@graph-render/react 1.0.1 → 1.1.0

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