import { useChildWorkflows as e, useWorkflow as t, useWorkflowConfigByName as n } from "../../../hooks/useWorkflows.js";
import { ReactFlowProvider as r } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
import i from "../../debug/components/WorkflowFlowViewer.js";
import "../../debug/index.js";
import { useWorkbenchLayout as a } from "../providers/WorkbenchLayoutProvider.js";
import { useMemo as o } from "react";
import { jsx as s, jsxs as c } from "react/jsx-runtime";
import { X as l } from "lucide-react";
//#region src/features/workbench/components/WorkbenchFlowPanel.tsx
function u() {
	let { workflow: u, closeSidePanel: d } = a(), f = t(u.id), p = e(u.id), m = n(f.data?.className ?? void 0), h = o(() => p.data ?? [], [p.data]);
	return /* @__PURE__ */ c("div", {
		className: "border-l bg-background flex w-1/2 shrink-0 flex-col",
		children: [/* @__PURE__ */ c("div", {
			className: "border-b flex h-12 shrink-0 items-center justify-between px-3",
			children: [/* @__PURE__ */ s("span", {
				className: "text-sm font-medium",
				children: "Graph"
			}), /* @__PURE__ */ s("button", {
				onClick: d,
				className: "text-muted-foreground hover:text-foreground flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:cursor-pointer",
				children: /* @__PURE__ */ s(l, { className: "h-4 w-4" })
			})]
		}), /* @__PURE__ */ s("div", {
			className: "flex-1 overflow-hidden",
			children: h.length > 0 ? /* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i, {
				workflowId: u.id,
				workflows: h,
				workflowConfig: m.data
			}) }) : /* @__PURE__ */ s("div", {
				className: "text-muted-foreground flex h-full items-center justify-center text-sm",
				children: "No workflows found"
			})
		})]
	});
}
//#endregion
export { u as WorkbenchFlowPanel };
