import { __exportAll } from "../../../_virtual/_rolldown/runtime.mjs";
import { BaseTextPropertyWidget } from "./TextPropertyWidget.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { InputAdornment } from "@material-ui/core";
import pluralize from "pluralize";
//#region src/UI/property/widgets/FloatPropertyWidget.jsx
var FloatPropertyWidget_exports = /* @__PURE__ */ __exportAll({ default: () => FloatPropertyWidget });
/**
* `float` property widget
*
* Outputs a type=number TextField with an optional unit and an optional step
*/
const FloatPropertyWidget = (props) => {
	const $ = c(12);
	const { property } = props;
	const { unit, step } = property;
	let endAdornment;
	if (unit) {
		let t0;
		if ($[0] !== unit) {
			t0 = pluralize(unit);
			$[0] = unit;
			$[1] = t0;
		} else t0 = $[1];
		let t1;
		if ($[2] !== t0) {
			t1 = /* @__PURE__ */ React.createElement(InputAdornment, { position: "end" }, t0);
			$[2] = t0;
			$[3] = t1;
		} else t1 = $[3];
		endAdornment = t1;
	}
	const t0 = step ? step : 1;
	let t1;
	if ($[4] !== t0) {
		t1 = { step: t0 };
		$[4] = t0;
		$[5] = t1;
	} else t1 = $[5];
	let t2;
	if ($[6] !== endAdornment) {
		t2 = { endAdornment };
		$[6] = endAdornment;
		$[7] = t2;
	} else t2 = $[7];
	let t3;
	if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
		t3 = /* @__PURE__ */ React.createElement(BaseTextPropertyWidget, {
			type: "number",
			inputProps: t1,
			InputProps: t2,
			...props
		});
		$[8] = props;
		$[9] = t1;
		$[10] = t2;
		$[11] = t3;
	} else t3 = $[11];
	return t3;
};
//#endregion
export { FloatPropertyWidget_exports, FloatPropertyWidget as default };

//# sourceMappingURL=FloatPropertyWidget.mjs.map