import { useApiClient } from "./useApi.js";
import { c } from "react/compiler-runtime";
import { useQuery } from "@tanstack/react-query";
function useWorkspaceConfig() {
	let r = c(7), { envKey: a, api: o } = useApiClient(), s;
	r[0] === a ? s = r[1] : (s = ["workspace-types", a], r[0] = a, r[1] = s);
	let l;
	r[2] === o ? l = r[3] : (l = () => {
		if (!o) throw Error("API not available");
		return o.ApiV1ConfigApi.configControllerGetWorkspaceTypes();
	}, r[2] = o, r[3] = l);
	let u;
	return r[4] !== s || r[5] !== l ? (u = {
		queryKey: s,
		queryFn: l,
		select: _temp,
		enabled: !0
	}, r[4] = s, r[5] = l, r[6] = u) : u = r[6], useQuery(u);
}
function _temp(e) {
	return e.data;
}
function usePipelineConfig(r) {
	let i = c(10), { envKey: a, api: s } = useApiClient(), l;
	i[0] !== a || i[1] !== r ? (l = [
		"pipeline-types",
		r,
		a
	], i[0] = a, i[1] = r, i[2] = l) : l = i[2];
	let u;
	i[3] !== s || i[4] !== r ? (u = () => {
		if (!s) throw Error("API not available");
		return s.ApiV1ConfigApi.configControllerGetPipelineTypesByWorkspace({ workspaceBlockName: r });
	}, i[3] = s, i[4] = r, i[5] = u) : u = i[5];
	let d = !!r, f;
	return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
		queryKey: l,
		queryFn: u,
		enabled: d,
		select: _temp2
	}, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
}
function _temp2(e) {
	return e.data;
}
export { usePipelineConfig, useWorkspaceConfig };
