import { c } from "react-compiler-runtime";
import React from "react";
import { DateTime } from "luxon";
import { KeyboardTimePicker, MuiPickersUtilsProvider } from "@material-ui/pickers";
import DateFnsUtils from "@date-io/date-fns";
//#region src/UI/inputs/datetimes/TimeField.jsx
/**
* TextField for time input
*/
const TimeField = (props) => {
	const $ = c(12);
	let onChangeProp;
	let other;
	let valueProp;
	if ($[0] !== props) {
		({onChange: onChangeProp, value: valueProp, ...other} = props);
		$[0] = props;
		$[1] = onChangeProp;
		$[2] = other;
		$[3] = valueProp;
	} else {
		onChangeProp = $[1];
		other = $[2];
		valueProp = $[3];
	}
	"HH:mm".split(/'([^']*)'/).map(_temp).join("");
	const isValidDate = _temp2;
	let t0;
	if ($[4] !== onChangeProp) {
		t0 = (value) => onChangeProp && onChangeProp(isValidDate(value) ? value : void 0);
		$[4] = onChangeProp;
		$[5] = t0;
	} else t0 = $[5];
	const onChange = t0;
	console.log(valueProp);
	let t1;
	if ($[6] !== valueProp) {
		t1 = isValidDate(valueProp) ? DateTime.fromISO(valueProp.toISOString()) : null;
		$[6] = valueProp;
		$[7] = t1;
	} else t1 = $[7];
	const value_0 = t1;
	let t2;
	if ($[8] !== onChange || $[9] !== other || $[10] !== value_0) {
		t2 = /* @__PURE__ */ React.createElement(MuiPickersUtilsProvider, { utils: DateFnsUtils }, /* @__PURE__ */ React.createElement(KeyboardTimePicker, {
			ampm: true,
			mask: "__:__ _M",
			variant: "inline",
			autoOk: true,
			onChange,
			value: value_0,
			...other
		}));
		$[8] = onChange;
		$[9] = other;
		$[10] = value_0;
		$[11] = t2;
	} else t2 = $[11];
	return t2;
};
function _temp(m, i) {
	return i % 2 === 0 ? m.replace(/[a-z]/gi, "_") : m;
}
function _temp2(date) {
	return date instanceof Date && !isNaN(date);
}
//#endregion
export { TimeField };

//# sourceMappingURL=TimeField.mjs.map