@notmrabhi/flowforge 0.1.107 → 0.1.108
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.
- package/dist/{GatewayBranchEdge-BsPsPmnx.js → GatewayBranchEdge-C023FhhW.js} +653 -637
- package/dist/GatewayBranchEdge-C023FhhW.js.map +1 -0
- package/dist/GatewayBranchEdge-CdoZtIhn.js +2 -0
- package/dist/GatewayBranchEdge-CdoZtIhn.js.map +1 -0
- package/dist/{WorkflowExecutionHistory-BA5IpymY.js → WorkflowExecutionHistory-BBeVPYVc.js} +565 -553
- package/dist/WorkflowExecutionHistory-BBeVPYVc.js.map +1 -0
- package/dist/WorkflowExecutionHistory-BrkL37Wb.js +2 -0
- package/dist/WorkflowExecutionHistory-BrkL37Wb.js.map +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +2 -2
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.d.ts +2 -0
- package/dist/defaultUi.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-BsPsPmnx.js.map +0 -1
- package/dist/GatewayBranchEdge-hUano0YJ.js +0 -2
- package/dist/GatewayBranchEdge-hUano0YJ.js.map +0 -1
- package/dist/WorkflowExecutionHistory-8xEbKYsc.js +0 -2
- package/dist/WorkflowExecutionHistory-8xEbKYsc.js.map +0 -1
- package/dist/WorkflowExecutionHistory-BA5IpymY.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsxs as w, jsx as u, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as w, jsx as u, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
+
import G, { useRef as Tt, useEffect as se, useState as L, useCallback as H, useMemo as U } from "react";
|
|
3
3
|
import Wn, { useStore as $n, useReactFlow as Gn, Background as Yn, Controls as Kn, MiniMap as Hn } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as Un, G as Vn, E as qn, P as Xn, L as Jn, d as Zn, h as Qn } from "./GatewayBranchEdge-
|
|
6
|
-
import { Dialog as er, Box as
|
|
5
|
+
import { e as Un, G as Vn, E as qn, P as Xn, L as Jn, d as Zn, h as Qn } from "./GatewayBranchEdge-C023FhhW.js";
|
|
6
|
+
import { Dialog as er, Box as ne, Drawer as tr, IconButton as It, Button as ze, CircularProgress as nr } from "@mui/material";
|
|
7
7
|
import rr from "react-select";
|
|
8
|
-
import { MdClose as or, MdCalendarToday as ir, MdBolt as sr, MdArrowBack as
|
|
8
|
+
import { MdClose as or, MdCalendarToday as ir, MdBolt as sr, MdArrowBack as Jt, MdChevronRight as Zt, MdAddCircleOutline as lr, MdApps as ar, MdErrorOutline as dr, MdAccountTree as cr, MdAdd as fr, MdSearch as ur, MdCategory as hr, MdCancel as Qt, MdError as en, MdCheckCircle as tn, MdPlayArrow as nn, MdHourglassEmpty as gr, MdSchedule as Ot, MdPerson as pr, MdExpandLess as yr, MdExpandMore as br } from "react-icons/md";
|
|
9
9
|
import { GrTrigger as mr } from "react-icons/gr";
|
|
10
10
|
import { BiCollapse as vr, BiExpand as wr } from "react-icons/bi";
|
|
11
11
|
import { k as Er, c as xr, O as kr } from "./index-C6t1hp3u.js";
|
|
12
12
|
import { m as _r } from "./messages-CRZgWFU-.js";
|
|
13
13
|
import { createTheme as Sr, ThemeProvider as Nr } from "@mui/material/styles";
|
|
14
|
-
import { T as Cr, E as
|
|
15
|
-
var
|
|
16
|
-
for (var n in t)
|
|
17
|
-
}, Or = (e, t, n) => Tr(e, t + "", n),
|
|
18
|
-
Ir(
|
|
19
|
-
var
|
|
20
|
-
for (var n in t)
|
|
21
|
-
},
|
|
14
|
+
import { T as Cr, E as re } from "./canvasTokens-CAD6G24b.js";
|
|
15
|
+
var rn = Object.defineProperty, Tr = (e, t, n) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ir = (e, t) => {
|
|
16
|
+
for (var n in t) rn(e, n, { get: t[n], enumerable: !0 });
|
|
17
|
+
}, Or = (e, t, n) => Tr(e, t + "", n), on = {};
|
|
18
|
+
Ir(on, { Graph: () => q, alg: () => ot, json: () => ln, version: () => zr });
|
|
19
|
+
var Mr = Object.defineProperty, sn = (e, t) => {
|
|
20
|
+
for (var n in t) Mr(e, n, { get: t[n], enumerable: !0 });
|
|
21
|
+
}, q = class {
|
|
22
22
|
constructor(e) {
|
|
23
23
|
this._isDirected = !0, this._isMultigraph = !1, this._isCompound = !1, this._nodes = {}, this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}, this._nodeCount = 0, this._edgeCount = 0, this._defaultNodeLabelFn = () => {
|
|
24
24
|
}, this._defaultEdgeLabelFn = () => {
|
|
@@ -151,15 +151,15 @@ var jr = Object.defineProperty, tn = (e, t) => {
|
|
|
151
151
|
setEdge(e, t, n, r) {
|
|
152
152
|
let o, i, s, l, d = !1;
|
|
153
153
|
typeof e == "object" && e !== null && "v" in e ? (o = e.v, i = e.w, s = e.name, arguments.length === 2 && (l = t, d = !0)) : (o = e, i = t, s = r, arguments.length > 2 && (l = n, d = !0)), o = "" + o, i = "" + i, s !== void 0 && (s = "" + s);
|
|
154
|
-
let a =
|
|
154
|
+
let a = ke(this._isDirected, o, i, s);
|
|
155
155
|
if (a in this._edgeLabels) return d && (this._edgeLabels[a] = l), this;
|
|
156
156
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
157
157
|
this.setNode(o), this.setNode(i), this._edgeLabels[a] = d ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
158
|
-
let c =
|
|
159
|
-
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c,
|
|
158
|
+
let c = jr(this._isDirected, o, i, s);
|
|
159
|
+
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c, Mt(this._preds[i], o), Mt(this._sucs[o], i), this._in[i][a] = c, this._out[o][a] = c, this._edgeCount++, this;
|
|
160
160
|
}
|
|
161
161
|
edge(e, t, n) {
|
|
162
|
-
let r = arguments.length === 1 ?
|
|
162
|
+
let r = arguments.length === 1 ? Ye(this._isDirected, e) : ke(this._isDirected, e, t, n);
|
|
163
163
|
return this._edgeLabels[r];
|
|
164
164
|
}
|
|
165
165
|
edgeAsObj(e, t, n) {
|
|
@@ -167,13 +167,13 @@ var jr = Object.defineProperty, tn = (e, t) => {
|
|
|
167
167
|
return typeof r != "object" ? { label: r } : r;
|
|
168
168
|
}
|
|
169
169
|
hasEdge(e, t, n) {
|
|
170
|
-
return (arguments.length === 1 ?
|
|
170
|
+
return (arguments.length === 1 ? Ye(this._isDirected, e) : ke(this._isDirected, e, t, n)) in this._edgeLabels;
|
|
171
171
|
}
|
|
172
172
|
removeEdge(e, t, n) {
|
|
173
|
-
let r = arguments.length === 1 ?
|
|
173
|
+
let r = arguments.length === 1 ? Ye(this._isDirected, e) : ke(this._isDirected, e, t, n), o = this._edgeObjs[r];
|
|
174
174
|
if (o) {
|
|
175
175
|
let i = o.v, s = o.w;
|
|
176
|
-
delete this._edgeLabels[r], delete this._edgeObjs[r],
|
|
176
|
+
delete this._edgeLabels[r], delete this._edgeObjs[r], jt(this._preds[s], i), jt(this._sucs[i], s), delete this._in[s][r], delete this._out[i][r], this._edgeCount--;
|
|
177
177
|
}
|
|
178
178
|
return this;
|
|
179
179
|
}
|
|
@@ -195,13 +195,13 @@ var jr = Object.defineProperty, tn = (e, t) => {
|
|
|
195
195
|
return n ? r.filter((o) => o.v === t && o.w === n || o.v === n && o.w === t) : r;
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
-
function
|
|
198
|
+
function Mt(e, t) {
|
|
199
199
|
e[t] ? e[t]++ : e[t] = 1;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function jt(e, t) {
|
|
202
202
|
e[t] !== void 0 && !--e[t] && delete e[t];
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ke(e, t, n, r) {
|
|
205
205
|
let o = "" + t, i = "" + n;
|
|
206
206
|
if (!e && o > i) {
|
|
207
207
|
let s = o;
|
|
@@ -209,7 +209,7 @@ function we(e, t, n, r) {
|
|
|
209
209
|
}
|
|
210
210
|
return o + "" + i + "" + (r === void 0 ? "\0" : r);
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function jr(e, t, n, r) {
|
|
213
213
|
let o = "" + t, i = "" + n;
|
|
214
214
|
if (!e && o > i) {
|
|
215
215
|
let l = o;
|
|
@@ -218,11 +218,11 @@ function Mr(e, t, n, r) {
|
|
|
218
218
|
let s = { v: o, w: i };
|
|
219
219
|
return r && (s.name = r), s;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
221
|
+
function Ye(e, t) {
|
|
222
|
+
return ke(e, t.v, t.w, t.name);
|
|
223
223
|
}
|
|
224
|
-
var zr = "4.0.1",
|
|
225
|
-
|
|
224
|
+
var zr = "4.0.1", ln = {};
|
|
225
|
+
sn(ln, { read: () => Rr, write: () => Lr });
|
|
226
226
|
function Lr(e) {
|
|
227
227
|
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes: Pr(e), edges: Fr(e) }, n = e.graph();
|
|
228
228
|
return n !== void 0 && (t.value = structuredClone(n)), t;
|
|
@@ -240,17 +240,17 @@ function Fr(e) {
|
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
function Rr(e) {
|
|
243
|
-
let t = new
|
|
243
|
+
let t = new q(e.options);
|
|
244
244
|
return e.value !== void 0 && t.setGraph(e.value), e.nodes.forEach((n) => {
|
|
245
245
|
t.setNode(n.v, n.value), n.parent && t.setParent(n.v, n.parent);
|
|
246
246
|
}), e.edges.forEach((n) => {
|
|
247
247
|
t.setEdge({ v: n.v, w: n.w, name: n.name }, n.value);
|
|
248
248
|
}), t;
|
|
249
249
|
}
|
|
250
|
-
var
|
|
251
|
-
|
|
250
|
+
var ot = {};
|
|
251
|
+
sn(ot, { CycleException: () => Pe, bellmanFord: () => an, components: () => Dr, dijkstra: () => Le, dijkstraAll: () => Gr, findCycles: () => Yr, floydWarshall: () => Hr, isAcyclic: () => Vr, postorder: () => Xr, preorder: () => Jr, prim: () => Zr, shortestPaths: () => Qr, tarjan: () => cn, topsort: () => fn });
|
|
252
252
|
var Ar = () => 1;
|
|
253
|
-
function
|
|
253
|
+
function an(e, t, n, r) {
|
|
254
254
|
return Br(e, String(t), n || Ar, r || function(o) {
|
|
255
255
|
return e.outEdges(o);
|
|
256
256
|
});
|
|
@@ -285,7 +285,7 @@ function Dr(e) {
|
|
|
285
285
|
r = [], o(i), r.length && n.push(r);
|
|
286
286
|
}), n;
|
|
287
287
|
}
|
|
288
|
-
var
|
|
288
|
+
var dn = class {
|
|
289
289
|
constructor() {
|
|
290
290
|
this._arr = [], this._keyIndices = {};
|
|
291
291
|
}
|
|
@@ -339,14 +339,14 @@ var on = class {
|
|
|
339
339
|
n[e] = i, n[t] = o, r[i.key] = e, r[o.key] = t;
|
|
340
340
|
}
|
|
341
341
|
}, Wr = () => 1;
|
|
342
|
-
function
|
|
342
|
+
function Le(e, t, n, r) {
|
|
343
343
|
let o = function(i) {
|
|
344
344
|
return e.outEdges(i);
|
|
345
345
|
};
|
|
346
346
|
return $r(e, String(t), n || Wr, r || o);
|
|
347
347
|
}
|
|
348
348
|
function $r(e, t, n, r) {
|
|
349
|
-
let o = {}, i = new
|
|
349
|
+
let o = {}, i = new dn(), s, l, d = function(a) {
|
|
350
350
|
let c = a.v !== s ? a.v : a.w, f = o[c], h = n(a), g = l.distance + h;
|
|
351
351
|
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + a + " Weight: " + h);
|
|
352
352
|
g < f.distance && (f.distance = g, f.predecessor = s, i.decrease(c, g));
|
|
@@ -359,10 +359,10 @@ function $r(e, t, n, r) {
|
|
|
359
359
|
}
|
|
360
360
|
function Gr(e, t, n) {
|
|
361
361
|
return e.nodes().reduce(function(r, o) {
|
|
362
|
-
return r[o] =
|
|
362
|
+
return r[o] = Le(e, o, t, n), r;
|
|
363
363
|
}, {});
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function cn(e) {
|
|
366
366
|
let t = 0, n = [], r = {}, o = [];
|
|
367
367
|
function i(s) {
|
|
368
368
|
let l = r[s] = { onStack: !0, lowlink: t, index: t++ };
|
|
@@ -381,7 +381,7 @@ function sn(e) {
|
|
|
381
381
|
}), o;
|
|
382
382
|
}
|
|
383
383
|
function Yr(e) {
|
|
384
|
-
return
|
|
384
|
+
return cn(e).filter(function(t) {
|
|
385
385
|
return t.length > 1 || t.length === 1 && e.hasEdge(t[0], t[0]);
|
|
386
386
|
});
|
|
387
387
|
}
|
|
@@ -411,25 +411,25 @@ function Ur(e, t, n) {
|
|
|
411
411
|
});
|
|
412
412
|
}), r;
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var Pe = class extends Error {
|
|
415
415
|
constructor(...e) {
|
|
416
416
|
super(...e);
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
|
-
function
|
|
419
|
+
function fn(e) {
|
|
420
420
|
let t = {}, n = {}, r = [];
|
|
421
421
|
function o(i) {
|
|
422
|
-
if (i in n) throw new
|
|
422
|
+
if (i in n) throw new Pe();
|
|
423
423
|
i in t || (n[i] = !0, t[i] = !0, e.predecessors(i).forEach(o), delete n[i], r.push(i));
|
|
424
424
|
}
|
|
425
|
-
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new
|
|
425
|
+
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new Pe();
|
|
426
426
|
return r;
|
|
427
427
|
}
|
|
428
428
|
function Vr(e) {
|
|
429
429
|
try {
|
|
430
|
-
|
|
430
|
+
fn(e);
|
|
431
431
|
} catch (t) {
|
|
432
|
-
if (t instanceof
|
|
432
|
+
if (t instanceof Pe) return !1;
|
|
433
433
|
throw t;
|
|
434
434
|
}
|
|
435
435
|
return !0;
|
|
@@ -442,27 +442,27 @@ function qr(e, t, n, r, o) {
|
|
|
442
442
|
}, s = {};
|
|
443
443
|
return t.forEach(function(l) {
|
|
444
444
|
if (!e.hasNode(l)) throw new Error("Graph does not have node: " + l);
|
|
445
|
-
o =
|
|
445
|
+
o = un(e, l, n === "post", s, i, r, o);
|
|
446
446
|
}), o;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function un(e, t, n, r, o, i, s) {
|
|
449
449
|
return t in r || (r[t] = !0, n || (s = i(s, t)), o(t).forEach(function(l) {
|
|
450
|
-
s =
|
|
450
|
+
s = un(e, l, n, r, o, i, s);
|
|
451
451
|
}), n && (s = i(s, t))), s;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function hn(e, t, n) {
|
|
454
454
|
return qr(e, t, n, function(r, o) {
|
|
455
455
|
return r.push(o), r;
|
|
456
456
|
}, []);
|
|
457
457
|
}
|
|
458
458
|
function Xr(e, t) {
|
|
459
|
-
return
|
|
459
|
+
return hn(e, t, "post");
|
|
460
460
|
}
|
|
461
461
|
function Jr(e, t) {
|
|
462
|
-
return
|
|
462
|
+
return hn(e, t, "pre");
|
|
463
463
|
}
|
|
464
464
|
function Zr(e, t) {
|
|
465
|
-
let n = new
|
|
465
|
+
let n = new q(), r = {}, o = new dn(), i;
|
|
466
466
|
function s(d) {
|
|
467
467
|
let a = d.v === i ? d.w : d.v, c = o.priority(a);
|
|
468
468
|
if (c !== void 0) {
|
|
@@ -492,7 +492,7 @@ function Qr(e, t, n, r) {
|
|
|
492
492
|
}));
|
|
493
493
|
}
|
|
494
494
|
function eo(e, t, n, r) {
|
|
495
|
-
if (n === void 0) return
|
|
495
|
+
if (n === void 0) return Le(e, t, n, r);
|
|
496
496
|
let o = !1, i = e.nodes();
|
|
497
497
|
for (let s = 0; s < i.length; s++) {
|
|
498
498
|
let l = r(i[s]);
|
|
@@ -500,38 +500,38 @@ function eo(e, t, n, r) {
|
|
|
500
500
|
let a = l[d], c = a.v === i[s] ? a.v : a.w, f = c === a.v ? a.w : a.v;
|
|
501
501
|
n({ v: c, w: f }) < 0 && (o = !0);
|
|
502
502
|
}
|
|
503
|
-
if (o) return
|
|
503
|
+
if (o) return an(e, t, n, r);
|
|
504
504
|
}
|
|
505
|
-
return
|
|
505
|
+
return Le(e, t, n, r);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function me(e, t, n, r) {
|
|
508
508
|
let o = r;
|
|
509
|
-
for (; e.hasNode(o); ) o =
|
|
509
|
+
for (; e.hasNode(o); ) o = it(r);
|
|
510
510
|
return n.dummy = t, e.setNode(o, n), o;
|
|
511
511
|
}
|
|
512
512
|
function to(e) {
|
|
513
|
-
let t = new
|
|
513
|
+
let t = new q().setGraph(e.graph());
|
|
514
514
|
return e.nodes().forEach((n) => t.setNode(n, e.node(n))), e.edges().forEach((n) => {
|
|
515
515
|
let r = t.edge(n.v, n.w) || { weight: 0, minlen: 1 }, o = e.edge(n);
|
|
516
516
|
t.setEdge(n.v, n.w, { weight: r.weight + o.weight, minlen: Math.max(r.minlen, o.minlen) });
|
|
517
517
|
}), t;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
let t = new
|
|
519
|
+
function gn(e) {
|
|
520
|
+
let t = new q({ multigraph: e.isMultigraph() }).setGraph(e.graph());
|
|
521
521
|
return e.nodes().forEach((n) => {
|
|
522
522
|
e.children(n).length || t.setNode(n, e.node(n));
|
|
523
523
|
}), e.edges().forEach((n) => {
|
|
524
524
|
t.setEdge(n, e.edge(n));
|
|
525
525
|
}), t;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function zt(e, t) {
|
|
528
528
|
let n = e.x, r = e.y, o = t.x - n, i = t.y - r, s = e.width / 2, l = e.height / 2;
|
|
529
529
|
if (!o && !i) throw new Error("Not possible to find intersection inside of the rectangle");
|
|
530
530
|
let d, a;
|
|
531
531
|
return Math.abs(i) * s > Math.abs(o) * l ? (i < 0 && (l = -l), d = l * o / i, a = l) : (o < 0 && (s = -s), d = s, a = s * i / o), { x: n + d, y: r + a };
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
let t =
|
|
533
|
+
function Te(e) {
|
|
534
|
+
let t = Se(yn(e) + 1).map(() => []);
|
|
535
535
|
return e.nodes().forEach((n) => {
|
|
536
536
|
let r = e.node(n), o = r.rank;
|
|
537
537
|
o !== void 0 && (t[o] || (t[o] = []), t[o][r.order] = n);
|
|
@@ -558,11 +558,11 @@ function ro(e) {
|
|
|
558
558
|
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((d) => e.node(d).rank += o);
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Lt(e, t, n, r) {
|
|
562
562
|
let o = { width: 0, height: 0 };
|
|
563
|
-
return arguments.length >= 4 && (o.rank = n, o.order = r),
|
|
563
|
+
return arguments.length >= 4 && (o.rank = n, o.order = r), me(e, "border", o, t);
|
|
564
564
|
}
|
|
565
|
-
function oo(e, t =
|
|
565
|
+
function oo(e, t = pn) {
|
|
566
566
|
let n = [];
|
|
567
567
|
for (let r = 0; r < e.length; r += t) {
|
|
568
568
|
let o = e.slice(r, r + t);
|
|
@@ -570,14 +570,14 @@ function oo(e, t = fn) {
|
|
|
570
570
|
}
|
|
571
571
|
return n;
|
|
572
572
|
}
|
|
573
|
-
var
|
|
573
|
+
var pn = 65535;
|
|
574
574
|
function Q(e, t) {
|
|
575
|
-
if (t.length >
|
|
575
|
+
if (t.length > pn) {
|
|
576
576
|
let n = oo(t);
|
|
577
577
|
return e(...n.map((r) => e(...r)));
|
|
578
578
|
} else return e(...t);
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function yn(e) {
|
|
581
581
|
let t = e.nodes().map((n) => {
|
|
582
582
|
let r = e.node(n).rank;
|
|
583
583
|
return r === void 0 ? Number.MIN_VALUE : r;
|
|
@@ -590,7 +590,7 @@ function io(e, t) {
|
|
|
590
590
|
t(r) ? n.lhs.push(r) : n.rhs.push(r);
|
|
591
591
|
}), n;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function bn(e, t) {
|
|
594
594
|
let n = Date.now();
|
|
595
595
|
try {
|
|
596
596
|
return t();
|
|
@@ -598,15 +598,15 @@ function hn(e, t) {
|
|
|
598
598
|
console.log(e + " time: " + (Date.now() - n) + "ms");
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function mn(e, t) {
|
|
602
602
|
return t();
|
|
603
603
|
}
|
|
604
604
|
var so = 0;
|
|
605
|
-
function
|
|
605
|
+
function it(e) {
|
|
606
606
|
let t = ++so;
|
|
607
607
|
return e + ("" + t);
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function Se(e, t, n = 1) {
|
|
610
610
|
t == null && (t = e, e = 0);
|
|
611
611
|
let r = (i) => i < t;
|
|
612
612
|
n < 0 && (r = (i) => t < i);
|
|
@@ -614,19 +614,19 @@ function xe(e, t, n = 1) {
|
|
|
614
614
|
for (let i = e; r(i); i += n) o.push(i);
|
|
615
615
|
return o;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function Fe(e, t) {
|
|
618
618
|
let n = {};
|
|
619
619
|
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
620
620
|
return n;
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function Re(e, t) {
|
|
623
623
|
let n;
|
|
624
624
|
return typeof t == "string" ? n = (r) => r[t] : n = t, Object.entries(e).reduce((r, [o, i]) => (r[o] = n(i, o), r), {});
|
|
625
625
|
}
|
|
626
626
|
function lo(e, t) {
|
|
627
627
|
return e.reduce((n, r, o) => (n[r] = t[o], n), {});
|
|
628
628
|
}
|
|
629
|
-
var
|
|
629
|
+
var Ae = "\0", ao = "3.0.0", co = class {
|
|
630
630
|
constructor() {
|
|
631
631
|
Or(this, "_sentinel");
|
|
632
632
|
let e = {};
|
|
@@ -634,11 +634,11 @@ var Le = "\0", ao = "3.0.0", co = class {
|
|
|
634
634
|
}
|
|
635
635
|
dequeue() {
|
|
636
636
|
let e = this._sentinel, t = e._prev;
|
|
637
|
-
if (t !== e) return
|
|
637
|
+
if (t !== e) return Pt(t), t;
|
|
638
638
|
}
|
|
639
639
|
enqueue(e) {
|
|
640
640
|
let t = this._sentinel;
|
|
641
|
-
e._prev && e._next &&
|
|
641
|
+
e._prev && e._next && Pt(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
|
|
642
642
|
}
|
|
643
643
|
toString() {
|
|
644
644
|
let e = [], t = this._sentinel, n = t._prev;
|
|
@@ -646,7 +646,7 @@ var Le = "\0", ao = "3.0.0", co = class {
|
|
|
646
646
|
return "[" + e.join(", ") + "]";
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
|
-
function
|
|
649
|
+
function Pt(e) {
|
|
650
650
|
e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
|
|
651
651
|
}
|
|
652
652
|
function fo(e, t) {
|
|
@@ -662,29 +662,29 @@ function po(e, t, n) {
|
|
|
662
662
|
var r;
|
|
663
663
|
let o = [], i = t[t.length - 1], s = t[0], l;
|
|
664
664
|
for (; e.nodeCount(); ) {
|
|
665
|
-
for (; l = s.dequeue(); )
|
|
666
|
-
for (; l = i.dequeue(); )
|
|
665
|
+
for (; l = s.dequeue(); ) Ke(e, t, n, l);
|
|
666
|
+
for (; l = i.dequeue(); ) Ke(e, t, n, l);
|
|
667
667
|
if (e.nodeCount()) {
|
|
668
668
|
for (let d = t.length - 2; d > 0; --d) if (l = (r = t[d]) == null ? void 0 : r.dequeue(), l) {
|
|
669
|
-
o = o.concat(
|
|
669
|
+
o = o.concat(Ke(e, t, n, l, !0) || []);
|
|
670
670
|
break;
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
return o;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Ke(e, t, n, r, o) {
|
|
677
677
|
let i = [], s = o ? i : void 0;
|
|
678
678
|
return (e.inEdges(r.v) || []).forEach((l) => {
|
|
679
679
|
let d = e.edge(l), a = e.node(l.v);
|
|
680
|
-
o && i.push({ v: l.v, w: l.w }), a.out -= d,
|
|
680
|
+
o && i.push({ v: l.v, w: l.w }), a.out -= d, Qe(t, n, a);
|
|
681
681
|
}), (e.outEdges(r.v) || []).forEach((l) => {
|
|
682
682
|
let d = e.edge(l), a = l.w, c = e.node(a);
|
|
683
|
-
c.in -= d,
|
|
683
|
+
c.in -= d, Qe(t, n, c);
|
|
684
684
|
}), e.removeNode(r.v), s;
|
|
685
685
|
}
|
|
686
686
|
function yo(e, t) {
|
|
687
|
-
let n = new
|
|
687
|
+
let n = new q(), r = 0, o = 0;
|
|
688
688
|
e.nodes().forEach((l) => {
|
|
689
689
|
n.setNode(l, { v: l, in: 0, out: 0 });
|
|
690
690
|
}), e.edges().forEach((l) => {
|
|
@@ -695,10 +695,10 @@ function yo(e, t) {
|
|
|
695
695
|
});
|
|
696
696
|
let i = bo(o + r + 3).map(() => new uo()), s = r + 1;
|
|
697
697
|
return n.nodes().forEach((l) => {
|
|
698
|
-
|
|
698
|
+
Qe(i, s, n.node(l));
|
|
699
699
|
}), { graph: n, buckets: i, zeroIdx: s };
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function Qe(e, t, n) {
|
|
702
702
|
var r, o, i;
|
|
703
703
|
n.out ? n.in ? (i = e[n.out - n.in + t]) == null || i.enqueue(n) : (o = e[e.length - 1]) == null || o.enqueue(n) : (r = e[0]) == null || r.enqueue(n);
|
|
704
704
|
}
|
|
@@ -710,7 +710,7 @@ function bo(e) {
|
|
|
710
710
|
function mo(e) {
|
|
711
711
|
(e.graph().acyclicer === "greedy" ? go(e, t(e)) : vo(e)).forEach((n) => {
|
|
712
712
|
let r = e.edge(n);
|
|
713
|
-
e.removeEdge(n), r.forwardName = n.name, r.reversed = !0, e.setEdge(n.w, n.v, r,
|
|
713
|
+
e.removeEdge(n), r.forwardName = n.name, r.reversed = !0, e.setEdge(n.w, n.v, r, it("rev"));
|
|
714
714
|
});
|
|
715
715
|
function t(n) {
|
|
716
716
|
return (r) => n.edge(r).weight;
|
|
@@ -743,7 +743,7 @@ function xo(e, t) {
|
|
|
743
743
|
if (i === r + 1) return;
|
|
744
744
|
e.removeEdge(t);
|
|
745
745
|
let a, c, f;
|
|
746
|
-
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, a =
|
|
746
|
+
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, a = me(e, "edge", c, "_d"), r === d && (c.width = l.width, c.height = l.height, c.dummy = "edge-label", c.labelpos = l.labelpos), e.setEdge(n, a, { weight: l.weight }, s), f === 0 && e.graph().dummyChains.push(a), n = a;
|
|
747
747
|
e.setEdge(n, o, { weight: l.weight }, s);
|
|
748
748
|
}
|
|
749
749
|
function ko(e) {
|
|
@@ -752,7 +752,7 @@ function ko(e) {
|
|
|
752
752
|
for (e.setEdge(n.edgeObj, r); n.dummy; ) o = e.successors(t)[0], e.removeNode(t), r.points.push({ x: n.x, y: n.y }), n.dummy === "edge-label" && (r.x = n.x, r.y = n.y, r.width = n.width, r.height = n.height), t = o, n = e.node(t);
|
|
753
753
|
});
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function st(e) {
|
|
756
756
|
let t = {};
|
|
757
757
|
function n(r) {
|
|
758
758
|
let o = e.node(r);
|
|
@@ -763,17 +763,17 @@ function tt(e) {
|
|
|
763
763
|
}
|
|
764
764
|
e.sources().forEach(n);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function be(e, t) {
|
|
767
767
|
return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
|
|
768
768
|
}
|
|
769
|
-
var
|
|
769
|
+
var vn = _o;
|
|
770
770
|
function _o(e) {
|
|
771
|
-
let t = new
|
|
771
|
+
let t = new q({ directed: !1 }), n = e.nodes();
|
|
772
772
|
if (n.length === 0) throw new Error("Graph must have at least one node");
|
|
773
773
|
let r = n[0], o = e.nodeCount();
|
|
774
774
|
t.setNode(r, {});
|
|
775
775
|
let i, s;
|
|
776
|
-
for (; So(t, e) < o && (i = No(t, e), !!i); ) s = t.hasNode(i.v) ?
|
|
776
|
+
for (; So(t, e) < o && (i = No(t, e), !!i); ) s = t.hasNode(i.v) ? be(e, i) : -be(e, i), Co(t, e, s);
|
|
777
777
|
return t;
|
|
778
778
|
}
|
|
779
779
|
function So(e, t) {
|
|
@@ -781,7 +781,7 @@ function So(e, t) {
|
|
|
781
781
|
let o = t.nodeEdges(r);
|
|
782
782
|
o && o.forEach((i) => {
|
|
783
783
|
let s = i.v, l = r === s ? i.w : s;
|
|
784
|
-
!e.hasNode(l) && !
|
|
784
|
+
!e.hasNode(l) && !be(t, i) && (e.setNode(l, {}), e.setEdge(r, l, {}), n(l));
|
|
785
785
|
});
|
|
786
786
|
}
|
|
787
787
|
return e.nodes().forEach(n), e.nodeCount();
|
|
@@ -789,35 +789,35 @@ function So(e, t) {
|
|
|
789
789
|
function No(e, t) {
|
|
790
790
|
return t.edges().reduce((n, r) => {
|
|
791
791
|
let o = Number.POSITIVE_INFINITY;
|
|
792
|
-
return e.hasNode(r.v) !== e.hasNode(r.w) && (o =
|
|
792
|
+
return e.hasNode(r.v) !== e.hasNode(r.w) && (o = be(t, r)), o < n[0] ? [o, r] : n;
|
|
793
793
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
794
794
|
}
|
|
795
795
|
function Co(e, t, n) {
|
|
796
796
|
e.nodes().forEach((r) => t.node(r).rank += n);
|
|
797
797
|
}
|
|
798
|
-
var { preorder: To, postorder: Io } =
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
function
|
|
806
|
-
e = to(e),
|
|
807
|
-
let t =
|
|
808
|
-
|
|
798
|
+
var { preorder: To, postorder: Io } = ot, Oo = ue;
|
|
799
|
+
ue.initLowLimValues = at;
|
|
800
|
+
ue.initCutValues = lt;
|
|
801
|
+
ue.calcCutValue = wn;
|
|
802
|
+
ue.leaveEdge = xn;
|
|
803
|
+
ue.enterEdge = kn;
|
|
804
|
+
ue.exchangeEdges = _n;
|
|
805
|
+
function ue(e) {
|
|
806
|
+
e = to(e), st(e);
|
|
807
|
+
let t = vn(e);
|
|
808
|
+
at(t), lt(t, e);
|
|
809
809
|
let n, r;
|
|
810
|
-
for (; n =
|
|
810
|
+
for (; n = xn(t); ) r = kn(t, e, n), _n(t, e, n, r);
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function lt(e, t) {
|
|
813
813
|
let n = Io(e, e.nodes());
|
|
814
|
-
n = n.slice(0, n.length - 1), n.forEach((r) =>
|
|
814
|
+
n = n.slice(0, n.length - 1), n.forEach((r) => Mo(e, t, r));
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function Mo(e, t, n) {
|
|
817
817
|
let r = e.node(n).parent, o = e.edge(n, r);
|
|
818
|
-
o.cutvalue =
|
|
818
|
+
o.cutvalue = wn(e, t, n);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function wn(e, t, n) {
|
|
821
821
|
let r = e.node(n).parent, o = !0, i = t.edge(n, r), s = 0;
|
|
822
822
|
i || (o = !1, i = t.edge(r, n)), s = i.weight;
|
|
823
823
|
let l = t.nodeEdges(n);
|
|
@@ -832,31 +832,31 @@ function yn(e, t, n) {
|
|
|
832
832
|
}
|
|
833
833
|
}), s;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
arguments.length < 2 && (t = e.nodes()[0]),
|
|
835
|
+
function at(e, t) {
|
|
836
|
+
arguments.length < 2 && (t = e.nodes()[0]), En(e, {}, 1, t);
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function En(e, t, n, r, o) {
|
|
839
839
|
let i = n, s = e.node(r);
|
|
840
840
|
t[r] = !0;
|
|
841
841
|
let l = e.neighbors(r);
|
|
842
842
|
return l && l.forEach((d) => {
|
|
843
|
-
Object.hasOwn(t, d) || (n =
|
|
843
|
+
Object.hasOwn(t, d) || (n = En(e, t, n, d, r));
|
|
844
844
|
}), s.low = i, s.lim = n++, o ? s.parent = o : delete s.parent, n;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function xn(e) {
|
|
847
847
|
return e.edges().find((t) => e.edge(t).cutvalue < 0);
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function kn(e, t, n) {
|
|
850
850
|
let r = n.v, o = n.w;
|
|
851
851
|
t.hasEdge(r, o) || (r = n.w, o = n.v);
|
|
852
852
|
let i = e.node(r), s = e.node(o), l = i, d = !1;
|
|
853
|
-
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d ===
|
|
853
|
+
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d === Ft(e, e.node(a.v), l) && d !== Ft(e, e.node(a.w), l)).reduce((a, c) => be(t, c) < be(t, a) ? c : a);
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function _n(e, t, n, r) {
|
|
856
856
|
let o = n.v, i = n.w;
|
|
857
|
-
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}),
|
|
857
|
+
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}), at(e), lt(e, t), jo(e, t);
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function jo(e, t) {
|
|
860
860
|
let n = e.nodes().find((o) => !e.node(o).parent);
|
|
861
861
|
if (!n) return;
|
|
862
862
|
let r = To(e, [n]);
|
|
@@ -868,7 +868,7 @@ function Mo(e, t) {
|
|
|
868
868
|
function zo(e, t, n) {
|
|
869
869
|
return e.hasEdge(t, n);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function Ft(e, t, n) {
|
|
872
872
|
return n.low <= t.lim && t.lim <= n.lim;
|
|
873
873
|
}
|
|
874
874
|
var Lo = Po;
|
|
@@ -877,7 +877,7 @@ function Po(e) {
|
|
|
877
877
|
if (typeof t == "function") return t(e);
|
|
878
878
|
switch (t) {
|
|
879
879
|
case "network-simplex":
|
|
880
|
-
|
|
880
|
+
Rt(e);
|
|
881
881
|
break;
|
|
882
882
|
case "tight-tree":
|
|
883
883
|
Ro(e);
|
|
@@ -888,14 +888,14 @@ function Po(e) {
|
|
|
888
888
|
case "none":
|
|
889
889
|
break;
|
|
890
890
|
default:
|
|
891
|
-
|
|
891
|
+
Rt(e);
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
var Fo =
|
|
894
|
+
var Fo = st;
|
|
895
895
|
function Ro(e) {
|
|
896
|
-
|
|
896
|
+
st(e), vn(e);
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function Rt(e) {
|
|
899
899
|
Oo(e);
|
|
900
900
|
}
|
|
901
901
|
var Ao = Bo;
|
|
@@ -932,25 +932,25 @@ function Wo(e) {
|
|
|
932
932
|
let i = n;
|
|
933
933
|
e.children(o).forEach(r), t[o] = { low: i, lim: n++ };
|
|
934
934
|
}
|
|
935
|
-
return e.children(
|
|
935
|
+
return e.children(Ae).forEach(r), t;
|
|
936
936
|
}
|
|
937
937
|
function $o(e) {
|
|
938
|
-
let t =
|
|
938
|
+
let t = me(e, "root", {}, "_root"), n = Go(e), r = Object.values(n), o = Q(Math.max, r) - 1, i = 2 * o + 1;
|
|
939
939
|
e.graph().nestingRoot = t, e.edges().forEach((l) => e.edge(l).minlen *= i);
|
|
940
940
|
let s = Yo(e) + 1;
|
|
941
|
-
e.children(
|
|
941
|
+
e.children(Ae).forEach((l) => Sn(e, t, i, s, o, n, l)), e.graph().nodeRankFactor = i;
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function Sn(e, t, n, r, o, i, s) {
|
|
944
944
|
var l;
|
|
945
945
|
let d = e.children(s);
|
|
946
946
|
if (!d.length) {
|
|
947
947
|
s !== t && e.setEdge(t, s, { weight: 0, minlen: n });
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
let a =
|
|
950
|
+
let a = Lt(e, "_bt"), c = Lt(e, "_bb"), f = e.node(s);
|
|
951
951
|
e.setParent(a, s), f.borderTop = a, e.setParent(c, s), f.borderBottom = c, d.forEach((h) => {
|
|
952
952
|
var g;
|
|
953
|
-
|
|
953
|
+
Sn(e, t, n, r, o, i, h);
|
|
954
954
|
let E = e.node(h), m = E.borderTop ? E.borderTop : h, p = E.borderBottom ? E.borderBottom : h, k = E.borderTop ? r : 2 * r, x = m !== p ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
955
955
|
e.setEdge(a, m, { weight: k, minlen: x, nestingEdge: !0 }), e.setEdge(p, c, { weight: k, minlen: x, nestingEdge: !0 });
|
|
956
956
|
}), e.parent(s) || e.setEdge(t, a, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
@@ -961,7 +961,7 @@ function Go(e) {
|
|
|
961
961
|
let i = e.children(r);
|
|
962
962
|
i && i.length && i.forEach((s) => n(s, o + 1)), t[r] = o;
|
|
963
963
|
}
|
|
964
|
-
return e.children(
|
|
964
|
+
return e.children(Ae).forEach((r) => n(r, 1)), t;
|
|
965
965
|
}
|
|
966
966
|
function Yo(e) {
|
|
967
967
|
return e.edges().reduce((t, n) => t + e.edge(n).weight, 0);
|
|
@@ -978,55 +978,55 @@ function Uo(e) {
|
|
|
978
978
|
let r = e.children(n), o = e.node(n);
|
|
979
979
|
if (r.length && r.forEach(t), Object.hasOwn(o, "minRank")) {
|
|
980
980
|
o.borderLeft = [], o.borderRight = [];
|
|
981
|
-
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i)
|
|
981
|
+
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i) At(e, "borderLeft", "_bl", n, o, i), At(e, "borderRight", "_br", n, o, i);
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
|
-
e.children(
|
|
984
|
+
e.children(Ae).forEach(t);
|
|
985
985
|
}
|
|
986
|
-
function
|
|
987
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d =
|
|
986
|
+
function At(e, t, n, r, o, i) {
|
|
987
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d = me(e, "border", s, n);
|
|
988
988
|
o[t][i] = d, e.setParent(d, r), l && e.setEdge(l, d, { weight: 1 });
|
|
989
989
|
}
|
|
990
990
|
function Vo(e) {
|
|
991
991
|
var t;
|
|
992
992
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
993
|
-
(n === "lr" || n === "rl") &&
|
|
993
|
+
(n === "lr" || n === "rl") && Nn(e);
|
|
994
994
|
}
|
|
995
995
|
function qo(e) {
|
|
996
996
|
var t;
|
|
997
997
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
998
|
-
(n === "bt" || n === "rl") && Xo(e), (n === "lr" || n === "rl") && (Jo(e),
|
|
998
|
+
(n === "bt" || n === "rl") && Xo(e), (n === "lr" || n === "rl") && (Jo(e), Nn(e));
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1001
|
-
e.nodes().forEach((t) =>
|
|
1000
|
+
function Nn(e) {
|
|
1001
|
+
e.nodes().forEach((t) => Bt(e.node(t))), e.edges().forEach((t) => Bt(e.edge(t)));
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function Bt(e) {
|
|
1004
1004
|
let t = e.width;
|
|
1005
1005
|
e.width = e.height, e.height = t;
|
|
1006
1006
|
}
|
|
1007
1007
|
function Xo(e) {
|
|
1008
|
-
e.nodes().forEach((t) =>
|
|
1008
|
+
e.nodes().forEach((t) => He(e.node(t))), e.edges().forEach((t) => {
|
|
1009
1009
|
var n;
|
|
1010
1010
|
let r = e.edge(t);
|
|
1011
|
-
(n = r.points) == null || n.forEach(
|
|
1011
|
+
(n = r.points) == null || n.forEach(He), Object.hasOwn(r, "y") && He(r);
|
|
1012
1012
|
});
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function He(e) {
|
|
1015
1015
|
e.y = -e.y;
|
|
1016
1016
|
}
|
|
1017
1017
|
function Jo(e) {
|
|
1018
|
-
e.nodes().forEach((t) =>
|
|
1018
|
+
e.nodes().forEach((t) => Ue(e.node(t))), e.edges().forEach((t) => {
|
|
1019
1019
|
var n;
|
|
1020
1020
|
let r = e.edge(t);
|
|
1021
|
-
(n = r.points) == null || n.forEach(
|
|
1021
|
+
(n = r.points) == null || n.forEach(Ue), Object.hasOwn(r, "x") && Ue(r);
|
|
1022
1022
|
});
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function Ue(e) {
|
|
1025
1025
|
let t = e.x;
|
|
1026
1026
|
e.x = e.y, e.y = t;
|
|
1027
1027
|
}
|
|
1028
1028
|
function Zo(e) {
|
|
1029
|
-
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = Q(Math.max, r), i =
|
|
1029
|
+
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = Q(Math.max, r), i = Se(o + 1).map(() => []);
|
|
1030
1030
|
function s(l) {
|
|
1031
1031
|
if (t[l]) return;
|
|
1032
1032
|
t[l] = !0;
|
|
@@ -1100,7 +1100,7 @@ function ri(e) {
|
|
|
1100
1100
|
let o = e.pop();
|
|
1101
1101
|
t.push(o), o.in.reverse().forEach(n(o)), o.out.forEach(r(o));
|
|
1102
1102
|
}
|
|
1103
|
-
return t.filter((o) => !o.merged).map((o) =>
|
|
1103
|
+
return t.filter((o) => !o.merged).map((o) => Fe(o, ["vs", "i", "barycenter", "weight"]));
|
|
1104
1104
|
}
|
|
1105
1105
|
function oi(e, t) {
|
|
1106
1106
|
let n = 0, r = 0;
|
|
@@ -1108,13 +1108,13 @@ function oi(e, t) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
function ii(e, t) {
|
|
1110
1110
|
let n = io(e, (c) => Object.hasOwn(c, "barycenter")), r = n.lhs, o = n.rhs.sort((c, f) => f.i - c.i), i = [], s = 0, l = 0, d = 0;
|
|
1111
|
-
r.sort(si(!!t)), d =
|
|
1112
|
-
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d =
|
|
1111
|
+
r.sort(si(!!t)), d = Dt(i, o, d), r.forEach((c) => {
|
|
1112
|
+
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d = Dt(i, o, d);
|
|
1113
1113
|
});
|
|
1114
1114
|
let a = { vs: i.flat(1) };
|
|
1115
1115
|
return l && (a.barycenter = s / l, a.weight = l), a;
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Dt(e, t, n) {
|
|
1118
1118
|
let r;
|
|
1119
1119
|
for (; t.length && (r = t[t.length - 1]).i <= n; ) t.pop(), e.push(r.vs), n++;
|
|
1120
1120
|
return n;
|
|
@@ -1122,13 +1122,13 @@ function Ft(e, t, n) {
|
|
|
1122
1122
|
function si(e) {
|
|
1123
1123
|
return (t, n) => t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : e ? n.i - t.i : t.i - n.i;
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1125
|
+
function Cn(e, t, n, r) {
|
|
1126
1126
|
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0, d = {};
|
|
1127
1127
|
s && (o = o.filter((h) => h !== s && h !== l));
|
|
1128
1128
|
let a = ti(e, o);
|
|
1129
1129
|
a.forEach((h) => {
|
|
1130
1130
|
if (e.children(h.v).length) {
|
|
1131
|
-
let g =
|
|
1131
|
+
let g = Cn(e, h.v, n, r);
|
|
1132
1132
|
d[h.v] = g, Object.hasOwn(g, "barycenter") && ai(h, g);
|
|
1133
1133
|
}
|
|
1134
1134
|
});
|
|
@@ -1155,7 +1155,7 @@ function ai(e, t) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
function di(e, t, n, r) {
|
|
1157
1157
|
r || (r = e.nodes());
|
|
1158
|
-
let o = ci(e), i = new
|
|
1158
|
+
let o = ci(e), i = new q({ compound: !0 }).setGraph({ root: o }).setDefaultNodeLabel((s) => e.node(s));
|
|
1159
1159
|
return r.forEach((s) => {
|
|
1160
1160
|
let l = e.node(s), d = e.parent(s);
|
|
1161
1161
|
if (l.rank === t || l.minRank <= t && t <= l.maxRank) {
|
|
@@ -1170,7 +1170,7 @@ function di(e, t, n, r) {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
function ci(e) {
|
|
1172
1172
|
let t;
|
|
1173
|
-
for (; e.hasNode(t =
|
|
1173
|
+
for (; e.hasNode(t = it("_root")); ) ;
|
|
1174
1174
|
return t;
|
|
1175
1175
|
}
|
|
1176
1176
|
function fi(e, t, n) {
|
|
@@ -1186,22 +1186,22 @@ function fi(e, t, n) {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
});
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1189
|
+
function Tn(e, t = {}) {
|
|
1190
1190
|
if (typeof t.customOrder == "function") {
|
|
1191
|
-
t.customOrder(e,
|
|
1191
|
+
t.customOrder(e, Tn);
|
|
1192
1192
|
return;
|
|
1193
1193
|
}
|
|
1194
|
-
let n =
|
|
1195
|
-
if (
|
|
1194
|
+
let n = yn(e), r = Wt(e, Se(1, n + 1), "inEdges"), o = Wt(e, Se(n - 1, -1, -1), "outEdges"), i = Zo(e);
|
|
1195
|
+
if ($t(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1196
1196
|
let s = Number.POSITIVE_INFINITY, l, d = t.constraints || [];
|
|
1197
1197
|
for (let a = 0, c = 0; c < 4; ++a, ++c) {
|
|
1198
|
-
ui(a % 2 ? r : o, a % 4 >= 2, d), i =
|
|
1198
|
+
ui(a % 2 ? r : o, a % 4 >= 2, d), i = Te(e);
|
|
1199
1199
|
let f = Qo(e, i);
|
|
1200
1200
|
f < s ? (c = 0, l = Object.assign({}, i), s = f) : f === s && (l = structuredClone(i));
|
|
1201
1201
|
}
|
|
1202
|
-
|
|
1202
|
+
$t(e, l);
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function Wt(e, t, n) {
|
|
1205
1205
|
let r = /* @__PURE__ */ new Map(), o = (i, s) => {
|
|
1206
1206
|
r.has(i) || r.set(i, []), r.get(i).push(s);
|
|
1207
1207
|
};
|
|
@@ -1214,14 +1214,14 @@ function Rt(e, t, n) {
|
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
1216
|
function ui(e, t, n) {
|
|
1217
|
-
let r = new
|
|
1217
|
+
let r = new q();
|
|
1218
1218
|
e.forEach(function(o) {
|
|
1219
1219
|
n.forEach((l) => r.setEdge(l.left, l.right));
|
|
1220
|
-
let i = o.graph().root, s =
|
|
1220
|
+
let i = o.graph().root, s = Cn(o, i, r, t);
|
|
1221
1221
|
s.vs.forEach((l, d) => o.node(l).order = d), fi(o, r, s.vs);
|
|
1222
1222
|
});
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function $t(e, t) {
|
|
1225
1225
|
Object.values(t).forEach((n) => n.forEach((r, o) => e.node(r).order = o));
|
|
1226
1226
|
}
|
|
1227
1227
|
function hi(e, t) {
|
|
@@ -1234,7 +1234,7 @@ function hi(e, t) {
|
|
|
1234
1234
|
let m = e.predecessors(E);
|
|
1235
1235
|
m && m.forEach((p) => {
|
|
1236
1236
|
let k = e.node(p), x = k.order;
|
|
1237
|
-
(x < s || g < x) && !(k.dummy && e.node(E).dummy) &&
|
|
1237
|
+
(x < s || g < x) && !(k.dummy && e.node(E).dummy) && In(n, p, E);
|
|
1238
1238
|
});
|
|
1239
1239
|
}), l = f + 1, s = g);
|
|
1240
1240
|
}), i;
|
|
@@ -1244,14 +1244,14 @@ function hi(e, t) {
|
|
|
1244
1244
|
function gi(e, t) {
|
|
1245
1245
|
let n = {};
|
|
1246
1246
|
function r(i, s, l, d, a) {
|
|
1247
|
-
|
|
1247
|
+
Se(s, l).forEach((c) => {
|
|
1248
1248
|
let f = i[c];
|
|
1249
1249
|
if (f !== void 0 && e.node(f).dummy) {
|
|
1250
1250
|
let h = e.predecessors(f);
|
|
1251
1251
|
h && h.forEach((g) => {
|
|
1252
1252
|
if (g === void 0) return;
|
|
1253
1253
|
let E = e.node(g);
|
|
1254
|
-
E.dummy && (E.order < d || E.order > a) &&
|
|
1254
|
+
E.dummy && (E.order < d || E.order > a) && In(n, g, f);
|
|
1255
1255
|
});
|
|
1256
1256
|
}
|
|
1257
1257
|
});
|
|
@@ -1278,7 +1278,7 @@ function pi(e, t) {
|
|
|
1278
1278
|
if (n) return n.find((r) => e.node(r).dummy);
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function In(e, t, n) {
|
|
1282
1282
|
if (t > n) {
|
|
1283
1283
|
let o = t;
|
|
1284
1284
|
t = n, n = o;
|
|
@@ -1346,8 +1346,8 @@ function mi(e, t, n, r, o = !1) {
|
|
|
1346
1346
|
function c(g) {
|
|
1347
1347
|
let E = s.outEdges(g), m = Number.POSITIVE_INFINITY;
|
|
1348
1348
|
E && (m = E.reduce((k, x) => {
|
|
1349
|
-
let O = i[x.w],
|
|
1350
|
-
return Math.min(k, (O !== void 0 ? O : 0) - (
|
|
1349
|
+
let O = i[x.w], z = s.edge(x);
|
|
1350
|
+
return Math.min(k, (O !== void 0 ? O : 0) - (z !== void 0 ? z : 0));
|
|
1351
1351
|
}, Number.POSITIVE_INFINITY));
|
|
1352
1352
|
let p = e.node(g);
|
|
1353
1353
|
m !== Number.POSITIVE_INFINITY && p.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, m));
|
|
@@ -1365,7 +1365,7 @@ function mi(e, t, n, r, o = !1) {
|
|
|
1365
1365
|
}), i;
|
|
1366
1366
|
}
|
|
1367
1367
|
function vi(e, t, n, r) {
|
|
1368
|
-
let o = new
|
|
1368
|
+
let o = new q(), i = e.graph(), s = _i(i.nodesep, i.edgesep, r);
|
|
1369
1369
|
return t.forEach((l) => {
|
|
1370
1370
|
let d;
|
|
1371
1371
|
l.forEach((a) => {
|
|
@@ -1401,13 +1401,13 @@ function Ei(e, t) {
|
|
|
1401
1401
|
let l = i + s, d = e[l];
|
|
1402
1402
|
if (!d || d === t) return;
|
|
1403
1403
|
let a = Object.values(d), c = r - Q(Math.min, a);
|
|
1404
|
-
s !== "l" && (c = o - Q(Math.max, a)), c && (e[l] =
|
|
1404
|
+
s !== "l" && (c = o - Q(Math.max, a)), c && (e[l] = Re(d, (f) => f + c));
|
|
1405
1405
|
});
|
|
1406
1406
|
});
|
|
1407
1407
|
}
|
|
1408
1408
|
function xi(e, t = void 0) {
|
|
1409
1409
|
let n = e.ul;
|
|
1410
|
-
return n ?
|
|
1410
|
+
return n ? Re(n, (r, o) => {
|
|
1411
1411
|
var i, s;
|
|
1412
1412
|
if (t) {
|
|
1413
1413
|
let d = t.toLowerCase(), a = e[d];
|
|
@@ -1421,12 +1421,12 @@ function xi(e, t = void 0) {
|
|
|
1421
1421
|
}) : {};
|
|
1422
1422
|
}
|
|
1423
1423
|
function ki(e) {
|
|
1424
|
-
let t =
|
|
1424
|
+
let t = Te(e), n = Object.assign(hi(e, t), gi(e, t)), r = {}, o;
|
|
1425
1425
|
["u", "d"].forEach((s) => {
|
|
1426
1426
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1427
1427
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1428
1428
|
let d = bi(e, o, n, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), a = mi(e, o, d.root, d.align, l === "r");
|
|
1429
|
-
l === "r" && (a =
|
|
1429
|
+
l === "r" && (a = Re(a, (c) => -c)), r[s + l] = a;
|
|
1430
1430
|
});
|
|
1431
1431
|
});
|
|
1432
1432
|
let i = wi(e, r);
|
|
@@ -1458,10 +1458,10 @@ function Si(e, t) {
|
|
|
1458
1458
|
return e.node(t).width;
|
|
1459
1459
|
}
|
|
1460
1460
|
function Ni(e) {
|
|
1461
|
-
e =
|
|
1461
|
+
e = gn(e), Ci(e), Object.entries(ki(e)).forEach(([t, n]) => e.node(t).x = n);
|
|
1462
1462
|
}
|
|
1463
1463
|
function Ci(e) {
|
|
1464
|
-
let t =
|
|
1464
|
+
let t = Te(e), n = e.graph(), r = n.ranksep, o = n.rankalign, i = 0;
|
|
1465
1465
|
t.forEach((s) => {
|
|
1466
1466
|
let l = s.reduce((d, a) => {
|
|
1467
1467
|
var c;
|
|
@@ -1475,14 +1475,14 @@ function Ci(e) {
|
|
|
1475
1475
|
});
|
|
1476
1476
|
}
|
|
1477
1477
|
function Ti(e, t = {}) {
|
|
1478
|
-
let n = t.debugTiming ?
|
|
1478
|
+
let n = t.debugTiming ? bn : mn;
|
|
1479
1479
|
return n("layout", () => {
|
|
1480
1480
|
let r = n(" buildLayoutGraph", () => Ai(e));
|
|
1481
1481
|
return n(" runLayout", () => Ii(r, n, t)), n(" updateInputGraph", () => Oi(e, r)), r;
|
|
1482
1482
|
});
|
|
1483
1483
|
}
|
|
1484
1484
|
function Ii(e, t, n) {
|
|
1485
|
-
t(" makeSpaceForEdgeLabels", () => Bi(e)), t(" removeSelfEdges", () => Vi(e)), t(" acyclic", () => mo(e)), t(" nestingGraph.run", () => $o(e)), t(" rank", () => Lo(
|
|
1485
|
+
t(" makeSpaceForEdgeLabels", () => Bi(e)), t(" removeSelfEdges", () => Vi(e)), t(" acyclic", () => mo(e)), t(" nestingGraph.run", () => $o(e)), t(" rank", () => Lo(gn(e))), t(" injectEdgeLabelProxies", () => Di(e)), t(" removeEmptyRanks", () => ro(e)), t(" nestingGraph.cleanup", () => Ko(e)), t(" normalizeRanks", () => no(e)), t(" assignRankMinMax", () => Wi(e)), t(" removeEdgeLabelProxies", () => $i(e)), t(" normalize.run", () => Eo(e)), t(" parentDummyChains", () => Ao(e)), t(" addBorderSegments", () => Ho(e)), t(" order", () => Tn(e, n)), t(" insertSelfEdges", () => qi(e)), t(" adjustCoordinateSystem", () => Vo(e)), t(" position", () => Ni(e)), t(" positionSelfEdges", () => Xi(e)), t(" removeBorderNodes", () => Ui(e)), t(" normalize.undo", () => ko(e)), t(" fixupEdgeLabelCoords", () => Ki(e)), t(" undoCoordinateSystem", () => qo(e)), t(" translateGraph", () => Gi(e)), t(" assignNodeIntersects", () => Yi(e)), t(" reversePoints", () => Hi(e)), t(" acyclic.undo", () => wo(e));
|
|
1486
1486
|
}
|
|
1487
1487
|
function Oi(e, t) {
|
|
1488
1488
|
e.nodes().forEach((n) => {
|
|
@@ -1493,19 +1493,19 @@ function Oi(e, t) {
|
|
|
1493
1493
|
r.points = o.points, Object.hasOwn(o, "x") && (r.x = o.x, r.y = o.y);
|
|
1494
1494
|
}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
|
|
1495
1495
|
}
|
|
1496
|
-
var
|
|
1496
|
+
var Mi = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], ji = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, zi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], Li = ["width", "height", "rank"], Gt = { width: 0, height: 0 }, Pi = ["minlen", "weight", "width", "height", "labeloffset"], Fi = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, Ri = ["labelpos"];
|
|
1497
1497
|
function Ai(e) {
|
|
1498
|
-
let t = new
|
|
1499
|
-
return t.setGraph(Object.assign({},
|
|
1500
|
-
let o =
|
|
1501
|
-
Object.keys(
|
|
1502
|
-
i[l] === void 0 && (i[l] =
|
|
1498
|
+
let t = new q({ multigraph: !0, compound: !0 }), n = qe(e.graph());
|
|
1499
|
+
return t.setGraph(Object.assign({}, ji, Ve(n, Mi), Fe(n, zi))), e.nodes().forEach((r) => {
|
|
1500
|
+
let o = qe(e.node(r)), i = Ve(o, Li);
|
|
1501
|
+
Object.keys(Gt).forEach((l) => {
|
|
1502
|
+
i[l] === void 0 && (i[l] = Gt[l]);
|
|
1503
1503
|
}), t.setNode(r, i);
|
|
1504
1504
|
let s = e.parent(r);
|
|
1505
1505
|
s !== void 0 && t.setParent(r, s);
|
|
1506
1506
|
}), e.edges().forEach((r) => {
|
|
1507
|
-
let o =
|
|
1508
|
-
t.setEdge(r, Object.assign({}, Fi,
|
|
1507
|
+
let o = qe(e.edge(r));
|
|
1508
|
+
t.setEdge(r, Object.assign({}, Fi, Ve(o, Pi), Fe(o, Ri)));
|
|
1509
1509
|
}), t;
|
|
1510
1510
|
}
|
|
1511
1511
|
function Bi(e) {
|
|
@@ -1520,7 +1520,7 @@ function Di(e) {
|
|
|
1520
1520
|
let n = e.edge(t);
|
|
1521
1521
|
if (n.width && n.height) {
|
|
1522
1522
|
let r = e.node(t.v), o = { rank: (e.node(t.w).rank - r.rank) / 2 + r.rank, e: t };
|
|
1523
|
-
|
|
1523
|
+
me(e, "edge-proxy", o, "_ep");
|
|
1524
1524
|
}
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
@@ -1562,7 +1562,7 @@ function Gi(e) {
|
|
|
1562
1562
|
function Yi(e) {
|
|
1563
1563
|
e.edges().forEach((t) => {
|
|
1564
1564
|
let n = e.edge(t), r = e.node(t.v), o = e.node(t.w), i, s;
|
|
1565
|
-
n.points ? (i = n.points[0], s = n.points[n.points.length - 1]) : (n.points = [], i = o, s = r), n.points.unshift(
|
|
1565
|
+
n.points ? (i = n.points[0], s = n.points[n.points.length - 1]) : (n.points = [], i = o, s = r), n.points.unshift(zt(r, i)), n.points.push(zt(o, s));
|
|
1566
1566
|
});
|
|
1567
1567
|
}
|
|
1568
1568
|
function Ki(e) {
|
|
@@ -1603,12 +1603,12 @@ function Vi(e) {
|
|
|
1603
1603
|
});
|
|
1604
1604
|
}
|
|
1605
1605
|
function qi(e) {
|
|
1606
|
-
|
|
1606
|
+
Te(e).forEach((t) => {
|
|
1607
1607
|
let n = 0;
|
|
1608
1608
|
t.forEach((r, o) => {
|
|
1609
1609
|
let i = e.node(r);
|
|
1610
1610
|
i.order = o + n, (i.selfEdges || []).forEach((s) => {
|
|
1611
|
-
|
|
1611
|
+
me(e, "selfedge", { width: s.label.width, height: s.label.height, rank: i.rank, order: o + ++n, e: s.e, label: s.label }, "_se");
|
|
1612
1612
|
}), delete i.selfEdges;
|
|
1613
1613
|
});
|
|
1614
1614
|
});
|
|
@@ -1622,17 +1622,17 @@ function Xi(e) {
|
|
|
1622
1622
|
}
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1625
|
+
function Ve(e, t) {
|
|
1626
|
+
return Re(Fe(e, t), Number);
|
|
1627
1627
|
}
|
|
1628
|
-
function
|
|
1628
|
+
function qe(e) {
|
|
1629
1629
|
let t = {};
|
|
1630
1630
|
return e && Object.entries(e).forEach(([n, r]) => {
|
|
1631
1631
|
typeof n == "string" && (n = n.toLowerCase()), t[n] = r;
|
|
1632
1632
|
}), t;
|
|
1633
1633
|
}
|
|
1634
1634
|
function Ji(e) {
|
|
1635
|
-
let t =
|
|
1635
|
+
let t = Te(e), n = new q({ compound: !0, multigraph: !0 }).setGraph({});
|
|
1636
1636
|
return e.nodes().forEach((r) => {
|
|
1637
1637
|
n.setNode(r, { label: r }), n.setParent(r, "layer" + e.node(r).rank);
|
|
1638
1638
|
}), e.edges().forEach((r) => n.setEdge(r.v, r.w, {}, r.name)), t.forEach((r, o) => {
|
|
@@ -1640,14 +1640,14 @@ function Ji(e) {
|
|
|
1640
1640
|
n.setNode(i, { rank: "same" }), r.reduce((s, l) => (n.setEdge(s, l, { style: "invis" }), l));
|
|
1641
1641
|
}), n;
|
|
1642
1642
|
}
|
|
1643
|
-
var Zi = { graphlib:
|
|
1643
|
+
var Zi = { graphlib: on, version: ao, layout: Ti, debug: Ji, util: { time: bn, notime: mn } }, Yt = Zi;
|
|
1644
1644
|
/*! For license information please see dagre.esm.js.LEGAL.txt */
|
|
1645
1645
|
const Qi = (e) => {
|
|
1646
1646
|
const t = [];
|
|
1647
1647
|
return e.nodeInternals.forEach((n, r) => t.push(`${r}:${n.height ?? 0}`)), t.join(",");
|
|
1648
1648
|
}, es = ({ onHeightsReady: e, nodeCount: t }) => {
|
|
1649
|
-
const n = $n(Qi), r =
|
|
1650
|
-
|
|
1649
|
+
const n = $n(Qi), r = Tt("");
|
|
1650
|
+
Tt(0);
|
|
1651
1651
|
const { fitView: o } = Gn();
|
|
1652
1652
|
return se(() => {
|
|
1653
1653
|
if (!n || n === r.current) return;
|
|
@@ -1674,8 +1674,8 @@ function ns({
|
|
|
1674
1674
|
saveLabel: s = "Save",
|
|
1675
1675
|
saveDisabled: l = !1
|
|
1676
1676
|
}) {
|
|
1677
|
-
const [d, a] =
|
|
1678
|
-
|
|
1677
|
+
const [d, a] = G.useState(!1), [c, f] = G.useState(!1), [h, g] = G.useState(e ?? "");
|
|
1678
|
+
G.useEffect(() => {
|
|
1679
1679
|
g(e ?? "");
|
|
1680
1680
|
}, [e]);
|
|
1681
1681
|
const E = async () => {
|
|
@@ -1813,16 +1813,16 @@ function ns({
|
|
|
1813
1813
|
}
|
|
1814
1814
|
);
|
|
1815
1815
|
}
|
|
1816
|
-
const
|
|
1817
|
-
const [l, d] =
|
|
1818
|
-
r && /* @__PURE__ */ u(
|
|
1816
|
+
const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i, width: s = 720 }) => {
|
|
1817
|
+
const [l, d] = L(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ w(ne, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
|
|
1818
|
+
r && /* @__PURE__ */ u(ne, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: r }),
|
|
1819
1819
|
/* @__PURE__ */ u("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: n }),
|
|
1820
|
-
/* @__PURE__ */ u(
|
|
1821
|
-
/* @__PURE__ */ u(
|
|
1822
|
-
] }), f = () => i ? /* @__PURE__ */ u(
|
|
1820
|
+
/* @__PURE__ */ u(It, { onClick: a, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ u(vr, {}) : /* @__PURE__ */ u(wr, {}) }),
|
|
1821
|
+
/* @__PURE__ */ u(It, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ u(or, {}) })
|
|
1822
|
+
] }), f = () => i ? /* @__PURE__ */ u(ne, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1823
1823
|
return l ? /* @__PURE__ */ w(er, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1824
1824
|
/* @__PURE__ */ u(c, {}),
|
|
1825
|
-
/* @__PURE__ */ u(
|
|
1825
|
+
/* @__PURE__ */ u(ne, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1826
1826
|
/* @__PURE__ */ u(f, {})
|
|
1827
1827
|
] }) : /* @__PURE__ */ w(
|
|
1828
1828
|
tr,
|
|
@@ -1850,7 +1850,7 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1850
1850
|
},
|
|
1851
1851
|
children: [
|
|
1852
1852
|
/* @__PURE__ */ u(c, {}),
|
|
1853
|
-
/* @__PURE__ */ u(
|
|
1853
|
+
/* @__PURE__ */ u(ne, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1854
1854
|
/* @__PURE__ */ u(f, {})
|
|
1855
1855
|
]
|
|
1856
1856
|
}
|
|
@@ -1863,7 +1863,7 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1863
1863
|
onClose: o,
|
|
1864
1864
|
loadTriggerSources: i
|
|
1865
1865
|
}) => {
|
|
1866
|
-
const [s, l] =
|
|
1866
|
+
const [s, l] = L("trigger"), [d, a] = L(null), [c, f] = L([]), [h, g] = L([]), [E, m] = L(!1), [p, k] = L(null);
|
|
1867
1867
|
se(() => {
|
|
1868
1868
|
e || (l("trigger"), a(null), f([]), g([]), m(!1), k(null));
|
|
1869
1869
|
}, [e]);
|
|
@@ -1887,33 +1887,33 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1887
1887
|
}
|
|
1888
1888
|
}, [i, r]), O = () => {
|
|
1889
1889
|
l("trigger"), a(null), f([]), g([]), k(null);
|
|
1890
|
-
},
|
|
1890
|
+
}, z = () => {
|
|
1891
1891
|
d && r(d, h);
|
|
1892
|
-
},
|
|
1893
|
-
/* @__PURE__ */ u(
|
|
1892
|
+
}, W = s === "sources" && d, $ = W ? /* @__PURE__ */ w(_e, { children: [
|
|
1893
|
+
/* @__PURE__ */ u(ze, { type: "button", variant: "outlined", size: "small", onClick: O, children: n.cancel ?? "Back" }),
|
|
1894
1894
|
/* @__PURE__ */ u(
|
|
1895
|
-
|
|
1895
|
+
ze,
|
|
1896
1896
|
{
|
|
1897
1897
|
type: "button",
|
|
1898
1898
|
variant: "contained",
|
|
1899
1899
|
size: "small",
|
|
1900
|
-
onClick:
|
|
1900
|
+
onClick: z,
|
|
1901
1901
|
disabled: h.length === 0,
|
|
1902
1902
|
children: n.save ?? "Continue"
|
|
1903
1903
|
}
|
|
1904
1904
|
)
|
|
1905
1905
|
] }) : null;
|
|
1906
1906
|
return /* @__PURE__ */ u(
|
|
1907
|
-
|
|
1907
|
+
Ne,
|
|
1908
1908
|
{
|
|
1909
1909
|
isOpen: e,
|
|
1910
1910
|
onClose: o,
|
|
1911
|
-
title:
|
|
1911
|
+
title: W ? d.label : n.addTriggerTitle,
|
|
1912
1912
|
icon: /* @__PURE__ */ u(mr, {}),
|
|
1913
1913
|
width: 500,
|
|
1914
|
-
footer:
|
|
1915
|
-
children: /* @__PURE__ */ w(
|
|
1916
|
-
!
|
|
1914
|
+
footer: $,
|
|
1915
|
+
children: /* @__PURE__ */ w(ne, { sx: { p: 2 }, children: [
|
|
1916
|
+
!W && /* @__PURE__ */ w(_e, { children: [
|
|
1917
1917
|
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: n.chooseTrigger }),
|
|
1918
1918
|
/* @__PURE__ */ w("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1919
1919
|
t.map((P) => /* @__PURE__ */ w(
|
|
@@ -1945,13 +1945,13 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1945
1945
|
)),
|
|
1946
1946
|
t.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noTriggers })
|
|
1947
1947
|
] }),
|
|
1948
|
-
E && /* @__PURE__ */ w(
|
|
1948
|
+
E && /* @__PURE__ */ w(ne, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
|
|
1949
1949
|
/* @__PURE__ */ u(nr, { size: 14 }),
|
|
1950
1950
|
/* @__PURE__ */ u("span", { children: "Loading sources for the selected trigger…" })
|
|
1951
1951
|
] }),
|
|
1952
1952
|
p && /* @__PURE__ */ u("p", { style: { fontSize: 12, color: "#d32f2f", marginTop: 12 }, children: p })
|
|
1953
1953
|
] }),
|
|
1954
|
-
|
|
1954
|
+
W && /* @__PURE__ */ w(_e, { children: [
|
|
1955
1955
|
/* @__PURE__ */ w(
|
|
1956
1956
|
"div",
|
|
1957
1957
|
{
|
|
@@ -1964,7 +1964,7 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1964
1964
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1965
1965
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
1966
1966
|
children: [
|
|
1967
|
-
/* @__PURE__ */ u(
|
|
1967
|
+
/* @__PURE__ */ u(Jt, { size: 16 }),
|
|
1968
1968
|
/* @__PURE__ */ u("span", { children: n.addTriggerTitle })
|
|
1969
1969
|
]
|
|
1970
1970
|
}
|
|
@@ -1991,10 +1991,10 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1991
1991
|
] })
|
|
1992
1992
|
}
|
|
1993
1993
|
);
|
|
1994
|
-
},
|
|
1994
|
+
}, Xe = {
|
|
1995
1995
|
cursor: "pointer",
|
|
1996
1996
|
transition: "background 0.15s"
|
|
1997
|
-
},
|
|
1997
|
+
}, Je = "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-center ff-gap-3", os = ({ open: e, availableDescriptors: t, messages: n, onSelect: r, onClose: o }) => {
|
|
1998
1998
|
const { apps: i, ungrouped: s } = U(() => {
|
|
1999
1999
|
const f = /* @__PURE__ */ new Map(), h = [];
|
|
2000
2000
|
for (const g of t)
|
|
@@ -2010,7 +2010,7 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2010
2010
|
} else
|
|
2011
2011
|
h.push(g);
|
|
2012
2012
|
return { apps: [...f.values()], ungrouped: h };
|
|
2013
|
-
}, [t]), [l, d] =
|
|
2013
|
+
}, [t]), [l, d] = L(null), a = l ? i.find((f) => f.key === l) ?? null : null;
|
|
2014
2014
|
se(() => {
|
|
2015
2015
|
e || d(null);
|
|
2016
2016
|
}, [e]), se(() => {
|
|
@@ -2018,14 +2018,14 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2018
2018
|
}, [t]);
|
|
2019
2019
|
const c = !a;
|
|
2020
2020
|
return /* @__PURE__ */ u(
|
|
2021
|
-
|
|
2021
|
+
Ne,
|
|
2022
2022
|
{
|
|
2023
2023
|
isOpen: e,
|
|
2024
2024
|
onClose: o,
|
|
2025
2025
|
title: c ? n.addStepTitle : a.label,
|
|
2026
2026
|
icon: c ? /* @__PURE__ */ u(lr, {}) : a.icon ?? /* @__PURE__ */ u(ar, {}),
|
|
2027
2027
|
width: 500,
|
|
2028
|
-
children: /* @__PURE__ */ w(
|
|
2028
|
+
children: /* @__PURE__ */ w(ne, { sx: { p: 2 }, children: [
|
|
2029
2029
|
!c && /* @__PURE__ */ w(
|
|
2030
2030
|
"div",
|
|
2031
2031
|
{
|
|
@@ -2038,18 +2038,18 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2038
2038
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
2039
2039
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
2040
2040
|
children: [
|
|
2041
|
-
/* @__PURE__ */ u(
|
|
2041
|
+
/* @__PURE__ */ u(Jt, { size: 16 }),
|
|
2042
2042
|
/* @__PURE__ */ u("span", { children: n.addStepTitle })
|
|
2043
2043
|
]
|
|
2044
2044
|
}
|
|
2045
2045
|
),
|
|
2046
2046
|
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? n.chooseAction : `Pick an action from ${a.label}` }),
|
|
2047
|
-
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(
|
|
2047
|
+
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(_e, { children: [
|
|
2048
2048
|
i.map((f) => /* @__PURE__ */ w(
|
|
2049
2049
|
"div",
|
|
2050
2050
|
{
|
|
2051
|
-
className:
|
|
2052
|
-
style:
|
|
2051
|
+
className: Je,
|
|
2052
|
+
style: Xe,
|
|
2053
2053
|
onClick: () => d(f.key),
|
|
2054
2054
|
role: "button",
|
|
2055
2055
|
tabIndex: 0,
|
|
@@ -2068,7 +2068,7 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2068
2068
|
/* @__PURE__ */ u("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: f.label }),
|
|
2069
2069
|
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: f.description ?? `${f.descriptors.length} action${f.descriptors.length === 1 ? "" : "s"}` })
|
|
2070
2070
|
] }),
|
|
2071
|
-
/* @__PURE__ */ u(
|
|
2071
|
+
/* @__PURE__ */ u(Zt, { size: 18, color: "#9e9e9e" })
|
|
2072
2072
|
]
|
|
2073
2073
|
},
|
|
2074
2074
|
`app-${f.key}`
|
|
@@ -2076,8 +2076,8 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2076
2076
|
s.map((f) => /* @__PURE__ */ w(
|
|
2077
2077
|
"div",
|
|
2078
2078
|
{
|
|
2079
|
-
className:
|
|
2080
|
-
style:
|
|
2079
|
+
className: Je,
|
|
2080
|
+
style: Xe,
|
|
2081
2081
|
onClick: () => r(f),
|
|
2082
2082
|
role: "button",
|
|
2083
2083
|
tabIndex: 0,
|
|
@@ -2103,8 +2103,8 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2103
2103
|
a.descriptors.map((f) => /* @__PURE__ */ w(
|
|
2104
2104
|
"div",
|
|
2105
2105
|
{
|
|
2106
|
-
className:
|
|
2107
|
-
style:
|
|
2106
|
+
className: Je,
|
|
2107
|
+
style: Xe,
|
|
2108
2108
|
onClick: () => r(f),
|
|
2109
2109
|
role: "button",
|
|
2110
2110
|
tabIndex: 0,
|
|
@@ -2128,20 +2128,20 @@ const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2128
2128
|
] })
|
|
2129
2129
|
}
|
|
2130
2130
|
);
|
|
2131
|
-
},
|
|
2132
|
-
function
|
|
2131
|
+
}, Kt = "_conditionConfig";
|
|
2132
|
+
function Ht(e) {
|
|
2133
2133
|
return Array.isArray(e) ? { layout: "flat", fields: e } : e && typeof e == "object" ? e : { layout: "flat", fields: [] };
|
|
2134
2134
|
}
|
|
2135
|
-
function
|
|
2135
|
+
function Ut(e) {
|
|
2136
2136
|
return e.layout === "stepper" ? Array.isArray(e.steps) && e.steps.some((t) => {
|
|
2137
2137
|
var n;
|
|
2138
2138
|
return ((n = t.fields) == null ? void 0 : n.length) > 0;
|
|
2139
2139
|
}) : Array.isArray(e.fields) && e.fields.length > 0;
|
|
2140
2140
|
}
|
|
2141
2141
|
const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o, onSave: i, onClose: s }) => {
|
|
2142
|
-
const [l, d] =
|
|
2142
|
+
const [l, d] = L({ layout: "flat", fields: [] }), [a, c] = L(!1), [f, h] = L(null), [g, E] = L({});
|
|
2143
2143
|
se(() => {
|
|
2144
|
-
E((r == null ? void 0 : r[
|
|
2144
|
+
E((r == null ? void 0 : r[Kt]) ?? {});
|
|
2145
2145
|
}, [r, t]), se(() => {
|
|
2146
2146
|
let x = !1;
|
|
2147
2147
|
if (h(null), !n || !t || n.customPanel) {
|
|
@@ -2149,18 +2149,18 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2149
2149
|
return;
|
|
2150
2150
|
}
|
|
2151
2151
|
const O = n.formSchema;
|
|
2152
|
-
return typeof O == "function" ? (c(!0), O(t).then((
|
|
2153
|
-
x || (d(
|
|
2154
|
-
}).catch((
|
|
2155
|
-
x || (d({ layout: "flat", fields: [] }), h(
|
|
2156
|
-
})) : (d(
|
|
2152
|
+
return typeof O == "function" ? (c(!0), O(t).then((z) => {
|
|
2153
|
+
x || (d(Ht(z)), c(!1));
|
|
2154
|
+
}).catch((z) => {
|
|
2155
|
+
x || (d({ layout: "flat", fields: [] }), h(z instanceof Error ? z.message : "Unable to load configuration."), c(!1));
|
|
2156
|
+
})) : (d(Ht(O)), c(!1)), () => {
|
|
2157
2157
|
x = !0;
|
|
2158
2158
|
};
|
|
2159
2159
|
}, [n, t]);
|
|
2160
|
-
const m = t ? `node-config-form-${t}` : "node-config-form", p = !a && !f &&
|
|
2161
|
-
/* @__PURE__ */ u(
|
|
2160
|
+
const m = t ? `node-config-form-${t}` : "node-config-form", p = !a && !f && Ut(l), k = p ? /* @__PURE__ */ w(_e, { children: [
|
|
2161
|
+
/* @__PURE__ */ u(ze, { type: "button", variant: "text", size: "small", sx: { textTransform: "none", color: "#475569" }, onClick: s, children: o.cancel }),
|
|
2162
2162
|
/* @__PURE__ */ u(
|
|
2163
|
-
|
|
2163
|
+
ze,
|
|
2164
2164
|
{
|
|
2165
2165
|
type: "submit",
|
|
2166
2166
|
form: m,
|
|
@@ -2178,7 +2178,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2178
2178
|
}
|
|
2179
2179
|
)
|
|
2180
2180
|
] }) : null;
|
|
2181
|
-
return n != null && n.customPanel && t ? /* @__PURE__ */ u(
|
|
2181
|
+
return n != null && n.customPanel && t ? /* @__PURE__ */ u(Ne, { isOpen: e, onClose: s, title: n.label ?? o.configureStep, icon: n.icon, width: 500, children: n.customPanel({
|
|
2182
2182
|
nodeId: t,
|
|
2183
2183
|
data: r ?? {},
|
|
2184
2184
|
onSave: (x) => {
|
|
@@ -2186,7 +2186,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2186
2186
|
},
|
|
2187
2187
|
onClose: s
|
|
2188
2188
|
}) }) : /* @__PURE__ */ u(
|
|
2189
|
-
|
|
2189
|
+
Ne,
|
|
2190
2190
|
{
|
|
2191
2191
|
isOpen: e,
|
|
2192
2192
|
onClose: s,
|
|
@@ -2194,10 +2194,10 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2194
2194
|
icon: n == null ? void 0 : n.icon,
|
|
2195
2195
|
width: 500,
|
|
2196
2196
|
footer: k,
|
|
2197
|
-
children: /* @__PURE__ */ w(
|
|
2197
|
+
children: /* @__PURE__ */ w(ne, { sx: { p: 2 }, children: [
|
|
2198
2198
|
a && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
2199
2199
|
!a && f && /* @__PURE__ */ u("p", { style: { fontSize: 13, color: "#d32f2f" }, children: f }),
|
|
2200
|
-
!a && !f && !
|
|
2200
|
+
!a && !f && !Ut(l) && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
2201
2201
|
p && /* @__PURE__ */ u(
|
|
2202
2202
|
xr,
|
|
2203
2203
|
{
|
|
@@ -2209,7 +2209,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2209
2209
|
onSubmit: (x) => {
|
|
2210
2210
|
if (!t) return;
|
|
2211
2211
|
const O = Object.keys(g).length > 0;
|
|
2212
|
-
i(t, { ...x, [
|
|
2212
|
+
i(t, { ...x, [Kt]: O ? g : void 0 }), s();
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
2215
2215
|
)
|
|
@@ -2223,7 +2223,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2223
2223
|
workflowLabel: r,
|
|
2224
2224
|
onFetchWorkflow: o
|
|
2225
2225
|
}) => {
|
|
2226
|
-
const [i, s] =
|
|
2226
|
+
const [i, s] = L({ status: "idle" });
|
|
2227
2227
|
return se(() => {
|
|
2228
2228
|
if (!e || !n) {
|
|
2229
2229
|
s({ status: "idle" });
|
|
@@ -2231,7 +2231,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2231
2231
|
}
|
|
2232
2232
|
s({ status: "loading" }), o(n).then((l) => s({ status: "loaded", state: l })).catch((l) => s({ status: "error", message: (l == null ? void 0 : l.message) ?? "Failed to load workflow" }));
|
|
2233
2233
|
}, [e, n, o]), /* @__PURE__ */ u(
|
|
2234
|
-
|
|
2234
|
+
Ne,
|
|
2235
2235
|
{
|
|
2236
2236
|
isOpen: e,
|
|
2237
2237
|
onClose: t,
|
|
@@ -2254,7 +2254,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2254
2254
|
}
|
|
2255
2255
|
);
|
|
2256
2256
|
}, ls = ({ state: e }) => {
|
|
2257
|
-
const [t, n] =
|
|
2257
|
+
const [t, n] = L(null), [r, o] = L(null);
|
|
2258
2258
|
return se(() => {
|
|
2259
2259
|
Promise.all([
|
|
2260
2260
|
Promise.resolve().then(() => hs).then((i) => i.default),
|
|
@@ -2272,7 +2272,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2272
2272
|
readOnly: !0
|
|
2273
2273
|
}
|
|
2274
2274
|
) });
|
|
2275
|
-
},
|
|
2275
|
+
}, Ce = 350, et = 70, tt = 60, nt = {
|
|
2276
2276
|
startNode: 40,
|
|
2277
2277
|
endNode: 40,
|
|
2278
2278
|
addTriggerNode: 56,
|
|
@@ -2289,7 +2289,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2289
2289
|
edgeWithPlusLabel: qn,
|
|
2290
2290
|
gatewayBranchEdge: Vn
|
|
2291
2291
|
};
|
|
2292
|
-
function
|
|
2292
|
+
function Vt() {
|
|
2293
2293
|
return [
|
|
2294
2294
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2295
2295
|
{ id: "addTrigger", kind: "addTrigger", reactFlowType: "addTriggerNode" },
|
|
@@ -2297,71 +2297,74 @@ function Yt() {
|
|
|
2297
2297
|
];
|
|
2298
2298
|
}
|
|
2299
2299
|
function ds(e, t, n, r = "TB") {
|
|
2300
|
-
const o = new
|
|
2300
|
+
const o = new Yt.graphlib.Graph();
|
|
2301
2301
|
return o.setGraph({ rankdir: r, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
|
|
2302
|
-
const s = n[i.id] ?? { width:
|
|
2302
|
+
const s = n[i.id] ?? { width: Ce, height: nt[i.type ?? ""] ?? 80 };
|
|
2303
2303
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2304
|
-
}), t.forEach((i) => o.setEdge(i.source, i.target)),
|
|
2304
|
+
}), t.forEach((i) => o.setEdge(i.source, i.target)), Yt.layout(o), e.map((i) => {
|
|
2305
2305
|
var a, c;
|
|
2306
|
-
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ??
|
|
2306
|
+
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ?? Ce, d = ((c = n[i.id]) == null ? void 0 : c.height) ?? nt[i.type ?? ""] ?? 80;
|
|
2307
2307
|
return { ...i, position: { x: s.x - l / 2, y: s.y - d / 2 } };
|
|
2308
2308
|
});
|
|
2309
2309
|
}
|
|
2310
|
-
const
|
|
2310
|
+
const fe = (e) => e === "filter" || e === "approval";
|
|
2311
2311
|
function cs(e, t, n, r) {
|
|
2312
|
-
const s =
|
|
2312
|
+
const s = et, l = 30, d = 30, a = {}, c = {}, f = /* @__PURE__ */ new Map();
|
|
2313
2313
|
for (const p of e) f.set(p.id, p);
|
|
2314
2314
|
for (const p of Object.values(t))
|
|
2315
2315
|
for (const k of Object.values(p))
|
|
2316
2316
|
for (const x of k) f.set(x.id, x);
|
|
2317
2317
|
const h = (p, k, x) => {
|
|
2318
|
-
const O = r[p] ?? { width:
|
|
2318
|
+
const O = r[p] ?? { width: Ce, height: 80 };
|
|
2319
2319
|
return a[p] = { x: k - O.width / 2, y: x }, x + O.height;
|
|
2320
2320
|
}, g = (p, k, x) => {
|
|
2321
2321
|
let O = x;
|
|
2322
|
-
for (const
|
|
2323
|
-
O = h(
|
|
2322
|
+
for (const z of p)
|
|
2323
|
+
O = h(z.id, k, O) + s, fe(z.kind) && t[z.id] && (O = E(z.id, k, O));
|
|
2324
2324
|
return O;
|
|
2325
2325
|
}, E = (p, k, x) => {
|
|
2326
|
-
const O = k + 180,
|
|
2327
|
-
if ((
|
|
2328
|
-
const
|
|
2329
|
-
let
|
|
2330
|
-
|
|
2331
|
-
|
|
2326
|
+
const O = k + 180, z = t[p], W = Object.keys(z), $ = f.get(p), P = ($ == null ? void 0 : $.branchLabels) ?? { pass: "Pass", fail: "Fail" }, M = a[p], V = r[p] ?? { height: 80 }, oe = M.y + V.height;
|
|
2327
|
+
if (($ == null ? void 0 : $.branchStyle) === "inline-gate") {
|
|
2328
|
+
const ie = [];
|
|
2329
|
+
let ee = M.y + V.height / 2;
|
|
2330
|
+
W.slice(1).forEach((ge) => {
|
|
2331
|
+
var Ie, we;
|
|
2332
|
+
ie.push({ y: ee - oe, label: P[ge] ?? ge, isPass: !1 });
|
|
2333
|
+
const Be = ee - (((we = r[(Ie = z[ge][0]) == null ? void 0 : Ie.id]) == null ? void 0 : we.height) ?? 50) / 2;
|
|
2334
|
+
ee = g(z[ge], O, Be) + l;
|
|
2332
2335
|
});
|
|
2333
|
-
const
|
|
2334
|
-
return c[p] = { branches:
|
|
2336
|
+
const he = g(z[W[0]], k, x);
|
|
2337
|
+
return c[p] = { branches: ie, height: Math.max(ee, he) - oe, indent: 180 }, Math.max(he, ee);
|
|
2335
2338
|
}
|
|
2336
2339
|
const le = [];
|
|
2337
|
-
let
|
|
2338
|
-
return
|
|
2339
|
-
const
|
|
2340
|
+
let A = x;
|
|
2341
|
+
return W.forEach((ie, ve) => {
|
|
2342
|
+
const ee = z[ie], he = A;
|
|
2340
2343
|
le.push({
|
|
2341
|
-
y:
|
|
2342
|
-
label: P[
|
|
2343
|
-
isPass:
|
|
2344
|
-
}),
|
|
2344
|
+
y: he - oe,
|
|
2345
|
+
label: P[ie] ?? ie,
|
|
2346
|
+
isPass: ve === 0
|
|
2347
|
+
}), A = g(ee, O, A + d), ve < W.length - 1 && (A += l);
|
|
2345
2348
|
}), c[p] = {
|
|
2346
2349
|
branches: le,
|
|
2347
|
-
height:
|
|
2350
|
+
height: A - oe,
|
|
2348
2351
|
indent: 180
|
|
2349
|
-
},
|
|
2352
|
+
}, A;
|
|
2350
2353
|
};
|
|
2351
|
-
let m =
|
|
2354
|
+
let m = tt;
|
|
2352
2355
|
for (const p of e)
|
|
2353
|
-
m = h(p.id, 400, m) + s,
|
|
2356
|
+
m = h(p.id, 400, m) + s, fe(p.kind) && t[p.id] && (m = E(p.id, 400, m));
|
|
2354
2357
|
return {
|
|
2355
2358
|
nodes: n.map((p) => a[p.id] ? { ...p, position: a[p.id] } : p),
|
|
2356
2359
|
railSpecs: c
|
|
2357
2360
|
};
|
|
2358
2361
|
}
|
|
2359
|
-
function
|
|
2362
|
+
function qt(e) {
|
|
2360
2363
|
return {
|
|
2361
2364
|
id: e.id,
|
|
2362
2365
|
type: e.reactFlowType,
|
|
2363
2366
|
position: { x: 0, y: 0 },
|
|
2364
|
-
data: { ...e.nodeData, ...e.formData, descriptorType: e.descriptorType },
|
|
2367
|
+
data: { ...e.nodeData, ...e.formData, descriptorType: e.descriptorType, branchStyle: e.branchStyle },
|
|
2365
2368
|
draggable: !1,
|
|
2366
2369
|
selectable: !1
|
|
2367
2370
|
};
|
|
@@ -2384,36 +2387,40 @@ function us(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
|
2384
2387
|
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (m, p, k) => {
|
|
2385
2388
|
const x = t[m];
|
|
2386
2389
|
if (!x) return;
|
|
2387
|
-
const
|
|
2390
|
+
const z = p ?? { pass: "Pass", fail: "Fail" }, W = Object.keys(x), $ = k === "inline-gate", P = (M, V, oe, le) => {
|
|
2388
2391
|
if (M.length !== 0) {
|
|
2389
|
-
M.forEach((
|
|
2390
|
-
id: `e-${m}-${
|
|
2392
|
+
M.forEach((A) => d.push(qt(A))), $ && le === 0 ? a.push({
|
|
2393
|
+
id: `e-${m}-${V}-start`,
|
|
2391
2394
|
source: m,
|
|
2395
|
+
sourceHandle: "pass",
|
|
2392
2396
|
target: M[0].id,
|
|
2393
2397
|
type: "plusEdge",
|
|
2394
2398
|
style: { stroke: l },
|
|
2395
|
-
data: { onAddStepClick: n, referenceNodeType: "filterNode", filterId: m, branch:
|
|
2399
|
+
data: { onAddStepClick: n, referenceNodeType: "filterNode", filterId: m, branch: V }
|
|
2396
2400
|
}) : a.push({
|
|
2397
|
-
id: `e-${m}-${
|
|
2401
|
+
id: `e-${m}-${V}-start`,
|
|
2398
2402
|
source: m,
|
|
2403
|
+
// inline-gate Fail leaves the dedicated RIGHT handle so it routes out
|
|
2404
|
+
// to the side instead of tangling with the Pass edge at the bottom.
|
|
2405
|
+
...$ ? { sourceHandle: "fail" } : {},
|
|
2399
2406
|
target: M[0].id,
|
|
2400
2407
|
type: "gatewayBranchEdge",
|
|
2401
2408
|
style: { stroke: l },
|
|
2402
|
-
data: { branch:
|
|
2409
|
+
data: { branch: V, filterId: m, label: oe, isFirst: le === 0, onAddStepClick: n, verticalRouting: s === "vertical" && !$, sideRouting: $ }
|
|
2403
2410
|
});
|
|
2404
|
-
for (let
|
|
2405
|
-
|
|
2406
|
-
for (const
|
|
2407
|
-
|
|
2411
|
+
for (let A = 1; A < M.length; A++)
|
|
2412
|
+
fe(M[A - 1].kind) || a.push(fs(M[A - 1], M[A], l, n, { filterId: m, branch: V }));
|
|
2413
|
+
for (const A of M)
|
|
2414
|
+
fe(A.kind) && t[A.id] && c(A.id, A.branchLabels, A.branchStyle);
|
|
2408
2415
|
}
|
|
2409
2416
|
};
|
|
2410
|
-
|
|
2411
|
-
P(x[M], M,
|
|
2417
|
+
W.forEach((M, V) => {
|
|
2418
|
+
P(x[M], M, z[M] ?? M, V);
|
|
2412
2419
|
});
|
|
2413
2420
|
};
|
|
2414
2421
|
for (let m = 0; m < e.length; m++) {
|
|
2415
2422
|
const p = e[m];
|
|
2416
|
-
if (d.push(
|
|
2423
|
+
if (d.push(qt(p)), m > 0) {
|
|
2417
2424
|
const k = e[m - 1], x = k.kind === "start" || k.kind === "addTrigger";
|
|
2418
2425
|
if (k.kind === "filter" || k.kind === "approval") continue;
|
|
2419
2426
|
a.push({
|
|
@@ -2433,22 +2440,22 @@ function us(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
|
2433
2440
|
const f = {};
|
|
2434
2441
|
if (d.forEach((m) => {
|
|
2435
2442
|
f[m.id] = {
|
|
2436
|
-
width:
|
|
2437
|
-
height: r[m.id] ??
|
|
2443
|
+
width: Ce,
|
|
2444
|
+
height: r[m.id] ?? nt[m.type ?? ""] ?? 80
|
|
2438
2445
|
};
|
|
2439
2446
|
}), !(Object.keys(t).length > 0)) {
|
|
2440
2447
|
if (i === "LR") {
|
|
2441
|
-
let O =
|
|
2442
|
-
return { nodes: d.map((
|
|
2443
|
-
const
|
|
2444
|
-
return O +=
|
|
2448
|
+
let O = tt;
|
|
2449
|
+
return { nodes: d.map((W) => {
|
|
2450
|
+
const $ = f[W.id].width, P = f[W.id].height, M = { ...W, position: { x: O, y: 300 - P / 2 } };
|
|
2451
|
+
return O += $ + et, M;
|
|
2445
2452
|
}), edges: a };
|
|
2446
2453
|
}
|
|
2447
2454
|
const m = 400;
|
|
2448
|
-
let p =
|
|
2455
|
+
let p = tt;
|
|
2449
2456
|
return { nodes: d.map((x) => {
|
|
2450
|
-
const O = f[x.id].height,
|
|
2451
|
-
return p += O +
|
|
2457
|
+
const O = f[x.id].height, z = { ...x, position: { x: m - Ce / 2, y: p } };
|
|
2458
|
+
return p += O + et, z;
|
|
2452
2459
|
}), edges: a };
|
|
2453
2460
|
}
|
|
2454
2461
|
const g = e.some((m) => m.branchStyle === "inline-gate") || Object.values(t).some(
|
|
@@ -2462,7 +2469,7 @@ function us(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
|
2462
2469
|
}
|
|
2463
2470
|
return { nodes: ds(d, a, f, i), edges: a };
|
|
2464
2471
|
}
|
|
2465
|
-
const
|
|
2472
|
+
const Xt = ({
|
|
2466
2473
|
nodeRegistry: e,
|
|
2467
2474
|
templateRegistry: t,
|
|
2468
2475
|
initialValue: n,
|
|
@@ -2483,241 +2490,246 @@ const Ht = ({
|
|
|
2483
2490
|
executionRecord: k,
|
|
2484
2491
|
onFetchWorkflow: x,
|
|
2485
2492
|
hideHeader: O = !1,
|
|
2486
|
-
workflowName:
|
|
2487
|
-
onWorkflowNameChange:
|
|
2488
|
-
onCancel:
|
|
2493
|
+
workflowName: z,
|
|
2494
|
+
onWorkflowNameChange: W,
|
|
2495
|
+
onCancel: $,
|
|
2489
2496
|
workflowStatus: P,
|
|
2490
2497
|
workflowStatusColor: M,
|
|
2491
|
-
saveLabel:
|
|
2492
|
-
optionsResolvers:
|
|
2498
|
+
saveLabel: V,
|
|
2499
|
+
optionsResolvers: oe
|
|
2493
2500
|
}) => {
|
|
2494
2501
|
const {
|
|
2495
2502
|
fitView: le = !0,
|
|
2496
|
-
fitViewPadding:
|
|
2497
|
-
showControls:
|
|
2498
|
-
showMiniMap:
|
|
2499
|
-
panOnScroll:
|
|
2500
|
-
zoomOnScroll:
|
|
2501
|
-
minZoom:
|
|
2502
|
-
maxZoom:
|
|
2503
|
-
snapToGrid:
|
|
2504
|
-
snapGrid:
|
|
2505
|
-
branchLayout:
|
|
2506
|
-
nodeBody:
|
|
2507
|
-
} = a,
|
|
2508
|
-
const
|
|
2503
|
+
fitViewPadding: A = 0.3,
|
|
2504
|
+
showControls: ie = !0,
|
|
2505
|
+
showMiniMap: ve = !1,
|
|
2506
|
+
panOnScroll: ee = !0,
|
|
2507
|
+
zoomOnScroll: he = !1,
|
|
2508
|
+
minZoom: ge = 0.25,
|
|
2509
|
+
maxZoom: Be = 2,
|
|
2510
|
+
snapToGrid: dt = !1,
|
|
2511
|
+
snapGrid: Ie = [15, 15],
|
|
2512
|
+
branchLayout: we = "horizontal",
|
|
2513
|
+
nodeBody: ct = "full"
|
|
2514
|
+
} = a, Ee = U(() => _r(d), [d]), [R, ae] = L(() => (n == null ? void 0 : n.slots) ?? Vt()), [Y, te] = L(() => (n == null ? void 0 : n.branches) ?? {}), [pe, X] = L(null), [De, ft] = L(null), [J, Oe] = L(null), [de, ut] = L(null), [Me, ht] = L(null), [j, gt] = L(() => {
|
|
2515
|
+
const y = n == null ? void 0 : n.slots.find((S) => S.kind === "triggerFixed"), v = y != null && y.id.startsWith("trigger-") ? y.id.slice(8) : void 0;
|
|
2509
2516
|
return v ? t.lookup(v) ?? null : null;
|
|
2510
|
-
}), [
|
|
2511
|
-
|
|
2517
|
+
}), [pt, Mn] = L({}), jn = H((y) => {
|
|
2518
|
+
Mn(y);
|
|
2512
2519
|
}, []), zn = U(() => ({ ...Un, ...r }), [r]), Ln = U(() => ({ ...as, ...o }), [o]), Pn = U(() => {
|
|
2513
|
-
const
|
|
2514
|
-
return
|
|
2515
|
-
}, [R, Y]),
|
|
2516
|
-
const v = R.find((S) => S.id ===
|
|
2520
|
+
const y = R.filter((S) => S.kind === "userTask").length, v = Object.values(Y).flatMap((S) => Object.values(S).flat()).filter((S) => S.kind === "userTask").length;
|
|
2521
|
+
return y + v;
|
|
2522
|
+
}, [R, Y]), yt = m ?? (j == null ? void 0 : j.maxTasks), bt = yt !== void 0 && Pn >= yt, ce = H((y) => {
|
|
2523
|
+
const v = R.find((S) => S.id === y);
|
|
2517
2524
|
if (v) return v;
|
|
2518
2525
|
for (const S of Object.values(Y)) {
|
|
2519
|
-
const C = Object.values(S).flat().find((T) => T.id ===
|
|
2526
|
+
const C = Object.values(S).flat().find((T) => T.id === y);
|
|
2520
2527
|
if (C) return C;
|
|
2521
2528
|
}
|
|
2522
2529
|
return null;
|
|
2523
|
-
}, [R, Y]),
|
|
2524
|
-
s || (
|
|
2525
|
-
}, [s]),
|
|
2530
|
+
}, [R, Y]), We = H((y) => {
|
|
2531
|
+
s || (ft(y), X("nodeConfig"));
|
|
2532
|
+
}, [s]), mt = H((y) => {
|
|
2526
2533
|
if (!s) {
|
|
2527
|
-
if (R.some((v) => v.id ===
|
|
2528
|
-
const v = R.find((S) => S.id ===
|
|
2534
|
+
if (R.some((v) => v.id === y)) {
|
|
2535
|
+
const v = R.find((S) => S.id === y);
|
|
2529
2536
|
if ((v == null ? void 0 : v.kind) === "triggerFixed") {
|
|
2530
|
-
|
|
2537
|
+
ae(Vt()), te({}), gt(null);
|
|
2531
2538
|
return;
|
|
2532
2539
|
}
|
|
2533
|
-
|
|
2534
|
-
const C = S.filter((T) => T.id !==
|
|
2535
|
-
return
|
|
2536
|
-
}),
|
|
2537
|
-
const C = { ...S }, T = (
|
|
2538
|
-
C[
|
|
2540
|
+
ae((S) => {
|
|
2541
|
+
const C = S.filter((T) => T.id !== y);
|
|
2542
|
+
return fe((v == null ? void 0 : v.kind) ?? "") && !C.some((T) => T.kind === "end") ? [...C, { id: "end", kind: "end", reactFlowType: "endNode" }] : C;
|
|
2543
|
+
}), te((S) => {
|
|
2544
|
+
const C = { ...S }, T = (b) => {
|
|
2545
|
+
C[b] && (Object.values(C[b]).flat().filter((N) => fe(N.kind)).forEach((N) => T(N.id)), delete C[b]);
|
|
2539
2546
|
};
|
|
2540
|
-
return T(
|
|
2547
|
+
return T(y), C;
|
|
2541
2548
|
});
|
|
2542
2549
|
return;
|
|
2543
2550
|
}
|
|
2544
|
-
|
|
2545
|
-
const S = (T,
|
|
2546
|
-
const
|
|
2547
|
-
for (const
|
|
2548
|
-
|
|
2549
|
-
return
|
|
2551
|
+
te((v) => {
|
|
2552
|
+
const S = (T, b) => {
|
|
2553
|
+
const N = [];
|
|
2554
|
+
for (const _ of T)
|
|
2555
|
+
fe(_.kind) && b[_.id] && (N.push(_.id), Object.values(b[_.id]).forEach((I) => N.push(...S(I, b))));
|
|
2556
|
+
return N;
|
|
2550
2557
|
}, C = { ...v };
|
|
2551
2558
|
for (const T of Object.keys(C))
|
|
2552
|
-
for (const
|
|
2553
|
-
const
|
|
2554
|
-
if (
|
|
2555
|
-
const I = _
|
|
2556
|
-
let B =
|
|
2557
|
-
return I.kind === "filter" && ((I.id in C ? S([I], C) : []).forEach((
|
|
2559
|
+
for (const b of Object.keys(C[T])) {
|
|
2560
|
+
const N = C[T][b], _ = N.findIndex((F) => F.id === y);
|
|
2561
|
+
if (_ === -1 || N[_].kind === "end") continue;
|
|
2562
|
+
const I = N[_];
|
|
2563
|
+
let B = N.filter((F) => F.id !== y);
|
|
2564
|
+
return I.kind === "filter" && ((I.id in C ? S([I], C) : []).forEach((D) => delete C[D]), delete C[I.id], B.some((D) => D.kind === "end") || (B = [...B, { id: `end-${T}-${b}`, kind: "end", reactFlowType: "endNode" }])), C[T] = { ...C[T], [b]: B }, C;
|
|
2558
2565
|
}
|
|
2559
2566
|
return C;
|
|
2560
2567
|
});
|
|
2561
2568
|
}
|
|
2562
|
-
}, [s, R]),
|
|
2569
|
+
}, [s, R]), $e = H(() => {
|
|
2563
2570
|
s || X("triggerSelect");
|
|
2564
|
-
}, [s]),
|
|
2565
|
-
s ||
|
|
2566
|
-
}, [s,
|
|
2567
|
-
if (
|
|
2568
|
-
const C = Array.isArray(v) && v.length > 0, T = (
|
|
2569
|
-
...
|
|
2571
|
+
}, [s]), vt = H((y, v) => {
|
|
2572
|
+
s || bt || (Oe(y), ut(v.filterId && v.branch ? { filterId: v.filterId, branch: v.branch } : null), X("nodePicker"));
|
|
2573
|
+
}, [s, bt]), wt = H((y, v) => {
|
|
2574
|
+
if (gt(y), X(null), y.skeletonState) {
|
|
2575
|
+
const C = Array.isArray(v) && v.length > 0, T = (y.skeletonState.slots ?? []).map((b) => b.kind !== "triggerFixed" ? b : {
|
|
2576
|
+
...b,
|
|
2570
2577
|
nodeData: {
|
|
2571
|
-
label:
|
|
2572
|
-
...
|
|
2578
|
+
label: y.label,
|
|
2579
|
+
...b.nodeData ?? {},
|
|
2573
2580
|
...C && { sources: v }
|
|
2574
2581
|
}
|
|
2575
2582
|
});
|
|
2576
|
-
|
|
2583
|
+
te(y.skeletonState.branches ?? {}), ae(T);
|
|
2577
2584
|
return;
|
|
2578
2585
|
}
|
|
2579
|
-
|
|
2586
|
+
te({});
|
|
2580
2587
|
const S = Array.isArray(v) && v.length > 0;
|
|
2581
|
-
|
|
2588
|
+
ae([
|
|
2582
2589
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2583
2590
|
{
|
|
2584
|
-
id: `trigger-${
|
|
2591
|
+
id: `trigger-${y.triggerKey}`,
|
|
2585
2592
|
kind: "triggerFixed",
|
|
2586
2593
|
reactFlowType: "triggerNode",
|
|
2587
2594
|
nodeData: {
|
|
2588
|
-
label:
|
|
2589
|
-
source:
|
|
2590
|
-
eventType:
|
|
2591
|
-
type:
|
|
2595
|
+
label: y.label,
|
|
2596
|
+
source: y.source,
|
|
2597
|
+
eventType: y.triggerKey,
|
|
2598
|
+
type: y.triggerCategory === "scheduler" ? "scheduler" : "event",
|
|
2592
2599
|
...S && { sources: v }
|
|
2593
2600
|
},
|
|
2594
2601
|
deletable: !1
|
|
2595
2602
|
},
|
|
2596
2603
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2597
2604
|
]);
|
|
2598
|
-
}, []),
|
|
2605
|
+
}, []), Et = H(() => {
|
|
2599
2606
|
var S;
|
|
2600
|
-
const
|
|
2607
|
+
const y = {
|
|
2601
2608
|
insertAfterSlot: null,
|
|
2602
2609
|
upstreamSlots: [],
|
|
2603
2610
|
downstreamSlots: [],
|
|
2604
|
-
branch:
|
|
2611
|
+
branch: de,
|
|
2605
2612
|
template: j
|
|
2606
2613
|
};
|
|
2607
|
-
if (!
|
|
2608
|
-
if (
|
|
2609
|
-
const { filterId: C, branch: T } =
|
|
2610
|
-
return
|
|
2614
|
+
if (!J) return y;
|
|
2615
|
+
if (de) {
|
|
2616
|
+
const { filterId: C, branch: T } = de, b = R.findIndex((F) => F.id === C), N = b >= 0 ? R.slice(0, b + 1) : [], _ = ((S = Y[C]) == null ? void 0 : S[T]) ?? [], I = _.findIndex((F) => F.id === J), B = I >= 0 ? _.slice(0, I + 1) : [];
|
|
2617
|
+
return y.upstreamSlots = [...N, ...B], y.downstreamSlots = I >= 0 ? _.slice(I + 1) : _, y.insertAfterSlot = B[B.length - 1] ?? null, y;
|
|
2611
2618
|
}
|
|
2612
|
-
const v = R.findIndex((C) => C.id ===
|
|
2613
|
-
return
|
|
2614
|
-
}, [R, Y,
|
|
2615
|
-
const
|
|
2619
|
+
const v = R.findIndex((C) => C.id === J);
|
|
2620
|
+
return y.upstreamSlots = v >= 0 ? R.slice(0, v + 1) : [], y.downstreamSlots = v >= 0 ? R.slice(v + 1) : [], y.insertAfterSlot = y.upstreamSlots[y.upstreamSlots.length - 1] ?? null, y;
|
|
2621
|
+
}, [R, Y, J, de, j]), Ge = (y, v) => y.descriptorType === v || y.id === v || y.kind === v, xt = H(() => {
|
|
2622
|
+
const y = e.list(), v = j != null && j.availableTasks ? y.filter((b) => j.availableTasks.includes(b.type)) : y, S = Et(), C = [
|
|
2616
2623
|
...R,
|
|
2617
|
-
...Object.values(Y).flatMap((
|
|
2618
|
-
], T = (
|
|
2619
|
-
return v.filter((
|
|
2620
|
-
(
|
|
2621
|
-
) ||
|
|
2622
|
-
(
|
|
2624
|
+
...Object.values(Y).flatMap((b) => Object.values(b).flat())
|
|
2625
|
+
], T = (b) => C.some((N) => b.some((_) => Ge(N, _)));
|
|
2626
|
+
return v.filter((b) => b.maxPerWorkflow !== void 0 && R.filter((_) => _.descriptorType === b.type).length + Object.values(Y).flatMap((_) => Object.values(_).flat()).filter((_) => _.descriptorType === b.type).length >= b.maxPerWorkflow ? !1 : b.canInsert ? b.canInsert(S) : !(b.insertAfter && b.insertAfter.length > 0 && T(b.insertAfter) && !S.upstreamSlots.some(
|
|
2627
|
+
(_) => b.insertAfter.some((I) => Ge(_, I))
|
|
2628
|
+
) || b.insertBefore && b.insertBefore.length > 0 && T(b.insertBefore) && !S.downstreamSlots.some(
|
|
2629
|
+
(_) => b.insertBefore.some((I) => Ge(_, I))
|
|
2623
2630
|
)));
|
|
2624
|
-
}, [e, j, R, Y,
|
|
2625
|
-
if (!
|
|
2626
|
-
const v = `${
|
|
2631
|
+
}, [e, j, R, Y, Et]), kt = H((y) => {
|
|
2632
|
+
if (!J) return;
|
|
2633
|
+
const v = `${y.type}-${Date.now()}`, S = y.reactFlowType === "filterNode" || y.reactFlowType === "approvalNode" || y.reactFlowType === "conditionBranchNode", C = y.branchLabels ?? { pass: "Pass", fail: "Fail" }, T = {
|
|
2627
2634
|
id: v,
|
|
2628
|
-
kind: S ?
|
|
2629
|
-
reactFlowType:
|
|
2630
|
-
descriptorType:
|
|
2635
|
+
kind: S ? y.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
2636
|
+
reactFlowType: y.reactFlowType,
|
|
2637
|
+
descriptorType: y.type,
|
|
2631
2638
|
formData: {},
|
|
2632
|
-
nodeData: { title:
|
|
2639
|
+
nodeData: { title: y.label },
|
|
2633
2640
|
deletable: !0,
|
|
2634
2641
|
branchLabels: C,
|
|
2635
|
-
...
|
|
2642
|
+
...y.branchStyle ? { branchStyle: y.branchStyle } : {}
|
|
2636
2643
|
};
|
|
2637
|
-
if (
|
|
2638
|
-
const { filterId:
|
|
2639
|
-
|
|
2640
|
-
const I = [...
|
|
2644
|
+
if (de) {
|
|
2645
|
+
const { filterId: b, branch: N } = de;
|
|
2646
|
+
te((_) => {
|
|
2647
|
+
const I = [..._[b][N]];
|
|
2641
2648
|
if (S) {
|
|
2642
|
-
const
|
|
2643
|
-
return
|
|
2644
|
-
...
|
|
2645
|
-
[
|
|
2649
|
+
const Z = I.filter((ye) => ye.kind !== "end"), xe = Z.findIndex((ye) => ye.id === J), Dn = xe === -1 ? Z.length : xe + 1;
|
|
2650
|
+
return Z.splice(Dn, 0, T), {
|
|
2651
|
+
..._,
|
|
2652
|
+
[b]: { ..._[b], [N]: Z },
|
|
2646
2653
|
[v]: Object.fromEntries(
|
|
2647
|
-
Object.keys(C).map((
|
|
2654
|
+
Object.keys(C).map((ye) => [ye, [{ id: `end-${v}-${ye}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2648
2655
|
)
|
|
2649
2656
|
};
|
|
2650
2657
|
}
|
|
2651
|
-
const B = I.findIndex((
|
|
2652
|
-
return I.splice(
|
|
2658
|
+
const B = I.findIndex((Z) => Z.id === J), F = I.findIndex((Z) => Z.kind === "end"), D = B === -1 ? F === -1 ? I.length : F : B + 1;
|
|
2659
|
+
return I.splice(D, 0, T), { ..._, [b]: { ..._[b], [N]: I } };
|
|
2653
2660
|
});
|
|
2654
|
-
} else
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
...
|
|
2661
|
+
} else if (S) {
|
|
2662
|
+
const b = y.branchStyle === "inline-gate", N = R.filter((F) => F.kind !== "end"), _ = N.findIndex((F) => F.id === J), I = _ >= 0 ? N.slice(_ + 1) : [];
|
|
2663
|
+
ae(() => [...N.slice(0, _ + 1), T]);
|
|
2664
|
+
const B = Object.keys(C);
|
|
2665
|
+
te((F) => ({
|
|
2666
|
+
...F,
|
|
2660
2667
|
[v]: Object.fromEntries(
|
|
2661
|
-
|
|
2668
|
+
B.map((D, Z) => {
|
|
2669
|
+
const xe = { id: `end-${v}-${D}`, kind: "end", reactFlowType: "endNode" };
|
|
2670
|
+
return b && Z === 0 && I.length > 0 ? [D, [...I, xe]] : [D, [xe]];
|
|
2671
|
+
})
|
|
2662
2672
|
)
|
|
2663
|
-
}))
|
|
2664
|
-
|
|
2665
|
-
|
|
2673
|
+
}));
|
|
2674
|
+
} else
|
|
2675
|
+
ae((b) => {
|
|
2676
|
+
const N = b.findIndex((_) => _.id === J);
|
|
2677
|
+
return N === -1 ? b : [...b.slice(0, N + 1), T, ...b.slice(N + 1)];
|
|
2666
2678
|
});
|
|
2667
|
-
|
|
2668
|
-
}, [
|
|
2669
|
-
const S = (
|
|
2670
|
-
const
|
|
2671
|
-
switch (
|
|
2679
|
+
Oe(null), ut(null), ft(v), X("nodeConfig");
|
|
2680
|
+
}, [J, de]), _t = H((y, v) => {
|
|
2681
|
+
const S = (b) => {
|
|
2682
|
+
const N = b.label || b.key;
|
|
2683
|
+
switch (b.kind) {
|
|
2672
2684
|
case "if":
|
|
2673
|
-
return `IF · ${
|
|
2685
|
+
return `IF · ${N}`;
|
|
2674
2686
|
case "elseif":
|
|
2675
|
-
return `ELSE IF · ${
|
|
2687
|
+
return `ELSE IF · ${N}`;
|
|
2676
2688
|
case "else":
|
|
2677
|
-
return
|
|
2689
|
+
return N.toUpperCase() === "ELSE" ? N : `ELSE · ${N}`;
|
|
2678
2690
|
default:
|
|
2679
|
-
return
|
|
2691
|
+
return N;
|
|
2680
2692
|
}
|
|
2681
|
-
}, C = (
|
|
2682
|
-
const
|
|
2683
|
-
if ((
|
|
2684
|
-
const I = (v.branchConfigs ?? []).map((
|
|
2685
|
-
if (I.length === 0) return
|
|
2686
|
-
const B = y
|
|
2687
|
-
return I.forEach((
|
|
2688
|
-
|
|
2689
|
-
}), { ...
|
|
2690
|
-
}, T = (
|
|
2691
|
-
if (
|
|
2692
|
-
const
|
|
2693
|
-
return
|
|
2693
|
+
}, C = (b) => {
|
|
2694
|
+
const N = ce(y);
|
|
2695
|
+
if ((N == null ? void 0 : N.descriptorType) !== "conditionBranch") return b;
|
|
2696
|
+
const I = (v.branchConfigs ?? []).map((D) => D.key).filter(Boolean);
|
|
2697
|
+
if (I.length === 0) return b;
|
|
2698
|
+
const B = b[y] ?? {}, F = {};
|
|
2699
|
+
return I.forEach((D) => {
|
|
2700
|
+
F[D] = B[D] ?? [{ id: `end-${y}-${D}`, kind: "end", reactFlowType: "endNode" }];
|
|
2701
|
+
}), { ...b, [y]: F };
|
|
2702
|
+
}, T = (b, N) => {
|
|
2703
|
+
if (b.descriptorType !== "conditionBranch") return { ...b, formData: N };
|
|
2704
|
+
const _ = N.branchConfigs ?? [], I = {};
|
|
2705
|
+
return _.forEach((B) => {
|
|
2694
2706
|
B.key && (I[B.key] = S(B));
|
|
2695
|
-
}), { ...
|
|
2707
|
+
}), { ...b, formData: N, branchLabels: I };
|
|
2696
2708
|
};
|
|
2697
|
-
if (R.some((
|
|
2698
|
-
|
|
2699
|
-
const
|
|
2700
|
-
return
|
|
2701
|
-
(
|
|
2702
|
-
(I) => I.id ===
|
|
2709
|
+
if (R.some((b) => b.id === y)) {
|
|
2710
|
+
te((b) => {
|
|
2711
|
+
const N = C(b);
|
|
2712
|
+
return ae(
|
|
2713
|
+
(_) => _.map(
|
|
2714
|
+
(I) => I.id === y ? T(I, v) : I
|
|
2703
2715
|
)
|
|
2704
|
-
),
|
|
2716
|
+
), N;
|
|
2705
2717
|
});
|
|
2706
2718
|
return;
|
|
2707
2719
|
}
|
|
2708
|
-
|
|
2709
|
-
const
|
|
2710
|
-
for (const I of Object.keys(
|
|
2711
|
-
const B = (
|
|
2712
|
-
for (const
|
|
2713
|
-
if (
|
|
2714
|
-
return
|
|
2720
|
+
te((b) => {
|
|
2721
|
+
const _ = { ...C(b) };
|
|
2722
|
+
for (const I of Object.keys(_)) {
|
|
2723
|
+
const B = (F) => F.map((D) => D.id === y ? T(D, v) : D);
|
|
2724
|
+
for (const F of Object.keys(_[I]))
|
|
2725
|
+
if (_[I][F].some((D) => D.id === y))
|
|
2726
|
+
return _[I] = { ..._[I], [F]: B(_[I][F]) }, _;
|
|
2715
2727
|
}
|
|
2716
|
-
return
|
|
2728
|
+
return _;
|
|
2717
2729
|
});
|
|
2718
|
-
}, [R, Y,
|
|
2730
|
+
}, [R, Y, ce]), K = U(() => ce(De ?? ""), [ce, De]), St = U(() => {
|
|
2719
2731
|
if ((K == null ? void 0 : K.kind) === "triggerFixed") {
|
|
2720
|
-
const
|
|
2732
|
+
const y = (j == null ? void 0 : j.triggerCategory) === "scheduler", v = (j == null ? void 0 : j.triggerConfigTitle) ?? (y ? "Scheduler" : j == null ? void 0 : j.label) ?? "Trigger", S = j == null ? void 0 : j.triggerCustomPanel;
|
|
2721
2733
|
if (S)
|
|
2722
2734
|
return {
|
|
2723
2735
|
type: K.id,
|
|
@@ -2725,7 +2737,7 @@ const Ht = ({
|
|
|
2725
2737
|
icon: j == null ? void 0 : j.icon,
|
|
2726
2738
|
reactFlowType: "triggerNode",
|
|
2727
2739
|
formSchema: [],
|
|
2728
|
-
customPanel: ({ nodeId: T, data:
|
|
2740
|
+
customPanel: ({ nodeId: T, data: b, onSave: N, onClose: _ }) => S({ data: b, onSave: N, onClose: _ }),
|
|
2729
2741
|
matches: () => !1,
|
|
2730
2742
|
bpmnEntry: (T) => T,
|
|
2731
2743
|
bpmnExit: (T) => T,
|
|
@@ -2747,25 +2759,25 @@ const Ht = ({
|
|
|
2747
2759
|
} : null;
|
|
2748
2760
|
}
|
|
2749
2761
|
return K != null && K.descriptorType ? e.forType(K.descriptorType) ?? null : null;
|
|
2750
|
-
}, [K, e, j]), { nodes:
|
|
2751
|
-
() => us(R, Y, s ? null :
|
|
2752
|
-
[R, Y, s,
|
|
2753
|
-
),
|
|
2754
|
-
const
|
|
2755
|
-
return
|
|
2762
|
+
}, [K, e, j]), { nodes: Nt, edges: Fn } = U(
|
|
2763
|
+
() => us(R, Y, s ? null : vt, pt, l, p, we),
|
|
2764
|
+
[R, Y, s, vt, pt, l, p, we]
|
|
2765
|
+
), Ct = U(() => {
|
|
2766
|
+
const y = k ? new Map(k.steps.map((v) => [v.nodeId, v])) : null;
|
|
2767
|
+
return Nt.map((v) => {
|
|
2756
2768
|
let S = {};
|
|
2757
|
-
if (
|
|
2758
|
-
const C =
|
|
2769
|
+
if (y) {
|
|
2770
|
+
const C = y.get(v.id);
|
|
2759
2771
|
C && (S = { _executionStatus: C.status, _executionError: C.error });
|
|
2760
2772
|
}
|
|
2761
2773
|
return v.type === "subWorkflowNode" && x && (S.onPreview = (C) => {
|
|
2762
|
-
var
|
|
2763
|
-
const T =
|
|
2764
|
-
|
|
2774
|
+
var b;
|
|
2775
|
+
const T = ce(v.id);
|
|
2776
|
+
ht({ workflowId: C, workflowLabel: ((b = T == null ? void 0 : T.formData) == null ? void 0 : b.workflowLabel) ?? void 0 });
|
|
2765
2777
|
}), Object.keys(S).length > 0 ? { ...v, data: { ...v.data, ...S } } : v;
|
|
2766
2778
|
});
|
|
2767
|
-
}, [
|
|
2768
|
-
}, onClickAddTrigger:
|
|
2779
|
+
}, [Nt, k, x, ce]), Rn = U(() => ({ onEditNode: We, onDeleteNode: mt, onAddStep: () => {
|
|
2780
|
+
}, onClickAddTrigger: $e, messages: Ee, nodeRegistry: e, nodeBody: ct, activeTemplate: j }), [We, mt, $e, Ee, e, ct, j]), An = H(async () => {
|
|
2769
2781
|
i && await i({ slots: R, branches: Y });
|
|
2770
2782
|
}, [i, R, Y]), Bn = U(() => Sr({
|
|
2771
2783
|
palette: {
|
|
@@ -2779,7 +2791,7 @@ const Ht = ({
|
|
|
2779
2791
|
shape: { borderRadius: l.borderRadius ?? 6 },
|
|
2780
2792
|
typography: l.fontFamily ? { fontFamily: l.fontFamily } : {}
|
|
2781
2793
|
}), [l]);
|
|
2782
|
-
return /* @__PURE__ */ u(Nr, { theme: Bn, children: /* @__PURE__ */ u(kr, { resolvers:
|
|
2794
|
+
return /* @__PURE__ */ u(Nr, { theme: Bn, children: /* @__PURE__ */ u(kr, { resolvers: oe, children: /* @__PURE__ */ u(Qn.Provider, { value: Rn, children: /* @__PURE__ */ w(
|
|
2783
2795
|
"div",
|
|
2784
2796
|
{
|
|
2785
2797
|
className: "flowforge-canvas",
|
|
@@ -2801,40 +2813,40 @@ const Ht = ({
|
|
|
2801
2813
|
"--ff-font-family": l.fontFamily
|
|
2802
2814
|
},
|
|
2803
2815
|
children: [
|
|
2804
|
-
!O && (i ||
|
|
2816
|
+
!O && (i || $ || z) && /* @__PURE__ */ u(
|
|
2805
2817
|
ns,
|
|
2806
2818
|
{
|
|
2807
|
-
workflowName:
|
|
2808
|
-
onWorkflowNameChange:
|
|
2819
|
+
workflowName: z,
|
|
2820
|
+
onWorkflowNameChange: W,
|
|
2809
2821
|
status: P,
|
|
2810
2822
|
statusColor: M,
|
|
2811
2823
|
onSave: i ? An : void 0,
|
|
2812
|
-
onCancel:
|
|
2813
|
-
saveLabel:
|
|
2824
|
+
onCancel: $,
|
|
2825
|
+
saveLabel: V
|
|
2814
2826
|
}
|
|
2815
2827
|
),
|
|
2816
2828
|
/* @__PURE__ */ w("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: [
|
|
2817
2829
|
/* @__PURE__ */ w(
|
|
2818
2830
|
Wn,
|
|
2819
2831
|
{
|
|
2820
|
-
nodes:
|
|
2832
|
+
nodes: Ct,
|
|
2821
2833
|
edges: Fn,
|
|
2822
2834
|
nodeTypes: zn,
|
|
2823
2835
|
edgeTypes: Ln,
|
|
2824
2836
|
fitView: le,
|
|
2825
|
-
fitViewOptions: { padding:
|
|
2837
|
+
fitViewOptions: { padding: A },
|
|
2826
2838
|
nodesDraggable: !1,
|
|
2827
2839
|
nodesConnectable: !1,
|
|
2828
|
-
panOnScroll:
|
|
2829
|
-
zoomOnScroll:
|
|
2830
|
-
minZoom:
|
|
2831
|
-
maxZoom:
|
|
2832
|
-
snapToGrid:
|
|
2833
|
-
snapGrid:
|
|
2840
|
+
panOnScroll: ee,
|
|
2841
|
+
zoomOnScroll: he,
|
|
2842
|
+
minZoom: ge,
|
|
2843
|
+
maxZoom: Be,
|
|
2844
|
+
snapToGrid: dt,
|
|
2845
|
+
snapGrid: Ie,
|
|
2834
2846
|
proOptions: { hideAttribution: !0 },
|
|
2835
|
-
onNodeClick: (
|
|
2836
|
-
const S =
|
|
2837
|
-
S && (E != null && E(S) || (S.kind === "addTrigger" || S.kind === "triggerFixed" ?
|
|
2847
|
+
onNodeClick: (y, v) => {
|
|
2848
|
+
const S = ce(v.id);
|
|
2849
|
+
S && (E != null && E(S) || (S.kind === "addTrigger" || S.kind === "triggerFixed" ? $e() : (S.kind === "userTask" || S.kind === "filter" || S.kind === "approval") && We(v.id)));
|
|
2838
2850
|
},
|
|
2839
2851
|
children: [
|
|
2840
2852
|
l.background !== "none" && /* @__PURE__ */ u(
|
|
@@ -2845,26 +2857,26 @@ const Ht = ({
|
|
|
2845
2857
|
gap: 20
|
|
2846
2858
|
}
|
|
2847
2859
|
),
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
/* @__PURE__ */ u(es, { onHeightsReady:
|
|
2860
|
+
ie && /* @__PURE__ */ u(Kn, { showInteractive: !1 }),
|
|
2861
|
+
ve && /* @__PURE__ */ u(Hn, { zoomable: !0, pannable: !0 }),
|
|
2862
|
+
/* @__PURE__ */ u(es, { onHeightsReady: jn, nodeCount: Ct.length })
|
|
2851
2863
|
]
|
|
2852
2864
|
}
|
|
2853
2865
|
),
|
|
2854
|
-
c ?
|
|
2855
|
-
h ?
|
|
2856
|
-
X(null),
|
|
2857
|
-
}) : /* @__PURE__ */ u(os, { open:
|
|
2858
|
-
X(null),
|
|
2866
|
+
c ? pe === "triggerSelect" && c(t.list(), wt, () => X(null)) : /* @__PURE__ */ u(rs, { open: pe === "triggerSelect", templates: t.list(), messages: Ee, onSelect: wt, onClose: () => X(null), loadTriggerSources: f }),
|
|
2867
|
+
h ? pe === "nodePicker" && h(xt(), kt, () => {
|
|
2868
|
+
X(null), Oe(null);
|
|
2869
|
+
}) : /* @__PURE__ */ u(os, { open: pe === "nodePicker", availableDescriptors: xt(), messages: Ee, onSelect: kt, onClose: () => {
|
|
2870
|
+
X(null), Oe(null);
|
|
2859
2871
|
} }),
|
|
2860
|
-
g ?
|
|
2861
|
-
x &&
|
|
2872
|
+
g ? pe === "nodeConfig" && g(St ?? void 0, K, _t, () => X(null)) : /* @__PURE__ */ u(is, { open: pe === "nodeConfig", nodeId: De, descriptor: St, initialValues: K == null ? void 0 : K.formData, messages: Ee, onSave: _t, onClose: () => X(null) }),
|
|
2873
|
+
x && Me && /* @__PURE__ */ u(
|
|
2862
2874
|
ss,
|
|
2863
2875
|
{
|
|
2864
|
-
isOpen: !!
|
|
2865
|
-
onClose: () =>
|
|
2866
|
-
workflowId:
|
|
2867
|
-
workflowLabel:
|
|
2876
|
+
isOpen: !!Me,
|
|
2877
|
+
onClose: () => ht(null),
|
|
2878
|
+
workflowId: Me.workflowId,
|
|
2879
|
+
workflowLabel: Me.workflowLabel,
|
|
2868
2880
|
onFetchWorkflow: x
|
|
2869
2881
|
}
|
|
2870
2882
|
)
|
|
@@ -2874,9 +2886,9 @@ const Ht = ({
|
|
|
2874
2886
|
) }) }) });
|
|
2875
2887
|
}, hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2876
2888
|
__proto__: null,
|
|
2877
|
-
WorkflowCanvas:
|
|
2878
|
-
default:
|
|
2879
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2889
|
+
WorkflowCanvas: Xt,
|
|
2890
|
+
default: Xt
|
|
2891
|
+
}, Symbol.toStringTag, { value: "Module" })), Ze = "All";
|
|
2880
2892
|
function gs({ template: e, onSelect: t }) {
|
|
2881
2893
|
var o, i;
|
|
2882
2894
|
const n = e.triggerCategory ? Cr[e.triggerCategory] : null, r = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
|
|
@@ -2932,19 +2944,19 @@ function gs({ template: e, onSelect: t }) {
|
|
|
2932
2944
|
}
|
|
2933
2945
|
);
|
|
2934
2946
|
}
|
|
2935
|
-
const
|
|
2947
|
+
const js = ({
|
|
2936
2948
|
templates: e,
|
|
2937
2949
|
onSelectTemplate: t,
|
|
2938
2950
|
onStartFromScratch: n
|
|
2939
2951
|
}) => {
|
|
2940
|
-
const [r, o] =
|
|
2952
|
+
const [r, o] = L(""), [i, s] = L(Ze), l = U(() => {
|
|
2941
2953
|
const a = /* @__PURE__ */ new Set();
|
|
2942
2954
|
return e.forEach((c) => {
|
|
2943
2955
|
c.category && a.add(c.category);
|
|
2944
|
-
}), [
|
|
2956
|
+
}), [Ze, ...Array.from(a)];
|
|
2945
2957
|
}, [e]), d = U(() => {
|
|
2946
2958
|
let a = e;
|
|
2947
|
-
if (i !==
|
|
2959
|
+
if (i !== Ze && (a = a.filter((c) => c.category === i)), r.trim()) {
|
|
2948
2960
|
const c = r.toLowerCase();
|
|
2949
2961
|
a = a.filter(
|
|
2950
2962
|
(f) => {
|
|
@@ -3011,26 +3023,26 @@ const Ms = ({
|
|
|
3011
3023
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
3012
3024
|
] }) : /* @__PURE__ */ u("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ u(gs, { template: a, onSelect: () => t(a) }, a.triggerKey)) }) })
|
|
3013
3025
|
] });
|
|
3014
|
-
},
|
|
3015
|
-
running: { label: "Running", color:
|
|
3016
|
-
success: { label: "Success", color:
|
|
3017
|
-
failed: { label: "Failed", color:
|
|
3018
|
-
cancelled: { label: "Cancelled", color:
|
|
3026
|
+
}, je = {
|
|
3027
|
+
running: { label: "Running", color: re.running, icon: G.createElement(nn, { size: 14 }) },
|
|
3028
|
+
success: { label: "Success", color: re.success, icon: G.createElement(tn, { size: 14 }) },
|
|
3029
|
+
failed: { label: "Failed", color: re.failed, icon: G.createElement(en, { size: 14 }) },
|
|
3030
|
+
cancelled: { label: "Cancelled", color: re.cancelled, icon: G.createElement(Qt, { size: 14 }) }
|
|
3019
3031
|
}, ps = {
|
|
3020
|
-
pending: { color:
|
|
3021
|
-
running: { color:
|
|
3022
|
-
success: { color:
|
|
3023
|
-
failed: { color:
|
|
3024
|
-
skipped: { color:
|
|
3032
|
+
pending: { color: re.pending, icon: G.createElement(gr, { size: 14 }) },
|
|
3033
|
+
running: { color: re.running, icon: G.createElement(nn, { size: 14 }) },
|
|
3034
|
+
success: { color: re.success, icon: G.createElement(tn, { size: 14 }) },
|
|
3035
|
+
failed: { color: re.failed, icon: G.createElement(en, { size: 14 }) },
|
|
3036
|
+
skipped: { color: re.skipped, icon: G.createElement(Qt, { size: 14 }) }
|
|
3025
3037
|
};
|
|
3026
|
-
function
|
|
3038
|
+
function rt(e) {
|
|
3027
3039
|
try {
|
|
3028
3040
|
return new Date(e).toLocaleString();
|
|
3029
3041
|
} catch {
|
|
3030
3042
|
return e;
|
|
3031
3043
|
}
|
|
3032
3044
|
}
|
|
3033
|
-
function
|
|
3045
|
+
function On(e, t) {
|
|
3034
3046
|
try {
|
|
3035
3047
|
const n = new Date(t ?? (/* @__PURE__ */ new Date()).toISOString()).getTime() - new Date(e).getTime();
|
|
3036
3048
|
return n < 1e3 ? `${n}ms` : n < 6e4 ? `${(n / 1e3).toFixed(1)}s` : `${Math.floor(n / 6e4)}m ${Math.floor(n % 6e4 / 1e3)}s`;
|
|
@@ -3039,7 +3051,7 @@ function Nn(e, t) {
|
|
|
3039
3051
|
}
|
|
3040
3052
|
}
|
|
3041
3053
|
function ys({ step: e }) {
|
|
3042
|
-
const [t, n] =
|
|
3054
|
+
const [t, n] = L(!1), r = ps[e.status], o = !!(e.inputs || e.outputs || e.error);
|
|
3043
3055
|
return /* @__PURE__ */ w("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
|
|
3044
3056
|
/* @__PURE__ */ w(
|
|
3045
3057
|
"div",
|
|
@@ -3054,11 +3066,11 @@ function ys({ step: e }) {
|
|
|
3054
3066
|
o && (i.key === "Enter" || i.key === " ") && n((s) => !s);
|
|
3055
3067
|
},
|
|
3056
3068
|
children: [
|
|
3057
|
-
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children:
|
|
3069
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: G.cloneElement(r.icon, { color: r.color }) }),
|
|
3058
3070
|
/* @__PURE__ */ u("span", { style: { flex: 1, fontSize: 13, color: "#212121" }, children: e.label || e.nodeId }),
|
|
3059
3071
|
e.branchTaken && /* @__PURE__ */ u("span", { style: { fontSize: 10, padding: "1px 6px", borderRadius: 10, background: "#e3f2fd", color: "#1565c0", fontWeight: 600 }, children: e.branchTaken }),
|
|
3060
|
-
/* @__PURE__ */ u("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ?
|
|
3061
|
-
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ?
|
|
3072
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ? On(e.startedAt, e.completedAt) : "—" }),
|
|
3073
|
+
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? G.createElement(yr, { size: 16 }) : G.createElement(br, { size: 16 }) })
|
|
3062
3074
|
]
|
|
3063
3075
|
}
|
|
3064
3076
|
),
|
|
@@ -3076,7 +3088,7 @@ function ys({ step: e }) {
|
|
|
3076
3088
|
] });
|
|
3077
3089
|
}
|
|
3078
3090
|
function bs({ record: e, selected: t, onSelect: n }) {
|
|
3079
|
-
const r =
|
|
3091
|
+
const r = je[e.status];
|
|
3080
3092
|
return /* @__PURE__ */ w(
|
|
3081
3093
|
"div",
|
|
3082
3094
|
{
|
|
@@ -3097,9 +3109,9 @@ function bs({ record: e, selected: t, onSelect: n }) {
|
|
|
3097
3109
|
outline: "none"
|
|
3098
3110
|
},
|
|
3099
3111
|
children: [
|
|
3100
|
-
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children:
|
|
3112
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: G.cloneElement(r.icon, { color: r.color, size: 16 }) }),
|
|
3101
3113
|
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3102
|
-
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children:
|
|
3114
|
+
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: rt(e.triggeredAt) }),
|
|
3103
3115
|
/* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
|
|
3104
3116
|
e.triggeredBy ? `by ${e.triggeredBy}` : "System",
|
|
3105
3117
|
" · ",
|
|
@@ -3109,16 +3121,16 @@ function bs({ record: e, selected: t, onSelect: n }) {
|
|
|
3109
3121
|
] })
|
|
3110
3122
|
] }),
|
|
3111
3123
|
/* @__PURE__ */ u("span", { style: { fontSize: 11, fontWeight: 600, color: r.color, flexShrink: 0 }, children: r.label }),
|
|
3112
|
-
/* @__PURE__ */ u(
|
|
3124
|
+
/* @__PURE__ */ u(Zt, { size: 14, color: "#bdbdbd" })
|
|
3113
3125
|
]
|
|
3114
3126
|
}
|
|
3115
3127
|
);
|
|
3116
3128
|
}
|
|
3117
3129
|
const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
3118
3130
|
var s;
|
|
3119
|
-
const [n, r] =
|
|
3131
|
+
const [n, r] = L(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === n) ?? null, i = [...e].sort((l, d) => new Date(d.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
|
|
3120
3132
|
return e.length === 0 ? /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
3121
|
-
/* @__PURE__ */ u(
|
|
3133
|
+
/* @__PURE__ */ u(Ot, { size: 36 }),
|
|
3122
3134
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
3123
3135
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
|
|
3124
3136
|
] }) : /* @__PURE__ */ w("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
|
|
@@ -3134,15 +3146,15 @@ const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3134
3146
|
/* @__PURE__ */ w("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
3135
3147
|
/* @__PURE__ */ w("div", { children: [
|
|
3136
3148
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
3137
|
-
|
|
3138
|
-
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children:
|
|
3149
|
+
G.cloneElement(je[o.status].icon, { color: je[o.status].color, size: 18 }),
|
|
3150
|
+
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: je[o.status].label })
|
|
3139
3151
|
] }),
|
|
3140
3152
|
/* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
3141
3153
|
/* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3142
|
-
/* @__PURE__ */ u(
|
|
3154
|
+
/* @__PURE__ */ u(Ot, { size: 13 }),
|
|
3143
3155
|
" ",
|
|
3144
|
-
|
|
3145
|
-
o.completedAt && ` → ${
|
|
3156
|
+
rt(o.triggeredAt),
|
|
3157
|
+
o.completedAt && ` → ${rt(o.completedAt)} (${On(o.triggeredAt, o.completedAt)})`
|
|
3146
3158
|
] }),
|
|
3147
3159
|
o.triggeredBy && /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3148
3160
|
/* @__PURE__ */ u(pr, { size: 13 }),
|
|
@@ -3177,10 +3189,10 @@ const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3177
3189
|
] });
|
|
3178
3190
|
};
|
|
3179
3191
|
export {
|
|
3180
|
-
|
|
3192
|
+
Xt as F,
|
|
3181
3193
|
ss as S,
|
|
3182
3194
|
zs as W,
|
|
3183
3195
|
ns as a,
|
|
3184
|
-
|
|
3196
|
+
js as b
|
|
3185
3197
|
};
|
|
3186
|
-
//# sourceMappingURL=WorkflowExecutionHistory-
|
|
3198
|
+
//# sourceMappingURL=WorkflowExecutionHistory-BBeVPYVc.js.map
|