quixotic-gol 0.1.8 → 0.1.9

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,5 +1,5 @@
1
- import { useRef as lt, useState as He, useCallback as be, useEffect as Re, forwardRef as Or, useImperativeHandle as Tr } from "react";
2
- import { jsx as Ct, jsxs as ue } from "react/jsx-runtime";
1
+ import { useRef as ut, useState as He, useCallback as be, useEffect as Re, forwardRef as Or, useImperativeHandle as Tr } from "react";
2
+ import { jsx as Mt, jsxs as ue } from "react/jsx-runtime";
3
3
  const ka = 500;
4
4
  function za(t) {
5
5
  return JSON.stringify(JSON.stringify(t)).slice(1, -1);
@@ -112,7 +112,7 @@ function Zr(t) {
112
112
  for (var e = this._groups, r = e.length, n = new Array(r), o = 0; o < r; ++o)
113
113
  for (var a = e[o], i = a.length, c = n[o] = new Array(i), l, s, u = 0; u < i; ++u)
114
114
  (l = a[u]) && (s = t.call(l, l.__data__, u, a)) && ("__data__" in l && (s.__data__ = l.__data__), c[u] = s);
115
- return new ft(n, this._parents);
115
+ return new ht(n, this._parents);
116
116
  }
117
117
  function Jr(t) {
118
118
  return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
@@ -135,7 +135,7 @@ function en(t) {
135
135
  for (var e = this._groups, r = e.length, n = [], o = [], a = 0; a < r; ++a)
136
136
  for (var i = e[a], c = i.length, l, s = 0; s < c; ++s)
137
137
  (l = i[s]) && (n.push(t.call(l, l.__data__, s, i)), o.push(l));
138
- return new ft(n, o);
138
+ return new ht(n, o);
139
139
  }
140
140
  function yr(t) {
141
141
  return function() {
@@ -176,13 +176,13 @@ function fn(t) {
176
176
  for (var e = this._groups, r = e.length, n = new Array(r), o = 0; o < r; ++o)
177
177
  for (var a = e[o], i = a.length, c = n[o] = [], l, s = 0; s < i; ++s)
178
178
  (l = a[s]) && t.call(l, l.__data__, s, a) && c.push(l);
179
- return new ft(n, this._parents);
179
+ return new ht(n, this._parents);
180
180
  }
181
181
  function gr(t) {
182
182
  return new Array(t.length);
183
183
  }
184
184
  function hn() {
185
- return new ft(this._enter || this._groups.map(gr), this._parents);
185
+ return new ht(this._enter || this._groups.map(gr), this._parents);
186
186
  }
187
187
  function fe(t, e) {
188
188
  this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
@@ -232,19 +232,19 @@ function mn(t, e) {
232
232
  for (var a = o.length, i = new Array(a), c = new Array(a), l = new Array(a), s = 0; s < a; ++s) {
233
233
  var u = n[s], p = o[s], v = p.length, g = gn(t.call(u, u && u.__data__, s, n)), _ = g.length, D = c[s] = new Array(_), $ = i[s] = new Array(_), R = l[s] = new Array(v);
234
234
  r(u, p, D, $, R, g, e);
235
- for (var Q = 0, G = 0, Z, H; Q < _; ++Q)
235
+ for (var Q = 0, G = 0, Z, V; Q < _; ++Q)
236
236
  if (Z = D[Q]) {
237
- for (Q >= G && (G = Q + 1); !(H = $[G]) && ++G < _; ) ;
238
- Z._next = H || null;
237
+ for (Q >= G && (G = Q + 1); !(V = $[G]) && ++G < _; ) ;
238
+ Z._next = V || null;
239
239
  }
240
240
  }
241
- return i = new ft(i, n), i._enter = c, i._exit = l, i;
241
+ return i = new ht(i, n), i._enter = c, i._exit = l, i;
242
242
  }
243
243
  function gn(t) {
244
244
  return typeof t == "object" && "length" in t ? t : Array.from(t);
245
245
  }
246
246
  function wn() {
247
- return new ft(this._exit || this._groups.map(gr), this._parents);
247
+ return new ht(this._exit || this._groups.map(gr), this._parents);
248
248
  }
249
249
  function xn(t, e, r) {
250
250
  var n = this.enter(), o = this, a = this.exit();
@@ -256,7 +256,7 @@ function En(t) {
256
256
  (g = s[_] || u[_]) && (v[_] = g);
257
257
  for (; l < o; ++l)
258
258
  c[l] = r[l];
259
- return new ft(c, this._parents);
259
+ return new ht(c, this._parents);
260
260
  }
261
261
  function bn() {
262
262
  for (var t = this._groups, e = -1, r = t.length; ++e < r; )
@@ -274,7 +274,7 @@ function Mn(t) {
274
274
  (s = i[u]) && (l[u] = s);
275
275
  l.sort(e);
276
276
  }
277
- return new ft(o, this._parents).order();
277
+ return new ht(o, this._parents).order();
278
278
  }
279
279
  function Fn(t, e) {
280
280
  return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
@@ -368,9 +368,9 @@ function zn(t, e, r) {
368
368
  };
369
369
  }
370
370
  function jn(t, e, r) {
371
- return arguments.length > 1 ? this.each((e == null ? In : typeof e == "function" ? zn : kn)(t, e, r ?? "")) : St(this.node(), t);
371
+ return arguments.length > 1 ? this.each((e == null ? In : typeof e == "function" ? zn : kn)(t, e, r ?? "")) : Ut(this.node(), t);
372
372
  }
373
- function St(t, e) {
373
+ function Ut(t, e) {
374
374
  return t.style.getPropertyValue(e) || wr(t).getComputedStyle(t, null).getPropertyValue(e);
375
375
  }
376
376
  function Gn(t) {
@@ -597,17 +597,17 @@ function* _o() {
597
597
  (i = n[o]) && (yield i);
598
598
  }
599
599
  var Cr = [null];
600
- function ft(t, e) {
600
+ function ht(t, e) {
601
601
  this._groups = t, this._parents = e;
602
602
  }
603
- function Jt() {
604
- return new ft([[document.documentElement]], Cr);
603
+ function Qt() {
604
+ return new ht([[document.documentElement]], Cr);
605
605
  }
606
606
  function Ro() {
607
607
  return this;
608
608
  }
609
- ft.prototype = Jt.prototype = {
610
- constructor: ft,
609
+ ht.prototype = Qt.prototype = {
610
+ constructor: ht,
611
611
  select: Zr,
612
612
  selectAll: en,
613
613
  selectChild: an,
@@ -644,15 +644,15 @@ ft.prototype = Jt.prototype = {
644
644
  dispatch: Co,
645
645
  [Symbol.iterator]: _o
646
646
  };
647
- function it(t) {
648
- return typeof t == "string" ? new ft([[document.querySelector(t)]], [document.documentElement]) : new ft([[t]], Cr);
647
+ function at(t) {
648
+ return typeof t == "string" ? new ht([[document.querySelector(t)]], [document.documentElement]) : new ht([[t]], Cr);
649
649
  }
650
650
  function Lo(t) {
651
651
  let e;
652
652
  for (; e = t.sourceEvent; ) t = e;
653
653
  return t;
654
654
  }
655
- function Dt(t, e) {
655
+ function Lt(t, e) {
656
656
  if (t = Lo(t), e === void 0 && (e = t.currentTarget), e) {
657
657
  var r = e.ownerSVGElement || e;
658
658
  if (r.createSVGPoint) {
@@ -671,11 +671,11 @@ function De(t) {
671
671
  t.preventDefault(), t.stopImmediatePropagation();
672
672
  }
673
673
  function Yo(t) {
674
- var e = t.document.documentElement, r = it(t).on("dragstart.drag", De, Ye);
674
+ var e = t.document.documentElement, r = at(t).on("dragstart.drag", De, Ye);
675
675
  "onselectstart" in e ? r.on("selectstart.drag", De, Ye) : (e.__noselect = e.style.MozUserSelect, e.style.MozUserSelect = "none");
676
676
  }
677
677
  function Do(t, e) {
678
- var r = t.document.documentElement, n = it(t).on("dragstart.drag", null);
678
+ var r = t.document.documentElement, n = at(t).on("dragstart.drag", null);
679
679
  e && (n.on("click.drag", De, Ye), setTimeout(function() {
680
680
  n.on("click.drag", null);
681
681
  }, 0)), "onselectstart" in r ? n.on("selectstart.drag", null) : (r.style.MozUserSelect = r.__noselect, delete r.__noselect);
@@ -688,9 +688,9 @@ function _r(t, e) {
688
688
  for (var n in e) r[n] = e[n];
689
689
  return r;
690
690
  }
691
- function At() {
691
+ function Zt() {
692
692
  }
693
- var qt = 0.7, he = 1 / qt, Ut = "\\s*([+-]?\\d+)\\s*", Kt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", mt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Bo = /^#([0-9a-f]{3,8})$/, Po = new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`), No = new RegExp(`^rgb\\(${mt},${mt},${mt}\\)$`), $o = new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${Kt}\\)$`), Xo = new RegExp(`^rgba\\(${mt},${mt},${mt},${Kt}\\)$`), Uo = new RegExp(`^hsl\\(${Kt},${mt},${mt}\\)$`), So = new RegExp(`^hsla\\(${Kt},${mt},${mt},${Kt}\\)$`), Ke = {
693
+ var Ht = 0.7, he = 1 / Ht, Xt = "\\s*([+-]?\\d+)\\s*", Wt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", yt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Bo = /^#([0-9a-f]{3,8})$/, Po = new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`), No = new RegExp(`^rgb\\(${yt},${yt},${yt}\\)$`), $o = new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${Wt}\\)$`), Xo = new RegExp(`^rgba\\(${yt},${yt},${yt},${Wt}\\)$`), Uo = new RegExp(`^hsl\\(${Wt},${yt},${yt}\\)$`), So = new RegExp(`^hsla\\(${Wt},${yt},${yt},${Wt}\\)$`), Ke = {
694
694
  aliceblue: 15792383,
695
695
  antiquewhite: 16444375,
696
696
  aqua: 65535,
@@ -840,7 +840,7 @@ var qt = 0.7, he = 1 / qt, Ut = "\\s*([+-]?\\d+)\\s*", Kt = "\\s*([+-]?(?:\\d*\\
840
840
  yellow: 16776960,
841
841
  yellowgreen: 10145074
842
842
  };
843
- je(At, Qt, {
843
+ je(Zt, qt, {
844
844
  copy(t) {
845
845
  return Object.assign(new this.constructor(), this, t);
846
846
  },
@@ -867,37 +867,37 @@ function ko() {
867
867
  function Ze() {
868
868
  return this.rgb().formatRgb();
869
869
  }
870
- function Qt(t) {
870
+ function qt(t) {
871
871
  var e, r;
872
- return t = (t + "").trim().toLowerCase(), (e = Bo.exec(t)) ? (r = e[1].length, e = parseInt(e[1], 16), r === 6 ? Je(e) : r === 3 ? new ut(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : r === 8 ? ee(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : r === 4 ? ee(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Po.exec(t)) ? new ut(e[1], e[2], e[3], 1) : (e = No.exec(t)) ? new ut(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = $o.exec(t)) ? ee(e[1], e[2], e[3], e[4]) : (e = Xo.exec(t)) ? ee(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Uo.exec(t)) ? er(e[1], e[2] / 100, e[3] / 100, 1) : (e = So.exec(t)) ? er(e[1], e[2] / 100, e[3] / 100, e[4]) : Ke.hasOwnProperty(t) ? Je(Ke[t]) : t === "transparent" ? new ut(NaN, NaN, NaN, 0) : null;
872
+ return t = (t + "").trim().toLowerCase(), (e = Bo.exec(t)) ? (r = e[1].length, e = parseInt(e[1], 16), r === 6 ? Je(e) : r === 3 ? new ft(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : r === 8 ? ee(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : r === 4 ? ee(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Po.exec(t)) ? new ft(e[1], e[2], e[3], 1) : (e = No.exec(t)) ? new ft(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = $o.exec(t)) ? ee(e[1], e[2], e[3], e[4]) : (e = Xo.exec(t)) ? ee(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Uo.exec(t)) ? er(e[1], e[2] / 100, e[3] / 100, 1) : (e = So.exec(t)) ? er(e[1], e[2] / 100, e[3] / 100, e[4]) : Ke.hasOwnProperty(t) ? Je(Ke[t]) : t === "transparent" ? new ft(NaN, NaN, NaN, 0) : null;
873
873
  }
874
874
  function Je(t) {
875
- return new ut(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
875
+ return new ft(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
876
876
  }
877
877
  function ee(t, e, r, n) {
878
- return n <= 0 && (t = e = r = NaN), new ut(t, e, r, n);
878
+ return n <= 0 && (t = e = r = NaN), new ft(t, e, r, n);
879
879
  }
880
880
  function zo(t) {
881
- return t instanceof At || (t = Qt(t)), t ? (t = t.rgb(), new ut(t.r, t.g, t.b, t.opacity)) : new ut();
881
+ return t instanceof Zt || (t = qt(t)), t ? (t = t.rgb(), new ft(t.r, t.g, t.b, t.opacity)) : new ft();
882
882
  }
883
883
  function Be(t, e, r, n) {
884
- return arguments.length === 1 ? zo(t) : new ut(t, e, r, n ?? 1);
884
+ return arguments.length === 1 ? zo(t) : new ft(t, e, r, n ?? 1);
885
885
  }
886
- function ut(t, e, r, n) {
886
+ function ft(t, e, r, n) {
887
887
  this.r = +t, this.g = +e, this.b = +r, this.opacity = +n;
888
888
  }
889
- je(ut, Be, _r(At, {
889
+ je(ft, Be, _r(Zt, {
890
890
  brighter(t) {
891
- return t = t == null ? he : Math.pow(he, t), new ut(this.r * t, this.g * t, this.b * t, this.opacity);
891
+ return t = t == null ? he : Math.pow(he, t), new ft(this.r * t, this.g * t, this.b * t, this.opacity);
892
892
  },
893
893
  darker(t) {
894
- return t = t == null ? qt : Math.pow(qt, t), new ut(this.r * t, this.g * t, this.b * t, this.opacity);
894
+ return t = t == null ? Ht : Math.pow(Ht, t), new ft(this.r * t, this.g * t, this.b * t, this.opacity);
895
895
  },
896
896
  rgb() {
897
897
  return this;
898
898
  },
899
899
  clamp() {
900
- return new ut(Nt(this.r), Nt(this.g), Nt(this.b), de(this.opacity));
900
+ return new ft(Bt(this.r), Bt(this.g), Bt(this.b), de(this.opacity));
901
901
  },
902
902
  displayable() {
903
903
  return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
@@ -910,51 +910,51 @@ je(ut, Be, _r(At, {
910
910
  toString: tr
911
911
  }));
912
912
  function Ae() {
913
- return `#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}`;
913
+ return `#${Dt(this.r)}${Dt(this.g)}${Dt(this.b)}`;
914
914
  }
915
915
  function jo() {
916
- return `#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}${Pt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
916
+ return `#${Dt(this.r)}${Dt(this.g)}${Dt(this.b)}${Dt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
917
917
  }
918
918
  function tr() {
919
919
  const t = de(this.opacity);
920
- return `${t === 1 ? "rgb(" : "rgba("}${Nt(this.r)}, ${Nt(this.g)}, ${Nt(this.b)}${t === 1 ? ")" : `, ${t})`}`;
920
+ return `${t === 1 ? "rgb(" : "rgba("}${Bt(this.r)}, ${Bt(this.g)}, ${Bt(this.b)}${t === 1 ? ")" : `, ${t})`}`;
921
921
  }
922
922
  function de(t) {
923
923
  return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
924
924
  }
925
- function Nt(t) {
925
+ function Bt(t) {
926
926
  return Math.max(0, Math.min(255, Math.round(t) || 0));
927
927
  }
928
- function Pt(t) {
929
- return t = Nt(t), (t < 16 ? "0" : "") + t.toString(16);
928
+ function Dt(t) {
929
+ return t = Bt(t), (t < 16 ? "0" : "") + t.toString(16);
930
930
  }
931
931
  function er(t, e, r, n) {
932
- return n <= 0 ? t = e = r = NaN : r <= 0 || r >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new vt(t, e, r, n);
932
+ return n <= 0 ? t = e = r = NaN : r <= 0 || r >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new dt(t, e, r, n);
933
933
  }
934
934
  function Rr(t) {
935
- if (t instanceof vt) return new vt(t.h, t.s, t.l, t.opacity);
936
- if (t instanceof At || (t = Qt(t)), !t) return new vt();
937
- if (t instanceof vt) return t;
935
+ if (t instanceof dt) return new dt(t.h, t.s, t.l, t.opacity);
936
+ if (t instanceof Zt || (t = qt(t)), !t) return new dt();
937
+ if (t instanceof dt) return t;
938
938
  t = t.rgb();
939
939
  var e = t.r / 255, r = t.g / 255, n = t.b / 255, o = Math.min(e, r, n), a = Math.max(e, r, n), i = NaN, c = a - o, l = (a + o) / 2;
940
- return c ? (e === a ? i = (r - n) / c + (r < n) * 6 : r === a ? i = (n - e) / c + 2 : i = (e - r) / c + 4, c /= l < 0.5 ? a + o : 2 - a - o, i *= 60) : c = l > 0 && l < 1 ? 0 : i, new vt(i, c, l, t.opacity);
940
+ return c ? (e === a ? i = (r - n) / c + (r < n) * 6 : r === a ? i = (n - e) / c + 2 : i = (e - r) / c + 4, c /= l < 0.5 ? a + o : 2 - a - o, i *= 60) : c = l > 0 && l < 1 ? 0 : i, new dt(i, c, l, t.opacity);
941
941
  }
942
942
  function Go(t, e, r, n) {
943
- return arguments.length === 1 ? Rr(t) : new vt(t, e, r, n ?? 1);
943
+ return arguments.length === 1 ? Rr(t) : new dt(t, e, r, n ?? 1);
944
944
  }
945
- function vt(t, e, r, n) {
945
+ function dt(t, e, r, n) {
946
946
  this.h = +t, this.s = +e, this.l = +r, this.opacity = +n;
947
947
  }
948
- je(vt, Go, _r(At, {
948
+ je(dt, Go, _r(Zt, {
949
949
  brighter(t) {
950
- return t = t == null ? he : Math.pow(he, t), new vt(this.h, this.s, this.l * t, this.opacity);
950
+ return t = t == null ? he : Math.pow(he, t), new dt(this.h, this.s, this.l * t, this.opacity);
951
951
  },
952
952
  darker(t) {
953
- return t = t == null ? qt : Math.pow(qt, t), new vt(this.h, this.s, this.l * t, this.opacity);
953
+ return t = t == null ? Ht : Math.pow(Ht, t), new dt(this.h, this.s, this.l * t, this.opacity);
954
954
  },
955
955
  rgb() {
956
956
  var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, r = this.l, n = r + (r < 0.5 ? r : 1 - r) * e, o = 2 * r - n;
957
- return new ut(
957
+ return new ft(
958
958
  Me(t >= 240 ? t - 240 : t + 120, o, n),
959
959
  Me(t, o, n),
960
960
  Me(t < 120 ? t + 240 : t - 120, o, n),
@@ -962,7 +962,7 @@ je(vt, Go, _r(At, {
962
962
  );
963
963
  },
964
964
  clamp() {
965
- return new vt(rr(this.h), re(this.s), re(this.l), de(this.opacity));
965
+ return new dt(rr(this.h), re(this.s), re(this.l), de(this.opacity));
966
966
  },
967
967
  displayable() {
968
968
  return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
@@ -1011,7 +1011,7 @@ const nr = (function t(e) {
1011
1011
  }
1012
1012
  return n.gamma = t, n;
1013
1013
  })(1);
1014
- function Ft(t, e) {
1014
+ function bt(t, e) {
1015
1015
  return t = +t, e = +e, function(r) {
1016
1016
  return t * (1 - r) + e * r;
1017
1017
  };
@@ -1030,7 +1030,7 @@ function Wo(t) {
1030
1030
  function qo(t, e) {
1031
1031
  var r = Pe.lastIndex = Fe.lastIndex = 0, n, o, a, i = -1, c = [], l = [];
1032
1032
  for (t = t + "", e = e + ""; (n = Pe.exec(t)) && (o = Fe.exec(e)); )
1033
- (a = o.index) > r && (a = e.slice(r, a), c[i] ? c[i] += a : c[++i] = a), (n = n[0]) === (o = o[0]) ? c[i] ? c[i] += o : c[++i] = o : (c[++i] = null, l.push({ i, x: Ft(n, o) })), r = Fe.lastIndex;
1033
+ (a = o.index) > r && (a = e.slice(r, a), c[i] ? c[i] += a : c[++i] = a), (n = n[0]) === (o = o[0]) ? c[i] ? c[i] += o : c[++i] = o : (c[++i] = null, l.push({ i, x: bt(n, o) })), r = Fe.lastIndex;
1034
1034
  return r < e.length && (a = e.slice(r), c[i] ? c[i] += a : c[++i] = a), c.length < 2 ? l[0] ? Wo(l[0].x) : Ho(e) : (e = l.length, function(s) {
1035
1035
  for (var u = 0, p; u < e; ++u) c[(p = l[u]).i] = p.x(s);
1036
1036
  return c.join("");
@@ -1070,19 +1070,19 @@ function Br(t, e, r, n) {
1070
1070
  function a(s, u, p, v, g, _) {
1071
1071
  if (s !== p || u !== v) {
1072
1072
  var D = g.push("translate(", null, e, null, r);
1073
- _.push({ i: D - 4, x: Ft(s, p) }, { i: D - 2, x: Ft(u, v) });
1073
+ _.push({ i: D - 4, x: bt(s, p) }, { i: D - 2, x: bt(u, v) });
1074
1074
  } else (p || v) && g.push("translate(" + p + e + v + r);
1075
1075
  }
1076
1076
  function i(s, u, p, v) {
1077
- s !== u ? (s - u > 180 ? u += 360 : u - s > 180 && (s += 360), v.push({ i: p.push(o(p) + "rotate(", null, n) - 2, x: Ft(s, u) })) : u && p.push(o(p) + "rotate(" + u + n);
1077
+ s !== u ? (s - u > 180 ? u += 360 : u - s > 180 && (s += 360), v.push({ i: p.push(o(p) + "rotate(", null, n) - 2, x: bt(s, u) })) : u && p.push(o(p) + "rotate(" + u + n);
1078
1078
  }
1079
1079
  function c(s, u, p, v) {
1080
- s !== u ? v.push({ i: p.push(o(p) + "skewX(", null, n) - 2, x: Ft(s, u) }) : u && p.push(o(p) + "skewX(" + u + n);
1080
+ s !== u ? v.push({ i: p.push(o(p) + "skewX(", null, n) - 2, x: bt(s, u) }) : u && p.push(o(p) + "skewX(" + u + n);
1081
1081
  }
1082
1082
  function l(s, u, p, v, g, _) {
1083
1083
  if (s !== p || u !== v) {
1084
1084
  var D = g.push(o(g) + "scale(", null, ",", null, ")");
1085
- _.push({ i: D - 4, x: Ft(s, p) }, { i: D - 2, x: Ft(u, v) });
1085
+ _.push({ i: D - 4, x: bt(s, p) }, { i: D - 2, x: bt(u, v) });
1086
1086
  } else (p !== 1 || v !== 1) && g.push(o(g) + "scale(" + p + "," + v + ")");
1087
1087
  }
1088
1088
  return function(s, u) {
@@ -1107,21 +1107,21 @@ const ri = (function t(e, r, n) {
1107
1107
  function o(a, i) {
1108
1108
  var c = a[0], l = a[1], s = a[2], u = i[0], p = i[1], v = i[2], g = u - c, _ = p - l, D = g * g + _ * _, $, R;
1109
1109
  if (D < Ao)
1110
- R = Math.log(v / s) / e, $ = function(tt) {
1110
+ R = Math.log(v / s) / e, $ = function(A) {
1111
1111
  return [
1112
- c + tt * g,
1113
- l + tt * _,
1114
- s * Math.exp(e * tt * R)
1112
+ c + A * g,
1113
+ l + A * _,
1114
+ s * Math.exp(e * A * R)
1115
1115
  ];
1116
1116
  };
1117
1117
  else {
1118
- var Q = Math.sqrt(D), G = (v * v - s * s + n * D) / (2 * s * r * Q), Z = (v * v - s * s - n * D) / (2 * v * r * Q), H = Math.log(Math.sqrt(G * G + 1) - G), U = Math.log(Math.sqrt(Z * Z + 1) - Z);
1119
- R = (U - H) / e, $ = function(tt) {
1120
- var nt = tt * R, b = ir(H), X = s / (r * Q) * (b * ei(e * nt + H) - ti(H));
1118
+ var Q = Math.sqrt(D), G = (v * v - s * s + n * D) / (2 * s * r * Q), Z = (v * v - s * s - n * D) / (2 * v * r * Q), V = Math.log(Math.sqrt(G * G + 1) - G), I = Math.log(Math.sqrt(Z * Z + 1) - Z);
1119
+ R = (I - V) / e, $ = function(A) {
1120
+ var et = A * R, b = ir(V), S = s / (r * Q) * (b * ei(e * et + V) - ti(V));
1121
1121
  return [
1122
- c + X * g,
1123
- l + X * _,
1124
- s * b / ir(e * nt + H)
1122
+ c + S * g,
1123
+ l + S * _,
1124
+ s * b / ir(e * et + V)
1125
1125
  ];
1126
1126
  };
1127
1127
  }
@@ -1132,14 +1132,14 @@ const ri = (function t(e, r, n) {
1132
1132
  return t(i, c, l);
1133
1133
  }, o;
1134
1134
  })(Math.SQRT2, 2, 4);
1135
- var It = 0, Vt = 0, Ot = 0, Pr = 1e3, pe, Ht, ve = 0, $t = 0, ge = 0, Zt = typeof performance == "object" && performance.now ? performance : Date, Nr = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
1135
+ var St = 0, Ot = 0, jt = 0, Pr = 1e3, pe, Tt, ve = 0, Pt = 0, ge = 0, Kt = typeof performance == "object" && performance.now ? performance : Date, Nr = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
1136
1136
  setTimeout(t, 17);
1137
1137
  };
1138
1138
  function Ge() {
1139
- return $t || (Nr(ni), $t = Zt.now() + ge);
1139
+ return Pt || (Nr(ni), Pt = Kt.now() + ge);
1140
1140
  }
1141
1141
  function ni() {
1142
- $t = 0;
1142
+ Pt = 0;
1143
1143
  }
1144
1144
  function ye() {
1145
1145
  this._call = this._time = this._next = null;
@@ -1148,7 +1148,7 @@ ye.prototype = $r.prototype = {
1148
1148
  constructor: ye,
1149
1149
  restart: function(t, e, r) {
1150
1150
  if (typeof t != "function") throw new TypeError("callback is not a function");
1151
- r = (r == null ? Ge() : +r) + (e == null ? 0 : +e), !this._next && Ht !== this && (Ht ? Ht._next = this : pe = this, Ht = this), this._call = t, this._time = r, $e();
1151
+ r = (r == null ? Ge() : +r) + (e == null ? 0 : +e), !this._next && Tt !== this && (Tt ? Tt._next = this : pe = this, Tt = this), this._call = t, this._time = r, $e();
1152
1152
  },
1153
1153
  stop: function() {
1154
1154
  this._call && (this._call = null, this._time = 1 / 0, $e());
@@ -1159,33 +1159,33 @@ function $r(t, e, r) {
1159
1159
  return n.restart(t, e, r), n;
1160
1160
  }
1161
1161
  function oi() {
1162
- Ge(), ++It;
1162
+ Ge(), ++St;
1163
1163
  for (var t = pe, e; t; )
1164
- (e = $t - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
1165
- --It;
1164
+ (e = Pt - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
1165
+ --St;
1166
1166
  }
1167
1167
  function ar() {
1168
- $t = (ve = Zt.now()) + ge, It = Vt = 0;
1168
+ Pt = (ve = Kt.now()) + ge, St = Ot = 0;
1169
1169
  try {
1170
1170
  oi();
1171
1171
  } finally {
1172
- It = 0, ai(), $t = 0;
1172
+ St = 0, ai(), Pt = 0;
1173
1173
  }
1174
1174
  }
1175
1175
  function ii() {
1176
- var t = Zt.now(), e = t - ve;
1176
+ var t = Kt.now(), e = t - ve;
1177
1177
  e > Pr && (ge -= e, ve = t);
1178
1178
  }
1179
1179
  function ai() {
1180
1180
  for (var t, e = pe, r, n = 1 / 0; e; )
1181
1181
  e._call ? (n > e._time && (n = e._time), t = e, e = e._next) : (r = e._next, e._next = null, e = t ? t._next = r : pe = r);
1182
- Ht = t, $e(n);
1182
+ Tt = t, $e(n);
1183
1183
  }
1184
1184
  function $e(t) {
1185
- if (!It) {
1186
- Vt && (Vt = clearTimeout(Vt));
1187
- var e = t - $t;
1188
- e > 24 ? (t < 1 / 0 && (Vt = setTimeout(ar, t - Zt.now() - ge)), Ot && (Ot = clearInterval(Ot))) : (Ot || (ve = Zt.now(), Ot = setInterval(ii, Pr)), It = 1, Nr(ar));
1185
+ if (!St) {
1186
+ Ot && (Ot = clearTimeout(Ot));
1187
+ var e = t - Pt;
1188
+ e > 24 ? (t < 1 / 0 && (Ot = setTimeout(ar, t - Kt.now() - ge)), jt && (jt = clearInterval(jt))) : (jt || (ve = Kt.now(), jt = setInterval(ii, Pr)), St = 1, Nr(ar));
1189
1189
  }
1190
1190
  }
1191
1191
  function sr(t, e, r) {
@@ -1216,16 +1216,16 @@ function we(t, e, r, n, o, a) {
1216
1216
  });
1217
1217
  }
1218
1218
  function Oe(t, e) {
1219
- var r = yt(t, e);
1219
+ var r = pt(t, e);
1220
1220
  if (r.state > Xr) throw new Error("too late; already scheduled");
1221
1221
  return r;
1222
1222
  }
1223
- function gt(t, e) {
1224
- var r = yt(t, e);
1223
+ function mt(t, e) {
1224
+ var r = pt(t, e);
1225
1225
  if (r.state > se) throw new Error("too late; already running");
1226
1226
  return r;
1227
1227
  }
1228
- function yt(t, e) {
1228
+ function pt(t, e) {
1229
1229
  var r = t.__transition;
1230
1230
  if (!r || !(r = r[e])) throw new Error("transition not found");
1231
1231
  return r;
@@ -1285,7 +1285,7 @@ function ui(t) {
1285
1285
  function fi(t, e) {
1286
1286
  var r, n;
1287
1287
  return function() {
1288
- var o = gt(this, t), a = o.tween;
1288
+ var o = mt(this, t), a = o.tween;
1289
1289
  if (a !== r) {
1290
1290
  n = r = a;
1291
1291
  for (var i = 0, c = n.length; i < c; ++i)
@@ -1301,7 +1301,7 @@ function hi(t, e, r) {
1301
1301
  var n, o;
1302
1302
  if (typeof r != "function") throw new Error();
1303
1303
  return function() {
1304
- var a = gt(this, t), i = a.tween;
1304
+ var a = mt(this, t), i = a.tween;
1305
1305
  if (i !== n) {
1306
1306
  o = (n = i).slice();
1307
1307
  for (var c = { name: e, value: r }, l = 0, s = o.length; l < s; ++l)
@@ -1317,7 +1317,7 @@ function hi(t, e, r) {
1317
1317
  function di(t, e) {
1318
1318
  var r = this._id;
1319
1319
  if (t += "", arguments.length < 2) {
1320
- for (var n = yt(this.node(), r).tween, o = 0, a = n.length, i; o < a; ++o)
1320
+ for (var n = pt(this.node(), r).tween, o = 0, a = n.length, i; o < a; ++o)
1321
1321
  if ((i = n[o]).name === t)
1322
1322
  return i.value;
1323
1323
  return null;
@@ -1327,15 +1327,15 @@ function di(t, e) {
1327
1327
  function Te(t, e, r) {
1328
1328
  var n = t._id;
1329
1329
  return t.each(function() {
1330
- var o = gt(this, n);
1330
+ var o = mt(this, n);
1331
1331
  (o.value || (o.value = {}))[e] = r.apply(this, arguments);
1332
1332
  }), function(o) {
1333
- return yt(o, n).value[e];
1333
+ return pt(o, n).value[e];
1334
1334
  };
1335
1335
  }
1336
1336
  function Ur(t, e) {
1337
1337
  var r;
1338
- return (typeof e == "number" ? Ft : e instanceof Qt ? nr : (r = Qt(e)) ? (e = r, nr) : qo)(t, e);
1338
+ return (typeof e == "number" ? bt : e instanceof qt ? nr : (r = qt(e)) ? (e = r, nr) : qo)(t, e);
1339
1339
  }
1340
1340
  function pi(t) {
1341
1341
  return function() {
@@ -1425,37 +1425,37 @@ function Ri(t, e) {
1425
1425
  }
1426
1426
  function Li(t) {
1427
1427
  var e = this._id;
1428
- return arguments.length ? this.each((typeof t == "function" ? _i : Ri)(e, t)) : yt(this.node(), e).delay;
1428
+ return arguments.length ? this.each((typeof t == "function" ? _i : Ri)(e, t)) : pt(this.node(), e).delay;
1429
1429
  }
1430
1430
  function Yi(t, e) {
1431
1431
  return function() {
1432
- gt(this, t).duration = +e.apply(this, arguments);
1432
+ mt(this, t).duration = +e.apply(this, arguments);
1433
1433
  };
1434
1434
  }
1435
1435
  function Di(t, e) {
1436
1436
  return e = +e, function() {
1437
- gt(this, t).duration = e;
1437
+ mt(this, t).duration = e;
1438
1438
  };
1439
1439
  }
1440
1440
  function Bi(t) {
1441
1441
  var e = this._id;
1442
- return arguments.length ? this.each((typeof t == "function" ? Yi : Di)(e, t)) : yt(this.node(), e).duration;
1442
+ return arguments.length ? this.each((typeof t == "function" ? Yi : Di)(e, t)) : pt(this.node(), e).duration;
1443
1443
  }
1444
1444
  function Pi(t, e) {
1445
1445
  if (typeof e != "function") throw new Error();
1446
1446
  return function() {
1447
- gt(this, t).ease = e;
1447
+ mt(this, t).ease = e;
1448
1448
  };
1449
1449
  }
1450
1450
  function Ni(t) {
1451
1451
  var e = this._id;
1452
- return arguments.length ? this.each(Pi(e, t)) : yt(this.node(), e).ease;
1452
+ return arguments.length ? this.each(Pi(e, t)) : pt(this.node(), e).ease;
1453
1453
  }
1454
1454
  function $i(t, e) {
1455
1455
  return function() {
1456
1456
  var r = e.apply(this, arguments);
1457
1457
  if (typeof r != "function") throw new Error();
1458
- gt(this, t).ease = r;
1458
+ mt(this, t).ease = r;
1459
1459
  };
1460
1460
  }
1461
1461
  function Xi(t) {
@@ -1467,7 +1467,7 @@ function Ui(t) {
1467
1467
  for (var e = this._groups, r = e.length, n = new Array(r), o = 0; o < r; ++o)
1468
1468
  for (var a = e[o], i = a.length, c = n[o] = [], l, s = 0; s < i; ++s)
1469
1469
  (l = a[s]) && t.call(l, l.__data__, s, a) && c.push(l);
1470
- return new Mt(n, this._parents, this._name, this._id);
1470
+ return new xt(n, this._parents, this._name, this._id);
1471
1471
  }
1472
1472
  function Si(t) {
1473
1473
  if (t._id !== this._id) throw new Error();
@@ -1476,7 +1476,7 @@ function Si(t) {
1476
1476
  (v = l[g] || s[g]) && (p[g] = v);
1477
1477
  for (; c < n; ++c)
1478
1478
  i[c] = e[c];
1479
- return new Mt(i, this._parents, this._name, this._id);
1479
+ return new xt(i, this._parents, this._name, this._id);
1480
1480
  }
1481
1481
  function Ii(t) {
1482
1482
  return (t + "").trim().split(/^|\s+/).every(function(e) {
@@ -1485,7 +1485,7 @@ function Ii(t) {
1485
1485
  });
1486
1486
  }
1487
1487
  function ki(t, e, r) {
1488
- var n, o, a = Ii(e) ? Oe : gt;
1488
+ var n, o, a = Ii(e) ? Oe : mt;
1489
1489
  return function() {
1490
1490
  var i = a(this, t), c = i.on;
1491
1491
  c !== n && (o = (n = c).copy()).on(e, r), i.on = o;
@@ -1493,7 +1493,7 @@ function ki(t, e, r) {
1493
1493
  }
1494
1494
  function zi(t, e) {
1495
1495
  var r = this._id;
1496
- return arguments.length < 2 ? yt(this.node(), r).on.on(t) : this.each(ki(r, t, e));
1496
+ return arguments.length < 2 ? pt(this.node(), r).on.on(t) : this.each(ki(r, t, e));
1497
1497
  }
1498
1498
  function ji(t) {
1499
1499
  return function() {
@@ -1510,8 +1510,8 @@ function Oi(t) {
1510
1510
  typeof t != "function" && (t = ke(t));
1511
1511
  for (var n = this._groups, o = n.length, a = new Array(o), i = 0; i < o; ++i)
1512
1512
  for (var c = n[i], l = c.length, s = a[i] = new Array(l), u, p, v = 0; v < l; ++v)
1513
- (u = c[v]) && (p = t.call(u, u.__data__, v, c)) && ("__data__" in u && (p.__data__ = u.__data__), s[v] = p, we(s[v], e, r, v, s, yt(u, r)));
1514
- return new Mt(a, this._parents, e, r);
1513
+ (u = c[v]) && (p = t.call(u, u.__data__, v, c)) && ("__data__" in u && (p.__data__ = u.__data__), s[v] = p, we(s[v], e, r, v, s, pt(u, r)));
1514
+ return new xt(a, this._parents, e, r);
1515
1515
  }
1516
1516
  function Ti(t) {
1517
1517
  var e = this._name, r = this._id;
@@ -1519,20 +1519,20 @@ function Ti(t) {
1519
1519
  for (var n = this._groups, o = n.length, a = [], i = [], c = 0; c < o; ++c)
1520
1520
  for (var l = n[c], s = l.length, u, p = 0; p < s; ++p)
1521
1521
  if (u = l[p]) {
1522
- for (var v = t.call(u, u.__data__, p, l), g, _ = yt(u, r), D = 0, $ = v.length; D < $; ++D)
1522
+ for (var v = t.call(u, u.__data__, p, l), g, _ = pt(u, r), D = 0, $ = v.length; D < $; ++D)
1523
1523
  (g = v[D]) && we(g, e, r, D, v, _);
1524
1524
  a.push(v), i.push(u);
1525
1525
  }
1526
- return new Mt(a, i, e, r);
1526
+ return new xt(a, i, e, r);
1527
1527
  }
1528
- var Vi = Jt.prototype.constructor;
1528
+ var Vi = Qt.prototype.constructor;
1529
1529
  function Hi() {
1530
1530
  return new Vi(this._groups, this._parents);
1531
1531
  }
1532
1532
  function Wi(t, e) {
1533
1533
  var r, n, o;
1534
1534
  return function() {
1535
- var a = St(this, t), i = (this.style.removeProperty(t), St(this, t));
1535
+ var a = Ut(this, t), i = (this.style.removeProperty(t), Ut(this, t));
1536
1536
  return a === i ? null : a === r && i === n ? o : o = e(r = a, n = i);
1537
1537
  };
1538
1538
  }
@@ -1544,21 +1544,21 @@ function Sr(t) {
1544
1544
  function qi(t, e, r) {
1545
1545
  var n, o = r + "", a;
1546
1546
  return function() {
1547
- var i = St(this, t);
1547
+ var i = Ut(this, t);
1548
1548
  return i === o ? null : i === n ? a : a = e(n = i, r);
1549
1549
  };
1550
1550
  }
1551
1551
  function Ki(t, e, r) {
1552
1552
  var n, o, a;
1553
1553
  return function() {
1554
- var i = St(this, t), c = r(this), l = c + "";
1555
- return c == null && (l = c = (this.style.removeProperty(t), St(this, t))), i === l ? null : i === n && l === o ? a : (o = l, a = e(n = i, c));
1554
+ var i = Ut(this, t), c = r(this), l = c + "";
1555
+ return c == null && (l = c = (this.style.removeProperty(t), Ut(this, t))), i === l ? null : i === n && l === o ? a : (o = l, a = e(n = i, c));
1556
1556
  };
1557
1557
  }
1558
1558
  function Qi(t, e) {
1559
1559
  var r, n, o, a = "style." + e, i = "end." + a, c;
1560
1560
  return function() {
1561
- var l = gt(this, t), s = l.on, u = l.value[a] == null ? c || (c = Sr(e)) : void 0;
1561
+ var l = mt(this, t), s = l.on, u = l.value[a] == null ? c || (c = Sr(e)) : void 0;
1562
1562
  (s !== r || o !== u) && (n = (r = s).copy()).on(i, o = u), l.on = n;
1563
1563
  };
1564
1564
  }
@@ -1624,7 +1624,7 @@ function sa() {
1624
1624
  for (var t = this._name, e = this._id, r = Ir(), n = this._groups, o = n.length, a = 0; a < o; ++a)
1625
1625
  for (var i = n[a], c = i.length, l, s = 0; s < c; ++s)
1626
1626
  if (l = i[s]) {
1627
- var u = yt(l, e);
1627
+ var u = pt(l, e);
1628
1628
  we(l, t, r, s, i, {
1629
1629
  time: u.time + u.delay + u.duration,
1630
1630
  delay: 0,
@@ -1632,7 +1632,7 @@ function sa() {
1632
1632
  ease: u.ease
1633
1633
  });
1634
1634
  }
1635
- return new Mt(n, this._parents, t, r);
1635
+ return new xt(n, this._parents, t, r);
1636
1636
  }
1637
1637
  function ca() {
1638
1638
  var t, e, r = this, n = r._id, o = r.size();
@@ -1641,35 +1641,35 @@ function ca() {
1641
1641
  --o === 0 && a();
1642
1642
  } };
1643
1643
  r.each(function() {
1644
- var s = gt(this, n), u = s.on;
1644
+ var s = mt(this, n), u = s.on;
1645
1645
  u !== t && (e = (t = u).copy(), e._.cancel.push(c), e._.interrupt.push(c), e._.end.push(l)), s.on = e;
1646
1646
  }), o === 0 && a();
1647
1647
  });
1648
1648
  }
1649
1649
  var la = 0;
1650
- function Mt(t, e, r, n) {
1650
+ function xt(t, e, r, n) {
1651
1651
  this._groups = t, this._parents = e, this._name = r, this._id = n;
1652
1652
  }
1653
1653
  function Ir() {
1654
1654
  return ++la;
1655
1655
  }
1656
- var Et = Jt.prototype;
1657
- Mt.prototype = {
1658
- constructor: Mt,
1656
+ var gt = Qt.prototype;
1657
+ xt.prototype = {
1658
+ constructor: xt,
1659
1659
  select: Oi,
1660
1660
  selectAll: Ti,
1661
- selectChild: Et.selectChild,
1662
- selectChildren: Et.selectChildren,
1661
+ selectChild: gt.selectChild,
1662
+ selectChildren: gt.selectChildren,
1663
1663
  filter: Ui,
1664
1664
  merge: Si,
1665
1665
  selection: Hi,
1666
1666
  transition: sa,
1667
- call: Et.call,
1668
- nodes: Et.nodes,
1669
- node: Et.node,
1670
- size: Et.size,
1671
- empty: Et.empty,
1672
- each: Et.each,
1667
+ call: gt.call,
1668
+ nodes: gt.nodes,
1669
+ node: gt.node,
1670
+ size: gt.size,
1671
+ empty: gt.empty,
1672
+ each: gt.each,
1673
1673
  on: zi,
1674
1674
  attr: xi,
1675
1675
  attrTween: Ci,
@@ -1684,7 +1684,7 @@ Mt.prototype = {
1684
1684
  ease: Ni,
1685
1685
  easeVarying: Xi,
1686
1686
  end: ca,
1687
- [Symbol.iterator]: Et[Symbol.iterator]
1687
+ [Symbol.iterator]: gt[Symbol.iterator]
1688
1688
  };
1689
1689
  function ua(t) {
1690
1690
  return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
@@ -1704,14 +1704,14 @@ function ha(t, e) {
1704
1704
  }
1705
1705
  function da(t) {
1706
1706
  var e, r;
1707
- t instanceof Mt ? (e = t._id, t = t._name) : (e = Ir(), (r = fa).time = Ge(), t = t == null ? null : t + "");
1707
+ t instanceof xt ? (e = t._id, t = t._name) : (e = Ir(), (r = fa).time = Ge(), t = t == null ? null : t + "");
1708
1708
  for (var n = this._groups, o = n.length, a = 0; a < o; ++a)
1709
1709
  for (var i = n[a], c = i.length, l, s = 0; s < c; ++s)
1710
1710
  (l = i[s]) && we(l, t, e, s, i, r || ha(l, e));
1711
- return new Mt(n, this._parents, t, e);
1711
+ return new xt(n, this._parents, t, e);
1712
1712
  }
1713
- Jt.prototype.interrupt = ui;
1714
- Jt.prototype.transition = da;
1713
+ Qt.prototype.interrupt = ui;
1714
+ Qt.prototype.transition = da;
1715
1715
  const oe = (t) => () => t;
1716
1716
  function pa(t, {
1717
1717
  sourceEvent: e,
@@ -1727,16 +1727,16 @@ function pa(t, {
1727
1727
  _: { value: o }
1728
1728
  });
1729
1729
  }
1730
- function bt(t, e, r) {
1730
+ function wt(t, e, r) {
1731
1731
  this.k = t, this.x = e, this.y = r;
1732
1732
  }
1733
- bt.prototype = {
1734
- constructor: bt,
1733
+ wt.prototype = {
1734
+ constructor: wt,
1735
1735
  scale: function(t) {
1736
- return t === 1 ? this : new bt(this.k * t, this.x, this.y);
1736
+ return t === 1 ? this : new wt(this.k * t, this.x, this.y);
1737
1737
  },
1738
1738
  translate: function(t, e) {
1739
- return t === 0 & e === 0 ? this : new bt(this.k, this.x + this.k * t, this.y + this.k * e);
1739
+ return t === 0 & e === 0 ? this : new wt(this.k, this.x + this.k * t, this.y + this.k * e);
1740
1740
  },
1741
1741
  apply: function(t) {
1742
1742
  return [t[0] * this.k + this.x, t[1] * this.k + this.y];
@@ -1766,16 +1766,16 @@ bt.prototype = {
1766
1766
  return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
1767
1767
  }
1768
1768
  };
1769
- var _t = new bt(1, 0, 0);
1770
- Wt.prototype = bt.prototype;
1771
- function Wt(t) {
1772
- for (; !t.__zoom; ) if (!(t = t.parentNode)) return _t;
1769
+ var Ft = new wt(1, 0, 0);
1770
+ Vt.prototype = wt.prototype;
1771
+ function Vt(t) {
1772
+ for (; !t.__zoom; ) if (!(t = t.parentNode)) return Ft;
1773
1773
  return t.__zoom;
1774
1774
  }
1775
1775
  function Ce(t) {
1776
1776
  t.stopImmediatePropagation();
1777
1777
  }
1778
- function Tt(t) {
1778
+ function Gt(t) {
1779
1779
  t.preventDefault(), t.stopImmediatePropagation();
1780
1780
  }
1781
1781
  function va(t) {
@@ -1786,7 +1786,7 @@ function ya() {
1786
1786
  return t instanceof SVGElement ? (t = t.ownerSVGElement || t, t.hasAttribute("viewBox") ? (t = t.viewBox.baseVal, [[t.x, t.y], [t.x + t.width, t.y + t.height]]) : [[0, 0], [t.width.baseVal.value, t.height.baseVal.value]]) : [[0, 0], [t.clientWidth, t.clientHeight]];
1787
1787
  }
1788
1788
  function ur() {
1789
- return this.__zoom || _t;
1789
+ return this.__zoom || Ft;
1790
1790
  }
1791
1791
  function ma(t) {
1792
1792
  return -t.deltaY * (t.deltaMode === 1 ? 0.05 : t.deltaMode ? 1 : 2e-3) * (t.ctrlKey ? 10 : 1);
@@ -1804,22 +1804,22 @@ function wa(t, e, r) {
1804
1804
  function Ve() {
1805
1805
  var t = va, e = ya, r = wa, n = ma, o = ga, a = [0, 1 / 0], i = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], c = 250, l = ri, s = Ie("start", "zoom", "end"), u, p, v, g = 500, _ = 150, D = 0, $ = 10;
1806
1806
  function R(f) {
1807
- f.property("__zoom", ur).on("wheel.zoom", nt, { passive: !1 }).on("mousedown.zoom", b).on("dblclick.zoom", X).filter(o).on("touchstart.zoom", K).on("touchmove.zoom", B).on("touchend.zoom touchcancel.zoom", et).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1807
+ f.property("__zoom", ur).on("wheel.zoom", et, { passive: !1 }).on("mousedown.zoom", b).on("dblclick.zoom", S).filter(o).on("touchstart.zoom", K).on("touchmove.zoom", B).on("touchend.zoom touchcancel.zoom", tt).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1808
1808
  }
1809
1809
  R.transform = function(f, C, m, L) {
1810
- var I = f.selection ? f.selection() : f;
1811
- I.property("__zoom", ur), f !== I ? H(f, C, m, L) : I.interrupt().each(function() {
1812
- U(this, arguments).event(L).start().zoom(null, typeof C == "function" ? C.apply(this, arguments) : C).end();
1810
+ var z = f.selection ? f.selection() : f;
1811
+ z.property("__zoom", ur), f !== z ? V(f, C, m, L) : z.interrupt().each(function() {
1812
+ I(this, arguments).event(L).start().zoom(null, typeof C == "function" ? C.apply(this, arguments) : C).end();
1813
1813
  });
1814
1814
  }, R.scaleBy = function(f, C, m, L) {
1815
1815
  R.scaleTo(f, function() {
1816
- var I = this.__zoom.k, N = typeof C == "function" ? C.apply(this, arguments) : C;
1817
- return I * N;
1816
+ var z = this.__zoom.k, N = typeof C == "function" ? C.apply(this, arguments) : C;
1817
+ return z * N;
1818
1818
  }, m, L);
1819
1819
  }, R.scaleTo = function(f, C, m, L) {
1820
1820
  R.transform(f, function() {
1821
- var I = e.apply(this, arguments), N = this.__zoom, P = m == null ? Z(I) : typeof m == "function" ? m.apply(this, arguments) : m, d = N.invert(P), h = typeof C == "function" ? C.apply(this, arguments) : C;
1822
- return r(G(Q(N, h), P, d), I, i);
1821
+ var z = e.apply(this, arguments), N = this.__zoom, P = m == null ? Z(z) : typeof m == "function" ? m.apply(this, arguments) : m, d = N.invert(P), h = typeof C == "function" ? C.apply(this, arguments) : C;
1822
+ return r(G(Q(N, h), P, d), z, i);
1823
1823
  }, m, L);
1824
1824
  }, R.translateBy = function(f, C, m, L) {
1825
1825
  R.transform(f, function() {
@@ -1828,49 +1828,49 @@ function Ve() {
1828
1828
  typeof m == "function" ? m.apply(this, arguments) : m
1829
1829
  ), e.apply(this, arguments), i);
1830
1830
  }, null, L);
1831
- }, R.translateTo = function(f, C, m, L, I) {
1831
+ }, R.translateTo = function(f, C, m, L, z) {
1832
1832
  R.transform(f, function() {
1833
1833
  var N = e.apply(this, arguments), P = this.__zoom, d = L == null ? Z(N) : typeof L == "function" ? L.apply(this, arguments) : L;
1834
- return r(_t.translate(d[0], d[1]).scale(P.k).translate(
1834
+ return r(Ft.translate(d[0], d[1]).scale(P.k).translate(
1835
1835
  typeof C == "function" ? -C.apply(this, arguments) : -C,
1836
1836
  typeof m == "function" ? -m.apply(this, arguments) : -m
1837
1837
  ), N, i);
1838
- }, L, I);
1838
+ }, L, z);
1839
1839
  };
1840
1840
  function Q(f, C) {
1841
- return C = Math.max(a[0], Math.min(a[1], C)), C === f.k ? f : new bt(C, f.x, f.y);
1841
+ return C = Math.max(a[0], Math.min(a[1], C)), C === f.k ? f : new wt(C, f.x, f.y);
1842
1842
  }
1843
1843
  function G(f, C, m) {
1844
- var L = C[0] - m[0] * f.k, I = C[1] - m[1] * f.k;
1845
- return L === f.x && I === f.y ? f : new bt(f.k, L, I);
1844
+ var L = C[0] - m[0] * f.k, z = C[1] - m[1] * f.k;
1845
+ return L === f.x && z === f.y ? f : new wt(f.k, L, z);
1846
1846
  }
1847
1847
  function Z(f) {
1848
1848
  return [(+f[0][0] + +f[1][0]) / 2, (+f[0][1] + +f[1][1]) / 2];
1849
1849
  }
1850
- function H(f, C, m, L) {
1850
+ function V(f, C, m, L) {
1851
1851
  f.on("start.zoom", function() {
1852
- U(this, arguments).event(L).start();
1852
+ I(this, arguments).event(L).start();
1853
1853
  }).on("interrupt.zoom end.zoom", function() {
1854
- U(this, arguments).event(L).end();
1854
+ I(this, arguments).event(L).end();
1855
1855
  }).tween("zoom", function() {
1856
- var I = this, N = arguments, P = U(I, N).event(L), d = e.apply(I, N), h = m == null ? Z(d) : typeof m == "function" ? m.apply(I, N) : m, Y = Math.max(d[1][0] - d[0][0], d[1][1] - d[0][1]), w = I.__zoom, x = typeof C == "function" ? C.apply(I, N) : C, M = l(w.invert(h).concat(Y / w.k), x.invert(h).concat(Y / x.k));
1856
+ var z = this, N = arguments, P = I(z, N).event(L), d = e.apply(z, N), h = m == null ? Z(d) : typeof m == "function" ? m.apply(z, N) : m, Y = Math.max(d[1][0] - d[0][0], d[1][1] - d[0][1]), w = z.__zoom, x = typeof C == "function" ? C.apply(z, N) : C, M = l(w.invert(h).concat(Y / w.k), x.invert(h).concat(Y / x.k));
1857
1857
  return function(y) {
1858
1858
  if (y === 1) y = x;
1859
1859
  else {
1860
1860
  var F = M(y), E = Y / F[2];
1861
- y = new bt(E, h[0] - F[0] * E, h[1] - F[1] * E);
1861
+ y = new wt(E, h[0] - F[0] * E, h[1] - F[1] * E);
1862
1862
  }
1863
1863
  P.zoom(null, y);
1864
1864
  };
1865
1865
  });
1866
1866
  }
1867
- function U(f, C, m) {
1868
- return !m && f.__zooming || new tt(f, C);
1867
+ function I(f, C, m) {
1868
+ return !m && f.__zooming || new A(f, C);
1869
1869
  }
1870
- function tt(f, C) {
1870
+ function A(f, C) {
1871
1871
  this.that = f, this.args = C, this.active = 0, this.sourceEvent = null, this.extent = e.apply(f, C), this.taps = 0;
1872
1872
  }
1873
- tt.prototype = {
1873
+ A.prototype = {
1874
1874
  event: function(f) {
1875
1875
  return f && (this.sourceEvent = f), this;
1876
1876
  },
@@ -1884,7 +1884,7 @@ function Ve() {
1884
1884
  return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
1885
1885
  },
1886
1886
  emit: function(f) {
1887
- var C = it(this.that).datum();
1887
+ var C = at(this.that).datum();
1888
1888
  s.call(
1889
1889
  f,
1890
1890
  this.that,
@@ -1898,56 +1898,56 @@ function Ve() {
1898
1898
  );
1899
1899
  }
1900
1900
  };
1901
- function nt(f, ...C) {
1901
+ function et(f, ...C) {
1902
1902
  if (!t.apply(this, arguments)) return;
1903
- var m = U(this, C).event(f), L = this.__zoom, I = Math.max(a[0], Math.min(a[1], L.k * Math.pow(2, n.apply(this, arguments)))), N = Dt(f);
1903
+ var m = I(this, C).event(f), L = this.__zoom, z = Math.max(a[0], Math.min(a[1], L.k * Math.pow(2, n.apply(this, arguments)))), N = Lt(f);
1904
1904
  if (m.wheel)
1905
1905
  (m.mouse[0][0] !== N[0] || m.mouse[0][1] !== N[1]) && (m.mouse[1] = L.invert(m.mouse[0] = N)), clearTimeout(m.wheel);
1906
1906
  else {
1907
- if (L.k === I) return;
1907
+ if (L.k === z) return;
1908
1908
  m.mouse = [N, L.invert(N)], le(this), m.start();
1909
1909
  }
1910
- Tt(f), m.wheel = setTimeout(P, _), m.zoom("mouse", r(G(Q(L, I), m.mouse[0], m.mouse[1]), m.extent, i));
1910
+ Gt(f), m.wheel = setTimeout(P, _), m.zoom("mouse", r(G(Q(L, z), m.mouse[0], m.mouse[1]), m.extent, i));
1911
1911
  function P() {
1912
1912
  m.wheel = null, m.end();
1913
1913
  }
1914
1914
  }
1915
1915
  function b(f, ...C) {
1916
1916
  if (v || !t.apply(this, arguments)) return;
1917
- var m = f.currentTarget, L = U(this, C, !0).event(f), I = it(f.view).on("mousemove.zoom", h, !0).on("mouseup.zoom", Y, !0), N = Dt(f, m), P = f.clientX, d = f.clientY;
1917
+ var m = f.currentTarget, L = I(this, C, !0).event(f), z = at(f.view).on("mousemove.zoom", h, !0).on("mouseup.zoom", Y, !0), N = Lt(f, m), P = f.clientX, d = f.clientY;
1918
1918
  Yo(f.view), Ce(f), L.mouse = [N, this.__zoom.invert(N)], le(this), L.start();
1919
1919
  function h(w) {
1920
- if (Tt(w), !L.moved) {
1920
+ if (Gt(w), !L.moved) {
1921
1921
  var x = w.clientX - P, M = w.clientY - d;
1922
1922
  L.moved = x * x + M * M > D;
1923
1923
  }
1924
- L.event(w).zoom("mouse", r(G(L.that.__zoom, L.mouse[0] = Dt(w, m), L.mouse[1]), L.extent, i));
1924
+ L.event(w).zoom("mouse", r(G(L.that.__zoom, L.mouse[0] = Lt(w, m), L.mouse[1]), L.extent, i));
1925
1925
  }
1926
1926
  function Y(w) {
1927
- I.on("mousemove.zoom mouseup.zoom", null), Do(w.view, L.moved), Tt(w), L.event(w).end();
1927
+ z.on("mousemove.zoom mouseup.zoom", null), Do(w.view, L.moved), Gt(w), L.event(w).end();
1928
1928
  }
1929
1929
  }
1930
- function X(f, ...C) {
1930
+ function S(f, ...C) {
1931
1931
  if (t.apply(this, arguments)) {
1932
- var m = this.__zoom, L = Dt(f.changedTouches ? f.changedTouches[0] : f, this), I = m.invert(L), N = m.k * (f.shiftKey ? 0.5 : 2), P = r(G(Q(m, N), L, I), e.apply(this, C), i);
1933
- Tt(f), c > 0 ? it(this).transition().duration(c).call(H, P, L, f) : it(this).call(R.transform, P, L, f);
1932
+ var m = this.__zoom, L = Lt(f.changedTouches ? f.changedTouches[0] : f, this), z = m.invert(L), N = m.k * (f.shiftKey ? 0.5 : 2), P = r(G(Q(m, N), L, z), e.apply(this, C), i);
1933
+ Gt(f), c > 0 ? at(this).transition().duration(c).call(V, P, L, f) : at(this).call(R.transform, P, L, f);
1934
1934
  }
1935
1935
  }
1936
1936
  function K(f, ...C) {
1937
1937
  if (t.apply(this, arguments)) {
1938
- var m = f.touches, L = m.length, I = U(this, C, f.changedTouches.length === L).event(f), N, P, d, h;
1938
+ var m = f.touches, L = m.length, z = I(this, C, f.changedTouches.length === L).event(f), N, P, d, h;
1939
1939
  for (Ce(f), P = 0; P < L; ++P)
1940
- d = m[P], h = Dt(d, this), h = [h, this.__zoom.invert(h), d.identifier], I.touch0 ? !I.touch1 && I.touch0[2] !== h[2] && (I.touch1 = h, I.taps = 0) : (I.touch0 = h, N = !0, I.taps = 1 + !!u);
1941
- u && (u = clearTimeout(u)), N && (I.taps < 2 && (p = h[0], u = setTimeout(function() {
1940
+ d = m[P], h = Lt(d, this), h = [h, this.__zoom.invert(h), d.identifier], z.touch0 ? !z.touch1 && z.touch0[2] !== h[2] && (z.touch1 = h, z.taps = 0) : (z.touch0 = h, N = !0, z.taps = 1 + !!u);
1941
+ u && (u = clearTimeout(u)), N && (z.taps < 2 && (p = h[0], u = setTimeout(function() {
1942
1942
  u = null;
1943
- }, g)), le(this), I.start());
1943
+ }, g)), le(this), z.start());
1944
1944
  }
1945
1945
  }
1946
1946
  function B(f, ...C) {
1947
1947
  if (this.__zooming) {
1948
- var m = U(this, C).event(f), L = f.changedTouches, I = L.length, N, P, d, h;
1949
- for (Tt(f), N = 0; N < I; ++N)
1950
- P = L[N], d = Dt(P, this), m.touch0 && m.touch0[2] === P.identifier ? m.touch0[0] = d : m.touch1 && m.touch1[2] === P.identifier && (m.touch1[0] = d);
1948
+ var m = I(this, C).event(f), L = f.changedTouches, z = L.length, N, P, d, h;
1949
+ for (Gt(f), N = 0; N < z; ++N)
1950
+ P = L[N], d = Lt(P, this), m.touch0 && m.touch0[2] === P.identifier ? m.touch0[0] = d : m.touch1 && m.touch1[2] === P.identifier && (m.touch1[0] = d);
1951
1951
  if (P = m.that.__zoom, m.touch1) {
1952
1952
  var Y = m.touch0[0], w = m.touch0[1], x = m.touch1[0], M = m.touch1[1], y = (y = x[0] - Y[0]) * y + (y = x[1] - Y[1]) * y, F = (F = M[0] - w[0]) * F + (F = M[1] - w[1]) * F;
1953
1953
  P = Q(P, Math.sqrt(y / F)), d = [(Y[0] + x[0]) / 2, (Y[1] + x[1]) / 2], h = [(w[0] + M[0]) / 2, (w[1] + M[1]) / 2];
@@ -1956,16 +1956,16 @@ function Ve() {
1956
1956
  m.zoom("touch", r(G(P, d, h), m.extent, i));
1957
1957
  }
1958
1958
  }
1959
- function et(f, ...C) {
1959
+ function tt(f, ...C) {
1960
1960
  if (this.__zooming) {
1961
- var m = U(this, C).event(f), L = f.changedTouches, I = L.length, N, P;
1961
+ var m = I(this, C).event(f), L = f.changedTouches, z = L.length, N, P;
1962
1962
  for (Ce(f), v && clearTimeout(v), v = setTimeout(function() {
1963
1963
  v = null;
1964
- }, g), N = 0; N < I; ++N)
1964
+ }, g), N = 0; N < z; ++N)
1965
1965
  P = L[N], m.touch0 && m.touch0[2] === P.identifier ? delete m.touch0 : m.touch1 && m.touch1[2] === P.identifier && delete m.touch1;
1966
1966
  if (m.touch1 && !m.touch0 && (m.touch0 = m.touch1, delete m.touch1), m.touch0) m.touch0[1] = this.__zoom.invert(m.touch0[0]);
1967
- else if (m.end(), m.taps === 2 && (P = Dt(P, this), Math.hypot(p[0] - P[0], p[1] - P[1]) < $)) {
1968
- var d = it(this).on("dblclick.zoom");
1967
+ else if (m.end(), m.taps === 2 && (P = Lt(P, this), Math.hypot(p[0] - P[0], p[1] - P[1]) < $)) {
1968
+ var d = at(this).on("dblclick.zoom");
1969
1969
  d && d.apply(this, arguments);
1970
1970
  }
1971
1971
  }
@@ -2318,7 +2318,7 @@ function Ca(t) {
2318
2318
  return e;
2319
2319
  }
2320
2320
  function ja(t) {
2321
- const e = it(t).select("svg"), r = e.select("g#graph0");
2321
+ const e = at(t).select("svg"), r = e.select("g#graph0");
2322
2322
  if (e.empty() || r.empty()) {
2323
2323
  console.warn("SVG or graph group not found");
2324
2324
  return;
@@ -2338,7 +2338,7 @@ function ja(t) {
2338
2338
  ];
2339
2339
  e.call(
2340
2340
  n.transform,
2341
- _t.translate(D[0], D[1]).scale(_)
2341
+ Ft.translate(D[0], D[1]).scale(_)
2342
2342
  );
2343
2343
  }
2344
2344
  }
@@ -2451,14 +2451,14 @@ function ie(t, e, r, n = xe) {
2451
2451
  const c = { x: o.x, y: e - o.y }, l = { x: a.x, y: e - a.y };
2452
2452
  let s = { x: l.x, y: l.y };
2453
2453
  i === "right" ? s = { x: l.x - n.arrowWidth, y: l.y } : i === "left" && (s = { x: l.x + n.arrowWidth, y: l.y });
2454
- const u = n.horizontalExtension, p = n.minEdgeDistance, v = n.minVerticalSegment, g = (H) => {
2455
- if (H.length < 2) return H;
2456
- const U = [H[0]];
2457
- for (let tt = 1; tt < H.length; tt++) {
2458
- const nt = U[U.length - 1];
2459
- (Math.abs(H[tt].x - nt.x) > 0.1 || Math.abs(H[tt].y - nt.y) > 0.1) && U.push(H[tt]);
2454
+ const u = n.horizontalExtension, p = n.minEdgeDistance, v = n.minVerticalSegment, g = (V) => {
2455
+ if (V.length < 2) return V;
2456
+ const I = [V[0]];
2457
+ for (let A = 1; A < V.length; A++) {
2458
+ const et = I[I.length - 1];
2459
+ (Math.abs(V[A].x - et.x) > 0.1 || Math.abs(V[A].y - et.y) > 0.1) && I.push(V[A]);
2460
2460
  }
2461
- return U;
2461
+ return I;
2462
2462
  };
2463
2463
  let _;
2464
2464
  const D = t.baseDirection === void 0;
@@ -2466,50 +2466,50 @@ function ie(t, e, r, n = xe) {
2466
2466
  let $ = _;
2467
2467
  if (!D && r && r.midY !== void 0) {
2468
2468
  if (t.baseDirection === "above") {
2469
- const H = r.midY - p;
2470
- $ > H && ($ = H);
2469
+ const V = r.midY - p;
2470
+ $ > V && ($ = V);
2471
2471
  } else if (t.baseDirection === "below") {
2472
- const H = r.midY + p;
2473
- $ < H && ($ = H);
2472
+ const V = r.midY + p;
2473
+ $ < V && ($ = V);
2474
2474
  }
2475
2475
  }
2476
- const R = Math.abs(c.y - s.y) < 5, Q = (H, U) => {
2477
- const tt = Math.abs(c.y - U), nt = Math.abs(U - s.y), b = i === "right" ? c.x + u : c.x - u, X = i === "right" ? s.x - u : s.x + u;
2478
- let K = [], B = U;
2479
- switch (H) {
2476
+ const R = Math.abs(c.y - s.y) < 5, Q = (V, I) => {
2477
+ const A = Math.abs(c.y - I), et = Math.abs(I - s.y), b = i === "right" ? c.x + u : c.x - u, S = i === "right" ? s.x - u : s.x + u;
2478
+ let K = [], B = I;
2479
+ switch (V) {
2480
2480
  case "straight":
2481
2481
  if (R) {
2482
2482
  const C = (c.y + s.y) / 2;
2483
- Math.abs(U - C) < v ? (K = [c, s], B = C) : (K = [
2483
+ Math.abs(I - C) < v ? (K = [c, s], B = C) : (K = [
2484
2484
  c,
2485
2485
  { x: b, y: c.y },
2486
2486
  // H: horizontal extension
2487
- { x: b, y: U },
2487
+ { x: b, y: I },
2488
2488
  // V: vertical to midY
2489
- { x: X, y: U },
2489
+ { x: S, y: I },
2490
2490
  // H: horizontal at midY
2491
- { x: X, y: s.y },
2491
+ { x: S, y: s.y },
2492
2492
  // V: vertical to end
2493
2493
  s
2494
2494
  // H: horizontal to end
2495
- ], B = U);
2495
+ ], B = I);
2496
2496
  } else
2497
2497
  return null;
2498
2498
  break;
2499
2499
  case "2seg":
2500
- tt < nt ? Math.abs(U - c.y) < v ? (K = [c, { x: s.x, y: c.y }, s], B = c.y) : (K = [
2500
+ A < et ? Math.abs(I - c.y) < v ? (K = [c, { x: s.x, y: c.y }, s], B = c.y) : (K = [
2501
2501
  c,
2502
2502
  { x: b, y: c.y },
2503
2503
  // H: horizontal extension
2504
- { x: b, y: U },
2504
+ { x: b, y: I },
2505
2505
  // V: vertical to midY
2506
- { x: X, y: U },
2506
+ { x: S, y: I },
2507
2507
  // H: horizontal at midY
2508
- { x: X, y: s.y },
2508
+ { x: S, y: s.y },
2509
2509
  // V: vertical to end
2510
2510
  s
2511
2511
  // H: horizontal to end
2512
- ], B = U) : Math.abs(U - s.y) < v ? (K = [
2512
+ ], B = I) : Math.abs(I - s.y) < v ? (K = [
2513
2513
  c,
2514
2514
  { x: b, y: c.y },
2515
2515
  // H: horizontal extension
@@ -2521,24 +2521,24 @@ function ie(t, e, r, n = xe) {
2521
2521
  c,
2522
2522
  { x: b, y: c.y },
2523
2523
  // H: horizontal extension
2524
- { x: b, y: U },
2524
+ { x: b, y: I },
2525
2525
  // V: vertical to midY
2526
- { x: X, y: U },
2526
+ { x: S, y: I },
2527
2527
  // H: horizontal at midY
2528
- { x: X, y: s.y },
2528
+ { x: S, y: s.y },
2529
2529
  // V: vertical to end
2530
2530
  s
2531
2531
  // H: horizontal to end
2532
- ], B = U);
2532
+ ], B = I);
2533
2533
  break;
2534
2534
  case "3seg":
2535
- const f = U;
2535
+ const f = I;
2536
2536
  K = [
2537
2537
  c,
2538
2538
  { x: b, y: c.y },
2539
2539
  { x: b, y: f },
2540
- { x: X, y: f },
2541
- { x: X, y: s.y },
2540
+ { x: S, y: f },
2541
+ { x: S, y: s.y },
2542
2542
  s
2543
2543
  ], B = f;
2544
2544
  break;
@@ -2547,39 +2547,39 @@ function ie(t, e, r, n = xe) {
2547
2547
  c,
2548
2548
  { x: b, y: c.y },
2549
2549
  // H: horizontal extension from start
2550
- { x: b, y: U },
2550
+ { x: b, y: I },
2551
2551
  // V: vertical to midY
2552
- { x: X, y: U },
2552
+ { x: S, y: I },
2553
2553
  // H: horizontal at midY to end extension
2554
2554
  s
2555
2555
  // Final segment (may be H or V depending on pathEnd.y vs testMidY)
2556
- ], B = U;
2556
+ ], B = I;
2557
2557
  break;
2558
2558
  case "5seg":
2559
- if (tt < v)
2559
+ if (A < v)
2560
2560
  K = [
2561
2561
  c,
2562
2562
  { x: b, y: c.y },
2563
2563
  // H: horizontal extension
2564
- { x: X, y: U },
2564
+ { x: S, y: I },
2565
2565
  // H: horizontal at midY (skip V since start.y ≈ testMidY)
2566
- { x: X, y: s.y },
2566
+ { x: S, y: s.y },
2567
2567
  // V: vertical to end Y
2568
2568
  s
2569
2569
  // H: horizontal to end
2570
- ], B = U;
2571
- else if (nt < v)
2570
+ ], B = I;
2571
+ else if (et < v)
2572
2572
  K = [
2573
2573
  c,
2574
2574
  { x: b, y: c.y },
2575
2575
  // H: horizontal extension
2576
- { x: b, y: U },
2576
+ { x: b, y: I },
2577
2577
  // V: vertical to midY
2578
- { x: X, y: U },
2578
+ { x: S, y: I },
2579
2579
  // H: horizontal at midY
2580
2580
  s
2581
2581
  // H: horizontal to end (skip V since testMidY ≈ pathEnd.y)
2582
- ], B = U;
2582
+ ], B = I;
2583
2583
  else
2584
2584
  return null;
2585
2585
  break;
@@ -2587,22 +2587,22 @@ function ie(t, e, r, n = xe) {
2587
2587
  K = [
2588
2588
  c,
2589
2589
  { x: b, y: c.y },
2590
- { x: b, y: U },
2591
- { x: X, y: U },
2592
- { x: X, y: s.y },
2590
+ { x: b, y: I },
2591
+ { x: S, y: I },
2592
+ { x: S, y: s.y },
2593
2593
  s
2594
- ], B = U;
2594
+ ], B = I;
2595
2595
  break;
2596
2596
  }
2597
- const et = g(K);
2598
- return et.length > 0 ? { points: et, actualMidY: B } : null;
2597
+ const tt = g(K);
2598
+ return tt.length > 0 ? { points: tt, actualMidY: B } : null;
2599
2599
  };
2600
2600
  let G;
2601
2601
  D ? G = R ? ["straight", "3seg"] : ["3seg"] : G = R ? ["straight", "3seg", "4seg", "5seg", "6seg"] : ["3seg", "4seg", "5seg", "6seg"];
2602
- for (const H of G) {
2603
- const U = Q(H, $);
2604
- if (U)
2605
- return { midY: U.actualMidY, points: U.points };
2602
+ for (const V of G) {
2603
+ const I = Q(V, $);
2604
+ if (I)
2605
+ return { midY: I.actualMidY, points: I.points };
2606
2606
  }
2607
2607
  const Z = Q("6seg", $);
2608
2608
  return Z ? { midY: Z.actualMidY, points: Z.points } : void 0;
@@ -2631,23 +2631,23 @@ function fr(t, e) {
2631
2631
  return r.push(`L${n.x},${n.y}`), r.join(" ");
2632
2632
  }
2633
2633
  function Ba(t, e, r, n = xe, o = !0, a = 0, i = 1 / 0, c, l, s, u, p, v, g, _ = !1) {
2634
- var U, tt, nt;
2634
+ var I, A, et;
2635
2635
  const D = v != null && t.edgeIndex === v, $ = t.getColor(), R = e.append("g").attr("class", D ? "edge selected" : "edge").attr("id", `edge_${t._gvid}`).attr("data-edge-id", t.edgeIndex !== void 0 ? String(t.edgeIndex) : "").attr("data-is-base", t.isBaseEdge ? "true" : "false").attr("data-color", $), Q = t.getStartPoint(), G = t.getEndPoint(), Z = t.getDirection();
2636
2636
  console.log(
2637
2637
  `Edge ${t._gvid}: direction=${Z}, isBase=${t.isBaseEdge}, depth=${t.depth}`,
2638
2638
  {
2639
2639
  start: Q,
2640
2640
  end: G,
2641
- sourceNode: (U = t.sourceNode) == null ? void 0 : U.name,
2642
- targetNode: (tt = t.targetNode) == null ? void 0 : tt.name
2641
+ sourceNode: (I = t.sourceNode) == null ? void 0 : I.name,
2642
+ targetNode: (A = t.targetNode) == null ? void 0 : A.name
2643
2643
  }
2644
2644
  );
2645
- const H = n.arrowWidth;
2645
+ const V = n.arrowWidth;
2646
2646
  if (n.arrowHeight, Q && G && Z) {
2647
- const b = { x: Q.x, y: r - Q.y }, X = { x: G.x, y: r - G.y }, K = { x: X.x, y: X.y };
2648
- let B = { x: X.x, y: X.y };
2649
- Z === "right" ? B = { x: X.x - H, y: X.y } : Z === "left" ? B = { x: X.x + H, y: X.y } : Z === "self" && (B = { x: X.x + H, y: X.y });
2650
- let et;
2647
+ const b = { x: Q.x, y: r - Q.y }, S = { x: G.x, y: r - G.y }, K = { x: S.x, y: S.y };
2648
+ let B = { x: S.x, y: S.y };
2649
+ Z === "right" ? B = { x: S.x - V, y: S.y } : Z === "left" ? B = { x: S.x + V, y: S.y } : Z === "self" && (B = { x: S.x + V, y: S.y });
2650
+ let tt;
2651
2651
  const f = n.loopRadius, C = n.horizontalExtension, m = n.cornerRadius;
2652
2652
  if (o)
2653
2653
  if (Z === "self")
@@ -2670,14 +2670,14 @@ function Ba(t, e, r, n = xe, o = !0, a = 0, i = 1 / 0, c, l, s, u, p, v, g, _ =
2670
2670
  B
2671
2671
  // rightIn of source node
2672
2672
  ];
2673
- et = fr(w, m);
2673
+ tt = fr(w, m);
2674
2674
  } else {
2675
2675
  const Y = b.x - f, w = b.y - f, x = B.x + f, M = B.y - f;
2676
- et = `M${b.x},${b.y} C${Y},${w} ${x},${M} ${B.x},${B.y}`;
2676
+ tt = `M${b.x},${b.y} C${Y},${w} ${x},${M} ${B.x},${B.y}`;
2677
2677
  }
2678
2678
  } else {
2679
2679
  const h = b.x - f, Y = b.y - f, w = B.x + f, x = B.y - f;
2680
- et = `M${b.x},${b.y} C${h},${Y} ${w},${x} ${B.x},${B.y}`;
2680
+ tt = `M${b.x},${b.y} C${h},${Y} ${w},${x} ${B.x},${B.y}`;
2681
2681
  }
2682
2682
  else {
2683
2683
  let h;
@@ -2686,11 +2686,11 @@ function Ba(t, e, r, n = xe, o = !0, a = 0, i = 1 / 0, c, l, s, u, p, v, g, _ =
2686
2686
  else {
2687
2687
  const Y = Math.abs(b.y - t.midY), w = Math.abs(t.midY - B.y), x = 20, M = Y >= x, y = w >= x, F = Z === "right" ? b.x + C : b.x - C, E = Z === "right" ? B.x - C : B.x + C;
2688
2688
  if (h = [], !M && !y) {
2689
- const k = (b.y + B.y) / 2;
2689
+ const j = (b.y + B.y) / 2;
2690
2690
  h.push(
2691
2691
  b,
2692
- { x: F, y: k },
2693
- { x: E, y: k },
2692
+ { x: F, y: j },
2693
+ { x: E, y: j },
2694
2694
  B
2695
2695
  );
2696
2696
  } else M ? y ? h.push(
@@ -2714,20 +2714,20 @@ function Ba(t, e, r, n = xe, o = !0, a = 0, i = 1 / 0, c, l, s, u, p, v, g, _ =
2714
2714
  B
2715
2715
  );
2716
2716
  }
2717
- et = fr(h, m);
2717
+ tt = fr(h, m);
2718
2718
  }
2719
2719
  else if (Z === "self") {
2720
2720
  const h = b.x - f, Y = b.y - f, w = B.x + f, x = B.y - f;
2721
- et = `M${b.x},${b.y} C${h},${Y} ${w},${x} ${B.x},${B.y}`;
2721
+ tt = `M${b.x},${b.y} C${h},${Y} ${w},${x} ${B.x},${B.y}`;
2722
2722
  } else {
2723
2723
  const h = B.x - b.x;
2724
2724
  B.y - b.y;
2725
2725
  const Y = 0.4, w = b.x + h * Y, x = b.y, M = B.x - h * Y, y = B.y;
2726
- et = `M${b.x},${b.y} C${w},${x} ${M},${y} ${B.x},${B.y}`;
2726
+ tt = `M${b.x},${b.y} C${w},${x} ${M},${y} ${B.x},${B.y}`;
2727
2727
  }
2728
- const L = _ && t.isBaseEdge ? "#000000" : t.getColor(), I = _ && t.isBaseEdge ? 4 : 1.5;
2729
- R.append("path").attr("d", et).attr("fill", "none").attr("stroke", "transparent").attr("stroke-width", 10).attr("class", "edge-hit-area").style("cursor", "pointer"), R.append("path").attr("d", et).attr("fill", "none").attr("stroke", L).attr("stroke-width", I).attr("class", "edge-path").style("pointer-events", "none"), R.on("mouseenter", function() {
2730
- it(this).raise();
2728
+ const L = _ && t.isBaseEdge ? "#000000" : t.getColor(), z = _ && t.isBaseEdge ? 4 : 1.5;
2729
+ R.append("path").attr("d", tt).attr("fill", "none").attr("stroke", "transparent").attr("stroke-width", 10).attr("class", "edge-hit-area").style("cursor", "pointer"), R.append("path").attr("d", tt).attr("fill", "none").attr("stroke", L).attr("stroke-width", z).attr("class", "edge-path").style("pointer-events", "none"), R.on("mouseenter", function() {
2730
+ at(this).raise();
2731
2731
  });
2732
2732
  const N = 12;
2733
2733
  let P = "";
@@ -2738,79 +2738,79 @@ function Ba(t, e, r, n = xe, o = !0, a = 0, i = 1 / 0, c, l, s, u, p, v, g, _ =
2738
2738
  };
2739
2739
  if (t.label) {
2740
2740
  let h = "";
2741
- (nt = t.edgeContent) != null && nt.elems && t.edgeContent.elems.length > 0 && (h = t.edgeContent.elems.map((st) => st.text).join(" ")), h || (h = Ca(t.label).map((pt) => pt.length > 20 ? pt.slice(0, 20) + "..." : pt).join(" "));
2742
- const Y = h.length > 60 ? h.slice(0, 60) + "..." : h, w = n.labelFontSize, x = w * 0.6, M = Y.length * x, y = w, F = n.labelPadding, E = 16, k = D ? 16 : 0, V = t.edgeIndex !== void 0, ot = V && t.edgeIndex > a, W = V && t.edgeIndex < i, S = (ot ? E : 0) + (W ? E : 0) + k, O = M + F * 2 + S, T = y + F * 2, z = n.labelCornerRadius, j = d.y, J = d.x, rt = (st) => it(`g.edge[data-edge-id="${st}"]`), q = 12, A = R.append("g").attr("class", "label-area");
2743
- A.append("rect").attr("class", "label-bg").attr("x", J - O / 2).attr("y", j - T / 2).attr("width", O).attr("height", T).attr("rx", z).attr("ry", z).attr("fill", "white").attr("stroke", L).attr("stroke-width", 1);
2744
- const at = J - O / 2 + E / 2, dt = J + O / 2 - E / 2 - k, ct = J + O / 2 - k / 2, kt = J + (ot ? E / 2 : 0) - (W ? E / 2 : 0) - (D ? k / 2 : 0);
2745
- if (V && g && R.style("cursor", "pointer").on("click", function(st) {
2746
- st.stopPropagation(), !D && g(t.edgeIndex);
2747
- }), A.append("text").attr("class", "label-text").attr("x", kt).attr("y", j).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Inter, Helvetica, Arial").attr("font-size", "10px").attr("fill", L).style("pointer-events", "none").text(Y), _ && R.append("circle").attr("cx", kt).attr("cy", j).attr("r", 4).attr("fill", "blue").attr("opacity", 0.8).style("pointer-events", "none").attr("class", "debug-label-center"), ot) {
2748
- const st = t.edgeIndex - 1, pt = A.append("g").attr("class", "nav-btn-group prev-btn-group");
2749
- pt.append("rect").attr("class", "nav-btn-area prev-btn-area").attr("x", J - O / 2).attr("y", j - T / 2).attr("width", E).attr("height", T).attr("fill", "transparent").attr("rx", z).style("cursor", "pointer").style("pointer-events", "all"), pt.append("use").attr("class", "nav-icon prev-icon").attr("href", "#nav-left").attr("x", at - q / 2).attr("y", j - q / 2).attr("width", q).attr("height", q).attr("fill", "#888"), pt.on("click", function(ht) {
2750
- ht.stopPropagation();
2751
- const wt = rt(st);
2752
- if (!wt.empty()) {
2741
+ (et = t.edgeContent) != null && et.elems && t.edgeContent.elems.length > 0 && (h = t.edgeContent.elems.map((it) => it.text).join(" ")), h || (h = Ca(t.label).map((lt) => lt.length > 20 ? lt.slice(0, 20) + "..." : lt).join(" "));
2742
+ const Y = h.length > 60 ? h.slice(0, 60) + "..." : h, w = n.labelFontSize, x = w * 0.6, M = Y.length * x, y = w, F = n.labelPadding, E = 16, j = D ? 16 : 0, T = t.edgeIndex !== void 0, nt = T && t.edgeIndex > a, q = T && t.edgeIndex < i, k = (nt ? E : 0) + (q ? E : 0) + j, O = M + F * 2 + k, U = y + F * 2, X = n.labelCornerRadius, H = d.y, rt = d.x, ot = (it) => at(`g.edge[data-edge-id="${it}"]`), W = 12, J = R.append("g").attr("class", "label-area");
2743
+ J.append("rect").attr("class", "label-bg").attr("x", rt - O / 2).attr("y", H - U / 2).attr("width", O).attr("height", U).attr("rx", X).attr("ry", X).attr("fill", "white").attr("stroke", L).attr("stroke-width", 1);
2744
+ const ct = rt - O / 2 + E / 2, vt = rt + O / 2 - E / 2 - j, st = rt + O / 2 - j / 2, Jt = rt + (nt ? E / 2 : 0) - (q ? E / 2 : 0) - (D ? j / 2 : 0);
2745
+ if (T && g && R.style("cursor", "pointer").on("click", function(it) {
2746
+ it.stopPropagation(), !D && g(t.edgeIndex);
2747
+ }), J.append("text").attr("class", "label-text").attr("x", Jt).attr("y", H).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Inter, Helvetica, Arial").attr("font-size", "10px").attr("fill", L).style("pointer-events", "none").text(Y), _ && R.append("circle").attr("cx", Jt).attr("cy", H).attr("r", 4).attr("fill", "blue").attr("opacity", 0.8).style("pointer-events", "none").attr("class", "debug-label-center"), nt) {
2748
+ const it = t.edgeIndex - 1, lt = J.append("g").attr("class", "nav-btn-group prev-btn-group");
2749
+ lt.append("rect").attr("class", "nav-btn-area prev-btn-area").attr("x", rt - O / 2).attr("y", H - U / 2).attr("width", E).attr("height", U).attr("fill", "transparent").attr("rx", X).style("cursor", "pointer").style("pointer-events", "all"), lt.append("use").attr("class", "nav-icon prev-icon").attr("href", "#nav-left").attr("x", ct - W / 2).attr("y", H - W / 2).attr("width", W).attr("height", W).attr("fill", "#888"), lt.on("click", function(Et) {
2750
+ Et.stopPropagation();
2751
+ const At = ot(it);
2752
+ if (!At.empty()) {
2753
2753
  if (c && l && s && u && p) {
2754
- const xt = wt.node();
2755
- if (xt) {
2756
- const Rt = it(xt).select(".label-text").node();
2757
- let Lt, Yt;
2758
- if (Rt)
2759
- Lt = parseFloat(Rt.getAttribute("x") || "0"), Yt = parseFloat(Rt.getAttribute("y") || "0");
2754
+ const Nt = At.node();
2755
+ if (Nt) {
2756
+ const Ct = at(Nt).select(".label-text").node();
2757
+ let _t, Rt;
2758
+ if (Ct)
2759
+ _t = parseFloat(Ct.getAttribute("x") || "0"), Rt = parseFloat(Ct.getAttribute("y") || "0");
2760
2760
  else {
2761
- const Xt = xt.getBBox();
2762
- Lt = Xt.x + Xt.width / 2, Yt = Xt.y + Xt.height / 2;
2761
+ const $t = Nt.getBBox();
2762
+ _t = $t.x + $t.width / 2, Rt = $t.y + $t.height / 2;
2763
2763
  }
2764
- const zt = s.clientWidth, jt = 1.2 * u / zt, Gt = u / 2 - Lt * jt, Ee = p / 2 - Yt * jt;
2764
+ const It = s.clientWidth, kt = 1.2 * u / It, zt = u / 2 - _t * kt, Ee = p / 2 - Rt * kt;
2765
2765
  l.transition().duration(500).call(
2766
2766
  c.transform,
2767
- _t.translate(Gt, Ee).scale(jt)
2767
+ Ft.translate(zt, Ee).scale(kt)
2768
2768
  );
2769
2769
  }
2770
2770
  }
2771
- g && g(st);
2771
+ g && g(it);
2772
2772
  }
2773
2773
  });
2774
2774
  }
2775
- if (W && t.edgeIndex !== void 0) {
2776
- const st = t.edgeIndex + 1, pt = D ? dt : J + O / 2 - E / 2, ht = A.append("g").attr("class", "nav-btn-group next-btn-group");
2777
- ht.append("rect").attr("class", "nav-btn-area next-btn-area").attr("x", J + O / 2 - E - k).attr("y", j - T / 2).attr("width", E).attr("height", T).attr("fill", "transparent").attr("rx", z).style("cursor", "pointer").style("pointer-events", "all"), ht.append("use").attr("class", "nav-icon next-icon").attr("href", "#nav-right").attr("x", pt - q / 2).attr("y", j - q / 2).attr("width", q).attr("height", q).attr("fill", "#888"), ht.on("click", function(wt) {
2778
- wt.stopPropagation();
2779
- const xt = rt(st);
2780
- if (!xt.empty()) {
2775
+ if (q && t.edgeIndex !== void 0) {
2776
+ const it = t.edgeIndex + 1, lt = D ? vt : rt + O / 2 - E / 2, Et = J.append("g").attr("class", "nav-btn-group next-btn-group");
2777
+ Et.append("rect").attr("class", "nav-btn-area next-btn-area").attr("x", rt + O / 2 - E - j).attr("y", H - U / 2).attr("width", E).attr("height", U).attr("fill", "transparent").attr("rx", X).style("cursor", "pointer").style("pointer-events", "all"), Et.append("use").attr("class", "nav-icon next-icon").attr("href", "#nav-right").attr("x", lt - W / 2).attr("y", H - W / 2).attr("width", W).attr("height", W).attr("fill", "#888"), Et.on("click", function(At) {
2778
+ At.stopPropagation();
2779
+ const Nt = ot(it);
2780
+ if (!Nt.empty()) {
2781
2781
  if (c && l && s && u && p) {
2782
- const Rt = xt.node();
2783
- if (Rt) {
2784
- const Lt = it(Rt).select(".label-text").node();
2785
- let Yt, zt;
2786
- if (Lt)
2787
- Yt = parseFloat(Lt.getAttribute("x") || "0"), zt = parseFloat(Lt.getAttribute("y") || "0");
2782
+ const Ct = Nt.node();
2783
+ if (Ct) {
2784
+ const _t = at(Ct).select(".label-text").node();
2785
+ let Rt, It;
2786
+ if (_t)
2787
+ Rt = parseFloat(_t.getAttribute("x") || "0"), It = parseFloat(_t.getAttribute("y") || "0");
2788
2788
  else {
2789
- const te = Rt.getBBox();
2790
- Yt = te.x + te.width / 2, zt = te.y + te.height / 2;
2789
+ const te = Ct.getBBox();
2790
+ Rt = te.x + te.width / 2, It = te.y + te.height / 2;
2791
2791
  }
2792
- const jt = s.clientWidth, Gt = 1.2 * u / jt, Ee = u / 2 - Yt * Gt, Xt = p / 2 - zt * Gt;
2792
+ const kt = s.clientWidth, zt = 1.2 * u / kt, Ee = u / 2 - Rt * zt, $t = p / 2 - It * zt;
2793
2793
  l.transition().duration(500).call(
2794
2794
  c.transform,
2795
- _t.translate(Ee, Xt).scale(Gt)
2795
+ Ft.translate(Ee, $t).scale(zt)
2796
2796
  );
2797
2797
  }
2798
2798
  }
2799
- g && g(st);
2799
+ g && g(it);
2800
2800
  }
2801
2801
  });
2802
2802
  }
2803
- D && V && g && R.append("text").attr("class", "close-btn").attr("x", ct).attr("y", j).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Arial").attr("font-size", "12px").attr("font-weight", "bold").attr("fill", "#888").style("cursor", "pointer").text("✕").on("mouseenter", function() {
2804
- it(this).attr("fill", "#EF4444");
2803
+ D && T && g && R.append("text").attr("class", "close-btn").attr("x", st).attr("y", H).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Arial").attr("font-size", "12px").attr("font-weight", "bold").attr("fill", "#888").style("cursor", "pointer").text("✕").on("mouseenter", function() {
2804
+ at(this).attr("fill", "#EF4444");
2805
2805
  }).on("mouseleave", function() {
2806
- it(this).attr("fill", "#888");
2807
- }).on("click", function(st) {
2808
- st.stopPropagation(), g(null);
2806
+ at(this).attr("fill", "#888");
2807
+ }).on("click", function(it) {
2808
+ it.stopPropagation(), g(null);
2809
2809
  });
2810
2810
  } else t._ldraw_ && t._ldraw_.forEach((h) => {
2811
2811
  if (h.op === "T" && h.text) {
2812
- const Y = h.size || 10, w = Y * 0.6, x = h.text.length * w, M = Y, y = 6, F = x + y * 2, E = M + y * 2, k = 4, V = d.y;
2813
- R.append("rect").attr("x", d.x - F / 2).attr("y", V - E / 2).attr("width", F).attr("height", E).attr("rx", k).attr("ry", k).attr("fill", "white").attr("stroke", "#d0d0d0").attr("stroke-width", 0.5), R.append("text").attr("x", d.x).attr("y", V).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", h.face || "Inter, Helvetica, Arial").attr("font-size", `${Y}px`).attr("fill", h.color || "#666").text(h.text);
2812
+ const Y = h.size || 10, w = Y * 0.6, x = h.text.length * w, M = Y, y = 6, F = x + y * 2, E = M + y * 2, j = 4, T = d.y;
2813
+ R.append("rect").attr("x", d.x - F / 2).attr("y", T - E / 2).attr("width", F).attr("height", E).attr("rx", j).attr("ry", j).attr("fill", "white").attr("stroke", "#d0d0d0").attr("stroke-width", 0.5), R.append("text").attr("x", d.x).attr("y", T).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", h.face || "Inter, Helvetica, Arial").attr("font-size", `${Y}px`).attr("fill", h.color || "#666").text(h.text);
2814
2814
  }
2815
2815
  });
2816
2816
  if (_) {
@@ -2820,22 +2820,22 @@ function Ba(t, e, r, n = xe, o = !0, a = 0, i = 1 / 0, c, l, s, u, p, v, g, _ =
2820
2820
  } else
2821
2821
  t._draw_ && t._draw_.forEach((b) => {
2822
2822
  if (b.op === "b" && b.points) {
2823
- const X = b.points.map(([B, et]) => [B, r - et]), K = `M${X[0][0]},${X[0][1]} C${X.slice(1).map((B) => `${B[0]},${B[1]}`).join(" ")}`;
2823
+ const S = b.points.map(([B, tt]) => [B, r - tt]), K = `M${S[0][0]},${S[0][1]} C${S.slice(1).map((B) => `${B[0]},${B[1]}`).join(" ")}`;
2824
2824
  R.append("path").attr("d", K).attr("fill", "none").attr("stroke", b.color || "#9AA4B2").attr("stroke-width", 2);
2825
2825
  }
2826
2826
  }), t._hdraw_ && t._hdraw_.forEach((b) => {
2827
2827
  if (b.op === "P" && b.points) {
2828
- const X = b.points.map(([K, B]) => [K, r - B]);
2829
- R.append("polygon").attr("points", X.map((K) => K.join(",")).join(" ")).attr("fill", b.color || "#9AA4B2");
2828
+ const S = b.points.map(([K, B]) => [K, r - B]);
2829
+ R.append("polygon").attr("points", S.map((K) => K.join(",")).join(" ")).attr("fill", b.color || "#9AA4B2");
2830
2830
  }
2831
- }), t._ldraw_ && Bt(R, t._ldraw_, r);
2831
+ }), t._ldraw_ && Yt(R, t._ldraw_, r);
2832
2832
  }
2833
2833
  function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
2834
2834
  var P;
2835
2835
  t.innerHTML = "";
2836
2836
  const _ = ((P = e.bb) == null ? void 0 : P.split(",").map(Number)) || [0, 0, 1e3, 800];
2837
2837
  let [, , D, $] = _;
2838
- const R = it(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${D} ${$}`).style("background", "white");
2838
+ const R = at(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${D} ${$}`).style("background", "white");
2839
2839
  R.append("defs").html(`
2840
2840
  <style>
2841
2841
  @keyframes selected-pulse {
@@ -2923,11 +2923,11 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
2923
2923
  height: v !== void 0 ? String(v / 72) : d.height,
2924
2924
  label: d.label
2925
2925
  })
2926
- ), H = /* @__PURE__ */ new Map();
2926
+ ), V = /* @__PURE__ */ new Map();
2927
2927
  Z.forEach((d) => {
2928
- H.set(d._gvid, d);
2928
+ V.set(d._gvid, d);
2929
2929
  });
2930
- const tt = (e.edges || []).map((d) => {
2930
+ const A = (e.edges || []).map((d) => {
2931
2931
  const h = new ba({
2932
2932
  _gvid: d._gvid,
2933
2933
  name: d.name,
@@ -2938,16 +2938,16 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
2938
2938
  head: d.head,
2939
2939
  tail: d.tail,
2940
2940
  label: d.label
2941
- }), Y = d.tail !== void 0 ? H.get(d.tail) : void 0, w = d.head !== void 0 ? H.get(d.head) : void 0;
2941
+ }), Y = d.tail !== void 0 ? V.get(d.tail) : void 0, w = d.head !== void 0 ? V.get(d.head) : void 0;
2942
2942
  return Y && w && h.setNodes(Y, w), h;
2943
- }), { nodeColumnMap: nt, nodeColumns: b, edgeColumns: X } = La(
2943
+ }), { nodeColumnMap: et, nodeColumns: b, edgeColumns: S } = La(
2944
2944
  Z,
2945
- tt
2945
+ A
2946
2946
  );
2947
- console.log("debug:", { nodeColumnMap: nt, nodeColumns: b, edgeColumns: X }), console.log(
2947
+ console.log("debug:", { nodeColumnMap: et, nodeColumns: b, edgeColumns: S }), console.log(
2948
2948
  "debug: edges sorted by midpoint Y:",
2949
2949
  Object.fromEntries(
2950
- Array.from(X.entries()).map(([d, h]) => [
2950
+ Array.from(S.entries()).map(([d, h]) => [
2951
2951
  d,
2952
2952
  h.edges.map((Y) => {
2953
2953
  const w = Y.getStartPoint(), x = Y.getEndPoint(), M = w && x ? (w.y + x.y) / 2 : 0;
@@ -2963,12 +2963,12 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
2963
2963
  ])
2964
2964
  )
2965
2965
  );
2966
- const K = Array.from(b.keys()).sort((d, h) => d - h), B = K.length, et = 80;
2966
+ const K = Array.from(b.keys()).sort((d, h) => d - h), B = K.length, tt = 80;
2967
2967
  let f;
2968
2968
  if (g !== void 0)
2969
- f = g, D = (B > 1 ? (B - 1) * f : 0) + 2 * et;
2969
+ f = g, D = (B > 1 ? (B - 1) * f : 0) + 2 * tt;
2970
2970
  else {
2971
- const d = D - 2 * et;
2971
+ const d = D - 2 * tt;
2972
2972
  f = B > 1 ? d / (B - 1) : 0;
2973
2973
  }
2974
2974
  if (K.forEach((d, h) => {
@@ -2978,150 +2978,149 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
2978
2978
  if (w.length === 0) return;
2979
2979
  console.log(
2980
2980
  `Column ${d} before sort:`,
2981
- w.map((S) => ({
2982
- name: S.name,
2983
- isVirtual: S.virtualNode,
2984
- pos: S.pos
2981
+ w.map((k) => ({
2982
+ name: k.name,
2983
+ isVirtual: k.virtualNode,
2984
+ pos: k.pos
2985
2985
  }))
2986
2986
  );
2987
- const x = B > 1 ? et + h * f : D / 2;
2988
- w.sort((S, O) => {
2989
- const T = S.getPosition(), z = O.getPosition();
2990
- return !T || !z ? 0 : z[1] - T[1];
2987
+ const x = B > 1 ? tt + h * f : D / 2;
2988
+ w.sort((k, O) => {
2989
+ const U = k.getPosition(), X = O.getPosition();
2990
+ return !U || !X ? 0 : X[1] - U[1];
2991
2991
  }), console.log(
2992
2992
  `Column ${d} after sort:`,
2993
- w.map((S) => ({
2994
- name: S.name,
2995
- isVirtual: S.virtualNode,
2996
- pos: S.pos
2993
+ w.map((k) => ({
2994
+ name: k.name,
2995
+ isVirtual: k.virtualNode,
2996
+ pos: k.pos
2997
2997
  }))
2998
2998
  );
2999
- const M = 50, y = w.filter((S) => !S.virtualNode), F = y.length;
2999
+ const M = 50, y = w.filter((k) => !k.virtualNode), F = y.length;
3000
3000
  if (F === 0) {
3001
- let S = ($ + w.reduce((O, T) => O + T.getHeightPoints(), 0)) / 2;
3001
+ let k = ($ + w.reduce((O, U) => O + U.getHeightPoints(), 0)) / 2;
3002
3002
  w.forEach((O) => {
3003
- const T = O.getHeightPoints();
3004
- S -= T / 2, O.pos = `${x},${S}`, S -= T / 2;
3003
+ const U = O.getHeightPoints();
3004
+ k -= U / 2, O.pos = `${x},${k}`, k -= U / 2;
3005
3005
  });
3006
3006
  return;
3007
3007
  }
3008
- let E, k;
3008
+ let E, j;
3009
3009
  if (F % 2 === 1) {
3010
- const S = Math.floor(F / 2), O = y[S];
3011
- k = w.indexOf(O), E = $ / 2;
3010
+ const k = Math.floor(F / 2), O = y[k];
3011
+ j = w.indexOf(O), E = $ / 2;
3012
3012
  } else {
3013
- const S = F / 2 - 1, O = F / 2, T = y[S];
3014
- y[O], k = w.indexOf(T), E = $ / 2;
3013
+ const k = F / 2 - 1, O = F / 2, U = y[k];
3014
+ y[O], j = w.indexOf(U), E = $ / 2;
3015
3015
  }
3016
- const V = w[k], ot = V.getHeightPoints();
3017
- V.pos = `${x},${E}`, console.log(
3018
- `Positioned center ${V.name} (virtual: ${V.virtualNode}) at ${V.pos}`
3016
+ const T = w[j], nt = T.getHeightPoints();
3017
+ T.pos = `${x},${E}`, console.log(
3018
+ `Positioned center ${T.name} (virtual: ${T.virtualNode}) at ${T.pos}`
3019
3019
  );
3020
- let W = E + ot / 2;
3021
- for (let S = k - 1; S >= 0; S--) {
3022
- const O = w[S], T = w[S + 1], z = O.getHeightPoints(), j = O.virtualNode || T.virtualNode ? 0 : M;
3023
- W += j + z / 2, O.pos = `${x},${W}`, console.log(
3024
- `Positioned ${O.name} (virtual: ${O.virtualNode}) at ${O.pos}, spacing: ${j}`
3025
- ), W += z / 2;
3020
+ let q = E + nt / 2;
3021
+ for (let k = j - 1; k >= 0; k--) {
3022
+ const O = w[k], U = w[k + 1], X = O.getHeightPoints(), H = O.virtualNode || U.virtualNode ? 0 : M;
3023
+ q += H + X / 2, O.pos = `${x},${q}`, console.log(
3024
+ `Positioned ${O.name} (virtual: ${O.virtualNode}) at ${O.pos}, spacing: ${H}`
3025
+ ), q += X / 2;
3026
3026
  }
3027
- W = E - ot / 2;
3028
- for (let S = k + 1; S < w.length; S++) {
3029
- const O = w[S], T = w[S - 1], z = O.getHeightPoints(), j = O.virtualNode || T.virtualNode ? 0 : M;
3030
- W -= j + z / 2, O.pos = `${x},${W}`, console.log(
3031
- `Positioned ${O.name} (virtual: ${O.virtualNode}) at ${O.pos}, spacing: ${j}`
3032
- ), W -= z / 2;
3027
+ q = E - nt / 2;
3028
+ for (let k = j + 1; k < w.length; k++) {
3029
+ const O = w[k], U = w[k - 1], X = O.getHeightPoints(), H = O.virtualNode || U.virtualNode ? 0 : M;
3030
+ q -= H + X / 2, O.pos = `${x},${q}`, console.log(
3031
+ `Positioned ${O.name} (virtual: ${O.virtualNode}) at ${O.pos}, spacing: ${H}`
3032
+ ), q -= X / 2;
3033
3033
  }
3034
3034
  }), g !== void 0 && R.attr("viewBox", `0 0 ${D} ${$}`), b.forEach((d) => {
3035
3035
  d.nodes.forEach((h) => {
3036
- var T, z;
3037
3036
  const Y = h.getPosition();
3038
3037
  if (!Y) return;
3039
3038
  const [w, x] = Y, M = h.getWidthPoints(), y = h.getHeightPoints(), F = h.virtualNode;
3040
3039
  if (F && !l) return;
3041
- const E = Q.append("g").attr("class", F ? "node virtual-node" : "node").attr("id", h.name), k = l && F;
3042
- let V = null;
3040
+ const E = Q.append("g").attr("class", F ? "node virtual-node" : "node").attr("id", h.name), j = l && F;
3041
+ let T = null;
3043
3042
  try {
3044
- h.label && (V = dr(h.label));
3045
- } catch (j) {
3046
- console.warn(`Failed to decode node label for ${h.name}:`, j);
3043
+ h.label && (T = dr(h.label));
3044
+ } catch (U) {
3045
+ console.warn(`Failed to decode node label for ${h.name}:`, U);
3047
3046
  }
3048
- const ot = (V == null ? void 0 : V.tags) || [], W = ((T = V == null ? void 0 : V.label) == null ? void 0 : T.text) || "", S = ((z = V == null ? void 0 : V.text) == null ? void 0 : z.text) || "";
3049
- if ((ot.length > 0 || W.length > 0) && !F) {
3050
- const j = y / 2, J = y / 2, rt = $ - x - y / 2;
3051
- E.append("rect").attr("x", w - M / 2).attr("y", rt).attr("width", M).attr("height", j).attr("rx", 5).attr("ry", 0).attr("fill", "#EDF2F7").attr("stroke", "#D5DFEA").attr("stroke-width", 1), E.append("rect").attr("x", w - M / 2).attr("y", rt + j).attr("width", M).attr("height", J).attr("rx", 0).attr("ry", 5).attr("fill", "white").attr("stroke", "#D5DFEA").attr("stroke-width", 1);
3052
- const q = E.append("rect").attr("x", w - M / 2).attr("y", rt).attr("width", M).attr("height", y).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#D5DFEA").attr("stroke-width", 1), A = E.append("rect").attr("x", w - M / 2 - 4).attr("y", rt - 4).attr("width", M + 8).attr("height", y + 8).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#000000").attr("stroke-width", 2).attr("opacity", 0).style("pointer-events", "none");
3053
- q.style("cursor", "pointer").on("mouseenter", function() {
3054
- A.attr("opacity", 1);
3047
+ const nt = (T == null ? void 0 : T.tags) || [], q = (T == null ? void 0 : T.label) || "", k = (T == null ? void 0 : T.text) || "";
3048
+ if ((nt.length > 0 || q.length > 0) && !F) {
3049
+ const U = y / 2, X = y / 2, H = $ - x - y / 2;
3050
+ E.append("rect").attr("x", w - M / 2).attr("y", H).attr("width", M).attr("height", U).attr("rx", 5).attr("ry", 0).attr("fill", "#EDF2F7").attr("stroke", "#D5DFEA").attr("stroke-width", 1), E.append("rect").attr("x", w - M / 2).attr("y", H + U).attr("width", M).attr("height", X).attr("rx", 0).attr("ry", 5).attr("fill", "white").attr("stroke", "#D5DFEA").attr("stroke-width", 1);
3051
+ const rt = E.append("rect").attr("x", w - M / 2).attr("y", H).attr("width", M).attr("height", y).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#D5DFEA").attr("stroke-width", 1), ot = E.append("rect").attr("x", w - M / 2 - 4).attr("y", H - 4).attr("width", M + 8).attr("height", y + 8).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#000000").attr("stroke-width", 2).attr("opacity", 0).style("pointer-events", "none");
3052
+ rt.style("cursor", "pointer").on("mouseenter", function() {
3053
+ ot.attr("opacity", 1);
3055
3054
  }).on("mouseleave", function() {
3056
- A.attr("opacity", 0);
3055
+ ot.attr("opacity", 0);
3057
3056
  });
3058
- let at = w - M / 2 + 8;
3059
- const dt = rt + j / 2, ct = 7.2, kt = 6, st = 18, pt = 4;
3060
- if (ot.forEach((ht) => {
3061
- const xt = ht.length * ct + kt * 2;
3062
- E.append("rect").attr("x", at).attr("y", dt - st / 2).attr("width", xt).attr("height", st).attr("rx", 5).attr("ry", 5).attr("fill", "#4E1E03").attr("stroke", "#AA4E09").attr("stroke-width", 1), E.append("text").attr("x", at + kt).attr("y", dt).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-inter), Inter, Helvetica, Arial").attr("font-size", "12px").attr("font-weight", "500").attr("fill", "white").text(ht), at += xt + pt;
3063
- }), W) {
3064
- const ht = w + M / 2 - 8 - at, wt = E.append("text").attr("x", at).attr("y", dt).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-inter), Inter, Helvetica, Arial").attr("font-size", "12px").attr("font-weight", "600").attr("fill", "#334155");
3065
- _e(wt, ht, W);
3057
+ let W = w - M / 2 + 8;
3058
+ const J = H + U / 2, ct = 7.2, vt = 6, st = 18, Jt = 4;
3059
+ if (nt.forEach((it) => {
3060
+ const Et = it.length * ct + vt * 2;
3061
+ E.append("rect").attr("x", W).attr("y", J - st / 2).attr("width", Et).attr("height", st).attr("rx", 5).attr("ry", 5).attr("fill", "#4E1E03").attr("stroke", "#AA4E09").attr("stroke-width", 1), E.append("text").attr("x", W + vt).attr("y", J).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-inter), Inter, Helvetica, Arial").attr("font-size", "12px").attr("font-weight", "500").attr("fill", "white").text(it), W += Et + Jt;
3062
+ }), q) {
3063
+ const it = w + M / 2 - 8 - W, lt = E.append("text").attr("x", W).attr("y", J).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-inter), Inter, Helvetica, Arial").attr("font-size", "12px").attr("font-weight", "600").attr("fill", "#334155");
3064
+ _e(lt, it, q);
3066
3065
  }
3067
- if (S) {
3068
- const ht = M - 16, wt = E.append("text").attr("x", w - M / 2 + 8).attr("y", rt + j + J / 2).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", "#334155");
3069
- _e(wt, ht, S);
3066
+ if (k) {
3067
+ const it = M - 16, lt = E.append("text").attr("x", w - M / 2 + 8).attr("y", H + U + X / 2).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", "#334155");
3068
+ _e(lt, it, k);
3070
3069
  }
3071
3070
  } else {
3072
- const j = E.append("rect").attr("x", w - M / 2).attr("y", $ - x - y / 2).attr("width", M).attr("height", y).attr("rx", 5).attr("ry", 5).attr("fill", k ? "#FEF2F2" : "white").attr("stroke", k ? "#EF4444" : "#D5DFEA").attr("stroke-width", k ? 2 : 1);
3071
+ const U = E.append("rect").attr("x", w - M / 2).attr("y", $ - x - y / 2).attr("width", M).attr("height", y).attr("rx", 5).attr("ry", 5).attr("fill", j ? "#FEF2F2" : "white").attr("stroke", j ? "#EF4444" : "#D5DFEA").attr("stroke-width", j ? 2 : 1);
3073
3072
  if (!F) {
3074
- const J = E.append("rect").attr("x", w - M / 2 - 4).attr("y", $ - x - y / 2 - 4).attr("width", M + 8).attr("height", y + 8).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#000000").attr("stroke-width", 2).attr("opacity", 0).style("pointer-events", "none");
3075
- j.style("cursor", "pointer").on("mouseenter", function() {
3076
- J.attr("opacity", 1);
3073
+ const X = E.append("rect").attr("x", w - M / 2 - 4).attr("y", $ - x - y / 2 - 4).attr("width", M + 8).attr("height", y + 8).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#000000").attr("stroke-width", 2).attr("opacity", 0).style("pointer-events", "none");
3074
+ U.style("cursor", "pointer").on("mouseenter", function() {
3075
+ X.attr("opacity", 1);
3077
3076
  }).on("mouseleave", function() {
3078
- J.attr("opacity", 0);
3077
+ X.attr("opacity", 0);
3079
3078
  });
3080
3079
  }
3081
- if (V)
3080
+ if (T)
3082
3081
  if (F) {
3083
- const J = W || S;
3082
+ const X = q || k;
3084
3083
  E.append("text").attr("x", w).attr("y", $ - x).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Inter, Helvetica, Arial").attr("font-size", "10px").attr("fill", "#991B1B").text(
3085
- J.length > 20 ? J.slice(0, 20) + "..." : J
3084
+ X.length > 20 ? X.slice(0, 20) + "..." : X
3086
3085
  );
3087
3086
  } else {
3088
- const J = S || W, rt = M - 16, q = E.append("text").attr("x", w - M / 2 + 8).attr("y", $ - x).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", "#334155");
3089
- _e(q, rt, J);
3087
+ const X = k || q, H = M - 16, rt = E.append("text").attr("x", w - M / 2 + 8).attr("y", $ - x).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", "#334155");
3088
+ _e(rt, H, X);
3090
3089
  }
3091
3090
  }
3092
- !h.label && h._ldraw_ && h._ldraw_.length > 0 && !F && h._ldraw_.forEach((j) => {
3093
- j.op === "T" && j.text && E.append("text").attr("x", w - M / 2 + 8).attr("y", $ - x).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", j.face || "Inter, Helvetica, Arial").attr("font-size", `${j.size || 11}px`).attr("fill", j.color || "#334155").text(j.text);
3091
+ !h.label && h._ldraw_ && h._ldraw_.length > 0 && !F && h._ldraw_.forEach((U) => {
3092
+ U.op === "T" && U.text && E.append("text").attr("x", w - M / 2 + 8).attr("y", $ - x).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", U.face || "Inter, Helvetica, Arial").attr("font-size", `${U.size || 11}px`).attr("fill", U.color || "#334155").text(U.text);
3094
3093
  });
3095
3094
  });
3096
3095
  }), i) {
3097
- Ya(b, $), Da(tt, X), console.log(
3096
+ Ya(b, $), Da(A, S), console.log(
3098
3097
  "debug: base edges selected:",
3099
3098
  Object.fromEntries(
3100
- Array.from(X.entries()).map(([y, F]) => {
3101
- var E, k;
3099
+ Array.from(S.entries()).map(([y, F]) => {
3100
+ var E, j;
3102
3101
  return [
3103
3102
  y,
3104
3103
  {
3105
3104
  baseEdge: (E = F.baseEdge) == null ? void 0 : E.name,
3106
- baseEdgeId: (k = F.baseEdge) == null ? void 0 : k.edgeIndex,
3105
+ baseEdgeId: (j = F.baseEdge) == null ? void 0 : j.edgeIndex,
3107
3106
  baseEdgeIndex: F.baseEdgeIndex,
3108
3107
  totalEdges: F.edges.length,
3109
- depth0Edges: F.edges.filter((V) => V.depth === 0).length
3108
+ depth0Edges: F.edges.filter((T) => T.depth === 0).length
3110
3109
  }
3111
3110
  ];
3112
3111
  })
3113
3112
  )
3114
3113
  );
3115
3114
  const d = a.loopRadius, h = a.edgeSpacing, Y = a.labelHeight;
3116
- X.forEach((y) => {
3115
+ S.forEach((y) => {
3117
3116
  const F = y.edges;
3118
3117
  if (F.length === 0) return;
3119
- const E = y.baseEdge, k = y.baseEdgeIndex;
3120
- if (!E || k < 0) return;
3121
- const V = E.getStartPoint(), ot = E.getEndPoint();
3122
- if (!V || !ot) return;
3123
- const W = $ - V.y, S = $ - ot.y;
3124
- E.midY = (W + S) / 2;
3118
+ const E = y.baseEdge, j = y.baseEdgeIndex;
3119
+ if (!E || j < 0) return;
3120
+ const T = E.getStartPoint(), nt = E.getEndPoint();
3121
+ if (!T || !nt) return;
3122
+ const q = $ - T.y, k = $ - nt.y;
3123
+ E.midY = (q + k) / 2;
3125
3124
  const O = ie(
3126
3125
  E,
3127
3126
  $,
@@ -3129,52 +3128,52 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
3129
3128
  a
3130
3129
  );
3131
3130
  O && (E.midY = O.midY, E.orthogonalPathPoints = O.points), y.aboveY = E.midY, y.belowY = E.midY;
3132
- for (let T = k - 1; T >= 0; T--) {
3133
- const z = F[T];
3134
- if (z.depth !== 0) continue;
3135
- if (z.getDirection() === "self") {
3136
- const A = z.getStartPoint();
3137
- A && (z.midY = $ - A.y - d);
3131
+ for (let U = j - 1; U >= 0; U--) {
3132
+ const X = F[U];
3133
+ if (X.depth !== 0) continue;
3134
+ if (X.getDirection() === "self") {
3135
+ const J = X.getStartPoint();
3136
+ J && (X.midY = $ - J.y - d);
3138
3137
  continue;
3139
3138
  }
3140
- const J = z.label ? h + Y : h;
3141
- z.midY = y.aboveY - J, y.aboveY = z.midY, z.baseDirection = "above", z.baseOffset = -(k - T);
3142
- const rt = T < F.length - 1 ? F[T + 1] : void 0, q = ie(
3143
- z,
3139
+ const rt = X.label ? h + Y : h;
3140
+ X.midY = y.aboveY - rt, y.aboveY = X.midY, X.baseDirection = "above", X.baseOffset = -(j - U);
3141
+ const ot = U < F.length - 1 ? F[U + 1] : void 0, W = ie(
3142
+ X,
3144
3143
  $,
3145
- rt,
3144
+ ot,
3146
3145
  a
3147
3146
  );
3148
- q && (z.midY = q.midY, z.orthogonalPathPoints = q.points, y.aboveY = z.midY);
3147
+ W && (X.midY = W.midY, X.orthogonalPathPoints = W.points, y.aboveY = X.midY);
3149
3148
  }
3150
- for (let T = k + 1; T < F.length; T++) {
3151
- const z = F[T];
3152
- if (z.depth !== 0) continue;
3153
- if (z.getDirection() === "self") {
3154
- const A = z.getStartPoint();
3155
- A && (z.midY = $ - A.y - d);
3149
+ for (let U = j + 1; U < F.length; U++) {
3150
+ const X = F[U];
3151
+ if (X.depth !== 0) continue;
3152
+ if (X.getDirection() === "self") {
3153
+ const J = X.getStartPoint();
3154
+ J && (X.midY = $ - J.y - d);
3156
3155
  continue;
3157
3156
  }
3158
- const J = z.label ? h + Y : h;
3159
- z.midY = y.belowY + J, y.belowY = z.midY, z.baseDirection = "below", z.baseOffset = T - k;
3160
- const rt = T > 0 ? F[T - 1] : void 0, q = ie(
3161
- z,
3157
+ const rt = X.label ? h + Y : h;
3158
+ X.midY = y.belowY + rt, y.belowY = X.midY, X.baseDirection = "below", X.baseOffset = U - j;
3159
+ const ot = U > 0 ? F[U - 1] : void 0, W = ie(
3160
+ X,
3162
3161
  $,
3163
- rt,
3162
+ ot,
3164
3163
  a
3165
3164
  );
3166
- q && (z.midY = q.midY, z.orthogonalPathPoints = q.points, y.belowY = z.midY);
3165
+ W && (X.midY = W.midY, X.orthogonalPathPoints = W.points, y.belowY = X.midY);
3167
3166
  }
3168
3167
  });
3169
3168
  const w = [];
3170
- X.forEach((y) => {
3169
+ S.forEach((y) => {
3171
3170
  const F = y.edges;
3172
- F.length === 0 || y.baseEdge || !F.every((k) => k.depth > 0) || F.forEach((k) => {
3173
- if (k.getDirection() !== "self")
3174
- w.push(k);
3171
+ F.length === 0 || y.baseEdge || !F.every((j) => j.depth > 0) || F.forEach((j) => {
3172
+ if (j.getDirection() !== "self")
3173
+ w.push(j);
3175
3174
  else {
3176
- const V = k.getStartPoint();
3177
- V && (k.midY = $ - V.y - d);
3175
+ const T = j.getStartPoint();
3176
+ T && (j.midY = $ - T.y - d);
3178
3177
  }
3179
3178
  });
3180
3179
  }), w.sort((y, F) => y.depth - F.depth), console.log("Processing deep edges by depth:", {
@@ -3182,7 +3181,7 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
3182
3181
  depths: [...new Set(w.map((y) => y.depth))].sort((y, F) => y - F)
3183
3182
  });
3184
3183
  let x = 1 / 0, M = -1 / 0;
3185
- X.forEach((y) => {
3184
+ S.forEach((y) => {
3186
3185
  y.aboveY !== 0 && (x = Math.min(x, y.aboveY)), y.belowY !== 0 && (M = Math.max(M, y.belowY));
3187
3186
  }), b.forEach((y) => {
3188
3187
  y.aboveY !== 0 && (x = Math.min(x, y.aboveY)), y.belowY !== 0 && (M = Math.max(M, y.belowY));
@@ -3191,57 +3190,57 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
3191
3190
  globalBelowY: M
3192
3191
  }), w.forEach((y) => {
3193
3192
  if (!y.sourceNode || !y.targetNode) return;
3194
- const F = nt.get(y.sourceNode._gvid), E = nt.get(y.targetNode._gvid);
3193
+ const F = et.get(y.sourceNode._gvid), E = et.get(y.targetNode._gvid);
3195
3194
  if (F === void 0 || E === void 0) return;
3196
- const k = Math.min(F, E), V = Math.max(F, E), ot = [];
3197
- for (let A = k; A <= V; A++) {
3198
- const at = b.get(A);
3199
- at && ot.push(...at.nodes);
3195
+ const j = Math.min(F, E), T = Math.max(F, E), nt = [];
3196
+ for (let J = j; J <= T; J++) {
3197
+ const ct = b.get(J);
3198
+ ct && nt.push(...ct.nodes);
3200
3199
  }
3201
- const W = ot.map((A) => {
3202
- const at = A.getPosition();
3203
- if (!at) return null;
3204
- const dt = $ - at[1], ct = A.height ? parseFloat(A.height) * 72 : 40;
3205
- return { y: dt, height: ct, bottomY: dt + ct / 2 };
3200
+ const q = nt.map((J) => {
3201
+ const ct = J.getPosition();
3202
+ if (!ct) return null;
3203
+ const vt = $ - ct[1], st = J.height ? parseFloat(J.height) * 72 : 40;
3204
+ return { y: vt, height: st, bottomY: vt + st / 2 };
3206
3205
  }).filter(
3207
- (A) => A !== null
3208
- ).sort((A, at) => A.y - at.y);
3209
- let S;
3210
- if (W.length === 0)
3211
- S = (x + M) / 2;
3212
- else if (W.length % 2 === 1)
3213
- S = W[Math.floor(W.length / 2)].bottomY;
3206
+ (J) => J !== null
3207
+ ).sort((J, ct) => J.y - ct.y);
3208
+ let k;
3209
+ if (q.length === 0)
3210
+ k = (x + M) / 2;
3211
+ else if (q.length % 2 === 1)
3212
+ k = q[Math.floor(q.length / 2)].bottomY;
3214
3213
  else {
3215
- const A = W.length / 2;
3216
- S = (W[A - 1].bottomY + W[A].bottomY) / 2;
3214
+ const J = q.length / 2;
3215
+ k = (q[J - 1].bottomY + q[J].bottomY) / 2;
3217
3216
  }
3218
- const O = y.getStartPoint(), T = y.getEndPoint(), j = (O && T ? $ - (O.y + T.y) / 2 : S) < S ? "above" : "below";
3219
- y.baseDirection = j;
3220
- const J = y.label ? h + Y : h;
3221
- let rt;
3222
- j === "above" ? (y.midY = x - J, rt = x, x = y.midY) : (y.midY = M + J, rt = M, M = y.midY), console.log("Placed deep edge:", {
3217
+ const O = y.getStartPoint(), U = y.getEndPoint(), H = (O && U ? $ - (O.y + U.y) / 2 : k) < k ? "above" : "below";
3218
+ y.baseDirection = H;
3219
+ const rt = y.label ? h + Y : h;
3220
+ let ot;
3221
+ H === "above" ? (y.midY = x - rt, ot = x, x = y.midY) : (y.midY = M + rt, ot = M, M = y.midY), console.log("Placed deep edge:", {
3223
3222
  edgeIndex: y.edgeIndex,
3224
3223
  depth: y.depth,
3225
- direction: j,
3224
+ direction: H,
3226
3225
  midY: y.midY,
3227
- centerNodeBottomY: S,
3226
+ centerNodeBottomY: k,
3228
3227
  globalAboveY: x,
3229
3228
  globalBelowY: M
3230
3229
  });
3231
- const q = ie(
3230
+ const W = ie(
3232
3231
  y,
3233
3232
  $,
3234
- { midY: rt },
3233
+ { midY: ot },
3235
3234
  a
3236
3235
  );
3237
- q && (y.midY = q.midY, y.orthogonalPathPoints = q.points, j === "above" ? x = Math.min(x, q.midY) : M = Math.max(M, q.midY));
3236
+ W && (y.midY = W.midY, y.orthogonalPathPoints = W.points, H === "above" ? x = Math.min(x, W.midY) : M = Math.max(M, W.midY));
3238
3237
  });
3239
3238
  }
3240
- const C = tt.map((d) => d.edgeIndex).filter((d) => d !== void 0), m = C.length > 0 ? Math.min(...C) : 0, L = C.length > 0 ? Math.max(...C) : 0, I = Ve().scaleExtent([0.1, Ea(t, D, c)]).on("zoom", (d) => {
3239
+ const C = A.map((d) => d.edgeIndex).filter((d) => d !== void 0), m = C.length > 0 ? Math.min(...C) : 0, L = C.length > 0 ? Math.max(...C) : 0, z = Ve().scaleExtent([0.1, Ea(t, D, c)]).on("zoom", (d) => {
3241
3240
  const h = d.transform;
3242
3241
  console.log("zoom event:", { x: h.x, y: h.y, k: h.k, isNaN: isNaN(h.x) || isNaN(h.y) || isNaN(h.k) }), !isNaN(h.x) && !isNaN(h.y) && !isNaN(h.k) && Q.attr("transform", h.toString());
3243
3242
  });
3244
- if (R.call(I), tt.forEach((d) => {
3243
+ if (R.call(z), A.forEach((d) => {
3245
3244
  if (n != null) {
3246
3245
  if (o) {
3247
3246
  if (d.depth > n) return;
@@ -3255,7 +3254,7 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
3255
3254
  i,
3256
3255
  m,
3257
3256
  L,
3258
- I,
3257
+ z,
3259
3258
  R,
3260
3259
  t,
3261
3260
  D,
@@ -3275,19 +3274,19 @@ function Pa(t, e, r, n, o = !0, a = xe, i = !0, c = 14, l = !1, s, u, p, v, g) {
3275
3274
  if (N) {
3276
3275
  const d = N.getBBox(), h = 0.9 * D / d.width, Y = d.x + d.width / 2, w = d.y + d.height / 2, x = D / 2 - Y * h, M = $ / 2 - w * h;
3277
3276
  R.call(
3278
- I.transform,
3279
- _t.translate(x, M).scale(h)
3277
+ z.transform,
3278
+ Ft.translate(x, M).scale(h)
3280
3279
  );
3281
3280
  }
3282
3281
  return {
3283
- zoomBehavior: I,
3282
+ zoomBehavior: z,
3284
3283
  svgElement: R.node(),
3285
3284
  gElement: Q.node(),
3286
3285
  baseFontSize: c,
3287
3286
  viewBoxWidth: D
3288
3287
  };
3289
3288
  }
3290
- function Bt(t, e, r) {
3289
+ function Yt(t, e, r) {
3291
3290
  let n = "#000000", o = "#000000", a = "#000000";
3292
3291
  e.forEach((i) => {
3293
3292
  switch (i.op) {
@@ -3354,7 +3353,7 @@ function Bt(t, e, r) {
3354
3353
  function Na(t, e, r = 14) {
3355
3354
  var g;
3356
3355
  t.innerHTML = "";
3357
- const n = ((g = e.bb) == null ? void 0 : g.split(",").map(Number)) || [0, 0, 1e3, 800], [, , o, a] = n, i = it(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${o} ${a}`).style("background", "white");
3356
+ const n = ((g = e.bb) == null ? void 0 : g.split(",").map(Number)) || [0, 0, 1e3, 800], [, , o, a] = n, i = at(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${o} ${a}`).style("background", "white");
3358
3357
  i.append("defs").html(`
3359
3358
  <style>
3360
3359
  .node rect, .node ellipse, .node polygon {
@@ -3368,10 +3367,10 @@ function Na(t, e, r = 14) {
3368
3367
  const c = i.append("g").attr("id", "graph0");
3369
3368
  (e.objects || []).forEach((_) => {
3370
3369
  const D = c.append("g").attr("class", "node").attr("id", _.name);
3371
- _._draw_ && Bt(D, _._draw_, a), _._ldraw_ && Bt(D, _._ldraw_, a);
3370
+ _._draw_ && Yt(D, _._draw_, a), _._ldraw_ && Yt(D, _._ldraw_, a);
3372
3371
  }), (e.edges || []).forEach((_) => {
3373
3372
  const D = c.append("g").attr("class", "edge").attr("id", `edge_${_._gvid}`);
3374
- _._draw_ && Bt(D, _._draw_, a), _._hdraw_ && Bt(D, _._hdraw_, a), _._tdraw_ && Bt(D, _._tdraw_, a), _._ldraw_ && Bt(D, _._ldraw_, a);
3373
+ _._draw_ && Yt(D, _._draw_, a), _._hdraw_ && Yt(D, _._hdraw_, a), _._tdraw_ && Yt(D, _._tdraw_, a), _._ldraw_ && Yt(D, _._ldraw_, a);
3375
3374
  });
3376
3375
  const u = Ve().scaleExtent([0.1, 10]).on("zoom", (_) => {
3377
3376
  c.attr("transform", _.transform.toString());
@@ -3411,7 +3410,7 @@ function $a(t) {
3411
3410
  let Se = null;
3412
3411
  Se = $a;
3413
3412
  function Xa() {
3414
- const t = lt(null), e = lt(null), [r, n] = He(!1), [o, a] = He(null), i = be(() => {
3413
+ const t = ut(null), e = ut(null), [r, n] = He(!1), [o, a] = He(null), i = be(() => {
3415
3414
  let s;
3416
3415
  return Se && (s = new Se()), s.onmessage = (u) => {
3417
3416
  const { id: p, success: v, json: g, error: _ } = u.data;
@@ -3450,13 +3449,13 @@ function Xa() {
3450
3449
  return { layout: c, cancel: l, isLoading: r, error: o };
3451
3450
  }
3452
3451
  function Ua({ onCancel: t }) {
3453
- return /* @__PURE__ */ Ct("div", { className: "absolute inset-0 bg-gray-900/80 flex flex-col items-center justify-center z-40", children: /* @__PURE__ */ ue("div", { className: "flex flex-col items-center gap-4", children: [
3454
- /* @__PURE__ */ Ct("div", { className: "w-12 h-12 border-4 border-blue-500/30 border-t-blue-500 rounded-full animate-spin" }),
3452
+ return /* @__PURE__ */ Mt("div", { className: "absolute inset-0 bg-gray-900/80 flex flex-col items-center justify-center z-40", children: /* @__PURE__ */ ue("div", { className: "flex flex-col items-center gap-4", children: [
3453
+ /* @__PURE__ */ Mt("div", { className: "w-12 h-12 border-4 border-blue-500/30 border-t-blue-500 rounded-full animate-spin" }),
3455
3454
  /* @__PURE__ */ ue("div", { className: "text-center", children: [
3456
- /* @__PURE__ */ Ct("p", { className: "text-white font-medium mb-1", children: "Processing layout..." }),
3457
- /* @__PURE__ */ Ct("p", { className: "text-gray-400 text-sm", children: "This may take a while for large graphs" })
3455
+ /* @__PURE__ */ Mt("p", { className: "text-white font-medium mb-1", children: "Processing layout..." }),
3456
+ /* @__PURE__ */ Mt("p", { className: "text-gray-400 text-sm", children: "This may take a while for large graphs" })
3458
3457
  ] }),
3459
- /* @__PURE__ */ Ct(
3458
+ /* @__PURE__ */ Mt(
3460
3459
  "button",
3461
3460
  {
3462
3461
  onClick: t,
@@ -3485,75 +3484,75 @@ const Ga = Or(function({
3485
3484
  nodeHeight: $ = 64,
3486
3485
  nodeColumnSpacing: R = 800
3487
3486
  }, Q) {
3488
- const G = lt(null), { layout: Z, cancel: H, isLoading: U, error: tt } = Xa(), nt = lt(null), b = lt(null), X = lt(null), K = lt(14), B = lt(1e3), et = lt(!1), f = lt(null), C = lt(null), m = lt(null), L = lt(null), I = lt(g);
3489
- return I.current = g, Tr(Q, () => ({
3487
+ const G = ut(null), { layout: Z, cancel: V, isLoading: I, error: A } = Xa(), et = ut(null), b = ut(null), S = ut(null), K = ut(14), B = ut(1e3), tt = ut(!1), f = ut(null), C = ut(null), m = ut(null), L = ut(null), z = ut(g);
3488
+ return z.current = g, Tr(Q, () => ({
3490
3489
  zoomIn: (N = 10) => {
3491
3490
  var M, y;
3492
- if (!nt.current || !b.current || !X.current) return;
3493
- const P = Wt(X.current), d = 1 + N / 100, h = P.k * d, Y = it(b.current), w = ((M = G.current) == null ? void 0 : M.clientWidth) || 1, x = ((y = G.current) == null ? void 0 : y.clientHeight) || 1;
3491
+ if (!et.current || !b.current || !S.current) return;
3492
+ const P = Vt(S.current), d = 1 + N / 100, h = P.k * d, Y = at(b.current), w = ((M = G.current) == null ? void 0 : M.clientWidth) || 1, x = ((y = G.current) == null ? void 0 : y.clientHeight) || 1;
3494
3493
  Y.transition().duration(300).call(
3495
- nt.current.scaleTo,
3494
+ et.current.scaleTo,
3496
3495
  h,
3497
3496
  [w / 2, x / 2]
3498
3497
  );
3499
3498
  },
3500
3499
  zoomOut: (N = 10) => {
3501
3500
  var M, y;
3502
- if (!nt.current || !b.current || !X.current) return;
3503
- const P = Wt(X.current), d = 1 - N / 100, h = Math.max(0.1, P.k * d), Y = it(b.current), w = ((M = G.current) == null ? void 0 : M.clientWidth) || 1, x = ((y = G.current) == null ? void 0 : y.clientHeight) || 1;
3501
+ if (!et.current || !b.current || !S.current) return;
3502
+ const P = Vt(S.current), d = 1 - N / 100, h = Math.max(0.1, P.k * d), Y = at(b.current), w = ((M = G.current) == null ? void 0 : M.clientWidth) || 1, x = ((y = G.current) == null ? void 0 : y.clientHeight) || 1;
3504
3503
  Y.transition().duration(300).call(
3505
- nt.current.scaleTo,
3504
+ et.current.scaleTo,
3506
3505
  h,
3507
3506
  [w / 2, x / 2]
3508
3507
  );
3509
3508
  },
3510
3509
  toggleZoom: () => {
3511
- var at, dt;
3512
- if (!nt.current || !b.current || !X.current) return;
3513
- const N = it(b.current), P = ((at = G.current) == null ? void 0 : at.clientWidth) || 1;
3514
- (dt = G.current) != null && dt.clientHeight;
3510
+ var ct, vt;
3511
+ if (!et.current || !b.current || !S.current) return;
3512
+ const N = at(b.current), P = ((ct = G.current) == null ? void 0 : ct.clientWidth) || 1;
3513
+ (vt = G.current) != null && vt.clientHeight;
3515
3514
  const d = K.current, h = b.current.getAttribute("viewBox");
3516
3515
  if (!h) return;
3517
3516
  const [, , Y, w] = h.split(" ").map(Number);
3518
3517
  if (isNaN(Y) || isNaN(w))
3519
3518
  return;
3520
3519
  if (!C.current) {
3521
- const ct = X.current.getBBox();
3522
- C.current = { x: ct.x, y: ct.y, width: ct.width, height: ct.height };
3520
+ const st = S.current.getBBox();
3521
+ C.current = { x: st.x, y: st.y, width: st.width, height: st.height };
3523
3522
  }
3524
3523
  const x = C.current;
3525
3524
  if (console.log("rootBBox:", x), isNaN(x.x) || isNaN(x.y) || isNaN(x.width) || isNaN(x.height)) {
3526
3525
  console.error("rootBBox contains NaN values, recalculating...");
3527
- const ct = X.current.getBBox();
3528
- C.current = { x: ct.x, y: ct.y, width: ct.width, height: ct.height };
3526
+ const st = S.current.getBBox();
3527
+ C.current = { x: st.x, y: st.y, width: st.width, height: st.height };
3529
3528
  }
3530
- const M = x.x + x.width / 2, y = x.y + x.height / 2, F = P / Y, E = 0.9 * Y / x.width, k = d * F * E, ot = 16 / (d * F), W = d * F * ot, S = Math.min(E, ot), O = Math.max(E, ot), T = Wt(b.current), z = d * F * T.k;
3529
+ const M = x.x + x.width / 2, y = x.y + x.height / 2, F = P / Y, E = 0.9 * Y / x.width, j = d * F * E, nt = 16 / (d * F), q = d * F * nt, k = Math.min(E, nt), O = Math.max(E, nt), U = Vt(b.current), X = d * F * U.k;
3531
3530
  console.log("toggleZoom debug:", {
3532
- currentState: et.current ? "zoomedIn" : "zoomedOut",
3533
- currentScale: T.k,
3534
- currentFontSize: z,
3531
+ currentState: tt.current ? "zoomedIn" : "zoomedOut",
3532
+ currentScale: U.k,
3533
+ currentFontSize: X,
3535
3534
  overviewScale: E,
3536
- overviewFontSize: k,
3537
- detailScale: ot,
3538
- detailFontSize: W,
3539
- zoomOutScale: S,
3535
+ overviewFontSize: j,
3536
+ detailScale: nt,
3537
+ detailFontSize: q,
3538
+ zoomOutScale: k,
3540
3539
  zoomInScale: O
3541
3540
  });
3542
- let j;
3543
- et.current ? (j = S, et.current = !1) : (j = O, f.current = Wt(b.current), et.current = !0), console.log("toggleZoom target:", {
3544
- targetScale: j,
3545
- targetFontSize: d * F * j,
3546
- newState: et.current ? "zoomedIn" : "zoomedOut"
3541
+ let H;
3542
+ tt.current ? (H = k, tt.current = !1) : (H = O, f.current = Vt(b.current), tt.current = !0), console.log("toggleZoom target:", {
3543
+ targetScale: H,
3544
+ targetFontSize: d * F * H,
3545
+ newState: tt.current ? "zoomedIn" : "zoomedOut"
3547
3546
  });
3548
- const J = Y / 2 - M * j, rt = w / 2 - y * j, q = _t.translate(J, rt).scale(j);
3549
- console.log("newTransform:", { x: q.x, y: q.y, k: q.k }), it(X.current).transition().duration(500).attr("transform", q.toString()).on("end", () => {
3550
- N.call(nt.current.transform, q);
3547
+ const rt = Y / 2 - M * H, ot = w / 2 - y * H, W = Ft.translate(rt, ot).scale(H);
3548
+ console.log("newTransform:", { x: W.x, y: W.y, k: W.k }), at(S.current).transition().duration(500).attr("transform", W.toString()).on("end", () => {
3549
+ N.call(et.current.transform, W);
3551
3550
  });
3552
3551
  },
3553
3552
  stopRendering: () => {
3554
- L.current && (clearInterval(L.current), L.current = null), m.current = null, H(), G.current && (G.current.innerHTML = ""), et.current = !1, f.current = null;
3553
+ L.current && (clearInterval(L.current), L.current = null), m.current = null, V(), G.current && (G.current.innerHTML = ""), tt.current = !1, f.current = null;
3555
3554
  }
3556
- }), [H]), Re(() => {
3555
+ }), [V]), Re(() => {
3557
3556
  if (!e || !G.current) return;
3558
3557
  let N = !1;
3559
3558
  return m.current = Date.now(), l && (L.current = setInterval(() => {
@@ -3596,17 +3595,17 @@ const Ga = Or(function({
3596
3595
  // selectedEdgeId - handle selection separately via useEffect
3597
3596
  (x) => {
3598
3597
  var M;
3599
- return (M = I.current) == null ? void 0 : M.call(I, x);
3598
+ return (M = z.current) == null ? void 0 : M.call(z, x);
3600
3599
  },
3601
3600
  // Use ref for callback
3602
3601
  D,
3603
3602
  $,
3604
3603
  R
3605
- ), nt.current = w.zoomBehavior, b.current = w.svgElement, X.current = w.gElement, K.current = w.baseFontSize, B.current = w.viewBoxWidth, X.current) {
3606
- const x = X.current.getBBox();
3604
+ ), et.current = w.zoomBehavior, b.current = w.svgElement, S.current = w.gElement, K.current = w.baseFontSize, B.current = w.viewBoxWidth, S.current) {
3605
+ const x = S.current.getBBox();
3607
3606
  C.current = { x: x.x, y: x.y, width: x.width, height: x.height };
3608
- const M = B.current, y = ((h = G.current) == null ? void 0 : h.clientWidth) || 1, F = K.current, E = y / M, k = 0.9 * M / x.width, V = 16 / (F * E);
3609
- et.current = k >= V;
3607
+ const M = B.current, y = ((h = G.current) == null ? void 0 : h.clientWidth) || 1, F = K.current, E = y / M, j = 0.9 * M / x.width, T = 16 / (F * E);
3608
+ tt.current = j >= T;
3610
3609
  }
3611
3610
  if (f.current = null, L.current && (clearInterval(L.current), L.current = null), m.current = null, c) {
3612
3611
  const x = G.current.querySelector("svg"), M = x == null ? void 0 : x.querySelector("#graph0");
@@ -3614,38 +3613,38 @@ const Ga = Or(function({
3614
3613
  const y = Y, F = x.getAttribute("viewBox");
3615
3614
  let E = 1e3;
3616
3615
  if (F) {
3617
- const [, , W] = F.split(" ").map(Number);
3618
- W && (E = W);
3616
+ const [, , q] = F.split(" ").map(Number);
3617
+ q && (E = q);
3619
3618
  }
3620
- const k = () => {
3621
- var j;
3622
- const W = M.getAttribute("transform");
3623
- let S = 1;
3624
- if (W) {
3625
- const J = W.match(/scale\(([^,)]+)/);
3626
- if (J) {
3627
- const rt = parseFloat(J[1]);
3628
- isNaN(rt) || (S = rt);
3619
+ const j = () => {
3620
+ var H;
3621
+ const q = M.getAttribute("transform");
3622
+ let k = 1;
3623
+ if (q) {
3624
+ const rt = q.match(/scale\(([^,)]+)/);
3625
+ if (rt) {
3626
+ const ot = parseFloat(rt[1]);
3627
+ isNaN(ot) || (k = ot);
3629
3628
  } else {
3630
- const rt = W.match(/matrix\(([^,)]+)/);
3631
- if (rt) {
3632
- const q = parseFloat(rt[1]);
3633
- isNaN(q) || (S = q);
3629
+ const ot = q.match(/matrix\(([^,)]+)/);
3630
+ if (ot) {
3631
+ const W = parseFloat(ot[1]);
3632
+ isNaN(W) || (k = W);
3634
3633
  }
3635
3634
  }
3636
3635
  }
3637
- const T = (((j = G.current) == null ? void 0 : j.clientWidth) || 1) / E, z = y * T * S;
3638
- !isNaN(z) && !isNaN(S) && c({ baseFontSize: y, actualFontSize: z, scale: S });
3636
+ const U = (((H = G.current) == null ? void 0 : H.clientWidth) || 1) / E, X = y * U * k;
3637
+ !isNaN(X) && !isNaN(k) && c({ baseFontSize: y, actualFontSize: X, scale: k });
3639
3638
  };
3640
- k();
3641
- const V = new MutationObserver(k);
3642
- V.observe(M, {
3639
+ j();
3640
+ const T = new MutationObserver(j);
3641
+ T.observe(M, {
3643
3642
  attributes: !0,
3644
3643
  attributeFilter: ["transform"]
3645
3644
  });
3646
- const ot = () => k();
3647
- return window.addEventListener("resize", ot), () => {
3648
- V.disconnect(), window.removeEventListener("resize", ot);
3645
+ const nt = () => j();
3646
+ return window.addEventListener("resize", nt), () => {
3647
+ T.disconnect(), window.removeEventListener("resize", nt);
3649
3648
  };
3650
3649
  }
3651
3650
  }
@@ -3654,7 +3653,7 @@ const Ga = Or(function({
3654
3653
  }).catch((P) => {
3655
3654
  N || (L.current && (clearInterval(L.current), L.current = null), m.current = null, P.message !== "Cancelled by user" && P.message !== "Request cancelled" && (console.error("GraphvizRenderer error:", P), G.current && (G.current.innerHTML = `<div style="padding: 1rem; color: #ef4444"><strong>Error rendering graph:</strong> ${P.message}</div>`), i == null || i(P instanceof Error ? P : new Error(String(P)))));
3656
3655
  }), () => {
3657
- N = !0, L.current && (clearInterval(L.current), L.current = null), m.current = null, H();
3656
+ N = !0, L.current && (clearInterval(L.current), L.current = null), m.current = null, V();
3658
3657
  };
3659
3658
  }, [
3660
3659
  e,
@@ -3687,22 +3686,22 @@ const Ga = Or(function({
3687
3686
  F.setAttribute("class", "close-btn-bg"), F.setAttribute("cx", String(y)), F.setAttribute("cy", w || "0"), F.setAttribute("r", "8"), F.setAttribute("fill", "white"), F.setAttribute("stroke", "#d0d0d0"), F.setAttribute("stroke-width", "1"), F.style.cursor = "pointer";
3688
3687
  const E = document.createElementNS("http://www.w3.org/2000/svg", "text");
3689
3688
  E.setAttribute("class", "close-btn"), E.setAttribute("x", String(y)), E.setAttribute("y", w || "0"), E.setAttribute("text-anchor", "middle"), E.setAttribute("dominant-baseline", "central"), E.setAttribute("font-family", "Arial"), E.setAttribute("font-size", "12px"), E.setAttribute("font-weight", "bold"), E.setAttribute("fill", "#888"), E.style.cursor = "pointer", E.textContent = "✕";
3690
- const k = (V) => {
3691
- V.stopPropagation(), g(null);
3689
+ const j = (T) => {
3690
+ T.stopPropagation(), g(null);
3692
3691
  };
3693
- F.addEventListener("click", k), E.addEventListener("click", k), d.appendChild(F), d.appendChild(E);
3692
+ F.addEventListener("click", j), E.addEventListener("click", j), d.appendChild(F), d.appendChild(E);
3694
3693
  }
3695
3694
  }
3696
3695
  }
3697
3696
  }
3698
3697
  }
3699
3698
  }, [v, g, _]), /* @__PURE__ */ ue("div", { className: `graphviz-renderer ${s}`.trim(), style: { position: "relative", width: "100%", height: "100%" }, children: [
3700
- /* @__PURE__ */ Ct("div", { ref: G, style: { width: "100%", height: "100%" } }),
3701
- U && u && (o ?? /* @__PURE__ */ Ct(Ua, { onCancel: H })),
3702
- tt && !U && /* @__PURE__ */ ue("div", { style: { padding: "1rem", color: "#ef4444" }, children: [
3703
- /* @__PURE__ */ Ct("strong", { children: "Error:" }),
3699
+ /* @__PURE__ */ Mt("div", { ref: G, style: { width: "100%", height: "100%" } }),
3700
+ I && u && (o ?? /* @__PURE__ */ Mt(Ua, { onCancel: V })),
3701
+ A && !I && /* @__PURE__ */ ue("div", { style: { padding: "1rem", color: "#ef4444" }, children: [
3702
+ /* @__PURE__ */ Mt("strong", { children: "Error:" }),
3704
3703
  " ",
3705
- tt
3704
+ A
3706
3705
  ] })
3707
3706
  ] });
3708
3707
  });