vue3-network-graph 0.2.2 → 0.2.3

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.mjs CHANGED
@@ -1,35 +1,32 @@
1
- import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, getCurrentInstance as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, unref as ee, watch as te, watchEffect as ne, withModifiers as g } from "vue";
2
- //#region node_modules/uuid/dist/stringify.js
3
- var _ = [];
4
- for (let e = 0; e < 256; ++e) _.push((e + 256).toString(16).slice(1));
5
- function re(e, t = 0) {
6
- return (_[e[t + 0]] + _[e[t + 1]] + _[e[t + 2]] + _[e[t + 3]] + "-" + _[e[t + 4]] + _[e[t + 5]] + "-" + _[e[t + 6]] + _[e[t + 7]] + "-" + _[e[t + 8]] + _[e[t + 9]] + "-" + _[e[t + 10]] + _[e[t + 11]] + _[e[t + 12]] + _[e[t + 13]] + _[e[t + 14]] + _[e[t + 15]]).toLowerCase();
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, getCurrentInstance as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderList as p, renderSlot as ee, toDisplayString as m, unref as te, watch as ne, watchEffect as re, withModifiers as h } from "vue";
2
+ // node_modules/uuid/dist/stringify.js
3
+ var g = [];
4
+ for (let e = 0; e < 256; ++e) g.push((e + 256).toString(16).slice(1));
5
+ function ie(e, t = 0) {
6
+ return (g[e[t + 0]] + g[e[t + 1]] + g[e[t + 2]] + g[e[t + 3]] + "-" + g[e[t + 4]] + g[e[t + 5]] + "-" + g[e[t + 6]] + g[e[t + 7]] + "-" + g[e[t + 8]] + g[e[t + 9]] + "-" + g[e[t + 10]] + g[e[t + 11]] + g[e[t + 12]] + g[e[t + 13]] + g[e[t + 14]] + g[e[t + 15]]).toLowerCase();
7
7
  }
