@html-graph/html-graph 8.22.0 → 8.23.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.
@@ -726,7 +726,7 @@ var e = /* @__PURE__ */ function(e) {
726
726
  }, x = (e, t, n) => {
727
727
  let { x: r, y: i, width: a, height: o } = e.getBoundingClientRect();
728
728
  return t >= r && t <= r + a && n >= i && n <= i + o;
729
- }, S = (e, t, n) => t >= 0 && t <= e.innerWidth && n >= 0 && n <= e.innerHeight, C = class {
729
+ }, S = (e, t, n) => t >= 0 && t <= e.innerWidth && n >= 0 && n <= e.innerHeight, ee = class {
730
730
  element;
731
731
  win;
732
732
  constructor(e, t) {
@@ -735,9 +735,9 @@ var e = /* @__PURE__ */ function(e) {
735
735
  verify(e, t) {
736
736
  return x(this.element, e, t) && S(this.win, e, t);
737
737
  }
738
- }, w = (e, t) => {
738
+ }, C = (e, t) => {
739
739
  t === null ? e.style.removeProperty("cursor") : e.style.cursor = t;
740
- }, T = (e) => {
740
+ }, w = (e) => {
741
741
  let t = document.createElement("div");
742
742
  return {
743
743
  id: e.overlayNodeId,
@@ -750,7 +750,7 @@ var e = /* @__PURE__ */ function(e) {
750
750
  direction: e.portDirection
751
751
  }]
752
752
  };
753
- }, ee = (e, t) => {
753
+ }, te = (e, t) => {
754
754
  let n = t;
755
755
  for (; n !== null;) {
756
756
  let t = e.findPortIdsByElement(n)[0] ?? null;
@@ -765,11 +765,11 @@ var e = /* @__PURE__ */ function(e) {
765
765
  };
766
766
  //#endregion
767
767
  //#region src/configurators/shared/find-port-at-point/get-elements-at-point/get-elements-at-point.ts
768
- function* te(e, t) {
768
+ function* ne(e, t) {
769
769
  let n = e.elementsFromPoint(t.x, t.y);
770
770
  for (let e of n) {
771
771
  if (e.shadowRoot !== null) {
772
- let n = te(e.shadowRoot, t);
772
+ let n = ne(e.shadowRoot, t);
773
773
  for (let e of n) yield e;
774
774
  }
775
775
  yield e;
@@ -777,23 +777,23 @@ function* te(e, t) {
777
777
  }
778
778
  //#endregion
779
779
  //#region src/configurators/shared/find-port-at-point/find-port-at-point.ts
780
- var ne = (e, t) => {
781
- let n = te(document, t);
780
+ var re = (e, t) => {
781
+ let n = ne(document, t);
782
782
  for (let t of n) {
783
- let n = ee(e, t);
783
+ let n = te(e, t);
784
784
  if (n.status === "portFound") return n.portId;
785
785
  if (n.status === "nodeEncountered") return null;
786
786
  }
787
787
  return null;
788
- }, E = /* @__PURE__ */ function(e) {
788
+ }, T = /* @__PURE__ */ function(e) {
789
789
  return e.StaticNodeId = "static", e.DraggingNodeId = "dragging", e.EdgeId = "edge", e;
790
- }({}), re = (e, t) => ({
790
+ }({}), ie = (e, t) => ({
791
791
  x: e / 2,
792
792
  y: t / 2
793
- }), D = (e, t, n) => ({
793
+ }), E = (e, t, n) => ({
794
794
  x: t.x * e.x - t.y * e.y + ((1 - t.x) * n.x + t.y * n.y),
795
795
  y: t.y * e.x + t.x * e.y + ((1 - t.x) * n.y - t.y * n.x)
796
- }), ie = (e, t, n) => {
796
+ }), ae = (e, t, n) => {
797
797
  let r = {
798
798
  x: e.x + e.width / 2,
799
799
  y: e.y + e.height / 2
@@ -815,14 +815,14 @@ var ne = (e, t) => {
815
815
  y: i.y - o
816
816
  }
817
817
  };
818
- }, O = .5 * .5 * .5, k = 3 * O, ae = class {
818
+ }, D = .5 * .5 * .5, O = 3 * D, oe = class {
819
819
  path;
820
820
  midpoint;
821
821
  constructor(e) {
822
- let { from: t, to: n, arrowLength: r, fromDir: i, toDir: a, curvature: o, hasSourceArrow: s, hasTargetArrow: c } = e, l = D({
822
+ let { from: t, to: n, arrowLength: r, fromDir: i, toDir: a, curvature: o, hasSourceArrow: s, hasTargetArrow: c } = e, l = E({
823
823
  x: t.x + r,
824
824
  y: t.y
825
- }, i, t), u = D({
825
+ }, i, t), u = E({
826
826
  x: n.x - r,
827
827
  y: n.y
828
828
  }, a, n), d = {
@@ -831,7 +831,7 @@ var ne = (e, t) => {
831
831
  }, f = {
832
832
  x: u.x - a.x * o,
833
833
  y: u.y - a.y * o
834
- }, p = O * l.x + k * d.x + k * f.x + O * u.x, m = O * l.y + k * d.y + k * f.y + O * u.y;
834
+ }, p = D * l.x + O * d.x + O * f.x + D * u.x, m = D * l.y + O * d.y + O * f.y + D * u.y;
835
835
  this.midpoint = {
836
836
  x: p,
837
837
  y: m
@@ -839,23 +839,23 @@ var ne = (e, t) => {
839
839
  let h = `M ${l.x} ${l.y} C ${d.x} ${d.y}, ${f.x} ${f.y}, ${u.x} ${u.y}`, g = s ? "" : `M ${t.x} ${t.y} L ${l.x} ${l.y} `, _ = c ? "" : ` M ${u.x} ${u.y} L ${n.x} ${n.y}`;
840
840
  this.path = `${g}${h}${_}`;
841
841
  }
842
- }, oe = class {
842
+ }, se = class {
843
843
  path;
844
844
  midpoint;
845
845
  constructor(e) {
846
- let { hasSourceArrow: t, hasTargetArrow: n, curvature: r, fromDir: i, toDir: a, detourDir: o, from: s, to: c, arrowLength: l, detourDistance: u } = e, d = t ? D({
846
+ let { hasSourceArrow: t, hasTargetArrow: n, curvature: r, fromDir: i, toDir: a, detourDir: o, from: s, to: c, arrowLength: l, detourDistance: u } = e, d = t ? E({
847
847
  x: s.x + l,
848
848
  y: s.y
849
- }, i, s) : s, f = n ? D({
849
+ }, i, s) : s, f = n ? E({
850
850
  x: c.x - l,
851
851
  y: c.y
852
- }, a, c) : c, p = Math.cos(o) * u, m = Math.sin(o) * u, h = D({
852
+ }, a, c) : c, p = Math.cos(o) * u, m = Math.sin(o) * u, h = E({
853
853
  x: s.x + l,
854
854
  y: s.y
855
855
  }, i, s), g = {
856
856
  x: h.x + p,
857
857
  y: h.y + m
858
- }, _ = D({
858
+ }, _ = E({
859
859
  x: c.x - l,
860
860
  y: c.y
861
861
  }, a, c), v = {
@@ -873,7 +873,7 @@ var ne = (e, t) => {
873
873
  }, S = {
874
874
  x: h.x + p,
875
875
  y: h.y + m
876
- }, C = {
876
+ }, ee = {
877
877
  x: _.x + p,
878
878
  y: _.y + m
879
879
  };
@@ -881,22 +881,22 @@ var ne = (e, t) => {
881
881
  `M ${d.x} ${d.y}`,
882
882
  `L ${h.x} ${h.y}`,
883
883
  `C ${b.x} ${b.y} ${S.x} ${S.y} ${y.x} ${y.y}`,
884
- `C ${C.x} ${C.y} ${x.x} ${x.y} ${_.x} ${_.y}`,
884
+ `C ${ee.x} ${ee.y} ${x.x} ${x.y} ${_.x} ${_.y}`,
885
885
  `L ${f.x} ${f.y}`
886
886
  ].join(" "), this.midpoint = y;
887
887
  }
888
- }, A = Object.freeze({ edgeColor: "--edge-color" }), se = (e) => {
888
+ }, k = Object.freeze({ edgeColor: "--edge-color" }), ce = (e) => {
889
889
  let t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
890
- return t.style.pointerEvents = "none", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.overflow = "visible", t.style.setProperty(A.edgeColor, e), t;
891
- }, ce = (e) => {
890
+ return t.style.pointerEvents = "none", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.overflow = "visible", t.style.setProperty(k.edgeColor, e), t;
891
+ }, le = (e) => {
892
892
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
893
- return t.setAttribute("stroke", `var(${A.edgeColor})`), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t;
894
- }, j = () => {
893
+ return t.setAttribute("stroke", `var(${k.edgeColor})`), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t;
894
+ }, A = () => {
895
895
  let e = document.createElementNS("http://www.w3.org/2000/svg", "path");
896
- return e.setAttribute("fill", `var(${A.edgeColor})`), e;
897
- }, le = (e, t) => {
896
+ return e.setAttribute("fill", `var(${k.edgeColor})`), e;
897
+ }, ue = (e, t) => {
898
898
  e.style.transform = `translate(${t.x}px, ${t.y}px)`, e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
899
- }, M = (e, t) => {
899
+ }, j = (e, t) => {
900
900
  let n = [];
901
901
  if (e.length > 0 && n.push(`M ${e[0].x} ${e[0].y}`), e.length === 2 && n.push(`L ${e[1].x} ${e[1].y}`), e.length > 2) {
902
902
  let r = e.length - 1, i = 0, a = 0, o = 0;
@@ -917,9 +917,9 @@ var ne = (e, t) => {
917
917
  });
918
918
  }
919
919
  return n.join(" ");
920
- }, ue = (e, t) => {
921
- let n = e.linePoint, r = t.linePoint, i = r.x - n.x >= 0, a = e.dirX >= 0;
922
- if (a === t.dirX >= 0) {
920
+ }, de = (e, t) => {
921
+ let n = e.linePoint, r = t.linePoint, i = r.x - n.x >= 0, a = e.dir.x >= 0;
922
+ if (a === t.dir.x >= 0) {
923
923
  let o = a === i, s = {
924
924
  x: (n.x + r.x) / 2,
925
925
  y: (n.y + r.y) / 2
@@ -991,50 +991,196 @@ var ne = (e, t) => {
991
991
  y: s
992
992
  }
993
993
  };
994
- }, de = class {
994
+ }, M = (e) => ({
995
+ x: e.y,
996
+ y: e.x
997
+ }), fe = (e, t) => {
998
+ let n = de({
999
+ arrowPoint: M(e.arrowPoint),
1000
+ linePoint: M(e.linePoint),
1001
+ dir: M(e.dir)
1002
+ }, {
1003
+ arrowPoint: M(t.arrowPoint),
1004
+ linePoint: M(t.linePoint),
1005
+ dir: M(t.dir)
1006
+ });
1007
+ return {
1008
+ points: n.points.map((e) => M(e)),
1009
+ midpoint: M(n.midpoint)
1010
+ };
1011
+ }, N = (e) => {
1012
+ let t = [];
1013
+ for (let n = 1; n < e.length; n++) {
1014
+ let r = e[n - 1], i = e[n], a = i.x - r.x, o = i.y - r.y, s = Math.sqrt(a * a + o * o);
1015
+ t.push({
1016
+ start: r,
1017
+ end: i,
1018
+ distance: s
1019
+ });
1020
+ }
1021
+ let n = t.reduce((e, t) => e + t.distance, 0) / 2, r = 0;
1022
+ for (let e of t) {
1023
+ let t = r + e.distance;
1024
+ if (t >= n) {
1025
+ let t = n - r, { start: i, end: a, distance: o } = e;
1026
+ if (o === 0) continue;
1027
+ let s = t / o, c = a.x - i.x, l = a.y - i.y;
1028
+ return {
1029
+ x: i.x + c * s,
1030
+ y: i.y + l * s
1031
+ };
1032
+ }
1033
+ r = t;
1034
+ }
1035
+ if (r === 0 && e.length > 0) return e[0];
1036
+ throw Error("Failed to calculate midpoint");
1037
+ }, pe = (e, t) => {
1038
+ let n = e.linePoint, r = e.arrowPoint, i = t.linePoint, a = t.arrowPoint, o = t.dir.y >= 0, s = e.dir.x >= 0, c = i.y - n.y >= 0, l = s === i.x - n.x >= 0, u = o === c;
1039
+ if (l) {
1040
+ if (u) {
1041
+ let e = {
1042
+ x: a.x,
1043
+ y: r.y
1044
+ };
1045
+ return {
1046
+ points: [
1047
+ r,
1048
+ e,
1049
+ a
1050
+ ],
1051
+ midpoint: N([
1052
+ n,
1053
+ e,
1054
+ i
1055
+ ])
1056
+ };
1057
+ }
1058
+ let e = (n.x + i.x) / 2, t = {
1059
+ x: e,
1060
+ y: n.y
1061
+ }, o = {
1062
+ x: e,
1063
+ y: i.y
1064
+ };
1065
+ return {
1066
+ points: [
1067
+ r,
1068
+ t,
1069
+ o,
1070
+ i,
1071
+ a
1072
+ ],
1073
+ midpoint: N([
1074
+ n,
1075
+ t,
1076
+ o,
1077
+ i
1078
+ ])
1079
+ };
1080
+ }
1081
+ if (u) {
1082
+ let e = (n.y + i.y) / 2, t = {
1083
+ x: n.x,
1084
+ y: e
1085
+ }, o = {
1086
+ x: i.x,
1087
+ y: e
1088
+ };
1089
+ return {
1090
+ points: [
1091
+ r,
1092
+ n,
1093
+ t,
1094
+ o,
1095
+ a
1096
+ ],
1097
+ midpoint: N([
1098
+ n,
1099
+ t,
1100
+ o,
1101
+ i
1102
+ ])
1103
+ };
1104
+ }
1105
+ let d = {
1106
+ x: n.x,
1107
+ y: i.y
1108
+ };
1109
+ return {
1110
+ points: [
1111
+ r,
1112
+ n,
1113
+ d,
1114
+ i,
1115
+ a
1116
+ ],
1117
+ midpoint: N([
1118
+ n,
1119
+ d,
1120
+ i
1121
+ ])
1122
+ };
1123
+ }, me = (e, t) => {
1124
+ let n = pe({
1125
+ arrowPoint: M(e.arrowPoint),
1126
+ linePoint: M(e.linePoint),
1127
+ dir: M(e.dir)
1128
+ }, {
1129
+ arrowPoint: M(t.arrowPoint),
1130
+ linePoint: M(t.linePoint),
1131
+ dir: M(t.dir)
1132
+ });
1133
+ return {
1134
+ points: n.points.map((e) => M(e)),
1135
+ midpoint: M(n.midpoint)
1136
+ };
1137
+ }, he = (e, t) => {
1138
+ let n = Math.abs(e.dir.y) < 1e-10, r = Math.abs(t.dir.y) < 1e-10;
1139
+ return n ? r ? de(e, t) : pe(e, t) : r ? me(e, t) : fe(e, t);
1140
+ }, ge = class {
995
1141
  path;
996
1142
  midpoint;
997
1143
  constructor(e) {
998
- let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? D({
1144
+ let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? E({
999
1145
  x: t.x + a,
1000
1146
  y: t.y
1001
- }, r, t) : t, d = l ? D({
1147
+ }, r, t) : t, d = l ? E({
1002
1148
  x: n.x - a,
1003
1149
  y: n.y
1004
- }, i, n) : n, f = a + o, p = D({
1150
+ }, i, n) : n, f = a + o, p = E({
1005
1151
  x: t.x + f,
1006
1152
  y: t.y
1007
- }, r, t), m = D({
1153
+ }, r, t), m = E({
1008
1154
  x: n.x - f,
1009
1155
  y: n.y
1010
- }, i, n), h = ue({
1156
+ }, i, n), h = de({
1011
1157
  arrowPoint: u,
1012
1158
  linePoint: p,
1013
- dirX: r.x
1159
+ dir: r
1014
1160
  }, {
1015
1161
  arrowPoint: d,
1016
1162
  linePoint: m,
1017
- dirX: i.x
1163
+ dir: i
1018
1164
  });
1019
- this.path = M(h.points, s), this.midpoint = h.midpoint;
1165
+ this.path = j(h.points, s), this.midpoint = h.midpoint;
1020
1166
  }
1021
- }, fe = class {
1167
+ }, _e = class {
1022
1168
  path;
1023
1169
  midpoint;
1024
1170
  constructor(e) {
1025
- let { hasSourceArrow: t, hasTargetArrow: n, from: r, to: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, detourDir: l, detourDistance: u, roundness: d } = e, f = t ? D({
1171
+ let { hasSourceArrow: t, hasTargetArrow: n, from: r, to: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, detourDir: l, detourDistance: u, roundness: d } = e, f = t ? E({
1026
1172
  x: r.x + a,
1027
1173
  y: r.y
1028
- }, o, r) : r, p = n ? D({
1174
+ }, o, r) : r, p = n ? E({
1029
1175
  x: i.x - a,
1030
1176
  y: i.y
1031
- }, s, i) : i, m = a + c, h = Math.cos(l) * u, g = Math.sin(l) * u, _ = D({
1177
+ }, s, i) : i, m = a + c, h = Math.cos(l) * u, g = Math.sin(l) * u, _ = E({
1032
1178
  x: r.x + m,
1033
1179
  y: r.y
1034
1180
  }, o, r), v = {
1035
1181
  x: _.x + h,
1036
1182
  y: _.y + g
1037
- }, y = D({
1183
+ }, y = E({
1038
1184
  x: i.x - m,
1039
1185
  y: i.y
1040
1186
  }, s, i), b = {
@@ -1044,7 +1190,7 @@ var ne = (e, t) => {
1044
1190
  this.midpoint = {
1045
1191
  x: (v.x + b.x) / 2,
1046
1192
  y: (v.y + b.y) / 2
1047
- }, this.path = M([
1193
+ }, this.path = j([
1048
1194
  f,
1049
1195
  _,
1050
1196
  v,
@@ -1053,18 +1199,18 @@ var ne = (e, t) => {
1053
1199
  p
1054
1200
  ], d);
1055
1201
  }
1056
- }, pe = class {
1202
+ }, ve = class {
1057
1203
  path;
1058
1204
  midpoint;
1059
1205
  constructor(e) {
1060
- let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l } = e, u = this.createArrowPoint(r, o, t, a), d = this.createArrowPoint(i, s, n, -a), f = a + c, p = D({
1206
+ let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l } = e, u = this.createArrowPoint(r, o, t, a), d = this.createArrowPoint(i, s, n, -a), f = a + c, p = E({
1061
1207
  x: t.x + f,
1062
1208
  y: t.y
1063
- }, o, t), m = D({
1209
+ }, o, t), m = E({
1064
1210
  x: n.x - f,
1065
1211
  y: n.y
1066
1212
  }, s, n);
1067
- this.path = M([
1213
+ this.path = j([
1068
1214
  u,
1069
1215
  p,
1070
1216
  m,
@@ -1077,113 +1223,66 @@ var ne = (e, t) => {
1077
1223
  };
1078
1224
  }
1079
1225
  createArrowPoint(e, t, n, r) {
1080
- return e ? D({
1226
+ return e ? E({
1081
1227
  x: n.x + r,
1082
1228
  y: n.y
1083
1229
  }, t, n) : n;
1084
1230
  }
1085
- }, me = (e, t) => {
1086
- let n = e.linePoint, r = t.linePoint, i = r.y - n.y >= 0, a = e.dirY >= 0;
1087
- if (a === t.dirY >= 0) {
1088
- let o = a === i, s = {
1089
- x: (n.x + r.x) / 2,
1090
- y: (n.y + r.y) / 2
1091
- };
1092
- return o ? {
1093
- points: [
1094
- e.arrowPoint,
1095
- {
1096
- x: n.x,
1097
- y: s.y
1098
- },
1099
- {
1100
- x: r.x,
1101
- y: s.y
1102
- },
1103
- t.arrowPoint
1104
- ],
1105
- midpoint: s
1106
- } : {
1107
- points: [
1108
- e.arrowPoint,
1109
- n,
1110
- {
1111
- x: s.x,
1112
- y: n.y
1113
- },
1114
- {
1115
- x: s.x,
1116
- y: r.y
1117
- },
1118
- r,
1119
- t.arrowPoint
1120
- ],
1121
- midpoint: s
1122
- };
1123
- }
1124
- let o = a === i, s = (n.x + r.x) / 2;
1125
- if (o) {
1126
- let i = {
1127
- x: n.x,
1128
- y: r.y
1129
- };
1130
- return {
1131
- points: [
1132
- e.arrowPoint,
1133
- i,
1134
- r,
1135
- t.arrowPoint
1136
- ],
1137
- midpoint: {
1138
- x: s,
1139
- y: i.y
1140
- }
1141
- };
1231
+ }, ye = class {
1232
+ path;
1233
+ midpoint;
1234
+ constructor(e) {
1235
+ let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, arrowOffset: o, fromDir: s, toDir: c, roundness: l } = e, u = r ? E({
1236
+ x: t.x + a,
1237
+ y: t.y
1238
+ }, s, t) : t, d = i ? E({
1239
+ x: n.x - a,
1240
+ y: n.y
1241
+ }, c, n) : n, f = a + o, p = E({
1242
+ x: t.x + f,
1243
+ y: t.y
1244
+ }, s, t), m = E({
1245
+ x: n.x - f,
1246
+ y: n.y
1247
+ }, c, n), h = fe({
1248
+ arrowPoint: u,
1249
+ linePoint: p,
1250
+ dir: s
1251
+ }, {
1252
+ arrowPoint: d,
1253
+ linePoint: m,
1254
+ dir: c
1255
+ });
1256
+ this.path = j(h.points, l), this.midpoint = h.midpoint;
1142
1257
  }
1143
- let c = {
1144
- x: r.x,
1145
- y: n.y
1146
- };
1147
- return {
1148
- points: [
1149
- e.arrowPoint,
1150
- n,
1151
- c,
1152
- t.arrowPoint
1153
- ],
1154
- midpoint: {
1155
- x: s,
1156
- y: c.y
1157
- }
1158
- };
1159
- }, he = class {
1258
+ }, be = class {
1160
1259
  path;
1161
1260
  midpoint;
1162
1261
  constructor(e) {
1163
- let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, arrowOffset: o, fromDir: s, toDir: c, roundness: l } = e, u = r ? D({
1262
+ let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? E({
1164
1263
  x: t.x + a,
1165
1264
  y: t.y
1166
- }, s, t) : t, d = i ? D({
1265
+ }, r, t) : t, d = l ? E({
1167
1266
  x: n.x - a,
1168
1267
  y: n.y
1169
- }, c, n) : n, f = a + o, p = D({
1268
+ }, i, n) : n, f = a + o, p = E({
1170
1269
  x: t.x + f,
1171
1270
  y: t.y
1172
- }, s, t), m = D({
1271
+ }, r, t), m = E({
1173
1272
  x: n.x - f,
1174
1273
  y: n.y
1175
- }, c, n), h = me({
1274
+ }, i, n), h = he({
1176
1275
  arrowPoint: u,
1177
1276
  linePoint: p,
1178
- dirY: s.y
1277
+ dir: r
1179
1278
  }, {
1180
1279
  arrowPoint: d,
1181
1280
  linePoint: m,
1182
- dirY: c.y
1281
+ dir: i
1183
1282
  });
1184
- this.path = M(h.points, l), this.midpoint = h.midpoint;
1283
+ this.path = j(h.points, s), this.midpoint = h.midpoint;
1185
1284
  }
1186
- }, ge = class {
1285
+ }, P = class {
1187
1286
  path;
1188
1287
  midpoint;
1189
1288
  constructor(e) {
@@ -1220,19 +1319,19 @@ var ne = (e, t) => {
1220
1319
  x: n,
1221
1320
  y: 0
1222
1321
  }
1223
- ].map((e) => D(e, i, {
1322
+ ].map((e) => E(e, i, {
1224
1323
  x: 0,
1225
1324
  y: 0
1226
1325
  })).map((e) => ({
1227
1326
  x: e.x + a.x,
1228
1327
  y: e.y + a.y
1229
1328
  })), u = `M ${a.x} ${a.y} L ${l[0].x} ${l[0].y} `;
1230
- this.path = `${o ? "" : u}${M(l, e.roundness)}`, this.midpoint = {
1329
+ this.path = `${o ? "" : u}${j(l, e.roundness)}`, this.midpoint = {
1231
1330
  x: (l[3].x + l[4].x) / 2,
1232
1331
  y: (l[3].y + l[4].y) / 2
1233
1332
  };
1234
1333
  }
1235
- }, _e = class {
1334
+ }, xe = class {
1236
1335
  path;
1237
1336
  midpoint;
1238
1337
  constructor(e) {
@@ -1253,7 +1352,7 @@ var ne = (e, t) => {
1253
1352
  x: d,
1254
1353
  y: 0
1255
1354
  }
1256
- ].map((e) => D(e, i, {
1355
+ ].map((e) => E(e, i, {
1257
1356
  x: 0,
1258
1357
  y: 0
1259
1358
  })).map((e) => ({
@@ -1267,30 +1366,30 @@ var ne = (e, t) => {
1267
1366
  ].join(" "), h = `M ${a.x} ${a.y} L ${p[0].x} ${p[0].y} `;
1268
1367
  this.path = `${o ? "" : h}${m}`, this.midpoint = p[3];
1269
1368
  }
1270
- }, ve = (e, t, n) => {
1369
+ }, Se = (e, t, n) => {
1271
1370
  let r = Math.max(e.y, t.y), i = Math.min(e.y, t.y);
1272
1371
  return (n >= 0 ? r : i) + n;
1273
- }, ye = class {
1372
+ }, Ce = class {
1274
1373
  path;
1275
1374
  midpoint;
1276
1375
  constructor(e) {
1277
- let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, from: i, to: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l, detourDistance: u } = e, d = t ? D({
1376
+ let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, from: i, to: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l, detourDistance: u } = e, d = t ? E({
1278
1377
  x: i.x + r,
1279
1378
  y: i.y
1280
- }, o, i) : i, f = n ? D({
1379
+ }, o, i) : i, f = n ? E({
1281
1380
  x: a.x - r,
1282
1381
  y: a.y
1283
- }, s, a) : a, p = r + c, m = D({
1382
+ }, s, a) : a, p = r + c, m = E({
1284
1383
  x: i.x + p,
1285
1384
  y: i.y
1286
- }, o, i), h = D({
1385
+ }, o, i), h = E({
1287
1386
  x: a.x - p,
1288
1387
  y: a.y
1289
- }, s, a), g = ve(m, h, u);
1388
+ }, s, a), g = Se(m, h, u);
1290
1389
  this.midpoint = {
1291
1390
  x: (m.x + h.x) / 2,
1292
1391
  y: g
1293
- }, this.path = M([
1392
+ }, this.path = j([
1294
1393
  d,
1295
1394
  m,
1296
1395
  {
@@ -1305,30 +1404,30 @@ var ne = (e, t) => {
1305
1404
  f
1306
1405
  ], l);
1307
1406
  }
1308
- }, be = (e, t, n) => {
1407
+ }, we = (e, t, n) => {
1309
1408
  let r = Math.max(e.x, t.x), i = Math.min(e.x, t.x);
1310
1409
  return (n >= 0 ? r : i) + n;
1311
- }, xe = class {
1410
+ }, Te = class {
1312
1411
  path;
1313
1412
  midpoint;
1314
1413
  constructor(e) {
1315
- let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, fromDir: i, toDir: a, from: o, to: s, arrowOffset: c, detourDistance: l, roundness: u } = e, d = t ? D({
1414
+ let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, fromDir: i, toDir: a, from: o, to: s, arrowOffset: c, detourDistance: l, roundness: u } = e, d = t ? E({
1316
1415
  x: o.x + r,
1317
1416
  y: o.y
1318
- }, i, o) : o, f = n ? D({
1417
+ }, i, o) : o, f = n ? E({
1319
1418
  x: s.x - r,
1320
1419
  y: s.y
1321
- }, a, s) : s, p = r + c, m = D({
1420
+ }, a, s) : s, p = r + c, m = E({
1322
1421
  x: o.x + p,
1323
1422
  y: o.y
1324
- }, i, o), h = D({
1423
+ }, i, o), h = E({
1325
1424
  x: s.x - p,
1326
1425
  y: s.y
1327
- }, a, s), g = be(m, h, l);
1426
+ }, a, s), g = we(m, h, l);
1328
1427
  this.midpoint = {
1329
1428
  x: g,
1330
1429
  y: (m.y + h.y) / 2
1331
- }, this.path = M([
1430
+ }, this.path = j([
1332
1431
  d,
1333
1432
  m,
1334
1433
  {
@@ -1343,7 +1442,25 @@ var ne = (e, t) => {
1343
1442
  f
1344
1443
  ], u);
1345
1444
  }
1346
- }, N = Object.freeze({
1445
+ }, Ee = class {
1446
+ path;
1447
+ midpoint;
1448
+ constructor(e) {
1449
+ let t = Math.abs(e.fromDir.y) < 1e-10, n = Math.abs(e.toDir.y) < 1e-10;
1450
+ if (t && n) {
1451
+ let t = new Ce(e);
1452
+ this.path = t.path, this.midpoint = t.midpoint;
1453
+ return;
1454
+ }
1455
+ if (!t && !n) {
1456
+ let t = new Te(e);
1457
+ this.path = t.path, this.midpoint = t.midpoint;
1458
+ return;
1459
+ }
1460
+ let r = new be(e);
1461
+ this.path = r.path, this.midpoint = r.midpoint;
1462
+ }
1463
+ }, F = Object.freeze({
1347
1464
  color: "#777777",
1348
1465
  width: 1,
1349
1466
  arrowLength: 20,
@@ -1365,10 +1482,10 @@ var ne = (e, t) => {
1365
1482
  curvature: 90,
1366
1483
  interactiveWidth: 10,
1367
1484
  portOffset: 0
1368
- }), Se = (e) => ({
1485
+ }), De = (e) => ({
1369
1486
  x: Math.cos(e),
1370
1487
  y: Math.sin(e)
1371
- }), P = class {
1488
+ }), I = class {
1372
1489
  params;
1373
1490
  svg;
1374
1491
  group = document.createElementNS("http://www.w3.org/2000/svg", "g");
@@ -1379,17 +1496,17 @@ var ne = (e, t) => {
1379
1496
  afterRenderEmitter;
1380
1497
  arrowRenderer;
1381
1498
  constructor(e) {
1382
- this.params = e, [this.afterRenderEmitter, this.onAfterRender] = u(), this.arrowRenderer = this.params.arrowRenderer, this.svg = se(e.color), this.svg.appendChild(this.group), this.line = ce(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = j(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = j(), this.group.appendChild(this.targetArrow));
1499
+ this.params = e, [this.afterRenderEmitter, this.onAfterRender] = u(), this.arrowRenderer = this.params.arrowRenderer, this.svg = ce(e.color), this.svg.appendChild(this.group), this.line = le(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = A(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = A(), this.group.appendChild(this.targetArrow));
1383
1500
  }
1384
1501
  render(t) {
1385
- let { x: n, y: r, width: i, height: a, from: o, to: s } = ie(t.from, t.to, this.params.padding);
1386
- le(this.svg, {
1502
+ let { x: n, y: r, width: i, height: a, from: o, to: s } = ae(t.from, t.to, this.params.padding);
1503
+ ue(this.svg, {
1387
1504
  x: n,
1388
1505
  y: r,
1389
1506
  width: i,
1390
1507
  height: a
1391
1508
  });
1392
- let c = Se(t.from.direction), l = Se(t.to.direction), u = {
1509
+ let c = De(t.from.direction), l = De(t.to.direction), u = {
1393
1510
  x: -l.x,
1394
1511
  y: -l.y
1395
1512
  }, d;
@@ -1413,7 +1530,7 @@ var ne = (e, t) => {
1413
1530
  targetArrowPath: m
1414
1531
  });
1415
1532
  }
1416
- }, Ce = (e) => (t) => {
1533
+ }, Oe = (e) => (t) => {
1417
1534
  let n = [
1418
1535
  {
1419
1536
  x: 0,
@@ -1427,7 +1544,7 @@ var ne = (e, t) => {
1427
1544
  x: t.arrowLength,
1428
1545
  y: -e.radius
1429
1546
  }
1430
- ].map((e) => D(e, t.direction, {
1547
+ ].map((e) => E(e, t.direction, {
1431
1548
  x: 0,
1432
1549
  y: 0
1433
1550
  })).map((e) => ({
@@ -1435,7 +1552,7 @@ var ne = (e, t) => {
1435
1552
  y: e.y + t.shift.y
1436
1553
  }));
1437
1554
  return `${`M ${n[0].x} ${n[0].y}`} ${`L ${n[1].x} ${n[1].y}`} ${`L ${n[2].x} ${n[2].y}`} Z`;
1438
- }, we = (e) => (t) => {
1555
+ }, ke = (e) => (t) => {
1439
1556
  let n = e.radius, r = t.arrowLength, i = (r * r + 2 * r * n) / (2 * n), a = i + n, o = r + n - n * (r + n) / a, s = n * i / a, c = [
1440
1557
  {
1441
1558
  x: 0,
@@ -1449,7 +1566,7 @@ var ne = (e, t) => {
1449
1566
  x: o,
1450
1567
  y: s
1451
1568
  }
1452
- ].map((e) => D(e, t.direction, {
1569
+ ].map((e) => E(e, t.direction, {
1453
1570
  x: 0,
1454
1571
  y: 0
1455
1572
  })).map((e) => ({
@@ -1457,8 +1574,8 @@ var ne = (e, t) => {
1457
1574
  y: e.y + t.shift.y
1458
1575
  }));
1459
1576
  return `${`M ${c[0].x} ${c[0].y}`} ${`A ${i} ${i} 0 0 0 ${c[1].x} ${c[1].y}`} ${`A ${n} ${n} 0 0 0 ${c[2].x} ${c[2].y}`} ${`A ${i} ${i} 0 0 0 ${c[0].x} ${c[0].y}`}`;
1460
- }, Te = (e) => (t) => {
1461
- let n = e.smallRadius, r = e.radius, i = D({
1577
+ }, Ae = (e) => (t) => {
1578
+ let n = e.smallRadius, r = e.radius, i = E({
1462
1579
  x: t.arrowLength,
1463
1580
  y: 0
1464
1581
  }, {
@@ -1477,7 +1594,7 @@ var ne = (e, t) => {
1477
1594
  y: -i.y
1478
1595
  },
1479
1596
  i
1480
- ].map((e) => D(e, t.direction, {
1597
+ ].map((e) => E(e, t.direction, {
1481
1598
  x: 0,
1482
1599
  y: 0
1483
1600
  })).map((e) => ({
@@ -1485,18 +1602,18 @@ var ne = (e, t) => {
1485
1602
  y: e.y + t.shift.y
1486
1603
  }));
1487
1604
  return `${`M ${a[0].x} ${a[0].y}`} ${`A ${r} ${r} 0 0 1 ${a[1].x} ${a[1].y}`} ${`A ${n} ${n} 0 0 1 ${a[2].x} ${a[2].y}`} ${`A ${r} ${r} 0 0 1 ${a[0].x} ${a[0].y}`}`;
1488
- }, F = (e) => {
1605
+ }, L = (e) => {
1489
1606
  if (typeof e == "function") return e;
1490
1607
  switch (e.type) {
1491
- case "triangle": return Ce({ radius: e.radius ?? N.polygonArrowRadius });
1492
- case "arc": return we({ radius: e.radius ?? N.circleArrowRadius });
1493
- default: return Te({
1494
- smallRadius: e.smallRadius ?? N.wedgeArrowSmallRadius,
1495
- angle: e.angle ?? N.wedgeArrowAngle,
1496
- radius: e.radius ?? N.wedgeArrowRadius
1608
+ case "triangle": return Oe({ radius: e.radius ?? F.polygonArrowRadius });
1609
+ case "arc": return ke({ radius: e.radius ?? F.circleArrowRadius });
1610
+ default: return Ae({
1611
+ smallRadius: e.smallRadius ?? F.wedgeArrowSmallRadius,
1612
+ angle: e.angle ?? F.wedgeArrowAngle,
1613
+ radius: e.radius ?? F.wedgeArrowRadius
1497
1614
  });
1498
1615
  }
1499
- }, Ee = class {
1616
+ }, je = class {
1500
1617
  svg;
1501
1618
  group;
1502
1619
  line;
@@ -1512,7 +1629,7 @@ var ne = (e, t) => {
1512
1629
  hasSourceArrow;
1513
1630
  hasTargetArrow;
1514
1631
  pathShape;
1515
- createCyclePath = (e, t, n) => new _e({
1632
+ createCyclePath = (e, t, n) => new xe({
1516
1633
  origin: e,
1517
1634
  dir: n,
1518
1635
  radius: this.portCycleRadius,
@@ -1520,7 +1637,7 @@ var ne = (e, t) => {
1520
1637
  arrowLength: this.arrowLength,
1521
1638
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1522
1639
  });
1523
- createDetourPath = (e, t, n, r) => new oe({
1640
+ createDetourPath = (e, t, n, r) => new se({
1524
1641
  from: e,
1525
1642
  to: t,
1526
1643
  fromDir: n,
@@ -1532,7 +1649,7 @@ var ne = (e, t) => {
1532
1649
  hasSourceArrow: this.hasSourceArrow,
1533
1650
  hasTargetArrow: this.hasTargetArrow
1534
1651
  });
1535
- createLinePath = (e, t, n, r) => new ae({
1652
+ createLinePath = (e, t, n, r) => new oe({
1536
1653
  from: e,
1537
1654
  to: t,
1538
1655
  fromDir: n,
@@ -1543,10 +1660,10 @@ var ne = (e, t) => {
1543
1660
  hasTargetArrow: this.hasTargetArrow
1544
1661
  });
1545
1662
  constructor(e) {
1546
- this.arrowLength = e?.arrowLength ?? N.arrowLength, this.curvature = e?.curvature ?? N.curvature, this.portCycleRadius = e?.cycleRadius ?? N.cycleRadius, this.portCycleSmallRadius = e?.smallCycleRadius ?? N.smallCycleRadius, this.detourDirection = e?.detourDirection ?? N.detourDirection, this.detourDistance = e?.detourDistance ?? N.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? N.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? N.hasTargetArrow, this.pathShape = new P({
1547
- color: e?.color ?? N.color,
1548
- width: e?.width ?? N.width,
1549
- arrowRenderer: F(e?.arrowRenderer ?? {}),
1663
+ this.arrowLength = e?.arrowLength ?? F.arrowLength, this.curvature = e?.curvature ?? F.curvature, this.portCycleRadius = e?.cycleRadius ?? F.cycleRadius, this.portCycleSmallRadius = e?.smallCycleRadius ?? F.smallCycleRadius, this.detourDirection = e?.detourDirection ?? F.detourDirection, this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1664
+ color: e?.color ?? F.color,
1665
+ width: e?.width ?? F.width,
1666
+ arrowRenderer: L(e?.arrowRenderer ?? {}),
1550
1667
  arrowLength: this.arrowLength,
1551
1668
  hasSourceArrow: this.hasSourceArrow,
1552
1669
  hasTargetArrow: this.hasTargetArrow,
@@ -1559,7 +1676,7 @@ var ne = (e, t) => {
1559
1676
  render(e) {
1560
1677
  this.pathShape.render(e);
1561
1678
  }
1562
- }, De = (e) => Math.cos(e) > 0 ? 0 : Math.PI, Oe = class {
1679
+ }, Me = (e) => Math.cos(e) > 0 ? 0 : Math.PI, Ne = class {
1563
1680
  svg;
1564
1681
  group;
1565
1682
  line;
@@ -1574,7 +1691,7 @@ var ne = (e, t) => {
1574
1691
  hasSourceArrow;
1575
1692
  hasTargetArrow;
1576
1693
  pathShape;
1577
- createCyclePath = (e, t, n) => new ge({
1694
+ createCyclePath = (e, t, n) => new P({
1578
1695
  origin: e,
1579
1696
  dir: n,
1580
1697
  arrowLength: this.arrowLength,
@@ -1583,7 +1700,7 @@ var ne = (e, t) => {
1583
1700
  roundness: this.roundness,
1584
1701
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1585
1702
  });
1586
- createDetourPath = (e, t, n, r) => new ye({
1703
+ createDetourPath = (e, t, n, r) => new Ce({
1587
1704
  from: e,
1588
1705
  to: t,
1589
1706
  fromDir: n,
@@ -1595,7 +1712,7 @@ var ne = (e, t) => {
1595
1712
  hasSourceArrow: this.hasSourceArrow,
1596
1713
  hasTargetArrow: this.hasTargetArrow
1597
1714
  });
1598
- createLinePath = (e, t, n, r) => new de({
1715
+ createLinePath = (e, t, n, r) => new ge({
1599
1716
  from: e,
1600
1717
  to: t,
1601
1718
  fromDir: n,
@@ -1607,12 +1724,12 @@ var ne = (e, t) => {
1607
1724
  hasTargetArrow: this.hasTargetArrow
1608
1725
  });
1609
1726
  constructor(e) {
1610
- this.arrowLength = e?.arrowLength ?? N.arrowLength, this.arrowOffset = e?.arrowOffset ?? N.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? N.cycleSquareSide;
1611
- let t = e?.roundness ?? N.roundness;
1612
- this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? N.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? N.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? N.hasTargetArrow, this.pathShape = new P({
1613
- color: e?.color ?? N.color,
1614
- width: e?.width ?? N.width,
1615
- arrowRenderer: F(e?.arrowRenderer ?? {}),
1727
+ this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowOffset = e?.arrowOffset ?? F.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? F.cycleSquareSide;
1728
+ let t = e?.roundness ?? F.roundness;
1729
+ this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1730
+ color: e?.color ?? F.color,
1731
+ width: e?.width ?? F.width,
1732
+ arrowRenderer: L(e?.arrowRenderer ?? {}),
1616
1733
  arrowLength: this.arrowLength,
1617
1734
  hasSourceArrow: this.hasSourceArrow,
1618
1735
  hasTargetArrow: this.hasTargetArrow,
@@ -1628,15 +1745,15 @@ var ne = (e, t) => {
1628
1745
  category: r,
1629
1746
  from: {
1630
1747
  ...t,
1631
- direction: De(t.direction)
1748
+ direction: Me(t.direction)
1632
1749
  },
1633
1750
  to: {
1634
1751
  ...n,
1635
- direction: De(n.direction)
1752
+ direction: Me(n.direction)
1636
1753
  }
1637
1754
  });
1638
1755
  }
1639
- }, ke = class {
1756
+ }, Pe = class {
1640
1757
  svg;
1641
1758
  group;
1642
1759
  line;
@@ -1652,7 +1769,7 @@ var ne = (e, t) => {
1652
1769
  hasSourceArrow;
1653
1770
  hasTargetArrow;
1654
1771
  pathShape;
1655
- createCyclePath = (e, t, n) => new ge({
1772
+ createCyclePath = (e, t, n) => new P({
1656
1773
  origin: e,
1657
1774
  dir: n,
1658
1775
  arrowLength: this.arrowLength,
@@ -1661,7 +1778,7 @@ var ne = (e, t) => {
1661
1778
  roundness: this.roundness,
1662
1779
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1663
1780
  });
1664
- createDetourPath = (e, t, n, r) => new fe({
1781
+ createDetourPath = (e, t, n, r) => new _e({
1665
1782
  from: e,
1666
1783
  to: t,
1667
1784
  fromDir: n,
@@ -1674,7 +1791,7 @@ var ne = (e, t) => {
1674
1791
  hasSourceArrow: this.hasSourceArrow,
1675
1792
  hasTargetArrow: this.hasTargetArrow
1676
1793
  });
1677
- createLinePath = (e, t, n, r) => new pe({
1794
+ createLinePath = (e, t, n, r) => new ve({
1678
1795
  from: e,
1679
1796
  to: t,
1680
1797
  fromDir: n,
@@ -1686,12 +1803,12 @@ var ne = (e, t) => {
1686
1803
  hasTargetArrow: this.hasTargetArrow
1687
1804
  });
1688
1805
  constructor(e) {
1689
- this.arrowLength = e?.arrowLength ?? N.arrowLength, this.arrowOffset = e?.arrowOffset ?? N.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? N.cycleSquareSide;
1690
- let t = e?.roundness ?? N.roundness;
1691
- this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDirection = e?.detourDirection ?? N.detourDirection, this.detourDistance = e?.detourDistance ?? N.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? N.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? N.hasTargetArrow, this.pathShape = new P({
1692
- color: e?.color ?? N.color,
1693
- width: e?.width ?? N.width,
1694
- arrowRenderer: F(e?.arrowRenderer ?? {}),
1806
+ this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowOffset = e?.arrowOffset ?? F.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? F.cycleSquareSide;
1807
+ let t = e?.roundness ?? F.roundness;
1808
+ this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDirection = e?.detourDirection ?? F.detourDirection, this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1809
+ color: e?.color ?? F.color,
1810
+ width: e?.width ?? F.width,
1811
+ arrowRenderer: L(e?.arrowRenderer ?? {}),
1695
1812
  arrowLength: this.arrowLength,
1696
1813
  hasSourceArrow: this.hasSourceArrow,
1697
1814
  hasTargetArrow: this.hasTargetArrow,
@@ -1704,7 +1821,7 @@ var ne = (e, t) => {
1704
1821
  render(e) {
1705
1822
  this.pathShape.render(e);
1706
1823
  }
1707
- }, Ae = Math.PI / 2, je = (e) => Math.sin(e) > 0 ? Ae : -Ae, Me = class {
1824
+ }, Fe = Math.PI / 2, Ie = (e) => Math.sin(e) > 0 ? Fe : -Fe, Le = class {
1708
1825
  svg;
1709
1826
  group;
1710
1827
  line;
@@ -1719,7 +1836,7 @@ var ne = (e, t) => {
1719
1836
  hasSourceArrow;
1720
1837
  hasTargetArrow;
1721
1838
  pathShape;
1722
- createCyclePath = (e, t, n) => new ge({
1839
+ createCyclePath = (e, t, n) => new P({
1723
1840
  origin: e,
1724
1841
  dir: n,
1725
1842
  arrowLength: this.arrowLength,
@@ -1728,7 +1845,7 @@ var ne = (e, t) => {
1728
1845
  roundness: this.roundness,
1729
1846
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1730
1847
  });
1731
- createDetourPath = (e, t, n, r) => new xe({
1848
+ createDetourPath = (e, t, n, r) => new Te({
1732
1849
  from: e,
1733
1850
  to: t,
1734
1851
  fromDir: n,
@@ -1740,7 +1857,7 @@ var ne = (e, t) => {
1740
1857
  hasSourceArrow: this.hasSourceArrow,
1741
1858
  hasTargetArrow: this.hasTargetArrow
1742
1859
  });
1743
- createLinePath = (e, t, n, r) => new he({
1860
+ createLinePath = (e, t, n, r) => new ye({
1744
1861
  from: e,
1745
1862
  to: t,
1746
1863
  fromDir: n,
@@ -1752,12 +1869,12 @@ var ne = (e, t) => {
1752
1869
  hasTargetArrow: this.hasTargetArrow
1753
1870
  });
1754
1871
  constructor(e) {
1755
- this.arrowLength = e?.arrowLength ?? N.arrowLength, this.arrowOffset = e?.arrowOffset ?? N.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? N.cycleSquareSide;
1756
- let t = e?.roundness ?? N.roundness;
1757
- this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? N.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? N.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? N.hasTargetArrow, this.pathShape = new P({
1758
- color: e?.color ?? N.color,
1759
- width: e?.width ?? N.width,
1760
- arrowRenderer: F(e?.arrowRenderer ?? {}),
1872
+ this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowOffset = e?.arrowOffset ?? F.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? F.cycleSquareSide;
1873
+ let t = e?.roundness ?? F.roundness;
1874
+ this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1875
+ color: e?.color ?? F.color,
1876
+ width: e?.width ?? F.width,
1877
+ arrowRenderer: L(e?.arrowRenderer ?? {}),
1761
1878
  arrowLength: this.arrowLength,
1762
1879
  hasSourceArrow: this.hasSourceArrow,
1763
1880
  hasTargetArrow: this.hasTargetArrow,
@@ -1773,18 +1890,98 @@ var ne = (e, t) => {
1773
1890
  category: r,
1774
1891
  from: {
1775
1892
  ...t,
1776
- direction: je(t.direction)
1893
+ direction: Ie(t.direction)
1777
1894
  },
1778
1895
  to: {
1779
1896
  ...n,
1780
- direction: je(n.direction)
1897
+ direction: Ie(n.direction)
1781
1898
  }
1782
1899
  });
1783
1900
  }
1784
- }, Ne = (e) => {
1901
+ }, Re = (e) => {
1902
+ let t = e + Math.PI / 4, n = Math.cos(t), r = Math.sin(t);
1903
+ return n > 0 ? r > 0 ? 0 : -Math.PI / 2 : r > 0 ? Math.PI / 2 : Math.PI;
1904
+ }, ze = class {
1905
+ svg;
1906
+ group;
1907
+ line;
1908
+ sourceArrow;
1909
+ targetArrow;
1910
+ onAfterRender;
1911
+ arrowLength;
1912
+ arrowOffset;
1913
+ roundness;
1914
+ cycleSquareSide;
1915
+ detourDistance;
1916
+ hasSourceArrow;
1917
+ hasTargetArrow;
1918
+ pathShape;
1919
+ createCyclePath = (e, t, n) => new P({
1920
+ origin: e,
1921
+ dir: n,
1922
+ arrowLength: this.arrowLength,
1923
+ side: this.cycleSquareSide,
1924
+ arrowOffset: this.arrowOffset,
1925
+ roundness: this.roundness,
1926
+ hasArrow: this.hasSourceArrow || this.hasTargetArrow
1927
+ });
1928
+ createDetourPath = (e, t, n, r) => new Ee({
1929
+ from: e,
1930
+ to: t,
1931
+ fromDir: n,
1932
+ toDir: r,
1933
+ arrowLength: this.arrowLength,
1934
+ arrowOffset: this.arrowOffset,
1935
+ roundness: this.roundness,
1936
+ detourDistance: this.detourDistance,
1937
+ hasSourceArrow: this.hasSourceArrow,
1938
+ hasTargetArrow: this.hasTargetArrow
1939
+ });
1940
+ createLinePath = (e, t, n, r) => new be({
1941
+ from: e,
1942
+ to: t,
1943
+ fromDir: n,
1944
+ toDir: r,
1945
+ arrowLength: this.arrowLength,
1946
+ arrowOffset: this.arrowOffset,
1947
+ roundness: this.roundness,
1948
+ hasSourceArrow: this.hasSourceArrow,
1949
+ hasTargetArrow: this.hasTargetArrow
1950
+ });
1951
+ constructor(e) {
1952
+ this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowOffset = e?.arrowOffset ?? F.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? F.cycleSquareSide;
1953
+ let t = e?.roundness ?? F.roundness;
1954
+ this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1955
+ color: e?.color ?? F.color,
1956
+ width: e?.width ?? F.width,
1957
+ arrowRenderer: L(e?.arrowRenderer ?? {}),
1958
+ arrowLength: this.arrowLength,
1959
+ hasSourceArrow: this.hasSourceArrow,
1960
+ hasTargetArrow: this.hasTargetArrow,
1961
+ createCyclePath: this.createCyclePath,
1962
+ createDetourPath: this.createDetourPath,
1963
+ createLinePath: this.createLinePath,
1964
+ padding: 50
1965
+ }), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1966
+ }
1967
+ render(e) {
1968
+ let { from: t, to: n, category: r } = e;
1969
+ this.pathShape.render({
1970
+ category: r,
1971
+ from: {
1972
+ ...t,
1973
+ direction: Re(t.direction)
1974
+ },
1975
+ to: {
1976
+ ...n,
1977
+ direction: Re(n.direction)
1978
+ }
1979
+ });
1980
+ }
1981
+ }, Be = (e) => {
1785
1982
  let { direction: t, radius: n } = e, { x: r, y: i } = t, { horizontal: a, vertical: o } = n, s = i / r, c = Math.abs(o / s), l = Math.abs(a * s), u = Math.min(a, c), d = Math.min(o, l);
1786
1983
  return Math.sqrt(u * u + d * d);
1787
- }, Pe = (e) => typeof e == "number" ? () => e : e === "box" ? Ne : e, Fe = N.portOffset, I = class {
1984
+ }, Ve = (e) => typeof e == "number" ? () => e : e === "box" ? Be : e, He = F.portOffset, R = class {
1788
1985
  svg;
1789
1986
  group = document.createElementNS("http://www.w3.org/2000/svg", "g");
1790
1987
  line;
@@ -1799,11 +1996,11 @@ var ne = (e, t) => {
1799
1996
  afterRenderEmitter;
1800
1997
  arrowRenderer;
1801
1998
  constructor(e) {
1802
- [this.afterRenderEmitter, this.onAfterRender] = u(), this.color = e?.color ?? N.color, this.width = e?.width ?? N.width, this.arrowLength = e?.arrowLength ?? N.arrowLength, this.arrowRenderer = F(e?.arrowRenderer ?? {}), this.sourceOffsetFn = Pe(e?.sourceOffset ?? Fe), this.targetOffsetFn = Pe(e?.targetOffset ?? Fe), this.svg = se(this.color), this.svg.appendChild(this.group), this.line = ce(this.width), this.group.appendChild(this.line), e?.hasSourceArrow && (this.sourceArrow = j(), this.group.appendChild(this.sourceArrow)), e?.hasTargetArrow && (this.targetArrow = j(), this.group.appendChild(this.targetArrow));
1999
+ [this.afterRenderEmitter, this.onAfterRender] = u(), this.color = e?.color ?? F.color, this.width = e?.width ?? F.width, this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowRenderer = L(e?.arrowRenderer ?? {}), this.sourceOffsetFn = Ve(e?.sourceOffset ?? He), this.targetOffsetFn = Ve(e?.targetOffset ?? He), this.svg = ce(this.color), this.svg.appendChild(this.group), this.line = le(this.width), this.group.appendChild(this.line), e?.hasSourceArrow && (this.sourceArrow = A(), this.group.appendChild(this.sourceArrow)), e?.hasTargetArrow && (this.targetArrow = A(), this.group.appendChild(this.targetArrow));
1803
2000
  }
1804
2001
  render(e) {
1805
- let { x: t, y: n, width: r, height: i, from: a, to: o } = ie(e.from, e.to, 50);
1806
- le(this.svg, {
2002
+ let { x: t, y: n, width: r, height: i, from: a, to: o } = ae(e.from, e.to, 50);
2003
+ ue(this.svg, {
1807
2004
  x: t,
1808
2005
  y: n,
1809
2006
  width: r,
@@ -1901,43 +2098,43 @@ var ne = (e, t) => {
1901
2098
  targetArrowPath: n
1902
2099
  });
1903
2100
  }
1904
- }, Ie = () => {
2101
+ }, Ue = () => {
1905
2102
  let e = document.createElementNS("http://www.w3.org/2000/svg", "g");
1906
2103
  return e.style.pointerEvents = "auto", e.style.cursor = "pointer", e;
1907
- }, Le = (e) => {
2104
+ }, We = (e) => {
1908
2105
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
1909
2106
  return t.setAttribute("stroke", "transparent"), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t.setAttribute("stroke-linecap", "round"), t;
1910
- }, Re = (e) => {
2107
+ }, Ge = (e) => {
1911
2108
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
1912
2109
  return t.setAttribute("stroke-linejoin", "round"), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "transparent"), t.setAttribute("stroke", "transparent"), t;
1913
- }, ze = class extends Error {
2110
+ }, Ke = class extends Error {
1914
2111
  constructor(e) {
1915
2112
  super(e), this.name = "InteractiveEdgeError";
1916
2113
  }
1917
- }, Be = class e {
2114
+ }, qe = class e {
1918
2115
  baseEdge;
1919
2116
  svg;
1920
2117
  group;
1921
2118
  line;
1922
2119
  sourceArrow;
1923
2120
  targetArrow;
1924
- handle = Ie();
2121
+ handle = Ue();
1925
2122
  onAfterRender;
1926
2123
  interactiveLine;
1927
2124
  interactiveSourceArrow = null;
1928
2125
  interactiveTargetArrow = null;
1929
2126
  constructor(t, n) {
1930
- if (this.baseEdge = t, t instanceof e) throw new ze("interactive edge can be configured only once");
2127
+ if (this.baseEdge = t, t instanceof e) throw new Ke("interactive edge can be configured only once");
1931
2128
  this.svg = this.baseEdge.svg, this.group = this.baseEdge.group, this.line = this.baseEdge.line, this.sourceArrow = this.baseEdge.sourceArrow, this.targetArrow = this.baseEdge.targetArrow, this.onAfterRender = this.baseEdge.onAfterRender;
1932
- let r = n?.distance ?? N.interactiveWidth;
1933
- this.interactiveLine = Le(r), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Re(r), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Re(r), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((e) => {
2129
+ let r = n?.distance ?? F.interactiveWidth;
2130
+ this.interactiveLine = We(r), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Ge(r), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Ge(r), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((e) => {
1934
2131
  this.interactiveLine.setAttribute("d", e.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", e.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", e.targetArrowPath);
1935
2132
  });
1936
2133
  }
1937
2134
  render(e) {
1938
2135
  this.baseEdge.render(e);
1939
2136
  }
1940
- }, Ve = class {
2137
+ }, Je = class {
1941
2138
  baseShape;
1942
2139
  midpointElement;
1943
2140
  group;
@@ -1955,7 +2152,7 @@ var ne = (e, t) => {
1955
2152
  render(e) {
1956
2153
  this.baseShape.render(e);
1957
2154
  }
1958
- }, He = class {
2155
+ }, Ye = class {
1959
2156
  graphStore;
1960
2157
  onAfterNodeAdded;
1961
2158
  onAfterNodeUpdated;
@@ -2054,7 +2251,7 @@ var ne = (e, t) => {
2054
2251
  getNodeAdjacentEdgeIds(e) {
2055
2252
  return this.graphStore.getNodeAdjacentEdgeIds(e);
2056
2253
  }
2057
- }, L = class {
2254
+ }, z = class {
2058
2255
  checkExists;
2059
2256
  counter = 0;
2060
2257
  constructor(e) {
@@ -2068,13 +2265,13 @@ var ne = (e, t) => {
2068
2265
  reset() {
2069
2266
  this.counter = 0;
2070
2267
  }
2071
- }, Ue = class {
2268
+ }, Xe = class {
2072
2269
  graphStore;
2073
2270
  htmlView;
2074
2271
  params;
2075
- nodeIdGenerator = new L((e) => this.graphStore.hasNode(e));
2076
- portIdGenerator = new L((e) => this.graphStore.hasPort(e));
2077
- edgeIdGenerator = new L((e) => this.graphStore.hasEdge(e));
2272
+ nodeIdGenerator = new z((e) => this.graphStore.hasNode(e));
2273
+ portIdGenerator = new z((e) => this.graphStore.hasPort(e));
2274
+ edgeIdGenerator = new z((e) => this.graphStore.hasEdge(e));
2078
2275
  onAfterNodeAdded = (e) => {
2079
2276
  this.htmlView.attachNode(e);
2080
2277
  };
@@ -2181,17 +2378,17 @@ var ne = (e, t) => {
2181
2378
  destroy() {
2182
2379
  this.graphStore.onAfterNodeAdded.unsubscribe(this.onAfterNodeAdded), this.graphStore.onAfterNodeUpdated.unsubscribe(this.onAfterNodeUpdated), this.graphStore.onAfterNodePriorityUpdated.unsubscribe(this.onAfterNodePriorityUpdated), this.graphStore.onBeforeNodeRemoved.unsubscribe(this.onBeforeNodeRemoved), this.graphStore.onAfterPortUpdated.unsubscribe(this.onAfterPortUpdated), this.graphStore.onBeforePortRemoved.unsubscribe(this.onBeforePortUnmarked), this.graphStore.onAfterEdgeAdded.unsubscribe(this.onAfterEdgeAdded), this.graphStore.onAfterEdgeShapeUpdated.unsubscribe(this.onAfterEdgeShapeUpdated), this.graphStore.onAfterEdgeUpdated.unsubscribe(this.onAfterEdgeUpdated), this.graphStore.onAfterEdgePriorityUpdated.unsubscribe(this.onAfterEdgePriorityUpdated), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy();
2183
2380
  }
2184
- }, We = (e) => {
2381
+ }, Ze = (e) => {
2185
2382
  setTimeout(() => {
2186
2383
  e();
2187
2384
  });
2188
- }, Ge = (e) => {
2385
+ }, Qe = (e) => {
2189
2386
  queueMicrotask(() => {
2190
2387
  e();
2191
2388
  });
2192
- }, R = (e) => {
2389
+ }, B = (e) => {
2193
2390
  e();
2194
- }, Ke = class {
2391
+ }, $e = class {
2195
2392
  viewportStore;
2196
2393
  onBeforeUpdated;
2197
2394
  onAfterUpdated;
@@ -2214,7 +2411,7 @@ var ne = (e, t) => {
2214
2411
  createViewportCoords(e) {
2215
2412
  return this.viewportStore.createViewportCoords(e);
2216
2413
  }
2217
- }, qe = (e, t) => Symbol.iterator in e ? {
2414
+ }, et = (e, t) => Symbol.iterator in e ? {
2218
2415
  minContentScale: t.focus.minContentScale,
2219
2416
  nodes: e,
2220
2417
  contentPadding: t.focus.contentPadding,
@@ -2224,15 +2421,15 @@ var ne = (e, t) => {
2224
2421
  nodes: e.nodes ?? [],
2225
2422
  contentPadding: e.contentPadding ?? e.contentOffset ?? t.focus.contentPadding,
2226
2423
  animationDuration: e.animationDuration ?? t.focus.animationDuration
2227
- }, Je = (e, t, n) => ({
2424
+ }, tt = (e, t, n) => ({
2228
2425
  scale: e.scale,
2229
2426
  x: e.x + e.scale * t,
2230
2427
  y: e.y + e.scale * n
2231
- }), Ye = (e, t, n, r) => ({
2428
+ }), nt = (e, t, n, r) => ({
2232
2429
  scale: e.scale * t,
2233
2430
  x: e.scale * (1 - t) * n + e.x,
2234
2431
  y: e.scale * (1 - t) * r + e.y
2235
- }), Xe = class {
2432
+ }), rt = class {
2236
2433
  graphStore;
2237
2434
  viewportStore;
2238
2435
  params;
@@ -2250,16 +2447,16 @@ var ne = (e, t) => {
2250
2447
  let { width: n, height: r } = this.viewportStore.getDimensions(), i = {
2251
2448
  x: n / 2,
2252
2449
  y: r / 2
2253
- }, a = this.viewportStore.getViewportMatrix(), o = this.viewportStore.createViewportCoords(e), s = Je(a, o.x - i.x, o.y - i.y), c = t?.contentScale;
2450
+ }, a = this.viewportStore.getViewportMatrix(), o = this.viewportStore.createViewportCoords(e), s = tt(a, o.x - i.x, o.y - i.y), c = t?.contentScale;
2254
2451
  if (c !== void 0) {
2255
2452
  let e = 1 / c;
2256
- s = Ye(s, e / a.scale, i.x, i.y);
2453
+ s = nt(s, e / a.scale, i.x, i.y);
2257
2454
  }
2258
2455
  let l = t?.animationDuration ?? 0;
2259
2456
  l > 0 ? this.animateNavigation(a, s, l) : this.viewportStore.patchViewportMatrix(s);
2260
2457
  }
2261
2458
  focus(e) {
2262
- let t = qe(e ?? {}, this.params);
2459
+ let t = et(e ?? {}, this.params);
2263
2460
  this.params.focus.schedule(() => {
2264
2461
  this.navigate(t);
2265
2462
  });
@@ -2301,25 +2498,25 @@ var ne = (e, t) => {
2301
2498
  };
2302
2499
  this.win.requestAnimationFrame(a);
2303
2500
  }
2304
- }, Ze = (e, t, n) => {
2501
+ }, it = (e, t, n) => {
2305
2502
  let r = new h();
2306
- return new d(new He(r), new Ke(t), new Ue(r, new a(r, t, e), {
2503
+ return new d(new Ye(r), new $e(t), new Xe(r, new a(r, t, e), {
2307
2504
  nodes: {
2308
- centerFn: re,
2505
+ centerFn: ie,
2309
2506
  priorityFn: () => 0
2310
2507
  },
2311
2508
  edges: {
2312
- shapeFactory: () => new I(),
2509
+ shapeFactory: () => new R(),
2313
2510
  priorityFn: () => 0
2314
2511
  },
2315
2512
  ports: { direction: 0 }
2316
- }), new Xe(r, t, { focus: {
2513
+ }), new rt(r, t, { focus: {
2317
2514
  contentPadding: 0,
2318
2515
  minContentScale: 0,
2319
- schedule: R,
2516
+ schedule: B,
2320
2517
  animationDuration: 0
2321
2518
  } }, n));
2322
- }, z = Symbol(), Qe = class e {
2519
+ }, V = Symbol(), at = class e {
2323
2520
  canvas;
2324
2521
  window;
2325
2522
  pointInsideVerifier;
@@ -2340,7 +2537,7 @@ var ne = (e, t) => {
2340
2537
  this.params.onPointerDownVerifier(r, {
2341
2538
  x: t.clientX,
2342
2539
  y: t.clientY
2343
- }) && (this.eventTagger.tag(e, z), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 }));
2540
+ }) && (this.eventTagger.tag(e, V), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 }));
2344
2541
  };
2345
2542
  onWindowMouseMove = (e) => {
2346
2543
  if (!this.pointInsideVerifier.verify(e.clientX, e.clientY)) {
@@ -2365,7 +2562,7 @@ var ne = (e, t) => {
2365
2562
  this.params.onPointerDownVerifier(i, {
2366
2563
  x: n.clientX,
2367
2564
  y: n.clientY
2368
- }) && (this.eventTagger.tag(e, z), this.window.addEventListener("touchmove", this.onWindowTouchMove, { passive: !0 }), this.window.addEventListener("touchend", this.onWindowTouchFinish, { passive: !0 }), this.window.addEventListener("touchcancel", this.onWindowTouchFinish, { passive: !0 }));
2565
+ }) && (this.eventTagger.tag(e, V), this.window.addEventListener("touchmove", this.onWindowTouchMove, { passive: !0 }), this.window.addEventListener("touchend", this.onWindowTouchFinish, { passive: !0 }), this.window.addEventListener("touchcancel", this.onWindowTouchFinish, { passive: !0 }));
2369
2566
  };
2370
2567
  onWindowTouchMove = (e) => {
2371
2568
  let t = e.touches[0];
@@ -2413,16 +2610,16 @@ var ne = (e, t) => {
2413
2610
  removeWindowTouchListeners() {
2414
2611
  this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
2415
2612
  }
2416
- }, B = Symbol(), $e = class {
2613
+ }, H = Symbol(), ot = class {
2417
2614
  has(e, t) {
2418
- let n = e[B];
2615
+ let n = e[H];
2419
2616
  return n !== void 0 && n.has(t);
2420
2617
  }
2421
2618
  tag(e, t) {
2422
- let n = e, r = n[B];
2423
- r === void 0 ? n[B] = /* @__PURE__ */ new Set([t]) : r.add(t);
2619
+ let n = e, r = n[H];
2620
+ r === void 0 ? n[H] = /* @__PURE__ */ new Set([t]) : r.add(t);
2424
2621
  }
2425
- }, V = Symbol(), H = class {
2622
+ }, U = Symbol(), W = class {
2426
2623
  window;
2427
2624
  pointInsideVerifier;
2428
2625
  onSelected;
@@ -2503,10 +2700,10 @@ var ne = (e, t) => {
2503
2700
  let r = Math.sqrt(e * e + t * t);
2504
2701
  this.movedDistance += r, this.movedDistance > this.movementThreshold && n();
2505
2702
  }
2506
- }, U = (e, t) => ({
2703
+ }, st = (e, t) => ({
2507
2704
  from: e.isDirect ? e.staticPortId : t,
2508
2705
  to: e.isDirect ? t : e.staticPortId
2509
- }), et = class {
2706
+ }), ct = class {
2510
2707
  graph;
2511
2708
  connectionAllowedVerifier;
2512
2709
  constructor(e, t) {
@@ -2517,7 +2714,7 @@ var ne = (e, t) => {
2517
2714
  return this.graph.getAllPortIds().forEach((i) => {
2518
2715
  let { element: a, direction: o, nodeId: s } = this.graph.getPort(i), { x: c, y: l } = this.graph.getNode(s);
2519
2716
  if (c === null || l === null) return;
2520
- let u = U(e, i);
2717
+ let u = st(e, i);
2521
2718
  if (!this.connectionAllowedVerifier(u)) return;
2522
2719
  let { top: d, left: f, width: p, height: m } = a.getBoundingClientRect(), h = {
2523
2720
  x: f + p / 2,
@@ -2526,7 +2723,7 @@ var ne = (e, t) => {
2526
2723
  v < n && (n = v, t = o);
2527
2724
  }), t;
2528
2725
  }
2529
- }, tt = class {
2726
+ }, lt = class {
2530
2727
  direction;
2531
2728
  constructor(e) {
2532
2729
  this.direction = e;
@@ -2534,7 +2731,7 @@ var ne = (e, t) => {
2534
2731
  resolve() {
2535
2732
  return this.direction;
2536
2733
  }
2537
- }, nt = class e {
2734
+ }, ut = class e {
2538
2735
  canvas;
2539
2736
  element;
2540
2737
  window;
@@ -2557,12 +2754,12 @@ var ne = (e, t) => {
2557
2754
  t.removeEventListener("mousedown", this.onMouseDown), t.removeEventListener("touchstart", this.onTouchStart);
2558
2755
  };
2559
2756
  onMouseDown = (e) => {
2560
- if (this.eventTagger.has(e, z)) return;
2757
+ if (this.eventTagger.has(e, V)) return;
2561
2758
  let t = e;
2562
2759
  if (!this.params.mouseDownEventVerifier(t)) return;
2563
2760
  let n = e.currentTarget, r = this.graph.findNodeIdByElement(n), i = this.graph.getNode(r);
2564
2761
  if (!this.params.nodeDragVerifier(r)) return;
2565
- this.eventTagger.tag(e, z), this.params.onNodeDragStarted(r);
2762
+ this.eventTagger.tag(e, V), this.params.onNodeDragStarted(r);
2566
2763
  let a = this.calculateContentPoint({
2567
2764
  x: t.clientX,
2568
2765
  y: t.clientY
@@ -2571,10 +2768,10 @@ var ne = (e, t) => {
2571
2768
  nodeId: r,
2572
2769
  dx: a.x - i.x,
2573
2770
  dy: a.y - i.y
2574
- }, w(this.element, this.params.dragCursor), this.moveNodeOnTop(r), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 });
2771
+ }, C(this.element, this.params.dragCursor), this.moveNodeOnTop(r), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 });
2575
2772
  };
2576
2773
  onTouchStart = (e) => {
2577
- if (this.eventTagger.has(e, z)) return;
2774
+ if (this.eventTagger.has(e, V)) return;
2578
2775
  let t = e;
2579
2776
  if (t.touches.length !== 1) return;
2580
2777
  let n = t.touches[0], r = e.currentTarget, i = this.canvas.graph.findNodeIdByElement(r), a = this.graph.getNode(i);
@@ -2584,7 +2781,7 @@ var ne = (e, t) => {
2584
2781
  x: a.x,
2585
2782
  y: a.y
2586
2783
  })) return;
2587
- this.eventTagger.tag(e, z);
2784
+ this.eventTagger.tag(e, V);
2588
2785
  let o = this.calculateContentPoint({
2589
2786
  x: n.clientX,
2590
2787
  y: n.clientY
@@ -2661,7 +2858,7 @@ var ne = (e, t) => {
2661
2858
  }
2662
2859
  }
2663
2860
  stopMouseDrag() {
2664
- this.finishDrag(), w(this.element, null), this.removeMouseDragListeners();
2861
+ this.finishDrag(), C(this.element, null), this.removeMouseDragListeners();
2665
2862
  }
2666
2863
  removeMouseDragListeners() {
2667
2864
  this.window.removeEventListener("mouseup", this.onWindowMouseUp), this.window.removeEventListener("mousemove", this.onWindowMouseMove);
@@ -2698,7 +2895,7 @@ var ne = (e, t) => {
2698
2895
  let e = this.grabbedNodeState.nodeId;
2699
2896
  this.graph.hasNode(e) && this.params.onNodeDragFinished(e), this.grabbedNodeState = null;
2700
2897
  }
2701
- }, W = (e) => {
2898
+ }, G = (e) => {
2702
2899
  let t = [], n = e.touches.length;
2703
2900
  for (let r = 0; r < n; r++) t.push([e.touches[r].clientX, e.touches[r].clientY]);
2704
2901
  let r = t.reduce((e, t) => [e[0] + t[0], e[1] + t[1]], [0, 0]), i = [r[0] / n, r[1] / n], a = t.map((e) => [e[0] - i[0], e[1] - i[1]]).reduce((e, t) => e + Math.sqrt(t[0] * t[0] + t[1] * t[1]), 0);
@@ -2709,7 +2906,7 @@ var ne = (e, t) => {
2709
2906
  touchesCnt: n,
2710
2907
  touches: t
2711
2908
  };
2712
- }, rt = class e {
2909
+ }, dt = class e {
2713
2910
  canvas;
2714
2911
  element;
2715
2912
  window;
@@ -2724,7 +2921,7 @@ var ne = (e, t) => {
2724
2921
  this.removeMouseDragListeners(), this.removeTouchDragListeners();
2725
2922
  };
2726
2923
  onMouseDown = (e) => {
2727
- this.eventTagger.has(e, z) || this.params.mouseDownEventVerifier(e) && (w(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 }), this.startRegisteredTransform());
2924
+ this.eventTagger.has(e, V) || this.params.mouseDownEventVerifier(e) && (C(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 }), this.startRegisteredTransform());
2728
2925
  };
2729
2926
  onWindowMouseMove = (e) => {
2730
2927
  let t = this.pointInsideVerifier.verify(e.clientX, e.clientY);
@@ -2746,16 +2943,16 @@ var ne = (e, t) => {
2746
2943
  }, this.params.scaleWheelFinishTimeout);
2747
2944
  };
2748
2945
  onTouchStart = (e) => {
2749
- if (!this.eventTagger.has(e, z)) {
2946
+ if (!this.eventTagger.has(e, V)) {
2750
2947
  if (this.prevTouches !== null) {
2751
- this.prevTouches = W(e);
2948
+ this.prevTouches = G(e);
2752
2949
  return;
2753
2950
  }
2754
- this.prevTouches = W(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, { passive: !0 }), this.window.addEventListener("touchend", this.onWindowTouchFinish, { passive: !0 }), this.window.addEventListener("touchcancel", this.onWindowTouchFinish, { passive: !0 }), this.startRegisteredTransform();
2951
+ this.prevTouches = G(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, { passive: !0 }), this.window.addEventListener("touchend", this.onWindowTouchFinish, { passive: !0 }), this.window.addEventListener("touchcancel", this.onWindowTouchFinish, { passive: !0 }), this.startRegisteredTransform();
2755
2952
  }
2756
2953
  };
2757
2954
  onWindowTouchMove = (e) => {
2758
- let t = W(e);
2955
+ let t = G(e);
2759
2956
  if (!t.touches.every((e) => this.pointInsideVerifier.verify(e[0], e[1]))) {
2760
2957
  this.stopTouchDrag();
2761
2958
  return;
@@ -2771,7 +2968,7 @@ var ne = (e, t) => {
2771
2968
  this.prevTouches = t;
2772
2969
  };
2773
2970
  onWindowTouchFinish = (e) => {
2774
- e.touches.length > 0 ? this.prevTouches = W(e) : this.stopTouchDrag();
2971
+ e.touches.length > 0 ? this.prevTouches = G(e) : this.stopTouchDrag();
2775
2972
  };
2776
2973
  preventWheelScaleListener = (e) => {
2777
2974
  e.preventDefault();
@@ -2785,7 +2982,7 @@ var ne = (e, t) => {
2785
2982
  new e(t, n, r, i, a, o);
2786
2983
  }
2787
2984
  moveViewport(e, t) {
2788
- let n = this.viewport.getViewportMatrix(), r = Je(n, e, t), { width: i, height: a } = this.viewport.getDimensions(), o = this.params.transformPreprocessor({
2985
+ let n = this.viewport.getViewportMatrix(), r = tt(n, e, t), { width: i, height: a } = this.viewport.getDimensions(), o = this.params.transformPreprocessor({
2789
2986
  prevTransform: n,
2790
2987
  nextTransform: r,
2791
2988
  canvasWidth: i,
@@ -2794,7 +2991,7 @@ var ne = (e, t) => {
2794
2991
  this.performTransform(o);
2795
2992
  }
2796
2993
  scaleViewport(e, t, n) {
2797
- let r = this.canvas.viewport.getViewportMatrix(), i = Ye(r, e, t, n), { width: a, height: o } = this.viewport.getDimensions(), s = this.params.transformPreprocessor({
2994
+ let r = this.canvas.viewport.getViewportMatrix(), i = nt(r, e, t, n), { width: a, height: o } = this.viewport.getDimensions(), s = this.params.transformPreprocessor({
2798
2995
  prevTransform: r,
2799
2996
  nextTransform: i,
2800
2997
  canvasWidth: a,
@@ -2803,7 +3000,7 @@ var ne = (e, t) => {
2803
3000
  this.performTransform(s);
2804
3001
  }
2805
3002
  stopMouseDrag() {
2806
- w(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
3003
+ C(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
2807
3004
  }
2808
3005
  removeMouseDragListeners() {
2809
3006
  this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
@@ -2832,7 +3029,7 @@ var ne = (e, t) => {
2832
3029
  });
2833
3030
  this.params.onResizeTransformStarted(), this.canvas.patchViewportMatrix(r), this.params.onResizeTransformFinished();
2834
3031
  }
2835
- }, it = class e {
3032
+ }, ft = class e {
2836
3033
  canvas;
2837
3034
  element;
2838
3035
  window;
@@ -2885,7 +3082,7 @@ var ne = (e, t) => {
2885
3082
  this.scheduleLoadAreaAroundViewport(), r.onTransformFinished();
2886
3083
  }
2887
3084
  };
2888
- rt.configure(e, this.element, this.window, this.pointInsideVerifier, o, c), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
3085
+ dt.configure(e, this.element, this.window, this.pointInsideVerifier, o, c), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
2889
3086
  }
2890
3087
  static configure(t, n, r, i, a, o, s, c) {
2891
3088
  new e(t, n, r, i, a, o, s, c);
@@ -2910,21 +3107,21 @@ var ne = (e, t) => {
2910
3107
  height: u
2911
3108
  });
2912
3109
  }
2913
- }, at = () => {
3110
+ }, pt = () => {
2914
3111
  let e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
2915
3112
  return e.style.position = "absolute", e.style.inset = "0", e;
2916
- }, ot = () => {
3113
+ }, mt = () => {
2917
3114
  let e = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2918
3115
  return e.setAttribute("fill", "url(#pattern)"), e;
2919
- }, st = () => {
3116
+ }, ht = () => {
2920
3117
  let e = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
2921
3118
  return e.setAttribute("id", "pattern"), e;
2922
- }, ct = class e {
3119
+ }, gt = class e {
2923
3120
  canvas;
2924
3121
  backgroundHost;
2925
- svg = at();
2926
- patternRenderingRectangle = ot();
2927
- pattern = st();
3122
+ svg = pt();
3123
+ patternRenderingRectangle = mt();
3124
+ pattern = ht();
2928
3125
  patternContent;
2929
3126
  tileWidth;
2930
3127
  tileHeight;
@@ -2959,7 +3156,7 @@ var ne = (e, t) => {
2959
3156
  this.pattern.setAttribute("width", `${n}`), this.pattern.setAttribute("height", `${r}`);
2960
3157
  }
2961
3158
  }
2962
- }, lt = class e {
3159
+ }, _t = class e {
2963
3160
  canvas;
2964
3161
  overlayLayer;
2965
3162
  viewportStore;
@@ -2973,7 +3170,7 @@ var ne = (e, t) => {
2973
3170
  this.params.onAfterEdgeCreated(e);
2974
3171
  };
2975
3172
  constructor(e, t, n, r, i, a, o) {
2976
- this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = Ze(this.overlayLayer, this.viewportStore, this.window);
3173
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = it(this.overlayLayer, this.viewportStore, this.window);
2977
3174
  let s = {
2978
3175
  mouseDownEventVerifier: this.params.mouseDownEventVerifier,
2979
3176
  mouseUpEventVerifier: this.params.mouseUpEventVerifier,
@@ -2992,7 +3189,7 @@ var ne = (e, t) => {
2992
3189
  this.resetDragState(), this.params.onEdgeCreationInterrupted(e);
2993
3190
  }
2994
3191
  };
2995
- Qe.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3192
+ at.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
2996
3193
  }
2997
3194
  static configure(t, n, r, i, a, o, s) {
2998
3195
  new e(t, n, r, i, a, o, s);
@@ -3005,7 +3202,7 @@ var ne = (e, t) => {
3005
3202
  x: t.x - s.x,
3006
3203
  y: t.y - s.y
3007
3204
  }), u = {
3008
- overlayNodeId: E.StaticNodeId,
3205
+ overlayNodeId: T.StaticNodeId,
3009
3206
  portCoords: c,
3010
3207
  portDirection: r.direction
3011
3208
  }, d = n === "direct";
@@ -3017,26 +3214,26 @@ var ne = (e, t) => {
3017
3214
  cursor: t,
3018
3215
  ...this.edgeInProgress
3019
3216
  }), p = {
3020
- overlayNodeId: E.DraggingNodeId,
3217
+ overlayNodeId: T.DraggingNodeId,
3021
3218
  portCoords: l,
3022
3219
  portDirection: f ?? r.direction
3023
3220
  }, [m, h] = d ? [u, p] : [p, u];
3024
- this.overlayCanvas.addNode(T(m)), this.overlayCanvas.addNode(T(h)), this.overlayCanvas.addEdge({
3221
+ this.overlayCanvas.addNode(w(m)), this.overlayCanvas.addNode(w(h)), this.overlayCanvas.addEdge({
3025
3222
  from: m.overlayNodeId,
3026
3223
  to: h.overlayNodeId,
3027
- shape: this.params.edgeShapeFactory(E.EdgeId)
3224
+ shape: this.params.edgeShapeFactory(T.EdgeId)
3028
3225
  });
3029
3226
  }
3030
3227
  resetDragState() {
3031
3228
  this.edgeInProgress = null, this.overlayCanvas.clear();
3032
3229
  }
3033
3230
  tryCreateConnection(e) {
3034
- let t = ne(this.canvas.graph, e);
3231
+ let t = re(this.canvas.graph, e);
3035
3232
  if (t === null) {
3036
3233
  this.params.onEdgeCreationInterrupted(this.edgeInProgress);
3037
3234
  return;
3038
3235
  }
3039
- let n = U(this.edgeInProgress, t), r = this.params.connectionAllowedVerifier(n), i = this.params.connectionPreprocessor({
3236
+ let n = st(this.edgeInProgress, t), r = this.params.connectionAllowedVerifier(n), i = this.params.connectionPreprocessor({
3040
3237
  from: n.from,
3041
3238
  to: n.to
3042
3239
  });
@@ -3050,12 +3247,12 @@ var ne = (e, t) => {
3050
3247
  cursor: e,
3051
3248
  ...this.edgeInProgress
3052
3249
  });
3053
- this.overlayCanvas.updateNode(E.DraggingNodeId, {
3250
+ this.overlayCanvas.updateNode(T.DraggingNodeId, {
3054
3251
  x: n.x,
3055
3252
  y: n.y
3056
- }).updatePort(E.DraggingNodeId, { direction: r });
3253
+ }).updatePort(T.DraggingNodeId, { direction: r });
3057
3254
  }
3058
- }, ut = class e {
3255
+ }, vt = class e {
3059
3256
  canvas;
3060
3257
  overlayLayer;
3061
3258
  viewportStore;
@@ -3070,7 +3267,7 @@ var ne = (e, t) => {
3070
3267
  this.params.onAfterEdgeReattached(e);
3071
3268
  };
3072
3269
  constructor(e, t, n, r, i, a, o) {
3073
- this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = Ze(this.overlayLayer, this.viewportStore, this.window);
3270
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = it(this.overlayLayer, this.viewportStore, this.window);
3074
3271
  let s = {
3075
3272
  mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3076
3273
  mouseUpEventVerifier: this.params.mouseUpEventVerifier,
@@ -3092,7 +3289,7 @@ var ne = (e, t) => {
3092
3289
  });
3093
3290
  }
3094
3291
  };
3095
- Qe.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3292
+ at.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3096
3293
  }
3097
3294
  static configure(t, n, r, i, a, o, s) {
3098
3295
  new e(t, n, r, i, a, o, s);
@@ -3123,21 +3320,21 @@ var ne = (e, t) => {
3123
3320
  priority: r.priority
3124
3321
  }, this.canvas.removeEdge(n);
3125
3322
  let m = {
3126
- overlayNodeId: E.StaticNodeId,
3323
+ overlayNodeId: T.StaticNodeId,
3127
3324
  portCoords: f,
3128
3325
  portDirection: c.direction
3129
3326
  }, h = this.params.draggingPortDirectionResolver.resolve({
3130
3327
  cursor: t,
3131
3328
  ...this.edgeInProgress
3132
3329
  }), g = {
3133
- overlayNodeId: E.DraggingNodeId,
3330
+ overlayNodeId: T.DraggingNodeId,
3134
3331
  portCoords: p,
3135
3332
  portDirection: h ?? s.direction
3136
3333
  }, [_, v] = a ? [m, g] : [g, m];
3137
- this.overlayCanvas.addNode(T(_)), this.overlayCanvas.addNode(T(v));
3138
- let y = this.params.draggingEdgeShapeFactory === null ? r.shape : this.params.draggingEdgeShapeFactory(E.EdgeId);
3334
+ this.overlayCanvas.addNode(w(_)), this.overlayCanvas.addNode(w(v));
3335
+ let y = this.params.draggingEdgeShapeFactory === null ? r.shape : this.params.draggingEdgeShapeFactory(T.EdgeId);
3139
3336
  return this.overlayCanvas.addEdge({
3140
- id: E.EdgeId,
3337
+ id: T.EdgeId,
3141
3338
  from: _.overlayNodeId,
3142
3339
  to: v.overlayNodeId,
3143
3340
  shape: y
@@ -3154,14 +3351,14 @@ var ne = (e, t) => {
3154
3351
  cursor: e,
3155
3352
  ...this.edgeInProgress
3156
3353
  });
3157
- this.overlayCanvas.updateNode(E.DraggingNodeId, {
3354
+ this.overlayCanvas.updateNode(T.DraggingNodeId, {
3158
3355
  x: r.x,
3159
3356
  y: r.y
3160
- }).updatePort(E.DraggingNodeId, { direction: i });
3357
+ }).updatePort(T.DraggingNodeId, { direction: i });
3161
3358
  }
3162
3359
  tryCreateConnection(e) {
3163
- let t = ne(this.canvas.graph, e);
3164
- if (this.overlayCanvas.removeEdge(E.EdgeId), t === null) {
3360
+ let t = re(this.canvas.graph, e);
3361
+ if (this.overlayCanvas.removeEdge(T.EdgeId), t === null) {
3165
3362
  let e = this.draggingEdgePayload;
3166
3363
  this.params.onEdgeReattachInterrupted({
3167
3364
  id: e.id,
@@ -3172,7 +3369,7 @@ var ne = (e, t) => {
3172
3369
  });
3173
3370
  return;
3174
3371
  }
3175
- let { from: n, to: r } = U(this.edgeInProgress, t), i = this.draggingEdgePayload, a = {
3372
+ let { from: n, to: r } = st(this.edgeInProgress, t), i = this.draggingEdgePayload, a = {
3176
3373
  id: i.id,
3177
3374
  from: n,
3178
3375
  to: r,
@@ -3194,7 +3391,7 @@ var ne = (e, t) => {
3194
3391
  });
3195
3392
  }
3196
3393
  }
3197
- }, dt = class e {
3394
+ }, yt = class e {
3198
3395
  applier;
3199
3396
  trigger;
3200
3397
  constructor(e, t) {
@@ -3205,7 +3402,7 @@ var ne = (e, t) => {
3205
3402
  static configure(t, n) {
3206
3403
  new e(t, n);
3207
3404
  }
3208
- }, ft = class e {
3405
+ }, bt = class e {
3209
3406
  graph;
3210
3407
  applier;
3211
3408
  defererFn;
@@ -3230,7 +3427,7 @@ var ne = (e, t) => {
3230
3427
  scheduleApply() {
3231
3428
  this.applyScheduled || (this.applyScheduled = !0, this.defererFn(this.apply));
3232
3429
  }
3233
- }, pt = class {
3430
+ }, xt = class {
3234
3431
  canvas;
3235
3432
  layoutAlgorithm;
3236
3433
  params;
@@ -3246,23 +3443,23 @@ var ne = (e, t) => {
3246
3443
  this.params.staticNodeResolver(t) || this.canvas.updateNode(t, e);
3247
3444
  }), this.params.onAfterApplied();
3248
3445
  }
3249
- }, mt = class {
3446
+ }, St = class {
3250
3447
  static configure(e, t) {
3251
- let n = t.applyOn, r = new pt(e, t.algorithm, {
3448
+ let n = t.applyOn, r = new xt(e, t.algorithm, {
3252
3449
  staticNodeResolver: t.staticNodeResolver,
3253
3450
  onBeforeApplied: t.onBeforeApplied,
3254
3451
  onAfterApplied: t.onAfterApplied
3255
3452
  });
3256
3453
  switch (n.type) {
3257
3454
  case "trigger":
3258
- dt.configure(r, n.trigger);
3455
+ yt.configure(r, n.trigger);
3259
3456
  break;
3260
3457
  case "topologyChangeSchedule":
3261
- ft.configure(e.graph, r, n.schedule);
3458
+ bt.configure(e.graph, r, n.schedule);
3262
3459
  break;
3263
3460
  }
3264
3461
  }
3265
- }, ht = class {
3462
+ }, Ct = class {
3266
3463
  win;
3267
3464
  callback;
3268
3465
  previousTimeStamp = void 0;
@@ -3277,7 +3474,7 @@ var ne = (e, t) => {
3277
3474
  constructor(e, t) {
3278
3475
  this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
3279
3476
  }
3280
- }, gt = class {
3477
+ }, wt = class {
3281
3478
  canvas;
3282
3479
  layoutAlgorithm;
3283
3480
  params;
@@ -3294,30 +3491,30 @@ var ne = (e, t) => {
3294
3491
  this.params.staticNodeResolver(t) || this.canvas.updateNode(t, e);
3295
3492
  }), this.params.onAfterApplied();
3296
3493
  }
3297
- }, _t = class e {
3494
+ }, Tt = class e {
3298
3495
  win;
3299
3496
  applier;
3300
3497
  step = (e) => {
3301
3498
  this.applier.apply(e);
3302
3499
  };
3303
3500
  constructor(e, t, n) {
3304
- this.win = n, this.applier = new gt(e, t.algorithm, {
3501
+ this.win = n, this.applier = new wt(e, t.algorithm, {
3305
3502
  staticNodeResolver: t.staticNodeResolver,
3306
3503
  onBeforeApplied: t.onBeforeApplied,
3307
3504
  onAfterApplied: t.onAfterApplied
3308
- }), new ht(this.win, this.step);
3505
+ }), new Ct(this.win, this.step);
3309
3506
  }
3310
3507
  static configure(t, n, r) {
3311
3508
  new e(t, n, r);
3312
3509
  }
3313
- }, vt = class e {
3510
+ }, Et = class e {
3314
3511
  canvas;
3315
3512
  window;
3316
3513
  pointInsideVerifier;
3317
3514
  eventTagger;
3318
3515
  configurator;
3319
3516
  onNodeSelected;
3320
- eventHandledTag = V;
3517
+ eventHandledTag = U;
3321
3518
  onAfterNodeAdded = (e) => {
3322
3519
  let { element: t } = this.canvas.graph.getNode(e);
3323
3520
  this.configurator.enable(t);
@@ -3333,7 +3530,7 @@ var ne = (e, t) => {
3333
3530
  });
3334
3531
  };
3335
3532
  constructor(e, t, n, r, i) {
3336
- this.canvas = e, this.window = t, this.pointInsideVerifier = n, this.eventTagger = r, this.onNodeSelected = i.onNodeSelected, this.configurator = new H(this.window, this.pointInsideVerifier, {
3533
+ this.canvas = e, this.window = t, this.pointInsideVerifier = n, this.eventTagger = r, this.onNodeSelected = i.onNodeSelected, this.configurator = new W(this.window, this.pointInsideVerifier, {
3337
3534
  onSelected: (e, t) => {
3338
3535
  let n = this.canvas.graph.findNodeIdByElement(e);
3339
3536
  this.eventTagger.tag(t, this.eventHandledTag), this.onNodeSelected(n);
@@ -3346,13 +3543,13 @@ var ne = (e, t) => {
3346
3543
  static configure(t, n, r, i, a) {
3347
3544
  new e(t, n, r, i, a);
3348
3545
  }
3349
- }, yt = class e {
3546
+ }, Dt = class e {
3350
3547
  canvas;
3351
3548
  window;
3352
3549
  pointInsideVerifier;
3353
3550
  eventTagger;
3354
3551
  configurator;
3355
- eventHandledTag = V;
3552
+ eventHandledTag = U;
3356
3553
  onEdgeSelected;
3357
3554
  onAfterEdgeAdded = (e) => {
3358
3555
  let { shape: t } = this.canvas.graph.getEdge(e);
@@ -3369,7 +3566,7 @@ var ne = (e, t) => {
3369
3566
  });
3370
3567
  };
3371
3568
  constructor(e, t, n, r, i) {
3372
- this.canvas = e, this.window = t, this.pointInsideVerifier = n, this.eventTagger = r, this.onEdgeSelected = i.onEdgeSelected, this.configurator = new H(this.window, this.pointInsideVerifier, {
3569
+ this.canvas = e, this.window = t, this.pointInsideVerifier = n, this.eventTagger = r, this.onEdgeSelected = i.onEdgeSelected, this.configurator = new W(this.window, this.pointInsideVerifier, {
3373
3570
  onSelected: (e, t) => {
3374
3571
  let n = this.canvas.graph.findEdgeIdByElement(e);
3375
3572
  this.eventTagger.tag(t, this.eventHandledTag), this.onEdgeSelected(n);
@@ -3382,7 +3579,7 @@ var ne = (e, t) => {
3382
3579
  static configure(t, n, r, i, a) {
3383
3580
  new e(t, n, r, i, a);
3384
3581
  }
3385
- }, bt = class e {
3582
+ }, Ot = class e {
3386
3583
  canvas;
3387
3584
  element;
3388
3585
  window;
@@ -3390,9 +3587,9 @@ var ne = (e, t) => {
3390
3587
  eventTagger;
3391
3588
  configurator;
3392
3589
  onCanvasSelected;
3393
- eventHandledTag = V;
3590
+ eventHandledTag = U;
3394
3591
  constructor(e, t, n, r, i, a) {
3395
- this.canvas = e, this.element = t, this.window = n, this.pointInsideVerifier = r, this.eventTagger = i, this.onCanvasSelected = a.onCanvasSelected, this.configurator = new H(this.window, this.pointInsideVerifier, {
3592
+ this.canvas = e, this.element = t, this.window = n, this.pointInsideVerifier = r, this.eventTagger = i, this.onCanvasSelected = a.onCanvasSelected, this.configurator = new W(this.window, this.pointInsideVerifier, {
3396
3593
  onSelected: (e, t) => {
3397
3594
  this.eventTagger.has(t, this.eventHandledTag) || this.onCanvasSelected();
3398
3595
  },
@@ -3406,22 +3603,22 @@ var ne = (e, t) => {
3406
3603
  static configure(t, n, r, i, a, o) {
3407
3604
  new e(t, n, r, i, a, o);
3408
3605
  }
3409
- }, xt = () => {
3606
+ }, kt = () => {
3410
3607
  let e = document.createElement("div");
3411
3608
  return e.style.width = "100%", e.style.height = "100%", e.style.position = "relative", e;
3412
- }, G = () => {
3609
+ }, At = () => {
3413
3610
  let e = document.createElement("div");
3414
3611
  return e.style.position = "absolute", e.style.inset = "0", e;
3415
- }, St = () => {
3416
- let e = G();
3612
+ }, jt = () => {
3613
+ let e = At();
3417
3614
  return e.style.pointerEvents = "none", e;
3418
- }, Ct = class {
3615
+ }, Mt = class {
3419
3616
  element;
3420
- background = G();
3421
- main = G();
3422
- overlayConnectablePorts = St();
3423
- overlayDraggableEdges = St();
3424
- host = xt();
3617
+ background = At();
3618
+ main = At();
3619
+ overlayConnectablePorts = jt();
3620
+ overlayDraggableEdges = jt();
3621
+ host = kt();
3425
3622
  constructor(e) {
3426
3623
  this.element = e, this.element.appendChild(this.host), this.host.appendChild(this.background), this.host.appendChild(this.main), this.host.appendChild(this.overlayConnectablePorts), this.host.appendChild(this.overlayDraggableEdges);
3427
3624
  }
@@ -3446,10 +3643,10 @@ var ne = (e, t) => {
3446
3643
  mouseDownEventVerifier: (e) => e.button === 0,
3447
3644
  mouseUpEventVerifier: (e) => e.button === 0,
3448
3645
  movementThreshold: 10
3449
- }), J = () => {}, wt = (e, t, n) => e === "closest-connectable-port" || e === "nearest-connectable-port" ? new et(t, n) : new tt(e), Y = (e) => {
3646
+ }), J = () => {}, Nt = (e, t, n) => e === "closest-connectable-port" || e === "nearest-connectable-port" ? new ct(t, n) : new lt(e), Y = (e) => {
3450
3647
  if (typeof e == "function") return e;
3451
3648
  switch (e.type) {
3452
- case "straight": return () => new ke({
3649
+ case "straight": return () => new Pe({
3453
3650
  color: e.color,
3454
3651
  width: e.width,
3455
3652
  arrowLength: e.arrowLength,
@@ -3462,7 +3659,19 @@ var ne = (e, t) => {
3462
3659
  detourDistance: e.detourDistance,
3463
3660
  detourDirection: e.detourDirection
3464
3661
  });
3465
- case "horizontal": return () => new Oe({
3662
+ case "horizontal": return () => new Ne({
3663
+ color: e.color,
3664
+ width: e.width,
3665
+ arrowLength: e.arrowLength,
3666
+ arrowOffset: e.arrowOffset,
3667
+ arrowRenderer: e.arrowRenderer,
3668
+ hasSourceArrow: e.hasSourceArrow,
3669
+ hasTargetArrow: e.hasTargetArrow,
3670
+ cycleSquareSide: e.cycleSquareSide,
3671
+ roundness: e.roundness,
3672
+ detourDistance: e.detourDistance
3673
+ });
3674
+ case "vertical": return () => new Le({
3466
3675
  color: e.color,
3467
3676
  width: e.width,
3468
3677
  arrowLength: e.arrowLength,
@@ -3474,7 +3683,7 @@ var ne = (e, t) => {
3474
3683
  roundness: e.roundness,
3475
3684
  detourDistance: e.detourDistance
3476
3685
  });
3477
- case "vertical": return () => new Me({
3686
+ case "orthogonal": return () => new ze({
3478
3687
  color: e.color,
3479
3688
  width: e.width,
3480
3689
  arrowLength: e.arrowLength,
@@ -3486,7 +3695,7 @@ var ne = (e, t) => {
3486
3695
  roundness: e.roundness,
3487
3696
  detourDistance: e.detourDistance
3488
3697
  });
3489
- case "direct": return () => new I({
3698
+ case "direct": return () => new R({
3490
3699
  color: e.color,
3491
3700
  width: e.width,
3492
3701
  arrowLength: e.arrowLength,
@@ -3496,7 +3705,7 @@ var ne = (e, t) => {
3496
3705
  sourceOffset: e.sourceOffset,
3497
3706
  targetOffset: e.targetOffset
3498
3707
  });
3499
- default: return () => new Ee({
3708
+ default: return () => new je({
3500
3709
  color: e.color,
3501
3710
  width: e.width,
3502
3711
  arrowLength: e.arrowLength,
@@ -3510,7 +3719,7 @@ var ne = (e, t) => {
3510
3719
  detourDirection: e.detourDirection
3511
3720
  });
3512
3721
  }
3513
- }, Tt = (e) => {
3722
+ }, Pt = (e) => {
3514
3723
  let t = e.nodeDragVerifier ?? (() => !0), n = e.moveOnTop !== !1, r = e.moveEdgesOnTop !== !1 && n, i = e.mouse?.dragCursor, a = i === void 0 ? "grab" : i, o = e.mouse?.mouseDownEventVerifier, s = o === void 0 ? (e) => e.button === 0 : o, c = e.mouse?.mouseUpEventVerifier, l = c === void 0 ? (e) => e.button === 0 : c;
3515
3724
  return {
3516
3725
  moveOnTop: n,
@@ -3524,7 +3733,7 @@ var ne = (e, t) => {
3524
3733
  nodeDragVerifier: t,
3525
3734
  onNodeDragFinished: e.events?.onNodeDragFinished ?? J
3526
3735
  };
3527
- }, Et = (e) => {
3736
+ }, Ft = (e) => {
3528
3737
  let t = e.minX === null ? -Infinity : e.minX, n = e.maxX === null ? Infinity : e.maxX, r = e.minY === null ? -Infinity : e.minY, i = e.maxY === null ? Infinity : e.maxY;
3529
3738
  return (e) => {
3530
3739
  let a = e.nextTransform.x, o = e.nextTransform.y;
@@ -3538,17 +3747,17 @@ var ne = (e, t) => {
3538
3747
  y: o
3539
3748
  };
3540
3749
  };
3541
- }, Dt = (e) => {
3750
+ }, It = (e) => {
3542
3751
  let t = e.maxContentScale, n = e.minContentScale, r = t === null ? 0 : 1 / t, i = n === null ? Infinity : 1 / n;
3543
3752
  return (e) => {
3544
3753
  let t = e.prevTransform, n = e.nextTransform, a = n.scale, o = n.x, s = n.y;
3545
3754
  if (n.scale > i && n.scale > t.scale) {
3546
- a = Math.max(t.scale, i), o = t.x, s = t.y;
3755
+ a = Math.max(t.scale, i);
3547
3756
  let e = (a - t.scale) / (n.scale - t.scale);
3548
3757
  o = t.x + (n.x - t.x) * e, s = t.y + (n.y - t.y) * e;
3549
3758
  }
3550
3759
  if (n.scale < r && n.scale < t.scale) {
3551
- a = Math.min(t.scale, r), o = t.x, s = t.y;
3760
+ a = Math.min(t.scale, r);
3552
3761
  let e = (a - t.scale) / (n.scale - t.scale);
3553
3762
  o = t.x + (n.x - t.x) * e, s = t.y + (n.y - t.y) * e;
3554
3763
  }
@@ -3558,28 +3767,28 @@ var ne = (e, t) => {
3558
3767
  y: s
3559
3768
  };
3560
3769
  };
3561
- }, Ot = (e) => (t) => e.reduce((e, n) => n({
3770
+ }, Lt = (e) => (t) => e.reduce((e, n) => n({
3562
3771
  prevTransform: t.prevTransform,
3563
3772
  nextTransform: e,
3564
3773
  canvasWidth: t.canvasWidth,
3565
3774
  canvasHeight: t.canvasHeight
3566
- }), t.nextTransform), kt = (e) => {
3775
+ }), t.nextTransform), Rt = (e) => {
3567
3776
  if (typeof e == "function") return e;
3568
3777
  switch (e.type) {
3569
- case "scale-limit": return Dt({
3778
+ case "scale-limit": return It({
3570
3779
  minContentScale: e.minContentScale ?? 0,
3571
3780
  maxContentScale: e.maxContentScale ?? Infinity
3572
3781
  });
3573
- case "shift-limit": return Et({
3782
+ case "shift-limit": return Ft({
3574
3783
  minX: e.minX ?? -Infinity,
3575
3784
  maxX: e.maxX ?? Infinity,
3576
3785
  minY: e.minY ?? -Infinity,
3577
3786
  maxY: e.maxY ?? Infinity
3578
3787
  });
3579
3788
  }
3580
- }, At = (e) => {
3789
+ }, zt = (e) => {
3581
3790
  let t = e?.scale?.mouseWheelSensitivity, n = t === void 0 ? 1.2 : t, r = e?.transformPreprocessor, i;
3582
- i = r === void 0 ? (e) => e.nextTransform : Array.isArray(r) ? Ot(r.map((e) => kt(e))) : kt(r);
3791
+ i = r === void 0 ? (e) => e.nextTransform : Array.isArray(r) ? Lt(r.map((e) => Rt(e))) : Rt(r);
3583
3792
  let a = e?.shift?.cursor === void 0 ? "grab" : e.shift.cursor, o = e?.shift?.mouseDownEventVerifier, s = o === void 0 ? (e) => e.button === 0 : o, c = e?.shift?.mouseUpEventVerifier, l = c === void 0 ? (e) => e.button === 0 : c, u = e?.scale?.mouseWheelEventVerifier, d = u === void 0 ? () => !0 : u;
3584
3793
  return {
3585
3794
  wheelSensitivity: n,
@@ -3596,15 +3805,15 @@ var ne = (e, t) => {
3596
3805
  onResizeTransformStarted: e?.events?.onResizeTransformStarted ?? J,
3597
3806
  onResizeTransformFinished: e?.events?.onResizeTransformFinished ?? J
3598
3807
  };
3599
- }, jt = (e, t) => {
3808
+ }, Bt = (e, t) => {
3600
3809
  let n = document.createElementNS("http://www.w3.org/2000/svg", "circle");
3601
3810
  return n.setAttribute("cx", "0"), n.setAttribute("cy", "0"), n.setAttribute("r", `${e}`), n.setAttribute("fill", `${t}`), n;
3602
- }, Mt = (e) => e instanceof SVGElement ? e : jt(e?.radius ?? 1.5, e?.color ?? "#d8d8d8"), Nt = (e) => {
3811
+ }, Vt = (e) => e instanceof SVGElement ? e : Bt(e?.radius ?? 1.5, e?.color ?? "#d8d8d8"), Ht = (e) => {
3603
3812
  let t = e.tileDimensions;
3604
3813
  return {
3605
3814
  tileWidth: t?.width ?? 25,
3606
3815
  tileHeight: t?.height ?? 25,
3607
- renderer: Mt(e.renderer ?? {}),
3816
+ renderer: Vt(e.renderer ?? {}),
3608
3817
  maxViewportScale: e.maxViewportScale ?? 10
3609
3818
  };
3610
3819
  }, X = Object.freeze({
@@ -3612,12 +3821,12 @@ var ne = (e, t) => {
3612
3821
  connectionPreprocessor: (e) => e,
3613
3822
  connectionAllowedVerifier: () => !0,
3614
3823
  mouseEventVerifier: (e) => e.button === 0
3615
- }), Pt = (e, t, n) => {
3824
+ }), Ut = (e, t, n) => {
3616
3825
  let r = e.connectionAllowedVerifier ?? X.connectionAllowedVerifier;
3617
3826
  return {
3618
3827
  connectionTypeResolver: e.connectionTypeResolver ?? X.connectionTypeResolver,
3619
3828
  connectionAllowedVerifier: r,
3620
- draggingPortDirectionResolver: wt(e.dragPortDirection, n, r),
3829
+ draggingPortDirectionResolver: Nt(e.dragPortDirection, n, r),
3621
3830
  edgeShapeFactory: e.edgeShape === void 0 ? t : Y(e.edgeShape),
3622
3831
  connectionPreprocessor: e.connectionPreprocessor ?? X.connectionPreprocessor,
3623
3832
  mouseDownEventVerifier: e.mouseDownEventVerifier ?? X.mouseEventVerifier,
@@ -3631,7 +3840,7 @@ var ne = (e, t) => {
3631
3840
  connectionPreprocessor: (e) => e,
3632
3841
  mouseDownEventVerifier: (e) => e.button === 0 && e.ctrlKey,
3633
3842
  mouseUpEventVerifier: (e) => e.button === 0
3634
- }), Ft = (e, t) => {
3843
+ }), Wt = (e, t) => {
3635
3844
  let n = (e) => {
3636
3845
  let n = t.getPortAdjacentEdgeIds(e);
3637
3846
  return n.length > 0 ? n[n.length - 1] : null;
@@ -3646,17 +3855,17 @@ var ne = (e, t) => {
3646
3855
  onAfterEdgeReattached: e.events?.onAfterEdgeReattached ?? J,
3647
3856
  onEdgeReattachInterrupted: e.events?.onEdgeReattachInterrupted ?? J,
3648
3857
  onEdgeReattachPrevented: e.events?.onEdgeReattachPrevented ?? J,
3649
- draggingPortDirectionResolver: wt(e.dragPortDirection, t, r)
3858
+ draggingPortDirectionResolver: Nt(e.dragPortDirection, t, r)
3650
3859
  };
3651
- }, It = (e) => ({
3860
+ }, Gt = (e) => ({
3652
3861
  nodeVerticalRadius: e.nodeContainingRadius.vertical,
3653
3862
  nodeHorizontalRadius: e.nodeContainingRadius.horizontal
3654
- }), Lt = (e) => ({
3863
+ }), Kt = (e) => ({
3655
3864
  onAfterNodeDetached: e?.events?.onAfterNodeDetached ?? J,
3656
3865
  onBeforeNodeAttached: e?.events?.onBeforeNodeAttached ?? J
3657
- }), Rt = class extends Error {
3866
+ }), qt = class extends Error {
3658
3867
  name = "CanvasBuilderError";
3659
- }, zt = class {
3868
+ }, Jt = class {
3660
3869
  graph;
3661
3870
  currentCoords;
3662
3871
  dt;
@@ -3691,7 +3900,7 @@ var ne = (e, t) => {
3691
3900
  d.x += l, d.y += u, f.x -= l, f.y -= u;
3692
3901
  });
3693
3902
  }
3694
- }, Bt = class {
3903
+ }, Yt = class {
3695
3904
  rand;
3696
3905
  PI2 = 2 * Math.PI;
3697
3906
  constructor(e) {
@@ -3714,11 +3923,11 @@ var ne = (e, t) => {
3714
3923
  d: a
3715
3924
  };
3716
3925
  }
3717
- }, Vt = (e) => {
3926
+ }, Xt = (e) => {
3718
3927
  if (e.distance === 0) return e.maxForce;
3719
3928
  let t = e.coefficient * (e.sourceCharge * e.targetCharge / (e.distance * e.distance));
3720
3929
  return Math.min(t, e.maxForce);
3721
- }, Ht = class {
3930
+ }, Zt = class {
3722
3931
  nodeCharge;
3723
3932
  distanceVectorGenerator;
3724
3933
  maxForce;
@@ -3730,7 +3939,7 @@ var ne = (e, t) => {
3730
3939
  for (let i = 0; i < r; i++) {
3731
3940
  let a = n[i];
3732
3941
  for (let o = i + 1; o < r; o++) {
3733
- let r = n[o], i = e.get(a), s = e.get(r), c = this.distanceVectorGenerator.create(i, s), l = Vt({
3942
+ let r = n[o], i = e.get(a), s = e.get(r), c = this.distanceVectorGenerator.create(i, s), l = Xt({
3734
3943
  coefficient: 1,
3735
3944
  sourceCharge: this.nodeCharge,
3736
3945
  targetCharge: this.nodeCharge,
@@ -3741,7 +3950,7 @@ var ne = (e, t) => {
3741
3950
  }
3742
3951
  }
3743
3952
  }
3744
- }, Ut = (e) => {
3953
+ }, Qt = (e) => {
3745
3954
  if (e.size === 0) return {
3746
3955
  centerX: 0,
3747
3956
  centerY: 0,
@@ -3757,7 +3966,7 @@ var ne = (e, t) => {
3757
3966
  centerY: (r + i) / 2,
3758
3967
  radius: s / 2
3759
3968
  };
3760
- }, Wt = class {
3969
+ }, $t = class {
3761
3970
  root;
3762
3971
  leaves = /* @__PURE__ */ new Map();
3763
3972
  coords;
@@ -3913,7 +4122,7 @@ var ne = (e, t) => {
3913
4122
  y: n / e.size
3914
4123
  };
3915
4124
  }
3916
- }, Gt = class {
4125
+ }, en = class {
3917
4126
  areaRadiusThreshold;
3918
4127
  nodeMass;
3919
4128
  nodeCharge;
@@ -3925,8 +4134,8 @@ var ne = (e, t) => {
3925
4134
  this.areaRadiusThreshold = e.areaRadiusThreshold, this.nodeMass = e.nodeMass, this.nodeCharge = e.nodeCharge, this.theta = e.theta, this.distanceVectorGenerator = e.distanceVectorGenerator, this.nodeForceCoefficient = e.nodeForceCoefficient, this.maxForce = e.maxForce;
3926
4135
  }
3927
4136
  apply(e, t) {
3928
- let n = new Wt({
3929
- box: Ut(e),
4137
+ let n = new $t({
4138
+ box: Qt(e),
3930
4139
  coords: e,
3931
4140
  areaRadiusThreshold: this.areaRadiusThreshold,
3932
4141
  nodeMass: this.nodeMass,
@@ -4036,7 +4245,7 @@ var ne = (e, t) => {
4036
4245
  });
4037
4246
  }
4038
4247
  calculateNodeRepulsiveForce(e) {
4039
- let t = this.distanceVectorGenerator.create(e.sourceCoords, e.targetCoords), n = Vt({
4248
+ let t = this.distanceVectorGenerator.create(e.sourceCoords, e.targetCoords), n = Xt({
4040
4249
  coefficient: this.nodeForceCoefficient,
4041
4250
  sourceCharge: e.sourceCharge,
4042
4251
  targetCharge: e.targetCharge,
@@ -4063,12 +4272,12 @@ var ne = (e, t) => {
4063
4272
  this.applyForce(e.totalForce, t);
4064
4273
  }
4065
4274
  }
4066
- }, Kt = (e) => e.theta === 0 ? new Ht({
4275
+ }, tn = (e) => e.theta === 0 ? new Zt({
4067
4276
  nodeCharge: e.nodeCharge,
4068
4277
  nodeForceCoefficient: e.nodeForceCoefficient,
4069
4278
  distanceVectorGenerator: e.distanceVectorGenerator,
4070
4279
  maxForce: e.maxForce
4071
- }) : new Gt({
4280
+ }) : new en({
4072
4281
  nodeCharge: e.nodeCharge,
4073
4282
  nodeForceCoefficient: e.nodeForceCoefficient,
4074
4283
  distanceVectorGenerator: e.distanceVectorGenerator,
@@ -4076,7 +4285,7 @@ var ne = (e, t) => {
4076
4285
  theta: e.theta,
4077
4286
  nodeMass: e.nodeMass,
4078
4287
  areaRadiusThreshold: e.areaRadiusThreshold
4079
- }), qt = class {
4288
+ }), nn = class {
4080
4289
  rand;
4081
4290
  sparsity;
4082
4291
  constructor(e) {
@@ -4101,7 +4310,7 @@ var ne = (e, t) => {
4101
4310
  });
4102
4311
  }), r;
4103
4312
  }
4104
- }, Jt = class {
4313
+ }, rn = class {
4105
4314
  distanceVectorGenerator;
4106
4315
  nodeForcesApplicationStrategy;
4107
4316
  fillerLayoutAlgorithm;
@@ -4112,7 +4321,7 @@ var ne = (e, t) => {
4112
4321
  edgeStiffness;
4113
4322
  convergenceVelocity;
4114
4323
  constructor(e) {
4115
- this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new Bt(e.rand), this.nodeForcesApplicationStrategy = Kt({
4324
+ this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new Yt(e.rand), this.nodeForcesApplicationStrategy = tn({
4116
4325
  distanceVectorGenerator: this.distanceVectorGenerator,
4117
4326
  nodeCharge: e.nodeCharge,
4118
4327
  maxForce: e.maxForce,
@@ -4120,7 +4329,7 @@ var ne = (e, t) => {
4120
4329
  theta: e.barnesHutTheta,
4121
4330
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
4122
4331
  nodeMass: e.nodeMass
4123
- }), this.fillerLayoutAlgorithm = new qt({
4332
+ }), this.fillerLayoutAlgorithm = new nn({
4124
4333
  rand: e.rand,
4125
4334
  sparsity: e.edgeEquilibriumLength
4126
4335
  });
@@ -4130,7 +4339,7 @@ var ne = (e, t) => {
4130
4339
  graph: t,
4131
4340
  viewport: n
4132
4341
  });
4133
- for (let e = 0; e < this.maxIterations && !(new zt(t, r, {
4342
+ for (let e = 0; e < this.maxIterations && !(new Jt(t, r, {
4134
4343
  distanceVectorGenerator: this.distanceVectorGenerator,
4135
4344
  nodeForcesApplicationStrategy: this.nodeForcesApplicationStrategy,
4136
4345
  dtSec: this.dtSec,
@@ -4140,7 +4349,7 @@ var ne = (e, t) => {
4140
4349
  }).apply() < this.convergenceVelocity); e++);
4141
4350
  return r;
4142
4351
  }
4143
- }, Yt = class {
4352
+ }, an = class {
4144
4353
  graph;
4145
4354
  nextLayerNodesResolver;
4146
4355
  forest = /* @__PURE__ */ new Set();
@@ -4184,7 +4393,7 @@ var ne = (e, t) => {
4184
4393
  }), r = e;
4185
4394
  }
4186
4395
  }
4187
- }, Xt = class {
4396
+ }, on = class {
4188
4397
  params;
4189
4398
  constructor(e) {
4190
4399
  this.params = e;
@@ -4223,13 +4432,13 @@ var ne = (e, t) => {
4223
4432
  }
4224
4433
  return n - 2 * this.params.spaceAroundRadius;
4225
4434
  }
4226
- }, Zt = class {
4435
+ }, sn = class {
4227
4436
  tree;
4228
4437
  offsets = /* @__PURE__ */ new Map();
4229
4438
  treeSpans = /* @__PURE__ */ new Map();
4230
4439
  constructor(e, t) {
4231
4440
  this.tree = e;
4232
- let n = t.spaceAroundRadius, r = new Xt({ spaceAroundRadius: n });
4441
+ let n = t.spaceAroundRadius, r = new on({ spaceAroundRadius: n });
4233
4442
  [...this.tree.sequence].reverse().forEach((e) => {
4234
4443
  let t = Array.from(e.children).map((e) => this.treeSpans.get(e.nodeId)), i = r.generate(t), a = 0;
4235
4444
  e.children.forEach((e) => {
@@ -4245,19 +4454,19 @@ var ne = (e, t) => {
4245
4454
  generate() {
4246
4455
  return this.offsets;
4247
4456
  }
4248
- }, Qt = class {
4457
+ }, cn = class {
4249
4458
  params;
4250
4459
  constructor(e) {
4251
4460
  this.params = e;
4252
4461
  }
4253
4462
  calculateCoordinates(e) {
4254
- let t = /* @__PURE__ */ new Map(), n = new Yt(e.graph, this.params.nextLayerNodesResolver).generate(), r = 0;
4463
+ let t = /* @__PURE__ */ new Map(), n = new an(e.graph, this.params.nextLayerNodesResolver).generate(), r = 0;
4255
4464
  return n.forEach((e) => {
4256
4465
  t.set(e.root.nodeId, {
4257
4466
  x: r,
4258
4467
  y: 0
4259
4468
  });
4260
- let n = new Zt(e, { spaceAroundRadius: this.params.layerSpace / 2 }).generate(), i = [e.root];
4469
+ let n = new sn(e, { spaceAroundRadius: this.params.layerSpace / 2 }).generate(), i = [e.root];
4261
4470
  for (; i.length > 0;) {
4262
4471
  let e = [];
4263
4472
  r += this.params.layerWidth, i.forEach((i) => {
@@ -4274,7 +4483,7 @@ var ne = (e, t) => {
4274
4483
  t.set(n, this.params.transform(e));
4275
4484
  }), t;
4276
4485
  }
4277
- }, $t = (e) => {
4486
+ }, ln = (e) => {
4278
4487
  let { graph: t, currentNodeId: n } = e, r = t.getNodeOutgoingEdgeIds(n).map((e) => {
4279
4488
  let n = t.getEdge(e);
4280
4489
  return t.getPort(n.to).nodeId;
@@ -4283,19 +4492,19 @@ var ne = (e, t) => {
4283
4492
  return t.getPort(n.from).nodeId;
4284
4493
  });
4285
4494
  return /* @__PURE__ */ new Set([...r, ...i]);
4286
- }, en = (e) => {
4495
+ }, un = (e) => {
4287
4496
  let { graph: t, currentNodeId: n } = e, r = t.getNodeOutgoingEdgeIds(n).map((e) => {
4288
4497
  let n = t.getEdge(e);
4289
4498
  return t.getPort(n.to).nodeId;
4290
4499
  });
4291
4500
  return new Set(r);
4292
- }, tn = (e) => {
4501
+ }, dn = (e) => {
4293
4502
  let { graph: t, currentNodeId: n } = e, r = t.getNodeIncomingEdgeIds(n).map((e) => {
4294
4503
  let n = t.getEdge(e);
4295
4504
  return t.getPort(n.from).nodeId;
4296
4505
  });
4297
4506
  return new Set(r);
4298
- }, nn = class {
4507
+ }, fn = class {
4299
4508
  distanceVectorGenerator;
4300
4509
  nodeForcesApplicationStrategy;
4301
4510
  convergenceVelocity;
@@ -4305,7 +4514,7 @@ var ne = (e, t) => {
4305
4514
  edgeStiffness;
4306
4515
  fillerLayoutAlgorithm;
4307
4516
  constructor(e) {
4308
- this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new Bt(e.rand), this.nodeForcesApplicationStrategy = Kt({
4517
+ this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new Yt(e.rand), this.nodeForcesApplicationStrategy = tn({
4309
4518
  distanceVectorGenerator: this.distanceVectorGenerator,
4310
4519
  nodeCharge: e.nodeCharge,
4311
4520
  maxForce: e.maxForce,
@@ -4313,7 +4522,7 @@ var ne = (e, t) => {
4313
4522
  theta: e.barnesHutTheta,
4314
4523
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
4315
4524
  nodeMass: e.nodeMass
4316
- }), this.fillerLayoutAlgorithm = new qt({
4525
+ }), this.fillerLayoutAlgorithm = new nn({
4317
4526
  rand: e.rand,
4318
4527
  sparsity: e.edgeEquilibriumLength
4319
4528
  });
@@ -4323,7 +4532,7 @@ var ne = (e, t) => {
4323
4532
  graph: t,
4324
4533
  viewport: n
4325
4534
  });
4326
- return new zt(t, i, {
4535
+ return new Jt(t, i, {
4327
4536
  distanceVectorGenerator: this.distanceVectorGenerator,
4328
4537
  nodeForcesApplicationStrategy: this.nodeForcesApplicationStrategy,
4329
4538
  dtSec: Math.min(r, this.maxTimeDeltaSec),
@@ -4335,7 +4544,7 @@ var ne = (e, t) => {
4335
4544
  return n.x === null || n.y === null;
4336
4545
  }) ? /* @__PURE__ */ new Map() : i;
4337
4546
  }
4338
- }, rn = (e) => {
4547
+ }, pn = (e) => {
4339
4548
  let t = 1779033703, n = 3144134277, r = 1013904242, i = 2773480762;
4340
4549
  for (let a = 0, o; a < e.length; a++) o = e.charCodeAt(a), t = n ^ Math.imul(t ^ o, 597399067), n = r ^ Math.imul(n ^ o, 2869860233), r = i ^ Math.imul(r ^ o, 951274213), i = t ^ Math.imul(i ^ o, 2716044179);
4341
4550
  return t = Math.imul(r ^ t >>> 18, 597399067), n = Math.imul(i ^ n >>> 22, 2869860233), r = Math.imul(t ^ r >>> 17, 951274213), i = Math.imul(n ^ i >>> 19, 2716044179), t ^= n ^ r ^ i, n ^= t, r ^= t, i ^= t, [
@@ -4344,17 +4553,17 @@ var ne = (e, t) => {
4344
4553
  r >>> 0,
4345
4554
  i >>> 0
4346
4555
  ];
4347
- }, an = (e, t, n, r) => function() {
4556
+ }, mn = (e, t, n, r) => function() {
4348
4557
  e |= 0, t |= 0, n |= 0, r |= 0;
4349
4558
  let i = (e + t | 0) + r | 0;
4350
4559
  return r = r + 1 | 0, e = t ^ t >>> 9, t = n + (n << 3) | 0, n = n << 21 | n >>> 11, n = n + i | 0, (i >>> 0) / 4294967296;
4351
- }, on = (e) => {
4560
+ }, hn = (e) => {
4352
4561
  switch (e?.type) {
4353
4562
  case "custom": return e.instance;
4354
4563
  default: {
4355
- let t = rn(e?.seed ?? K.seed);
4356
- return new nn({
4357
- rand: an(t[0], t[1], t[2], t[3]),
4564
+ let t = pn(e?.seed ?? K.seed);
4565
+ return new fn({
4566
+ rand: mn(t[0], t[1], t[2], t[3]),
4358
4567
  maxTimeDeltaSec: e?.maxTimeDeltaSec ?? K.maxTimeDeltaSec,
4359
4568
  nodeCharge: e?.nodeCharge ?? K.nodeCharge,
4360
4569
  nodeMass: e?.nodeMass ?? K.nodeMass,
@@ -4368,37 +4577,37 @@ var ne = (e, t) => {
4368
4577
  });
4369
4578
  }
4370
4579
  }
4371
- }, sn = { staticNodeResolver: () => !1 }, cn = (e) => ({
4372
- algorithm: on(e?.algorithm ?? {}),
4373
- staticNodeResolver: e?.staticNodeResolver ?? sn.staticNodeResolver,
4580
+ }, gn = { staticNodeResolver: () => !1 }, _n = (e) => ({
4581
+ algorithm: hn(e?.algorithm ?? {}),
4582
+ staticNodeResolver: e?.staticNodeResolver ?? gn.staticNodeResolver,
4374
4583
  onBeforeApplied: e?.events?.onBeforeApplied ?? J,
4375
4584
  onAfterApplied: e?.events?.onAfterApplied ?? J
4376
- }), ln = (e) => e instanceof l ? {
4585
+ }), vn = (e) => e instanceof l ? {
4377
4586
  type: "trigger",
4378
4587
  trigger: e
4379
4588
  } : e === "topologyChangeMicrotask" ? {
4380
4589
  type: "topologyChangeSchedule",
4381
- schedule: Ge
4590
+ schedule: Qe
4382
4591
  } : e?.type === "topologyChangeMacrotask" ? {
4383
4592
  type: "topologyChangeSchedule",
4384
- schedule: We
4593
+ schedule: Ze
4385
4594
  } : {
4386
4595
  type: "topologyChangeSchedule",
4387
- schedule: Ge
4388
- }, Q = Object.freeze({
4596
+ schedule: Qe
4597
+ }, yn = Object.freeze({
4389
4598
  staticNodeResolver: () => !1,
4390
4599
  hierarchicalLayout: {
4391
4600
  layerWidth: 300,
4392
4601
  layerSpace: 300
4393
4602
  }
4394
- }), $ = (e, t) => ({
4603
+ }), Q = (e, t) => ({
4395
4604
  a: e.a * t.a + e.b * t.d,
4396
4605
  b: e.a * t.b + e.b * t.e,
4397
4606
  c: e.a * t.c + e.b * t.f + e.c,
4398
4607
  d: e.d * t.a + e.e * t.d,
4399
4608
  e: e.d * t.b + e.e * t.e,
4400
4609
  f: e.d * t.c + e.e * t.f + e.f
4401
- }), un = (e) => {
4610
+ }), bn = (e) => {
4402
4611
  let { a: t, b: n, c: r, d: i, e: a, f: o } = e, s = t * a - n * i;
4403
4612
  return {
4404
4613
  a: a / s,
@@ -4408,7 +4617,7 @@ var ne = (e, t) => {
4408
4617
  e: t / s,
4409
4618
  f: (r * i - t * o) / s
4410
4619
  };
4411
- }, dn = class {
4620
+ }, xn = class {
4412
4621
  resolve(e) {
4413
4622
  if ("shift" in e) return this.createShiftBaseMatrix(e.shift);
4414
4623
  if ("scale" in e) {
@@ -4450,11 +4659,11 @@ var ne = (e, t) => {
4450
4659
  return this.createRelativeTransform(n, r);
4451
4660
  }
4452
4661
  createMirrorRelativeMatrix(e, t) {
4453
- let n = this.createMirrorYBaseMatrix(), r = $(this.createShiftBaseMatrix(t), this.createRotateBaseMatrix(e));
4662
+ let n = this.createMirrorYBaseMatrix(), r = Q(this.createShiftBaseMatrix(t), this.createRotateBaseMatrix(e));
4454
4663
  return this.createRelativeTransform(n, r);
4455
4664
  }
4456
4665
  createRelativeTransform(e, t) {
4457
- return $($(t, e), un(t));
4666
+ return Q(Q(t, e), bn(t));
4458
4667
  }
4459
4668
  createShiftBaseMatrix(e) {
4460
4669
  return {
@@ -4497,7 +4706,7 @@ var ne = (e, t) => {
4497
4706
  f: 0
4498
4707
  };
4499
4708
  }
4500
- }, fn = (e) => {
4709
+ }, Sn = (e) => {
4501
4710
  if (e === void 0) return (e) => e;
4502
4711
  if (typeof e == "function") return e;
4503
4712
  let t = Array.isArray(e) ? e : [e], n = {
@@ -4507,10 +4716,10 @@ var ne = (e, t) => {
4507
4716
  d: 0,
4508
4717
  e: 1,
4509
4718
  f: 0
4510
- }, r = new dn();
4719
+ }, r = new xn();
4511
4720
  return t.forEach((e) => {
4512
4721
  let t = r.resolve(e);
4513
- n = $(n, t);
4722
+ n = Q(n, t);
4514
4723
  }), (e) => {
4515
4724
  let { x: t, y: r } = e;
4516
4725
  return {
@@ -4518,25 +4727,25 @@ var ne = (e, t) => {
4518
4727
  y: n.d * t + n.e * r + n.f
4519
4728
  };
4520
4729
  };
4521
- }, pn = (e) => {
4730
+ }, Cn = (e) => {
4522
4731
  if (typeof e == "function") return e;
4523
4732
  switch (e) {
4524
- case "outgoing": return en;
4525
- case "incoming": return tn;
4526
- default: return $t;
4733
+ case "outgoing": return un;
4734
+ case "incoming": return dn;
4735
+ default: return ln;
4527
4736
  }
4528
- }, mn = (e) => {
4737
+ }, wn = (e) => {
4529
4738
  switch (e?.type) {
4530
4739
  case "custom": return e.instance;
4531
- case "hierarchical": return new Qt({
4532
- layerWidth: e.layerWidth ?? Q.hierarchicalLayout.layerWidth,
4533
- layerSpace: e.layerSpace ?? Q.hierarchicalLayout.layerSpace,
4534
- transform: fn(e.transform),
4535
- nextLayerNodesResolver: pn(e.nextLayerNodesResolver)
4740
+ case "hierarchical": return new cn({
4741
+ layerWidth: e.layerWidth ?? yn.hierarchicalLayout.layerWidth,
4742
+ layerSpace: e.layerSpace ?? yn.hierarchicalLayout.layerSpace,
4743
+ transform: Sn(e.transform),
4744
+ nextLayerNodesResolver: Cn(e.nextLayerNodesResolver)
4536
4745
  });
4537
4746
  default: {
4538
- let t = rn(e?.seed ?? K.seed), n = an(t[0], t[1], t[2], t[3]);
4539
- return new Jt({
4747
+ let t = pn(e?.seed ?? K.seed), n = mn(t[0], t[1], t[2], t[3]);
4748
+ return new rn({
4540
4749
  dtSec: e?.dtSec ?? K.dtSec,
4541
4750
  maxIterations: e?.maxIterations ?? K.maxIterations,
4542
4751
  rand: n,
@@ -4552,13 +4761,13 @@ var ne = (e, t) => {
4552
4761
  });
4553
4762
  }
4554
4763
  }
4555
- }, hn = (e) => ({
4556
- algorithm: mn(e.algorithm),
4557
- applyOn: ln(e.applyOn),
4558
- staticNodeResolver: e.staticNodeResolver ?? Q.staticNodeResolver,
4764
+ }, Tn = (e) => ({
4765
+ algorithm: wn(e.algorithm),
4766
+ applyOn: vn(e.applyOn),
4767
+ staticNodeResolver: e.staticNodeResolver ?? yn.staticNodeResolver,
4559
4768
  onBeforeApplied: e.events?.onBeforeApplied ?? J,
4560
4769
  onAfterApplied: e.events?.onAfterApplied ?? J
4561
- }), gn = (e, t) => ({
4770
+ }), En = (e, t) => ({
4562
4771
  ...e,
4563
4772
  onNodeDragStarted: (n) => {
4564
4773
  t.add(n), e.onNodeDragStarted(n);
@@ -4566,7 +4775,7 @@ var ne = (e, t) => {
4566
4775
  onNodeDragFinished: (n) => {
4567
4776
  t.delete(n), e.onNodeDragFinished(n);
4568
4777
  }
4569
- }), _n = (e, t) => {
4778
+ }), Dn = (e, t) => {
4570
4779
  e.graph.onBeforeNodeRemoved.subscribe((e) => {
4571
4780
  t.delete(e);
4572
4781
  }), e.graph.onBeforeClear.subscribe(() => {
@@ -4574,23 +4783,23 @@ var ne = (e, t) => {
4574
4783
  }), e.onBeforeDestroy.subscribe(() => {
4575
4784
  t.clear();
4576
4785
  });
4577
- }, vn = (e, t) => ({
4786
+ }, On = (e, t) => ({
4578
4787
  ...e,
4579
4788
  staticNodeResolver: (n) => e.staticNodeResolver(n) || t.has(n)
4580
- }), yn = (e) => () => e, bn = yn(0), xn = () => {
4789
+ }), $ = (e) => () => e, kn = $(0), An = () => {
4581
4790
  let e = 0;
4582
4791
  return () => e++;
4583
- }, Sn = (e, t) => {
4584
- let n = bn, r = bn, i = xn();
4585
- return e === "incremental" && (n = i), t === "incremental" && (r = i), typeof e == "number" && (n = yn(e)), typeof t == "number" && (r = yn(t)), typeof e == "function" && (n = e), typeof t == "function" && (r = t), {
4792
+ }, jn = (e, t) => {
4793
+ let n = kn, r = kn, i = An();
4794
+ return e === "incremental" && (n = i), t === "incremental" && (r = i), typeof e == "number" && (n = $(e)), typeof t == "number" && (r = $(t)), typeof e == "function" && (n = e), typeof t == "function" && (r = t), {
4586
4795
  nodesPriorityFn: n,
4587
4796
  edgesPriorityFn: r
4588
4797
  };
4589
- }, Cn = (e) => {
4590
- let t = Sn(e.nodes?.priority, e.edges?.priority);
4798
+ }, Mn = (e) => {
4799
+ let t = jn(e.nodes?.priority, e.edges?.priority);
4591
4800
  return {
4592
4801
  nodes: {
4593
- centerFn: e.nodes?.centerFn ?? re,
4802
+ centerFn: e.nodes?.centerFn ?? ie,
4594
4803
  priorityFn: t.nodesPriorityFn
4595
4804
  },
4596
4805
  ports: { direction: e.ports?.direction ?? 0 },
@@ -4599,30 +4808,30 @@ var ne = (e, t) => {
4599
4808
  priorityFn: t.edgesPriorityFn
4600
4809
  }
4601
4810
  };
4602
- }, wn = (e) => e.applyOn.type === "topologyChangeSchedule" ? e.applyOn.schedule : R, Tn = (e) => {
4603
- let { canvasDefaults: t } = e, n = e.hasLayout ? wn(e.layoutParams) : R;
4811
+ }, Nn = (e) => e.applyOn.type === "topologyChangeSchedule" ? e.applyOn.schedule : B, Pn = (e) => {
4812
+ let { canvasDefaults: t } = e, n = e.hasLayout ? Nn(e.layoutParams) : B;
4604
4813
  return { focus: {
4605
4814
  contentPadding: t.focus?.contentPadding ?? t.focus?.contentOffset ?? 100,
4606
4815
  minContentScale: t.focus?.minContentScale ?? 0,
4607
4816
  schedule: n,
4608
4817
  animationDuration: t.focus?.animationDuration ?? 0
4609
4818
  } };
4610
- }, En = (e) => ({
4819
+ }, Fn = (e) => ({
4611
4820
  onNodeSelected: e.onNodeSelected,
4612
4821
  mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4613
4822
  mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4614
4823
  movementThreshold: e.movementThreshold ?? q.movementThreshold
4615
- }), Dn = (e) => ({
4824
+ }), In = (e) => ({
4616
4825
  onCanvasSelected: e.onCanvasSelected,
4617
4826
  mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4618
4827
  mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4619
4828
  movementThreshold: e.movementThreshold ?? q.movementThreshold
4620
- }), On = (e) => ({
4829
+ }), Ln = (e) => ({
4621
4830
  onEdgeSelected: e.onEdgeSelected,
4622
4831
  mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4623
4832
  mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4624
4833
  movementThreshold: e.movementThreshold ?? q.movementThreshold
4625
- }), kn = class {
4834
+ }), Rn = class {
4626
4835
  element;
4627
4836
  used = !1;
4628
4837
  canvasDefaults = {};
@@ -4649,9 +4858,9 @@ var ne = (e, t) => {
4649
4858
  window = window;
4650
4859
  animationStaticNodes = /* @__PURE__ */ new Set();
4651
4860
  pointInsideVerifier;
4652
- eventTagger = new $e();
4861
+ eventTagger = new ot();
4653
4862
  constructor(e) {
4654
- this.element = e, this.pointInsideVerifier = new C(e, this.window);
4863
+ this.element = e, this.pointInsideVerifier = new ee(e, this.window);
4655
4864
  }
4656
4865
  setDefaults(e) {
4657
4866
  return this.canvasDefaults = e, this;
@@ -4693,40 +4902,40 @@ var ne = (e, t) => {
4693
4902
  return this.userSelectableCanvasConfig = e, this;
4694
4903
  }
4695
4904
  build() {
4696
- if (this.used) throw new Rt("Failed to build Canvas because CanvasBuilder is a single-use object");
4905
+ if (this.used) throw new qt("Failed to build Canvas because CanvasBuilder is a single-use object");
4697
4906
  this.used = !0;
4698
- let e = new y(this.element), t = new h(), n = new Ct(this.element), r = this.createHtmlView(n.main, t, e), i = Cn(this.canvasDefaults), a = new Ue(t, r, i), o = hn(this.layoutConfig), s = new Xe(t, e, Tn({
4907
+ let e = new y(this.element), t = new h(), n = new Mt(this.element), r = this.createHtmlView(n.main, t, e), i = Mn(this.canvasDefaults), a = new Xe(t, r, i), o = Tn(this.layoutConfig), s = new rt(t, e, Pn({
4699
4908
  canvasDefaults: this.canvasDefaults,
4700
4909
  hasLayout: this.hasLayout,
4701
4910
  layoutParams: o
4702
- }), this.window), c = new Ke(e), l = new d(new He(t), c, a, s);
4703
- if (this.hasBackground && ct.configure(l, Nt(this.backgroundConfig), n.background), this.hasNodeResizeReactiveEdges && b.configure(l), this.userSelectableEdgesConfig !== void 0) {
4704
- let e = On(this.userSelectableEdgesConfig);
4705
- yt.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4911
+ }), this.window), c = new $e(e), l = new d(new Ye(t), c, a, s);
4912
+ if (this.hasBackground && gt.configure(l, Ht(this.backgroundConfig), n.background), this.hasNodeResizeReactiveEdges && b.configure(l), this.userSelectableEdgesConfig !== void 0) {
4913
+ let e = Ln(this.userSelectableEdgesConfig);
4914
+ Dt.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4706
4915
  }
4707
4916
  if (this.userSelectableNodesConfig !== void 0) {
4708
- let e = En(this.userSelectableNodesConfig);
4709
- vt.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4917
+ let e = Fn(this.userSelectableNodesConfig);
4918
+ Et.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4710
4919
  }
4711
4920
  if (this.userSelectableCanvasConfig !== void 0) {
4712
- let e = Dn(this.userSelectableCanvasConfig);
4713
- bt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4921
+ let e = In(this.userSelectableCanvasConfig);
4922
+ Ot.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4714
4923
  }
4715
4924
  if (this.hasDraggableNodes) {
4716
- let e = Tt(this.dragConfig);
4717
- this.hasAnimatedLayout && (e = gn(e, this.animationStaticNodes)), nt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4925
+ let e = Pt(this.dragConfig);
4926
+ this.hasAnimatedLayout && (e = En(e, this.animationStaticNodes)), ut.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4718
4927
  }
4719
4928
  if (this.hasUserConnectablePorts) {
4720
- let t = Pt(this.connectablePortsConfig, i.edges.shapeFactory, l.graph);
4721
- lt.configure(l, n.overlayConnectablePorts, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4929
+ let t = Ut(this.connectablePortsConfig, i.edges.shapeFactory, l.graph);
4930
+ _t.configure(l, n.overlayConnectablePorts, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4722
4931
  }
4723
4932
  if (this.hasUserDraggableEdges) {
4724
- let t = Ft(this.draggableEdgesConfig, l.graph);
4725
- ut.configure(l, n.overlayDraggableEdges, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4933
+ let t = Wt(this.draggableEdgesConfig, l.graph);
4934
+ vt.configure(l, n.overlayDraggableEdges, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4726
4935
  }
4727
- if (this.virtualScrollConfig === void 0 ? this.hasTransformableViewport && rt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, At(this.transformConfig)) : it.configure(l, n.main, this.window, At(this.transformConfig), this.boxRenderingTrigger, this.pointInsideVerifier, this.eventTagger, It(this.virtualScrollConfig)), this.hasLayout && mt.configure(l, o), this.hasAnimatedLayout) {
4728
- let e = cn(this.animatedLayoutConfig);
4729
- this.hasDraggableNodes && (_n(l, this.animationStaticNodes), e = vn(e, this.animationStaticNodes)), _t.configure(l, e, this.window);
4936
+ if (this.virtualScrollConfig === void 0 ? this.hasTransformableViewport && dt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, zt(this.transformConfig)) : ft.configure(l, n.main, this.window, zt(this.transformConfig), this.boxRenderingTrigger, this.pointInsideVerifier, this.eventTagger, Gt(this.virtualScrollConfig)), this.hasLayout && St.configure(l, o), this.hasAnimatedLayout) {
4937
+ let e = _n(this.animatedLayoutConfig);
4938
+ this.hasDraggableNodes && (Dn(l, this.animationStaticNodes), e = On(e, this.animationStaticNodes)), Tt.configure(l, e, this.window);
4730
4939
  }
4731
4940
  return l.onBeforeDestroy.subscribe(() => {
4732
4941
  n.destroy();
@@ -4734,8 +4943,8 @@ var ne = (e, t) => {
4734
4943
  }
4735
4944
  createHtmlView(e, t, n) {
4736
4945
  let r = new a(t, n, e);
4737
- return this.virtualScrollConfig !== void 0 && (r = new s(r, t, this.boxRenderingTrigger, Lt(this.virtualScrollConfig))), r = new c(r, t), r;
4946
+ return this.virtualScrollConfig !== void 0 && (r = new s(r, t, this.boxRenderingTrigger, Kt(this.virtualScrollConfig))), r = new c(r, t), r;
4738
4947
  }
4739
4948
  };
4740
4949
  //#endregion
4741
- export { Ee as BezierEdgeShape, kn as CanvasBuilder, Rt as CanvasBuilderError, p as CanvasError, e as ConnectionCategory, I as DirectEdgeShape, l as EventSubject, Oe as HorizontalEdgeShape, ze as InteractiveEdgeError, Be as InteractiveEdgeShape, Ve as MidpointEdgeShape, ke as StraightEdgeShape, Me as VerticalEdgeShape, Ne as boxPortOffsetFn };
4950
+ export { je as BezierEdgeShape, Rn as CanvasBuilder, qt as CanvasBuilderError, p as CanvasError, e as ConnectionCategory, R as DirectEdgeShape, l as EventSubject, Ne as HorizontalEdgeShape, Ke as InteractiveEdgeError, qe as InteractiveEdgeShape, Je as MidpointEdgeShape, ze as OrthogonalEdgeShape, Pe as StraightEdgeShape, Le as VerticalEdgeShape, Be as boxPortOffsetFn };