import { c } from "react-compiler-runtime";
import { useHistory, useLocation } from "react-router-dom";
//#region src/hooks/useUpdateSearchParams.js
const useUpdateSearchParams = () => {
	const $ = c(4);
	const history = useHistory();
	const location = useLocation();
	let t0;
	if ($[0] !== history || $[1] !== location.pathname || $[2] !== location.search) {
		t0 = (params) => {
			const searchParams = new URLSearchParams(location.search);
			Object.keys(params).forEach((key) => {
				if (params[key] !== null) searchParams.set(key, params[key]);
				else searchParams.delete(key);
			});
			history.push({
				pathname: location.pathname,
				search: searchParams.toString()
			});
		};
		$[0] = history;
		$[1] = location.pathname;
		$[2] = location.search;
		$[3] = t0;
	} else t0 = $[3];
	return t0;
};
//#endregion
export { useUpdateSearchParams };

//# sourceMappingURL=useUpdateSearchParams.mjs.map