8
- //#endregion
9
- //#region node_modules/uuid/dist/rng.js
10
- var ie = /* @__PURE__ */ new Uint8Array(16);
11
- function v() {
12
- return crypto.getRandomValues(ie);
8
+ // node_modules/uuid/dist/rng.js
9
+ var ae = /* @__PURE__ */ new Uint8Array(16);
10
+ function _() {
11
+ return crypto.getRandomValues(ae);
13
12
  }
14
- //#endregion
15
- //#region node_modules/uuid/dist/v4.js
16
- function ae(e, t, n) {
17
- return !t && !e && crypto.randomUUID ? crypto.randomUUID() : y(e, t, n);
13
+ // node_modules/uuid/dist/v4.js
14
+ function oe(e, t, n) {
15
+ return !t && !e && crypto.randomUUID ? crypto.randomUUID() : v(e, t, n);
18
16
  }
19
- function y(e, t, n) {
17
+ function v(e, t, n) {
20
18
  e ||= {};
21
- let r = e.random ?? e.rng?.() ?? v();
19
+ let r = e.random ?? e.rng?.() ?? _();
22
20
  if (r.length < 16) throw Error("Random bytes length must be >= 16");
23
21
  if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
24
22
  if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
25
23
  for (let e = 0; e < 16; ++e) t[n + e] = r[e];
26
24
  return t;
27
25
  }
28
- return re(r);
26
+ return ie(r);
29
27
  }
30
- //#endregion
31
- //#region src/components/topology-data.js
32
- var b = {
28
+ // src/components/topology-data.js
29
+ var y = {
33
30
  normal: {
34
31
  color: "#4ade80",
35
32
  label: "Running"
@@ -70,7 +67,7 @@ var b = {
70
67
  color: "#64748b",
71
68
  label: "Idle"
72
69
  }
73
- }, oe = {
70
+ }, se = {
74
71
  core: "#00f0ff",
75
72
  firewall: "#ff6b35",
76
73
  loadbalancer: "#a855f7",
@@ -80,73 +77,93 @@ var b = {
80
77
  cache: "#f43f5e",
81
78
  queue: "#fb923c",
82
79
  text: "#94a3b8"
83
- }, se = ["viewBox"], ce = [
80
+ }, ce = ["viewBox"], le = [
84
81
  "cx",
85
82
  "cy",
86
83
  "r"
87
- ], le = [
84
+ ], ue = [
88
85
  "offset",
89
86
  "stop-color",
90
87
  "stop-opacity"
91
- ], ue = ["id"], de = ["stop-color"], fe = ["stop-color"], pe = ["stop-color"], me = ["id"], he = ["fill"], ge = ["id"], _e = ["fill"], ve = [
88
+ ], de = ["id"], fe = ["stop-color"], pe = ["stop-color"], me = ["stop-color"], he = ["id"], ge = [
89
+ "offset",
90
+ "stop-color",
91
+ "stop-opacity"
92
+ ], _e = ["id"], ve = ["fill"], ye = ["id"], be = ["fill"], xe = [
92
93
  "width",
93
94
  "height",
94
95
  "x",
95
96
  "y"
96
- ], ye = ["width", "height"], be = ["d", "stroke"], xe = [
97
+ ], Se = ["width", "height"], Ce = ["d", "stroke"], we = [
97
98
  "width",
98
99
  "height",
99
100
  "x",
100
101
  "y",
101
102
  "opacity"
102
- ], Se = {
103
+ ], Te = {
103
104
  key: 1,
104
105
  class: "center-crosshair"
105
- }, Ce = [
106
+ }, Ee = [
106
107
  "x",
107
108
  "y",
108
109
  "width",
109
110
  "height",
110
111
  "fill"
111
- ], we = [
112
+ ], De = [
112
113
  "x",
113
114
  "y",
114
115
  "width",
115
116
  "height",
116
117
  "stroke"
117
- ], Te = [
118
+ ], Oe = [
118
119
  "cx",
119
120
  "cy",
120
121
  "fill"
121
- ], Ee = [
122
+ ], ke = [
122
123
  "cx",
123
124
  "cy",
124
125
  "fill"
125
- ], De = [
126
+ ], Ae = [
126
127
  "cx",
127
128
  "cy",
128
129
  "fill"
129
- ], Oe = [
130
+ ], je = [
130
131
  "cx",
131
132
  "cy",
132
133
  "fill"
133
- ], ke = [
134
+ ], Me = [
134
135
  "x",
135
136
  "y",
136
137
  "transform",
137
138
  "fill"
138
- ], Ae = {
139
+ ], Ne = ["transform"], Pe = [
140
+ "x",
141
+ "y",
142
+ "width",
143
+ "height",
144
+ "rx",
145
+ "fill"
146
+ ], Fe = [
147
+ "x",
148
+ "y",
149
+ "width",
150
+ "height",
151
+ "rx",
152
+ "stroke",
153
+ "stroke-width",
154
+ "stroke-dasharray"
155
+ ], Ie = {
139
156
  key: 2,
140
157
  class: "node-base-layer",
141
158
  "pointer-events": "none"
142
- }, je = ["transform"], Me = [
159
+ }, Le = ["transform"], Re = [
143
160
  "x",
144
161
  "y",
145
162
  "width",
146
163
  "height",
147
164
  "rx",
148
165
  "fill"
149
- ], Ne = [
166
+ ], ze = [
150
167
  "x",
151
168
  "y",
152
169
  "width",
@@ -155,22 +172,22 @@ var b = {
155
172
  "stroke",
156
173
  "stroke-width",
157
174
  "stroke-dasharray"
158
- ], Pe = [
175
+ ], Be = [
159
176
  "d",
160
177
  "stroke",
161
178
  "opacity",
162
179
  "marker-end"
163
- ], Fe = ["d", "stroke"], Ie = ["d", "stroke"], Le = { key: 0 }, Re = ["d", "stroke"], ze = ["dur"], Be = ["d", "stroke"], Ve = ["dur"], He = ["d", "stroke"], Ue = ["dur"], We = [
180
+ ], Ve = ["d", "stroke"], He = ["d", "stroke"], Ue = { key: 0 }, We = ["d", "stroke"], Ge = ["dur"], Ke = ["d", "stroke"], qe = ["dur"], Je = ["d", "stroke"], Ye = ["dur"], Xe = [
164
181
  "d",
165
182
  "stroke",
166
183
  "stroke-width",
167
184
  "stroke-dasharray",
168
185
  "marker-end"
169
- ], Ge = ["to", "dur"], Ke = { key: 0 }, qe = ["fill"], Je = ["path", "dur"], Ye = ["fill"], Xe = ["path", "dur"], Ze = ["transform"], Qe = [
186
+ ], Ze = ["to", "dur"], Qe = { key: 0 }, $e = ["fill"], et = ["path", "dur"], tt = ["fill"], nt = ["path", "dur"], rt = ["transform"], it = [
170
187
  "y",
171
188
  "height",
172
189
  "stroke"
173
- ], $e = ["font-size", "fill"], et = { key: 1 }, tt = ["transform"], nt = [
190
+ ], at = ["font-size", "fill"], ot = { key: 1 }, st = ["transform"], ct = [
174
191
  "x",
175
192
  "y",
176
193
  "width",
@@ -180,7 +197,7 @@ var b = {
180
197
  "stroke",
181
198
  "stroke-opacity",
182
199
  "stroke-dasharray"
183
- ], rt = ["font-size", "fill"], it = ["transform"], at = [
200
+ ], lt = ["font-size", "fill"], ut = ["transform"], dt = [
184
201
  "x",
185
202
  "y",
186
203
  "width",
@@ -190,7 +207,7 @@ var b = {
190
207
  "stroke",
191
208
  "stroke-opacity",
192
209
  "stroke-dasharray"
193
- ], ot = ["font-size", "fill"], st = ["transform"], ct = [
210
+ ], ft = ["font-size", "fill"], pt = ["transform"], mt = [
194
211
  "x",
195
212
  "y",
196
213
  "width",
@@ -200,46 +217,69 @@ var b = {
200
217
  "stroke",
201
218
  "stroke-opacity",
202
219
  "stroke-dasharray"
203
- ], lt = ["font-size", "fill"], ut = { key: 3 }, dt = [
220
+ ], ht = ["font-size", "fill"], gt = { key: 3 }, _t = [
204
221
  "x1",
205
222
  "y1",
206
223
  "x2",
207
224
  "y2",
208
225
  "stroke"
209
- ], ft = [
226
+ ], vt = [
210
227
  "cx",
211
228
  "cy",
212
229
  "fill"
213
- ], pt = [
230
+ ], yt = [
231
+ "x",
232
+ "y",
233
+ "width",
234
+ "height",
235
+ "stroke"
236
+ ], bt = { class: "region-hit-layer" }, xt = [
237
+ "transform",
238
+ "onMousedown",
239
+ "onClick"
240
+ ], St = [
241
+ "x",
242
+ "y",
243
+ "width",
244
+ "height",
245
+ "rx"
246
+ ], Ct = [
214
247
  "x",
215
248
  "y",
216
249
  "width",
217
250
  "height",
251
+ "rx"
252
+ ], wt = [
253
+ "x",
254
+ "y",
255
+ "width",
256
+ "height",
257
+ "rx",
218
258
  "stroke"
219
- ], mt = ["d", "onClick"], ht = [
259
+ ], Tt = ["d", "onClick"], Et = [
220
260
  "transform",
221
261
  "onMousedown",
222
262
  "onClick"
223
- ], gt = [
263
+ ], Dt = [
224
264
  "x",
225
265
  "y",
226
266
  "width",
227
267
  "height",
228
268
  "rx",
229
269
  "stroke-width"
230
- ], _t = [
270
+ ], Ot = [
231
271
  "x",
232
272
  "y",
233
273
  "width",
234
274
  "height"
235
- ], vt = [
275
+ ], kt = [
236
276
  "x",
237
277
  "y",
238
278
  "width",
239
279
  "height",
240
280
  "rx",
241
281
  "fill"
242
- ], yt = [
282
+ ], At = [
243
283
  "x",
244
284
  "y",
245
285
  "width",
@@ -248,63 +288,79 @@ var b = {
248
288
  "stroke",
249
289
  "stroke-width",
250
290
  "stroke-dasharray"
251
- ], bt = [
291
+ ], jt = [
252
292
  "x",
253
293
  "y",
254
294
  "width",
255
295
  "height",
256
296
  "rx",
257
297
  "stroke"
258
- ], xt = [
298
+ ], Mt = [
259
299
  "transform",
260
300
  "fill",
261
301
  "font-size"
262
- ], St = ["dy"], Ct = ["r", "stroke"], wt = ["values"], Tt = [
302
+ ], Nt = ["dy"], Pt = [
303
+ "r",
304
+ "fill",
305
+ "stroke",
306
+ "stroke-width",
307
+ "opacity"
308
+ ], Ft = [
309
+ "values",
310
+ "dur",
311
+ "begin"
312
+ ], It = [
313
+ "values",
314
+ "keyTimes",
315
+ "dur",
316
+ "begin"
317
+ ], Lt = [
263
318
  "x",
264
319
  "y",
265
320
  "width",
266
321
  "height",
322
+ "viewBox",
267
323
  "preserveAspectRatio"
268
- ], Et = [
324
+ ], Rt = [
269
325
  "href",
270
326
  "x",
271
327
  "y",
272
328
  "width",
273
329
  "height"
274
- ], Dt = ["transform"], Ot = ["fill"], kt = ["transform"], At = ["fill"], jt = [
330
+ ], zt = ["transform"], Bt = ["fill"], Vt = ["transform"], Ht = ["fill"], Ut = [
275
331
  "y",
276
332
  "transform",
277
333
  "fill",
278
334
  "font-size",
279
335
  "font-weight"
280
- ], Mt = ["dy"], Nt = {
281
- key: 8,
336
+ ], Wt = ["dy"], Gt = {
337
+ key: 9,
282
338
  class: "node-handles"
283
- }, Pt = [
339
+ }, Kt = [
284
340
  "cx",
285
341
  "cy",
286
342
  "stroke",
287
343
  "onPointerdown"
288
- ], Ft = {
344
+ ], qt = {
289
345
  key: 4,
290
346
  class: "node-resize-layer"
291
- }, It = [
347
+ }, Jt = [
292
348
  "x",
293
349
  "y",
294
350
  "onMousedown"
295
- ], Lt = {
351
+ ], Yt = {
296
352
  key: 0,
297
353
  "pointer-events": "none"
298
- }, Rt = [
354
+ }, Xt = [
299
355
  "d",
300
356
  "stroke",
301
357
  "marker-end"
302
- ], zt = [
358
+ ], Zt = [
303
359
  "x",
304
360
  "y",
305
361
  "width",
306
362
  "height"
307
- ], Bt = 6, Vt = 14, Ht = 3, x = 60, Ut = .2, Wt = 5, Gt = 160, Kt = 140, qt = 12, Jt = 4e3, Yt = 12, Xt = 4e3, Zt = 45, Qt = {
363
+ ], Qt = 6, $t = 14, en = 3, tn = .2, nn = 5, rn = 160, an = 140, on = 12, sn = 4e3, cn = 12, ln = 4e3, un = 45, dn = 32, fn = {
308
364
  __name: "Topology",
309
365
  props: {
310
366
  nodes: {
@@ -362,10 +418,10 @@ var b = {
362
418
  "node-resize-end",
363
419
  "delete-request"
364
420
  ],
365
- setup(_, { expose: re, emit: ie }) {
366
- let v = _, y = ie, Qt = 0, $t = () => {
367
- Qt++;
368
- }, en = (e) => e && typeof e == "object" ? {
421
+ setup(g, { expose: ie, emit: ae }) {
422
+ let _ = g, v = ae, fn = 0, pn = () => {
423
+ fn++;
424
+ }, mn = (e) => e && typeof e == "object" ? {
369
425
  text: e.text,
370
426
  rotation: e.rotation || 0,
371
427
  fontSize: e.fontSize,
@@ -375,147 +431,147 @@ var b = {
375
431
  rotation: 0,
376
432
  fontSize: void 0,
377
433
  color: void 0
378
- }, tn = (e, t = 11) => e.fontSize || t, nn = (e) => e.fontColor || "#000000", rn = (e, t = 500) => e.fontWeight || t, an = (e, t) => e.fontSize || en(t).fontSize || 8, on = (e, t) => e.fontColor || en(t).color || t != null && t === e.centerText && gi.value || "#000000", S = f(v.nodes.map((e) => ({ ...e }))), sn = null, C = () => {
379
- sn = S.value, y("update:nodes", S.value);
434
+ }, hn = (e, t = 11) => e.fontSize || t, gn = (e) => e.fontColor || "#000000", _n = (e, t = 500) => e.fontWeight || t, vn = (e, t) => e.fontSize || mn(t).fontSize || 8, yn = (e, t) => e.fontColor || mn(t).color || t != null && t === e.centerText && na.value || "#000000", b = f(_.nodes.map((e) => ({ ...e }))), bn = null, x = () => {
435
+ bn = b.value, v("update:nodes", b.value);
380
436
  };
381
- te(() => v.nodes, (e) => {
437
+ ne(() => _.nodes, (e) => {
382
438
  let t = Array.isArray(e) ? e : [];
383
- if (t === sn) return;
439
+ if (t === bn) return;
384
440
  let n = null, r = null;
385
441
  try {
386
- n = JSON.stringify(t), r = JSON.stringify(S.value);
442
+ n = JSON.stringify(t), r = JSON.stringify(b.value);
387
443
  } catch {
388
444
  n = null;
389
445
  }
390
- (n === null || n !== r) && ($t(), S.value = t.map((e) => ({ ...e })));
446
+ (n === null || n !== r) && (pn(), b.value = t.map((e) => ({ ...e })));
391
447
  }, { deep: !0 });
392
- let cn = f(v.lineMode);
393
- te(() => v.lineMode, (e) => {
394
- cn.value = e;
448
+ let xn = f(_.lineMode);
449
+ ne(() => _.lineMode, (e) => {
450
+ xn.value = e;
395
451
  });
396
- let w = t({
397
- get: () => cn.value,
452
+ let Sn = t({
453
+ get: () => xn.value,
398
454
  set: (e) => {
399
- cn.value = e, y("update:lineMode", e);
455
+ xn.value = e, v("update:lineMode", e);
400
456
  }
401
- }), T = f(null), E = f(null), ln = f({
457
+ }), S = f(null), C = f(null), Cn = f({
402
458
  x: 0,
403
459
  y: 0
404
- }), un = f(null), dn = null, fn = !1, pn = !1, D = f([]), O = f(/* @__PURE__ */ new Map()), k = f(/* @__PURE__ */ new Set()), A = t(() => {
405
- let e = v.edges, t = [];
406
- if (D.value.length) {
460
+ }), wn = f(null), Tn = null, En = !1, Dn = !1, w = f([]), T = f(/* @__PURE__ */ new Map()), E = f(/* @__PURE__ */ new Set()), D = t(() => {
461
+ let e = _.edges, t = [];
462
+ if (w.value.length) {
407
463
  let n = new Set(e.map((e) => e.id));
408
- t = D.value.filter((e) => !n.has(e.id));
464
+ t = w.value.filter((e) => !n.has(e.id));
409
465
  }
410
- let n = t.length ? [...e, ...t] : e, r = O.value;
466
+ let n = t.length ? [...e, ...t] : e, r = T.value;
411
467
  r.size && (n = n.map((e) => r.has(e.id) ? {
412
468
  ...e,
413
469
  ...r.get(e.id)
414
470
  } : e));
415
- let i = new Set(S.value.map((e) => e.id)), a = k.value;
471
+ let i = new Set(b.value.map((e) => e.id)), a = E.value;
416
472
  return n.filter((e) => !a.has(e.id) && i.has(e.from) && i.has(e.to));
417
- }), mn = t(() => v.config.watchDataChanges === !0), hn = f({
473
+ }), On = t(() => _.config.watchDataChanges === !0), kn = f({
418
474
  nodes: [],
419
475
  edges: []
420
- }), gn = "", j = null, _n = () => JSON.parse(JSON.stringify({
421
- nodes: S.value,
422
- edges: A.value
423
- })), vn = (e, t) => {
476
+ }), An = "", O = null, jn = () => JSON.parse(JSON.stringify({
477
+ nodes: b.value,
478
+ edges: D.value
479
+ })), Mn = (e, t) => {
424
480
  let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e]));
425
481
  return {
426
482
  added: t.filter((e) => !n.has(e.id)).map((e) => e.id),
427
483
  removed: e.filter((e) => !r.has(e.id)).map((e) => e.id),
428
484
  updated: t.filter((e) => n.has(e.id) && JSON.stringify(n.get(e.id)) !== JSON.stringify(e)).map((e) => e.id)
429
485
  };
430
- }, yn = (e) => ({
431
- nodes: vn(hn.value.nodes, e.nodes),
432
- edges: vn(hn.value.edges, e.edges)
433
- }), bn = () => {
434
- if (j = null, !mn.value) return;
435
- let e = _n(), t = JSON.stringify(e);
436
- if (t === gn) return;
437
- let n = yn(e), r = n.nodes.added.length + n.nodes.removed.length + n.nodes.updated.length + n.edges.added.length + n.edges.removed.length + n.edges.updated.length;
438
- gn = t, r && y("data-change", {
486
+ }, Nn = (e) => ({
487
+ nodes: Mn(kn.value.nodes, e.nodes),
488
+ edges: Mn(kn.value.edges, e.edges)
489
+ }), Pn = () => {
490
+ if (O = null, !On.value) return;
491
+ let e = jn(), t = JSON.stringify(e);
492
+ if (t === An) return;
493
+ let n = Nn(e), r = n.nodes.added.length + n.nodes.removed.length + n.nodes.updated.length + n.edges.added.length + n.edges.removed.length + n.edges.updated.length;
494
+ An = t, r && v("data-change", {
439
495
  nodes: e.nodes,
440
496
  edges: e.edges,
441
497
  summary: n
442
498
  });
443
- }, xn = () => {
444
- mn.value && (j && clearTimeout(j), j = setTimeout(bn, 300));
445
- }, Sn = () => {
446
- j &&= (clearTimeout(j), null), hn.value = _n(), gn = "";
499
+ }, Fn = () => {
500
+ On.value && (O && clearTimeout(O), O = setTimeout(Pn, 300));
501
+ }, In = () => {
502
+ O &&= (clearTimeout(O), null), kn.value = jn(), An = "";
447
503
  };
448
- te([
449
- S,
450
- D,
451
- k,
452
- O
453
- ], () => xn(), { deep: !0 }), te(mn, (e) => {
454
- e ? Sn() : j &&= (clearTimeout(j), null);
504
+ ne([
505
+ b,
506
+ w,
507
+ E,
508
+ T
509
+ ], () => Fn(), { deep: !0 }), ne(On, (e) => {
510
+ e ? In() : O &&= (clearTimeout(O), null);
455
511
  }), u(() => {
456
- mn.value && Sn();
512
+ On.value && In();
457
513
  });
458
- let Cn = () => _n(), wn = () => {
459
- let e = new Set(z.value), t = new Set(B.value);
514
+ let Ln = () => jn(), Rn = () => {
515
+ let e = new Set(L.value), t = new Set(R.value);
460
516
  return {
461
517
  nodeIds: e,
462
- nodes: S.value.filter((t) => e.has(t.id)),
463
- edges: A.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to))
518
+ nodes: b.value.filter((t) => e.has(t.id)),
519
+ edges: D.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to))
464
520
  };
465
- }, Tn = () => {
466
- let { nodeIds: e, nodes: t, edges: n } = wn();
521
+ }, zn = () => {
522
+ let { nodeIds: e, nodes: t, edges: n } = Rn();
467
523
  return !t.length && !n.length ? {
468
524
  nodes: [],
469
525
  edges: []
470
- } : (t.length && (S.value = S.value.filter((t) => !e.has(t.id)), C()), n.length && (k.value = /* @__PURE__ */ new Set([...k.value, ...n.map((e) => e.id)]), D.value = D.value.filter((e) => !k.value.has(e.id)), y("edge-remove", n.map((e) => JSON.parse(JSON.stringify(e))))), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), JSON.parse(JSON.stringify({
526
+ } : (t.length && (b.value = b.value.filter((t) => !e.has(t.id)), x()), n.length && (E.value = /* @__PURE__ */ new Set([...E.value, ...n.map((e) => e.id)]), w.value = w.value.filter((e) => !E.value.has(e.id)), v("edge-remove", n.map((e) => JSON.parse(JSON.stringify(e))))), L.value = [], R.value = [], v("node-select", null), v("edge-select", null), z(), JSON.parse(JSON.stringify({
471
527
  nodes: t,
472
528
  edges: n
473
529
  })));
474
- }, En = (e) => {
530
+ }, Bn = (e) => {
475
531
  let t = e.target;
476
532
  if (!t || t === document.body) return !1;
477
533
  let n = String(t.tagName || "").toLowerCase();
478
534
  return n === "input" || n === "textarea" || n === "select" || t.isContentEditable;
479
- }, Dn = o(), On = () => {
480
- let e = Dn?.vnode?.props;
535
+ }, Vn = o(), Hn = () => {
536
+ let e = Vn?.vnode?.props;
481
537
  return !!e && "onDeleteRequest" in e;
482
- }, kn = () => {
483
- let { nodes: e, edges: t } = wn();
484
- y("delete-request", JSON.parse(JSON.stringify({
538
+ }, Un = () => {
539
+ let { nodes: e, edges: t } = Rn();
540
+ v("delete-request", JSON.parse(JSON.stringify({
485
541
  nodes: e,
486
542
  edges: t
487
543
  })));
488
- }, An = (e) => {
489
- (e.key === "Delete" || e.key === "Backspace") && (e.isComposing || e.ctrlKey || e.metaKey || e.altKey || v.config?.enableDeleteKey !== !1 && v.editable && (En(e) || (z.value.length || B.value.length) && (T.value || J.value || Y.value || (e.preventDefault(), On() ? kn() : Tn()))));
544
+ }, Wn = (e) => {
545
+ e.key !== "Delete" && e.key !== "Backspace" || e.isComposing || e.ctrlKey || e.metaKey || e.altKey || _.config?.enableDeleteKey !== !1 && _.editable && (Bn(e) || (L.value.length || R.value.length) && (S.value || J.value || Y.value || (e.preventDefault(), Hn() ? Un() : zn())));
490
546
  };
491
- u(() => window.addEventListener("keydown", An)), l(() => window.removeEventListener("keydown", An));
492
- let jn = (e) => {
493
- let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(S.value.map((e) => e.id)), r = [];
547
+ u(() => window.addEventListener("keydown", Wn)), l(() => window.removeEventListener("keydown", Wn));
548
+ let Gn = (e) => {
549
+ let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(b.value.map((e) => e.id)), r = [];
494
550
  for (let e of t) {
495
551
  let t = JSON.parse(JSON.stringify(e));
496
- if (t.id == null) t.id = ae();
552
+ if (t.id == null) t.id = oe();
497
553
  else if (n.has(t.id)) continue;
498
554
  n.add(t.id), r.push(t);
499
555
  }
500
- return r.length ? (S.value = [...S.value, ...r], C(), JSON.parse(JSON.stringify(r))) : [];
501
- }, Mn = (e) => {
502
- let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(A.value.map((e) => e.id)), r = [];
556
+ return r.length ? (b.value = [...b.value, ...r], x(), JSON.parse(JSON.stringify(r))) : [];
557
+ }, Kn = (e) => {
558
+ let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(D.value.map((e) => e.id)), r = [];
503
559
  for (let e of t) {
504
560
  let t = JSON.parse(JSON.stringify(e));
505
561
  if (t.from != null && t.to != null) {
506
- if (t.id == null) t.id = ae();
562
+ if (t.id == null) t.id = oe();
507
563
  else if (n.has(t.id)) continue;
508
564
  n.add(t.id), r.push(t);
509
565
  }
510
566
  }
511
567
  if (!r.length) return [];
512
- let i = r.filter((e) => k.value.has(e.id));
568
+ let i = r.filter((e) => E.value.has(e.id));
513
569
  if (i.length) {
514
570
  let e = new Set(i.map((e) => e.id));
515
- k.value = new Set([...k.value].filter((t) => !e.has(t)));
571
+ E.value = new Set([...E.value].filter((t) => !e.has(t)));
516
572
  }
517
- return D.value = [...D.value, ...r], r.forEach((e) => y("edge-create", JSON.parse(JSON.stringify(e)))), JSON.parse(JSON.stringify(r));
518
- }, Nn = (e) => {
573
+ return w.value = [...w.value, ...r], r.forEach((e) => v("edge-create", JSON.parse(JSON.stringify(e)))), JSON.parse(JSON.stringify(r));
574
+ }, qn = (e) => {
519
575
  let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
520
576
  if (!t.length) return [];
521
577
  let n = /* @__PURE__ */ new Map();
@@ -528,7 +584,7 @@ var b = {
528
584
  });
529
585
  }
530
586
  let r = [];
531
- return S.value = S.value.map((e) => {
587
+ return b.value = b.value.map((e) => {
532
588
  let t = n.get(e.id);
533
589
  if (!t) return e;
534
590
  let i = {
@@ -536,11 +592,11 @@ var b = {
536
592
  ...t
537
593
  };
538
594
  return r.push(i), i;
539
- }), r.length ? (C(), JSON.parse(JSON.stringify(r))) : [];
540
- }, Pn = (e) => {
595
+ }), r.length ? (x(), JSON.parse(JSON.stringify(r))) : [];
596
+ }, Jn = (e) => {
541
597
  let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
542
598
  if (!t.length) return [];
543
- let n = new Set(A.value.map((e) => e.id)), r = new Map(O.value), i = [];
599
+ let n = new Set(D.value.map((e) => e.id)), r = new Map(T.value), i = [];
544
600
  for (let e of t) {
545
601
  let { id: t, ...a } = e;
546
602
  if (!n.has(t)) continue;
@@ -551,43 +607,43 @@ var b = {
551
607
  ...o
552
608
  };
553
609
  r.set(t, s);
554
- let c = A.value.find((e) => e.id === t);
610
+ let c = D.value.find((e) => e.id === t);
555
611
  i.push({
556
612
  ...c,
557
613
  ...s
558
614
  });
559
615
  }
560
- return i.length ? (O.value = r, y("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
561
- }, Fn = (e) => {
616
+ return i.length ? (T.value = r, v("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
617
+ }, Yn = (e) => {
562
618
  let t = e && typeof e == "object" ? e : null;
563
- return D.value = [], k.value = /* @__PURE__ */ new Set(), O.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (S.value = JSON.parse(JSON.stringify(t.nodes)), C()) : (S.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), sn = S.value), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), Sn(), _n();
619
+ return w.value = [], E.value = /* @__PURE__ */ new Set(), T.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (b.value = JSON.parse(JSON.stringify(t.nodes)), x()) : (b.value = (Array.isArray(_.nodes) ? _.nodes : []).map((e) => ({ ...e })), bn = b.value), L.value = [], R.value = [], v("node-select", null), v("edge-select", null), z(), In(), jn();
564
620
  };
565
- te(() => v.edges, (e) => {
566
- $t();
621
+ ne(() => _.edges, (e) => {
622
+ pn();
567
623
  let t = Array.isArray(e) ? e : [], n = new Set(t.map((e) => e.id));
568
- if (D.value.length) {
569
- let e = D.value.filter((e) => !n.has(e.id));
570
- e.length !== D.value.length && (D.value = e);
624
+ if (w.value.length) {
625
+ let e = w.value.filter((e) => !n.has(e.id));
626
+ e.length !== w.value.length && (w.value = e);
571
627
  }
572
- if (O.value.size) {
573
- let e = new Map(O.value), n = new Set(D.value.map((e) => e.id)), r = !1;
628
+ if (T.value.size) {
629
+ let e = new Map(T.value), n = new Set(w.value.map((e) => e.id)), r = !1;
574
630
  for (let [i, a] of e) {
575
631
  let o = t.find((e) => e.id === i);
576
632
  o ? Object.entries(a).every(([e, t]) => JSON.stringify(o[e] ?? null) === JSON.stringify(t ?? null)) && (e.delete(i), r = !0) : n.has(i) || (e.delete(i), r = !0);
577
633
  }
578
- r && (O.value = e);
634
+ r && (T.value = e);
579
635
  }
580
636
  }, { deep: !0 });
581
- let In = t(() => {
637
+ let k = t(() => {
582
638
  let e = {};
583
- A.value.forEach((t) => {
639
+ D.value.forEach((t) => {
584
640
  let n = [t.from, t.to].sort().join("__");
585
641
  e[n] || (e[n] = []), e[n].push(t);
586
642
  });
587
643
  let t = {};
588
644
  return Object.entries(e).forEach(([e, n]) => {
589
645
  let r = n.length;
590
- r > Bt ? n.forEach((n, i) => {
646
+ r > Qt ? n.forEach((n, i) => {
591
647
  t[n.id] = i === 0 ? {
592
648
  key: e,
593
649
  index: 0,
@@ -616,44 +672,50 @@ var b = {
616
672
  };
617
673
  });
618
674
  }), t;
619
- }), Ln = t(() => {
675
+ }), Xn = t(() => {
620
676
  let e = /* @__PURE__ */ new Map();
621
- for (let t of S.value) e.set(t.id, t);
677
+ for (let t of b.value) e.set(t.id, t);
622
678
  return e;
623
- }), M = (e) => Ln.value.get(e), N = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", Rn = (e) => b[e.state] || b.normal, zn = (e) => e.nodeType === "text", Bn = (e) => e.nodeType === "border-only", Vn = [
679
+ }), A = (e) => Xn.value.get(e), j = (e) => e.state != "none" && y[e.state] && y[e.state].color || "#00f0ff", Zn = (e) => y[e.state] || y.normal, Qn = (e) => e.nodeType === "text", $n = (e) => e.nodeType === "border-only", M = (e) => e.nodeType === "region", er = (e) => e.background || "#f60f60", tr = (e) => e.borderStyle !== "none", nr = (e) => {
680
+ let t = Number(e.borderWidth);
681
+ return Number.isFinite(t) && t > 0 ? t : 1.5;
682
+ }, rr = (e, t) => {
683
+ let n = Number(e);
684
+ return Number.isFinite(n) && n > 0 ? n : t;
685
+ }, ir = t(() => rr(_.config?.baseIconWidth, 60)), ar = t(() => rr(_.config?.baseIconHeight, 60)), or = [
624
686
  "image",
625
687
  "img",
626
688
  "picture"
627
- ], P = (e) => {
689
+ ], sr = (e) => {
628
690
  if (!e) return "";
629
691
  let t = e.image ?? e.src ?? e.img ?? e.imageUrl;
630
692
  return typeof t == "string" && t.trim() ? t.trim() : "";
631
- }, Hn = (e) => e ? Vn.includes(String(e.nodeType ?? "").toLowerCase()) ? !0 : (v.config?.imageNodeBySource || !e.nodeType) && !!P(e) : !1, Un = t(() => v.config?.imageFit === "cover" ? "cover" : "contain"), Wn = t(() => Un.value === "contain" ? "xMidYMid meet" : "xMidYMid slice"), Gn = `-30 -30 ${x} ${x}`, Kn = /* @__PURE__ */ new Map(), qn = f(0), Jn = (e) => {
632
- if (!e || Kn.has(e) || typeof Image > "u") return;
633
- Kn.set(e, null);
693
+ }, cr = (e) => e ? or.includes(String(e.nodeType ?? "").toLowerCase()) ? !0 : (_.config?.imageNodeBySource || !e.nodeType) && !!sr(e) : !1, lr = t(() => _.config?.imageFit === "cover" ? "cover" : "contain"), ur = t(() => lr.value === "contain" ? "xMidYMid meet" : "xMidYMid slice"), dr = t(() => `${-ir.value / 2} ${-ar.value / 2} ${ir.value} ${ar.value}`), fr = /* @__PURE__ */ new Map(), pr = f(0), mr = (e) => {
694
+ if (!e || fr.has(e) || typeof Image > "u") return;
695
+ fr.set(e, null);
634
696
  let t = new Image();
635
697
  t.onload = () => {
636
- Kn.set(e, {
698
+ fr.set(e, {
637
699
  w: t.naturalWidth || 1,
638
700
  h: t.naturalHeight || 1
639
- }), qn.value++;
701
+ }), pr.value++;
640
702
  }, t.onerror = () => {
641
- Kn.set(e, {
703
+ fr.set(e, {
642
704
  w: 1,
643
705
  h: 1
644
- }), qn.value++;
706
+ }), pr.value++;
645
707
  }, t.src = e;
646
- }, F = (e) => {
647
- qn.value;
648
- let t = P(e), n = t ? Kn.get(t) : null, { w: r, h: i } = I(e);
708
+ }, hr = (e) => {
709
+ pr.value;
710
+ let t = sr(e), n = t ? fr.get(t) : null, { w: r, h: i } = P(e);
649
711
  if (!n) return {
650
712
  w: r,
651
713
  h: i
652
714
  };
653
- let a = n.w, o = n.h, s;
654
- if (Un.value === "contain") s = Math.min(x / a, x / o);
715
+ let a = n.w, o = n.h, s, c = ir.value, l = ar.value;
716
+ if (lr.value === "contain") s = Math.min(c / a, l / o);
655
717
  else {
656
- let e = Math.max(r, i) / x;
718
+ let e = Math.max(r / c, i / l);
657
719
  s = Math.max(r / e / a, i / e / o);
658
720
  }
659
721
  return {
@@ -661,38 +723,235 @@ var b = {
661
723
  h: o * s
662
724
  };
663
725
  };
664
- ne(() => {
665
- for (let e of S.value) Hn(e) && Jn(P(e));
726
+ re(() => {
727
+ for (let e of b.value) cr(e) && mr(sr(e));
666
728
  });
667
- let Yn = (e, t) => {
729
+ let gr = (e, t) => {
668
730
  let n = Number(e);
669
731
  return Number.isFinite(n) && n > 0 ? n : t;
670
- }, Xn = (e) => {
671
- let t = Yn(e.width, x), n = Yn(e.height, x);
732
+ }, _r = (e) => {
733
+ let t = gr(e.width, ir.value), n = gr(e.height, ar.value);
672
734
  return {
673
- sx: t / x,
674
- sy: n / x
735
+ sx: t / ir.value,
736
+ sy: n / ar.value
675
737
  };
676
- }, Zn = (e) => {
677
- let t = Math.max(e.width, e.height);
678
- return isNaN(t) ? 30 : t / 2;
679
- }, Qn = (e) => {
680
- let { sx: t, sy: n } = Xn(e);
738
+ }, vr = (e) => {
739
+ let { w: t, h: n } = P(e), r = Math.min(t, n) / 2;
740
+ return Number.isFinite(r) && r > 0 ? r : 30;
741
+ }, yr = [
742
+ "warning",
743
+ "error",
744
+ "master"
745
+ ], br = t(() => {
746
+ let e = _.config.alertStates;
747
+ return Array.isArray(e) && e.length ? e.map((e) => String(e)) : yr;
748
+ }), xr = (e) => !!e && e.state != null && br.value.includes(String(e.state)), Sr = {
749
+ warning: {
750
+ dur: 2.2,
751
+ scale: 1.5,
752
+ opacity: .35,
753
+ ripple: !1
754
+ },
755
+ error: {
756
+ dur: 1.2,
757
+ scale: 1.8,
758
+ opacity: .5,
759
+ ripple: !0
760
+ },
761
+ master: {
762
+ dur: .9,
763
+ scale: 1.9,
764
+ opacity: .55,
765
+ ripple: !0
766
+ }
767
+ }, Cr = (e) => Sr[e.state] || {
768
+ dur: 2,
769
+ scale: 1.6,
770
+ opacity: .4,
771
+ ripple: !1
772
+ }, wr = (e, t = 1) => {
773
+ let n = String(e.id ?? ""), r = 0;
774
+ for (let e = 0; e < n.length; e++) r = (r * 31 + n.charCodeAt(e)) % 997;
775
+ return -(r / 997) * Cr(e).dur * t;
776
+ }, Tr = [
777
+ "ring",
778
+ "fill",
779
+ "ripple",
780
+ "blink"
781
+ ], Er = t(() => Tr.includes(_.config.alertStyle) ? _.config.alertStyle : "ring"), Dr = (e) => Tr.includes(e?.alertStyle) ? e.alertStyle : Er.value, N = (e) => Number(Number(e).toFixed(2)), Or = (e, t = .1) => `${N(e)};${N(e * t)};${N(e)}`, kr = [
782
+ {
783
+ offset: "0%",
784
+ opacity: 1
785
+ },
786
+ {
787
+ offset: "52%",
788
+ opacity: 1
789
+ },
790
+ {
791
+ offset: "84%",
792
+ opacity: .92
793
+ },
794
+ {
795
+ offset: "100%",
796
+ opacity: 0
797
+ }
798
+ ], Ar = [
799
+ {
800
+ offset: "0%",
801
+ opacity: 0
802
+ },
803
+ {
804
+ offset: "56%",
805
+ opacity: .1
806
+ },
807
+ {
808
+ offset: "82%",
809
+ opacity: .62
810
+ },
811
+ {
812
+ offset: "92%",
813
+ opacity: .5
814
+ },
815
+ {
816
+ offset: "100%",
817
+ opacity: 0
818
+ }
819
+ ], jr = (e) => String(e).replace(/[^a-zA-Z0-9]/g, ""), Mr = t(() => {
820
+ let e = /* @__PURE__ */ new Map();
821
+ for (let t of Object.values(y)) {
822
+ let n = jr(t.color);
823
+ n && !e.has(n) && e.set(n, t.color);
824
+ }
825
+ let t = [];
826
+ for (let [n, r] of e) t.push({
827
+ id: `alert-fill-${n}`,
828
+ color: r,
829
+ stops: kr
830
+ }), t.push({
831
+ id: `alert-glow-${n}`,
832
+ color: r,
833
+ stops: Ar
834
+ });
835
+ return t;
836
+ }), Nr = t(() => _.config.alertGlow !== !1), Pr = (e) => {
837
+ if (!ca.value || !xr(e)) return [];
838
+ let t = Cr(e), n = Zn(e).color, r = N(vr(e)), i = t.dur, a = N(wr(e)), o = Dr(e);
839
+ if (o === "fill") {
840
+ let o = jr(n), s = N(t.opacity * .55), c = r * (1 + (t.scale - 1) * .55), l = {
841
+ key: "fill",
842
+ r,
843
+ fill: Nr.value ? `url(#alert-fill-${o})` : n,
844
+ stroke: "none",
845
+ strokeWidth: 0,
846
+ opacity: s,
847
+ rValues: `${r};${N(c)};${r}`,
848
+ opacityValues: Or(s),
849
+ keyTimes: null,
850
+ dur: `${N(i)}s`,
851
+ begin: `${a}s`
852
+ };
853
+ if (!Nr.value) return [l];
854
+ let u = N(r * 1.04), d = N(c * 1.14), f = N(Math.min(.95, t.opacity * 1.6));
855
+ return [l, {
856
+ key: "fill-glow",
857
+ r: u,
858
+ fill: `url(#alert-glow-${o})`,
859
+ stroke: "none",
860
+ strokeWidth: 0,
861
+ opacity: f,
862
+ rValues: `${u};${d};${u}`,
863
+ opacityValues: Or(f),
864
+ keyTimes: null,
865
+ dur: `${N(i * 1.15)}s`,
866
+ begin: `${N(wr(e, 1.15))}s`
867
+ }];
868
+ }
869
+ if (o === "ripple") {
870
+ let e = i * 1.1;
871
+ return [
872
+ 0,
873
+ 1,
874
+ 2
875
+ ].map((i) => {
876
+ let o = N(r * (.92 + i * .02)), s = N(t.opacity * (1 - i * .15));
877
+ return {
878
+ key: `ripple-${i}`,
879
+ r: o,
880
+ fill: "none",
881
+ stroke: n,
882
+ strokeWidth: 1.8,
883
+ opacity: s,
884
+ rValues: `${o};${N(r * t.scale)};${o}`,
885
+ opacityValues: `${s};0;${s}`,
886
+ keyTimes: null,
887
+ dur: `${N(e)}s`,
888
+ begin: `${N(a - e * i / 3)}s`
889
+ };
890
+ });
891
+ }
892
+ if (o === "blink") {
893
+ let e = N(Math.min(.9, t.opacity * 1.7)), o = Math.max(.8, i * .8);
894
+ return [{
895
+ key: "blink",
896
+ r: N(r * 1.06),
897
+ fill: "none",
898
+ stroke: n,
899
+ strokeWidth: 3,
900
+ opacity: e,
901
+ rValues: null,
902
+ opacityValues: `${e};${e};0.04;${e};${e};0.04;${e}`,
903
+ keyTimes: "0;0.18;0.22;0.4;0.58;0.62;1",
904
+ dur: `${N(o)}s`,
905
+ begin: `${a}s`
906
+ }];
907
+ }
908
+ let s = [{
909
+ key: "ring",
910
+ r,
911
+ fill: "none",
912
+ stroke: n,
913
+ strokeWidth: 2.5,
914
+ opacity: N(t.opacity),
915
+ rValues: `${r};${N(r * t.scale)};${r}`,
916
+ opacityValues: Or(t.opacity),
917
+ keyTimes: null,
918
+ dur: `${N(i)}s`,
919
+ begin: `${a}s`
920
+ }];
921
+ if (t.ripple) {
922
+ let a = N(r * 1.12), o = N(t.opacity * .45);
923
+ s.push({
924
+ key: "ring-ripple",
925
+ r: a,
926
+ fill: "none",
927
+ stroke: n,
928
+ strokeWidth: 1.5,
929
+ opacity: o,
930
+ rValues: `${a};${N(r * (t.scale - .12))};${a}`,
931
+ opacityValues: Or(o),
932
+ keyTimes: null,
933
+ dur: `${N(i * 1.25)}s`,
934
+ begin: `${N(wr(e, 1.25))}s`
935
+ });
936
+ }
937
+ return s;
938
+ }, Fr = t(() => b.value.filter((e) => xr(e)).length), Ir = (e) => {
939
+ let { sx: t, sy: n } = _r(e);
681
940
  return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
682
- }, $n = (e) => {
683
- let { w: t, h: n } = I(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
941
+ }, Lr = (e) => {
942
+ let { w: t, h: n } = P(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
684
943
  return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
685
- }, er = t(() => {
686
- let e = Number(v.config.labelGap);
944
+ }, Rr = t(() => {
945
+ let e = Number(_.config.labelGap);
687
946
  return Number.isFinite(e) && e >= 0 ? e : 18;
688
- }), tr = (e) => {
689
- if (zn(e)) return 4;
690
- let { h: t } = I(e);
691
- return e.labelPosition === "top" ? -(t / 2 + er.value) : e.labelPosition === "center" ? 0 : t / 2 + er.value;
692
- }, nr = (e) => {
693
- let t = L(e);
694
- if (zn(e) || !e.label) return t;
695
- let n = tn(e), r = tr(e);
947
+ }), zr = (e) => {
948
+ if (Qn(e)) return 4;
949
+ let { h: t } = P(e);
950
+ return e.labelPosition === "top" ? -(t / 2 + Rr.value) : e.labelPosition === "center" ? 0 : t / 2 + Rr.value;
951
+ }, Br = (e) => {
952
+ let t = F(e);
953
+ if (Qn(e) || !e.label) return t;
954
+ let n = hn(e), r = zr(e);
696
955
  if (e.labelPosition === "top") {
697
956
  let e = r - n - 4;
698
957
  e < t.y && (t.height += t.y - e, t.y = e);
@@ -701,147 +960,147 @@ var b = {
701
960
  i > t.y + t.height && (t.height = i - t.y);
702
961
  }
703
962
  return t;
704
- }, rr = (e) => e.borderStyle !== "none" && (e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0), I = (e) => {
705
- let t = zn(e), n = Bn(e);
963
+ }, Vr = (e) => e.borderStyle !== "none" && (e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0), P = (e) => {
964
+ let t = Qn(e), n = $n(e), r = M(e);
706
965
  return {
707
- w: Yn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : n ? Math.max(80, String(e.label).length * 8 + 24) : x),
708
- h: Yn(e.height, t ? 26 : n ? 40 : x)
966
+ w: gr(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : r ? 240 : n ? Math.max(80, String(e.label).length * 8 + 24) : ir.value),
967
+ h: gr(e.height, t ? 26 : r ? 160 : n ? 40 : ar.value)
709
968
  };
710
- }, L = (e) => {
711
- let { w: t, h: n } = I(e);
969
+ }, F = (e) => {
970
+ let { w: t, h: n } = P(e);
712
971
  return {
713
972
  x: -t / 2,
714
973
  y: -n / 2,
715
974
  width: t,
716
975
  height: n
717
976
  };
718
- }, R = (e) => rr(e) ? L(e) : null, ir = (e) => e.background && e.background !== "none" ? e.background : null, z = f([]), B = f([]);
719
- t(() => z.value.length === 1 ? z.value[0] : null), t(() => B.value.length === 1 ? B.value[0] : null);
720
- let ar = (e) => z.value.includes(e.id), or = (e) => B.value.includes(e.id), V = () => {
721
- y("selection-change", {
722
- nodes: S.value.filter((e) => z.value.includes(e.id)),
723
- edges: A.value.filter((e) => B.value.includes(e.id))
977
+ }, I = (e) => M(e) ? null : Vr(e) ? F(e) : null, Hr = (e) => !M(e) && e.background && e.background !== "none" ? e.background : null, L = f([]), R = f([]);
978
+ t(() => L.value.length === 1 ? L.value[0] : null), t(() => R.value.length === 1 ? R.value[0] : null);
979
+ let Ur = (e) => L.value.includes(e.id), Wr = (e) => R.value.includes(e.id), z = () => {
980
+ v("selection-change", {
981
+ nodes: b.value.filter((e) => L.value.includes(e.id)),
982
+ edges: D.value.filter((e) => R.value.includes(e.id))
724
983
  });
725
- }, sr = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 ? Math.floor(e) : Infinity : typeof e == "string" && /^\d+$/.test(e.trim()) ? parseInt(e.trim(), 10) : Infinity, cr = t(() => sr(v.config.maxSelectNodes)), lr = t(() => sr(v.config.maxSelectEdges)), H = (e, t, n) => {
984
+ }, Gr = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 ? Math.floor(e) : Infinity : typeof e == "string" && /^\d+$/.test(e.trim()) ? parseInt(e.trim(), 10) : Infinity, Kr = t(() => Gr(_.config.maxSelectNodes)), qr = t(() => Gr(_.config.maxSelectEdges)), B = (e, t, n) => {
726
985
  let r = new Set(e), i = [];
727
986
  for (let e of t) r.has(e) || (r.add(e), i.push(e));
728
987
  if (n === Infinity) return [...e, ...i];
729
988
  let a = Math.max(0, n - e.length);
730
989
  return [...e, ...i.slice(0, a)];
731
990
  };
732
- te([cr, lr], ([e, t]) => {
991
+ ne([Kr, qr], ([e, t]) => {
733
992
  let n = !1;
734
- z.value.length > e && (z.value = z.value.slice(0, e), n = !0), B.value.length > t && (B.value = B.value.slice(0, t), n = !0), n && V();
993
+ L.value.length > e && (L.value = L.value.slice(0, e), n = !0), R.value.length > t && (R.value = R.value.slice(0, t), n = !0), n && z();
735
994
  });
736
- let ur = t(() => v.config.selectedBorderColor || "#fbbf24"), dr = t(() => v.config?.edgeLayer !== "below"), fr = t(() => v.config?.highlightEdgeOnTop !== !1), pr = (e, t) => {
737
- if (!Cr()) {
995
+ let Jr = t(() => _.config.selectedBorderColor || "#fbbf24"), Yr = t(() => _.config?.edgeLayer !== "below"), Xr = t(() => _.config?.highlightEdgeOnTop !== !1), Zr = (e, t) => {
996
+ if (!si()) {
738
997
  if (t && (t.ctrlKey || t.metaKey)) {
739
- let t = z.value.indexOf(e.id);
740
- t >= 0 ? z.value.splice(t, 1) : z.value = H(z.value, [e.id], cr.value);
998
+ let t = L.value.indexOf(e.id);
999
+ t >= 0 ? L.value.splice(t, 1) : L.value = B(L.value, [e.id], Kr.value);
741
1000
  } else {
742
- let t = z.value.length === 1 && z.value[0] === e.id;
743
- z.value = t ? [] : H([], [e.id], cr.value), B.value = [];
1001
+ let t = L.value.length === 1 && L.value[0] === e.id;
1002
+ L.value = t ? [] : B([], [e.id], Kr.value), R.value = [];
744
1003
  }
745
- y("node-click", e), y("node-select", ar(e) ? e : null), V();
1004
+ v("node-click", e), v("node-select", Ur(e) ? e : null), z();
746
1005
  }
747
- }, mr = (e) => {
748
- let t = S.value.find((t) => t.id === e);
749
- if (!t || v.config.enableZOrder === !1) return !1;
750
- let n = t.zIndex ?? 0, r = S.value.filter((e) => (e.zIndex ?? 0) > n);
1006
+ }, Qr = (e) => {
1007
+ let t = b.value.find((t) => t.id === e);
1008
+ if (!t || _.config.enableZOrder === !1) return !1;
1009
+ let n = t.zIndex ?? 0, r = b.value.filter((e) => (e.zIndex ?? 0) > n);
751
1010
  return r.length !== 0 && (t.zIndex = Math.min(...r.map((e) => e.zIndex ?? 0)), !0);
752
- }, hr = (e) => {
753
- let t = S.value.find((t) => t.id === e);
754
- if (!t || v.config.enableZOrder === !1) return !1;
755
- let n = t.zIndex ?? 0, r = S.value.filter((e) => (e.zIndex ?? 0) < n);
1011
+ }, $r = (e) => {
1012
+ let t = b.value.find((t) => t.id === e);
1013
+ if (!t || _.config.enableZOrder === !1) return !1;
1014
+ let n = t.zIndex ?? 0, r = b.value.filter((e) => (e.zIndex ?? 0) < n);
756
1015
  return r.length !== 0 && (t.zIndex = Math.max(...r.map((e) => e.zIndex ?? 0)), !0);
757
- }, gr = (e) => {
758
- let t = S.value.find((t) => t.id === e);
759
- return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...S.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
760
- }, _r = (e) => {
761
- let t = S.value.find((t) => t.id === e);
762
- return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...S.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
763
- }, vr = () => {
764
- if (!E.value) return;
765
- let e = E.value.cloneNode(!0);
766
- e.querySelectorAll("animate, animateMotion, animateTransform, set").forEach((e) => e.remove()), e.querySelectorAll(".center-crosshair").forEach((e) => e.remove()), e.setAttribute("width", U.value || "800"), e.setAttribute("height", W.value || "600");
1016
+ }, ei = (e) => {
1017
+ let t = b.value.find((t) => t.id === e);
1018
+ return !t || _.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...b.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
1019
+ }, ti = (e) => {
1020
+ let t = b.value.find((t) => t.id === e);
1021
+ return !t || _.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...b.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
1022
+ }, ni = () => {
1023
+ if (!C.value) return;
1024
+ let e = C.value.cloneNode(!0);
1025
+ e.querySelectorAll("animate, animateMotion, animateTransform, set").forEach((e) => e.remove()), e.querySelectorAll(".center-crosshair").forEach((e) => e.remove()), e.setAttribute("width", V.value || "800"), e.setAttribute("height", H.value || "600");
767
1026
  let t = new XMLSerializer().serializeToString(e);
768
1027
  t = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + t;
769
1028
  let n = new Blob([t], { type: "image/svg+xml;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
770
1029
  i.href = r, i.download = `topology-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.svg`, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
771
- }, yr = t(() => v.config.selectedLineColor || "#fbbf24"), br = (e, t) => {
772
- if (Cr()) return;
773
- let n = In.value[e.id], r = !!(n && n.merged && n.representative), i = r ? A.value.filter((e) => {
774
- let t = In.value[e.id];
1030
+ }, ri = t(() => _.config.selectedLineColor || "#fbbf24"), ii = (e, t) => {
1031
+ if (si()) return;
1032
+ let n = k.value[e.id], r = !!(n && n.merged && n.representative), i = r ? D.value.filter((e) => {
1033
+ let t = k.value[e.id];
775
1034
  return t && t.key === n.key;
776
1035
  }) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
777
1036
  ...e,
778
1037
  bundleEdges: i
779
1038
  } : e;
780
- if (t && (t.ctrlKey || t.metaKey)) a.every((e) => B.value.includes(e)) ? B.value = B.value.filter((e) => !a.includes(e)) : B.value = H(B.value, a, lr.value);
1039
+ if (t && (t.ctrlKey || t.metaKey)) a.every((e) => R.value.includes(e)) ? R.value = R.value.filter((e) => !a.includes(e)) : R.value = B(R.value, a, qr.value);
781
1040
  else {
782
- let e = a.length === B.value.length && a.every((e) => B.value.includes(e));
783
- B.value = e ? [] : H([], a, lr.value), z.value = [];
1041
+ let e = a.length === R.value.length && a.every((e) => R.value.includes(e));
1042
+ R.value = e ? [] : B([], a, qr.value), L.value = [];
784
1043
  }
785
- y("edge-select", or(e) ? o : null), V();
786
- }, xr = 0, Sr = (e = 200) => {
787
- xr = performance.now() + e;
788
- }, Cr = () => performance.now() < xr, wr = () => {
789
- z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V();
790
- }, Tr = (e) => {
791
- if (Cr()) return;
1044
+ v("edge-select", Wr(e) ? o : null), z();
1045
+ }, ai = 0, oi = (e = 200) => {
1046
+ ai = performance.now() + e;
1047
+ }, si = () => performance.now() < ai, ci = () => {
1048
+ L.value = [], R.value = [], v("node-select", null), v("edge-select", null), z();
1049
+ }, li = (e) => {
1050
+ if (si()) return;
792
1051
  let t = e.target;
793
- t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || wr();
794
- }, Er = f({
1052
+ t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || ci();
1053
+ }, ui = f({
795
1054
  width: 1e3,
796
1055
  height: 650
797
- }), Dr = f(1), Or = f(0), kr = f(0), Ar = t(() => -Mr.value / 2 + Or.value), jr = t(() => -Nr.value / 2 + kr.value), Mr = t(() => v.width ?? Er.value.width), Nr = t(() => v.height ?? Er.value.height), Pr = null;
1056
+ }), di = f(1), fi = f(0), pi = f(0), mi = t(() => -gi.value / 2 + fi.value), hi = t(() => -_i.value / 2 + pi.value), gi = t(() => _.width ?? ui.value.width), _i = t(() => _.height ?? ui.value.height), vi = null;
798
1057
  u(() => {
799
- let e = E.value;
1058
+ let e = C.value;
800
1059
  if (e) {
801
1060
  let t = e.getBoundingClientRect();
802
- t.width > 0 && t.height > 0 && (Er.value = {
1061
+ t.width > 0 && t.height > 0 && (ui.value = {
803
1062
  width: t.width,
804
1063
  height: t.height
805
1064
  });
806
1065
  }
807
- e && typeof ResizeObserver < "u" && (Pr = new ResizeObserver(() => {
1066
+ e && typeof ResizeObserver < "u" && (vi = new ResizeObserver(() => {
808
1067
  let t = e.getBoundingClientRect();
809
- t.width > 0 && t.height > 0 && (Er.value = {
1068
+ t.width > 0 && t.height > 0 && (ui.value = {
810
1069
  width: t.width,
811
1070
  height: t.height
812
1071
  });
813
- }), Pr.observe(e));
1072
+ }), vi.observe(e));
814
1073
  }), l(() => {
815
- Pr &&= (Pr.disconnect(), null), ki &&= (cancelAnimationFrame(ki), 0), Jr &&= (cancelAnimationFrame(Jr), 0), Z &&= (cancelAnimationFrame(Z), 0), $i(), ei();
1074
+ vi &&= (vi.disconnect(), null), ma &&= (cancelAnimationFrame(ma), 0), Pi &&= (cancelAnimationFrame(Pi), 0), Z &&= (cancelAnimationFrame(Z), 0), Wa(), Bi();
816
1075
  });
817
- let U = t(() => Mr.value / Dr.value), W = t(() => Nr.value / Dr.value), Fr = t(() => ({
818
- x0: Ar.value - Gt,
819
- y0: jr.value - Gt,
820
- x1: Ar.value + U.value + Gt,
821
- y1: jr.value + W.value + Gt
822
- })), Ir = t(() => {
823
- let e = Fr.value, t = S.value.filter((t) => {
824
- let { w: n, h: r } = I(t);
1076
+ let V = t(() => gi.value / di.value), H = t(() => _i.value / di.value), yi = t(() => ({
1077
+ x0: mi.value - rn,
1078
+ y0: hi.value - rn,
1079
+ x1: mi.value + V.value + rn,
1080
+ y1: hi.value + H.value + rn
1081
+ })), bi = t(() => {
1082
+ let e = yi.value, t = b.value.filter((t) => {
1083
+ let { w: n, h: r } = P(t);
825
1084
  return t.x + n / 2 >= e.x0 && t.x - n / 2 <= e.x1 && t.y + r / 2 >= e.y0 && t.y - r / 2 <= e.y1;
826
1085
  });
827
- return v.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
828
- }), G = t(() => {
829
- let e = Fr.value;
830
- return A.value.filter((t) => {
831
- if (!ha(t)) return !1;
832
- let n = M(t.from), r = M(t.to);
1086
+ return _.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
1087
+ }), xi = t(() => bi.value.filter((e) => M(e))), Si = t(() => bi.value.filter((e) => !M(e))), U = t(() => {
1088
+ let e = yi.value;
1089
+ return D.value.filter((t) => {
1090
+ if (!oo(t)) return !1;
1091
+ let n = A(t.from), r = A(t.to);
833
1092
  if (!n || !r) return !1;
834
- let i = I(n).w / 2, a = I(n).h / 2, o = I(r).w / 2, s = I(r).h / 2;
835
- return Math.min(n.x - i, r.x - o) - Kt <= e.x1 && Math.max(n.x + i, r.x + o) + Kt >= e.x0 && Math.min(n.y - a, r.y - s) - Kt <= e.y1 && Math.max(n.y + a, r.y + s) + Kt >= e.y0;
1093
+ let i = P(n).w / 2, a = P(n).h / 2, o = P(r).w / 2, s = P(r).h / 2;
1094
+ return Math.min(n.x - i, r.x - o) - an <= e.x1 && Math.max(n.x + i, r.x + o) + an >= e.x0 && Math.min(n.y - a, r.y - s) - an <= e.y1 && Math.max(n.y + a, r.y + s) + an >= e.y0;
836
1095
  });
837
- }), Lr = (e) => {
838
- if (v.config.enableZoom === !1) return;
1096
+ }), Ci = (e) => {
1097
+ if (_.config.enableZoom === !1) return;
839
1098
  e.preventDefault();
840
- let t = E.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = U.value, s = W.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(Wt, Math.max(Ut, Dr.value * c)), u = Mr.value / l, d = Nr.value / l;
841
- Or.value += (o - u) * i, kr.value += (s - d) * a, Dr.value = l;
842
- }, K = f(null), q = f(null), Rr = (e) => {
843
- let t = E.value, n = t ? t.getBoundingClientRect() : null;
844
- K.value = {
1099
+ let t = C.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = V.value, s = H.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(nn, Math.max(tn, di.value * c)), u = gi.value / l, d = _i.value / l;
1100
+ fi.value += (o - u) * i, pi.value += (s - d) * a, di.value = l;
1101
+ }, W = f(null), G = f(null), wi = (e) => {
1102
+ let t = C.value, n = t ? t.getBoundingClientRect() : null;
1103
+ W.value = {
845
1104
  startX: e.clientX,
846
1105
  startY: e.clientY,
847
1106
  lastX: e.clientX,
@@ -849,9 +1108,9 @@ var b = {
849
1108
  moved: !1,
850
1109
  rectWidth: n && n.width ? n.width : 0,
851
1110
  rectHeight: n && n.height ? n.height : 0
852
- }, $r();
853
- }, zr = (e) => {
854
- let t = K.value, n = E.value;
1111
+ }, zi();
1112
+ }, Ti = (e) => {
1113
+ let t = W.value, n = C.value;
855
1114
  if (!t || !n) return;
856
1115
  let r = t.rectWidth, i = t.rectHeight;
857
1116
  if (!r || !i) return;
@@ -861,13 +1120,13 @@ var b = {
861
1120
  return;
862
1121
  }
863
1122
  let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
864
- t.lastX = e.clientX, t.lastY = e.clientY, Or.value -= a * (U.value / r), kr.value -= o * (W.value / i);
865
- }, Br = () => {
866
- let e = K.value;
867
- K.value = null, e && e.moved && Sr(), ti();
868
- }, Vr = (e) => {
1123
+ t.lastX = e.clientX, t.lastY = e.clientY, fi.value -= a * (V.value / r), pi.value -= o * (H.value / i);
1124
+ }, Ei = () => {
1125
+ let e = W.value;
1126
+ W.value = null, e && e.moved && oi(), Vi();
1127
+ }, Di = (e) => {
869
1128
  let t = X(e);
870
- q.value = {
1129
+ G.value = {
871
1130
  start: {
872
1131
  x: t.x,
873
1132
  y: t.y
@@ -879,17 +1138,17 @@ var b = {
879
1138
  startClientX: e.clientX,
880
1139
  startClientY: e.clientY,
881
1140
  moved: !1
882
- }, $r();
883
- }, Hr = (e) => {
884
- let t = q.value;
1141
+ }, zi();
1142
+ }, Oi = (e) => {
1143
+ let t = G.value;
885
1144
  if (!t) return;
886
1145
  let n = X(e);
887
1146
  t.current = {
888
1147
  x: n.x,
889
1148
  y: n.y
890
1149
  }, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
891
- }, Ur = t(() => {
892
- let e = q.value;
1150
+ }, ki = t(() => {
1151
+ let e = G.value;
893
1152
  return e ? {
894
1153
  x: Math.min(e.start.x, e.current.x),
895
1154
  y: Math.min(e.start.y, e.current.y),
@@ -901,63 +1160,59 @@ var b = {
901
1160
  width: 0,
902
1161
  height: 0
903
1162
  };
904
- }), Wr = () => {
905
- let e = q.value;
906
- if (q.value = null, e && e.moved) {
1163
+ }), Ai = () => {
1164
+ let e = G.value;
1165
+ if (G.value = null, e && e.moved) {
907
1166
  let t = {
908
1167
  x: Math.min(e.start.x, e.current.x),
909
1168
  y: Math.min(e.start.y, e.current.y),
910
1169
  w: Math.abs(e.current.x - e.start.x),
911
1170
  h: Math.abs(e.current.y - e.start.y)
912
- }, n = S.value.filter((e) => {
913
- let n = L(e), r = e.x + n.x, i = e.y + n.y;
914
- return !(r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h);
1171
+ }, n = b.value.filter((e) => {
1172
+ let n = F(e), r = e.x + n.x, i = e.y + n.y;
1173
+ return r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h ? !1 : !M(e) || r >= t.x && i >= t.y && r + n.width <= t.x + t.w && i + n.height <= t.y + t.h;
915
1174
  });
916
- n.length && (z.value = H(z.value, n.map((e) => e.id), cr.value), V()), Sr();
1175
+ n.length && (L.value = B(L.value, n.map((e) => e.id), Kr.value), z()), oi();
917
1176
  }
918
- ti();
919
- }, Gr = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), Kr = (e) => {
920
- if (E.value) {
1177
+ Vi();
1178
+ }, ji = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), Mi = (e) => {
1179
+ if (C.value) {
921
1180
  if (e.button === 1) {
922
- if (v.config.enablePan === !1) return;
923
- e.preventDefault(), Rr(e);
924
- return;
925
- }
926
- if (e.button === 0 && !Gr(e.target)) {
1181
+ if (_.config.enablePan === !1) return;
1182
+ e.preventDefault(), wi(e);
1183
+ } else if (e.button === 0 && !ji(e.target)) {
927
1184
  if (e.ctrlKey || e.metaKey) {
928
- if (v.config.enableMarquee === !1) return;
929
- e.preventDefault(), Vr(e);
930
- return;
931
- }
932
- v.config.enablePan !== !1 && (e.preventDefault(), Rr(e));
1185
+ if (_.config.enableMarquee === !1) return;
1186
+ e.preventDefault(), Di(e);
1187
+ } else _.config.enablePan !== !1 && (e.preventDefault(), wi(e));
933
1188
  }
934
1189
  }
935
- }, qr = !1, Jr = 0, Yr = null, Xr = () => {
936
- Jr = 0;
937
- let e = Yr;
938
- Yr = null, e && (K.value ? zr(e) : q.value && Hr(e));
939
- }, Zr = (e) => {
940
- Yr = e, Jr ||= requestAnimationFrame(Xr);
941
- }, Qr = () => {
942
- Jr && (cancelAnimationFrame(Jr), Xr()), K.value && Br(), q.value && Wr();
943
- }, $r = () => {
944
- qr || (qr = !0, window.addEventListener("mousemove", Zr, !0), window.addEventListener("mouseup", Qr, !0));
945
- }, ei = () => {
946
- qr && (qr = !1, window.removeEventListener("mousemove", Zr, !0), window.removeEventListener("mouseup", Qr, !0));
947
- }, ti = () => {
948
- !K.value && !q.value && ei();
949
- }, ni = t(() => {
950
- if (J.value && J.value.side) return { cursor: Li(J.value.side) };
951
- if (q.value) return { cursor: "crosshair" };
952
- if (K.value && K.value.moved) return { cursor: "grabbing" };
953
- }), ri = t(() => v.config.showGrid !== !1), ii = t(() => v.config.gridColor || "#1a2240"), ai = t(() => {
954
- let e = Number(v.config.gridStep);
955
- return (Number.isFinite(e) && e > 0 ? e : 40) / Dr.value;
956
- }), oi = t(() => {
957
- let e = Number(v.config.gridOpacity);
1190
+ }, Ni = !1, Pi = 0, Fi = null, Ii = () => {
1191
+ Pi = 0;
1192
+ let e = Fi;
1193
+ Fi = null, e && (W.value ? Ti(e) : G.value && Oi(e));
1194
+ }, Li = (e) => {
1195
+ Fi = e, Pi ||= requestAnimationFrame(Ii);
1196
+ }, Ri = () => {
1197
+ Pi && (cancelAnimationFrame(Pi), Ii()), W.value && Ei(), G.value && Ai();
1198
+ }, zi = () => {
1199
+ Ni || (Ni = !0, window.addEventListener("mousemove", Li, !0), window.addEventListener("mouseup", Ri, !0));
1200
+ }, Bi = () => {
1201
+ Ni && (Ni = !1, window.removeEventListener("mousemove", Li, !0), window.removeEventListener("mouseup", Ri, !0));
1202
+ }, Vi = () => {
1203
+ !W.value && !G.value && Bi();
1204
+ }, Hi = t(() => {
1205
+ if (J.value && J.value.side) return { cursor: Oa(J.value.side) };
1206
+ if (G.value) return { cursor: "crosshair" };
1207
+ if (W.value && W.value.moved) return { cursor: "grabbing" };
1208
+ }), Ui = t(() => _.config.showGrid !== !1), Wi = t(() => _.config.gridColor || "#1a2240"), Gi = t(() => {
1209
+ let e = Number(_.config.gridStep);
1210
+ return (Number.isFinite(e) && e > 0 ? e : 40) / di.value;
1211
+ }), Ki = t(() => {
1212
+ let e = Number(_.config.gridOpacity);
958
1213
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
959
- }), si = t(() => {
960
- let e = v.config.radialGradient && typeof v.config.radialGradient == "object" ? v.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
1214
+ }), qi = t(() => {
1215
+ let e = _.config.radialGradient && typeof _.config.radialGradient == "object" ? _.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
961
1216
  offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
962
1217
  color: e.color,
963
1218
  opacity: e.opacity
@@ -976,110 +1231,144 @@ var b = {
976
1231
  r: e.r || "60%",
977
1232
  stops: n
978
1233
  };
979
- }), ci = t(() => v.config.showCenterPoint === !0), li = t(() => v.config.showEdgeTextBg === !0), ui = t(() => v.config.edgeTextBgColor || "#0a0e1a"), di = t(() => {
980
- let e = Number(v.config.edgeTextBgOpacity);
1234
+ }), Ji = t(() => _.config.showCenterPoint === !0), Yi = t(() => _.config.showEdgeTextBg === !0), Xi = t(() => _.config.edgeTextBgColor || "#0a0e1a"), Zi = t(() => {
1235
+ let e = Number(_.config.edgeTextBgOpacity);
981
1236
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .92;
982
- }), fi = t(() => v.config.edgeColor || v.config.defaultEdgeColor || null), pi = t(() => v.config.edgeBaseColor || null), mi = (e) => e.baseColor ? e.baseColor : pi.value ? pi.value : e.color || fi.value ? Q(e) : "#1a2744", hi = (e) => {
983
- let t = e.baseDimOpacity ?? v.config.edgeBaseDimOpacity;
1237
+ }), Qi = t(() => _.config.edgeColor || _.config.defaultEdgeColor || null), $i = t(() => _.config.edgeBaseColor || null), ea = (e) => e.baseColor ? e.baseColor : $i.value ? $i.value : e.color || Qi.value ? Q(e) : "#1a2744", ta = (e) => {
1238
+ let t = e.baseDimOpacity ?? _.config.edgeBaseDimOpacity;
984
1239
  if (t != null) {
985
1240
  let e = Number(t);
986
1241
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 1;
987
1242
  }
988
- return bi.value === "none" || Ci(e) === "none" ? 1 : .45;
989
- }, gi = t(() => v.config.edgeCenterTextColor || null), _i = t(() => v.config.showNodeHandles === !0), vi = t(() => v.config.showStatusDot !== !1), yi = (e, t) => {
1243
+ return oa.value === "none" || la(e) === "none" ? 1 : .45;
1244
+ }, na = t(() => _.config.edgeCenterTextColor || null), ra = t(() => _.config.showNodeHandles === !0), ia = t(() => _.config.showStatusDot !== !1), aa = (e, t) => {
990
1245
  let n = Number(e);
991
1246
  return Number.isFinite(n) && n >= 0 ? n : t;
992
- }, bi = t(() => {
993
- let e = v.config.motionFx ?? v.config.fx;
1247
+ }, oa = t(() => {
1248
+ let e = _.config.motionFx ?? _.config.fx;
994
1249
  return typeof e == "boolean" ? e ? "all" : "none" : [
995
1250
  "none",
996
1251
  "flow",
997
1252
  "particle",
998
1253
  "all"
999
- ].includes(e) ? e : A.value.length <= yi(v.config.fxMotionMaxEdges, 200) ? "all" : "none";
1000
- }), xi = t(() => {
1001
- let e = v.config.glowFx ?? v.config.fx;
1002
- return typeof e == "boolean" ? e : A.value.length <= yi(v.config.fxGlowMaxEdges, 500);
1003
- }), Si = t(() => {
1004
- let e = v.config.breatheFx ?? v.config.fx;
1005
- return typeof e == "boolean" ? e : S.value.length <= yi(v.config.fxBreatheMaxNodes, 300);
1006
- }), Ci = (e) => {
1254
+ ].includes(e) ? e : D.value.length <= aa(_.config.fxMotionMaxEdges, 200) ? "all" : "none";
1255
+ }), sa = t(() => {
1256
+ let e = _.config.glowFx ?? _.config.fx;
1257
+ return typeof e == "boolean" ? e : D.value.length <= aa(_.config.fxGlowMaxEdges, 500);
1258
+ }), ca = t(() => {
1259
+ let e = _.config.breatheFx ?? _.config.fx;
1260
+ return typeof e == "boolean" ? e : Fr.value <= aa(_.config.fxAlertMaxNodes, 300);
1261
+ }), la = (e) => {
1007
1262
  if (e.animatedMode !== void 0) {
1008
1263
  let t = e.animatedMode;
1009
- return !t || t === "all" ? bi.value : t === "none" ? "none" : t;
1264
+ return !t || t === "all" ? oa.value : t === "none" ? "none" : t;
1010
1265
  }
1011
- return e.animated === void 0 || e.animated ? bi.value : "none";
1012
- }, wi = (e) => e.borderColor || N(e) || "#94a3b8", Ti = (e) => e.borderWidth || 0, Ei = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Di = (e) => {
1266
+ return e.animated === void 0 || e.animated ? oa.value : "none";
1267
+ }, ua = (e) => e.borderColor || j(e) || "#94a3b8", da = (e) => e.borderWidth || 0, fa = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, K = (e) => {
1013
1268
  let t = e.borderRadius;
1014
- if (t == null || t === "") return 6;
1269
+ if (t == null || t === "") return M(e) ? 16 : 6;
1015
1270
  let n = Number(t);
1016
- return Number.isFinite(n) && n >= 0 ? n : 6;
1017
- }, Oi = (e, t) => {
1018
- if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
1271
+ return !Number.isFinite(n) || n < 0 ? M(e) ? 16 : 6 : n;
1272
+ }, pa = (e, t) => {
1273
+ if (e.button !== 0 || !_.editable || _.config.nodeDraggable === !1) return;
1019
1274
  e.stopPropagation();
1020
- let n = M(t), r = X(e);
1021
- if (ln.value = {
1275
+ let n = A(t), r = X(e);
1276
+ if (Cn.value = {
1022
1277
  x: r.x - n.x,
1023
1278
  y: r.y - n.y
1024
- }, dn = {
1279
+ }, Tn = {
1025
1280
  x: e.clientX,
1026
1281
  y: e.clientY
1027
- }, fn = !1, pn = !!(e.ctrlKey || e.metaKey), z.value.length > 1 && z.value.includes(t)) {
1282
+ }, En = !1, Dn = !!(e.ctrlKey || e.metaKey), L.value.length > 1 && L.value.includes(t)) {
1028
1283
  let e = {};
1029
- z.value.forEach((t) => {
1030
- let n = M(t);
1031
- n && (e[t] = {
1284
+ L.value.forEach((t) => {
1285
+ let n = A(t);
1286
+ n && !M(n) && (e[t] = {
1032
1287
  x: n.x,
1033
1288
  y: n.y
1034
1289
  });
1035
- }), un.value = {
1290
+ }), wn.value = {
1036
1291
  origins: e,
1037
1292
  start: {
1038
1293
  x: r.x,
1039
1294
  y: r.y
1040
1295
  }
1041
1296
  };
1042
- } else un.value = null;
1043
- T.value = t, y("node-drag-start", n);
1044
- }, ki = 0, Ai = null, ji = () => {
1045
- ki = 0;
1046
- let e = Ai;
1047
- Ai = null, e && Ni(e);
1048
- }, Mi = (e) => {
1049
- (J.value || T.value) && (Ai = {
1297
+ } else wn.value = null;
1298
+ S.value = t, v("node-drag-start", n);
1299
+ }, ma = 0, ha = null, ga = () => {
1300
+ ma = 0;
1301
+ let e = ha;
1302
+ ha = null, e && va(e);
1303
+ }, _a = (e) => {
1304
+ (J.value || S.value || q.value) && (ha = {
1050
1305
  clientX: e.clientX,
1051
1306
  clientY: e.clientY
1052
- }, ki ||= requestAnimationFrame(ji));
1053
- }, Ni = (e) => {
1307
+ }, ma ||= requestAnimationFrame(ga));
1308
+ }, va = (e) => {
1309
+ if (q.value) {
1310
+ Ca(e);
1311
+ return;
1312
+ }
1054
1313
  if (J.value) {
1055
- zi(e);
1314
+ Aa(e);
1056
1315
  return;
1057
1316
  }
1058
- if (!T.value) return;
1317
+ if (!S.value) return;
1059
1318
  let t = X(e);
1060
- !fn && dn && Math.hypot(e.clientX - dn.x, e.clientY - dn.y) > Ht && (fn = !0, !pn && !z.value.includes(T.value) && (z.value = H([], [T.value], cr.value), B.value = [], y("node-select", z.value.includes(T.value) ? M(T.value) : null), V()));
1061
- let n = un.value;
1319
+ !En && Tn && Math.hypot(e.clientX - Tn.x, e.clientY - Tn.y) > en && (En = !0, !Dn && !L.value.includes(S.value) && (L.value = B([], [S.value], Kr.value), R.value = [], v("node-select", L.value.includes(S.value) ? A(S.value) : null), z()));
1320
+ let n = wn.value;
1062
1321
  if (n) {
1063
1322
  let e = t.x - n.start.x, r = t.y - n.start.y;
1064
- S.value = S.value.map((t) => n.origins[t.id] ? {
1323
+ b.value = b.value.map((t) => n.origins[t.id] ? {
1065
1324
  ...t,
1066
1325
  x: n.origins[t.id].x + e,
1067
1326
  y: n.origins[t.id].y + r
1068
1327
  } : t);
1069
- } else S.value = S.value.map((e) => e.id === T.value ? {
1328
+ } else b.value = b.value.map((e) => e.id === S.value ? {
1070
1329
  ...e,
1071
- x: t.x - ln.value.x,
1072
- y: t.y - ln.value.y
1330
+ x: t.x - Cn.value.x,
1331
+ y: t.y - Cn.value.y
1073
1332
  } : e);
1074
- C();
1075
- }, Pi = () => {
1076
- if (ki && (cancelAnimationFrame(ki), ji()), J.value) {
1077
- Bi();
1078
- return;
1333
+ x();
1334
+ }, ya = () => {
1335
+ ma && (cancelAnimationFrame(ma), ga()), q.value ? wa() : J.value ? ja() : S.value && (En && oi(), S.value = null, wn.value = null, Tn = null, En = !1, v("node-drag-end"));
1336
+ }, q = f(null), ba = t(() => _.editable && _.config.regionDraggable !== !1), xa = t(() => _.config.regionHitArea === "border" ? "border" : "box"), Sa = (e, t) => {
1337
+ if (e.button !== 0 || e.ctrlKey || e.metaKey || !ba.value) return;
1338
+ e.stopPropagation(), e.preventDefault();
1339
+ let n = X(e);
1340
+ q.value = {
1341
+ id: t.id,
1342
+ offset: {
1343
+ x: n.x - t.x,
1344
+ y: n.y - t.y
1345
+ },
1346
+ startClient: {
1347
+ x: e.clientX,
1348
+ y: e.clientY
1349
+ },
1350
+ moved: !1
1351
+ }, v("node-drag-start", t);
1352
+ }, Ca = (e) => {
1353
+ let t = q.value;
1354
+ if (!t) return;
1355
+ if (!t.moved) {
1356
+ if (Math.hypot(e.clientX - t.startClient.x, e.clientY - t.startClient.y) <= en) return;
1357
+ t.moved = !0, L.value.includes(t.id) || (L.value = B([], [t.id], Kr.value), R.value = [], v("node-select", A(t.id) || null), z());
1079
1358
  }
1080
- T.value && (fn && Sr(), T.value = null, un.value = null, dn = null, fn = !1, y("node-drag-end"));
1081
- }, J = f(null), Fi = (e, t, n) => Math.min(n, Math.max(t, e)), Ii = (e) => {
1082
- let t = L(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
1359
+ let n = X(e);
1360
+ b.value = b.value.map((e) => e.id === t.id ? {
1361
+ ...e,
1362
+ x: n.x - t.offset.x,
1363
+ y: n.y - t.offset.y
1364
+ } : e), x();
1365
+ }, wa = () => {
1366
+ let e = q.value;
1367
+ q.value = null, e && (e.moved && oi(), v("node-drag-end", A(e.id) || null));
1368
+ }, Ta = (e, t) => {
1369
+ si() || Zr(e, t);
1370
+ }, J = f(null), Ea = (e, t, n) => Math.min(n, Math.max(t, e)), Da = (e) => {
1371
+ let t = F(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
1083
1372
  return [
1084
1373
  {
1085
1374
  side: "nw",
@@ -1122,9 +1411,9 @@ var b = {
1122
1411
  y: 0
1123
1412
  }
1124
1413
  ];
1125
- }, Li = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Ri = (e, t, n) => {
1126
- if (!v.editable || v.config.nodeResizable === !1 || !t) return;
1127
- let { w: r, h: i } = I(t);
1414
+ }, Oa = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", ka = (e, t, n) => {
1415
+ if (!_.editable || _.config.nodeResizable === !1 || !t) return;
1416
+ let { w: r, h: i } = P(t);
1128
1417
  J.value = {
1129
1418
  id: t.id,
1130
1419
  side: n,
@@ -1132,37 +1421,37 @@ var b = {
1132
1421
  anchorY: n.includes("s") ? t.y - i / 2 : n.includes("n") ? t.y + i / 2 : null,
1133
1422
  startW: r,
1134
1423
  startH: i
1135
- }, y("node-resize-start", t);
1136
- }, zi = (e) => {
1424
+ }, v("node-resize-start", t);
1425
+ }, Aa = (e) => {
1137
1426
  let t = J.value;
1138
1427
  if (!t) return;
1139
- let n = M(t.id);
1428
+ let n = A(t.id);
1140
1429
  if (!n) return;
1141
1430
  let r = X(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
1142
1431
  if (t.anchorX !== null) {
1143
1432
  let e = t.side.includes("e");
1144
- i = Fi(e ? r.x - t.anchorX : t.anchorX - r.x, qt, Jt), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
1433
+ i = Ea(e ? r.x - t.anchorX : t.anchorX - r.x, on, sn), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
1145
1434
  }
1146
1435
  if (t.anchorY !== null) {
1147
1436
  let e = t.side.includes("s");
1148
- a = Fi(e ? r.y - t.anchorY : t.anchorY - r.y, Yt, Xt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
1437
+ a = Ea(e ? r.y - t.anchorY : t.anchorY - r.y, cn, ln), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
1149
1438
  }
1150
- S.value = S.value.map((e) => e.id === t.id ? {
1439
+ b.value = b.value.map((e) => e.id === t.id ? {
1151
1440
  ...e,
1152
1441
  x: o,
1153
1442
  y: s,
1154
1443
  width: i,
1155
1444
  height: a
1156
- } : e), C();
1157
- }, Bi = () => {
1445
+ } : e), x();
1446
+ }, ja = () => {
1158
1447
  let e = J.value;
1159
- J.value = null, e && (Sr(), y("node-resize-end", M(e.id) || null));
1160
- }, Vi = t(() => v.editable && v.config.nodeResizable !== !1), Hi = t(() => {
1161
- if (!Vi.value) return null;
1162
- let e = z.value;
1163
- return e.length === 1 && M(e[0]) || null;
1164
- }), Y = f(null), Ui = (e) => {
1165
- let t = L(e);
1448
+ J.value = null, e && (oi(), v("node-resize-end", A(e.id) || null));
1449
+ }, Ma = t(() => _.editable && _.config.nodeResizable !== !1), Na = t(() => {
1450
+ if (!Ma.value) return null;
1451
+ let e = L.value;
1452
+ return e.length === 1 && A(e[0]) || null;
1453
+ }), Y = f(null), Pa = (e) => {
1454
+ let t = F(e);
1166
1455
  return [
1167
1456
  {
1168
1457
  side: "top",
@@ -1185,8 +1474,8 @@ var b = {
1185
1474
  y: 0
1186
1475
  }
1187
1476
  ];
1188
- }, Wi = (e, t) => {
1189
- let n = E.value;
1477
+ }, Fa = (e, t) => {
1478
+ let n = C.value;
1190
1479
  if (!n) return null;
1191
1480
  let r = e, i = t;
1192
1481
  if (e && typeof e == "object" && (r = e.clientX, i = e.clientY), r == null || i == null) return null;
@@ -1199,8 +1488,8 @@ var b = {
1199
1488
  x: s.x,
1200
1489
  y: s.y
1201
1490
  };
1202
- }, Gi = (e, t) => {
1203
- let n = E.value;
1491
+ }, Ia = (e, t) => {
1492
+ let n = C.value;
1204
1493
  if (!n) return null;
1205
1494
  let r = n.createSVGPoint();
1206
1495
  r.x = Number(e) || 0, r.y = Number(t) || 0;
@@ -1211,12 +1500,12 @@ var b = {
1211
1500
  x: a.x,
1212
1501
  y: a.y
1213
1502
  };
1214
- }, X = (e) => Wi(e) ?? {
1503
+ }, X = (e) => Fa(e) ?? {
1215
1504
  x: 0,
1216
1505
  y: 0
1217
- }, Ki = (e, t, n) => {
1218
- let r = M(t);
1219
- if (!r || !E.value) return;
1506
+ }, La = (e, t, n) => {
1507
+ let r = A(t);
1508
+ if (!r || !C.value) return;
1220
1509
  let i = X(e);
1221
1510
  Y.value = {
1222
1511
  fromId: t,
@@ -1230,53 +1519,53 @@ var b = {
1230
1519
  try {
1231
1520
  e.target.setPointerCapture?.(e.pointerId);
1232
1521
  } catch {}
1233
- Qi();
1234
- }, Z = 0, qi = null, Ji = () => {
1522
+ Ua();
1523
+ }, Z = 0, Ra = null, za = () => {
1235
1524
  Z = 0;
1236
- let e = qi;
1237
- qi = null, e && Y.value && ta(e);
1238
- }, Yi = (e) => {
1239
- Y.value && (qi = {
1525
+ let e = Ra;
1526
+ Ra = null, e && Y.value && Ka(e);
1527
+ }, Ba = (e) => {
1528
+ Y.value && (Ra = {
1240
1529
  clientX: e.clientX,
1241
1530
  clientY: e.clientY
1242
- }, Z ||= requestAnimationFrame(Ji));
1243
- }, Xi = () => {
1244
- Z && (cancelAnimationFrame(Z), Ji()), Y.value && na();
1245
- }, Zi = !1, Qi = () => {
1246
- Zi || (Zi = !0, window.addEventListener("mousemove", Yi, !0), window.addEventListener("mouseup", Xi, !0));
1247
- }, $i = () => {
1248
- Zi && (Zi = !1, window.removeEventListener("mousemove", Yi, !0), window.removeEventListener("mouseup", Xi, !0));
1249
- }, ea = (e, t, n) => {
1250
- let r = S.value;
1531
+ }, Z ||= requestAnimationFrame(za));
1532
+ }, Va = () => {
1533
+ Z && (cancelAnimationFrame(Z), za()), Y.value && qa();
1534
+ }, Ha = !1, Ua = () => {
1535
+ Ha || (Ha = !0, window.addEventListener("mousemove", Ba, !0), window.addEventListener("mouseup", Va, !0));
1536
+ }, Wa = () => {
1537
+ Ha && (Ha = !1, window.removeEventListener("mousemove", Ba, !0), window.removeEventListener("mouseup", Va, !0));
1538
+ }, Ga = (e, t, n) => {
1539
+ let r = b.value;
1251
1540
  for (let i = r.length - 1; i >= 0; i--) {
1252
1541
  let a = r[i];
1253
1542
  if (a.id === n) continue;
1254
- let o = L(a);
1543
+ let o = F(a);
1255
1544
  if (e >= a.x + o.x - 2 && e <= a.x + o.x + o.width + 2 && t >= a.y + o.y - 2 && t <= a.y + o.y + o.height + 2) return a;
1256
1545
  }
1257
1546
  return null;
1258
- }, ta = (e) => {
1547
+ }, Ka = (e) => {
1259
1548
  let t = Y.value;
1260
1549
  if (!t) return;
1261
1550
  let n = X(e);
1262
1551
  t.px = n.x, t.py = n.y;
1263
- let r = ea(n.x, n.y, t.fromId);
1552
+ let r = Ga(n.x, n.y, t.fromId);
1264
1553
  t.overId = r ? r.id : null;
1265
- }, na = () => {
1266
- $i();
1554
+ }, qa = () => {
1555
+ Wa();
1267
1556
  let e = Y.value;
1268
1557
  if (Y.value = null, !e || !e.overId || e.overId === e.fromId) return;
1269
1558
  let t = {
1270
- id: `${ae()}`,
1559
+ id: `${oe()}`,
1271
1560
  from: e.fromId,
1272
1561
  to: e.overId,
1273
1562
  speed: 1,
1274
1563
  fromAnchor: "edge",
1275
1564
  toAnchor: "edge"
1276
1565
  };
1277
- D.value.push(t), y("edge-create", t);
1278
- }, ra = (e, t, n) => {
1279
- let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = I(e);
1566
+ w.value.push(t), v("edge-create", t);
1567
+ }, Ja = (e, t, n) => {
1568
+ let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = P(e);
1280
1569
  if (!n || n === "center" || a === 0 && o === 0) return {
1281
1570
  x: r,
1282
1571
  y: i
@@ -1286,44 +1575,44 @@ var b = {
1286
1575
  x: r + a * p,
1287
1576
  y: i + o * p
1288
1577
  };
1289
- }, ia = t(() => {
1578
+ }, Ya = t(() => {
1290
1579
  let e = /* @__PURE__ */ new Map();
1291
- A.value.forEach((t) => {
1292
- let n = In.value[t.id];
1580
+ D.value.forEach((t) => {
1581
+ let n = k.value[t.id];
1293
1582
  n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
1294
1583
  });
1295
1584
  let t = {};
1296
1585
  return e.forEach((e, n) => {
1297
- let [r, i] = n.split("__"), a = M(r), o = M(i);
1586
+ let [r, i] = n.split("__"), a = A(r), o = A(i);
1298
1587
  if (!a || !o) return;
1299
- let s = o.x - a.x, c = o.y - a.y, l = Math.sqrt(s * s + c * c) || 1, u = s / l, d = c / l, f = -d, p = u, m = e.length, h = Vt;
1300
- if (m > 1) {
1301
- let e = (m - 1) / 2 * Vt, t = (e) => {
1302
- let { w: t, h: n } = I(e);
1588
+ let s = o.x - a.x, c = o.y - a.y, l = Math.sqrt(s * s + c * c) || 1, u = s / l, d = c / l, f = -d, p = u, ee = e.length, m = $t;
1589
+ if (ee > 1) {
1590
+ let e = (ee - 1) / 2 * $t, t = (e) => {
1591
+ let { w: t, h: n } = P(e);
1303
1592
  return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
1304
1593
  }, n = Math.min(1, t(a) / e, t(o) / e);
1305
- h = Vt * Math.max(.35, n);
1594
+ m = $t * Math.max(.35, n);
1306
1595
  }
1307
- let ee = {};
1596
+ let te = {};
1308
1597
  e.forEach((e, t) => {
1309
- ee[e.id] = m > 1 ? t - (m - 1) / 2 : 0;
1598
+ te[e.id] = ee > 1 ? t - (ee - 1) / 2 : 0;
1310
1599
  }), t[n] = {
1311
1600
  key: n,
1312
1601
  nx: f,
1313
1602
  ny: p,
1314
1603
  dist: l,
1315
- gap: h,
1316
- slots: ee,
1604
+ gap: m,
1605
+ slots: te,
1317
1606
  dominant: Math.abs(u) >= Math.abs(d) ? "h" : "v",
1318
1607
  bulge: Math.min(l * .15, 50)
1319
1608
  };
1320
1609
  }), t;
1321
- }), aa = (e) => {
1322
- let t = In.value[e.id], n = t && ia.value[t.key];
1610
+ }), Xa = (e) => {
1611
+ let t = k.value[e.id], n = t && Ya.value[t.key];
1323
1612
  if (!n) return null;
1324
- let r = M(e.from), i = M(e.to);
1613
+ let r = A(e.from), i = A(e.to);
1325
1614
  if (!r || !i) return null;
1326
- let a = n.slots[e.id] || 0, o = a * n.gap, s = ra(r, i, e.fromAnchor), c = ra(i, r, e.toAnchor);
1615
+ let a = n.slots[e.id] || 0, o = a * n.gap, s = Ja(r, i, e.fromAnchor), c = Ja(i, r, e.toAnchor);
1327
1616
  return {
1328
1617
  frame: n,
1329
1618
  slot: a,
@@ -1336,12 +1625,12 @@ var b = {
1336
1625
  y: c.y + n.ny * o
1337
1626
  }
1338
1627
  };
1339
- }, oa = (e) => {
1340
- let t = aa(e);
1628
+ }, Za = (e) => {
1629
+ let t = Xa(e);
1341
1630
  if (!t) return "";
1342
1631
  let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
1343
- if (w.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
1344
- if (w.value === "polyline") {
1632
+ if (Sn.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
1633
+ if (Sn.value === "polyline") {
1345
1634
  if (i.dominant === "v") {
1346
1635
  let e = (n.y + r.y) / 2 + o;
1347
1636
  return `M ${n.x} ${n.y} L ${n.x} ${e} L ${r.x} ${e} L ${r.x} ${r.y}`;
@@ -1351,18 +1640,18 @@ var b = {
1351
1640
  }
1352
1641
  let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
1353
1642
  return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
1354
- }, sa = (e, t) => {
1355
- let n = aa(e);
1643
+ }, Qa = (e, t) => {
1644
+ let n = Xa(e);
1356
1645
  if (!n) return {
1357
1646
  x: 0,
1358
1647
  y: 0
1359
1648
  };
1360
1649
  let { from: r, to: i, frame: a, slot: o } = n, s = o * a.gap;
1361
- if (w.value === "straight") return {
1650
+ if (Sn.value === "straight") return {
1362
1651
  x: r.x + (i.x - r.x) * t,
1363
1652
  y: r.y + (i.y - r.y) * t
1364
1653
  };
1365
- if (w.value === "polyline") {
1654
+ if (Sn.value === "polyline") {
1366
1655
  if (a.dominant === "v") {
1367
1656
  let e = (r.y + i.y) / 2 + s, n = Math.abs(e - r.y), a = Math.abs(i.x - r.x), o = Math.abs(i.y - e), c = t * (n + a + o || 1);
1368
1657
  return c <= n ? {
@@ -1393,29 +1682,29 @@ var b = {
1393
1682
  x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
1394
1683
  y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
1395
1684
  };
1396
- }, ca = t(() => Y.value ? M(Y.value.fromId) : null), la = t(() => Y.value && Y.value.overId ? M(Y.value.overId) : null), ua = t(() => ca.value ? N(ca.value) : "#00f0ff"), da = t(() => {
1685
+ }, $a = t(() => Y.value ? A(Y.value.fromId) : null), eo = t(() => Y.value && Y.value.overId ? A(Y.value.overId) : null), to = t(() => $a.value ? j($a.value) : "#00f0ff"), no = t(() => {
1397
1686
  let e = Y.value;
1398
1687
  if (!e) return {
1399
1688
  x: 0,
1400
1689
  y: 0
1401
1690
  };
1402
- let t = la.value;
1403
- return t && ca.value ? ra(t, ca.value, "edge") : {
1691
+ let t = eo.value;
1692
+ return t && $a.value ? Ja(t, $a.value, "edge") : {
1404
1693
  x: e.px,
1405
1694
  y: e.py
1406
1695
  };
1407
- }), fa = t(() => {
1408
- let e = la.value;
1696
+ }), ro = t(() => {
1697
+ let e = eo.value;
1409
1698
  if (!e) return null;
1410
- let t = L(e);
1699
+ let t = F(e);
1411
1700
  return {
1412
1701
  x: e.x + t.x - 4,
1413
1702
  y: e.y + t.y - 4,
1414
1703
  w: t.width + 8,
1415
1704
  h: t.height + 8
1416
1705
  };
1417
- }), pa = (e) => {
1418
- let t = e.nodeIds.map((e) => M(e)).filter(Boolean);
1706
+ }), io = (e) => {
1707
+ let t = e.nodeIds.map((e) => A(e)).filter(Boolean);
1419
1708
  if (t.length === 0) return null;
1420
1709
  let n = e.padding, r = Math.min(...t.map((e) => e.x)) - n, i = Math.min(...t.map((e) => e.y)) - n, a = Math.max(...t.map((e) => e.x)) + n, o = Math.max(...t.map((e) => e.y)) + n;
1421
1710
  return {
@@ -1424,62 +1713,62 @@ var b = {
1424
1713
  width: a - r,
1425
1714
  height: o - i
1426
1715
  };
1427
- }, ma = t(() => v.groups.map((e) => ({
1716
+ }, ao = t(() => _.groups.map((e) => ({
1428
1717
  ...e,
1429
- rect: pa(e)
1430
- })).filter((e) => e.rect)), Q = (e) => or(e) ? yr.value : e.color ? e.color : fi.value ? fi.value : e.centerText && e.centerText.color || "#00f0ff", ha = (e) => {
1431
- let t = In.value[e.id];
1718
+ rect: io(e)
1719
+ })).filter((e) => e.rect)), Q = (e) => Wr(e) ? ri.value : e.color ? e.color : Qi.value ? Qi.value : e.centerText && e.centerText.color || "#00f0ff", oo = (e) => {
1720
+ let t = k.value[e.id];
1432
1721
  return !!t && !t.hidden;
1433
- }, ga = t(() => [...new Set(A.value.map(Q))].map((e) => ({
1722
+ }, so = t(() => [...new Set(D.value.map(Q))].map((e) => ({
1434
1723
  key: String(e).replace("#", ""),
1435
1724
  color: e
1436
- }))), _a = (e) => {
1725
+ }))), co = (e) => {
1437
1726
  let t = e.endMarker;
1438
1727
  if (!t || t === "none") return "";
1439
1728
  let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
1440
1729
  return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
1441
- }, va = /* @__PURE__ */ new Map(), ya = {
1730
+ }, lo = /* @__PURE__ */ new Map(), uo = {
1442
1731
  nodes: null,
1443
1732
  edges: null,
1444
1733
  mode: null,
1445
1734
  epoch: -1
1446
- }, ba = () => {
1447
- let e = ya;
1448
- (e.nodes !== S.value || e.edges !== A.value || e.mode !== w.value || e.epoch !== Qt) && (ya = {
1449
- nodes: S.value,
1450
- edges: A.value,
1451
- mode: w.value,
1452
- epoch: Qt
1453
- }, va = /* @__PURE__ */ new Map());
1735
+ }, fo = () => {
1736
+ let e = uo;
1737
+ (e.nodes !== b.value || e.edges !== D.value || e.mode !== Sn.value || e.epoch !== fn) && (uo = {
1738
+ nodes: b.value,
1739
+ edges: D.value,
1740
+ mode: Sn.value,
1741
+ epoch: fn
1742
+ }, lo = /* @__PURE__ */ new Map());
1454
1743
  }, $ = (e) => {
1455
- ba();
1456
- let t = va.get(e.id);
1457
- return t === void 0 && (t = oa(e), va.set(e.id, t)), t;
1458
- }, xa = (e, t = 1) => `${2 / e.speed * t}s`, Sa = (e) => `${3 / e.speed}s`, Ca = t(() => v.config.edgeDashFlow === !0), wa = t(() => {
1459
- let e = v.config.edgeDashPattern, t = null;
1744
+ fo();
1745
+ let t = lo.get(e.id);
1746
+ return t === void 0 && (t = Za(e), lo.set(e.id, t)), t;
1747
+ }, po = (e, t = 1) => `${2 / e.speed * t}s`, mo = (e) => `${3 / e.speed}s`, ho = t(() => _.config.edgeDashFlow === !0), go = t(() => {
1748
+ let e = _.config.edgeDashPattern, t = null;
1460
1749
  return typeof e == "string" && e.trim() ? t = e.trim().split(/\s+/).map(Number).filter((e) => Number.isFinite(e) && e > 0) : Array.isArray(e) && (t = e.map(Number).filter((e) => Number.isFinite(e) && e > 0)), t && t.length ? t : [10, 8];
1461
- }), Ta = t(() => wa.value.join(" ")), Ea = t(() => wa.value.reduce((e, t) => e + t, 0)), Da = (e) => {
1462
- let t = Number(e.dashFlowWidth ?? v.config.edgeDashFlowWidth);
1750
+ }), _o = t(() => go.value.join(" ")), vo = t(() => go.value.reduce((e, t) => e + t, 0)), yo = (e) => {
1751
+ let t = Number(e.dashFlowWidth ?? _.config.edgeDashFlowWidth);
1463
1752
  return Number.isFinite(t) && t > 0 ? t : 2;
1464
- }, Oa = (e) => {
1753
+ }, bo = (e) => {
1465
1754
  let t = Number(e.speed);
1466
1755
  return `${1.2 / (Number.isFinite(t) && t > 0 ? t : 1)}s`;
1467
- }, ka = (e) => e.animated === !1 ? !1 : e.dashFlow === !0 || e.dashFlow !== !1 && Ca.value, Aa = (e) => {
1468
- let t = Ci(e);
1756
+ }, xo = (e) => e.animated === !1 ? !1 : e.dashFlow === !0 || e.dashFlow !== !1 && ho.value, So = (e) => {
1757
+ let t = la(e);
1469
1758
  return t === "flow" || t === "all";
1470
- }, ja = (e) => {
1471
- let t = Ci(e);
1759
+ }, Co = (e) => {
1760
+ let t = la(e);
1472
1761
  return t === "particle" || t === "all";
1473
- }, Ma = (e) => en(e).text, Na = (e) => !!e && String(en(e).text ?? "").trim() !== "", Pa = (e, t) => {
1762
+ }, wo = (e) => mn(e).text, To = (e) => !!e && String(mn(e).text ?? "").trim() !== "", Eo = (e, t) => {
1474
1763
  if (!e) return null;
1475
- let n = en(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
1764
+ let n = mn(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
1476
1765
  for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
1477
1766
  return {
1478
1767
  w: Math.max(14, a * r + 8),
1479
1768
  h: Math.max(12, r + 6)
1480
1769
  };
1481
- }, Fa = (e, t) => {
1482
- let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ? li.value : !!n.showBg, i = n.bgColor || ui.value, a = di.value;
1770
+ }, Do = (e, t) => {
1771
+ let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ? Yi.value : !!n.showBg, i = n.bgColor || Xi.value, a = Zi.value;
1483
1772
  if (n.bgOpacity !== void 0 && n.bgOpacity !== null) {
1484
1773
  let e = Number(n.bgOpacity);
1485
1774
  Number.isFinite(e) && (a = Math.min(1, Math.max(0, e)));
@@ -1488,7 +1777,7 @@ var b = {
1488
1777
  "solid",
1489
1778
  "dashed",
1490
1779
  "none"
1491
- ].includes(n.borderStyle) ? n.borderStyle : "solid", s = n.borderColor || on(e, t), c = n.borderColor ? 1 : .35;
1780
+ ].includes(n.borderStyle) ? n.borderStyle : "solid", s = n.borderColor || yn(e, t), c = n.borderColor ? 1 : .35;
1492
1781
  return {
1493
1782
  show: r,
1494
1783
  fill: i,
@@ -1497,90 +1786,106 @@ var b = {
1497
1786
  borderColor: s,
1498
1787
  borderOpacity: c
1499
1788
  };
1500
- }, Ia = (e, t) => {
1501
- let n = sa(e, Math.max(0, t - .005)), r = sa(e, Math.min(1, t + .005));
1789
+ }, Oo = (e, t) => {
1790
+ let n = Qa(e, Math.max(0, t - .005)), r = Qa(e, Math.min(1, t + .005));
1502
1791
  return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
1503
- }, La = (e) => {
1792
+ }, ko = (e) => {
1504
1793
  let t = e % 180;
1505
1794
  return t > 90 && (t -= 180), t < -90 && (t += 180), t;
1506
- }, Ra = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(en(e).rotation || 0) + (n || 0)})`, za = t(() => v.config?.edgeCenterTextFollowLine !== !1), Ba = (e, t) => za.value ? Math.abs(e) <= Zt || v.config?.edgeCenterTextFollowLine ? e : t > 0 ? Math.abs(e) : -Math.abs(e) : 0, Va = () => ({
1507
- fromT: .28,
1508
- toT: .72
1509
- }), Ha = t(() => {
1795
+ }, Ao = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(mn(e).rotation || 0) + (n || 0)})`, jo = t(() => _.config?.edgeCenterTextFollowLine !== !1), Mo = (e, t) => jo.value ? Math.abs(e) <= un || _.config?.edgeCenterTextFollowLine ? e : t > 0 ? Math.abs(e) : -Math.abs(e) : 0, No = (e, t = 120) => {
1796
+ let n = [];
1797
+ for (let r = 0; r <= t; r++) n.push(Qa(e, r / t));
1798
+ return n;
1799
+ }, Po = (e, t, n = !1) => {
1800
+ let r = No(e), i = [], a = 0;
1801
+ for (let e = 1; e < r.length; e++) {
1802
+ let t = Math.hypot(r[e].x - r[e - 1].x, r[e].y - r[e - 1].y);
1803
+ i.push(t), a += t;
1804
+ }
1805
+ let o = Math.min(t, a / 2), s = n ? a - o : o, c = 0;
1806
+ for (let e = 0; e < i.length; e++) {
1807
+ if (c + i[e] >= s) {
1808
+ let t = i[e] ? (s - c) / i[e] : 0;
1809
+ return (e + t) / i.length;
1810
+ }
1811
+ c += i[e];
1812
+ }
1813
+ return +!!n;
1814
+ }, Fo = t(() => {
1510
1815
  let e = [];
1511
- for (let t of G.value) {
1512
- let n = In.value[t.id];
1816
+ for (let t of U.value) {
1817
+ let n = k.value[t.id];
1513
1818
  if (!n) continue;
1514
1819
  let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
1515
1820
  if (!r && !i) continue;
1516
- let a = M(t.from), o = M(t.to);
1821
+ let a = A(t.from), o = A(t.to);
1517
1822
  if (!a || !o) continue;
1518
- let { fromT: s, toT: c } = Va();
1823
+ let s = Po(t, dn), c = Po(t, dn, !0);
1519
1824
  e.push({
1520
1825
  id: t.id,
1521
1826
  edge: t,
1522
1827
  info: n,
1523
- color: a && oe[a.nodeType] || "#00f0ff",
1524
- start: sa(t, s),
1525
- center: sa(t, .5),
1526
- end: sa(t, c),
1527
- startAngle: La(Ia(t, s)),
1528
- centerRaw: Ia(t, .5),
1529
- centerAngle: La(Ia(t, .5)),
1530
- endAngle: La(Ia(t, c)),
1531
- fromBox: Pa(t.fromText, t),
1532
- centerBox: Pa(t.centerText, t),
1533
- toBox: Pa(t.toText, t),
1534
- fromPlate: Fa(t, t.fromText),
1535
- centerPlate: Fa(t, t.centerText),
1536
- toPlate: Fa(t, t.toText)
1828
+ color: a && se[a.nodeType] || "#00f0ff",
1829
+ start: Qa(t, s),
1830
+ center: Qa(t, .5),
1831
+ end: Qa(t, c),
1832
+ startAngle: ko(Oo(t, s)),
1833
+ centerRaw: Oo(t, .5),
1834
+ centerAngle: ko(Oo(t, .5)),
1835
+ endAngle: ko(Oo(t, c)),
1836
+ fromBox: Eo(t.fromText, t),
1837
+ centerBox: Eo(t.centerText, t),
1838
+ toBox: Eo(t.toText, t),
1839
+ fromPlate: Do(t, t.fromText),
1840
+ centerPlate: Do(t, t.centerText),
1841
+ toPlate: Do(t, t.toText)
1537
1842
  });
1538
1843
  }
1539
1844
  return e;
1540
1845
  });
1541
- return re({
1542
- resetDataBaseline: Sn,
1543
- getData: Cn,
1544
- setData: Fn,
1545
- removeSelected: Tn,
1546
- addNodes: jn,
1547
- addEdges: Mn,
1548
- updateNodes: Nn,
1549
- updateEdges: Pn,
1550
- clientToSvg: Wi,
1551
- svgToClient: Gi,
1552
- moveLayerUp: mr,
1553
- moveLayerDown: hr,
1554
- moveToFront: gr,
1555
- moveToBack: _r,
1556
- downloadSVG: vr
1846
+ return ie({
1847
+ resetDataBaseline: In,
1848
+ getData: Ln,
1849
+ setData: Yn,
1850
+ removeSelected: zn,
1851
+ addNodes: Gn,
1852
+ addEdges: Kn,
1853
+ updateNodes: qn,
1854
+ updateEdges: Jn,
1855
+ clientToSvg: Fa,
1856
+ svgToClient: Ia,
1857
+ moveLayerUp: Qr,
1858
+ moveLayerDown: $r,
1859
+ moveToFront: ei,
1860
+ moveToBack: ti,
1861
+ downloadSVG: ni
1557
1862
  }), (t, o) => (d(), r("svg", {
1558
1863
  ref_key: "svgRef",
1559
- ref: E,
1864
+ ref: C,
1560
1865
  class: "topology-svg",
1561
- style: c(ni.value),
1562
- viewBox: `${Ar.value} ${jr.value} ${U.value} ${W.value}`,
1563
- onMousedown: Kr,
1564
- onMousemove: Mi,
1565
- onMouseup: Pi,
1566
- onMouseleave: Pi,
1567
- onClick: Tr,
1568
- onWheel: g(Lr, ["prevent"])
1866
+ style: c(Hi.value),
1867
+ viewBox: `${mi.value} ${hi.value} ${V.value} ${H.value}`,
1868
+ onMousedown: Mi,
1869
+ onMousemove: _a,
1870
+ onMouseup: ya,
1871
+ onMouseleave: ya,
1872
+ onClick: li,
1873
+ onWheel: h(Ci, ["prevent"])
1569
1874
  }, [
1570
1875
  i("defs", null, [
1571
1876
  o[3] ||= a("<linearGradient id=\"glassHighlight\" x1=\"0%\" y1=\"0%\" x2=\"60%\" y2=\"100%\"><stop offset=\"0%\" stop-color=\"rgba(255,255,255,0.9)\"></stop><stop offset=\"30%\" stop-color=\"rgba(255,255,255,0.25)\"></stop><stop offset=\"100%\" stop-color=\"rgba(255,255,255,0)\"></stop></linearGradient><filter id=\"glow-core\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"3\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter><filter id=\"glow-strong\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"6\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter>", 3),
1572
1877
  i("radialGradient", {
1573
1878
  id: "bg-grid",
1574
- cx: si.value.cx,
1575
- cy: si.value.cy,
1576
- r: si.value.r
1577
- }, [(d(!0), r(e, null, p(si.value.stops, (e, t) => (d(), r("stop", {
1879
+ cx: qi.value.cx,
1880
+ cy: qi.value.cy,
1881
+ r: qi.value.r
1882
+ }, [(d(!0), r(e, null, p(qi.value.stops, (e, t) => (d(), r("stop", {
1578
1883
  key: `bg-stop-${t}`,
1579
1884
  offset: e.offset,
1580
1885
  "stop-color": e.color,
1581
1886
  "stop-opacity": e.opacity
1582
- }, null, 8, le))), 128))], 8, ce),
1583
- (d(!0), r(e, null, p(ee(b), (e, t) => (d(), r("radialGradient", {
1887
+ }, null, 8, ue))), 128))], 8, le),
1888
+ (d(!0), r(e, null, p(te(y), (e, t) => (d(), r("radialGradient", {
1584
1889
  key: `breath-${t}`,
1585
1890
  id: `breath-grad-${t}`
1586
1891
  }, [
@@ -1588,20 +1893,29 @@ var b = {
1588
1893
  offset: "0%",
1589
1894
  "stop-color": e.color,
1590
1895
  "stop-opacity": "1"
1591
- }, null, 8, de),
1896
+ }, null, 8, fe),
1592
1897
  i("stop", {
1593
1898
  offset: "40%",
1594
1899
  "stop-color": e.color,
1595
1900
  "stop-opacity": "0.5"
1596
- }, null, 8, fe),
1901
+ }, null, 8, pe),
1597
1902
  i("stop", {
1598
1903
  offset: "100%",
1599
1904
  "stop-color": e.color,
1600
1905
  "stop-opacity": "0"
1601
- }, null, 8, pe)
1602
- ], 8, ue))), 128)),
1906
+ }, null, 8, me)
1907
+ ], 8, de))), 128)),
1908
+ (d(!0), r(e, null, p(Mr.value, (t) => (d(), r("radialGradient", {
1909
+ key: t.id,
1910
+ id: t.id
1911
+ }, [(d(!0), r(e, null, p(t.stops, (e, n) => (d(), r("stop", {
1912
+ key: `${t.id}-stop-${n}`,
1913
+ offset: e.offset,
1914
+ "stop-color": t.color,
1915
+ "stop-opacity": e.opacity
1916
+ }, null, 8, ge))), 128))], 8, he))), 128)),
1603
1917
  o[4] ||= a("<linearGradient id=\"flow-grad-1\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop><stop offset=\"40%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"60%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"100%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop></linearGradient>", 1),
1604
- (d(!0), r(e, null, p(ga.value, (e) => (d(), r("marker", {
1918
+ (d(!0), r(e, null, p(so.value, (e) => (d(), r("marker", {
1605
1919
  key: `m-arrow-${e.key}`,
1606
1920
  id: `edge-arrow-${e.key}`,
1607
1921
  viewBox: "0 0 10 10",
@@ -1614,8 +1928,8 @@ var b = {
1614
1928
  }, [i("path", {
1615
1929
  d: "M1,2.5 L9,5 L1,7.5 Z",
1616
1930
  fill: e.color
1617
- }, null, 8, he)], 8, me))), 128)),
1618
- (d(!0), r(e, null, p(ga.value, (e) => (d(), r("marker", {
1931
+ }, null, 8, ve)], 8, _e))), 128)),
1932
+ (d(!0), r(e, null, p(so.value, (e) => (d(), r("marker", {
1619
1933
  key: `m-dot-${e.key}`,
1620
1934
  id: `edge-dot-${e.key}`,
1621
1935
  viewBox: "0 0 10 10",
@@ -1630,34 +1944,34 @@ var b = {
1630
1944
  cy: "5",
1631
1945
  r: "4",
1632
1946
  fill: e.color
1633
- }, null, 8, _e)], 8, ge))), 128))
1947
+ }, null, 8, be)], 8, ye))), 128))
1634
1948
  ]),
1635
1949
  i("rect", {
1636
- width: U.value,
1637
- height: W.value,
1638
- x: Ar.value,
1639
- y: jr.value,
1950
+ width: V.value,
1951
+ height: H.value,
1952
+ x: mi.value,
1953
+ y: hi.value,
1640
1954
  fill: "url(#bg-grid)"
1641
- }, null, 8, ve),
1642
- ri.value ? (d(), r(e, { key: 0 }, [i("pattern", {
1955
+ }, null, 8, xe),
1956
+ Ui.value ? (d(), r(e, { key: 0 }, [i("pattern", {
1643
1957
  id: "grid",
1644
- width: ai.value,
1645
- height: ai.value,
1958
+ width: Gi.value,
1959
+ height: Gi.value,
1646
1960
  patternUnits: "userSpaceOnUse"
1647
1961
  }, [i("path", {
1648
- d: `M ${ai.value} 0 L 0 0 0 ${ai.value}`,
1962
+ d: `M ${Gi.value} 0 L 0 0 0 ${Gi.value}`,
1649
1963
  fill: "none",
1650
- stroke: ii.value,
1964
+ stroke: Wi.value,
1651
1965
  "stroke-width": "0.5"
1652
- }, null, 8, be)], 8, ye), i("rect", {
1653
- width: U.value,
1654
- height: W.value,
1655
- x: Ar.value,
1656
- y: jr.value,
1966
+ }, null, 8, Ce)], 8, Se), i("rect", {
1967
+ width: V.value,
1968
+ height: H.value,
1969
+ x: mi.value,
1970
+ y: hi.value,
1657
1971
  fill: "url(#grid)",
1658
- opacity: oi.value
1659
- }, null, 8, xe)], 64)) : n("", !0),
1660
- ci.value ? (d(), r("g", Se, [...o[5] ||= [
1972
+ opacity: Ki.value
1973
+ }, null, 8, we)], 64)) : n("", !0),
1974
+ Ji.value ? (d(), r("g", Te, [...o[5] ||= [
1661
1975
  i("line", {
1662
1976
  x1: "-22",
1663
1977
  y1: "0",
@@ -1689,7 +2003,7 @@ var b = {
1689
2003
  opacity: "0.8"
1690
2004
  }, null, -1)
1691
2005
  ]])) : n("", !0),
1692
- (d(!0), r(e, null, p(ma.value, (e) => (d(), r("g", { key: e.id }, [
2006
+ (d(!0), r(e, null, p(ao.value, (e) => (d(), r("g", { key: e.id }, [
1693
2007
  i("rect", {
1694
2008
  x: e.rect.x,
1695
2009
  y: e.rect.y,
@@ -1698,7 +2012,7 @@ var b = {
1698
2012
  rx: "16",
1699
2013
  fill: e.color,
1700
2014
  opacity: "0.03"
1701
- }, null, 8, Ce),
2015
+ }, null, 8, Ee),
1702
2016
  i("rect", {
1703
2017
  x: e.rect.x,
1704
2018
  y: e.rect.y,
@@ -1710,83 +2024,106 @@ var b = {
1710
2024
  "stroke-width": "1.5",
1711
2025
  "stroke-dasharray": "8 5",
1712
2026
  opacity: "0.35"
1713
- }, null, 8, we),
2027
+ }, null, 8, De),
1714
2028
  i("circle", {
1715
2029
  cx: e.rect.x + 4,
1716
2030
  cy: e.rect.y + 4,
1717
2031
  r: "3",
1718
2032
  fill: e.color,
1719
2033
  opacity: "0.5"
1720
- }, null, 8, Te),
2034
+ }, null, 8, Oe),
1721
2035
  i("circle", {
1722
2036
  cx: e.rect.x + e.rect.width - 4,
1723
2037
  cy: e.rect.y + 4,
1724
2038
  r: "3",
1725
2039
  fill: e.color,
1726
2040
  opacity: "0.5"
1727
- }, null, 8, Ee),
2041
+ }, null, 8, ke),
1728
2042
  i("circle", {
1729
2043
  cx: e.rect.x + 4,
1730
2044
  cy: e.rect.y + e.rect.height - 4,
1731
2045
  r: "3",
1732
2046
  fill: e.color,
1733
2047
  opacity: "0.5"
1734
- }, null, 8, De),
2048
+ }, null, 8, Ae),
1735
2049
  i("circle", {
1736
2050
  cx: e.rect.x + e.rect.width - 4,
1737
2051
  cy: e.rect.y + e.rect.height - 4,
1738
2052
  r: "3",
1739
2053
  fill: e.color,
1740
2054
  opacity: "0.5"
1741
- }, null, 8, Oe),
2055
+ }, null, 8, je),
1742
2056
  i("text", {
1743
2057
  x: e.rect.x + 14,
1744
2058
  y: e.rect.y + 20,
1745
2059
  transform: `rotate(${e.rotation || 0} ${e.rect.x + 14} ${e.rect.y + 20})`,
1746
2060
  fill: e.color,
1747
2061
  "font-size": "12",
1748
- "font-family": "'SF Mono', 'Cascadia Code', 'Consolas', monospace",
1749
- "font-weight": "600",
1750
2062
  opacity: "0.7",
1751
2063
  "letter-spacing": "0.5"
1752
- }, h(e.label), 9, ke)
2064
+ }, m(e.label), 9, Me)
1753
2065
  ]))), 128)),
1754
- dr.value ? (d(), r("g", Ae, [(d(!0), r(e, null, p(Ir.value, (e) => (d(), r("g", {
2066
+ (d(!0), r(e, null, p(xi.value, (e) => (d(), r("g", {
2067
+ key: `region-${e.id}`,
2068
+ transform: `translate(${e.x}, ${e.y})`,
2069
+ "pointer-events": "none"
2070
+ }, [i("rect", {
2071
+ x: F(e).x,
2072
+ y: F(e).y,
2073
+ width: F(e).width,
2074
+ height: F(e).height,
2075
+ rx: K(e),
2076
+ fill: er(e),
2077
+ opacity: "0.03"
2078
+ }, null, 8, Pe), tr(e) ? (d(), r("rect", {
2079
+ key: 0,
2080
+ x: F(e).x,
2081
+ y: F(e).y,
2082
+ width: F(e).width,
2083
+ height: F(e).height,
2084
+ rx: K(e),
2085
+ fill: "none",
2086
+ stroke: ua(e),
2087
+ "stroke-width": nr(e),
2088
+ "stroke-dasharray": fa(e),
2089
+ opacity: "0.35"
2090
+ }, null, 8, Fe)) : n("", !0)], 8, Ne))), 128)),
2091
+ Yr.value ? (d(), r("g", Ie, [(d(!0), r(e, null, p(Si.value, (e) => (d(), r("g", {
1755
2092
  key: `node-base-${e.id}`,
1756
2093
  transform: `translate(${e.x}, ${e.y})`
1757
- }, [ir(e) && _.viewMode !== "3d" ? (d(), r("rect", {
2094
+ }, [Hr(e) && g.viewMode !== "3d" ? (d(), r("rect", {
1758
2095
  key: 0,
1759
- x: L(e).x,
1760
- y: L(e).y,
1761
- width: L(e).width,
1762
- height: L(e).height,
1763
- rx: Di(e),
1764
- fill: ir(e),
2096
+ x: F(e).x,
2097
+ y: F(e).y,
2098
+ width: F(e).width,
2099
+ height: F(e).height,
2100
+ rx: K(e),
2101
+ fill: Hr(e),
1765
2102
  opacity: "0.15"
1766
- }, null, 8, Me)) : n("", !0), R(e) && _.viewMode !== "3d" ? (d(), r("rect", {
2103
+ }, null, 8, Re)) : n("", !0), I(e) && g.viewMode !== "3d" ? (d(), r("rect", {
1767
2104
  key: 1,
1768
- x: R(e).x,
1769
- y: R(e).y,
1770
- width: R(e).width,
1771
- height: R(e).height,
1772
- rx: Di(e),
2105
+ x: I(e).x,
2106
+ y: I(e).y,
2107
+ width: I(e).width,
2108
+ height: I(e).height,
2109
+ rx: K(e),
1773
2110
  fill: "none",
1774
- stroke: wi(e),
1775
- "stroke-width": Ti(e),
1776
- "stroke-dasharray": Ei(e),
2111
+ stroke: ua(e),
2112
+ "stroke-width": da(e),
2113
+ "stroke-dasharray": fa(e),
1777
2114
  opacity: "0.8"
1778
- }, null, 8, Ne)) : n("", !0)], 8, je))), 128))])) : n("", !0),
1779
- (d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `base-${t.id}` }, [ka(t) ? n("", !0) : (d(), r("path", {
2115
+ }, null, 8, ze)) : n("", !0)], 8, Le))), 128))])) : n("", !0),
2116
+ (d(!0), r(e, null, p(U.value, (t) => (d(), r(e, { key: `base-${t.id}` }, [xo(t) ? n("", !0) : (d(), r("path", {
1780
2117
  key: 0,
1781
2118
  d: $(t),
1782
2119
  fill: "none",
1783
- stroke: mi(t),
1784
- opacity: hi(t),
2120
+ stroke: ea(t),
2121
+ opacity: ta(t),
1785
2122
  "stroke-width": "2",
1786
2123
  "stroke-linecap": "round",
1787
- "marker-end": _a(t)
1788
- }, null, 8, Pe))], 64))), 128)),
1789
- (d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `glow-${t.id}` }, [xi.value ? (d(), r("path", {
2124
+ "marker-end": co(t)
2125
+ }, null, 8, Be))], 64))), 128)),
2126
+ (d(!0), r(e, null, p(U.value, (t) => (d(), r(e, { key: `glow-${t.id}` }, [sa.value ? (d(), r("path", {
1790
2127
  key: 0,
1791
2128
  d: $(t),
1792
2129
  fill: "none",
@@ -1795,17 +2132,17 @@ var b = {
1795
2132
  "stroke-linecap": "round",
1796
2133
  opacity: "0.15",
1797
2134
  filter: "url(#glow-strong)"
1798
- }, null, 8, Fe)) : n("", !0)], 64))), 128)),
1799
- (d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `sel-${t.id}` }, [or(t) ? (d(), r("path", {
2135
+ }, null, 8, Ve)) : n("", !0)], 64))), 128)),
2136
+ (d(!0), r(e, null, p(U.value, (t) => (d(), r(e, { key: `sel-${t.id}` }, [Wr(t) ? (d(), r("path", {
1800
2137
  key: 0,
1801
2138
  d: $(t),
1802
2139
  fill: "none",
1803
- stroke: yr.value,
2140
+ stroke: ri.value,
1804
2141
  "stroke-width": "4",
1805
2142
  opacity: "0.35",
1806
2143
  filter: "url(#glow-strong)"
1807
- }, null, 8, Ie)) : n("", !0)], 64))), 128)),
1808
- (d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `flow-${t.id}` }, [Aa(t) ? (d(), r("g", Le, [
2144
+ }, null, 8, He)) : n("", !0)], 64))), 128)),
2145
+ (d(!0), r(e, null, p(U.value, (t) => (d(), r(e, { key: `flow-${t.id}` }, [So(t) ? (d(), r("g", Ue, [
1809
2146
  i("path", {
1810
2147
  d: $(t),
1811
2148
  fill: "none",
@@ -1818,9 +2155,9 @@ var b = {
1818
2155
  attributeName: "stroke-dashoffset",
1819
2156
  from: "0",
1820
2157
  to: "-52",
1821
- dur: xa(t),
2158
+ dur: po(t),
1822
2159
  repeatCount: "indefinite"
1823
- }, null, 8, ze)], 8, Re),
2160
+ }, null, 8, Ge)], 8, We),
1824
2161
  i("path", {
1825
2162
  d: $(t),
1826
2163
  fill: "none",
@@ -1833,9 +2170,9 @@ var b = {
1833
2170
  attributeName: "stroke-dashoffset",
1834
2171
  from: "-30",
1835
2172
  to: "-82",
1836
- dur: xa(t, 1.3),
2173
+ dur: po(t, 1.3),
1837
2174
  repeatCount: "indefinite"
1838
- }, null, 8, Ve)], 8, Be),
2175
+ }, null, 8, qe)], 8, Ke),
1839
2176
  i("path", {
1840
2177
  d: $(t),
1841
2178
  fill: "none",
@@ -1849,71 +2186,70 @@ var b = {
1849
2186
  attributeName: "stroke-dashoffset",
1850
2187
  from: "0",
1851
2188
  to: "-84",
1852
- dur: xa(t, .8),
2189
+ dur: po(t, .8),
1853
2190
  repeatCount: "indefinite"
1854
- }, null, 8, Ue)], 8, He)
2191
+ }, null, 8, Ye)], 8, Je)
1855
2192
  ])) : n("", !0)], 64))), 128)),
1856
- (d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `dash-${t.id}` }, [ka(t) ? (d(), r("path", {
2193
+ (d(!0), r(e, null, p(U.value, (t) => (d(), r(e, { key: `dash-${t.id}` }, [xo(t) ? (d(), r("path", {
1857
2194
  key: 0,
1858
2195
  d: $(t),
1859
2196
  fill: "none",
1860
2197
  stroke: Q(t),
1861
- "stroke-width": Da(t),
2198
+ "stroke-width": yo(t),
1862
2199
  "stroke-linecap": "round",
1863
- "stroke-dasharray": Ta.value,
1864
- "marker-end": _a(t),
2200
+ "stroke-dasharray": _o.value,
2201
+ "marker-end": co(t),
1865
2202
  opacity: "0.9"
1866
2203
  }, [i("animate", {
1867
2204
  attributeName: "stroke-dashoffset",
1868
2205
  from: "0",
1869
- to: `${-Ea.value}`,
1870
- dur: Oa(t),
2206
+ to: `${-vo.value}`,
2207
+ dur: bo(t),
1871
2208
  repeatCount: "indefinite"
1872
- }, null, 8, Ge)], 8, We)) : n("", !0)], 64))), 128)),
1873
- (d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `particle-${t.id}` }, [ja(t) ? (d(), r("g", Ke, [i("circle", {
2209
+ }, null, 8, Ze)], 8, Xe)) : n("", !0)], 64))), 128)),
2210
+ (d(!0), r(e, null, p(U.value, (t) => (d(), r(e, { key: `particle-${t.id}` }, [Co(t) ? (d(), r("g", Qe, [i("circle", {
1874
2211
  r: "3",
1875
2212
  fill: Q(t),
1876
2213
  opacity: "0.9",
1877
2214
  filter: "url(#glow-core)"
1878
2215
  }, [i("animateMotion", {
1879
2216
  path: $(t),
1880
- dur: Sa(t),
2217
+ dur: mo(t),
1881
2218
  repeatCount: "indefinite"
1882
- }, null, 8, Je)], 8, qe), i("circle", {
2219
+ }, null, 8, et)], 8, $e), i("circle", {
1883
2220
  r: "8",
1884
2221
  fill: Q(t),
1885
2222
  opacity: "0.2",
1886
2223
  filter: "url(#glow-strong)"
1887
2224
  }, [i("animateMotion", {
1888
2225
  path: $(t),
1889
- dur: Sa(t),
2226
+ dur: mo(t),
1890
2227
  repeatCount: "indefinite"
1891
- }, null, 8, Xe)], 8, Ye)])) : n("", !0)], 64))), 128)),
1892
- (d(!0), r(e, null, p(Ha.value, (t) => (d(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (d(), r("g", {
2228
+ }, null, 8, nt)], 8, tt)])) : n("", !0)], 64))), 128)),
2229
+ (d(!0), r(e, null, p(Fo.value, (t) => (d(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (d(), r("g", {
1893
2230
  key: 0,
1894
2231
  transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
1895
2232
  }, [i("rect", {
1896
2233
  x: "-7",
1897
- y: -an(t.edge, null) / 2,
2234
+ y: -vn(t.edge, null) / 2,
1898
2235
  width: 14,
1899
- height: an(t.edge, null),
2236
+ height: vn(t.edge, null),
1900
2237
  rx: "2",
1901
2238
  fill: "#FFFFFF",
1902
2239
  opacity: "0.9",
1903
2240
  stroke: t.color,
1904
2241
  "stroke-width": "0.6"
1905
- }, null, 8, Qe), i("text", {
2242
+ }, null, 8, it), i("text", {
1906
2243
  y: "0",
1907
2244
  "dominant-baseline": "central",
1908
2245
  "text-anchor": "middle",
1909
- "font-size": an(t.edge, null),
1910
- fill: on(t.edge, null),
1911
- "font-family": "'SF Mono', monospace",
2246
+ "font-size": vn(t.edge, null),
2247
+ fill: yn(t.edge, null),
1912
2248
  opacity: "1"
1913
- }, h(t.info.count), 9, $e)], 8, Ze)) : t.info.merged ? n("", !0) : (d(), r("g", et, [
1914
- Na(t.edge.fromText) ? (d(), r("g", {
2249
+ }, m(t.info.count), 9, at)], 8, rt)) : t.info.merged ? n("", !0) : (d(), r("g", ot, [
2250
+ To(t.edge.fromText) ? (d(), r("g", {
1915
2251
  key: 0,
1916
- transform: Ra(t.edge.fromText, t.start, t.startAngle)
2252
+ transform: Ao(t.edge.fromText, t.start, t.startAngle)
1917
2253
  }, [t.fromPlate.show ? (d(), r("rect", {
1918
2254
  key: 0,
1919
2255
  x: -t.fromBox.w / 2,
@@ -1927,19 +2263,17 @@ var b = {
1927
2263
  "stroke-width": "0.6",
1928
2264
  "stroke-opacity": t.fromPlate.borderOpacity,
1929
2265
  "stroke-dasharray": t.fromPlate.borderStyle === "dashed" ? "3 2" : void 0
1930
- }, null, 8, nt)) : n("", !0), i("text", {
2266
+ }, null, 8, ct)) : n("", !0), i("text", {
1931
2267
  y: "0",
1932
2268
  "dominant-baseline": "central",
1933
2269
  "text-anchor": "middle",
1934
- "font-size": an(t.edge, t.edge.fromText),
1935
- fill: on(t.edge, t.edge.fromText),
1936
- "font-family": "'SF Mono', monospace",
1937
- "font-weight": "500",
2270
+ "font-size": vn(t.edge, t.edge.fromText),
2271
+ fill: yn(t.edge, t.edge.fromText),
1938
2272
  opacity: "0.9"
1939
- }, h(Ma(t.edge.fromText)), 9, rt)], 8, tt)) : n("", !0),
1940
- Na(t.edge.centerText) ? (d(), r("g", {
2273
+ }, m(wo(t.edge.fromText)), 9, lt)], 8, st)) : n("", !0),
2274
+ To(t.edge.centerText) ? (d(), r("g", {
1941
2275
  key: 1,
1942
- transform: Ra(t.edge.centerText, t.center, Ba(t.centerAngle, t.centerRaw))
2276
+ transform: Ao(t.edge.centerText, t.center, Mo(t.centerAngle, t.centerRaw))
1943
2277
  }, [t.centerPlate.show ? (d(), r("rect", {
1944
2278
  key: 0,
1945
2279
  x: -t.centerBox.w / 2,
@@ -1953,19 +2287,17 @@ var b = {
1953
2287
  "stroke-width": "0.6",
1954
2288
  "stroke-opacity": t.centerPlate.borderOpacity,
1955
2289
  "stroke-dasharray": t.centerPlate.borderStyle === "dashed" ? "3 2" : void 0
1956
- }, null, 8, at)) : n("", !0), i("text", {
2290
+ }, null, 8, dt)) : n("", !0), i("text", {
1957
2291
  y: "0",
1958
2292
  "dominant-baseline": "central",
1959
2293
  "text-anchor": "middle",
1960
- "font-size": an(t.edge, t.edge.centerText),
1961
- fill: on(t.edge, t.edge.centerText),
1962
- "font-family": "'SF Mono', monospace",
1963
- "font-weight": "600",
2294
+ "font-size": vn(t.edge, t.edge.centerText),
2295
+ fill: yn(t.edge, t.edge.centerText),
1964
2296
  opacity: "1"
1965
- }, h(Ma(t.edge.centerText)), 9, ot)], 8, it)) : n("", !0),
1966
- Na(t.edge.toText) ? (d(), r("g", {
2297
+ }, m(wo(t.edge.centerText)), 9, ft)], 8, ut)) : n("", !0),
2298
+ To(t.edge.toText) ? (d(), r("g", {
1967
2299
  key: 2,
1968
- transform: Ra(t.edge.toText, t.end, t.endAngle)
2300
+ transform: Ao(t.edge.toText, t.end, t.endAngle)
1969
2301
  }, [t.toPlate.show ? (d(), r("rect", {
1970
2302
  key: 0,
1971
2303
  x: -t.toBox.w / 2,
@@ -1979,51 +2311,89 @@ var b = {
1979
2311
  "stroke-width": "0.6",
1980
2312
  "stroke-opacity": t.toPlate.borderOpacity,
1981
2313
  "stroke-dasharray": t.toPlate.borderStyle === "dashed" ? "3 2" : void 0
1982
- }, null, 8, ct)) : n("", !0), i("text", {
2314
+ }, null, 8, mt)) : n("", !0), i("text", {
1983
2315
  y: "0",
1984
2316
  "dominant-baseline": "central",
1985
2317
  "text-anchor": "middle",
1986
- "font-size": an(t.edge, t.edge.toText),
1987
- fill: on(t.edge, t.edge.toText),
1988
- "font-family": "'SF Mono', monospace",
1989
- "font-weight": "500",
2318
+ "font-size": vn(t.edge, t.edge.toText),
2319
+ fill: yn(t.edge, t.edge.toText),
1990
2320
  opacity: "0.9"
1991
- }, h(Ma(t.edge.toText)), 9, lt)], 8, st)) : n("", !0)
2321
+ }, m(wo(t.edge.toText)), 9, ht)], 8, pt)) : n("", !0)
1992
2322
  ]))], 64))), 128)),
1993
- Y.value ? (d(), r("g", ut, [
2323
+ Y.value ? (d(), r("g", gt, [
1994
2324
  i("line", {
1995
2325
  x1: Y.value.ax,
1996
2326
  y1: Y.value.ay,
1997
- x2: da.value.x,
1998
- y2: da.value.y,
1999
- stroke: ua.value,
2327
+ x2: no.value.x,
2328
+ y2: no.value.y,
2329
+ stroke: to.value,
2000
2330
  "stroke-width": "2",
2001
2331
  "stroke-dasharray": "6 6",
2002
2332
  "stroke-linecap": "round",
2003
2333
  opacity: "0.9"
2004
- }, null, 8, dt),
2334
+ }, null, 8, _t),
2005
2335
  i("circle", {
2006
2336
  cx: Y.value.px,
2007
2337
  cy: Y.value.py,
2008
2338
  r: "3.5",
2009
- fill: ua.value,
2339
+ fill: to.value,
2010
2340
  opacity: "0.9"
2011
- }, null, 8, ft),
2012
- Y.value.overId && fa.value ? (d(), r("rect", {
2341
+ }, null, 8, vt),
2342
+ Y.value.overId && ro.value ? (d(), r("rect", {
2013
2343
  key: 0,
2014
- x: fa.value.x,
2015
- y: fa.value.y,
2016
- width: fa.value.w,
2017
- height: fa.value.h,
2344
+ x: ro.value.x,
2345
+ y: ro.value.y,
2346
+ width: ro.value.w,
2347
+ height: ro.value.h,
2018
2348
  rx: "6",
2019
2349
  fill: "none",
2020
- stroke: ua.value,
2350
+ stroke: to.value,
2021
2351
  "stroke-width": "1.5",
2022
2352
  "stroke-dasharray": "6 4",
2023
2353
  opacity: "0.9"
2024
- }, null, 8, pt)) : n("", !0)
2354
+ }, null, 8, yt)) : n("", !0)
2025
2355
  ])) : n("", !0),
2026
- (d(!0), r(e, null, p(G.value, (e) => (d(), r("path", {
2356
+ i("g", bt, [(d(!0), r(e, null, p(xi.value, (e) => (d(), r("g", {
2357
+ key: `region-hit-${e.id}`,
2358
+ transform: `translate(${e.x}, ${e.y})`,
2359
+ style: c({ cursor: ba.value ? "move" : "default" }),
2360
+ onMousedown: (t) => Sa(t, e),
2361
+ onClick: h((t) => Ta(e, t), ["stop"])
2362
+ }, [xa.value === "box" ? (d(), r("rect", {
2363
+ key: 0,
2364
+ class: "region-hit-area",
2365
+ x: F(e).x,
2366
+ y: F(e).y,
2367
+ width: F(e).width,
2368
+ height: F(e).height,
2369
+ rx: K(e),
2370
+ fill: "transparent",
2371
+ "pointer-events": "all"
2372
+ }, null, 8, St)) : (d(), r("rect", {
2373
+ key: 1,
2374
+ class: "region-hit-area region-hit-frame",
2375
+ x: F(e).x,
2376
+ y: F(e).y,
2377
+ width: F(e).width,
2378
+ height: F(e).height,
2379
+ rx: K(e),
2380
+ fill: "none",
2381
+ stroke: "transparent",
2382
+ "stroke-width": "14",
2383
+ "pointer-events": "stroke"
2384
+ }, null, 8, Ct)), Ur(e) && g.viewMode !== "3d" ? (d(), r("rect", {
2385
+ key: 2,
2386
+ x: F(e).x,
2387
+ y: F(e).y,
2388
+ width: F(e).width,
2389
+ height: F(e).height,
2390
+ rx: K(e),
2391
+ fill: "none",
2392
+ stroke: Jr.value,
2393
+ "stroke-width": "2.5",
2394
+ "pointer-events": "none"
2395
+ }, null, 8, wt)) : n("", !0)], 44, xt))), 128))]),
2396
+ (d(!0), r(e, null, p(U.value, (e) => (d(), r("path", {
2027
2397
  key: `hit-${e.id}`,
2028
2398
  d: $(e),
2029
2399
  fill: "none",
@@ -2033,232 +2403,232 @@ var b = {
2033
2403
  "pointer-events": "stroke",
2034
2404
  cursor: "pointer"
2035
2405
  },
2036
- onClick: g((t) => br(e, t), ["stop"])
2037
- }, null, 8, mt))), 128)),
2038
- (d(!0), r(e, null, p(Ir.value, (a) => (d(), r("g", {
2406
+ onClick: h((t) => ii(e, t), ["stop"])
2407
+ }, null, 8, Tt))), 128)),
2408
+ (d(!0), r(e, null, p(Si.value, (a) => (d(), r("g", {
2039
2409
  key: a.id,
2040
2410
  transform: `translate(${a.x}, ${a.y})`,
2041
- class: s(["topology-node", T.value === a.id ? "dragging" : ""]),
2042
- onMousedown: (e) => Oi(e, a.id),
2043
- onClick: (e) => pr(a, e),
2411
+ class: s(["topology-node", S.value === a.id ? "dragging" : ""]),
2412
+ onMousedown: (e) => pa(e, a.id),
2413
+ onClick: (e) => Zr(a, e),
2044
2414
  style: c({
2045
- cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
2046
- color: N(a)
2415
+ cursor: _.editable && _.config.nodeDraggable !== !1 ? "grab" : "default",
2416
+ color: j(a)
2047
2417
  })
2048
2418
  }, [
2049
- Bn(a) ? (d(), r("rect", {
2419
+ $n(a) ? (d(), r("rect", {
2050
2420
  key: 0,
2051
2421
  class: "node-hit-area node-hit-frame",
2052
- x: L(a).x,
2053
- y: L(a).y,
2054
- width: L(a).width,
2055
- height: L(a).height,
2056
- rx: Di(a),
2422
+ x: F(a).x,
2423
+ y: F(a).y,
2424
+ width: F(a).width,
2425
+ height: F(a).height,
2426
+ rx: K(a),
2057
2427
  fill: "none",
2058
2428
  stroke: "transparent",
2059
- "stroke-width": Math.max(Ti(a), 12),
2429
+ "stroke-width": Math.max(da(a), 12),
2060
2430
  "pointer-events": "stroke"
2061
- }, null, 8, gt)) : (d(), r("rect", {
2431
+ }, null, 8, Dt)) : (d(), r("rect", {
2062
2432
  key: 1,
2063
2433
  class: "node-hit-area",
2064
- x: nr(a).x,
2065
- y: nr(a).y,
2066
- width: nr(a).width,
2067
- height: nr(a).height,
2434
+ x: Br(a).x,
2435
+ y: Br(a).y,
2436
+ width: Br(a).width,
2437
+ height: Br(a).height,
2068
2438
  fill: "transparent",
2069
2439
  "pointer-events": "all"
2070
- }, null, 8, _t)),
2071
- !dr.value && ir(a) && _.viewMode !== "3d" ? (d(), r("rect", {
2440
+ }, null, 8, Ot)),
2441
+ !Yr.value && Hr(a) && g.viewMode !== "3d" ? (d(), r("rect", {
2072
2442
  key: 2,
2073
- x: L(a).x,
2074
- y: L(a).y,
2075
- width: L(a).width,
2076
- height: L(a).height,
2077
- rx: Di(a),
2078
- fill: ir(a),
2443
+ x: F(a).x,
2444
+ y: F(a).y,
2445
+ width: F(a).width,
2446
+ height: F(a).height,
2447
+ rx: K(a),
2448
+ fill: Hr(a),
2079
2449
  opacity: "0.15"
2080
- }, null, 8, vt)) : n("", !0),
2081
- !dr.value && R(a) && _.viewMode !== "3d" ? (d(), r("rect", {
2450
+ }, null, 8, kt)) : n("", !0),
2451
+ !Yr.value && I(a) && g.viewMode !== "3d" ? (d(), r("rect", {
2082
2452
  key: 3,
2083
- x: R(a).x,
2084
- y: R(a).y,
2085
- width: R(a).width,
2086
- height: R(a).height,
2087
- rx: Di(a),
2453
+ x: I(a).x,
2454
+ y: I(a).y,
2455
+ width: I(a).width,
2456
+ height: I(a).height,
2457
+ rx: K(a),
2088
2458
  fill: "none",
2089
- stroke: wi(a),
2090
- "stroke-width": Ti(a),
2091
- "stroke-dasharray": Ei(a),
2459
+ stroke: ua(a),
2460
+ "stroke-width": da(a),
2461
+ "stroke-dasharray": fa(a),
2092
2462
  opacity: "0.8"
2093
- }, null, 8, yt)) : n("", !0),
2094
- ar(a) && _.viewMode !== "3d" ? (d(), r("rect", {
2463
+ }, null, 8, At)) : n("", !0),
2464
+ Ur(a) && g.viewMode !== "3d" ? (d(), r("rect", {
2095
2465
  key: 4,
2096
- x: L(a).x,
2097
- y: L(a).y,
2098
- width: L(a).width,
2099
- height: L(a).height,
2100
- rx: Di(a),
2466
+ x: F(a).x,
2467
+ y: F(a).y,
2468
+ width: F(a).width,
2469
+ height: F(a).height,
2470
+ rx: K(a),
2101
2471
  fill: "none",
2102
- stroke: ur.value,
2472
+ stroke: Jr.value,
2103
2473
  "stroke-width": "2.5",
2104
2474
  transform: "scale(1.1)",
2105
2475
  style: { "pointer-events": "none" }
2106
- }, null, 8, bt)) : n("", !0),
2107
- zn(a) ? (d(), r("text", {
2476
+ }, null, 8, jt)) : n("", !0),
2477
+ Qn(a) ? (d(), r("text", {
2108
2478
  key: 5,
2109
2479
  y: "4",
2110
2480
  transform: `rotate(${a.rotation || 0} 0 4)`,
2111
2481
  "text-anchor": "middle",
2112
- fill: nn(a) || N(a) || Rn(a).color,
2113
- "font-size": tn(a, 12),
2114
- "font-family": "'SF Mono', monospace",
2115
- "font-weight": "600"
2482
+ fill: gn(a) || j(a) || Zn(a).color,
2483
+ "font-size": hn(a, 12)
2116
2484
  }, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
2117
2485
  key: t,
2118
2486
  x: "0",
2119
2487
  dy: t === 0 ? 0 : "1.2em"
2120
- }, h(e), 9, St))), 128))], 8, xt)) : Bn(a) ? (d(), r(e, { key: 6 }, [], 64)) : (d(), r(e, { key: 7 }, [
2121
- a.state !== "none" && Si.value ? (d(), r("circle", {
2488
+ }, m(e), 9, Nt))), 128))], 8, Mt)) : $n(a) ? (d(), r(e, { key: 6 }, [], 64)) : M(a) ? (d(), r(e, { key: 7 }, [], 64)) : (d(), r(e, { key: 8 }, [
2489
+ (d(!0), r(e, null, p(Pr(a), (e) => (d(), r("circle", {
2490
+ key: `alert-${a.id}-${e.key}`,
2491
+ r: e.r,
2492
+ fill: e.fill,
2493
+ stroke: e.stroke,
2494
+ "stroke-width": e.strokeWidth,
2495
+ opacity: e.opacity
2496
+ }, [e.rValues ? (d(), r("animate", {
2122
2497
  key: 0,
2123
- r: Zn(a),
2124
- fill: "none",
2125
- stroke: Rn(a).color,
2126
- "stroke-width": "2.5",
2127
- opacity: "0"
2128
- }, [i("animate", {
2129
2498
  attributeName: "r",
2130
- values: `${Zn(a)};${Zn(a) * 1.6};${Zn(a)}`,
2131
- dur: "2s",
2499
+ values: e.rValues,
2500
+ dur: e.dur,
2501
+ begin: e.begin,
2132
2502
  repeatCount: "indefinite"
2133
- }, null, 8, wt), o[6] ||= i("animate", {
2503
+ }, null, 8, Ft)) : n("", !0), i("animate", {
2134
2504
  attributeName: "opacity",
2135
- values: "0.4;0.05;0.4",
2136
- dur: "2s",
2505
+ values: e.opacityValues,
2506
+ keyTimes: e.keyTimes || void 0,
2507
+ dur: e.dur,
2508
+ begin: e.begin,
2137
2509
  repeatCount: "indefinite"
2138
- }, null, -1)], 8, Ct)) : n("", !0),
2139
- Hn(a) ? (d(), r("svg", {
2140
- key: 1,
2510
+ }, null, 8, It)], 8, Pt))), 128)),
2511
+ cr(a) ? (d(), r("svg", {
2512
+ key: 0,
2141
2513
  class: "node-icon",
2142
- x: L(a).x,
2143
- y: L(a).y,
2144
- width: L(a).width,
2145
- height: L(a).height,
2146
- viewBox: Gn,
2147
- preserveAspectRatio: Wn.value
2148
- }, [m(t.$slots, "node-icon", {
2514
+ x: F(a).x,
2515
+ y: F(a).y,
2516
+ width: F(a).width,
2517
+ height: F(a).height,
2518
+ viewBox: dr.value,
2519
+ preserveAspectRatio: ur.value
2520
+ }, [ee(t.$slots, "node-icon", {
2149
2521
  node: a,
2150
- color: N(a),
2151
- viewMode: _.viewMode,
2522
+ color: j(a),
2523
+ viewMode: g.viewMode,
2152
2524
  isImage: !0,
2153
- image: P(a),
2154
- fit: Un.value,
2155
- imageWidth: F(a).w,
2156
- imageHeight: F(a).h,
2157
- width: L(a).width,
2158
- height: L(a).height
2525
+ image: sr(a),
2526
+ fit: lr.value,
2527
+ imageWidth: hr(a).w,
2528
+ imageHeight: hr(a).h,
2529
+ width: F(a).width,
2530
+ height: F(a).height
2159
2531
  }, () => [i("image", {
2160
- href: P(a),
2161
- x: -F(a).w / 2,
2162
- y: -F(a).h / 2,
2163
- width: F(a).w,
2164
- height: F(a).h
2165
- }, null, 8, Et)])], 8, Tt)) : (d(), r("g", {
2166
- key: 2,
2532
+ href: sr(a),
2533
+ x: -hr(a).w / 2,
2534
+ y: -hr(a).h / 2,
2535
+ width: hr(a).w,
2536
+ height: hr(a).h
2537
+ }, null, 8, Rt)])], 8, Lt)) : (d(), r("g", {
2538
+ key: 1,
2167
2539
  class: "node-icon",
2168
- transform: Qn(a)
2169
- }, [m(t.$slots, "node-icon", {
2540
+ transform: Ir(a)
2541
+ }, [ee(t.$slots, "node-icon", {
2170
2542
  node: a,
2171
- color: N(a),
2172
- viewMode: _.viewMode,
2543
+ color: j(a),
2544
+ viewMode: g.viewMode,
2173
2545
  isImage: !1,
2174
- image: P(a),
2175
- fit: Un.value,
2176
- width: L(a).width,
2177
- height: L(a).height
2546
+ image: sr(a),
2547
+ fit: lr.value,
2548
+ width: F(a).width,
2549
+ height: F(a).height
2178
2550
  }, () => [i("rect", {
2179
2551
  x: "-18",
2180
2552
  y: "-18",
2181
2553
  width: "36",
2182
2554
  height: "36",
2183
2555
  rx: "6",
2184
- fill: N(a),
2556
+ fill: j(a),
2185
2557
  opacity: "0.9"
2186
- }, null, 8, Ot)])], 8, Dt)),
2187
- vi.value ? (d(), r("g", {
2188
- key: 3,
2189
- transform: $n(a)
2558
+ }, null, 8, Bt)])], 8, zt)),
2559
+ ia.value ? (d(), r("g", {
2560
+ key: 2,
2561
+ transform: Lr(a)
2190
2562
  }, [i("circle", {
2191
2563
  r: "4",
2192
- fill: Rn(a).color,
2564
+ fill: Zn(a).color,
2193
2565
  stroke: "#0a0e1a",
2194
2566
  "stroke-width": "2"
2195
- }, null, 8, At)], 8, kt)) : n("", !0),
2567
+ }, null, 8, Ht)], 8, Vt)) : n("", !0),
2196
2568
  i("text", {
2197
- y: tr(a),
2198
- transform: `rotate(${a.rotation || 0} 0 ${tr(a)})`,
2569
+ y: zr(a),
2570
+ transform: `rotate(${a.rotation || 0} 0 ${zr(a)})`,
2199
2571
  "text-anchor": "middle",
2200
- fill: nn(a),
2201
- "font-size": tn(a),
2202
- "font-weight": rn(a),
2203
- "font-family": "'Segoe UI', system-ui, sans-serif",
2572
+ fill: gn(a),
2573
+ "font-size": hn(a),
2574
+ "font-weight": _n(a),
2204
2575
  opacity: "0.9"
2205
2576
  }, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
2206
2577
  key: t,
2207
2578
  x: "0",
2208
2579
  dy: t === 0 ? 0 : "1.2em"
2209
- }, h(e), 9, Mt))), 128))], 8, jt)
2580
+ }, m(e), 9, Wt))), 128))], 8, Ut)
2210
2581
  ], 64)),
2211
- _i.value ? (d(), r("g", Nt, [(d(!0), r(e, null, p(Ui(a), (e) => (d(), r("circle", {
2582
+ ra.value && !M(a) ? (d(), r("g", Gt, [(d(!0), r(e, null, p(Pa(a), (e) => (d(), r("circle", {
2212
2583
  key: e.side,
2213
2584
  cx: e.x,
2214
2585
  cy: e.y,
2215
2586
  r: "4.5",
2216
2587
  class: "node-handle",
2217
2588
  fill: "#0a0e1a",
2218
- stroke: N(a),
2589
+ stroke: j(a),
2219
2590
  "stroke-width": "1.5",
2220
- onPointerdown: g((t) => Ki(t, a.id, e), ["stop", "prevent"]),
2221
- onPointermove: g(ta, ["stop"]),
2222
- onPointerup: g(na, ["stop"]),
2223
- onPointercancel: g(na, ["stop"]),
2224
- onLostpointercapture: na,
2225
- onMousedown: o[0] ||= g(() => {}, ["stop", "prevent"]),
2226
- onClick: o[1] ||= g(() => {}, ["stop"])
2227
- }, null, 40, Pt))), 128))])) : n("", !0)
2228
- ], 46, ht))), 128)),
2229
- Hi.value ? (d(), r("g", Ft, [(d(!0), r(e, null, p(Ii(Hi.value), (e) => (d(), r("rect", {
2591
+ onPointerdown: h((t) => La(t, a.id, e), ["stop", "prevent"]),
2592
+ onPointermove: h(Ka, ["stop"]),
2593
+ onPointerup: h(qa, ["stop"]),
2594
+ onPointercancel: h(qa, ["stop"]),
2595
+ onLostpointercapture: qa,
2596
+ onMousedown: o[0] ||= h(() => {}, ["stop", "prevent"]),
2597
+ onClick: o[1] ||= h(() => {}, ["stop"])
2598
+ }, null, 40, Kt))), 128))])) : n("", !0)
2599
+ ], 46, Et))), 128)),
2600
+ Na.value ? (d(), r("g", qt, [(d(!0), r(e, null, p(Da(Na.value), (e) => (d(), r("rect", {
2230
2601
  key: e.side,
2231
- x: Hi.value.x + e.x - 4.5,
2232
- y: Hi.value.y + e.y - 4.5,
2602
+ x: Na.value.x + e.x - 4.5,
2603
+ y: Na.value.y + e.y - 4.5,
2233
2604
  width: "9",
2234
2605
  height: "9",
2235
2606
  rx: "2",
2236
2607
  class: s(["node-resize-handle", `rt-${e.side}`]),
2237
- onMousedown: g((t) => Ri(t, Hi.value, e.side), ["stop", "prevent"]),
2238
- onClick: o[2] ||= g(() => {}, ["stop"])
2239
- }, null, 42, It))), 128))])) : n("", !0),
2240
- fr.value ? (d(!0), r(e, { key: 5 }, p(G.value, (t) => (d(), r(e, { key: `front-${t.id}` }, [or(t) ? (d(), r("g", Lt, [i("path", {
2608
+ onMousedown: h((t) => ka(t, Na.value, e.side), ["stop", "prevent"]),
2609
+ onClick: o[2] ||= h(() => {}, ["stop"])
2610
+ }, null, 42, Jt))), 128))])) : n("", !0),
2611
+ Xr.value ? (d(!0), r(e, { key: 5 }, p(U.value, (t) => (d(), r(e, { key: `front-${t.id}` }, [Wr(t) ? (d(), r("g", Yt, [i("path", {
2241
2612
  d: $(t),
2242
2613
  fill: "none",
2243
2614
  stroke: Q(t),
2244
2615
  "stroke-width": "2.5",
2245
2616
  "stroke-linecap": "round",
2246
- "marker-end": _a(t)
2247
- }, null, 8, Rt)])) : n("", !0)], 64))), 128)) : n("", !0),
2248
- q.value ? (d(), r("rect", {
2617
+ "marker-end": co(t)
2618
+ }, null, 8, Xt)])) : n("", !0)], 64))), 128)) : n("", !0),
2619
+ G.value ? (d(), r("rect", {
2249
2620
  key: 6,
2250
2621
  class: "marquee-box",
2251
- x: Ur.value.x,
2252
- y: Ur.value.y,
2253
- width: Ur.value.width,
2254
- height: Ur.value.height,
2622
+ x: ki.value.x,
2623
+ y: ki.value.y,
2624
+ width: ki.value.width,
2625
+ height: ki.value.height,
2255
2626
  rx: "2",
2256
2627
  "vector-effect": "non-scaling-stroke"
2257
- }, null, 8, zt)) : n("", !0)
2258
- ], 44, se));
2628
+ }, null, 8, Zt)) : n("", !0)
2629
+ ], 44, ce));
2259
2630
  }
2260
- }, $t = { install(e) {
2261
- e.component("Topology", Qt);
2631
+ }, pn = { install(e) {
2632
+ e.component("Topology", fn);
2262
2633
  } };
2263
- //#endregion
2264
- export { Qt as Topology, $t as default, oe as nodeColors, b as nodeStates };
2634
+ export { fn as Topology, pn as default, se as nodeColors, y as nodeStates };