import { cx as e } from "../../../theme/tools.js";
import { SidebarNavSection as t } from "../../../backoffice/molecules/sidebar_nav_section/SidebarNavSection.js";
import { SidebarCollapseToggle as n } from "../../../backoffice/molecules/sidebar_collapse_toggle/SidebarCollapseToggle.js";
import { container as r, footer as i, header as a, inner as o, sections as s, widthRecipe as c } from "./adminSidebar.css.js";
import { useCallback as l, useState as u } from "react";
import { jsx as d, jsxs as f } from "react/jsx-runtime";
//#region src/admin/organisms/admin_sidebar/AdminSidebar.tsx
var p = ({ header: p, search: m, footer: h, sections: g, isCollapsed: _, defaultCollapsed: v = !1, onCollapsedChange: y, collapseToggleLabel: b, expandToggleLabel: x, collapseShortcut: S, navigationAriaLabel: C = "Admin navigation", hideCollapseToggle: w = !1, className: T }) => {
	let [E, D] = u(v), O = _ ?? E, k = l(() => {
		let e = !O;
		_ ?? D(e), y?.(e);
	}, [
		O,
		_,
		y
	]), A = "expanded";
	O && (A = "collapsed");
	let j = null;
	return h != null && (j = /* @__PURE__ */ d("div", {
		className: i,
		children: h
	})), /* @__PURE__ */ d("aside", {
		className: e(r, c({ state: A }), T),
		children: /* @__PURE__ */ f("div", {
			className: o,
			children: [
				/* @__PURE__ */ f("div", {
					className: a,
					children: [p, !w && /* @__PURE__ */ d(n, {
						isCollapsed: O,
						onToggle: k,
						label: b,
						expandLabel: x,
						shortcut: S
					})]
				}),
				m != null && /* @__PURE__ */ d("div", {
					className: "jmrd3s7 txvbqbnvp txvbqboiy txvbqb9ip txvbqbai7 txvbqbao7",
					children: m
				}),
				/* @__PURE__ */ d("nav", {
					className: s,
					"aria-label": C,
					children: g.map((e) => /* @__PURE__ */ d(t, {
						title: e.title,
						icon: e.icon,
						items: e.items,
						collapsible: e.collapsible,
						defaultCollapsed: e.defaultCollapsed,
						isCollapsed: e.isCollapsed,
						onCollapsedChange: e.onCollapsedChange,
						collapsed: O
					}, e.id))
				}),
				j
			]
		})
	});
};
//#endregion
export { p as AdminSidebar, p as default };

//# sourceMappingURL=AdminSidebar.js.map