vue3-network-graph 0.1.2 → 0.1.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
@@ -190,12 +190,14 @@ var b = {
190
190
  "y",
191
191
  "width",
192
192
  "height",
193
+ "rx",
193
194
  "fill"
194
195
  ], ut = [
195
196
  "x",
196
197
  "y",
197
198
  "width",
198
199
  "height",
200
+ "rx",
199
201
  "stroke",
200
202
  "stroke-width",
201
203
  "stroke-dasharray"
@@ -204,6 +206,7 @@ var b = {
204
206
  "y",
205
207
  "width",
206
208
  "height",
209
+ "rx",
207
210
  "stroke"
208
211
  ], ft = ["fill"], pt = [
209
212
  "transform",
@@ -235,7 +238,7 @@ var b = {
235
238
  "y",
236
239
  "width",
237
240
  "height"
238
- ], Dt = 6, Ot = 14, kt = 3, At = 60, jt = .2, Mt = 5, Nt = 160, Pt = 140, Ft = 12, It = 4e3, Lt = 12, Rt = 4e3, zt = {
241
+ ], Dt = 6, Ot = 14, kt = 3, x = 60, At = .2, jt = 5, Mt = 160, Nt = 140, Pt = 12, Ft = 4e3, It = 12, Lt = 4e3, Rt = {
239
242
  __name: "Topology",
240
243
  props: {
241
244
  nodes: {
@@ -293,9 +296,9 @@ var b = {
293
296
  "node-resize-end"
294
297
  ],
295
298
  setup(_, { expose: te, emit: ne }) {
296
- let v = _, y = ne, zt = 0, Bt = () => {
297
- zt++;
298
- }, x = (e) => e && typeof e == "object" ? {
299
+ let v = _, y = ne, Rt = 0, zt = () => {
300
+ Rt++;
301
+ }, S = (e) => e && typeof e == "object" ? {
299
302
  text: e.text,
300
303
  rotation: e.rotation || 0,
301
304
  fontSize: e.fontSize,
@@ -305,28 +308,28 @@ var b = {
305
308
  rotation: 0,
306
309
  fontSize: void 0,
307
310
  color: void 0
308
- }, Vt = (e, t = 11) => e.fontSize || t, Ht = (e) => e.fontColor || "#000000", Ut = (e, t = 500) => e.fontWeight || t, S = (e, t) => e.fontSize || x(t).fontSize || 8, C = (e, t) => e.fontColor || x(t).color || "#000000", w = d(v.nodes.map((e) => ({ ...e }))), Wt = null, T = () => {
309
- Wt = w.value, y("update:nodes", w.value);
311
+ }, Bt = (e, t = 11) => e.fontSize || t, Vt = (e) => e.fontColor || "#000000", Ht = (e, t = 500) => e.fontWeight || t, C = (e, t) => e.fontSize || S(t).fontSize || 8, w = (e, t) => e.fontColor || S(t).color || "#000000", T = d(v.nodes.map((e) => ({ ...e }))), Ut = null, E = () => {
312
+ Ut = T.value, y("update:nodes", T.value);
310
313
  };
311
314
  h(() => v.nodes, (e) => {
312
315
  let t = Array.isArray(e) ? e : [];
313
- if (t === Wt) return;
316
+ if (t === Ut) return;
314
317
  let n = null, r = null;
315
318
  try {
316
- n = JSON.stringify(t), r = JSON.stringify(w.value);
319
+ n = JSON.stringify(t), r = JSON.stringify(T.value);
317
320
  } catch {
318
321
  n = null;
319
322
  }
320
- (n === null || n !== r) && (Bt(), w.value = t.map((e) => ({ ...e })));
323
+ (n === null || n !== r) && (zt(), T.value = t.map((e) => ({ ...e })));
321
324
  }, { deep: !0 });
322
- let Gt = d(v.lineMode);
325
+ let Wt = d(v.lineMode);
323
326
  h(() => v.lineMode, (e) => {
324
- Gt.value = e;
327
+ Wt.value = e;
325
328
  });
326
- let E = t({
327
- get: () => Gt.value,
329
+ let Gt = t({
330
+ get: () => Wt.value,
328
331
  set: (e) => {
329
- Gt.value = e, y("update:lineMode", e);
332
+ Wt.value = e, y("update:lineMode", e);
330
333
  }
331
334
  }), D = d(null), O = d(null), Kt = d({
332
335
  x: 0,
@@ -342,13 +345,13 @@ var b = {
342
345
  ...e,
343
346
  ...r.get(e.id)
344
347
  } : e));
345
- let i = new Set(w.value.map((e) => e.id)), a = j.value;
348
+ let i = new Set(T.value.map((e) => e.id)), a = j.value;
346
349
  return n.filter((e) => !a.has(e.id) && i.has(e.from) && i.has(e.to));
347
350
  }), Zt = t(() => v.config.watchDataChanges === !0), Qt = d({
348
351
  nodes: [],
349
352
  edges: []
350
353
  }), $t = "", N = null, en = () => JSON.parse(JSON.stringify({
351
- nodes: w.value,
354
+ nodes: T.value,
352
355
  edges: M.value
353
356
  })), tn = (e, t) => {
354
357
  let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e]));
@@ -376,7 +379,7 @@ var b = {
376
379
  N &&= (clearTimeout(N), null), Qt.value = en(), $t = "";
377
380
  };
378
381
  h([
379
- w,
382
+ T,
380
383
  k,
381
384
  j,
382
385
  A
@@ -386,23 +389,23 @@ var b = {
386
389
  Zt.value && on();
387
390
  });
388
391
  let sn = () => en(), cn = () => {
389
- let e = new Set(R.value), t = new Set(z.value), n = w.value.filter((t) => e.has(t.id)), r = M.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to));
392
+ let e = new Set(z.value), t = new Set(B.value), n = T.value.filter((t) => e.has(t.id)), r = M.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to));
390
393
  return !n.length && !r.length ? {
391
394
  nodes: [],
392
395
  edges: []
393
- } : (n.length && (w.value = w.value.filter((t) => !e.has(t.id)), T()), r.length && (j.value = /* @__PURE__ */ new Set([...j.value, ...r.map((e) => e.id)]), k.value = k.value.filter((e) => !j.value.has(e.id)), y("edge-remove", r.map((e) => JSON.parse(JSON.stringify(e))))), R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B(), JSON.parse(JSON.stringify({
396
+ } : (n.length && (T.value = T.value.filter((t) => !e.has(t.id)), E()), r.length && (j.value = /* @__PURE__ */ new Set([...j.value, ...r.map((e) => e.id)]), k.value = k.value.filter((e) => !j.value.has(e.id)), y("edge-remove", r.map((e) => JSON.parse(JSON.stringify(e))))), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), JSON.parse(JSON.stringify({
394
397
  nodes: n,
395
398
  edges: r
396
399
  })));
397
400
  }, ln = (e) => {
398
- let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(w.value.map((e) => e.id)), r = [];
401
+ let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(T.value.map((e) => e.id)), r = [];
399
402
  for (let e of t) {
400
403
  let t = JSON.parse(JSON.stringify(e));
401
404
  if (t.id == null) t.id = re();
402
405
  else if (n.has(t.id)) continue;
403
406
  n.add(t.id), r.push(t);
404
407
  }
405
- return r.length ? (w.value = [...w.value, ...r], T(), JSON.parse(JSON.stringify(r))) : [];
408
+ return r.length ? (T.value = [...T.value, ...r], E(), JSON.parse(JSON.stringify(r))) : [];
406
409
  }, un = (e) => {
407
410
  let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(M.value.map((e) => e.id)), r = [];
408
411
  for (let e of t) {
@@ -433,7 +436,7 @@ var b = {
433
436
  });
434
437
  }
435
438
  let r = [];
436
- return w.value = w.value.map((e) => {
439
+ return T.value = T.value.map((e) => {
437
440
  let t = n.get(e.id);
438
441
  if (!t) return e;
439
442
  let i = {
@@ -441,7 +444,7 @@ var b = {
441
444
  ...t
442
445
  };
443
446
  return r.push(i), i;
444
- }), r.length ? (T(), JSON.parse(JSON.stringify(r))) : [];
447
+ }), r.length ? (E(), JSON.parse(JSON.stringify(r))) : [];
445
448
  }, fn = (e) => {
446
449
  let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
447
450
  if (!t.length) return [];
@@ -465,10 +468,10 @@ var b = {
465
468
  return i.length ? (A.value = r, y("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
466
469
  }, pn = (e) => {
467
470
  let t = e && typeof e == "object" ? e : null;
468
- return k.value = [], j.value = /* @__PURE__ */ new Set(), A.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (w.value = JSON.parse(JSON.stringify(t.nodes)), T()) : (w.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Wt = w.value), R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B(), on(), en();
471
+ return k.value = [], j.value = /* @__PURE__ */ new Set(), A.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (T.value = JSON.parse(JSON.stringify(t.nodes)), E()) : (T.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Ut = T.value), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), on(), en();
469
472
  };
470
473
  h(() => v.edges, (e) => {
471
- Bt();
474
+ zt();
472
475
  let t = Array.isArray(e) ? e : [], n = new Set(t.map((e) => e.id));
473
476
  if (k.value.length) {
474
477
  let e = k.value.filter((e) => !n.has(e.id));
@@ -483,7 +486,7 @@ var b = {
483
486
  r && (A.value = e);
484
487
  }
485
488
  }, { deep: !0 });
486
- let mn = t(() => {
489
+ let P = t(() => {
487
490
  let e = {};
488
491
  M.value.forEach((t) => {
489
492
  let n = [t.from, t.to].sort().join("__");
@@ -521,32 +524,36 @@ var b = {
521
524
  };
522
525
  });
523
526
  }), t;
524
- }), hn = t(() => {
527
+ }), mn = t(() => {
525
528
  let e = /* @__PURE__ */ new Map();
526
- for (let t of w.value) e.set(t.id, t);
529
+ for (let t of T.value) e.set(t.id, t);
527
530
  return e;
528
- }), P = (e) => hn.value.get(e), F = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", gn = (e) => b[e.state] || b.normal, _n = (e) => e.type === "text", vn = (e, t) => {
531
+ }), F = (e) => mn.value.get(e), I = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", hn = (e) => b[e.state] || b.normal, gn = (e) => e.type === "text", _n = (e, t) => {
529
532
  let n = Number(e);
530
533
  return Number.isFinite(n) && n > 0 ? n : t;
531
- }, yn = (e) => {
532
- let t = vn(e.width, At), n = vn(e.height, At);
534
+ }, vn = (e) => {
535
+ let t = _n(e.width, x), n = _n(e.height, x);
533
536
  return {
534
- sx: t / At,
535
- sy: n / At
537
+ sx: t / x,
538
+ sy: n / x
536
539
  };
537
- }, bn = (e) => {
538
- let { sx: t, sy: n } = yn(e);
540
+ }, yn = (e) => {
541
+ let { sx: t, sy: n } = vn(e);
539
542
  return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
540
- }, xn = (e) => {
541
- let { w: t, h: n } = I(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
543
+ }, bn = (e) => {
544
+ let { w: t, h: n } = L(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
542
545
  return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
543
- }, Sn = (e) => {
544
- let { sy: t } = yn(e);
545
- return Math.round(48 * t);
546
- }, Cn = (e) => _n(e) ? 4 : e.labelPosition === "top" ? -30 : e.labelPosition === "center" ? 0 : Sn(e), wn = (e) => {
547
- let t = L(e);
548
- if (_n(e) || !e.label) return t;
549
- let n = Vt(e), r = Cn(e);
546
+ }, xn = t(() => {
547
+ let e = Number(v.config.labelGap);
548
+ return Number.isFinite(e) && e >= 0 ? e : 18;
549
+ }), Sn = (e) => {
550
+ if (gn(e)) return 4;
551
+ let { h: t } = L(e);
552
+ return e.labelPosition === "top" ? -(t / 2 + xn.value) : e.labelPosition === "center" ? 0 : t / 2 + xn.value;
553
+ }, Cn = (e) => {
554
+ let t = R(e);
555
+ if (gn(e) || !e.label) return t;
556
+ let n = Bt(e), r = Sn(e);
550
557
  if (e.labelPosition === "top") {
551
558
  let e = r - n - 4;
552
559
  e < t.y && (t.height += t.y - e, t.y = e);
@@ -555,123 +562,123 @@ var b = {
555
562
  i > t.y + t.height && (t.height = i - t.y);
556
563
  }
557
564
  return t;
558
- }, Tn = (e) => e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0, I = (e) => {
559
- let t = _n(e);
565
+ }, wn = (e) => e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0, L = (e) => {
566
+ let t = gn(e);
560
567
  return {
561
- w: vn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : At),
562
- h: vn(e.height, t ? 26 : At)
568
+ w: _n(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : x),
569
+ h: _n(e.height, t ? 26 : x)
563
570
  };
564
- }, L = (e) => {
565
- let { w: t, h: n } = I(e);
571
+ }, R = (e) => {
572
+ let { w: t, h: n } = L(e);
566
573
  return {
567
574
  x: -t / 2,
568
575
  y: -n / 2,
569
576
  width: t,
570
577
  height: n
571
578
  };
572
- }, En = (e) => Tn(e) ? L(e) : null, Dn = (e) => e.background && e.background !== "none" ? e.background : null, R = d([]), z = d([]);
573
- t(() => R.value.length === 1 ? R.value[0] : null), t(() => z.value.length === 1 ? z.value[0] : null);
574
- let On = (e) => R.value.includes(e.id), kn = (e) => z.value.includes(e.id), B = () => {
579
+ }, Tn = (e) => wn(e) ? R(e) : null, En = (e) => e.background && e.background !== "none" ? e.background : null, z = d([]), B = d([]);
580
+ t(() => z.value.length === 1 ? z.value[0] : null), t(() => B.value.length === 1 ? B.value[0] : null);
581
+ let Dn = (e) => z.value.includes(e.id), On = (e) => B.value.includes(e.id), V = () => {
575
582
  y("selection-change", {
576
- nodes: w.value.filter((e) => R.value.includes(e.id)),
577
- edges: M.value.filter((e) => z.value.includes(e.id))
583
+ nodes: T.value.filter((e) => z.value.includes(e.id)),
584
+ edges: M.value.filter((e) => B.value.includes(e.id))
578
585
  });
579
- }, An = (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, jn = t(() => An(v.config.maxSelectNodes)), Mn = t(() => An(v.config.maxSelectEdges)), V = (e, t, n) => {
586
+ }, kn = (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, An = t(() => kn(v.config.maxSelectNodes)), jn = t(() => kn(v.config.maxSelectEdges)), H = (e, t, n) => {
580
587
  let r = new Set(e), i = [];
581
588
  for (let e of t) r.has(e) || (r.add(e), i.push(e));
582
589
  if (n === Infinity) return [...e, ...i];
583
590
  let a = Math.max(0, n - e.length);
584
591
  return [...e, ...i.slice(0, a)];
585
592
  };
586
- h([jn, Mn], ([e, t]) => {
593
+ h([An, jn], ([e, t]) => {
587
594
  let n = !1;
588
- R.value.length > e && (R.value = R.value.slice(0, e), n = !0), z.value.length > t && (z.value = z.value.slice(0, t), n = !0), n && B();
595
+ 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();
589
596
  });
590
- let Nn = t(() => v.config.selectedBorderColor || "#fbbf24"), Pn = (e, t) => {
591
- if (!zn()) {
597
+ let Mn = t(() => v.config.selectedBorderColor || "#fbbf24"), Nn = (e, t) => {
598
+ if (!Rn()) {
592
599
  if (t && (t.ctrlKey || t.metaKey)) {
593
- let t = R.value.indexOf(e.id);
594
- t >= 0 ? R.value.splice(t, 1) : R.value = V(R.value, [e.id], jn.value);
600
+ let t = z.value.indexOf(e.id);
601
+ t >= 0 ? z.value.splice(t, 1) : z.value = H(z.value, [e.id], An.value);
595
602
  } else {
596
- let t = R.value.length === 1 && R.value[0] === e.id;
597
- R.value = t ? [] : V([], [e.id], jn.value), z.value = [];
603
+ let t = z.value.length === 1 && z.value[0] === e.id;
604
+ z.value = t ? [] : H([], [e.id], An.value), B.value = [];
598
605
  }
599
- y("node-click", e), y("node-select", On(e) ? e : null), B();
606
+ y("node-click", e), y("node-select", Dn(e) ? e : null), V();
600
607
  }
601
- }, Fn = t(() => v.config.selectedLineColor || "#fbbf24"), In = (e, t) => {
602
- if (zn()) return;
603
- let n = mn.value[e.id], r = !!(n && n.merged && n.representative), i = r ? M.value.filter((e) => {
604
- let t = mn.value[e.id];
608
+ }, Pn = t(() => v.config.selectedLineColor || "#fbbf24"), Fn = (e, t) => {
609
+ if (Rn()) return;
610
+ let n = P.value[e.id], r = !!(n && n.merged && n.representative), i = r ? M.value.filter((e) => {
611
+ let t = P.value[e.id];
605
612
  return t && t.key === n.key;
606
613
  }) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
607
614
  ...e,
608
615
  bundleEdges: i
609
616
  } : e;
610
- if (t && (t.ctrlKey || t.metaKey)) a.every((e) => z.value.includes(e)) ? z.value = z.value.filter((e) => !a.includes(e)) : z.value = V(z.value, a, Mn.value);
617
+ 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, jn.value);
611
618
  else {
612
- let e = a.length === z.value.length && a.every((e) => z.value.includes(e));
613
- z.value = e ? [] : V([], a, Mn.value), R.value = [];
619
+ let e = a.length === B.value.length && a.every((e) => B.value.includes(e));
620
+ B.value = e ? [] : H([], a, jn.value), z.value = [];
614
621
  }
615
- y("edge-select", kn(e) ? o : null), B();
616
- }, Ln = 0, Rn = (e = 200) => {
617
- Ln = performance.now() + e;
618
- }, zn = () => performance.now() < Ln, Bn = () => {
619
- R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B();
620
- }, Vn = (e) => {
621
- if (zn()) return;
622
+ y("edge-select", On(e) ? o : null), V();
623
+ }, In = 0, Ln = (e = 200) => {
624
+ In = performance.now() + e;
625
+ }, Rn = () => performance.now() < In, zn = () => {
626
+ z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V();
627
+ }, Bn = (e) => {
628
+ if (Rn()) return;
622
629
  let t = e.target;
623
- t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || Bn();
624
- }, Hn = d({
630
+ t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || zn();
631
+ }, Vn = d({
625
632
  width: 1e3,
626
633
  height: 650
627
- }), Un = d(1), Wn = d(0), Gn = d(0), Kn = t(() => -Jn.value / 2 + Wn.value), qn = t(() => -Yn.value / 2 + Gn.value), Jn = t(() => v.width ?? Hn.value.width), Yn = t(() => v.height ?? Hn.value.height), Xn = null;
634
+ }), Hn = d(1), Un = d(0), Wn = d(0), Gn = t(() => -qn.value / 2 + Un.value), Kn = t(() => -Jn.value / 2 + Wn.value), qn = t(() => v.width ?? Vn.value.width), Jn = t(() => v.height ?? Vn.value.height), Yn = null;
628
635
  l(() => {
629
636
  let e = O.value;
630
637
  if (e) {
631
638
  let t = e.getBoundingClientRect();
632
- t.width > 0 && t.height > 0 && (Hn.value = {
639
+ t.width > 0 && t.height > 0 && (Vn.value = {
633
640
  width: t.width,
634
641
  height: t.height
635
642
  });
636
643
  }
637
- e && typeof ResizeObserver < "u" && (Xn = new ResizeObserver(() => {
644
+ e && typeof ResizeObserver < "u" && (Yn = new ResizeObserver(() => {
638
645
  let t = e.getBoundingClientRect();
639
- t.width > 0 && t.height > 0 && (Hn.value = {
646
+ t.width > 0 && t.height > 0 && (Vn.value = {
640
647
  width: t.width,
641
648
  height: t.height
642
649
  });
643
- }), Xn.observe(e));
650
+ }), Yn.observe(e));
644
651
  }), c(() => {
645
- Xn &&= (Xn.disconnect(), null), Lr &&= (cancelAnimationFrame(Lr), 0), q &&= (cancelAnimationFrame(q), 0), Z &&= (cancelAnimationFrame(Z), 0), si(), hr();
652
+ Yn &&= (Yn.disconnect(), null), Lr &&= (cancelAnimationFrame(Lr), 0), J &&= (cancelAnimationFrame(J), 0), ti &&= (cancelAnimationFrame(ti), 0), ci(), mr();
646
653
  });
647
- let H = t(() => Jn.value / Un.value), U = t(() => Yn.value / Un.value), Zn = t(() => ({
648
- x0: Kn.value - Nt,
649
- y0: qn.value - Nt,
650
- x1: Kn.value + H.value + Nt,
651
- y1: qn.value + U.value + Nt
652
- })), Qn = t(() => {
653
- let e = Zn.value;
654
- return w.value.filter((t) => {
655
- let { w: n, h: r } = I(t);
654
+ let U = t(() => qn.value / Hn.value), W = t(() => Jn.value / Hn.value), Xn = t(() => ({
655
+ x0: Gn.value - Mt,
656
+ y0: Kn.value - Mt,
657
+ x1: Gn.value + U.value + Mt,
658
+ y1: Kn.value + W.value + Mt
659
+ })), Zn = t(() => {
660
+ let e = Xn.value;
661
+ return T.value.filter((t) => {
662
+ let { w: n, h: r } = L(t);
656
663
  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;
657
664
  });
658
- }), W = t(() => {
659
- let e = Zn.value;
665
+ }), G = t(() => {
666
+ let e = Xn.value;
660
667
  return M.value.filter((t) => {
661
- if (!Ci(t)) return !1;
662
- let n = P(t.from), r = P(t.to);
668
+ if (!wi(t)) return !1;
669
+ let n = F(t.from), r = F(t.to);
663
670
  if (!n || !r) return !1;
664
- let i = I(n).w / 2, a = I(n).h / 2, o = I(r).w / 2, s = I(r).h / 2;
665
- return Math.min(n.x - i, r.x - o) - Pt <= e.x1 && Math.max(n.x + i, r.x + o) + Pt >= e.x0 && Math.min(n.y - a, r.y - s) - Pt <= e.y1 && Math.max(n.y + a, r.y + s) + Pt >= e.y0;
671
+ let i = L(n).w / 2, a = L(n).h / 2, o = L(r).w / 2, s = L(r).h / 2;
672
+ return Math.min(n.x - i, r.x - o) - Nt <= e.x1 && Math.max(n.x + i, r.x + o) + Nt >= e.x0 && Math.min(n.y - a, r.y - s) - Nt <= e.y1 && Math.max(n.y + a, r.y + s) + Nt >= e.y0;
666
673
  });
667
- }), $n = (e) => {
674
+ }), Qn = (e) => {
668
675
  if (v.config.enableZoom === !1) return;
669
676
  e.preventDefault();
670
- let t = O.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = H.value, s = U.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(Mt, Math.max(jt, Un.value * c)), u = Jn.value / l, d = Yn.value / l;
671
- Wn.value += (o - u) * i, Gn.value += (s - d) * a, Un.value = l;
672
- }, G = d(null), K = d(null), er = (e) => {
677
+ let t = O.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(jt, Math.max(At, Hn.value * c)), u = qn.value / l, d = Jn.value / l;
678
+ Un.value += (o - u) * i, Wn.value += (s - d) * a, Hn.value = l;
679
+ }, K = d(null), q = d(null), $n = (e) => {
673
680
  let t = O.value, n = t ? t.getBoundingClientRect() : null;
674
- G.value = {
681
+ K.value = {
675
682
  startX: e.clientX,
676
683
  startY: e.clientY,
677
684
  lastX: e.clientX,
@@ -679,9 +686,9 @@ var b = {
679
686
  moved: !1,
680
687
  rectWidth: n && n.width ? n.width : 0,
681
688
  rectHeight: n && n.height ? n.height : 0
682
- }, mr();
683
- }, tr = (e) => {
684
- let t = G.value, n = O.value;
689
+ }, pr();
690
+ }, er = (e) => {
691
+ let t = K.value, n = O.value;
685
692
  if (!t || !n) return;
686
693
  let r = t.rectWidth, i = t.rectHeight;
687
694
  if (!r || !i) return;
@@ -691,13 +698,13 @@ var b = {
691
698
  return;
692
699
  }
693
700
  let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
694
- t.lastX = e.clientX, t.lastY = e.clientY, Wn.value -= a * (H.value / r), Gn.value -= o * (U.value / i);
695
- }, nr = () => {
696
- let e = G.value;
697
- G.value = null, e && e.moved && Rn(), gr();
698
- }, rr = (e) => {
699
- let t = X(e);
700
- K.value = {
701
+ t.lastX = e.clientX, t.lastY = e.clientY, Un.value -= a * (U.value / r), Wn.value -= o * (W.value / i);
702
+ }, tr = () => {
703
+ let e = K.value;
704
+ K.value = null, e && e.moved && Ln(), hr();
705
+ }, nr = (e) => {
706
+ let t = Z(e);
707
+ q.value = {
701
708
  start: {
702
709
  x: t.x,
703
710
  y: t.y
@@ -709,17 +716,17 @@ var b = {
709
716
  startClientX: e.clientX,
710
717
  startClientY: e.clientY,
711
718
  moved: !1
712
- }, mr();
713
- }, ir = (e) => {
714
- let t = K.value;
719
+ }, pr();
720
+ }, rr = (e) => {
721
+ let t = q.value;
715
722
  if (!t) return;
716
- let n = X(e);
723
+ let n = Z(e);
717
724
  t.current = {
718
725
  x: n.x,
719
726
  y: n.y
720
727
  }, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
721
- }, ar = t(() => {
722
- let e = K.value;
728
+ }, ir = t(() => {
729
+ let e = q.value;
723
730
  return e ? {
724
731
  x: Math.min(e.start.x, e.current.x),
725
732
  y: Math.min(e.start.y, e.current.y),
@@ -731,62 +738,62 @@ var b = {
731
738
  width: 0,
732
739
  height: 0
733
740
  };
734
- }), or = () => {
735
- let e = K.value;
736
- if (K.value = null, e && e.moved) {
741
+ }), ar = () => {
742
+ let e = q.value;
743
+ if (q.value = null, e && e.moved) {
737
744
  let t = {
738
745
  x: Math.min(e.start.x, e.current.x),
739
746
  y: Math.min(e.start.y, e.current.y),
740
747
  w: Math.abs(e.current.x - e.start.x),
741
748
  h: Math.abs(e.current.y - e.start.y)
742
- }, n = w.value.filter((e) => {
743
- let n = L(e), r = e.x + n.x, i = e.y + n.y;
749
+ }, n = T.value.filter((e) => {
750
+ let n = R(e), r = e.x + n.x, i = e.y + n.y;
744
751
  return !(r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h);
745
752
  });
746
- n.length && (R.value = V(R.value, n.map((e) => e.id), jn.value), B()), Rn();
753
+ n.length && (z.value = H(z.value, n.map((e) => e.id), An.value), V()), Ln();
747
754
  }
748
- gr();
749
- }, sr = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), cr = (e) => {
755
+ hr();
756
+ }, or = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), sr = (e) => {
750
757
  if (O.value) {
751
758
  if (e.button === 1) {
752
759
  if (v.config.enablePan === !1) return;
753
- e.preventDefault(), er(e);
760
+ e.preventDefault(), $n(e);
754
761
  return;
755
762
  }
756
- if (e.button === 0 && !sr(e.target)) {
763
+ if (e.button === 0 && !or(e.target)) {
757
764
  if (e.ctrlKey || e.metaKey) {
758
765
  if (v.config.enableMarquee === !1) return;
759
- e.preventDefault(), rr(e);
766
+ e.preventDefault(), nr(e);
760
767
  return;
761
768
  }
762
- v.config.enablePan !== !1 && (e.preventDefault(), er(e));
769
+ v.config.enablePan !== !1 && (e.preventDefault(), $n(e));
763
770
  }
764
771
  }
765
- }, lr = !1, q = 0, ur = null, dr = () => {
766
- q = 0;
767
- let e = ur;
768
- ur = null, e && (G.value ? tr(e) : K.value && ir(e));
769
- }, fr = (e) => {
770
- ur = e, q ||= requestAnimationFrame(dr);
772
+ }, cr = !1, J = 0, lr = null, ur = () => {
773
+ J = 0;
774
+ let e = lr;
775
+ lr = null, e && (K.value ? er(e) : q.value && rr(e));
776
+ }, dr = (e) => {
777
+ lr = e, J ||= requestAnimationFrame(ur);
778
+ }, fr = () => {
779
+ J && (cancelAnimationFrame(J), ur()), K.value && tr(), q.value && ar();
771
780
  }, pr = () => {
772
- q && (cancelAnimationFrame(q), dr()), G.value && nr(), K.value && or();
781
+ cr || (cr = !0, window.addEventListener("mousemove", dr, !0), window.addEventListener("mouseup", fr, !0));
773
782
  }, mr = () => {
774
- lr || (lr = !0, window.addEventListener("mousemove", fr, !0), window.addEventListener("mouseup", pr, !0));
783
+ cr && (cr = !1, window.removeEventListener("mousemove", dr, !0), window.removeEventListener("mouseup", fr, !0));
775
784
  }, hr = () => {
776
- lr && (lr = !1, window.removeEventListener("mousemove", fr, !0), window.removeEventListener("mouseup", pr, !0));
777
- }, gr = () => {
778
- !G.value && !K.value && hr();
779
- }, _r = t(() => {
780
- if (J.value && J.value.side) return { cursor: Gr(J.value.side) };
781
- if (K.value) return { cursor: "crosshair" };
782
- if (G.value && G.value.moved) return { cursor: "grabbing" };
783
- }), vr = t(() => v.config.showGrid !== !1), yr = t(() => v.config.gridColor || "#1a2240"), br = t(() => {
785
+ !K.value && !q.value && mr();
786
+ }, gr = t(() => {
787
+ if (Y.value && Y.value.side) return { cursor: Gr(Y.value.side) };
788
+ if (q.value) return { cursor: "crosshair" };
789
+ if (K.value && K.value.moved) return { cursor: "grabbing" };
790
+ }), _r = t(() => v.config.showGrid !== !1), vr = t(() => v.config.gridColor || "#1a2240"), yr = t(() => {
784
791
  let e = Number(v.config.gridStep);
785
- return (Number.isFinite(e) && e > 0 ? e : 40) / Un.value;
786
- }), xr = t(() => {
792
+ return (Number.isFinite(e) && e > 0 ? e : 40) / Hn.value;
793
+ }), br = t(() => {
787
794
  let e = Number(v.config.gridOpacity);
788
795
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
789
- }), Sr = t(() => {
796
+ }), xr = t(() => {
790
797
  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) => ({
791
798
  offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
792
799
  color: e.color,
@@ -806,32 +813,37 @@ var b = {
806
813
  r: e.r || "60%",
807
814
  stops: n
808
815
  };
809
- }), Cr = t(() => v.config.showCenterPoint === !0), wr = t(() => v.config.showEdgeTextBg === !0), Tr = t(() => v.config.edgeTextBgColor || "#0a0e1a"), Er = t(() => v.config.showNodeHandles === !0), Dr = t(() => v.config.showStatusDot !== !1), Or = (e, t) => {
816
+ }), Sr = t(() => v.config.showCenterPoint === !0), Cr = t(() => v.config.showEdgeTextBg === !0), wr = t(() => v.config.edgeTextBgColor || "#0a0e1a"), Tr = t(() => v.config.showNodeHandles === !0), Er = t(() => v.config.showStatusDot !== !1), Dr = (e, t) => {
810
817
  let n = Number(e);
811
818
  return Number.isFinite(n) && n >= 0 ? n : t;
812
- }, kr = t(() => {
819
+ }, Or = t(() => {
813
820
  let e = v.config.motionFx ?? v.config.fx;
814
- return typeof e == "boolean" ? e : M.value.length <= Or(v.config.fxMotionMaxEdges, 200);
815
- }), Ar = t(() => {
821
+ return typeof e == "boolean" ? e : M.value.length <= Dr(v.config.fxMotionMaxEdges, 200);
822
+ }), kr = t(() => {
816
823
  let e = v.config.glowFx ?? v.config.fx;
817
- return typeof e == "boolean" ? e : M.value.length <= Or(v.config.fxGlowMaxEdges, 500);
818
- }), jr = t(() => {
824
+ return typeof e == "boolean" ? e : M.value.length <= Dr(v.config.fxGlowMaxEdges, 500);
825
+ }), Ar = t(() => {
819
826
  let e = v.config.breatheFx ?? v.config.fx;
820
- return typeof e == "boolean" ? e : w.value.length <= Or(v.config.fxBreatheMaxNodes, 300);
821
- }), Mr = (e) => e.animated !== !1, Nr = (e) => e.borderColor || F(e) || "#94a3b8", Pr = (e) => e.borderWidth || 0, Fr = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Ir = (e, t) => {
827
+ return typeof e == "boolean" ? e : T.value.length <= Dr(v.config.fxBreatheMaxNodes, 300);
828
+ }), jr = (e) => e.animated !== !1, Mr = (e) => e.borderColor || I(e) || "#94a3b8", Nr = (e) => e.borderWidth || 0, Pr = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Fr = (e) => {
829
+ let t = e.borderRadius;
830
+ if (t == null || t === "") return 6;
831
+ let n = Number(t);
832
+ return Number.isFinite(n) && n >= 0 ? n : 6;
833
+ }, Ir = (e, t) => {
822
834
  if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
823
835
  e.stopPropagation();
824
- let n = P(t), r = X(e);
836
+ let n = F(t), r = Z(e);
825
837
  if (Kt.value = {
826
838
  x: r.x - n.x,
827
839
  y: r.y - n.y
828
840
  }, Jt = {
829
841
  x: e.clientX,
830
842
  y: e.clientY
831
- }, Yt = !1, Xt = !!(e.ctrlKey || e.metaKey), R.value.length > 1 && R.value.includes(t)) {
843
+ }, Yt = !1, Xt = !!(e.ctrlKey || e.metaKey), z.value.length > 1 && z.value.includes(t)) {
832
844
  let e = {};
833
- R.value.forEach((t) => {
834
- let n = P(t);
845
+ z.value.forEach((t) => {
846
+ let n = F(t);
835
847
  n && (e[t] = {
836
848
  x: n.x,
837
849
  y: n.y
@@ -850,40 +862,40 @@ var b = {
850
862
  let e = Rr;
851
863
  Rr = null, e && Vr(e);
852
864
  }, Br = (e) => {
853
- (J.value || D.value) && (Rr = {
865
+ (Y.value || D.value) && (Rr = {
854
866
  clientX: e.clientX,
855
867
  clientY: e.clientY
856
868
  }, Lr ||= requestAnimationFrame(zr));
857
869
  }, Vr = (e) => {
858
- if (J.value) {
870
+ if (Y.value) {
859
871
  qr(e);
860
872
  return;
861
873
  }
862
874
  if (!D.value) return;
863
- let t = X(e);
864
- !Yt && Jt && Math.hypot(e.clientX - Jt.x, e.clientY - Jt.y) > kt && (Yt = !0, !Xt && !R.value.includes(D.value) && (R.value = V([], [D.value], jn.value), z.value = [], y("node-select", R.value.includes(D.value) ? P(D.value) : null), B()));
875
+ let t = Z(e);
876
+ !Yt && Jt && Math.hypot(e.clientX - Jt.x, e.clientY - Jt.y) > kt && (Yt = !0, !Xt && !z.value.includes(D.value) && (z.value = H([], [D.value], An.value), B.value = [], y("node-select", z.value.includes(D.value) ? F(D.value) : null), V()));
865
877
  let n = qt.value;
866
878
  if (n) {
867
879
  let e = t.x - n.start.x, r = t.y - n.start.y;
868
- w.value = w.value.map((t) => n.origins[t.id] ? {
880
+ T.value = T.value.map((t) => n.origins[t.id] ? {
869
881
  ...t,
870
882
  x: n.origins[t.id].x + e,
871
883
  y: n.origins[t.id].y + r
872
884
  } : t);
873
- } else w.value = w.value.map((e) => e.id === D.value ? {
885
+ } else T.value = T.value.map((e) => e.id === D.value ? {
874
886
  ...e,
875
887
  x: t.x - Kt.value.x,
876
888
  y: t.y - Kt.value.y
877
889
  } : e);
878
- T();
890
+ E();
879
891
  }, Hr = () => {
880
- if (Lr && (cancelAnimationFrame(Lr), zr()), J.value) {
892
+ if (Lr && (cancelAnimationFrame(Lr), zr()), Y.value) {
881
893
  Jr();
882
894
  return;
883
895
  }
884
- D.value && (Yt && Rn(), D.value = null, qt.value = null, Jt = null, Yt = !1, y("node-drag-end"));
885
- }, J = d(null), Ur = (e, t, n) => Math.min(n, Math.max(t, e)), Wr = (e) => {
886
- let t = L(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
896
+ D.value && (Yt && Ln(), D.value = null, qt.value = null, Jt = null, Yt = !1, y("node-drag-end"));
897
+ }, Y = d(null), Ur = (e, t, n) => Math.min(n, Math.max(t, e)), Wr = (e) => {
898
+ let t = R(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
887
899
  return [
888
900
  {
889
901
  side: "nw",
@@ -928,8 +940,8 @@ var b = {
928
940
  ];
929
941
  }, Gr = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Kr = (e, t, n) => {
930
942
  if (!v.editable || v.config.nodeResizable === !1 || !t) return;
931
- let { w: r, h: i } = I(t);
932
- J.value = {
943
+ let { w: r, h: i } = L(t);
944
+ Y.value = {
933
945
  id: t.id,
934
946
  side: n,
935
947
  anchorX: n.includes("e") ? t.x - r / 2 : n.includes("w") ? t.x + r / 2 : null,
@@ -938,35 +950,35 @@ var b = {
938
950
  startH: i
939
951
  }, y("node-resize-start", t);
940
952
  }, qr = (e) => {
941
- let t = J.value;
953
+ let t = Y.value;
942
954
  if (!t) return;
943
- let n = P(t.id);
955
+ let n = F(t.id);
944
956
  if (!n) return;
945
- let r = X(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
957
+ let r = Z(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
946
958
  if (t.anchorX !== null) {
947
959
  let e = t.side.includes("e");
948
- i = Ur(e ? r.x - t.anchorX : t.anchorX - r.x, Ft, It), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
960
+ i = Ur(e ? r.x - t.anchorX : t.anchorX - r.x, Pt, Ft), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
949
961
  }
950
962
  if (t.anchorY !== null) {
951
963
  let e = t.side.includes("s");
952
- a = Ur(e ? r.y - t.anchorY : t.anchorY - r.y, Lt, Rt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
964
+ a = Ur(e ? r.y - t.anchorY : t.anchorY - r.y, It, Lt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
953
965
  }
954
- w.value = w.value.map((e) => e.id === t.id ? {
966
+ T.value = T.value.map((e) => e.id === t.id ? {
955
967
  ...e,
956
968
  x: o,
957
969
  y: s,
958
970
  width: i,
959
971
  height: a
960
- } : e), T();
972
+ } : e), E();
961
973
  }, Jr = () => {
962
- let e = J.value;
963
- J.value = null, e && (Rn(), y("node-resize-end", P(e.id) || null));
974
+ let e = Y.value;
975
+ Y.value = null, e && (Ln(), y("node-resize-end", F(e.id) || null));
964
976
  }, Yr = t(() => v.editable && v.config.nodeResizable !== !1), Xr = t(() => {
965
977
  if (!Yr.value) return null;
966
- let e = R.value;
967
- return e.length === 1 && P(e[0]) || null;
968
- }), Y = d(null), Zr = (e) => {
969
- let t = L(e);
978
+ let e = z.value;
979
+ return e.length === 1 && F(e[0]) || null;
980
+ }), X = d(null), Zr = (e) => {
981
+ let t = R(e);
970
982
  return [
971
983
  {
972
984
  side: "top",
@@ -1015,14 +1027,14 @@ var b = {
1015
1027
  x: a.x,
1016
1028
  y: a.y
1017
1029
  };
1018
- }, X = (e) => Qr(e) ?? {
1030
+ }, Z = (e) => Qr(e) ?? {
1019
1031
  x: 0,
1020
1032
  y: 0
1021
1033
  }, ei = (e, t, n) => {
1022
- let r = P(t);
1034
+ let r = F(t);
1023
1035
  if (!r || !O.value) return;
1024
- let i = X(e);
1025
- Y.value = {
1036
+ let i = Z(e);
1037
+ X.value = {
1026
1038
  fromId: t,
1027
1039
  side: n.side,
1028
1040
  ax: r.x + n.x,
@@ -1034,42 +1046,42 @@ var b = {
1034
1046
  try {
1035
1047
  e.target.setPointerCapture?.(e.pointerId);
1036
1048
  } catch {}
1037
- oi();
1038
- }, Z = 0, ti = null, ni = () => {
1039
- Z = 0;
1040
- let e = ti;
1041
- ti = null, e && Y.value && li(e);
1042
- }, ri = (e) => {
1043
- Y.value && (ti = {
1049
+ si();
1050
+ }, ti = 0, ni = null, ri = () => {
1051
+ ti = 0;
1052
+ let e = ni;
1053
+ ni = null, e && X.value && ui(e);
1054
+ }, ii = (e) => {
1055
+ X.value && (ni = {
1044
1056
  clientX: e.clientX,
1045
1057
  clientY: e.clientY
1046
- }, Z ||= requestAnimationFrame(ni));
1047
- }, ii = () => {
1048
- Z && (cancelAnimationFrame(Z), ni()), Y.value && ui();
1049
- }, ai = !1, oi = () => {
1050
- ai || (ai = !0, window.addEventListener("mousemove", ri, !0), window.addEventListener("mouseup", ii, !0));
1051
- }, si = () => {
1052
- ai && (ai = !1, window.removeEventListener("mousemove", ri, !0), window.removeEventListener("mouseup", ii, !0));
1053
- }, ci = (e, t, n) => {
1054
- let r = w.value;
1058
+ }, ti ||= requestAnimationFrame(ri));
1059
+ }, ai = () => {
1060
+ ti && (cancelAnimationFrame(ti), ri()), X.value && di();
1061
+ }, oi = !1, si = () => {
1062
+ oi || (oi = !0, window.addEventListener("mousemove", ii, !0), window.addEventListener("mouseup", ai, !0));
1063
+ }, ci = () => {
1064
+ oi && (oi = !1, window.removeEventListener("mousemove", ii, !0), window.removeEventListener("mouseup", ai, !0));
1065
+ }, li = (e, t, n) => {
1066
+ let r = T.value;
1055
1067
  for (let i = r.length - 1; i >= 0; i--) {
1056
1068
  let a = r[i];
1057
1069
  if (a.id === n) continue;
1058
- let o = L(a);
1070
+ let o = R(a);
1059
1071
  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;
1060
1072
  }
1061
1073
  return null;
1062
- }, li = (e) => {
1063
- let t = Y.value;
1074
+ }, ui = (e) => {
1075
+ let t = X.value;
1064
1076
  if (!t) return;
1065
- let n = X(e);
1077
+ let n = Z(e);
1066
1078
  t.px = n.x, t.py = n.y;
1067
- let r = ci(n.x, n.y, t.fromId);
1079
+ let r = li(n.x, n.y, t.fromId);
1068
1080
  t.overId = r ? r.id : null;
1069
- }, ui = () => {
1070
- si();
1071
- let e = Y.value;
1072
- if (Y.value = null, !e || !e.overId || e.overId === e.fromId) return;
1081
+ }, di = () => {
1082
+ ci();
1083
+ let e = X.value;
1084
+ if (X.value = null, !e || !e.overId || e.overId === e.fromId) return;
1073
1085
  let t = {
1074
1086
  id: `${re()}`,
1075
1087
  from: e.fromId,
@@ -1079,8 +1091,8 @@ var b = {
1079
1091
  toAnchor: "edge"
1080
1092
  };
1081
1093
  k.value.push(t), y("edge-create", t);
1082
- }, di = (e, t, n) => {
1083
- let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = I(e);
1094
+ }, fi = (e, t, n) => {
1095
+ let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = L(e);
1084
1096
  if (!n || n === "center" || a === 0 && o === 0) return {
1085
1097
  x: r,
1086
1098
  y: i
@@ -1090,20 +1102,20 @@ var b = {
1090
1102
  x: r + a * p,
1091
1103
  y: i + o * p
1092
1104
  };
1093
- }, fi = t(() => {
1105
+ }, pi = t(() => {
1094
1106
  let e = /* @__PURE__ */ new Map();
1095
1107
  M.value.forEach((t) => {
1096
- let n = mn.value[t.id];
1108
+ let n = P.value[t.id];
1097
1109
  n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
1098
1110
  });
1099
1111
  let t = {};
1100
1112
  return e.forEach((e, n) => {
1101
- let [r, i] = n.split("__"), a = P(r), o = P(i);
1113
+ let [r, i] = n.split("__"), a = F(r), o = F(i);
1102
1114
  if (!a || !o) return;
1103
1115
  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, ee = Ot;
1104
1116
  if (m > 1) {
1105
1117
  let e = (m - 1) / 2 * Ot, t = (e) => {
1106
- let { w: t, h: n } = I(e);
1118
+ let { w: t, h: n } = L(e);
1107
1119
  return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
1108
1120
  }, n = Math.min(1, t(a) / e, t(o) / e);
1109
1121
  ee = Ot * Math.max(.35, n);
@@ -1122,12 +1134,12 @@ var b = {
1122
1134
  bulge: Math.min(l * .15, 50)
1123
1135
  };
1124
1136
  }), t;
1125
- }), pi = (e) => {
1126
- let t = mn.value[e.id], n = t && fi.value[t.key];
1137
+ }), mi = (e) => {
1138
+ let t = P.value[e.id], n = t && pi.value[t.key];
1127
1139
  if (!n) return null;
1128
- let r = P(e.from), i = P(e.to);
1140
+ let r = F(e.from), i = F(e.to);
1129
1141
  if (!r || !i) return null;
1130
- let a = n.slots[e.id] || 0, o = a * n.gap, s = di(r, i, e.fromAnchor), c = di(i, r, e.toAnchor);
1142
+ let a = n.slots[e.id] || 0, o = a * n.gap, s = fi(r, i, e.fromAnchor), c = fi(i, r, e.toAnchor);
1131
1143
  return {
1132
1144
  frame: n,
1133
1145
  slot: a,
@@ -1140,12 +1152,12 @@ var b = {
1140
1152
  y: c.y + n.ny * o
1141
1153
  }
1142
1154
  };
1143
- }, mi = (e) => {
1144
- let t = pi(e);
1155
+ }, hi = (e) => {
1156
+ let t = mi(e);
1145
1157
  if (!t) return "";
1146
1158
  let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
1147
- if (E.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
1148
- if (E.value === "polyline") {
1159
+ if (Gt.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
1160
+ if (Gt.value === "polyline") {
1149
1161
  if (i.dominant === "v") {
1150
1162
  let e = (n.y + r.y) / 2 + o;
1151
1163
  return `M ${n.x} ${n.y} L ${n.x} ${e} L ${r.x} ${e} L ${r.x} ${r.y}`;
@@ -1155,18 +1167,18 @@ var b = {
1155
1167
  }
1156
1168
  let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
1157
1169
  return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
1158
- }, hi = (e, t) => {
1159
- let n = pi(e);
1170
+ }, gi = (e, t) => {
1171
+ let n = mi(e);
1160
1172
  if (!n) return {
1161
1173
  x: 0,
1162
1174
  y: 0
1163
1175
  };
1164
1176
  let { from: r, to: i, frame: a, slot: o } = n, s = o * a.gap;
1165
- if (E.value === "straight") return {
1177
+ if (Gt.value === "straight") return {
1166
1178
  x: r.x + (i.x - r.x) * t,
1167
1179
  y: r.y + (i.y - r.y) * t
1168
1180
  };
1169
- if (E.value === "polyline") {
1181
+ if (Gt.value === "polyline") {
1170
1182
  if (a.dominant === "v") {
1171
1183
  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);
1172
1184
  return c <= n ? {
@@ -1197,29 +1209,29 @@ var b = {
1197
1209
  x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
1198
1210
  y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
1199
1211
  };
1200
- }, gi = t(() => Y.value ? P(Y.value.fromId) : null), _i = t(() => Y.value && Y.value.overId ? P(Y.value.overId) : null), vi = t(() => gi.value ? F(gi.value) : "#00f0ff"), yi = t(() => {
1201
- let e = Y.value;
1212
+ }, _i = t(() => X.value ? F(X.value.fromId) : null), vi = t(() => X.value && X.value.overId ? F(X.value.overId) : null), yi = t(() => _i.value ? I(_i.value) : "#00f0ff"), bi = t(() => {
1213
+ let e = X.value;
1202
1214
  if (!e) return {
1203
1215
  x: 0,
1204
1216
  y: 0
1205
1217
  };
1206
- let t = _i.value;
1207
- return t && gi.value ? di(t, gi.value, "edge") : {
1218
+ let t = vi.value;
1219
+ return t && _i.value ? fi(t, _i.value, "edge") : {
1208
1220
  x: e.px,
1209
1221
  y: e.py
1210
1222
  };
1211
- }), bi = t(() => {
1212
- let e = _i.value;
1223
+ }), xi = t(() => {
1224
+ let e = vi.value;
1213
1225
  if (!e) return null;
1214
- let t = L(e);
1226
+ let t = R(e);
1215
1227
  return {
1216
1228
  x: e.x + t.x - 4,
1217
1229
  y: e.y + t.y - 4,
1218
1230
  w: t.width + 8,
1219
1231
  h: t.height + 8
1220
1232
  };
1221
- }), xi = (e) => {
1222
- let t = e.nodeIds.map((e) => P(e)).filter(Boolean);
1233
+ }), Si = (e) => {
1234
+ let t = e.nodeIds.map((e) => F(e)).filter(Boolean);
1223
1235
  if (t.length === 0) return null;
1224
1236
  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;
1225
1237
  return {
@@ -1228,73 +1240,73 @@ var b = {
1228
1240
  width: a - r,
1229
1241
  height: o - i
1230
1242
  };
1231
- }, Si = t(() => v.groups.map((e) => ({
1243
+ }, Ci = t(() => v.groups.map((e) => ({
1232
1244
  ...e,
1233
- rect: xi(e)
1234
- })).filter((e) => e.rect)), Q = (e) => kn(e) ? Fn.value : (P(e.from), e.centerText && e.centerText.color || "#00f0ff"), Ci = (e) => {
1235
- let t = mn.value[e.id];
1245
+ rect: Si(e)
1246
+ })).filter((e) => e.rect)), Q = (e) => On(e) ? Pn.value : (F(e.from), e.centerText && e.centerText.color || "#00f0ff"), wi = (e) => {
1247
+ let t = P.value[e.id];
1236
1248
  return !!t && !t.hidden;
1237
- }, wi = t(() => [...new Set(M.value.map(Q))].map((e) => ({
1249
+ }, Ti = t(() => [...new Set(M.value.map(Q))].map((e) => ({
1238
1250
  key: String(e).replace("#", ""),
1239
1251
  color: e
1240
- }))), Ti = (e) => {
1252
+ }))), Ei = (e) => {
1241
1253
  let t = e.endMarker;
1242
1254
  if (!t || t === "none") return "";
1243
1255
  let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
1244
1256
  return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
1245
- }, Ei = /* @__PURE__ */ new Map(), Di = {
1257
+ }, Di = /* @__PURE__ */ new Map(), Oi = {
1246
1258
  nodes: null,
1247
1259
  edges: null,
1248
1260
  mode: null,
1249
1261
  epoch: -1
1250
- }, Oi = () => {
1251
- let e = Di;
1252
- (e.nodes !== w.value || e.edges !== M.value || e.mode !== E.value || e.epoch !== zt) && (Di = {
1253
- nodes: w.value,
1262
+ }, ki = () => {
1263
+ let e = Oi;
1264
+ (e.nodes !== T.value || e.edges !== M.value || e.mode !== Gt.value || e.epoch !== Rt) && (Oi = {
1265
+ nodes: T.value,
1254
1266
  edges: M.value,
1255
- mode: E.value,
1256
- epoch: zt
1257
- }, Ei = /* @__PURE__ */ new Map());
1267
+ mode: Gt.value,
1268
+ epoch: Rt
1269
+ }, Di = /* @__PURE__ */ new Map());
1258
1270
  }, $ = (e) => {
1259
- Oi();
1260
- let t = Ei.get(e.id);
1261
- return t === void 0 && (t = mi(e), Ei.set(e.id, t)), t;
1262
- }, ki = (e, t = 1) => `${2 / e.speed * t}s`, Ai = (e) => `${3 / e.speed}s`, ji = (e) => x(e).text, Mi = (e) => !!e && String(x(e).text ?? "").trim() !== "", Ni = (e, t) => {
1271
+ ki();
1272
+ let t = Di.get(e.id);
1273
+ return t === void 0 && (t = hi(e), Di.set(e.id, t)), t;
1274
+ }, Ai = (e, t = 1) => `${2 / e.speed * t}s`, ji = (e) => `${3 / e.speed}s`, Mi = (e) => S(e).text, Ni = (e) => !!e && String(S(e).text ?? "").trim() !== "", Pi = (e, t) => {
1263
1275
  if (!e) return null;
1264
- let n = x(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
1276
+ let n = S(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
1265
1277
  for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
1266
1278
  return {
1267
1279
  w: Math.max(14, a * r + 8),
1268
1280
  h: Math.max(12, r + 6)
1269
1281
  };
1270
- }, Pi = (e, t) => {
1271
- let n = hi(e, Math.max(0, t - .005)), r = hi(e, Math.min(1, t + .005));
1282
+ }, Fi = (e, t) => {
1283
+ let n = gi(e, Math.max(0, t - .005)), r = gi(e, Math.min(1, t + .005));
1272
1284
  return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
1273
- }, Fi = (e) => {
1285
+ }, Ii = (e) => {
1274
1286
  let t = e % 180;
1275
1287
  return t > 90 && (t -= 180), t < -90 && (t += 180), t;
1276
- }, Ii = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(x(e).rotation || 0) + (n || 0)})`, Li = t(() => {
1288
+ }, Li = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(S(e).rotation || 0) + (n || 0)})`, Ri = t(() => {
1277
1289
  let e = [];
1278
- for (let t of W.value) {
1279
- let n = mn.value[t.id];
1290
+ for (let t of G.value) {
1291
+ let n = P.value[t.id];
1280
1292
  if (!n) continue;
1281
1293
  let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
1282
1294
  if (!r && !i) continue;
1283
- let a = P(t.from), o = P(t.to);
1295
+ let a = F(t.from), o = F(t.to);
1284
1296
  a && o && e.push({
1285
1297
  id: t.id,
1286
1298
  edge: t,
1287
1299
  info: n,
1288
1300
  color: a && ie[a.type] || "#00f0ff",
1289
- start: hi(t, .28),
1290
- center: hi(t, .5),
1291
- end: hi(t, .72),
1292
- startAngle: Fi(Pi(t, .28)),
1293
- centerAngle: Fi(Pi(t, .5)),
1294
- endAngle: Fi(Pi(t, .72)),
1295
- fromBox: Ni(t.fromText, t),
1296
- centerBox: Ni(t.centerText, t),
1297
- toBox: Ni(t.toText, t)
1301
+ start: gi(t, .28),
1302
+ center: gi(t, .5),
1303
+ end: gi(t, .72),
1304
+ startAngle: Ii(Fi(t, .28)),
1305
+ centerAngle: Ii(Fi(t, .5)),
1306
+ endAngle: Ii(Fi(t, .72)),
1307
+ fromBox: Pi(t.fromText, t),
1308
+ centerBox: Pi(t.centerText, t),
1309
+ toBox: Pi(t.toText, t)
1298
1310
  });
1299
1311
  }
1300
1312
  return e;
@@ -1314,23 +1326,23 @@ var b = {
1314
1326
  ref_key: "svgRef",
1315
1327
  ref: O,
1316
1328
  class: "topology-svg",
1317
- style: s(_r.value),
1318
- viewBox: `${Kn.value} ${qn.value} ${H.value} ${U.value}`,
1319
- onMousedown: cr,
1329
+ style: s(gr.value),
1330
+ viewBox: `${Gn.value} ${Kn.value} ${U.value} ${W.value}`,
1331
+ onMousedown: sr,
1320
1332
  onMousemove: Br,
1321
1333
  onMouseup: Hr,
1322
1334
  onMouseleave: Hr,
1323
- onClick: Vn,
1324
- onWheel: g($n, ["prevent"])
1335
+ onClick: Bn,
1336
+ onWheel: g(Qn, ["prevent"])
1325
1337
  }, [
1326
1338
  i("defs", null, [
1327
1339
  c[3] ||= a("<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>", 2),
1328
1340
  i("radialGradient", {
1329
1341
  id: "bg-grid",
1330
- cx: Sr.value.cx,
1331
- cy: Sr.value.cy,
1332
- r: Sr.value.r
1333
- }, [(u(!0), r(e, null, f(Sr.value.stops, (e, t) => (u(), r("stop", {
1342
+ cx: xr.value.cx,
1343
+ cy: xr.value.cy,
1344
+ r: xr.value.r
1345
+ }, [(u(!0), r(e, null, f(xr.value.stops, (e, t) => (u(), r("stop", {
1334
1346
  key: `bg-stop-${t}`,
1335
1347
  offset: e.offset,
1336
1348
  "stop-color": e.color,
@@ -1357,7 +1369,7 @@ var b = {
1357
1369
  }, null, 8, de)
1358
1370
  ], 8, ce))), 128)),
1359
1371
  c[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),
1360
- (u(!0), r(e, null, f(wi.value, (e) => (u(), r("marker", {
1372
+ (u(!0), r(e, null, f(Ti.value, (e) => (u(), r("marker", {
1361
1373
  key: `m-arrow-${e.key}`,
1362
1374
  id: `edge-arrow-${e.key}`,
1363
1375
  viewBox: "0 0 10 10",
@@ -1371,7 +1383,7 @@ var b = {
1371
1383
  d: "M1,2.5 L9,5 L1,7.5 Z",
1372
1384
  fill: e.color
1373
1385
  }, null, 8, pe)], 8, fe))), 128)),
1374
- (u(!0), r(e, null, f(wi.value, (e) => (u(), r("marker", {
1386
+ (u(!0), r(e, null, f(Ti.value, (e) => (u(), r("marker", {
1375
1387
  key: `m-dot-${e.key}`,
1376
1388
  id: `edge-dot-${e.key}`,
1377
1389
  viewBox: "0 0 10 10",
@@ -1389,31 +1401,31 @@ var b = {
1389
1401
  }, null, 8, he)], 8, me))), 128))
1390
1402
  ]),
1391
1403
  i("rect", {
1392
- width: H.value,
1393
- height: U.value,
1394
- x: Kn.value,
1395
- y: qn.value,
1404
+ width: U.value,
1405
+ height: W.value,
1406
+ x: Gn.value,
1407
+ y: Kn.value,
1396
1408
  fill: "url(#bg-grid)"
1397
1409
  }, null, 8, ge),
1398
- vr.value ? (u(), r(e, { key: 0 }, [i("pattern", {
1410
+ _r.value ? (u(), r(e, { key: 0 }, [i("pattern", {
1399
1411
  id: "grid",
1400
- width: br.value,
1401
- height: br.value,
1412
+ width: yr.value,
1413
+ height: yr.value,
1402
1414
  patternUnits: "userSpaceOnUse"
1403
1415
  }, [i("path", {
1404
- d: `M ${br.value} 0 L 0 0 0 ${br.value}`,
1416
+ d: `M ${yr.value} 0 L 0 0 0 ${yr.value}`,
1405
1417
  fill: "none",
1406
- stroke: yr.value,
1418
+ stroke: vr.value,
1407
1419
  "stroke-width": "0.5"
1408
1420
  }, null, 8, ve)], 8, _e), i("rect", {
1409
- width: H.value,
1410
- height: U.value,
1411
- x: Kn.value,
1412
- y: qn.value,
1421
+ width: U.value,
1422
+ height: W.value,
1423
+ x: Gn.value,
1424
+ y: Kn.value,
1413
1425
  fill: "url(#grid)",
1414
- opacity: xr.value
1426
+ opacity: br.value
1415
1427
  }, null, 8, ye)], 64)) : n("", !0),
1416
- Cr.value ? (u(), r("g", be, [...c[5] ||= [
1428
+ Sr.value ? (u(), r("g", be, [...c[5] ||= [
1417
1429
  i("line", {
1418
1430
  x1: "-22",
1419
1431
  y1: "0",
@@ -1445,7 +1457,7 @@ var b = {
1445
1457
  opacity: "0.8"
1446
1458
  }, null, -1)
1447
1459
  ]])) : n("", !0),
1448
- (u(!0), r(e, null, f(Si.value, (e) => (u(), r("g", { key: e.id }, [
1460
+ (u(!0), r(e, null, f(Ci.value, (e) => (u(), r("g", { key: e.id }, [
1449
1461
  i("rect", {
1450
1462
  x: e.rect.x,
1451
1463
  y: e.rect.y,
@@ -1507,16 +1519,16 @@ var b = {
1507
1519
  "letter-spacing": "0.5"
1508
1520
  }, m(e.label), 9, De)
1509
1521
  ]))), 128)),
1510
- (u(!0), r(e, null, f(W.value, (e) => (u(), r("path", {
1522
+ (u(!0), r(e, null, f(G.value, (e) => (u(), r("path", {
1511
1523
  key: `base-${e.id}`,
1512
1524
  d: $(e),
1513
1525
  fill: "none",
1514
1526
  stroke: "#1a2744",
1515
1527
  "stroke-width": "2",
1516
1528
  "stroke-linecap": "round",
1517
- "marker-end": Ti(e)
1529
+ "marker-end": Ei(e)
1518
1530
  }, null, 8, Oe))), 128)),
1519
- (u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `glow-${t.id}` }, [Ar.value ? (u(), r("path", {
1531
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `glow-${t.id}` }, [kr.value ? (u(), r("path", {
1520
1532
  key: 0,
1521
1533
  d: $(t),
1522
1534
  fill: "none",
@@ -1526,16 +1538,16 @@ var b = {
1526
1538
  opacity: "0.15",
1527
1539
  filter: "url(#glow-strong)"
1528
1540
  }, null, 8, ke)) : n("", !0)], 64))), 128)),
1529
- (u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `sel-${t.id}` }, [kn(t) ? (u(), r("path", {
1541
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `sel-${t.id}` }, [On(t) ? (u(), r("path", {
1530
1542
  key: 0,
1531
1543
  d: $(t),
1532
1544
  fill: "none",
1533
- stroke: Fn.value,
1545
+ stroke: Pn.value,
1534
1546
  "stroke-width": "4",
1535
1547
  opacity: "0.35",
1536
1548
  filter: "url(#glow-strong)"
1537
1549
  }, null, 8, Ae)) : n("", !0)], 64))), 128)),
1538
- (u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `flow-${t.id}` }, [kr.value && Mr(t) ? (u(), r("g", je, [
1550
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `flow-${t.id}` }, [Or.value && jr(t) ? (u(), r("g", je, [
1539
1551
  i("path", {
1540
1552
  d: $(t),
1541
1553
  fill: "none",
@@ -1548,7 +1560,7 @@ var b = {
1548
1560
  attributeName: "stroke-dashoffset",
1549
1561
  from: "0",
1550
1562
  to: "-52",
1551
- dur: ki(t),
1563
+ dur: Ai(t),
1552
1564
  repeatCount: "indefinite"
1553
1565
  }, null, 8, Ne)], 8, Me),
1554
1566
  i("path", {
@@ -1563,7 +1575,7 @@ var b = {
1563
1575
  attributeName: "stroke-dashoffset",
1564
1576
  from: "-30",
1565
1577
  to: "-82",
1566
- dur: ki(t, 1.3),
1578
+ dur: Ai(t, 1.3),
1567
1579
  repeatCount: "indefinite"
1568
1580
  }, null, 8, Fe)], 8, Pe),
1569
1581
  i("path", {
@@ -1579,18 +1591,18 @@ var b = {
1579
1591
  attributeName: "stroke-dashoffset",
1580
1592
  from: "0",
1581
1593
  to: "-84",
1582
- dur: ki(t, .8),
1594
+ dur: Ai(t, .8),
1583
1595
  repeatCount: "indefinite"
1584
1596
  }, null, 8, Le)], 8, Ie)
1585
1597
  ])) : n("", !0)], 64))), 128)),
1586
- (u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `particle-${t.id}` }, [kr.value && Mr(t) ? (u(), r("g", Re, [i("circle", {
1598
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `particle-${t.id}` }, [Or.value && jr(t) ? (u(), r("g", Re, [i("circle", {
1587
1599
  r: "3",
1588
1600
  fill: Q(t),
1589
1601
  opacity: "0.9",
1590
1602
  filter: "url(#glow-core)"
1591
1603
  }, [i("animateMotion", {
1592
1604
  path: $(t),
1593
- dur: Ai(t),
1605
+ dur: ji(t),
1594
1606
  repeatCount: "indefinite"
1595
1607
  }, null, 8, Be)], 8, ze), i("circle", {
1596
1608
  r: "8",
@@ -1599,17 +1611,17 @@ var b = {
1599
1611
  filter: "url(#glow-strong)"
1600
1612
  }, [i("animateMotion", {
1601
1613
  path: $(t),
1602
- dur: Ai(t),
1614
+ dur: ji(t),
1603
1615
  repeatCount: "indefinite"
1604
1616
  }, null, 8, He)], 8, Ve)])) : n("", !0)], 64))), 128)),
1605
- (u(!0), r(e, null, f(Li.value, (t) => (u(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (u(), r("g", {
1617
+ (u(!0), r(e, null, f(Ri.value, (t) => (u(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (u(), r("g", {
1606
1618
  key: 0,
1607
1619
  transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
1608
1620
  }, [i("rect", {
1609
1621
  x: "-7",
1610
- y: -S(t.edge, null) / 2,
1622
+ y: -C(t.edge, null) / 2,
1611
1623
  width: 14,
1612
- height: S(t.edge, null),
1624
+ height: C(t.edge, null),
1613
1625
  rx: "2",
1614
1626
  fill: "#FFFFFF",
1615
1627
  opacity: "0.9",
@@ -1619,121 +1631,121 @@ var b = {
1619
1631
  y: "0",
1620
1632
  "dominant-baseline": "central",
1621
1633
  "text-anchor": "middle",
1622
- "font-size": S(t.edge, null),
1623
- fill: C(t.edge, null),
1634
+ "font-size": C(t.edge, null),
1635
+ fill: w(t.edge, null),
1624
1636
  "font-family": "'SF Mono', monospace",
1625
1637
  opacity: "1"
1626
1638
  }, m(t.info.count), 9, Ge)], 8, Ue)) : t.info.merged ? n("", !0) : (u(), r("g", Ke, [
1627
- Mi(t.edge.fromText) ? (u(), r("g", {
1639
+ Ni(t.edge.fromText) ? (u(), r("g", {
1628
1640
  key: 0,
1629
- transform: Ii(t.edge.fromText, t.start, t.startAngle)
1630
- }, [wr.value ? (u(), r("rect", {
1641
+ transform: Li(t.edge.fromText, t.start, t.startAngle)
1642
+ }, [Cr.value ? (u(), r("rect", {
1631
1643
  key: 0,
1632
1644
  x: -t.fromBox.w / 2,
1633
1645
  y: -t.fromBox.h / 2,
1634
1646
  width: t.fromBox.w,
1635
1647
  height: t.fromBox.h,
1636
1648
  rx: "3",
1637
- fill: Tr.value,
1649
+ fill: wr.value,
1638
1650
  opacity: "0.92",
1639
- stroke: C(t.edge, t.edge.fromText),
1651
+ stroke: w(t.edge, t.edge.fromText),
1640
1652
  "stroke-opacity": "0.35",
1641
1653
  "stroke-width": "0.6"
1642
1654
  }, null, 8, Je)) : n("", !0), i("text", {
1643
1655
  y: "0",
1644
1656
  "dominant-baseline": "central",
1645
1657
  "text-anchor": "middle",
1646
- "font-size": S(t.edge, t.edge.fromText),
1647
- fill: C(t.edge, t.edge.fromText),
1658
+ "font-size": C(t.edge, t.edge.fromText),
1659
+ fill: w(t.edge, t.edge.fromText),
1648
1660
  "font-family": "'SF Mono', monospace",
1649
1661
  "font-weight": "500",
1650
1662
  opacity: "0.9"
1651
- }, m(ji(t.edge.fromText)), 9, Ye)], 8, qe)) : n("", !0),
1652
- Mi(t.edge.centerText) ? (u(), r("g", {
1663
+ }, m(Mi(t.edge.fromText)), 9, Ye)], 8, qe)) : n("", !0),
1664
+ Ni(t.edge.centerText) ? (u(), r("g", {
1653
1665
  key: 1,
1654
- transform: Ii(t.edge.centerText, t.center, t.centerAngle)
1655
- }, [wr.value ? (u(), r("rect", {
1666
+ transform: Li(t.edge.centerText, t.center, t.centerAngle)
1667
+ }, [Cr.value ? (u(), r("rect", {
1656
1668
  key: 0,
1657
1669
  x: -t.centerBox.w / 2,
1658
1670
  y: -t.centerBox.h / 2,
1659
1671
  width: t.centerBox.w,
1660
1672
  height: t.centerBox.h,
1661
1673
  rx: "3",
1662
- fill: Tr.value,
1674
+ fill: wr.value,
1663
1675
  opacity: "0.92",
1664
- stroke: C(t.edge, t.edge.centerText),
1676
+ stroke: w(t.edge, t.edge.centerText),
1665
1677
  "stroke-opacity": "0.35",
1666
1678
  "stroke-width": "0.6"
1667
1679
  }, null, 8, Ze)) : n("", !0), i("text", {
1668
1680
  y: "0",
1669
1681
  "dominant-baseline": "central",
1670
1682
  "text-anchor": "middle",
1671
- "font-size": S(t.edge, t.edge.centerText),
1672
- fill: C(t.edge, t.edge.centerText),
1683
+ "font-size": C(t.edge, t.edge.centerText),
1684
+ fill: w(t.edge, t.edge.centerText),
1673
1685
  "font-family": "'SF Mono', monospace",
1674
1686
  "font-weight": "600",
1675
1687
  opacity: "1"
1676
- }, m(ji(t.edge.centerText)), 9, Qe)], 8, Xe)) : n("", !0),
1677
- Mi(t.edge.toText) ? (u(), r("g", {
1688
+ }, m(Mi(t.edge.centerText)), 9, Qe)], 8, Xe)) : n("", !0),
1689
+ Ni(t.edge.toText) ? (u(), r("g", {
1678
1690
  key: 2,
1679
- transform: Ii(t.edge.toText, t.end, t.endAngle)
1680
- }, [wr.value ? (u(), r("rect", {
1691
+ transform: Li(t.edge.toText, t.end, t.endAngle)
1692
+ }, [Cr.value ? (u(), r("rect", {
1681
1693
  key: 0,
1682
1694
  x: -t.toBox.w / 2,
1683
1695
  y: -t.toBox.h / 2,
1684
1696
  width: t.toBox.w,
1685
1697
  height: t.toBox.h,
1686
1698
  rx: "3",
1687
- fill: Tr.value,
1699
+ fill: wr.value,
1688
1700
  opacity: "0.92",
1689
- stroke: C(t.edge, t.edge.toText),
1701
+ stroke: w(t.edge, t.edge.toText),
1690
1702
  "stroke-opacity": "0.35",
1691
1703
  "stroke-width": "0.6"
1692
1704
  }, null, 8, et)) : n("", !0), i("text", {
1693
1705
  y: "0",
1694
1706
  "dominant-baseline": "central",
1695
1707
  "text-anchor": "middle",
1696
- "font-size": S(t.edge, t.edge.toText),
1697
- fill: C(t.edge, t.edge.toText),
1708
+ "font-size": C(t.edge, t.edge.toText),
1709
+ fill: w(t.edge, t.edge.toText),
1698
1710
  "font-family": "'SF Mono', monospace",
1699
1711
  "font-weight": "500",
1700
1712
  opacity: "0.9"
1701
- }, m(ji(t.edge.toText)), 9, tt)], 8, $e)) : n("", !0)
1713
+ }, m(Mi(t.edge.toText)), 9, tt)], 8, $e)) : n("", !0)
1702
1714
  ]))], 64))), 128)),
1703
- Y.value ? (u(), r("g", nt, [
1715
+ X.value ? (u(), r("g", nt, [
1704
1716
  i("line", {
1705
- x1: Y.value.ax,
1706
- y1: Y.value.ay,
1707
- x2: yi.value.x,
1708
- y2: yi.value.y,
1709
- stroke: vi.value,
1717
+ x1: X.value.ax,
1718
+ y1: X.value.ay,
1719
+ x2: bi.value.x,
1720
+ y2: bi.value.y,
1721
+ stroke: yi.value,
1710
1722
  "stroke-width": "2",
1711
1723
  "stroke-dasharray": "6 6",
1712
1724
  "stroke-linecap": "round",
1713
1725
  opacity: "0.9"
1714
1726
  }, null, 8, rt),
1715
1727
  i("circle", {
1716
- cx: Y.value.px,
1717
- cy: Y.value.py,
1728
+ cx: X.value.px,
1729
+ cy: X.value.py,
1718
1730
  r: "3.5",
1719
- fill: vi.value,
1731
+ fill: yi.value,
1720
1732
  opacity: "0.9"
1721
1733
  }, null, 8, it),
1722
- Y.value.overId && bi.value ? (u(), r("rect", {
1734
+ X.value.overId && xi.value ? (u(), r("rect", {
1723
1735
  key: 0,
1724
- x: bi.value.x,
1725
- y: bi.value.y,
1726
- width: bi.value.w,
1727
- height: bi.value.h,
1736
+ x: xi.value.x,
1737
+ y: xi.value.y,
1738
+ width: xi.value.w,
1739
+ height: xi.value.h,
1728
1740
  rx: "6",
1729
1741
  fill: "none",
1730
- stroke: vi.value,
1742
+ stroke: yi.value,
1731
1743
  "stroke-width": "1.5",
1732
1744
  "stroke-dasharray": "6 4",
1733
1745
  opacity: "0.9"
1734
1746
  }, null, 8, at)) : n("", !0)
1735
1747
  ])) : n("", !0),
1736
- (u(!0), r(e, null, f(W.value, (e) => (u(), r("path", {
1748
+ (u(!0), r(e, null, f(G.value, (e) => (u(), r("path", {
1737
1749
  key: `hit-${e.id}`,
1738
1750
  d: $(e),
1739
1751
  fill: "none",
@@ -1743,85 +1755,85 @@ var b = {
1743
1755
  "pointer-events": "stroke",
1744
1756
  cursor: "pointer"
1745
1757
  },
1746
- onClick: g((t) => In(e, t), ["stop"])
1758
+ onClick: g((t) => Fn(e, t), ["stop"])
1747
1759
  }, null, 8, ot))), 128)),
1748
- (u(!0), r(e, null, f(Qn.value, (a) => (u(), r("g", {
1760
+ (u(!0), r(e, null, f(Zn.value, (a) => (u(), r("g", {
1749
1761
  key: a.id,
1750
1762
  transform: `translate(${a.x}, ${a.y})`,
1751
1763
  class: o(["topology-node", D.value === a.id ? "dragging" : ""]),
1752
1764
  onMousedown: (e) => Ir(e, a.id),
1753
- onClick: (e) => Pn(a, e),
1765
+ onClick: (e) => Nn(a, e),
1754
1766
  style: s({
1755
1767
  cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
1756
- color: F(a)
1768
+ color: I(a)
1757
1769
  })
1758
1770
  }, [
1759
1771
  i("rect", {
1760
1772
  class: "node-hit-area",
1761
- x: wn(a).x,
1762
- y: wn(a).y,
1763
- width: wn(a).width,
1764
- height: wn(a).height,
1773
+ x: Cn(a).x,
1774
+ y: Cn(a).y,
1775
+ width: Cn(a).width,
1776
+ height: Cn(a).height,
1765
1777
  fill: "transparent",
1766
1778
  "pointer-events": "all"
1767
1779
  }, null, 8, ct),
1768
- Dn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1780
+ En(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1769
1781
  key: 0,
1770
- x: L(a).x,
1771
- y: L(a).y,
1772
- width: L(a).width,
1773
- height: L(a).height,
1774
- rx: "6",
1775
- fill: Dn(a),
1782
+ x: R(a).x,
1783
+ y: R(a).y,
1784
+ width: R(a).width,
1785
+ height: R(a).height,
1786
+ rx: Fr(a),
1787
+ fill: En(a),
1776
1788
  opacity: "0.15"
1777
1789
  }, null, 8, lt)) : n("", !0),
1778
- En(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1790
+ Tn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1779
1791
  key: 1,
1780
- x: En(a).x,
1781
- y: En(a).y,
1782
- width: En(a).width,
1783
- height: En(a).height,
1784
- rx: "6",
1792
+ x: Tn(a).x,
1793
+ y: Tn(a).y,
1794
+ width: Tn(a).width,
1795
+ height: Tn(a).height,
1796
+ rx: Fr(a),
1785
1797
  fill: "none",
1786
- stroke: Nr(a),
1787
- "stroke-width": Pr(a),
1788
- "stroke-dasharray": Fr(a),
1798
+ stroke: Mr(a),
1799
+ "stroke-width": Nr(a),
1800
+ "stroke-dasharray": Pr(a),
1789
1801
  opacity: "0.8"
1790
1802
  }, null, 8, ut)) : n("", !0),
1791
- On(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1803
+ Dn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1792
1804
  key: 2,
1793
- x: L(a).x,
1794
- y: L(a).y,
1795
- width: L(a).width,
1796
- height: L(a).height,
1797
- rx: "6",
1805
+ x: R(a).x,
1806
+ y: R(a).y,
1807
+ width: R(a).width,
1808
+ height: R(a).height,
1809
+ rx: Fr(a),
1798
1810
  fill: "none",
1799
- stroke: Nn.value,
1811
+ stroke: Mn.value,
1800
1812
  "stroke-width": "2.5",
1801
1813
  transform: "scale(1.1)",
1802
1814
  style: { "pointer-events": "none" }
1803
1815
  }, null, 8, dt)) : n("", !0),
1804
- _n(a) ? (u(), r(e, { key: 3 }, [i("rect", {
1816
+ gn(a) ? (u(), r(e, { key: 3 }, [i("rect", {
1805
1817
  x: "-4",
1806
1818
  y: "-10",
1807
1819
  width: "8",
1808
1820
  height: "20",
1809
- fill: gn(a).color,
1821
+ fill: hn(a).color,
1810
1822
  opacity: "0.06"
1811
1823
  }, null, 8, ft), i("text", {
1812
1824
  y: "4",
1813
1825
  transform: `rotate(${a.rotation || 0} 0 4)`,
1814
1826
  "text-anchor": "middle",
1815
- fill: Ht(a) || F(a) || gn(a).color,
1816
- "font-size": Vt(a, 12),
1827
+ fill: Vt(a) || I(a) || hn(a).color,
1828
+ "font-size": Bt(a, 12),
1817
1829
  "font-family": "'SF Mono', 'Cascadia Code', 'Consolas', monospace",
1818
1830
  "font-weight": "600"
1819
1831
  }, m(a.label), 9, pt)], 64)) : (u(), r(e, { key: 4 }, [
1820
- i("g", { transform: bn(a) }, [a.state !== "none" && jr.value ? (u(), r("circle", {
1832
+ i("g", { transform: yn(a) }, [a.state !== "none" && Ar.value ? (u(), r("circle", {
1821
1833
  key: 0,
1822
1834
  r: "30",
1823
1835
  fill: "none",
1824
- stroke: gn(a).color,
1836
+ stroke: hn(a).color,
1825
1837
  "stroke-width": "2.5",
1826
1838
  opacity: "0"
1827
1839
  }, [...c[6] ||= [i("animate", {
@@ -1836,7 +1848,7 @@ var b = {
1836
1848
  repeatCount: "indefinite"
1837
1849
  }, null, -1)]], 8, ht)) : n("", !0), i("g", gt, [p(t.$slots, "node-icon", {
1838
1850
  node: a,
1839
- color: F(a),
1851
+ color: I(a),
1840
1852
  viewMode: _.viewMode
1841
1853
  }, () => [i("rect", {
1842
1854
  x: "-18",
@@ -1844,25 +1856,25 @@ var b = {
1844
1856
  width: "36",
1845
1857
  height: "36",
1846
1858
  rx: "6",
1847
- fill: F(a),
1859
+ fill: I(a),
1848
1860
  opacity: "0.9"
1849
1861
  }, null, 8, _t)])])], 8, mt),
1850
- Dr.value ? (u(), r("g", {
1862
+ Er.value ? (u(), r("g", {
1851
1863
  key: 0,
1852
- transform: xn(a)
1864
+ transform: bn(a)
1853
1865
  }, [i("circle", {
1854
1866
  r: "4",
1855
- fill: gn(a).color,
1867
+ fill: hn(a).color,
1856
1868
  stroke: "#0a0e1a",
1857
1869
  "stroke-width": "2"
1858
1870
  }, null, 8, yt)], 8, vt)) : n("", !0),
1859
1871
  i("text", {
1860
- y: Cn(a),
1861
- transform: `rotate(${a.rotation || 0} 0 ${Cn(a)})`,
1872
+ y: Sn(a),
1873
+ transform: `rotate(${a.rotation || 0} 0 ${Sn(a)})`,
1862
1874
  "text-anchor": "middle",
1863
- fill: Ht(a),
1864
- "font-size": Vt(a),
1865
- "font-weight": Ut(a),
1875
+ fill: Vt(a),
1876
+ "font-size": Bt(a),
1877
+ "font-weight": Ht(a),
1866
1878
  "font-family": "'Segoe UI', system-ui, sans-serif",
1867
1879
  opacity: "0.9"
1868
1880
  }, [(u(!0), r(e, null, f(String(a.label ?? "").split("\n"), (e, t) => (u(), r("tspan", {
@@ -1871,20 +1883,20 @@ var b = {
1871
1883
  dy: t === 0 ? 0 : "1.2em"
1872
1884
  }, m(e), 9, xt))), 128))], 8, bt)
1873
1885
  ], 64)),
1874
- Er.value ? (u(), r("g", St, [(u(!0), r(e, null, f(Zr(a), (e) => (u(), r("circle", {
1886
+ Tr.value ? (u(), r("g", St, [(u(!0), r(e, null, f(Zr(a), (e) => (u(), r("circle", {
1875
1887
  key: e.side,
1876
1888
  cx: e.x,
1877
1889
  cy: e.y,
1878
1890
  r: "4.5",
1879
1891
  class: "node-handle",
1880
1892
  fill: "#0a0e1a",
1881
- stroke: F(a),
1893
+ stroke: I(a),
1882
1894
  "stroke-width": "1.5",
1883
1895
  onPointerdown: g((t) => ei(t, a.id, e), ["stop", "prevent"]),
1884
- onPointermove: g(li, ["stop"]),
1885
- onPointerup: g(ui, ["stop"]),
1886
- onPointercancel: g(ui, ["stop"]),
1887
- onLostpointercapture: ui,
1896
+ onPointermove: g(ui, ["stop"]),
1897
+ onPointerup: g(di, ["stop"]),
1898
+ onPointercancel: g(di, ["stop"]),
1899
+ onLostpointercapture: di,
1888
1900
  onMousedown: c[0] ||= g(() => {}, ["stop", "prevent"]),
1889
1901
  onClick: c[1] ||= g(() => {}, ["stop"])
1890
1902
  }, null, 40, Ct))), 128))])) : n("", !0)
@@ -1900,20 +1912,20 @@ var b = {
1900
1912
  onMousedown: g((t) => Kr(t, Xr.value, e.side), ["stop", "prevent"]),
1901
1913
  onClick: c[2] ||= g(() => {}, ["stop"])
1902
1914
  }, null, 42, Tt))), 128))])) : n("", !0),
1903
- K.value ? (u(), r("rect", {
1915
+ q.value ? (u(), r("rect", {
1904
1916
  key: 4,
1905
1917
  class: "marquee-box",
1906
- x: ar.value.x,
1907
- y: ar.value.y,
1908
- width: ar.value.width,
1909
- height: ar.value.height,
1918
+ x: ir.value.x,
1919
+ y: ir.value.y,
1920
+ width: ir.value.width,
1921
+ height: ir.value.height,
1910
1922
  rx: "2",
1911
1923
  "vector-effect": "non-scaling-stroke"
1912
1924
  }, null, 8, Et)) : n("", !0)
1913
1925
  ], 44, ae));
1914
1926
  }
1915
- }, Bt = { install(e) {
1916
- e.component("Topology", zt);
1927
+ }, zt = { install(e) {
1928
+ e.component("Topology", Rt);
1917
1929
  } };
1918
1930
  //#endregion
1919
- export { zt as Topology, Bt as default, ie as nodeColors, b as nodeStates };
1931
+ export { Rt as Topology, zt as default, ie as nodeColors, b as nodeStates };