async function performDeleteNodeFlow(nodeId, deps) {
  const node = deps.nodes.find((n) => n.id === nodeId);
  const nodeData = node?.data;
  const stepName = nodeData?.stepName || nodeData?.label || nodeId;
  deps.setShowNodeDialog(false);
  deps.setSelectedNode(null);
  const confirmed = await deps.confirm({
    title: deps.t("workflows.confirm.deleteStepTitle"),
    text: deps.t("workflows.confirm.deleteStep", { name: stepName }),
    variant: "destructive"
  });
  if (!confirmed) return false;
  deps.setNodes((nds) => nds.filter((n) => n.id !== nodeId));
  deps.setEdges((eds) => eds.filter((edge) => edge.source !== nodeId && edge.target !== nodeId));
  deps.notifyDeleted();
  return true;
}
async function performDeleteEdgeFlow(edgeId, deps) {
  deps.setShowEdgeDialog(false);
  deps.setSelectedEdge(null);
  const confirmed = await deps.confirm({
    title: deps.t("workflows.confirm.deleteTransitionTitle"),
    text: deps.t("workflows.confirm.deleteTransitionText"),
    variant: "destructive"
  });
  if (!confirmed) return false;
  deps.setEdges((eds) => eds.filter((edge) => edge.id !== edgeId));
  deps.notifyDeleted();
  return true;
}
export {
  performDeleteEdgeFlow,
  performDeleteNodeFlow
};
//# sourceMappingURL=visual-editor-delete-flow.js.map
