"use client";
import { startTransition, useRef, useState } from "react";
import { useIsomorphicEffect, useWindowEvent } from "@mantine/hooks";
//#region packages/@mantine/core/src/components/AppShell/use-resizing/use-resizing.tsx
function useResizing({ transitionDuration, disabled }) {
	const [resizing, setResizing] = useState(true);
	const resizingTimeout = useRef(-1);
	const disabledTimeout = useRef(-1);
	useWindowEvent("resize", () => {
		setResizing(true);
		clearTimeout(resizingTimeout.current);
		resizingTimeout.current = window.setTimeout(() => startTransition(() => {
			setResizing(false);
		}), 200);
	});
	useIsomorphicEffect(() => {
		setResizing(true);
		clearTimeout(disabledTimeout.current);
		disabledTimeout.current = window.setTimeout(() => startTransition(() => {
			setResizing(false);
		}), transitionDuration || 0);
	}, [disabled, transitionDuration]);
	return resizing;
}
//#endregion
export { useResizing };

//# sourceMappingURL=use-resizing.mjs.map