@graph-render/react 1.0.2 → 1.1.0

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