import { OpenPage } from "./OpenPage.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { makeStyles } from "@material-ui/core";
import { Resizable } from "re-resizable";
//#region src/UI/templates/DraggableSidebarTemplate.jsx
const useStyles = makeStyles((theme) => ({
	root: {},
	stage: {
		display: "flex",
		flexDirection: "column",
		alignItems: "center",
		width: "100%",
		marginTop: 16,
		gap: 16
	},
	gridColumn: {
		width: "100%",
		height: "100vh",
		border: 0
	},
	arrow: { transform: "rotate(180deg)" },
	buttonContainer: {
		background: theme.palette.common.white,
		borderRadius: "50px 0px 0px 50px",
		marginTop: theme.spacing(1),
		height: 39,
		paddingTop: (props) => props.removePadding ? 0 : 10
	},
	hide: { display: "none" }
}));
const DraggableSidebarTemplate = (props) => {
	const $ = c(29);
	const { body, sidebar, divide, width, setWidth, hide, maxWidth, enable: t0, splitScreenStyle: t1 } = props;
	let t2;
	if ($[0] !== t0) {
		t2 = t0 === void 0 ? {
			top: true,
			right: true,
			bottom: true,
			left: true,
			topRight: false,
			bottomRight: false,
			bottomLeft: false,
			topLeft: false
		} : t0;
		$[0] = t0;
		$[1] = t2;
	} else t2 = $[1];
	const enable = t2;
	let t3;
	if ($[2] !== t1) {
		t3 = t1 === void 0 ? {} : t1;
		$[2] = t1;
		$[3] = t3;
	} else t3 = $[3];
	const splitScreenStyle = t3;
	const classes = useStyles(props);
	let t4;
	if ($[4] !== hide) {
		t4 = {
			width: "100%",
			display: "flex",
			flex: 1,
			...hide ? {} : { overflow: "hidden" },
			border: 0
		};
		$[4] = hide;
		$[5] = t4;
	} else t4 = $[5];
	let t5;
	if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
		t5 = {
			position: "relative",
			top: 0
		};
		$[6] = t5;
	} else t5 = $[6];
	const t6 = divide && classes.stage;
	let t7;
	let t8;
	if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
		t7 = {
			flex: 1,
			display: "flex",
			flexDirection: "column"
		};
		t8 = {
			flex: 1,
			display: "flex",
			flexDirection: "column"
		};
		$[7] = t7;
		$[8] = t8;
	} else {
		t7 = $[7];
		t8 = $[8];
	}
	let t9;
	if ($[9] !== body) {
		t9 = /* @__PURE__ */ React.createElement("div", { style: t8 }, body);
		$[9] = body;
		$[10] = t9;
	} else t9 = $[10];
	let t10;
	if ($[11] !== t6 || $[12] !== t9) {
		t10 = /* @__PURE__ */ React.createElement(OpenPage, {
			disableGutters: true,
			style: t5
		}, /* @__PURE__ */ React.createElement("div", {
			className: t6,
			style: t7
		}, t9));
		$[11] = t6;
		$[12] = t9;
		$[13] = t10;
	} else t10 = $[13];
	const t11 = divide && classes.stage;
	let t12;
	if ($[14] !== t11) {
		t12 = /* @__PURE__ */ React.createElement("div", { className: t11 });
		$[14] = t11;
		$[15] = t12;
	} else t12 = $[15];
	let t13;
	if ($[16] !== enable || $[17] !== hide || $[18] !== maxWidth || $[19] !== setWidth || $[20] !== sidebar || $[21] !== splitScreenStyle || $[22] !== width) {
		t13 = !hide && /* @__PURE__ */ React.createElement(Resizable, {
			style: splitScreenStyle,
			onResizeStop: (e, direction, ref, d) => {
				setWidth(width + d.width);
			},
			defaultSize: { width },
			size: { width },
			maxWidth: maxWidth || "50%",
			enable
		}, sidebar);
		$[16] = enable;
		$[17] = hide;
		$[18] = maxWidth;
		$[19] = setWidth;
		$[20] = sidebar;
		$[21] = splitScreenStyle;
		$[22] = width;
		$[23] = t13;
	} else t13 = $[23];
	let t14;
	if ($[24] !== t10 || $[25] !== t12 || $[26] !== t13 || $[27] !== t4) {
		t14 = /* @__PURE__ */ React.createElement("div", { style: t4 }, t10, t12, t13);
		$[24] = t10;
		$[25] = t12;
		$[26] = t13;
		$[27] = t4;
		$[28] = t14;
	} else t14 = $[28];
	return t14;
};
//#endregion
export { DraggableSidebarTemplate };

//# sourceMappingURL=DraggableSidebarTemplate.mjs.map