@notmrabhi/flowforge 0.1.37 → 0.1.39
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-CYoEUE5g.js +2 -0
- package/dist/GatewayBranchEdge-CYoEUE5g.js.map +1 -0
- package/dist/{GatewayBranchEdge-Diid9GtB.js → GatewayBranchEdge-DffZFc99.js} +473 -407
- package/dist/GatewayBranchEdge-DffZFc99.js.map +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +46 -1
- package/dist/canvas.js +22 -21
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +46 -1
- package/dist/index.js +33 -32
- package/dist/{templateSkeletons-BB6jQ9r5.js → templateSkeletons-CEqw1Djn.js} +1168 -987
- package/dist/templateSkeletons-CEqw1Djn.js.map +1 -0
- package/dist/templateSkeletons-Sd2FDF9w.js +2 -0
- package/dist/templateSkeletons-Sd2FDF9w.js.map +1 -0
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-DNSPjIZw.js +0 -2
- package/dist/GatewayBranchEdge-DNSPjIZw.js.map +0 -1
- package/dist/GatewayBranchEdge-Diid9GtB.js.map +0 -1
- package/dist/templateSkeletons-BB6jQ9r5.js.map +0 -1
- package/dist/templateSkeletons-BkdRPbV0.js +0 -2
- package/dist/templateSkeletons-BkdRPbV0.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as w, jsx as u, Fragment as be } from "react/jsx-runtime";
|
|
2
|
+
import P, { useRef as Tt, useEffect as re, useState as j, useCallback as Y, useMemo as K } from "react";
|
|
3
|
+
import Rn, { useStore as Dn, useReactFlow as Pn, Background as Bn, Controls as Wn, MiniMap as Gn } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as
|
|
6
|
-
import { Dialog as
|
|
7
|
-
import
|
|
8
|
-
import { MdClose as
|
|
9
|
-
import { GrTrigger as
|
|
10
|
-
import { BiCollapse as
|
|
11
|
-
import { j as
|
|
12
|
-
import { m as
|
|
13
|
-
import { T as
|
|
14
|
-
var
|
|
15
|
-
for (var n in t)
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
for (var n in t)
|
|
20
|
-
},
|
|
5
|
+
import { e as $n, G as Yn, E as Kn, P as Un, L as Hn, d as Vn, f as qn } from "./GatewayBranchEdge-DffZFc99.js";
|
|
6
|
+
import { Dialog as Xn, Box as Q, Drawer as Jn, IconButton as _t, Button as Ne, CircularProgress as Zn } from "@mui/material";
|
|
7
|
+
import Qn from "react-select";
|
|
8
|
+
import { MdClose as er, MdCalendarToday as tr, MdBolt as nr, MdArrowBack as Kt, MdChevronRight as Ut, MdAddCircleOutline as rr, MdApps as or, MdErrorOutline as ir, MdAccountTree as sr, MdAdd as lr, MdSearch as ar, MdCategory as dr, MdCancel as Ht, MdError as Vt, MdCheckCircle as qt, MdPlayArrow as Xt, MdHourglassEmpty as cr, MdSchedule as Nt, MdPerson as fr, MdExpandLess as ur, MdExpandMore as hr } from "react-icons/md";
|
|
9
|
+
import { GrTrigger as gr } from "react-icons/gr";
|
|
10
|
+
import { BiCollapse as pr, BiExpand as br } from "react-icons/bi";
|
|
11
|
+
import { j as yr, b as mr } from "./index-B74jTc2b.js";
|
|
12
|
+
import { m as wr } from "./messages-CO299wPN.js";
|
|
13
|
+
import { T as vr, E as ee } from "./canvasTokens-CAD6G24b.js";
|
|
14
|
+
var Jt = Object.defineProperty, Er = (e, t, n) => t in e ? Jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, kr = (e, t) => {
|
|
15
|
+
for (var n in t) Jt(e, n, { get: t[n], enumerable: !0 });
|
|
16
|
+
}, xr = (e, t, n) => Er(e, t + "", n), Zt = {};
|
|
17
|
+
kr(Zt, { Graph: () => U, alg: () => Ze, json: () => en, version: () => Nr });
|
|
18
|
+
var Tr = Object.defineProperty, Qt = (e, t) => {
|
|
19
|
+
for (var n in t) Tr(e, n, { get: t[n], enumerable: !0 });
|
|
20
|
+
}, U = class {
|
|
21
21
|
constructor(e) {
|
|
22
22
|
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 = () => {
|
|
23
23
|
}, this._defaultEdgeLabelFn = () => {
|
|
@@ -150,15 +150,15 @@ var br = Object.defineProperty, qt = (e, t) => {
|
|
|
150
150
|
setEdge(e, t, n, r) {
|
|
151
151
|
let o, i, s, l, d = !1;
|
|
152
152
|
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);
|
|
153
|
-
let a =
|
|
153
|
+
let a = pe(this._isDirected, o, i, s);
|
|
154
154
|
if (a in this._edgeLabels) return d && (this._edgeLabels[a] = l), this;
|
|
155
155
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
156
156
|
this.setNode(o), this.setNode(i), this._edgeLabels[a] = d ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
157
|
-
let c =
|
|
158
|
-
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c,
|
|
157
|
+
let c = _r(this._isDirected, o, i, s);
|
|
158
|
+
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c, St(this._preds[i], o), St(this._sucs[o], i), this._in[i][a] = c, this._out[o][a] = c, this._edgeCount++, this;
|
|
159
159
|
}
|
|
160
160
|
edge(e, t, n) {
|
|
161
|
-
let r = arguments.length === 1 ?
|
|
161
|
+
let r = arguments.length === 1 ? De(this._isDirected, e) : pe(this._isDirected, e, t, n);
|
|
162
162
|
return this._edgeLabels[r];
|
|
163
163
|
}
|
|
164
164
|
edgeAsObj(e, t, n) {
|
|
@@ -166,13 +166,13 @@ var br = Object.defineProperty, qt = (e, t) => {
|
|
|
166
166
|
return typeof r != "object" ? { label: r } : r;
|
|
167
167
|
}
|
|
168
168
|
hasEdge(e, t, n) {
|
|
169
|
-
return (arguments.length === 1 ?
|
|
169
|
+
return (arguments.length === 1 ? De(this._isDirected, e) : pe(this._isDirected, e, t, n)) in this._edgeLabels;
|
|
170
170
|
}
|
|
171
171
|
removeEdge(e, t, n) {
|
|
172
|
-
let r = arguments.length === 1 ?
|
|
172
|
+
let r = arguments.length === 1 ? De(this._isDirected, e) : pe(this._isDirected, e, t, n), o = this._edgeObjs[r];
|
|
173
173
|
if (o) {
|
|
174
174
|
let i = o.v, s = o.w;
|
|
175
|
-
delete this._edgeLabels[r], delete this._edgeObjs[r],
|
|
175
|
+
delete this._edgeLabels[r], delete this._edgeObjs[r], Ct(this._preds[s], i), Ct(this._sucs[i], s), delete this._in[s][r], delete this._out[i][r], this._edgeCount--;
|
|
176
176
|
}
|
|
177
177
|
return this;
|
|
178
178
|
}
|
|
@@ -194,13 +194,13 @@ var br = Object.defineProperty, qt = (e, t) => {
|
|
|
194
194
|
return n ? r.filter((o) => o.v === t && o.w === n || o.v === n && o.w === t) : r;
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
|
-
function
|
|
197
|
+
function St(e, t) {
|
|
198
198
|
e[t] ? e[t]++ : e[t] = 1;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Ct(e, t) {
|
|
201
201
|
e[t] !== void 0 && !--e[t] && delete e[t];
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function pe(e, t, n, r) {
|
|
204
204
|
let o = "" + t, i = "" + n;
|
|
205
205
|
if (!e && o > i) {
|
|
206
206
|
let s = o;
|
|
@@ -208,7 +208,7 @@ function be(e, t, n, r) {
|
|
|
208
208
|
}
|
|
209
209
|
return o + "" + i + "" + (r === void 0 ? "\0" : r);
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function _r(e, t, n, r) {
|
|
212
212
|
let o = "" + t, i = "" + n;
|
|
213
213
|
if (!e && o > i) {
|
|
214
214
|
let l = o;
|
|
@@ -217,65 +217,65 @@ function yr(e, t, n, r) {
|
|
|
217
217
|
let s = { v: o, w: i };
|
|
218
218
|
return r && (s.name = r), s;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return
|
|
220
|
+
function De(e, t) {
|
|
221
|
+
return pe(e, t.v, t.w, t.name);
|
|
222
222
|
}
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
function
|
|
226
|
-
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes:
|
|
223
|
+
var Nr = "4.0.1", en = {};
|
|
224
|
+
Qt(en, { read: () => Or, write: () => Sr });
|
|
225
|
+
function Sr(e) {
|
|
226
|
+
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes: Cr(e), edges: Ir(e) }, n = e.graph();
|
|
227
227
|
return n !== void 0 && (t.value = structuredClone(n)), t;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Cr(e) {
|
|
230
230
|
return e.nodes().map((t) => {
|
|
231
231
|
let n = e.node(t), r = e.parent(t), o = { v: t };
|
|
232
232
|
return n !== void 0 && (o.value = n), r !== void 0 && (o.parent = r), o;
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Ir(e) {
|
|
236
236
|
return e.edges().map((t) => {
|
|
237
237
|
let n = e.edge(t), r = { v: t.v, w: t.w };
|
|
238
238
|
return t.name !== void 0 && (r.name = t.name), n !== void 0 && (r.value = n), r;
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
let t = new
|
|
241
|
+
function Or(e) {
|
|
242
|
+
let t = new U(e.options);
|
|
243
243
|
return e.value !== void 0 && t.setGraph(e.value), e.nodes.forEach((n) => {
|
|
244
244
|
t.setNode(n.v, n.value), n.parent && t.setParent(n.v, n.parent);
|
|
245
245
|
}), e.edges.forEach((n) => {
|
|
246
246
|
t.setEdge({ v: n.v, w: n.w, name: n.name }, n.value);
|
|
247
247
|
}), t;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
var
|
|
252
|
-
function
|
|
253
|
-
return
|
|
249
|
+
var Ze = {};
|
|
250
|
+
Qt(Ze, { CycleException: () => Ce, bellmanFord: () => tn, components: () => zr, dijkstra: () => Se, dijkstraAll: () => Ar, findCycles: () => Rr, floydWarshall: () => Pr, isAcyclic: () => Wr, postorder: () => $r, preorder: () => Yr, prim: () => Kr, shortestPaths: () => Ur, tarjan: () => rn, topsort: () => on });
|
|
251
|
+
var jr = () => 1;
|
|
252
|
+
function tn(e, t, n, r) {
|
|
253
|
+
return Mr(e, String(t), n || jr, r || function(o) {
|
|
254
254
|
return e.outEdges(o);
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
let o = {}, i, s = 0, l = e.nodes(), d = function(
|
|
259
|
-
let h = n(
|
|
260
|
-
o[
|
|
257
|
+
function Mr(e, t, n, r) {
|
|
258
|
+
let o = {}, i, s = 0, l = e.nodes(), d = function(f) {
|
|
259
|
+
let h = n(f);
|
|
260
|
+
o[f.v].distance + h < o[f.w].distance && (o[f.w] = { distance: o[f.v].distance + h, predecessor: f.v }, i = !0);
|
|
261
261
|
}, a = function() {
|
|
262
|
-
l.forEach(function(
|
|
263
|
-
r(
|
|
264
|
-
let g = h.v ===
|
|
265
|
-
d({ v: g, w:
|
|
262
|
+
l.forEach(function(f) {
|
|
263
|
+
r(f).forEach(function(h) {
|
|
264
|
+
let g = h.v === f ? h.v : h.w, p = g === h.v ? h.w : h.v;
|
|
265
|
+
d({ v: g, w: p });
|
|
266
266
|
});
|
|
267
267
|
});
|
|
268
268
|
};
|
|
269
|
-
l.forEach(function(
|
|
270
|
-
let h =
|
|
271
|
-
o[
|
|
269
|
+
l.forEach(function(f) {
|
|
270
|
+
let h = f === t ? 0 : Number.POSITIVE_INFINITY;
|
|
271
|
+
o[f] = { distance: h, predecessor: "" };
|
|
272
272
|
});
|
|
273
273
|
let c = l.length;
|
|
274
|
-
for (let
|
|
274
|
+
for (let f = 1; f < c && (i = !1, s++, a(), !!i); f++) ;
|
|
275
275
|
if (s === c - 1 && (i = !1, a(), i)) throw new Error("The graph contains a negative weight cycle");
|
|
276
276
|
return o;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function zr(e) {
|
|
279
279
|
let t = {}, n = [], r;
|
|
280
280
|
function o(i) {
|
|
281
281
|
i in t || (t[i] = !0, r.push(i), e.successors(i).forEach(o), e.predecessors(i).forEach(o));
|
|
@@ -284,7 +284,7 @@ function _r(e) {
|
|
|
284
284
|
r = [], o(i), r.length && n.push(r);
|
|
285
285
|
}), n;
|
|
286
286
|
}
|
|
287
|
-
var
|
|
287
|
+
var nn = class {
|
|
288
288
|
constructor() {
|
|
289
289
|
this._arr = [], this._keyIndices = {};
|
|
290
290
|
}
|
|
@@ -337,18 +337,18 @@ var Zt = class {
|
|
|
337
337
|
let n = this._arr, r = this._keyIndices, o = n[e], i = n[t];
|
|
338
338
|
n[e] = i, n[t] = o, r[i.key] = e, r[o.key] = t;
|
|
339
339
|
}
|
|
340
|
-
},
|
|
340
|
+
}, Fr = () => 1;
|
|
341
341
|
function Se(e, t, n, r) {
|
|
342
342
|
let o = function(i) {
|
|
343
343
|
return e.outEdges(i);
|
|
344
344
|
};
|
|
345
|
-
return
|
|
345
|
+
return Lr(e, String(t), n || Fr, r || o);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
let o = {}, i = new
|
|
349
|
-
let c = a.v !== s ? a.v : a.w,
|
|
347
|
+
function Lr(e, t, n, r) {
|
|
348
|
+
let o = {}, i = new nn(), s, l, d = function(a) {
|
|
349
|
+
let c = a.v !== s ? a.v : a.w, f = o[c], h = n(a), g = l.distance + h;
|
|
350
350
|
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + a + " Weight: " + h);
|
|
351
|
-
g <
|
|
351
|
+
g < f.distance && (f.distance = g, f.predecessor = s, i.decrease(c, g));
|
|
352
352
|
};
|
|
353
353
|
for (e.nodes().forEach(function(a) {
|
|
354
354
|
let c = a === t ? 0 : Number.POSITIVE_INFINITY;
|
|
@@ -356,12 +356,12 @@ function Sr(e, t, n, r) {
|
|
|
356
356
|
}); i.size() > 0 && (s = i.removeMin(), l = o[s], l.distance !== Number.POSITIVE_INFINITY); ) r(s).forEach(d);
|
|
357
357
|
return o;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Ar(e, t, n) {
|
|
360
360
|
return e.nodes().reduce(function(r, o) {
|
|
361
361
|
return r[o] = Se(e, o, t, n), r;
|
|
362
362
|
}, {});
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function rn(e) {
|
|
365
365
|
let t = 0, n = [], r = {}, o = [];
|
|
366
366
|
function i(s) {
|
|
367
367
|
let l = r[s] = { onStack: !0, lowlink: t, index: t++ };
|
|
@@ -379,18 +379,18 @@ function Qt(e) {
|
|
|
379
379
|
s in r || i(s);
|
|
380
380
|
}), o;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
return
|
|
382
|
+
function Rr(e) {
|
|
383
|
+
return rn(e).filter(function(t) {
|
|
384
384
|
return t.length > 1 || t.length === 1 && e.hasEdge(t[0], t[0]);
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
-
var
|
|
388
|
-
function
|
|
389
|
-
return
|
|
387
|
+
var Dr = () => 1;
|
|
388
|
+
function Pr(e, t, n) {
|
|
389
|
+
return Br(e, t || Dr, n || function(r) {
|
|
390
390
|
return e.outEdges(r);
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function Br(e, t, n) {
|
|
394
394
|
let r = {}, o = e.nodes();
|
|
395
395
|
return o.forEach(function(i) {
|
|
396
396
|
r[i] = {}, r[i][i] = { distance: 0, predecessor: "" }, o.forEach(function(s) {
|
|
@@ -404,8 +404,8 @@ function jr(e, t, n) {
|
|
|
404
404
|
o.forEach(function(l) {
|
|
405
405
|
let d = r[l];
|
|
406
406
|
o.forEach(function(a) {
|
|
407
|
-
let c = d[i],
|
|
408
|
-
g < h.distance && (h.distance = g, h.predecessor =
|
|
407
|
+
let c = d[i], f = s[a], h = d[a], g = c.distance + f.distance;
|
|
408
|
+
g < h.distance && (h.distance = g, h.predecessor = f.predecessor);
|
|
409
409
|
});
|
|
410
410
|
});
|
|
411
411
|
}), r;
|
|
@@ -415,7 +415,7 @@ var Ce = class extends Error {
|
|
|
415
415
|
super(...e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
418
|
-
function
|
|
418
|
+
function on(e) {
|
|
419
419
|
let t = {}, n = {}, r = [];
|
|
420
420
|
function o(i) {
|
|
421
421
|
if (i in n) throw new Ce();
|
|
@@ -424,16 +424,16 @@ function en(e) {
|
|
|
424
424
|
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new Ce();
|
|
425
425
|
return r;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Wr(e) {
|
|
428
428
|
try {
|
|
429
|
-
|
|
429
|
+
on(e);
|
|
430
430
|
} catch (t) {
|
|
431
431
|
if (t instanceof Ce) return !1;
|
|
432
432
|
throw t;
|
|
433
433
|
}
|
|
434
434
|
return !0;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function Gr(e, t, n, r, o) {
|
|
437
437
|
Array.isArray(t) || (t = [t]);
|
|
438
438
|
let i = (l) => {
|
|
439
439
|
var d;
|
|
@@ -441,32 +441,32 @@ function zr(e, t, n, r, o) {
|
|
|
441
441
|
}, s = {};
|
|
442
442
|
return t.forEach(function(l) {
|
|
443
443
|
if (!e.hasNode(l)) throw new Error("Graph does not have node: " + l);
|
|
444
|
-
o =
|
|
444
|
+
o = sn(e, l, n === "post", s, i, r, o);
|
|
445
445
|
}), o;
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function sn(e, t, n, r, o, i, s) {
|
|
448
448
|
return t in r || (r[t] = !0, n || (s = i(s, t)), o(t).forEach(function(l) {
|
|
449
|
-
s =
|
|
449
|
+
s = sn(e, l, n, r, o, i, s);
|
|
450
450
|
}), n && (s = i(s, t))), s;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
return
|
|
452
|
+
function ln(e, t, n) {
|
|
453
|
+
return Gr(e, t, n, function(r, o) {
|
|
454
454
|
return r.push(o), r;
|
|
455
455
|
}, []);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
458
|
-
return
|
|
457
|
+
function $r(e, t) {
|
|
458
|
+
return ln(e, t, "post");
|
|
459
459
|
}
|
|
460
|
-
function
|
|
461
|
-
return
|
|
460
|
+
function Yr(e, t) {
|
|
461
|
+
return ln(e, t, "pre");
|
|
462
462
|
}
|
|
463
|
-
function
|
|
464
|
-
let n = new
|
|
463
|
+
function Kr(e, t) {
|
|
464
|
+
let n = new U(), r = {}, o = new nn(), i;
|
|
465
465
|
function s(d) {
|
|
466
466
|
let a = d.v === i ? d.w : d.v, c = o.priority(a);
|
|
467
467
|
if (c !== void 0) {
|
|
468
|
-
let
|
|
469
|
-
|
|
468
|
+
let f = t(d);
|
|
469
|
+
f < c && (r[a] = i, o.decrease(a, f));
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
if (e.nodeCount() === 0) return n;
|
|
@@ -484,59 +484,59 @@ function Dr(e, t) {
|
|
|
484
484
|
}
|
|
485
485
|
return n;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
return
|
|
487
|
+
function Ur(e, t, n, r) {
|
|
488
|
+
return Hr(e, t, n, r ?? ((o) => {
|
|
489
489
|
let i = e.outEdges(o);
|
|
490
490
|
return i ?? [];
|
|
491
491
|
}));
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Hr(e, t, n, r) {
|
|
494
494
|
if (n === void 0) return Se(e, t, n, r);
|
|
495
495
|
let o = !1, i = e.nodes();
|
|
496
496
|
for (let s = 0; s < i.length; s++) {
|
|
497
497
|
let l = r(i[s]);
|
|
498
498
|
for (let d = 0; d < l.length; d++) {
|
|
499
|
-
let a = l[d], c = a.v === i[s] ? a.v : a.w,
|
|
500
|
-
n({ v: c, w:
|
|
499
|
+
let a = l[d], c = a.v === i[s] ? a.v : a.w, f = c === a.v ? a.w : a.v;
|
|
500
|
+
n({ v: c, w: f }) < 0 && (o = !0);
|
|
501
501
|
}
|
|
502
|
-
if (o) return
|
|
502
|
+
if (o) return tn(e, t, n, r);
|
|
503
503
|
}
|
|
504
504
|
return Se(e, t, n, r);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function ue(e, t, n, r) {
|
|
507
507
|
let o = r;
|
|
508
|
-
for (; e.hasNode(o); ) o =
|
|
508
|
+
for (; e.hasNode(o); ) o = Qe(r);
|
|
509
509
|
return n.dummy = t, e.setNode(o, n), o;
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
let t = new
|
|
511
|
+
function Vr(e) {
|
|
512
|
+
let t = new U().setGraph(e.graph());
|
|
513
513
|
return e.nodes().forEach((n) => t.setNode(n, e.node(n))), e.edges().forEach((n) => {
|
|
514
514
|
let r = t.edge(n.v, n.w) || { weight: 0, minlen: 1 }, o = e.edge(n);
|
|
515
515
|
t.setEdge(n.v, n.w, { weight: r.weight + o.weight, minlen: Math.max(r.minlen, o.minlen) });
|
|
516
516
|
}), t;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
let t = new
|
|
518
|
+
function an(e) {
|
|
519
|
+
let t = new U({ multigraph: e.isMultigraph() }).setGraph(e.graph());
|
|
520
520
|
return e.nodes().forEach((n) => {
|
|
521
521
|
e.children(n).length || t.setNode(n, e.node(n));
|
|
522
522
|
}), e.edges().forEach((n) => {
|
|
523
523
|
t.setEdge(n, e.edge(n));
|
|
524
524
|
}), t;
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function It(e, t) {
|
|
527
527
|
let n = e.x, r = e.y, o = t.x - n, i = t.y - r, s = e.width / 2, l = e.height / 2;
|
|
528
528
|
if (!o && !i) throw new Error("Not possible to find intersection inside of the rectangle");
|
|
529
529
|
let d, a;
|
|
530
530
|
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 };
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
let t =
|
|
532
|
+
function we(e) {
|
|
533
|
+
let t = ye(cn(e) + 1).map(() => []);
|
|
534
534
|
return e.nodes().forEach((n) => {
|
|
535
535
|
let r = e.node(n), o = r.rank;
|
|
536
536
|
o !== void 0 && (t[o] || (t[o] = []), t[o][r.order] = n);
|
|
537
537
|
}), t;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function qr(e) {
|
|
540
540
|
let t = e.nodes().map((r) => {
|
|
541
541
|
let o = e.node(r).rank;
|
|
542
542
|
return o === void 0 ? Number.MAX_VALUE : o;
|
|
@@ -546,7 +546,7 @@ function Wr(e) {
|
|
|
546
546
|
Object.hasOwn(o, "rank") && (o.rank -= n);
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function Xr(e) {
|
|
550
550
|
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n = X(Math.min, t), r = [];
|
|
551
551
|
e.nodes().forEach((s) => {
|
|
552
552
|
let l = e.node(s).rank - n;
|
|
@@ -557,11 +557,11 @@ function Gr(e) {
|
|
|
557
557
|
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((d) => e.node(d).rank += o);
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function Ot(e, t, n, r) {
|
|
561
561
|
let o = { width: 0, height: 0 };
|
|
562
|
-
return arguments.length >= 4 && (o.rank = n, o.order = r),
|
|
562
|
+
return arguments.length >= 4 && (o.rank = n, o.order = r), ue(e, "border", o, t);
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function Jr(e, t = dn) {
|
|
565
565
|
let n = [];
|
|
566
566
|
for (let r = 0; r < e.length; r += t) {
|
|
567
567
|
let o = e.slice(r, r + t);
|
|
@@ -569,27 +569,27 @@ function $r(e, t = on) {
|
|
|
569
569
|
}
|
|
570
570
|
return n;
|
|
571
571
|
}
|
|
572
|
-
var
|
|
572
|
+
var dn = 65535;
|
|
573
573
|
function X(e, t) {
|
|
574
|
-
if (t.length >
|
|
575
|
-
let n =
|
|
574
|
+
if (t.length > dn) {
|
|
575
|
+
let n = Jr(t);
|
|
576
576
|
return e(...n.map((r) => e(...r)));
|
|
577
577
|
} else return e(...t);
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function cn(e) {
|
|
580
580
|
let t = e.nodes().map((n) => {
|
|
581
581
|
let r = e.node(n).rank;
|
|
582
582
|
return r === void 0 ? Number.MIN_VALUE : r;
|
|
583
583
|
});
|
|
584
584
|
return X(Math.max, t);
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function Zr(e, t) {
|
|
587
587
|
let n = { lhs: [], rhs: [] };
|
|
588
588
|
return e.forEach((r) => {
|
|
589
589
|
t(r) ? n.lhs.push(r) : n.rhs.push(r);
|
|
590
590
|
}), n;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function fn(e, t) {
|
|
593
593
|
let n = Date.now();
|
|
594
594
|
try {
|
|
595
595
|
return t();
|
|
@@ -597,15 +597,15 @@ function ln(e, t) {
|
|
|
597
597
|
console.log(e + " time: " + (Date.now() - n) + "ms");
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function un(e, t) {
|
|
601
601
|
return t();
|
|
602
602
|
}
|
|
603
|
-
var
|
|
604
|
-
function
|
|
605
|
-
let t = ++
|
|
603
|
+
var Qr = 0;
|
|
604
|
+
function Qe(e) {
|
|
605
|
+
let t = ++Qr;
|
|
606
606
|
return e + ("" + t);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function ye(e, t, n = 1) {
|
|
609
609
|
t == null && (t = e, e = 0);
|
|
610
610
|
let r = (i) => i < t;
|
|
611
611
|
n < 0 && (r = (i) => t < i);
|
|
@@ -622,100 +622,100 @@ function Oe(e, t) {
|
|
|
622
622
|
let n;
|
|
623
623
|
return typeof t == "string" ? n = (r) => r[t] : n = t, Object.entries(e).reduce((r, [o, i]) => (r[o] = n(i, o), r), {});
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function eo(e, t) {
|
|
626
626
|
return e.reduce((n, r, o) => (n[r] = t[o], n), {});
|
|
627
627
|
}
|
|
628
|
-
var
|
|
628
|
+
var je = "\0", to = "3.0.0", no = class {
|
|
629
629
|
constructor() {
|
|
630
|
-
|
|
630
|
+
xr(this, "_sentinel");
|
|
631
631
|
let e = {};
|
|
632
632
|
e._next = e._prev = e, this._sentinel = e;
|
|
633
633
|
}
|
|
634
634
|
dequeue() {
|
|
635
635
|
let e = this._sentinel, t = e._prev;
|
|
636
|
-
if (t !== e) return
|
|
636
|
+
if (t !== e) return jt(t), t;
|
|
637
637
|
}
|
|
638
638
|
enqueue(e) {
|
|
639
639
|
let t = this._sentinel;
|
|
640
|
-
e._prev && e._next &&
|
|
640
|
+
e._prev && e._next && jt(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
|
|
641
641
|
}
|
|
642
642
|
toString() {
|
|
643
643
|
let e = [], t = this._sentinel, n = t._prev;
|
|
644
|
-
for (; n !== t; ) e.push(JSON.stringify(n,
|
|
644
|
+
for (; n !== t; ) e.push(JSON.stringify(n, ro)), n = n._prev;
|
|
645
645
|
return "[" + e.join(", ") + "]";
|
|
646
646
|
}
|
|
647
647
|
};
|
|
648
|
-
function
|
|
648
|
+
function jt(e) {
|
|
649
649
|
e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function ro(e, t) {
|
|
652
652
|
if (e !== "_next" && e !== "_prev") return t;
|
|
653
653
|
}
|
|
654
|
-
var
|
|
655
|
-
function
|
|
654
|
+
var oo = no, io = () => 1;
|
|
655
|
+
function so(e, t) {
|
|
656
656
|
if (e.nodeCount() <= 1) return [];
|
|
657
|
-
let n =
|
|
658
|
-
return
|
|
657
|
+
let n = ao(e, t || io);
|
|
658
|
+
return lo(n.graph, n.buckets, n.zeroIdx).flatMap((r) => e.outEdges(r.v, r.w) || []);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function lo(e, t, n) {
|
|
661
661
|
var r;
|
|
662
662
|
let o = [], i = t[t.length - 1], s = t[0], l;
|
|
663
663
|
for (; e.nodeCount(); ) {
|
|
664
|
-
for (; l = s.dequeue(); )
|
|
665
|
-
for (; l = i.dequeue(); )
|
|
664
|
+
for (; l = s.dequeue(); ) Pe(e, t, n, l);
|
|
665
|
+
for (; l = i.dequeue(); ) Pe(e, t, n, l);
|
|
666
666
|
if (e.nodeCount()) {
|
|
667
667
|
for (let d = t.length - 2; d > 0; --d) if (l = (r = t[d]) == null ? void 0 : r.dequeue(), l) {
|
|
668
|
-
o = o.concat(
|
|
668
|
+
o = o.concat(Pe(e, t, n, l, !0) || []);
|
|
669
669
|
break;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
return o;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Pe(e, t, n, r, o) {
|
|
676
676
|
let i = [], s = o ? i : void 0;
|
|
677
677
|
return (e.inEdges(r.v) || []).forEach((l) => {
|
|
678
678
|
let d = e.edge(l), a = e.node(l.v);
|
|
679
|
-
o && i.push({ v: l.v, w: l.w }), a.out -= d,
|
|
679
|
+
o && i.push({ v: l.v, w: l.w }), a.out -= d, He(t, n, a);
|
|
680
680
|
}), (e.outEdges(r.v) || []).forEach((l) => {
|
|
681
681
|
let d = e.edge(l), a = l.w, c = e.node(a);
|
|
682
|
-
c.in -= d,
|
|
682
|
+
c.in -= d, He(t, n, c);
|
|
683
683
|
}), e.removeNode(r.v), s;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
686
|
-
let n = new
|
|
685
|
+
function ao(e, t) {
|
|
686
|
+
let n = new U(), r = 0, o = 0;
|
|
687
687
|
e.nodes().forEach((l) => {
|
|
688
688
|
n.setNode(l, { v: l, in: 0, out: 0 });
|
|
689
689
|
}), e.edges().forEach((l) => {
|
|
690
690
|
let d = n.edge(l.v, l.w) || 0, a = t(l), c = d + a;
|
|
691
691
|
n.setEdge(l.v, l.w, c);
|
|
692
|
-
let
|
|
693
|
-
o = Math.max(o,
|
|
692
|
+
let f = n.node(l.v), h = n.node(l.w);
|
|
693
|
+
o = Math.max(o, f.out += a), r = Math.max(r, h.in += a);
|
|
694
694
|
});
|
|
695
|
-
let i =
|
|
695
|
+
let i = co(o + r + 3).map(() => new oo()), s = r + 1;
|
|
696
696
|
return n.nodes().forEach((l) => {
|
|
697
|
-
|
|
697
|
+
He(i, s, n.node(l));
|
|
698
698
|
}), { graph: n, buckets: i, zeroIdx: s };
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function He(e, t, n) {
|
|
701
701
|
var r, o, i;
|
|
702
702
|
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);
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function co(e) {
|
|
705
705
|
let t = [];
|
|
706
706
|
for (let n = 0; n < e; n++) t.push(n);
|
|
707
707
|
return t;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
(e.graph().acyclicer === "greedy" ?
|
|
709
|
+
function fo(e) {
|
|
710
|
+
(e.graph().acyclicer === "greedy" ? so(e, t(e)) : uo(e)).forEach((n) => {
|
|
711
711
|
let r = e.edge(n);
|
|
712
|
-
e.removeEdge(n), r.forwardName = n.name, r.reversed = !0, e.setEdge(n.w, n.v, r,
|
|
712
|
+
e.removeEdge(n), r.forwardName = n.name, r.reversed = !0, e.setEdge(n.w, n.v, r, Qe("rev"));
|
|
713
713
|
});
|
|
714
714
|
function t(n) {
|
|
715
715
|
return (r) => n.edge(r).weight;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function uo(e) {
|
|
719
719
|
let t = [], n = {}, r = {};
|
|
720
720
|
function o(i) {
|
|
721
721
|
Object.hasOwn(r, i) || (r[i] = !0, n[i] = !0, e.outEdges(i).forEach((s) => {
|
|
@@ -724,7 +724,7 @@ function ro(e) {
|
|
|
724
724
|
}
|
|
725
725
|
return e.nodes().forEach(o), t;
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function ho(e) {
|
|
728
728
|
e.edges().forEach((t) => {
|
|
729
729
|
let n = e.edge(t);
|
|
730
730
|
if (n.reversed) {
|
|
@@ -734,24 +734,24 @@ function oo(e) {
|
|
|
734
734
|
}
|
|
735
735
|
});
|
|
736
736
|
}
|
|
737
|
-
function
|
|
738
|
-
e.graph().dummyChains = [], e.edges().forEach((t) =>
|
|
737
|
+
function go(e) {
|
|
738
|
+
e.graph().dummyChains = [], e.edges().forEach((t) => po(e, t));
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function po(e, t) {
|
|
741
741
|
let n = t.v, r = e.node(n).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t), d = l.labelRank;
|
|
742
742
|
if (i === r + 1) return;
|
|
743
743
|
e.removeEdge(t);
|
|
744
|
-
let a, c,
|
|
745
|
-
for (
|
|
744
|
+
let a, c, f;
|
|
745
|
+
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, a = ue(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;
|
|
746
746
|
e.setEdge(n, o, { weight: l.weight }, s);
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function bo(e) {
|
|
749
749
|
e.graph().dummyChains.forEach((t) => {
|
|
750
750
|
let n = e.node(t), r = n.edgeLabel, o;
|
|
751
751
|
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);
|
|
752
752
|
});
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function et(e) {
|
|
755
755
|
let t = {};
|
|
756
756
|
function n(r) {
|
|
757
757
|
let o = e.node(r);
|
|
@@ -762,146 +762,146 @@ function Ze(e) {
|
|
|
762
762
|
}
|
|
763
763
|
e.sources().forEach(n);
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function fe(e, t) {
|
|
766
766
|
return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
|
|
767
767
|
}
|
|
768
|
-
var
|
|
769
|
-
function
|
|
770
|
-
let t = new
|
|
768
|
+
var hn = yo;
|
|
769
|
+
function yo(e) {
|
|
770
|
+
let t = new U({ directed: !1 }), n = e.nodes();
|
|
771
771
|
if (n.length === 0) throw new Error("Graph must have at least one node");
|
|
772
772
|
let r = n[0], o = e.nodeCount();
|
|
773
773
|
t.setNode(r, {});
|
|
774
774
|
let i, s;
|
|
775
|
-
for (;
|
|
775
|
+
for (; mo(t, e) < o && (i = wo(t, e), !!i); ) s = t.hasNode(i.v) ? fe(e, i) : -fe(e, i), vo(t, e, s);
|
|
776
776
|
return t;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function mo(e, t) {
|
|
779
779
|
function n(r) {
|
|
780
780
|
let o = t.nodeEdges(r);
|
|
781
781
|
o && o.forEach((i) => {
|
|
782
782
|
let s = i.v, l = r === s ? i.w : s;
|
|
783
|
-
!e.hasNode(l) && !
|
|
783
|
+
!e.hasNode(l) && !fe(t, i) && (e.setNode(l, {}), e.setEdge(r, l, {}), n(l));
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
786
|
return e.nodes().forEach(n), e.nodeCount();
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function wo(e, t) {
|
|
789
789
|
return t.edges().reduce((n, r) => {
|
|
790
790
|
let o = Number.POSITIVE_INFINITY;
|
|
791
|
-
return e.hasNode(r.v) !== e.hasNode(r.w) && (o =
|
|
791
|
+
return e.hasNode(r.v) !== e.hasNode(r.w) && (o = fe(t, r)), o < n[0] ? [o, r] : n;
|
|
792
792
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function vo(e, t, n) {
|
|
795
795
|
e.nodes().forEach((r) => t.node(r).rank += n);
|
|
796
796
|
}
|
|
797
|
-
var { preorder:
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
function
|
|
805
|
-
e =
|
|
806
|
-
let t =
|
|
807
|
-
|
|
797
|
+
var { preorder: Eo, postorder: ko } = Ze, xo = ae;
|
|
798
|
+
ae.initLowLimValues = nt;
|
|
799
|
+
ae.initCutValues = tt;
|
|
800
|
+
ae.calcCutValue = gn;
|
|
801
|
+
ae.leaveEdge = bn;
|
|
802
|
+
ae.enterEdge = yn;
|
|
803
|
+
ae.exchangeEdges = mn;
|
|
804
|
+
function ae(e) {
|
|
805
|
+
e = Vr(e), et(e);
|
|
806
|
+
let t = hn(e);
|
|
807
|
+
nt(t), tt(t, e);
|
|
808
808
|
let n, r;
|
|
809
|
-
for (; n =
|
|
809
|
+
for (; n = bn(t); ) r = yn(t, e, n), mn(t, e, n, r);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
let n =
|
|
813
|
-
n = n.slice(0, n.length - 1), n.forEach((r) =>
|
|
811
|
+
function tt(e, t) {
|
|
812
|
+
let n = ko(e, e.nodes());
|
|
813
|
+
n = n.slice(0, n.length - 1), n.forEach((r) => To(e, t, r));
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function To(e, t, n) {
|
|
816
816
|
let r = e.node(n).parent, o = e.edge(n, r);
|
|
817
|
-
o.cutvalue =
|
|
817
|
+
o.cutvalue = gn(e, t, n);
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function gn(e, t, n) {
|
|
820
820
|
let r = e.node(n).parent, o = !0, i = t.edge(n, r), s = 0;
|
|
821
821
|
i || (o = !1, i = t.edge(r, n)), s = i.weight;
|
|
822
822
|
let l = t.nodeEdges(n);
|
|
823
823
|
return l && l.forEach((d) => {
|
|
824
824
|
let a = d.v === n, c = a ? d.w : d.v;
|
|
825
825
|
if (c !== r) {
|
|
826
|
-
let
|
|
827
|
-
if (s +=
|
|
826
|
+
let f = a === o, h = t.edge(d).weight;
|
|
827
|
+
if (s += f ? h : -h, No(e, n, c)) {
|
|
828
828
|
let g = e.edge(n, c).cutvalue;
|
|
829
|
-
s +=
|
|
829
|
+
s += f ? -g : g;
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
832
|
}), s;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
arguments.length < 2 && (t = e.nodes()[0]),
|
|
834
|
+
function nt(e, t) {
|
|
835
|
+
arguments.length < 2 && (t = e.nodes()[0]), pn(e, {}, 1, t);
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function pn(e, t, n, r, o) {
|
|
838
838
|
let i = n, s = e.node(r);
|
|
839
839
|
t[r] = !0;
|
|
840
840
|
let l = e.neighbors(r);
|
|
841
841
|
return l && l.forEach((d) => {
|
|
842
|
-
Object.hasOwn(t, d) || (n =
|
|
842
|
+
Object.hasOwn(t, d) || (n = pn(e, t, n, d, r));
|
|
843
843
|
}), s.low = i, s.lim = n++, o ? s.parent = o : delete s.parent, n;
|
|
844
844
|
}
|
|
845
|
-
function
|
|
845
|
+
function bn(e) {
|
|
846
846
|
return e.edges().find((t) => e.edge(t).cutvalue < 0);
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function yn(e, t, n) {
|
|
849
849
|
let r = n.v, o = n.w;
|
|
850
850
|
t.hasEdge(r, o) || (r = n.w, o = n.v);
|
|
851
851
|
let i = e.node(r), s = e.node(o), l = i, d = !1;
|
|
852
|
-
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d ===
|
|
852
|
+
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d === Mt(e, e.node(a.v), l) && d !== Mt(e, e.node(a.w), l)).reduce((a, c) => fe(t, c) < fe(t, a) ? c : a);
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function mn(e, t, n, r) {
|
|
855
855
|
let o = n.v, i = n.w;
|
|
856
|
-
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}),
|
|
856
|
+
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}), nt(e), tt(e, t), _o(e, t);
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function _o(e, t) {
|
|
859
859
|
let n = e.nodes().find((o) => !e.node(o).parent);
|
|
860
860
|
if (!n) return;
|
|
861
|
-
let r =
|
|
861
|
+
let r = Eo(e, [n]);
|
|
862
862
|
r = r.slice(1), r.forEach((o) => {
|
|
863
863
|
let i = e.node(o).parent, s = t.edge(o, i), l = !1;
|
|
864
864
|
s || (s = t.edge(i, o), l = !0), t.node(o).rank = t.node(i).rank + (l ? s.minlen : -s.minlen);
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function No(e, t, n) {
|
|
868
868
|
return e.hasEdge(t, n);
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Mt(e, t, n) {
|
|
871
871
|
return n.low <= t.lim && t.lim <= n.lim;
|
|
872
872
|
}
|
|
873
|
-
var
|
|
874
|
-
function
|
|
873
|
+
var So = Co;
|
|
874
|
+
function Co(e) {
|
|
875
875
|
let t = e.graph().ranker;
|
|
876
876
|
if (typeof t == "function") return t(e);
|
|
877
877
|
switch (t) {
|
|
878
878
|
case "network-simplex":
|
|
879
|
-
|
|
879
|
+
zt(e);
|
|
880
880
|
break;
|
|
881
881
|
case "tight-tree":
|
|
882
|
-
|
|
882
|
+
Oo(e);
|
|
883
883
|
break;
|
|
884
884
|
case "longest-path":
|
|
885
|
-
|
|
885
|
+
Io(e);
|
|
886
886
|
break;
|
|
887
887
|
case "none":
|
|
888
888
|
break;
|
|
889
889
|
default:
|
|
890
|
-
|
|
890
|
+
zt(e);
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
|
-
var
|
|
894
|
-
function
|
|
895
|
-
|
|
893
|
+
var Io = et;
|
|
894
|
+
function Oo(e) {
|
|
895
|
+
et(e), hn(e);
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
|
|
897
|
+
function zt(e) {
|
|
898
|
+
xo(e);
|
|
899
899
|
}
|
|
900
|
-
var
|
|
901
|
-
function
|
|
902
|
-
let t =
|
|
900
|
+
var jo = Mo;
|
|
901
|
+
function Mo(e) {
|
|
902
|
+
let t = Fo(e);
|
|
903
903
|
e.graph().dummyChains.forEach((n) => {
|
|
904
|
-
let r = e.node(n), o = r.edgeObj, i =
|
|
904
|
+
let r = e.node(n), o = r.edgeObj, i = zo(e, t, o.v, o.w), s = i.path, l = i.lca, d = 0, a = s[d], c = !0;
|
|
905
905
|
for (; n !== o.w; ) {
|
|
906
906
|
if (r = e.node(n), c) {
|
|
907
907
|
for (; (a = s[d]) !== l && e.node(a).maxRank < r.rank; ) d++;
|
|
@@ -915,7 +915,7 @@ function To(e) {
|
|
|
915
915
|
}
|
|
916
916
|
});
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function zo(e, t, n, r) {
|
|
919
919
|
let o = [], i = [], s = Math.min(t[n].low, t[r].low), l = Math.max(t[n].lim, t[r].lim), d;
|
|
920
920
|
d = n;
|
|
921
921
|
do
|
|
@@ -925,107 +925,107 @@ function _o(e, t, n, r) {
|
|
|
925
925
|
for (; (c = e.parent(c)) !== a; ) i.push(c);
|
|
926
926
|
return { path: o.concat(i.reverse()), lca: a };
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function Fo(e) {
|
|
929
929
|
let t = {}, n = 0;
|
|
930
930
|
function r(o) {
|
|
931
931
|
let i = n;
|
|
932
932
|
e.children(o).forEach(r), t[o] = { low: i, lim: n++ };
|
|
933
933
|
}
|
|
934
|
-
return e.children(
|
|
934
|
+
return e.children(je).forEach(r), t;
|
|
935
935
|
}
|
|
936
|
-
function
|
|
937
|
-
let t =
|
|
936
|
+
function Lo(e) {
|
|
937
|
+
let t = ue(e, "root", {}, "_root"), n = Ao(e), r = Object.values(n), o = X(Math.max, r) - 1, i = 2 * o + 1;
|
|
938
938
|
e.graph().nestingRoot = t, e.edges().forEach((l) => e.edge(l).minlen *= i);
|
|
939
|
-
let s =
|
|
940
|
-
e.children(
|
|
939
|
+
let s = Ro(e) + 1;
|
|
940
|
+
e.children(je).forEach((l) => wn(e, t, i, s, o, n, l)), e.graph().nodeRankFactor = i;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function wn(e, t, n, r, o, i, s) {
|
|
943
943
|
var l;
|
|
944
944
|
let d = e.children(s);
|
|
945
945
|
if (!d.length) {
|
|
946
946
|
s !== t && e.setEdge(t, s, { weight: 0, minlen: n });
|
|
947
947
|
return;
|
|
948
948
|
}
|
|
949
|
-
let a =
|
|
950
|
-
e.setParent(a, s),
|
|
949
|
+
let a = Ot(e, "_bt"), c = Ot(e, "_bb"), f = e.node(s);
|
|
950
|
+
e.setParent(a, s), f.borderTop = a, e.setParent(c, s), f.borderBottom = c, d.forEach((h) => {
|
|
951
951
|
var g;
|
|
952
|
-
|
|
953
|
-
let
|
|
954
|
-
e.setEdge(a, E, { weight: x, minlen: N, nestingEdge: !0 }), e.setEdge(
|
|
952
|
+
wn(e, t, n, r, o, i, h);
|
|
953
|
+
let p = e.node(h), E = p.borderTop ? p.borderTop : h, b = p.borderBottom ? p.borderBottom : h, x = p.borderTop ? r : 2 * r, N = E !== b ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
954
|
+
e.setEdge(a, E, { weight: x, minlen: N, nestingEdge: !0 }), e.setEdge(b, c, { weight: x, minlen: N, nestingEdge: !0 });
|
|
955
955
|
}), e.parent(s) || e.setEdge(t, a, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function Ao(e) {
|
|
958
958
|
let t = {};
|
|
959
959
|
function n(r, o) {
|
|
960
960
|
let i = e.children(r);
|
|
961
961
|
i && i.length && i.forEach((s) => n(s, o + 1)), t[r] = o;
|
|
962
962
|
}
|
|
963
|
-
return e.children(
|
|
963
|
+
return e.children(je).forEach((r) => n(r, 1)), t;
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function Ro(e) {
|
|
966
966
|
return e.edges().reduce((t, n) => t + e.edge(n).weight, 0);
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function Do(e) {
|
|
969
969
|
let t = e.graph();
|
|
970
970
|
e.removeNode(t.nestingRoot), delete t.nestingRoot, e.edges().forEach((n) => {
|
|
971
971
|
e.edge(n).nestingEdge && e.removeEdge(n);
|
|
972
972
|
});
|
|
973
973
|
}
|
|
974
|
-
var
|
|
975
|
-
function
|
|
974
|
+
var Po = Bo;
|
|
975
|
+
function Bo(e) {
|
|
976
976
|
function t(n) {
|
|
977
977
|
let r = e.children(n), o = e.node(n);
|
|
978
978
|
if (r.length && r.forEach(t), Object.hasOwn(o, "minRank")) {
|
|
979
979
|
o.borderLeft = [], o.borderRight = [];
|
|
980
|
-
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i)
|
|
980
|
+
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i) Ft(e, "borderLeft", "_bl", n, o, i), Ft(e, "borderRight", "_br", n, o, i);
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
e.children(
|
|
983
|
+
e.children(je).forEach(t);
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d =
|
|
985
|
+
function Ft(e, t, n, r, o, i) {
|
|
986
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d = ue(e, "border", s, n);
|
|
987
987
|
o[t][i] = d, e.setParent(d, r), l && e.setEdge(l, d, { weight: 1 });
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function Wo(e) {
|
|
990
990
|
var t;
|
|
991
991
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
992
|
-
(n === "lr" || n === "rl") &&
|
|
992
|
+
(n === "lr" || n === "rl") && vn(e);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Go(e) {
|
|
995
995
|
var t;
|
|
996
996
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
997
|
-
(n === "bt" || n === "rl") &&
|
|
997
|
+
(n === "bt" || n === "rl") && $o(e), (n === "lr" || n === "rl") && (Yo(e), vn(e));
|
|
998
998
|
}
|
|
999
|
-
function
|
|
1000
|
-
e.nodes().forEach((t) =>
|
|
999
|
+
function vn(e) {
|
|
1000
|
+
e.nodes().forEach((t) => Lt(e.node(t))), e.edges().forEach((t) => Lt(e.edge(t)));
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function Lt(e) {
|
|
1003
1003
|
let t = e.width;
|
|
1004
1004
|
e.width = e.height, e.height = t;
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1007
|
-
e.nodes().forEach((t) =>
|
|
1006
|
+
function $o(e) {
|
|
1007
|
+
e.nodes().forEach((t) => Be(e.node(t))), e.edges().forEach((t) => {
|
|
1008
1008
|
var n;
|
|
1009
1009
|
let r = e.edge(t);
|
|
1010
|
-
(n = r.points) == null || n.forEach(
|
|
1010
|
+
(n = r.points) == null || n.forEach(Be), Object.hasOwn(r, "y") && Be(r);
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1013
|
+
function Be(e) {
|
|
1014
1014
|
e.y = -e.y;
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
e.nodes().forEach((t) =>
|
|
1016
|
+
function Yo(e) {
|
|
1017
|
+
e.nodes().forEach((t) => We(e.node(t))), e.edges().forEach((t) => {
|
|
1018
1018
|
var n;
|
|
1019
1019
|
let r = e.edge(t);
|
|
1020
|
-
(n = r.points) == null || n.forEach(
|
|
1020
|
+
(n = r.points) == null || n.forEach(We), Object.hasOwn(r, "x") && We(r);
|
|
1021
1021
|
});
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function We(e) {
|
|
1024
1024
|
let t = e.x;
|
|
1025
1025
|
e.x = e.y, e.y = t;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = X(Math.max, r), i =
|
|
1027
|
+
function Ko(e) {
|
|
1028
|
+
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = X(Math.max, r), i = ye(o + 1).map(() => []);
|
|
1029
1029
|
function s(l) {
|
|
1030
1030
|
if (t[l]) return;
|
|
1031
1031
|
t[l] = !0;
|
|
@@ -1036,15 +1036,15 @@ function Do(e) {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
return n.sort((l, d) => e.node(l).rank - e.node(d).rank).forEach(s), i;
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function Uo(e, t) {
|
|
1040
1040
|
let n = 0;
|
|
1041
|
-
for (let r = 1; r < t.length; ++r) n +=
|
|
1041
|
+
for (let r = 1; r < t.length; ++r) n += Ho(e, t[r - 1], t[r]);
|
|
1042
1042
|
return n;
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1045
|
-
let r =
|
|
1044
|
+
function Ho(e, t, n) {
|
|
1045
|
+
let r = eo(n, n.map((a, c) => c)), o = t.flatMap((a) => {
|
|
1046
1046
|
let c = e.outEdges(a);
|
|
1047
|
-
return c ? c.map((
|
|
1047
|
+
return c ? c.map((f) => ({ pos: r[f.w], weight: e.edge(f).weight })).sort((f, h) => f.pos - h.pos) : [];
|
|
1048
1048
|
}), i = 1;
|
|
1049
1049
|
for (; i < n.length; ) i <<= 1;
|
|
1050
1050
|
let s = 2 * i - 1;
|
|
@@ -1053,12 +1053,12 @@ function Po(e, t, n) {
|
|
|
1053
1053
|
return o.forEach((a) => {
|
|
1054
1054
|
let c = a.pos + i;
|
|
1055
1055
|
l[c] += a.weight;
|
|
1056
|
-
let
|
|
1057
|
-
for (; c > 0; ) c % 2 && (
|
|
1058
|
-
d += a.weight *
|
|
1056
|
+
let f = 0;
|
|
1057
|
+
for (; c > 0; ) c % 2 && (f += l[c + 1]), c = c - 1 >> 1, l[c] += a.weight;
|
|
1058
|
+
d += a.weight * f;
|
|
1059
1059
|
}), d;
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function Vo(e, t = []) {
|
|
1062
1062
|
return t.map((n) => {
|
|
1063
1063
|
let r = e.inEdges(n);
|
|
1064
1064
|
if (!r || !r.length) return { v: n };
|
|
@@ -1071,7 +1071,7 @@ function Bo(e, t = []) {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
});
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function qo(e, t) {
|
|
1075
1075
|
let n = {};
|
|
1076
1076
|
e.forEach((o, i) => {
|
|
1077
1077
|
let s = { indegree: 0, in: [], out: [], vs: [o.v], i };
|
|
@@ -1081,13 +1081,13 @@ function Wo(e, t) {
|
|
|
1081
1081
|
i !== void 0 && s !== void 0 && (s.indegree++, i.out.push(s));
|
|
1082
1082
|
});
|
|
1083
1083
|
let r = Object.values(n).filter((o) => !o.indegree);
|
|
1084
|
-
return
|
|
1084
|
+
return Xo(r);
|
|
1085
1085
|
}
|
|
1086
|
-
function
|
|
1086
|
+
function Xo(e) {
|
|
1087
1087
|
let t = [];
|
|
1088
1088
|
function n(o) {
|
|
1089
1089
|
return (i) => {
|
|
1090
|
-
i.merged || (i.barycenter === void 0 || o.barycenter === void 0 || i.barycenter >= o.barycenter) &&
|
|
1090
|
+
i.merged || (i.barycenter === void 0 || o.barycenter === void 0 || i.barycenter >= o.barycenter) && Jo(o, i);
|
|
1091
1091
|
};
|
|
1092
1092
|
}
|
|
1093
1093
|
function r(o) {
|
|
@@ -1101,78 +1101,78 @@ function Go(e) {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
return t.filter((o) => !o.merged).map((o) => Ie(o, ["vs", "i", "barycenter", "weight"]));
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function Jo(e, t) {
|
|
1105
1105
|
let n = 0, r = 0;
|
|
1106
1106
|
e.weight && (n += e.barycenter * e.weight, r += e.weight), t.weight && (n += t.barycenter * t.weight, r += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = n / r, e.weight = r, e.i = Math.min(t.i, e.i), t.merged = !0;
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1109
|
-
let n =
|
|
1110
|
-
r.sort(
|
|
1111
|
-
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d =
|
|
1108
|
+
function Zo(e, t) {
|
|
1109
|
+
let n = Zr(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;
|
|
1110
|
+
r.sort(Qo(!!t)), d = At(i, o, d), r.forEach((c) => {
|
|
1111
|
+
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d = At(i, o, d);
|
|
1112
1112
|
});
|
|
1113
1113
|
let a = { vs: i.flat(1) };
|
|
1114
1114
|
return l && (a.barycenter = s / l, a.weight = l), a;
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function At(e, t, n) {
|
|
1117
1117
|
let r;
|
|
1118
1118
|
for (; t.length && (r = t[t.length - 1]).i <= n; ) t.pop(), e.push(r.vs), n++;
|
|
1119
1119
|
return n;
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function Qo(e) {
|
|
1122
1122
|
return (t, n) => t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : e ? n.i - t.i : t.i - n.i;
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function En(e, t, n, r) {
|
|
1125
1125
|
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0, d = {};
|
|
1126
1126
|
s && (o = o.filter((h) => h !== s && h !== l));
|
|
1127
|
-
let a =
|
|
1127
|
+
let a = Vo(e, o);
|
|
1128
1128
|
a.forEach((h) => {
|
|
1129
1129
|
if (e.children(h.v).length) {
|
|
1130
|
-
let g =
|
|
1131
|
-
d[h.v] = g, Object.hasOwn(g, "barycenter") &&
|
|
1130
|
+
let g = En(e, h.v, n, r);
|
|
1131
|
+
d[h.v] = g, Object.hasOwn(g, "barycenter") && ti(h, g);
|
|
1132
1132
|
}
|
|
1133
1133
|
});
|
|
1134
|
-
let c =
|
|
1135
|
-
|
|
1136
|
-
let
|
|
1134
|
+
let c = qo(a, n);
|
|
1135
|
+
ei(c, d);
|
|
1136
|
+
let f = Zo(c, r);
|
|
1137
1137
|
if (s && l) {
|
|
1138
|
-
|
|
1138
|
+
f.vs = [s, f.vs, l].flat(1);
|
|
1139
1139
|
let h = e.predecessors(s);
|
|
1140
1140
|
if (h && h.length) {
|
|
1141
|
-
let g = e.node(h[0]),
|
|
1142
|
-
Object.hasOwn(
|
|
1141
|
+
let g = e.node(h[0]), p = e.predecessors(l), E = e.node(p[0]);
|
|
1142
|
+
Object.hasOwn(f, "barycenter") || (f.barycenter = 0, f.weight = 0), f.barycenter = (f.barycenter * f.weight + g.order + E.order) / (f.weight + 2), f.weight += 2;
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
1145
|
-
return
|
|
1145
|
+
return f;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function ei(e, t) {
|
|
1148
1148
|
e.forEach((n) => {
|
|
1149
1149
|
n.vs = n.vs.flatMap((r) => t[r] ? t[r].vs : r);
|
|
1150
1150
|
});
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function ti(e, t) {
|
|
1153
1153
|
e.barycenter !== void 0 ? (e.barycenter = (e.barycenter * e.weight + t.barycenter * t.weight) / (e.weight + t.weight), e.weight += t.weight) : (e.barycenter = t.barycenter, e.weight = t.weight);
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function ni(e, t, n, r) {
|
|
1156
1156
|
r || (r = e.nodes());
|
|
1157
|
-
let o =
|
|
1157
|
+
let o = ri(e), i = new U({ compound: !0 }).setGraph({ root: o }).setDefaultNodeLabel((s) => e.node(s));
|
|
1158
1158
|
return r.forEach((s) => {
|
|
1159
1159
|
let l = e.node(s), d = e.parent(s);
|
|
1160
1160
|
if (l.rank === t || l.minRank <= t && t <= l.maxRank) {
|
|
1161
1161
|
i.setNode(s), i.setParent(s, d || o);
|
|
1162
1162
|
let a = e[n](s);
|
|
1163
1163
|
a && a.forEach((c) => {
|
|
1164
|
-
let
|
|
1165
|
-
i.setEdge(
|
|
1164
|
+
let f = c.v === s ? c.w : c.v, h = i.edge(f, s), g = h !== void 0 ? h.weight : 0;
|
|
1165
|
+
i.setEdge(f, s, { weight: e.edge(c).weight + g });
|
|
1166
1166
|
}), Object.hasOwn(l, "minRank") && i.setNode(s, { borderLeft: l.borderLeft[t], borderRight: l.borderRight[t] });
|
|
1167
1167
|
}
|
|
1168
1168
|
}), i;
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function ri(e) {
|
|
1171
1171
|
let t;
|
|
1172
|
-
for (; e.hasNode(t =
|
|
1172
|
+
for (; e.hasNode(t = Qe("_root")); ) ;
|
|
1173
1173
|
return t;
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function oi(e, t, n) {
|
|
1176
1176
|
let r = {}, o;
|
|
1177
1177
|
n.forEach((i) => {
|
|
1178
1178
|
let s = e.parent(i), l, d;
|
|
@@ -1185,22 +1185,22 @@ function Xo(e, t, n) {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
});
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function kn(e, t = {}) {
|
|
1189
1189
|
if (typeof t.customOrder == "function") {
|
|
1190
|
-
t.customOrder(e,
|
|
1190
|
+
t.customOrder(e, kn);
|
|
1191
1191
|
return;
|
|
1192
1192
|
}
|
|
1193
|
-
let n =
|
|
1194
|
-
if (
|
|
1193
|
+
let n = cn(e), r = Rt(e, ye(1, n + 1), "inEdges"), o = Rt(e, ye(n - 1, -1, -1), "outEdges"), i = Ko(e);
|
|
1194
|
+
if (Dt(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1195
1195
|
let s = Number.POSITIVE_INFINITY, l, d = t.constraints || [];
|
|
1196
1196
|
for (let a = 0, c = 0; c < 4; ++a, ++c) {
|
|
1197
|
-
|
|
1198
|
-
let
|
|
1199
|
-
|
|
1197
|
+
ii(a % 2 ? r : o, a % 4 >= 2, d), i = we(e);
|
|
1198
|
+
let f = Uo(e, i);
|
|
1199
|
+
f < s ? (c = 0, l = Object.assign({}, i), s = f) : f === s && (l = structuredClone(i));
|
|
1200
1200
|
}
|
|
1201
|
-
|
|
1201
|
+
Dt(e, l);
|
|
1202
1202
|
}
|
|
1203
|
-
function
|
|
1203
|
+
function Rt(e, t, n) {
|
|
1204
1204
|
let r = /* @__PURE__ */ new Map(), o = (i, s) => {
|
|
1205
1205
|
r.has(i) || r.set(i, []), r.get(i).push(s);
|
|
1206
1206
|
};
|
|
@@ -1209,61 +1209,61 @@ function Ft(e, t, n) {
|
|
|
1209
1209
|
if (typeof s.rank == "number" && o(s.rank, i), typeof s.minRank == "number" && typeof s.maxRank == "number") for (let l = s.minRank; l <= s.maxRank; l++) l !== s.rank && o(l, i);
|
|
1210
1210
|
}
|
|
1211
1211
|
return t.map(function(i) {
|
|
1212
|
-
return
|
|
1212
|
+
return ni(e, i, n, r.get(i) || []);
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1216
|
-
let r = new
|
|
1215
|
+
function ii(e, t, n) {
|
|
1216
|
+
let r = new U();
|
|
1217
1217
|
e.forEach(function(o) {
|
|
1218
1218
|
n.forEach((l) => r.setEdge(l.left, l.right));
|
|
1219
|
-
let i = o.graph().root, s =
|
|
1220
|
-
s.vs.forEach((l, d) => o.node(l).order = d),
|
|
1219
|
+
let i = o.graph().root, s = En(o, i, r, t);
|
|
1220
|
+
s.vs.forEach((l, d) => o.node(l).order = d), oi(o, r, s.vs);
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1223
|
+
function Dt(e, t) {
|
|
1224
1224
|
Object.values(t).forEach((n) => n.forEach((r, o) => e.node(r).order = o));
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1226
|
+
function si(e, t) {
|
|
1227
1227
|
let n = {};
|
|
1228
1228
|
function r(o, i) {
|
|
1229
1229
|
let s = 0, l = 0, d = o.length, a = i[i.length - 1];
|
|
1230
|
-
return i.forEach((c,
|
|
1231
|
-
let h =
|
|
1232
|
-
(h || c === a) && (i.slice(l,
|
|
1233
|
-
let E = e.predecessors(
|
|
1234
|
-
E && E.forEach((
|
|
1235
|
-
let x = e.node(
|
|
1236
|
-
(N < s || g < N) && !(x.dummy && e.node(
|
|
1230
|
+
return i.forEach((c, f) => {
|
|
1231
|
+
let h = ai(e, c), g = h ? e.node(h).order : d;
|
|
1232
|
+
(h || c === a) && (i.slice(l, f + 1).forEach((p) => {
|
|
1233
|
+
let E = e.predecessors(p);
|
|
1234
|
+
E && E.forEach((b) => {
|
|
1235
|
+
let x = e.node(b), N = x.order;
|
|
1236
|
+
(N < s || g < N) && !(x.dummy && e.node(p).dummy) && xn(n, b, p);
|
|
1237
1237
|
});
|
|
1238
|
-
}), l =
|
|
1238
|
+
}), l = f + 1, s = g);
|
|
1239
1239
|
}), i;
|
|
1240
1240
|
}
|
|
1241
1241
|
return t.length && t.reduce(r), n;
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function li(e, t) {
|
|
1244
1244
|
let n = {};
|
|
1245
1245
|
function r(i, s, l, d, a) {
|
|
1246
|
-
|
|
1247
|
-
let
|
|
1248
|
-
if (
|
|
1249
|
-
let h = e.predecessors(
|
|
1246
|
+
ye(s, l).forEach((c) => {
|
|
1247
|
+
let f = i[c];
|
|
1248
|
+
if (f !== void 0 && e.node(f).dummy) {
|
|
1249
|
+
let h = e.predecessors(f);
|
|
1250
1250
|
h && h.forEach((g) => {
|
|
1251
1251
|
if (g === void 0) return;
|
|
1252
|
-
let
|
|
1253
|
-
|
|
1252
|
+
let p = e.node(g);
|
|
1253
|
+
p.dummy && (p.order < d || p.order > a) && xn(n, g, f);
|
|
1254
1254
|
});
|
|
1255
1255
|
}
|
|
1256
1256
|
});
|
|
1257
1257
|
}
|
|
1258
1258
|
function o(i, s) {
|
|
1259
1259
|
let l = -1, d = -1, a = 0;
|
|
1260
|
-
return s.forEach((c,
|
|
1260
|
+
return s.forEach((c, f) => {
|
|
1261
1261
|
if (e.node(c).dummy === "border") {
|
|
1262
1262
|
let h = e.predecessors(c);
|
|
1263
1263
|
if (h && h.length) {
|
|
1264
1264
|
let g = h[0];
|
|
1265
1265
|
if (g === void 0) return;
|
|
1266
|
-
d = e.node(g).order, r(s, a,
|
|
1266
|
+
d = e.node(g).order, r(s, a, f, l, d), a = f, l = d;
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
r(s, a, s.length, d, i.length);
|
|
@@ -1271,13 +1271,13 @@ function Qo(e, t) {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
return t.length && t.reduce(o), n;
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function ai(e, t) {
|
|
1275
1275
|
if (e.node(t).dummy) {
|
|
1276
1276
|
let n = e.predecessors(t);
|
|
1277
1277
|
if (n) return n.find((r) => e.node(r).dummy);
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function xn(e, t, n) {
|
|
1281
1281
|
if (t > n) {
|
|
1282
1282
|
let o = t;
|
|
1283
1283
|
t = n, n = o;
|
|
@@ -1285,7 +1285,7 @@ function wn(e, t, n) {
|
|
|
1285
1285
|
let r = e[t];
|
|
1286
1286
|
r || (e[t] = r = {}), r[n] = !0;
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1288
|
+
function di(e, t, n) {
|
|
1289
1289
|
if (t > n) {
|
|
1290
1290
|
let o = t;
|
|
1291
1291
|
t = n, n = o;
|
|
@@ -1293,7 +1293,7 @@ function ti(e, t, n) {
|
|
|
1293
1293
|
let r = e[t];
|
|
1294
1294
|
return r !== void 0 && Object.hasOwn(r, n);
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function ci(e, t, n, r) {
|
|
1297
1297
|
let o = {}, i = {}, s = {};
|
|
1298
1298
|
return t.forEach((l) => {
|
|
1299
1299
|
l.forEach((d, a) => {
|
|
@@ -1304,77 +1304,77 @@ function ni(e, t, n, r) {
|
|
|
1304
1304
|
l.forEach((a) => {
|
|
1305
1305
|
let c = r(a);
|
|
1306
1306
|
if (c && c.length) {
|
|
1307
|
-
let
|
|
1308
|
-
let E = s[g],
|
|
1309
|
-
return (E !== void 0 ? E : 0) - (
|
|
1310
|
-
}), h = (
|
|
1311
|
-
for (let g = Math.floor(h),
|
|
1312
|
-
let E =
|
|
1307
|
+
let f = c.sort((g, p) => {
|
|
1308
|
+
let E = s[g], b = s[p];
|
|
1309
|
+
return (E !== void 0 ? E : 0) - (b !== void 0 ? b : 0);
|
|
1310
|
+
}), h = (f.length - 1) / 2;
|
|
1311
|
+
for (let g = Math.floor(h), p = Math.ceil(h); g <= p; ++g) {
|
|
1312
|
+
let E = f[g];
|
|
1313
1313
|
if (E === void 0) continue;
|
|
1314
|
-
let
|
|
1315
|
-
if (
|
|
1314
|
+
let b = s[E];
|
|
1315
|
+
if (b !== void 0 && i[a] === a && d < b && !di(n, a, E)) {
|
|
1316
1316
|
let x = o[E];
|
|
1317
|
-
x !== void 0 && (i[E] = a, i[a] = o[a] = x, d =
|
|
1317
|
+
x !== void 0 && (i[E] = a, i[a] = o[a] = x, d = b);
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
});
|
|
1322
1322
|
}), { root: o, align: i };
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1325
|
-
let i = {}, s =
|
|
1326
|
-
function d(g,
|
|
1327
|
-
let E = s.nodes().slice(),
|
|
1324
|
+
function fi(e, t, n, r, o = !1) {
|
|
1325
|
+
let i = {}, s = ui(e, t, n, o), l = o ? "borderLeft" : "borderRight";
|
|
1326
|
+
function d(g, p) {
|
|
1327
|
+
let E = s.nodes().slice(), b = {}, x = E.pop();
|
|
1328
1328
|
for (; x; ) {
|
|
1329
|
-
if (
|
|
1329
|
+
if (b[x]) g(x);
|
|
1330
1330
|
else {
|
|
1331
|
-
|
|
1332
|
-
for (let N of
|
|
1331
|
+
b[x] = !0, E.push(x);
|
|
1332
|
+
for (let N of p(x)) E.push(N);
|
|
1333
1333
|
}
|
|
1334
1334
|
x = E.pop();
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
1337
|
function a(g) {
|
|
1338
|
-
let
|
|
1339
|
-
|
|
1338
|
+
let p = s.inEdges(g);
|
|
1339
|
+
p ? i[g] = p.reduce((E, b) => {
|
|
1340
1340
|
var x;
|
|
1341
|
-
let N = (x = i[
|
|
1341
|
+
let N = (x = i[b.v]) != null ? x : 0, O = s.edge(b);
|
|
1342
1342
|
return Math.max(E, N + (O !== void 0 ? O : 0));
|
|
1343
1343
|
}, 0) : i[g] = 0;
|
|
1344
1344
|
}
|
|
1345
1345
|
function c(g) {
|
|
1346
|
-
let
|
|
1347
|
-
|
|
1348
|
-
let O = i[N.w],
|
|
1349
|
-
return Math.min(x, (O !== void 0 ? O : 0) - (
|
|
1346
|
+
let p = s.outEdges(g), E = Number.POSITIVE_INFINITY;
|
|
1347
|
+
p && (E = p.reduce((x, N) => {
|
|
1348
|
+
let O = i[N.w], M = s.edge(N);
|
|
1349
|
+
return Math.min(x, (O !== void 0 ? O : 0) - (M !== void 0 ? M : 0));
|
|
1350
1350
|
}, Number.POSITIVE_INFINITY));
|
|
1351
|
-
let
|
|
1352
|
-
E !== Number.POSITIVE_INFINITY &&
|
|
1351
|
+
let b = e.node(g);
|
|
1352
|
+
E !== Number.POSITIVE_INFINITY && b.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, E));
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1354
|
+
function f(g) {
|
|
1355
1355
|
return s.predecessors(g) || [];
|
|
1356
1356
|
}
|
|
1357
1357
|
function h(g) {
|
|
1358
1358
|
return s.successors(g) || [];
|
|
1359
1359
|
}
|
|
1360
|
-
return d(a,
|
|
1361
|
-
var
|
|
1360
|
+
return d(a, f), d(c, h), Object.keys(r).forEach((g) => {
|
|
1361
|
+
var p;
|
|
1362
1362
|
let E = n[g];
|
|
1363
|
-
E !== void 0 && (i[g] = (
|
|
1363
|
+
E !== void 0 && (i[g] = (p = i[E]) != null ? p : 0);
|
|
1364
1364
|
}), i;
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1367
|
-
let o = new
|
|
1366
|
+
function ui(e, t, n, r) {
|
|
1367
|
+
let o = new U(), i = e.graph(), s = yi(i.nodesep, i.edgesep, r);
|
|
1368
1368
|
return t.forEach((l) => {
|
|
1369
1369
|
let d;
|
|
1370
1370
|
l.forEach((a) => {
|
|
1371
1371
|
let c = n[a];
|
|
1372
1372
|
if (c !== void 0) {
|
|
1373
1373
|
if (o.setNode(c), d !== void 0) {
|
|
1374
|
-
let
|
|
1375
|
-
if (
|
|
1376
|
-
let h = o.edge(
|
|
1377
|
-
o.setEdge(
|
|
1374
|
+
let f = n[d];
|
|
1375
|
+
if (f !== void 0) {
|
|
1376
|
+
let h = o.edge(f, c);
|
|
1377
|
+
o.setEdge(f, c, Math.max(s(e, a, d), h || 0));
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
1380
|
d = a;
|
|
@@ -1382,29 +1382,29 @@ function oi(e, t, n, r) {
|
|
|
1382
1382
|
});
|
|
1383
1383
|
}), o;
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function hi(e, t) {
|
|
1386
1386
|
return Object.values(t).reduce((n, r) => {
|
|
1387
1387
|
let o = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY;
|
|
1388
1388
|
Object.entries(r).forEach(([l, d]) => {
|
|
1389
|
-
let a =
|
|
1389
|
+
let a = mi(e, l) / 2;
|
|
1390
1390
|
o = Math.max(d + a, o), i = Math.min(d - a, i);
|
|
1391
1391
|
});
|
|
1392
1392
|
let s = o - i;
|
|
1393
1393
|
return s < n[0] && (n = [s, r]), n;
|
|
1394
1394
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function gi(e, t) {
|
|
1397
1397
|
let n = Object.values(t), r = X(Math.min, n), o = X(Math.max, n);
|
|
1398
1398
|
["u", "d"].forEach((i) => {
|
|
1399
1399
|
["l", "r"].forEach((s) => {
|
|
1400
1400
|
let l = i + s, d = e[l];
|
|
1401
1401
|
if (!d || d === t) return;
|
|
1402
1402
|
let a = Object.values(d), c = r - X(Math.min, a);
|
|
1403
|
-
s !== "l" && (c = o - X(Math.max, a)), c && (e[l] = Oe(d, (
|
|
1403
|
+
s !== "l" && (c = o - X(Math.max, a)), c && (e[l] = Oe(d, (f) => f + c));
|
|
1404
1404
|
});
|
|
1405
1405
|
});
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function pi(e, t = void 0) {
|
|
1408
1408
|
let n = e.ul;
|
|
1409
1409
|
return n ? Oe(n, (r, o) => {
|
|
1410
1410
|
var i, s;
|
|
@@ -1419,19 +1419,19 @@ function li(e, t = void 0) {
|
|
|
1419
1419
|
return (((i = l[1]) != null ? i : 0) + ((s = l[2]) != null ? s : 0)) / 2;
|
|
1420
1420
|
}) : {};
|
|
1421
1421
|
}
|
|
1422
|
-
function
|
|
1423
|
-
let t =
|
|
1422
|
+
function bi(e) {
|
|
1423
|
+
let t = we(e), n = Object.assign(si(e, t), li(e, t)), r = {}, o;
|
|
1424
1424
|
["u", "d"].forEach((s) => {
|
|
1425
1425
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1426
1426
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1427
|
-
let d =
|
|
1427
|
+
let d = ci(e, o, n, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), a = fi(e, o, d.root, d.align, l === "r");
|
|
1428
1428
|
l === "r" && (a = Oe(a, (c) => -c)), r[s + l] = a;
|
|
1429
1429
|
});
|
|
1430
1430
|
});
|
|
1431
|
-
let i =
|
|
1432
|
-
return
|
|
1431
|
+
let i = hi(e, r);
|
|
1432
|
+
return gi(r, i), pi(r, e.graph().align);
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function yi(e, t, n) {
|
|
1435
1435
|
return (r, o, i) => {
|
|
1436
1436
|
let s = r.node(o), l = r.node(i), d = 0, a;
|
|
1437
1437
|
if (d += s.width / 2, Object.hasOwn(s, "labelpos")) switch (s.labelpos.toLowerCase()) {
|
|
@@ -1453,19 +1453,19 @@ function di(e, t, n) {
|
|
|
1453
1453
|
return a && (d += n ? a : -a), d;
|
|
1454
1454
|
};
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1456
|
+
function mi(e, t) {
|
|
1457
1457
|
return e.node(t).width;
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1460
|
-
e =
|
|
1459
|
+
function wi(e) {
|
|
1460
|
+
e = an(e), vi(e), Object.entries(bi(e)).forEach(([t, n]) => e.node(t).x = n);
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1463
|
-
let t =
|
|
1462
|
+
function vi(e) {
|
|
1463
|
+
let t = we(e), n = e.graph(), r = n.ranksep, o = n.rankalign, i = 0;
|
|
1464
1464
|
t.forEach((s) => {
|
|
1465
1465
|
let l = s.reduce((d, a) => {
|
|
1466
1466
|
var c;
|
|
1467
|
-
let
|
|
1468
|
-
return d >
|
|
1467
|
+
let f = (c = e.node(a).height) != null ? c : 0;
|
|
1468
|
+
return d > f ? d : f;
|
|
1469
1469
|
}, 0);
|
|
1470
1470
|
s.forEach((d) => {
|
|
1471
1471
|
let a = e.node(d);
|
|
@@ -1473,17 +1473,17 @@ function fi(e) {
|
|
|
1473
1473
|
}), i += l + r;
|
|
1474
1474
|
});
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1477
|
-
let n = t.debugTiming ?
|
|
1476
|
+
function Ei(e, t = {}) {
|
|
1477
|
+
let n = t.debugTiming ? fn : un;
|
|
1478
1478
|
return n("layout", () => {
|
|
1479
|
-
let r = n(" buildLayoutGraph", () =>
|
|
1480
|
-
return n(" runLayout", () =>
|
|
1479
|
+
let r = n(" buildLayoutGraph", () => ji(e));
|
|
1480
|
+
return n(" runLayout", () => ki(r, n, t)), n(" updateInputGraph", () => xi(e, r)), r;
|
|
1481
1481
|
});
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1484
|
-
t(" makeSpaceForEdgeLabels", () =>
|
|
1483
|
+
function ki(e, t, n) {
|
|
1484
|
+
t(" makeSpaceForEdgeLabels", () => Mi(e)), t(" removeSelfEdges", () => Wi(e)), t(" acyclic", () => fo(e)), t(" nestingGraph.run", () => Lo(e)), t(" rank", () => So(an(e))), t(" injectEdgeLabelProxies", () => zi(e)), t(" removeEmptyRanks", () => Xr(e)), t(" nestingGraph.cleanup", () => Do(e)), t(" normalizeRanks", () => qr(e)), t(" assignRankMinMax", () => Fi(e)), t(" removeEdgeLabelProxies", () => Li(e)), t(" normalize.run", () => go(e)), t(" parentDummyChains", () => jo(e)), t(" addBorderSegments", () => Po(e)), t(" order", () => kn(e, n)), t(" insertSelfEdges", () => Gi(e)), t(" adjustCoordinateSystem", () => Wo(e)), t(" position", () => wi(e)), t(" positionSelfEdges", () => $i(e)), t(" removeBorderNodes", () => Bi(e)), t(" normalize.undo", () => bo(e)), t(" fixupEdgeLabelCoords", () => Di(e)), t(" undoCoordinateSystem", () => Go(e)), t(" translateGraph", () => Ai(e)), t(" assignNodeIntersects", () => Ri(e)), t(" reversePoints", () => Pi(e)), t(" acyclic.undo", () => ho(e));
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function xi(e, t) {
|
|
1487
1487
|
e.nodes().forEach((n) => {
|
|
1488
1488
|
let r = e.node(n), o = t.node(n);
|
|
1489
1489
|
r && (r.x = o.x, r.y = o.y, r.order = o.order, r.rank = o.rank, t.children(n).length && (r.width = o.width, r.height = o.height));
|
|
@@ -1492,45 +1492,45 @@ function pi(e, t) {
|
|
|
1492
1492
|
r.points = o.points, Object.hasOwn(o, "x") && (r.x = o.x, r.y = o.y);
|
|
1493
1493
|
}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
|
|
1494
1494
|
}
|
|
1495
|
-
var
|
|
1496
|
-
function
|
|
1497
|
-
let t = new
|
|
1498
|
-
return t.setGraph(Object.assign({},
|
|
1499
|
-
let o =
|
|
1500
|
-
Object.keys(
|
|
1501
|
-
i[l] === void 0 && (i[l] =
|
|
1495
|
+
var Ti = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], _i = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, Ni = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], Si = ["width", "height", "rank"], Pt = { width: 0, height: 0 }, Ci = ["minlen", "weight", "width", "height", "labeloffset"], Ii = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, Oi = ["labelpos"];
|
|
1496
|
+
function ji(e) {
|
|
1497
|
+
let t = new U({ multigraph: !0, compound: !0 }), n = $e(e.graph());
|
|
1498
|
+
return t.setGraph(Object.assign({}, _i, Ge(n, Ti), Ie(n, Ni))), e.nodes().forEach((r) => {
|
|
1499
|
+
let o = $e(e.node(r)), i = Ge(o, Si);
|
|
1500
|
+
Object.keys(Pt).forEach((l) => {
|
|
1501
|
+
i[l] === void 0 && (i[l] = Pt[l]);
|
|
1502
1502
|
}), t.setNode(r, i);
|
|
1503
1503
|
let s = e.parent(r);
|
|
1504
1504
|
s !== void 0 && t.setParent(r, s);
|
|
1505
1505
|
}), e.edges().forEach((r) => {
|
|
1506
|
-
let o =
|
|
1507
|
-
t.setEdge(r, Object.assign({},
|
|
1506
|
+
let o = $e(e.edge(r));
|
|
1507
|
+
t.setEdge(r, Object.assign({}, Ii, Ge(o, Ci), Ie(o, Oi)));
|
|
1508
1508
|
}), t;
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function Mi(e) {
|
|
1511
1511
|
let t = e.graph();
|
|
1512
1512
|
t.ranksep /= 2, e.edges().forEach((n) => {
|
|
1513
1513
|
let r = e.edge(n);
|
|
1514
1514
|
r.minlen *= 2, r.labelpos.toLowerCase() !== "c" && (t.rankdir === "TB" || t.rankdir === "BT" ? r.width += r.labeloffset : r.height += r.labeloffset);
|
|
1515
1515
|
});
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1517
|
+
function zi(e) {
|
|
1518
1518
|
e.edges().forEach((t) => {
|
|
1519
1519
|
let n = e.edge(t);
|
|
1520
1520
|
if (n.width && n.height) {
|
|
1521
1521
|
let r = e.node(t.v), o = { rank: (e.node(t.w).rank - r.rank) / 2 + r.rank, e: t };
|
|
1522
|
-
|
|
1522
|
+
ue(e, "edge-proxy", o, "_ep");
|
|
1523
1523
|
}
|
|
1524
1524
|
});
|
|
1525
1525
|
}
|
|
1526
|
-
function
|
|
1526
|
+
function Fi(e) {
|
|
1527
1527
|
let t = 0;
|
|
1528
1528
|
e.nodes().forEach((n) => {
|
|
1529
1529
|
let r = e.node(n);
|
|
1530
1530
|
r.borderTop && (r.minRank = e.node(r.borderTop).rank, r.maxRank = e.node(r.borderBottom).rank, t = Math.max(t, r.maxRank));
|
|
1531
1531
|
}), e.graph().maxRank = t;
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1533
|
+
function Li(e) {
|
|
1534
1534
|
e.nodes().forEach((t) => {
|
|
1535
1535
|
let n = e.node(t);
|
|
1536
1536
|
if (n.dummy === "edge-proxy") {
|
|
@@ -1539,11 +1539,11 @@ function Si(e) {
|
|
|
1539
1539
|
}
|
|
1540
1540
|
});
|
|
1541
1541
|
}
|
|
1542
|
-
function
|
|
1542
|
+
function Ai(e) {
|
|
1543
1543
|
let t = Number.POSITIVE_INFINITY, n = 0, r = Number.POSITIVE_INFINITY, o = 0, i = e.graph(), s = i.marginx || 0, l = i.marginy || 0;
|
|
1544
1544
|
function d(a) {
|
|
1545
|
-
let c = a.x,
|
|
1546
|
-
t = Math.min(t, c - h / 2), n = Math.max(n, c + h / 2), r = Math.min(r,
|
|
1545
|
+
let c = a.x, f = a.y, h = a.width, g = a.height;
|
|
1546
|
+
t = Math.min(t, c - h / 2), n = Math.max(n, c + h / 2), r = Math.min(r, f - g / 2), o = Math.max(o, f + g / 2);
|
|
1547
1547
|
}
|
|
1548
1548
|
e.nodes().forEach((a) => d(e.node(a))), e.edges().forEach((a) => {
|
|
1549
1549
|
let c = e.edge(a);
|
|
@@ -1553,18 +1553,18 @@ function Ci(e) {
|
|
|
1553
1553
|
c.x -= t, c.y -= r;
|
|
1554
1554
|
}), e.edges().forEach((a) => {
|
|
1555
1555
|
let c = e.edge(a);
|
|
1556
|
-
c.points.forEach((
|
|
1557
|
-
|
|
1556
|
+
c.points.forEach((f) => {
|
|
1557
|
+
f.x -= t, f.y -= r;
|
|
1558
1558
|
}), Object.hasOwn(c, "x") && (c.x -= t), Object.hasOwn(c, "y") && (c.y -= r);
|
|
1559
1559
|
}), i.width = n - t + s, i.height = o - r + l;
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function Ri(e) {
|
|
1562
1562
|
e.edges().forEach((t) => {
|
|
1563
1563
|
let n = e.edge(t), r = e.node(t.v), o = e.node(t.w), i, s;
|
|
1564
|
-
n.points ? (i = n.points[0], s = n.points[n.points.length - 1]) : (n.points = [], i = o, s = r), n.points.unshift(
|
|
1564
|
+
n.points ? (i = n.points[0], s = n.points[n.points.length - 1]) : (n.points = [], i = o, s = r), n.points.unshift(It(r, i)), n.points.push(It(o, s));
|
|
1565
1565
|
});
|
|
1566
1566
|
}
|
|
1567
|
-
function
|
|
1567
|
+
function Di(e) {
|
|
1568
1568
|
e.edges().forEach((t) => {
|
|
1569
1569
|
let n = e.edge(t);
|
|
1570
1570
|
if (Object.hasOwn(n, "x")) switch ((n.labelpos === "l" || n.labelpos === "r") && (n.width -= n.labeloffset), n.labelpos) {
|
|
@@ -1577,13 +1577,13 @@ function Oi(e) {
|
|
|
1577
1577
|
}
|
|
1578
1578
|
});
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1580
|
+
function Pi(e) {
|
|
1581
1581
|
e.edges().forEach((t) => {
|
|
1582
1582
|
let n = e.edge(t);
|
|
1583
1583
|
n.reversed && n.points.reverse();
|
|
1584
1584
|
});
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function Bi(e) {
|
|
1587
1587
|
e.nodes().forEach((t) => {
|
|
1588
1588
|
if (e.children(t).length) {
|
|
1589
1589
|
let n = e.node(t), r = e.node(n.borderTop), o = e.node(n.borderBottom), i = e.node(n.borderLeft[n.borderLeft.length - 1]), s = e.node(n.borderRight[n.borderRight.length - 1]);
|
|
@@ -1593,7 +1593,7 @@ function ji(e) {
|
|
|
1593
1593
|
e.node(t).dummy === "border" && e.removeNode(t);
|
|
1594
1594
|
});
|
|
1595
1595
|
}
|
|
1596
|
-
function
|
|
1596
|
+
function Wi(e) {
|
|
1597
1597
|
e.edges().forEach((t) => {
|
|
1598
1598
|
if (t.v === t.w) {
|
|
1599
1599
|
let n = e.node(t.v);
|
|
@@ -1601,18 +1601,18 @@ function Fi(e) {
|
|
|
1601
1601
|
}
|
|
1602
1602
|
});
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1605
|
-
|
|
1604
|
+
function Gi(e) {
|
|
1605
|
+
we(e).forEach((t) => {
|
|
1606
1606
|
let n = 0;
|
|
1607
1607
|
t.forEach((r, o) => {
|
|
1608
1608
|
let i = e.node(r);
|
|
1609
1609
|
i.order = o + n, (i.selfEdges || []).forEach((s) => {
|
|
1610
|
-
|
|
1610
|
+
ue(e, "selfedge", { width: s.label.width, height: s.label.height, rank: i.rank, order: o + ++n, e: s.e, label: s.label }, "_se");
|
|
1611
1611
|
}), delete i.selfEdges;
|
|
1612
1612
|
});
|
|
1613
1613
|
});
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1615
|
+
function $i(e) {
|
|
1616
1616
|
e.nodes().forEach((t) => {
|
|
1617
1617
|
let n = e.node(t);
|
|
1618
1618
|
if (n.dummy === "selfedge") {
|
|
@@ -1621,17 +1621,17 @@ function Li(e) {
|
|
|
1621
1621
|
}
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function Ge(e, t) {
|
|
1625
1625
|
return Oe(Ie(e, t), Number);
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function $e(e) {
|
|
1628
1628
|
let t = {};
|
|
1629
1629
|
return e && Object.entries(e).forEach(([n, r]) => {
|
|
1630
1630
|
typeof n == "string" && (n = n.toLowerCase()), t[n] = r;
|
|
1631
1631
|
}), t;
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1634
|
-
let t =
|
|
1633
|
+
function Yi(e) {
|
|
1634
|
+
let t = we(e), n = new U({ compound: !0, multigraph: !0 }).setGraph({});
|
|
1635
1635
|
return e.nodes().forEach((r) => {
|
|
1636
1636
|
n.setNode(r, { label: r }), n.setParent(r, "layer" + e.node(r).rank);
|
|
1637
1637
|
}), e.edges().forEach((r) => n.setEdge(r.v, r.w, {}, r.name)), t.forEach((r, o) => {
|
|
@@ -1639,15 +1639,15 @@ function Ai(e) {
|
|
|
1639
1639
|
n.setNode(i, { rank: "same" }), r.reduce((s, l) => (n.setEdge(s, l, { style: "invis" }), l));
|
|
1640
1640
|
}), n;
|
|
1641
1641
|
}
|
|
1642
|
-
var
|
|
1642
|
+
var Ki = { graphlib: Zt, version: to, layout: Ei, debug: Yi, util: { time: fn, notime: un } }, Bt = Ki;
|
|
1643
1643
|
/*! For license information please see dagre.esm.js.LEGAL.txt */
|
|
1644
|
-
const
|
|
1644
|
+
const Ui = (e) => {
|
|
1645
1645
|
const t = [];
|
|
1646
1646
|
return e.nodeInternals.forEach((n, r) => t.push(`${r}:${n.height ?? 0}`)), t.join(",");
|
|
1647
|
-
},
|
|
1648
|
-
const n =
|
|
1649
|
-
|
|
1650
|
-
const { fitView: o } =
|
|
1647
|
+
}, Hi = ({ onHeightsReady: e, nodeCount: t }) => {
|
|
1648
|
+
const n = Dn(Ui), r = Tt("");
|
|
1649
|
+
Tt(0);
|
|
1650
|
+
const { fitView: o } = Pn();
|
|
1651
1651
|
return re(() => {
|
|
1652
1652
|
if (!n || n === r.current) return;
|
|
1653
1653
|
const i = {};
|
|
@@ -1657,19 +1657,174 @@ const Ri = (e) => {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
Object.keys(i).length !== 0 && (r.current = n, e(i));
|
|
1659
1659
|
}, [n]), null;
|
|
1660
|
-
},
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1660
|
+
}, Vi = {
|
|
1661
|
+
gray: { bg: "#f1f5f9", fg: "#475569" },
|
|
1662
|
+
green: { bg: "#dcfce7", fg: "#166534" },
|
|
1663
|
+
amber: { bg: "#fef3c7", fg: "#92400e" },
|
|
1664
|
+
red: { bg: "#fee2e2", fg: "#991b1b" }
|
|
1665
|
+
};
|
|
1666
|
+
function qi({
|
|
1667
|
+
workflowName: e,
|
|
1668
|
+
onWorkflowNameChange: t,
|
|
1669
|
+
status: n,
|
|
1670
|
+
statusColor: r = "gray",
|
|
1671
|
+
onSave: o,
|
|
1672
|
+
onCancel: i,
|
|
1673
|
+
saveLabel: s = "Save",
|
|
1674
|
+
saveDisabled: l = !1
|
|
1675
|
+
}) {
|
|
1676
|
+
const [d, a] = P.useState(!1), [c, f] = P.useState(!1), [h, g] = P.useState(e ?? "");
|
|
1677
|
+
P.useEffect(() => {
|
|
1678
|
+
g(e ?? "");
|
|
1679
|
+
}, [e]);
|
|
1680
|
+
const p = async () => {
|
|
1681
|
+
if (!(!o || d || l)) {
|
|
1682
|
+
a(!0);
|
|
1683
|
+
try {
|
|
1684
|
+
await o();
|
|
1685
|
+
} finally {
|
|
1686
|
+
a(!1);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
}, E = Vi[r] ?? {
|
|
1690
|
+
bg: r,
|
|
1691
|
+
fg: "#fff"
|
|
1692
|
+
};
|
|
1693
|
+
return /* @__PURE__ */ w(
|
|
1694
|
+
"div",
|
|
1695
|
+
{
|
|
1696
|
+
style: {
|
|
1697
|
+
display: "flex",
|
|
1698
|
+
alignItems: "center",
|
|
1699
|
+
gap: 12,
|
|
1700
|
+
padding: "10px 20px",
|
|
1701
|
+
background: "#fff",
|
|
1702
|
+
borderBottom: "1px solid #e2e8f0",
|
|
1703
|
+
flexShrink: 0
|
|
1704
|
+
},
|
|
1705
|
+
children: [
|
|
1706
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 10, minWidth: 0 }, children: [
|
|
1707
|
+
c && t ? /* @__PURE__ */ u(
|
|
1708
|
+
"input",
|
|
1709
|
+
{
|
|
1710
|
+
value: h,
|
|
1711
|
+
onChange: (b) => g(b.target.value),
|
|
1712
|
+
onBlur: () => {
|
|
1713
|
+
f(!1), h !== e && t(h);
|
|
1714
|
+
},
|
|
1715
|
+
onKeyDown: (b) => {
|
|
1716
|
+
b.key === "Enter" && b.target.blur(), b.key === "Escape" && (g(e ?? ""), f(!1));
|
|
1717
|
+
},
|
|
1718
|
+
autoFocus: !0,
|
|
1719
|
+
style: {
|
|
1720
|
+
fontSize: 15,
|
|
1721
|
+
fontWeight: 600,
|
|
1722
|
+
color: "#0f172a",
|
|
1723
|
+
border: "1px solid #cbd5e1",
|
|
1724
|
+
borderRadius: 4,
|
|
1725
|
+
padding: "2px 6px",
|
|
1726
|
+
minWidth: 200
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
) : /* @__PURE__ */ u(
|
|
1730
|
+
"span",
|
|
1731
|
+
{
|
|
1732
|
+
onClick: () => t && f(!0),
|
|
1733
|
+
style: {
|
|
1734
|
+
fontSize: 15,
|
|
1735
|
+
fontWeight: 600,
|
|
1736
|
+
color: "#0f172a",
|
|
1737
|
+
cursor: t ? "text" : "default",
|
|
1738
|
+
whiteSpace: "nowrap",
|
|
1739
|
+
overflow: "hidden",
|
|
1740
|
+
textOverflow: "ellipsis",
|
|
1741
|
+
maxWidth: 360
|
|
1742
|
+
},
|
|
1743
|
+
title: e,
|
|
1744
|
+
children: e || "Untitled workflow"
|
|
1745
|
+
}
|
|
1746
|
+
),
|
|
1747
|
+
n && /* @__PURE__ */ u(
|
|
1748
|
+
"span",
|
|
1749
|
+
{
|
|
1750
|
+
style: {
|
|
1751
|
+
fontSize: 11,
|
|
1752
|
+
fontWeight: 600,
|
|
1753
|
+
padding: "3px 8px",
|
|
1754
|
+
borderRadius: 999,
|
|
1755
|
+
background: E.bg,
|
|
1756
|
+
color: E.fg,
|
|
1757
|
+
textTransform: "uppercase",
|
|
1758
|
+
letterSpacing: 0.4,
|
|
1759
|
+
flexShrink: 0
|
|
1760
|
+
},
|
|
1761
|
+
children: n
|
|
1762
|
+
}
|
|
1763
|
+
)
|
|
1764
|
+
] }),
|
|
1765
|
+
/* @__PURE__ */ w("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1766
|
+
i && /* @__PURE__ */ u(
|
|
1767
|
+
"button",
|
|
1768
|
+
{
|
|
1769
|
+
type: "button",
|
|
1770
|
+
onClick: i,
|
|
1771
|
+
disabled: d,
|
|
1772
|
+
style: {
|
|
1773
|
+
padding: "6px 14px",
|
|
1774
|
+
fontSize: 13,
|
|
1775
|
+
fontWeight: 500,
|
|
1776
|
+
border: "1px solid #cbd5e1",
|
|
1777
|
+
background: "#fff",
|
|
1778
|
+
color: "#475569",
|
|
1779
|
+
borderRadius: 6,
|
|
1780
|
+
cursor: d ? "not-allowed" : "pointer",
|
|
1781
|
+
opacity: d ? 0.6 : 1
|
|
1782
|
+
},
|
|
1783
|
+
children: "Cancel"
|
|
1784
|
+
}
|
|
1785
|
+
),
|
|
1786
|
+
o && /* @__PURE__ */ u(
|
|
1787
|
+
"button",
|
|
1788
|
+
{
|
|
1789
|
+
type: "button",
|
|
1790
|
+
onClick: p,
|
|
1791
|
+
disabled: d || l,
|
|
1792
|
+
style: {
|
|
1793
|
+
padding: "6px 16px",
|
|
1794
|
+
fontSize: 13,
|
|
1795
|
+
fontWeight: 600,
|
|
1796
|
+
border: "none",
|
|
1797
|
+
background: l ? "#94a3b8" : "var(--ff-primary, #1dbf60)",
|
|
1798
|
+
color: "#fff",
|
|
1799
|
+
borderRadius: 6,
|
|
1800
|
+
cursor: d || l ? "not-allowed" : "pointer",
|
|
1801
|
+
display: "inline-flex",
|
|
1802
|
+
alignItems: "center",
|
|
1803
|
+
gap: 6,
|
|
1804
|
+
minWidth: 80,
|
|
1805
|
+
justifyContent: "center"
|
|
1806
|
+
},
|
|
1807
|
+
children: d ? "Saving…" : s
|
|
1808
|
+
}
|
|
1809
|
+
)
|
|
1810
|
+
] })
|
|
1811
|
+
]
|
|
1812
|
+
}
|
|
1813
|
+
);
|
|
1814
|
+
}
|
|
1815
|
+
const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i, width: s = 600 }) => {
|
|
1816
|
+
const [l, d] = j(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ w(Q, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
|
|
1817
|
+
r && /* @__PURE__ */ u(Q, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: r }),
|
|
1818
|
+
/* @__PURE__ */ u("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: n }),
|
|
1819
|
+
/* @__PURE__ */ u(_t, { onClick: a, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ u(pr, {}) : /* @__PURE__ */ u(br, {}) }),
|
|
1820
|
+
/* @__PURE__ */ u(_t, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ u(er, {}) })
|
|
1821
|
+
] }), f = () => i ? /* @__PURE__ */ u(Q, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1822
|
+
return l ? /* @__PURE__ */ w(Xn, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1823
|
+
/* @__PURE__ */ u(c, {}),
|
|
1824
|
+
/* @__PURE__ */ u(Q, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1825
|
+
/* @__PURE__ */ u(f, {})
|
|
1826
|
+
] }) : /* @__PURE__ */ w(
|
|
1827
|
+
Jn,
|
|
1673
1828
|
{
|
|
1674
1829
|
anchor: "right",
|
|
1675
1830
|
open: e,
|
|
@@ -1693,13 +1848,13 @@ const Ri = (e) => {
|
|
|
1693
1848
|
}
|
|
1694
1849
|
},
|
|
1695
1850
|
children: [
|
|
1696
|
-
/* @__PURE__ */
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */ f
|
|
1851
|
+
/* @__PURE__ */ u(c, {}),
|
|
1852
|
+
/* @__PURE__ */ u(Q, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1853
|
+
/* @__PURE__ */ u(f, {})
|
|
1699
1854
|
]
|
|
1700
1855
|
}
|
|
1701
1856
|
);
|
|
1702
|
-
},
|
|
1857
|
+
}, Xi = ({
|
|
1703
1858
|
open: e,
|
|
1704
1859
|
templates: t,
|
|
1705
1860
|
messages: n,
|
|
@@ -1707,144 +1862,144 @@ const Ri = (e) => {
|
|
|
1707
1862
|
onClose: o,
|
|
1708
1863
|
loadTriggerSources: i
|
|
1709
1864
|
}) => {
|
|
1710
|
-
const [s, l] =
|
|
1865
|
+
const [s, l] = j("trigger"), [d, a] = j(null), [c, f] = j([]), [h, g] = j([]), [p, E] = j(!1), [b, x] = j(null);
|
|
1711
1866
|
re(() => {
|
|
1712
|
-
e || (l("trigger"), a(null),
|
|
1867
|
+
e || (l("trigger"), a(null), f([]), g([]), E(!1), x(null));
|
|
1713
1868
|
}, [e]);
|
|
1714
|
-
const N =
|
|
1869
|
+
const N = Y(async (F) => {
|
|
1715
1870
|
if (!i) {
|
|
1716
|
-
r(
|
|
1871
|
+
r(F);
|
|
1717
1872
|
return;
|
|
1718
1873
|
}
|
|
1719
|
-
a(
|
|
1874
|
+
a(F), E(!0), x(null);
|
|
1720
1875
|
try {
|
|
1721
|
-
const
|
|
1722
|
-
if (!
|
|
1723
|
-
r(
|
|
1876
|
+
const D = await i(F.triggerKey);
|
|
1877
|
+
if (!D || D.length === 0) {
|
|
1878
|
+
r(F);
|
|
1724
1879
|
return;
|
|
1725
1880
|
}
|
|
1726
|
-
|
|
1727
|
-
} catch (
|
|
1728
|
-
x(
|
|
1881
|
+
f(D), l("sources");
|
|
1882
|
+
} catch (D) {
|
|
1883
|
+
x(D instanceof Error ? D.message : "Failed to load sources.");
|
|
1729
1884
|
} finally {
|
|
1730
1885
|
E(!1);
|
|
1731
1886
|
}
|
|
1732
1887
|
}, [i, r]), O = () => {
|
|
1733
|
-
l("trigger"), a(null),
|
|
1734
|
-
},
|
|
1888
|
+
l("trigger"), a(null), f([]), g([]), x(null);
|
|
1889
|
+
}, M = () => {
|
|
1735
1890
|
d && r(d, h);
|
|
1736
|
-
},
|
|
1737
|
-
/* @__PURE__ */
|
|
1738
|
-
/* @__PURE__ */
|
|
1891
|
+
}, z = s === "sources" && d, W = z ? /* @__PURE__ */ w(be, { children: [
|
|
1892
|
+
/* @__PURE__ */ u(Ne, { type: "button", variant: "outlined", size: "small", onClick: O, children: n.cancel ?? "Back" }),
|
|
1893
|
+
/* @__PURE__ */ u(
|
|
1739
1894
|
Ne,
|
|
1740
1895
|
{
|
|
1741
1896
|
type: "button",
|
|
1742
1897
|
variant: "contained",
|
|
1743
1898
|
size: "small",
|
|
1744
|
-
onClick:
|
|
1899
|
+
onClick: M,
|
|
1745
1900
|
disabled: h.length === 0,
|
|
1746
1901
|
children: n.save ?? "Continue"
|
|
1747
1902
|
}
|
|
1748
1903
|
)
|
|
1749
1904
|
] }) : null;
|
|
1750
|
-
return /* @__PURE__ */
|
|
1751
|
-
|
|
1905
|
+
return /* @__PURE__ */ u(
|
|
1906
|
+
Me,
|
|
1752
1907
|
{
|
|
1753
1908
|
isOpen: e,
|
|
1754
1909
|
onClose: o,
|
|
1755
|
-
title:
|
|
1756
|
-
icon: /* @__PURE__ */
|
|
1910
|
+
title: z ? d.label : n.addTriggerTitle,
|
|
1911
|
+
icon: /* @__PURE__ */ u(gr, {}),
|
|
1757
1912
|
width: 500,
|
|
1758
1913
|
footer: W,
|
|
1759
|
-
children: /* @__PURE__ */
|
|
1760
|
-
!
|
|
1761
|
-
/* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
t.map((
|
|
1914
|
+
children: /* @__PURE__ */ w(Q, { sx: { p: 2 }, children: [
|
|
1915
|
+
!z && /* @__PURE__ */ w(be, { children: [
|
|
1916
|
+
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: n.chooseTrigger }),
|
|
1917
|
+
/* @__PURE__ */ w("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1918
|
+
t.map((F) => /* @__PURE__ */ w(
|
|
1764
1919
|
"div",
|
|
1765
1920
|
{
|
|
1766
1921
|
className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
|
|
1767
|
-
style: { cursor:
|
|
1768
|
-
onClick: () => !
|
|
1922
|
+
style: { cursor: p ? "wait" : "pointer", transition: "background 0.15s", opacity: p ? 0.6 : 1 },
|
|
1923
|
+
onClick: () => !p && N(F),
|
|
1769
1924
|
role: "button",
|
|
1770
1925
|
tabIndex: 0,
|
|
1771
|
-
onKeyDown: (
|
|
1772
|
-
|
|
1926
|
+
onKeyDown: (D) => {
|
|
1927
|
+
D.key === "Enter" && !p && N(F);
|
|
1773
1928
|
},
|
|
1774
|
-
onMouseEnter: (
|
|
1775
|
-
|
|
1929
|
+
onMouseEnter: (D) => {
|
|
1930
|
+
p || (D.currentTarget.style.background = "#f5f5f5");
|
|
1776
1931
|
},
|
|
1777
|
-
onMouseLeave: (
|
|
1778
|
-
|
|
1932
|
+
onMouseLeave: (D) => {
|
|
1933
|
+
D.currentTarget.style.background = "";
|
|
1779
1934
|
},
|
|
1780
1935
|
children: [
|
|
1781
|
-
/* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
|
|
1936
|
+
/* @__PURE__ */ u("div", { style: { color: F.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: F.triggerCategory === "scheduler" ? /* @__PURE__ */ u(tr, { size: 18 }) : /* @__PURE__ */ u(nr, { size: 18 }) }),
|
|
1937
|
+
/* @__PURE__ */ w("div", { children: [
|
|
1938
|
+
/* @__PURE__ */ u("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: F.label }),
|
|
1939
|
+
F.description && /* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: F.description })
|
|
1785
1940
|
] })
|
|
1786
1941
|
]
|
|
1787
1942
|
},
|
|
1788
|
-
|
|
1943
|
+
F.triggerKey
|
|
1789
1944
|
)),
|
|
1790
|
-
t.length === 0 && /* @__PURE__ */
|
|
1945
|
+
t.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noTriggers })
|
|
1791
1946
|
] }),
|
|
1792
|
-
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1947
|
+
p && /* @__PURE__ */ w(Q, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
|
|
1948
|
+
/* @__PURE__ */ u(Zn, { size: 14 }),
|
|
1949
|
+
/* @__PURE__ */ u("span", { children: "Loading sources for the selected trigger…" })
|
|
1795
1950
|
] }),
|
|
1796
|
-
|
|
1951
|
+
b && /* @__PURE__ */ u("p", { style: { fontSize: 12, color: "#d32f2f", marginTop: 12 }, children: b })
|
|
1797
1952
|
] }),
|
|
1798
|
-
|
|
1799
|
-
/* @__PURE__ */
|
|
1953
|
+
z && /* @__PURE__ */ w(be, { children: [
|
|
1954
|
+
/* @__PURE__ */ w(
|
|
1800
1955
|
"div",
|
|
1801
1956
|
{
|
|
1802
1957
|
role: "button",
|
|
1803
1958
|
tabIndex: 0,
|
|
1804
1959
|
onClick: O,
|
|
1805
|
-
onKeyDown: (
|
|
1806
|
-
|
|
1960
|
+
onKeyDown: (F) => {
|
|
1961
|
+
F.key === "Enter" && O();
|
|
1807
1962
|
},
|
|
1808
1963
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1809
1964
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
1810
1965
|
children: [
|
|
1811
|
-
/* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ u(Kt, { size: 16 }),
|
|
1967
|
+
/* @__PURE__ */ u("span", { children: n.addTriggerTitle })
|
|
1813
1968
|
]
|
|
1814
1969
|
}
|
|
1815
1970
|
),
|
|
1816
|
-
/* @__PURE__ */
|
|
1971
|
+
/* @__PURE__ */ w("p", { className: "ff-text-muted ff-mb-2", style: { fontSize: 13 }, children: [
|
|
1817
1972
|
"Pick one or more sources for ",
|
|
1818
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ u("strong", { children: d.label }),
|
|
1819
1974
|
":"
|
|
1820
1975
|
] }),
|
|
1821
|
-
/* @__PURE__ */
|
|
1822
|
-
|
|
1976
|
+
/* @__PURE__ */ u(
|
|
1977
|
+
Qn,
|
|
1823
1978
|
{
|
|
1824
1979
|
isMulti: !0,
|
|
1825
1980
|
options: c,
|
|
1826
1981
|
value: h,
|
|
1827
|
-
onChange: (
|
|
1982
|
+
onChange: (F) => g(F ?? []),
|
|
1828
1983
|
placeholder: "Select sources…",
|
|
1829
1984
|
menuPosition: "fixed",
|
|
1830
1985
|
menuPortalTarget: typeof document < "u" ? document.body : void 0,
|
|
1831
|
-
styles:
|
|
1986
|
+
styles: yr(!1, !0)
|
|
1832
1987
|
}
|
|
1833
1988
|
)
|
|
1834
1989
|
] })
|
|
1835
1990
|
] })
|
|
1836
1991
|
}
|
|
1837
1992
|
);
|
|
1838
|
-
},
|
|
1993
|
+
}, Ye = {
|
|
1839
1994
|
cursor: "pointer",
|
|
1840
1995
|
transition: "background 0.15s"
|
|
1841
|
-
},
|
|
1842
|
-
const { apps: i, ungrouped: s } =
|
|
1843
|
-
const
|
|
1996
|
+
}, Ke = "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-center ff-gap-3", Ji = ({ open: e, availableDescriptors: t, messages: n, onSelect: r, onClose: o }) => {
|
|
1997
|
+
const { apps: i, ungrouped: s } = K(() => {
|
|
1998
|
+
const f = /* @__PURE__ */ new Map(), h = [];
|
|
1844
1999
|
for (const g of t)
|
|
1845
2000
|
if (g.app) {
|
|
1846
|
-
const
|
|
1847
|
-
|
|
2001
|
+
const p = f.get(g.app.key);
|
|
2002
|
+
p ? p.descriptors.push(g) : f.set(g.app.key, {
|
|
1848
2003
|
key: g.app.key,
|
|
1849
2004
|
label: g.app.label,
|
|
1850
2005
|
icon: g.app.icon,
|
|
@@ -1853,52 +2008,52 @@ const Ri = (e) => {
|
|
|
1853
2008
|
});
|
|
1854
2009
|
} else
|
|
1855
2010
|
h.push(g);
|
|
1856
|
-
return { apps: [...
|
|
1857
|
-
}, [t]), [l, d] =
|
|
2011
|
+
return { apps: [...f.values()], ungrouped: h };
|
|
2012
|
+
}, [t]), [l, d] = j(null), a = l ? i.find((f) => f.key === l) ?? null : null;
|
|
1858
2013
|
re(() => {
|
|
1859
2014
|
e || d(null);
|
|
1860
2015
|
}, [e]), re(() => {
|
|
1861
2016
|
d(null);
|
|
1862
2017
|
}, [t]);
|
|
1863
2018
|
const c = !a;
|
|
1864
|
-
return /* @__PURE__ */
|
|
1865
|
-
|
|
2019
|
+
return /* @__PURE__ */ u(
|
|
2020
|
+
Me,
|
|
1866
2021
|
{
|
|
1867
2022
|
isOpen: e,
|
|
1868
2023
|
onClose: o,
|
|
1869
2024
|
title: c ? n.addStepTitle : a.label,
|
|
1870
|
-
icon: c ? /* @__PURE__ */
|
|
2025
|
+
icon: c ? /* @__PURE__ */ u(rr, {}) : a.icon ?? /* @__PURE__ */ u(or, {}),
|
|
1871
2026
|
width: 500,
|
|
1872
|
-
children: /* @__PURE__ */
|
|
1873
|
-
!c && /* @__PURE__ */
|
|
2027
|
+
children: /* @__PURE__ */ w(Q, { sx: { p: 2 }, children: [
|
|
2028
|
+
!c && /* @__PURE__ */ w(
|
|
1874
2029
|
"div",
|
|
1875
2030
|
{
|
|
1876
2031
|
role: "button",
|
|
1877
2032
|
tabIndex: 0,
|
|
1878
2033
|
onClick: () => d(null),
|
|
1879
|
-
onKeyDown: (
|
|
1880
|
-
|
|
2034
|
+
onKeyDown: (f) => {
|
|
2035
|
+
f.key === "Enter" && d(null);
|
|
1881
2036
|
},
|
|
1882
2037
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1883
2038
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
1884
2039
|
children: [
|
|
1885
|
-
/* @__PURE__ */
|
|
1886
|
-
/* @__PURE__ */
|
|
2040
|
+
/* @__PURE__ */ u(Kt, { size: 16 }),
|
|
2041
|
+
/* @__PURE__ */ u("span", { children: n.addStepTitle })
|
|
1887
2042
|
]
|
|
1888
2043
|
}
|
|
1889
2044
|
),
|
|
1890
|
-
/* @__PURE__ */
|
|
1891
|
-
/* @__PURE__ */
|
|
1892
|
-
i.map((
|
|
2045
|
+
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? n.chooseAction : `Pick an action from ${a.label}` }),
|
|
2046
|
+
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(be, { children: [
|
|
2047
|
+
i.map((f) => /* @__PURE__ */ w(
|
|
1893
2048
|
"div",
|
|
1894
2049
|
{
|
|
1895
|
-
className:
|
|
1896
|
-
style:
|
|
1897
|
-
onClick: () => d(
|
|
2050
|
+
className: Ke,
|
|
2051
|
+
style: Ye,
|
|
2052
|
+
onClick: () => d(f.key),
|
|
1898
2053
|
role: "button",
|
|
1899
2054
|
tabIndex: 0,
|
|
1900
2055
|
onKeyDown: (h) => {
|
|
1901
|
-
h.key === "Enter" && d(
|
|
2056
|
+
h.key === "Enter" && d(f.key);
|
|
1902
2057
|
},
|
|
1903
2058
|
onMouseEnter: (h) => {
|
|
1904
2059
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -1907,26 +2062,26 @@ const Ri = (e) => {
|
|
|
1907
2062
|
h.currentTarget.style.background = "";
|
|
1908
2063
|
},
|
|
1909
2064
|
children: [
|
|
1910
|
-
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
/* @__PURE__ */
|
|
2065
|
+
f.icon && /* @__PURE__ */ u("div", { style: { flexShrink: 0 }, children: f.icon }),
|
|
2066
|
+
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2067
|
+
/* @__PURE__ */ u("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: f.label }),
|
|
2068
|
+
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: f.description ?? `${f.descriptors.length} action${f.descriptors.length === 1 ? "" : "s"}` })
|
|
1914
2069
|
] }),
|
|
1915
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ u(Ut, { size: 18, color: "#9e9e9e" })
|
|
1916
2071
|
]
|
|
1917
2072
|
},
|
|
1918
|
-
`app-${
|
|
2073
|
+
`app-${f.key}`
|
|
1919
2074
|
)),
|
|
1920
|
-
s.map((
|
|
2075
|
+
s.map((f) => /* @__PURE__ */ w(
|
|
1921
2076
|
"div",
|
|
1922
2077
|
{
|
|
1923
|
-
className:
|
|
1924
|
-
style:
|
|
1925
|
-
onClick: () => r(
|
|
2078
|
+
className: Ke,
|
|
2079
|
+
style: Ye,
|
|
2080
|
+
onClick: () => r(f),
|
|
1926
2081
|
role: "button",
|
|
1927
2082
|
tabIndex: 0,
|
|
1928
2083
|
onKeyDown: (h) => {
|
|
1929
|
-
h.key === "Enter" && r(
|
|
2084
|
+
h.key === "Enter" && r(f);
|
|
1930
2085
|
},
|
|
1931
2086
|
onMouseEnter: (h) => {
|
|
1932
2087
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -1935,25 +2090,25 @@ const Ri = (e) => {
|
|
|
1935
2090
|
h.currentTarget.style.background = "";
|
|
1936
2091
|
},
|
|
1937
2092
|
children: [
|
|
1938
|
-
|
|
1939
|
-
/* @__PURE__ */
|
|
2093
|
+
f.icon && /* @__PURE__ */ u("div", { style: { flexShrink: 0 }, children: f.icon }),
|
|
2094
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: f.label })
|
|
1940
2095
|
]
|
|
1941
2096
|
},
|
|
1942
|
-
|
|
2097
|
+
f.type
|
|
1943
2098
|
)),
|
|
1944
|
-
i.length === 0 && s.length === 0 && /* @__PURE__ */
|
|
2099
|
+
i.length === 0 && s.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noActions })
|
|
1945
2100
|
] }) : (
|
|
1946
2101
|
/* Stage 2 — actions for the selected app */
|
|
1947
|
-
a.descriptors.map((
|
|
2102
|
+
a.descriptors.map((f) => /* @__PURE__ */ w(
|
|
1948
2103
|
"div",
|
|
1949
2104
|
{
|
|
1950
|
-
className:
|
|
1951
|
-
style:
|
|
1952
|
-
onClick: () => r(
|
|
2105
|
+
className: Ke,
|
|
2106
|
+
style: Ye,
|
|
2107
|
+
onClick: () => r(f),
|
|
1953
2108
|
role: "button",
|
|
1954
2109
|
tabIndex: 0,
|
|
1955
2110
|
onKeyDown: (h) => {
|
|
1956
|
-
h.key === "Enter" && r(
|
|
2111
|
+
h.key === "Enter" && r(f);
|
|
1957
2112
|
},
|
|
1958
2113
|
onMouseEnter: (h) => {
|
|
1959
2114
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -1962,20 +2117,20 @@ const Ri = (e) => {
|
|
|
1962
2117
|
h.currentTarget.style.background = "";
|
|
1963
2118
|
},
|
|
1964
2119
|
children: [
|
|
1965
|
-
|
|
1966
|
-
/* @__PURE__ */
|
|
2120
|
+
f.icon && /* @__PURE__ */ u("div", { style: { flexShrink: 0 }, children: f.icon }),
|
|
2121
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: f.label })
|
|
1967
2122
|
]
|
|
1968
2123
|
},
|
|
1969
|
-
|
|
2124
|
+
f.type
|
|
1970
2125
|
))
|
|
1971
2126
|
) })
|
|
1972
2127
|
] })
|
|
1973
2128
|
}
|
|
1974
2129
|
);
|
|
1975
|
-
},
|
|
1976
|
-
const [l, d] =
|
|
2130
|
+
}, Wt = "_conditionConfig", Zi = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o, onSave: i, onClose: s }) => {
|
|
2131
|
+
const [l, d] = j([]), [a, c] = j(!1), [f, h] = j(null), [g, p] = j({});
|
|
1977
2132
|
re(() => {
|
|
1978
|
-
|
|
2133
|
+
p((r == null ? void 0 : r[Wt]) ?? {});
|
|
1979
2134
|
}, [r, t]), re(() => {
|
|
1980
2135
|
let N = !1;
|
|
1981
2136
|
if (h(null), !n || !t) {
|
|
@@ -1983,20 +2138,20 @@ const Ri = (e) => {
|
|
|
1983
2138
|
return;
|
|
1984
2139
|
}
|
|
1985
2140
|
const O = n.formSchema;
|
|
1986
|
-
return typeof O == "function" ? (c(!0), O(t).then((
|
|
1987
|
-
N || (d(
|
|
1988
|
-
}).catch((
|
|
1989
|
-
N || (d([]), h(
|
|
2141
|
+
return typeof O == "function" ? (c(!0), O(t).then((M) => {
|
|
2142
|
+
N || (d(M), c(!1));
|
|
2143
|
+
}).catch((M) => {
|
|
2144
|
+
N || (d([]), h(M instanceof Error ? M.message : "Unable to load configuration."), c(!1));
|
|
1990
2145
|
})) : (d(O), c(!1)), () => {
|
|
1991
2146
|
N = !0;
|
|
1992
2147
|
};
|
|
1993
2148
|
}, [n, t]);
|
|
1994
|
-
const E = t ? `node-config-form-${t}` : "node-config-form",
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
2149
|
+
const E = t ? `node-config-form-${t}` : "node-config-form", b = !a && !f && l.length > 0, x = b ? /* @__PURE__ */ w(be, { children: [
|
|
2150
|
+
/* @__PURE__ */ u(Ne, { type: "button", variant: "outlined", size: "small", onClick: s, children: o.cancel }),
|
|
2151
|
+
/* @__PURE__ */ u(Ne, { type: "submit", form: E, variant: "contained", size: "small", children: o.save })
|
|
1997
2152
|
] }) : null;
|
|
1998
|
-
return /* @__PURE__ */
|
|
1999
|
-
|
|
2153
|
+
return /* @__PURE__ */ u(
|
|
2154
|
+
Me,
|
|
2000
2155
|
{
|
|
2001
2156
|
isOpen: e,
|
|
2002
2157
|
onClose: s,
|
|
@@ -2004,76 +2159,76 @@ const Ri = (e) => {
|
|
|
2004
2159
|
icon: n == null ? void 0 : n.icon,
|
|
2005
2160
|
width: 500,
|
|
2006
2161
|
footer: x,
|
|
2007
|
-
children: /* @__PURE__ */
|
|
2008
|
-
a && /* @__PURE__ */
|
|
2009
|
-
!a &&
|
|
2010
|
-
!a && !
|
|
2011
|
-
|
|
2012
|
-
|
|
2162
|
+
children: /* @__PURE__ */ w(Q, { sx: { p: 2 }, children: [
|
|
2163
|
+
a && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
2164
|
+
!a && f && /* @__PURE__ */ u("p", { style: { fontSize: 13, color: "#d32f2f" }, children: f }),
|
|
2165
|
+
!a && !f && l.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
2166
|
+
b && /* @__PURE__ */ u(
|
|
2167
|
+
mr,
|
|
2013
2168
|
{
|
|
2014
2169
|
schema: { layout: "flat", fields: l },
|
|
2015
2170
|
initialValues: r ?? {},
|
|
2016
2171
|
formId: E,
|
|
2017
2172
|
conditionConfig: g,
|
|
2018
|
-
onConditionConfigChange:
|
|
2173
|
+
onConditionConfigChange: p,
|
|
2019
2174
|
onSubmit: (N) => {
|
|
2020
2175
|
if (!t) return;
|
|
2021
2176
|
const O = Object.keys(g).length > 0;
|
|
2022
|
-
i(t, { ...N, [
|
|
2177
|
+
i(t, { ...N, [Wt]: O ? g : void 0 }), s();
|
|
2023
2178
|
}
|
|
2024
2179
|
}
|
|
2025
2180
|
)
|
|
2026
2181
|
] })
|
|
2027
2182
|
}
|
|
2028
2183
|
);
|
|
2029
|
-
},
|
|
2184
|
+
}, Qi = ({
|
|
2030
2185
|
isOpen: e,
|
|
2031
2186
|
onClose: t,
|
|
2032
2187
|
workflowId: n,
|
|
2033
2188
|
workflowLabel: r,
|
|
2034
2189
|
onFetchWorkflow: o
|
|
2035
2190
|
}) => {
|
|
2036
|
-
const [i, s] =
|
|
2191
|
+
const [i, s] = j({ status: "idle" });
|
|
2037
2192
|
return re(() => {
|
|
2038
2193
|
if (!e || !n) {
|
|
2039
2194
|
s({ status: "idle" });
|
|
2040
2195
|
return;
|
|
2041
2196
|
}
|
|
2042
2197
|
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" }));
|
|
2043
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2044
|
-
|
|
2198
|
+
}, [e, n, o]), /* @__PURE__ */ u(
|
|
2199
|
+
Me,
|
|
2045
2200
|
{
|
|
2046
2201
|
isOpen: e,
|
|
2047
2202
|
onClose: t,
|
|
2048
2203
|
title: r ? `Preview: ${r}` : "Sub-Workflow Preview",
|
|
2049
|
-
icon: /* @__PURE__ */
|
|
2204
|
+
icon: /* @__PURE__ */ u(sr, { size: 18, color: "#00695c" }),
|
|
2050
2205
|
width: 700,
|
|
2051
|
-
children: /* @__PURE__ */
|
|
2052
|
-
i.status === "idle" && /* @__PURE__ */
|
|
2053
|
-
i.status === "loading" && /* @__PURE__ */
|
|
2054
|
-
/* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
/* @__PURE__ */
|
|
2206
|
+
children: /* @__PURE__ */ w("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
|
|
2207
|
+
i.status === "idle" && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", fontSize: 14 }, children: "Select a workflow to preview" }),
|
|
2208
|
+
i.status === "loading" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
|
|
2209
|
+
/* @__PURE__ */ u("div", { style: { width: 32, height: 32, borderRadius: "50%", border: "3px solid #e0e0e0", borderTopColor: "#00897b", animation: "spin 0.8s linear infinite", margin: "0 auto 12px" } }),
|
|
2210
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 14 }, children: "Loading workflow…" }),
|
|
2211
|
+
/* @__PURE__ */ u("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
|
|
2057
2212
|
] }),
|
|
2058
|
-
i.status === "error" && /* @__PURE__ */
|
|
2059
|
-
/* @__PURE__ */
|
|
2060
|
-
/* @__PURE__ */
|
|
2213
|
+
i.status === "error" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#c62828" }, children: [
|
|
2214
|
+
/* @__PURE__ */ u(ir, { size: 32, style: { marginBottom: 8 } }),
|
|
2215
|
+
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: i.message })
|
|
2061
2216
|
] }),
|
|
2062
|
-
i.status === "loaded" && /* @__PURE__ */
|
|
2217
|
+
i.status === "loaded" && /* @__PURE__ */ u("div", { style: { width: "100%", flex: 1 }, children: /* @__PURE__ */ u(es, { state: i.state }) })
|
|
2063
2218
|
] })
|
|
2064
2219
|
}
|
|
2065
2220
|
);
|
|
2066
|
-
},
|
|
2067
|
-
const [t, n] =
|
|
2221
|
+
}, es = ({ state: e }) => {
|
|
2222
|
+
const [t, n] = j(null), [r, o] = j(null);
|
|
2068
2223
|
return re(() => {
|
|
2069
2224
|
Promise.all([
|
|
2070
|
-
Promise.resolve().then(() =>
|
|
2225
|
+
Promise.resolve().then(() => ss).then((i) => i.default),
|
|
2071
2226
|
import("./nodeRegistry.js").then((i) => i.nodeTypeRegistry),
|
|
2072
2227
|
import("./templateRegistry.js").then((i) => i.templateRegistry)
|
|
2073
2228
|
]).then(([i, s, l]) => {
|
|
2074
2229
|
n(() => i), o({ nodeTypeRegistry: s, templateRegistry: l });
|
|
2075
2230
|
});
|
|
2076
|
-
}, []), !t || !r ? /* @__PURE__ */
|
|
2231
|
+
}, []), !t || !r ? /* @__PURE__ */ u("div", { style: { color: "#9e9e9e", fontSize: 13, textAlign: "center" }, children: "Loading canvas…" }) : /* @__PURE__ */ u("div", { style: { width: "100%", height: 480, border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: /* @__PURE__ */ u(
|
|
2077
2232
|
t,
|
|
2078
2233
|
{
|
|
2079
2234
|
nodeRegistry: r.nodeTypeRegistry,
|
|
@@ -2082,7 +2237,7 @@ const Ri = (e) => {
|
|
|
2082
2237
|
readOnly: !0
|
|
2083
2238
|
}
|
|
2084
2239
|
) });
|
|
2085
|
-
},
|
|
2240
|
+
}, me = 350, Ve = 70, qe = 60, Xe = {
|
|
2086
2241
|
startNode: 40,
|
|
2087
2242
|
endNode: 40,
|
|
2088
2243
|
addTriggerNode: 56,
|
|
@@ -2092,71 +2247,71 @@ const Ri = (e) => {
|
|
|
2092
2247
|
approvalNode: 90,
|
|
2093
2248
|
delayNode: 80,
|
|
2094
2249
|
notificationNode: 80
|
|
2095
|
-
},
|
|
2096
|
-
plusEdge:
|
|
2097
|
-
labelPlusEdge:
|
|
2098
|
-
plainEdge:
|
|
2099
|
-
edgeWithPlusLabel:
|
|
2100
|
-
gatewayBranchEdge:
|
|
2250
|
+
}, ts = {
|
|
2251
|
+
plusEdge: Vn,
|
|
2252
|
+
labelPlusEdge: Hn,
|
|
2253
|
+
plainEdge: Un,
|
|
2254
|
+
edgeWithPlusLabel: Kn,
|
|
2255
|
+
gatewayBranchEdge: Yn
|
|
2101
2256
|
};
|
|
2102
|
-
function
|
|
2257
|
+
function Gt() {
|
|
2103
2258
|
return [
|
|
2104
2259
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2105
2260
|
{ id: "addTrigger", kind: "addTrigger", reactFlowType: "addTriggerNode" },
|
|
2106
2261
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2107
2262
|
];
|
|
2108
2263
|
}
|
|
2109
|
-
function
|
|
2110
|
-
const o = new
|
|
2264
|
+
function ns(e, t, n, r = "TB") {
|
|
2265
|
+
const o = new Bt.graphlib.Graph();
|
|
2111
2266
|
return o.setGraph({ rankdir: r, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
|
|
2112
|
-
const s = n[i.id] ?? { width:
|
|
2267
|
+
const s = n[i.id] ?? { width: me, height: Xe[i.type ?? ""] ?? 80 };
|
|
2113
2268
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2114
|
-
}), t.forEach((i) => o.setEdge(i.source, i.target)),
|
|
2269
|
+
}), t.forEach((i) => o.setEdge(i.source, i.target)), Bt.layout(o), e.map((i) => {
|
|
2115
2270
|
var a, c;
|
|
2116
|
-
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ??
|
|
2271
|
+
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ?? me, d = ((c = n[i.id]) == null ? void 0 : c.height) ?? Xe[i.type ?? ""] ?? 80;
|
|
2117
2272
|
return { ...i, position: { x: s.x - l / 2, y: s.y - d / 2 } };
|
|
2118
2273
|
});
|
|
2119
2274
|
}
|
|
2120
|
-
const
|
|
2121
|
-
function
|
|
2122
|
-
const s =
|
|
2123
|
-
for (const
|
|
2124
|
-
for (const
|
|
2125
|
-
for (const x of Object.values(
|
|
2126
|
-
for (const N of x)
|
|
2127
|
-
const h = (
|
|
2128
|
-
const O = r[
|
|
2129
|
-
return a[
|
|
2130
|
-
}, g = (
|
|
2275
|
+
const le = (e) => e === "filter" || e === "approval";
|
|
2276
|
+
function rs(e, t, n, r) {
|
|
2277
|
+
const s = Ve, l = 30, d = 30, a = {}, c = {}, f = /* @__PURE__ */ new Map();
|
|
2278
|
+
for (const b of e) f.set(b.id, b);
|
|
2279
|
+
for (const b of Object.values(t))
|
|
2280
|
+
for (const x of Object.values(b))
|
|
2281
|
+
for (const N of x) f.set(N.id, N);
|
|
2282
|
+
const h = (b, x, N) => {
|
|
2283
|
+
const O = r[b] ?? { width: me, height: 80 };
|
|
2284
|
+
return a[b] = { x: x - O.width / 2, y: N }, N + O.height;
|
|
2285
|
+
}, g = (b, x, N) => {
|
|
2131
2286
|
let O = N;
|
|
2132
|
-
for (const
|
|
2133
|
-
O = h(
|
|
2287
|
+
for (const M of b)
|
|
2288
|
+
O = h(M.id, x, O) + s, le(M.kind) && t[M.id] && (O = p(M.id, x, O));
|
|
2134
2289
|
return O;
|
|
2135
|
-
},
|
|
2136
|
-
const O = x + 180,
|
|
2290
|
+
}, p = (b, x, N) => {
|
|
2291
|
+
const O = x + 180, M = t[b], z = Object.keys(M), W = f.get(b), F = (W == null ? void 0 : W.branchLabels) ?? { pass: "Pass", fail: "Fail" }, D = a[b], G = r[b] ?? { height: 80 }, ve = D.y + G.height, Ee = [];
|
|
2137
2292
|
let te = N;
|
|
2138
|
-
return
|
|
2139
|
-
const
|
|
2140
|
-
|
|
2141
|
-
y:
|
|
2142
|
-
label:
|
|
2143
|
-
isPass:
|
|
2144
|
-
}), te = g(
|
|
2145
|
-
}), c[
|
|
2146
|
-
branches:
|
|
2147
|
-
height: te -
|
|
2293
|
+
return z.forEach((he, ke) => {
|
|
2294
|
+
const ze = M[he], Fe = te;
|
|
2295
|
+
Ee.push({
|
|
2296
|
+
y: Fe - ve,
|
|
2297
|
+
label: F[he] ?? he,
|
|
2298
|
+
isPass: ke === 0
|
|
2299
|
+
}), te = g(ze, O, te + d), ke < z.length - 1 && (te += l);
|
|
2300
|
+
}), c[b] = {
|
|
2301
|
+
branches: Ee,
|
|
2302
|
+
height: te - ve,
|
|
2148
2303
|
indent: 180
|
|
2149
2304
|
}, te;
|
|
2150
2305
|
};
|
|
2151
|
-
let E =
|
|
2152
|
-
for (const
|
|
2153
|
-
E = h(
|
|
2306
|
+
let E = qe;
|
|
2307
|
+
for (const b of e)
|
|
2308
|
+
E = h(b.id, 400, E) + s, le(b.kind) && t[b.id] && (E = p(b.id, 400, E));
|
|
2154
2309
|
return {
|
|
2155
|
-
nodes: n.map((
|
|
2310
|
+
nodes: n.map((b) => a[b.id] ? { ...b, position: a[b.id] } : b),
|
|
2156
2311
|
railSpecs: c
|
|
2157
2312
|
};
|
|
2158
2313
|
}
|
|
2159
|
-
function
|
|
2314
|
+
function $t(e) {
|
|
2160
2315
|
return {
|
|
2161
2316
|
id: e.id,
|
|
2162
2317
|
type: e.reactFlowType,
|
|
@@ -2166,7 +2321,7 @@ function Pt(e) {
|
|
|
2166
2321
|
selectable: !1
|
|
2167
2322
|
};
|
|
2168
2323
|
}
|
|
2169
|
-
function
|
|
2324
|
+
function os(e, t, n, r, o) {
|
|
2170
2325
|
return {
|
|
2171
2326
|
id: `e-${e.id}-${t.id}`,
|
|
2172
2327
|
source: e.id,
|
|
@@ -2180,79 +2335,79 @@ function Hi(e, t, n, r, o) {
|
|
|
2180
2335
|
}
|
|
2181
2336
|
};
|
|
2182
2337
|
}
|
|
2183
|
-
function
|
|
2184
|
-
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (
|
|
2185
|
-
const
|
|
2186
|
-
if (!
|
|
2187
|
-
const N = E ?? { pass: "Pass", fail: "Fail" }, O = Object.keys(
|
|
2188
|
-
if (
|
|
2189
|
-
|
|
2190
|
-
id: `e-${
|
|
2191
|
-
source:
|
|
2192
|
-
target:
|
|
2338
|
+
function is(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
2339
|
+
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (p, E) => {
|
|
2340
|
+
const b = t[p];
|
|
2341
|
+
if (!b) return;
|
|
2342
|
+
const N = E ?? { pass: "Pass", fail: "Fail" }, O = Object.keys(b), M = (z, W, F, D) => {
|
|
2343
|
+
if (z.length !== 0) {
|
|
2344
|
+
z.forEach((G) => d.push($t(G))), a.push({
|
|
2345
|
+
id: `e-${p}-${W}-start`,
|
|
2346
|
+
source: p,
|
|
2347
|
+
target: z[0].id,
|
|
2193
2348
|
type: "gatewayBranchEdge",
|
|
2194
2349
|
style: { stroke: l },
|
|
2195
|
-
data: { branch: W, filterId:
|
|
2350
|
+
data: { branch: W, filterId: p, label: F, isFirst: D === 0, onAddStepClick: n, verticalRouting: s === "vertical" }
|
|
2196
2351
|
});
|
|
2197
|
-
for (let
|
|
2198
|
-
|
|
2199
|
-
for (const
|
|
2200
|
-
|
|
2352
|
+
for (let G = 1; G < z.length; G++)
|
|
2353
|
+
le(z[G - 1].kind) || a.push(os(z[G - 1], z[G], l, n, { filterId: p, branch: W }));
|
|
2354
|
+
for (const G of z)
|
|
2355
|
+
le(G.kind) && t[G.id] && c(G.id, G.branchLabels);
|
|
2201
2356
|
}
|
|
2202
2357
|
};
|
|
2203
|
-
O.forEach((
|
|
2204
|
-
|
|
2358
|
+
O.forEach((z, W) => {
|
|
2359
|
+
M(b[z], z, N[z] ?? z, W);
|
|
2205
2360
|
});
|
|
2206
2361
|
};
|
|
2207
|
-
for (let
|
|
2208
|
-
const E = e[
|
|
2209
|
-
if (d.push(
|
|
2210
|
-
const
|
|
2211
|
-
if (
|
|
2362
|
+
for (let p = 0; p < e.length; p++) {
|
|
2363
|
+
const E = e[p];
|
|
2364
|
+
if (d.push($t(E)), p > 0) {
|
|
2365
|
+
const b = e[p - 1], x = b.kind === "start" || b.kind === "addTrigger";
|
|
2366
|
+
if (b.kind === "filter" || b.kind === "approval") continue;
|
|
2212
2367
|
a.push({
|
|
2213
|
-
id: `e-${
|
|
2214
|
-
source:
|
|
2368
|
+
id: `e-${b.id}-${E.id}`,
|
|
2369
|
+
source: b.id,
|
|
2215
2370
|
target: E.id,
|
|
2216
2371
|
type: x ? "plainEdge" : "plusEdge",
|
|
2217
2372
|
style: { stroke: l },
|
|
2218
2373
|
data: x ? {} : {
|
|
2219
2374
|
onAddStepClick: n,
|
|
2220
|
-
referenceNodeType:
|
|
2375
|
+
referenceNodeType: b.reactFlowType
|
|
2221
2376
|
}
|
|
2222
2377
|
});
|
|
2223
2378
|
}
|
|
2224
2379
|
(E.kind === "filter" || E.kind === "approval") && t[E.id] && c(E.id, E.branchLabels);
|
|
2225
2380
|
}
|
|
2226
|
-
const
|
|
2227
|
-
if (d.forEach((
|
|
2228
|
-
|
|
2229
|
-
width:
|
|
2230
|
-
height: r[
|
|
2381
|
+
const f = {};
|
|
2382
|
+
if (d.forEach((p) => {
|
|
2383
|
+
f[p.id] = {
|
|
2384
|
+
width: me,
|
|
2385
|
+
height: r[p.id] ?? Xe[p.type ?? ""] ?? 80
|
|
2231
2386
|
};
|
|
2232
2387
|
}), !(Object.keys(t).length > 0)) {
|
|
2233
2388
|
if (i === "LR") {
|
|
2234
|
-
let N =
|
|
2235
|
-
return { nodes: d.map((
|
|
2236
|
-
const
|
|
2237
|
-
return N +=
|
|
2389
|
+
let N = qe;
|
|
2390
|
+
return { nodes: d.map((M) => {
|
|
2391
|
+
const z = f[M.id].width, W = f[M.id].height, F = { ...M, position: { x: N, y: 300 - W / 2 } };
|
|
2392
|
+
return N += z + Ve, F;
|
|
2238
2393
|
}), edges: a };
|
|
2239
2394
|
}
|
|
2240
|
-
const
|
|
2241
|
-
let E =
|
|
2395
|
+
const p = 400;
|
|
2396
|
+
let E = qe;
|
|
2242
2397
|
return { nodes: d.map((x) => {
|
|
2243
|
-
const N =
|
|
2244
|
-
return E += N +
|
|
2398
|
+
const N = f[x.id].height, O = { ...x, position: { x: p - me / 2, y: E } };
|
|
2399
|
+
return E += N + Ve, O;
|
|
2245
2400
|
}), edges: a };
|
|
2246
2401
|
}
|
|
2247
2402
|
if (s === "vertical") {
|
|
2248
|
-
const { nodes:
|
|
2249
|
-
return { nodes:
|
|
2403
|
+
const { nodes: p, railSpecs: E } = rs(e, t, d, f);
|
|
2404
|
+
return { nodes: p.map(
|
|
2250
2405
|
(x) => E[x.id] ? { ...x, data: { ...x.data, _branchRail: E[x.id] } } : x
|
|
2251
2406
|
), edges: a };
|
|
2252
2407
|
}
|
|
2253
|
-
return { nodes:
|
|
2408
|
+
return { nodes: ns(d, a, f, i), edges: a };
|
|
2254
2409
|
}
|
|
2255
|
-
const
|
|
2410
|
+
const Yt = ({
|
|
2256
2411
|
nodeRegistry: e,
|
|
2257
2412
|
templateRegistry: t,
|
|
2258
2413
|
initialValue: n,
|
|
@@ -2264,186 +2419,193 @@ const Bt = ({
|
|
|
2264
2419
|
messages: d,
|
|
2265
2420
|
canvasOptions: a = {},
|
|
2266
2421
|
renderTriggerSelector: c,
|
|
2267
|
-
loadTriggerSources:
|
|
2422
|
+
loadTriggerSources: f,
|
|
2268
2423
|
renderNodePicker: h,
|
|
2269
2424
|
renderNodeConfig: g,
|
|
2270
|
-
onNodeClick:
|
|
2425
|
+
onNodeClick: p,
|
|
2271
2426
|
maxNodes: E,
|
|
2272
|
-
layoutDirection:
|
|
2427
|
+
layoutDirection: b = "TB",
|
|
2273
2428
|
executionRecord: x,
|
|
2274
|
-
onFetchWorkflow: N
|
|
2429
|
+
onFetchWorkflow: N,
|
|
2430
|
+
hideHeader: O = !1,
|
|
2431
|
+
workflowName: M,
|
|
2432
|
+
onWorkflowNameChange: z,
|
|
2433
|
+
onCancel: W,
|
|
2434
|
+
workflowStatus: F,
|
|
2435
|
+
workflowStatusColor: D,
|
|
2436
|
+
saveLabel: G
|
|
2275
2437
|
}) => {
|
|
2276
2438
|
const {
|
|
2277
|
-
fitView:
|
|
2278
|
-
fitViewPadding:
|
|
2279
|
-
showControls:
|
|
2280
|
-
showMiniMap:
|
|
2281
|
-
panOnScroll:
|
|
2282
|
-
zoomOnScroll:
|
|
2283
|
-
minZoom:
|
|
2284
|
-
maxZoom:
|
|
2285
|
-
snapToGrid:
|
|
2286
|
-
snapGrid:
|
|
2287
|
-
branchLayout:
|
|
2288
|
-
nodeBody:
|
|
2289
|
-
} = a,
|
|
2290
|
-
const
|
|
2291
|
-
return
|
|
2292
|
-
}), [
|
|
2293
|
-
|
|
2294
|
-
}, []),
|
|
2295
|
-
const
|
|
2296
|
-
return
|
|
2297
|
-
}, [A,
|
|
2298
|
-
const
|
|
2299
|
-
if (
|
|
2300
|
-
for (const _ of Object.values(
|
|
2301
|
-
const k = Object.values(_).flat().find((I) => I.id ===
|
|
2439
|
+
fitView: ve = !0,
|
|
2440
|
+
fitViewPadding: Ee = 0.3,
|
|
2441
|
+
showControls: te = !0,
|
|
2442
|
+
showMiniMap: he = !1,
|
|
2443
|
+
panOnScroll: ke = !0,
|
|
2444
|
+
zoomOnScroll: ze = !1,
|
|
2445
|
+
minZoom: Fe = 0.25,
|
|
2446
|
+
maxZoom: _n = 2,
|
|
2447
|
+
snapToGrid: Nn = !1,
|
|
2448
|
+
snapGrid: Sn = [15, 15],
|
|
2449
|
+
branchLayout: rt = "horizontal",
|
|
2450
|
+
nodeBody: ot = "full"
|
|
2451
|
+
} = a, ge = K(() => wr(d), [d]), [A, oe] = j(() => (n == null ? void 0 : n.slots) ?? Gt()), [$, J] = j(() => (n == null ? void 0 : n.branches) ?? {}), [de, H] = j(null), [Le, it] = j(null), [V, xe] = j(null), [ie, st] = j(null), [Te, lt] = j(null), [q, at] = j(() => {
|
|
2452
|
+
const y = n == null ? void 0 : n.slots.find((_) => _.kind === "triggerFixed"), v = y != null && y.id.startsWith("trigger-") ? y.id.slice(8) : void 0;
|
|
2453
|
+
return v ? t.lookup(v) ?? null : null;
|
|
2454
|
+
}), [dt, Cn] = j({}), In = Y((y) => {
|
|
2455
|
+
Cn(y);
|
|
2456
|
+
}, []), On = K(() => ({ ...$n, ...r }), [r]), jn = K(() => ({ ...ts, ...o }), [o]), Mn = K(() => {
|
|
2457
|
+
const y = A.filter((_) => _.kind === "userTask").length, v = Object.values($).flatMap((_) => Object.values(_).flat()).filter((_) => _.kind === "userTask").length;
|
|
2458
|
+
return y + v;
|
|
2459
|
+
}, [A, $]), ct = E ?? (q == null ? void 0 : q.maxTasks), ft = ct !== void 0 && Mn >= ct, se = Y((y) => {
|
|
2460
|
+
const v = A.find((_) => _.id === y);
|
|
2461
|
+
if (v) return v;
|
|
2462
|
+
for (const _ of Object.values($)) {
|
|
2463
|
+
const k = Object.values(_).flat().find((I) => I.id === y);
|
|
2302
2464
|
if (k) return k;
|
|
2303
2465
|
}
|
|
2304
2466
|
return null;
|
|
2305
|
-
}, [A,
|
|
2306
|
-
s || (
|
|
2307
|
-
}, [s]),
|
|
2467
|
+
}, [A, $]), Ae = Y((y) => {
|
|
2468
|
+
s || (it(y), H("nodeConfig"));
|
|
2469
|
+
}, [s]), ut = Y((y) => {
|
|
2308
2470
|
if (!s) {
|
|
2309
|
-
if (A.some((
|
|
2310
|
-
const
|
|
2311
|
-
if ((
|
|
2312
|
-
|
|
2471
|
+
if (A.some((v) => v.id === y)) {
|
|
2472
|
+
const v = A.find((_) => _.id === y);
|
|
2473
|
+
if ((v == null ? void 0 : v.kind) === "triggerFixed") {
|
|
2474
|
+
oe(Gt()), J({}), at(null);
|
|
2313
2475
|
return;
|
|
2314
2476
|
}
|
|
2315
|
-
|
|
2316
|
-
const k = _.filter((I) => I.id !==
|
|
2317
|
-
return
|
|
2477
|
+
oe((_) => {
|
|
2478
|
+
const k = _.filter((I) => I.id !== y);
|
|
2479
|
+
return le((v == null ? void 0 : v.kind) ?? "") && !k.some((I) => I.kind === "end") ? [...k, { id: "end", kind: "end", reactFlowType: "endNode" }] : k;
|
|
2318
2480
|
}), J((_) => {
|
|
2319
2481
|
const k = { ..._ }, I = (m) => {
|
|
2320
|
-
k[m] && (Object.values(k[m]).flat().filter((T) =>
|
|
2482
|
+
k[m] && (Object.values(k[m]).flat().filter((T) => le(T.kind)).forEach((T) => I(T.id)), delete k[m]);
|
|
2321
2483
|
};
|
|
2322
|
-
return I(
|
|
2484
|
+
return I(y), k;
|
|
2323
2485
|
});
|
|
2324
2486
|
return;
|
|
2325
2487
|
}
|
|
2326
|
-
J((
|
|
2488
|
+
J((v) => {
|
|
2327
2489
|
const _ = (I, m) => {
|
|
2328
2490
|
const T = [];
|
|
2329
2491
|
for (const S of I)
|
|
2330
|
-
|
|
2492
|
+
le(S.kind) && m[S.id] && (T.push(S.id), Object.values(m[S.id]).forEach((C) => T.push(..._(C, m))));
|
|
2331
2493
|
return T;
|
|
2332
|
-
}, k = { ...
|
|
2494
|
+
}, k = { ...v };
|
|
2333
2495
|
for (const I of Object.keys(k))
|
|
2334
2496
|
for (const m of Object.keys(k[I])) {
|
|
2335
|
-
const T = k[I][m], S = T.findIndex((
|
|
2497
|
+
const T = k[I][m], S = T.findIndex((R) => R.id === y);
|
|
2336
2498
|
if (S === -1 || T[S].kind === "end") continue;
|
|
2337
2499
|
const C = T[S];
|
|
2338
|
-
let L = T.filter((
|
|
2339
|
-
return C.kind === "filter" && ((C.id in k ? _([C], k) : []).forEach((
|
|
2500
|
+
let L = T.filter((R) => R.id !== y);
|
|
2501
|
+
return C.kind === "filter" && ((C.id in k ? _([C], k) : []).forEach((B) => delete k[B]), delete k[C.id], L.some((B) => B.kind === "end") || (L = [...L, { id: `end-${I}-${m}`, kind: "end", reactFlowType: "endNode" }])), k[I] = { ...k[I], [m]: L }, k;
|
|
2340
2502
|
}
|
|
2341
2503
|
return k;
|
|
2342
2504
|
});
|
|
2343
2505
|
}
|
|
2344
|
-
}, [s, A]),
|
|
2345
|
-
s ||
|
|
2346
|
-
}, [s]),
|
|
2347
|
-
s ||
|
|
2348
|
-
}, [s,
|
|
2349
|
-
if (
|
|
2350
|
-
const k = Array.isArray(
|
|
2506
|
+
}, [s, A]), Re = Y(() => {
|
|
2507
|
+
s || H("triggerSelect");
|
|
2508
|
+
}, [s]), ht = Y((y, v) => {
|
|
2509
|
+
s || ft || (xe(y), st(v.filterId && v.branch ? { filterId: v.filterId, branch: v.branch } : null), H("nodePicker"));
|
|
2510
|
+
}, [s, ft]), gt = Y((y, v) => {
|
|
2511
|
+
if (at(y), H(null), y.skeletonState) {
|
|
2512
|
+
const k = Array.isArray(v) && v.length > 0, I = (y.skeletonState.slots ?? []).map((m) => m.kind !== "triggerFixed" ? m : {
|
|
2351
2513
|
...m,
|
|
2352
2514
|
nodeData: {
|
|
2353
|
-
label:
|
|
2515
|
+
label: y.label,
|
|
2354
2516
|
...m.nodeData ?? {},
|
|
2355
|
-
...k && { sources:
|
|
2517
|
+
...k && { sources: v }
|
|
2356
2518
|
}
|
|
2357
2519
|
});
|
|
2358
|
-
J(
|
|
2520
|
+
J(y.skeletonState.branches ?? {}), oe(I);
|
|
2359
2521
|
return;
|
|
2360
2522
|
}
|
|
2361
2523
|
J({});
|
|
2362
|
-
const _ = Array.isArray(
|
|
2363
|
-
|
|
2524
|
+
const _ = Array.isArray(v) && v.length > 0;
|
|
2525
|
+
oe([
|
|
2364
2526
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2365
2527
|
{
|
|
2366
|
-
id: `trigger-${
|
|
2528
|
+
id: `trigger-${y.triggerKey}`,
|
|
2367
2529
|
kind: "triggerFixed",
|
|
2368
2530
|
reactFlowType: "triggerNode",
|
|
2369
2531
|
nodeData: {
|
|
2370
|
-
label:
|
|
2371
|
-
source:
|
|
2372
|
-
eventType:
|
|
2373
|
-
type:
|
|
2374
|
-
..._ && { sources:
|
|
2532
|
+
label: y.label,
|
|
2533
|
+
source: y.source,
|
|
2534
|
+
eventType: y.triggerKey,
|
|
2535
|
+
type: y.triggerCategory === "scheduler" ? "scheduler" : "event",
|
|
2536
|
+
..._ && { sources: v }
|
|
2375
2537
|
},
|
|
2376
2538
|
deletable: !1
|
|
2377
2539
|
},
|
|
2378
2540
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2379
2541
|
]);
|
|
2380
|
-
}, []),
|
|
2542
|
+
}, []), pt = Y(() => {
|
|
2381
2543
|
var _;
|
|
2382
|
-
const
|
|
2544
|
+
const y = {
|
|
2383
2545
|
insertAfterSlot: null,
|
|
2384
2546
|
upstreamSlots: [],
|
|
2385
2547
|
downstreamSlots: [],
|
|
2386
|
-
branch:
|
|
2548
|
+
branch: ie,
|
|
2387
2549
|
template: q
|
|
2388
2550
|
};
|
|
2389
|
-
if (!
|
|
2390
|
-
if (
|
|
2391
|
-
const { filterId: k, branch: I } =
|
|
2392
|
-
return
|
|
2551
|
+
if (!V) return y;
|
|
2552
|
+
if (ie) {
|
|
2553
|
+
const { filterId: k, branch: I } = ie, m = A.findIndex((R) => R.id === k), T = m >= 0 ? A.slice(0, m + 1) : [], S = ((_ = $[k]) == null ? void 0 : _[I]) ?? [], C = S.findIndex((R) => R.id === V), L = C >= 0 ? S.slice(0, C + 1) : [];
|
|
2554
|
+
return y.upstreamSlots = [...T, ...L], y.downstreamSlots = C >= 0 ? S.slice(C + 1) : S, y.insertAfterSlot = L[L.length - 1] ?? null, y;
|
|
2393
2555
|
}
|
|
2394
|
-
const
|
|
2395
|
-
return
|
|
2396
|
-
}, [A,
|
|
2397
|
-
const
|
|
2398
|
-
return
|
|
2399
|
-
(m) => k.insertAfter.some((T) =>
|
|
2556
|
+
const v = A.findIndex((k) => k.id === V);
|
|
2557
|
+
return y.upstreamSlots = v >= 0 ? A.slice(0, v + 1) : [], y.downstreamSlots = v >= 0 ? A.slice(v + 1) : [], y.insertAfterSlot = y.upstreamSlots[y.upstreamSlots.length - 1] ?? null, y;
|
|
2558
|
+
}, [A, $, V, ie, q]), bt = (y, v) => y.descriptorType === v || y.id === v || y.kind === v, yt = Y(() => {
|
|
2559
|
+
const y = e.list(), v = q != null && q.availableTasks ? y.filter((k) => q.availableTasks.includes(k.type)) : y, _ = pt();
|
|
2560
|
+
return v.filter((k) => k.maxPerWorkflow !== void 0 && A.filter((m) => m.descriptorType === k.type).length + Object.values($).flatMap((m) => Object.values(m).flat()).filter((m) => m.descriptorType === k.type).length >= k.maxPerWorkflow ? !1 : k.canInsert ? k.canInsert(_) : !(k.insertAfter && k.insertAfter.length > 0 && !_.upstreamSlots.some(
|
|
2561
|
+
(m) => k.insertAfter.some((T) => bt(m, T))
|
|
2400
2562
|
) || k.insertBefore && k.insertBefore.length > 0 && !_.downstreamSlots.some(
|
|
2401
|
-
(m) => k.insertBefore.some((T) =>
|
|
2563
|
+
(m) => k.insertBefore.some((T) => bt(m, T))
|
|
2402
2564
|
)));
|
|
2403
|
-
}, [e, q, A,
|
|
2404
|
-
if (!
|
|
2405
|
-
const
|
|
2406
|
-
id:
|
|
2407
|
-
kind: _ ?
|
|
2408
|
-
reactFlowType:
|
|
2409
|
-
descriptorType:
|
|
2565
|
+
}, [e, q, A, $, pt]), mt = Y((y) => {
|
|
2566
|
+
if (!V) return;
|
|
2567
|
+
const v = `${y.type}-${Date.now()}`, _ = y.reactFlowType === "filterNode" || y.reactFlowType === "approvalNode" || y.reactFlowType === "conditionBranchNode", k = y.branchLabels ?? { pass: "Pass", fail: "Fail" }, I = {
|
|
2568
|
+
id: v,
|
|
2569
|
+
kind: _ ? y.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
2570
|
+
reactFlowType: y.reactFlowType,
|
|
2571
|
+
descriptorType: y.type,
|
|
2410
2572
|
formData: {},
|
|
2411
|
-
nodeData: { title:
|
|
2573
|
+
nodeData: { title: y.label },
|
|
2412
2574
|
deletable: !0,
|
|
2413
2575
|
branchLabels: k
|
|
2414
2576
|
};
|
|
2415
|
-
if (
|
|
2416
|
-
const { filterId: m, branch: T } =
|
|
2577
|
+
if (ie) {
|
|
2578
|
+
const { filterId: m, branch: T } = ie;
|
|
2417
2579
|
J((S) => {
|
|
2418
2580
|
const C = [...S[m][T]];
|
|
2419
2581
|
if (_) {
|
|
2420
|
-
const ne = C.filter((
|
|
2421
|
-
return ne.splice(
|
|
2582
|
+
const ne = C.filter((ce) => ce.kind !== "end"), xt = ne.findIndex((ce) => ce.id === V), An = xt === -1 ? ne.length : xt + 1;
|
|
2583
|
+
return ne.splice(An, 0, I), {
|
|
2422
2584
|
...S,
|
|
2423
2585
|
[m]: { ...S[m], [T]: ne },
|
|
2424
|
-
[
|
|
2425
|
-
Object.keys(k).map((
|
|
2586
|
+
[v]: Object.fromEntries(
|
|
2587
|
+
Object.keys(k).map((ce) => [ce, [{ id: `end-${v}-${ce}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2426
2588
|
)
|
|
2427
2589
|
};
|
|
2428
2590
|
}
|
|
2429
|
-
const L = C.findIndex((ne) => ne.id ===
|
|
2430
|
-
return C.splice(
|
|
2591
|
+
const L = C.findIndex((ne) => ne.id === V), R = C.findIndex((ne) => ne.kind === "end"), B = L === -1 ? R === -1 ? C.length : R : L + 1;
|
|
2592
|
+
return C.splice(B, 0, I), { ...S, [m]: { ...S[m], [T]: C } };
|
|
2431
2593
|
});
|
|
2432
2594
|
} else
|
|
2433
|
-
_ ? (
|
|
2434
|
-
const T = m.findIndex((C) => C.id ===
|
|
2595
|
+
_ ? (oe((m) => {
|
|
2596
|
+
const T = m.findIndex((C) => C.id === V);
|
|
2435
2597
|
return [...m.filter((C) => C.kind !== "end").slice(0, T + 1), I];
|
|
2436
2598
|
}), J((m) => ({
|
|
2437
2599
|
...m,
|
|
2438
|
-
[
|
|
2439
|
-
Object.keys(k).map((T) => [T, [{ id: `end-${
|
|
2600
|
+
[v]: Object.fromEntries(
|
|
2601
|
+
Object.keys(k).map((T) => [T, [{ id: `end-${v}-${T}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2440
2602
|
)
|
|
2441
|
-
}))) :
|
|
2442
|
-
const T = m.findIndex((S) => S.id ===
|
|
2603
|
+
}))) : oe((m) => {
|
|
2604
|
+
const T = m.findIndex((S) => S.id === V);
|
|
2443
2605
|
return T === -1 ? m : [...m.slice(0, T + 1), I, ...m.slice(T + 1)];
|
|
2444
2606
|
});
|
|
2445
|
-
xe(null),
|
|
2446
|
-
}, [
|
|
2607
|
+
xe(null), st(null), it(v), H("nodeConfig");
|
|
2608
|
+
}, [V, ie]), wt = Y((y, v) => {
|
|
2447
2609
|
const _ = (m) => {
|
|
2448
2610
|
const T = m.label || m.key;
|
|
2449
2611
|
switch (m.kind) {
|
|
@@ -2457,14 +2619,14 @@ const Bt = ({
|
|
|
2457
2619
|
return T;
|
|
2458
2620
|
}
|
|
2459
2621
|
}, k = (m) => {
|
|
2460
|
-
const T =
|
|
2622
|
+
const T = se(y);
|
|
2461
2623
|
if ((T == null ? void 0 : T.descriptorType) !== "conditionBranch") return m;
|
|
2462
|
-
const C = (
|
|
2624
|
+
const C = (v.branchConfigs ?? []).map((B) => B.key).filter(Boolean);
|
|
2463
2625
|
if (C.length === 0) return m;
|
|
2464
|
-
const L = m[
|
|
2465
|
-
return C.forEach((
|
|
2466
|
-
|
|
2467
|
-
}), { ...m, [
|
|
2626
|
+
const L = m[y] ?? {}, R = {};
|
|
2627
|
+
return C.forEach((B) => {
|
|
2628
|
+
R[B] = L[B] ?? [{ id: `end-${y}-${B}`, kind: "end", reactFlowType: "endNode" }];
|
|
2629
|
+
}), { ...m, [y]: R };
|
|
2468
2630
|
}, I = (m, T) => {
|
|
2469
2631
|
if (m.descriptorType !== "conditionBranch") return { ...m, formData: T };
|
|
2470
2632
|
const S = T.branchConfigs ?? [], C = {};
|
|
@@ -2472,11 +2634,11 @@ const Bt = ({
|
|
|
2472
2634
|
L.key && (C[L.key] = _(L));
|
|
2473
2635
|
}), { ...m, formData: T, branchLabels: C };
|
|
2474
2636
|
};
|
|
2475
|
-
if (A.some((m) => m.id ===
|
|
2637
|
+
if (A.some((m) => m.id === y)) {
|
|
2476
2638
|
J((m) => {
|
|
2477
2639
|
const T = k(m);
|
|
2478
|
-
return
|
|
2479
|
-
const C = S.map((L) => L.id ===
|
|
2640
|
+
return oe((S) => {
|
|
2641
|
+
const C = S.map((L) => L.id === y ? I(L, v) : L);
|
|
2480
2642
|
return i == null || i({ slots: C, branches: T }), C;
|
|
2481
2643
|
}), T;
|
|
2482
2644
|
});
|
|
@@ -2485,33 +2647,35 @@ const Bt = ({
|
|
|
2485
2647
|
J((m) => {
|
|
2486
2648
|
const S = { ...k(m) };
|
|
2487
2649
|
for (const C of Object.keys(S)) {
|
|
2488
|
-
const L = (
|
|
2489
|
-
for (const
|
|
2490
|
-
if (S[C][
|
|
2491
|
-
return S[C] = { ...S[C], [
|
|
2650
|
+
const L = (R) => R.map((B) => B.id === y ? I(B, v) : B);
|
|
2651
|
+
for (const R of Object.keys(S[C]))
|
|
2652
|
+
if (S[C][R].some((B) => B.id === y))
|
|
2653
|
+
return S[C] = { ...S[C], [R]: L(S[C][R]) }, i == null || i({ slots: A, branches: S }), S;
|
|
2492
2654
|
}
|
|
2493
2655
|
return S;
|
|
2494
2656
|
});
|
|
2495
|
-
}, [A,
|
|
2496
|
-
() =>
|
|
2497
|
-
[A,
|
|
2498
|
-
),
|
|
2499
|
-
const
|
|
2500
|
-
return
|
|
2657
|
+
}, [A, $, se, i]), Z = K(() => se(Le ?? ""), [se, Le]), vt = K(() => Z != null && Z.descriptorType ? e.forType(Z.descriptorType) ?? null : null, [Z, e]), { nodes: Et, edges: zn } = K(
|
|
2658
|
+
() => is(A, $, s ? null : ht, dt, l, b, rt),
|
|
2659
|
+
[A, $, s, ht, dt, l, b, rt]
|
|
2660
|
+
), kt = K(() => {
|
|
2661
|
+
const y = x ? new Map(x.steps.map((v) => [v.nodeId, v])) : null;
|
|
2662
|
+
return Et.map((v) => {
|
|
2501
2663
|
let _ = {};
|
|
2502
|
-
if (
|
|
2503
|
-
const k =
|
|
2664
|
+
if (y) {
|
|
2665
|
+
const k = y.get(v.id);
|
|
2504
2666
|
k && (_ = { _executionStatus: k.status, _executionError: k.error });
|
|
2505
2667
|
}
|
|
2506
|
-
return
|
|
2668
|
+
return v.type === "subWorkflowNode" && N && (_.onPreview = (k) => {
|
|
2507
2669
|
var m;
|
|
2508
|
-
const I =
|
|
2509
|
-
|
|
2510
|
-
}), Object.keys(_).length > 0 ? { ...
|
|
2670
|
+
const I = se(v.id);
|
|
2671
|
+
lt({ workflowId: k, workflowLabel: ((m = I == null ? void 0 : I.formData) == null ? void 0 : m.workflowLabel) ?? void 0 });
|
|
2672
|
+
}), Object.keys(_).length > 0 ? { ...v, data: { ...v.data, ..._ } } : v;
|
|
2511
2673
|
});
|
|
2512
|
-
}, [
|
|
2513
|
-
}, onClickAddTrigger:
|
|
2514
|
-
|
|
2674
|
+
}, [Et, x, N, se]), Fn = K(() => ({ onEditNode: Ae, onDeleteNode: ut, onAddStep: () => {
|
|
2675
|
+
}, onClickAddTrigger: Re, messages: ge, nodeRegistry: e, nodeBody: ot }), [Ae, ut, Re, ge, e, ot]), Ln = Y(async () => {
|
|
2676
|
+
i && await i({ slots: A, branches: $ });
|
|
2677
|
+
}, [i, A, $]);
|
|
2678
|
+
return /* @__PURE__ */ u(qn.Provider, { value: Fn, children: /* @__PURE__ */ w(
|
|
2515
2679
|
"div",
|
|
2516
2680
|
{
|
|
2517
2681
|
className: "flowforge-canvas",
|
|
@@ -2519,6 +2683,8 @@ const Bt = ({
|
|
|
2519
2683
|
width: "100%",
|
|
2520
2684
|
height: "100%",
|
|
2521
2685
|
position: "relative",
|
|
2686
|
+
display: "flex",
|
|
2687
|
+
flexDirection: "column",
|
|
2522
2688
|
// CSS variable consumed by edge SCSS for primary/hover color
|
|
2523
2689
|
"--ff-primary": l.primaryColor ?? "#1dbf60",
|
|
2524
2690
|
"--ff-edge-color": l.edgeColor ?? "#b0bec5",
|
|
@@ -2531,72 +2697,86 @@ const Bt = ({
|
|
|
2531
2697
|
"--ff-font-family": l.fontFamily
|
|
2532
2698
|
},
|
|
2533
2699
|
children: [
|
|
2534
|
-
/* @__PURE__ */
|
|
2535
|
-
|
|
2700
|
+
!O && (i || W || M) && /* @__PURE__ */ u(
|
|
2701
|
+
qi,
|
|
2536
2702
|
{
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
nodesConnectable: !1,
|
|
2545
|
-
panOnScroll: z,
|
|
2546
|
-
zoomOnScroll: R,
|
|
2547
|
-
minZoom: B,
|
|
2548
|
-
maxZoom: Ee,
|
|
2549
|
-
snapToGrid: ke,
|
|
2550
|
-
snapGrid: te,
|
|
2551
|
-
proOptions: { hideAttribution: !0 },
|
|
2552
|
-
onNodeClick: (p, w) => {
|
|
2553
|
-
const _ = le(w.id);
|
|
2554
|
-
_ && (b != null && b(_) || (_.kind === "addTrigger" || _.kind === "triggerFixed" ? Le() : (_.kind === "userTask" || _.kind === "filter" || _.kind === "approval") && ze(w.id)));
|
|
2555
|
-
},
|
|
2556
|
-
children: [
|
|
2557
|
-
l.background !== "none" && /* @__PURE__ */ f(
|
|
2558
|
-
jn,
|
|
2559
|
-
{
|
|
2560
|
-
variant: l.background,
|
|
2561
|
-
color: l.backgroundColor ?? "#e0e0e0",
|
|
2562
|
-
gap: 20
|
|
2563
|
-
}
|
|
2564
|
-
),
|
|
2565
|
-
j && /* @__PURE__ */ f(Fn, { showInteractive: !1 }),
|
|
2566
|
-
W && /* @__PURE__ */ f(zn, { zoomable: !0, pannable: !0 }),
|
|
2567
|
-
/* @__PURE__ */ f(Pi, { onHeightsReady: kn, nodeCount: mt.length })
|
|
2568
|
-
]
|
|
2703
|
+
workflowName: M,
|
|
2704
|
+
onWorkflowNameChange: z,
|
|
2705
|
+
status: F,
|
|
2706
|
+
statusColor: D,
|
|
2707
|
+
onSave: i ? Ln : void 0,
|
|
2708
|
+
onCancel: W,
|
|
2709
|
+
saveLabel: G
|
|
2569
2710
|
}
|
|
2570
2711
|
),
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2712
|
+
/* @__PURE__ */ w("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: [
|
|
2713
|
+
/* @__PURE__ */ w(
|
|
2714
|
+
Rn,
|
|
2715
|
+
{
|
|
2716
|
+
nodes: kt,
|
|
2717
|
+
edges: zn,
|
|
2718
|
+
nodeTypes: On,
|
|
2719
|
+
edgeTypes: jn,
|
|
2720
|
+
fitView: ve,
|
|
2721
|
+
fitViewOptions: { padding: Ee },
|
|
2722
|
+
nodesDraggable: !1,
|
|
2723
|
+
nodesConnectable: !1,
|
|
2724
|
+
panOnScroll: ke,
|
|
2725
|
+
zoomOnScroll: ze,
|
|
2726
|
+
minZoom: Fe,
|
|
2727
|
+
maxZoom: _n,
|
|
2728
|
+
snapToGrid: Nn,
|
|
2729
|
+
snapGrid: Sn,
|
|
2730
|
+
proOptions: { hideAttribution: !0 },
|
|
2731
|
+
onNodeClick: (y, v) => {
|
|
2732
|
+
const _ = se(v.id);
|
|
2733
|
+
_ && (p != null && p(_) || (_.kind === "addTrigger" || _.kind === "triggerFixed" ? Re() : (_.kind === "userTask" || _.kind === "filter" || _.kind === "approval") && Ae(v.id)));
|
|
2734
|
+
},
|
|
2735
|
+
children: [
|
|
2736
|
+
l.background !== "none" && /* @__PURE__ */ u(
|
|
2737
|
+
Bn,
|
|
2738
|
+
{
|
|
2739
|
+
variant: l.background,
|
|
2740
|
+
color: l.backgroundColor ?? "#e0e0e0",
|
|
2741
|
+
gap: 20
|
|
2742
|
+
}
|
|
2743
|
+
),
|
|
2744
|
+
te && /* @__PURE__ */ u(Wn, { showInteractive: !1 }),
|
|
2745
|
+
he && /* @__PURE__ */ u(Gn, { zoomable: !0, pannable: !0 }),
|
|
2746
|
+
/* @__PURE__ */ u(Hi, { onHeightsReady: In, nodeCount: kt.length })
|
|
2747
|
+
]
|
|
2748
|
+
}
|
|
2749
|
+
),
|
|
2750
|
+
c ? de === "triggerSelect" && c(t.list(), gt, () => H(null)) : /* @__PURE__ */ u(Xi, { open: de === "triggerSelect", templates: t.list(), messages: ge, onSelect: gt, onClose: () => H(null), loadTriggerSources: f }),
|
|
2751
|
+
h ? de === "nodePicker" && h(yt(), mt, () => {
|
|
2752
|
+
H(null), xe(null);
|
|
2753
|
+
}) : /* @__PURE__ */ u(Ji, { open: de === "nodePicker", availableDescriptors: yt(), messages: ge, onSelect: mt, onClose: () => {
|
|
2754
|
+
H(null), xe(null);
|
|
2755
|
+
} }),
|
|
2756
|
+
g ? de === "nodeConfig" && g(vt ?? void 0, Z, wt, () => H(null)) : /* @__PURE__ */ u(Zi, { open: de === "nodeConfig", nodeId: Le, descriptor: vt, initialValues: Z == null ? void 0 : Z.formData, messages: ge, onSave: wt, onClose: () => H(null) }),
|
|
2757
|
+
N && Te && /* @__PURE__ */ u(
|
|
2758
|
+
Qi,
|
|
2759
|
+
{
|
|
2760
|
+
isOpen: !!Te,
|
|
2761
|
+
onClose: () => lt(null),
|
|
2762
|
+
workflowId: Te.workflowId,
|
|
2763
|
+
workflowLabel: Te.workflowLabel,
|
|
2764
|
+
onFetchWorkflow: N
|
|
2765
|
+
}
|
|
2766
|
+
)
|
|
2767
|
+
] })
|
|
2588
2768
|
]
|
|
2589
2769
|
}
|
|
2590
2770
|
) });
|
|
2591
|
-
},
|
|
2771
|
+
}, ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2592
2772
|
__proto__: null,
|
|
2593
|
-
WorkflowCanvas:
|
|
2594
|
-
default:
|
|
2595
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2596
|
-
function
|
|
2773
|
+
WorkflowCanvas: Yt,
|
|
2774
|
+
default: Yt
|
|
2775
|
+
}, Symbol.toStringTag, { value: "Module" })), Ue = "All";
|
|
2776
|
+
function ls({ template: e, onSelect: t }) {
|
|
2597
2777
|
var o, i;
|
|
2598
|
-
const n = e.triggerCategory ?
|
|
2599
|
-
return /* @__PURE__ */
|
|
2778
|
+
const n = e.triggerCategory ? vr[e.triggerCategory] : null, r = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
|
|
2779
|
+
return /* @__PURE__ */ w(
|
|
2600
2780
|
"div",
|
|
2601
2781
|
{
|
|
2602
2782
|
role: "button",
|
|
@@ -2624,23 +2804,23 @@ function Ji({ template: e, onSelect: t }) {
|
|
|
2624
2804
|
s.currentTarget.style.borderColor = "#e0e0e0", s.currentTarget.style.boxShadow = "none";
|
|
2625
2805
|
},
|
|
2626
2806
|
children: [
|
|
2627
|
-
/* @__PURE__ */
|
|
2628
|
-
e.icon && /* @__PURE__ */
|
|
2629
|
-
/* @__PURE__ */
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
e.description && /* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
|
|
2808
|
+
e.icon && /* @__PURE__ */ u("div", { style: { flexShrink: 0, width: 36, height: 36, borderRadius: 8, background: "#f5f5f5", display: "flex", alignItems: "center", justifyContent: "center" }, children: e.icon }),
|
|
2809
|
+
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2810
|
+
/* @__PURE__ */ u("div", { style: { fontWeight: 600, fontSize: 14, color: "#212121", marginBottom: 2 }, children: e.label }),
|
|
2811
|
+
e.description && /* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#757575", lineHeight: 1.4, display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden" }, children: e.description })
|
|
2632
2812
|
] })
|
|
2633
2813
|
] }),
|
|
2634
|
-
/* @__PURE__ */
|
|
2635
|
-
n && /* @__PURE__ */
|
|
2636
|
-
(i = e.tags) == null ? void 0 : i.map((s) => /* @__PURE__ */
|
|
2637
|
-
r > 0 && /* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
|
|
2815
|
+
n && /* @__PURE__ */ u("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: n.bg, color: n.color }, children: n.label }),
|
|
2816
|
+
(i = e.tags) == null ? void 0 : i.map((s) => /* @__PURE__ */ u("span", { style: { fontSize: 10, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#616161" }, children: s }, s)),
|
|
2817
|
+
r > 0 && /* @__PURE__ */ w("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
|
|
2638
2818
|
r,
|
|
2639
2819
|
" step",
|
|
2640
2820
|
r !== 1 ? "s" : ""
|
|
2641
2821
|
] })
|
|
2642
2822
|
] }),
|
|
2643
|
-
e.author && /* @__PURE__ */
|
|
2823
|
+
e.author && /* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#bdbdbd" }, children: [
|
|
2644
2824
|
"by ",
|
|
2645
2825
|
e.author
|
|
2646
2826
|
] })
|
|
@@ -2648,51 +2828,51 @@ function Ji({ template: e, onSelect: t }) {
|
|
|
2648
2828
|
}
|
|
2649
2829
|
);
|
|
2650
2830
|
}
|
|
2651
|
-
const
|
|
2831
|
+
const Ts = ({
|
|
2652
2832
|
templates: e,
|
|
2653
2833
|
onSelectTemplate: t,
|
|
2654
2834
|
onStartFromScratch: n
|
|
2655
2835
|
}) => {
|
|
2656
|
-
const [r, o] =
|
|
2836
|
+
const [r, o] = j(""), [i, s] = j(Ue), l = K(() => {
|
|
2657
2837
|
const a = /* @__PURE__ */ new Set();
|
|
2658
2838
|
return e.forEach((c) => {
|
|
2659
2839
|
c.category && a.add(c.category);
|
|
2660
|
-
}), [
|
|
2661
|
-
}, [e]), d =
|
|
2840
|
+
}), [Ue, ...Array.from(a)];
|
|
2841
|
+
}, [e]), d = K(() => {
|
|
2662
2842
|
let a = e;
|
|
2663
|
-
if (i !==
|
|
2843
|
+
if (i !== Ue && (a = a.filter((c) => c.category === i)), r.trim()) {
|
|
2664
2844
|
const c = r.toLowerCase();
|
|
2665
2845
|
a = a.filter(
|
|
2666
|
-
(
|
|
2846
|
+
(f) => {
|
|
2667
2847
|
var h, g;
|
|
2668
|
-
return
|
|
2848
|
+
return f.label.toLowerCase().includes(c) || ((h = f.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = f.tags) == null ? void 0 : g.some((p) => p.toLowerCase().includes(c)));
|
|
2669
2849
|
}
|
|
2670
2850
|
);
|
|
2671
2851
|
}
|
|
2672
|
-
return [...a].sort((c,
|
|
2852
|
+
return [...a].sort((c, f) => (f.popularity ?? 0) - (c.popularity ?? 0));
|
|
2673
2853
|
}, [e, i, r]);
|
|
2674
|
-
return /* @__PURE__ */
|
|
2675
|
-
/* @__PURE__ */
|
|
2676
|
-
/* @__PURE__ */
|
|
2677
|
-
/* @__PURE__ */
|
|
2678
|
-
/* @__PURE__ */
|
|
2679
|
-
/* @__PURE__ */
|
|
2854
|
+
return /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
|
|
2855
|
+
/* @__PURE__ */ w("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
|
|
2856
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
|
|
2857
|
+
/* @__PURE__ */ w("div", { children: [
|
|
2858
|
+
/* @__PURE__ */ u("h2", { style: { margin: 0, fontSize: 20, fontWeight: 700, color: "#212121" }, children: "Workflow Templates" }),
|
|
2859
|
+
/* @__PURE__ */ u("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#757575" }, children: "Choose a pre-built template or start from scratch" })
|
|
2680
2860
|
] }),
|
|
2681
|
-
n && /* @__PURE__ */
|
|
2861
|
+
n && /* @__PURE__ */ w(
|
|
2682
2862
|
"button",
|
|
2683
2863
|
{
|
|
2684
2864
|
onClick: n,
|
|
2685
2865
|
style: { display: "flex", alignItems: "center", gap: 6, padding: "8px 16px", border: "1.5px solid #1976d2", borderRadius: 6, background: "#fff", color: "#1976d2", fontSize: 13, fontWeight: 600, cursor: "pointer" },
|
|
2686
2866
|
children: [
|
|
2687
|
-
/* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ u(lr, { size: 16 }),
|
|
2688
2868
|
"Start from Scratch"
|
|
2689
2869
|
]
|
|
2690
2870
|
}
|
|
2691
2871
|
)
|
|
2692
2872
|
] }),
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2695
|
-
/* @__PURE__ */
|
|
2873
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
|
|
2874
|
+
/* @__PURE__ */ u(ar, { size: 18, color: "#9e9e9e" }),
|
|
2875
|
+
/* @__PURE__ */ u(
|
|
2696
2876
|
"input",
|
|
2697
2877
|
{
|
|
2698
2878
|
value: r,
|
|
@@ -2702,7 +2882,7 @@ const gs = ({
|
|
|
2702
2882
|
}
|
|
2703
2883
|
)
|
|
2704
2884
|
] }),
|
|
2705
|
-
l.length > 1 && /* @__PURE__ */
|
|
2885
|
+
l.length > 1 && /* @__PURE__ */ u("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: l.map((a) => /* @__PURE__ */ u(
|
|
2706
2886
|
"button",
|
|
2707
2887
|
{
|
|
2708
2888
|
onClick: () => s(a),
|
|
@@ -2722,31 +2902,31 @@ const gs = ({
|
|
|
2722
2902
|
a
|
|
2723
2903
|
)) })
|
|
2724
2904
|
] }),
|
|
2725
|
-
/* @__PURE__ */
|
|
2726
|
-
/* @__PURE__ */
|
|
2727
|
-
/* @__PURE__ */
|
|
2728
|
-
] }) : /* @__PURE__ */
|
|
2905
|
+
/* @__PURE__ */ u("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: d.length === 0 ? /* @__PURE__ */ w("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
|
|
2906
|
+
/* @__PURE__ */ u(dr, { size: 36, style: { marginBottom: 8 } }),
|
|
2907
|
+
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
2908
|
+
] }) : /* @__PURE__ */ u("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ u(ls, { template: a, onSelect: () => t(a) }, a.triggerKey)) }) })
|
|
2729
2909
|
] });
|
|
2730
2910
|
}, _e = {
|
|
2731
|
-
running: { label: "Running", color: ee.running, icon:
|
|
2732
|
-
success: { label: "Success", color: ee.success, icon:
|
|
2733
|
-
failed: { label: "Failed", color: ee.failed, icon:
|
|
2734
|
-
cancelled: { label: "Cancelled", color: ee.cancelled, icon:
|
|
2735
|
-
},
|
|
2736
|
-
pending: { color: ee.pending, icon:
|
|
2737
|
-
running: { color: ee.running, icon:
|
|
2738
|
-
success: { color: ee.success, icon:
|
|
2739
|
-
failed: { color: ee.failed, icon:
|
|
2740
|
-
skipped: { color: ee.skipped, icon:
|
|
2911
|
+
running: { label: "Running", color: ee.running, icon: P.createElement(Xt, { size: 14 }) },
|
|
2912
|
+
success: { label: "Success", color: ee.success, icon: P.createElement(qt, { size: 14 }) },
|
|
2913
|
+
failed: { label: "Failed", color: ee.failed, icon: P.createElement(Vt, { size: 14 }) },
|
|
2914
|
+
cancelled: { label: "Cancelled", color: ee.cancelled, icon: P.createElement(Ht, { size: 14 }) }
|
|
2915
|
+
}, as = {
|
|
2916
|
+
pending: { color: ee.pending, icon: P.createElement(cr, { size: 14 }) },
|
|
2917
|
+
running: { color: ee.running, icon: P.createElement(Xt, { size: 14 }) },
|
|
2918
|
+
success: { color: ee.success, icon: P.createElement(qt, { size: 14 }) },
|
|
2919
|
+
failed: { color: ee.failed, icon: P.createElement(Vt, { size: 14 }) },
|
|
2920
|
+
skipped: { color: ee.skipped, icon: P.createElement(Ht, { size: 14 }) }
|
|
2741
2921
|
};
|
|
2742
|
-
function
|
|
2922
|
+
function Je(e) {
|
|
2743
2923
|
try {
|
|
2744
2924
|
return new Date(e).toLocaleString();
|
|
2745
2925
|
} catch {
|
|
2746
2926
|
return e;
|
|
2747
2927
|
}
|
|
2748
2928
|
}
|
|
2749
|
-
function
|
|
2929
|
+
function Tn(e, t) {
|
|
2750
2930
|
try {
|
|
2751
2931
|
const n = new Date(t ?? (/* @__PURE__ */ new Date()).toISOString()).getTime() - new Date(e).getTime();
|
|
2752
2932
|
return n < 1e3 ? `${n}ms` : n < 6e4 ? `${(n / 1e3).toFixed(1)}s` : `${Math.floor(n / 6e4)}m ${Math.floor(n % 6e4 / 1e3)}s`;
|
|
@@ -2754,10 +2934,10 @@ function vn(e, t) {
|
|
|
2754
2934
|
return "—";
|
|
2755
2935
|
}
|
|
2756
2936
|
}
|
|
2757
|
-
function
|
|
2758
|
-
const [t, n] =
|
|
2759
|
-
return /* @__PURE__ */
|
|
2760
|
-
/* @__PURE__ */
|
|
2937
|
+
function ds({ step: e }) {
|
|
2938
|
+
const [t, n] = j(!1), r = as[e.status], o = !!(e.inputs || e.outputs || e.error);
|
|
2939
|
+
return /* @__PURE__ */ w("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
|
|
2940
|
+
/* @__PURE__ */ w(
|
|
2761
2941
|
"div",
|
|
2762
2942
|
{
|
|
2763
2943
|
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 12px", cursor: o ? "pointer" : "default" },
|
|
@@ -2770,30 +2950,30 @@ function Qi({ step: e }) {
|
|
|
2770
2950
|
o && (i.key === "Enter" || i.key === " ") && n((s) => !s);
|
|
2771
2951
|
},
|
|
2772
2952
|
children: [
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
e.branchTaken && /* @__PURE__ */
|
|
2776
|
-
/* @__PURE__ */
|
|
2777
|
-
o && /* @__PURE__ */
|
|
2953
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: P.cloneElement(r.icon, { color: r.color }) }),
|
|
2954
|
+
/* @__PURE__ */ u("span", { style: { flex: 1, fontSize: 13, color: "#212121" }, children: e.label || e.nodeId }),
|
|
2955
|
+
e.branchTaken && /* @__PURE__ */ u("span", { style: { fontSize: 10, padding: "1px 6px", borderRadius: 10, background: "#e3f2fd", color: "#1565c0", fontWeight: 600 }, children: e.branchTaken }),
|
|
2956
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ? Tn(e.startedAt, e.completedAt) : "—" }),
|
|
2957
|
+
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? P.createElement(ur, { size: 16 }) : P.createElement(hr, { size: 16 }) })
|
|
2778
2958
|
]
|
|
2779
2959
|
}
|
|
2780
2960
|
),
|
|
2781
|
-
t && o && /* @__PURE__ */
|
|
2782
|
-
e.error && /* @__PURE__ */
|
|
2783
|
-
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */
|
|
2784
|
-
/* @__PURE__ */
|
|
2785
|
-
/* @__PURE__ */
|
|
2961
|
+
t && o && /* @__PURE__ */ w("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
|
|
2962
|
+
e.error && /* @__PURE__ */ u("div", { style: { padding: "6px 10px", borderRadius: 6, background: "#ffebee", color: "#c62828", marginBottom: 6 }, children: e.error }),
|
|
2963
|
+
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ w("details", { style: { marginBottom: 4 }, children: [
|
|
2964
|
+
/* @__PURE__ */ u("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Inputs" }),
|
|
2965
|
+
/* @__PURE__ */ u("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.inputs, null, 2) })
|
|
2786
2966
|
] }),
|
|
2787
|
-
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */
|
|
2788
|
-
/* @__PURE__ */
|
|
2789
|
-
/* @__PURE__ */
|
|
2967
|
+
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ w("details", { children: [
|
|
2968
|
+
/* @__PURE__ */ u("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Outputs" }),
|
|
2969
|
+
/* @__PURE__ */ u("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.outputs, null, 2) })
|
|
2790
2970
|
] })
|
|
2791
2971
|
] })
|
|
2792
2972
|
] });
|
|
2793
2973
|
}
|
|
2794
|
-
function
|
|
2974
|
+
function cs({ record: e, selected: t, onSelect: n }) {
|
|
2795
2975
|
const r = _e[e.status];
|
|
2796
|
-
return /* @__PURE__ */
|
|
2976
|
+
return /* @__PURE__ */ w(
|
|
2797
2977
|
"div",
|
|
2798
2978
|
{
|
|
2799
2979
|
role: "button",
|
|
@@ -2813,10 +2993,10 @@ function es({ record: e, selected: t, onSelect: n }) {
|
|
|
2813
2993
|
outline: "none"
|
|
2814
2994
|
},
|
|
2815
2995
|
children: [
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: P.cloneElement(r.icon, { color: r.color, size: 16 }) }),
|
|
2997
|
+
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2998
|
+
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: Je(e.triggeredAt) }),
|
|
2999
|
+
/* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
|
|
2820
3000
|
e.triggeredBy ? `by ${e.triggeredBy}` : "System",
|
|
2821
3001
|
" · ",
|
|
2822
3002
|
e.steps.length,
|
|
@@ -2824,50 +3004,50 @@ function es({ record: e, selected: t, onSelect: n }) {
|
|
|
2824
3004
|
e.steps.length !== 1 ? "s" : ""
|
|
2825
3005
|
] })
|
|
2826
3006
|
] }),
|
|
2827
|
-
/* @__PURE__ */
|
|
2828
|
-
/* @__PURE__ */
|
|
3007
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 11, fontWeight: 600, color: r.color, flexShrink: 0 }, children: r.label }),
|
|
3008
|
+
/* @__PURE__ */ u(Ut, { size: 14, color: "#bdbdbd" })
|
|
2829
3009
|
]
|
|
2830
3010
|
}
|
|
2831
3011
|
);
|
|
2832
3012
|
}
|
|
2833
|
-
const
|
|
3013
|
+
const _s = ({ records: e, onViewOnCanvas: t }) => {
|
|
2834
3014
|
var s;
|
|
2835
|
-
const [n, r] =
|
|
2836
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
2837
|
-
/* @__PURE__ */
|
|
2838
|
-
/* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
] }) : /* @__PURE__ */
|
|
2841
|
-
/* @__PURE__ */
|
|
2842
|
-
/* @__PURE__ */
|
|
3015
|
+
const [n, r] = j(((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());
|
|
3016
|
+
return e.length === 0 ? /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
3017
|
+
/* @__PURE__ */ u(Nt, { size: 36 }),
|
|
3018
|
+
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
3019
|
+
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
|
|
3020
|
+
] }) : /* @__PURE__ */ w("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
|
|
3021
|
+
/* @__PURE__ */ w("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
|
|
3022
|
+
/* @__PURE__ */ w("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
|
|
2843
3023
|
"Run History (",
|
|
2844
3024
|
e.length,
|
|
2845
3025
|
")"
|
|
2846
3026
|
] }),
|
|
2847
|
-
i.map((l) => /* @__PURE__ */
|
|
3027
|
+
i.map((l) => /* @__PURE__ */ u(cs, { record: l, selected: l.id === n, onSelect: () => r(l.id) }, l.id))
|
|
2848
3028
|
] }),
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2851
|
-
/* @__PURE__ */
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
|
|
2854
|
-
/* @__PURE__ */
|
|
3029
|
+
/* @__PURE__ */ u("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ w("div", { children: [
|
|
3030
|
+
/* @__PURE__ */ w("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
3031
|
+
/* @__PURE__ */ w("div", { children: [
|
|
3032
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
3033
|
+
P.cloneElement(_e[o.status].icon, { color: _e[o.status].color, size: 18 }),
|
|
3034
|
+
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: _e[o.status].label })
|
|
2855
3035
|
] }),
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
3037
|
+
/* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3038
|
+
/* @__PURE__ */ u(Nt, { size: 13 }),
|
|
2859
3039
|
" ",
|
|
2860
|
-
|
|
2861
|
-
o.completedAt && ` → ${
|
|
3040
|
+
Je(o.triggeredAt),
|
|
3041
|
+
o.completedAt && ` → ${Je(o.completedAt)} (${Tn(o.triggeredAt, o.completedAt)})`
|
|
2862
3042
|
] }),
|
|
2863
|
-
o.triggeredBy && /* @__PURE__ */
|
|
2864
|
-
/* @__PURE__ */
|
|
3043
|
+
o.triggeredBy && /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3044
|
+
/* @__PURE__ */ u(fr, { size: 13 }),
|
|
2865
3045
|
" ",
|
|
2866
3046
|
o.triggeredBy
|
|
2867
3047
|
] })
|
|
2868
3048
|
] })
|
|
2869
3049
|
] }),
|
|
2870
|
-
t && /* @__PURE__ */
|
|
3050
|
+
t && /* @__PURE__ */ u(
|
|
2871
3051
|
"button",
|
|
2872
3052
|
{
|
|
2873
3053
|
onClick: () => t(o),
|
|
@@ -2876,22 +3056,22 @@ const ps = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2876
3056
|
}
|
|
2877
3057
|
)
|
|
2878
3058
|
] }),
|
|
2879
|
-
o.error && /* @__PURE__ */
|
|
2880
|
-
/* @__PURE__ */
|
|
2881
|
-
/* @__PURE__ */
|
|
3059
|
+
o.error && /* @__PURE__ */ u("div", { style: { margin: "12px 16px", padding: "10px 14px", borderRadius: 6, background: "#ffebee", color: "#c62828", fontSize: 13 }, children: o.error }),
|
|
3060
|
+
/* @__PURE__ */ w("div", { children: [
|
|
3061
|
+
/* @__PURE__ */ w("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
2882
3062
|
"STEPS (",
|
|
2883
3063
|
o.steps.length,
|
|
2884
3064
|
")"
|
|
2885
3065
|
] }),
|
|
2886
|
-
o.steps.map((l, d) => /* @__PURE__ */
|
|
3066
|
+
o.steps.map((l, d) => /* @__PURE__ */ u(ds, { step: l }, `${l.nodeId}-${d}`))
|
|
2887
3067
|
] }),
|
|
2888
|
-
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */
|
|
2889
|
-
/* @__PURE__ */
|
|
2890
|
-
/* @__PURE__ */
|
|
3068
|
+
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ u("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ w("details", { children: [
|
|
3069
|
+
/* @__PURE__ */ u("summary", { style: { cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#757575", marginBottom: 6 }, children: "TRIGGER INPUTS" }),
|
|
3070
|
+
/* @__PURE__ */ u("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 10, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(o.inputs, null, 2) })
|
|
2891
3071
|
] }) })
|
|
2892
|
-
] }) : /* @__PURE__ */
|
|
3072
|
+
] }) : /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%", color: "#9e9e9e", fontSize: 14 }, children: "Select a run to see details" }) })
|
|
2893
3073
|
] });
|
|
2894
|
-
},
|
|
3074
|
+
}, Ns = {
|
|
2895
3075
|
slots: [
|
|
2896
3076
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2897
3077
|
{ id: "trigger-END_USER_CREATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "New User Registration", nodeData: { label: "New User Registration" } },
|
|
@@ -2905,7 +3085,7 @@ const ps = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2905
3085
|
fail: [{ id: "notification-fail-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Rejection Notice", nodeData: { title: "Rejection Notice" } }]
|
|
2906
3086
|
}
|
|
2907
3087
|
}
|
|
2908
|
-
},
|
|
3088
|
+
}, Ss = {
|
|
2909
3089
|
slots: [
|
|
2910
3090
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2911
3091
|
{ id: "trigger-ACCESS_REQUEST", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "Access Request Submitted", nodeData: { label: "Access Request Submitted" } },
|
|
@@ -2923,7 +3103,7 @@ const ps = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2923
3103
|
]
|
|
2924
3104
|
}
|
|
2925
3105
|
}
|
|
2926
|
-
},
|
|
3106
|
+
}, Cs = {
|
|
2927
3107
|
slots: [
|
|
2928
3108
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2929
3109
|
{ id: "trigger-USER_DEACTIVATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "User Deactivation", nodeData: { label: "User Deactivation" } },
|
|
@@ -2932,7 +3112,7 @@ const ps = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2932
3112
|
{ id: "end", kind: "end", reactFlowType: "endNode", deletable: !1 }
|
|
2933
3113
|
],
|
|
2934
3114
|
branches: {}
|
|
2935
|
-
},
|
|
3115
|
+
}, Is = {
|
|
2936
3116
|
slots: [
|
|
2937
3117
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2938
3118
|
{ id: "trigger-WEBHOOK_TRIGGER", kind: "triggerFixed", reactFlowType: "webhookTriggerNode", deletable: !0, label: "Incoming Webhook", nodeData: { label: "Incoming Webhook" } },
|
|
@@ -2943,13 +3123,14 @@ const ps = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2943
3123
|
branches: {}
|
|
2944
3124
|
};
|
|
2945
3125
|
export {
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
3126
|
+
Yt as F,
|
|
3127
|
+
Qi as S,
|
|
3128
|
+
_s as W,
|
|
3129
|
+
qi as a,
|
|
3130
|
+
Ts as b,
|
|
3131
|
+
Ss as c,
|
|
3132
|
+
Cs as o,
|
|
3133
|
+
Ns as u,
|
|
3134
|
+
Is as w
|
|
2954
3135
|
};
|
|
2955
|
-
//# sourceMappingURL=templateSkeletons-
|
|
3136
|
+
//# sourceMappingURL=templateSkeletons-CEqw1Djn.js.map
|