import { createChangeEvent, createFocusEvent } from "./utils/formEvents.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { UdpTimeInput } from "udp-react-stencil-component-library";
//#region src/UI/fluent-web-components/UdpTimeInput.tsx
const UdpTimeInput$1 = (t0) => {
	const $ = c(30);
	let error;
	let helperText;
	let hint;
	let name;
	let onBlur;
	let onChange;
	let onFocus;
	let onInvalidTime;
	let props;
	let value;
	if ($[0] !== t0) {
		({onChange, onBlur, onFocus, onInvalidTime, name, value, error, helperText, hint, ...props} = t0);
		$[0] = t0;
		$[1] = error;
		$[2] = helperText;
		$[3] = hint;
		$[4] = name;
		$[5] = onBlur;
		$[6] = onChange;
		$[7] = onFocus;
		$[8] = onInvalidTime;
		$[9] = props;
		$[10] = value;
	} else {
		error = $[1];
		helperText = $[2];
		hint = $[3];
		name = $[4];
		onBlur = $[5];
		onChange = $[6];
		onFocus = $[7];
		onInvalidTime = $[8];
		props = $[9];
		value = $[10];
	}
	let t1;
	if ($[11] !== name || $[12] !== onChange) {
		t1 = (e) => {
			onChange?.(createChangeEvent(e.detail, name, "time"));
		};
		$[11] = name;
		$[12] = onChange;
		$[13] = t1;
	} else t1 = $[13];
	const handleValueChanged = t1;
	let t2;
	if ($[14] !== name || $[15] !== onBlur) {
		t2 = () => {
			onBlur?.(createFocusEvent("blur", name));
		};
		$[14] = name;
		$[15] = onBlur;
		$[16] = t2;
	} else t2 = $[16];
	const handleBlur = t2;
	let t3;
	if ($[17] !== name || $[18] !== onFocus) {
		t3 = () => {
			onFocus?.(createFocusEvent("focus", name));
		};
		$[17] = name;
		$[18] = onFocus;
		$[19] = t3;
	} else t3 = $[19];
	const handleFocus = t3;
	const hintStr = typeof hint === "string" ? hint : void 0;
	let normalizedError;
	let normalizedHint;
	if (typeof error === "string") {
		normalizedError = error;
		normalizedHint = hintStr;
	} else if (typeof error === "boolean") {
		normalizedError = error ? helperText || "" : void 0;
		normalizedHint = !error ? helperText || hintStr : hintStr;
	} else normalizedHint = hintStr ?? helperText;
	let t4;
	if ($[20] !== handleBlur || $[21] !== handleFocus || $[22] !== handleValueChanged || $[23] !== name || $[24] !== normalizedError || $[25] !== normalizedHint || $[26] !== onInvalidTime || $[27] !== props || $[28] !== value) {
		t4 = /* @__PURE__ */ React.createElement(UdpTimeInput, {
			...props,
			name,
			value,
			error: normalizedError,
			hint: normalizedHint,
			onValueChanged: handleValueChanged,
			onInputBlur: handleBlur,
			onInputFocus: handleFocus,
			onInvalidTime
		});
		$[20] = handleBlur;
		$[21] = handleFocus;
		$[22] = handleValueChanged;
		$[23] = name;
		$[24] = normalizedError;
		$[25] = normalizedHint;
		$[26] = onInvalidTime;
		$[27] = props;
		$[28] = value;
		$[29] = t4;
	} else t4 = $[29];
	return t4;
};
//#endregion
export { UdpTimeInput$1 as UdpTimeInput };

//# sourceMappingURL=UdpTimeInput.mjs.map