import WidgetCard from "../../WidgetCard.mjs";
import { c } from "react-compiler-runtime";
import React, { forwardRef } from "react";
import { Box } from "@material-ui/core";
import { MuiVegaLite } from "@material-vega/material-ui";
//#region src/UI/widgets/library/DensePlotWidget/DensePlotWidget.jsx
const layout = {
	w: {
		default: 2,
		min: 0,
		max: 4
	},
	h: {
		default: 2,
		min: 0,
		max: 4
	}
};
const params = { mode: { defaultValue: "chart" } };
const DensePlotWidget = (props, ref) => {
	const $ = c(24);
	let children;
	let other;
	let params;
	if ($[0] !== props) {
		const { children: t0, params: t1, setParam, ...t2 } = props;
		children = t0;
		params = t1;
		other = t2;
		$[0] = props;
		$[1] = children;
		$[2] = other;
		$[3] = params;
	} else {
		children = $[1];
		other = $[2];
		params = $[3];
	}
	const { mockData, theme } = params;
	const t0 = mockData?.title;
	const t1 = mockData?.description;
	const t2 = mockData?.data;
	let t3;
	if ($[4] !== t2) {
		t3 = { values: t2 };
		$[4] = t2;
		$[5] = t3;
	} else t3 = $[5];
	const t4 = mockData?.xAxisType;
	let t5;
	if ($[6] !== t4) {
		t5 = {
			field: "xAxis",
			type: t4
		};
		$[6] = t4;
		$[7] = t5;
	} else t5 = $[7];
	const t6 = mockData?.yAxisType;
	let t7;
	if ($[8] !== t6) {
		t7 = {
			field: "yAxis",
			type: t6
		};
		$[8] = t6;
		$[9] = t7;
	} else t7 = $[9];
	let t8;
	if ($[10] !== t5 || $[11] !== t7) {
		t8 = {
			x: t5,
			y: t7
		};
		$[10] = t5;
		$[11] = t7;
		$[12] = t8;
	} else t8 = $[12];
	let t9;
	if ($[13] !== t1 || $[14] !== t3 || $[15] !== t8) {
		t9 = /* @__PURE__ */ React.createElement(Box, {
			clone: true,
			flex: 1,
			mt: 1,
			overflow: "hidden"
		}, /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: "scatterplotChart",
			spec: {
				$schema: "https://vega.github.io/schema/vega-lite/v4.json",
				description: t1,
				data: t3,
				mark: "point",
				height: 180,
				encoding: t8
			}
		}));
		$[13] = t1;
		$[14] = t3;
		$[15] = t8;
		$[16] = t9;
	} else t9 = $[16];
	let t10;
	if ($[17] !== children || $[18] !== other || $[19] !== ref || $[20] !== t0 || $[21] !== t9 || $[22] !== theme) {
		t10 = /* @__PURE__ */ React.createElement(WidgetCard, {
			ref,
			...other,
			title: t0,
			theme
		}, t9, children);
		$[17] = children;
		$[18] = other;
		$[19] = ref;
		$[20] = t0;
		$[21] = t9;
		$[22] = theme;
		$[23] = t10;
	} else t10 = $[23];
	return t10;
};
var DensePlotWidget_default = forwardRef(DensePlotWidget);
//#endregion
export { DensePlotWidget_default as default, layout, params };

//# sourceMappingURL=DensePlotWidget.mjs.map