import { FluentTextFieldAutoComplete } from "../../../UI/inputs/textField/FluentTextFieldAutoComplete.mjs";
import { SideSheet } from "../../../UI/surfaces/SideSheet.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
//#region src/udp/pages/UdpGridPanelManagementSidesheet/UdpGridPanelManagementSidesheet.jsx
/**
* @param {object} props
* @param {object} props.selectedGridPanel
* @param {string} props.environment
* @param {boolean} props.open
* @param {Function} props.onClose
* @param {Function} props.onSubmit
* @param {string} props.title
* @param {any[]} props.grids
* @param {any[]} props.panels
* @param {any} props.grid
* @param {Function} props.setGrid
* @param {any} props.panel
* @param {Function} props.setPanel
* @returns {JSX.Element}
*/
const UdpGridPanelManagementSidesheet = (props) => {
	const $ = c(30);
	let grid;
	let grids;
	let onClose;
	let onSubmit;
	let open;
	let panel;
	let panels;
	let setGrid;
	let setPanel;
	let sheetProps;
	let title;
	if ($[0] !== props) {
		const { selectedGridPanel, environment, open: t0, onClose: t1, onSubmit: t2, title: t3, grids: t4, panels: t5, grid: t6, setGrid: t7, panel: t8, setPanel: t9, ...t10 } = props;
		open = t0;
		onClose = t1;
		onSubmit = t2;
		title = t3;
		grids = t4;
		panels = t5;
		grid = t6;
		setGrid = t7;
		panel = t8;
		setPanel = t9;
		sheetProps = t10;
		$[0] = props;
		$[1] = grid;
		$[2] = grids;
		$[3] = onClose;
		$[4] = onSubmit;
		$[5] = open;
		$[6] = panel;
		$[7] = panels;
		$[8] = setGrid;
		$[9] = setPanel;
		$[10] = sheetProps;
		$[11] = title;
	} else {
		grid = $[1];
		grids = $[2];
		onClose = $[3];
		onSubmit = $[4];
		open = $[5];
		panel = $[6];
		panels = $[7];
		setGrid = $[8];
		setPanel = $[9];
		sheetProps = $[10];
		title = $[11];
	}
	let t0;
	if ($[12] !== onClose) {
		t0 = () => onClose();
		$[12] = onClose;
		$[13] = t0;
	} else t0 = $[13];
	let t1;
	if ($[14] !== grid || $[15] !== grids || $[16] !== setGrid) {
		t1 = /* @__PURE__ */ React.createElement(FluentTextFieldAutoComplete, {
			id: "grid",
			label: "Grid",
			options: grids,
			optionKey: "name",
			onChange: setGrid,
			value: grid
		});
		$[14] = grid;
		$[15] = grids;
		$[16] = setGrid;
		$[17] = t1;
	} else t1 = $[17];
	let t2;
	if ($[18] !== panel || $[19] !== panels || $[20] !== setPanel) {
		t2 = /* @__PURE__ */ React.createElement(FluentTextFieldAutoComplete, {
			id: "panel",
			label: "Panel",
			options: panels,
			optionKey: "name",
			onChange: setPanel,
			value: panel
		});
		$[18] = panel;
		$[19] = panels;
		$[20] = setPanel;
		$[21] = t2;
	} else t2 = $[21];
	let t3;
	if ($[22] !== onSubmit || $[23] !== open || $[24] !== sheetProps || $[25] !== t0 || $[26] !== t1 || $[27] !== t2 || $[28] !== title) {
		t3 = /* @__PURE__ */ React.createElement(SideSheet, {
			open,
			onClose: t0,
			width: 400,
			title,
			buttonLabel: "Save",
			onSubmit,
			...sheetProps
		}, t1, t2);
		$[22] = onSubmit;
		$[23] = open;
		$[24] = sheetProps;
		$[25] = t0;
		$[26] = t1;
		$[27] = t2;
		$[28] = title;
		$[29] = t3;
	} else t3 = $[29];
	return t3;
};
//#endregion
export { UdpGridPanelManagementSidesheet as default };

//# sourceMappingURL=UdpGridPanelManagementSidesheet.mjs.map