@notmrabhi/flowforge 0.1.5 → 0.1.7

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