import { useCallback as e } from "react";
//#region src/hooks/useSubmitOnEnter.ts
function t(t = {}) {
	let { enabled: n = !0 } = t;
	return e((e) => {
		if (!n || e.defaultPrevented || e.key !== "Enter" || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.repeat || e.nativeEvent.isComposing) return;
		let { form: t } = e.currentTarget;
		if (t != null) {
			if (e.preventDefault(), typeof t.requestSubmit == "function") {
				t.requestSubmit();
				return;
			}
			t.dispatchEvent(new Event("submit", {
				bubbles: !0,
				cancelable: !0
			}));
		}
	}, [n]);
}
//#endregion
export { t as useSubmitOnEnter };

//# sourceMappingURL=useSubmitOnEnter.js.map