import { UdpDistributionChart } from "../../../charts/amcharts/UdpDistributionChart.mjs";
import { UdpDonutChart } from "../../../charts/amcharts/UdpDonutChart.mjs";
import { UdpLineChart } from "../../../charts/amcharts/UdpLineChart.mjs";
import { UdpSankeyChart } from "../../../charts/amcharts/UdpSankeyChart.mjs";
import { UdpXYMultiSeriesChart } from "../../../charts/amcharts/UdpXYMultiSeriesChart.mjs";
import { UdpBarChart } from "../../../charts/amcharts/UdpBarChart.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { makeStyles } from "@material-ui/core";
//#region src/UI/dataDisplay/visualization/amCharts/AmChart.tsx
const useStyles = makeStyles(() => ({ chartWrapper: {
	height: "100%",
	width: "100%"
} }));
const AmChart = (props) => {
	const $ = c(43);
	let chartType;
	let data;
	let dataMappingField;
	let labelFormat;
	let otherProps;
	let tooltipTextFormat;
	if ($[0] !== props) {
		({chartType, data, dataMappingField, labelFormat, tooltipTextFormat, ...otherProps} = props);
		$[0] = props;
		$[1] = chartType;
		$[2] = data;
		$[3] = dataMappingField;
		$[4] = labelFormat;
		$[5] = otherProps;
		$[6] = tooltipTextFormat;
	} else {
		chartType = $[1];
		data = $[2];
		dataMappingField = $[3];
		labelFormat = $[4];
		otherProps = $[5];
		tooltipTextFormat = $[6];
	}
	const classes = useStyles();
	let t0;
	bb0: switch (chartType) {
		case "sankey": {
			const t1 = dataMappingField?.valueField;
			const t2 = dataMappingField?.targetIdField;
			const t3 = dataMappingField?.sourceIdField;
			let t4;
			if ($[7] !== data || $[8] !== labelFormat || $[9] !== otherProps || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 || $[13] !== tooltipTextFormat) {
				t4 = /* @__PURE__ */ React.createElement(UdpSankeyChart, {
					data,
					valueField: t1,
					targetIdField: t2,
					sourceIdField: t3,
					labelFormat,
					tooltipTextFormat,
					...otherProps
				});
				$[7] = data;
				$[8] = labelFormat;
				$[9] = otherProps;
				$[10] = t1;
				$[11] = t2;
				$[12] = t3;
				$[13] = tooltipTextFormat;
				$[14] = t4;
			} else t4 = $[14];
			t0 = t4;
			break bb0;
		}
		case "bar": {
			const t1 = dataMappingField?.valueField;
			const t2 = dataMappingField?.labelField;
			let t3;
			if ($[15] !== data || $[16] !== otherProps || $[17] !== t1 || $[18] !== t2) {
				t3 = /* @__PURE__ */ React.createElement(UdpBarChart, {
					data,
					valueField: t1,
					labelField: t2,
					...otherProps
				});
				$[15] = data;
				$[16] = otherProps;
				$[17] = t1;
				$[18] = t2;
				$[19] = t3;
			} else t3 = $[19];
			t0 = t3;
			break bb0;
		}
		case "donut": {
			const t1 = dataMappingField?.valueField;
			const t2 = dataMappingField?.labelField;
			let t3;
			if ($[20] !== data || $[21] !== otherProps || $[22] !== t1 || $[23] !== t2) {
				t3 = /* @__PURE__ */ React.createElement(UdpDonutChart, {
					data,
					valueField: t1,
					labelField: t2,
					hideLegend: false,
					...otherProps
				});
				$[20] = data;
				$[21] = otherProps;
				$[22] = t1;
				$[23] = t2;
				$[24] = t3;
			} else t3 = $[24];
			t0 = t3;
			break bb0;
		}
		case "line": {
			const t1 = dataMappingField?.xAxisField;
			const t2 = dataMappingField?.yAxisField;
			let t3;
			if ($[25] !== data || $[26] !== otherProps || $[27] !== t1 || $[28] !== t2) {
				t3 = /* @__PURE__ */ React.createElement(UdpLineChart, {
					data,
					xAxisField: t1,
					yAxisField: t2,
					...otherProps
				});
				$[25] = data;
				$[26] = otherProps;
				$[27] = t1;
				$[28] = t2;
				$[29] = t3;
			} else t3 = $[29];
			t0 = t3;
			break bb0;
		}
		case "distribution": {
			const t1 = dataMappingField?.valueField;
			let t2;
			if ($[30] !== data || $[31] !== otherProps || $[32] !== t1) {
				t2 = /* @__PURE__ */ React.createElement(UdpDistributionChart, {
					data,
					valueField: t1,
					...otherProps
				});
				$[30] = data;
				$[31] = otherProps;
				$[32] = t1;
				$[33] = t2;
			} else t2 = $[33];
			t0 = t2;
			break bb0;
		}
		case "xyMultiSeries": {
			let t1;
			let t2;
			let t3;
			if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
				t1 = [];
				t2 = [];
				t3 = [];
				$[34] = t1;
				$[35] = t2;
				$[36] = t3;
			} else {
				t1 = $[34];
				t2 = $[35];
				t3 = $[36];
			}
			let t4;
			if ($[37] !== data || $[38] !== otherProps) {
				t4 = /* @__PURE__ */ React.createElement(UdpXYMultiSeriesChart, {
					hideLegend: false,
					xAxes: t1,
					yAxes: t2,
					series: t3,
					data,
					...otherProps
				});
				$[37] = data;
				$[38] = otherProps;
				$[39] = t4;
			} else t4 = $[39];
			t0 = t4;
			break bb0;
		}
		default: t0 = null;
	}
	const chart = t0;
	let t1;
	if ($[40] !== chart || $[41] !== classes.chartWrapper) {
		t1 = /* @__PURE__ */ React.createElement("div", { className: classes.chartWrapper }, chart);
		$[40] = chart;
		$[41] = classes.chartWrapper;
		$[42] = t1;
	} else t1 = $[42];
	return t1;
};
//#endregion
export { AmChart };

//# sourceMappingURL=AmChart.mjs.map