@notmrabhi/flowforge 0.1.20 → 0.1.21

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