import { withEngineComponent } from "./hocs/withEngineComponent.mjs";
import { c } from "react-compiler-runtime";
import { cloneElement } from "react";
import PropTypes from "prop-types";
//#region src/componentSystems/pageRenderer/PageRenderer.js
const PageRenderer = (props) => {
	const $ = c(8);
	const { viewBuilderMetaData, setSideSheetOpen, sideSheetOpen, sideSheetComponent, setSideSheetComponent } = props;
	let t0;
	if ($[0] !== setSideSheetComponent || $[1] !== setSideSheetOpen || $[2] !== sideSheetComponent || $[3] !== sideSheetOpen || $[4] !== viewBuilderMetaData) {
		t0 = () => {
			if (!viewBuilderMetaData || !viewBuilderMetaData.length) return;
			return (viewBuilderMetaData && viewBuilderMetaData.map((item, index) => item?.map((subItem) => withEngineComponent(subItem.component)({
				propsComponent: subItem,
				setSideSheetOpen,
				sideSheetOpen,
				sideSheetComponent,
				setSideSheetComponent
			}))))?.flat() || [];
		};
		$[0] = setSideSheetComponent;
		$[1] = setSideSheetOpen;
		$[2] = sideSheetComponent;
		$[3] = sideSheetOpen;
		$[4] = viewBuilderMetaData;
		$[5] = t0;
	} else t0 = $[5];
	const RenderPageComponentTree = t0;
	let t1;
	if ($[6] !== RenderPageComponentTree) {
		t1 = RenderPageComponentTree()?.map(_temp);
		$[6] = RenderPageComponentTree;
		$[7] = t1;
	} else t1 = $[7];
	return t1;
};
PageRenderer.propTypes = { viewBuilderMetaData: PropTypes.array.isRequired };
function _temp(component, index_0) {
	return cloneElement(component);
}
//#endregion
export { PageRenderer };

//# sourceMappingURL=PageRenderer.mjs.map