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