import { apiGet } from "./apiClient.mjs";
import { c } from "react-compiler-runtime";
import { useQuery } from "@tanstack/react-query";
//#region src/utilities/useApiQuery.ts
/**
* Idiomatic TanStack Query wrapper around apiGet.
*/
function useApiQuery(baseURL, url, t0, options) {
	const $ = c(14);
	let t1;
	if ($[0] !== t0) {
		t1 = t0 === void 0 ? {} : t0;
		$[0] = t0;
		$[1] = t1;
	} else t1 = $[1];
	const config = t1;
	let t2;
	if ($[2] !== baseURL || $[3] !== config || $[4] !== url) {
		t2 = [
			baseURL,
			url,
			config
		];
		$[2] = baseURL;
		$[3] = config;
		$[4] = url;
		$[5] = t2;
	} else t2 = $[5];
	const queryKey = t2;
	let t3;
	if ($[6] !== baseURL || $[7] !== config || $[8] !== url) {
		t3 = () => apiGet(baseURL, url, config);
		$[6] = baseURL;
		$[7] = config;
		$[8] = url;
		$[9] = t3;
	} else t3 = $[9];
	let t4;
	if ($[10] !== options || $[11] !== queryKey || $[12] !== t3) {
		t4 = {
			queryKey,
			queryFn: t3,
			...options
		};
		$[10] = options;
		$[11] = queryKey;
		$[12] = t3;
		$[13] = t4;
	} else t4 = $[13];
	return useQuery(t4);
}
//#endregion
export { useApiQuery };

//# sourceMappingURL=useApiQuery.mjs.map