@notmrabhi/flowforge 0.1.53 → 0.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/GatewayBranchEdge-6rCziASt.js +2 -0
  2. package/dist/GatewayBranchEdge-6rCziASt.js.map +1 -0
  3. package/dist/GatewayBranchEdge-PsxBbEky.js +1538 -0
  4. package/dist/GatewayBranchEdge-PsxBbEky.js.map +1 -0
  5. package/dist/{templateSkeletons-f-XQQvyE.js → WorkflowExecutionHistory-CF0-D-7q.js} +805 -859
  6. package/dist/WorkflowExecutionHistory-CF0-D-7q.js.map +1 -0
  7. package/dist/{templateSkeletons-gOva2Xus.js → WorkflowExecutionHistory-CQkhhFQr.js} +2 -2
  8. package/dist/WorkflowExecutionHistory-CQkhhFQr.js.map +1 -0
  9. package/dist/buildBackendPayload-4SwOp7St.js.map +1 -1
  10. package/dist/buildBackendPayload-BvrjW1uM.js.map +1 -1
  11. package/dist/canvas.cjs +1 -1
  12. package/dist/canvas.d.ts +7 -61
  13. package/dist/canvas.js +21 -25
  14. package/dist/core.cjs +1 -1
  15. package/dist/core.d.ts +7 -24
  16. package/dist/core.js +1 -1
  17. package/dist/defaultUi.cjs +1 -1
  18. package/dist/defaultUi.js +1 -1
  19. package/dist/form.d.ts +0 -35
  20. package/dist/index-B-D9UuLO.js.map +1 -1
  21. package/dist/index-DUbQPmIx.js.map +1 -1
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.ts +7 -43
  25. package/dist/index.js +65 -69
  26. package/dist/{messages-O9Tw_XXR.js → messages-Bg7b9RbI.js} +2 -2
  27. package/dist/messages-Bg7b9RbI.js.map +1 -0
  28. package/dist/{messages-CO299wPN.js → messages-CRZgWFU-.js} +15 -8
  29. package/dist/messages-CRZgWFU-.js.map +1 -0
  30. package/dist/nodeRegistry.d.ts +0 -24
  31. package/package.json +1 -1
  32. package/dist/GatewayBranchEdge-CMY30xhz.js +0 -2
  33. package/dist/GatewayBranchEdge-CMY30xhz.js.map +0 -1
  34. package/dist/GatewayBranchEdge-CrgczPYJ.js +0 -1414
  35. package/dist/GatewayBranchEdge-CrgczPYJ.js.map +0 -1
  36. package/dist/messages-CO299wPN.js.map +0 -1
  37. package/dist/messages-O9Tw_XXR.js.map +0 -1
  38. package/dist/templateSkeletons-f-XQQvyE.js.map +0 -1
  39. package/dist/templateSkeletons-gOva2Xus.js.map +0 -1
