@notmrabhi/flowforge 0.1.54 → 0.1.56

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