"use client";
let react = require("react");
//#region packages/@mantine/core/src/utils/Floating/use-delayed-hover.ts
function useDelayedHover({ open, close, openDelay, closeDelay }) {
	const openTimeout = (0, react.useRef)(-1);
	const closeTimeout = (0, react.useRef)(-1);
	const clearTimeouts = () => {
		window.clearTimeout(openTimeout.current);
		window.clearTimeout(closeTimeout.current);
	};
	const openDropdown = () => {
		clearTimeouts();
		if (openDelay === 0 || openDelay === void 0) open();
		else openTimeout.current = window.setTimeout(open, openDelay);
	};
	const closeDropdown = () => {
		clearTimeouts();
		if (closeDelay === 0 || closeDelay === void 0) close();
		else closeTimeout.current = window.setTimeout(close, closeDelay);
	};
	(0, react.useEffect)(() => clearTimeouts, []);
	return {
		openDropdown,
		closeDropdown
	};
}
//#endregion
exports.useDelayedHover = useDelayedHover;

//# sourceMappingURL=use-delayed-hover.cjs.map