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