import { c } from "react/compiler-runtime";
import { useNavigate } from "react-router-dom";
var LocalRouter = class {
	navigate;
	envId;
	constructor(e, t) {
		this.navigate = e, this.envId = t;
	}
	async navigateToHome() {
		await this.navigate("/");
	}
	async navigateToEnvironmentInfo() {
		await this.navigate("/info");
	}
	getDashboard() {
		return "/dashboard";
	}
	async navigateToDashboard() {
		await this.navigate(this.getDashboard());
	}
	getWorkspaces() {
		return "/workspaces";
	}
	getDebugWorkflows() {
		return "/debug/workflows";
	}
	getDebugWorkflow(e) {
		return `/debug/workflows/${e}`;
	}
	async navigateToDebugWorkflow(e) {
		await this.navigate(this.getDebugWorkflow(e));
	}
	async navigateToWorkspaces() {
		await this.navigate(this.getWorkspaces());
	}
	getWorkspace(e) {
		return `/workspaces/${e}`;
	}
	async navigateToWorkspace(e) {
		await this.navigate(this.getWorkspace(e));
	}
	getPipeline(e) {
		return `/pipelines/${e}`;
	}
	async navigateToPipeline(e) {
		await this.navigate(this.getPipeline(e));
	}
	getPipelineDebug(e) {
		return `/pipelines/${e}/debug`;
	}
	async navigateToPipelineDebug(e) {
		await this.navigate(this.getPipelineDebug(e));
	}
	async navigateToWorkflow(e, t, n) {
		await this.navigate(`/pipelines/${e}/workflows/${t}/${(n ? parseInt(n) : 0) + 1}`);
	}
	async navigateToPipelineNamespace(e, t, n) {
		await this.navigate(`/workspaces/${e}/pipelines/${t}/namespaces/${n}`);
	}
	getEmbedPipeline(e) {
		return `/embed/pipelines/${e}`;
	}
	getCurrentEnvironmentId() {
		return this.envId;
	}
	getTheme() {
		return "local";
	}
};
const useRouter = (r) => {
	let i = c(3), a = useNavigate(), o;
	return i[0] !== r || i[1] !== a ? (o = new LocalRouter(a, r), i[0] = r, i[1] = a, i[2] = o) : o = i[2], o;
};
export { LocalRouter, useRouter };
