import { useReadMetaData } from "../hooks/useReadMetaData.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Box, Grid } from "@material-ui/core";
import { MuiVegaLite } from "@material-vega/material-ui";
//#region src/componentSystems/pageRenderer/wrappers/DonutWrapper.jsx
const DonutWrapper = (props) => {
	const $ = c(13);
	const { propsComponent } = props;
	const { id, columnSize, values } = useReadMetaData(propsComponent);
	const t0 = columnSize?.xs;
	const t1 = columnSize?.sm;
	const t2 = columnSize?.md;
	let t3;
	if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
		t3 = {
			width: "100%",
			minWidth: "100%"
		};
		$[0] = t3;
	} else t3 = $[0];
	let t4;
	if ($[1] !== values) {
		t4 = { values };
		$[1] = values;
		$[2] = t4;
	} else t4 = $[2];
	let t5;
	if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
		t5 = {
			type: "arc",
			innerRadius: 160
		};
		$[3] = t5;
	} else t5 = $[3];
	let t6;
	if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
		t6 = {
			theta: {
				field: "value",
				type: "quantitative"
			},
			color: {
				field: "category",
				type: "nominal"
			}
		};
		$[4] = t6;
	} else t6 = $[4];
	let t7;
	if ($[5] !== t4) {
		t7 = /* @__PURE__ */ React.createElement(Box, {
			mt: 2,
			clone: true,
			overflow: "hidden",
			sx: t3
		}, /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: "verticalBarChart",
			color: "secondary",
			background: "paper",
			autoResize: true,
			actions: false,
			spec: {
				$schema: "https://vega.github.io/schema/vega-lite/v5.json",
				description: "A simple donut chart with embedded data.",
				data: t4,
				mark: t5,
				width: 350,
				height: 350,
				encoding: t6
			}
		}));
		$[5] = t4;
		$[6] = t7;
	} else t7 = $[6];
	let t8;
	if ($[7] !== id || $[8] !== t0 || $[9] !== t1 || $[10] !== t2 || $[11] !== t7) {
		t8 = /* @__PURE__ */ React.createElement(Grid, {
			item: true,
			xs: t0,
			sm: t1,
			md: t2,
			key: id
		}, t7);
		$[7] = id;
		$[8] = t0;
		$[9] = t1;
		$[10] = t2;
		$[11] = t7;
		$[12] = t8;
	} else t8 = $[12];
	return t8;
};
//#endregion
export { DonutWrapper };

//# sourceMappingURL=DonutWrapper.mjs.map