import { TreeViewModeEnums } from "../../enums/unitySystemEnums.mjs";
import { IconButtonWithTooltip } from "../../UI/inputs/buttons/IconButtonWithToolTip.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { makeStyles } from "@material-ui/core";
import clsx from "clsx";
import { BulletedTreeListIcon, ChevronFold10Icon, ChevronUnfold10Icon, EraseToolIcon, SkypeMinusIcon, UploadIcon, ViewListTreeIcon } from "@fluentui/react-icons";
//#region src/inquiry/inquiryBar/InquiryControlList.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		display: "flex",
		justifyContent: "space-between"
	},
	icon: {
		margin: theme.spacing(.5),
		borderRadius: 2,
		width: theme.spacing(1),
		height: theme.spacing(1)
	}
}));
const InquiryControlList = (t0) => {
	const $ = c(40);
	const { remove, expandAll, collapseAll, moveToTop, clearAll, switchTreeViewMode, treeViewMode, hiddenControls: t1, classes: classProps } = t0;
	let t2;
	if ($[0] !== t1) {
		t2 = t1 === void 0 ? [] : t1;
		$[0] = t1;
		$[1] = t2;
	} else t2 = $[1];
	const hiddenControls = t2;
	const classes = useStyles();
	let t3;
	if ($[2] !== classProps) {
		t3 = classProps || {};
		$[2] = classProps;
		$[3] = t3;
	} else t3 = $[3];
	const { inquiryControlListRoot } = t3;
	let t4;
	if ($[4] !== clearAll) {
		t4 = {
			id: "clearAll",
			label: "Clear All",
			icon: SkypeMinusIcon,
			clickFunction: clearAll
		};
		$[4] = clearAll;
		$[5] = t4;
	} else t4 = $[5];
	let t5;
	if ($[6] !== remove) {
		t5 = {
			id: "remove",
			label: "Remove",
			icon: EraseToolIcon,
			clickFunction: remove
		};
		$[6] = remove;
		$[7] = t5;
	} else t5 = $[7];
	let t6;
	if ($[8] !== collapseAll) {
		t6 = {
			id: "collapseAll",
			label: "Collapse All",
			icon: ChevronFold10Icon,
			clickFunction: collapseAll
		};
		$[8] = collapseAll;
		$[9] = t6;
	} else t6 = $[9];
	let t7;
	if ($[10] !== expandAll) {
		t7 = {
			id: "expandAll",
			label: "Expand All",
			icon: ChevronUnfold10Icon,
			clickFunction: expandAll
		};
		$[10] = expandAll;
		$[11] = t7;
	} else t7 = $[11];
	let t8;
	if ($[12] !== moveToTop) {
		t8 = {
			id: "moveToTop",
			label: "Move To Top",
			icon: UploadIcon,
			clickFunction: moveToTop
		};
		$[12] = moveToTop;
		$[13] = t8;
	} else t8 = $[13];
	const t9 = treeViewMode === TreeViewModeEnums.Compact ? "Classic View" : "Compact View";
	const t10 = treeViewMode === TreeViewModeEnums.Compact ? ViewListTreeIcon : BulletedTreeListIcon;
	let t11;
	if ($[14] !== switchTreeViewMode || $[15] !== t10 || $[16] !== t9) {
		t11 = {
			id: "switchTreeViewMode",
			label: t9,
			icon: t10,
			clickFunction: switchTreeViewMode
		};
		$[14] = switchTreeViewMode;
		$[15] = t10;
		$[16] = t9;
		$[17] = t11;
	} else t11 = $[17];
	let t12;
	if ($[18] !== t11 || $[19] !== t4 || $[20] !== t5 || $[21] !== t6 || $[22] !== t7 || $[23] !== t8) {
		t12 = [
			t4,
			t5,
			t6,
			t7,
			t8,
			t11
		];
		$[18] = t11;
		$[19] = t4;
		$[20] = t5;
		$[21] = t6;
		$[22] = t7;
		$[23] = t8;
		$[24] = t12;
	} else t12 = $[24];
	const controlList = t12;
	let t13;
	bb0: {
		if (!controlList) {
			let t14;
			if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
				t14 = [];
				$[25] = t14;
			} else t14 = $[25];
			t13 = t14;
			break bb0;
		}
		let t14;
		if ($[26] !== controlList || $[27] !== hiddenControls) {
			t14 = controlList.filter((control) => !hiddenControls.includes(control.id));
			$[26] = controlList;
			$[27] = hiddenControls;
			$[28] = t14;
		} else t14 = $[28];
		t13 = t14;
	}
	const filteredControlList = t13;
	let t14;
	if ($[29] !== classes.icon) {
		t14 = (t15) => {
			const { title, icon, clickFunction } = t15;
			return /* @__PURE__ */ React.createElement(IconButtonWithTooltip, {
				id: `udpRecord-InquiryControlList-${title.replace(/\s+/g, "")}`,
				udprecordid: `udpRecord-InquiryControlList-${title.replace(/\s+/g, "")}`,
				title,
				className: classes.icon,
				size: "medium",
				onClick: clickFunction,
				icon
			});
		};
		$[29] = classes.icon;
		$[30] = t14;
	} else t14 = $[30];
	const ButtonItem = t14;
	let t15;
	if ($[31] !== classes.root || $[32] !== inquiryControlListRoot) {
		t15 = clsx(classes.root, inquiryControlListRoot);
		$[31] = classes.root;
		$[32] = inquiryControlListRoot;
		$[33] = t15;
	} else t15 = $[33];
	let t16;
	if ($[34] !== ButtonItem || $[35] !== filteredControlList) {
		t16 = filteredControlList.map((item) => /* @__PURE__ */ React.createElement(ButtonItem, {
			title: item.label,
			icon: item.icon,
			clickFunction: item.clickFunction
		}));
		$[34] = ButtonItem;
		$[35] = filteredControlList;
		$[36] = t16;
	} else t16 = $[36];
	let t17;
	if ($[37] !== t15 || $[38] !== t16) {
		t17 = /* @__PURE__ */ React.createElement("div", { className: t15 }, t16);
		$[37] = t15;
		$[38] = t16;
		$[39] = t17;
	} else t17 = $[39];
	return t17;
};
//#endregion
export { InquiryControlList };

//# sourceMappingURL=InquiryControlList.mjs.map