import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
import { Children as r, createContext as i, forwardRef as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useImperativeHandle as d, useMemo as f, useRef as p, useState as m } from "react";
import { createPortal as h } from "react-dom";
var g = {
	layout: "_layout_dg90q_8",
	topBar: "_topBar_dg90q_20",
	body: "_body_dg90q_28",
	sidebar: "_sidebar_dg90q_37",
	backdrop: "_backdrop_dg90q_43",
	content: "_content_dg90q_49",
	bodySidebarOpen: "_bodySidebarOpen_dg90q_75",
	bottomBar: "_bottomBar_dg90q_92"
};
//#endregion
//#region src/components/Layout/Layout.tsx
function _({ topBar: r, sidebar: i, sidebarOpen: a = !1, onSidebarClose: o, children: s, bottomBar: c, className: l, ...u }) {
	let d = [g.body, i && a ? g.bodySidebarOpen : void 0].filter(Boolean).join(" ");
	return /* @__PURE__ */ n("div", {
		className: [g.layout, l].filter(Boolean).join(" "),
		...u,
		children: [
			r && /* @__PURE__ */ t("div", {
				className: g.topBar,
				children: r
			}),
			/* @__PURE__ */ n("div", {
				className: d,
				children: [i && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
					className: g.sidebar,
					children: i
				}), /* @__PURE__ */ t("div", {
					className: g.backdrop,
					onClick: o,
					"aria-hidden": "true"
				})] }), /* @__PURE__ */ t("div", {
					className: g.content,
					children: s
				})]
			}),
			c && /* @__PURE__ */ t("div", {
				className: g.bottomBar,
				children: c
			})
		]
	});
}
//#endregion
//#region ../react/dist/index.js
var v = "_text_102e3_1", y = "_heading_102e3_41", b = "_body_102e3_48", x = "_document_102e3_55", S = "_caption_102e3_62", C = "_monospace_102e3_78", w = "_numeric_102e3_85", T = {
	text: v,
	"large-title": "_large-title_102e3_9",
	"title-1": "_title-1_102e3_16",
	"title-2": "_title-2_102e3_22",
	"title-3": "_title-3_102e3_28",
	"title-4": "_title-4_102e3_34",
	heading: y,
	body: b,
	document: x,
	caption: S,
	"caption-heading": "_caption-heading_102e3_69",
	monospace: C,
	numeric: w,
	"color-default": "_color-default_102e3_95",
	"color-dim": "_color-dim_102e3_99",
	"color-accent": "_color-accent_102e3_103",
	"color-destructive": "_color-destructive_102e3_107",
	"color-success": "_color-success_102e3_111",
	"color-warning": "_color-warning_102e3_115",
	"color-error": "_color-error_102e3_119"
}, E = {
	"large-title": "h1",
	"title-1": "h1",
	"title-2": "h2",
	"title-3": "h3",
	"title-4": "h4",
	heading: "h3",
	body: "p",
	document: "p",
	caption: "span",
	"caption-heading": "span",
	monospace: "code",
	numeric: "span"
};
function D({ variant: e = "body", color: n = "default", as: r, className: i, children: a, ...o }) {
	return /* @__PURE__ */ t(r ?? E[e], {
		className: [
			T.text,
			T[e],
			T[`color-${n}`],
			i
		].filter(Boolean).join(" "),
		...o,
		children: a
	});
}
var O = "_card_7f351_1", k = "_interactive_7f351_19", A = {
	card: O,
	"padding-none": "_padding-none_7f351_12",
	"padding-sm": "_padding-sm_7f351_13",
	"padding-md": "_padding-md_7f351_14",
	"padding-lg": "_padding-lg_7f351_15",
	interactive: k
};
function j({ interactive: e = !1, padding: n = "md", as: r, className: i, children: a, ...o }) {
	return /* @__PURE__ */ t(r ?? (e ? "button" : "div"), {
		className: [
			A.card,
			A[`padding-${n}`],
			e ? A.interactive : null,
			i
		].filter(Boolean).join(" "),
		...o,
		children: a
	});
}
var M = {
	avatar: "_avatar_1f2cd_3",
	sm: "_sm_1f2cd_17",
	md: "_md_1f2cd_22",
	lg: "_lg_1f2cd_27",
	xl: "_xl_1f2cd_32",
	image: "_image_1f2cd_39",
	initials: "_initials_1f2cd_48",
	"color-blue": "_color-blue_1f2cd_64",
	"color-green": "_color-green_1f2cd_65",
	"color-yellow": "_color-yellow_1f2cd_66",
	"color-orange": "_color-orange_1f2cd_72",
	"color-red": "_color-red_1f2cd_73",
	"color-purple": "_color-purple_1f2cd_74",
	"color-brown": "_color-brown_1f2cd_75",
	"color-teal": "_color-teal_1f2cd_76",
	"color-slate": "_color-slate_1f2cd_77"
}, N = [
	"blue",
	"green",
	"yellow",
	"orange",
	"red",
	"purple",
	"brown",
	"teal",
	"slate"
];
function P(e) {
	let t = 0;
	for (let n = 0; n < e.length; n++) t = t * 31 + e.charCodeAt(n) >>> 0;
	return N[t % N.length];
}
function F(e) {
	let t = e.trim().split(/\s+/).filter(Boolean);
	return t.length === 0 ? "" : t.length === 1 ? t[0].charAt(0).toUpperCase() : t[0].charAt(0).toUpperCase() + t[t.length - 1].charAt(0).toUpperCase();
}
function ee({ name: e = "", src: n, alt: r, size: i = "md", color: a, className: o, ...s }) {
	let c = a ?? (e ? P(e) : "blue"), l = F(e), u = [
		M.avatar,
		M[i],
		n ? null : M[`color-${c}`],
		o
	].filter(Boolean).join(" ");
	return /* @__PURE__ */ t("span", {
		role: "img",
		"aria-label": r ?? e ?? "Avatar",
		className: u,
		...s,
		children: n ? /* @__PURE__ */ t("img", {
			src: n,
			alt: r ?? e,
			className: M.image
		}) : /* @__PURE__ */ t("span", {
			"aria-hidden": "true",
			className: M.initials,
			children: l
		})
	});
}
var I = {
	separator: "_separator_w9b4s_3",
	horizontal: "_horizontal_w9b4s_12",
	vertical: "_vertical_w9b4s_20"
};
function L({ orientation: e = "horizontal", className: n, ...r }) {
	let i = [
		I.separator,
		e === "vertical" ? I.vertical : I.horizontal,
		n
	].filter(Boolean).join(" ");
	return e === "vertical" ? /* @__PURE__ */ t("div", {
		role: "separator",
		"aria-orientation": "vertical",
		className: i,
		...r
	}) : /* @__PURE__ */ t("hr", {
		className: i,
		...r
	});
}
var te = {
	sm: 12,
	md: 16,
	lg: 20
};
function R({ icon: e, size: n = "md", label: r, width: i, height: a, ...o }) {
	let s = te[n];
	return /* @__PURE__ */ t("svg", {
		xmlns: "http://www.w3.org/2000/svg",
		viewBox: e.viewBox,
		width: i ?? s,
		height: a ?? s,
		fill: "currentColor",
		"aria-label": r,
		"aria-hidden": r ? void 0 : !0,
		role: r ? "img" : void 0,
		focusable: "false",
		...o,
		children: e.paths.map((e, n) => /* @__PURE__ */ t("path", {
			d: e.d,
			fillRule: e.fillRule,
			clipRule: e.clipRule
		}, n))
	});
}
var ne = {
	viewBox: "0 0 16 16",
	paths: [{
		d: "m2.5 5 5.5 6 5.5-6z",
		fillRule: "evenodd"
	}]
}, re = {
	viewBox: "0 0 16 16",
	paths: [{
		d: "M2.5 11 8 5l5.5 6z",
		fillRule: "evenodd"
	}]
}, ie = "_sidebar_537se_3", ae = "_section_537se_21", oe = "_sectionHeader_537se_35", se = "_sectionHeaderIcon_537se_71", ce = "_sectionTitle_537se_78", le = "_sectionChevron_537se_94", ue = "_sectionBody_537se_104", de = "_sectionBodyCollapsed_537se_110", fe = "_sectionBodyInner_537se_114", pe = "_list_537se_120", me = "_item_537se_131", he = "_itemBtn_537se_137", ge = "_active_537se_184", _e = "_itemIcon_537se_200", ve = "_itemLabel_537se_213", ye = "_itemSuffix_537se_223", be = "_contextMenu_537se_232", xe = "_contextMenuItem_537se_256", Se = "_contextMenuDestructive_537se_292", Ce = "_searchWrap_537se_298", we = "_variantBlue_537se_309", Te = "_variantGreen_537se_318", Ee = "_variantRed_537se_327", De = "_variantYellow_537se_336", Oe = "_variantBlack_537se_345", ke = "_variantTransparent_537se_354", Ae = "_variantBlurred_537se_359", je = "_pageMode_537se_375", Me = "_dragOver_537se_382", Ne = "_collapsed_537se_390", Pe = "_itemCollapsed_537se_401", z = {
	sidebar: ie,
	section: ae,
	sectionHeader: oe,
	sectionHeaderIcon: se,
	sectionTitle: ce,
	sectionChevron: le,
	sectionBody: ue,
	sectionBodyCollapsed: de,
	sectionBodyInner: fe,
	list: pe,
	item: me,
	itemBtn: he,
	active: ge,
	itemIcon: _e,
	itemLabel: ve,
	itemSuffix: ye,
	contextMenu: be,
	"menu-in": "_menu-in_537se_1",
	contextMenuItem: xe,
	contextMenuDestructive: Se,
	searchWrap: Ce,
	variantBlue: we,
	variantGreen: Te,
	variantRed: Ee,
	variantYellow: De,
	variantBlack: Oe,
	variantTransparent: ke,
	variantBlurred: Ae,
	pageMode: je,
	dragOver: Me,
	collapsed: Ne,
	itemCollapsed: Pe
}, Fe = i(!1);
function Ie() {
	return c(Fe);
}
var Le = i("");
function B(e, t) {
	let n = 0;
	return r.forEach(e, (e) => {
		if (!o(e)) return;
		let r = e.props;
		typeof r.label == "string" ? r.label.toLowerCase().includes(t.toLowerCase()) && n++ : r.children && (n += B(r.children, t));
	}), n;
}
a(function({ title: e, icon: r, collapsible: i = !1, defaultOpen: a = !0, open: o, onOpenChange: s, children: l, className: f, ...p }, h) {
	let [g, _] = m(a), v = o !== void 0, y = v ? o : g, b = Ie(), x = c(Le), S = u(), C = (e) => {
		v || _(e), s?.(e);
	};
	if (d(h, () => ({
		expand: () => C(!0),
		collapse: () => C(!1),
		toggle: () => C(!y)
	})), !(x.length === 0 || B(l, x) > 0)) return null;
	let w = b ? !0 : y, T = !!(e || r || i && !b);
	return /* @__PURE__ */ n("section", {
		className: [z.section, f].filter(Boolean).join(" "),
		...p,
		children: [T && (i && !b ? /* @__PURE__ */ n("button", {
			type: "button",
			className: z.sectionHeader,
			onClick: () => C(!y),
			"aria-expanded": y,
			"aria-controls": S,
			children: [
				r && /* @__PURE__ */ t("span", {
					className: z.sectionHeaderIcon,
					children: /* @__PURE__ */ t(R, {
						icon: r,
						size: "sm",
						"aria-hidden": !0
					})
				}),
				e && /* @__PURE__ */ t("span", {
					className: z.sectionTitle,
					children: e
				}),
				/* @__PURE__ */ t("span", {
					className: z.sectionChevron,
					children: /* @__PURE__ */ t(R, {
						icon: y ? re : ne,
						size: "sm",
						"aria-hidden": !0
					})
				})
			]
		}) : /* @__PURE__ */ n("div", {
			className: z.sectionHeader,
			children: [r && /* @__PURE__ */ t("span", {
				className: z.sectionHeaderIcon,
				children: /* @__PURE__ */ t(R, {
					icon: r,
					size: "sm",
					"aria-hidden": !0
				})
			}), e && /* @__PURE__ */ t("span", {
				className: z.sectionTitle,
				children: e
			})]
		})), /* @__PURE__ */ t("div", {
			id: S,
			className: [z.sectionBody, w ? null : z.sectionBodyCollapsed].filter(Boolean).join(" "),
			"aria-hidden": !w || void 0,
			children: /* @__PURE__ */ t("div", {
				className: z.sectionBodyInner,
				children: /* @__PURE__ */ t("ul", {
					role: "list",
					className: z.list,
					children: l
				})
			})
		})]
	});
});
var V = {
	switcher: "_switcher_1uh9r_3",
	item: "_item_1uh9r_18",
	active: "_active_1uh9r_45",
	itemIcon: "_itemIcon_1uh9r_76",
	itemLabel: "_itemLabel_1uh9r_84"
};
function H({ label: e, icon: r, active: i = !1, className: a, disabled: o, ...s }) {
	return /* @__PURE__ */ n("button", {
		type: "button",
		role: "radio",
		"aria-checked": i,
		tabIndex: i ? 0 : -1,
		disabled: o,
		className: [
			V.item,
			i ? V.active : null,
			a
		].filter(Boolean).join(" "),
		...s,
		children: [r && /* @__PURE__ */ t("span", {
			className: V.itemIcon,
			children: /* @__PURE__ */ t(R, {
				icon: r,
				size: "md",
				"aria-hidden": !0
			})
		}), /* @__PURE__ */ t("span", {
			className: V.itemLabel,
			children: e
		})]
	});
}
var Re = { bar: "_bar_njcvu_3" };
function ze({ children: e, reveal: n = !0, className: r, ...i }) {
	return n ? /* @__PURE__ */ t("div", {
		role: "navigation",
		"aria-label": "Bottom navigation",
		className: [Re.bar, r].filter(Boolean).join(" "),
		...i,
		children: e
	}) : null;
}
i(null);
var U = {
	sidebar: "_sidebar_1hdq3_3",
	sidebarCollapsed: "_sidebarCollapsed_1hdq3_15",
	itemBtn: "_itemBtn_1hdq3_19",
	header: "_header_1hdq3_26",
	footer: "_footer_1hdq3_31",
	list: "_list_1hdq3_38",
	item: "_item_1hdq3_19",
	active: "_active_1hdq3_84",
	itemIcon: "_itemIcon_1hdq3_130",
	itemLabel: "_itemLabel_1hdq3_143",
	itemSuffix: "_itemSuffix_1hdq3_153",
	count: "_count_1hdq3_160"
}, W = i(null);
function Be() {
	let e = c(W);
	if (!e) throw Error("ViewSwitcherSidebarItem must be used inside ViewSwitcherSidebar");
	return e;
}
function Ve({ value: e, onValueChange: r, "aria-label": i = "Views", collapsed: a = !1, header: o, footer: s, children: c, className: l, ...u }) {
	let d = p(null);
	function f(e) {
		let t = Array.from(d.current?.querySelectorAll("[role=radio]:not(:disabled)") ?? []), n = t.findIndex((e) => e === document.activeElement);
		if (n === -1) return;
		let r = n;
		if (e.key === "ArrowDown" || e.key === "ArrowRight") r = (n + 1) % t.length;
		else if (e.key === "ArrowUp" || e.key === "ArrowLeft") r = (n - 1 + t.length) % t.length;
		else if (e.key === "Home") r = 0;
		else if (e.key === "End") r = t.length - 1;
		else return;
		e.preventDefault(), t[r].focus(), t[r].click();
	}
	return /* @__PURE__ */ t(W.Provider, {
		value: {
			value: e,
			onValueChange: r,
			collapsed: a
		},
		children: /* @__PURE__ */ n("nav", {
			className: [
				U.sidebar,
				a ? U.sidebarCollapsed : null,
				l
			].filter(Boolean).join(" "),
			onKeyDown: f,
			...u,
			children: [
				o && /* @__PURE__ */ t("div", {
					className: U.header,
					children: o
				}),
				/* @__PURE__ */ t("ul", {
					ref: d,
					role: "radiogroup",
					"aria-label": i,
					className: U.list,
					children: c
				}),
				s && /* @__PURE__ */ t("div", {
					className: U.footer,
					children: s
				})
			]
		})
	});
}
function G({ name: e, label: r, icon: i, count: a, suffix: o, disabled: s, className: c, ...l }) {
	let { value: u, onValueChange: d, collapsed: f } = Be(), p = u === e, m = o ?? a ?? null;
	return /* @__PURE__ */ t("li", {
		className: U.item,
		children: /* @__PURE__ */ n("button", {
			type: "button",
			role: "radio",
			"aria-checked": p,
			tabIndex: p ? 0 : -1,
			disabled: s,
			onClick: () => d(e),
			className: [
				U.itemBtn,
				p ? U.active : null,
				c
			].filter(Boolean).join(" "),
			...l,
			children: [
				i && /* @__PURE__ */ t("span", {
					className: U.itemIcon,
					children: /* @__PURE__ */ t(R, {
						icon: i,
						size: "md",
						"aria-hidden": !0
					})
				}),
				!f && /* @__PURE__ */ t("span", {
					className: U.itemLabel,
					children: r
				}),
				!f && m != null && /* @__PURE__ */ t("span", {
					className: U.itemSuffix,
					children: typeof m == "number" ? /* @__PURE__ */ t("span", {
						className: U.count,
						children: m > 99 ? "99+" : m
					}) : m
				})
			]
		})
	});
}
i(null), i({
	navigate: () => {},
	pop: () => {},
	canGoBack: !1,
	currentTag: "",
	direction: "forward"
});
var He = "_backdrop_zzv98_3", Ue = "_sheet_zzv98_26", We = "_handle_zzv98_49", Ge = "_handleBar_zzv98_56", Ke = "_title_zzv98_66", qe = "_content_zzv98_79", K = {
	backdrop: He,
	"backdrop-in": "_backdrop-in_zzv98_1",
	sheet: Ue,
	"sheet-in": "_sheet-in_zzv98_1",
	handle: We,
	handleBar: Ge,
	title: Ke,
	content: qe
}, q = "button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
function Je({ open: e, title: r, children: i, onClose: a, closeOnBackdrop: o = !0, className: c, ...d }) {
	let f = p(null), m = u(), g = p(null);
	l(() => {
		e ? (g.current = document.activeElement, (f.current?.querySelector(q))?.focus()) : g.current?.focus();
	}, [e]);
	let _ = s((e) => {
		if (e.key === "Escape") {
			e.preventDefault(), a?.();
			return;
		}
		if (e.key !== "Tab") return;
		let t = Array.from(f.current?.querySelectorAll(q) ?? []);
		if (t.length === 0) return;
		let n = t[0], r = t[t.length - 1];
		e.shiftKey ? document.activeElement === n && (e.preventDefault(), r.focus()) : document.activeElement === r && (e.preventDefault(), n.focus());
	}, [a]);
	if (!e) return null;
	let v = /* @__PURE__ */ t("div", {
		className: K.backdrop,
		onClick: o ? a : void 0,
		"aria-hidden": "true",
		children: /* @__PURE__ */ n("div", {
			ref: f,
			role: "dialog",
			"aria-modal": "true",
			"aria-labelledby": r ? m : void 0,
			className: [K.sheet, c].filter(Boolean).join(" "),
			onKeyDown: _,
			onClick: (e) => e.stopPropagation(),
			...d,
			children: [
				/* @__PURE__ */ t("div", {
					className: K.handle,
					"aria-hidden": "true",
					children: /* @__PURE__ */ t("div", { className: K.handleBar })
				}),
				r && /* @__PURE__ */ t("div", {
					id: m,
					className: K.title,
					children: r
				}),
				i && /* @__PURE__ */ t("div", {
					className: K.content,
					children: i
				})
			]
		})
	});
	return typeof document > "u" ? v : h(v, document.body);
}
var J = {
	outer: "_outer_1pg3h_3",
	scroll: "_scroll_1pg3h_13",
	table: "_table_1pg3h_20",
	thead: "_thead_1pg3h_28",
	th: "_th_1pg3h_28",
	headerLabel: "_headerLabel_1pg3h_48",
	sortBtn: "_sortBtn_1pg3h_55",
	sortBtnActive: "_sortBtnActive_1pg3h_84",
	sortActive: "_sortActive_1pg3h_89",
	sortNeutral: "_sortNeutral_1pg3h_93",
	tbody: "_tbody_1pg3h_99",
	row: "_row_1pg3h_105",
	rowSelectable: "_rowSelectable_1pg3h_114",
	rowSelected: "_rowSelected_1pg3h_126",
	td: "_td_1pg3h_144",
	alignStart: "_alignStart_1pg3h_156",
	alignCenter: "_alignCenter_1pg3h_160",
	alignEnd: "_alignEnd_1pg3h_164",
	checkboxCol: "_checkboxCol_1pg3h_170",
	checkbox: "_checkbox_1pg3h_170",
	emptyCell: "_emptyCell_1pg3h_186",
	emptyLabel: "_emptyLabel_1pg3h_191"
};
J.alignStart, J.alignCenter, J.alignEnd;
var Y = {
	card: "_card_1hglg_3",
	label: "_label_1hglg_12",
	value: "_value_1hglg_18",
	number: "_number_1hglg_25",
	affix: "_affix_1hglg_32",
	accent: "_accent_1hglg_42"
};
//#endregion
//#region src/components/CounterCard/CounterCard.tsx
function Ye(e, t, n) {
	let [r, i] = m(0), a = p(0), o = p(null);
	return l(() => {
		let r = typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
		if (!n || r) {
			o.current !== null && (cancelAnimationFrame(o.current), o.current = null), a.current = e, i(e);
			return;
		}
		o.current !== null && cancelAnimationFrame(o.current);
		let s = a.current, c = performance.now();
		function l(n) {
			let r = n - c, u = Math.min(r / t, 1), d = 1 - (1 - u) ** 3, f = s + (e - s) * d;
			a.current = f, i(f), u < 1 ? o.current = requestAnimationFrame(l) : o.current = null;
		}
		return o.current = requestAnimationFrame(l), () => {
			o.current !== null && (cancelAnimationFrame(o.current), o.current = null);
		};
	}, [
		e,
		t,
		n
	]), r;
}
function Xe({ label: e, value: r, prefix: i, suffix: a, decimals: o = 0, format: s, animated: c = !0, duration: l = 1e3, accent: u = !1, interactive: d = !1, className: f, style: p, ...m }) {
	let h = Ye(r, l, c), g = s ? s(h) : h.toLocaleString(void 0, {
		minimumFractionDigits: o,
		maximumFractionDigits: o
	});
	return /* @__PURE__ */ n(j, {
		interactive: d,
		className: [Y.card, f].filter(Boolean).join(" "),
		style: p,
		...m,
		children: [/* @__PURE__ */ t(D, {
			variant: "caption",
			color: "dim",
			className: Y.label,
			children: e
		}), /* @__PURE__ */ n("span", {
			className: [Y.value, u ? Y.accent : null].filter(Boolean).join(" "),
			"aria-live": "polite",
			"aria-atomic": "true",
			"aria-label": `${e}: ${i ?? ""}${r.toLocaleString(void 0, {
				minimumFractionDigits: o,
				maximumFractionDigits: o
			})}${a ?? ""}`,
			children: [
				i && /* @__PURE__ */ t("span", {
					className: Y.affix,
					children: i
				}),
				/* @__PURE__ */ t(D, {
					variant: "title-2",
					as: "span",
					className: Y.number,
					children: g
				}),
				a && /* @__PURE__ */ t("span", {
					className: Y.affix,
					children: a
				})
			]
		})]
	});
}
var X = {
	root: "_root_xz9vz_3",
	header: "_header_xz9vz_10",
	headerVertical: "_headerVertical_xz9vz_18",
	identity: "_identity_xz9vz_26",
	identityVertical: "_identityVertical_xz9vz_33",
	name: "_name_xz9vz_37",
	email: "_email_xz9vz_45",
	actions: "_actions_xz9vz_53",
	action: "_action_xz9vz_53",
	destructive: "_destructive_xz9vz_96"
};
//#endregion
//#region src/components/UserCard/UserCard.tsx
function Ze({ name: r, email: i, avatarSrc: a, avatarColor: o, avatarSize: s = "md", orientation: c = "vertical", actions: l = [], minWidth: u = 200, className: d, style: f, ...p }) {
	let m = c === "vertical", h = (e) => l.slice(0, e).some((e) => e.variant !== "destructive");
	return /* @__PURE__ */ n("div", {
		className: [X.root, d].filter(Boolean).join(" "),
		style: {
			minWidth: u,
			...f
		},
		...p,
		children: [/* @__PURE__ */ n("div", {
			className: [X.header, m ? X.headerVertical : null].filter(Boolean).join(" "),
			children: [/* @__PURE__ */ t(ee, {
				name: r,
				src: a,
				color: o,
				size: s
			}), /* @__PURE__ */ n("div", {
				className: [X.identity, m ? X.identityVertical : null].filter(Boolean).join(" "),
				children: [/* @__PURE__ */ t(D, {
					variant: "body",
					className: X.name,
					children: r
				}), i && /* @__PURE__ */ t(D, {
					variant: "caption",
					color: "dim",
					className: X.email,
					children: i
				})]
			})]
		}), l.length > 0 && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(L, {}), /* @__PURE__ */ t("div", {
			className: X.actions,
			role: "list",
			children: l.map((e, r) => /* @__PURE__ */ n("div", {
				role: "listitem",
				children: [e.variant === "destructive" && h(r) && /* @__PURE__ */ t(L, {}), /* @__PURE__ */ t("button", {
					type: "button",
					className: [X.action, e.variant === "destructive" ? X.destructive : null].filter(Boolean).join(" "),
					onClick: e.onClick,
					children: e.label
				})]
			}, e.label))
		})] })]
	});
}
//#endregion
//#region ../icons/dist/index.js
var Qe = {
	viewBox: "0 0 16 16",
	paths: [{
		d: "m2.5 5 5.5 6 5.5-6z",
		fillRule: "evenodd"
	}]
}, $e = {
	viewBox: "0 0 16 16",
	paths: [{
		d: "M2.5 11 8 5l5.5 6z",
		fillRule: "evenodd"
	}]
}, Z = {
	root: "_root_thypt_3",
	header: "_header_thypt_11",
	icon: "_icon_thypt_19",
	title: "_title_thypt_26",
	titleText: "_titleText_thypt_31",
	trailing: "_trailing_thypt_37",
	headerActions: "_headerActions_thypt_44",
	toggle: "_toggle_thypt_52",
	bodyWrapper: "_bodyWrapper_thypt_90",
	bodyCollapsed: "_bodyCollapsed_thypt_96",
	bodyInner: "_bodyInner_thypt_100",
	body: "_body_thypt_90",
	footer: "_footer_thypt_114",
	footerContent: "_footerContent_thypt_122",
	footerActions: "_footerActions_thypt_127"
}, et = a(function({ icon: r, title: i, headerActions: a, defaultExpanded: o = !0, collapsible: s = !0, onExpandedChange: c, children: l, footer: u, footerActions: f, className: p, style: h, ...g }, _) {
	let [v, y] = m(o), b = (e) => {
		y(e), c?.(e);
	};
	d(_, () => ({
		expand: () => b(!0),
		collapse: () => b(!1),
		toggle: () => y((e) => {
			let t = !e;
			return c?.(t), t;
		})
	}));
	let x = u !== void 0 || f !== void 0;
	return /* @__PURE__ */ n(j, {
		padding: "none",
		className: [Z.root, p].filter(Boolean).join(" "),
		style: h,
		...g,
		children: [/* @__PURE__ */ n("div", {
			className: Z.header,
			children: [
				r && /* @__PURE__ */ t("span", {
					className: Z.icon,
					children: r
				}),
				/* @__PURE__ */ t("div", {
					className: Z.title,
					children: typeof i == "string" ? /* @__PURE__ */ t(D, {
						variant: "heading",
						className: Z.titleText,
						children: i
					}) : i
				}),
				/* @__PURE__ */ n("div", {
					className: Z.trailing,
					children: [a && /* @__PURE__ */ t("div", {
						className: Z.headerActions,
						children: a
					}), s && /* @__PURE__ */ t("button", {
						type: "button",
						className: Z.toggle,
						onClick: () => b(!v),
						"aria-expanded": v,
						"aria-label": v ? "Collapse panel" : "Expand panel",
						children: /* @__PURE__ */ t(R, {
							icon: v ? $e : Qe,
							size: "sm"
						})
					})]
				})
			]
		}), /* @__PURE__ */ t("div", {
			className: [Z.bodyWrapper, v ? null : Z.bodyCollapsed].filter(Boolean).join(" "),
			"aria-hidden": !v || void 0,
			children: /* @__PURE__ */ n("div", {
				className: Z.bodyInner,
				children: [
					/* @__PURE__ */ t(L, {}),
					/* @__PURE__ */ t("div", {
						className: Z.body,
						children: l
					}),
					x && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(L, {}), /* @__PURE__ */ n("div", {
						className: Z.footer,
						children: [/* @__PURE__ */ t("div", {
							className: Z.footerContent,
							children: u
						}), f && /* @__PURE__ */ t("div", {
							className: Z.footerActions,
							children: f
						})]
					})] })
				]
			})
		})]
	});
}), tt = "(max-width: 479px)", nt = "(min-width: 480px) and (max-width: 1023px)", rt = "(min-width: 1024px)";
function it() {
	return typeof window > "u" ? {
		isMobile: !1,
		isTablet: !1,
		isDesktop: !0
	} : {
		isMobile: window.matchMedia(tt).matches,
		isTablet: window.matchMedia(nt).matches,
		isDesktop: window.matchMedia(rt).matches
	};
}
function at() {
	let [e, t] = m(it);
	return l(() => {
		let e = [
			window.matchMedia(tt),
			window.matchMedia(nt),
			window.matchMedia(rt)
		], n = () => t(it());
		return e.forEach((e) => e.addEventListener("change", n)), () => e.forEach((e) => e.removeEventListener("change", n));
	}, []), e;
}
var Q = {
	root: "_root_1vxvq_3",
	topBarSlot: "_topBarSlot_1vxvq_13",
	body: "_body_1vxvq_19",
	contentSlot: "_contentSlot_1vxvq_28",
	collapseBtn: "_collapseBtn_1vxvq_36",
	collapseBtnLabel: "_collapseBtnLabel_1vxvq_62",
	sidebarGroup: "_sidebarGroup_1vxvq_68",
	sidebarGroupLabel: "_sidebarGroupLabel_1vxvq_76",
	moreBtn: "_moreBtn_1vxvq_90",
	moreBtnActive: "_moreBtnActive_1vxvq_111",
	moreDots: "_moreDots_1vxvq_116",
	moreLabel: "_moreLabel_1vxvq_122",
	sheetList: "_sheetList_1vxvq_128",
	sheetItem: "_sheetItem_1vxvq_137",
	sheetItemActive: "_sheetItemActive_1vxvq_163",
	sheetItemIcon: "_sheetItemIcon_1vxvq_168",
	sheetItemLabel: "_sheetItemLabel_1vxvq_173",
	sheetItemBadge: "_sheetItemBadge_1vxvq_178"
}, $ = 3;
function ot({ items: r, value: i, onValueChange: a, topBar: o, sidebarHeader: s, sidebarHeaderCollapsed: c, children: l }) {
	let { isMobile: u, isTablet: d } = at(), [p, h] = m(null), [g, _] = m(!1), [v, y] = m(), [b, x] = m([]), S = d || (p ?? !1), C = f(() => {
		let e = [], t = /* @__PURE__ */ new Set();
		for (let n of r) if (!n.group) e.push({
			type: "item",
			item: n
		});
		else if (!t.has(n.group)) {
			t.add(n.group);
			let i = r.filter((e) => e.group === n.group);
			e.push({
				type: "group",
				groupName: n.group,
				icon: i[0].icon,
				groupItems: i
			});
		}
		return e;
	}, [r]), w = C.length > 4, T = w ? C.slice(0, $) : C, E = w ? C.slice($) : [], D = f(() => E.flatMap((e) => e.type === "item" ? [e.item] : e.groupItems), [E]), O = D.some((e) => e.id === i);
	function k(e, t) {
		y(e), x(t), _(!0);
	}
	function A() {
		y(void 0), x(D), _(!0);
	}
	function j(e) {
		a(e), _(!1);
	}
	let M = S ? c ?? s : s, N = r.filter((e) => !e.group), P = [...new Set(r.filter((e) => e.group).map((e) => e.group))];
	if (u) return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("div", {
		className: Q.root,
		children: [
			o && /* @__PURE__ */ t("div", {
				className: Q.topBarSlot,
				children: o
			}),
			/* @__PURE__ */ t("div", {
				className: Q.contentSlot,
				children: l
			}),
			/* @__PURE__ */ n(ze, { children: [T.map((e) => {
				if (e.type === "item") return /* @__PURE__ */ t(H, {
					label: e.item.label,
					icon: e.item.icon,
					active: e.item.id === i,
					onClick: () => a(e.item.id)
				}, e.item.id);
				let n = e.groupItems.some((e) => e.id === i);
				return /* @__PURE__ */ t(H, {
					label: e.groupName,
					icon: e.icon,
					active: n,
					onClick: () => k(e.groupName, e.groupItems)
				}, e.groupName);
			}), w && /* @__PURE__ */ n("button", {
				type: "button",
				className: [Q.moreBtn, O ? Q.moreBtnActive : null].filter(Boolean).join(" "),
				onClick: A,
				"aria-label": "More navigation items",
				children: [/* @__PURE__ */ t("span", {
					className: Q.moreDots,
					"aria-hidden": "true",
					children: "···"
				}), /* @__PURE__ */ t("span", {
					className: Q.moreLabel,
					children: "More"
				})]
			})] })
		]
	}), /* @__PURE__ */ t(Je, {
		open: g,
		title: v,
		onClose: () => _(!1),
		children: /* @__PURE__ */ t("ul", {
			className: Q.sheetList,
			children: b.map((e) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("button", {
				type: "button",
				className: [Q.sheetItem, e.id === i ? Q.sheetItemActive : null].filter(Boolean).join(" "),
				onClick: () => j(e.id),
				children: [
					/* @__PURE__ */ t(R, {
						icon: e.icon,
						size: "md",
						"aria-hidden": !0,
						className: Q.sheetItemIcon
					}),
					/* @__PURE__ */ t("span", {
						className: Q.sheetItemLabel,
						children: e.label
					}),
					e.badge != null && /* @__PURE__ */ t("span", {
						className: Q.sheetItemBadge,
						children: e.badge > 99 ? "99+" : e.badge
					})
				]
			}) }, e.id))
		})
	})] });
	let F = /* @__PURE__ */ n("button", {
		type: "button",
		className: Q.collapseBtn,
		onClick: () => h(!S),
		"aria-label": S ? "Expand sidebar" : "Collapse sidebar",
		children: [/* @__PURE__ */ t("span", {
			"aria-hidden": "true",
			children: S ? "›" : "‹"
		}), !S && /* @__PURE__ */ t("span", {
			className: Q.collapseBtnLabel,
			children: "Compress"
		})]
	});
	return /* @__PURE__ */ n("div", {
		className: Q.root,
		children: [o && /* @__PURE__ */ t("div", {
			className: Q.topBarSlot,
			children: o
		}), /* @__PURE__ */ n("div", {
			className: Q.body,
			children: [/* @__PURE__ */ n(Ve, {
				value: i,
				onValueChange: a,
				collapsed: S,
				header: M,
				footer: F,
				children: [N.map((e) => /* @__PURE__ */ t(G, {
					name: e.id,
					label: e.label,
					icon: e.icon,
					count: e.badge ?? void 0
				}, e.id)), P.map((e) => {
					let i = r.filter((t) => t.group === e);
					return /* @__PURE__ */ n("li", {
						className: Q.sidebarGroup,
						children: [!S && /* @__PURE__ */ t("span", {
							className: Q.sidebarGroupLabel,
							children: e
						}), i.map((e) => /* @__PURE__ */ t(G, {
							name: e.id,
							label: e.label,
							icon: e.icon,
							count: e.badge ?? void 0
						}, e.id))]
					}, e);
				})]
			}), /* @__PURE__ */ t("div", {
				className: Q.contentSlot,
				children: l
			})]
		})]
	});
}
//#endregion
export { ot as AdaptiveLayout, Xe as CounterCard, _ as Layout, et as PanelCard, Ze as UserCard };

//# sourceMappingURL=index.js.map