@html-graph/html-graph 8.16.0 → 8.17.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.
@@ -1,7 +1,7 @@
1
1
  var qe = Object.defineProperty;
2
2
  var et = (r, e, t) => e in r ? qe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var i = (r, e, t) => et(r, typeof e != "symbol" ? e + "" : e, t);
4
- var V = /* @__PURE__ */ ((r) => (r.Line = "line", r.NodeCycle = "node-cycle", r.PortCycle = "port-cycle", r))(V || {});
4
+ var I = /* @__PURE__ */ ((r) => (r.Line = "line", r.NodeCycle = "node-cycle", r.PortCycle = "port-cycle", r))(I || {});
5
5
  const tt = () => {
6
6
  const r = document.createElement("div");
7
7
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r.style.overflow = "hidden", r;
@@ -13,7 +13,7 @@ const tt = () => {
13
13
  }, st = (r) => {
14
14
  r.style.removeProperty("position"), r.style.removeProperty("top"), r.style.removeProperty("left"), r.style.removeProperty("visibility"), r.style.removeProperty("transform");
15
15
  };
16
- class Ce {
16
+ class Te {
17
17
  constructor(e, t, o) {
18
18
  i(this, "host", tt());
19
19
  i(this, "container", rt());
@@ -72,8 +72,8 @@ class Ce {
72
72
  h,
73
73
  d
74
74
  ), u = this.createEdgeRenderPort(s, a, h, d);
75
- let g = V.Line;
76
- o.element === s.element ? g = V.PortCycle : o.nodeId === s.nodeId && (g = V.NodeCycle), t.payload.shape.render({ from: c, to: u, category: g });
75
+ let g = I.Line;
76
+ o.element === s.element ? g = I.PortCycle : o.nodeId === s.nodeId && (g = I.NodeCycle), t.payload.shape.render({ from: c, to: u, category: g });
77
77
  }
78
78
  updateEdgePriority(e) {
79
79
  const t = this.graphStore.getEdge(e);
@@ -245,7 +245,7 @@ class at {
245
245
  this.isEdgeValid(e) && (this.deferredEdges.delete(e), this.htmlView.attachEdge(e));
246
246
  }
247
247
  }
248
- class _ {
248
+ class q {
249
249
  constructor() {
250
250
  i(this, "callbacks", /* @__PURE__ */ new Set());
251
251
  }
@@ -262,10 +262,10 @@ class _ {
262
262
  }
263
263
  }
264
264
  const P = () => {
265
- const r = new _();
265
+ const r = new q();
266
266
  return [r, r];
267
267
  };
268
- class Te {
268
+ class Ce {
269
269
  constructor(e, t, o, s) {
270
270
  i(this, "beforeDestroyEmitter");
271
271
  i(this, "destroyed", !1);
@@ -743,7 +743,7 @@ class dt {
743
743
  this.observer.disconnect();
744
744
  }
745
745
  }
746
- class q {
746
+ class ee {
747
747
  constructor(e) {
748
748
  i(this, "elementToNodeId", /* @__PURE__ */ new Map());
749
749
  i(this, "nodesResizeObserver");
@@ -769,7 +769,7 @@ class q {
769
769
  }), this.canvas.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.canvas.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
770
770
  }
771
771
  static configure(e) {
772
- new q(e);
772
+ new ee(e);
773
773
  }
774
774
  handleNodeResize(e) {
775
775
  const t = this.elementToNodeId.get(e);
@@ -788,9 +788,9 @@ class ut {
788
788
  return ct(this.element, e, t) && lt(this.win, e, t);
789
789
  }
790
790
  }
791
- const k = (r, e) => {
791
+ const H = (r, e) => {
792
792
  e !== null ? r.style.cursor = e : r.style.removeProperty("cursor");
793
- }, H = (r) => {
793
+ }, Y = (r) => {
794
794
  const e = document.createElement("div");
795
795
  return {
796
796
  id: r.overlayNodeId,
@@ -846,7 +846,7 @@ const Re = (r, e) => {
846
846
  }
847
847
  return null;
848
848
  };
849
- var M = /* @__PURE__ */ ((r) => (r.StaticNodeId = "static", r.DraggingNodeId = "dragging", r.EdgeId = "edge", r))(M || {});
849
+ var D = /* @__PURE__ */ ((r) => (r.StaticNodeId = "static", r.DraggingNodeId = "dragging", r.EdgeId = "edge", r))(D || {});
850
850
  const Le = (r, e) => ({
851
851
  x: r / 2,
852
852
  y: e / 2
@@ -889,17 +889,17 @@ class pt {
889
889
  { x: t.x + s, y: t.y },
890
890
  n,
891
891
  t
892
- ), w = m(
892
+ ), p = m(
893
893
  { x: o.x - s, y: o.y },
894
894
  a,
895
895
  o
896
- ), p = {
896
+ ), w = {
897
897
  x: l.x + n.x * h,
898
898
  y: l.y + n.y * h
899
899
  }, y = {
900
- x: w.x - a.x * h,
901
- y: w.y - a.y * h
902
- }, f = `M ${l.x} ${l.y} C ${p.x} ${p.y}, ${y.x} ${y.y}, ${w.x} ${w.y}`, x = d ? "" : `M ${t.x} ${t.y} L ${l.x} ${l.y} `, E = c ? "" : ` M ${w.x} ${w.y} L ${o.x} ${o.y}`;
900
+ x: p.x - a.x * h,
901
+ y: p.y - a.y * h
902
+ }, f = `M ${l.x} ${l.y} C ${w.x} ${w.y}, ${y.x} ${y.y}, ${p.x} ${p.y}`, x = d ? "" : `M ${t.x} ${t.y} L ${l.x} ${l.y} `, E = c ? "" : ` M ${p.x} ${p.y} L ${o.x} ${o.y}`;
903
903
  this.path = `${x}${f}${E}`;
904
904
  }
905
905
  }
@@ -922,79 +922,79 @@ class wt {
922
922
  { x: d.x + u, y: d.y },
923
923
  n,
924
924
  d
925
- ) : d, w = o ? m(
925
+ ) : d, p = o ? m(
926
926
  {
927
927
  x: c.x - u,
928
928
  y: c.y
929
929
  },
930
930
  a,
931
931
  c
932
- ) : c, p = Math.cos(h) * g, y = Math.sin(h) * g, f = m(
932
+ ) : c, w = Math.cos(h) * g, y = Math.sin(h) * g, f = m(
933
933
  { x: d.x + u, y: d.y },
934
934
  n,
935
935
  d
936
936
  ), x = {
937
- x: f.x + p,
937
+ x: f.x + w,
938
938
  y: f.y + y
939
939
  }, E = m(
940
940
  { x: c.x - u, y: c.y },
941
941
  a,
942
942
  c
943
- ), N = {
944
- x: E.x + p,
943
+ ), T = {
944
+ x: E.x + w,
945
945
  y: E.y + y
946
946
  }, C = {
947
- x: (x.x + N.x) / 2,
948
- y: (x.y + N.y) / 2
949
- }, T = {
947
+ x: (x.x + T.x) / 2,
948
+ y: (x.y + T.y) / 2
949
+ }, M = {
950
950
  x: f.x + s * n.x,
951
951
  y: f.y + s * n.y
952
- }, I = {
952
+ }, F = {
953
953
  x: E.x - s * a.x,
954
954
  y: E.y - s * a.y
955
- }, F = {
956
- x: f.x + p,
957
- y: f.y + y
958
955
  }, U = {
959
- x: E.x + p,
956
+ x: f.x + w,
957
+ y: f.y + y
958
+ }, R = {
959
+ x: E.x + w,
960
960
  y: E.y + y
961
961
  };
962
962
  this.path = [
963
963
  `M ${l.x} ${l.y}`,
964
964
  `L ${f.x} ${f.y}`,
965
- `C ${T.x} ${T.y} ${F.x} ${F.y} ${C.x} ${C.y}`,
966
- `C ${U.x} ${U.y} ${I.x} ${I.y} ${E.x} ${E.y}`,
967
- `L ${w.x} ${w.y}`
965
+ `C ${M.x} ${M.y} ${U.x} ${U.y} ${C.x} ${C.y}`,
966
+ `C ${R.x} ${R.y} ${F.x} ${F.y} ${E.x} ${E.y}`,
967
+ `L ${p.x} ${p.y}`
968
968
  ].join(" "), this.midpoint = C;
969
969
  }
970
970
  }
971
- const ee = Object.freeze({
971
+ const te = Object.freeze({
972
972
  edgeColor: "--edge-color"
973
973
  }), Ie = (r) => {
974
974
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
975
- return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(ee.edgeColor, r), e;
975
+ return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(te.edgeColor, r), e;
976
976
  }, Fe = (r) => {
977
977
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
978
- return e.setAttribute("stroke", `var(${ee.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
979
- }, Y = () => {
978
+ return e.setAttribute("stroke", `var(${te.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
979
+ }, X = () => {
980
980
  const r = document.createElementNS("http://www.w3.org/2000/svg", "path");
981
- return r.setAttribute("fill", `var(${ee.edgeColor})`), r;
981
+ return r.setAttribute("fill", `var(${te.edgeColor})`), r;
982
982
  }, Ue = (r, e) => {
983
983
  r.style.transform = `translate(${e.x}px, ${e.y}px)`, r.style.width = `${e.width}px`, r.style.height = `${e.height}px`;
984
- }, L = (r, e) => {
984
+ }, V = (r, e) => {
985
985
  const t = [];
986
986
  if (r.length > 0 && t.push(`M ${r[0].x} ${r[0].y}`), r.length === 2 && t.push(`L ${r[1].x} ${r[1].y}`), r.length > 2) {
987
987
  const o = r.length - 1;
988
988
  let s = 0, n = 0, a = 0;
989
989
  r.forEach((h, d) => {
990
990
  let c = 0, u = 0, g = 0;
991
- const l = d > 0, w = d < o, p = l && w;
992
- if (l && (c = -s, u = -n, g = a), w) {
993
- const T = r[d + 1];
994
- s = T.x - h.x, n = T.y - h.y, a = Math.sqrt(s * s + n * n);
991
+ const l = d > 0, p = d < o, w = l && p;
992
+ if (l && (c = -s, u = -n, g = a), p) {
993
+ const M = r[d + 1];
994
+ s = M.x - h.x, n = M.y - h.y, a = Math.sqrt(s * s + n * n);
995
995
  }
996
- const f = a !== 0 ? Math.min((p ? e : 0) / a, d < o - 1 ? 0.5 : 1) : 0, x = p ? { x: h.x + s * f, y: h.y + n * f } : h, N = g !== 0 ? Math.min((p ? e : 0) / g, d > 1 ? 0.5 : 1) : 0, C = p ? { x: h.x + c * N, y: h.y + u * N } : h;
997
- d > 0 && t.push(`L ${C.x} ${C.y}`), p && t.push(
996
+ const f = a !== 0 ? Math.min((w ? e : 0) / a, d < o - 1 ? 0.5 : 1) : 0, x = w ? { x: h.x + s * f, y: h.y + n * f } : h, T = g !== 0 ? Math.min((w ? e : 0) / g, d > 1 ? 0.5 : 1) : 0, C = w ? { x: h.x + c * T, y: h.y + u * T } : h;
997
+ d > 0 && t.push(`L ${C.x} ${C.y}`), w && t.push(
998
998
  `C ${h.x} ${h.y} ${h.x} ${h.y} ${x.x} ${x.y}`
999
999
  );
1000
1000
  });
@@ -1061,14 +1061,14 @@ class ft {
1061
1061
  },
1062
1062
  n,
1063
1063
  o
1064
- ) : o, w = a + h, p = m(
1065
- { x: t.x + w, y: t.y },
1064
+ ) : o, p = a + h, w = m(
1065
+ { x: t.x + p, y: t.y },
1066
1066
  s,
1067
1067
  t
1068
- ), y = m({ x: o.x - w, y: o.y }, n, o), f = yt(
1068
+ ), y = m({ x: o.x - p, y: o.y }, n, o), f = yt(
1069
1069
  {
1070
- x: p.x,
1071
- y: p.y,
1070
+ x: w.x,
1071
+ y: w.y,
1072
1072
  dirX: s.x
1073
1073
  },
1074
1074
  {
@@ -1077,7 +1077,7 @@ class ft {
1077
1077
  dirX: n.x
1078
1078
  }
1079
1079
  );
1080
- this.path = L(
1080
+ this.path = V(
1081
1081
  [g, ...f.points, l],
1082
1082
  d
1083
1083
  ), this.midpoint = f.midpoint;
@@ -1099,11 +1099,11 @@ class vt {
1099
1099
  detourDir: u,
1100
1100
  detourDistance: g,
1101
1101
  roundness: l
1102
- } = e, w = t ? m(
1102
+ } = e, p = t ? m(
1103
1103
  { x: s.x + a, y: s.y },
1104
1104
  h,
1105
1105
  s
1106
- ) : s, p = o ? m(
1106
+ ) : s, w = o ? m(
1107
1107
  {
1108
1108
  x: n.x - a,
1109
1109
  y: n.y
@@ -1114,22 +1114,22 @@ class vt {
1114
1114
  { x: s.x + y, y: s.y },
1115
1115
  h,
1116
1116
  s
1117
- ), N = {
1117
+ ), T = {
1118
1118
  x: E.x + f,
1119
1119
  y: E.y + x
1120
1120
  }, C = m(
1121
1121
  { x: n.x - y, y: n.y },
1122
1122
  d,
1123
1123
  n
1124
- ), T = {
1124
+ ), M = {
1125
1125
  x: C.x + f,
1126
1126
  y: C.y + x
1127
1127
  };
1128
1128
  this.midpoint = {
1129
- x: (N.x + T.x) / 2,
1130
- y: (N.y + T.y) / 2
1131
- }, this.path = L(
1132
- [w, E, N, T, C, p],
1129
+ x: (T.x + M.x) / 2,
1130
+ y: (T.y + M.y) / 2
1131
+ }, this.path = V(
1132
+ [p, E, T, M, C, w],
1133
1133
  l
1134
1134
  );
1135
1135
  }
@@ -1158,13 +1158,13 @@ class mt {
1158
1158
  d,
1159
1159
  o,
1160
1160
  -a
1161
- ), w = a + c, p = { x: t.x + w, y: t.y }, y = m(p, h, t), f = { x: o.x - w, y: o.y }, x = m(f, d, o);
1162
- this.path = L(
1161
+ ), p = a + c, w = { x: t.x + p, y: t.y }, y = m(w, h, t), f = { x: o.x - p, y: o.y }, x = m(f, d, o);
1162
+ this.path = V(
1163
1163
  [g, y, x, l],
1164
1164
  u
1165
1165
  );
1166
- const E = (y.x + x.x) / 2, N = (y.y + x.y) / 2;
1167
- this.midpoint = { x: E, y: N };
1166
+ const E = (y.x + x.x) / 2, T = (y.y + x.y) / 2;
1167
+ this.midpoint = { x: E, y: T };
1168
1168
  }
1169
1169
  createArrowPoint(e, t, o, s) {
1170
1170
  if (!e)
@@ -1237,14 +1237,14 @@ class Et {
1237
1237
  },
1238
1238
  c,
1239
1239
  o
1240
- ) : o, w = a + h, p = m(
1241
- { x: t.x + w, y: t.y },
1240
+ ) : o, p = a + h, w = m(
1241
+ { x: t.x + p, y: t.y },
1242
1242
  d,
1243
1243
  t
1244
- ), y = m({ x: o.x - w, y: o.y }, c, o), f = xt(
1244
+ ), y = m({ x: o.x - p, y: o.y }, c, o), f = xt(
1245
1245
  {
1246
- x: p.x,
1247
- y: p.y,
1246
+ x: w.x,
1247
+ y: w.y,
1248
1248
  dirY: d.y
1249
1249
  },
1250
1250
  {
@@ -1253,13 +1253,13 @@ class Et {
1253
1253
  dirY: c.y
1254
1254
  }
1255
1255
  );
1256
- this.path = L(
1256
+ this.path = V(
1257
1257
  [g, ...f.points, l],
1258
1258
  u
1259
1259
  ), this.midpoint = f.midpoint;
1260
1260
  }
1261
1261
  }
1262
- class te {
1262
+ class re {
1263
1263
  constructor(e) {
1264
1264
  i(this, "path");
1265
1265
  i(this, "midpoint");
@@ -1272,18 +1272,18 @@ class te {
1272
1272
  { x: d, y: -t },
1273
1273
  { x: d, y: 0 },
1274
1274
  { x: o, y: 0 }
1275
- ].map((w) => m(w, n, { x: 0, y: 0 })).map((w) => ({ x: w.x + a.x, y: w.y + a.y })), l = `M ${a.x} ${a.y} L ${g[0].x} ${g[0].y} `;
1276
- this.path = `${h ? "" : l}${L(g, e.roundness)}`, this.midpoint = { x: (g[3].x + g[4].x) / 2, y: (g[3].y + g[4].y) / 2 };
1275
+ ].map((p) => m(p, n, { x: 0, y: 0 })).map((p) => ({ x: p.x + a.x, y: p.y + a.y })), l = `M ${a.x} ${a.y} L ${g[0].x} ${g[0].y} `;
1276
+ this.path = `${h ? "" : l}${V(g, e.roundness)}`, this.midpoint = { x: (g[3].x + g[4].x) / 2, y: (g[3].y + g[4].y) / 2 };
1277
1277
  }
1278
1278
  }
1279
1279
  class At {
1280
1280
  constructor(e) {
1281
1281
  i(this, "path");
1282
1282
  i(this, "midpoint");
1283
- const { arrowLength: t, radius: o, smallRadius: s, dir: n, origin: a, hasArrow: h } = e, d = s + o, c = s * o / d, u = Math.sqrt(d * d - s * s), g = u * s / d, l = u + o + t, w = t + g, y = [
1283
+ const { arrowLength: t, radius: o, smallRadius: s, dir: n, origin: a, hasArrow: h } = e, d = s + o, c = s * o / d, u = Math.sqrt(d * d - s * s), g = u * s / d, l = u + o + t, p = t + g, y = [
1284
1284
  { x: t, y: 0 },
1285
- { x: w, y: c },
1286
- { x: w, y: -c },
1285
+ { x: p, y: c },
1286
+ { x: p, y: -c },
1287
1287
  { x: l, y: 0 }
1288
1288
  ].map((E) => m(E, n, { x: 0, y: 0 })).map((E) => ({ x: E.x + a.x, y: E.y + a.y })), f = [
1289
1289
  `M ${y[0].x} ${y[0].y}`,
@@ -1321,7 +1321,7 @@ class St {
1321
1321
  shift: t,
1322
1322
  arrowLength: d,
1323
1323
  dir: g
1324
- }), w = this.createDirectLinePoint({
1324
+ }), p = this.createDirectLinePoint({
1325
1325
  offset: n,
1326
1326
  hasArrow: h,
1327
1327
  flip: -1,
@@ -1329,7 +1329,7 @@ class St {
1329
1329
  arrowLength: d,
1330
1330
  dir: g
1331
1331
  });
1332
- this.path = `M ${l.x} ${l.y} L ${w.x} ${w.y}`;
1332
+ this.path = `M ${l.x} ${l.y} L ${p.x} ${p.y}`;
1333
1333
  }
1334
1334
  createDirectLinePoint(e) {
1335
1335
  const t = e.hasArrow ? e.arrowLength : 0, o = e.offset + t, s = e.flip * o / this.diagonalDistance, { dir: n, shift: a } = e;
@@ -1362,33 +1362,33 @@ class Nt {
1362
1362
  { x: n.x + s, y: n.y },
1363
1363
  h,
1364
1364
  n
1365
- ) : n, w = o ? m(
1365
+ ) : n, p = o ? m(
1366
1366
  {
1367
1367
  x: a.x - s,
1368
1368
  y: a.y
1369
1369
  },
1370
1370
  d,
1371
1371
  a
1372
- ) : a, p = s + c, y = m(
1373
- { x: n.x + p, y: n.y },
1372
+ ) : a, w = s + c, y = m(
1373
+ { x: n.x + w, y: n.y },
1374
1374
  h,
1375
1375
  n
1376
1376
  ), f = m(
1377
- { x: a.x - p, y: a.y },
1377
+ { x: a.x - w, y: a.y },
1378
1378
  d,
1379
1379
  a
1380
1380
  ), x = bt(y, f, g);
1381
1381
  this.midpoint = {
1382
1382
  x: (y.x + f.x) / 2,
1383
1383
  y: x
1384
- }, this.path = L(
1384
+ }, this.path = V(
1385
1385
  [
1386
1386
  l,
1387
1387
  y,
1388
1388
  { x: y.x, y: x },
1389
1389
  { x: f.x, y: x },
1390
1390
  f,
1391
- w
1391
+ p
1392
1392
  ],
1393
1393
  u
1394
1394
  );
@@ -1398,7 +1398,7 @@ const Pt = (r, e, t) => {
1398
1398
  const o = Math.max(r.x, e.x), s = Math.min(r.x, e.x);
1399
1399
  return (t >= 0 ? o : s) + t;
1400
1400
  };
1401
- class Ct {
1401
+ class Tt {
1402
1402
  constructor(e) {
1403
1403
  i(this, "path");
1404
1404
  i(this, "midpoint");
@@ -1417,33 +1417,33 @@ class Ct {
1417
1417
  { x: h.x + s, y: h.y },
1418
1418
  n,
1419
1419
  h
1420
- ) : h, w = o ? m(
1420
+ ) : h, p = o ? m(
1421
1421
  {
1422
1422
  x: d.x - s,
1423
1423
  y: d.y
1424
1424
  },
1425
1425
  a,
1426
1426
  d
1427
- ) : d, p = s + c, y = m(
1428
- { x: h.x + p, y: h.y },
1427
+ ) : d, w = s + c, y = m(
1428
+ { x: h.x + w, y: h.y },
1429
1429
  n,
1430
1430
  h
1431
1431
  ), f = m(
1432
- { x: d.x - p, y: d.y },
1432
+ { x: d.x - w, y: d.y },
1433
1433
  a,
1434
1434
  d
1435
1435
  ), x = Pt(y, f, u);
1436
1436
  this.midpoint = {
1437
1437
  x,
1438
1438
  y: (y.y + f.y) / 2
1439
- }, this.path = L(
1439
+ }, this.path = V(
1440
1440
  [
1441
1441
  l,
1442
1442
  y,
1443
1443
  { x, y: y.y },
1444
1444
  { x, y: f.y },
1445
1445
  f,
1446
- w
1446
+ p
1447
1447
  ],
1448
1448
  g
1449
1449
  );
@@ -1472,7 +1472,7 @@ const v = Object.freeze({
1472
1472
  interactiveWidth: 10,
1473
1473
  preOffset: 0
1474
1474
  }), Ee = (r) => ({ x: Math.cos(r), y: Math.sin(r) });
1475
- class X {
1475
+ class G {
1476
1476
  constructor(e) {
1477
1477
  i(this, "svg");
1478
1478
  i(this, "group", document.createElementNS(
@@ -1485,7 +1485,7 @@ class X {
1485
1485
  i(this, "onAfterRender");
1486
1486
  i(this, "afterRenderEmitter");
1487
1487
  i(this, "arrowRenderer");
1488
- this.params = e, [this.afterRenderEmitter, this.onAfterRender] = P(), this.arrowRenderer = this.params.arrowRenderer, this.svg = Ie(e.color), this.svg.appendChild(this.group), this.line = Fe(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = Y(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = Y(), this.group.appendChild(this.targetArrow));
1488
+ this.params = e, [this.afterRenderEmitter, this.onAfterRender] = P(), this.arrowRenderer = this.params.arrowRenderer, this.svg = Ie(e.color), this.svg.appendChild(this.group), this.line = Fe(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = X(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = X(), this.group.appendChild(this.targetArrow));
1489
1489
  }
1490
1490
  render(e) {
1491
1491
  const { x: t, y: o, width: s, height: n, from: a, to: h } = Ve(
@@ -1496,28 +1496,28 @@ class X {
1496
1496
  Ue(this.svg, { x: t, y: o, width: s, height: n });
1497
1497
  const d = Ee(e.from.direction), c = Ee(e.to.direction);
1498
1498
  let u = { x: -c.x, y: -c.y }, g;
1499
- e.category === V.PortCycle ? (g = this.params.createCyclePath, u = d) : e.category === V.NodeCycle ? g = this.params.createDetourPath : g = this.params.createLinePath;
1499
+ e.category === I.PortCycle ? (g = this.params.createCyclePath, u = d) : e.category === I.NodeCycle ? g = this.params.createDetourPath : g = this.params.createLinePath;
1500
1500
  const l = g(a, h, d, c);
1501
1501
  this.line.setAttribute("d", l.path);
1502
- let w = null;
1503
- this.sourceArrow && (w = this.arrowRenderer({
1502
+ let p = null;
1503
+ this.sourceArrow && (p = this.arrowRenderer({
1504
1504
  direction: d,
1505
1505
  shift: a,
1506
1506
  arrowLength: this.params.arrowLength
1507
- }), this.sourceArrow.setAttribute("d", w));
1508
- let p = null;
1509
- this.targetArrow && (p = this.arrowRenderer({
1507
+ }), this.sourceArrow.setAttribute("d", p));
1508
+ let w = null;
1509
+ this.targetArrow && (w = this.arrowRenderer({
1510
1510
  direction: u,
1511
1511
  shift: h,
1512
1512
  arrowLength: this.params.arrowLength
1513
- }), this.targetArrow.setAttribute("d", p)), this.afterRenderEmitter.emit({
1513
+ }), this.targetArrow.setAttribute("d", w)), this.afterRenderEmitter.emit({
1514
1514
  edgePath: l,
1515
- sourceArrowPath: w,
1516
- targetArrowPath: p
1515
+ sourceArrowPath: p,
1516
+ targetArrowPath: w
1517
1517
  });
1518
1518
  }
1519
1519
  }
1520
- const Tt = (r) => (e) => {
1520
+ const Ct = (r) => (e) => {
1521
1521
  const o = [
1522
1522
  { x: 0, y: 0 },
1523
1523
  { x: e.arrowLength, y: r.radius },
@@ -1535,12 +1535,12 @@ const Tt = (r) => (e) => {
1535
1535
  { x: a, y: -h },
1536
1536
  { x: a, y: h }
1537
1537
  ].map(
1538
- (p) => m(p, e.direction, { x: 0, y: 0 })
1539
- ).map((p) => ({
1540
- x: p.x + e.shift.x,
1541
- y: p.y + e.shift.y
1542
- })), u = `M ${c[0].x} ${c[0].y}`, g = `A ${s} ${s} 0 0 0 ${c[1].x} ${c[1].y}`, l = `A ${t} ${t} 0 0 0 ${c[2].x} ${c[2].y}`, w = `A ${s} ${s} 0 0 0 ${c[0].x} ${c[0].y}`;
1543
- return `${u} ${g} ${l} ${w}`;
1538
+ (w) => m(w, e.direction, { x: 0, y: 0 })
1539
+ ).map((w) => ({
1540
+ x: w.x + e.shift.x,
1541
+ y: w.y + e.shift.y
1542
+ })), u = `M ${c[0].x} ${c[0].y}`, g = `A ${s} ${s} 0 0 0 ${c[1].x} ${c[1].y}`, l = `A ${t} ${t} 0 0 0 ${c[2].x} ${c[2].y}`, p = `A ${s} ${s} 0 0 0 ${c[0].x} ${c[0].y}`;
1543
+ return `${u} ${g} ${l} ${p}`;
1544
1544
  }, Dt = (r) => (e) => {
1545
1545
  const t = r.smallRadius, o = r.radius, s = m(
1546
1546
  {
@@ -1567,7 +1567,7 @@ const Tt = (r) => (e) => {
1567
1567
  return r;
1568
1568
  switch (r.type) {
1569
1569
  case "triangle":
1570
- return Tt({
1570
+ return Ct({
1571
1571
  radius: r.radius ?? v.polygonArrowRadius
1572
1572
  });
1573
1573
  case "arc":
@@ -1629,7 +1629,7 @@ class Rt {
1629
1629
  hasSourceArrow: this.hasSourceArrow,
1630
1630
  hasTargetArrow: this.hasTargetArrow
1631
1631
  }));
1632
- this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.curvature = (e == null ? void 0 : e.curvature) ?? v.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? v.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? v.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new X({
1632
+ this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.curvature = (e == null ? void 0 : e.curvature) ?? v.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? v.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? v.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new G({
1633
1633
  color: (e == null ? void 0 : e.color) ?? v.color,
1634
1634
  width: (e == null ? void 0 : e.width) ?? v.width,
1635
1635
  arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
@@ -1662,7 +1662,7 @@ class Lt {
1662
1662
  i(this, "hasSourceArrow");
1663
1663
  i(this, "hasTargetArrow");
1664
1664
  i(this, "pathShape");
1665
- i(this, "createCyclePath", (e, t, o) => new te({
1665
+ i(this, "createCyclePath", (e, t, o) => new re({
1666
1666
  origin: e,
1667
1667
  dir: o,
1668
1668
  arrowLength: this.arrowLength,
@@ -1700,7 +1700,7 @@ class Lt {
1700
1700
  t,
1701
1701
  this.arrowOffset,
1702
1702
  this.cycleSquareSide / 2
1703
- ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new X({
1703
+ ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new G({
1704
1704
  color: (e == null ? void 0 : e.color) ?? v.color,
1705
1705
  width: (e == null ? void 0 : e.width) ?? v.width,
1706
1706
  arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
@@ -1734,7 +1734,7 @@ class Vt {
1734
1734
  i(this, "hasSourceArrow");
1735
1735
  i(this, "hasTargetArrow");
1736
1736
  i(this, "pathShape");
1737
- i(this, "createCyclePath", (e, t, o) => new te({
1737
+ i(this, "createCyclePath", (e, t, o) => new re({
1738
1738
  origin: e,
1739
1739
  dir: o,
1740
1740
  arrowLength: this.arrowLength,
@@ -1773,7 +1773,7 @@ class Vt {
1773
1773
  t,
1774
1774
  this.arrowOffset,
1775
1775
  this.cycleSquareSide / 2
1776
- ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new X({
1776
+ ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new G({
1777
1777
  color: (e == null ? void 0 : e.color) ?? v.color,
1778
1778
  width: (e == null ? void 0 : e.width) ?? v.width,
1779
1779
  arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
@@ -1806,7 +1806,7 @@ class It {
1806
1806
  i(this, "hasSourceArrow");
1807
1807
  i(this, "hasTargetArrow");
1808
1808
  i(this, "pathShape");
1809
- i(this, "createCyclePath", (e, t, o) => new te({
1809
+ i(this, "createCyclePath", (e, t, o) => new re({
1810
1810
  origin: e,
1811
1811
  dir: o,
1812
1812
  arrowLength: this.arrowLength,
@@ -1815,7 +1815,7 @@ class It {
1815
1815
  roundness: this.roundness,
1816
1816
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1817
1817
  }));
1818
- i(this, "createDetourPath", (e, t, o, s) => new Ct({
1818
+ i(this, "createDetourPath", (e, t, o, s) => new Tt({
1819
1819
  from: e,
1820
1820
  to: t,
1821
1821
  fromDir: o,
@@ -1844,7 +1844,7 @@ class It {
1844
1844
  t,
1845
1845
  this.arrowOffset,
1846
1846
  this.cycleSquareSide / 2
1847
- ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new X({
1847
+ ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new G({
1848
1848
  color: (e == null ? void 0 : e.color) ?? v.color,
1849
1849
  width: (e == null ? void 0 : e.width) ?? v.width,
1850
1850
  arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
@@ -1879,7 +1879,7 @@ class $e {
1879
1879
  i(this, "onAfterRender");
1880
1880
  i(this, "afterRenderEmitter");
1881
1881
  i(this, "arrowRenderer");
1882
- [this.afterRenderEmitter, this.onAfterRender] = P(), this.color = (e == null ? void 0 : e.color) ?? v.color, this.width = (e == null ? void 0 : e.width) ?? v.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.arrowRenderer = B((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? v.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? v.preOffset, this.svg = Ie(this.color), this.svg.appendChild(this.group), this.line = Fe(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = Y(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = Y(), this.group.appendChild(this.targetArrow));
1882
+ [this.afterRenderEmitter, this.onAfterRender] = P(), this.color = (e == null ? void 0 : e.color) ?? v.color, this.width = (e == null ? void 0 : e.width) ?? v.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.arrowRenderer = B((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? v.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? v.preOffset, this.svg = Ie(this.color), this.svg.appendChild(this.group), this.line = Fe(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = X(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = X(), this.group.appendChild(this.targetArrow));
1883
1883
  }
1884
1884
  render(e) {
1885
1885
  const { x: t, y: o, width: s, height: n, from: a, to: h } = Ve(
@@ -1908,26 +1908,26 @@ class $e {
1908
1908
  y: (h.y - a.y) / g
1909
1909
  };
1910
1910
  if (this.sourceArrow) {
1911
- const w = {
1911
+ const p = {
1912
1912
  x: l.x * this.sourceOffset,
1913
1913
  y: l.y * this.sourceOffset
1914
1914
  };
1915
1915
  c = this.arrowRenderer({
1916
1916
  direction: l,
1917
- shift: w,
1917
+ shift: p,
1918
1918
  arrowLength: this.arrowLength
1919
1919
  }), this.sourceArrow.setAttribute("d", c);
1920
1920
  }
1921
1921
  if (this.targetArrow) {
1922
- const w = {
1922
+ const p = {
1923
1923
  x: l.x * this.targetOffset,
1924
1924
  y: l.y * this.targetOffset
1925
1925
  };
1926
1926
  u = this.arrowRenderer({
1927
1927
  direction: { x: -l.x, y: -l.y },
1928
1928
  shift: {
1929
- x: h.x - w.x,
1930
- y: h.y - w.y
1929
+ x: h.x - p.x,
1930
+ y: h.y - p.y
1931
1931
  },
1932
1932
  arrowLength: this.arrowLength
1933
1933
  }), this.targetArrow.setAttribute("d", u);
@@ -1962,6 +1962,11 @@ class Be {
1962
1962
  i(this, "line");
1963
1963
  i(this, "sourceArrow");
1964
1964
  i(this, "targetArrow");
1965
+ // TODO: make private
1966
+ /**
1967
+ * @deprecated
1968
+ * do use shape.svg instead
1969
+ */
1965
1970
  i(this, "handle", Ft());
1966
1971
  i(this, "onAfterRender");
1967
1972
  i(this, "interactiveLine");
@@ -1981,7 +1986,7 @@ class Be {
1981
1986
  this.baseEdge.render(e);
1982
1987
  }
1983
1988
  }
1984
- class Hr {
1989
+ class Yr {
1985
1990
  constructor(e, t) {
1986
1991
  i(this, "group");
1987
1992
  i(this, "line");
@@ -2097,7 +2102,7 @@ class Oe {
2097
2102
  return this.graphStore.getNodeAdjacentEdgeIds(e);
2098
2103
  }
2099
2104
  }
2100
- class J {
2105
+ class K {
2101
2106
  constructor(e) {
2102
2107
  i(this, "counter", 0);
2103
2108
  this.checkExists = e;
@@ -2115,13 +2120,13 @@ class J {
2115
2120
  }
2116
2121
  class We {
2117
2122
  constructor(e, t, o) {
2118
- i(this, "nodeIdGenerator", new J(
2123
+ i(this, "nodeIdGenerator", new K(
2119
2124
  (e) => this.graphStore.hasNode(e)
2120
2125
  ));
2121
- i(this, "portIdGenerator", new J(
2126
+ i(this, "portIdGenerator", new K(
2122
2127
  (e) => this.graphStore.hasPort(e)
2123
2128
  ));
2124
- i(this, "edgeIdGenerator", new J(
2129
+ i(this, "edgeIdGenerator", new K(
2125
2130
  (e) => this.graphStore.hasEdge(e)
2126
2131
  ));
2127
2132
  i(this, "onAfterNodeAdded", (e) => {
@@ -2252,7 +2257,7 @@ const Bt = (r) => {
2252
2257
  queueMicrotask(() => {
2253
2258
  r();
2254
2259
  });
2255
- }, re = (r) => {
2260
+ }, oe = (r) => {
2256
2261
  r();
2257
2262
  };
2258
2263
  class ze {
@@ -2312,10 +2317,10 @@ class Ye {
2312
2317
  let u = ke(a, d, c);
2313
2318
  const g = t == null ? void 0 : t.contentScale;
2314
2319
  if (g !== void 0) {
2315
- const w = 1 / g;
2320
+ const p = 1 / g;
2316
2321
  u = He(
2317
2322
  u,
2318
- w / a.scale,
2323
+ p / a.scale,
2319
2324
  n.x,
2320
2325
  n.y
2321
2326
  );
@@ -2345,10 +2350,10 @@ class Ye {
2345
2350
  const d = {
2346
2351
  x: (t + o) / 2,
2347
2352
  y: (s + n) / 2
2348
- }, { scale: c } = this.viewportStore.getContentMatrix(), u = (n - s) * c, g = (o - t) * c, { width: l, height: w } = this.viewportStore.getDimensions(), p = Math.max(
2353
+ }, { scale: c } = this.viewportStore.getContentMatrix(), u = (n - s) * c, g = (o - t) * c, { width: l, height: p } = this.viewportStore.getDimensions(), w = Math.max(
2349
2354
  g / l,
2350
- u / w
2351
- ), y = p > 1 ? c / p : c, f = Math.max(y, e.minContentScale);
2355
+ u / p
2356
+ ), y = w > 1 ? c / w : c, f = Math.max(y, e.minContentScale);
2352
2357
  this.center(d, {
2353
2358
  contentScale: f,
2354
2359
  animationDuration: e.animationDuration
@@ -2374,7 +2379,7 @@ class Ye {
2374
2379
  }
2375
2380
  }
2376
2381
  const Xe = (r, e, t) => {
2377
- const o = new Me(), s = new Oe(o), n = new ze(e), a = new Ce(o, e, r), h = {
2382
+ const o = new Me(), s = new Oe(o), n = new ze(e), a = new Te(o, e, r), h = {
2378
2383
  nodes: {
2379
2384
  centerFn: Le,
2380
2385
  priorityFn: () => 0
@@ -2394,7 +2399,7 @@ const Xe = (r, e, t) => {
2394
2399
  focus: {
2395
2400
  contentPadding: 0,
2396
2401
  minContentScale: 0,
2397
- schedule: re,
2402
+ schedule: oe,
2398
2403
  animationDuration: 0
2399
2404
  }
2400
2405
  }, u = new Ye(
@@ -2403,9 +2408,9 @@ const Xe = (r, e, t) => {
2403
2408
  c,
2404
2409
  t
2405
2410
  );
2406
- return new Te(s, n, d, u);
2411
+ return new Ce(s, n, d, u);
2407
2412
  };
2408
- class G {
2413
+ class j {
2409
2414
  constructor(e, t, o, s) {
2410
2415
  i(this, "onAfterPortMarked", (e) => {
2411
2416
  const t = this.canvas.graph.getPort(e);
@@ -2420,7 +2425,7 @@ class G {
2420
2425
  if (!this.params.mouseDownEventVerifier(t))
2421
2426
  return;
2422
2427
  const o = e.currentTarget, s = this.canvas.graph.findPortIdsByElement(o)[0];
2423
- this.params.onPortPointerDown(s, {
2428
+ this.params.portDragAllowedVerifier(s, {
2424
2429
  x: t.clientX,
2425
2430
  y: t.clientY
2426
2431
  }) && (e.stopPropagation(), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
@@ -2434,20 +2439,20 @@ class G {
2434
2439
  e.clientX,
2435
2440
  e.clientY
2436
2441
  )) {
2437
- this.params.onPointerMoveOutside(), this.stopMouseDrag();
2442
+ this.removeWindowMouseListeners(), this.params.onPointerOutside();
2438
2443
  return;
2439
2444
  }
2440
2445
  this.params.onPointerMove({ x: e.clientX, y: e.clientY });
2441
2446
  });
2442
2447
  i(this, "onWindowMouseUp", (e) => {
2443
- this.params.mouseUpEventVerifier(e) && (this.params.onPointerUp({ x: e.clientX, y: e.clientY }), this.stopMouseDrag());
2448
+ this.params.mouseUpEventVerifier(e) && (this.removeWindowMouseListeners(), this.params.onPointerUp({ x: e.clientX, y: e.clientY }));
2444
2449
  });
2445
2450
  i(this, "onPortTouchStart", (e) => {
2446
2451
  const t = e;
2447
2452
  if (t.touches.length !== 1)
2448
2453
  return;
2449
2454
  const o = t.touches[0], s = e.currentTarget, n = this.canvas.graph.findPortIdsByElement(s)[0];
2450
- this.params.onPortPointerDown(n, {
2455
+ this.params.portDragAllowedVerifier(n, {
2451
2456
  x: o.clientX,
2452
2457
  y: o.clientY
2453
2458
  }) && (e.stopPropagation(), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
@@ -2464,14 +2469,15 @@ class G {
2464
2469
  t.clientX,
2465
2470
  t.clientY
2466
2471
  )) {
2467
- this.params.onPointerMoveOutside(), this.stopTouchDrag();
2472
+ this.removeWindowTouchListeners(), this.params.onPointerOutside();
2468
2473
  return;
2469
2474
  }
2470
2475
  this.params.onPointerMove({ x: t.clientX, y: t.clientY });
2471
2476
  });
2472
2477
  i(this, "onWindowTouchFinish", (e) => {
2478
+ this.removeWindowTouchListeners();
2473
2479
  const t = e.changedTouches[0];
2474
- this.params.onPointerUp({ x: t.clientX, y: t.clientY }), this.stopTouchDrag();
2480
+ this.params.onPointerUp({ x: t.clientX, y: t.clientY });
2475
2481
  });
2476
2482
  i(this, "reset", () => {
2477
2483
  this.canvas.graph.getAllPortIds().forEach((e) => {
@@ -2480,12 +2486,12 @@ class G {
2480
2486
  });
2481
2487
  });
2482
2488
  i(this, "revert", () => {
2483
- this.params.onStopDrag(), this.reset(), this.removeWindowMouseListeners(), this.removeWindowTouchListeners();
2489
+ this.removeWindowMouseListeners(), this.removeWindowTouchListeners(), this.reset();
2484
2490
  });
2485
2491
  this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.params = s, this.canvas.graph.onAfterPortMarked.subscribe(this.onAfterPortMarked), this.canvas.graph.onBeforePortUnmarked.subscribe(this.onBeforePortUnmarked), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
2486
2492
  }
2487
2493
  static configure(e, t, o, s) {
2488
- new G(e, t, o, s);
2494
+ new j(e, t, o, s);
2489
2495
  }
2490
2496
  hookPortEvents(e) {
2491
2497
  e.addEventListener("mousedown", this.onPortMouseDown, {
@@ -2497,12 +2503,6 @@ class G {
2497
2503
  unhookPortEvents(e) {
2498
2504
  e.removeEventListener("mousedown", this.onPortMouseDown), e.removeEventListener("touchstart", this.onPortTouchStart);
2499
2505
  }
2500
- stopMouseDrag() {
2501
- this.params.onStopDrag(), this.removeWindowMouseListeners();
2502
- }
2503
- stopTouchDrag() {
2504
- this.params.onStopDrag(), this.removeWindowTouchListeners();
2505
- }
2506
2506
  removeWindowMouseListeners() {
2507
2507
  this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
2508
2508
  }
@@ -2511,35 +2511,6 @@ class G {
2511
2511
  }
2512
2512
  }
2513
2513
  class zt {
2514
- constructor(e, t, o) {
2515
- this.canvas = e, this.layoutAlgorithm = t, this.params = o;
2516
- }
2517
- apply() {
2518
- const e = this.layoutAlgorithm.calculateCoordinates({
2519
- graph: this.canvas.graph,
2520
- viewport: this.canvas.viewport
2521
- });
2522
- this.params.onBeforeApplied(), e.forEach((t, o) => {
2523
- this.params.staticNodeResolver(o) || this.canvas.updateNode(o, t);
2524
- }), this.params.onAfterApplied();
2525
- }
2526
- }
2527
- class kt {
2528
- constructor(e, t, o) {
2529
- this.canvas = e, this.layoutAlgorithm = t, this.params = o;
2530
- }
2531
- apply(e) {
2532
- const t = this.layoutAlgorithm.calculateNextCoordinates({
2533
- graph: this.canvas.graph,
2534
- viewport: this.canvas.viewport,
2535
- dt: e
2536
- });
2537
- this.params.onBeforeApplied(), t.forEach((o, s) => {
2538
- this.params.staticNodeResolver(s) || this.canvas.updateNode(s, o);
2539
- }), this.params.onAfterApplied();
2540
- }
2541
- }
2542
- class Ht {
2543
2514
  constructor() {
2544
2515
  i(this, "field", "_htmlGraphTags");
2545
2516
  }
@@ -2552,8 +2523,8 @@ class Ht {
2552
2523
  s === void 0 ? o[this.field] = /* @__PURE__ */ new Set([t]) : s.add(t);
2553
2524
  }
2554
2525
  }
2555
- const oe = Symbol();
2556
- class se {
2526
+ const se = Symbol();
2527
+ class ie {
2557
2528
  constructor(e, t, o) {
2558
2529
  i(this, "onSelected");
2559
2530
  i(this, "mouseDownEventVerifier");
@@ -2643,7 +2614,7 @@ class se {
2643
2614
  this.movedDistance += s, this.movedDistance > this.movementThreshold && o();
2644
2615
  }
2645
2616
  }
2646
- class ie {
2617
+ class ne {
2647
2618
  constructor(e, t, o, s, n) {
2648
2619
  i(this, "grabbedNode", null);
2649
2620
  i(this, "maxNodePriority", 0);
@@ -2680,7 +2651,7 @@ class ie {
2680
2651
  nodeId: s,
2681
2652
  dx: h.x - n.x,
2682
2653
  dy: h.y - n.y
2683
- }, k(this.element, this.params.dragCursor), this.moveNodeOnTop(s), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2654
+ }, H(this.element, this.params.dragCursor), this.moveNodeOnTop(s), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2684
2655
  passive: !0
2685
2656
  }), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
2686
2657
  passive: !0
@@ -2762,7 +2733,7 @@ class ie {
2762
2733
  this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.params = n, this.graph = e.graph, this.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.graph.onAfterNodeUpdated.subscribe(this.onAfterNodeUpdated), this.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
2763
2734
  }
2764
2735
  static configure(e, t, o, s, n) {
2765
- new ie(
2736
+ new ne(
2766
2737
  e,
2767
2738
  t,
2768
2739
  o,
@@ -2794,7 +2765,7 @@ class ie {
2794
2765
  }
2795
2766
  }
2796
2767
  stopMouseDrag() {
2797
- this.grabbedNode !== null && this.graph.hasNode(this.grabbedNode.nodeId) && this.params.onNodeDragFinished(this.grabbedNode.nodeId), this.grabbedNode = null, k(this.element, null), this.removeMouseDragListeners();
2768
+ this.grabbedNode !== null && this.graph.hasNode(this.grabbedNode.nodeId) && this.params.onNodeDragFinished(this.grabbedNode.nodeId), this.grabbedNode = null, H(this.element, null), this.removeMouseDragListeners();
2798
2769
  }
2799
2770
  removeMouseDragListeners() {
2800
2771
  this.window.removeEventListener("mouseup", this.onWindowMouseUp), this.window.removeEventListener("mousemove", this.onWindowMouseMove);
@@ -2856,7 +2827,7 @@ const W = (r) => {
2856
2827
  touches: e
2857
2828
  };
2858
2829
  };
2859
- class j {
2830
+ class J {
2860
2831
  constructor(e, t, o, s, n) {
2861
2832
  i(this, "viewport");
2862
2833
  i(this, "prevTouches", null);
@@ -2866,7 +2837,7 @@ class j {
2866
2837
  this.removeMouseDragListeners(), this.removeTouchDragListeners();
2867
2838
  });
2868
2839
  i(this, "onMouseDown", (e) => {
2869
- this.params.mouseDownEventVerifier(e) && (k(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2840
+ this.params.mouseDownEventVerifier(e) && (H(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2870
2841
  passive: !0
2871
2842
  }), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
2872
2843
  passive: !0
@@ -2944,7 +2915,7 @@ class j {
2944
2915
  }), e.onBeforeDestroy.subscribe(this.revert);
2945
2916
  }
2946
2917
  static configure(e, t, o, s, n) {
2947
- new j(
2918
+ new J(
2948
2919
  e,
2949
2920
  t,
2950
2921
  o,
@@ -2971,7 +2942,7 @@ class j {
2971
2942
  this.performTransform(d);
2972
2943
  }
2973
2944
  stopMouseDrag() {
2974
- k(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
2945
+ H(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
2975
2946
  }
2976
2947
  removeMouseDragListeners() {
2977
2948
  this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
@@ -3001,7 +2972,7 @@ class j {
3001
2972
  this.params.onResizeTransformStarted(), this.canvas.patchViewportMatrix(s), this.params.onResizeTransformFinished();
3002
2973
  }
3003
2974
  }
3004
- class ne {
2975
+ class ae {
3005
2976
  constructor(e, t, o, s, n, a, h) {
3006
2977
  i(this, "nodeHorizontal");
3007
2978
  i(this, "nodeVertical");
@@ -3048,7 +3019,7 @@ class ne {
3048
3019
  this.scheduleLoadAreaAroundViewport(), s.onTransformFinished();
3049
3020
  }
3050
3021
  };
3051
- j.configure(
3022
+ J.configure(
3052
3023
  e,
3053
3024
  this.element,
3054
3025
  this.window,
@@ -3057,7 +3028,7 @@ class ne {
3057
3028
  ), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
3058
3029
  }
3059
3030
  static configure(e, t, o, s, n, a, h) {
3060
- new ne(
3031
+ new ae(
3061
3032
  e,
3062
3033
  t,
3063
3034
  o,
@@ -3088,24 +3059,24 @@ class ne {
3088
3059
  });
3089
3060
  }
3090
3061
  }
3091
- const Yt = () => {
3062
+ const kt = () => {
3092
3063
  const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3093
3064
  return r.style.position = "absolute", r.style.inset = "0", r;
3094
- }, Xt = () => {
3065
+ }, Ht = () => {
3095
3066
  const r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
3096
3067
  return r.setAttribute("fill", "url(#pattern)"), r;
3097
- }, Gt = () => {
3068
+ }, Yt = () => {
3098
3069
  const r = document.createElementNS(
3099
3070
  "http://www.w3.org/2000/svg",
3100
3071
  "pattern"
3101
3072
  );
3102
3073
  return r.setAttribute("id", "pattern"), r;
3103
3074
  };
3104
- class ae {
3075
+ class he {
3105
3076
  constructor(e, t, o) {
3106
- i(this, "svg", Yt());
3107
- i(this, "patternRenderingRectangle", Xt());
3108
- i(this, "pattern", Gt());
3077
+ i(this, "svg", kt());
3078
+ i(this, "patternRenderingRectangle", Ht());
3079
+ i(this, "pattern", Yt());
3109
3080
  i(this, "patternContent");
3110
3081
  i(this, "tileWidth");
3111
3082
  i(this, "tileHeight");
@@ -3126,7 +3097,7 @@ class ae {
3126
3097
  }), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterTransformUpdated), this.onAfterTransformUpdated();
3127
3098
  }
3128
3099
  static configure(e, t, o) {
3129
- new ae(e, t, o);
3100
+ new he(e, t, o);
3130
3101
  }
3131
3102
  updateVisibility() {
3132
3103
  const { scale: e } = this.canvas.viewport.getViewportMatrix(), t = e > this.maxViewportScale;
@@ -3140,7 +3111,7 @@ class ae {
3140
3111
  }
3141
3112
  }
3142
3113
  }
3143
- class he {
3114
+ class de {
3144
3115
  constructor(e, t, o, s, n, a) {
3145
3116
  i(this, "overlayCanvas");
3146
3117
  i(this, "staticPortId", null);
@@ -3152,34 +3123,37 @@ class he {
3152
3123
  this.overlayLayer,
3153
3124
  this.viewportStore,
3154
3125
  this.window
3155
- ), G.configure(
3126
+ );
3127
+ const h = {
3128
+ mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3129
+ mouseUpEventVerifier: this.params.mouseUpEventVerifier,
3130
+ portDragAllowedVerifier: (d, c) => {
3131
+ const u = this.params.connectionTypeResolver(d);
3132
+ return u === null ? !1 : (this.grabPort(d, c, u), !0);
3133
+ },
3134
+ onPointerMove: (d) => {
3135
+ this.moveDraggingPort(d);
3136
+ },
3137
+ onPointerUp: (d) => {
3138
+ this.tryCreateConnection(d), this.resetDragState();
3139
+ },
3140
+ onPointerOutside: () => {
3141
+ const d = this.staticPortId, c = this.isTargetDragging;
3142
+ this.resetDragState(), this.params.onEdgeCreationInterrupted({
3143
+ staticPortId: d,
3144
+ isDirect: c
3145
+ });
3146
+ }
3147
+ };
3148
+ j.configure(
3156
3149
  this.canvas,
3157
3150
  this.window,
3158
3151
  this.pointInsideVerifier,
3159
- {
3160
- mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3161
- mouseUpEventVerifier: this.params.mouseUpEventVerifier,
3162
- onStopDrag: () => {
3163
- this.resetDragState();
3164
- },
3165
- onPortPointerDown: (h, d) => {
3166
- const c = this.params.connectionTypeResolver(h);
3167
- return c === null ? !1 : (this.grabPort(h, d, c), !0);
3168
- },
3169
- onPointerMove: (h) => {
3170
- this.moveDraggingPort(h);
3171
- },
3172
- onPointerMoveOutside: () => {
3173
- this.handleEdgeCreationInterrupted();
3174
- },
3175
- onPointerUp: (h) => {
3176
- this.tryCreateConnection(h);
3177
- }
3178
- }
3152
+ h
3179
3153
  );
3180
3154
  }
3181
3155
  static configure(e, t, o, s, n, a) {
3182
- new he(
3156
+ new de(
3183
3157
  e,
3184
3158
  t,
3185
3159
  o,
@@ -3198,20 +3172,20 @@ class he {
3198
3172
  x: t.x - d.x,
3199
3173
  y: t.y - d.y
3200
3174
  }), g = {
3201
- overlayNodeId: M.StaticNodeId,
3175
+ overlayNodeId: D.StaticNodeId,
3202
3176
  portCoords: c,
3203
3177
  portDirection: s.direction
3204
3178
  }, l = {
3205
- overlayNodeId: M.DraggingNodeId,
3179
+ overlayNodeId: D.DraggingNodeId,
3206
3180
  portCoords: u,
3207
3181
  portDirection: this.params.dragPortDirection
3208
3182
  };
3209
3183
  this.isTargetDragging = o === "direct";
3210
- const [w, p] = this.isTargetDragging ? [g, l] : [l, g];
3211
- this.overlayCanvas.addNode(H(w)), this.overlayCanvas.addNode(H(p)), this.overlayCanvas.addEdge({
3212
- from: w.overlayNodeId,
3213
- to: p.overlayNodeId,
3214
- shape: this.params.edgeShapeFactory(M.EdgeId)
3184
+ const [p, w] = this.isTargetDragging ? [g, l] : [l, g];
3185
+ this.overlayCanvas.addNode(Y(p)), this.overlayCanvas.addNode(Y(w)), this.overlayCanvas.addEdge({
3186
+ from: p.overlayNodeId,
3187
+ to: w.overlayNodeId,
3188
+ shape: this.params.edgeShapeFactory(D.EdgeId)
3215
3189
  });
3216
3190
  }
3217
3191
  resetDragState() {
@@ -3220,31 +3194,27 @@ class he {
3220
3194
  tryCreateConnection(e) {
3221
3195
  const t = Re(this.canvas.graph, e);
3222
3196
  if (t === null) {
3223
- this.handleEdgeCreationInterrupted();
3197
+ this.params.onEdgeCreationInterrupted({
3198
+ staticPortId: this.staticPortId,
3199
+ isDirect: this.isTargetDragging
3200
+ });
3224
3201
  return;
3225
3202
  }
3226
- const o = this.staticPortId, s = this.isTargetDragging ? o : t, n = this.isTargetDragging ? t : o, a = { from: s, to: n }, h = this.params.connectionPreprocessor(a);
3227
- h !== null ? (this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeCreated), this.canvas.addEdge(h), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeCreated)) : this.params.onEdgeCreationPrevented(a);
3203
+ const o = this.staticPortId, s = this.isTargetDragging ? o : t, n = this.isTargetDragging ? t : o, a = { from: s, to: n }, h = this.params.connectionAllowedVerifier(a), d = this.params.connectionPreprocessor(a);
3204
+ h && d !== null ? (this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeCreated), this.canvas.addEdge(d), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeCreated)) : this.params.onEdgeCreationPrevented(a);
3228
3205
  }
3229
3206
  moveDraggingPort(e) {
3230
3207
  const t = this.overlayLayer.getBoundingClientRect(), o = this.canvas.viewport.createContentCoords({
3231
3208
  x: e.x - t.x,
3232
3209
  y: e.y - t.y
3233
3210
  });
3234
- this.overlayCanvas.updateNode(M.DraggingNodeId, {
3211
+ this.overlayCanvas.updateNode(D.DraggingNodeId, {
3235
3212
  x: o.x,
3236
3213
  y: o.y
3237
3214
  });
3238
3215
  }
3239
- handleEdgeCreationInterrupted() {
3240
- const e = this.staticPortId;
3241
- this.params.onEdgeCreationInterrupted({
3242
- staticPortId: e,
3243
- isDirect: this.isTargetDragging
3244
- });
3245
- }
3246
3216
  }
3247
- class de {
3217
+ class ce {
3248
3218
  constructor(e, t, o, s, n, a) {
3249
3219
  i(this, "overlayCanvas");
3250
3220
  i(this, "staticPortId", null);
@@ -3257,40 +3227,37 @@ class de {
3257
3227
  this.overlayLayer,
3258
3228
  this.viewportStore,
3259
3229
  this.window
3260
- ), G.configure(
3230
+ );
3231
+ const h = {
3232
+ mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3233
+ mouseUpEventVerifier: this.params.mouseUpEventVerifier,
3234
+ portDragAllowedVerifier: (d, c) => this.tryStartEdgeDragging(d, c),
3235
+ onPointerMove: (d) => {
3236
+ this.moveDraggingPort(d);
3237
+ },
3238
+ onPointerUp: (d) => {
3239
+ this.tryCreateConnection(d), this.resetDragState();
3240
+ },
3241
+ onPointerOutside: () => {
3242
+ const d = this.draggingEdgePayload;
3243
+ this.resetDragState(), this.params.onEdgeReattachInterrupted({
3244
+ id: d.id,
3245
+ from: d.from,
3246
+ to: d.to,
3247
+ shape: d.shape,
3248
+ priority: d.priority
3249
+ });
3250
+ }
3251
+ };
3252
+ j.configure(
3261
3253
  this.canvas,
3262
3254
  this.window,
3263
3255
  this.pointInsideVerifier,
3264
- {
3265
- mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3266
- mouseUpEventVerifier: this.params.mouseUpEventVerifier,
3267
- onStopDrag: () => {
3268
- this.resetDragState();
3269
- },
3270
- onPortPointerDown: (h, d) => this.tryStartEdgeDragging(h, d),
3271
- onPointerMove: (h) => {
3272
- this.moveDraggingPort(h);
3273
- },
3274
- onPointerMoveOutside: () => {
3275
- const h = this.draggingEdgePayload;
3276
- queueMicrotask(() => {
3277
- this.params.onEdgeReattachInterrupted({
3278
- id: h.id,
3279
- from: h.from,
3280
- to: h.to,
3281
- shape: h.shape,
3282
- priority: h.priority
3283
- });
3284
- });
3285
- },
3286
- onPointerUp: (h) => {
3287
- this.tryCreateConnection(h);
3288
- }
3289
- }
3256
+ h
3290
3257
  );
3291
3258
  }
3292
3259
  static configure(e, t, o, s, n, a) {
3293
- new de(
3260
+ new ce(
3294
3261
  e,
3295
3262
  t,
3296
3263
  o,
@@ -3301,17 +3268,17 @@ class de {
3301
3268
  }
3302
3269
  tryStartEdgeDragging(e, t) {
3303
3270
  const o = this.params.draggingEdgeResolver(e);
3304
- if (o === null || !this.canvas.graph.hasEdge(o))
3271
+ if (o === null)
3305
3272
  return !1;
3306
3273
  const s = this.canvas.graph.getEdge(o), n = e === s.from, a = e === s.to, h = n ? s.to : s.from;
3307
3274
  this.staticPortId = h, this.isTargetDragging = a;
3308
3275
  const d = this.canvas.graph.getPort(e), c = this.canvas.graph.getPort(h), u = c.element.getBoundingClientRect(), g = {
3309
3276
  x: u.x + u.width / 2,
3310
3277
  y: u.y + u.height / 2
3311
- }, l = this.overlayLayer.getBoundingClientRect(), w = this.canvas.viewport.createContentCoords({
3278
+ }, l = this.overlayLayer.getBoundingClientRect(), p = this.canvas.viewport.createContentCoords({
3312
3279
  x: g.x - l.x,
3313
3280
  y: g.y - l.y
3314
- }), p = this.canvas.viewport.createContentCoords({
3281
+ }), w = this.canvas.viewport.createContentCoords({
3315
3282
  x: t.x - l.x,
3316
3283
  y: t.y - l.y
3317
3284
  });
@@ -3323,21 +3290,21 @@ class de {
3323
3290
  priority: s.priority
3324
3291
  }, this.canvas.removeEdge(o);
3325
3292
  const y = {
3326
- overlayNodeId: M.StaticNodeId,
3327
- portCoords: w,
3293
+ overlayNodeId: D.StaticNodeId,
3294
+ portCoords: p,
3328
3295
  portDirection: c.direction
3329
3296
  }, f = {
3330
- overlayNodeId: M.DraggingNodeId,
3331
- portCoords: p,
3297
+ overlayNodeId: D.DraggingNodeId,
3298
+ portCoords: w,
3332
3299
  portDirection: d.direction
3333
3300
  }, [x, E] = this.isTargetDragging ? [y, f] : [f, y];
3334
- this.overlayCanvas.addNode(H(x)), this.overlayCanvas.addNode(H(E));
3335
- const N = this.params.draggingEdgeShapeFactory !== null ? this.params.draggingEdgeShapeFactory(M.EdgeId) : s.shape;
3301
+ this.overlayCanvas.addNode(Y(x)), this.overlayCanvas.addNode(Y(E));
3302
+ const T = this.params.draggingEdgeShapeFactory !== null ? this.params.draggingEdgeShapeFactory(D.EdgeId) : s.shape;
3336
3303
  return this.overlayCanvas.addEdge({
3337
- id: M.EdgeId,
3304
+ id: D.EdgeId,
3338
3305
  from: x.overlayNodeId,
3339
3306
  to: E.overlayNodeId,
3340
- shape: N
3307
+ shape: T
3341
3308
  }), !0;
3342
3309
  }
3343
3310
  resetDragState() {
@@ -3348,14 +3315,14 @@ class de {
3348
3315
  x: e.x - t.x,
3349
3316
  y: e.y - t.y
3350
3317
  }, s = this.canvas.viewport.createContentCoords(o);
3351
- this.overlayCanvas.updateNode(M.DraggingNodeId, {
3318
+ this.overlayCanvas.updateNode(D.DraggingNodeId, {
3352
3319
  x: s.x,
3353
3320
  y: s.y
3354
3321
  });
3355
3322
  }
3356
3323
  tryCreateConnection(e) {
3357
3324
  const t = Re(this.canvas.graph, e);
3358
- if (this.overlayCanvas.removeEdge(M.EdgeId), t === null) {
3325
+ if (this.overlayCanvas.removeEdge(D.EdgeId), t === null) {
3359
3326
  this.handleEdgeReattachInterrupted();
3360
3327
  return;
3361
3328
  }
@@ -3365,17 +3332,20 @@ class de {
3365
3332
  to: s,
3366
3333
  shape: n.shape,
3367
3334
  priority: n.priority
3368
- }, h = this.params.connectionPreprocessor(a);
3369
- if (h !== null)
3370
- this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeReattached), this.canvas.addEdge(h), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeReattached);
3335
+ }, h = this.params.connectionAllowedVerifier({
3336
+ from: o,
3337
+ to: s
3338
+ }), d = this.params.connectionPreprocessor(a);
3339
+ if (h && d !== null)
3340
+ this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeReattached), this.canvas.addEdge(d), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeReattached);
3371
3341
  else {
3372
- const d = this.draggingEdgePayload;
3342
+ const c = this.draggingEdgePayload;
3373
3343
  this.params.onEdgeReattachPrevented({
3374
- id: d.id,
3375
- from: d.from,
3376
- to: d.to,
3377
- shape: d.shape,
3378
- priority: d.priority
3344
+ id: c.id,
3345
+ from: c.from,
3346
+ to: c.to,
3347
+ shape: c.shape,
3348
+ priority: c.priority
3379
3349
  });
3380
3350
  }
3381
3351
  }
@@ -3390,17 +3360,17 @@ class de {
3390
3360
  });
3391
3361
  }
3392
3362
  }
3393
- class ce {
3363
+ class le {
3394
3364
  constructor(e, t) {
3395
3365
  this.applier = e, this.trigger = t, this.trigger.subscribe(() => {
3396
3366
  this.applier.apply();
3397
3367
  });
3398
3368
  }
3399
3369
  static configure(e, t) {
3400
- new ce(e, t);
3370
+ new le(e, t);
3401
3371
  }
3402
3372
  }
3403
- class le {
3373
+ class ue {
3404
3374
  constructor(e, t, o) {
3405
3375
  i(this, "applyScheduled", !1);
3406
3376
  i(this, "apply", () => {
@@ -3417,7 +3387,7 @@ class le {
3417
3387
  });
3418
3388
  }
3419
3389
  static configure(e, t, o) {
3420
- new le(
3390
+ new ue(
3421
3391
  e,
3422
3392
  t,
3423
3393
  o
@@ -3427,23 +3397,37 @@ class le {
3427
3397
  this.applyScheduled || (this.applyScheduled = !0, this.defererFn(this.apply));
3428
3398
  }
3429
3399
  }
3430
- class jt {
3400
+ class Xt {
3401
+ constructor(e, t, o) {
3402
+ this.canvas = e, this.layoutAlgorithm = t, this.params = o;
3403
+ }
3404
+ apply() {
3405
+ const e = this.layoutAlgorithm.calculateCoordinates({
3406
+ graph: this.canvas.graph,
3407
+ viewport: this.canvas.viewport
3408
+ });
3409
+ this.params.onBeforeApplied(), e.forEach((t, o) => {
3410
+ this.params.staticNodeResolver(o) || this.canvas.updateNode(o, t);
3411
+ }), this.params.onAfterApplied();
3412
+ }
3413
+ }
3414
+ class Gt {
3431
3415
  static configure(e, t) {
3432
- const o = t.applyOn, s = new zt(e, t.algorithm, {
3416
+ const o = t.applyOn, s = new Xt(e, t.algorithm, {
3433
3417
  staticNodeResolver: t.staticNodeResolver,
3434
3418
  onBeforeApplied: t.onBeforeApplied,
3435
3419
  onAfterApplied: t.onAfterApplied
3436
3420
  });
3437
3421
  switch (o.type) {
3438
3422
  case "trigger": {
3439
- ce.configure(
3423
+ le.configure(
3440
3424
  s,
3441
3425
  o.trigger
3442
3426
  );
3443
3427
  break;
3444
3428
  }
3445
3429
  case "topologyChangeSchedule": {
3446
- le.configure(
3430
+ ue.configure(
3447
3431
  e.graph,
3448
3432
  s,
3449
3433
  o.schedule
@@ -3453,7 +3437,7 @@ class jt {
3453
3437
  }
3454
3438
  }
3455
3439
  }
3456
- class Jt {
3440
+ class jt {
3457
3441
  constructor(e, t) {
3458
3442
  i(this, "previousTimeStamp");
3459
3443
  i(this, "step", (e) => {
@@ -3468,27 +3452,42 @@ class Jt {
3468
3452
  this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
3469
3453
  }
3470
3454
  }
3471
- class ue {
3455
+ class Jt {
3456
+ constructor(e, t, o) {
3457
+ this.canvas = e, this.layoutAlgorithm = t, this.params = o;
3458
+ }
3459
+ apply(e) {
3460
+ const t = this.layoutAlgorithm.calculateNextCoordinates({
3461
+ graph: this.canvas.graph,
3462
+ viewport: this.canvas.viewport,
3463
+ dt: e
3464
+ });
3465
+ this.params.onBeforeApplied(), t.forEach((o, s) => {
3466
+ this.params.staticNodeResolver(s) || this.canvas.updateNode(s, o);
3467
+ }), this.params.onAfterApplied();
3468
+ }
3469
+ }
3470
+ class ge {
3472
3471
  constructor(e, t, o) {
3473
3472
  i(this, "applier");
3474
3473
  i(this, "step", (e) => {
3475
3474
  this.applier.apply(e);
3476
3475
  });
3477
- this.win = o, this.applier = new kt(e, t.algorithm, {
3476
+ this.win = o, this.applier = new Jt(e, t.algorithm, {
3478
3477
  staticNodeResolver: t.staticNodeResolver,
3479
3478
  onBeforeApplied: t.onBeforeApplied,
3480
3479
  onAfterApplied: t.onAfterApplied
3481
- }), new Jt(this.win, this.step);
3480
+ }), new jt(this.win, this.step);
3482
3481
  }
3483
3482
  static configure(e, t, o) {
3484
- new ue(e, t, o);
3483
+ new ge(e, t, o);
3485
3484
  }
3486
3485
  }
3487
- class ge {
3486
+ class pe {
3488
3487
  constructor(e, t, o, s, n) {
3489
3488
  i(this, "configurator");
3490
3489
  i(this, "onNodeSelected");
3491
- i(this, "selectionHandledTag", oe);
3490
+ i(this, "selectionHandledTag", se);
3492
3491
  i(this, "onAfterNodeAdded", (e) => {
3493
3492
  const { element: t } = this.canvas.graph.getNode(e);
3494
3493
  this.configurator.enable(t);
@@ -3503,7 +3502,7 @@ class ge {
3503
3502
  this.configurator.disable(t);
3504
3503
  });
3505
3504
  });
3506
- this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.eventTagger = s, this.onNodeSelected = n.onNodeSelected, this.configurator = new se(
3505
+ this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.eventTagger = s, this.onNodeSelected = n.onNodeSelected, this.configurator = new ie(
3507
3506
  this.window,
3508
3507
  this.pointInsideVerifier,
3509
3508
  {
@@ -3518,7 +3517,7 @@ class ge {
3518
3517
  ), this.canvas.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.canvas.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.reset);
3519
3518
  }
3520
3519
  static configure(e, t, o, s, n) {
3521
- new ge(
3520
+ new pe(
3522
3521
  e,
3523
3522
  t,
3524
3523
  o,
@@ -3527,10 +3526,10 @@ class ge {
3527
3526
  );
3528
3527
  }
3529
3528
  }
3530
- class pe {
3529
+ class we {
3531
3530
  constructor(e, t, o, s, n) {
3532
3531
  i(this, "configurator");
3533
- i(this, "selectionHandledTag", oe);
3532
+ i(this, "selectionHandledTag", se);
3534
3533
  i(this, "onEdgeSelected");
3535
3534
  i(this, "onAfterEdgeAdded", (e) => {
3536
3535
  const { shape: t } = this.canvas.graph.getEdge(e);
@@ -3546,7 +3545,7 @@ class pe {
3546
3545
  this.configurator.disable(t.svg);
3547
3546
  });
3548
3547
  });
3549
- this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.eventTagger = s, this.onEdgeSelected = n.onEdgeSelected, this.configurator = new se(
3548
+ this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.eventTagger = s, this.onEdgeSelected = n.onEdgeSelected, this.configurator = new ie(
3550
3549
  this.window,
3551
3550
  this.pointInsideVerifier,
3552
3551
  {
@@ -3561,7 +3560,7 @@ class pe {
3561
3560
  ), this.canvas.graph.onAfterEdgeAdded.subscribe(this.onAfterEdgeAdded), this.canvas.graph.onBeforeEdgeRemoved.subscribe(this.onBeforeEdgeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.reset);
3562
3561
  }
3563
3562
  static configure(e, t, o, s, n) {
3564
- new pe(
3563
+ new we(
3565
3564
  e,
3566
3565
  t,
3567
3566
  o,
@@ -3570,15 +3569,12 @@ class pe {
3570
3569
  );
3571
3570
  }
3572
3571
  }
3573
- class we {
3572
+ class ye {
3574
3573
  constructor(e, t, o, s, n, a) {
3575
3574
  i(this, "configurator");
3576
3575
  i(this, "onCanvasSelected");
3577
- i(this, "selectionHandledTag", oe);
3578
- i(this, "restore", () => {
3579
- this.configurator.disable(this.element);
3580
- });
3581
- this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.eventTagger = n, this.onCanvasSelected = a.onCanvasSelected, this.configurator = new se(
3576
+ i(this, "selectionHandledTag", se);
3577
+ this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.eventTagger = n, this.onCanvasSelected = a.onCanvasSelected, this.configurator = new ie(
3582
3578
  this.window,
3583
3579
  this.pointInsideVerifier,
3584
3580
  {
@@ -3589,10 +3585,12 @@ class we {
3589
3585
  mouseDownEventVerifier: a.mouseDownEventVerifier,
3590
3586
  mouseUpEventVerifier: a.mouseUpEventVerifier
3591
3587
  }
3592
- ), this.configurator.enable(this.element), this.canvas.onBeforeDestroy.subscribe(this.restore);
3588
+ ), this.configurator.enable(this.element), this.canvas.onBeforeDestroy.subscribe(() => {
3589
+ this.configurator.disable(this.element);
3590
+ });
3593
3591
  }
3594
3592
  static configure(e, t, o, s, n, a) {
3595
- new we(
3593
+ new ye(
3596
3594
  e,
3597
3595
  t,
3598
3596
  o,
@@ -3625,23 +3623,39 @@ class Qt {
3625
3623
  this.host.removeChild(this.background), this.host.removeChild(this.main), this.host.removeChild(this.overlayConnectablePorts), this.host.removeChild(this.overlayDraggableEdges), this.element.removeChild(this.host);
3626
3624
  }
3627
3625
  }
3628
- const Zt = (r) => {
3629
- var w, p, y, f, x, E;
3630
- const e = ((w = r.events) == null ? void 0 : w.onNodeDragStarted) ?? (() => {
3631
- }), t = ((p = r.events) == null ? void 0 : p.onNodeDrag) ?? (() => {
3632
- }), o = r.nodeDragVerifier ?? (() => !0), s = ((y = r.events) == null ? void 0 : y.onNodeDragFinished) ?? (() => {
3633
- }), n = r.moveOnTop !== !1, a = r.moveEdgesOnTop !== !1 && n, h = (f = r.mouse) == null ? void 0 : f.dragCursor, d = h !== void 0 ? h : "grab", c = (x = r.mouse) == null ? void 0 : x.mouseDownEventVerifier, u = c !== void 0 ? c : (N) => N.button === 0, g = (E = r.mouse) == null ? void 0 : E.mouseUpEventVerifier, l = g !== void 0 ? g : (N) => N.button === 0;
3626
+ const b = Object.freeze({
3627
+ seed: "HTMLGraph is awesome",
3628
+ maxTimeDeltaSec: 0.01,
3629
+ nodeCharge: 1e5,
3630
+ nodeMass: 1,
3631
+ edgeEquilibriumLength: 300,
3632
+ edgeStiffness: 1e3,
3633
+ dtSec: 0.01,
3634
+ maxIterations: 1e3,
3635
+ convergenceVelocity: 10,
3636
+ maxForce: 1e7,
3637
+ nodeForceCoefficient: 1,
3638
+ barnesHutAreaRadiusThreshold: 0.01,
3639
+ barnesHutTheta: 1
3640
+ }), L = Object.freeze({
3641
+ mouseDownEventVerifier: (r) => r.button === 0,
3642
+ mouseUpEventVerifier: (r) => r.button === 0,
3643
+ movementThreshold: 10
3644
+ }), N = () => {
3645
+ }, Zt = (r) => {
3646
+ var u, g, l, p, w, y;
3647
+ 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 = (g = r.mouse) == null ? void 0 : g.mouseDownEventVerifier, h = a !== void 0 ? a : (f) => f.button === 0, d = (l = r.mouse) == null ? void 0 : l.mouseUpEventVerifier, c = d !== void 0 ? d : (f) => f.button === 0;
3634
3648
  return {
3635
- moveOnTop: n,
3636
- moveEdgesOnTop: a,
3637
- dragCursor: d,
3649
+ moveOnTop: t,
3650
+ moveEdgesOnTop: o,
3651
+ dragCursor: n,
3638
3652
  gridSize: r.gridSize ?? null,
3639
- mouseDownEventVerifier: u,
3640
- mouseUpEventVerifier: l,
3641
- onNodeDragStarted: e,
3642
- onNodeDrag: t,
3643
- nodeDragVerifier: o,
3644
- onNodeDragFinished: s
3653
+ mouseDownEventVerifier: h,
3654
+ mouseUpEventVerifier: c,
3655
+ onNodeDragStarted: ((p = r.events) == null ? void 0 : p.onNodeDragStarted) ?? N,
3656
+ onNodeDrag: ((w = r.events) == null ? void 0 : w.onNodeDrag) ?? N,
3657
+ nodeDragVerifier: e,
3658
+ onNodeDragFinished: ((y = r.events) == null ? void 0 : y.onNodeDragFinished) ?? N
3645
3659
  };
3646
3660
  }, _t = (r) => {
3647
3661
  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;
@@ -3700,35 +3714,29 @@ const Zt = (r) => {
3700
3714
  });
3701
3715
  }
3702
3716
  }, Ne = (r) => {
3703
- var p, y, f, x, E, N, C, T, I, F, U, fe;
3704
- const e = (p = r == null ? void 0 : r.scale) == null ? void 0 : p.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, o = r == null ? void 0 : r.transformPreprocessor;
3717
+ var l, p, w, y, f, x, E, T, C, M, F, U;
3718
+ const e = (l = r == null ? void 0 : r.scale) == null ? void 0 : l.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, o = r == null ? void 0 : r.transformPreprocessor;
3705
3719
  let s;
3706
3720
  o !== void 0 ? Array.isArray(o) ? s = er(
3707
3721
  o.map(
3708
3722
  (R) => be(R)
3709
3723
  )
3710
3724
  ) : s = be(o) : s = (R) => R.nextTransform;
3711
- const n = ((y = r == null ? void 0 : r.shift) == null ? void 0 : y.cursor) !== void 0 ? r.shift.cursor : "grab", a = ((f = r == null ? void 0 : r.events) == null ? void 0 : f.onBeforeTransformChange) ?? (() => {
3712
- }), h = ((x = r == null ? void 0 : r.events) == null ? void 0 : x.onTransformChange) ?? (() => {
3713
- }), d = (E = r == null ? void 0 : r.shift) == null ? void 0 : E.mouseDownEventVerifier, c = d !== void 0 ? d : (R) => R.button === 0, u = (N = r == null ? void 0 : r.shift) == null ? void 0 : N.mouseUpEventVerifier, g = u !== void 0 ? u : (R) => R.button === 0, l = (C = r == null ? void 0 : r.scale) == null ? void 0 : C.mouseWheelEventVerifier, w = l !== void 0 ? l : () => !0;
3725
+ const n = ((p = r == null ? void 0 : r.shift) == null ? void 0 : p.cursor) !== void 0 ? r.shift.cursor : "grab", a = (w = r == null ? void 0 : r.shift) == null ? void 0 : w.mouseDownEventVerifier, h = a !== void 0 ? a : (R) => R.button === 0, d = (y = r == null ? void 0 : r.shift) == null ? void 0 : y.mouseUpEventVerifier, c = d !== void 0 ? d : (R) => R.button === 0, u = (f = r == null ? void 0 : r.scale) == null ? void 0 : f.mouseWheelEventVerifier, g = u !== void 0 ? u : () => !0;
3714
3726
  return {
3715
3727
  wheelSensitivity: t,
3716
- onTransformStarted: ((T = r == null ? void 0 : r.events) == null ? void 0 : T.onTransformStarted) ?? (() => {
3717
- }),
3718
- onTransformFinished: ((I = r == null ? void 0 : r.events) == null ? void 0 : I.onTransformFinished) ?? (() => {
3719
- }),
3720
- onBeforeTransformChange: a,
3721
- onTransformChange: h,
3728
+ onTransformStarted: ((x = r == null ? void 0 : r.events) == null ? void 0 : x.onTransformStarted) ?? N,
3729
+ onTransformFinished: ((E = r == null ? void 0 : r.events) == null ? void 0 : E.onTransformFinished) ?? N,
3730
+ onBeforeTransformChange: ((T = r == null ? void 0 : r.events) == null ? void 0 : T.onBeforeTransformChange) ?? N,
3731
+ onTransformChange: ((C = r == null ? void 0 : r.events) == null ? void 0 : C.onTransformChange) ?? N,
3722
3732
  transformPreprocessor: s,
3723
3733
  shiftCursor: n,
3724
- mouseDownEventVerifier: c,
3725
- mouseUpEventVerifier: g,
3726
- mouseWheelEventVerifier: w,
3727
- scaleWheelFinishTimeout: ((F = r == null ? void 0 : r.scale) == null ? void 0 : F.wheelFinishTimeout) ?? 500,
3728
- onResizeTransformStarted: ((U = r == null ? void 0 : r.events) == null ? void 0 : U.onResizeTransformStarted) ?? (() => {
3729
- }),
3730
- onResizeTransformFinished: ((fe = r == null ? void 0 : r.events) == null ? void 0 : fe.onResizeTransformFinished) ?? (() => {
3731
- })
3734
+ mouseDownEventVerifier: h,
3735
+ mouseUpEventVerifier: c,
3736
+ mouseWheelEventVerifier: g,
3737
+ scaleWheelFinishTimeout: ((M = r == null ? void 0 : r.scale) == null ? void 0 : M.wheelFinishTimeout) ?? 500,
3738
+ onResizeTransformStarted: ((F = r == null ? void 0 : r.events) == null ? void 0 : F.onResizeTransformStarted) ?? N,
3739
+ onResizeTransformFinished: ((U = r == null ? void 0 : r.events) == null ? void 0 : U.onResizeTransformFinished) ?? N
3732
3740
  };
3733
3741
  }, tr = (r, e) => {
3734
3742
  const t = document.createElementNS(
@@ -3747,7 +3755,7 @@ const Zt = (r) => {
3747
3755
  renderer: s,
3748
3756
  maxViewportScale: r.maxViewportScale ?? 10
3749
3757
  };
3750
- }, ye = (r) => {
3758
+ }, fe = (r) => {
3751
3759
  if (typeof r == "function")
3752
3760
  return r;
3753
3761
  switch (r.type) {
@@ -3817,41 +3825,46 @@ const Zt = (r) => {
3817
3825
  detourDirection: r.detourDirection
3818
3826
  });
3819
3827
  }
3820
- }, sr = (r, e, t) => {
3821
- var c, u, g;
3822
- const o = () => "direct", s = (l) => l, n = (l) => l.button === 0, a = () => {
3823
- }, h = () => {
3824
- }, d = () => {
3825
- };
3828
+ }, $ = Object.freeze({
3829
+ connectionTypeResolver: () => "direct",
3830
+ connectionPreprocessor: (r) => r,
3831
+ connectionAllowedVerifier: () => !0,
3832
+ mouseEventVerifier: (r) => r.button === 0
3833
+ }), sr = (r, e, t) => {
3834
+ var o, s, n;
3826
3835
  return {
3827
- connectionTypeResolver: r.connectionTypeResolver ?? o,
3828
- connectionPreprocessor: r.connectionPreprocessor ?? s,
3829
- mouseDownEventVerifier: r.mouseDownEventVerifier ?? n,
3830
- mouseUpEventVerifier: r.mouseUpEventVerifier ?? n,
3831
- onAfterEdgeCreated: ((c = r.events) == null ? void 0 : c.onAfterEdgeCreated) ?? a,
3832
- onEdgeCreationInterrupted: ((u = r.events) == null ? void 0 : u.onEdgeCreationInterrupted) ?? d,
3833
- onEdgeCreationPrevented: ((g = r.events) == null ? void 0 : g.onEdgeCreationPrevented) ?? h,
3836
+ connectionTypeResolver: r.connectionTypeResolver ?? $.connectionTypeResolver,
3837
+ connectionPreprocessor: r.connectionPreprocessor ?? $.connectionPreprocessor,
3838
+ connectionAllowedVerifier: r.connectionAllowedVerifier ?? $.connectionAllowedVerifier,
3839
+ mouseDownEventVerifier: r.mouseDownEventVerifier ?? $.mouseEventVerifier,
3840
+ mouseUpEventVerifier: r.mouseUpEventVerifier ?? $.mouseEventVerifier,
3841
+ onAfterEdgeCreated: ((o = r.events) == null ? void 0 : o.onAfterEdgeCreated) ?? N,
3842
+ onEdgeCreationInterrupted: ((s = r.events) == null ? void 0 : s.onEdgeCreationInterrupted) ?? N,
3843
+ onEdgeCreationPrevented: ((n = r.events) == null ? void 0 : n.onEdgeCreationPrevented) ?? N,
3834
3844
  dragPortDirection: r.dragPortDirection ?? t,
3835
- edgeShapeFactory: r.edgeShape !== void 0 ? ye(r.edgeShape) : e
3845
+ edgeShapeFactory: r.edgeShape !== void 0 ? fe(r.edgeShape) : e
3836
3846
  };
3837
- }, ir = (r, e) => {
3838
- var c, u, g;
3839
- const t = (l) => l, o = (l) => l.button === 0 && l.ctrlKey, s = (l) => l.button === 0, n = (l) => {
3840
- const w = e.getPortAdjacentEdgeIds(l);
3841
- return w.length > 0 ? w[w.length - 1] : null;
3842
- }, a = () => {
3843
- }, h = () => {
3844
- }, d = () => {
3847
+ }, z = Object.freeze({
3848
+ connectionAllowedVerifier: () => !0,
3849
+ connectionPreprocessor: (r) => r,
3850
+ mouseDownEventVerifier: (r) => r.button === 0 && r.ctrlKey,
3851
+ mouseUpEventVerifier: (r) => r.button === 0
3852
+ }), ir = (r, e) => {
3853
+ var o, s, n;
3854
+ const t = (a) => {
3855
+ const h = e.getPortAdjacentEdgeIds(a);
3856
+ return h.length > 0 ? h[h.length - 1] : null;
3845
3857
  };
3846
3858
  return {
3847
- connectionPreprocessor: r.connectionPreprocessor ?? t,
3848
- mouseDownEventVerifier: r.mouseDownEventVerifier ?? o,
3849
- mouseUpEventVerifier: r.mouseUpEventVerifier ?? s,
3850
- draggingEdgeResolver: r.draggingEdgeResolver ?? n,
3851
- draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? ye(r.draggingEdgeShape) : null,
3852
- onAfterEdgeReattached: ((c = r.events) == null ? void 0 : c.onAfterEdgeReattached) ?? a,
3853
- onEdgeReattachInterrupted: ((u = r.events) == null ? void 0 : u.onEdgeReattachInterrupted) ?? d,
3854
- onEdgeReattachPrevented: ((g = r.events) == null ? void 0 : g.onEdgeReattachPrevented) ?? h
3859
+ connectionPreprocessor: r.connectionPreprocessor ?? z.connectionPreprocessor,
3860
+ connectionAllowedVerifier: r.connectionAllowedVerifier ?? z.connectionAllowedVerifier,
3861
+ mouseDownEventVerifier: r.mouseDownEventVerifier ?? z.mouseDownEventVerifier,
3862
+ mouseUpEventVerifier: r.mouseUpEventVerifier ?? z.mouseUpEventVerifier,
3863
+ draggingEdgeResolver: r.draggingEdgeResolver ?? t,
3864
+ draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? fe(r.draggingEdgeShape) : null,
3865
+ onAfterEdgeReattached: ((o = r.events) == null ? void 0 : o.onAfterEdgeReattached) ?? N,
3866
+ onEdgeReattachInterrupted: ((s = r.events) == null ? void 0 : s.onEdgeReattachInterrupted) ?? N,
3867
+ onEdgeReattachPrevented: ((n = r.events) == null ? void 0 : n.onEdgeReattachPrevented) ?? N
3855
3868
  };
3856
3869
  }, nr = (r) => ({
3857
3870
  nodeVerticalRadius: r.nodeContainingRadius.vertical,
@@ -3859,10 +3872,8 @@ const Zt = (r) => {
3859
3872
  }), ar = (r) => {
3860
3873
  var e, t;
3861
3874
  return {
3862
- onAfterNodeDetached: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onAfterNodeDetached) ?? (() => {
3863
- }),
3864
- onBeforeNodeAttached: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeNodeAttached) ?? (() => {
3865
- })
3875
+ onAfterNodeDetached: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onAfterNodeDetached) ?? N,
3876
+ onBeforeNodeAttached: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeNodeAttached) ?? N
3866
3877
  };
3867
3878
  };
3868
3879
  class hr extends Error {
@@ -3904,8 +3915,8 @@ class Ge {
3904
3915
  const o = this.graph.getEdge(t), s = this.graph.getPort(o.from), n = this.graph.getPort(o.to), a = this.currentCoords.get(s.nodeId), h = this.currentCoords.get(n.nodeId), d = this.distanceVectorGenerator.create(
3905
3916
  a,
3906
3917
  h
3907
- ), u = (d.d - this.edgeEquilibriumLength) * this.edgeStiffness, g = d.ex * u, l = d.ey * u, w = e.get(s.nodeId), p = e.get(n.nodeId);
3908
- w.x += g, w.y += l, p.x -= g, p.y -= l;
3918
+ ), u = (d.d - this.edgeEquilibriumLength) * this.edgeStiffness, g = d.ex * u, l = d.ey * u, p = e.get(s.nodeId), w = e.get(n.nodeId);
3919
+ p.x += g, p.y += l, w.x -= g, w.y -= l;
3909
3920
  });
3910
3921
  }
3911
3922
  }
@@ -3955,8 +3966,8 @@ class dr {
3955
3966
  targetCharge: this.nodeCharge,
3956
3967
  distance: g.d,
3957
3968
  maxForce: this.maxForce
3958
- }), w = l * g.ex, p = l * g.ey, y = t.get(a), f = t.get(d);
3959
- y.x -= w, y.y -= p, f.x += w, f.y += p;
3969
+ }), p = l * g.ex, w = l * g.ey, y = t.get(a), f = t.get(d);
3970
+ y.x -= p, y.y -= w, f.x += p, f.y += w;
3960
3971
  }
3961
3972
  }
3962
3973
  }
@@ -4034,8 +4045,8 @@ class lr {
4034
4045
  this.sortedParentNodes.push(e);
4035
4046
  const n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), c = s / 2;
4036
4047
  e.nodeIds.forEach((l) => {
4037
- const { x: w, y: p } = this.coords.get(l);
4038
- w < t ? p < o ? d.add(l) : h.add(l) : p < o ? a.add(l) : n.add(l), e.nodeIds.delete(l);
4048
+ const { x: p, y: w } = this.coords.get(l);
4049
+ p < t ? w < o ? d.add(l) : h.add(l) : w < o ? a.add(l) : n.add(l), e.nodeIds.delete(l);
4039
4050
  });
4040
4051
  const u = {
4041
4052
  parent: e,
@@ -4319,16 +4330,16 @@ class Qe {
4319
4330
  this.rand = e.rand, this.sparsity = e.sparsity;
4320
4331
  }
4321
4332
  calculateCoordinates(e) {
4322
- const { graph: t, viewport: o } = e, s = /* @__PURE__ */ new Map(), n = t.getAllNodeIds().filter((p) => {
4323
- const y = t.getNode(p);
4333
+ const { graph: t, viewport: o } = e, s = /* @__PURE__ */ new Map(), n = t.getAllNodeIds().filter((w) => {
4334
+ const y = t.getNode(w);
4324
4335
  return y.x === null || y.y === null;
4325
4336
  }), a = Math.sqrt(n.length) * this.sparsity, { width: h, height: d } = o.getDimensions(), c = { x: h / 2, y: d / 2 }, u = o.createContentCoords(c), g = a / 2, l = {
4326
4337
  x: u.x - g,
4327
4338
  y: u.y - g
4328
4339
  };
4329
- return t.getAllNodeIds().forEach((p) => {
4330
- const y = t.getNode(p);
4331
- s.set(p, {
4340
+ return t.getAllNodeIds().forEach((w) => {
4341
+ const y = t.getNode(w);
4342
+ s.set(w, {
4332
4343
  x: y.x ?? l.x + a * this.rand(),
4333
4344
  y: y.y ?? l.y + a * this.rand()
4334
4345
  });
@@ -4509,9 +4520,9 @@ class fr {
4509
4520
  const u = [];
4510
4521
  n += this.params.layerWidth, c.forEach((g) => {
4511
4522
  g.children.forEach((l) => {
4512
- const w = t.get(g.nodeId).y;
4523
+ const p = t.get(g.nodeId).y;
4513
4524
  t.set(l.nodeId, {
4514
- y: w + d.get(l.nodeId),
4525
+ y: p + d.get(l.nodeId),
4515
4526
  x: n
4516
4527
  }), u.push(l);
4517
4528
  });
@@ -4598,25 +4609,7 @@ const Ze = (r) => {
4598
4609
  r |= 0, e |= 0, t |= 0, o |= 0;
4599
4610
  const s = (r + e | 0) + o | 0;
4600
4611
  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;
4601
- }, b = Object.freeze({
4602
- seed: "HTMLGraph is awesome",
4603
- maxTimeDeltaSec: 0.01,
4604
- nodeCharge: 1e5,
4605
- nodeMass: 1,
4606
- edgeEquilibriumLength: 300,
4607
- edgeStiffness: 1e3,
4608
- dtSec: 0.01,
4609
- maxIterations: 1e3,
4610
- convergenceVelocity: 10,
4611
- maxForce: 1e7,
4612
- nodeForceCoefficient: 1,
4613
- barnesHutAreaRadiusThreshold: 0.01,
4614
- barnesHutTheta: 1
4615
- }), D = Object.freeze({
4616
- mouseDownEventVerifier: (r) => r.button === 0,
4617
- mouseUpEventVerifier: (r) => r.button === 0,
4618
- movementThreshold: 10
4619
- }), Ar = (r) => {
4612
+ }, Ar = (r) => {
4620
4613
  var e, t;
4621
4614
  switch (r == null ? void 0 : r.type) {
4622
4615
  case "custom":
@@ -4638,21 +4631,17 @@ const Ze = (r) => {
4638
4631
  });
4639
4632
  }
4640
4633
  }
4641
- }, K = {
4642
- staticNodeResolver: () => !1,
4643
- onBeforeApplied: () => {
4644
- },
4645
- onAfterApplied: () => {
4646
- }
4647
- }, Sr = (r) => {
4634
+ }, Sr = {
4635
+ staticNodeResolver: () => !1
4636
+ }, br = (r) => {
4648
4637
  var t, o;
4649
4638
  return {
4650
4639
  algorithm: Ar((r == null ? void 0 : r.algorithm) ?? {}),
4651
- staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? K.staticNodeResolver,
4652
- onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ?? K.onBeforeApplied,
4653
- onAfterApplied: ((o = r == null ? void 0 : r.events) == null ? void 0 : o.onAfterApplied) ?? K.onAfterApplied
4640
+ staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? Sr.staticNodeResolver,
4641
+ onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ?? N,
4642
+ onAfterApplied: ((o = r == null ? void 0 : r.events) == null ? void 0 : o.onAfterApplied) ?? N
4654
4643
  };
4655
- }, br = (r) => r instanceof _ ? {
4644
+ }, Nr = (r) => r instanceof q ? {
4656
4645
  type: "trigger",
4657
4646
  trigger: r
4658
4647
  } : (r == null ? void 0 : r.type) === "topologyChangeMacrotask" ? {
@@ -4661,24 +4650,20 @@ const Ze = (r) => {
4661
4650
  } : {
4662
4651
  type: "topologyChangeSchedule",
4663
4652
  schedule: Ot
4664
- }, $ = Object.freeze({
4653
+ }, Z = Object.freeze({
4665
4654
  staticNodeResolver: () => !1,
4666
- onBeforeApplied: () => {
4667
- },
4668
- onAfterApplied: () => {
4669
- },
4670
4655
  hierarchicalLayout: {
4671
4656
  layerWidth: 300,
4672
4657
  layerSpace: 300
4673
4658
  }
4674
- }), z = (r, e) => ({
4659
+ }), k = (r, e) => ({
4675
4660
  a: r.a * e.a + r.b * e.d,
4676
4661
  b: r.a * e.b + r.b * e.e,
4677
4662
  c: r.a * e.c + r.b * e.f + r.c,
4678
4663
  d: r.d * e.a + r.e * e.d,
4679
4664
  e: r.d * e.b + r.e * e.e,
4680
4665
  f: r.d * e.c + r.e * e.f + r.f
4681
- }), Nr = (r) => {
4666
+ }), Pr = (r) => {
4682
4667
  const { a: e, b: t, c: o, d: s, e: n, f: a } = r, h = e * n - t * s;
4683
4668
  return {
4684
4669
  a: n / h,
@@ -4689,7 +4674,7 @@ const Ze = (r) => {
4689
4674
  f: (o * s - e * a) / h
4690
4675
  };
4691
4676
  };
4692
- class Pr {
4677
+ class Tr {
4693
4678
  resolve(e) {
4694
4679
  if ("shift" in e)
4695
4680
  return this.createShiftBaseMatrix(e.shift);
@@ -4723,18 +4708,18 @@ class Pr {
4723
4708
  return this.createRelativeTransform(o, s);
4724
4709
  }
4725
4710
  createMirrorRelativeMatrix(e, t) {
4726
- const o = this.createMirrorYBaseMatrix(), s = z(
4711
+ const o = this.createMirrorYBaseMatrix(), s = k(
4727
4712
  this.createShiftBaseMatrix(t),
4728
4713
  this.createRotateBaseMatrix(e)
4729
4714
  );
4730
4715
  return this.createRelativeTransform(o, s);
4731
4716
  }
4732
4717
  createRelativeTransform(e, t) {
4733
- const o = z(
4718
+ const o = k(
4734
4719
  t,
4735
4720
  e
4736
- ), s = Nr(t);
4737
- return z(o, s);
4721
+ ), s = Pr(t);
4722
+ return k(o, s);
4738
4723
  }
4739
4724
  createShiftBaseMatrix(e) {
4740
4725
  return {
@@ -4792,10 +4777,10 @@ const Cr = (r) => {
4792
4777
  e: 1,
4793
4778
  f: 0
4794
4779
  };
4795
- const o = new Pr();
4780
+ const o = new Tr();
4796
4781
  return e.forEach((s) => {
4797
4782
  const n = o.resolve(s);
4798
- t = z(t, n);
4783
+ t = k(t, n);
4799
4784
  }), (s) => {
4800
4785
  const { x: n, y: a } = s;
4801
4786
  return {
@@ -4803,7 +4788,7 @@ const Cr = (r) => {
4803
4788
  y: t.d * n + t.e * a + t.f
4804
4789
  };
4805
4790
  };
4806
- }, Tr = (r) => {
4791
+ }, Mr = (r) => {
4807
4792
  if (typeof r == "function")
4808
4793
  return r;
4809
4794
  switch (r) {
@@ -4814,17 +4799,17 @@ const Cr = (r) => {
4814
4799
  default:
4815
4800
  return vr;
4816
4801
  }
4817
- }, Mr = (r) => {
4802
+ }, Dr = (r) => {
4818
4803
  var e, t;
4819
4804
  switch (r == null ? void 0 : r.type) {
4820
4805
  case "custom":
4821
4806
  return r.instance;
4822
4807
  case "hierarchical":
4823
4808
  return new fr({
4824
- layerWidth: r.layerWidth ?? $.hierarchicalLayout.layerWidth,
4825
- layerSpace: r.layerSpace ?? $.hierarchicalLayout.layerSpace,
4809
+ layerWidth: r.layerWidth ?? Z.hierarchicalLayout.layerWidth,
4810
+ layerSpace: r.layerSpace ?? Z.hierarchicalLayout.layerSpace,
4826
4811
  transform: Cr(r.transform),
4827
- nextLayerNodesResolver: Tr(
4812
+ nextLayerNodesResolver: Mr(
4828
4813
  r.nextLayerNodesResolver
4829
4814
  )
4830
4815
  });
@@ -4846,16 +4831,16 @@ const Cr = (r) => {
4846
4831
  });
4847
4832
  }
4848
4833
  }
4849
- }, Dr = (r) => {
4834
+ }, Rr = (r) => {
4850
4835
  var e, t;
4851
4836
  return {
4852
- algorithm: Mr(r.algorithm),
4853
- applyOn: br(r.applyOn),
4854
- staticNodeResolver: r.staticNodeResolver ?? $.staticNodeResolver,
4855
- onBeforeApplied: ((e = r.events) == null ? void 0 : e.onBeforeApplied) ?? $.onBeforeApplied,
4856
- onAfterApplied: ((t = r.events) == null ? void 0 : t.onAfterApplied) ?? $.onAfterApplied
4837
+ algorithm: Dr(r.algorithm),
4838
+ applyOn: Nr(r.applyOn),
4839
+ staticNodeResolver: r.staticNodeResolver ?? Z.staticNodeResolver,
4840
+ onBeforeApplied: ((e = r.events) == null ? void 0 : e.onBeforeApplied) ?? N,
4841
+ onAfterApplied: ((t = r.events) == null ? void 0 : t.onAfterApplied) ?? N
4857
4842
  };
4858
- }, Rr = (r, e) => ({
4843
+ }, Lr = (r, e) => ({
4859
4844
  ...r,
4860
4845
  onNodeDragStarted: (t) => {
4861
4846
  e.add(t), r.onNodeDragStarted(t);
@@ -4863,7 +4848,7 @@ const Cr = (r) => {
4863
4848
  onNodeDragFinished: (t) => {
4864
4849
  e.delete(t), r.onNodeDragFinished(t);
4865
4850
  }
4866
- }), Lr = (r, e) => {
4851
+ }), Vr = (r, e) => {
4867
4852
  r.graph.onBeforeNodeRemoved.subscribe((t) => {
4868
4853
  e.delete(t);
4869
4854
  }), r.graph.onBeforeClear.subscribe(() => {
@@ -4871,22 +4856,22 @@ const Cr = (r) => {
4871
4856
  }), r.onBeforeDestroy.subscribe(() => {
4872
4857
  e.clear();
4873
4858
  });
4874
- }, Vr = (r, e) => ({
4859
+ }, Ir = (r, e) => ({
4875
4860
  ...r,
4876
4861
  staticNodeResolver: (t) => r.staticNodeResolver(t) || e.has(t)
4877
- }), Z = (r) => () => r, Pe = Z(0), Ir = () => {
4862
+ }), _ = (r) => () => r, Pe = _(0), Fr = () => {
4878
4863
  let r = 0;
4879
4864
  return () => r++;
4880
- }, Fr = (r, e) => {
4865
+ }, Ur = (r, e) => {
4881
4866
  let t = Pe, o = Pe;
4882
- const s = Ir();
4883
- return r === "incremental" && (t = s), e === "incremental" && (o = s), typeof r == "number" && (t = Z(r)), typeof e == "number" && (o = Z(e)), typeof r == "function" && (t = r), typeof e == "function" && (o = e), {
4867
+ const s = Fr();
4868
+ 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), {
4884
4869
  nodesPriorityFn: t,
4885
4870
  edgesPriorityFn: o
4886
4871
  };
4887
- }, Ur = (r) => {
4872
+ }, $r = (r) => {
4888
4873
  var t, o, s, n, a;
4889
- const e = Fr(
4874
+ const e = Ur(
4890
4875
  (t = r.nodes) == null ? void 0 : t.priority,
4891
4876
  (o = r.edges) == null ? void 0 : o.priority
4892
4877
  );
@@ -4899,13 +4884,13 @@ const Cr = (r) => {
4899
4884
  direction: ((n = r.ports) == null ? void 0 : n.direction) ?? 0
4900
4885
  },
4901
4886
  edges: {
4902
- shapeFactory: ye(((a = r.edges) == null ? void 0 : a.shape) ?? {}),
4887
+ shapeFactory: fe(((a = r.edges) == null ? void 0 : a.shape) ?? {}),
4903
4888
  priorityFn: e.edgesPriorityFn
4904
4889
  }
4905
4890
  };
4906
- }, $r = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : re, Br = (r) => {
4891
+ }, Br = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : oe, Or = (r) => {
4907
4892
  var o, s, n, a;
4908
- const { canvasDefaults: e } = r, t = r.hasLayout ? $r(r.layoutParams) : re;
4893
+ const { canvasDefaults: e } = r, t = r.hasLayout ? Br(r.layoutParams) : oe;
4909
4894
  return {
4910
4895
  focus: {
4911
4896
  contentPadding: ((o = e.focus) == null ? void 0 : o.contentPadding) ?? ((s = e.focus) == null ? void 0 : s.contentOffset) ?? 100,
@@ -4914,23 +4899,23 @@ const Cr = (r) => {
4914
4899
  animationDuration: ((a = e.focus) == null ? void 0 : a.animationDuration) ?? 0
4915
4900
  }
4916
4901
  };
4917
- }, Or = (r) => ({
4902
+ }, Wr = (r) => ({
4918
4903
  onNodeSelected: r.onNodeSelected,
4919
- mouseDownEventVerifier: r.mouseDownEventVerifier ?? D.mouseDownEventVerifier,
4920
- mouseUpEventVerifier: r.mouseUpEventVerifier ?? D.mouseUpEventVerifier,
4921
- movementThreshold: r.movementThreshold ?? D.movementThreshold
4922
- }), Wr = (r) => ({
4923
- onCanvasSelected: r.onCanvasSelected,
4924
- mouseDownEventVerifier: r.mouseDownEventVerifier ?? D.mouseDownEventVerifier,
4925
- mouseUpEventVerifier: r.mouseUpEventVerifier ?? D.mouseUpEventVerifier,
4926
- movementThreshold: r.movementThreshold ?? D.movementThreshold
4904
+ mouseDownEventVerifier: r.mouseDownEventVerifier ?? L.mouseDownEventVerifier,
4905
+ mouseUpEventVerifier: r.mouseUpEventVerifier ?? L.mouseUpEventVerifier,
4906
+ movementThreshold: r.movementThreshold ?? L.movementThreshold
4927
4907
  }), zr = (r) => ({
4908
+ onCanvasSelected: r.onCanvasSelected,
4909
+ mouseDownEventVerifier: r.mouseDownEventVerifier ?? L.mouseDownEventVerifier,
4910
+ mouseUpEventVerifier: r.mouseUpEventVerifier ?? L.mouseUpEventVerifier,
4911
+ movementThreshold: r.movementThreshold ?? L.movementThreshold
4912
+ }), kr = (r) => ({
4928
4913
  onEdgeSelected: r.onEdgeSelected,
4929
- mouseDownEventVerifier: r.mouseDownEventVerifier ?? D.mouseDownEventVerifier,
4930
- mouseUpEventVerifier: r.mouseUpEventVerifier ?? D.mouseUpEventVerifier,
4931
- movementThreshold: r.movementThreshold ?? D.movementThreshold
4914
+ mouseDownEventVerifier: r.mouseDownEventVerifier ?? L.mouseDownEventVerifier,
4915
+ mouseUpEventVerifier: r.mouseUpEventVerifier ?? L.mouseUpEventVerifier,
4916
+ movementThreshold: r.movementThreshold ?? L.movementThreshold
4932
4917
  });
4933
- class Yr {
4918
+ class Xr {
4934
4919
  constructor(e) {
4935
4920
  i(this, "used", !1);
4936
4921
  i(this, "canvasDefaults", {});
@@ -4953,11 +4938,11 @@ class Yr {
4953
4938
  i(this, "hasUserDraggableEdges", !1);
4954
4939
  i(this, "hasAnimatedLayout", !1);
4955
4940
  i(this, "hasLayout", !1);
4956
- i(this, "boxRenderingTrigger", new _());
4941
+ i(this, "boxRenderingTrigger", new q());
4957
4942
  i(this, "window", window);
4958
4943
  i(this, "animationStaticNodes", /* @__PURE__ */ new Set());
4959
4944
  i(this, "pointInsideVerifier");
4960
- i(this, "eventTagger", new Ht());
4945
+ i(this, "eventTagger", new zt());
4961
4946
  this.element = e, this.pointInsideVerifier = new ut(e, this.window);
4962
4947
  }
4963
4948
  setDefaults(e) {
@@ -5009,13 +4994,13 @@ class Yr {
5009
4994
  o.main,
5010
4995
  t,
5011
4996
  e
5012
- ), n = Ur(
4997
+ ), n = $r(
5013
4998
  this.canvasDefaults
5014
4999
  ), a = new We(
5015
5000
  t,
5016
5001
  s,
5017
5002
  n
5018
- ), h = Dr(this.layoutConfig), d = Br({
5003
+ ), h = Rr(this.layoutConfig), d = Or({
5019
5004
  canvasDefaults: this.canvasDefaults,
5020
5005
  hasLayout: this.hasLayout,
5021
5006
  layoutParams: h
@@ -5024,21 +5009,21 @@ class Yr {
5024
5009
  e,
5025
5010
  d,
5026
5011
  this.window
5027
- ), u = new ze(e), g = new Oe(t), l = new Te(
5012
+ ), u = new ze(e), g = new Oe(t), l = new Ce(
5028
5013
  g,
5029
5014
  u,
5030
5015
  a,
5031
5016
  c
5032
5017
  );
5033
- if (this.hasBackground && ae.configure(
5018
+ if (this.hasBackground && he.configure(
5034
5019
  l,
5035
5020
  or(this.backgroundConfig),
5036
5021
  o.background
5037
- ), this.hasNodeResizeReactiveEdges && q.configure(l), this.userSelectableEdgesConfig !== void 0) {
5038
- const p = zr(
5022
+ ), this.hasNodeResizeReactiveEdges && ee.configure(l), this.userSelectableEdgesConfig !== void 0) {
5023
+ const p = kr(
5039
5024
  this.userSelectableEdgesConfig
5040
5025
  );
5041
- pe.configure(
5026
+ we.configure(
5042
5027
  l,
5043
5028
  this.window,
5044
5029
  this.pointInsideVerifier,
@@ -5047,10 +5032,10 @@ class Yr {
5047
5032
  );
5048
5033
  }
5049
5034
  if (this.userSelectableNodesConfig !== void 0) {
5050
- const p = Or(
5035
+ const p = Wr(
5051
5036
  this.userSelectableNodesConfig
5052
5037
  );
5053
- ge.configure(
5038
+ pe.configure(
5054
5039
  l,
5055
5040
  this.window,
5056
5041
  this.pointInsideVerifier,
@@ -5059,10 +5044,10 @@ class Yr {
5059
5044
  );
5060
5045
  }
5061
5046
  if (this.userSelectableCanvasConfig !== void 0) {
5062
- const p = Wr(
5047
+ const p = zr(
5063
5048
  this.userSelectableCanvasConfig
5064
5049
  );
5065
- we.configure(
5050
+ ye.configure(
5066
5051
  l,
5067
5052
  o.main,
5068
5053
  this.window,
@@ -5073,10 +5058,10 @@ class Yr {
5073
5058
  }
5074
5059
  if (this.hasDraggableNodes) {
5075
5060
  let p = Zt(this.dragConfig);
5076
- this.hasAnimatedLayout && (p = Rr(
5061
+ this.hasAnimatedLayout && (p = Lr(
5077
5062
  p,
5078
5063
  this.animationStaticNodes
5079
- )), ie.configure(
5064
+ )), ne.configure(
5080
5065
  l,
5081
5066
  o.main,
5082
5067
  this.window,
@@ -5090,7 +5075,7 @@ class Yr {
5090
5075
  n.edges.shapeFactory,
5091
5076
  n.ports.direction
5092
5077
  );
5093
- he.configure(
5078
+ de.configure(
5094
5079
  l,
5095
5080
  o.overlayConnectablePorts,
5096
5081
  e,
@@ -5104,7 +5089,7 @@ class Yr {
5104
5089
  this.draggableEdgesConfig,
5105
5090
  l.graph
5106
5091
  );
5107
- de.configure(
5092
+ ce.configure(
5108
5093
  l,
5109
5094
  o.overlayDraggableEdges,
5110
5095
  e,
@@ -5113,7 +5098,7 @@ class Yr {
5113
5098
  p
5114
5099
  );
5115
5100
  }
5116
- if (this.virtualScrollConfig !== void 0 ? ne.configure(
5101
+ if (this.virtualScrollConfig !== void 0 ? ae.configure(
5117
5102
  l,
5118
5103
  o.main,
5119
5104
  this.window,
@@ -5121,31 +5106,28 @@ class Yr {
5121
5106
  this.boxRenderingTrigger,
5122
5107
  this.pointInsideVerifier,
5123
5108
  nr(this.virtualScrollConfig)
5124
- ) : this.hasTransformableViewport && j.configure(
5109
+ ) : this.hasTransformableViewport && J.configure(
5125
5110
  l,
5126
5111
  o.main,
5127
5112
  this.window,
5128
5113
  this.pointInsideVerifier,
5129
5114
  Ne(this.transformConfig)
5130
- ), this.hasLayout && jt.configure(l, h), this.hasAnimatedLayout) {
5131
- let p = Sr(
5132
- this.animatedLayoutConfig
5133
- );
5134
- this.hasDraggableNodes && (Lr(
5115
+ ), this.hasLayout && Gt.configure(l, h), this.hasAnimatedLayout) {
5116
+ let p = br(this.animatedLayoutConfig);
5117
+ this.hasDraggableNodes && (Vr(
5135
5118
  l,
5136
5119
  this.animationStaticNodes
5137
- ), p = Vr(
5120
+ ), p = Ir(
5138
5121
  p,
5139
5122
  this.animationStaticNodes
5140
- )), ue.configure(l, p, this.window);
5123
+ )), ge.configure(l, p, this.window);
5141
5124
  }
5142
- const w = () => {
5143
- o.destroy(), l.onBeforeDestroy.unsubscribe(w);
5144
- };
5145
- return l.onBeforeDestroy.subscribe(w), l;
5125
+ return l.onBeforeDestroy.subscribe(() => {
5126
+ o.destroy();
5127
+ }), l;
5146
5128
  }
5147
5129
  createHtmlView(e, t, o) {
5148
- let s = new Ce(t, o, e);
5130
+ let s = new Te(t, o, e);
5149
5131
  return this.virtualScrollConfig !== void 0 && (s = new nt(
5150
5132
  s,
5151
5133
  t,
@@ -5156,16 +5138,16 @@ class Yr {
5156
5138
  }
5157
5139
  export {
5158
5140
  Rt as BezierEdgeShape,
5159
- Yr as CanvasBuilder,
5141
+ Xr as CanvasBuilder,
5160
5142
  hr as CanvasBuilderError,
5161
5143
  A as CanvasError,
5162
- V as ConnectionCategory,
5144
+ I as ConnectionCategory,
5163
5145
  $e as DirectEdgeShape,
5164
- _ as EventSubject,
5146
+ q as EventSubject,
5165
5147
  Lt as HorizontalEdgeShape,
5166
5148
  $t as InteractiveEdgeError,
5167
5149
  Be as InteractiveEdgeShape,
5168
- Hr as MidpointEdgeShape,
5150
+ Yr as MidpointEdgeShape,
5169
5151
  Vt as StraightEdgeShape,
5170
5152
  It as VerticalEdgeShape
5171
5153
  };