import { FluentIconButton } from "../../UI/inputs/buttons/FluentIconButton.mjs";
import { c } from "react-compiler-runtime";
import React, { useState } from "react";
import { Fade, makeStyles } from "@material-ui/core";
import { ChevronLeftIcon, ChevronRightIcon } from "@fluentui/react-icons";
//#region src/layout/templates/SideBarTemplate.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		display: "flex",
		flexDirection: "row",
		width: "100%",
		position: "relative"
	},
	column: {
		display: "flex",
		flexDirection: "row",
		flex: 1
	},
	content: { flex: 1 },
	sideBar: {
		height: "100vh",
		background: theme.palette.primary.light
	}
}));
const SideBarTemplate = (t0) => {
	const $ = c(25);
	const { children, sidebar } = t0;
	const classes = useStyles();
	const [open, setOpen] = useState(true);
	let t1;
	if ($[0] !== open) {
		t1 = () => {
			setOpen(!open);
		};
		$[0] = open;
		$[1] = t1;
	} else t1 = $[1];
	const toggleSidebar = t1;
	let t2;
	if ($[2] !== children || $[3] !== classes.content) {
		t2 = /* @__PURE__ */ React.createElement("div", { className: classes.content }, children);
		$[2] = children;
		$[3] = classes.content;
		$[4] = t2;
	} else t2 = $[4];
	const t3 = open ? 300 : 0;
	let t4;
	if ($[5] !== t3) {
		t4 = {
			position: "absolute",
			top: 0,
			right: t3
		};
		$[5] = t3;
		$[6] = t4;
	} else t4 = $[6];
	const t5 = open ? ChevronRightIcon : ChevronLeftIcon;
	let t6;
	if ($[7] !== t5 || $[8] !== toggleSidebar) {
		t6 = /* @__PURE__ */ React.createElement(FluentIconButton, {
			color: "primary",
			icon: t5,
			onClick: toggleSidebar
		});
		$[7] = t5;
		$[8] = toggleSidebar;
		$[9] = t6;
	} else t6 = $[9];
	let t7;
	if ($[10] !== t4 || $[11] !== t6) {
		t7 = /* @__PURE__ */ React.createElement("div", { style: t4 }, t6);
		$[10] = t4;
		$[11] = t6;
		$[12] = t7;
	} else t7 = $[12];
	let t8;
	if ($[13] !== classes.sideBar || $[14] !== open || $[15] !== sidebar) {
		t8 = open && /* @__PURE__ */ React.createElement(Fade, {
			in: open,
			timeout: {
				enter: 1e3,
				exit: 1e3
			}
		}, /* @__PURE__ */ React.createElement("div", { className: classes.sideBar }, sidebar));
		$[13] = classes.sideBar;
		$[14] = open;
		$[15] = sidebar;
		$[16] = t8;
	} else t8 = $[16];
	let t9;
	if ($[17] !== classes.column || $[18] !== t2 || $[19] !== t7 || $[20] !== t8) {
		t9 = /* @__PURE__ */ React.createElement("div", { className: classes.column }, t2, t7, t8);
		$[17] = classes.column;
		$[18] = t2;
		$[19] = t7;
		$[20] = t8;
		$[21] = t9;
	} else t9 = $[21];
	let t10;
	if ($[22] !== classes.root || $[23] !== t9) {
		t10 = /* @__PURE__ */ React.createElement("div", { className: classes.root }, t9);
		$[22] = classes.root;
		$[23] = t9;
		$[24] = t10;
	} else t10 = $[24];
	return t10;
};
//#endregion
export { SideBarTemplate };

//# sourceMappingURL=SideBarTemplate.mjs.map