@graph-render/react 1.0.1 → 1.1.0
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/CHANGELOG.md +60 -34
- package/README.md +73 -0
- package/dist/index.js +1611 -1910
- package/dist/src/components/Graph.d.ts.map +1 -1
- package/dist/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/src/hooks/useGraphSearchState.d.ts.map +1 -1
- package/dist/src/hooks/useGraphViewState.d.ts +29 -0
- package/dist/src/hooks/useGraphViewState.d.ts.map +1 -0
- package/dist/src/utils/columns.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/components/Graph.tsx +25 -90
- package/src/hooks/useGraphCollapse.ts +1 -1
- package/src/hooks/useGraphModel.ts +118 -94
- package/src/hooks/useGraphSearchState.ts +15 -17
- package/src/hooks/useGraphViewState.ts +151 -0
- package/src/utils/columns.ts +4 -2
- package/tsconfig.json +5 -1
package/dist/index.js
CHANGED
|
@@ -1,1549 +1,1277 @@
|
|
|
1
|
-
import { LayoutType as
|
|
2
|
-
import { EdgeType as
|
|
3
|
-
import
|
|
4
|
-
import { groupEdgesByTarget as
|
|
5
|
-
import { buildEdgePath as
|
|
6
|
-
var
|
|
1
|
+
import { LayoutType as Jt, EdgeType as qe, LayoutDirection as xe } from "@graph-render/types";
|
|
2
|
+
import { EdgeType as Vn, LayoutDirection as qn, LayoutType as Zn, NodeSide as Jn } from "@graph-render/types";
|
|
3
|
+
import Ft, { useState as ut, useMemo as A, useCallback as G, useRef as ot, useEffect as zt, useLayoutEffect as Jr, useId as Qr, useImperativeHandle as tn } from "react";
|
|
4
|
+
import { groupEdgesByTarget as en, sortEdgesBySourcePosition as rn, fromTypedNxGraph as nn, layoutNodes as we, routeEdges as Ze, buildEdgePath as on, normalizeGraphConfig as sn, DEFAULT_THEME as Je } from "@graph-render/core";
|
|
5
|
+
import { buildEdgePath as to, fromNxGraph as eo, layoutNodes as ro, renderGraphToSvg as no, routeEdges as oo } from "@graph-render/core";
|
|
6
|
+
var be = { exports: {} }, Xt = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
|
-
* react-jsx-runtime.production.
|
|
9
|
+
* react-jsx-runtime.production.js
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c)
|
|
11
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
var Qe;
|
|
17
|
+
function an() {
|
|
18
|
+
if (Qe) return Xt;
|
|
19
|
+
Qe = 1;
|
|
20
|
+
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
21
|
+
function s(n, o, i) {
|
|
22
|
+
var d = null;
|
|
23
|
+
if (i !== void 0 && (d = "" + i), o.key !== void 0 && (d = "" + o.key), "key" in o) {
|
|
24
|
+
i = {};
|
|
25
|
+
for (var l in o)
|
|
26
|
+
l !== "key" && (i[l] = o[l]);
|
|
27
|
+
} else i = o;
|
|
28
|
+
return o = i.ref, {
|
|
29
|
+
$$typeof: t,
|
|
30
|
+
type: n,
|
|
31
|
+
key: d,
|
|
32
|
+
ref: o !== void 0 ? o : null,
|
|
33
|
+
props: i
|
|
34
|
+
};
|
|
27
35
|
}
|
|
28
|
-
return
|
|
36
|
+
return Xt.Fragment = e, Xt.jsx = s, Xt.jsxs = s, Xt;
|
|
29
37
|
}
|
|
30
|
-
var
|
|
38
|
+
var Wt = {};
|
|
31
39
|
/**
|
|
32
40
|
* @license React
|
|
33
41
|
* react-jsx-runtime.development.js
|
|
34
42
|
*
|
|
35
|
-
* Copyright (c)
|
|
43
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
36
44
|
*
|
|
37
45
|
* This source code is licensed under the MIT license found in the
|
|
38
46
|
* LICENSE file in the root directory of this source tree.
|
|
39
47
|
*/
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
return null;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function E(t) {
|
|
52
|
-
{
|
|
53
|
-
for (var a = arguments.length, f = new Array(a > 1 ? a - 1 : 0), R = 1; R < a; R++)
|
|
54
|
-
f[R - 1] = arguments[R];
|
|
55
|
-
_("error", t, f);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function _(t, a, f) {
|
|
59
|
-
{
|
|
60
|
-
var R = y.ReactDebugCurrentFrame, M = R.getStackAddendum();
|
|
61
|
-
M !== "" && (a += "%s", f = f.concat([M]));
|
|
62
|
-
var W = f.map(function(z) {
|
|
63
|
-
return String(z);
|
|
64
|
-
});
|
|
65
|
-
W.unshift("Warning: " + a), Function.prototype.apply.call(console[t], console, W);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var x = !1, G = !1, ut = !1, rt = !1, S = !1, D;
|
|
69
|
-
D = Symbol.for("react.module.reference");
|
|
70
|
-
function H(t) {
|
|
71
|
-
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || S || t === o || t === T || t === v || rt || t === I || x || G || ut || typeof t == "object" && t !== null && (t.$$typeof === g || t.$$typeof === m || t.$$typeof === h || t.$$typeof === u || t.$$typeof === w || // This needs to include all possible module reference object
|
|
72
|
-
// types supported by any Flight configuration anywhere since
|
|
73
|
-
// we don't know which Flight build this will end up being used
|
|
74
|
-
// with.
|
|
75
|
-
t.$$typeof === D || t.getModuleId !== void 0));
|
|
76
|
-
}
|
|
77
|
-
function it(t, a, f) {
|
|
78
|
-
var R = t.displayName;
|
|
79
|
-
if (R)
|
|
80
|
-
return R;
|
|
81
|
-
var M = a.displayName || a.name || "";
|
|
82
|
-
return M !== "" ? f + "(" + M + ")" : f;
|
|
83
|
-
}
|
|
84
|
-
function q(t) {
|
|
85
|
-
return t.displayName || "Context";
|
|
86
|
-
}
|
|
87
|
-
function V(t) {
|
|
88
|
-
if (t == null)
|
|
89
|
-
return null;
|
|
90
|
-
if (typeof t.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
91
|
-
return t.displayName || t.name || null;
|
|
92
|
-
if (typeof t == "string")
|
|
93
|
-
return t;
|
|
94
|
-
switch (t) {
|
|
95
|
-
case i:
|
|
48
|
+
var tr;
|
|
49
|
+
function cn() {
|
|
50
|
+
return tr || (tr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
51
|
+
function t(a) {
|
|
52
|
+
if (a == null) return null;
|
|
53
|
+
if (typeof a == "function")
|
|
54
|
+
return a.$$typeof === D ? null : a.displayName || a.name || null;
|
|
55
|
+
if (typeof a == "string") return a;
|
|
56
|
+
switch (a) {
|
|
57
|
+
case N:
|
|
96
58
|
return "Fragment";
|
|
97
|
-
case
|
|
98
|
-
return "Portal";
|
|
99
|
-
case c:
|
|
59
|
+
case P:
|
|
100
60
|
return "Profiler";
|
|
101
|
-
case
|
|
61
|
+
case x:
|
|
102
62
|
return "StrictMode";
|
|
103
|
-
case
|
|
63
|
+
case q:
|
|
104
64
|
return "Suspense";
|
|
105
|
-
case
|
|
65
|
+
case et:
|
|
106
66
|
return "SuspenseList";
|
|
67
|
+
case C:
|
|
68
|
+
return "Activity";
|
|
107
69
|
}
|
|
108
|
-
if (typeof
|
|
109
|
-
switch (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return
|
|
116
|
-
case
|
|
117
|
-
return
|
|
118
|
-
case
|
|
119
|
-
var
|
|
120
|
-
return
|
|
121
|
-
case
|
|
122
|
-
|
|
70
|
+
if (typeof a == "object")
|
|
71
|
+
switch (typeof a.tag == "number" && console.error(
|
|
72
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
|
+
), a.$$typeof) {
|
|
74
|
+
case v:
|
|
75
|
+
return "Portal";
|
|
76
|
+
case f:
|
|
77
|
+
return a.displayName || "Context";
|
|
78
|
+
case p:
|
|
79
|
+
return (a._context.displayName || "Context") + ".Consumer";
|
|
80
|
+
case B:
|
|
81
|
+
var S = a.render;
|
|
82
|
+
return a = a.displayName, a || (a = S.displayName || S.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
|
|
83
|
+
case _:
|
|
84
|
+
return S = a.displayName || null, S !== null ? S : t(a.type) || "Memo";
|
|
85
|
+
case E:
|
|
86
|
+
S = a._payload, a = a._init;
|
|
123
87
|
try {
|
|
124
|
-
return
|
|
88
|
+
return t(a(S));
|
|
125
89
|
} catch {
|
|
126
|
-
return null;
|
|
127
90
|
}
|
|
128
|
-
}
|
|
129
91
|
}
|
|
130
92
|
return null;
|
|
131
93
|
}
|
|
132
|
-
|
|
133
|
-
|
|
94
|
+
function e(a) {
|
|
95
|
+
return "" + a;
|
|
134
96
|
}
|
|
135
|
-
|
|
136
|
-
function Kt() {
|
|
137
|
-
{
|
|
138
|
-
if (O === 0) {
|
|
139
|
-
A = console.log, Y = console.info, J = console.warn, dt = console.error, jt = console.group, vt = console.groupCollapsed, _t = console.groupEnd;
|
|
140
|
-
var t = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
value: Ft,
|
|
144
|
-
writable: !0
|
|
145
|
-
};
|
|
146
|
-
Object.defineProperties(console, {
|
|
147
|
-
info: t,
|
|
148
|
-
log: t,
|
|
149
|
-
warn: t,
|
|
150
|
-
error: t,
|
|
151
|
-
group: t,
|
|
152
|
-
groupCollapsed: t,
|
|
153
|
-
groupEnd: t
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
O++;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function ot() {
|
|
160
|
-
{
|
|
161
|
-
if (O--, O === 0) {
|
|
162
|
-
var t = {
|
|
163
|
-
configurable: !0,
|
|
164
|
-
enumerable: !0,
|
|
165
|
-
writable: !0
|
|
166
|
-
};
|
|
167
|
-
Object.defineProperties(console, {
|
|
168
|
-
log: at({}, t, {
|
|
169
|
-
value: A
|
|
170
|
-
}),
|
|
171
|
-
info: at({}, t, {
|
|
172
|
-
value: Y
|
|
173
|
-
}),
|
|
174
|
-
warn: at({}, t, {
|
|
175
|
-
value: J
|
|
176
|
-
}),
|
|
177
|
-
error: at({}, t, {
|
|
178
|
-
value: dt
|
|
179
|
-
}),
|
|
180
|
-
group: at({}, t, {
|
|
181
|
-
value: jt
|
|
182
|
-
}),
|
|
183
|
-
groupCollapsed: at({}, t, {
|
|
184
|
-
value: vt
|
|
185
|
-
}),
|
|
186
|
-
groupEnd: at({}, t, {
|
|
187
|
-
value: _t
|
|
188
|
-
})
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
O < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
var Q = y.ReactCurrentDispatcher, Lt;
|
|
195
|
-
function Tt(t, a, f) {
|
|
196
|
-
{
|
|
197
|
-
if (Lt === void 0)
|
|
198
|
-
try {
|
|
199
|
-
throw Error();
|
|
200
|
-
} catch (M) {
|
|
201
|
-
var R = M.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
-
Lt = R && R[1] || "";
|
|
203
|
-
}
|
|
204
|
-
return `
|
|
205
|
-
` + Lt + t;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var mt = !1, Gt;
|
|
209
|
-
{
|
|
210
|
-
var De = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
Gt = new De();
|
|
212
|
-
}
|
|
213
|
-
function me(t, a) {
|
|
214
|
-
if (!t || mt)
|
|
215
|
-
return "";
|
|
216
|
-
{
|
|
217
|
-
var f = Gt.get(t);
|
|
218
|
-
if (f !== void 0)
|
|
219
|
-
return f;
|
|
220
|
-
}
|
|
221
|
-
var R;
|
|
222
|
-
mt = !0;
|
|
223
|
-
var M = Error.prepareStackTrace;
|
|
224
|
-
Error.prepareStackTrace = void 0;
|
|
225
|
-
var W;
|
|
226
|
-
W = Q.current, Q.current = null, Kt();
|
|
97
|
+
function s(a) {
|
|
227
98
|
try {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (Object.defineProperty(z.prototype, "props", {
|
|
233
|
-
set: function() {
|
|
234
|
-
throw Error();
|
|
235
|
-
}
|
|
236
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
-
try {
|
|
238
|
-
Reflect.construct(z, []);
|
|
239
|
-
} catch (C) {
|
|
240
|
-
R = C;
|
|
241
|
-
}
|
|
242
|
-
Reflect.construct(t, [], z);
|
|
243
|
-
} else {
|
|
244
|
-
try {
|
|
245
|
-
z.call();
|
|
246
|
-
} catch (C) {
|
|
247
|
-
R = C;
|
|
248
|
-
}
|
|
249
|
-
t.call(z.prototype);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
try {
|
|
253
|
-
throw Error();
|
|
254
|
-
} catch (C) {
|
|
255
|
-
R = C;
|
|
256
|
-
}
|
|
257
|
-
t();
|
|
258
|
-
}
|
|
259
|
-
} catch (C) {
|
|
260
|
-
if (C && R && typeof C.stack == "string") {
|
|
261
|
-
for (var j = C.stack.split(`
|
|
262
|
-
`), nt = R.stack.split(`
|
|
263
|
-
`), B = j.length - 1, Z = nt.length - 1; B >= 1 && Z >= 0 && j[B] !== nt[Z]; )
|
|
264
|
-
Z--;
|
|
265
|
-
for (; B >= 1 && Z >= 0; B--, Z--)
|
|
266
|
-
if (j[B] !== nt[Z]) {
|
|
267
|
-
if (B !== 1 || Z !== 1)
|
|
268
|
-
do
|
|
269
|
-
if (B--, Z--, Z < 0 || j[B] !== nt[Z]) {
|
|
270
|
-
var ft = `
|
|
271
|
-
` + j[B].replace(" at new ", " at ");
|
|
272
|
-
return t.displayName && ft.includes("<anonymous>") && (ft = ft.replace("<anonymous>", t.displayName)), typeof t == "function" && Gt.set(t, ft), ft;
|
|
273
|
-
}
|
|
274
|
-
while (B >= 1 && Z >= 0);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
} finally {
|
|
279
|
-
mt = !1, Q.current = W, ot(), Error.prepareStackTrace = M;
|
|
280
|
-
}
|
|
281
|
-
var $ = t ? t.displayName || t.name : "", tt = $ ? Tt($) : "";
|
|
282
|
-
return typeof t == "function" && Gt.set(t, tt), tt;
|
|
283
|
-
}
|
|
284
|
-
function ne(t, a, f) {
|
|
285
|
-
return me(t, !1);
|
|
286
|
-
}
|
|
287
|
-
function ie(t) {
|
|
288
|
-
var a = t.prototype;
|
|
289
|
-
return !!(a && a.isReactComponent);
|
|
290
|
-
}
|
|
291
|
-
function ct(t, a, f) {
|
|
292
|
-
if (t == null)
|
|
293
|
-
return "";
|
|
294
|
-
if (typeof t == "function")
|
|
295
|
-
return me(t, ie(t));
|
|
296
|
-
if (typeof t == "string")
|
|
297
|
-
return Tt(t);
|
|
298
|
-
switch (t) {
|
|
299
|
-
case T:
|
|
300
|
-
return Tt("Suspense");
|
|
301
|
-
case v:
|
|
302
|
-
return Tt("SuspenseList");
|
|
303
|
-
}
|
|
304
|
-
if (typeof t == "object")
|
|
305
|
-
switch (t.$$typeof) {
|
|
306
|
-
case w:
|
|
307
|
-
return ne(t.render);
|
|
308
|
-
case m:
|
|
309
|
-
return ct(t.type, a, f);
|
|
310
|
-
case g: {
|
|
311
|
-
var R = t, M = R._payload, W = R._init;
|
|
312
|
-
try {
|
|
313
|
-
return ct(W(M), a, f);
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
var Pt = Object.prototype.hasOwnProperty, Yt = {}, Rt = y.ReactDebugCurrentFrame;
|
|
321
|
-
function yt(t) {
|
|
322
|
-
if (t) {
|
|
323
|
-
var a = t._owner, f = ct(t.type, t._source, a ? a.type : null);
|
|
324
|
-
Rt.setExtraStackFrame(f);
|
|
325
|
-
} else
|
|
326
|
-
Rt.setExtraStackFrame(null);
|
|
327
|
-
}
|
|
328
|
-
function ze(t, a, f, R, M) {
|
|
329
|
-
{
|
|
330
|
-
var W = Function.call.bind(Pt);
|
|
331
|
-
for (var z in t)
|
|
332
|
-
if (W(t, z)) {
|
|
333
|
-
var j = void 0;
|
|
334
|
-
try {
|
|
335
|
-
if (typeof t[z] != "function") {
|
|
336
|
-
var nt = Error((R || "React class") + ": " + f + " type `" + z + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[z] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
-
throw nt.name = "Invariant Violation", nt;
|
|
338
|
-
}
|
|
339
|
-
j = t[z](a, z, R, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (B) {
|
|
341
|
-
j = B;
|
|
342
|
-
}
|
|
343
|
-
j && !(j instanceof Error) && (yt(M), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", R || "React class", f, z, typeof j), yt(null)), j instanceof Error && !(j.message in Yt) && (Yt[j.message] = !0, yt(M), E("Failed %s type: %s", f, j.message), yt(null));
|
|
344
|
-
}
|
|
99
|
+
e(a);
|
|
100
|
+
var S = !1;
|
|
101
|
+
} catch {
|
|
102
|
+
S = !0;
|
|
345
103
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
return f;
|
|
104
|
+
if (S) {
|
|
105
|
+
S = console;
|
|
106
|
+
var j = S.error, F = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
107
|
+
return j.call(
|
|
108
|
+
S,
|
|
109
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
+
F
|
|
111
|
+
), e(a);
|
|
355
112
|
}
|
|
356
113
|
}
|
|
357
|
-
function
|
|
114
|
+
function n(a) {
|
|
115
|
+
if (a === N) return "<>";
|
|
116
|
+
if (typeof a == "object" && a !== null && a.$$typeof === E)
|
|
117
|
+
return "<...>";
|
|
358
118
|
try {
|
|
359
|
-
|
|
119
|
+
var S = t(a);
|
|
120
|
+
return S ? "<" + S + ">" : "<...>";
|
|
360
121
|
} catch {
|
|
361
|
-
return
|
|
122
|
+
return "<...>";
|
|
362
123
|
}
|
|
363
124
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
125
|
+
function o() {
|
|
126
|
+
var a = Y.A;
|
|
127
|
+
return a === null ? null : a.getOwner();
|
|
366
128
|
}
|
|
367
|
-
function
|
|
368
|
-
|
|
369
|
-
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ht(t)), Wt(t);
|
|
129
|
+
function i() {
|
|
130
|
+
return Error("react-stack-top-frame");
|
|
370
131
|
}
|
|
371
|
-
|
|
372
|
-
key
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
__source: !0
|
|
376
|
-
}, xe, we;
|
|
377
|
-
function Ne(t) {
|
|
378
|
-
if (Pt.call(t, "ref")) {
|
|
379
|
-
var a = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
380
|
-
if (a && a.isReactWarning)
|
|
381
|
-
return !1;
|
|
132
|
+
function d(a) {
|
|
133
|
+
if (X.call(a, "key")) {
|
|
134
|
+
var S = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
135
|
+
if (S && S.isReactWarning) return !1;
|
|
382
136
|
}
|
|
383
|
-
return
|
|
137
|
+
return a.key !== void 0;
|
|
384
138
|
}
|
|
385
|
-
function
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
return t.key !== void 0;
|
|
392
|
-
}
|
|
393
|
-
function ae(t, a) {
|
|
394
|
-
typeof t.ref == "string" && ve.current;
|
|
395
|
-
}
|
|
396
|
-
function be(t, a) {
|
|
397
|
-
{
|
|
398
|
-
var f = function() {
|
|
399
|
-
xe || (xe = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
400
|
-
};
|
|
401
|
-
f.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
402
|
-
get: f,
|
|
403
|
-
configurable: !0
|
|
404
|
-
});
|
|
139
|
+
function l(a, S) {
|
|
140
|
+
function j() {
|
|
141
|
+
R || (R = !0, console.error(
|
|
142
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
143
|
+
S
|
|
144
|
+
));
|
|
405
145
|
}
|
|
146
|
+
j.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
147
|
+
get: j,
|
|
148
|
+
configurable: !0
|
|
149
|
+
});
|
|
406
150
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
f.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
413
|
-
get: f,
|
|
414
|
-
configurable: !0
|
|
415
|
-
});
|
|
416
|
-
}
|
|
151
|
+
function T() {
|
|
152
|
+
var a = t(this.type);
|
|
153
|
+
return k[a] || (k[a] = !0, console.error(
|
|
154
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
|
+
)), a = this.props.ref, a !== void 0 ? a : null;
|
|
417
156
|
}
|
|
418
|
-
|
|
419
|
-
var
|
|
420
|
-
|
|
421
|
-
$$typeof:
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
return j._store = {}, Object.defineProperty(j._store, "validated", {
|
|
157
|
+
function w(a, S, j, F, J, K) {
|
|
158
|
+
var $ = j.ref;
|
|
159
|
+
return a = {
|
|
160
|
+
$$typeof: c,
|
|
161
|
+
type: a,
|
|
162
|
+
key: S,
|
|
163
|
+
props: j,
|
|
164
|
+
_owner: F
|
|
165
|
+
}, ($ !== void 0 ? $ : null) !== null ? Object.defineProperty(a, "ref", {
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
get: T
|
|
168
|
+
}) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
431
169
|
configurable: !1,
|
|
432
170
|
enumerable: !1,
|
|
433
171
|
writable: !0,
|
|
434
|
-
value:
|
|
435
|
-
}), Object.defineProperty(
|
|
172
|
+
value: 0
|
|
173
|
+
}), Object.defineProperty(a, "_debugInfo", {
|
|
436
174
|
configurable: !1,
|
|
437
175
|
enumerable: !1,
|
|
438
|
-
writable: !
|
|
439
|
-
value:
|
|
440
|
-
}), Object.defineProperty(
|
|
176
|
+
writable: !0,
|
|
177
|
+
value: null
|
|
178
|
+
}), Object.defineProperty(a, "_debugStack", {
|
|
441
179
|
configurable: !1,
|
|
442
180
|
enumerable: !1,
|
|
443
|
-
writable: !
|
|
444
|
-
value:
|
|
445
|
-
}), Object.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
for (W in a)
|
|
452
|
-
Pt.call(a, W) && !se.hasOwnProperty(W) && (z[W] = a[W]);
|
|
453
|
-
if (t && t.defaultProps) {
|
|
454
|
-
var B = t.defaultProps;
|
|
455
|
-
for (W in B)
|
|
456
|
-
z[W] === void 0 && (z[W] = B[W]);
|
|
457
|
-
}
|
|
458
|
-
if (j || nt) {
|
|
459
|
-
var Z = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
460
|
-
j && be(z, Z), nt && Ie(z, Z);
|
|
461
|
-
}
|
|
462
|
-
return xt(t, j, nt, M, R, ve.current, z);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
var bt = y.ReactCurrentOwner, Ot = y.ReactDebugCurrentFrame;
|
|
466
|
-
function Dt(t) {
|
|
467
|
-
if (t) {
|
|
468
|
-
var a = t._owner, f = ct(t.type, t._source, a ? a.type : null);
|
|
469
|
-
Ot.setExtraStackFrame(f);
|
|
470
|
-
} else
|
|
471
|
-
Ot.setExtraStackFrame(null);
|
|
472
|
-
}
|
|
473
|
-
var $t;
|
|
474
|
-
$t = !1;
|
|
475
|
-
function b(t) {
|
|
476
|
-
return typeof t == "object" && t !== null && t.$$typeof === r;
|
|
477
|
-
}
|
|
478
|
-
function gt() {
|
|
479
|
-
{
|
|
480
|
-
if (bt.current) {
|
|
481
|
-
var t = V(bt.current.type);
|
|
482
|
-
if (t)
|
|
483
|
-
return `
|
|
484
|
-
|
|
485
|
-
Check the render method of \`` + t + "`.";
|
|
486
|
-
}
|
|
487
|
-
return "";
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
function Ee(t) {
|
|
491
|
-
return "";
|
|
492
|
-
}
|
|
493
|
-
var Xt = {};
|
|
494
|
-
function _e(t) {
|
|
495
|
-
{
|
|
496
|
-
var a = gt();
|
|
497
|
-
if (!a) {
|
|
498
|
-
var f = typeof t == "string" ? t : t.displayName || t.name;
|
|
499
|
-
f && (a = `
|
|
500
|
-
|
|
501
|
-
Check the top-level render call using <` + f + ">.");
|
|
502
|
-
}
|
|
503
|
-
return a;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
function Te(t, a) {
|
|
507
|
-
{
|
|
508
|
-
if (!t._store || t._store.validated || t.key != null)
|
|
509
|
-
return;
|
|
510
|
-
t._store.validated = !0;
|
|
511
|
-
var f = _e(a);
|
|
512
|
-
if (Xt[f])
|
|
513
|
-
return;
|
|
514
|
-
Xt[f] = !0;
|
|
515
|
-
var R = "";
|
|
516
|
-
t && t._owner && t._owner !== bt.current && (R = " It was passed a child from " + V(t._owner.type) + "."), Dt(t), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, R), Dt(null);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
function Pe(t, a) {
|
|
520
|
-
{
|
|
521
|
-
if (typeof t != "object")
|
|
522
|
-
return;
|
|
523
|
-
if (lt(t))
|
|
524
|
-
for (var f = 0; f < t.length; f++) {
|
|
525
|
-
var R = t[f];
|
|
526
|
-
b(R) && Te(R, a);
|
|
527
|
-
}
|
|
528
|
-
else if (b(t))
|
|
529
|
-
t._store && (t._store.validated = !0);
|
|
530
|
-
else if (t) {
|
|
531
|
-
var M = X(t);
|
|
532
|
-
if (typeof M == "function" && M !== t.entries)
|
|
533
|
-
for (var W = M.call(t), z; !(z = W.next()).done; )
|
|
534
|
-
b(z.value) && Te(z.value, a);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
function Fe(t) {
|
|
539
|
-
{
|
|
540
|
-
var a = t.type;
|
|
541
|
-
if (a == null || typeof a == "string")
|
|
542
|
-
return;
|
|
543
|
-
var f;
|
|
544
|
-
if (typeof a == "function")
|
|
545
|
-
f = a.propTypes;
|
|
546
|
-
else if (typeof a == "object" && (a.$$typeof === w || // Note: Memo only checks outer props here.
|
|
547
|
-
// Inner props are checked in the reconciler.
|
|
548
|
-
a.$$typeof === m))
|
|
549
|
-
f = a.propTypes;
|
|
550
|
-
else
|
|
551
|
-
return;
|
|
552
|
-
if (f) {
|
|
553
|
-
var R = V(a);
|
|
554
|
-
ze(f, t.props, "prop", R, t);
|
|
555
|
-
} else if (a.PropTypes !== void 0 && !$t) {
|
|
556
|
-
$t = !0;
|
|
557
|
-
var M = V(a);
|
|
558
|
-
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
|
|
559
|
-
}
|
|
560
|
-
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
function Ye(t) {
|
|
564
|
-
{
|
|
565
|
-
for (var a = Object.keys(t.props), f = 0; f < a.length; f++) {
|
|
566
|
-
var R = a[f];
|
|
567
|
-
if (R !== "children" && R !== "key") {
|
|
568
|
-
Dt(t), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", R), Dt(null);
|
|
569
|
-
break;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
t.ref !== null && (Dt(t), E("Invalid attribute `ref` supplied to `React.Fragment`."), Dt(null));
|
|
573
|
-
}
|
|
181
|
+
writable: !0,
|
|
182
|
+
value: J
|
|
183
|
+
}), Object.defineProperty(a, "_debugTask", {
|
|
184
|
+
configurable: !1,
|
|
185
|
+
enumerable: !1,
|
|
186
|
+
writable: !0,
|
|
187
|
+
value: K
|
|
188
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
574
189
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
for (var $ = 0; $ < ft.length; $++)
|
|
596
|
-
Pe(ft[$], t);
|
|
597
|
-
Object.freeze && Object.freeze(ft);
|
|
598
|
-
} else
|
|
599
|
-
E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
|
-
else
|
|
601
|
-
Pe(ft, t);
|
|
602
|
-
}
|
|
603
|
-
if (Pt.call(a, "key")) {
|
|
604
|
-
var tt = V(t), C = Object.keys(a).filter(function($e) {
|
|
605
|
-
return $e !== "key";
|
|
606
|
-
}), Vt = C.length > 0 ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
607
|
-
if (!Bt[tt + Vt]) {
|
|
608
|
-
var We = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
|
|
609
|
-
E(`A props object containing a "key" prop is being spread into JSX:
|
|
190
|
+
function b(a, S, j, F, J, K) {
|
|
191
|
+
var $ = S.children;
|
|
192
|
+
if ($ !== void 0)
|
|
193
|
+
if (F)
|
|
194
|
+
if (Z($)) {
|
|
195
|
+
for (F = 0; F < $.length; F++)
|
|
196
|
+
h($[F]);
|
|
197
|
+
Object.freeze && Object.freeze($);
|
|
198
|
+
} else
|
|
199
|
+
console.error(
|
|
200
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
|
+
);
|
|
202
|
+
else h($);
|
|
203
|
+
if (X.call(S, "key")) {
|
|
204
|
+
$ = t(a);
|
|
205
|
+
var st = Object.keys(S).filter(function(ee) {
|
|
206
|
+
return ee !== "key";
|
|
207
|
+
});
|
|
208
|
+
F = 0 < st.length ? "{key: someKey, " + st.join(": ..., ") + ": ...}" : "{key: someKey}", wt[$ + F] || (st = 0 < st.length ? "{" + st.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
610
210
|
let props = %s;
|
|
611
211
|
<%s {...props} />
|
|
612
212
|
React keys must be passed directly to JSX without using spread:
|
|
613
213
|
let props = %s;
|
|
614
|
-
<%s key={someKey} {...props} />`,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
214
|
+
<%s key={someKey} {...props} />`,
|
|
215
|
+
F,
|
|
216
|
+
$,
|
|
217
|
+
st,
|
|
218
|
+
$
|
|
219
|
+
), wt[$ + F] = !0);
|
|
618
220
|
}
|
|
221
|
+
if ($ = null, j !== void 0 && (s(j), $ = "" + j), d(S) && (s(S.key), $ = "" + S.key), "key" in S) {
|
|
222
|
+
j = {};
|
|
223
|
+
for (var it in S)
|
|
224
|
+
it !== "key" && (j[it] = S[it]);
|
|
225
|
+
} else j = S;
|
|
226
|
+
return $ && l(
|
|
227
|
+
j,
|
|
228
|
+
typeof a == "function" ? a.displayName || a.name || "Unknown" : a
|
|
229
|
+
), w(
|
|
230
|
+
a,
|
|
231
|
+
$,
|
|
232
|
+
j,
|
|
233
|
+
o(),
|
|
234
|
+
J,
|
|
235
|
+
K
|
|
236
|
+
);
|
|
619
237
|
}
|
|
620
|
-
function
|
|
621
|
-
|
|
238
|
+
function h(a) {
|
|
239
|
+
m(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === E && (a._payload.status === "fulfilled" ? m(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
|
|
622
240
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
241
|
+
function m(a) {
|
|
242
|
+
return typeof a == "object" && a !== null && a.$$typeof === c;
|
|
625
243
|
}
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
|
|
244
|
+
var g = Ft, c = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), p = Symbol.for("react.consumer"), f = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), q = Symbol.for("react.suspense"), et = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), C = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), Y = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, Q = console.createTask ? console.createTask : function() {
|
|
245
|
+
return null;
|
|
246
|
+
};
|
|
247
|
+
g = {
|
|
248
|
+
react_stack_bottom_frame: function(a) {
|
|
249
|
+
return a();
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
var R, k = {}, O = g.react_stack_bottom_frame.bind(
|
|
253
|
+
g,
|
|
254
|
+
i
|
|
255
|
+
)(), W = Q(n(i)), wt = {};
|
|
256
|
+
Wt.Fragment = N, Wt.jsx = function(a, S, j) {
|
|
257
|
+
var F = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
258
|
+
return b(
|
|
259
|
+
a,
|
|
260
|
+
S,
|
|
261
|
+
j,
|
|
262
|
+
!1,
|
|
263
|
+
F ? Error("react-stack-top-frame") : O,
|
|
264
|
+
F ? Q(n(a)) : W
|
|
265
|
+
);
|
|
266
|
+
}, Wt.jsxs = function(a, S, j) {
|
|
267
|
+
var F = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return b(
|
|
269
|
+
a,
|
|
270
|
+
S,
|
|
271
|
+
j,
|
|
272
|
+
!0,
|
|
273
|
+
F ? Error("react-stack-top-frame") : O,
|
|
274
|
+
F ? Q(n(a)) : W
|
|
275
|
+
);
|
|
276
|
+
};
|
|
277
|
+
}()), Wt;
|
|
629
278
|
}
|
|
630
|
-
process.env.NODE_ENV === "production" ?
|
|
631
|
-
var
|
|
632
|
-
function
|
|
633
|
-
return
|
|
279
|
+
process.env.NODE_ENV === "production" ? be.exports = an() : be.exports = cn();
|
|
280
|
+
var M = be.exports;
|
|
281
|
+
function ue(t) {
|
|
282
|
+
return t.trim().toLowerCase();
|
|
634
283
|
}
|
|
635
|
-
function
|
|
636
|
-
const
|
|
637
|
-
return
|
|
638
|
-
const
|
|
639
|
-
if (!
|
|
284
|
+
function ln(t) {
|
|
285
|
+
const e = /* @__PURE__ */ new Map();
|
|
286
|
+
return t.forEach((s) => {
|
|
287
|
+
const n = s.meta;
|
|
288
|
+
if (!n)
|
|
640
289
|
return;
|
|
641
|
-
const o =
|
|
642
|
-
|
|
643
|
-
}),
|
|
290
|
+
const o = n.pathKeys, d = (Array.isArray(o) ? o : []).map((l) => typeof l == "string" ? l : typeof l == "object" && l !== null && "name" in l && typeof l.name == "string" ? l.name : null).filter((l) => typeof l == "string").map((l) => l.trim()).filter((l) => l.length > 0);
|
|
291
|
+
d.length && e.set(s.id, d);
|
|
292
|
+
}), e;
|
|
644
293
|
}
|
|
645
|
-
function
|
|
294
|
+
function un(t) {
|
|
646
295
|
const {
|
|
647
|
-
startNodeId:
|
|
296
|
+
startNodeId: e,
|
|
648
297
|
sourceIndex: s,
|
|
649
|
-
pathKey:
|
|
298
|
+
pathKey: n,
|
|
650
299
|
incomingEdgesByTarget: o,
|
|
651
|
-
pathKeysByNode:
|
|
652
|
-
maxNodes:
|
|
653
|
-
} =
|
|
654
|
-
{ nodeId:
|
|
300
|
+
pathKeysByNode: i,
|
|
301
|
+
maxNodes: d = 500
|
|
302
|
+
} = t, l = /* @__PURE__ */ new Set([e]), T = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set([`${e}|${s ?? ""}|${n ?? ""}`]), b = [
|
|
303
|
+
{ nodeId: e, sourceIndex: s ?? null, pathKey: n }
|
|
655
304
|
];
|
|
656
|
-
for (;
|
|
657
|
-
const
|
|
658
|
-
if (!
|
|
305
|
+
for (; b.length && !(l.size >= d); ) {
|
|
306
|
+
const h = b.pop();
|
|
307
|
+
if (!h)
|
|
659
308
|
continue;
|
|
660
|
-
const
|
|
661
|
-
let
|
|
662
|
-
|
|
663
|
-
if (
|
|
309
|
+
const m = o.get(h.nodeId) ?? [], g = h.pathKey ? ue(h.pathKey) : null;
|
|
310
|
+
let c = [];
|
|
311
|
+
g && i && (c = m.filter((v) => (i.get(v.source) ?? []).some((x) => ue(x) === g))), c.length || (h.sourceIndex == null ? c = m : m[h.sourceIndex] && (c = [m[h.sourceIndex]])), c.forEach((v) => {
|
|
312
|
+
if (T.has(v.id))
|
|
664
313
|
return;
|
|
665
|
-
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
nodeId:
|
|
669
|
-
sourceIndex:
|
|
670
|
-
pathKey:
|
|
314
|
+
T.add(v.id), l.add(v.source);
|
|
315
|
+
const N = (i == null ? void 0 : i.get(v.source)) ?? [], x = g ? N.findIndex((f) => ue(f) === g) : h.sourceIndex, P = typeof x == "number" && x >= 0 ? x : h.sourceIndex, p = `${v.source}|${P ?? ""}|${h.pathKey ?? ""}`;
|
|
316
|
+
w.has(p) || (w.add(p), b.push({
|
|
317
|
+
nodeId: v.source,
|
|
318
|
+
sourceIndex: P,
|
|
319
|
+
pathKey: h.pathKey
|
|
671
320
|
}));
|
|
672
321
|
});
|
|
673
322
|
}
|
|
674
|
-
return { nodes:
|
|
323
|
+
return { nodes: l, edges: T };
|
|
675
324
|
}
|
|
676
|
-
function
|
|
677
|
-
const [
|
|
678
|
-
() => new Map(
|
|
679
|
-
[r]
|
|
680
|
-
), v = k(() => {
|
|
681
|
-
const y = /* @__PURE__ */ new Map();
|
|
682
|
-
return r.forEach((E) => {
|
|
683
|
-
y.set(E.source, [...y.get(E.source) ?? [], E]), E.target !== E.source && y.set(E.target, [...y.get(E.target) ?? [], E]);
|
|
684
|
-
}), y;
|
|
685
|
-
}, [r]), m = k(() => {
|
|
686
|
-
const y = /* @__PURE__ */ new Map();
|
|
687
|
-
return e.forEach((E) => y.set(E.id, E.position)), y;
|
|
688
|
-
}, [e]), g = k(
|
|
689
|
-
() => gn(e),
|
|
325
|
+
function dn(t, e, s) {
|
|
326
|
+
const [n, o] = ut(null), [i, d] = ut(null), [l, T] = ut(null), w = A(
|
|
327
|
+
() => new Map(e.map((x) => [x.id, x])),
|
|
690
328
|
[e]
|
|
691
|
-
),
|
|
692
|
-
const
|
|
693
|
-
return
|
|
694
|
-
|
|
695
|
-
}),
|
|
696
|
-
}, [
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
329
|
+
), b = A(() => {
|
|
330
|
+
const x = /* @__PURE__ */ new Map();
|
|
331
|
+
return e.forEach((P) => {
|
|
332
|
+
x.set(P.source, [...x.get(P.source) ?? [], P]), P.target !== P.source && x.set(P.target, [...x.get(P.target) ?? [], P]);
|
|
333
|
+
}), x;
|
|
334
|
+
}, [e]), h = A(() => {
|
|
335
|
+
const x = /* @__PURE__ */ new Map();
|
|
336
|
+
return t.forEach((P) => x.set(P.id, P.position)), x;
|
|
337
|
+
}, [t]), m = A(
|
|
338
|
+
() => ln(t),
|
|
339
|
+
[t]
|
|
340
|
+
), g = A(() => {
|
|
341
|
+
const x = en(e);
|
|
342
|
+
return x.forEach((P, p) => {
|
|
343
|
+
x.set(p, rn(P, h));
|
|
344
|
+
}), x;
|
|
345
|
+
}, [e, h]), c = A(() => l ? un({
|
|
346
|
+
startNodeId: l.nodeId,
|
|
347
|
+
sourceIndex: l.sourceIndex,
|
|
348
|
+
pathKey: l.pathKey,
|
|
349
|
+
incomingEdgesByTarget: g,
|
|
350
|
+
pathKeysByNode: m
|
|
351
|
+
}) : null, [l, g, m]), v = A(() => {
|
|
352
|
+
if (!s && !c) return null;
|
|
353
|
+
const x = /* @__PURE__ */ new Map(), P = () => {
|
|
354
|
+
c && c.nodes.forEach((p) => {
|
|
355
|
+
const f = x.get(p) ?? { in: !1, out: !1 };
|
|
356
|
+
x.set(p, { ...f, in: !0, out: !0 });
|
|
708
357
|
});
|
|
709
358
|
};
|
|
710
|
-
if (
|
|
711
|
-
|
|
359
|
+
if (l)
|
|
360
|
+
P();
|
|
712
361
|
else {
|
|
713
362
|
if (s) {
|
|
714
|
-
if (
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
717
|
-
const
|
|
718
|
-
const
|
|
719
|
-
|
|
363
|
+
if (n) {
|
|
364
|
+
const p = w.get(n);
|
|
365
|
+
if (p) {
|
|
366
|
+
const f = (B, q) => {
|
|
367
|
+
const et = x.get(B) ?? { in: !1, out: !1 };
|
|
368
|
+
x.set(B, { ...et, [q]: !0 });
|
|
720
369
|
};
|
|
721
|
-
|
|
370
|
+
p.type === "undirected" ? (f(p.source, "in"), f(p.source, "out"), f(p.target, "in"), f(p.target, "out")) : (f(p.source, "out"), f(p.target, "in"));
|
|
722
371
|
}
|
|
723
|
-
} else if (
|
|
724
|
-
const
|
|
725
|
-
const
|
|
726
|
-
|
|
372
|
+
} else if (i) {
|
|
373
|
+
const p = (f, B) => {
|
|
374
|
+
const q = x.get(f) ?? { in: !1, out: !1 };
|
|
375
|
+
x.set(f, { ...q, [B]: !0 });
|
|
727
376
|
};
|
|
728
|
-
(
|
|
729
|
-
const
|
|
730
|
-
(
|
|
731
|
-
}),
|
|
377
|
+
(b.get(i) ?? []).forEach((f) => {
|
|
378
|
+
const B = f.type === "undirected";
|
|
379
|
+
(f.source === i || f.target === i) && (B ? (p(f.source, "in"), p(f.source, "out"), p(f.target, "in"), p(f.target, "out")) : (p(f.source, "out"), p(f.target, "in")));
|
|
380
|
+
}), p(i, "in"), p(i, "out");
|
|
732
381
|
}
|
|
733
382
|
}
|
|
734
|
-
|
|
383
|
+
P();
|
|
735
384
|
}
|
|
736
|
-
return
|
|
385
|
+
return x.size ? x : null;
|
|
737
386
|
}, [
|
|
738
|
-
|
|
739
|
-
|
|
387
|
+
w,
|
|
388
|
+
b,
|
|
740
389
|
s,
|
|
390
|
+
n,
|
|
741
391
|
i,
|
|
742
392
|
c,
|
|
743
|
-
l
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
}), [..._, ...E];
|
|
393
|
+
l
|
|
394
|
+
]), N = A(() => {
|
|
395
|
+
const x = /* @__PURE__ */ new Set();
|
|
396
|
+
if (l && c ? c.edges.forEach((f) => x.add(f)) : (s && (n ? x.add(n) : i && (b.get(i) ?? []).forEach((f) => {
|
|
397
|
+
(f.source === i || f.target === i) && x.add(f.id);
|
|
398
|
+
})), c && c.edges.forEach((f) => x.add(f))), !x.size) return e;
|
|
399
|
+
const P = [], p = [];
|
|
400
|
+
return e.forEach((f) => {
|
|
401
|
+
x.has(f.id) ? P.push(f) : p.push(f);
|
|
402
|
+
}), [...p, ...P];
|
|
754
403
|
}, [
|
|
755
|
-
|
|
404
|
+
b,
|
|
756
405
|
s,
|
|
406
|
+
n,
|
|
757
407
|
i,
|
|
408
|
+
e,
|
|
758
409
|
c,
|
|
759
|
-
|
|
760
|
-
l,
|
|
761
|
-
u
|
|
410
|
+
l
|
|
762
411
|
]);
|
|
763
412
|
return {
|
|
764
|
-
hoveredEdgeId:
|
|
413
|
+
hoveredEdgeId: n,
|
|
765
414
|
setHoveredEdgeId: o,
|
|
766
|
-
hoveredNodeId:
|
|
767
|
-
setHoveredNodeId:
|
|
768
|
-
focusedPath:
|
|
769
|
-
setFocusedPath:
|
|
770
|
-
pathHighlight:
|
|
771
|
-
hoveredNodeStates:
|
|
772
|
-
edgesForRender:
|
|
415
|
+
hoveredNodeId: i,
|
|
416
|
+
setHoveredNodeId: d,
|
|
417
|
+
focusedPath: l,
|
|
418
|
+
setFocusedPath: T,
|
|
419
|
+
pathHighlight: c,
|
|
420
|
+
hoveredNodeStates: v,
|
|
421
|
+
edgesForRender: N
|
|
773
422
|
};
|
|
774
423
|
}
|
|
775
|
-
const
|
|
776
|
-
collapsedNodeIds:
|
|
777
|
-
defaultCollapsedNodeIds:
|
|
424
|
+
const fn = ({
|
|
425
|
+
collapsedNodeIds: t,
|
|
426
|
+
defaultCollapsedNodeIds: e,
|
|
778
427
|
onCollapsedNodeIdsChange: s
|
|
779
428
|
}) => {
|
|
780
|
-
const [
|
|
781
|
-
|
|
782
|
-
), [
|
|
783
|
-
() => new Set(
|
|
784
|
-
[
|
|
785
|
-
),
|
|
786
|
-
(
|
|
787
|
-
const
|
|
788
|
-
|
|
429
|
+
const [n, o] = ut(
|
|
430
|
+
e ?? []
|
|
431
|
+
), [i, d] = ut([]), l = t ?? n, T = A(() => new Set(l), [l]), w = A(
|
|
432
|
+
() => new Set(i),
|
|
433
|
+
[i]
|
|
434
|
+
), b = G(
|
|
435
|
+
(h) => {
|
|
436
|
+
const g = typeof h == "function" ? h(l) : h;
|
|
437
|
+
t == null && o(g), s == null || s(g);
|
|
789
438
|
},
|
|
790
|
-
[
|
|
439
|
+
[l, t, s]
|
|
791
440
|
);
|
|
792
441
|
return {
|
|
793
|
-
collapsedIds:
|
|
794
|
-
collapsedNodeSet:
|
|
795
|
-
pendingExpansionNodeSet:
|
|
796
|
-
updateCollapsedNodeIds:
|
|
797
|
-
setPendingExpansionNodeIds:
|
|
442
|
+
collapsedIds: l,
|
|
443
|
+
collapsedNodeSet: T,
|
|
444
|
+
pendingExpansionNodeSet: w,
|
|
445
|
+
updateCollapsedNodeIds: b,
|
|
446
|
+
setPendingExpansionNodeIds: d
|
|
798
447
|
};
|
|
799
|
-
},
|
|
800
|
-
nodes:
|
|
801
|
-
edges:
|
|
448
|
+
}, hn = ({
|
|
449
|
+
nodes: t,
|
|
450
|
+
edges: e,
|
|
802
451
|
collapsedIds: s,
|
|
803
|
-
hiddenNodeIds:
|
|
452
|
+
hiddenNodeIds: n,
|
|
804
453
|
searchQuery: o,
|
|
805
|
-
hideUnmatchedSearch:
|
|
806
|
-
searchPredicate:
|
|
807
|
-
highlightedNodeIds:
|
|
808
|
-
highlightedEdgeIds:
|
|
809
|
-
highlightStrategy:
|
|
810
|
-
onSearchResultsChange:
|
|
454
|
+
hideUnmatchedSearch: i = !1,
|
|
455
|
+
searchPredicate: d,
|
|
456
|
+
highlightedNodeIds: l,
|
|
457
|
+
highlightedEdgeIds: T,
|
|
458
|
+
highlightStrategy: w,
|
|
459
|
+
onSearchResultsChange: b
|
|
811
460
|
}) => {
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
const
|
|
815
|
-
const
|
|
816
|
-
return
|
|
817
|
-
if (
|
|
461
|
+
const h = ot(b);
|
|
462
|
+
h.current = b;
|
|
463
|
+
const m = A(() => {
|
|
464
|
+
const _ = o == null ? void 0 : o.trim().toLowerCase();
|
|
465
|
+
return _ ? t.filter((E) => {
|
|
466
|
+
if (d)
|
|
818
467
|
try {
|
|
819
|
-
return
|
|
468
|
+
return d(E, _);
|
|
820
469
|
} catch {
|
|
821
470
|
return !1;
|
|
822
471
|
}
|
|
823
|
-
const
|
|
824
|
-
return
|
|
825
|
-
}).map((
|
|
826
|
-
}, [
|
|
827
|
-
() => new Set(
|
|
828
|
-
[
|
|
829
|
-
),
|
|
830
|
-
const
|
|
831
|
-
return
|
|
832
|
-
const
|
|
833
|
-
return
|
|
834
|
-
}).map((
|
|
835
|
-
}, [
|
|
472
|
+
const C = typeof E.label == "string" || typeof E.label == "number" ? String(E.label) : E.id;
|
|
473
|
+
return E.id.toLowerCase().includes(_) || C.toLowerCase().includes(_);
|
|
474
|
+
}).map((E) => E.id) : [];
|
|
475
|
+
}, [t, d, o]), g = A(
|
|
476
|
+
() => new Set(m),
|
|
477
|
+
[m]
|
|
478
|
+
), c = A(() => {
|
|
479
|
+
const _ = o == null ? void 0 : o.trim().toLowerCase();
|
|
480
|
+
return _ ? e.filter((E) => {
|
|
481
|
+
const C = E.label != null ? String(E.label).toLowerCase() : "";
|
|
482
|
+
return g.has(E.source) || g.has(E.target) || C.includes(_);
|
|
483
|
+
}).map((E) => E.id) : [];
|
|
484
|
+
}, [e, g, o]), v = A(() => o != null && o.trim() ? (() => {
|
|
836
485
|
try {
|
|
837
|
-
return (
|
|
838
|
-
nodes:
|
|
839
|
-
edges:
|
|
486
|
+
return (w == null ? void 0 : w({
|
|
487
|
+
nodes: t,
|
|
488
|
+
edges: e,
|
|
840
489
|
query: o,
|
|
841
|
-
matchedNodeIds:
|
|
842
|
-
matchedEdgeIds:
|
|
490
|
+
matchedNodeIds: m,
|
|
491
|
+
matchedEdgeIds: c
|
|
843
492
|
})) ?? { nodeIds: [], edgeIds: [] };
|
|
844
493
|
} catch {
|
|
845
494
|
return { nodeIds: [], edgeIds: [] };
|
|
846
495
|
}
|
|
847
|
-
})() : { nodeIds: [], edgeIds: [] }, [
|
|
496
|
+
})() : { nodeIds: [], edgeIds: [] }, [e, w, t, c, m, o]), N = A(
|
|
848
497
|
() => /* @__PURE__ */ new Set([
|
|
849
|
-
...
|
|
850
|
-
...
|
|
851
|
-
...
|
|
498
|
+
...m,
|
|
499
|
+
...v.nodeIds ?? [],
|
|
500
|
+
...l ?? []
|
|
852
501
|
]),
|
|
853
|
-
[
|
|
854
|
-
),
|
|
502
|
+
[v.nodeIds, l, m]
|
|
503
|
+
), x = A(
|
|
855
504
|
() => /* @__PURE__ */ new Set([
|
|
856
|
-
...
|
|
857
|
-
...
|
|
858
|
-
...
|
|
505
|
+
...c,
|
|
506
|
+
...v.edgeIds ?? [],
|
|
507
|
+
...T ?? []
|
|
859
508
|
]),
|
|
860
|
-
[
|
|
509
|
+
[v.edgeIds, T, c]
|
|
861
510
|
);
|
|
862
|
-
|
|
863
|
-
var
|
|
864
|
-
(
|
|
865
|
-
nodeIds:
|
|
866
|
-
edgeIds:
|
|
511
|
+
zt(() => {
|
|
512
|
+
var _;
|
|
513
|
+
(_ = h.current) == null || _.call(h, {
|
|
514
|
+
nodeIds: m,
|
|
515
|
+
edgeIds: c
|
|
867
516
|
});
|
|
868
|
-
}, [
|
|
869
|
-
const
|
|
870
|
-
const
|
|
871
|
-
return
|
|
872
|
-
|
|
873
|
-
}),
|
|
874
|
-
}, [
|
|
875
|
-
const
|
|
876
|
-
return
|
|
877
|
-
|
|
878
|
-
}),
|
|
879
|
-
}, [
|
|
880
|
-
const
|
|
881
|
-
return s.forEach((
|
|
882
|
-
const
|
|
883
|
-
for (;
|
|
884
|
-
const
|
|
885
|
-
!
|
|
517
|
+
}, [c, m]);
|
|
518
|
+
const P = A(() => {
|
|
519
|
+
const _ = new Set(n ?? []);
|
|
520
|
+
return i && (o != null && o.trim()) && t.forEach((E) => {
|
|
521
|
+
N.has(E.id) || _.add(E.id);
|
|
522
|
+
}), _;
|
|
523
|
+
}, [N, n, i, t, o]), p = A(() => {
|
|
524
|
+
const _ = /* @__PURE__ */ new Map();
|
|
525
|
+
return e.forEach((E) => {
|
|
526
|
+
_.set(E.source, [..._.get(E.source) ?? [], E.target]);
|
|
527
|
+
}), _;
|
|
528
|
+
}, [e]), f = A(() => {
|
|
529
|
+
const _ = new Set(P);
|
|
530
|
+
return s.forEach((E) => {
|
|
531
|
+
const C = [...p.get(E) ?? []];
|
|
532
|
+
for (; C.length; ) {
|
|
533
|
+
const D = C.pop();
|
|
534
|
+
!D || _.has(D) || (_.add(D), C.push(...p.get(D) ?? []));
|
|
886
535
|
}
|
|
887
|
-
}),
|
|
888
|
-
}, [s,
|
|
889
|
-
() =>
|
|
890
|
-
[
|
|
891
|
-
),
|
|
892
|
-
() =>
|
|
893
|
-
(
|
|
536
|
+
}), _;
|
|
537
|
+
}, [s, P, p]), B = A(
|
|
538
|
+
() => t.filter((_) => !f.has(_.id)),
|
|
539
|
+
[f, t]
|
|
540
|
+
), q = A(
|
|
541
|
+
() => e.filter(
|
|
542
|
+
(_) => !f.has(_.source) && !f.has(_.target)
|
|
894
543
|
),
|
|
895
|
-
[
|
|
544
|
+
[f, e]
|
|
896
545
|
);
|
|
897
546
|
return {
|
|
898
|
-
effectiveHighlightedNodeSet:
|
|
899
|
-
effectiveHighlightedEdgeSet:
|
|
900
|
-
visibleNodes:
|
|
901
|
-
visibleEdges:
|
|
902
|
-
childNodeIdsByParent:
|
|
547
|
+
effectiveHighlightedNodeSet: N,
|
|
548
|
+
effectiveHighlightedEdgeSet: x,
|
|
549
|
+
visibleNodes: B,
|
|
550
|
+
visibleEdges: q,
|
|
551
|
+
childNodeIdsByParent: p
|
|
903
552
|
};
|
|
904
|
-
},
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
553
|
+
}, dr = (t) => !!(t && Number.isFinite(t.x) && Number.isFinite(t.y)), $t = (t, e, s) => {
|
|
554
|
+
const n = new Set(e.map((i) => i.id));
|
|
555
|
+
if (t.length !== e.length)
|
|
907
556
|
throw new Error(
|
|
908
|
-
`${s} must return ${
|
|
557
|
+
`${s} must return ${e.length} nodes, received ${t.length}.`
|
|
909
558
|
);
|
|
910
559
|
const o = /* @__PURE__ */ new Set();
|
|
911
|
-
|
|
912
|
-
if (!
|
|
913
|
-
throw new Error(`${s} returned unknown node id "${
|
|
914
|
-
if (o.has(
|
|
915
|
-
throw new Error(`${s} returned duplicate node id "${
|
|
916
|
-
if (!
|
|
917
|
-
throw new Error(`${s} returned a non-finite position for node "${
|
|
918
|
-
o.add(
|
|
560
|
+
t.forEach((i) => {
|
|
561
|
+
if (!n.has(i.id))
|
|
562
|
+
throw new Error(`${s} returned unknown node id "${i.id}".`);
|
|
563
|
+
if (o.has(i.id))
|
|
564
|
+
throw new Error(`${s} returned duplicate node id "${i.id}".`);
|
|
565
|
+
if (!dr(i.position))
|
|
566
|
+
throw new Error(`${s} returned a non-finite position for node "${i.id}".`);
|
|
567
|
+
o.add(i.id);
|
|
919
568
|
});
|
|
920
|
-
},
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
if (
|
|
569
|
+
}, Bt = (t, e, s) => {
|
|
570
|
+
const n = /* @__PURE__ */ new Set();
|
|
571
|
+
t.forEach((o) => {
|
|
572
|
+
if (n.has(o.id))
|
|
924
573
|
throw new Error(`${s} returned duplicate edge id "${o.id}".`);
|
|
925
|
-
if (!
|
|
574
|
+
if (!e.has(o.source) || !e.has(o.target))
|
|
926
575
|
throw new Error(
|
|
927
576
|
`${s} returned edge "${o.id}" with unknown endpoint(s): ${o.source} -> ${o.target}.`
|
|
928
577
|
);
|
|
929
578
|
if (!Array.isArray(o.points) || o.points.length < 2)
|
|
930
579
|
throw new Error(`${s} returned edge "${o.id}" without a valid point path.`);
|
|
931
|
-
o.points.forEach((
|
|
932
|
-
if (!
|
|
580
|
+
o.points.forEach((i, d) => {
|
|
581
|
+
if (!dr(i))
|
|
933
582
|
throw new Error(
|
|
934
|
-
`${s} returned a non-finite point at index ${
|
|
583
|
+
`${s} returned a non-finite point at index ${d} for edge "${o.id}".`
|
|
935
584
|
);
|
|
936
|
-
}),
|
|
585
|
+
}), n.add(o.id);
|
|
937
586
|
});
|
|
938
|
-
},
|
|
939
|
-
...
|
|
940
|
-
layout:
|
|
941
|
-
}),
|
|
942
|
-
const s = new Map(
|
|
943
|
-
return
|
|
944
|
-
var
|
|
945
|
-
const o = s.get(
|
|
946
|
-
if (!o || !
|
|
587
|
+
}, at = (t) => t instanceof Error ? t : new Error(String(t)), er = (t) => we({
|
|
588
|
+
...t,
|
|
589
|
+
layout: Jt.Centered
|
|
590
|
+
}), rr = (t, e) => {
|
|
591
|
+
const s = new Map(t.map((n) => [n.id, n]));
|
|
592
|
+
return e.flatMap((n) => {
|
|
593
|
+
var b, h, m, g;
|
|
594
|
+
const o = s.get(n.source), i = s.get(n.target);
|
|
595
|
+
if (!o || !i)
|
|
947
596
|
return [];
|
|
948
|
-
const
|
|
949
|
-
if (o.id ===
|
|
950
|
-
const
|
|
597
|
+
const d = ((b = o.size) == null ? void 0 : b.width) ?? 0, l = ((h = o.size) == null ? void 0 : h.height) ?? 0, T = ((m = i.size) == null ? void 0 : m.width) ?? 0, w = ((g = i.size) == null ? void 0 : g.height) ?? 0;
|
|
598
|
+
if (o.id === i.id) {
|
|
599
|
+
const c = o.position.x + d, v = o.position.y;
|
|
951
600
|
return [
|
|
952
601
|
{
|
|
953
|
-
...
|
|
954
|
-
type:
|
|
602
|
+
...n,
|
|
603
|
+
type: n.type ?? qe.Directed,
|
|
955
604
|
points: [
|
|
956
|
-
{
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
605
|
+
{
|
|
606
|
+
x: c - Math.min(d * 0.25, 18),
|
|
607
|
+
y: v + Math.min(l * 0.35, 18)
|
|
608
|
+
},
|
|
609
|
+
{ x: c + 28, y: v - 20 },
|
|
610
|
+
{ x: c + 36, y: v + l / 2 },
|
|
611
|
+
{ x: c - Math.min(d * 0.25, 18), y: v + l * 0.8 }
|
|
960
612
|
]
|
|
961
613
|
}
|
|
962
614
|
];
|
|
963
615
|
}
|
|
964
616
|
return [
|
|
965
617
|
{
|
|
966
|
-
...
|
|
967
|
-
type:
|
|
618
|
+
...n,
|
|
619
|
+
type: n.type ?? qe.Directed,
|
|
968
620
|
points: [
|
|
969
621
|
{
|
|
970
|
-
x: o.position.x +
|
|
971
|
-
y: o.position.y +
|
|
622
|
+
x: o.position.x + d / 2,
|
|
623
|
+
y: o.position.y + l / 2
|
|
972
624
|
},
|
|
973
625
|
{
|
|
974
|
-
x:
|
|
975
|
-
y:
|
|
626
|
+
x: i.position.x + T / 2,
|
|
627
|
+
y: i.position.y + w / 2
|
|
976
628
|
}
|
|
977
629
|
]
|
|
978
630
|
}
|
|
979
631
|
];
|
|
980
632
|
});
|
|
981
|
-
},
|
|
982
|
-
graph:
|
|
983
|
-
config:
|
|
633
|
+
}, mn = ({
|
|
634
|
+
graph: t,
|
|
635
|
+
config: e,
|
|
984
636
|
mergedTheme: s,
|
|
985
|
-
collapsedIds:
|
|
637
|
+
collapsedIds: n,
|
|
986
638
|
hiddenNodeIds: o,
|
|
987
|
-
searchQuery:
|
|
988
|
-
hideUnmatchedSearch:
|
|
989
|
-
searchPredicate:
|
|
990
|
-
highlightedNodeIds:
|
|
991
|
-
highlightedEdgeIds:
|
|
992
|
-
highlightStrategy:
|
|
993
|
-
onSearchResultsChange:
|
|
994
|
-
layoutNodesOverride:
|
|
995
|
-
routeEdgesOverride:
|
|
996
|
-
onError:
|
|
639
|
+
searchQuery: i,
|
|
640
|
+
hideUnmatchedSearch: d = !1,
|
|
641
|
+
searchPredicate: l,
|
|
642
|
+
highlightedNodeIds: T,
|
|
643
|
+
highlightedEdgeIds: w,
|
|
644
|
+
highlightStrategy: b,
|
|
645
|
+
onSearchResultsChange: h,
|
|
646
|
+
layoutNodesOverride: m,
|
|
647
|
+
routeEdgesOverride: g,
|
|
648
|
+
onError: c
|
|
997
649
|
}) => {
|
|
998
|
-
const [
|
|
999
|
-
() =>
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
650
|
+
const [v, N] = ut({}), { nodes: x, edges: P } = A(
|
|
651
|
+
() => nn(t, e.defaultEdgeType, {
|
|
652
|
+
inputValidationMode: e.inputValidationMode
|
|
653
|
+
}),
|
|
654
|
+
[e.defaultEdgeType, e.inputValidationMode, t]
|
|
655
|
+
), p = e.failureBehavior === "degrade", f = A(
|
|
656
|
+
() => x.map((R) => ({
|
|
657
|
+
...R,
|
|
658
|
+
measuredSize: v[R.id] ?? R.measuredSize
|
|
1005
659
|
})),
|
|
1006
|
-
[
|
|
660
|
+
[v, x]
|
|
1007
661
|
);
|
|
1008
|
-
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1011
|
-
const
|
|
1012
|
-
return
|
|
662
|
+
zt(() => {
|
|
663
|
+
const R = new Set(x.map((k) => k.id));
|
|
664
|
+
N((k) => {
|
|
665
|
+
const O = Object.entries(k).filter(([W]) => R.has(W));
|
|
666
|
+
return O.length === Object.keys(k).length ? k : Object.fromEntries(O);
|
|
1013
667
|
});
|
|
1014
|
-
}, [
|
|
1015
|
-
const
|
|
1016
|
-
() =>
|
|
1017
|
-
...
|
|
1018
|
-
type:
|
|
668
|
+
}, [x]);
|
|
669
|
+
const B = A(
|
|
670
|
+
() => P.map((R) => ({
|
|
671
|
+
...R,
|
|
672
|
+
type: R.type ?? e.defaultEdgeType
|
|
1019
673
|
})),
|
|
1020
|
-
[
|
|
674
|
+
[e.defaultEdgeType, P]
|
|
1021
675
|
), {
|
|
1022
|
-
effectiveHighlightedNodeSet:
|
|
1023
|
-
effectiveHighlightedEdgeSet:
|
|
1024
|
-
visibleNodes:
|
|
1025
|
-
visibleEdges:
|
|
1026
|
-
childNodeIdsByParent:
|
|
1027
|
-
} =
|
|
1028
|
-
nodes:
|
|
1029
|
-
edges:
|
|
1030
|
-
collapsedIds:
|
|
676
|
+
effectiveHighlightedNodeSet: q,
|
|
677
|
+
effectiveHighlightedEdgeSet: et,
|
|
678
|
+
visibleNodes: _,
|
|
679
|
+
visibleEdges: E,
|
|
680
|
+
childNodeIdsByParent: C
|
|
681
|
+
} = hn({
|
|
682
|
+
nodes: f,
|
|
683
|
+
edges: B,
|
|
684
|
+
collapsedIds: n,
|
|
1031
685
|
hiddenNodeIds: o,
|
|
1032
|
-
searchQuery:
|
|
1033
|
-
hideUnmatchedSearch:
|
|
1034
|
-
searchPredicate:
|
|
1035
|
-
highlightedNodeIds:
|
|
1036
|
-
highlightedEdgeIds:
|
|
1037
|
-
highlightStrategy:
|
|
1038
|
-
onSearchResultsChange:
|
|
1039
|
-
}),
|
|
686
|
+
searchQuery: i,
|
|
687
|
+
hideUnmatchedSearch: d,
|
|
688
|
+
searchPredicate: l,
|
|
689
|
+
highlightedNodeIds: T,
|
|
690
|
+
highlightedEdgeIds: w,
|
|
691
|
+
highlightStrategy: b,
|
|
692
|
+
onSearchResultsChange: h
|
|
693
|
+
}), D = A(
|
|
1040
694
|
() => ({
|
|
1041
|
-
nodes:
|
|
1042
|
-
edges:
|
|
695
|
+
nodes: _,
|
|
696
|
+
edges: E,
|
|
1043
697
|
theme: s,
|
|
1044
|
-
padding:
|
|
1045
|
-
layout:
|
|
1046
|
-
width:
|
|
1047
|
-
height:
|
|
1048
|
-
layoutDirection:
|
|
1049
|
-
nodeSizing:
|
|
1050
|
-
fixedNodeSize:
|
|
1051
|
-
labelMeasurementPaddingX:
|
|
1052
|
-
labelMeasurementPaddingY:
|
|
1053
|
-
labelMeasurementCharWidth:
|
|
1054
|
-
labelMeasurementLineHeight:
|
|
698
|
+
padding: e.padding,
|
|
699
|
+
layout: e.layout,
|
|
700
|
+
width: e.width,
|
|
701
|
+
height: e.height,
|
|
702
|
+
layoutDirection: e.layoutDirection,
|
|
703
|
+
nodeSizing: e.nodeSizing,
|
|
704
|
+
fixedNodeSize: e.fixedNodeSize,
|
|
705
|
+
labelMeasurementPaddingX: e.labelMeasurementPaddingX,
|
|
706
|
+
labelMeasurementPaddingY: e.labelMeasurementPaddingY,
|
|
707
|
+
labelMeasurementCharWidth: e.labelMeasurementCharWidth,
|
|
708
|
+
labelMeasurementLineHeight: e.labelMeasurementLineHeight
|
|
1055
709
|
}),
|
|
1056
|
-
[
|
|
1057
|
-
),
|
|
1058
|
-
(
|
|
1059
|
-
|
|
1060
|
-
const
|
|
1061
|
-
return
|
|
1062
|
-
...
|
|
1063
|
-
[
|
|
710
|
+
[e, s, E, _]
|
|
711
|
+
), Y = G(
|
|
712
|
+
(R, k) => {
|
|
713
|
+
e.nodeSizing === "measured" && N((O) => {
|
|
714
|
+
const W = O[R];
|
|
715
|
+
return W && W.width === k.width && W.height === k.height ? O : {
|
|
716
|
+
...O,
|
|
717
|
+
[R]: k
|
|
1064
718
|
};
|
|
1065
719
|
});
|
|
1066
720
|
},
|
|
1067
|
-
[
|
|
1068
|
-
),
|
|
1069
|
-
()
|
|
1070
|
-
|
|
721
|
+
[e.nodeSizing]
|
|
722
|
+
), X = A(() => {
|
|
723
|
+
if (!m)
|
|
724
|
+
try {
|
|
725
|
+
const R = we(D);
|
|
726
|
+
return $t(R, _, "layout"), R;
|
|
727
|
+
} catch (R) {
|
|
728
|
+
if (c == null || c(at(R), {
|
|
729
|
+
graph: t,
|
|
730
|
+
phase: "layout"
|
|
731
|
+
}), !p)
|
|
732
|
+
throw at(R);
|
|
1071
733
|
try {
|
|
1072
|
-
const
|
|
1073
|
-
return
|
|
1074
|
-
} catch (
|
|
1075
|
-
|
|
1076
|
-
|
|
734
|
+
const k = er(D);
|
|
735
|
+
return $t(k, _, "layout"), k;
|
|
736
|
+
} catch (k) {
|
|
737
|
+
const O = at(k);
|
|
738
|
+
throw c == null || c(O, {
|
|
739
|
+
graph: t,
|
|
1077
740
|
phase: "layout"
|
|
1078
|
-
});
|
|
1079
|
-
try {
|
|
1080
|
-
const A = Er(H);
|
|
1081
|
-
return he(A, rt, "layout"), A;
|
|
1082
|
-
} catch (A) {
|
|
1083
|
-
const Y = Nt(A);
|
|
1084
|
-
throw l == null || l(Y, {
|
|
1085
|
-
graph: e,
|
|
1086
|
-
phase: "layout"
|
|
1087
|
-
}), Y;
|
|
1088
|
-
}
|
|
741
|
+
}), O;
|
|
1089
742
|
}
|
|
743
|
+
}
|
|
744
|
+
try {
|
|
745
|
+
const R = m(D);
|
|
746
|
+
return $t(R, _, "layout override"), R;
|
|
747
|
+
} catch (R) {
|
|
748
|
+
if (c == null || c(at(R), {
|
|
749
|
+
graph: t,
|
|
750
|
+
phase: "layout-override"
|
|
751
|
+
}), !p)
|
|
752
|
+
throw at(R);
|
|
1090
753
|
try {
|
|
1091
|
-
const
|
|
1092
|
-
return
|
|
1093
|
-
} catch (
|
|
1094
|
-
|
|
1095
|
-
graph: e,
|
|
1096
|
-
phase: "layout-override"
|
|
1097
|
-
});
|
|
754
|
+
const k = we(D);
|
|
755
|
+
return $t(k, _, "layout"), k;
|
|
756
|
+
} catch (k) {
|
|
757
|
+
c == null || c(at(k), { graph: t, phase: "layout" });
|
|
1098
758
|
try {
|
|
1099
|
-
const
|
|
1100
|
-
return
|
|
1101
|
-
} catch (
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
const Y = Er(H);
|
|
1105
|
-
return he(Y, rt, "layout"), Y;
|
|
1106
|
-
} catch (Y) {
|
|
1107
|
-
const J = Nt(Y);
|
|
1108
|
-
throw l == null || l(J, { graph: e, phase: "layout" }), J;
|
|
1109
|
-
}
|
|
759
|
+
const O = er(D);
|
|
760
|
+
return $t(O, _, "layout"), O;
|
|
761
|
+
} catch (O) {
|
|
762
|
+
const W = at(O);
|
|
763
|
+
throw c == null || c(W, { graph: t, phase: "layout" }), W;
|
|
1110
764
|
}
|
|
1111
765
|
}
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
), V = k(
|
|
766
|
+
}
|
|
767
|
+
}, [t, m, D, c, _]), Z = A(
|
|
1115
768
|
() => ({
|
|
1116
|
-
arrowPadding:
|
|
1117
|
-
straight: !
|
|
1118
|
-
layoutDirection:
|
|
1119
|
-
forceRightToLeft:
|
|
1120
|
-
routingStyle:
|
|
1121
|
-
edgeSeparation:
|
|
1122
|
-
selfLoopRadius:
|
|
769
|
+
arrowPadding: e.arrowPadding,
|
|
770
|
+
straight: !e.curveEdges || e.routingStyle === "orthogonal",
|
|
771
|
+
layoutDirection: e.layoutDirection,
|
|
772
|
+
forceRightToLeft: e.forceRightToLeft,
|
|
773
|
+
routingStyle: e.routingStyle,
|
|
774
|
+
edgeSeparation: e.edgeSeparation,
|
|
775
|
+
selfLoopRadius: e.selfLoopRadius
|
|
1123
776
|
}),
|
|
1124
|
-
[
|
|
1125
|
-
),
|
|
1126
|
-
() =>
|
|
1127
|
-
|
|
1128
|
-
if (!I)
|
|
1129
|
-
try {
|
|
1130
|
-
const A = xr(q, S, V);
|
|
1131
|
-
return pe(A, O, "routing"), A;
|
|
1132
|
-
} catch (A) {
|
|
1133
|
-
l == null || l(Nt(A), {
|
|
1134
|
-
graph: e,
|
|
1135
|
-
phase: "routing"
|
|
1136
|
-
});
|
|
1137
|
-
const Y = _r(q, S);
|
|
1138
|
-
return pe(Y, O, "routing"), Y;
|
|
1139
|
-
}
|
|
777
|
+
[e]
|
|
778
|
+
), Q = A(() => {
|
|
779
|
+
const R = new Set(X.map((k) => k.id));
|
|
780
|
+
if (!g)
|
|
1140
781
|
try {
|
|
1141
|
-
const
|
|
1142
|
-
return
|
|
1143
|
-
} catch (
|
|
1144
|
-
|
|
1145
|
-
graph:
|
|
1146
|
-
phase: "routing
|
|
1147
|
-
})
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
782
|
+
const k = Ze(X, E, Z);
|
|
783
|
+
return Bt(k, R, "routing"), k;
|
|
784
|
+
} catch (k) {
|
|
785
|
+
if (c == null || c(at(k), {
|
|
786
|
+
graph: t,
|
|
787
|
+
phase: "routing"
|
|
788
|
+
}), !p)
|
|
789
|
+
throw at(k);
|
|
790
|
+
const O = rr(X, E);
|
|
791
|
+
return Bt(O, R, "routing"), O;
|
|
792
|
+
}
|
|
793
|
+
try {
|
|
794
|
+
const k = g(X, E, Z);
|
|
795
|
+
return Bt(k, R, "routing override"), k;
|
|
796
|
+
} catch (k) {
|
|
797
|
+
if (c == null || c(at(k), {
|
|
798
|
+
graph: t,
|
|
799
|
+
phase: "routing-override"
|
|
800
|
+
}), !p)
|
|
801
|
+
throw at(k);
|
|
802
|
+
try {
|
|
803
|
+
const O = Ze(X, E, Z);
|
|
804
|
+
return Bt(O, R, "routing"), O;
|
|
805
|
+
} catch (O) {
|
|
806
|
+
c == null || c(at(O), { graph: t, phase: "routing" });
|
|
807
|
+
const W = rr(X, E);
|
|
808
|
+
return Bt(W, R, "routing"), W;
|
|
1156
809
|
}
|
|
810
|
+
}
|
|
811
|
+
}, [
|
|
812
|
+
Z,
|
|
813
|
+
t,
|
|
814
|
+
c,
|
|
815
|
+
p,
|
|
816
|
+
X,
|
|
817
|
+
g,
|
|
818
|
+
E
|
|
819
|
+
]);
|
|
820
|
+
return {
|
|
821
|
+
childNodeIdsByParent: C,
|
|
822
|
+
effectiveHighlightedEdgeSet: et,
|
|
823
|
+
effectiveHighlightedNodeSet: q,
|
|
824
|
+
handleNodeMeasure: Y,
|
|
825
|
+
positionedEdges: Q,
|
|
826
|
+
positionedNodes: X,
|
|
827
|
+
visibleEdges: E,
|
|
828
|
+
visibleNodesWithMeasuredSize: _
|
|
829
|
+
};
|
|
830
|
+
}, fr = 180, hr = 72, Qt = (t, e, s) => Math.min(Math.max(t, e), s), pn = (t) => t.length ? t.reduce(
|
|
831
|
+
(s, n) => {
|
|
832
|
+
var b, h;
|
|
833
|
+
const o = ((b = n.size) == null ? void 0 : b.width) ?? fr, i = ((h = n.size) == null ? void 0 : h.height) ?? hr, d = Math.min(s.minX, n.position.x), l = Math.min(s.minY, n.position.y), T = Math.max(s.maxX, n.position.x + o), w = Math.max(s.maxY, n.position.y + i);
|
|
834
|
+
return {
|
|
835
|
+
minX: d,
|
|
836
|
+
minY: l,
|
|
837
|
+
maxX: T,
|
|
838
|
+
maxY: w,
|
|
839
|
+
width: T - d,
|
|
840
|
+
height: w - l
|
|
841
|
+
};
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
minX: Number.POSITIVE_INFINITY,
|
|
845
|
+
minY: Number.POSITIVE_INFINITY,
|
|
846
|
+
maxX: Number.NEGATIVE_INFINITY,
|
|
847
|
+
maxY: Number.NEGATIVE_INFINITY,
|
|
848
|
+
width: 0,
|
|
849
|
+
height: 0
|
|
850
|
+
}
|
|
851
|
+
) : null, yn = (t, e, s, n, o, i) => {
|
|
852
|
+
if (!t || e <= 0 || s <= 0)
|
|
853
|
+
return { x: 0, y: 0, zoom: 1 };
|
|
854
|
+
const d = Math.max(t.width, 1), l = Math.max(t.height, 1), T = Math.max(e - n * 2, 1), w = Math.max(s - n * 2, 1), b = Qt(
|
|
855
|
+
Math.min(T / d, w / l),
|
|
856
|
+
o,
|
|
857
|
+
i
|
|
858
|
+
);
|
|
859
|
+
return {
|
|
860
|
+
x: n + (T - d * b) / 2 - t.minX * b,
|
|
861
|
+
y: n + (w - l * b) / 2 - t.minY * b,
|
|
862
|
+
zoom: b
|
|
863
|
+
};
|
|
864
|
+
}, gn = (t, e, s, n) => {
|
|
865
|
+
var T, w;
|
|
866
|
+
const o = ((T = t.size) == null ? void 0 : T.width) ?? fr, i = ((w = t.size) == null ? void 0 : w.height) ?? hr, d = t.position.x + o / 2, l = t.position.y + i / 2;
|
|
867
|
+
return {
|
|
868
|
+
x: e / 2 - d * n,
|
|
869
|
+
y: s / 2 - l * n,
|
|
870
|
+
zoom: n
|
|
871
|
+
};
|
|
872
|
+
}, xn = { x: 0, y: 0, zoom: 1 }, de = (t, e, s) => ({
|
|
873
|
+
x: Number.isFinite(t.x) ? t.x : 0,
|
|
874
|
+
y: Number.isFinite(t.y) ? t.y : 0,
|
|
875
|
+
zoom: Qt(Number.isFinite(t.zoom) ? t.zoom : 1, e, s)
|
|
876
|
+
}), wn = ({
|
|
877
|
+
controlledViewport: t,
|
|
878
|
+
defaultViewport: e,
|
|
879
|
+
safeMinZoom: s,
|
|
880
|
+
safeMaxZoom: n,
|
|
881
|
+
onViewportChange: o,
|
|
882
|
+
selectedNodeIds: i,
|
|
883
|
+
selectedEdgeIds: d,
|
|
884
|
+
defaultSelectedNodeIds: l,
|
|
885
|
+
defaultSelectedEdgeIds: T,
|
|
886
|
+
onSelectionChange: w,
|
|
887
|
+
controlledFocusedNodeId: b,
|
|
888
|
+
defaultFocusedNodeId: h,
|
|
889
|
+
onFocusedNodeChange: m
|
|
890
|
+
}) => {
|
|
891
|
+
const [g, c] = ut(
|
|
892
|
+
() => de({ ...xn, ...e ?? {} }, s, n)
|
|
893
|
+
), [v, N] = ut({
|
|
894
|
+
nodeIds: l ?? [],
|
|
895
|
+
edgeIds: T ?? []
|
|
896
|
+
}), [x, P] = ut(
|
|
897
|
+
h
|
|
898
|
+
), p = A(
|
|
899
|
+
() => de(t ?? g, s, n),
|
|
900
|
+
[t, g, n, s]
|
|
901
|
+
), f = ot(p);
|
|
902
|
+
f.current = p;
|
|
903
|
+
const B = ot(o);
|
|
904
|
+
B.current = o;
|
|
905
|
+
const q = A(
|
|
906
|
+
() => ({
|
|
907
|
+
nodeIds: i ?? v.nodeIds,
|
|
908
|
+
edgeIds: d ?? v.edgeIds
|
|
909
|
+
}),
|
|
910
|
+
[i, d, v]
|
|
911
|
+
), et = ot(q);
|
|
912
|
+
et.current = q;
|
|
913
|
+
const _ = b !== void 0 ? b : x, E = G(
|
|
914
|
+
(Y) => {
|
|
915
|
+
var R;
|
|
916
|
+
const X = f.current, Z = typeof Y == "function" ? Y(X) : Y, Q = de({ ...X, ...Z }, s, n);
|
|
917
|
+
t || c(Q), (R = B.current) == null || R.call(B, Q);
|
|
1157
918
|
},
|
|
1158
|
-
[
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
919
|
+
[t, n, s]
|
|
920
|
+
), C = G(
|
|
921
|
+
(Y) => {
|
|
922
|
+
const X = et.current, Z = typeof Y == "function" ? Y(X) : Y;
|
|
923
|
+
(i == null || d == null) && N((Q) => ({
|
|
924
|
+
nodeIds: i == null ? Z.nodeIds : Q.nodeIds,
|
|
925
|
+
edgeIds: d == null ? Z.edgeIds : Q.edgeIds
|
|
926
|
+
})), w == null || w(Z);
|
|
927
|
+
},
|
|
928
|
+
[w, d, i]
|
|
929
|
+
), D = G(
|
|
930
|
+
(Y) => {
|
|
931
|
+
b === void 0 && P(Y), m == null || m(Y);
|
|
932
|
+
},
|
|
933
|
+
[b, m]
|
|
1166
934
|
);
|
|
1167
935
|
return {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
936
|
+
viewport: p,
|
|
937
|
+
viewportRef: f,
|
|
938
|
+
selection: q,
|
|
939
|
+
selectionRef: et,
|
|
940
|
+
focusedNodeId: _,
|
|
941
|
+
updateViewport: E,
|
|
942
|
+
updateSelection: C,
|
|
943
|
+
updateFocusedNode: D
|
|
1176
944
|
};
|
|
1177
|
-
},
|
|
1178
|
-
if (Object.is(
|
|
945
|
+
}, nr = (t) => Object.prototype.toString.call(t) === "[object Object]", Ie = (t, e, s) => {
|
|
946
|
+
if (Object.is(t, e))
|
|
1179
947
|
return !0;
|
|
1180
|
-
if (typeof
|
|
948
|
+
if (typeof t == "function" || typeof e == "function" || !t || !e || typeof t != "object" || typeof e != "object")
|
|
1181
949
|
return !1;
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
950
|
+
const n = s.get(t);
|
|
951
|
+
if (n != null && n.has(e))
|
|
1184
952
|
return !0;
|
|
1185
|
-
if (Array.isArray(
|
|
1186
|
-
if (!Array.isArray(
|
|
953
|
+
if (Array.isArray(t) || Array.isArray(e)) {
|
|
954
|
+
if (!Array.isArray(t) || !Array.isArray(e) || t.length !== e.length)
|
|
1187
955
|
return !1;
|
|
1188
|
-
|
|
1189
|
-
for (let
|
|
1190
|
-
if (!
|
|
956
|
+
n ? n.add(e) : s.set(t, new WeakSet([e]));
|
|
957
|
+
for (let d = 0; d < t.length; d += 1)
|
|
958
|
+
if (!Ie(t[d], e[d], s))
|
|
1191
959
|
return !1;
|
|
1192
960
|
return !0;
|
|
1193
961
|
}
|
|
1194
|
-
if (!
|
|
962
|
+
if (!nr(t) || !nr(e))
|
|
1195
963
|
return !1;
|
|
1196
|
-
|
|
1197
|
-
const o = Object.keys(
|
|
1198
|
-
if (o.length !==
|
|
964
|
+
n ? n.add(e) : s.set(t, new WeakSet([e]));
|
|
965
|
+
const o = Object.keys(t), i = Object.keys(e);
|
|
966
|
+
if (o.length !== i.length)
|
|
1199
967
|
return !1;
|
|
1200
|
-
for (const
|
|
1201
|
-
if (!(
|
|
968
|
+
for (const d of o)
|
|
969
|
+
if (!(d in e) || !Ie(t[d], e[d], s))
|
|
1202
970
|
return !1;
|
|
1203
971
|
return !0;
|
|
1204
972
|
};
|
|
1205
|
-
function
|
|
1206
|
-
const
|
|
1207
|
-
return (
|
|
973
|
+
function bn(t) {
|
|
974
|
+
const e = ot(null);
|
|
975
|
+
return (e.current === null || !Ie(e.current, t, /* @__PURE__ */ new WeakMap())) && (e.current = t), e.current;
|
|
1208
976
|
}
|
|
1209
|
-
const
|
|
1210
|
-
var
|
|
1211
|
-
return ((
|
|
1212
|
-
},
|
|
1213
|
-
const s = [...
|
|
977
|
+
const In = 180, vn = 24, mr = (t) => {
|
|
978
|
+
var e;
|
|
979
|
+
return ((e = t.size) == null ? void 0 : e.width) ?? In;
|
|
980
|
+
}, fe = (t) => t.position.x + mr(t) / 2, pr = (t, e = vn) => {
|
|
981
|
+
const s = [...t].sort(
|
|
982
|
+
(o, i) => fe(o) - fe(i)
|
|
983
|
+
), n = [];
|
|
1214
984
|
return s.forEach((o) => {
|
|
1215
|
-
const
|
|
1216
|
-
if (!
|
|
1217
|
-
|
|
985
|
+
const i = fe(o), d = mr(o), l = n[n.length - 1];
|
|
986
|
+
if (!l) {
|
|
987
|
+
n.push({ centerX: i, avgWidth: d, nodes: [o] });
|
|
1218
988
|
return;
|
|
1219
989
|
}
|
|
1220
|
-
const
|
|
1221
|
-
if (Math.abs(
|
|
1222
|
-
|
|
990
|
+
const T = Math.max(e, Math.min(l.avgWidth, d) * 0.35);
|
|
991
|
+
if (Math.abs(i - l.centerX) > T) {
|
|
992
|
+
n.push({ centerX: i, avgWidth: d, nodes: [o] });
|
|
1223
993
|
return;
|
|
1224
994
|
}
|
|
1225
|
-
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1228
|
-
}),
|
|
995
|
+
l.nodes.push(o);
|
|
996
|
+
const w = l.nodes.length;
|
|
997
|
+
l.centerX = (l.centerX * (w - 1) + i) / w, l.avgWidth = (l.avgWidth * (w - 1) + d) / w;
|
|
998
|
+
}), n.map((o) => ({
|
|
1229
999
|
centerX: o.centerX,
|
|
1230
|
-
nodes: [...o.nodes].sort((
|
|
1000
|
+
nodes: [...o.nodes].sort((i, d) => i.position.y - d.position.y)
|
|
1231
1001
|
}));
|
|
1232
|
-
},
|
|
1233
|
-
|
|
1234
|
-
var v, m;
|
|
1235
|
-
const o = ((v = i.size) == null ? void 0 : v.width) ?? Dr, c = ((m = i.size) == null ? void 0 : m.height) ?? zr, h = Math.min(s.minX, i.position.x), u = Math.min(s.minY, i.position.y), w = Math.max(s.maxX, i.position.x + o), T = Math.max(s.maxY, i.position.y + c);
|
|
1236
|
-
return {
|
|
1237
|
-
minX: h,
|
|
1238
|
-
minY: u,
|
|
1239
|
-
maxX: w,
|
|
1240
|
-
maxY: T,
|
|
1241
|
-
width: w - h,
|
|
1242
|
-
height: T - u
|
|
1243
|
-
};
|
|
1244
|
-
},
|
|
1245
|
-
{
|
|
1246
|
-
minX: Number.POSITIVE_INFINITY,
|
|
1247
|
-
minY: Number.POSITIVE_INFINITY,
|
|
1248
|
-
maxX: Number.NEGATIVE_INFINITY,
|
|
1249
|
-
maxY: Number.NEGATIVE_INFINITY,
|
|
1250
|
-
width: 0,
|
|
1251
|
-
height: 0
|
|
1252
|
-
}
|
|
1253
|
-
) : null, Rn = (e, r, s, i, o, c) => {
|
|
1254
|
-
if (!e || r <= 0 || s <= 0)
|
|
1255
|
-
return { x: 0, y: 0, zoom: 1 };
|
|
1256
|
-
const h = Math.max(e.width, 1), u = Math.max(e.height, 1), w = Math.max(r - i * 2, 1), T = Math.max(s - i * 2, 1), v = Ae(
|
|
1257
|
-
Math.min(w / h, T / u),
|
|
1258
|
-
o,
|
|
1259
|
-
c
|
|
1260
|
-
);
|
|
1261
|
-
return {
|
|
1262
|
-
x: i + (w - h * v) / 2 - e.minX * v,
|
|
1263
|
-
y: i + (T - u * v) / 2 - e.minY * v,
|
|
1264
|
-
zoom: v
|
|
1265
|
-
};
|
|
1266
|
-
}, Sn = (e, r, s, i) => {
|
|
1267
|
-
var w, T;
|
|
1268
|
-
const o = ((w = e.size) == null ? void 0 : w.width) ?? Dr, c = ((T = e.size) == null ? void 0 : T.height) ?? zr, h = e.position.x + o / 2, u = e.position.y + c / 2;
|
|
1269
|
-
return {
|
|
1270
|
-
x: r / 2 - h * i,
|
|
1271
|
-
y: s / 2 - u * i,
|
|
1272
|
-
zoom: i
|
|
1273
|
-
};
|
|
1274
|
-
}, Ln = re.memo(function({
|
|
1275
|
-
edge: r,
|
|
1002
|
+
}, En = Ft.memo(function({
|
|
1003
|
+
edge: e,
|
|
1276
1004
|
color: s,
|
|
1277
|
-
width:
|
|
1005
|
+
width: n,
|
|
1278
1006
|
curveEdges: o,
|
|
1279
|
-
curveStrength:
|
|
1280
|
-
markerEnd:
|
|
1281
|
-
isHovered:
|
|
1282
|
-
isSelected:
|
|
1283
|
-
hoverColor:
|
|
1284
|
-
selectionColor:
|
|
1285
|
-
labelColor:
|
|
1286
|
-
selectionMarker:
|
|
1287
|
-
hoverMarker:
|
|
1288
|
-
hoverEnabled:
|
|
1289
|
-
hoverStrokeWidth:
|
|
1290
|
-
selectedStrokeWidth:
|
|
1291
|
-
hitStrokeWidth:
|
|
1292
|
-
onHoverChange:
|
|
1293
|
-
onClick:
|
|
1007
|
+
curveStrength: i,
|
|
1008
|
+
markerEnd: d,
|
|
1009
|
+
isHovered: l,
|
|
1010
|
+
isSelected: T,
|
|
1011
|
+
hoverColor: w,
|
|
1012
|
+
selectionColor: b,
|
|
1013
|
+
labelColor: h,
|
|
1014
|
+
selectionMarker: m,
|
|
1015
|
+
hoverMarker: g,
|
|
1016
|
+
hoverEnabled: c,
|
|
1017
|
+
hoverStrokeWidth: v,
|
|
1018
|
+
selectedStrokeWidth: N,
|
|
1019
|
+
hitStrokeWidth: x,
|
|
1020
|
+
onHoverChange: P,
|
|
1021
|
+
onClick: p
|
|
1294
1022
|
}) {
|
|
1295
|
-
const
|
|
1296
|
-
if (!
|
|
1297
|
-
const
|
|
1298
|
-
return /* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1023
|
+
const f = on(e, o, i);
|
|
1024
|
+
if (!f) return null;
|
|
1025
|
+
const B = l ? w : T ? b ?? w : s, q = l ? v ?? n : T ? N ?? n + 1 : n, et = l ? g ?? m ?? d : T ? m ?? d : d, _ = e.label != null && e.labelPosition ? String(e.label) : null;
|
|
1026
|
+
return /* @__PURE__ */ M.jsxs(M.Fragment, { children: [
|
|
1027
|
+
/* @__PURE__ */ M.jsx(
|
|
1300
1028
|
"path",
|
|
1301
1029
|
{
|
|
1302
|
-
d:
|
|
1030
|
+
d: f,
|
|
1303
1031
|
stroke: "transparent",
|
|
1304
|
-
strokeWidth:
|
|
1032
|
+
strokeWidth: x ?? n + 8,
|
|
1305
1033
|
fill: "none",
|
|
1306
1034
|
pointerEvents: "stroke",
|
|
1307
1035
|
"data-graph-edge-interactive": "true",
|
|
1308
|
-
onMouseEnter: () =>
|
|
1309
|
-
onMouseLeave: () =>
|
|
1310
|
-
onClick:
|
|
1036
|
+
onMouseEnter: () => c && (P == null ? void 0 : P(!0)),
|
|
1037
|
+
onMouseLeave: () => c && (P == null ? void 0 : P(!1)),
|
|
1038
|
+
onClick: p
|
|
1311
1039
|
}
|
|
1312
1040
|
),
|
|
1313
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ M.jsx(
|
|
1314
1042
|
"path",
|
|
1315
1043
|
{
|
|
1316
|
-
d:
|
|
1317
|
-
stroke:
|
|
1318
|
-
strokeWidth:
|
|
1044
|
+
d: f,
|
|
1045
|
+
stroke: B,
|
|
1046
|
+
strokeWidth: q,
|
|
1319
1047
|
fill: "none",
|
|
1320
|
-
markerEnd:
|
|
1048
|
+
markerEnd: e.type === "directed" ? et : void 0,
|
|
1321
1049
|
pointerEvents: "none"
|
|
1322
1050
|
}
|
|
1323
1051
|
),
|
|
1324
|
-
|
|
1052
|
+
_ && e.labelPosition ? /* @__PURE__ */ M.jsx(
|
|
1325
1053
|
"text",
|
|
1326
1054
|
{
|
|
1327
|
-
x:
|
|
1328
|
-
y:
|
|
1055
|
+
x: e.labelPosition.x,
|
|
1056
|
+
y: e.labelPosition.y - 6,
|
|
1329
1057
|
textAnchor: "middle",
|
|
1330
1058
|
fontSize: 12,
|
|
1331
1059
|
fontWeight: 600,
|
|
1332
|
-
fill:
|
|
1060
|
+
fill: h ?? "#334155",
|
|
1333
1061
|
pointerEvents: "none",
|
|
1334
|
-
children:
|
|
1062
|
+
children: _
|
|
1335
1063
|
}
|
|
1336
1064
|
) : null
|
|
1337
1065
|
] });
|
|
1338
|
-
}),
|
|
1339
|
-
function
|
|
1340
|
-
const
|
|
1066
|
+
}), Tn = 64, jt = 20, or = 8, _n = 12, Pn = 7, Ln = 48, kn = 12, Sn = 700;
|
|
1067
|
+
function yr(t) {
|
|
1068
|
+
const e = Math.min(Array.from(t).length, Ln);
|
|
1341
1069
|
return Math.max(
|
|
1342
|
-
|
|
1343
|
-
|
|
1070
|
+
Tn,
|
|
1071
|
+
e * Pn + _n * 2
|
|
1344
1072
|
);
|
|
1345
1073
|
}
|
|
1346
|
-
function
|
|
1347
|
-
const
|
|
1348
|
-
if (!
|
|
1074
|
+
function gr(t, e, s, n, o = !1) {
|
|
1075
|
+
const i = pr(t), d = i.map((m) => m.centerX);
|
|
1076
|
+
if (!d.length)
|
|
1349
1077
|
return { orderedXs: [], orderedLabels: [] };
|
|
1350
|
-
const
|
|
1351
|
-
const
|
|
1352
|
-
return
|
|
1353
|
-
}),
|
|
1354
|
-
return { orderedXs:
|
|
1078
|
+
const T = i.map((m) => m.nodes.length).map((m) => {
|
|
1079
|
+
const g = m * 2;
|
|
1080
|
+
return g <= 2 ? "Final" : `1/${g}`;
|
|
1081
|
+
}), w = n && n.length ? n : o ? T : [], b = e === Jt.Tree && s === xe.RTL ? [...d].reverse() : d, h = e === Jt.Tree && s === xe.RTL ? [...w].reverse() : w;
|
|
1082
|
+
return { orderedXs: b, orderedLabels: h };
|
|
1355
1083
|
}
|
|
1356
|
-
function
|
|
1357
|
-
positionedNodes:
|
|
1358
|
-
layout:
|
|
1084
|
+
function An({
|
|
1085
|
+
positionedNodes: t,
|
|
1086
|
+
layout: e,
|
|
1359
1087
|
layoutDirection: s,
|
|
1360
|
-
labels:
|
|
1088
|
+
labels: n,
|
|
1361
1089
|
autoLabels: o,
|
|
1362
|
-
labelOffset:
|
|
1363
|
-
pillBackground:
|
|
1364
|
-
pillBorderColor:
|
|
1365
|
-
pillTextColor:
|
|
1090
|
+
labelOffset: i,
|
|
1091
|
+
pillBackground: d = "#eef1f6",
|
|
1092
|
+
pillBorderColor: l = "#d7dbe3",
|
|
1093
|
+
pillTextColor: T = "#3f434b"
|
|
1366
1094
|
}) {
|
|
1367
|
-
const { orderedXs:
|
|
1095
|
+
const { orderedXs: w, orderedLabels: b } = gr(
|
|
1096
|
+
t,
|
|
1368
1097
|
e,
|
|
1369
|
-
r,
|
|
1370
1098
|
s,
|
|
1371
|
-
|
|
1099
|
+
n,
|
|
1372
1100
|
o
|
|
1373
1101
|
);
|
|
1374
|
-
if (!
|
|
1375
|
-
const
|
|
1376
|
-
(
|
|
1102
|
+
if (!w.length || !b.length) return null;
|
|
1103
|
+
const m = t.reduce(
|
|
1104
|
+
(g, c) => Math.min(g, c.position.y),
|
|
1377
1105
|
Number.POSITIVE_INFINITY
|
|
1378
|
-
) -
|
|
1379
|
-
return /* @__PURE__ */
|
|
1380
|
-
const
|
|
1381
|
-
return /* @__PURE__ */
|
|
1106
|
+
) - i;
|
|
1107
|
+
return /* @__PURE__ */ M.jsx("g", { "aria-label": "labels", children: w.map((g, c) => {
|
|
1108
|
+
const v = b[c] ?? "", N = yr(v), x = g;
|
|
1109
|
+
return /* @__PURE__ */ M.jsxs(
|
|
1382
1110
|
"g",
|
|
1383
1111
|
{
|
|
1384
|
-
transform: `translate(${
|
|
1112
|
+
transform: `translate(${x - N / 2}, ${m - jt + 6})`,
|
|
1385
1113
|
children: [
|
|
1386
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ M.jsx(
|
|
1387
1115
|
"rect",
|
|
1388
1116
|
{
|
|
1389
|
-
width:
|
|
1390
|
-
height:
|
|
1391
|
-
rx:
|
|
1392
|
-
ry:
|
|
1393
|
-
fill:
|
|
1394
|
-
stroke:
|
|
1117
|
+
width: N,
|
|
1118
|
+
height: jt,
|
|
1119
|
+
rx: or,
|
|
1120
|
+
ry: or,
|
|
1121
|
+
fill: d,
|
|
1122
|
+
stroke: l,
|
|
1395
1123
|
strokeWidth: 1
|
|
1396
1124
|
}
|
|
1397
1125
|
),
|
|
1398
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ M.jsx(
|
|
1399
1127
|
"text",
|
|
1400
1128
|
{
|
|
1401
|
-
x:
|
|
1402
|
-
y:
|
|
1403
|
-
fill:
|
|
1404
|
-
fontSize:
|
|
1405
|
-
fontWeight:
|
|
1129
|
+
x: N / 2,
|
|
1130
|
+
y: jt / 2 + 4,
|
|
1131
|
+
fill: T,
|
|
1132
|
+
fontSize: kn,
|
|
1133
|
+
fontWeight: Sn,
|
|
1406
1134
|
textAnchor: "middle",
|
|
1407
|
-
children:
|
|
1135
|
+
children: v
|
|
1408
1136
|
}
|
|
1409
1137
|
)
|
|
1410
1138
|
]
|
|
1411
1139
|
},
|
|
1412
|
-
`col-${
|
|
1140
|
+
`col-${g}`
|
|
1413
1141
|
);
|
|
1414
1142
|
}) });
|
|
1415
1143
|
}
|
|
1416
|
-
const
|
|
1144
|
+
const Rn = typeof window > "u" ? zt : Jr, xr = Ft.memo(
|
|
1417
1145
|
({
|
|
1418
|
-
node:
|
|
1419
|
-
Vertex:
|
|
1146
|
+
node: t,
|
|
1147
|
+
Vertex: e,
|
|
1420
1148
|
isSelected: s,
|
|
1421
|
-
isFocused:
|
|
1149
|
+
isFocused: n,
|
|
1422
1150
|
selectionColor: o,
|
|
1423
|
-
isHighlighted:
|
|
1424
|
-
activePathKey:
|
|
1425
|
-
activePathNodeIds:
|
|
1426
|
-
highlightColor:
|
|
1427
|
-
nodeBorderColor:
|
|
1428
|
-
nodeBorderWidth:
|
|
1429
|
-
hoverNodeBorderColor:
|
|
1430
|
-
hoverNodeBothColor:
|
|
1431
|
-
hoverNodeInColor:
|
|
1432
|
-
hoverNodeOutColor:
|
|
1433
|
-
hoverNodeHighlight:
|
|
1434
|
-
hoveredNodeStates:
|
|
1435
|
-
onNodeMeasure:
|
|
1436
|
-
onNodeFocus:
|
|
1437
|
-
onNodeClick:
|
|
1438
|
-
onNodeDoubleClick:
|
|
1439
|
-
onNodeMouseEnter:
|
|
1440
|
-
onNodeMouseLeave:
|
|
1441
|
-
onPathHover:
|
|
1442
|
-
onPathLeave:
|
|
1151
|
+
isHighlighted: i,
|
|
1152
|
+
activePathKey: d,
|
|
1153
|
+
activePathNodeIds: l,
|
|
1154
|
+
highlightColor: T,
|
|
1155
|
+
nodeBorderColor: w,
|
|
1156
|
+
nodeBorderWidth: b,
|
|
1157
|
+
hoverNodeBorderColor: h,
|
|
1158
|
+
hoverNodeBothColor: m,
|
|
1159
|
+
hoverNodeInColor: g,
|
|
1160
|
+
hoverNodeOutColor: c,
|
|
1161
|
+
hoverNodeHighlight: v,
|
|
1162
|
+
hoveredNodeStates: N,
|
|
1163
|
+
onNodeMeasure: x,
|
|
1164
|
+
onNodeFocus: P,
|
|
1165
|
+
onNodeClick: p,
|
|
1166
|
+
onNodeDoubleClick: f,
|
|
1167
|
+
onNodeMouseEnter: B,
|
|
1168
|
+
onNodeMouseLeave: q,
|
|
1169
|
+
onPathHover: et,
|
|
1170
|
+
onPathLeave: _
|
|
1443
1171
|
}) => {
|
|
1444
|
-
var
|
|
1445
|
-
const
|
|
1446
|
-
let
|
|
1447
|
-
s ?
|
|
1448
|
-
let
|
|
1449
|
-
s ||
|
|
1450
|
-
if (!
|
|
1172
|
+
var j, F;
|
|
1173
|
+
const E = ot(null), C = ((j = t.size) == null ? void 0 : j.width) ?? 180, D = ((F = t.size) == null ? void 0 : F.height) ?? 72, Y = 8, X = N == null ? void 0 : N.get(t.id), Z = (X == null ? void 0 : X.in) ?? !1, Q = (X == null ? void 0 : X.out) ?? !1, R = Z && Q, k = Z || Q, O = !!w && b > 0 || s;
|
|
1174
|
+
let W = w;
|
|
1175
|
+
s ? W = o : i ? W = T : O ? v && (R ? W = m : Q ? W = c : Z ? W = g : k && (W = h)) : W = "none";
|
|
1176
|
+
let wt = 0;
|
|
1177
|
+
s || i ? wt = 1 : O && (wt = v && k ? 1 : 0.4), Rn(() => {
|
|
1178
|
+
if (!E.current || !x)
|
|
1451
1179
|
return;
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1454
|
-
},
|
|
1455
|
-
var
|
|
1180
|
+
const J = () => {
|
|
1181
|
+
C > 0 && D > 0 && x(t.id, { width: Math.ceil(C), height: Math.ceil(D) });
|
|
1182
|
+
}, K = requestAnimationFrame(() => {
|
|
1183
|
+
var $, st;
|
|
1456
1184
|
try {
|
|
1457
|
-
if (typeof ((
|
|
1458
|
-
|
|
1185
|
+
if (typeof (($ = E.current) == null ? void 0 : $.getBBox) != "function") {
|
|
1186
|
+
J();
|
|
1459
1187
|
return;
|
|
1460
1188
|
}
|
|
1461
|
-
const
|
|
1462
|
-
if (
|
|
1463
|
-
|
|
1464
|
-
width: Math.ceil(
|
|
1465
|
-
height: Math.ceil(
|
|
1189
|
+
const it = (st = E.current) == null ? void 0 : st.getBBox();
|
|
1190
|
+
if (it && it.width > 0 && it.height > 0) {
|
|
1191
|
+
x(t.id, {
|
|
1192
|
+
width: Math.ceil(it.width),
|
|
1193
|
+
height: Math.ceil(it.height)
|
|
1466
1194
|
});
|
|
1467
1195
|
return;
|
|
1468
1196
|
}
|
|
1469
1197
|
} catch {
|
|
1470
|
-
|
|
1198
|
+
J();
|
|
1471
1199
|
}
|
|
1472
|
-
|
|
1200
|
+
J();
|
|
1473
1201
|
});
|
|
1474
|
-
return () => cancelAnimationFrame(
|
|
1475
|
-
}, [
|
|
1476
|
-
const
|
|
1477
|
-
return /* @__PURE__ */
|
|
1202
|
+
return () => cancelAnimationFrame(K);
|
|
1203
|
+
}, [t.id, t.label, t.meta, x, C, D]);
|
|
1204
|
+
const a = s || i ? Math.max(2, b) : O ? b : 0, S = n ? Math.max(2, a || 2) : 0;
|
|
1205
|
+
return /* @__PURE__ */ M.jsxs(
|
|
1478
1206
|
"g",
|
|
1479
1207
|
{
|
|
1480
|
-
ref:
|
|
1481
|
-
transform: `translate(${
|
|
1208
|
+
ref: E,
|
|
1209
|
+
transform: `translate(${t.position.x}, ${t.position.y})`,
|
|
1482
1210
|
"data-graph-node-interactive": "true",
|
|
1483
1211
|
role: "button",
|
|
1484
1212
|
tabIndex: 0,
|
|
1485
1213
|
"aria-selected": s,
|
|
1486
|
-
onMouseDown: (
|
|
1487
|
-
|
|
1214
|
+
onMouseDown: (J) => {
|
|
1215
|
+
J.preventDefault();
|
|
1488
1216
|
},
|
|
1489
|
-
onFocus: () =>
|
|
1490
|
-
onClick: () =>
|
|
1491
|
-
onDoubleClick: () =>
|
|
1492
|
-
onMouseEnter: () =>
|
|
1493
|
-
onMouseLeave:
|
|
1494
|
-
onKeyDown: (
|
|
1495
|
-
(
|
|
1217
|
+
onFocus: () => P == null ? void 0 : P(t.id),
|
|
1218
|
+
onClick: () => p == null ? void 0 : p(t),
|
|
1219
|
+
onDoubleClick: () => f == null ? void 0 : f(t),
|
|
1220
|
+
onMouseEnter: () => B(t.id),
|
|
1221
|
+
onMouseLeave: q,
|
|
1222
|
+
onKeyDown: (J) => {
|
|
1223
|
+
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), p == null || p(t));
|
|
1496
1224
|
},
|
|
1497
1225
|
children: [
|
|
1498
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ M.jsx(
|
|
1499
1227
|
"rect",
|
|
1500
1228
|
{
|
|
1501
1229
|
x: 0,
|
|
1502
1230
|
y: 0,
|
|
1503
|
-
width:
|
|
1504
|
-
height:
|
|
1505
|
-
rx:
|
|
1506
|
-
ry:
|
|
1231
|
+
width: C,
|
|
1232
|
+
height: D,
|
|
1233
|
+
rx: Y,
|
|
1234
|
+
ry: Y,
|
|
1507
1235
|
fill: "none",
|
|
1508
|
-
stroke:
|
|
1509
|
-
strokeOpacity:
|
|
1510
|
-
strokeWidth:
|
|
1236
|
+
stroke: W,
|
|
1237
|
+
strokeOpacity: wt,
|
|
1238
|
+
strokeWidth: a,
|
|
1511
1239
|
pointerEvents: "none"
|
|
1512
1240
|
}
|
|
1513
1241
|
),
|
|
1514
|
-
|
|
1242
|
+
n ? /* @__PURE__ */ M.jsx(
|
|
1515
1243
|
"rect",
|
|
1516
1244
|
{
|
|
1517
1245
|
x: -3,
|
|
1518
1246
|
y: -3,
|
|
1519
|
-
width:
|
|
1520
|
-
height:
|
|
1521
|
-
rx:
|
|
1522
|
-
ry:
|
|
1247
|
+
width: C + 6,
|
|
1248
|
+
height: D + 6,
|
|
1249
|
+
rx: Y + 2,
|
|
1250
|
+
ry: Y + 2,
|
|
1523
1251
|
fill: "none",
|
|
1524
1252
|
stroke: o,
|
|
1525
1253
|
strokeOpacity: 0.7,
|
|
1526
|
-
strokeWidth:
|
|
1254
|
+
strokeWidth: S,
|
|
1527
1255
|
strokeDasharray: "4 3",
|
|
1528
1256
|
pointerEvents: "none"
|
|
1529
1257
|
}
|
|
1530
1258
|
) : null,
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
|
|
1259
|
+
/* @__PURE__ */ M.jsx(
|
|
1260
|
+
e,
|
|
1533
1261
|
{
|
|
1534
|
-
node:
|
|
1262
|
+
node: t,
|
|
1535
1263
|
isSelected: s,
|
|
1536
|
-
isHovered:
|
|
1537
|
-
isHoveredIn:
|
|
1538
|
-
isHoveredOut:
|
|
1539
|
-
isHoveredBoth:
|
|
1540
|
-
activePathKey:
|
|
1541
|
-
activePathNodeIds:
|
|
1542
|
-
hoverInColor:
|
|
1543
|
-
hoverOutColor:
|
|
1544
|
-
hoverBothColor:
|
|
1545
|
-
onPathHover: (
|
|
1546
|
-
onPathLeave:
|
|
1264
|
+
isHovered: k,
|
|
1265
|
+
isHoveredIn: Z,
|
|
1266
|
+
isHoveredOut: Q,
|
|
1267
|
+
isHoveredBoth: R,
|
|
1268
|
+
activePathKey: d,
|
|
1269
|
+
activePathNodeIds: l,
|
|
1270
|
+
hoverInColor: g,
|
|
1271
|
+
hoverOutColor: c,
|
|
1272
|
+
hoverBothColor: m,
|
|
1273
|
+
onPathHover: (J, K) => J !== null && et(t.id, J, (K == null ? void 0 : K.pathKey) ?? (K == null ? void 0 : K.playerKey)),
|
|
1274
|
+
onPathLeave: _
|
|
1547
1275
|
}
|
|
1548
1276
|
)
|
|
1549
1277
|
]
|
|
@@ -1551,959 +1279,932 @@ const Nn = typeof window > "u" ? te : an, Yr = re.memo(
|
|
|
1551
1279
|
);
|
|
1552
1280
|
}
|
|
1553
1281
|
);
|
|
1554
|
-
|
|
1555
|
-
const
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
const s = Number.isFinite(e) && e > 0 ? e : Wr, i = Number.isFinite(r) && r > 0 ? r : $r;
|
|
1561
|
-
return s <= i ? { minZoom: s, maxZoom: i } : { minZoom: i, maxZoom: s };
|
|
1562
|
-
}, Je = (e) => e instanceof Error ? e : new Error(String(e)), Rr = (e, r, s) => s === "single" ? e.length === 1 && e[0] === r ? [] : [r] : e.includes(r) ? e.filter((i) => i !== r) : [...e, r], Bn = (e, r, s) => {
|
|
1563
|
-
const i = 2 * Ht + 2 * ir + Xr * 3, o = 12;
|
|
1282
|
+
xr.displayName = "GraphNode";
|
|
1283
|
+
const sr = { x: 0, y: 0, zoom: 1 }, he = { nodeIds: [], edgeIds: [] }, wr = 0.25, br = 2.5, Mn = 0.12, Nn = "#f59e0b", On = "top-left", St = 26, ve = 34, Ir = 8, me = 48, pe = 20, zn = 8, jn = (t, e) => {
|
|
1284
|
+
const s = Number.isFinite(t) && t > 0 ? t : wr, n = Number.isFinite(e) && e > 0 ? e : br;
|
|
1285
|
+
return s <= n ? { minZoom: s, maxZoom: n } : { minZoom: n, maxZoom: s };
|
|
1286
|
+
}, ye = (t) => t instanceof Error ? t : new Error(String(t)), ir = (t, e, s) => s === "single" ? t.length === 1 && t[0] === e ? [] : [e] : t.includes(e) ? t.filter((n) => n !== e) : [...t, e], Dn = (t, e, s) => {
|
|
1287
|
+
const n = 2 * St + 2 * ve + Ir * 3, o = 12;
|
|
1564
1288
|
switch (s) {
|
|
1565
1289
|
case "top-right":
|
|
1566
|
-
return { x:
|
|
1290
|
+
return { x: t - n - o, y: o };
|
|
1567
1291
|
case "bottom-left":
|
|
1568
|
-
return { x: o, y:
|
|
1292
|
+
return { x: o, y: e - St - o };
|
|
1569
1293
|
case "bottom-right":
|
|
1570
1294
|
return {
|
|
1571
|
-
x:
|
|
1572
|
-
y:
|
|
1295
|
+
x: t - n - o,
|
|
1296
|
+
y: e - St - o
|
|
1573
1297
|
};
|
|
1574
1298
|
case "top-left":
|
|
1575
1299
|
default:
|
|
1576
1300
|
return { x: o, y: o };
|
|
1577
1301
|
}
|
|
1578
|
-
},
|
|
1579
|
-
x: (
|
|
1580
|
-
y: (
|
|
1581
|
-
}),
|
|
1582
|
-
x: Math.min(
|
|
1583
|
-
y: Math.min(
|
|
1584
|
-
width: Math.abs(
|
|
1585
|
-
height: Math.abs(
|
|
1586
|
-
}),
|
|
1587
|
-
minX:
|
|
1588
|
-
minY:
|
|
1589
|
-
maxX:
|
|
1590
|
-
maxY:
|
|
1591
|
-
width:
|
|
1592
|
-
height:
|
|
1593
|
-
}),
|
|
1594
|
-
if (!
|
|
1595
|
-
return r;
|
|
1596
|
-
if (!r)
|
|
1302
|
+
}, ar = (t, e) => Math.hypot(t.x - e.x, t.y - e.y), cr = (t, e) => ({
|
|
1303
|
+
x: (t.x + e.x) / 2,
|
|
1304
|
+
y: (t.y + e.y) / 2
|
|
1305
|
+
}), lr = (t) => ({
|
|
1306
|
+
x: Math.min(t.startX, t.endX),
|
|
1307
|
+
y: Math.min(t.startY, t.endY),
|
|
1308
|
+
width: Math.abs(t.endX - t.startX),
|
|
1309
|
+
height: Math.abs(t.endY - t.startY)
|
|
1310
|
+
}), ur = (t, e, s) => t >= s.x && t <= s.x + s.width && e >= s.y && e <= s.y + s.height, Yn = (t, e) => ({
|
|
1311
|
+
minX: t.minX - e,
|
|
1312
|
+
minY: t.minY - e,
|
|
1313
|
+
maxX: t.maxX + e,
|
|
1314
|
+
maxY: t.maxY + e,
|
|
1315
|
+
width: t.width + e * 2,
|
|
1316
|
+
height: t.height + e * 2
|
|
1317
|
+
}), te = (t, e) => {
|
|
1318
|
+
if (!t)
|
|
1597
1319
|
return e;
|
|
1598
|
-
|
|
1320
|
+
if (!e)
|
|
1321
|
+
return t;
|
|
1322
|
+
const s = Math.min(t.minX, e.minX), n = Math.min(t.minY, e.minY), o = Math.max(t.maxX, e.maxX), i = Math.max(t.maxY, e.maxY);
|
|
1599
1323
|
return {
|
|
1600
1324
|
minX: s,
|
|
1601
|
-
minY:
|
|
1325
|
+
minY: n,
|
|
1602
1326
|
maxX: o,
|
|
1603
|
-
maxY:
|
|
1327
|
+
maxY: i,
|
|
1604
1328
|
width: o - s,
|
|
1605
|
-
height:
|
|
1329
|
+
height: i - n
|
|
1606
1330
|
};
|
|
1607
|
-
},
|
|
1608
|
-
if (!
|
|
1331
|
+
}, Xn = (t, e, s, n, o, i) => {
|
|
1332
|
+
if (!t.length || !o && !(n && n.length))
|
|
1609
1333
|
return null;
|
|
1610
|
-
const
|
|
1611
|
-
if (!
|
|
1334
|
+
const d = pr(t);
|
|
1335
|
+
if (!d.length)
|
|
1612
1336
|
return null;
|
|
1613
|
-
const
|
|
1337
|
+
const l = e === Jt.Tree && s === xe.RTL ? [...d].reverse() : d, { orderedLabels: T } = gr(
|
|
1338
|
+
t,
|
|
1614
1339
|
e,
|
|
1615
|
-
r,
|
|
1616
1340
|
s,
|
|
1617
|
-
|
|
1341
|
+
n,
|
|
1618
1342
|
o
|
|
1619
|
-
),
|
|
1620
|
-
(
|
|
1343
|
+
), b = t.reduce(
|
|
1344
|
+
(h, m) => Math.min(h, m.position.y),
|
|
1621
1345
|
Number.POSITIVE_INFINITY
|
|
1622
|
-
) -
|
|
1623
|
-
return
|
|
1624
|
-
const
|
|
1625
|
-
minX:
|
|
1626
|
-
minY:
|
|
1627
|
-
maxX:
|
|
1628
|
-
maxY:
|
|
1629
|
-
width:
|
|
1630
|
-
height:
|
|
1346
|
+
) - i - jt + 6;
|
|
1347
|
+
return l.reduce((h, m, g) => {
|
|
1348
|
+
const c = yr(T[g] ?? ""), v = {
|
|
1349
|
+
minX: m.centerX - c / 2,
|
|
1350
|
+
minY: b,
|
|
1351
|
+
maxX: m.centerX + c / 2,
|
|
1352
|
+
maxY: b + jt,
|
|
1353
|
+
width: c,
|
|
1354
|
+
height: jt
|
|
1631
1355
|
};
|
|
1632
|
-
return
|
|
1356
|
+
return te(h, v);
|
|
1633
1357
|
}, null);
|
|
1634
|
-
},
|
|
1358
|
+
}, Wn = (t) => t.reduce((e, s) => {
|
|
1635
1359
|
if (!s.labelPosition)
|
|
1636
|
-
return
|
|
1637
|
-
const
|
|
1638
|
-
minX: s.labelPosition.x -
|
|
1639
|
-
minY: s.labelPosition.y -
|
|
1640
|
-
maxX: s.labelPosition.x +
|
|
1641
|
-
maxY: s.labelPosition.y +
|
|
1642
|
-
width:
|
|
1643
|
-
height:
|
|
1360
|
+
return e;
|
|
1361
|
+
const n = {
|
|
1362
|
+
minX: s.labelPosition.x - me / 2,
|
|
1363
|
+
minY: s.labelPosition.y - pe / 2,
|
|
1364
|
+
maxX: s.labelPosition.x + me / 2,
|
|
1365
|
+
maxY: s.labelPosition.y + pe / 2,
|
|
1366
|
+
width: me,
|
|
1367
|
+
height: pe
|
|
1644
1368
|
};
|
|
1645
|
-
return
|
|
1646
|
-
}, null),
|
|
1647
|
-
if (!
|
|
1648
|
-
return { x:
|
|
1649
|
-
const
|
|
1369
|
+
return te(e, n);
|
|
1370
|
+
}, null), ge = (t, e, s) => {
|
|
1371
|
+
if (!t)
|
|
1372
|
+
return { x: e, y: s };
|
|
1373
|
+
const n = t.getBoundingClientRect();
|
|
1650
1374
|
return {
|
|
1651
|
-
x:
|
|
1652
|
-
y: s -
|
|
1375
|
+
x: e - n.left,
|
|
1376
|
+
y: s - n.top
|
|
1653
1377
|
};
|
|
1654
|
-
},
|
|
1655
|
-
var
|
|
1656
|
-
const
|
|
1657
|
-
x:
|
|
1658
|
-
y:
|
|
1659
|
-
}, o =
|
|
1660
|
-
var
|
|
1661
|
-
if (
|
|
1378
|
+
}, $n = (t, e, s) => {
|
|
1379
|
+
var l, T, w, b, h, m;
|
|
1380
|
+
const n = {
|
|
1381
|
+
x: t.position.x + (((l = t.size) == null ? void 0 : l.width) ?? 0) / 2,
|
|
1382
|
+
y: t.position.y + (((T = t.size) == null ? void 0 : T.height) ?? 0) / 2
|
|
1383
|
+
}, o = e.filter((g) => {
|
|
1384
|
+
var v, N;
|
|
1385
|
+
if (g.id === t.id)
|
|
1662
1386
|
return !1;
|
|
1663
|
-
const
|
|
1664
|
-
x:
|
|
1665
|
-
y:
|
|
1387
|
+
const c = {
|
|
1388
|
+
x: g.position.x + (((v = g.size) == null ? void 0 : v.width) ?? 0) / 2,
|
|
1389
|
+
y: g.position.y + (((N = g.size) == null ? void 0 : N.height) ?? 0) / 2
|
|
1666
1390
|
};
|
|
1667
|
-
return s === "left" ?
|
|
1391
|
+
return s === "left" ? c.x < n.x : s === "right" ? c.x > n.x : s === "up" ? c.y < n.y : c.y > n.y;
|
|
1668
1392
|
});
|
|
1669
1393
|
if (!o.length)
|
|
1670
1394
|
return null;
|
|
1671
|
-
let
|
|
1672
|
-
|
|
1673
|
-
|
|
1395
|
+
let i = o[0], d = Math.hypot(
|
|
1396
|
+
i.position.x + (((w = i.size) == null ? void 0 : w.width) ?? 0) / 2 - n.x,
|
|
1397
|
+
i.position.y + (((b = i.size) == null ? void 0 : b.height) ?? 0) / 2 - n.y
|
|
1674
1398
|
);
|
|
1675
|
-
for (let
|
|
1676
|
-
const
|
|
1677
|
-
|
|
1678
|
-
|
|
1399
|
+
for (let g = 1; g < o.length; g++) {
|
|
1400
|
+
const c = o[g], v = Math.hypot(
|
|
1401
|
+
c.position.x + (((h = c.size) == null ? void 0 : h.width) ?? 0) / 2 - n.x,
|
|
1402
|
+
c.position.y + (((m = c.size) == null ? void 0 : m.height) ?? 0) / 2 - n.y
|
|
1679
1403
|
);
|
|
1680
|
-
|
|
1404
|
+
v < d && (i = c, d = v);
|
|
1681
1405
|
}
|
|
1682
|
-
return
|
|
1683
|
-
},
|
|
1684
|
-
graph:
|
|
1685
|
-
vertexComponent:
|
|
1686
|
-
edgeComponent: s =
|
|
1687
|
-
config:
|
|
1406
|
+
return i;
|
|
1407
|
+
}, Bn = ({
|
|
1408
|
+
graph: t,
|
|
1409
|
+
vertexComponent: e,
|
|
1410
|
+
edgeComponent: s = En,
|
|
1411
|
+
config: n,
|
|
1688
1412
|
viewport: o,
|
|
1689
|
-
defaultViewport:
|
|
1690
|
-
onViewportChange:
|
|
1691
|
-
fitViewOnMount:
|
|
1692
|
-
fitViewPadding:
|
|
1693
|
-
minZoom:
|
|
1694
|
-
maxZoom:
|
|
1695
|
-
zoomStep:
|
|
1696
|
-
panEnabled:
|
|
1697
|
-
zoomEnabled:
|
|
1698
|
-
pinchZoomEnabled:
|
|
1699
|
-
keyboardNavigation:
|
|
1700
|
-
showControls:
|
|
1701
|
-
controlsPosition:
|
|
1702
|
-
marqueeSelectionEnabled:
|
|
1703
|
-
focusedNodeId:
|
|
1704
|
-
defaultFocusedNodeId:
|
|
1705
|
-
onFocusedNodeChange:
|
|
1706
|
-
collapsedNodeIds:
|
|
1707
|
-
defaultCollapsedNodeIds:
|
|
1708
|
-
onCollapsedNodeIdsChange:
|
|
1709
|
-
toggleCollapseOnNodeDoubleClick:
|
|
1710
|
-
hiddenNodeIds:
|
|
1711
|
-
onNodeExpand:
|
|
1712
|
-
onNodeCollapse:
|
|
1713
|
-
searchQuery:
|
|
1714
|
-
hideUnmatchedSearch:
|
|
1715
|
-
searchPredicate:
|
|
1716
|
-
highlightedNodeIds:
|
|
1717
|
-
highlightedEdgeIds:
|
|
1718
|
-
highlightColor:
|
|
1719
|
-
highlightStrategy:
|
|
1720
|
-
onSearchResultsChange:
|
|
1721
|
-
selectedNodeIds:
|
|
1722
|
-
selectedEdgeIds:
|
|
1723
|
-
defaultSelectedNodeIds:
|
|
1724
|
-
defaultSelectedEdgeIds:
|
|
1725
|
-
onSelectionChange:
|
|
1726
|
-
selectionMode:
|
|
1727
|
-
nodeSelectionEnabled:
|
|
1728
|
-
edgeSelectionEnabled:
|
|
1729
|
-
selectionColor:
|
|
1730
|
-
edgeSelectionColor:
|
|
1731
|
-
layoutNodesOverride:
|
|
1732
|
-
routeEdgesOverride:
|
|
1733
|
-
renderBackground:
|
|
1734
|
-
renderOverlay:
|
|
1413
|
+
defaultViewport: i,
|
|
1414
|
+
onViewportChange: d,
|
|
1415
|
+
fitViewOnMount: l = !1,
|
|
1416
|
+
fitViewPadding: T = 32,
|
|
1417
|
+
minZoom: w = wr,
|
|
1418
|
+
maxZoom: b = br,
|
|
1419
|
+
zoomStep: h = Mn,
|
|
1420
|
+
panEnabled: m = !0,
|
|
1421
|
+
zoomEnabled: g = !0,
|
|
1422
|
+
pinchZoomEnabled: c = !0,
|
|
1423
|
+
keyboardNavigation: v = !0,
|
|
1424
|
+
showControls: N = !1,
|
|
1425
|
+
controlsPosition: x = On,
|
|
1426
|
+
marqueeSelectionEnabled: P = !0,
|
|
1427
|
+
focusedNodeId: p,
|
|
1428
|
+
defaultFocusedNodeId: f = null,
|
|
1429
|
+
onFocusedNodeChange: B,
|
|
1430
|
+
collapsedNodeIds: q,
|
|
1431
|
+
defaultCollapsedNodeIds: et,
|
|
1432
|
+
onCollapsedNodeIdsChange: _,
|
|
1433
|
+
toggleCollapseOnNodeDoubleClick: E = !0,
|
|
1434
|
+
hiddenNodeIds: C,
|
|
1435
|
+
onNodeExpand: D,
|
|
1436
|
+
onNodeCollapse: Y,
|
|
1437
|
+
searchQuery: X,
|
|
1438
|
+
hideUnmatchedSearch: Z = !1,
|
|
1439
|
+
searchPredicate: Q,
|
|
1440
|
+
highlightedNodeIds: R,
|
|
1441
|
+
highlightedEdgeIds: k,
|
|
1442
|
+
highlightColor: O = "#f59e0b",
|
|
1443
|
+
highlightStrategy: W,
|
|
1444
|
+
onSearchResultsChange: wt,
|
|
1445
|
+
selectedNodeIds: a,
|
|
1446
|
+
selectedEdgeIds: S,
|
|
1447
|
+
defaultSelectedNodeIds: j,
|
|
1448
|
+
defaultSelectedEdgeIds: F,
|
|
1449
|
+
onSelectionChange: J,
|
|
1450
|
+
selectionMode: K = "single",
|
|
1451
|
+
nodeSelectionEnabled: $ = !0,
|
|
1452
|
+
edgeSelectionEnabled: st = !0,
|
|
1453
|
+
selectionColor: it = Nn,
|
|
1454
|
+
edgeSelectionColor: ee,
|
|
1455
|
+
layoutNodesOverride: Er,
|
|
1456
|
+
routeEdgesOverride: Tr,
|
|
1457
|
+
renderBackground: re,
|
|
1458
|
+
renderOverlay: ne,
|
|
1735
1459
|
onError: ct,
|
|
1736
|
-
onNodeHoverChange:
|
|
1737
|
-
onEdgeHoverChange:
|
|
1738
|
-
onNodeClick:
|
|
1739
|
-
onEdgeClick:
|
|
1740
|
-
},
|
|
1741
|
-
const
|
|
1742
|
-
() => qe({ ...Ke, ...c ?? {} }, lt, ht)
|
|
1743
|
-
), [se, xe] = Et({
|
|
1744
|
-
nodeIds: Ft ?? [],
|
|
1745
|
-
edgeIds: Kt ?? []
|
|
1746
|
-
}), [we, Ne] = Et(
|
|
1747
|
-
x
|
|
1748
|
-
), [kt, ae] = Et(null), [be, Ie] = Et(!1), xt = pt({
|
|
1460
|
+
onNodeHoverChange: Gt,
|
|
1461
|
+
onEdgeHoverChange: Ht,
|
|
1462
|
+
onNodeClick: It,
|
|
1463
|
+
onEdgeClick: vt
|
|
1464
|
+
}, _r) => {
|
|
1465
|
+
const Ee = A(() => jn(w, b), [w, b]), Et = Ee.minZoom, Tt = Ee.maxZoom, Te = bn(n), Ut = Qr().replace(/:/g, "-"), [_t, oe] = ut(null), [_e, Pe] = ut(!1), ht = ot({
|
|
1749
1466
|
active: !1,
|
|
1750
1467
|
startX: 0,
|
|
1751
1468
|
startY: 0,
|
|
1752
1469
|
originX: 0,
|
|
1753
1470
|
originY: 0
|
|
1754
|
-
}),
|
|
1471
|
+
}), mt = ot(/* @__PURE__ */ new Map()), Pt = ot({
|
|
1755
1472
|
active: !1,
|
|
1756
1473
|
startDistance: 0,
|
|
1757
1474
|
startZoom: 1,
|
|
1758
1475
|
worldX: 0,
|
|
1759
1476
|
worldY: 0
|
|
1760
|
-
}),
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
() => ({
|
|
1769
|
-
nodeIds: vt ?? se.nodeIds,
|
|
1770
|
-
edgeIds: _t ?? se.edgeIds
|
|
1771
|
-
}),
|
|
1772
|
-
[vt, _t, se]
|
|
1773
|
-
), R = pt(f);
|
|
1774
|
-
R.current = f;
|
|
1775
|
-
const M = _ !== void 0 ? _ : we, {
|
|
1776
|
-
collapsedIds: W,
|
|
1777
|
-
collapsedNodeSet: z,
|
|
1778
|
-
pendingExpansionNodeSet: j,
|
|
1779
|
-
updateCollapsedNodeIds: nt,
|
|
1780
|
-
setPendingExpansionNodeIds: B
|
|
1477
|
+
}), At = ot(null), Pr = ot(null), se = ot(!1), I = A(() => sn(Te), [Te]), pt = I.theme, Le = pt.edgeColor ?? Je.edgeColor, Ct = pt.edgeWidth ?? Je.edgeWidth, ke = ee ?? it, Lr = I.hoverNodeBorderColor ?? I.hoverEdgeColor, kr = I.hoverNodeBothColor ?? I.hoverEdgeColor, Sr = pt.nodeBorderColor, Ar = pt.nodeBorderWidth ?? 0, Kt = I.showArrows, Se = `${Ut}-arrow`, Ae = `${Ut}-arrow-hover`, Re = `${Ut}-arrow-hover-in`, Me = `${Ut}-arrow-selected`, {
|
|
1478
|
+
viewport: z,
|
|
1479
|
+
viewportRef: Rr,
|
|
1480
|
+
selection: rt,
|
|
1481
|
+
focusedNodeId: yt,
|
|
1482
|
+
updateViewport: H,
|
|
1483
|
+
updateSelection: nt,
|
|
1484
|
+
updateFocusedNode: dt
|
|
1781
1485
|
} = wn({
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
onSearchResultsChange: jt,
|
|
1830
|
-
layoutNodesOverride: De,
|
|
1831
|
-
routeEdgesOverride: me,
|
|
1486
|
+
controlledViewport: o,
|
|
1487
|
+
defaultViewport: i,
|
|
1488
|
+
safeMinZoom: Et,
|
|
1489
|
+
safeMaxZoom: Tt,
|
|
1490
|
+
onViewportChange: d,
|
|
1491
|
+
selectedNodeIds: a,
|
|
1492
|
+
selectedEdgeIds: S,
|
|
1493
|
+
defaultSelectedNodeIds: j,
|
|
1494
|
+
defaultSelectedEdgeIds: F,
|
|
1495
|
+
onSelectionChange: J,
|
|
1496
|
+
controlledFocusedNodeId: p,
|
|
1497
|
+
defaultFocusedNodeId: f,
|
|
1498
|
+
onFocusedNodeChange: B
|
|
1499
|
+
}), {
|
|
1500
|
+
collapsedIds: Mr,
|
|
1501
|
+
collapsedNodeSet: Ne,
|
|
1502
|
+
pendingExpansionNodeSet: Oe,
|
|
1503
|
+
updateCollapsedNodeIds: Vt,
|
|
1504
|
+
setPendingExpansionNodeIds: ie
|
|
1505
|
+
} = fn({
|
|
1506
|
+
collapsedNodeIds: q,
|
|
1507
|
+
defaultCollapsedNodeIds: et,
|
|
1508
|
+
onCollapsedNodeIdsChange: _
|
|
1509
|
+
}), Nr = A(() => new Set(rt.nodeIds), [rt.nodeIds]), ze = A(() => new Set(rt.edgeIds), [rt.edgeIds]), {
|
|
1510
|
+
childNodeIdsByParent: je,
|
|
1511
|
+
effectiveHighlightedEdgeSet: Or,
|
|
1512
|
+
effectiveHighlightedNodeSet: zr,
|
|
1513
|
+
handleNodeMeasure: jr,
|
|
1514
|
+
positionedEdges: gt,
|
|
1515
|
+
positionedNodes: tt,
|
|
1516
|
+
visibleEdges: De,
|
|
1517
|
+
visibleNodesWithMeasuredSize: Ye
|
|
1518
|
+
} = mn({
|
|
1519
|
+
graph: t,
|
|
1520
|
+
config: I,
|
|
1521
|
+
mergedTheme: pt,
|
|
1522
|
+
collapsedIds: Mr,
|
|
1523
|
+
hiddenNodeIds: C,
|
|
1524
|
+
searchQuery: X,
|
|
1525
|
+
hideUnmatchedSearch: Z,
|
|
1526
|
+
searchPredicate: Q,
|
|
1527
|
+
highlightedNodeIds: R,
|
|
1528
|
+
highlightedEdgeIds: k,
|
|
1529
|
+
highlightStrategy: W,
|
|
1530
|
+
onSearchResultsChange: wt,
|
|
1531
|
+
layoutNodesOverride: Er,
|
|
1532
|
+
routeEdgesOverride: Tr,
|
|
1832
1533
|
onError: ct
|
|
1833
|
-
}),
|
|
1834
|
-
(
|
|
1835
|
-
if (!(!
|
|
1836
|
-
if (
|
|
1534
|
+
}), Dr = G(
|
|
1535
|
+
(r) => {
|
|
1536
|
+
if (!(!E || !((je.get(r.id) ?? []).length > 0) || Oe.has(r.id)))
|
|
1537
|
+
if (Ne.has(r.id))
|
|
1837
1538
|
try {
|
|
1838
|
-
const
|
|
1839
|
-
if (
|
|
1840
|
-
|
|
1841
|
-
(
|
|
1842
|
-
), Promise.resolve(
|
|
1843
|
-
|
|
1844
|
-
}).catch((
|
|
1845
|
-
ct == null || ct(
|
|
1539
|
+
const y = D == null ? void 0 : D(r.id);
|
|
1540
|
+
if (y && typeof y == "object" && "then" in y) {
|
|
1541
|
+
ie(
|
|
1542
|
+
(L) => L.includes(r.id) ? L : [...L, r.id]
|
|
1543
|
+
), Promise.resolve(y).then(() => {
|
|
1544
|
+
Vt((L) => L.filter((U) => U !== r.id));
|
|
1545
|
+
}).catch((L) => {
|
|
1546
|
+
ct == null || ct(ye(L), { graph: t, phase: "interaction" });
|
|
1846
1547
|
}).finally(() => {
|
|
1847
|
-
|
|
1848
|
-
(
|
|
1548
|
+
ie(
|
|
1549
|
+
(L) => L.filter((U) => U !== r.id)
|
|
1849
1550
|
);
|
|
1850
1551
|
});
|
|
1851
1552
|
return;
|
|
1852
1553
|
}
|
|
1853
|
-
|
|
1854
|
-
} catch (
|
|
1855
|
-
ct == null || ct(
|
|
1554
|
+
Vt((L) => L.filter((U) => U !== r.id));
|
|
1555
|
+
} catch (y) {
|
|
1556
|
+
ct == null || ct(ye(y), { graph: t, phase: "interaction" });
|
|
1856
1557
|
}
|
|
1857
1558
|
else {
|
|
1858
|
-
|
|
1559
|
+
Vt((y) => [...y, r.id]);
|
|
1859
1560
|
try {
|
|
1860
|
-
|
|
1861
|
-
} catch (
|
|
1862
|
-
ct == null || ct(
|
|
1561
|
+
Y == null || Y(r.id);
|
|
1562
|
+
} catch (y) {
|
|
1563
|
+
ct == null || ct(ye(y), { graph: t, phase: "interaction" });
|
|
1863
1564
|
}
|
|
1864
1565
|
}
|
|
1865
1566
|
},
|
|
1866
1567
|
[
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1568
|
+
je,
|
|
1569
|
+
Ne,
|
|
1570
|
+
t,
|
|
1870
1571
|
ct,
|
|
1871
|
-
|
|
1872
|
-
it,
|
|
1873
|
-
j,
|
|
1874
|
-
B,
|
|
1572
|
+
Y,
|
|
1875
1573
|
D,
|
|
1876
|
-
|
|
1574
|
+
Oe,
|
|
1575
|
+
ie,
|
|
1576
|
+
E,
|
|
1577
|
+
Vt
|
|
1877
1578
|
]
|
|
1878
1579
|
);
|
|
1879
|
-
|
|
1880
|
-
const
|
|
1881
|
-
(
|
|
1882
|
-
nodeIds:
|
|
1883
|
-
edgeIds:
|
|
1884
|
-
}),
|
|
1580
|
+
zt(() => {
|
|
1581
|
+
const r = new Set(Ye.map((y) => y.id)), u = new Set(De.map((y) => y.id));
|
|
1582
|
+
(rt.nodeIds.some((y) => !r.has(y)) || rt.edgeIds.some((y) => !u.has(y))) && nt({
|
|
1583
|
+
nodeIds: rt.nodeIds.filter((y) => r.has(y)),
|
|
1584
|
+
edgeIds: rt.edgeIds.filter((y) => u.has(y))
|
|
1585
|
+
}), yt && !r.has(yt) && dt(null);
|
|
1885
1586
|
}, [
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1587
|
+
yt,
|
|
1588
|
+
rt,
|
|
1589
|
+
dt,
|
|
1590
|
+
nt,
|
|
1591
|
+
De,
|
|
1592
|
+
Ye
|
|
1892
1593
|
]);
|
|
1893
|
-
const
|
|
1894
|
-
() => new Map(
|
|
1895
|
-
[
|
|
1896
|
-
),
|
|
1897
|
-
() => new Map(
|
|
1898
|
-
[
|
|
1899
|
-
),
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1594
|
+
const lt = A(
|
|
1595
|
+
() => new Map(tt.map((r) => [r.id, r])),
|
|
1596
|
+
[tt]
|
|
1597
|
+
), Xe = A(
|
|
1598
|
+
() => new Map(gt.map((r) => [r.id, r])),
|
|
1599
|
+
[gt]
|
|
1600
|
+
), We = A(() => pn(tt), [tt]), $e = A(() => {
|
|
1601
|
+
const r = te(
|
|
1602
|
+
te(
|
|
1603
|
+
We,
|
|
1604
|
+
Xn(
|
|
1605
|
+
tt,
|
|
1606
|
+
I.layout,
|
|
1607
|
+
I.layoutDirection,
|
|
1608
|
+
I.labels,
|
|
1609
|
+
I.autoLabels,
|
|
1610
|
+
I.labelOffset
|
|
1910
1611
|
)
|
|
1911
1612
|
),
|
|
1912
|
-
|
|
1613
|
+
Wn(gt)
|
|
1913
1614
|
);
|
|
1914
|
-
return
|
|
1615
|
+
return r && Yn(r, zn);
|
|
1915
1616
|
}, [
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
]),
|
|
1925
|
-
var
|
|
1926
|
-
const
|
|
1927
|
-
if (!
|
|
1928
|
-
return { width:
|
|
1929
|
-
const
|
|
1617
|
+
I.autoLabels,
|
|
1618
|
+
I.labelOffset,
|
|
1619
|
+
I.labels,
|
|
1620
|
+
I.layout,
|
|
1621
|
+
I.layoutDirection,
|
|
1622
|
+
We,
|
|
1623
|
+
gt,
|
|
1624
|
+
tt
|
|
1625
|
+
]), qt = G(() => {
|
|
1626
|
+
var L;
|
|
1627
|
+
const r = At.current;
|
|
1628
|
+
if (!r)
|
|
1629
|
+
return { width: I.width, height: I.height };
|
|
1630
|
+
const y = ((L = r.parentElement) == null ? void 0 : L.getBoundingClientRect()) ?? r.getBoundingClientRect();
|
|
1930
1631
|
return {
|
|
1931
|
-
width:
|
|
1932
|
-
height:
|
|
1632
|
+
width: y.width || I.width,
|
|
1633
|
+
height: y.height || I.height
|
|
1933
1634
|
};
|
|
1934
|
-
}, [
|
|
1935
|
-
(
|
|
1936
|
-
const { width:
|
|
1937
|
-
|
|
1938
|
-
|
|
1635
|
+
}, [I.height, I.width]), Lt = G(
|
|
1636
|
+
(r = T) => {
|
|
1637
|
+
const { width: u, height: y } = qt();
|
|
1638
|
+
H(
|
|
1639
|
+
yn($e, u, y, r, Et, Tt)
|
|
1939
1640
|
);
|
|
1940
1641
|
},
|
|
1941
|
-
[
|
|
1942
|
-
),
|
|
1943
|
-
(
|
|
1944
|
-
const
|
|
1945
|
-
if (!
|
|
1642
|
+
[$e, T, qt, Tt, Et, H]
|
|
1643
|
+
), Zt = G(
|
|
1644
|
+
(r) => {
|
|
1645
|
+
const u = lt.get(r);
|
|
1646
|
+
if (!u)
|
|
1946
1647
|
return;
|
|
1947
|
-
const { width:
|
|
1948
|
-
|
|
1648
|
+
const { width: y, height: L } = qt();
|
|
1649
|
+
H(gn(u, y, L, z.zoom));
|
|
1949
1650
|
},
|
|
1950
|
-
[
|
|
1651
|
+
[qt, lt, H, z.zoom]
|
|
1951
1652
|
);
|
|
1952
|
-
|
|
1953
|
-
|
|
1653
|
+
tn(
|
|
1654
|
+
_r,
|
|
1954
1655
|
() => ({
|
|
1955
|
-
fitView:
|
|
1956
|
-
centerOnNode:
|
|
1957
|
-
zoomIn: () =>
|
|
1958
|
-
zoomOut: () =>
|
|
1959
|
-
zoomTo: (
|
|
1960
|
-
resetViewport: () =>
|
|
1961
|
-
getViewport: () =>
|
|
1962
|
-
setViewport:
|
|
1963
|
-
clearSelection: () =>
|
|
1656
|
+
fitView: Lt,
|
|
1657
|
+
centerOnNode: Zt,
|
|
1658
|
+
zoomIn: () => H((r) => ({ zoom: r.zoom + h })),
|
|
1659
|
+
zoomOut: () => H((r) => ({ zoom: r.zoom - h })),
|
|
1660
|
+
zoomTo: (r) => H({ zoom: r }),
|
|
1661
|
+
resetViewport: () => H(sr),
|
|
1662
|
+
getViewport: () => z,
|
|
1663
|
+
setViewport: H,
|
|
1664
|
+
clearSelection: () => nt(he)
|
|
1964
1665
|
}),
|
|
1965
|
-
[
|
|
1966
|
-
),
|
|
1967
|
-
|
|
1968
|
-
}, [
|
|
1969
|
-
!
|
|
1970
|
-
}, [
|
|
1666
|
+
[Zt, Lt, nt, H, z, h]
|
|
1667
|
+
), zt(() => {
|
|
1668
|
+
se.current = !1;
|
|
1669
|
+
}, [t]), zt(() => {
|
|
1670
|
+
!l || se.current || tt.length === 0 || (se.current = !0, Lt());
|
|
1671
|
+
}, [Lt, l, tt.length]);
|
|
1971
1672
|
const {
|
|
1972
|
-
hoveredEdgeId:
|
|
1973
|
-
setHoveredEdgeId:
|
|
1974
|
-
hoveredNodeId:
|
|
1975
|
-
setHoveredNodeId:
|
|
1976
|
-
focusedPath:
|
|
1977
|
-
setFocusedPath:
|
|
1978
|
-
pathHighlight:
|
|
1979
|
-
hoveredNodeStates:
|
|
1980
|
-
edgesForRender:
|
|
1981
|
-
} =
|
|
1982
|
-
|
|
1983
|
-
const
|
|
1673
|
+
hoveredEdgeId: Be,
|
|
1674
|
+
setHoveredEdgeId: Fe,
|
|
1675
|
+
hoveredNodeId: kt,
|
|
1676
|
+
setHoveredNodeId: Rt,
|
|
1677
|
+
focusedPath: ae,
|
|
1678
|
+
setFocusedPath: xt,
|
|
1679
|
+
pathHighlight: Mt,
|
|
1680
|
+
hoveredNodeStates: Yr,
|
|
1681
|
+
edgesForRender: Xr
|
|
1682
|
+
} = dn(tt, gt, I.hoverHighlight), Ge = ot(kt);
|
|
1683
|
+
Ge.current = kt;
|
|
1684
|
+
const He = A(
|
|
1984
1685
|
() => ({
|
|
1985
|
-
graph:
|
|
1986
|
-
nodes:
|
|
1987
|
-
edges:
|
|
1988
|
-
config:
|
|
1989
|
-
viewport:
|
|
1990
|
-
selection:
|
|
1686
|
+
graph: t,
|
|
1687
|
+
nodes: tt,
|
|
1688
|
+
edges: gt,
|
|
1689
|
+
config: I,
|
|
1690
|
+
viewport: z,
|
|
1691
|
+
selection: rt
|
|
1991
1692
|
}),
|
|
1992
|
-
[
|
|
1993
|
-
),
|
|
1994
|
-
(
|
|
1995
|
-
|
|
1996
|
-
viewport:
|
|
1997
|
-
selection:
|
|
1998
|
-
trigger:
|
|
1693
|
+
[I, t, gt, tt, rt, z]
|
|
1694
|
+
), Nt = G(
|
|
1695
|
+
(r, u, y = "pointer") => {
|
|
1696
|
+
Gt == null || Gt(r, u, {
|
|
1697
|
+
viewport: z,
|
|
1698
|
+
selection: rt,
|
|
1699
|
+
trigger: y
|
|
1999
1700
|
});
|
|
2000
1701
|
},
|
|
2001
|
-
[
|
|
2002
|
-
),
|
|
2003
|
-
(
|
|
2004
|
-
|
|
2005
|
-
viewport:
|
|
2006
|
-
selection:
|
|
2007
|
-
trigger:
|
|
1702
|
+
[Gt, rt, z]
|
|
1703
|
+
), Ue = G(
|
|
1704
|
+
(r, u, y = "pointer") => {
|
|
1705
|
+
Ht == null || Ht(r, u, {
|
|
1706
|
+
viewport: z,
|
|
1707
|
+
selection: rt,
|
|
1708
|
+
trigger: y
|
|
2008
1709
|
});
|
|
2009
1710
|
},
|
|
2010
|
-
[
|
|
2011
|
-
),
|
|
2012
|
-
(
|
|
2013
|
-
if (
|
|
2014
|
-
|
|
1711
|
+
[Ht, rt, z]
|
|
1712
|
+
), ce = G(
|
|
1713
|
+
(r) => {
|
|
1714
|
+
if (!$) {
|
|
1715
|
+
dt(r.id), It == null || It(r);
|
|
2015
1716
|
return;
|
|
2016
1717
|
}
|
|
2017
|
-
|
|
2018
|
-
nodeIds:
|
|
2019
|
-
edgeIds:
|
|
2020
|
-
})),
|
|
1718
|
+
nt((u) => ({
|
|
1719
|
+
nodeIds: ir(u.nodeIds, r.id, K),
|
|
1720
|
+
edgeIds: K === "single" ? [] : u.edgeIds
|
|
1721
|
+
})), dt(r.id), It == null || It(r);
|
|
2021
1722
|
},
|
|
2022
|
-
[
|
|
2023
|
-
),
|
|
2024
|
-
(
|
|
2025
|
-
if (!
|
|
2026
|
-
|
|
1723
|
+
[$, It, K, dt, nt]
|
|
1724
|
+
), Wr = G(
|
|
1725
|
+
(r) => {
|
|
1726
|
+
if (!st) {
|
|
1727
|
+
vt == null || vt(r);
|
|
2027
1728
|
return;
|
|
2028
1729
|
}
|
|
2029
|
-
|
|
2030
|
-
nodeIds:
|
|
2031
|
-
edgeIds:
|
|
2032
|
-
})),
|
|
1730
|
+
nt((u) => ({
|
|
1731
|
+
nodeIds: K === "single" ? [] : u.nodeIds,
|
|
1732
|
+
edgeIds: ir(u.edgeIds, r.id, K)
|
|
1733
|
+
})), vt == null || vt(r);
|
|
2033
1734
|
},
|
|
2034
|
-
[
|
|
2035
|
-
),
|
|
2036
|
-
(
|
|
2037
|
-
var U,
|
|
2038
|
-
const
|
|
2039
|
-
if (!
|
|
2040
|
-
|
|
2041
|
-
startX:
|
|
2042
|
-
startY:
|
|
2043
|
-
endX:
|
|
2044
|
-
endY:
|
|
2045
|
-
}),
|
|
1735
|
+
[st, vt, K, nt]
|
|
1736
|
+
), $r = G(
|
|
1737
|
+
(r) => {
|
|
1738
|
+
var U, ft;
|
|
1739
|
+
const u = r.target, y = !!u.closest('[data-graph-node-interactive="true"], [data-graph-edge-interactive="true"]'), L = ge(At.current, r.clientX, r.clientY);
|
|
1740
|
+
if (!y && K === "multiple" && P && r.shiftKey) {
|
|
1741
|
+
oe({
|
|
1742
|
+
startX: L.x,
|
|
1743
|
+
startY: L.y,
|
|
1744
|
+
endX: L.x,
|
|
1745
|
+
endY: L.y
|
|
1746
|
+
}), ht.current.active = !1;
|
|
2046
1747
|
return;
|
|
2047
1748
|
}
|
|
2048
|
-
if (
|
|
2049
|
-
const [
|
|
2050
|
-
|
|
1749
|
+
if (r.pointerType === "touch" && (mt.current.set(r.pointerId, L), c && g && mt.current.size === 2)) {
|
|
1750
|
+
const [bt, V] = Array.from(mt.current.values()), Ot = cr(bt, V);
|
|
1751
|
+
Pt.current = {
|
|
2051
1752
|
active: !0,
|
|
2052
|
-
startDistance:
|
|
2053
|
-
startZoom:
|
|
2054
|
-
worldX: (
|
|
2055
|
-
worldY: (
|
|
2056
|
-
},
|
|
1753
|
+
startDistance: ar(bt, V),
|
|
1754
|
+
startZoom: z.zoom,
|
|
1755
|
+
worldX: (Ot.x - z.x) / z.zoom,
|
|
1756
|
+
worldY: (Ot.y - z.y) / z.zoom
|
|
1757
|
+
}, ht.current.active = !1, (U = u.setPointerCapture) == null || U.call(u, r.pointerId);
|
|
2057
1758
|
return;
|
|
2058
1759
|
}
|
|
2059
|
-
!
|
|
1760
|
+
!m || r.button !== 0 || y || (ht.current = {
|
|
2060
1761
|
active: !0,
|
|
2061
|
-
startX:
|
|
2062
|
-
startY:
|
|
2063
|
-
originX:
|
|
2064
|
-
originY:
|
|
2065
|
-
},
|
|
1762
|
+
startX: L.x,
|
|
1763
|
+
startY: L.y,
|
|
1764
|
+
originX: z.x,
|
|
1765
|
+
originY: z.y
|
|
1766
|
+
}, Pe(!0), (ft = u.setPointerCapture) == null || ft.call(u, r.pointerId));
|
|
2066
1767
|
},
|
|
2067
|
-
[
|
|
2068
|
-
),
|
|
2069
|
-
(
|
|
2070
|
-
const
|
|
2071
|
-
if (
|
|
2072
|
-
const [
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
1768
|
+
[P, m, c, K, z, g]
|
|
1769
|
+
), Br = G(
|
|
1770
|
+
(r) => {
|
|
1771
|
+
const u = ge(At.current, r.clientX, r.clientY);
|
|
1772
|
+
if (r.pointerType === "touch" && mt.current.has(r.pointerId) && (mt.current.set(r.pointerId, u), Pt.current.active && mt.current.size >= 2)) {
|
|
1773
|
+
const [y, L] = Array.from(mt.current.values()), U = cr(y, L), ft = ar(y, L), bt = Qt(
|
|
1774
|
+
Pt.current.startZoom * (ft / Math.max(1, Pt.current.startDistance)),
|
|
1775
|
+
Et,
|
|
1776
|
+
Tt
|
|
2076
1777
|
);
|
|
2077
|
-
|
|
2078
|
-
zoom:
|
|
2079
|
-
x: U.x -
|
|
2080
|
-
y: U.y -
|
|
1778
|
+
H({
|
|
1779
|
+
zoom: bt,
|
|
1780
|
+
x: U.x - Pt.current.worldX * bt,
|
|
1781
|
+
y: U.y - Pt.current.worldY * bt
|
|
2081
1782
|
});
|
|
2082
1783
|
return;
|
|
2083
1784
|
}
|
|
2084
|
-
if (
|
|
2085
|
-
|
|
2086
|
-
(
|
|
2087
|
-
...
|
|
2088
|
-
endX:
|
|
2089
|
-
endY:
|
|
1785
|
+
if (_t) {
|
|
1786
|
+
oe(
|
|
1787
|
+
(y) => y && {
|
|
1788
|
+
...y,
|
|
1789
|
+
endX: u.x,
|
|
1790
|
+
endY: u.y
|
|
2090
1791
|
}
|
|
2091
1792
|
);
|
|
2092
1793
|
return;
|
|
2093
1794
|
}
|
|
2094
|
-
!
|
|
2095
|
-
x:
|
|
2096
|
-
y:
|
|
1795
|
+
!m || !ht.current.active || H({
|
|
1796
|
+
x: ht.current.originX + (u.x - ht.current.startX),
|
|
1797
|
+
y: ht.current.originY + (u.y - ht.current.startY)
|
|
2097
1798
|
});
|
|
2098
1799
|
},
|
|
2099
|
-
[
|
|
2100
|
-
),
|
|
2101
|
-
(
|
|
2102
|
-
var
|
|
2103
|
-
if (
|
|
2104
|
-
const
|
|
2105
|
-
x: (
|
|
2106
|
-
y: (
|
|
2107
|
-
width:
|
|
2108
|
-
height:
|
|
2109
|
-
},
|
|
2110
|
-
var
|
|
2111
|
-
const
|
|
2112
|
-
return !(
|
|
2113
|
-
}).map((
|
|
2114
|
-
const
|
|
2115
|
-
(
|
|
2116
|
-
),
|
|
2117
|
-
return
|
|
2118
|
-
}).map((
|
|
2119
|
-
|
|
2120
|
-
nodeIds: Array.from(/* @__PURE__ */ new Set([...
|
|
2121
|
-
edgeIds: Array.from(/* @__PURE__ */ new Set([...
|
|
2122
|
-
})),
|
|
1800
|
+
[m, Tt, Et, _t, H]
|
|
1801
|
+
), Ce = G(
|
|
1802
|
+
(r) => {
|
|
1803
|
+
var u, y;
|
|
1804
|
+
if (mt.current.delete(r.pointerId), mt.current.size < 2 && (Pt.current.active = !1), _t) {
|
|
1805
|
+
const L = lr(_t), U = {
|
|
1806
|
+
x: (L.x - z.x) / z.zoom,
|
|
1807
|
+
y: (L.y - z.y) / z.zoom,
|
|
1808
|
+
width: L.width / z.zoom,
|
|
1809
|
+
height: L.height / z.zoom
|
|
1810
|
+
}, ft = tt.filter((V) => {
|
|
1811
|
+
var Yt, Ve;
|
|
1812
|
+
const Ot = ((Yt = V.size) == null ? void 0 : Yt.width) ?? 0, le = ((Ve = V.size) == null ? void 0 : Ve.height) ?? 0;
|
|
1813
|
+
return !(V.position.x + Ot < U.x || V.position.x > U.x + U.width || V.position.y + le < U.y || V.position.y > U.y + U.height);
|
|
1814
|
+
}).map((V) => V.id), bt = gt.filter((V) => {
|
|
1815
|
+
const Ot = V.points.some(
|
|
1816
|
+
(Yt) => ur(Yt.x, Yt.y, U)
|
|
1817
|
+
), le = !!V.labelPosition && ur(V.labelPosition.x, V.labelPosition.y, U);
|
|
1818
|
+
return Ot || le;
|
|
1819
|
+
}).map((V) => V.id);
|
|
1820
|
+
nt((V) => ({
|
|
1821
|
+
nodeIds: Array.from(/* @__PURE__ */ new Set([...V.nodeIds, ...ft])),
|
|
1822
|
+
edgeIds: Array.from(/* @__PURE__ */ new Set([...V.edgeIds, ...bt]))
|
|
1823
|
+
})), oe(null);
|
|
2123
1824
|
}
|
|
2124
|
-
|
|
1825
|
+
ht.current.active = !1, Pe(!1), (y = (u = r.target).releasePointerCapture) == null || y.call(u, r.pointerId);
|
|
2125
1826
|
},
|
|
2126
|
-
[
|
|
2127
|
-
),
|
|
2128
|
-
(
|
|
2129
|
-
if (!
|
|
1827
|
+
[gt, tt, _t, nt, z]
|
|
1828
|
+
), Fr = G(
|
|
1829
|
+
(r) => {
|
|
1830
|
+
if (!g || !At.current)
|
|
2130
1831
|
return;
|
|
2131
|
-
|
|
2132
|
-
const
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
1832
|
+
r.preventDefault();
|
|
1833
|
+
const u = ge(At.current, r.clientX, r.clientY), y = Rr.current, L = (u.x - y.x) / y.zoom, U = (u.y - y.y) / y.zoom, ft = Qt(
|
|
1834
|
+
y.zoom + (r.deltaY < 0 ? h : -h),
|
|
1835
|
+
Et,
|
|
1836
|
+
Tt
|
|
2136
1837
|
);
|
|
2137
|
-
|
|
2138
|
-
zoom:
|
|
2139
|
-
x:
|
|
2140
|
-
y:
|
|
1838
|
+
H({
|
|
1839
|
+
zoom: ft,
|
|
1840
|
+
x: u.x - L * ft,
|
|
1841
|
+
y: u.y - U * ft
|
|
2141
1842
|
});
|
|
2142
1843
|
},
|
|
2143
|
-
[
|
|
2144
|
-
),
|
|
2145
|
-
(
|
|
2146
|
-
if (
|
|
2147
|
-
switch (
|
|
1844
|
+
[Tt, Et, H, g, h]
|
|
1845
|
+
), Gr = G(
|
|
1846
|
+
(r) => {
|
|
1847
|
+
if (v)
|
|
1848
|
+
switch (r.key) {
|
|
2148
1849
|
case "+":
|
|
2149
1850
|
case "=":
|
|
2150
|
-
|
|
1851
|
+
r.preventDefault(), H((u) => ({ zoom: u.zoom + h }));
|
|
2151
1852
|
break;
|
|
2152
1853
|
case "-":
|
|
2153
1854
|
case "_":
|
|
2154
|
-
|
|
1855
|
+
r.preventDefault(), H((u) => ({ zoom: u.zoom - h }));
|
|
2155
1856
|
break;
|
|
2156
1857
|
case "0":
|
|
2157
|
-
|
|
1858
|
+
r.preventDefault(), Lt();
|
|
2158
1859
|
break;
|
|
2159
1860
|
case "ArrowLeft":
|
|
2160
1861
|
case "ArrowRight":
|
|
2161
1862
|
case "ArrowUp":
|
|
2162
1863
|
case "ArrowDown": {
|
|
2163
|
-
if (
|
|
2164
|
-
const
|
|
2165
|
-
if (
|
|
2166
|
-
const
|
|
2167
|
-
|
|
1864
|
+
if (r.preventDefault(), yt) {
|
|
1865
|
+
const u = lt.get(yt);
|
|
1866
|
+
if (u) {
|
|
1867
|
+
const y = r.key === "ArrowLeft" ? "left" : r.key === "ArrowRight" ? "right" : r.key === "ArrowUp" ? "up" : "down", L = $n(u, tt, y);
|
|
1868
|
+
L && (dt(L.id), Zt(L.id));
|
|
2168
1869
|
break;
|
|
2169
1870
|
}
|
|
2170
1871
|
}
|
|
2171
|
-
|
|
1872
|
+
H((u) => r.key === "ArrowLeft" ? { x: u.x + 32 } : r.key === "ArrowRight" ? { x: u.x - 32 } : r.key === "ArrowUp" ? { y: u.y + 32 } : { y: u.y - 32 });
|
|
2172
1873
|
break;
|
|
2173
1874
|
}
|
|
2174
1875
|
case "Enter":
|
|
2175
1876
|
case " ": {
|
|
2176
|
-
if (!
|
|
1877
|
+
if (!yt)
|
|
2177
1878
|
break;
|
|
2178
|
-
|
|
2179
|
-
const
|
|
2180
|
-
|
|
1879
|
+
r.preventDefault();
|
|
1880
|
+
const u = lt.get(yt);
|
|
1881
|
+
u && ce(u);
|
|
2181
1882
|
break;
|
|
2182
1883
|
}
|
|
2183
1884
|
case "Escape":
|
|
2184
|
-
|
|
1885
|
+
r.preventDefault(), xt(null), nt(he), dt(null);
|
|
2185
1886
|
break;
|
|
2186
1887
|
}
|
|
2187
1888
|
},
|
|
2188
1889
|
[
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
st,
|
|
2196
|
-
At,
|
|
2197
|
-
C,
|
|
1890
|
+
Zt,
|
|
1891
|
+
Lt,
|
|
1892
|
+
yt,
|
|
1893
|
+
ce,
|
|
1894
|
+
v,
|
|
1895
|
+
lt,
|
|
2198
1896
|
tt,
|
|
2199
|
-
|
|
2200
|
-
|
|
1897
|
+
xt,
|
|
1898
|
+
dt,
|
|
1899
|
+
nt,
|
|
1900
|
+
H,
|
|
1901
|
+
h
|
|
2201
1902
|
]
|
|
2202
|
-
),
|
|
2203
|
-
(
|
|
2204
|
-
|
|
2205
|
-
const
|
|
2206
|
-
|
|
1903
|
+
), Hr = G(
|
|
1904
|
+
(r) => {
|
|
1905
|
+
Rt(r);
|
|
1906
|
+
const u = lt.get(r);
|
|
1907
|
+
u && Nt(u, !0);
|
|
2207
1908
|
},
|
|
2208
|
-
[
|
|
2209
|
-
),
|
|
2210
|
-
const
|
|
2211
|
-
if (
|
|
2212
|
-
const
|
|
2213
|
-
|
|
1909
|
+
[Nt, lt, Rt]
|
|
1910
|
+
), Ur = G(() => {
|
|
1911
|
+
const r = Ge.current;
|
|
1912
|
+
if (r) {
|
|
1913
|
+
const u = lt.get(r);
|
|
1914
|
+
u && Nt(u, !1);
|
|
2214
1915
|
}
|
|
2215
|
-
|
|
2216
|
-
}, [
|
|
2217
|
-
(
|
|
2218
|
-
|
|
2219
|
-
const
|
|
2220
|
-
|
|
1916
|
+
Rt(null), xt(null);
|
|
1917
|
+
}, [Nt, lt, xt, Rt]), Cr = G(
|
|
1918
|
+
(r, u, y) => {
|
|
1919
|
+
xt({ nodeId: r, sourceIndex: u, pathKey: y });
|
|
1920
|
+
const L = lt.get(r);
|
|
1921
|
+
L && Nt(L, !0, "path");
|
|
2221
1922
|
},
|
|
2222
|
-
[
|
|
2223
|
-
),
|
|
2224
|
-
|
|
2225
|
-
}, [
|
|
2226
|
-
(
|
|
2227
|
-
const
|
|
2228
|
-
|
|
1923
|
+
[Nt, lt, xt]
|
|
1924
|
+
), Kr = G(() => {
|
|
1925
|
+
xt(null);
|
|
1926
|
+
}, [xt]), Vr = G(
|
|
1927
|
+
(r, u) => {
|
|
1928
|
+
const y = Xe.get(r);
|
|
1929
|
+
y && Ue(y, u), I.hoverHighlight && (Fe(u ? r : null), u && Rt(null));
|
|
2229
1930
|
},
|
|
2230
|
-
[
|
|
2231
|
-
),
|
|
1931
|
+
[I.hoverHighlight, Ue, Xe, Fe, Rt]
|
|
1932
|
+
), qr = A(
|
|
2232
1933
|
() => ({
|
|
2233
|
-
background:
|
|
2234
|
-
fontFamily:
|
|
2235
|
-
cursor:
|
|
1934
|
+
background: pt.background,
|
|
1935
|
+
fontFamily: pt.fontFamily,
|
|
1936
|
+
cursor: _e ? "grabbing" : m ? "grab" : "default",
|
|
2236
1937
|
outline: "none",
|
|
2237
|
-
touchAction:
|
|
1938
|
+
touchAction: m || g ? "none" : "auto",
|
|
2238
1939
|
overflow: "hidden",
|
|
2239
1940
|
userSelect: "none"
|
|
2240
1941
|
}),
|
|
2241
|
-
[
|
|
2242
|
-
),
|
|
2243
|
-
() =>
|
|
2244
|
-
[
|
|
2245
|
-
),
|
|
1942
|
+
[_e, pt.background, pt.fontFamily, m, g]
|
|
1943
|
+
), Ke = A(
|
|
1944
|
+
() => Dn(I.width, I.height, x),
|
|
1945
|
+
[I.height, I.width, x]
|
|
1946
|
+
), Dt = _t ? lr(_t) : null, Zr = N ? /* @__PURE__ */ M.jsx(
|
|
2246
1947
|
"g",
|
|
2247
1948
|
{
|
|
2248
1949
|
"aria-label": "viewport-controls",
|
|
2249
|
-
transform: `translate(${
|
|
1950
|
+
transform: `translate(${Ke.x}, ${Ke.y})`,
|
|
2250
1951
|
children: [
|
|
2251
1952
|
{
|
|
2252
1953
|
key: "zoom-in",
|
|
2253
1954
|
label: "+",
|
|
2254
|
-
width:
|
|
2255
|
-
onClick: () =>
|
|
1955
|
+
width: St,
|
|
1956
|
+
onClick: () => H((r) => ({ zoom: r.zoom + h }))
|
|
2256
1957
|
},
|
|
2257
1958
|
{
|
|
2258
1959
|
key: "zoom-out",
|
|
2259
1960
|
label: "−",
|
|
2260
|
-
width:
|
|
2261
|
-
onClick: () =>
|
|
1961
|
+
width: St,
|
|
1962
|
+
onClick: () => H((r) => ({ zoom: r.zoom - h }))
|
|
2262
1963
|
},
|
|
2263
1964
|
{
|
|
2264
1965
|
key: "fit-view",
|
|
2265
1966
|
label: "Fit",
|
|
2266
|
-
width:
|
|
2267
|
-
onClick: () =>
|
|
1967
|
+
width: ve,
|
|
1968
|
+
onClick: () => Lt()
|
|
2268
1969
|
},
|
|
2269
1970
|
{
|
|
2270
1971
|
key: "reset-view",
|
|
2271
1972
|
label: "1:1",
|
|
2272
|
-
width:
|
|
2273
|
-
onClick: () =>
|
|
1973
|
+
width: ve,
|
|
1974
|
+
onClick: () => H(sr)
|
|
2274
1975
|
}
|
|
2275
1976
|
].reduce(
|
|
2276
|
-
(
|
|
2277
|
-
x:
|
|
2278
|
-
controls: [...
|
|
1977
|
+
(r, u) => ({
|
|
1978
|
+
x: r.x + u.width + Ir,
|
|
1979
|
+
controls: [...r.controls, { ...u, x: r.x }]
|
|
2279
1980
|
}),
|
|
2280
1981
|
{ x: 0, controls: [] }
|
|
2281
|
-
).controls.map((
|
|
1982
|
+
).controls.map((r) => /* @__PURE__ */ M.jsxs(
|
|
2282
1983
|
"g",
|
|
2283
1984
|
{
|
|
2284
|
-
transform: `translate(${
|
|
1985
|
+
transform: `translate(${r.x}, 0)`,
|
|
2285
1986
|
role: "button",
|
|
2286
1987
|
tabIndex: 0,
|
|
2287
|
-
onClick: (
|
|
2288
|
-
|
|
1988
|
+
onClick: (u) => {
|
|
1989
|
+
u.stopPropagation(), r.onClick();
|
|
2289
1990
|
},
|
|
2290
|
-
onKeyDown: (
|
|
2291
|
-
(
|
|
1991
|
+
onKeyDown: (u) => {
|
|
1992
|
+
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.stopPropagation(), r.onClick());
|
|
2292
1993
|
},
|
|
2293
1994
|
children: [
|
|
2294
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ M.jsx(
|
|
2295
1996
|
"rect",
|
|
2296
1997
|
{
|
|
2297
|
-
width:
|
|
2298
|
-
height:
|
|
1998
|
+
width: r.width,
|
|
1999
|
+
height: St,
|
|
2299
2000
|
rx: 7,
|
|
2300
2001
|
ry: 7,
|
|
2301
2002
|
fill: "rgba(255,255,255,0.92)",
|
|
2302
2003
|
stroke: "rgba(15,23,42,0.18)"
|
|
2303
2004
|
}
|
|
2304
2005
|
),
|
|
2305
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ M.jsx(
|
|
2306
2007
|
"text",
|
|
2307
2008
|
{
|
|
2308
|
-
x:
|
|
2309
|
-
y:
|
|
2009
|
+
x: r.width / 2,
|
|
2010
|
+
y: St / 2 + 4,
|
|
2310
2011
|
textAnchor: "middle",
|
|
2311
|
-
fontSize:
|
|
2012
|
+
fontSize: r.label.length > 1 ? 10 : 16,
|
|
2312
2013
|
fontWeight: 700,
|
|
2313
2014
|
fill: "#0f172a",
|
|
2314
|
-
children:
|
|
2015
|
+
children: r.label
|
|
2315
2016
|
}
|
|
2316
2017
|
)
|
|
2317
2018
|
]
|
|
2318
2019
|
},
|
|
2319
|
-
|
|
2020
|
+
r.key
|
|
2320
2021
|
))
|
|
2321
2022
|
}
|
|
2322
2023
|
) : null;
|
|
2323
|
-
return /* @__PURE__ */
|
|
2024
|
+
return /* @__PURE__ */ M.jsxs(
|
|
2324
2025
|
"svg",
|
|
2325
2026
|
{
|
|
2326
|
-
ref:
|
|
2327
|
-
width:
|
|
2328
|
-
height:
|
|
2027
|
+
ref: At,
|
|
2028
|
+
width: I.width,
|
|
2029
|
+
height: I.height,
|
|
2329
2030
|
role: "figure",
|
|
2330
2031
|
"aria-label": "Graph",
|
|
2331
2032
|
tabIndex: 0,
|
|
2332
|
-
style:
|
|
2333
|
-
onClick: (
|
|
2334
|
-
|
|
2033
|
+
style: qr,
|
|
2034
|
+
onClick: (r) => {
|
|
2035
|
+
r.target === r.currentTarget && (nt(he), xt(null), dt(null));
|
|
2335
2036
|
},
|
|
2336
|
-
onPointerDown:
|
|
2337
|
-
onPointerMove:
|
|
2338
|
-
onPointerUp:
|
|
2339
|
-
onPointerLeave:
|
|
2340
|
-
onWheel:
|
|
2341
|
-
onKeyDown:
|
|
2037
|
+
onPointerDown: $r,
|
|
2038
|
+
onPointerMove: Br,
|
|
2039
|
+
onPointerUp: Ce,
|
|
2040
|
+
onPointerLeave: Ce,
|
|
2041
|
+
onWheel: Fr,
|
|
2042
|
+
onKeyDown: Gr,
|
|
2342
2043
|
children: [
|
|
2343
|
-
|
|
2344
|
-
/* @__PURE__ */
|
|
2044
|
+
Kt ? /* @__PURE__ */ M.jsxs("defs", { children: [
|
|
2045
|
+
/* @__PURE__ */ M.jsx(
|
|
2345
2046
|
"marker",
|
|
2346
2047
|
{
|
|
2347
|
-
id:
|
|
2048
|
+
id: Se,
|
|
2348
2049
|
viewBox: "0 0 10 10",
|
|
2349
2050
|
refX: "6",
|
|
2350
2051
|
refY: "5",
|
|
2351
2052
|
markerWidth: "6",
|
|
2352
2053
|
markerHeight: "6",
|
|
2353
2054
|
orient: "auto-start-reverse",
|
|
2354
|
-
children: /* @__PURE__ */
|
|
2055
|
+
children: /* @__PURE__ */ M.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: Le })
|
|
2355
2056
|
}
|
|
2356
2057
|
),
|
|
2357
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ M.jsx(
|
|
2358
2059
|
"marker",
|
|
2359
2060
|
{
|
|
2360
|
-
id:
|
|
2061
|
+
id: Ae,
|
|
2361
2062
|
viewBox: "0 0 10 10",
|
|
2362
2063
|
refX: "6",
|
|
2363
2064
|
refY: "5",
|
|
2364
2065
|
markerWidth: "6",
|
|
2365
2066
|
markerHeight: "6",
|
|
2366
2067
|
orient: "auto-start-reverse",
|
|
2367
|
-
children: /* @__PURE__ */
|
|
2068
|
+
children: /* @__PURE__ */ M.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: I.hoverEdgeColor })
|
|
2368
2069
|
}
|
|
2369
2070
|
),
|
|
2370
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ M.jsx(
|
|
2371
2072
|
"marker",
|
|
2372
2073
|
{
|
|
2373
|
-
id:
|
|
2074
|
+
id: Re,
|
|
2374
2075
|
viewBox: "0 0 10 10",
|
|
2375
2076
|
refX: "6",
|
|
2376
2077
|
refY: "5",
|
|
2377
2078
|
markerWidth: "6",
|
|
2378
2079
|
markerHeight: "6",
|
|
2379
2080
|
orient: "auto-start-reverse",
|
|
2380
|
-
children: /* @__PURE__ */
|
|
2081
|
+
children: /* @__PURE__ */ M.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: I.hoverNodeOutColor })
|
|
2381
2082
|
}
|
|
2382
2083
|
),
|
|
2383
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ M.jsx(
|
|
2384
2085
|
"marker",
|
|
2385
2086
|
{
|
|
2386
|
-
id:
|
|
2087
|
+
id: Me,
|
|
2387
2088
|
viewBox: "0 0 10 10",
|
|
2388
2089
|
refX: "6",
|
|
2389
2090
|
refY: "5",
|
|
2390
2091
|
markerWidth: "6",
|
|
2391
2092
|
markerHeight: "6",
|
|
2392
2093
|
orient: "auto-start-reverse",
|
|
2393
|
-
children: /* @__PURE__ */
|
|
2094
|
+
children: /* @__PURE__ */ M.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: ke })
|
|
2394
2095
|
}
|
|
2395
2096
|
)
|
|
2396
2097
|
] }) : null,
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
|
|
2399
|
-
/* @__PURE__ */
|
|
2400
|
-
|
|
2098
|
+
/* @__PURE__ */ M.jsx("g", { transform: `translate(${z.x}, ${z.y}) scale(${z.zoom})`, children: /* @__PURE__ */ M.jsxs("g", { ref: Pr, children: [
|
|
2099
|
+
re == null ? void 0 : re(He),
|
|
2100
|
+
/* @__PURE__ */ M.jsx(
|
|
2101
|
+
An,
|
|
2401
2102
|
{
|
|
2402
|
-
positionedNodes:
|
|
2403
|
-
layout:
|
|
2404
|
-
layoutDirection:
|
|
2405
|
-
labels:
|
|
2406
|
-
autoLabels:
|
|
2407
|
-
labelOffset:
|
|
2408
|
-
pillBackground:
|
|
2409
|
-
pillBorderColor:
|
|
2410
|
-
pillTextColor:
|
|
2103
|
+
positionedNodes: tt,
|
|
2104
|
+
layout: I.layout,
|
|
2105
|
+
layoutDirection: I.layoutDirection,
|
|
2106
|
+
labels: I.labels,
|
|
2107
|
+
autoLabels: I.autoLabels,
|
|
2108
|
+
labelOffset: I.labelOffset,
|
|
2109
|
+
pillBackground: I.labelPillBackground,
|
|
2110
|
+
pillBorderColor: I.labelPillBorderColor,
|
|
2111
|
+
pillTextColor: I.labelPillTextColor
|
|
2411
2112
|
}
|
|
2412
2113
|
),
|
|
2413
|
-
/* @__PURE__ */
|
|
2414
|
-
const
|
|
2415
|
-
return /* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ M.jsx("g", { "aria-label": "edges", children: Xr.map((r) => {
|
|
2115
|
+
const u = I.hoverHighlight && (Be === r.id || kt && (r.source === kt || r.target === kt)) || (Mt == null ? void 0 : Mt.edges.has(r.id)), y = kt && !Be && r.type !== "undirected" && r.target === kt;
|
|
2116
|
+
return /* @__PURE__ */ M.jsx(
|
|
2416
2117
|
s,
|
|
2417
2118
|
{
|
|
2418
|
-
edge:
|
|
2419
|
-
color:
|
|
2420
|
-
width:
|
|
2421
|
-
curveEdges:
|
|
2422
|
-
curveStrength:
|
|
2423
|
-
markerEnd:
|
|
2424
|
-
isHovered:
|
|
2425
|
-
isSelected:
|
|
2426
|
-
hoverColor:
|
|
2427
|
-
selectionColor:
|
|
2428
|
-
labelColor:
|
|
2429
|
-
selectionMarker:
|
|
2430
|
-
hoverMarker:
|
|
2431
|
-
hoverEnabled:
|
|
2432
|
-
hitStrokeWidth:
|
|
2433
|
-
hoverStrokeWidth:
|
|
2434
|
-
selectedStrokeWidth:
|
|
2435
|
-
onHoverChange: (
|
|
2436
|
-
onClick: () =>
|
|
2119
|
+
edge: r,
|
|
2120
|
+
color: Le,
|
|
2121
|
+
width: Ct,
|
|
2122
|
+
curveEdges: I.curveEdges && I.routingStyle !== "orthogonal",
|
|
2123
|
+
curveStrength: I.curveStrength,
|
|
2124
|
+
markerEnd: Kt ? `url(#${Se})` : void 0,
|
|
2125
|
+
isHovered: u,
|
|
2126
|
+
isSelected: ze.has(r.id) || Or.has(r.id),
|
|
2127
|
+
hoverColor: y ? I.hoverNodeOutColor : I.hoverEdgeColor,
|
|
2128
|
+
selectionColor: ze.has(r.id) ? ke : O,
|
|
2129
|
+
labelColor: I.edgeLabelColor,
|
|
2130
|
+
selectionMarker: Kt ? `url(#${Me})` : void 0,
|
|
2131
|
+
hoverMarker: Kt ? y ? `url(#${Re})` : `url(#${Ae})` : void 0,
|
|
2132
|
+
hoverEnabled: I.hoverHighlight,
|
|
2133
|
+
hitStrokeWidth: Ct + 8,
|
|
2134
|
+
hoverStrokeWidth: Ct + 1.5,
|
|
2135
|
+
selectedStrokeWidth: Ct + 1.5,
|
|
2136
|
+
onHoverChange: (L) => Vr(r.id, L),
|
|
2137
|
+
onClick: () => Wr(r)
|
|
2437
2138
|
},
|
|
2438
|
-
|
|
2139
|
+
r.id
|
|
2439
2140
|
);
|
|
2440
2141
|
}) }),
|
|
2441
|
-
/* @__PURE__ */
|
|
2442
|
-
|
|
2142
|
+
/* @__PURE__ */ M.jsx("g", { "aria-label": "nodes", children: tt.map((r) => /* @__PURE__ */ M.jsx(
|
|
2143
|
+
xr,
|
|
2443
2144
|
{
|
|
2444
|
-
node:
|
|
2445
|
-
Vertex:
|
|
2446
|
-
isSelected:
|
|
2447
|
-
isFocused:
|
|
2448
|
-
isHighlighted:
|
|
2449
|
-
activePathKey:
|
|
2450
|
-
activePathNodeIds:
|
|
2451
|
-
highlightColor:
|
|
2452
|
-
selectionColor:
|
|
2453
|
-
nodeBorderColor:
|
|
2454
|
-
nodeBorderWidth:
|
|
2455
|
-
hoverNodeBorderColor:
|
|
2456
|
-
hoverNodeBothColor:
|
|
2457
|
-
hoverNodeInColor:
|
|
2458
|
-
hoverNodeOutColor:
|
|
2459
|
-
hoverNodeHighlight:
|
|
2460
|
-
hoveredNodeStates:
|
|
2461
|
-
onNodeMeasure:
|
|
2462
|
-
onNodeFocus:
|
|
2463
|
-
onNodeClick:
|
|
2464
|
-
onNodeDoubleClick:
|
|
2465
|
-
onNodeMouseEnter:
|
|
2466
|
-
onNodeMouseLeave:
|
|
2467
|
-
onPathHover:
|
|
2468
|
-
onPathLeave:
|
|
2145
|
+
node: r,
|
|
2146
|
+
Vertex: e,
|
|
2147
|
+
isSelected: Nr.has(r.id),
|
|
2148
|
+
isFocused: yt === r.id,
|
|
2149
|
+
isHighlighted: zr.has(r.id),
|
|
2150
|
+
activePathKey: ae == null ? void 0 : ae.pathKey,
|
|
2151
|
+
activePathNodeIds: Mt == null ? void 0 : Mt.nodes,
|
|
2152
|
+
highlightColor: O,
|
|
2153
|
+
selectionColor: it,
|
|
2154
|
+
nodeBorderColor: Sr,
|
|
2155
|
+
nodeBorderWidth: Ar,
|
|
2156
|
+
hoverNodeBorderColor: Lr,
|
|
2157
|
+
hoverNodeBothColor: kr,
|
|
2158
|
+
hoverNodeInColor: I.hoverNodeInColor,
|
|
2159
|
+
hoverNodeOutColor: I.hoverNodeOutColor,
|
|
2160
|
+
hoverNodeHighlight: I.hoverNodeHighlight,
|
|
2161
|
+
hoveredNodeStates: Yr ?? void 0,
|
|
2162
|
+
onNodeMeasure: jr,
|
|
2163
|
+
onNodeFocus: dt,
|
|
2164
|
+
onNodeClick: ce,
|
|
2165
|
+
onNodeDoubleClick: Dr,
|
|
2166
|
+
onNodeMouseEnter: Hr,
|
|
2167
|
+
onNodeMouseLeave: Ur,
|
|
2168
|
+
onPathHover: Cr,
|
|
2169
|
+
onPathLeave: Kr
|
|
2469
2170
|
},
|
|
2470
|
-
|
|
2171
|
+
r.id
|
|
2471
2172
|
)) }),
|
|
2472
|
-
|
|
2173
|
+
ne == null ? void 0 : ne(He)
|
|
2473
2174
|
] }) }),
|
|
2474
|
-
|
|
2175
|
+
Dt ? /* @__PURE__ */ M.jsx(
|
|
2475
2176
|
"rect",
|
|
2476
2177
|
{
|
|
2477
|
-
x:
|
|
2478
|
-
y:
|
|
2479
|
-
width:
|
|
2480
|
-
height:
|
|
2178
|
+
x: Dt.x,
|
|
2179
|
+
y: Dt.y,
|
|
2180
|
+
width: Dt.width,
|
|
2181
|
+
height: Dt.height,
|
|
2481
2182
|
fill: "rgba(59, 130, 246, 0.12)",
|
|
2482
2183
|
stroke: "rgba(59, 130, 246, 0.8)",
|
|
2483
2184
|
strokeDasharray: "6 4",
|
|
2484
2185
|
pointerEvents: "none"
|
|
2485
2186
|
}
|
|
2486
2187
|
) : null,
|
|
2487
|
-
|
|
2188
|
+
Zr
|
|
2488
2189
|
]
|
|
2489
2190
|
}
|
|
2490
2191
|
);
|
|
2491
|
-
},
|
|
2492
|
-
|
|
2192
|
+
}, vr = Ft.memo(
|
|
2193
|
+
Ft.forwardRef(Bn)
|
|
2493
2194
|
);
|
|
2494
|
-
|
|
2495
|
-
const
|
|
2195
|
+
vr.displayName = "Graph";
|
|
2196
|
+
const Un = vr;
|
|
2496
2197
|
export {
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2198
|
+
En as EdgePath,
|
|
2199
|
+
Vn as EdgeType,
|
|
2200
|
+
Un as Graph,
|
|
2201
|
+
qn as LayoutDirection,
|
|
2202
|
+
Zn as LayoutType,
|
|
2203
|
+
Jn as NodeSide,
|
|
2204
|
+
to as buildEdgePath,
|
|
2205
|
+
eo as fromNxGraph,
|
|
2206
|
+
pr as groupPositionedNodesByColumn,
|
|
2207
|
+
ro as layoutNodes,
|
|
2208
|
+
no as renderGraphToSvg,
|
|
2209
|
+
oo as routeEdges
|
|
2509
2210
|
};
|