import { h as e } from "./chunk.BlbRoQQ3.js";
import { ac as t, ae as n, ag as r, ai as i, aj as a, am as o, ap as s, aq as c } from "./system.DbMQd1I1.js";
import { b as l } from "./jsx-runtime.DF4K5VCp.js";
import { b as u, c as d } from "./theme.HtT_2QlC.js";
import { A as f, B as p, D as m, E as h, F as ee, b as te, c as ne, d as g, e as re, f as _, l as ie, m as ae, n as oe, o as se, p as ce, q as le, r as ue, s as de, t as fe, u as pe, v as me, w as v, x as he, y as ge, z as _e } from "./base-menu.props.BWy5Ub-q.js";
import { d as y } from "./text.CvSXsyI-.js";
import * as b from "react";
var x = /* @__PURE__ */ e(l(), 1), S = "DropdownMenu", [ve, ye] = i(S, [p]), C = p(), [be, w] = ve(S), T = (e) => {
	let { __scopeDropdownMenu: r, children: i, dir: a, open: o, defaultOpen: s, onOpenChange: c, modal: l = !0 } = e, u = C(r), d = b.useRef(null), [f = !1, p] = t({
		prop: o,
		defaultProp: s,
		onChange: c
	});
	return /* @__PURE__ */ (0, x.jsx)(be, {
		scope: r,
		triggerId: n(),
		triggerRef: d,
		contentId: n(),
		open: f,
		onOpenChange: p,
		onOpenToggle: b.useCallback(() => p((e) => !e), [p]),
		modal: l,
		children: /* @__PURE__ */ (0, x.jsx)(v, {
			...u,
			open: f,
			onOpenChange: p,
			dir: a,
			modal: l,
			children: i
		})
	});
};
T.displayName = S;
var E = "DropdownMenuTrigger", D = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n, disabled: i = !1,...a } = e, s = w(E, n), l = C(n);
	return /* @__PURE__ */ (0, x.jsx)(ie, {
		asChild: !0,
		...l,
		children: /* @__PURE__ */ (0, x.jsx)(o.button, {
			type: "button",
			id: s.triggerId,
			"aria-haspopup": "menu",
			"aria-expanded": s.open,
			"aria-controls": s.open ? s.contentId : void 0,
			"data-state": s.open ? "open" : "closed",
			"data-disabled": i ? "" : void 0,
			disabled: i,
			...a,
			ref: c(t, s.triggerRef),
			onPointerDown: r(e.onPointerDown, (e) => {
				!i && e.button === 0 && e.ctrlKey === !1 && (s.onOpenToggle(), s.open || e.preventDefault());
			}),
			onKeyDown: r(e.onKeyDown, (e) => {
				i || (["Enter", " "].includes(e.key) && s.onOpenToggle(), e.key === "ArrowDown" && s.onOpenChange(!0), [
					"Enter",
					" ",
					"ArrowDown"
				].includes(e.key) && e.preventDefault());
			})
		})
	});
});
D.displayName = E;
var xe = "DropdownMenuPortal", O = (e) => {
	let { __scopeDropdownMenu: t,...n } = e, r = C(t);
	return /* @__PURE__ */ (0, x.jsx)(fe, {
		...r,
		...n
	});
};
O.displayName = xe;
var k = "DropdownMenuContent", A = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...i } = e, a = w(k, n), o = C(n), s = b.useRef(!1);
	return /* @__PURE__ */ (0, x.jsx)(se, {
		id: a.contentId,
		"aria-labelledby": a.triggerId,
		...o,
		...i,
		ref: t,
		onCloseAutoFocus: r(e.onCloseAutoFocus, (e) => {
			s.current || a.triggerRef.current?.focus(), s.current = !1, e.preventDefault();
		}),
		onInteractOutside: r(e.onInteractOutside, (e) => {
			let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0, r = t.button === 2 || n;
			(!a.modal || r) && (s.current = !0);
		}),
		style: {
			...e.style,
			"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
			"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
			"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
			"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
			"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
		}
	});
});
A.displayName = k;
var Se = "DropdownMenuGroup", j = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(ce, {
		...i,
		...r,
		ref: t
	});
});
j.displayName = Se;
var Ce = "DropdownMenuLabel", M = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(de, {
		...i,
		...r,
		ref: t
	});
});
M.displayName = Ce;
var we = "DropdownMenuItem", N = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(le, {
		...i,
		...r,
		ref: t
	});
});
N.displayName = we;
var Te = "DropdownMenuCheckboxItem", P = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(oe, {
		...i,
		...r,
		ref: t
	});
});
P.displayName = Te;
var Ee = "DropdownMenuRadioGroup", F = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(pe, {
		...i,
		...r,
		ref: t
	});
});
F.displayName = Ee;
var De = "DropdownMenuRadioItem", I = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(me, {
		...i,
		...r,
		ref: t
	});
});
I.displayName = De;
var Oe = "DropdownMenuItemIndicator", L = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(ue, {
		...i,
		...r,
		ref: t
	});
});
L.displayName = Oe;
var ke = "DropdownMenuSeparator", R = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(he, {
		...i,
		...r,
		ref: t
	});
});
R.displayName = ke;
var Ae = "DropdownMenuArrow", je = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(ae, {
		...i,
		...r,
		ref: t
	});
});
je.displayName = Ae;
var Me = (e) => {
	let { __scopeDropdownMenu: n, children: r, open: i, onOpenChange: a, defaultOpen: o } = e, s = C(n), [c = !1, l] = t({
		prop: i,
		defaultProp: o,
		onChange: a
	});
	return /* @__PURE__ */ (0, x.jsx)(ge, {
		...s,
		open: c,
		onOpenChange: l,
		children: r
	});
}, Ne = "DropdownMenuSubTrigger", z = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(f, {
		...i,
		...r,
		ref: t
	});
});
z.displayName = Ne;
var Pe = "DropdownMenuSubContent", B = b.forwardRef((e, t) => {
	let { __scopeDropdownMenu: n,...r } = e, i = C(n);
	return /* @__PURE__ */ (0, x.jsx)(_e, {
		...i,
		...r,
		ref: t,
		style: {
			...e.style,
			"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
			"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
			"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
			"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
			"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
		}
	});
});
B.displayName = Pe;
var V = T, Fe = D, H = O, Ie = A, Le = j, Re = M, ze = N, Be = P, Ve = F, He = I, U = L, Ue = R, We = Me, Ge = z, Ke = B, W = /* @__PURE__ */ e(a());
const G = (e) => b.createElement(V, { ...e });
G.displayName = "DropdownMenu.Root";
const K = b.forwardRef(({ children: e,...t }, n) => b.createElement(Fe, {
	...t,
	ref: n,
	asChild: !0
}, ee(e)));
K.displayName = "DropdownMenu.Trigger";
const q = b.createContext({}), J = b.forwardRef((e, t) => {
	let n = u(), { size: r = g.size.default, variant: i = g.variant.default, highContrast: a = g.highContrast.default } = e, { className: o, children: s, color: c, container: l, forceMount: f,...p } = y(e, g), m = c || n.accentColor;
	return b.createElement(H, {
		container: l,
		forceMount: f
	}, b.createElement(d, { asChild: !0 }, b.createElement(Ie, {
		"data-accent-color": m,
		align: "start",
		sideOffset: 4,
		collisionPadding: 10,
		...p,
		asChild: !1,
		ref: t,
		className: (0, W.default)("rt-PopperContent", "rt-BaseMenuContent", "rt-DropdownMenuContent", o)
	}, b.createElement(_, { type: "auto" }, b.createElement("div", { className: (0, W.default)("rt-BaseMenuViewport", "rt-DropdownMenuViewport") }, b.createElement(q.Provider, { value: b.useMemo(() => ({
		size: r,
		variant: i,
		color: m,
		highContrast: a
	}), [
		r,
		i,
		m,
		a
	]) }, s))))));
});
J.displayName = "DropdownMenu.Content";
const Y = b.forwardRef(({ className: e,...t }, n) => b.createElement(Re, {
	...t,
	asChild: !1,
	ref: n,
	className: (0, W.default)("rt-BaseMenuLabel", "rt-DropdownMenuLabel", e)
}));
Y.displayName = "DropdownMenu.Label";
const X = b.forwardRef((e, t) => {
	let { className: n, children: r, color: i = te.color.default, shortcut: a,...o } = e;
	return b.createElement(ze, {
		"data-accent-color": i,
		...o,
		ref: t,
		className: (0, W.default)("rt-reset", "rt-BaseMenuItem", "rt-DropdownMenuItem", n)
	}, b.createElement(s, null, r), a && b.createElement("div", { className: "rt-BaseMenuShortcut rt-DropdownMenuShortcut" }, a));
});
X.displayName = "DropdownMenu.Item";
const Z = b.forwardRef(({ className: e,...t }, n) => b.createElement(Le, {
	...t,
	asChild: !1,
	ref: n,
	className: (0, W.default)("rt-BaseMenuGroup", "rt-DropdownMenuGroup", e)
}));
Z.displayName = "DropdownMenu.Group";
const qe = b.forwardRef(({ className: e,...t }, n) => b.createElement(Ve, {
	...t,
	asChild: !1,
	ref: n,
	className: (0, W.default)("rt-BaseMenuRadioGroup", "rt-DropdownMenuRadioGroup", e)
}));
qe.displayName = "DropdownMenu.RadioGroup";
const Je = b.forwardRef((e, t) => {
	let { children: n, className: r, color: i = re.color.default,...a } = e;
	return b.createElement(He, {
		...a,
		asChild: !1,
		ref: t,
		"data-accent-color": i,
		className: (0, W.default)("rt-BaseMenuItem", "rt-BaseMenuRadioItem", "rt-DropdownMenuItem", "rt-DropdownMenuRadioItem", r)
	}, n, b.createElement(U, { className: "rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator" }, b.createElement(h, { className: "rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon" })));
});
Je.displayName = "DropdownMenu.RadioItem";
const Q = b.forwardRef((e, t) => {
	let { children: n, className: r, shortcut: i, color: a = ne.color.default,...o } = e;
	return b.createElement(Be, {
		...o,
		asChild: !1,
		ref: t,
		"data-accent-color": a,
		className: (0, W.default)("rt-BaseMenuItem", "rt-BaseMenuCheckboxItem", "rt-DropdownMenuItem", "rt-DropdownMenuCheckboxItem", r)
	}, n, b.createElement(U, { className: "rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator" }, b.createElement(h, { className: "rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon" })), i && b.createElement("div", { className: "rt-BaseMenuShortcut rt-DropdownMenuShortcut" }, i));
});
Q.displayName = "DropdownMenu.CheckboxItem";
const Ye = (e) => b.createElement(We, { ...e });
Ye.displayName = "DropdownMenu.Sub";
const Xe = b.forwardRef((e, t) => {
	let { className: n, children: r,...i } = e;
	return b.createElement(Ge, {
		...i,
		asChild: !1,
		ref: t,
		className: (0, W.default)("rt-BaseMenuItem", "rt-BaseMenuSubTrigger", "rt-DropdownMenuItem", "rt-DropdownMenuSubTrigger", n)
	}, r, b.createElement("div", { className: "rt-BaseMenuShortcut rt-DropdownMenuShortcut" }, b.createElement(m, { className: "rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon" })));
});
Xe.displayName = "DropdownMenu.SubTrigger";
const Ze = b.forwardRef((e, t) => {
	let { size: n, variant: r, color: i, highContrast: a } = b.useContext(q), { className: o, children: s, container: c, forceMount: l,...u } = y({
		size: n,
		variant: r,
		color: i,
		highContrast: a,
		...e
	}, g);
	return b.createElement(H, {
		container: c,
		forceMount: l
	}, b.createElement(d, { asChild: !0 }, b.createElement(Ke, {
		"data-accent-color": i,
		alignOffset: -Number(n) * 4,
		sideOffset: 1,
		collisionPadding: 10,
		...u,
		asChild: !1,
		ref: t,
		className: (0, W.default)("rt-PopperContent", "rt-BaseMenuContent", "rt-BaseMenuSubContent", "rt-DropdownMenuContent", "rt-DropdownMenuSubContent", o)
	}, b.createElement(_, { type: "auto" }, b.createElement("div", { className: (0, W.default)("rt-BaseMenuViewport", "rt-DropdownMenuViewport") }, s)))));
});
Ze.displayName = "DropdownMenu.SubContent";
const $ = b.forwardRef(({ className: e,...t }, n) => b.createElement(Ue, {
	...t,
	asChild: !1,
	ref: n,
	className: (0, W.default)("rt-BaseMenuSeparator", "rt-DropdownMenuSeparator", e)
}));
$.displayName = "DropdownMenu.Separator";
export { $ as b, G as c, Z as d, Q as e, J as f, K as g, X as h, Y as i };

//# sourceMappingURL=dropdown-menu.DOURzgMR.js.map