@@ -1,1414 +0,0 @@
1
- import { jsxs as t, jsx as e, Fragment as j } from "react/jsx-runtime";
2
- import { Handle as x, Position as N, getStraightPath as U, BaseEdge as G } from "reactflow";
3
- import { Tooltip as $, Chip as q } from "@mui/material";
4
- import { GrTrigger as Ne } from "react-icons/gr";
5
- import { createContext as ke, useContext as ve } from "react";
6
- import { d as we } from "./messages-CO299wPN.js";
7
- import { MdOutlineModeEdit as D, MdInfoOutline as B, MdInput as fe, MdDeleteOutline as F, MdCheckCircle as Se, MdPeople as Ce, MdSchedule as Ee, MdWebhook as de, MdNotifications as O, MdSms as Te, MdEmail as ze, MdContentCopy as Ie, MdHttp as Pe, MdCallSplit as Ae, MdAccountTree as De, MdOpenInNew as Re } from "react-icons/md";
8
- import { FaCheckCircle as ae, FaTimesCircle as pe } from "react-icons/fa";
9
- import { FiFilter as Le } from "react-icons/fi";
10
- import { a as K, H as We, B as Y } from "./canvasTokens-CAD6G24b.js";
11
- const Fe = ke({
12
- onEditNode: () => {
13
- },
14
- onDeleteNode: () => {
15
- },
16
- onAddStep: () => {
17
- },
18
- onClickAddTrigger: () => {
19
- },
20
- messages: we,
21
- nodeRegistry: null,
22
- nodeBody: "full"
23
- }), P = () => ve(Fe), $e = () => /* @__PURE__ */ t("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
24
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0, left: "50%" } }),
25
- /* @__PURE__ */ e("div", { style: { padding: "8px 28px", borderRadius: 999, background: "#f5f5f5", border: "1.5px solid #bdbdbd", fontSize: 13, fontWeight: 500, color: "#424242", userSelect: "none" }, children: "Start" })
26
- ] }), je = () => /* @__PURE__ */ t("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
27
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0, left: "50%" } }),
28
- /* @__PURE__ */ e("div", { style: { padding: "8px 28px", borderRadius: 999, background: "#f5f5f5", border: "1.5px solid #bdbdbd", fontSize: 13, fontWeight: 500, color: "#424242", userSelect: "none" }, children: "End" })
29
- ] }), Be = () => {
30
- const { onClickAddTrigger: n, messages: i } = P();
31
- return /* @__PURE__ */ t("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
32
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0, left: "50%" } }),
33
- /* @__PURE__ */ e($, { title: i.addTriggerTooltip, placement: "top", arrow: !0, children: /* @__PURE__ */ t(
34
- "div",
35
- {
36
- onClick: n,
37
- role: "button",
38
- tabIndex: 0,
39
- onKeyDown: (f) => {
40
- f.key === "Enter" && n();
41
- },
42
- style: { padding: "10px 24px", borderRadius: 8, border: "1.5px dashed #d0d0d0", background: "#fff", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", gap: 8 },
43
- children: [
44
- /* @__PURE__ */ e(Ne, { size: 16 }),
45
- /* @__PURE__ */ e("span", { className: "ff-text-black", style: { fontSize: 13 }, "data-testid": "add-trigger-btn-text", children: i.addTriggerButton })
46
- ]
47
- }
48
- ) }),
49
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0, left: "50%" } })
50
- ] });
51
- }, Ke = ({ id: n }) => {
52
- const { onAddStep: i } = P();
53
- return /* @__PURE__ */ t(
54
- "div",
55
- {
56
- onClick: () => i(n),
57
- role: "button",
58
- tabIndex: 0,
59
- onKeyDown: (f) => {
60
- f.key === "Enter" && i(n);
61
- },
62
- style: { width: 28, height: 28, borderRadius: "50%", border: "1.5px solid #9e9e9e", background: "#fff", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", fontSize: 18, color: "#757575", lineHeight: 1, userSelect: "none" },
63
- children: [
64
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
65
- "+",
66
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
67
- ]
68
- }
69
- );
70
- };
71
- function ge(n) {
72
- return n ? n.replace(/[_-]+/g, " ").toLowerCase().replace(/\b\w/g, (i) => i.toUpperCase()) : "";
73
- }
74
- function Me(n) {
75
- if (typeof n != "string" && n.label) return n.label;
76
- const i = typeof n == "string" ? n : n.value ?? "";
77
- return ge(i);
78
- }
79
- const _e = ({ data: n }) => {
80
- const { onClickAddTrigger: i } = P(), {
81
- type: f,
82
- eventType: p,
83
- sources: c,
84
- label: r,
85
- source: h,
86
- previewWorkflow: o,
87
- executionStatus: l,
88
- infoText: d = "This node decides the flow trigger type and configuration."
89
- } = n ?? {}, u = (m) => {
90
- m == null || m.stopPropagation(), i();
91
- }, y = Array.isArray(c) && c.length > 0, k = !!(r || h), g = f === "scheduler" ? "Scheduler Trigger" : f === "event" || y || k ? "Event Trigger Source" : "Select Trigger", s = (() => {
92
- if (f === "scheduler")
93
- return /* @__PURE__ */ e("span", { children: "Scheduler to be configured" });
94
- if (f === "event" || y) {
95
- const m = r || ge(p);
96
- return /* @__PURE__ */ t("div", { children: [
97
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center", children: [
98
- /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: m }),
99
- /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-text-muted", style: { fontSize: 12 }, children: "via" })
100
- ] }),
101
- /* @__PURE__ */ e("div", { className: "ff-d-flex ff-flex-wrap ff-mt-2", style: { gap: 4 }, children: y ? c.map((C, v) => /* @__PURE__ */ e(
102
- q,
103
- {
104
- label: Me(C),
105
- variant: "outlined",
106
- size: "small",
107
- className: "ff-text-dark"
108
- },
109
- v
110
- )) : /* @__PURE__ */ e("span", { className: "ff-text-muted", style: { fontSize: 12 }, children: "No source selected" }) })
111
- ] });
112
- }
113
- return k ? /* @__PURE__ */ t("div", { className: "ff-d-flex ff-flex-wrap ff-align-items-center", style: { gap: 6 }, children: [
114
- r && /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: r }),
115
- h && /* @__PURE__ */ e(q, { label: h, variant: "outlined", size: "small" })
116
- ] }) : /* @__PURE__ */ e(
117
- "span",
118
- {
119
- role: "button",
120
- tabIndex: 0,
121
- onClick: u,
122
- onKeyDown: (m) => {
123
- (m.key === "Enter" || m.key === " ") && u(m);
124
- },
125
- style: { cursor: "pointer", color: "#1e88e5" },
126
- children: "Click to select a trigger to start your workflow"
127
- }
128
- );
129
- })(), S = l ? /* @__PURE__ */ t(j, { children: [
130
- l.status === "success" && /* @__PURE__ */ e(ae, { size: 16, color: "#1DBF60", style: { marginRight: 8 } }),
131
- l.status === "failed" && /* @__PURE__ */ e(pe, { size: 16, color: "#f44336", style: { marginRight: 8 } })
132
- ] }) : /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center", children: [
133
- !o && /* @__PURE__ */ e(
134
- "div",
135
- {
136
- role: "button",
137
- tabIndex: 0,
138
- onClick: u,
139
- onKeyDown: (m) => {
140
- (m.key === "Enter" || m.key === " ") && u(m);
141
- },
142
- className: "ff-me-2",
143
- style: { cursor: "pointer", color: "#212121" },
144
- "aria-label": "Edit trigger",
145
- children: /* @__PURE__ */ e(D, { size: 16 })
146
- }
147
- ),
148
- /* @__PURE__ */ e($, { title: /* @__PURE__ */ e("div", { children: d }), placement: "right", arrow: !0, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(B, { color: "gray", size: 16 }) }) })
149
- ] });
150
- return /* @__PURE__ */ t("div", { style: { width: 350 }, children: [
151
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
152
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #a5d6a7", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
153
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "12px 14px" }, children: [
154
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
155
- /* @__PURE__ */ e(
156
- "div",
157
- {
158
- style: {
159
- width: 28,
160
- height: 28,
161
- borderRadius: 6,
162
- background: "rgba(76,175,80,0.1)",
163
- display: "flex",
164
- alignItems: "center",
165
- justifyContent: "center",
166
- flexShrink: 0
167
- },
168
- children: /* @__PURE__ */ e(fe, { size: 16, color: "#388e3c" })
169
- }
170
- ),
171
- /* @__PURE__ */ e("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: g })
172
- ] }),
173
- /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center", children: S })
174
- ] }),
175
- /* @__PURE__ */ e(
176
- "div",
177
- {
178
- style: {
179
- background: "#f5f5f5",
180
- fontSize: 12,
181
- color: "#212121",
182
- padding: "14px 16px",
183
- margin: "0 10px 12px",
184
- borderRadius: 6,
185
- textAlign: "left"
186
- },
187
- children: s
188
- }
189
- )
190
- ] }),
191
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 }, id: "1" })
192
- ] });
193
- };
194
- function He(n) {
195
- return n ? n === "END_USER_CREATION" ? "New User Registration" : n === "END_USER_UPDATION" ? "On User Update" : n.replace(/[_-]+/g, " ").replace(/\b\w/g, (i) => i.toUpperCase()) : "";
196
- }
197
- function Oe(n) {
198
- const i = typeof n == "string" ? n : n.value ?? "";
199
- return i === "SIGNUP_FLOW" ? "User Self-Registration" : i === "ADMIN_CREATION_FLOW" ? "Create User via Admin Portal" : i === "SHEDULAR" || i === "SCHEDULER" ? "Scheduler" : typeof n != "string" && n.label ? n.label : i.replace(/[_-]+/g, " ").replace(/\b\w/g, (f) => f.toUpperCase());
200
- }
201
- const Ue = ({ data: n }) => {
202
- const {
203
- header: i = "Event",
204
- title: f,
205
- eventType: p,
206
- sources: c,
207
- executionStatus: r,
208
- infoText: h = "This event is raised by the system. It cannot be configured."
209
- } = n ?? {}, o = f ?? He(p) ?? "—";
210
- return /* @__PURE__ */ t("div", { style: { width: 350 }, children: [
211
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
212
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #a5d6a7", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
213
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "12px 14px" }, children: [
214
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
215
- /* @__PURE__ */ e(
216
- "div",
217
- {
218
- style: {
219
- width: 28,
220
- height: 28,
221
- borderRadius: 6,
222
- background: "rgba(76,175,80,0.1)",
223
- display: "flex",
224
- alignItems: "center",
225
- justifyContent: "center",
226
- flexShrink: 0
227
- },
228
- children: /* @__PURE__ */ e(fe, { size: 16, color: "#388e3c" })
229
- }
230
- ),
231
- /* @__PURE__ */ e("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: i })
232
- ] }),
233
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center", children: [
234
- (r == null ? void 0 : r.status) === "success" && /* @__PURE__ */ e(ae, { size: 16, color: "#1DBF60", style: { marginRight: 8 } }),
235
- (r == null ? void 0 : r.status) === "failed" && /* @__PURE__ */ e(pe, { size: 16, color: "#f44336", style: { marginRight: 8 } }),
236
- !r && /* @__PURE__ */ e($, { title: /* @__PURE__ */ e("div", { children: h }), placement: "right", arrow: !0, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(B, { color: "gray", size: 16 }) }) })
237
- ] })
238
- ] }),
239
- /* @__PURE__ */ t(
240
- "div",
241
- {
242
- style: {
243
- background: "#f5f5f5",
244
- fontSize: 13,
245
- color: "#212121",
246
- padding: "14px 16px",
247
- margin: "0 10px 12px",
248
- borderRadius: 6,
249
- textAlign: "left"
250
- },
251
- children: [
252
- /* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: o }),
253
- Array.isArray(c) && c.length > 0 && /* @__PURE__ */ t(j, { children: [
254
- /* @__PURE__ */ e("div", { className: "ff-text-muted", style: { fontSize: 12, marginTop: 4 }, children: "via" }),
255
- /* @__PURE__ */ e("div", { className: "ff-d-flex ff-flex-wrap ff-mt-1", style: { gap: 4 }, children: c.map((l, d) => /* @__PURE__ */ e(
256
- q,
257
- {
258
- label: Oe(l),
259
- variant: "outlined",
260
- size: "small",
261
- className: "ff-text-dark"
262
- },
263
- d
264
- )) })
265
- ] })
266
- ]
267
- }
268
- )
269
- ] }),
270
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 }, id: "1" })
271
- ] });
272
- }, he = ({ rail: n, cardWidth: i }) => {
273
- const f = i / 2;
274
- i / 2 + n.indent;
275
- const p = "var(--ff-edge-color, #b0bec5)";
276
- return /* @__PURE__ */ t(
277
- "svg",
278
- {
279
- width: i + n.indent + 200,
280
- height: n.height,
281
- style: { position: "absolute", left: 0, top: "100%", pointerEvents: "none", overflow: "visible" },
282
- children: [
283
- /* @__PURE__ */ e("line", { x1: f, y1: 0, x2: f, y2: n.height, stroke: p, strokeWidth: 1.5 }),
284
- n.branches.map((c, r) => {
285
- const h = c.y;
286
- return /* @__PURE__ */ t("g", { transform: `translate(0, ${h})`, children: [
287
- /* @__PURE__ */ e(
288
- "rect",
289
- {
290
- x: f - 5,
291
- y: -5,
292
- width: 10,
293
- height: 10,
294
- fill: "#fff",
295
- stroke: p,
296
- strokeWidth: 1.5,
297
- transform: `rotate(45, ${f}, 0)`
298
- }
299
- ),
300
- /* @__PURE__ */ e(
301
- "text",
302
- {
303
- x: f + 14,
304
- y: 4,
305
- fontSize: 12,
306
- fontWeight: 500,
307
- fill: "var(--ff-text, #212121)",
308
- style: { fontFamily: "sans-serif" },
309
- children: c.label
310
- }
311
- )
312
- ] }, r);
313
- })
314
- ]
315
- }
316
- );
317
- }, Ge = ({ id: n, data: i }) => {
318
- const { onEditNode: f, onDeleteNode: p } = P(), { conditions: c = [], infoText: r = "Filter conditions applied to workflow data", _branchRail: h } = i;
319
- return /* @__PURE__ */ t("div", { style: { width: 350, position: "relative" }, children: [
320
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
321
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #ffe082", borderRadius: 8, background: "#fff" }, children: [
322
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
323
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center", children: [
324
- /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(255,160,0,0.1)" }, children: /* @__PURE__ */ e(Le, { className: "ff-text-warning", size: 16 }) }),
325
- /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Filter" })
326
- ] }),
327
- /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
328
- /* @__PURE__ */ e(
329
- "div",
330
- {
331
- role: "button",
332
- tabIndex: 0,
333
- onClick: (o) => {
334
- o.stopPropagation(), f(n);
335
- },
336
- onKeyDown: (o) => {
337
- o.key === "Enter" && (o.stopPropagation(), f(n));
338
- },
339
- children: /* @__PURE__ */ e(D, { size: 16 })
340
- }
341
- ),
342
- /* @__PURE__ */ e(
343
- "div",
344
- {
345
- className: "ff-ms-2",
346
- role: "button",
347
- tabIndex: 0,
348
- onClick: (o) => {
349
- o.stopPropagation(), p(n);
350
- },
351
- onKeyDown: (o) => {
352
- o.key === "Enter" && (o.stopPropagation(), p(n));
353
- },
354
- children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
355
- }
356
- ),
357
- /* @__PURE__ */ e($, { title: r, placement: "right", arrow: !0, children: /* @__PURE__ */ e("div", { className: "ff-ms-2", children: /* @__PURE__ */ e(B, { color: "gray", size: 16 }) }) })
358
- ] })
359
- ] }),
360
- /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: c.length === 0 ? /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "No conditions configured" }) : c.map((o, l) => /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-mb-1", children: [
361
- /* @__PURE__ */ e("p", { className: "ff-m-0 ff-fw-bold ff-me-1 ff-text-truncate", style: { maxWidth: 100 }, title: o.field, children: o.field }),
362
- /* @__PURE__ */ e("span", { className: "ff-text-muted", children: o.operator }),
363
- /* @__PURE__ */ e("p", { className: "ff-text-dark ff-text-truncate ff-mx-1 ff-m-0", title: o.value, children: o.value }),
364
- l < c.length - 1 && /* @__PURE__ */ e("p", { className: "ff-bg-primary ff-text-white ff-fw-bold ff-ms-1 ff-px-1 ff-rounded-1 ff-m-0", children: o.logicalOperator })
365
- ] }, l)) })
366
- ] }),
367
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } }),
368
- h && /* @__PURE__ */ e(he, { rail: h, cardWidth: 350 })
369
- ] });
370
- }, Ve = ({ id: n, data: i }) => {
371
- const { onEditNode: f, onDeleteNode: p, nodeRegistry: c, nodeBody: r = "full" } = P(), { title: h = "Task", descriptorType: o, groupBlocks: l, groups: d, roles: u, groupId: y, roleId: k, infoText: g = "" } = i, s = o ? c == null ? void 0 : c.forType(o) : void 0, S = s == null ? void 0 : s.icon, m = (a) => a == null ? "" : typeof a == "string" ? a : typeof a == "object" && "label" in a ? String(a.label) : String(a), C = (a) => Array.isArray(a) ? a.map(m).filter(Boolean) : a != null && a !== "" ? [m(a)] : [], v = /* @__PURE__ */ new Set([
372
- "descriptorType",
373
- "title",
374
- "header",
375
- "icon",
376
- "infoText",
377
- "label",
378
- // FlowForm's condition-builder sidecar — rendered separately below as
379
- // proper "When ..." rows, not as a JSON dump in the generic body.
380
- "conditionConfig",
381
- "_conditionConfig"
382
- ]), R = s == null ? void 0 : s.formSchema, T = (a) => {
383
- if (Array.isArray(R)) {
384
- const b = R.find((w) => (w == null ? void 0 : w.id) === a || (w == null ? void 0 : w.name) === a);
385
- if (b != null && b.label) return b.label;
386
- }
387
- return a.replace(/[_-]+/g, " ").replace(/\b\w/g, (b) => b.toUpperCase());
388
- }, A = (a) => {
389
- if (Array.isArray(a)) {
390
- const b = a.map(
391
- (W) => typeof W == "object" && W ? W.label ?? W.name ?? W.value ?? "" : String(W)
392
- ).filter(Boolean), w = b.slice(0, 3).join(", ");
393
- return b.length > 3 ? `${w} +${b.length - 3}` : w;
394
- }
395
- if (a && typeof a == "object") {
396
- const b = a;
397
- return b.label ?? b.name ?? b.value ?? JSON.stringify(a);
398
- }
399
- return String(a);
400
- }, I = Object.entries(i || {}).filter(
401
- ([a, b]) => !v.has(a) && b !== "" && b !== null && b !== void 0 && !(Array.isArray(b) && b.length === 0)
402
- ), z = (i == null ? void 0 : i.conditionConfig) ?? (i == null ? void 0 : i._conditionConfig), E = z && typeof z == "object" ? Object.entries(z).filter(([, a]) => Array.isArray(a) && a.length > 0).map(([a, b]) => ({
403
- path: a,
404
- entries: b
405
- })) : [], L = (l == null ? void 0 : l.flatMap((a) => a.groups ?? [])) ?? [...C(d), ...C(u), ...C(y), ...C(k)], V = L.length > 0;
406
- return /* @__PURE__ */ t("div", { style: { width: 350 }, children: [
407
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
408
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
409
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
410
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
411
- S && /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center" }, children: S }),
412
- /* @__PURE__ */ e("span", { className: "ff-text-dark", style: { fontSize: 14, fontWeight: 500 }, children: h })
413
- ] }),
414
- /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
415
- /* @__PURE__ */ e(
416
- "div",
417
- {
418
- role: "button",
419
- tabIndex: 0,
420
- onClick: (a) => {
421
- a.stopPropagation(), f(n);
422
- },
423
- onKeyDown: (a) => {
424
- a.key === "Enter" && (a.stopPropagation(), f(n));
425
- },
426
- children: /* @__PURE__ */ e(D, { size: 16 })
427
- }
428
- ),
429
- /* @__PURE__ */ e(
430
- "div",
431
- {
432
- className: "ff-ms-2",
433
- role: "button",
434
- tabIndex: 0,
435
- onClick: (a) => {
436
- a.stopPropagation(), p(n);
437
- },
438
- onKeyDown: (a) => {
439
- a.key === "Enter" && (a.stopPropagation(), p(n));
440
- },
441
- children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
442
- }
443
- ),
444
- g && /* @__PURE__ */ e($, { title: g, placement: "right", arrow: !0, children: /* @__PURE__ */ e("div", { className: "ff-ms-2", children: /* @__PURE__ */ e(B, { color: "gray", size: 16 }) }) })
445
- ] })
446
- ] }),
447
- r !== "title-only" && // Body container matches IAM ActionNodeLabel: 12px text, left-aligned.
448
- // We use a single bg-light rounded pill that wraps everything, the
449
- // same way IAM's groupBlocks each render as bg-light rounded my-2 p-2.
450
- /* @__PURE__ */ e(
451
- "div",
452
- {
453
- style: {
454
- margin: "0 8px 8px",
455
- padding: 8,
456
- borderRadius: 4,
457
- background: "#f8f9fa",
458
- fontSize: 12,
459
- textAlign: "left",
460
- color: "#212529",
461
- lineHeight: 1.4
462
- },
463
- children: s != null && s.renderNode ? s.renderNode(i) : I.length > 0 || E.length > 0 ? /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column" }, children: [
464
- E.map((a, b) => /* @__PURE__ */ t("div", { children: [
465
- /* @__PURE__ */ e("div", { style: { color: "#6c757d" }, children: "When" }),
466
- a.entries.slice(0, 3).map((w, W, ye) => {
467
- const ue = w.field || "", me = w.fieldLabel || T(ue), be = w.operator || "", Z = w.value == null ? "" : typeof w.value == "object" ? A(w.value) : String(w.value), xe = w.connector || "and";
468
- return /* @__PURE__ */ t(
469
- "div",
470
- {
471
- style: {
472
- display: "flex",
473
- alignItems: "center",
474
- flexWrap: "wrap",
475
- marginTop: 4
476
- },
477
- children: [
478
- /* @__PURE__ */ e("span", { style: { fontWeight: 700, marginRight: 4, color: "#212529" }, children: me }),
479
- /* @__PURE__ */ e("span", { style: { color: "#6c757d", marginRight: 4 }, children: be }),
480
- /* @__PURE__ */ e("span", { style: { color: "#212529", marginRight: 4 }, title: Z, children: Z }),
481
- W < ye.length - 1 && /* @__PURE__ */ e(
482
- "span",
483
- {
484
- style: {
485
- background: "#0d6efd",
486
- color: "#fff",
487
- fontWeight: 700,
488
- marginLeft: 4,
489
- padding: "0 4px",
490
- borderRadius: 2,
491
- textTransform: "uppercase",
492
- fontSize: 10
493
- },
494
- children: xe
495
- }
496
- )
497
- ]
498
- },
499
- W
500
- );
501
- }),
502
- a.entries.length > 3 && /* @__PURE__ */ t("div", { style: { color: "#6c757d", fontSize: 11, marginTop: 2 }, children: [
503
- "+",
504
- a.entries.length - 3,
505
- " more"
506
- ] })
507
- ] }, `cond-${b}`)),
508
- I.length > 0 && /* @__PURE__ */ e(
509
- "div",
510
- {
511
- style: {
512
- marginTop: 4,
513
- color: "#212529",
514
- display: "flex",
515
- justifyContent: "flex-start"
516
- },
517
- children: (s == null ? void 0 : s.label) || h
518
- }
519
- ),
520
- I.length > 0 && /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginTop: 4 }, children: [
521
- I.slice(0, 6).map(([a, b]) => /* @__PURE__ */ e(
522
- "span",
523
- {
524
- title: `${T(a)}: ${A(b)}`,
525
- style: {
526
- background: "#212529",
527
- color: "#fff",
528
- padding: "4px 8px",
529
- borderRadius: 4,
530
- fontSize: 11
531
- },
532
- children: A(b)
533
- },
534
- a
535
- )),
536
- I.length > 6 && /* @__PURE__ */ t("span", { style: { color: "#6c757d", fontSize: 11, alignSelf: "center" }, children: [
537
- "+",
538
- I.length - 6
539
- ] })
540
- ] })
541
- ] }) : V ? (
542
- // Dark badges matching IAM's bg-dark text-white py-1 px-2 rounded
543
- /* @__PURE__ */ e("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: L.map((a, b) => /* @__PURE__ */ e(
544
- "span",
545
- {
546
- title: a,
547
- style: {
548
- background: "#212529",
549
- color: "#fff",
550
- padding: "4px 8px",
551
- borderRadius: 4,
552
- fontSize: 11
553
- },
554
- children: a
555
- },
556
- b
557
- )) })
558
- ) : /* @__PURE__ */ e("span", { style: { color: "#6c757d" }, children: "Click edit to configure" })
559
- }
560
- )
561
- ] }),
562
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
563
- ] });
564
- }, J = 5, qe = ({ id: n, data: i }) => {
565
- const { onEditNode: f, onDeleteNode: p } = P(), { approvalData: c, isPreview: r = !1, _branchRail: h } = i, o = (c == null ? void 0 : c.policy) ?? {}, l = o.stages ?? [], d = l.length, u = l.slice(0, J), y = d - J, k = o.name ?? o.policyName ?? "Untitled Policy";
566
- return /* @__PURE__ */ t("div", { style: { width: 350, position: "relative" }, children: [
567
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
568
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #ffe082", borderRadius: 8, background: "#fff" }, children: [
569
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
570
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
571
- /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(251,192,45,0.2)" }, children: /* @__PURE__ */ e(Se, { style: { color: "#FBC02D" }, size: 16 }) }),
572
- /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Approval Policy" })
573
- ] }),
574
- /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
575
- !r && /* @__PURE__ */ e(
576
- "div",
577
- {
578
- role: "button",
579
- tabIndex: 0,
580
- style: { cursor: "pointer" },
581
- onClick: (g) => {
582
- g.stopPropagation(), f(n);
583
- },
584
- onKeyDown: (g) => {
585
- g.key === "Enter" && (g.stopPropagation(), f(n));
586
- },
587
- children: /* @__PURE__ */ e(D, { size: 16, className: "ff-text-secondary" })
588
- }
589
- ),
590
- !r && /* @__PURE__ */ e(
591
- "div",
592
- {
593
- className: "ff-ms-2",
594
- role: "button",
595
- tabIndex: 0,
596
- style: { cursor: "pointer" },
597
- onClick: (g) => {
598
- g.stopPropagation(), p(n);
599
- },
600
- onKeyDown: (g) => {
601
- g.key === "Enter" && (g.stopPropagation(), p(n));
602
- },
603
- children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
604
- }
605
- ),
606
- /* @__PURE__ */ e($, { title: "This approval policy determines who must approve a request before the workflow continues.", arrow: !0, placement: "right", children: /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-d-inline-flex", children: /* @__PURE__ */ e(B, { color: "gray", size: 16 }) }) })
607
- ] })
608
- ] }),
609
- /* @__PURE__ */ t("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#FCFCFC" }, children: [
610
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-start ff-align-items-center ff-mb-2", children: [
611
- /* @__PURE__ */ e("h6", { className: "ff-text-dark ff-mb-0 ff-text-truncate ff-flex-grow-1 ff-me-2", style: { fontSize: 13, fontWeight: 700 }, title: k, children: k }),
612
- /* @__PURE__ */ t("span", { className: "ff-badge ff-rounded-pill ff-px-2 ff-py-1 ff-flex-shrink-0", style: { background: "#FFF9C4", color: "#616161", fontSize: 11, fontWeight: 600 }, children: [
613
- d,
614
- " Stage",
615
- d !== 1 ? "s" : ""
616
- ] })
617
- ] }),
618
- l.length > 0 ? /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
619
- u.map((g, s) => {
620
- var A, I, z;
621
- const S = ((A = g.stageName) == null ? void 0 : A.trim()) || `Stage ${s + 1}`, m = Array.isArray(g.userIds) ? g.userIds.length : 0, C = ((I = g.groupName) == null ? void 0 : I.trim()) ?? "", v = ((z = g.roleName) == null ? void 0 : z.trim()) ?? "", R = m > 0 || C || v;
622
- let T = "Not configured";
623
- return C ? T = `Group: ${C}` : v ? T = `Role: ${v}` : m > 0 && (T = `${m} approver${m !== 1 ? "s" : ""}`), /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
624
- /* @__PURE__ */ e("div", { className: "ff-rounded-circle ff-d-flex ff-align-items-center ff-justify-content-center ff-flex-shrink-0", style: { width: 28, height: 28, background: "#FFF9C4", color: "#5D4037", fontSize: 12, fontWeight: 700 }, children: s + 1 }),
625
- /* @__PURE__ */ t("div", { className: "ff-flex-grow-1 ff-rounded ff-p-2 ff-d-flex ff-justify-content-between ff-align-items-center ff-border", style: { background: "#FFFDE7", borderColor: "#FEE79A" }, children: [
626
- /* @__PURE__ */ e("span", { style: { fontSize: 12, fontWeight: 700, color: "#212121" }, children: S }),
627
- /* @__PURE__ */ t("span", { className: `ff-d-flex ff-align-items-center ff-gap-1 ${R ? "ff-text-dark" : "ff-text-muted"}`, style: { fontSize: 12 }, children: [
628
- /* @__PURE__ */ e(Ce, { size: 16, className: "ff-flex-shrink-0", style: { color: R ? "#5D4037" : "#9E9E9E" } }),
629
- T
630
- ] })
631
- ] })
632
- ] }, s);
633
- }),
634
- y > 0 && /* @__PURE__ */ t(
635
- "div",
636
- {
637
- className: "ff-text-center ff-fw-bold ff-py-2 ff-border ff-rounded",
638
- style: { fontSize: 11, color: "#1976d2", borderColor: "#FEE79A", background: "#FFFDE7", borderStyle: "dashed", cursor: r ? "default" : "pointer" },
639
- role: r ? void 0 : "button",
640
- tabIndex: r ? void 0 : 0,
641
- onClick: (g) => {
642
- r || (g.stopPropagation(), f(n));
643
- },
644
- onKeyDown: (g) => {
645
- r || g.key !== "Enter" || (g.stopPropagation(), f(n));
646
- },
647
- children: [
648
- "+ ",
649
- y,
650
- " More Stage",
651
- y > 1 ? "s" : ""
652
- ]
653
- }
654
- )
655
- ] }) : /* @__PURE__ */ e("div", { className: "ff-text-center ff-py-3 ff-rounded ff-border", style: { fontSize: 12, color: "#9e9e9e", background: "#FFFDE7", borderColor: "#FEE79A", borderStyle: "dashed" }, children: "No stages configured" })
656
- ] })
657
- ] }),
658
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } }),
659
- h && /* @__PURE__ */ e(he, { rail: h, cardWidth: 350 })
660
- ] });
661
- }, Ze = ({ id: n, data: i }) => {
662
- const { onEditNode: f, onDeleteNode: p } = P(), { duration: c, unit: r } = i, h = c != null && r, o = h ? `Wait ${c} ${r}` : "Not configured";
663
- return /* @__PURE__ */ t("div", { style: { width: 350 }, children: [
664
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
665
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
666
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1", children: [
667
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
668
- /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(33,150,243,0.1)" }, children: /* @__PURE__ */ e(Ee, { size: 16, color: "#1976d2" }) }),
669
- /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Delay" })
670
- ] }),
671
- /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
672
- /* @__PURE__ */ e(
673
- "div",
674
- {
675
- role: "button",
676
- tabIndex: 0,
677
- onClick: (l) => {
678
- l.stopPropagation(), f(n);
679
- },
680
- onKeyDown: (l) => {
681
- l.key === "Enter" && (l.stopPropagation(), f(n));
682
- },
683
- children: /* @__PURE__ */ e(D, { size: 16 })
684
- }
685
- ),
686
- /* @__PURE__ */ e(
687
- "div",
688
- {
689
- className: "ff-ms-2",
690
- role: "button",
691
- tabIndex: 0,
692
- onClick: (l) => {
693
- l.stopPropagation(), p(n);
694
- },
695
- onKeyDown: (l) => {
696
- l.key === "Enter" && (l.stopPropagation(), p(n));
697
- },
698
- children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
699
- }
700
- )
701
- ] })
702
- ] }),
703
- /* @__PURE__ */ e("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 }, children: /* @__PURE__ */ e("span", { className: h ? "ff-text-dark ff-fw-medium" : "ff-text-muted", children: o }) })
704
- ] }),
705
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
706
- ] });
707
- }, Q = {
708
- email: { label: "Email", bg: "#e3f2fd", color: "#1565c0", iconType: ze },
709
- slack: { label: "Slack", bg: "#e8f5e9", color: "#2e7d32", iconType: O },
710
- teams: { label: "MS Teams", bg: "#ede7f6", color: "#4527a0", iconType: O },
711
- sms: { label: "SMS", bg: "#fce4ec", color: "#880e4f", iconType: Te },
712
- "in-app": { label: "In-App", bg: "#fff3e0", color: "#e65100", iconType: O },
713
- webhook: { label: "Webhook", bg: "#f3e5f5", color: "#6a1b9a", iconType: de }
714
- }, Ye = {
715
- label: "Notification",
716
- bg: "rgba(156,39,176,0.1)",
717
- color: "#7b1fa2",
718
- iconType: O
719
- };
720
- function Je(n) {
721
- var i;
722
- switch (n.channel) {
723
- case "email":
724
- return ((i = n.emailTo) == null ? void 0 : i.join(", ")) ?? n.recipient ?? null;
725
- case "slack":
726
- return n.slackChannel ?? null;
727
- case "teams":
728
- return n.teamsMessage ? "Message configured" : null;
729
- case "sms":
730
- return n.smsTo ?? null;
731
- case "in-app":
732
- return n.inAppRecipient ?? null;
733
- case "webhook":
734
- return n.webhookUrl ?? null;
735
- default:
736
- return n.recipient ?? null;
737
- }
738
- }
739
- function Qe(n) {
740
- switch (n.channel) {
741
- case "email":
742
- return n.emailSubject ?? n.subject ?? null;
743
- case "slack": {
744
- const i = n.slackMessage;
745
- return i ? i.length > 60 ? `${i.slice(0, 60)}…` : i : null;
746
- }
747
- case "in-app":
748
- return n.inAppTitle ?? null;
749
- default:
750
- return n.subject ?? null;
751
- }
752
- }
753
- const Xe = ({ id: n, data: i }) => {
754
- const { onEditNode: f, onDeleteNode: p } = P(), c = i, r = c.channel && Q[c.channel] ? Q[c.channel] : Ye, h = Je(c), o = Qe(c), l = !!(c.channel && h), d = r.iconType;
755
- return /* @__PURE__ */ t("div", { style: { width: K }, children: [
756
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
757
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
758
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
759
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
760
- /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: r.bg }, children: /* @__PURE__ */ e(d, { size: 16, color: r.color }) }),
761
- /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: c.channel ? `${r.label} Notification` : "Notification" })
762
- ] }),
763
- /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
764
- /* @__PURE__ */ e(
765
- "div",
766
- {
767
- role: "button",
768
- tabIndex: 0,
769
- onClick: (u) => {
770
- u.stopPropagation(), f(n);
771
- },
772
- onKeyDown: (u) => {
773
- (u.key === "Enter" || u.key === " ") && (u.stopPropagation(), f(n));
774
- },
775
- children: /* @__PURE__ */ e(D, { size: 16 })
776
- }
777
- ),
778
- /* @__PURE__ */ e(
779
- "div",
780
- {
781
- className: "ff-ms-2",
782
- role: "button",
783
- tabIndex: 0,
784
- onClick: (u) => {
785
- u.stopPropagation(), p(n);
786
- },
787
- onKeyDown: (u) => {
788
- (u.key === "Enter" || u.key === " ") && (u.stopPropagation(), p(n));
789
- },
790
- children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
791
- }
792
- )
793
- ] })
794
- ] }),
795
- /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: l ? /* @__PURE__ */ t("div", { className: "ff-d-flex ff-flex-column ff-gap-1", children: [
796
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
797
- /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 10, background: r.bg, color: r.color, fontWeight: 600, flexShrink: 0 }, children: r.label }),
798
- /* @__PURE__ */ e("span", { className: "ff-text-dark ff-text-truncate", style: { maxWidth: 220 }, children: h })
799
- ] }),
800
- o && /* @__PURE__ */ e("span", { className: "ff-text-muted ff-text-truncate", style: { maxWidth: 280 }, children: o })
801
- ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured" }) })
802
- ] }),
803
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
804
- ] });
805
- }, X = {
806
- "api-key": "API Key",
807
- hmac: "HMAC"
808
- }, et = ({ data: n }) => {
809
- const { onClickAddTrigger: i } = P(), { label: f = "Webhook Trigger", endpointUrl: p, authMethod: c, source: r } = n, h = (l) => {
810
- l.stopPropagation(), i();
811
- }, o = (l) => {
812
- l.stopPropagation(), p && navigator.clipboard.writeText(p).catch(() => {
813
- });
814
- };
815
- return /* @__PURE__ */ t("div", { style: { width: K }, children: [
816
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
817
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #90caf9", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
818
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
819
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
820
- /* @__PURE__ */ e("div", { style: { width: 28, height: 28, borderRadius: 6, background: "rgba(33,150,243,0.1)", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 }, children: /* @__PURE__ */ e(de, { size: 16, color: "#1565c0" }) }),
821
- /* @__PURE__ */ e("span", { style: { fontSize: 13, fontWeight: 600, color: "#212121" }, children: "Webhook Trigger" })
822
- ] }),
823
- /* @__PURE__ */ e(
824
- "div",
825
- {
826
- role: "button",
827
- tabIndex: 0,
828
- onClick: h,
829
- onKeyDown: (l) => {
830
- (l.key === "Enter" || l.key === " ") && h(l);
831
- },
832
- className: "ff-d-flex ff-align-items-center",
833
- style: { paddingRight: 4, cursor: "pointer" },
834
- children: /* @__PURE__ */ e(D, { size: 16, color: "#555" })
835
- }
836
- )
837
- ] }),
838
- /* @__PURE__ */ t("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#e3f2fd", border: "1px solid #90caf9" }, children: [
839
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-flex-wrap ff-gap-2 ff-mb-1", children: [
840
- /* @__PURE__ */ e("span", { style: { fontSize: 12, color: "#1565c0", fontWeight: 600 }, children: f }),
841
- r && /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 11, background: "#fff", border: "1px solid #90caf9", color: "#1565c0" }, children: r }),
842
- c && c !== "none" && X[c] && /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 10, background: "#1565c0", color: "#fff", fontWeight: 600 }, children: X[c] })
843
- ] }),
844
- p && /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-1", style: { marginTop: 4 }, children: [
845
- /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "#1565c0", fontFamily: "monospace", flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: p }),
846
- /* @__PURE__ */ e($, { title: "Copy URL", placement: "top", arrow: !0, children: /* @__PURE__ */ e(
847
- "div",
848
- {
849
- role: "button",
850
- tabIndex: 0,
851
- onClick: o,
852
- onKeyDown: (l) => {
853
- (l.key === "Enter" || l.key === " ") && o(l);
854
- },
855
- style: { cursor: "pointer", flexShrink: 0 },
856
- children: /* @__PURE__ */ e(Ie, { size: 12, color: "#1565c0" })
857
- }
858
- ) })
859
- ] })
860
- ] })
861
- ] }),
862
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
863
- ] });
864
- }, tt = ({ id: n, data: i }) => {
865
- var k;
866
- const { onEditNode: f, onDeleteNode: p, nodeRegistry: c } = P(), { method: r, url: h, descriptorType: o } = i, l = o ? (k = c == null ? void 0 : c.forType(o)) == null ? void 0 : k.icon : /* @__PURE__ */ e(Pe, { size: 16, color: "#546e7a" }), d = !!(r && h), u = (r == null ? void 0 : r.toUpperCase()) ?? "", y = We[u] ?? null;
867
- return /* @__PURE__ */ t("div", { style: { width: K }, children: [
868
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
869
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
870
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
871
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
872
- /* @__PURE__ */ e("div", { style: { width: 25, height: 25, display: "flex", alignItems: "center", justifyContent: "center" }, children: l }),
873
- /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "REST API Call" })
874
- ] }),
875
- /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
876
- /* @__PURE__ */ e(
877
- "div",
878
- {
879
- role: "button",
880
- tabIndex: 0,
881
- onClick: (g) => {
882
- g.stopPropagation(), f(n);
883
- },
884
- onKeyDown: (g) => {
885
- (g.key === "Enter" || g.key === " ") && (g.stopPropagation(), f(n));
886
- },
887
- children: /* @__PURE__ */ e(D, { size: 16 })
888
- }
889
- ),
890
- /* @__PURE__ */ e(
891
- "div",
892
- {
893
- className: "ff-ms-2",
894
- role: "button",
895
- tabIndex: 0,
896
- onClick: (g) => {
897
- g.stopPropagation(), p(n);
898
- },
899
- onKeyDown: (g) => {
900
- (g.key === "Enter" || g.key === " ") && (g.stopPropagation(), p(n));
901
- },
902
- children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
903
- }
904
- )
905
- ] })
906
- ] }),
907
- /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: d ? /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
908
- y && /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 700, padding: "2px 6px", borderRadius: 4, background: y.bg, color: y.color, flexShrink: 0 }, children: u }),
909
- /* @__PURE__ */ e("span", { className: "ff-text-dark ff-text-truncate", style: { fontFamily: "monospace", fontSize: 11 }, title: h, children: h })
910
- ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured" }) })
911
- ] }),
912
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
913
- ] });
914
- }, nt = {
915
- eq: "=",
916
- neq: "≠",
917
- gt: ">",
918
- gte: "≥",
919
- lt: "<",
920
- lte: "≤",
921
- contains: "contains",
922
- startsWith: "starts with",
923
- endsWith: "ends with",
924
- isEmpty: "is empty",
925
- isNotEmpty: "is not empty"
926
- }, ot = ({ id: n, data: i }) => {
927
- const { onEditNode: f, onDeleteNode: p } = P(), { title: c = "Condition Branch", branchConfigs: r = [], defaultBranch: h } = i, o = r.length > 0;
928
- return /* @__PURE__ */ t("div", { style: { width: K }, children: [
929
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
930
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b39ddb", borderRadius: 8, background: "#fff" }, children: [
931
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
932
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
933
- /* @__PURE__ */ e("div", { style: { width: 25, height: 25, borderRadius: 6, background: "rgba(103,58,183,0.1)", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e(Ae, { size: 16, color: "#512da8" }) }),
934
- /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: c })
935
- ] }),
936
- /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
937
- /* @__PURE__ */ e(
938
- "div",
939
- {
940
- role: "button",
941
- tabIndex: 0,
942
- onClick: (l) => {
943
- l.stopPropagation(), f(n);
944
- },
945
- onKeyDown: (l) => {
946
- (l.key === "Enter" || l.key === " ") && (l.stopPropagation(), f(n));
947
- },
948
- children: /* @__PURE__ */ e(D, { size: 16 })
949
- }
950
- ),
951
- /* @__PURE__ */ e(
952
- "div",
953
- {
954
- className: "ff-ms-2",
955
- role: "button",
956
- tabIndex: 0,
957
- onClick: (l) => {
958
- l.stopPropagation(), p(n);
959
- },
960
- onKeyDown: (l) => {
961
- (l.key === "Enter" || l.key === " ") && (l.stopPropagation(), p(n));
962
- },
963
- children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
964
- }
965
- )
966
- ] })
967
- ] }),
968
- /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: o ? /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
969
- r.map((l, d) => {
970
- var g, s;
971
- const u = Y[d % Y.length], y = (g = l.conditions) == null ? void 0 : g[0], k = (((s = l.conditions) == null ? void 0 : s.length) ?? 0) - 1;
972
- return /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
973
- /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: u.bg, color: u.color, flexShrink: 0 }, children: l.label || l.key }),
974
- y ? /* @__PURE__ */ t("span", { style: { fontSize: 11, color: "#616161", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
975
- y.field,
976
- " ",
977
- nt[y.operator] ?? y.operator,
978
- y.value ? ` ${y.value}` : "",
979
- k > 0 ? ` +${k} more` : ""
980
- ] }) : /* @__PURE__ */ e("span", { style: { fontSize: 11, color: "#9e9e9e" }, children: "No conditions yet" })
981
- ] }, l.key);
982
- }),
983
- h && /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: 6, marginTop: 2 }, children: [
984
- /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#757575", flexShrink: 0 }, children: "Default" }),
985
- /* @__PURE__ */ e("span", { style: { fontSize: 11, color: "#9e9e9e" }, children: "fallback path" })
986
- ] })
987
- ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured — click edit to add branches" }) })
988
- ] }),
989
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
990
- ] });
991
- }, it = ({ id: n, data: i }) => {
992
- var g;
993
- const { onEditNode: f, onDeleteNode: p, nodeRegistry: c } = P(), { title: r = "Sub-Workflow", workflowId: h, workflowLabel: o, descriptorType: l, onPreview: d } = i, u = l ? (g = c == null ? void 0 : c.forType(l)) == null ? void 0 : g.icon : /* @__PURE__ */ e(De, { size: 16, color: "#00695c" }), y = !!h, k = (s) => {
994
- s.stopPropagation(), h && d && d(h);
995
- };
996
- return /* @__PURE__ */ t("div", { style: { width: K }, children: [
997
- /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
998
- /* @__PURE__ */ t("div", { style: { border: "1.5px solid #80cbc4", borderRadius: 8, background: "#fff" }, children: [
999
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
1000
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
1001
- /* @__PURE__ */ e("div", { style: { width: 25, height: 25, borderRadius: 6, background: "rgba(0,137,123,0.1)", display: "flex", alignItems: "center", justifyContent: "center" }, children: u }),
1002
- /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: r })
1003
- ] }),
1004
- /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
1005
- /* @__PURE__ */ e(
1006
- "div",
1007
- {
1008
- role: "button",
1009
- tabIndex: 0,
1010
- onClick: (s) => {
1011
- s.stopPropagation(), f(n);
1012
- },
1013
- onKeyDown: (s) => {
1014
- (s.key === "Enter" || s.key === " ") && (s.stopPropagation(), f(n));
1015
- },
1016
- children: /* @__PURE__ */ e(D, { size: 16 })
1017
- }
1018
- ),
1019
- /* @__PURE__ */ e(
1020
- "div",
1021
- {
1022
- className: "ff-ms-2",
1023
- role: "button",
1024
- tabIndex: 0,
1025
- onClick: (s) => {
1026
- s.stopPropagation(), p(n);
1027
- },
1028
- onKeyDown: (s) => {
1029
- (s.key === "Enter" || s.key === " ") && (s.stopPropagation(), p(n));
1030
- },
1031
- children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
1032
- }
1033
- )
1034
- ] })
1035
- ] }),
1036
- /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: y ? "#e0f2f1" : "#fafafa", fontSize: 12, border: y ? "1px solid #b2dfdb" : "none" }, children: y ? /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-between", children: [
1037
- /* @__PURE__ */ t("div", { className: "ff-d-flex ff-flex-column ff-gap-1", children: [
1038
- /* @__PURE__ */ e("span", { style: { fontSize: 12, fontWeight: 600, color: "#00695c" }, children: o || h }),
1039
- /* @__PURE__ */ t("span", { style: { fontSize: 10, color: "#80cbc4", fontFamily: "monospace" }, children: [
1040
- "ID: ",
1041
- h
1042
- ] })
1043
- ] }),
1044
- d && /* @__PURE__ */ t(
1045
- "div",
1046
- {
1047
- role: "button",
1048
- tabIndex: 0,
1049
- onClick: k,
1050
- onKeyDown: (s) => {
1051
- (s.key === "Enter" || s.key === " ") && k(s);
1052
- },
1053
- style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 3, fontSize: 11, color: "#00897b" },
1054
- children: [
1055
- /* @__PURE__ */ e(Re, { size: 13 }),
1056
- "Preview"
1057
- ]
1058
- }
1059
- )
1060
- ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured — select a workflow" }) })
1061
- ] }),
1062
- /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
1063
- ] });
1064
- }, xt = {
1065
- startNode: $e,
1066
- endNode: je,
1067
- addTriggerNode: Be,
1068
- addStepNode: Ke,
1069
- triggerNode: _e,
1070
- eventNode: Ue,
1071
- filterNode: Ge,
1072
- actionNode: Ve,
1073
- approvalNode: qe,
1074
- delayNode: Ze,
1075
- notificationNode: Xe,
1076
- webhookTriggerNode: et,
1077
- restApiNode: tt,
1078
- conditionBranchNode: ot,
1079
- subWorkflowNode: it
1080
- }, lt = 11.5, ee = 2, M = 6, te = 40, ne = 20, oe = 4, Nt = ({
1081
- id: n,
1082
- sourceX: i,
1083
- sourceY: f,
1084
- targetX: p,
1085
- targetY: c,
1086
- sourcePosition: r,
1087
- targetPosition: h,
1088
- source: o,
1089
- target: l,
1090
- data: d
1091
- }) => {
1092
- const [u, y, k] = U({
1093
- sourceX: i,
1094
- sourceY: f,
1095
- targetX: p,
1096
- targetY: c
1097
- }), g = d == null ? void 0 : d.label, s = g === "Pass", S = s || g === "Fail", m = i + (p - i) / 3, C = f + (c - f) / 3, v = i + 2 * (p - i) / 3, R = f + 2 * (c - f) / 3, T = d == null ? void 0 : d.onAddStepClick, A = (L) => {
1098
- if (L.stopPropagation(), typeof T != "function") return;
1099
- const V = {
1100
- edgeId: n,
1101
- nodeId: o,
1102
- sourceNodeId: o,
1103
- targetNodeId: l,
1104
- position: "between",
1105
- referenceNodeId: o,
1106
- referenceNodeType: d == null ? void 0 : d.referenceNodeType,
1107
- stepVisibility: d == null ? void 0 : d.stepVisibility
1108
- };
1109
- T(o, V);
1110
- }, I = (L) => {
1111
- (L.key === "Enter" || L.key === " ") && (L.preventDefault(), A(L));
1112
- }, z = () => /* @__PURE__ */ t(j, { children: [
1113
- /* @__PURE__ */ t("g", { className: "plus-icon-container", children: [
1114
- /* @__PURE__ */ e("circle", { r: lt, className: "edge-plus-circle" }),
1115
- /* @__PURE__ */ e("line", { x1: 0, y1: -M, x2: 0, y2: M, strokeWidth: ee, strokeLinecap: "round", className: "plus-line" }),
1116
- /* @__PURE__ */ e("line", { x1: -M, y1: 0, x2: M, y2: 0, strokeWidth: ee, strokeLinecap: "round", className: "plus-line" })
1117
- ] }),
1118
- /* @__PURE__ */ t("g", { className: "edge-plus-tooltip", transform: "translate(18, 0)", children: [
1119
- /* @__PURE__ */ e("rect", { x: 0, y: -10, width: 65, height: 20, rx: 4, className: "tooltip-bg" }),
1120
- /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
1121
- /* @__PURE__ */ e("text", { x: 32, y: 0, textAnchor: "middle", dominantBaseline: "central", fill: "white", style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" }, children: "Add Step" })
1122
- ] })
1123
- ] }), E = T ? {
1124
- onClick: A,
1125
- onKeyDown: I,
1126
- role: "button",
1127
- tabIndex: 0,
1128
- style: { cursor: "pointer", pointerEvents: "all" }
1129
- } : {
1130
- style: { cursor: "default", pointerEvents: "all" }
1131
- };
1132
- return /* @__PURE__ */ t("g", { className: "edge-with-plus-wrapper", children: [
1133
- /* @__PURE__ */ e(G, { id: n, path: u }),
1134
- S ? /* @__PURE__ */ t(j, { children: [
1135
- /* @__PURE__ */ t("g", { transform: `translate(${m}, ${C})`, children: [
1136
- /* @__PURE__ */ e("rect", { x: -te / 2, y: -ne / 2, width: te, height: ne, rx: oe, ry: oe, fill: s ? "#ADE6C5" : "#FDBFBF" }),
1137
- /* @__PURE__ */ e("text", { textAnchor: "middle", dominantBaseline: "central", fill: s ? "#1DBF60" : "#C50000", style: { fontSize: 12, fontWeight: 500 }, children: g })
1138
- ] }),
1139
- /* @__PURE__ */ e("g", { className: "nodrag nopan edge-plus-svg", transform: `translate(${v}, ${R})`, "data-testid": "plus-node-icon", ...E, children: /* @__PURE__ */ e(z, {}) })
1140
- ] }) : /* @__PURE__ */ e("g", { className: "nodrag nopan edge-plus-svg", transform: `translate(${y}, ${k})`, "data-testid": "plus-node-icon", ...E, children: /* @__PURE__ */ e(z, {}) })
1141
- ] });
1142
- }, rt = 11.5, ie = 2, _ = 6, kt = ({
1143
- id: n,
1144
- sourceX: i,
1145
- sourceY: f,
1146
- targetX: p,
1147
- targetY: c,
1148
- source: r,
1149
- target: h,
1150
- data: o
1151
- }) => {
1152
- const [l, d, u] = U({
1153
- sourceX: i,
1154
- sourceY: f,
1155
- targetX: p,
1156
- targetY: c
1157
- }), y = o == null ? void 0 : o.onAddStepClick, k = (s) => {
1158
- s.stopPropagation(), typeof y == "function" && y(r, {
1159
- edgeId: n,
1160
- nodeId: r,
1161
- sourceNodeId: r,
1162
- targetNodeId: h,
1163
- position: "between",
1164
- referenceNodeId: r,
1165
- referenceNodeType: o == null ? void 0 : o.referenceNodeType,
1166
- stepVisibility: o == null ? void 0 : o.stepVisibility,
1167
- filterId: o == null ? void 0 : o.filterId,
1168
- branch: o == null ? void 0 : o.branch
1169
- });
1170
- }, g = (s) => {
1171
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), k(s));
1172
- };
1173
- return /* @__PURE__ */ t("g", { className: "edge-with-plus-wrapper", children: [
1174
- /* @__PURE__ */ e(G, { id: n, path: l, style: { stroke: "#b0bec5" } }),
1175
- /* @__PURE__ */ t(
1176
- "g",
1177
- {
1178
- className: "nodrag nopan edge-plus-svg",
1179
- transform: `translate(${d}, ${u})`,
1180
- style: {
1181
- cursor: y ? "pointer" : "default",
1182
- pointerEvents: "all",
1183
- outline: "none"
1184
- },
1185
- onClick: y ? k : void 0,
1186
- onKeyDown: y ? g : void 0,
1187
- role: y ? "button" : void 0,
1188
- tabIndex: y ? 0 : void 0,
1189
- "data-testid": "plus-node-icon",
1190
- children: [
1191
- /* @__PURE__ */ e("circle", { r: rt, className: "edge-plus-circle" }),
1192
- /* @__PURE__ */ e(
1193
- "line",
1194
- {
1195
- x1: 0,
1196
- y1: -_,
1197
- x2: 0,
1198
- y2: _,
1199
- strokeWidth: ie,
1200
- strokeLinecap: "round",
1201
- className: "plus-line"
1202
- }
1203
- ),
1204
- /* @__PURE__ */ e(
1205
- "line",
1206
- {
1207
- x1: -_,
1208
- y1: 0,
1209
- x2: _,
1210
- y2: 0,
1211
- strokeWidth: ie,
1212
- strokeLinecap: "round",
1213
- className: "plus-line"
1214
- }
1215
- ),
1216
- /* @__PURE__ */ t("g", { className: "edge-plus-tooltip", transform: "translate(18, 0)", children: [
1217
- /* @__PURE__ */ e(
1218
- "rect",
1219
- {
1220
- x: 0,
1221
- y: -10,
1222
- width: 65,
1223
- height: 20,
1224
- rx: 4,
1225
- className: "tooltip-bg"
1226
- }
1227
- ),
1228
- /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
1229
- /* @__PURE__ */ e(
1230
- "text",
1231
- {
1232
- x: 32,
1233
- y: 0,
1234
- textAnchor: "middle",
1235
- dominantBaseline: "central",
1236
- fill: "white",
1237
- style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" },
1238
- children: "Add Step"
1239
- }
1240
- )
1241
- ] })
1242
- ]
1243
- }
1244
- )
1245
- ] });
1246
- }, vt = ({ id: n, sourceX: i, sourceY: f, targetX: p, targetY: c }) => {
1247
- const [r] = U({ sourceX: i, sourceY: f, targetX: p, targetY: c });
1248
- return /* @__PURE__ */ e(G, { id: n, path: r, style: { stroke: "#b0bec5" } });
1249
- }, st = 11.5, le = 2, H = 6, ct = -24, re = 40, se = 20, ce = 4, wt = ({
1250
- id: n,
1251
- sourceX: i,
1252
- sourceY: f,
1253
- targetX: p,
1254
- targetY: c,
1255
- source: r,
1256
- target: h,
1257
- data: o
1258
- }) => {
1259
- const [l, d, u] = U({ sourceX: i, sourceY: f, targetX: p, targetY: c }), y = o == null ? void 0 : o.label, k = y === "Pass", g = k || y === "Fail", s = o == null ? void 0 : o.onAddStepClick, S = (o == null ? void 0 : o.showPlus) !== !1 && !!s, m = (v) => {
1260
- v.stopPropagation(), typeof s == "function" && s(r, {
1261
- edgeId: n,
1262
- nodeId: r,
1263
- sourceNodeId: r,
1264
- targetNodeId: h,
1265
- position: "between",
1266
- referenceNodeId: r,
1267
- referenceNodeType: o == null ? void 0 : o.referenceNodeType,
1268
- stepVisibility: o == null ? void 0 : o.stepVisibility
1269
- });
1270
- }, C = (v) => {
1271
- (v.key === "Enter" || v.key === " ") && (v.preventDefault(), m(v));
1272
- };
1273
- return /* @__PURE__ */ t("g", { className: "edge-with-plus-wrapper", children: [
1274
- /* @__PURE__ */ e(G, { id: n, path: l, style: { stroke: "#b0bec5" } }),
1275
- /* @__PURE__ */ t(
1276
- "g",
1277
- {
1278
- className: "nodrag nopan edge-plus-svg",
1279
- transform: `translate(${d}, ${u})`,
1280
- style: { cursor: s ? "pointer" : "default", pointerEvents: "all", outline: "none" },
1281
- onClick: s ? m : void 0,
1282
- onKeyDown: s ? C : void 0,
1283
- role: s ? "button" : void 0,
1284
- tabIndex: s ? 0 : void 0,
1285
- children: [
1286
- g && /* @__PURE__ */ t("g", { transform: `translate(0, ${S ? ct : 0})`, children: [
1287
- /* @__PURE__ */ e(
1288
- "rect",
1289
- {
1290
- x: -re / 2,
1291
- y: -se / 2,
1292
- width: re,
1293
- height: se,
1294
- rx: ce,
1295
- ry: ce,
1296
- fill: k ? "#ADE6C5" : "#FDBFBF"
1297
- }
1298
- ),
1299
- /* @__PURE__ */ e("text", { textAnchor: "middle", dominantBaseline: "central", fill: k ? "#1DBF60" : "#C50000", style: { fontSize: 12, fontWeight: 500 }, children: y })
1300
- ] }),
1301
- S && /* @__PURE__ */ t("g", { className: "plus-icon-container", children: [
1302
- /* @__PURE__ */ e("circle", { r: st, className: "edge-plus-circle" }),
1303
- /* @__PURE__ */ e("line", { x1: 0, y1: -H, x2: 0, y2: H, strokeWidth: le, strokeLinecap: "round", className: "plus-line" }),
1304
- /* @__PURE__ */ e("line", { x1: -H, y1: 0, x2: H, y2: 0, strokeWidth: le, strokeLinecap: "round", className: "plus-line" })
1305
- ] }),
1306
- S && /* @__PURE__ */ t("g", { className: "edge-plus-tooltip", transform: "translate(22, 0)", children: [
1307
- /* @__PURE__ */ e("rect", { x: 0, y: -10, width: 65, height: 20, rx: 4, className: "tooltip-bg" }),
1308
- /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
1309
- /* @__PURE__ */ e("text", { x: 32, y: 0, textAnchor: "middle", dominantBaseline: "central", fill: "white", style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" }, children: "Add Step" })
1310
- ] })
1311
- ]
1312
- }
1313
- )
1314
- ] });
1315
- }, St = ({
1316
- id: n,
1317
- source: i,
1318
- target: f,
1319
- sourceX: p,
1320
- sourceY: c,
1321
- targetX: r,
1322
- targetY: h,
1323
- style: o = {},
1324
- markerEnd: l,
1325
- data: d
1326
- }) => {
1327
- const u = (d == null ? void 0 : d.verticalRouting) ?? !1, y = 30, k = u ? (() => {
1328
- const E = h - y;
1329
- return `M ${p},${E} L ${r},${E} L ${r},${h}`;
1330
- })() : (() => {
1331
- const E = c + 30;
1332
- return `M ${p},${c} L ${p},${E} L ${r},${E} L ${r},${h}`;
1333
- })(), g = o.stroke || "#d1d5db", s = d == null ? void 0 : d.label, S = (d == null ? void 0 : d.isFirst) ?? !1, m = d == null ? void 0 : d.onAddStepClick, C = u ? h - y : c + 30, v = p + (r - p) * (u ? 0.25 : 0.35), R = p + (r - p) * (u ? 0.65 : 0.7), T = C, A = (E) => {
1334
- E.stopPropagation(), m && m(i, {
1335
- edgeId: n,
1336
- nodeId: i,
1337
- sourceNodeId: i,
1338
- targetNodeId: f,
1339
- position: "between",
1340
- referenceNodeId: i,
1341
- filterId: d == null ? void 0 : d.filterId,
1342
- branch: d == null ? void 0 : d.branch
1343
- });
1344
- }, I = 11.5, z = 6;
1345
- return /* @__PURE__ */ t("g", { children: [
1346
- /* @__PURE__ */ e("path", { id: n, d: k, fill: "none", stroke: g, strokeWidth: 1.5, markerEnd: l }),
1347
- s && !u && /* @__PURE__ */ e("g", { transform: `translate(${v}, ${T})`, children: (() => {
1348
- const E = Math.max(44, s.length * 7 + 20);
1349
- return /* @__PURE__ */ t(j, { children: [
1350
- /* @__PURE__ */ e(
1351
- "rect",
1352
- {
1353
- x: -E / 2,
1354
- y: -11,
1355
- width: E,
1356
- height: 22,
1357
- rx: 11,
1358
- fill: S ? "#e8f5e9" : "#ffebee",
1359
- stroke: S ? "#81c784" : "#e57373",
1360
- strokeWidth: 1
1361
- }
1362
- ),
1363
- /* @__PURE__ */ e(
1364
- "text",
1365
- {
1366
- x: 0,
1367
- y: 4,
1368
- textAnchor: "middle",
1369
- fontSize: 10,
1370
- fontWeight: 600,
1371
- fill: S ? "#2e7d32" : "#c62828",
1372
- style: { fontFamily: "sans-serif", pointerEvents: "none" },
1373
- children: s
1374
- }
1375
- )
1376
- ] });
1377
- })() }),
1378
- m && /* @__PURE__ */ t(
1379
- "g",
1380
- {
1381
- transform: `translate(${R}, ${T})`,
1382
- onClick: A,
1383
- style: { cursor: "pointer", pointerEvents: "all" },
1384
- className: "nodrag nopan edge-plus-svg",
1385
- children: [
1386
- /* @__PURE__ */ e("circle", { r: I, className: "edge-plus-circle" }),
1387
- /* @__PURE__ */ e("line", { x1: 0, y1: -z, x2: 0, y2: z, strokeWidth: 2, strokeLinecap: "round", className: "plus-line" }),
1388
- /* @__PURE__ */ e("line", { x1: -z, y1: 0, x2: z, y2: 0, strokeWidth: 2, strokeLinecap: "round", className: "plus-line" })
1389
- ]
1390
- }
1391
- )
1392
- ] });
1393
- };
1394
- export {
1395
- Ve as A,
1396
- Ze as D,
1397
- Nt as E,
1398
- Ge as F,
1399
- St as G,
1400
- wt as L,
1401
- Xe as N,
1402
- vt as P,
1403
- tt as R,
1404
- $e as S,
1405
- _e as T,
1406
- et as W,
1407
- Be as a,
1408
- qe as b,
1409
- je as c,
1410
- kt as d,
1411
- xt as e,
1412
- Fe as f
1413
- };
1414
- //# sourceMappingURL=GatewayBranchEdge-CrgczPYJ.js.map