import { t as e } from "./utils-B7XIe3qq.js";
import { t } from "./createLucideIcon-wKpAnzBe.js";
import { t as n } from "./check-CybgTpDT.js";
import { t as r } from "./chevron-right-DuHRAn8w.js";
import { n as i } from "./dist-CTlQcJNK.js";
import { a, o, t as s } from "./dist-koa_pEtu.js";
import { t as c } from "./dist-CpMqmV-i.js";
import { t as l } from "./dist-C0wG5dwG.js";
import { t as u } from "./dist-cMlzVrN6.js";
import { t as d } from "./dist-CVCn7F_m.js";
import { n as f, r as p, t as m } from "./dist-B1veE5DO.js";
import { _ as h, a as g, c as _, d as v, f as ee, g as te, h as ne, i as re, l as ie, m as ae, n as oe, o as se, p as ce, r as le, s as ue, t as de, u as fe } from "./dist-Dq1IoZXt.js";
import * as y from "react";
import { jsx as b, jsxs as x } from "react/jsx-runtime";
var pe = t("circle", [["circle", {
	cx: "12",
	cy: "12",
	r: "10",
	key: "1mglay"
}]]), S = "Menubar", [C, w, me] = u(S), [T, he] = a(S, [me, p]), E = h(), D = p(), [ge, O] = T(S), k = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, value: r, onValueChange: i, defaultValue: a, loop: o = !0, dir: c, ...u } = e, p = d(c), m = D(n), [h, g] = l({
		prop: r,
		onChange: i,
		defaultProp: a ?? "",
		caller: S
	}), [_, v] = y.useState(null);
	return /* @__PURE__ */ b(ge, {
		scope: n,
		value: h,
		onMenuOpen: y.useCallback((e) => {
			g(e), v(e);
		}, [g]),
		onMenuClose: y.useCallback(() => g(""), [g]),
		onMenuToggle: y.useCallback((e) => {
			g((t) => t ? "" : e), v(e);
		}, [g]),
		dir: p,
		loop: o,
		children: /* @__PURE__ */ b(C.Provider, {
			scope: n,
			children: /* @__PURE__ */ b(C.Slot, {
				scope: n,
				children: /* @__PURE__ */ b(f, {
					asChild: !0,
					...m,
					orientation: "horizontal",
					loop: o,
					dir: p,
					currentTabStopId: _,
					onCurrentTabStopIdChange: v,
					children: /* @__PURE__ */ b(s.div, {
						role: "menubar",
						...u,
						ref: t
					})
				})
			})
		})
	});
});
k.displayName = S;
var A = "MenubarMenu", [_e, j] = T(A), M = (e) => {
	let { __scopeMenubar: t, value: n, ...r } = e, i = c(), a = n || i || "LEGACY_REACT_AUTO_VALUE", o = O(A, t), s = E(t), l = y.useRef(null), u = y.useRef(!1), d = o.value === a;
	return y.useEffect(() => {
		d || (u.current = !1);
	}, [d]), /* @__PURE__ */ b(_e, {
		scope: t,
		value: a,
		triggerId: c(),
		triggerRef: l,
		contentId: c(),
		wasKeyboardTriggerOpenRef: u,
		children: /* @__PURE__ */ b(ee, {
			...s,
			open: d,
			onOpenChange: (e) => {
				e || o.onMenuClose();
			},
			modal: !1,
			dir: o.dir,
			...r
		})
	});
};
M.displayName = A;
var N = "MenubarTrigger", P = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, disabled: r = !1, ...a } = e, c = D(n), l = E(n), u = O(N, n), d = j(N, n), f = y.useRef(null), p = i(t, f, d.triggerRef), [h, g] = y.useState(!1), _ = u.value === d.value;
	return /* @__PURE__ */ b(C.ItemSlot, {
		scope: n,
		value: d.value,
		disabled: r,
		children: /* @__PURE__ */ b(m, {
			asChild: !0,
			...c,
			focusable: !r,
			tabStopId: d.value,
			children: /* @__PURE__ */ b(de, {
				asChild: !0,
				...l,
				children: /* @__PURE__ */ b(s.button, {
					type: "button",
					role: "menuitem",
					id: d.triggerId,
					"aria-haspopup": "menu",
					"aria-expanded": _,
					"aria-controls": _ ? d.contentId : void 0,
					"data-highlighted": h ? "" : void 0,
					"data-state": _ ? "open" : "closed",
					"data-disabled": r ? "" : void 0,
					disabled: r,
					...a,
					ref: p,
					onPointerDown: o(e.onPointerDown, (e) => {
						!r && e.button === 0 && e.ctrlKey === !1 && (u.onMenuOpen(d.value), _ || e.preventDefault());
					}),
					onPointerEnter: o(e.onPointerEnter, () => {
						u.value && !_ && (u.onMenuOpen(d.value), f.current?.focus());
					}),
					onKeyDown: o(e.onKeyDown, (e) => {
						r || (["Enter", " "].includes(e.key) && u.onMenuToggle(d.value), e.key === "ArrowDown" && u.onMenuOpen(d.value), [
							"Enter",
							" ",
							"ArrowDown"
						].includes(e.key) && (d.wasKeyboardTriggerOpenRef.current = !0, e.preventDefault()));
					}),
					onFocus: o(e.onFocus, () => g(!0)),
					onBlur: o(e.onBlur, () => g(!1))
				})
			})
		})
	});
});
P.displayName = N;
var F = "MenubarPortal", I = (e) => {
	let { __scopeMenubar: t, ...n } = e;
	return /* @__PURE__ */ b(ie, {
		...E(t),
		...n
	});
};
I.displayName = F;
var L = "MenubarContent", R = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, align: r = "start", ...i } = e, a = E(n), s = O(L, n), c = j(L, n), l = w(n), u = y.useRef(!1);
	return /* @__PURE__ */ b(re, {
		id: c.contentId,
		"aria-labelledby": c.triggerId,
		"data-radix-menubar-content": "",
		...a,
		...i,
		ref: t,
		align: r,
		onCloseAutoFocus: o(e.onCloseAutoFocus, (e) => {
			!s.value && !u.current && c.triggerRef.current?.focus(), u.current = !1, e.preventDefault();
		}),
		onFocusOutside: o(e.onFocusOutside, (e) => {
			let t = e.target;
			l().some((e) => e.ref.current?.contains(t)) && e.preventDefault();
		}),
		onInteractOutside: o(e.onInteractOutside, () => {
			u.current = !0;
		}),
		onEntryFocus: (e) => {
			c.wasKeyboardTriggerOpenRef.current || e.preventDefault();
		},
		onKeyDown: o(e.onKeyDown, (e) => {
			if (["ArrowRight", "ArrowLeft"].includes(e.key)) {
				let t = e.target, n = t.hasAttribute("data-radix-menubar-subtrigger"), r = t.closest("[data-radix-menubar-content]") !== e.currentTarget, i = (s.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === e.key;
				if (!i && n || r && i) return;
				let a = l().filter((e) => !e.disabled).map((e) => e.value);
				i && a.reverse();
				let o = a.indexOf(c.value);
				a = s.loop ? ke(a, o + 1) : a.slice(o + 1);
				let [u] = a;
				u && s.onMenuOpen(u);
			}
		}, { checkForDefaultPrevented: !1 }),
		style: {
			...e.style,
			"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
			"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
			"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
			"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
			"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
		}
	});
});
R.displayName = L;
var ve = "MenubarGroup", z = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(g, {
		...E(n),
		...r,
		ref: t
	});
});
z.displayName = ve;
var ye = "MenubarLabel", B = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(_, {
		...E(n),
		...r,
		ref: t
	});
});
B.displayName = ye;
var be = "MenubarItem", V = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(se, {
		...E(n),
		...r,
		ref: t
	});
});
V.displayName = be;
var xe = "MenubarCheckboxItem", H = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(le, {
		...E(n),
		...r,
		ref: t
	});
});
H.displayName = xe;
var Se = "MenubarRadioGroup", U = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(fe, {
		...E(n),
		...r,
		ref: t
	});
});
U.displayName = Se;
var Ce = "MenubarRadioItem", W = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(v, {
		...E(n),
		...r,
		ref: t
	});
});
W.displayName = Ce;
var we = "MenubarItemIndicator", G = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(ue, {
		...E(n),
		...r,
		ref: t
	});
});
G.displayName = we;
var Te = "MenubarSeparator", K = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(ce, {
		...E(n),
		...r,
		ref: t
	});
});
K.displayName = Te;
var q = "MenubarArrow", Ee = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(oe, {
		...E(n),
		...r,
		ref: t
	});
});
Ee.displayName = q;
var J = "MenubarSub", Y = (e) => {
	let { __scopeMenubar: t, children: n, open: r, onOpenChange: i, defaultOpen: a } = e, o = E(t), [s, c] = l({
		prop: r,
		defaultProp: a ?? !1,
		onChange: i,
		caller: J
	});
	return /* @__PURE__ */ b(ae, {
		...o,
		open: s,
		onOpenChange: c,
		children: n
	});
};
Y.displayName = J;
var De = "MenubarSubTrigger", X = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e, i = E(n);
	return /* @__PURE__ */ b(te, {
		"data-radix-menubar-subtrigger": "",
		...i,
		...r,
		ref: t
	});
});
X.displayName = De;
var Oe = "MenubarSubContent", Z = y.forwardRef((e, t) => {
	let { __scopeMenubar: n, ...r } = e;
	return /* @__PURE__ */ b(ne, {
		...E(n),
		"data-radix-menubar-content": "",
		...r,
		ref: t,
		style: {
			...e.style,
			"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
			"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
			"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
			"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
			"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
		}
	});
});
Z.displayName = Oe;
function ke(e, t) {
	return e.map((n, r) => e[(t + r) % e.length]);
}
var Ae = k, je = M, Me = P, Ne = I, Pe = R, Fe = z, Ie = B, Le = V, Re = H, ze = U, Be = W, Q = G, Ve = K, He = Y, Ue = X, We = Z;
//#endregion
//#region src/react/primitives/menubar.tsx
function Ge({ className: t, ...n }) {
	return /* @__PURE__ */ b(Ae, {
		"data-slot": "menubar",
		className: e("border-border-glass bg-background flex h-9 items-center gap-1 rounded-lg border px-1 shadow-sm backdrop-blur-xl", t),
		...n
	});
}
function Ke({ ...e }) {
	return /* @__PURE__ */ b(je, {
		"data-slot": "menubar-menu",
		...e
	});
}
function qe({ className: t, ...n }) {
	return /* @__PURE__ */ b(Me, {
		"data-slot": "menubar-trigger",
		className: e("text-foreground focus:bg-accent focus:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground flex items-center rounded-md px-3 py-1 text-sm font-medium outline-none select-none cursor-pointer", t),
		...n
	});
}
function $({ ...e }) {
	return /* @__PURE__ */ b(Ne, { ...e });
}
function Je({ className: t, align: n = "start", alignOffset: r = -4, sideOffset: i = 8, ...a }) {
	return /* @__PURE__ */ b($, { children: /* @__PURE__ */ b(Pe, {
		"data-slot": "menubar-content",
		align: n,
		alignOffset: r,
		sideOffset: i,
		className: e("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-[12rem] overflow-hidden rounded-xl border p-1 shadow-xl", "border-border-glass bg-popover backdrop-blur-xl", t),
		...a
	}) });
}
function Ye({ className: t, inset: n, ...r }) {
	return /* @__PURE__ */ b(Le, {
		"data-slot": "menubar-item",
		className: e("relative flex cursor-pointer items-center rounded-lg px-3 py-2 text-sm transition-colors outline-none select-none", "text-foreground hover:bg-accent focus:bg-accent", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", n && "pl-8", t),
		...r
	});
}
function Xe({ className: t, children: r, checked: i, ...a }) {
	return /* @__PURE__ */ x(Re, {
		"data-slot": "menubar-checkbox-item",
		className: e("relative flex cursor-pointer items-center rounded-lg py-2 pr-3 pl-8 text-sm transition-colors outline-none select-none", "text-foreground hover:bg-accent focus:bg-accent", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", t),
		checked: i ?? !1,
		...a,
		children: [/* @__PURE__ */ b("span", {
			className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center",
			children: /* @__PURE__ */ b(Q, { children: /* @__PURE__ */ b(n, { className: "size-4" }) })
		}), r]
	});
}
function Ze({ ...e }) {
	return /* @__PURE__ */ b(ze, {
		"data-slot": "menubar-radio-group",
		...e
	});
}
function Qe({ className: t, children: n, ...r }) {
	return /* @__PURE__ */ x(Be, {
		"data-slot": "menubar-radio-item",
		className: e("relative flex cursor-pointer items-center rounded-lg py-2 pr-3 pl-8 text-sm transition-colors outline-none select-none", "text-foreground hover:bg-accent focus:bg-accent", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", t),
		...r,
		children: [/* @__PURE__ */ b("span", {
			className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center",
			children: /* @__PURE__ */ b(Q, { children: /* @__PURE__ */ b(pe, { className: "size-2 fill-current" }) })
		}), n]
	});
}
function $e({ className: t, inset: n, ...r }) {
	return /* @__PURE__ */ b(Ie, {
		"data-slot": "menubar-label",
		className: e("text-foreground px-3 py-2 text-sm font-semibold", n && "pl-8", t),
		...r
	});
}
function et({ className: t, ...n }) {
	return /* @__PURE__ */ b(Ve, {
		"data-slot": "menubar-separator",
		className: e("bg-border-glass -mx-1 my-1 h-px", t),
		...n
	});
}
function tt({ className: t, ...n }) {
	return /* @__PURE__ */ b("span", {
		"data-slot": "menubar-shortcut",
		className: e("text-foreground-secondary ml-auto text-xs tracking-widest", t),
		...n
	});
}
function nt({ ...e }) {
	return /* @__PURE__ */ b(Fe, {
		"data-slot": "menubar-group",
		...e
	});
}
function rt({ ...e }) {
	return /* @__PURE__ */ b(He, {
		"data-slot": "menubar-sub",
		...e
	});
}
function it({ className: t, inset: n, children: i, ...a }) {
	return /* @__PURE__ */ x(Ue, {
		"data-slot": "menubar-sub-trigger",
		className: e("text-foreground focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer items-center rounded-lg px-3 py-2 text-sm outline-none select-none", n && "pl-8", t),
		...a,
		children: [i, /* @__PURE__ */ b(r, { className: "ml-auto size-4" })]
	});
}
function at({ className: t, ...n }) {
	return /* @__PURE__ */ b(We, {
		"data-slot": "menubar-sub-content",
		className: e("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-[12rem] overflow-hidden rounded-xl border p-1 shadow-xl", "border-border-glass bg-popover backdrop-blur-xl", t),
		...n
	});
}
//#endregion
export { Ye as a, $ as c, et as d, tt as f, qe as g, it as h, nt as i, Ze as l, at as m, Xe as n, $e as o, rt as p, Je as r, Ke as s, Ge as t, Qe as u };

//# sourceMappingURL=menubar-CZie7LCj.js.map