@html-graph/html-graph 8.20.0 → 8.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1808,7 +1808,10 @@ class kt {
1808
1808
  });
1809
1809
  }
1810
1810
  }
1811
- const Ne = (r) => typeof r == "number" ? () => r : r, Ce = v.portOffset;
1811
+ const Ht = (r) => {
1812
+ const { direction: e, radius: t } = r, { x: o, y: s } = e, { horizontal: n, vertical: a } = t, h = s / o, d = Math.abs(a / h), c = Math.abs(n * h), u = Math.min(n, d), l = Math.min(a, c);
1813
+ return Math.sqrt(u * u + l * l);
1814
+ }, Ne = (r) => typeof r == "number" ? () => r : r === "box" ? Ht : r, Ce = v.portOffset;
1812
1815
  class Xe {
1813
1816
  constructor(e) {
1814
1817
  i(this, "svg");
@@ -1916,20 +1919,17 @@ class Xe {
1916
1919
  });
1917
1920
  }
1918
1921
  }
1919
- const _r = (r) => {
1920
- const { direction: e, radius: t } = r, { x: o, y: s } = e, { horizontal: n, vertical: a } = t, h = s / o, d = Math.abs(a / h), c = Math.abs(n * h), u = Math.min(n, d), l = Math.min(a, c);
1921
- return Math.sqrt(u * u + l * l);
1922
- }, Ht = () => {
1922
+ const Yt = () => {
1923
1923
  const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
1924
1924
  return r.style.pointerEvents = "auto", r.style.cursor = "pointer", r;
1925
- }, Yt = (r) => {
1925
+ }, Xt = (r) => {
1926
1926
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1927
1927
  return e.setAttribute("stroke", "transparent"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e.setAttribute("stroke-linecap", "round"), e;
1928
1928
  }, Te = (r) => {
1929
1929
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1930
1930
  return e.setAttribute("stroke-linejoin", "round"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "transparent"), e.setAttribute("stroke", "transparent"), e;
1931
1931
  };
1932
- class Xt extends Error {
1932
+ class Gt extends Error {
1933
1933
  constructor(e) {
1934
1934
  super(e), this.name = "InteractiveEdgeError";
1935
1935
  }
@@ -1946,18 +1946,18 @@ class Ge {
1946
1946
  * @deprecated
1947
1947
  * use shape.svg instead
1948
1948
  */
1949
- i(this, "handle", Ht());
1949
+ i(this, "handle", Yt());
1950
1950
  i(this, "onAfterRender");
1951
1951
  i(this, "interactiveLine");
1952
1952
  i(this, "interactiveSourceArrow", null);
1953
1953
  i(this, "interactiveTargetArrow", null);
1954
1954
  if (this.baseEdge = e, e instanceof Ge)
1955
- throw new Xt(
1955
+ throw new Gt(
1956
1956
  "interactive edge can be configured only once"
1957
1957
  );
1958
1958
  this.svg = this.baseEdge.svg, this.group = this.baseEdge.group, this.line = this.baseEdge.line, this.sourceArrow = this.baseEdge.sourceArrow, this.targetArrow = this.baseEdge.targetArrow, this.onAfterRender = this.baseEdge.onAfterRender;
1959
1959
  const o = (t == null ? void 0 : t.distance) ?? v.interactiveWidth;
1960
- this.interactiveLine = Yt(o), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Te(o), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Te(o), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((s) => {
1960
+ this.interactiveLine = Xt(o), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Te(o), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Te(o), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((s) => {
1961
1961
  this.interactiveLine.setAttribute("d", s.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", s.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", s.targetArrowPath);
1962
1962
  });
1963
1963
  }
@@ -2228,7 +2228,7 @@ class Je {
2228
2228
  ), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy();
2229
2229
  }
2230
2230
  }
2231
- const Gt = (r) => {
2231
+ const jt = (r) => {
2232
2232
  setTimeout(() => {
2233
2233
  r();
2234
2234
  });
@@ -2262,7 +2262,7 @@ class Ke {
2262
2262
  return this.viewportStore.createViewportCoords(e);
2263
2263
  }
2264
2264
  }
2265
- const jt = (r, e) => Symbol.iterator in r ? {
2265
+ const Jt = (r, e) => Symbol.iterator in r ? {
2266
2266
  minContentScale: e.focus.minContentScale,
2267
2267
  nodes: r,
2268
2268
  contentPadding: e.focus.contentPadding,
@@ -2308,7 +2308,7 @@ class _e {
2308
2308
  g > 0 ? this.animateNavigation(a, u, g) : this.viewportStore.patchViewportMatrix(u);
2309
2309
  }
2310
2310
  focus(e) {
2311
- const t = jt(e ?? {}, this.params);
2311
+ const t = Jt(e ?? {}, this.params);
2312
2312
  this.params.focus.schedule(() => {
2313
2313
  this.navigate(t);
2314
2314
  });
@@ -2489,7 +2489,7 @@ class j {
2489
2489
  this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
2490
2490
  }
2491
2491
  }
2492
- class Jt {
2492
+ class Kt {
2493
2493
  constructor() {
2494
2494
  i(this, "field", "_htmlGraphTags");
2495
2495
  }
@@ -2616,7 +2616,7 @@ class De {
2616
2616
  }), t;
2617
2617
  }
2618
2618
  }
2619
- class Kt {
2619
+ class Qt {
2620
2620
  constructor(e) {
2621
2621
  this.direction = e;
2622
2622
  }
@@ -3069,13 +3069,13 @@ class he {
3069
3069
  });
3070
3070
  }
3071
3071
  }
3072
- const Qt = () => {
3072
+ const Zt = () => {
3073
3073
  const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3074
3074
  return r.style.position = "absolute", r.style.inset = "0", r;
3075
- }, Zt = () => {
3075
+ }, _t = () => {
3076
3076
  const r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
3077
3077
  return r.setAttribute("fill", "url(#pattern)"), r;
3078
- }, _t = () => {
3078
+ }, qt = () => {
3079
3079
  const r = document.createElementNS(
3080
3080
  "http://www.w3.org/2000/svg",
3081
3081
  "pattern"
@@ -3084,9 +3084,9 @@ const Qt = () => {
3084
3084
  };
3085
3085
  class de {
3086
3086
  constructor(e, t, o) {
3087
- i(this, "svg", Qt());
3088
- i(this, "patternRenderingRectangle", Zt());
3089
- i(this, "pattern", _t());
3087
+ i(this, "svg", Zt());
3088
+ i(this, "patternRenderingRectangle", _t());
3089
+ i(this, "pattern", qt());
3090
3090
  i(this, "patternContent");
3091
3091
  i(this, "tileWidth");
3092
3092
  i(this, "tileHeight");
@@ -3422,7 +3422,7 @@ class ge {
3422
3422
  this.applyScheduled || (this.applyScheduled = !0, this.defererFn(this.apply));
3423
3423
  }
3424
3424
  }
3425
- class qt {
3425
+ class er {
3426
3426
  constructor(e, t, o) {
3427
3427
  this.canvas = e, this.layoutAlgorithm = t, this.params = o;
3428
3428
  }
@@ -3436,9 +3436,9 @@ class qt {
3436
3436
  }), this.params.onAfterApplied();
3437
3437
  }
3438
3438
  }
3439
- class er {
3439
+ class tr {
3440
3440
  static configure(e, t) {
3441
- const o = t.applyOn, s = new qt(e, t.algorithm, {
3441
+ const o = t.applyOn, s = new er(e, t.algorithm, {
3442
3442
  staticNodeResolver: t.staticNodeResolver,
3443
3443
  onBeforeApplied: t.onBeforeApplied,
3444
3444
  onAfterApplied: t.onAfterApplied
@@ -3462,7 +3462,7 @@ class er {
3462
3462
  }
3463
3463
  }
3464
3464
  }
3465
- class tr {
3465
+ class rr {
3466
3466
  constructor(e, t) {
3467
3467
  i(this, "previousTimeStamp");
3468
3468
  i(this, "step", (e) => {
@@ -3477,7 +3477,7 @@ class tr {
3477
3477
  this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
3478
3478
  }
3479
3479
  }
3480
- class rr {
3480
+ class or {
3481
3481
  constructor(e, t, o) {
3482
3482
  this.canvas = e, this.layoutAlgorithm = t, this.params = o;
3483
3483
  }
@@ -3498,11 +3498,11 @@ class pe {
3498
3498
  i(this, "step", (e) => {
3499
3499
  this.applier.apply(e);
3500
3500
  });
3501
- this.win = o, this.applier = new rr(e, t.algorithm, {
3501
+ this.win = o, this.applier = new or(e, t.algorithm, {
3502
3502
  staticNodeResolver: t.staticNodeResolver,
3503
3503
  onBeforeApplied: t.onBeforeApplied,
3504
3504
  onAfterApplied: t.onAfterApplied
3505
- }), new tr(this.win, this.step);
3505
+ }), new rr(this.win, this.step);
3506
3506
  }
3507
3507
  static configure(e, t, o) {
3508
3508
  new pe(e, t, o);
@@ -3625,7 +3625,7 @@ class fe {
3625
3625
  );
3626
3626
  }
3627
3627
  }
3628
- const or = () => {
3628
+ const sr = () => {
3629
3629
  const r = document.createElement("div");
3630
3630
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r;
3631
3631
  }, Q = () => {
@@ -3635,13 +3635,13 @@ const or = () => {
3635
3635
  const r = Q();
3636
3636
  return r.style.pointerEvents = "none", r;
3637
3637
  };
3638
- class sr {
3638
+ class ir {
3639
3639
  constructor(e) {
3640
3640
  i(this, "background", Q());
3641
3641
  i(this, "main", Q());
3642
3642
  i(this, "overlayConnectablePorts", Re());
3643
3643
  i(this, "overlayDraggableEdges", Re());
3644
- i(this, "host", or());
3644
+ i(this, "host", sr());
3645
3645
  this.element = e, this.element.appendChild(this.host), this.host.appendChild(this.background), this.host.appendChild(this.main), this.host.appendChild(this.overlayConnectablePorts), this.host.appendChild(this.overlayDraggableEdges);
3646
3646
  }
3647
3647
  destroy() {
@@ -3673,7 +3673,7 @@ const P = Object.freeze({
3673
3673
  ) : r === "nearest-connectable-port" ? new De(
3674
3674
  e,
3675
3675
  t
3676
- ) : new Kt(r), ve = (r) => {
3676
+ ) : new Qt(r), ve = (r) => {
3677
3677
  if (typeof r == "function")
3678
3678
  return r;
3679
3679
  switch (r.type) {
@@ -3743,7 +3743,7 @@ const P = Object.freeze({
3743
3743
  detourDirection: r.detourDirection
3744
3744
  });
3745
3745
  }
3746
- }, ir = (r) => {
3746
+ }, nr = (r) => {
3747
3747
  var u, l, g, p, w, y;
3748
3748
  const e = r.nodeDragVerifier ?? (() => !0), t = r.moveOnTop !== !1, o = r.moveEdgesOnTop !== !1 && t, s = (u = r.mouse) == null ? void 0 : u.dragCursor, n = s !== void 0 ? s : "grab", a = (l = r.mouse) == null ? void 0 : l.mouseDownEventVerifier, h = a !== void 0 ? a : (f) => f.button === 0, d = (g = r.mouse) == null ? void 0 : g.mouseUpEventVerifier, c = d !== void 0 ? d : (f) => f.button === 0;
3749
3749
  return {
@@ -3758,7 +3758,7 @@ const P = Object.freeze({
3758
3758
  nodeDragVerifier: e,
3759
3759
  onNodeDragFinished: ((y = r.events) == null ? void 0 : y.onNodeDragFinished) ?? N
3760
3760
  };
3761
- }, nr = (r) => {
3761
+ }, ar = (r) => {
3762
3762
  const e = r.minX !== null ? r.minX : -1 / 0, t = r.maxX !== null ? r.maxX : 1 / 0, o = r.minY !== null ? r.minY : -1 / 0, s = r.maxY !== null ? r.maxY : 1 / 0;
3763
3763
  return (n) => {
3764
3764
  let a = n.nextTransform.x, h = n.nextTransform.y;
@@ -3768,7 +3768,7 @@ const P = Object.freeze({
3768
3768
  const u = n.canvasHeight * n.prevTransform.scale, l = s - u;
3769
3769
  return h > l && h > n.prevTransform.y && (h = Math.max(n.prevTransform.y, l)), { scale: n.nextTransform.scale, x: a, y: h };
3770
3770
  };
3771
- }, ar = (r) => {
3771
+ }, hr = (r) => {
3772
3772
  const e = r.maxContentScale, t = r.minContentScale, o = e !== null ? 1 / e : 0, s = t !== null ? 1 / t : 1 / 0;
3773
3773
  return (n) => {
3774
3774
  const a = n.prevTransform, h = n.nextTransform;
@@ -3789,7 +3789,7 @@ const P = Object.freeze({
3789
3789
  y: u
3790
3790
  };
3791
3791
  };
3792
- }, hr = (r) => (e) => r.reduce(
3792
+ }, dr = (r) => (e) => r.reduce(
3793
3793
  (t, o) => o({
3794
3794
  prevTransform: e.prevTransform,
3795
3795
  nextTransform: t,
@@ -3802,12 +3802,12 @@ const P = Object.freeze({
3802
3802
  return r;
3803
3803
  switch (r.type) {
3804
3804
  case "scale-limit":
3805
- return ar({
3805
+ return hr({
3806
3806
  minContentScale: r.minContentScale ?? 0,
3807
3807
  maxContentScale: r.maxContentScale ?? 1 / 0
3808
3808
  });
3809
3809
  case "shift-limit":
3810
- return nr({
3810
+ return ar({
3811
3811
  minX: r.minX ?? -1 / 0,
3812
3812
  maxX: r.maxX ?? 1 / 0,
3813
3813
  minY: r.minY ?? -1 / 0,
@@ -3818,7 +3818,7 @@ const P = Object.freeze({
3818
3818
  var g, p, w, y, f, m, E, A, T, M, L, V;
3819
3819
  const e = (g = r == null ? void 0 : r.scale) == null ? void 0 : g.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, o = r == null ? void 0 : r.transformPreprocessor;
3820
3820
  let s;
3821
- o !== void 0 ? Array.isArray(o) ? s = hr(
3821
+ o !== void 0 ? Array.isArray(o) ? s = dr(
3822
3822
  o.map(
3823
3823
  (D) => Le(D)
3824
3824
  )
@@ -3839,17 +3839,17 @@ const P = Object.freeze({
3839
3839
  onResizeTransformStarted: ((L = r == null ? void 0 : r.events) == null ? void 0 : L.onResizeTransformStarted) ?? N,
3840
3840
  onResizeTransformFinished: ((V = r == null ? void 0 : r.events) == null ? void 0 : V.onResizeTransformFinished) ?? N
3841
3841
  };
3842
- }, dr = (r, e) => {
3842
+ }, cr = (r, e) => {
3843
3843
  const t = document.createElementNS(
3844
3844
  "http://www.w3.org/2000/svg",
3845
3845
  "circle"
3846
3846
  );
3847
3847
  return t.setAttribute("cx", "0"), t.setAttribute("cy", "0"), t.setAttribute("r", `${r}`), t.setAttribute("fill", `${e}`), t;
3848
- }, cr = (r) => r instanceof SVGElement ? r : dr(
3848
+ }, lr = (r) => r instanceof SVGElement ? r : cr(
3849
3849
  (r == null ? void 0 : r.radius) ?? 1.5,
3850
3850
  (r == null ? void 0 : r.color) ?? "#d8d8d8"
3851
- ), lr = (r) => {
3852
- const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, o = (e == null ? void 0 : e.height) ?? 25, s = cr(r.renderer ?? {});
3851
+ ), ur = (r) => {
3852
+ const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, o = (e == null ? void 0 : e.height) ?? 25, s = lr(r.renderer ?? {});
3853
3853
  return {
3854
3854
  tileWidth: t,
3855
3855
  tileHeight: o,
@@ -3861,7 +3861,7 @@ const P = Object.freeze({
3861
3861
  connectionPreprocessor: (r) => r,
3862
3862
  connectionAllowedVerifier: () => !0,
3863
3863
  mouseEventVerifier: (r) => r.button === 0
3864
- }), ur = (r, e, t) => {
3864
+ }), gr = (r, e, t) => {
3865
3865
  var s, n, a;
3866
3866
  const o = r.connectionAllowedVerifier ?? $.connectionAllowedVerifier;
3867
3867
  return {
@@ -3886,7 +3886,7 @@ const P = Object.freeze({
3886
3886
  // TODO: remove ctrl key
3887
3887
  mouseDownEventVerifier: (r) => r.button === 0 && r.ctrlKey,
3888
3888
  mouseUpEventVerifier: (r) => r.button === 0
3889
- }), gr = (r, e) => {
3889
+ }), pr = (r, e) => {
3890
3890
  var s, n, a;
3891
3891
  const t = (h) => {
3892
3892
  const d = e.getPortAdjacentEdgeIds(h);
@@ -3908,17 +3908,17 @@ const P = Object.freeze({
3908
3908
  o
3909
3909
  )
3910
3910
  };
3911
- }, pr = (r) => ({
3911
+ }, wr = (r) => ({
3912
3912
  nodeVerticalRadius: r.nodeContainingRadius.vertical,
3913
3913
  nodeHorizontalRadius: r.nodeContainingRadius.horizontal
3914
- }), wr = (r) => {
3914
+ }), yr = (r) => {
3915
3915
  var e, t;
3916
3916
  return {
3917
3917
  onAfterNodeDetached: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onAfterNodeDetached) ?? N,
3918
3918
  onBeforeNodeAttached: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeNodeAttached) ?? N
3919
3919
  };
3920
3920
  };
3921
- class yr extends Error {
3921
+ class fr extends Error {
3922
3922
  constructor() {
3923
3923
  super(...arguments);
3924
3924
  i(this, "name", "CanvasBuilderError");
@@ -3987,7 +3987,7 @@ const ot = (r) => {
3987
3987
  const e = r.coefficient * (r.sourceCharge * r.targetCharge / (r.distance * r.distance));
3988
3988
  return Math.min(e, r.maxForce);
3989
3989
  };
3990
- class fr {
3990
+ class vr {
3991
3991
  constructor(e) {
3992
3992
  i(this, "nodeCharge");
3993
3993
  i(this, "distanceVectorGenerator");
@@ -4014,7 +4014,7 @@ class fr {
4014
4014
  }
4015
4015
  }
4016
4016
  }
4017
- const vr = (r) => {
4017
+ const mr = (r) => {
4018
4018
  if (r.size === 0)
4019
4019
  return {
4020
4020
  centerX: 0,
@@ -4032,7 +4032,7 @@ const vr = (r) => {
4032
4032
  radius: h / 2
4033
4033
  };
4034
4034
  };
4035
- class mr {
4035
+ class xr {
4036
4036
  constructor(e) {
4037
4037
  i(this, "root");
4038
4038
  i(this, "leaves", /* @__PURE__ */ new Map());
@@ -4189,7 +4189,7 @@ class mr {
4189
4189
  }), { x: t / e.size, y: o / e.size };
4190
4190
  }
4191
4191
  }
4192
- class xr {
4192
+ class Er {
4193
4193
  constructor(e) {
4194
4194
  i(this, "areaRadiusThreshold");
4195
4195
  i(this, "nodeMass");
@@ -4201,7 +4201,7 @@ class xr {
4201
4201
  this.areaRadiusThreshold = e.areaRadiusThreshold, this.nodeMass = e.nodeMass, this.nodeCharge = e.nodeCharge, this.theta = e.theta, this.distanceVectorGenerator = e.distanceVectorGenerator, this.nodeForceCoefficient = e.nodeForceCoefficient, this.maxForce = e.maxForce;
4202
4202
  }
4203
4203
  apply(e, t) {
4204
- const o = vr(e), s = new mr({
4204
+ const o = mr(e), s = new xr({
4205
4205
  box: o,
4206
4206
  coords: e,
4207
4207
  areaRadiusThreshold: this.areaRadiusThreshold,
@@ -4351,7 +4351,7 @@ class xr {
4351
4351
  }
4352
4352
  }
4353
4353
  }
4354
- const st = (r) => r.theta !== 0 ? new xr({
4354
+ const st = (r) => r.theta !== 0 ? new Er({
4355
4355
  nodeCharge: r.nodeCharge,
4356
4356
  nodeForceCoefficient: r.nodeForceCoefficient,
4357
4357
  distanceVectorGenerator: r.distanceVectorGenerator,
@@ -4359,7 +4359,7 @@ const st = (r) => r.theta !== 0 ? new xr({
4359
4359
  theta: r.theta,
4360
4360
  nodeMass: r.nodeMass,
4361
4361
  areaRadiusThreshold: r.areaRadiusThreshold
4362
- }) : new fr({
4362
+ }) : new vr({
4363
4363
  nodeCharge: r.nodeCharge,
4364
4364
  nodeForceCoefficient: r.nodeForceCoefficient,
4365
4365
  distanceVectorGenerator: r.distanceVectorGenerator,
@@ -4388,7 +4388,7 @@ class it {
4388
4388
  }), s;
4389
4389
  }
4390
4390
  }
4391
- class Er {
4391
+ class Ar {
4392
4392
  constructor(e) {
4393
4393
  i(this, "distanceVectorGenerator");
4394
4394
  i(this, "nodeForcesApplicationStrategy");
@@ -4433,7 +4433,7 @@ class Er {
4433
4433
  return s;
4434
4434
  }
4435
4435
  }
4436
- class Ar {
4436
+ class Sr {
4437
4437
  constructor(e, t) {
4438
4438
  i(this, "forest", /* @__PURE__ */ new Set());
4439
4439
  i(this, "remainingNodeIds");
@@ -4474,7 +4474,7 @@ class Ar {
4474
4474
  }
4475
4475
  }
4476
4476
  }
4477
- class Sr {
4477
+ class br {
4478
4478
  constructor(e) {
4479
4479
  this.params = e;
4480
4480
  }
@@ -4515,12 +4515,12 @@ class Sr {
4515
4515
  return o - 2 * this.params.spaceAroundRadius;
4516
4516
  }
4517
4517
  }
4518
- class br {
4518
+ class Pr {
4519
4519
  constructor(e, t) {
4520
4520
  i(this, "offsets", /* @__PURE__ */ new Map());
4521
4521
  i(this, "treeSpans", /* @__PURE__ */ new Map());
4522
4522
  this.tree = e;
4523
- const o = t.spaceAroundRadius, s = new Sr({
4523
+ const o = t.spaceAroundRadius, s = new br({
4524
4524
  spaceAroundRadius: o
4525
4525
  });
4526
4526
  [...this.tree.sequence].reverse().forEach((n) => {
@@ -4542,19 +4542,19 @@ class br {
4542
4542
  return this.offsets;
4543
4543
  }
4544
4544
  }
4545
- class Pr {
4545
+ class Nr {
4546
4546
  constructor(e) {
4547
4547
  this.params = e;
4548
4548
  }
4549
4549
  calculateCoordinates(e) {
4550
- const t = /* @__PURE__ */ new Map(), s = new Ar(
4550
+ const t = /* @__PURE__ */ new Map(), s = new Sr(
4551
4551
  e.graph,
4552
4552
  this.params.nextLayerNodesResolver
4553
4553
  ).generate();
4554
4554
  let n = 0;
4555
4555
  return s.forEach((a) => {
4556
4556
  t.set(a.root.nodeId, { x: n, y: 0 });
4557
- const d = new br(a, {
4557
+ const d = new Pr(a, {
4558
4558
  spaceAroundRadius: this.params.layerSpace / 2
4559
4559
  }).generate();
4560
4560
  let c = [a.root];
@@ -4575,7 +4575,7 @@ class Pr {
4575
4575
  }), t;
4576
4576
  }
4577
4577
  }
4578
- const Nr = (r) => {
4578
+ const Cr = (r) => {
4579
4579
  const { graph: e, currentNodeId: t } = r, o = e.getNodeOutgoingEdgeIds(t).map((n) => {
4580
4580
  const a = e.getEdge(n);
4581
4581
  return e.getPort(a.to).nodeId;
@@ -4584,20 +4584,20 @@ const Nr = (r) => {
4584
4584
  return e.getPort(a.from).nodeId;
4585
4585
  });
4586
4586
  return /* @__PURE__ */ new Set([...o, ...s]);
4587
- }, Cr = (r) => {
4587
+ }, Tr = (r) => {
4588
4588
  const { graph: e, currentNodeId: t } = r, o = e.getNodeOutgoingEdgeIds(t).map((s) => {
4589
4589
  const n = e.getEdge(s);
4590
4590
  return e.getPort(n.to).nodeId;
4591
4591
  });
4592
4592
  return new Set(o);
4593
- }, Tr = (r) => {
4593
+ }, Mr = (r) => {
4594
4594
  const { graph: e, currentNodeId: t } = r, o = e.getNodeIncomingEdgeIds(t).map((s) => {
4595
4595
  const n = e.getEdge(s);
4596
4596
  return e.getPort(n.from).nodeId;
4597
4597
  });
4598
4598
  return new Set(o);
4599
4599
  };
4600
- class Mr {
4600
+ class Dr {
4601
4601
  constructor(e) {
4602
4602
  i(this, "distanceVectorGenerator");
4603
4603
  i(this, "nodeForcesApplicationStrategy");
@@ -4651,14 +4651,14 @@ const nt = (r) => {
4651
4651
  r |= 0, e |= 0, t |= 0, o |= 0;
4652
4652
  const s = (r + e | 0) + o | 0;
4653
4653
  return o = o + 1 | 0, r = e ^ e >>> 9, e = t + (t << 3) | 0, t = t << 21 | t >>> 11, t = t + s | 0, (s >>> 0) / 4294967296;
4654
- }, Dr = (r) => {
4654
+ }, Rr = (r) => {
4655
4655
  var e, t;
4656
4656
  switch (r == null ? void 0 : r.type) {
4657
4657
  case "custom":
4658
4658
  return r.instance;
4659
4659
  default: {
4660
4660
  const o = nt((r == null ? void 0 : r.seed) ?? P.seed), s = at(o[0], o[1], o[2], o[3]);
4661
- return new Mr({
4661
+ return new Dr({
4662
4662
  rand: s,
4663
4663
  maxTimeDeltaSec: (r == null ? void 0 : r.maxTimeDeltaSec) ?? P.maxTimeDeltaSec,
4664
4664
  nodeCharge: (r == null ? void 0 : r.nodeCharge) ?? P.nodeCharge,
@@ -4674,17 +4674,17 @@ const nt = (r) => {
4674
4674
  });
4675
4675
  }
4676
4676
  }
4677
- }, Rr = {
4677
+ }, Lr = {
4678
4678
  staticNodeResolver: () => !1
4679
- }, Lr = (r) => {
4679
+ }, Vr = (r) => {
4680
4680
  var t, o;
4681
4681
  return {
4682
- algorithm: Dr((r == null ? void 0 : r.algorithm) ?? {}),
4683
- staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? Rr.staticNodeResolver,
4682
+ algorithm: Rr((r == null ? void 0 : r.algorithm) ?? {}),
4683
+ staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? Lr.staticNodeResolver,
4684
4684
  onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ?? N,
4685
4685
  onAfterApplied: ((o = r == null ? void 0 : r.events) == null ? void 0 : o.onAfterApplied) ?? N
4686
4686
  };
4687
- }, Vr = (r) => r instanceof q ? {
4687
+ }, Ir = (r) => r instanceof q ? {
4688
4688
  type: "trigger",
4689
4689
  trigger: r
4690
4690
  } : r === "topologyChangeMicrotask" ? {
@@ -4692,7 +4692,7 @@ const nt = (r) => {
4692
4692
  schedule: Me
4693
4693
  } : (r == null ? void 0 : r.type) === "topologyChangeMacrotask" ? {
4694
4694
  type: "topologyChangeSchedule",
4695
- schedule: Gt
4695
+ schedule: jt
4696
4696
  } : {
4697
4697
  type: "topologyChangeSchedule",
4698
4698
  schedule: Me
@@ -4709,7 +4709,7 @@ const nt = (r) => {
4709
4709
  d: r.d * e.a + r.e * e.d,
4710
4710
  e: r.d * e.b + r.e * e.e,
4711
4711
  f: r.d * e.c + r.e * e.f + r.f
4712
- }), Ir = (r) => {
4712
+ }), Fr = (r) => {
4713
4713
  const { a: e, b: t, c: o, d: s, e: n, f: a } = r, h = e * n - t * s;
4714
4714
  return {
4715
4715
  a: n / h,
@@ -4720,7 +4720,7 @@ const nt = (r) => {
4720
4720
  f: (o * s - e * a) / h
4721
4721
  };
4722
4722
  };
4723
- class Fr {
4723
+ class Ur {
4724
4724
  resolve(e) {
4725
4725
  if ("shift" in e)
4726
4726
  return this.createShiftBaseMatrix(e.shift);
@@ -4764,7 +4764,7 @@ class Fr {
4764
4764
  const o = k(
4765
4765
  t,
4766
4766
  e
4767
- ), s = Ir(t);
4767
+ ), s = Fr(t);
4768
4768
  return k(o, s);
4769
4769
  }
4770
4770
  createShiftBaseMatrix(e) {
@@ -4809,7 +4809,7 @@ class Fr {
4809
4809
  };
4810
4810
  }
4811
4811
  }
4812
- const Ur = (r) => {
4812
+ const $r = (r) => {
4813
4813
  if (r === void 0)
4814
4814
  return (s) => s;
4815
4815
  if (typeof r == "function")
@@ -4823,7 +4823,7 @@ const Ur = (r) => {
4823
4823
  e: 1,
4824
4824
  f: 0
4825
4825
  };
4826
- const o = new Fr();
4826
+ const o = new Ur();
4827
4827
  return e.forEach((s) => {
4828
4828
  const n = o.resolve(s);
4829
4829
  t = k(t, n);
@@ -4834,34 +4834,34 @@ const Ur = (r) => {
4834
4834
  y: t.d * n + t.e * a + t.f
4835
4835
  };
4836
4836
  };
4837
- }, $r = (r) => {
4837
+ }, Br = (r) => {
4838
4838
  if (typeof r == "function")
4839
4839
  return r;
4840
4840
  switch (r) {
4841
4841
  case "outgoing":
4842
- return Cr;
4843
- case "incoming":
4844
4842
  return Tr;
4843
+ case "incoming":
4844
+ return Mr;
4845
4845
  default:
4846
- return Nr;
4846
+ return Cr;
4847
4847
  }
4848
- }, Br = (r) => {
4848
+ }, Or = (r) => {
4849
4849
  var e, t;
4850
4850
  switch (r == null ? void 0 : r.type) {
4851
4851
  case "custom":
4852
4852
  return r.instance;
4853
4853
  case "hierarchical":
4854
- return new Pr({
4854
+ return new Nr({
4855
4855
  layerWidth: r.layerWidth ?? Z.hierarchicalLayout.layerWidth,
4856
4856
  layerSpace: r.layerSpace ?? Z.hierarchicalLayout.layerSpace,
4857
- transform: Ur(r.transform),
4858
- nextLayerNodesResolver: $r(
4857
+ transform: $r(r.transform),
4858
+ nextLayerNodesResolver: Br(
4859
4859
  r.nextLayerNodesResolver
4860
4860
  )
4861
4861
  });
4862
4862
  default: {
4863
4863
  const o = nt((r == null ? void 0 : r.seed) ?? P.seed), s = at(o[0], o[1], o[2], o[3]);
4864
- return new Er({
4864
+ return new Ar({
4865
4865
  dtSec: (r == null ? void 0 : r.dtSec) ?? P.dtSec,
4866
4866
  maxIterations: (r == null ? void 0 : r.maxIterations) ?? P.maxIterations,
4867
4867
  rand: s,
@@ -4877,16 +4877,16 @@ const Ur = (r) => {
4877
4877
  });
4878
4878
  }
4879
4879
  }
4880
- }, Or = (r) => {
4880
+ }, Wr = (r) => {
4881
4881
  var e, t;
4882
4882
  return {
4883
- algorithm: Br(r.algorithm),
4884
- applyOn: Vr(r.applyOn),
4883
+ algorithm: Or(r.algorithm),
4884
+ applyOn: Ir(r.applyOn),
4885
4885
  staticNodeResolver: r.staticNodeResolver ?? Z.staticNodeResolver,
4886
4886
  onBeforeApplied: ((e = r.events) == null ? void 0 : e.onBeforeApplied) ?? N,
4887
4887
  onAfterApplied: ((t = r.events) == null ? void 0 : t.onAfterApplied) ?? N
4888
4888
  };
4889
- }, Wr = (r, e) => ({
4889
+ }, zr = (r, e) => ({
4890
4890
  ...r,
4891
4891
  onNodeDragStarted: (t) => {
4892
4892
  e.add(t), r.onNodeDragStarted(t);
@@ -4894,7 +4894,7 @@ const Ur = (r) => {
4894
4894
  onNodeDragFinished: (t) => {
4895
4895
  e.delete(t), r.onNodeDragFinished(t);
4896
4896
  }
4897
- }), zr = (r, e) => {
4897
+ }), kr = (r, e) => {
4898
4898
  r.graph.onBeforeNodeRemoved.subscribe((t) => {
4899
4899
  e.delete(t);
4900
4900
  }), r.graph.onBeforeClear.subscribe(() => {
@@ -4902,22 +4902,22 @@ const Ur = (r) => {
4902
4902
  }), r.onBeforeDestroy.subscribe(() => {
4903
4903
  e.clear();
4904
4904
  });
4905
- }, kr = (r, e) => ({
4905
+ }, Hr = (r, e) => ({
4906
4906
  ...r,
4907
4907
  staticNodeResolver: (t) => r.staticNodeResolver(t) || e.has(t)
4908
- }), _ = (r) => () => r, Ie = _(0), Hr = () => {
4908
+ }), _ = (r) => () => r, Ie = _(0), Yr = () => {
4909
4909
  let r = 0;
4910
4910
  return () => r++;
4911
- }, Yr = (r, e) => {
4911
+ }, Xr = (r, e) => {
4912
4912
  let t = Ie, o = Ie;
4913
- const s = Hr();
4913
+ const s = Yr();
4914
4914
  return r === "incremental" && (t = s), e === "incremental" && (o = s), typeof r == "number" && (t = _(r)), typeof e == "number" && (o = _(e)), typeof r == "function" && (t = r), typeof e == "function" && (o = e), {
4915
4915
  nodesPriorityFn: t,
4916
4916
  edgesPriorityFn: o
4917
4917
  };
4918
- }, Xr = (r) => {
4918
+ }, Gr = (r) => {
4919
4919
  var t, o, s, n, a;
4920
- const e = Yr(
4920
+ const e = Xr(
4921
4921
  (t = r.nodes) == null ? void 0 : t.priority,
4922
4922
  (o = r.edges) == null ? void 0 : o.priority
4923
4923
  );
@@ -4934,9 +4934,9 @@ const Ur = (r) => {
4934
4934
  priorityFn: e.edgesPriorityFn
4935
4935
  }
4936
4936
  };
4937
- }, Gr = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : oe, jr = (r) => {
4937
+ }, jr = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : oe, Jr = (r) => {
4938
4938
  var o, s, n, a;
4939
- const { canvasDefaults: e } = r, t = r.hasLayout ? Gr(r.layoutParams) : oe;
4939
+ const { canvasDefaults: e } = r, t = r.hasLayout ? jr(r.layoutParams) : oe;
4940
4940
  return {
4941
4941
  focus: {
4942
4942
  contentPadding: ((o = e.focus) == null ? void 0 : o.contentPadding) ?? ((s = e.focus) == null ? void 0 : s.contentOffset) ?? 100,
@@ -4945,17 +4945,17 @@ const Ur = (r) => {
4945
4945
  animationDuration: ((a = e.focus) == null ? void 0 : a.animationDuration) ?? 0
4946
4946
  }
4947
4947
  };
4948
- }, Jr = (r) => ({
4948
+ }, Kr = (r) => ({
4949
4949
  onNodeSelected: r.onNodeSelected,
4950
4950
  mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
4951
4951
  mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
4952
4952
  movementThreshold: r.movementThreshold ?? I.movementThreshold
4953
- }), Kr = (r) => ({
4953
+ }), Qr = (r) => ({
4954
4954
  onCanvasSelected: r.onCanvasSelected,
4955
4955
  mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
4956
4956
  mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
4957
4957
  movementThreshold: r.movementThreshold ?? I.movementThreshold
4958
- }), Qr = (r) => ({
4958
+ }), Zr = (r) => ({
4959
4959
  onEdgeSelected: r.onEdgeSelected,
4960
4960
  mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
4961
4961
  mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
@@ -4988,7 +4988,7 @@ class eo {
4988
4988
  i(this, "window", window);
4989
4989
  i(this, "animationStaticNodes", /* @__PURE__ */ new Set());
4990
4990
  i(this, "pointInsideVerifier");
4991
- i(this, "eventTagger", new Jt());
4991
+ i(this, "eventTagger", new Kt());
4992
4992
  this.element = e, this.pointInsideVerifier = new Et(e, this.window);
4993
4993
  }
4994
4994
  setDefaults(e) {
@@ -5032,21 +5032,21 @@ class eo {
5032
5032
  }
5033
5033
  build() {
5034
5034
  if (this.used)
5035
- throw new yr(
5035
+ throw new fr(
5036
5036
  "Failed to build Canvas because CanvasBuilder is a single-use object"
5037
5037
  );
5038
5038
  this.used = !0;
5039
- const e = new vt(this.element), t = new $e(), o = new sr(this.element), s = this.createHtmlView(
5039
+ const e = new vt(this.element), t = new $e(), o = new ir(this.element), s = this.createHtmlView(
5040
5040
  o.main,
5041
5041
  t,
5042
5042
  e
5043
- ), n = Xr(
5043
+ ), n = Gr(
5044
5044
  this.canvasDefaults
5045
5045
  ), a = new Je(
5046
5046
  t,
5047
5047
  s,
5048
5048
  n
5049
- ), h = Or(this.layoutConfig), d = jr({
5049
+ ), h = Wr(this.layoutConfig), d = Jr({
5050
5050
  canvasDefaults: this.canvasDefaults,
5051
5051
  hasLayout: this.hasLayout,
5052
5052
  layoutParams: h
@@ -5063,10 +5063,10 @@ class eo {
5063
5063
  );
5064
5064
  if (this.hasBackground && de.configure(
5065
5065
  g,
5066
- lr(this.backgroundConfig),
5066
+ ur(this.backgroundConfig),
5067
5067
  o.background
5068
5068
  ), this.hasNodeResizeReactiveEdges && ee.configure(g), this.userSelectableEdgesConfig !== void 0) {
5069
- const p = Qr(
5069
+ const p = Zr(
5070
5070
  this.userSelectableEdgesConfig
5071
5071
  );
5072
5072
  ye.configure(
@@ -5078,7 +5078,7 @@ class eo {
5078
5078
  );
5079
5079
  }
5080
5080
  if (this.userSelectableNodesConfig !== void 0) {
5081
- const p = Jr(
5081
+ const p = Kr(
5082
5082
  this.userSelectableNodesConfig
5083
5083
  );
5084
5084
  we.configure(
@@ -5090,7 +5090,7 @@ class eo {
5090
5090
  );
5091
5091
  }
5092
5092
  if (this.userSelectableCanvasConfig !== void 0) {
5093
- const p = Kr(
5093
+ const p = Qr(
5094
5094
  this.userSelectableCanvasConfig
5095
5095
  );
5096
5096
  fe.configure(
@@ -5103,8 +5103,8 @@ class eo {
5103
5103
  );
5104
5104
  }
5105
5105
  if (this.hasDraggableNodes) {
5106
- let p = ir(this.dragConfig);
5107
- this.hasAnimatedLayout && (p = Wr(
5106
+ let p = nr(this.dragConfig);
5107
+ this.hasAnimatedLayout && (p = zr(
5108
5108
  p,
5109
5109
  this.animationStaticNodes
5110
5110
  )), ae.configure(
@@ -5116,7 +5116,7 @@ class eo {
5116
5116
  );
5117
5117
  }
5118
5118
  if (this.hasUserConnectablePorts) {
5119
- const p = ur(
5119
+ const p = gr(
5120
5120
  this.connectablePortsConfig,
5121
5121
  n.edges.shapeFactory,
5122
5122
  g.graph
@@ -5131,7 +5131,7 @@ class eo {
5131
5131
  );
5132
5132
  }
5133
5133
  if (this.hasUserDraggableEdges) {
5134
- const p = gr(
5134
+ const p = pr(
5135
5135
  this.draggableEdgesConfig,
5136
5136
  g.graph
5137
5137
  );
@@ -5151,19 +5151,19 @@ class eo {
5151
5151
  Ve(this.transformConfig),
5152
5152
  this.boxRenderingTrigger,
5153
5153
  this.pointInsideVerifier,
5154
- pr(this.virtualScrollConfig)
5154
+ wr(this.virtualScrollConfig)
5155
5155
  ) : this.hasTransformableViewport && J.configure(
5156
5156
  g,
5157
5157
  o.main,
5158
5158
  this.window,
5159
5159
  this.pointInsideVerifier,
5160
5160
  Ve(this.transformConfig)
5161
- ), this.hasLayout && er.configure(g, h), this.hasAnimatedLayout) {
5162
- let p = Lr(this.animatedLayoutConfig);
5163
- this.hasDraggableNodes && (zr(
5161
+ ), this.hasLayout && tr.configure(g, h), this.hasAnimatedLayout) {
5162
+ let p = Vr(this.animatedLayoutConfig);
5163
+ this.hasDraggableNodes && (kr(
5164
5164
  g,
5165
5165
  this.animationStaticNodes
5166
- ), p = kr(
5166
+ ), p = Hr(
5167
5167
  p,
5168
5168
  this.animationStaticNodes
5169
5169
  )), pe.configure(g, p, this.window);
@@ -5178,23 +5178,23 @@ class eo {
5178
5178
  s,
5179
5179
  t,
5180
5180
  this.boxRenderingTrigger,
5181
- wr(this.virtualScrollConfig)
5181
+ yr(this.virtualScrollConfig)
5182
5182
  )), s = new yt(s, t), s;
5183
5183
  }
5184
5184
  }
5185
5185
  export {
5186
5186
  Ot as BezierEdgeShape,
5187
5187
  eo as CanvasBuilder,
5188
- yr as CanvasBuilderError,
5188
+ fr as CanvasBuilderError,
5189
5189
  S as CanvasError,
5190
5190
  U as ConnectionCategory,
5191
5191
  Xe as DirectEdgeShape,
5192
5192
  q as EventSubject,
5193
5193
  Wt as HorizontalEdgeShape,
5194
- Xt as InteractiveEdgeError,
5194
+ Gt as InteractiveEdgeError,
5195
5195
  Ge as InteractiveEdgeShape,
5196
5196
  qr as MidpointEdgeShape,
5197
5197
  zt as StraightEdgeShape,
5198
5198
  kt as VerticalEdgeShape,
5199
- _r as boxPortOffsetFn
5199
+ Ht as boxPortOffsetFn
5200
5200
  };