import { RatioVisulization } from "./RatioVisulization.mjs";
import { GaugeGraph } from "./GaugeGraph.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { useTheme } from "@material-ui/core";
import { MuiVegaLite } from "@material-vega/material-ui";
//#region src/UI/dataDisplay/visualization/AmbientVisualizer.jsx
const AmbientVisualizer = (t0) => {
	const $ = c(155);
	const { values, visualization, verticalBarWidth: t1, verticalBarColor: t2, verticalBarBand: t3, verticalBarBandThin: t4, styleThin, verticalBarXfield: t5, verticalBarXtype: t6, verticalBarYfield: t7, verticalBarYtype: t8, horizontalBarWidth: t9, horizontalBarHeight: t10, horizontalBarColor: t11, horizontalBarBand: t12, horizontalBarBandThin: t13, horizontalBarXfield: t14, horizontalBarXtype: t15, horizontalBarYfield: t16, horizontalBarYtype: t17, areaLineHeight: t18, areaLineWidth: t19, areaLineXtimeUnit: t20, areaLineXfield: t21, areaLineXtype: t22, areaLineXaxisFormat: t23, areaLineYaggergate: t24, areaLineYfield: t25, areaLineType: t26, layeredChartLayer, donutChartInnerRadius: t27, pieThetaField, pieThetaType: t28, pieColorField, pieColorType: t29, tooltip, encodingTooltip: t30, chartWidth, chartHeight, xTitle, yTitle, linePoint, lineXtimeUnit, lineXfield, lineXtype, lineYaggergate, lineYfield, lineYtype, lineColorField, lineColorType: t31, vegaLiteSpecProps: t32, gaugeTitle: t33, gaugeUnitLabel: t34, gaugeLegend: t35, gaugeShowTicks: t36, gaugeTicksNumber, gaugeBackgroundColor: t37, gaugeFillColor: t38, gaugeValue: t39, gaugeMinValue: t40, gaugeMaxValue: t41 } = t0;
	const verticalBarWidth = t1 === void 0 ? 70 : t1;
	const verticalBarColor = t2 === void 0 ? "primary" : t2;
	const verticalBarBand = t3 === void 0 ? .9 : t3;
	const verticalBarBandThin = t4 === void 0 ? .1 : t4;
	const verticalBarXfield = t5 === void 0 ? "category" : t5;
	const verticalBarXtype = t6 === void 0 ? "nominal" : t6;
	const verticalBarYfield = t7 === void 0 ? "amount" : t7;
	const verticalBarYtype = t8 === void 0 ? "quantitative" : t8;
	const horizontalBarWidth = t9 === void 0 ? 265 : t9;
	const horizontalBarHeight = t10 === void 0 ? 35 : t10;
	const horizontalBarBand = t12 === void 0 ? .7 : t12;
	const horizontalBarBandThin = t13 === void 0 ? .1 : t13;
	const horizontalBarXfield = t14 === void 0 ? "amount" : t14;
	const horizontalBarXtype = t15 === void 0 ? "quantitative" : t15;
	const horizontalBarYfield = t16 === void 0 ? "category" : t16;
	const horizontalBarYtype = t17 === void 0 ? "nominal" : t17;
	const areaLineHeight = t18 === void 0 ? 150 : t18;
	const areaLineWidth = t19 === void 0 ? 350 : t19;
	const areaLineXtimeUnit = t20 === void 0 ? "yearmonth" : t20;
	const areaLineXfield = t21 === void 0 ? "date" : t21;
	const areaLineXtype = t22 === void 0 ? "temporal" : t22;
	const areaLineXaxisFormat = t23 === void 0 ? "%Y" : t23;
	const areaLineYaggergate = t24 === void 0 ? "sum" : t24;
	const areaLineYfield = t25 === void 0 ? "count" : t25;
	const areaLineType = t26 === void 0 ? "quantitative" : t26;
	const donutChartInnerRadius = t27 === void 0 ? 50 : t27;
	const pieThetaType = t28 === void 0 ? "quantitative" : t28;
	const pieColorType = t29 === void 0 ? "nominal" : t29;
	const encodingTooltip = t30 === void 0 ? null : t30;
	const lineColorType = t31 === void 0 ? "nominal" : t31;
	let t42;
	if ($[0] !== t32) {
		t42 = t32 === void 0 ? {} : t32;
		$[0] = t32;
		$[1] = t42;
	} else t42 = $[1];
	const vegaLiteSpecProps = t42;
	const gaugeTitle = t33 === void 0 ? "" : t33;
	const gaugeUnitLabel = t34 === void 0 ? "" : t34;
	const gaugeLegend = t35 === void 0 ? "" : t35;
	const gaugeShowTicks = t36 === void 0 ? false : t36;
	const gaugeBackgroundColor = t37 === void 0 ? "secondary" : t37;
	const gaugeFillColor = t38 === void 0 ? "warning" : t38;
	const gaugeValue = t39 === void 0 ? 0 : t39;
	const gaugeMinValue = t40 === void 0 ? 0 : t40;
	const gaugeMaxValue = t41 === void 0 ? 100 : t41;
	const theme = useTheme();
	let t43;
	if ($[2] !== verticalBarWidth) {
		t43 = { step: verticalBarWidth };
		$[2] = verticalBarWidth;
		$[3] = t43;
	} else t43 = $[3];
	let t44;
	if ($[4] !== values) {
		t44 = { values };
		$[4] = values;
		$[5] = t44;
	} else t44 = $[5];
	const t45 = verticalBarColor === "primary" ? theme.palette.primary.main : theme.palette.secondary.main;
	let t46;
	if ($[6] !== t45) {
		t46 = { value: t45 };
		$[6] = t45;
		$[7] = t46;
	} else t46 = $[7];
	let t47;
	if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
		t47 = { ticks: false };
		$[8] = t47;
	} else t47 = $[8];
	const t48 = styleThin ? verticalBarBandThin : verticalBarBand;
	let t49;
	if ($[9] !== t48 || $[10] !== verticalBarXfield || $[11] !== verticalBarXtype) {
		t49 = {
			field: verticalBarXfield,
			type: verticalBarXtype,
			axis: t47,
			band: t48
		};
		$[9] = t48;
		$[10] = verticalBarXfield;
		$[11] = verticalBarXtype;
		$[12] = t49;
	} else t49 = $[12];
	let t50;
	if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
		t50 = { format: "" };
		$[13] = t50;
	} else t50 = $[13];
	let t51;
	if ($[14] !== verticalBarYfield || $[15] !== verticalBarYtype) {
		t51 = {
			field: verticalBarYfield,
			type: verticalBarYtype,
			axis: t50
		};
		$[14] = verticalBarYfield;
		$[15] = verticalBarYtype;
		$[16] = t51;
	} else t51 = $[16];
	let t52;
	if ($[17] !== encodingTooltip || $[18] !== t46 || $[19] !== t49 || $[20] !== t51) {
		t52 = {
			color: t46,
			x: t49,
			y: t51,
			tooltip: encodingTooltip
		};
		$[17] = encodingTooltip;
		$[18] = t46;
		$[19] = t49;
		$[20] = t51;
		$[21] = t52;
	} else t52 = $[21];
	let t53;
	if ($[22] !== t43 || $[23] !== t44 || $[24] !== t52 || $[25] !== vegaLiteSpecProps) {
		t53 = /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: "verticalBarChart",
			actions: false,
			spec: {
				$schema: "https://vega.github.io/schema/vega-lite/v4.json",
				width: t43,
				data: t44,
				mark: "bar",
				encoding: t52,
				...vegaLiteSpecProps
			}
		});
		$[22] = t43;
		$[23] = t44;
		$[24] = t52;
		$[25] = vegaLiteSpecProps;
		$[26] = t53;
	} else t53 = $[26];
	const verticalBar = t53;
	let t54;
	if ($[27] !== horizontalBarHeight) {
		t54 = { step: horizontalBarHeight };
		$[27] = horizontalBarHeight;
		$[28] = t54;
	} else t54 = $[28];
	let t55;
	if ($[29] !== values) {
		t55 = { values };
		$[29] = values;
		$[30] = t55;
	} else t55 = $[30];
	let t56;
	if ($[31] !== theme.palette.secondary.main) {
		t56 = { value: theme.palette.secondary.main };
		$[31] = theme.palette.secondary.main;
		$[32] = t56;
	} else t56 = $[32];
	let t57;
	if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
		t57 = { format: "s" };
		$[33] = t57;
	} else t57 = $[33];
	let t58;
	if ($[34] !== horizontalBarXfield || $[35] !== horizontalBarXtype) {
		t58 = {
			field: horizontalBarXfield,
			type: horizontalBarXtype,
			axis: t57
		};
		$[34] = horizontalBarXfield;
		$[35] = horizontalBarXtype;
		$[36] = t58;
	} else t58 = $[36];
	const t59 = styleThin ? horizontalBarBandThin : horizontalBarBand;
	let t60;
	if ($[37] !== horizontalBarYfield || $[38] !== horizontalBarYtype || $[39] !== t59) {
		t60 = {
			field: horizontalBarYfield,
			type: horizontalBarYtype,
			band: t59
		};
		$[37] = horizontalBarYfield;
		$[38] = horizontalBarYtype;
		$[39] = t59;
		$[40] = t60;
	} else t60 = $[40];
	let t61;
	if ($[41] !== encodingTooltip || $[42] !== t56 || $[43] !== t58 || $[44] !== t60) {
		t61 = {
			color: t56,
			x: t58,
			y: t60,
			tooltip: encodingTooltip
		};
		$[41] = encodingTooltip;
		$[42] = t56;
		$[43] = t58;
		$[44] = t60;
		$[45] = t61;
	} else t61 = $[45];
	let t62;
	if ($[46] !== horizontalBarWidth || $[47] !== t54 || $[48] !== t55 || $[49] !== t61 || $[50] !== vegaLiteSpecProps) {
		t62 = /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: "horizontalBarChart",
			spec: {
				$schema: "https://vega.github.io/schema/vega-lite/v4.json",
				height: t54,
				width: horizontalBarWidth,
				data: t55,
				mark: "bar",
				encoding: t61,
				...vegaLiteSpecProps
			}
		});
		$[46] = horizontalBarWidth;
		$[47] = t54;
		$[48] = t55;
		$[49] = t61;
		$[50] = vegaLiteSpecProps;
		$[51] = t62;
	} else t62 = $[51];
	const horizontalBar = t62;
	let t63;
	if ($[52] !== values) {
		t63 = { values };
		$[52] = values;
		$[53] = t63;
	} else t63 = $[53];
	let t64;
	if ($[54] !== areaLineXaxisFormat) {
		t64 = { format: areaLineXaxisFormat };
		$[54] = areaLineXaxisFormat;
		$[55] = t64;
	} else t64 = $[55];
	let t65;
	if ($[56] !== areaLineXfield || $[57] !== areaLineXtimeUnit || $[58] !== areaLineXtype || $[59] !== t64) {
		t65 = {
			timeUnit: areaLineXtimeUnit,
			field: areaLineXfield,
			type: areaLineXtype,
			axis: t64
		};
		$[56] = areaLineXfield;
		$[57] = areaLineXtimeUnit;
		$[58] = areaLineXtype;
		$[59] = t64;
		$[60] = t65;
	} else t65 = $[60];
	let t66;
	if ($[61] !== areaLineType || $[62] !== areaLineYaggergate || $[63] !== areaLineYfield) {
		t66 = {
			aggregate: areaLineYaggergate,
			field: areaLineYfield,
			type: areaLineType
		};
		$[61] = areaLineType;
		$[62] = areaLineYaggergate;
		$[63] = areaLineYfield;
		$[64] = t66;
	} else t66 = $[64];
	let t67;
	if ($[65] !== encodingTooltip || $[66] !== t65 || $[67] !== t66) {
		t67 = {
			x: t65,
			y: t66,
			tooltip: encodingTooltip
		};
		$[65] = encodingTooltip;
		$[66] = t65;
		$[67] = t66;
		$[68] = t67;
	} else t67 = $[68];
	let t68;
	if ($[69] !== areaLineHeight || $[70] !== areaLineWidth || $[71] !== t63 || $[72] !== t67 || $[73] !== vegaLiteSpecProps) {
		t68 = /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: "areaLineChart",
			spec: {
				$schema: "https://vega.github.io/schema/vega-lite/v4.json",
				width: areaLineWidth,
				height: areaLineHeight,
				data: t63,
				mark: "area",
				encoding: t67,
				...vegaLiteSpecProps
			}
		});
		$[69] = areaLineHeight;
		$[70] = areaLineWidth;
		$[71] = t63;
		$[72] = t67;
		$[73] = vegaLiteSpecProps;
		$[74] = t68;
	} else t68 = $[74];
	const areaLine = t68;
	let t69;
	if ($[75] === Symbol.for("react.memo_cache_sentinel")) {
		t69 = /* @__PURE__ */ React.createElement(RatioVisulization, {
			m: 15,
			n: 1
		});
		$[75] = t69;
	} else t69 = $[75];
	const numberRatio = t69;
	let t70;
	if ($[76] !== values) {
		t70 = values ? { values } : null;
		$[76] = values;
		$[77] = t70;
	} else t70 = $[77];
	let t71;
	if ($[78] === Symbol.for("react.memo_cache_sentinel")) {
		t71 = { legend: {
			orient: "bottom",
			layout: { bottom: { anchor: "middle" } }
		} };
		$[78] = t71;
	} else t71 = $[78];
	let t72;
	if ($[79] !== chartHeight || $[80] !== chartWidth || $[81] !== layeredChartLayer || $[82] !== t70 || $[83] !== vegaLiteSpecProps) {
		t72 = /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: "verticalBarChart",
			actions: false,
			spec: {
				$schema: "https://vega.github.io/schema/vega-lite/v5.json",
				width: chartWidth,
				height: chartHeight,
				autosize: "fit",
				data: t70,
				layer: layeredChartLayer,
				config: t71,
				...vegaLiteSpecProps
			}
		});
		$[79] = chartHeight;
		$[80] = chartWidth;
		$[81] = layeredChartLayer;
		$[82] = t70;
		$[83] = vegaLiteSpecProps;
		$[84] = t72;
	} else t72 = $[84];
	const layeredChart = t72;
	const t73 = visualization === "pie" ? "pieChart" : "donutChart";
	let t74;
	if ($[85] !== values) {
		t74 = { values };
		$[85] = values;
		$[86] = t74;
	} else t74 = $[86];
	let t75;
	if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
		t75 = { legend: {
			orient: "bottom",
			layout: { bottom: { anchor: "middle" } }
		} };
		$[87] = t75;
	} else t75 = $[87];
	const t76 = visualization === "pie" ? 0 : donutChartInnerRadius;
	let t77;
	if ($[88] !== t76 || $[89] !== tooltip) {
		t77 = {
			type: "arc",
			innerRadius: t76,
			tooltip
		};
		$[88] = t76;
		$[89] = tooltip;
		$[90] = t77;
	} else t77 = $[90];
	let t78;
	if ($[91] !== pieThetaField || $[92] !== pieThetaType) {
		t78 = {
			field: pieThetaField,
			type: pieThetaType
		};
		$[91] = pieThetaField;
		$[92] = pieThetaType;
		$[93] = t78;
	} else t78 = $[93];
	let t79;
	if ($[94] !== pieColorField || $[95] !== pieColorType) {
		t79 = {
			field: pieColorField,
			type: pieColorType
		};
		$[94] = pieColorField;
		$[95] = pieColorType;
		$[96] = t79;
	} else t79 = $[96];
	let t80;
	if ($[97] !== encodingTooltip || $[98] !== t78 || $[99] !== t79) {
		t80 = {
			theta: t78,
			color: t79,
			tooltip: encodingTooltip
		};
		$[97] = encodingTooltip;
		$[98] = t78;
		$[99] = t79;
		$[100] = t80;
	} else t80 = $[100];
	let t81;
	if ($[101] !== chartHeight || $[102] !== chartWidth || $[103] !== t74 || $[104] !== t77 || $[105] !== t80 || $[106] !== vegaLiteSpecProps) {
		t81 = {
			$schema: "https://vega.github.io/schema/vega-lite/v5.json",
			width: chartWidth,
			height: chartHeight,
			data: t74,
			config: t75,
			mark: t77,
			encoding: t80,
			...vegaLiteSpecProps
		};
		$[101] = chartHeight;
		$[102] = chartWidth;
		$[103] = t74;
		$[104] = t77;
		$[105] = t80;
		$[106] = vegaLiteSpecProps;
		$[107] = t81;
	} else t81 = $[107];
	let t82;
	if ($[108] !== t73 || $[109] !== t81) {
		t82 = /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: t73,
			actions: false,
			spec: t81
		});
		$[108] = t73;
		$[109] = t81;
		$[110] = t82;
	} else t82 = $[110];
	const pie = t82;
	let t83;
	if ($[111] !== values) {
		t83 = { values };
		$[111] = values;
		$[112] = t83;
	} else t83 = $[112];
	let t84;
	if ($[113] !== linePoint || $[114] !== tooltip) {
		t84 = {
			type: "line",
			point: linePoint,
			tooltip
		};
		$[113] = linePoint;
		$[114] = tooltip;
		$[115] = t84;
	} else t84 = $[115];
	let t85;
	if ($[116] === Symbol.for("react.memo_cache_sentinel")) {
		t85 = { legend: {
			orient: "bottom",
			layout: { bottom: { anchor: "middle" } }
		} };
		$[116] = t85;
	} else t85 = $[116];
	let t86;
	if ($[117] !== lineXfield || $[118] !== lineXtimeUnit || $[119] !== lineXtype || $[120] !== xTitle) {
		t86 = {
			field: lineXfield,
			type: lineXtype,
			timeUnit: lineXtimeUnit,
			title: xTitle
		};
		$[117] = lineXfield;
		$[118] = lineXtimeUnit;
		$[119] = lineXtype;
		$[120] = xTitle;
		$[121] = t86;
	} else t86 = $[121];
	let t87;
	if ($[122] !== lineYaggergate || $[123] !== lineYfield || $[124] !== lineYtype || $[125] !== yTitle) {
		t87 = {
			field: lineYfield,
			type: lineYtype,
			title: yTitle,
			aggregate: lineYaggergate
		};
		$[122] = lineYaggergate;
		$[123] = lineYfield;
		$[124] = lineYtype;
		$[125] = yTitle;
		$[126] = t87;
	} else t87 = $[126];
	let t88;
	if ($[127] !== lineColorField || $[128] !== lineColorType) {
		t88 = lineColorField ? {
			field: lineColorField,
			type: lineColorType
		} : null;
		$[127] = lineColorField;
		$[128] = lineColorType;
		$[129] = t88;
	} else t88 = $[129];
	let t89;
	if ($[130] !== encodingTooltip || $[131] !== t86 || $[132] !== t87 || $[133] !== t88) {
		t89 = {
			x: t86,
			y: t87,
			color: t88,
			tooltip: encodingTooltip
		};
		$[130] = encodingTooltip;
		$[131] = t86;
		$[132] = t87;
		$[133] = t88;
		$[134] = t89;
	} else t89 = $[134];
	let t90;
	if ($[135] !== chartHeight || $[136] !== chartWidth || $[137] !== t83 || $[138] !== t84 || $[139] !== t89 || $[140] !== vegaLiteSpecProps) {
		t90 = /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: "lineChart",
			actions: false,
			spec: {
				$schema: "https://vega.github.io/schema/vega-lite/v5.json",
				width: chartWidth,
				height: chartHeight,
				autosize: "fit",
				data: t83,
				mark: t84,
				config: t85,
				encoding: t89,
				...vegaLiteSpecProps
			}
		});
		$[135] = chartHeight;
		$[136] = chartWidth;
		$[137] = t83;
		$[138] = t84;
		$[139] = t89;
		$[140] = vegaLiteSpecProps;
		$[141] = t90;
	} else t90 = $[141];
	const line = t90;
	let t91;
	if ($[142] !== chartHeight || $[143] !== chartWidth || $[144] !== gaugeBackgroundColor || $[145] !== gaugeFillColor || $[146] !== gaugeLegend || $[147] !== gaugeMaxValue || $[148] !== gaugeMinValue || $[149] !== gaugeShowTicks || $[150] !== gaugeTicksNumber || $[151] !== gaugeTitle || $[152] !== gaugeUnitLabel || $[153] !== gaugeValue) {
		t91 = /* @__PURE__ */ React.createElement(GaugeGraph, {
			title: gaugeTitle,
			unitLabel: gaugeUnitLabel,
			legend: gaugeLegend,
			showTicks: gaugeShowTicks,
			ticksNumber: gaugeTicksNumber,
			backgroundColor: gaugeBackgroundColor,
			fillColor: gaugeFillColor,
			value: gaugeValue,
			minValue: gaugeMinValue,
			maxValue: gaugeMaxValue,
			width: chartWidth,
			height: chartHeight
		});
		$[142] = chartHeight;
		$[143] = chartWidth;
		$[144] = gaugeBackgroundColor;
		$[145] = gaugeFillColor;
		$[146] = gaugeLegend;
		$[147] = gaugeMaxValue;
		$[148] = gaugeMinValue;
		$[149] = gaugeShowTicks;
		$[150] = gaugeTicksNumber;
		$[151] = gaugeTitle;
		$[152] = gaugeUnitLabel;
		$[153] = gaugeValue;
		$[154] = t91;
	} else t91 = $[154];
	const gauge = t91;
	let type = "";
	bb0: switch (visualization) {
		case "verticalBar":
			type = verticalBar;
			break bb0;
		case "horizontalBar":
			type = horizontalBar;
			break bb0;
		case "areaLine":
			type = areaLine;
			break bb0;
		case "numberRatio":
			type = numberRatio;
			break bb0;
		case "layeredChart":
			type = layeredChart;
			break bb0;
		case "donut":
			type = pie;
			break bb0;
		case "pie":
			type = pie;
			break bb0;
		case "line":
			type = line;
			break bb0;
		case "gauge":
			type = gauge;
			break bb0;
		default:
	}
	return type;
};
//#endregion
export { AmbientVisualizer };

//# sourceMappingURL=AmbientVisualizer.mjs.map