"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Handle, Position } from "@xyflow/react";
import { WorkflowNodeCard } from "../WorkflowNodeCard.js";
function WaitForSignalNode({ data, isConnectable, selected }) {
  const nodeData = data;
  const mapStatus = (status) => {
    if (!status || status === "pending") return "not_started";
    if (status === "running" || status === "in_progress") return "in_progress";
    if (status === "completed") return "completed";
    if (status === "error") return "not_started";
    return "not_started";
  };
  const workflowStatus = mapStatus(nodeData.status);
  const description = nodeData.description || (nodeData.signalName ? `Waiting for signal: ${nodeData.signalName}` : "Signal invocation");
  return /* @__PURE__ */ jsxs("div", { className: "waiting-for-signal-node", title: nodeData.tooltip, children: [
    /* @__PURE__ */ jsx(
      Handle,
      {
        type: "target",
        position: Position.Top,
        id: "target",
        isConnectable,
        className: "!w-3 !h-3 !bg-[#0080FE] !border-2 !border-white"
      }
    ),
    /* @__PURE__ */ jsx(
      WorkflowNodeCard,
      {
        title: nodeData.label,
        description,
        status: workflowStatus,
        nodeType: "waitForSignal",
        selected
      }
    ),
    /* @__PURE__ */ jsx(
      Handle,
      {
        type: "source",
        position: Position.Bottom,
        id: "source",
        isConnectable,
        className: "!w-3 !h-3 !bg-[#0080FE] !border-2 !border-white"
      }
    )
  ] });
}
export {
  WaitForSignalNode
};
//# sourceMappingURL=WaitForSignalNode.js.map
