import * as o from "react";
import { composeEventHandlers as v } from "../../../../../@radix-ui_primitive@1.1.0/node_modules/@radix-ui/primitive/dist/index.js";
import { createCollection as ze } from "../../../../../@radix-ui_react-collection@1.1.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types_re_068c4d9b06eb1baa6b6ecff66d582472/node_modules/@radix-ui/react-collection/dist/index.js";
import { useComposedRefs as D, composeRefs as Ze } from "../../../../../@radix-ui_react-compose-refs@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-compose-refs/dist/index.js";
import { createContextScope as $e } from "../../../../../@radix-ui_react-context@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-context/dist/index.js";
import { useDirection as qe } from "../../../../../@radix-ui_react-direction@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-direction/dist/index.js";
import { DismissableLayer as Je } from "../../../../../@radix-ui_react-dismissable-layer@1.1.0_@types_react-dom@18.3.6_@types_react@18.3.3__@t_540819d22b5f34e77f512765c1a78ce5/node_modules/@radix-ui/react-dismissable-layer/dist/index.js";
import { useFocusGuards as Qe } from "../../../../../@radix-ui_react-focus-guards@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-focus-guards/dist/index.js";
import { FocusScope as et } from "../../../../../@radix-ui_react-focus-scope@1.1.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types_r_c5413b53d4356de1cc2ff1163dee68dc/node_modules/@radix-ui/react-focus-scope/dist/index.js";
import { useId as de } from "../../../../../@radix-ui_react-id@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-id/dist/index.js";
import { createPopperScope as pe, Root as me, Anchor as tt, Content as nt, Arrow as ot } from "../../../../../@radix-ui_react-popper@1.2.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types_react@_0c236d22233b5684ecf8a3d8d1b24562/node_modules/@radix-ui/react-popper/dist/index.js";
import { Portal as rt } from "../../../../../@radix-ui_react-portal@1.1.1_@types_react-dom@18.3.6_@types_react@18.3.3__@types_react@_d91fd04d10d265136bf0d35a7b9375b2/node_modules/@radix-ui/react-portal/dist/index.js";
import { Presence as Y } from "../../../../../@radix-ui_react-presence@1.1.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types_reac_4a916339a724b4591202705df11dd5fc/node_modules/@radix-ui/react-presence/dist/index.js";
import { Primitive as k, dispatchDiscreteCustomEvent as ct } from "../../../../../@radix-ui_react-primitive@2.0.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types_rea_bdcf182289a3a76356f07e550726e479/node_modules/@radix-ui/react-primitive/dist/index.js";
import { createRovingFocusGroupScope as he, Item as st, Root as at } from "../../../../../@radix-ui_react-roving-focus@1.1.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types__089b118f90c2a8e34e48dd885dbeaf66/node_modules/@radix-ui/react-roving-focus/dist/index.js";
import { Slot as ut } from "../../../../../@radix-ui_react-slot@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-slot/dist/index.js";
import { useCallbackRef as q } from "../../../../../@radix-ui_react-use-callback-ref@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-use-callback-ref/dist/index.js";
import { hideOthers as it } from "../../../../../aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js";
import lt from "../../../../../react-remove-scroll@2.5.7_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/react-remove-scroll/dist/es2015/Combination.js";
import { j as a } from "../../../../../../../_virtual/jsx-runtime.js";
var $ = ["Enter", " "], dt = ["ArrowDown", "PageUp", "Home"], Me = ["ArrowUp", "PageDown", "End"], ft = [...dt, ...Me], pt = {
  ltr: [...$, "ArrowRight"],
  rtl: [...$, "ArrowLeft"]
}, mt = {
  ltr: ["ArrowLeft"],
  rtl: ["ArrowRight"]
}, N = "Menu", [O, ht, Mt] = ze(N), [S, nn] = $e(N, [
  Mt,
  pe,
  he
]), F = pe(), ve = he(), [Ce, _] = S(N), [vt, L] = S(N), ge = (e) => {
  const { __scopeMenu: n, open: t = !1, children: c, dir: u, onOpenChange: r, modal: l = !0 } = e, f = F(n), [p, m] = o.useState(null), d = o.useRef(!1), s = q(r), h = qe(u);
  return o.useEffect(() => {
    const x = () => {
      d.current = !0, document.addEventListener("pointerdown", M, { capture: !0, once: !0 }), document.addEventListener("pointermove", M, { capture: !0, once: !0 });
    }, M = () => d.current = !1;
    return document.addEventListener("keydown", x, { capture: !0 }), () => {
      document.removeEventListener("keydown", x, { capture: !0 }), document.removeEventListener("pointerdown", M, { capture: !0 }), document.removeEventListener("pointermove", M, { capture: !0 });
    };
  }, []), /* @__PURE__ */ a.jsx(me, { ...f, children: /* @__PURE__ */ a.jsx(
    Ce,
    {
      scope: n,
      open: t,
      onOpenChange: s,
      content: p,
      onContentChange: m,
      children: /* @__PURE__ */ a.jsx(
        vt,
        {
          scope: n,
          onClose: o.useCallback(() => s(!1), [s]),
          isUsingKeyboardRef: d,
          dir: h,
          modal: l,
          children: c
        }
      )
    }
  ) });
};
ge.displayName = N;
var Ct = "MenuAnchor", J = o.forwardRef(
  (e, n) => {
    const { __scopeMenu: t, ...c } = e, u = F(t);
    return /* @__PURE__ */ a.jsx(tt, { ...u, ...c, ref: n });
  }
);
J.displayName = Ct;
var Q = "MenuPortal", [gt, xe] = S(Q, {
  forceMount: void 0
}), _e = (e) => {
  const { __scopeMenu: n, forceMount: t, children: c, container: u } = e, r = _(Q, n);
  return /* @__PURE__ */ a.jsx(gt, { scope: n, forceMount: t, children: /* @__PURE__ */ a.jsx(Y, { present: t || r.open, children: /* @__PURE__ */ a.jsx(rt, { asChild: !0, container: u, children: c }) }) });
};
_e.displayName = Q;
var g = "MenuContent", [xt, ee] = S(g), Re = o.forwardRef(
  (e, n) => {
    const t = xe(g, e.__scopeMenu), { forceMount: c = t.forceMount, ...u } = e, r = _(g, e.__scopeMenu), l = L(g, e.__scopeMenu);
    return /* @__PURE__ */ a.jsx(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(Y, { present: c || r.open, children: /* @__PURE__ */ a.jsx(O.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ a.jsx(_t, { ...u, ref: n }) : /* @__PURE__ */ a.jsx(Rt, { ...u, ref: n }) }) }) });
  }
), _t = o.forwardRef(
  (e, n) => {
    const t = _(g, e.__scopeMenu), c = o.useRef(null), u = D(n, c);
    return o.useEffect(() => {
      const r = c.current;
      if (r) return it(r);
    }, []), /* @__PURE__ */ a.jsx(
      te,
      {
        ...e,
        ref: u,
        trapFocus: t.open,
        disableOutsidePointerEvents: t.open,
        disableOutsideScroll: !0,
        onFocusOutside: v(
          e.onFocusOutside,
          (r) => r.preventDefault(),
          { checkForDefaultPrevented: !1 }
        ),
        onDismiss: () => t.onOpenChange(!1)
      }
    );
  }
), Rt = o.forwardRef((e, n) => {
  const t = _(g, e.__scopeMenu);
  return /* @__PURE__ */ a.jsx(
    te,
    {
      ...e,
      ref: n,
      trapFocus: !1,
      disableOutsidePointerEvents: !1,
      disableOutsideScroll: !1,
      onDismiss: () => t.onOpenChange(!1)
    }
  );
}), te = o.forwardRef(
  (e, n) => {
    const {
      __scopeMenu: t,
      loop: c = !1,
      trapFocus: u,
      onOpenAutoFocus: r,
      onCloseAutoFocus: l,
      disableOutsidePointerEvents: f,
      onEntryFocus: p,
      onEscapeKeyDown: m,
      onPointerDownOutside: d,
      onFocusOutside: s,
      onInteractOutside: h,
      onDismiss: x,
      disableOutsideScroll: M,
      ...P
    } = e, y = _(g, t), E = L(g, t), Ge = F(t), Ue = ve(t), se = ht(t), [Be, ae] = o.useState(null), K = o.useRef(null), Ve = D(n, K, y.onContentChange), G = o.useRef(0), U = o.useRef(""), Ye = o.useRef(0), H = o.useRef(null), ue = o.useRef("right"), W = o.useRef(0), Xe = M ? lt : o.Fragment, He = M ? { as: ut, allowPinchZoom: !0 } : void 0, We = (i) => {
      const I = U.current + i, R = se().filter((C) => !C.disabled), b = document.activeElement, z = R.find((C) => C.ref.current === b)?.textValue, Z = R.map((C) => C.textValue), ie = Dt(Z, I, z), T = R.find((C) => C.textValue === ie)?.ref.current;
      (function C(le) {
        U.current = le, window.clearTimeout(G.current), le !== "" && (G.current = window.setTimeout(() => C(""), 1e3));
      })(I), T && setTimeout(() => T.focus());
    };
    o.useEffect(() => () => window.clearTimeout(G.current), []), Qe();
    const w = o.useCallback((i) => ue.current === H.current?.side && Nt(i, H.current?.area), []);
    return /* @__PURE__ */ a.jsx(
      xt,
      {
        scope: t,
        searchRef: U,
        onItemEnter: o.useCallback(
          (i) => {
            w(i) && i.preventDefault();
          },
          [w]
        ),
        onItemLeave: o.useCallback(
          (i) => {
            w(i) || (K.current?.focus(), ae(null));
          },
          [w]
        ),
        onTriggerLeave: o.useCallback(
          (i) => {
            w(i) && i.preventDefault();
          },
          [w]
        ),
        pointerGraceTimerRef: Ye,
        onPointerGraceIntentChange: o.useCallback((i) => {
          H.current = i;
        }, []),
        children: /* @__PURE__ */ a.jsx(Xe, { ...He, children: /* @__PURE__ */ a.jsx(
          et,
          {
            asChild: !0,
            trapped: u,
            onMountAutoFocus: v(r, (i) => {
              i.preventDefault(), K.current?.focus({ preventScroll: !0 });
            }),
            onUnmountAutoFocus: l,
            children: /* @__PURE__ */ a.jsx(
              Je,
              {
                asChild: !0,
                disableOutsidePointerEvents: f,
                onEscapeKeyDown: m,
                onPointerDownOutside: d,
                onFocusOutside: s,
                onInteractOutside: h,
                onDismiss: x,
                children: /* @__PURE__ */ a.jsx(
                  at,
                  {
                    asChild: !0,
                    ...Ue,
                    dir: E.dir,
                    orientation: "vertical",
                    loop: c,
                    currentTabStopId: Be,
                    onCurrentTabStopIdChange: ae,
                    onEntryFocus: v(p, (i) => {
                      E.isUsingKeyboardRef.current || i.preventDefault();
                    }),
                    preventScrollOnEntryFocus: !0,
                    children: /* @__PURE__ */ a.jsx(
                      nt,
                      {
                        role: "menu",
                        "aria-orientation": "vertical",
                        "data-state": Ke(y.open),
                        "data-radix-menu-content": "",
                        dir: E.dir,
                        ...Ge,
                        ...P,
                        ref: Ve,
                        style: { outline: "none", ...P.style },
                        onKeyDown: v(P.onKeyDown, (i) => {
                          const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, b = i.ctrlKey || i.altKey || i.metaKey, z = i.key.length === 1;
                          R && (i.key === "Tab" && i.preventDefault(), !b && z && We(i.key));
                          const Z = K.current;
                          if (i.target !== Z || !ft.includes(i.key)) return;
                          i.preventDefault();
                          const T = se().filter((C) => !C.disabled).map((C) => C.ref.current);
                          Me.includes(i.key) && T.reverse(), Ot(T);
                        }),
                        onBlur: v(e.onBlur, (i) => {
                          i.currentTarget.contains(i.target) || (window.clearTimeout(G.current), U.current = "");
                        }),
                        onPointerMove: v(
                          e.onPointerMove,
                          j((i) => {
                            const I = i.target, R = W.current !== i.clientX;
                            if (i.currentTarget.contains(I) && R) {
                              const b = i.clientX > W.current ? "right" : "left";
                              ue.current = b, W.current = i.clientX;
                            }
                          })
                        )
                      }
                    )
                  }
                )
              }
            )
          }
        ) })
      }
    );
  }
);
Re.displayName = g;
var St = "MenuGroup", ne = o.forwardRef(
  (e, n) => {
    const { __scopeMenu: t, ...c } = e;
    return /* @__PURE__ */ a.jsx(k.div, { role: "group", ...c, ref: n });
  }
);
ne.displayName = St;
var Pt = "MenuLabel", Se = o.forwardRef(
  (e, n) => {
    const { __scopeMenu: t, ...c } = e;
    return /* @__PURE__ */ a.jsx(k.div, { ...c, ref: n });
  }
);
Se.displayName = Pt;
var B = "MenuItem", fe = "menu.itemSelect", X = o.forwardRef(
  (e, n) => {
    const { disabled: t = !1, onSelect: c, ...u } = e, r = o.useRef(null), l = L(B, e.__scopeMenu), f = ee(B, e.__scopeMenu), p = D(n, r), m = o.useRef(!1), d = () => {
      const s = r.current;
      if (!t && s) {
        const h = new CustomEvent(fe, { bubbles: !0, cancelable: !0 });
        s.addEventListener(fe, (x) => c?.(x), { once: !0 }), ct(s, h), h.defaultPrevented ? m.current = !1 : l.onClose();
      }
    };
    return /* @__PURE__ */ a.jsx(
      Pe,
      {
        ...u,
        ref: p,
        disabled: t,
        onClick: v(e.onClick, d),
        onPointerDown: (s) => {
          e.onPointerDown?.(s), m.current = !0;
        },
        onPointerUp: v(e.onPointerUp, (s) => {
          m.current || s.currentTarget?.click();
        }),
        onKeyDown: v(e.onKeyDown, (s) => {
          const h = f.searchRef.current !== "";
          t || h && s.key === " " || $.includes(s.key) && (s.currentTarget.click(), s.preventDefault());
        })
      }
    );
  }
);
X.displayName = B;
var Pe = o.forwardRef(
  (e, n) => {
    const { __scopeMenu: t, disabled: c = !1, textValue: u, ...r } = e, l = ee(B, t), f = ve(t), p = o.useRef(null), m = D(n, p), [d, s] = o.useState(!1), [h, x] = o.useState("");
    return o.useEffect(() => {
      const M = p.current;
      M && x((M.textContent ?? "").trim());
    }, [r.children]), /* @__PURE__ */ a.jsx(
      O.ItemSlot,
      {
        scope: t,
        disabled: c,
        textValue: u ?? h,
        children: /* @__PURE__ */ a.jsx(st, { asChild: !0, ...f, focusable: !c, children: /* @__PURE__ */ a.jsx(
          k.div,
          {
            role: "menuitem",
            "data-highlighted": d ? "" : void 0,
            "aria-disabled": c || void 0,
            "data-disabled": c ? "" : void 0,
            ...r,
            ref: m,
            onPointerMove: v(
              e.onPointerMove,
              j((M) => {
                c ? l.onItemLeave(M) : (l.onItemEnter(M), M.defaultPrevented || M.currentTarget.focus({ preventScroll: !0 }));
              })
            ),
            onPointerLeave: v(
              e.onPointerLeave,
              j((M) => l.onItemLeave(M))
            ),
            onFocus: v(e.onFocus, () => s(!0)),
            onBlur: v(e.onBlur, () => s(!1))
          }
        ) })
      }
    );
  }
), Et = "MenuCheckboxItem", Ee = o.forwardRef(
  (e, n) => {
    const { checked: t = !1, onCheckedChange: c, ...u } = e;
    return /* @__PURE__ */ a.jsx(Te, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ a.jsx(
      X,
      {
        role: "menuitemcheckbox",
        "aria-checked": V(t) ? "mixed" : t,
        ...u,
        ref: n,
        "data-state": ce(t),
        onSelect: v(
          u.onSelect,
          () => c?.(V(t) ? !0 : !t),
          { checkForDefaultPrevented: !1 }
        )
      }
    ) });
  }
);
Ee.displayName = Et;
var we = "MenuRadioGroup", [wt, It] = S(
  we,
  { value: void 0, onValueChange: () => {
  } }
), Ie = o.forwardRef(
  (e, n) => {
    const { value: t, onValueChange: c, ...u } = e, r = q(c);
    return /* @__PURE__ */ a.jsx(wt, { scope: e.__scopeMenu, value: t, onValueChange: r, children: /* @__PURE__ */ a.jsx(ne, { ...u, ref: n }) });
  }
);
Ie.displayName = we;
var ye = "MenuRadioItem", be = o.forwardRef(
  (e, n) => {
    const { value: t, ...c } = e, u = It(ye, e.__scopeMenu), r = t === u.value;
    return /* @__PURE__ */ a.jsx(Te, { scope: e.__scopeMenu, checked: r, children: /* @__PURE__ */ a.jsx(
      X,
      {
        role: "menuitemradio",
        "aria-checked": r,
        ...c,
        ref: n,
        "data-state": ce(r),
        onSelect: v(
          c.onSelect,
          () => u.onValueChange?.(t),
          { checkForDefaultPrevented: !1 }
        )
      }
    ) });
  }
);
be.displayName = ye;
var oe = "MenuItemIndicator", [Te, yt] = S(
  oe,
  { checked: !1 }
), Ae = o.forwardRef(
  (e, n) => {
    const { __scopeMenu: t, forceMount: c, ...u } = e, r = yt(oe, t);
    return /* @__PURE__ */ a.jsx(
      Y,
      {
        present: c || V(r.checked) || r.checked === !0,
        children: /* @__PURE__ */ a.jsx(
          k.span,
          {
            ...u,
            ref: n,
            "data-state": ce(r.checked)
          }
        )
      }
    );
  }
);
Ae.displayName = oe;
var bt = "MenuSeparator", Oe = o.forwardRef(
  (e, n) => {
    const { __scopeMenu: t, ...c } = e;
    return /* @__PURE__ */ a.jsx(
      k.div,
      {
        role: "separator",
        "aria-orientation": "horizontal",
        ...c,
        ref: n
      }
    );
  }
);
Oe.displayName = bt;
var Tt = "MenuArrow", je = o.forwardRef(
  (e, n) => {
    const { __scopeMenu: t, ...c } = e, u = F(t);
    return /* @__PURE__ */ a.jsx(ot, { ...u, ...c, ref: n });
  }
);
je.displayName = Tt;
var re = "MenuSub", [At, De] = S(re), ke = (e) => {
  const { __scopeMenu: n, children: t, open: c = !1, onOpenChange: u } = e, r = _(re, n), l = F(n), [f, p] = o.useState(null), [m, d] = o.useState(null), s = q(u);
  return o.useEffect(() => (r.open === !1 && s(!1), () => s(!1)), [r.open, s]), /* @__PURE__ */ a.jsx(me, { ...l, children: /* @__PURE__ */ a.jsx(
    Ce,
    {
      scope: n,
      open: c,
      onOpenChange: s,
      content: m,
      onContentChange: d,
      children: /* @__PURE__ */ a.jsx(
        At,
        {
          scope: n,
          contentId: de(),
          triggerId: de(),
          trigger: f,
          onTriggerChange: p,
          children: t
        }
      )
    }
  ) });
};
ke.displayName = re;
var A = "MenuSubTrigger", Ne = o.forwardRef(
  (e, n) => {
    const t = _(A, e.__scopeMenu), c = L(A, e.__scopeMenu), u = De(A, e.__scopeMenu), r = ee(A, e.__scopeMenu), l = o.useRef(null), { pointerGraceTimerRef: f, onPointerGraceIntentChange: p } = r, m = { __scopeMenu: e.__scopeMenu }, d = o.useCallback(() => {
      l.current && window.clearTimeout(l.current), l.current = null;
    }, []);
    return o.useEffect(() => d, [d]), o.useEffect(() => {
      const s = f.current;
      return () => {
        window.clearTimeout(s), p(null);
      };
    }, [f, p]), /* @__PURE__ */ a.jsx(J, { asChild: !0, ...m, children: /* @__PURE__ */ a.jsx(
      Pe,
      {
        id: u.triggerId,
        "aria-haspopup": "menu",
        "aria-expanded": t.open,
        "aria-controls": u.contentId,
        "data-state": Ke(t.open),
        ...e,
        ref: Ze(n, u.onTriggerChange),
        onClick: (s) => {
          e.onClick?.(s), !(e.disabled || s.defaultPrevented) && (s.currentTarget.focus(), t.open || t.onOpenChange(!0));
        },
        onPointerMove: v(
          e.onPointerMove,
          j((s) => {
            r.onItemEnter(s), !s.defaultPrevented && !e.disabled && !t.open && !l.current && (r.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
              t.onOpenChange(!0), d();
            }, 100));
          })
        ),
        onPointerLeave: v(
          e.onPointerLeave,
          j((s) => {
            d();
            const h = t.content?.getBoundingClientRect();
            if (h) {
              const x = t.content?.dataset.side, M = x === "right", P = M ? -5 : 5, y = h[M ? "left" : "right"], E = h[M ? "right" : "left"];
              r.onPointerGraceIntentChange({
                area: [
                  // Apply a bleed on clientX to ensure that our exit point is
                  // consistently within polygon bounds
                  { x: s.clientX + P, y: s.clientY },
                  { x: y, y: h.top },
                  { x: E, y: h.top },
                  { x: E, y: h.bottom },
                  { x: y, y: h.bottom }
                ],
                side: x
              }), window.clearTimeout(f.current), f.current = window.setTimeout(
                () => r.onPointerGraceIntentChange(null),
                300
              );
            } else {
              if (r.onTriggerLeave(s), s.defaultPrevented) return;
              r.onPointerGraceIntentChange(null);
            }
          })
        ),
        onKeyDown: v(e.onKeyDown, (s) => {
          const h = r.searchRef.current !== "";
          e.disabled || h && s.key === " " || pt[c.dir].includes(s.key) && (t.onOpenChange(!0), t.content?.focus(), s.preventDefault());
        })
      }
    ) });
  }
);
Ne.displayName = A;
var Fe = "MenuSubContent", Le = o.forwardRef(
  (e, n) => {
    const t = xe(g, e.__scopeMenu), { forceMount: c = t.forceMount, ...u } = e, r = _(g, e.__scopeMenu), l = L(g, e.__scopeMenu), f = De(Fe, e.__scopeMenu), p = o.useRef(null), m = D(n, p);
    return /* @__PURE__ */ a.jsx(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(Y, { present: c || r.open, children: /* @__PURE__ */ a.jsx(O.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(
      te,
      {
        id: f.contentId,
        "aria-labelledby": f.triggerId,
        ...u,
        ref: m,
        align: "start",
        side: l.dir === "rtl" ? "left" : "right",
        disableOutsidePointerEvents: !1,
        disableOutsideScroll: !1,
        trapFocus: !1,
        onOpenAutoFocus: (d) => {
          l.isUsingKeyboardRef.current && p.current?.focus(), d.preventDefault();
        },
        onCloseAutoFocus: (d) => d.preventDefault(),
        onFocusOutside: v(e.onFocusOutside, (d) => {
          d.target !== f.trigger && r.onOpenChange(!1);
        }),
        onEscapeKeyDown: v(e.onEscapeKeyDown, (d) => {
          l.onClose(), d.preventDefault();
        }),
        onKeyDown: v(e.onKeyDown, (d) => {
          const s = d.currentTarget.contains(d.target), h = mt[l.dir].includes(d.key);
          s && h && (r.onOpenChange(!1), f.trigger?.focus(), d.preventDefault());
        })
      }
    ) }) }) });
  }
);
Le.displayName = Fe;
function Ke(e) {
  return e ? "open" : "closed";
}
function V(e) {
  return e === "indeterminate";
}
function ce(e) {
  return V(e) ? "indeterminate" : e ? "checked" : "unchecked";
}
function Ot(e) {
  const n = document.activeElement;
  for (const t of e)
    if (t === n || (t.focus(), document.activeElement !== n)) return;
}
function jt(e, n) {
  return e.map((t, c) => e[(n + c) % e.length]);
}
function Dt(e, n, t) {
  const u = n.length > 1 && Array.from(n).every((m) => m === n[0]) ? n[0] : n, r = t ? e.indexOf(t) : -1;
  let l = jt(e, Math.max(r, 0));
  u.length === 1 && (l = l.filter((m) => m !== t));
  const p = l.find(
    (m) => m.toLowerCase().startsWith(u.toLowerCase())
  );
  return p !== t ? p : void 0;
}
function kt(e, n) {
  const { x: t, y: c } = e;
  let u = !1;
  for (let r = 0, l = n.length - 1; r < n.length; l = r++) {
    const f = n[r].x, p = n[r].y, m = n[l].x, d = n[l].y;
    p > c != d > c && t < (m - f) * (c - p) / (d - p) + f && (u = !u);
  }
  return u;
}
function Nt(e, n) {
  if (!n) return !1;
  const t = { x: e.clientX, y: e.clientY };
  return kt(t, n);
}
function j(e) {
  return (n) => n.pointerType === "mouse" ? e(n) : void 0;
}
var on = ge, rn = J, cn = _e, sn = Re, an = ne, un = Se, ln = X, dn = Ee, fn = Ie, pn = be, mn = Ae, hn = Oe, Mn = je, vn = ke, Cn = Ne, gn = Le;
export {
  rn as Anchor,
  Mn as Arrow,
  dn as CheckboxItem,
  sn as Content,
  an as Group,
  ln as Item,
  mn as ItemIndicator,
  un as Label,
  ge as Menu,
  J as MenuAnchor,
  je as MenuArrow,
  Ee as MenuCheckboxItem,
  Re as MenuContent,
  ne as MenuGroup,
  X as MenuItem,
  Ae as MenuItemIndicator,
  Se as MenuLabel,
  _e as MenuPortal,
  Ie as MenuRadioGroup,
  be as MenuRadioItem,
  Oe as MenuSeparator,
  ke as MenuSub,
  Le as MenuSubContent,
  Ne as MenuSubTrigger,
  cn as Portal,
  fn as RadioGroup,
  pn as RadioItem,
  on as Root,
  hn as Separator,
  vn as Sub,
  gn as SubContent,
  Cn as SubTrigger,
  nn as createMenuScope
};
//# sourceMappingURL=index.js.map
