import { BaseEdge as e, EdgeLabelRenderer as t } from "../../../../node_modules/@xyflow/react/dist/esm/index.js";
import { formatCondition as n } from "../../lib/flow-utils.js";
import { resolveEdgePath as r } from "../../lib/edge-paths.js";
import "react";
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
import { Wrench as s } from "lucide-react";
//#region src/features/debug/components/workflow-flow/WorkflowTransitionEdge.tsx
var c = ({ transitionId: e, tools: t, condition: n, isExecuted: r, forceVisible: i }) => /* @__PURE__ */ o("div", {
	className: `flex flex-col items-center gap-0.5 rounded-full border px-2 py-0.5 shadow-sm transition-all hover:z-50 hover:scale-105 bg-background/95 backdrop-blur-[2px] text-muted-foreground border-border/40 hover:border-border/80 ${r || i ? "opacity-100" : "opacity-60 hover:opacity-100"}`,
	children: [
		/* @__PURE__ */ a("span", {
			className: "text-[10px] font-semibold leading-tight tracking-tight",
			children: e
		}),
		t && /* @__PURE__ */ o("div", {
			className: `flex items-center gap-1 rounded-full px-1.5 py-[1px] text-[9px] ${r ? "bg-primary/5 text-primary" : "bg-muted/50 text-muted-foreground"}`,
			children: [/* @__PURE__ */ a(s, { className: "h-2.5 w-2.5 opacity-70" }), /* @__PURE__ */ a("span", {
				className: "max-w-[150px] truncate font-mono font-medium",
				children: t
			})]
		}),
		n && /* @__PURE__ */ a("span", {
			className: "max-w-[150px] truncate font-mono text-[8px] tracking-tighter opacity-70",
			children: n
		})
	]
}), l = ({ sourceX: s, sourceY: l, targetX: u, targetY: d, sourcePosition: f, targetPosition: p, style: m = {}, markerEnd: h, data: g }) => {
	let { id: _, isExecuted: v = !1, isSelfLoop: y = !1, isBackEdge: b = !1, forceVisible: x = !1, call: S, condition: C } = g ?? {}, { path: w, labelX: T, labelY: E } = r({
		sourceX: s,
		sourceY: l,
		targetX: u,
		targetY: d,
		sourcePosition: f,
		targetPosition: p
	}, {
		isSelfLoop: y,
		isBackEdge: b
	}), D = C ? n(C) : null, O = S?.map((e) => e.tool).join(", ");
	return _ || O || D ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, {
		path: w,
		markerEnd: h,
		style: m
	}), /* @__PURE__ */ a(t, { children: /* @__PURE__ */ a("div", {
		style: {
			position: "absolute",
			transform: `translate(-50%, -50%) translate(${T}px,${E}px)`,
			pointerEvents: "all"
		},
		className: "nodrag nopan",
		children: /* @__PURE__ */ a(c, {
			transitionId: _ ?? "",
			tools: O,
			condition: D,
			isExecuted: v,
			forceVisible: x
		})
	}) })] }) : /* @__PURE__ */ a(e, {
		path: w,
		markerEnd: h,
		style: m
	});
};
//#endregion
export { l as default };
