import { useEffect as e, useState as t } from "react";
//#region lib/ui/hooks/useValue.ts
function n({ initialValue: n, onChange: r, defaultValue: i = "", formatter: a = (e) => e }) {
	let [o, s] = t(a(n || i));
	e(() => {
		s(a(n ?? i));
	}, [n]);
	function c(e, t) {
		e = a(e), s(e), r && r(t ?? new Event("change"), e);
	}
	function l() {
		s(i);
	}
	return {
		value: o,
		setValue: c,
		resetValue: l
	};
}
//#endregion
export { n as useValue };

//# sourceMappingURL=useValue.js.map