import { c } from "react-compiler-runtime";
import React, { Children, cloneElement } from "react";
import { Divider, alpha, darken, makeStyles } from "@material-ui/core";
import clsx from "clsx";
import PropTypes from "prop-types";
//#region src/UI/dataDisplay/entityHeader/ui/EntityHeaderContainer.jsx
const useStyles = makeStyles((theme) => ({
	root: (props) => ({
		display: "flex",
		flexDirection: props.direction === "column" ? "column" : "row"
	}),
	rootBgDark: (props) => ({
		backgroundColor: darken(props.color === "primary" ? theme.palette.primary.main : theme.palette.secondary.main, .2),
		color: theme.palette.getContrastText(props.color === "primary" ? theme.palette.primary.main : theme.palette.secondary.main)
	}),
	rootBgSoft: (props) => ({ backgroundColor: alpha(props.color === "primary" ? theme.palette.primary.main : theme.palette.secondary.main, .15) }),
	rootBgCustom: (props) => ({
		backgroundColor: props.background,
		color: props.color
	})
}));
const EntityHeaderContainer = (props) => {
	const $ = c(13);
	const { children, showSeperator, background } = props;
	const arrayChildren = Children.toArray(children);
	const classes = useStyles(props);
	const t0 = background === "light" || !background;
	const t1 = background === "dark";
	const t2 = background === "soft";
	const t3 = background && background !== "light" && background !== "dark" && background !== "soft";
	let t4;
	if ($[0] !== classes.root || $[1] !== classes.rootBg || $[2] !== classes.rootBgCustom || $[3] !== classes.rootBgDark || $[4] !== classes.rootBgSoft || $[5] !== t0 || $[6] !== t1 || $[7] !== t2 || $[8] !== t3) {
		t4 = clsx({
			[classes.root]: true,
			[classes.rootBg]: t0,
			[classes.rootBgDark]: t1,
			[classes.rootBgSoft]: t2,
			[classes.rootBgCustom]: t3
		});
		$[0] = classes.root;
		$[1] = classes.rootBg;
		$[2] = classes.rootBgCustom;
		$[3] = classes.rootBgDark;
		$[4] = classes.rootBgSoft;
		$[5] = t0;
		$[6] = t1;
		$[7] = t2;
		$[8] = t3;
		$[9] = t4;
	} else t4 = $[9];
	const t5 = Children.map(arrayChildren, (child, index) => {
		const isLast = index === arrayChildren.length - 1;
		return /* @__PURE__ */ React.createElement(React.Fragment, null, cloneElement(child, { isLast }), !isLast && showSeperator && /* @__PURE__ */ React.createElement(Divider, {
			orientation: "vertical",
			flexItem: true
		}));
	});
	let t6;
	if ($[10] !== t4 || $[11] !== t5) {
		t6 = /* @__PURE__ */ React.createElement("div", { className: t4 }, t5);
		$[10] = t4;
		$[11] = t5;
		$[12] = t6;
	} else t6 = $[12];
	return t6;
};
EntityHeaderContainer.propTypes = {
	children: PropTypes.node.isRequired,
	showSeperator: PropTypes.bool,
	background: PropTypes.oneOf([
		"light",
		"dark",
		"soft"
	]),
	direction: PropTypes.oneOf(["row", "column"]),
	color: PropTypes.oneOf(["primary", "secondary"])
};
EntityHeaderContainer.defaultProps = {
	showSeperator: true,
	background: "light",
	direction: "row",
	color: "primary"
};
//#endregion
export { EntityHeaderContainer };

//# sourceMappingURL=EntityHeaderContainer.mjs.map