@zombie-mermaid/svg-renderer 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DEFAULTS as e, buildStyleBlock as t, detectDiagramType as n, escapeAttr as r, escapeXml as i, f as a, formatCssColor as o, getReadableTextColor as s, isMonospaceFont as c, measureMultilineText as l, measureTextWidth as u, mixSrgb as d, parseCssColor as f, renderMultilineText as p, renderMultilineTextWithBackground as m, resolveNodeStyle as h, safeHref as g, sanitizeClassName as _, setMonospaceMetrics as v, splitStatements as y, styleOpenTag as b, svgOpenTag as x, themeStyleDeclarations as S, withDirectionOverride as C, withoutOwnClusterEdges as w } from "@zombie-mermaid/core";
2
2
  import T from "elkjs/lib/elk.bundled.js";
3
- import { CHART_ACCENT_FALLBACK as E, architectureToGraph as D, c4BoundaryTypeLine as O, c4RelLabelLines as k, c4TypeLine as A, formatClassMember as j, getSeriesColor as ee, parseArchitecture as M, parseC4Diagram as N, parseClassDiagram as P, parseErDiagram as te, parseMermaid as ne, parsePieChart as re, parseSequenceDiagram as ie, parseXYChart as ae } from "@zombie-mermaid/mermaid-parser";
3
+ import { CHART_ACCENT_FALLBACK as E, architectureToGraph as D, c4BoundaryTypeLine as O, c4RelLabelLines as k, c4TypeLine as A, formatClassMember as ee, getSeriesColor as j, parseArchitecture as M, parseC4Diagram as N, parseClassDiagram as P, parseErDiagram as te, parseMermaid as ne, parsePieChart as re, parseSequenceDiagram as ie, parseXYChart as ae } from "@zombie-mermaid/mermaid-parser";
4
4
  import { decodeXML as oe } from "entities";
5
5
  //#region packages/svg-renderer/src/edge-curves.ts
6
6
  function se(e) {
@@ -846,8 +846,42 @@ function _t(e, t, n, r) {
846
846
  }
847
847
  }
848
848
  //#endregion
849
+ //#region packages/svg-renderer/src/layout-engine/jog-straightening.ts
850
+ var vt = 1.5, yt = .01;
851
+ function bt(e) {
852
+ let t = e.map((e) => ({ ...e })), n = 0;
853
+ for (; n + 3 < t.length;) {
854
+ let [e, r, i, a] = [
855
+ t[n],
856
+ t[n + 1],
857
+ t[n + 2],
858
+ t[n + 3]
859
+ ], o = Math.abs(e.x - r.x) < yt && Math.abs(i.x - a.x) < yt && Math.abs(r.y - i.y) < yt && Math.abs(r.x - i.x) <= vt && Math.abs(r.x - i.x) >= yt, s = Math.abs(e.y - r.y) < yt && Math.abs(i.y - a.y) < yt && Math.abs(r.x - i.x) < yt && Math.abs(r.y - i.y) <= vt && Math.abs(r.y - i.y) >= yt;
860
+ if (o) {
861
+ let r = (e.x + a.x) / 2;
862
+ t.splice(n, 4, {
863
+ x: r,
864
+ y: e.y
865
+ }, {
866
+ x: r,
867
+ y: a.y
868
+ });
869
+ } else if (s) {
870
+ let r = (e.y + a.y) / 2;
871
+ t.splice(n, 4, {
872
+ x: e.x,
873
+ y: r
874
+ }, {
875
+ x: a.x,
876
+ y: r
877
+ });
878
+ } else n++;
879
+ }
880
+ return t;
881
+ }
882
+ //#endregion
849
883
  //#region packages/svg-renderer/src/layout-engine/elk-adapter-utils.ts
850
- function vt(e, t = 0, n = 0) {
884
+ function xt(e, t = 0, n = 0) {
851
885
  let r = [];
852
886
  if (!e.sections || e.sections.length === 0) return r;
853
887
  let i = e.sections[0];
@@ -863,7 +897,7 @@ function vt(e, t = 0, n = 0) {
863
897
  y: i.endPoint.y + n
864
898
  }), r;
865
899
  }
866
- function yt(e, t = 0, n = 0) {
900
+ function St(e, t = 0, n = 0) {
867
901
  if (!e.labels || e.labels.length === 0) return;
868
902
  let r = e.labels[0];
869
903
  if (r.x != null && r.y != null) return {
@@ -873,11 +907,11 @@ function yt(e, t = 0, n = 0) {
873
907
  }
874
908
  //#endregion
875
909
  //#region packages/svg-renderer/src/layout-engine/from-elk.ts
876
- var bt = 16, xt = 28, St = 18, Ct = 28, wt = 10;
877
- function Tt(e, t) {
878
- let n = e.x + e.width, r = e.y + e.height / 2, i = Math.min(Ct, e.height * .6) / 2, a = xt + t * St, o = [];
879
- for (let e = 0; e <= bt; e++) {
880
- let t = Math.PI * e / bt;
910
+ var Ct = 16, wt = 28, Tt = 18, Et = 28, Dt = 10;
911
+ function Ot(e, t) {
912
+ let n = e.x + e.width, r = e.y + e.height / 2, i = Math.min(Et, e.height * .6) / 2, a = wt + t * Tt, o = [];
913
+ for (let e = 0; e <= Ct; e++) {
914
+ let t = Math.PI * e / Ct;
881
915
  o.push({
882
916
  x: n + a * Math.sin(t),
883
917
  y: r - i * Math.cos(t)
@@ -886,12 +920,12 @@ function Tt(e, t) {
886
920
  return {
887
921
  points: o,
888
922
  labelPosition: {
889
- x: n + a + wt,
923
+ x: n + a + Dt,
890
924
  y: r
891
925
  }
892
926
  };
893
927
  }
894
- function Et(e, t, n) {
928
+ function kt(e, t, n) {
895
929
  let r = /* @__PURE__ */ new Map();
896
930
  for (let i = 0; i < e.edges.length; i++) {
897
931
  let a = e.edges[i];
@@ -900,7 +934,7 @@ function Et(e, t, n) {
900
934
  if (!o) continue;
901
935
  let s = r.get(o.id) ?? 0;
902
936
  r.set(o.id, s + 1);
903
- let { points: c, labelPosition: l } = Tt(o, s);
937
+ let { points: c, labelPosition: l } = Ot(o, s);
904
938
  n.push({
905
939
  source: a.source,
906
940
  target: a.target,
@@ -910,34 +944,35 @@ function Et(e, t, n) {
910
944
  hasArrowEnd: a.hasArrowEnd,
911
945
  points: c,
912
946
  labelPosition: a.label ? l : void 0,
913
- inlineStyle: Rt(i, e),
947
+ inlineStyle: Vt(i, e),
914
948
  id: a.id,
915
949
  animate: a.animate
916
950
  });
917
951
  }
918
952
  }
919
- function Dt(e) {
953
+ function At(e) {
920
954
  let t = [];
921
955
  for (let n of e) t.push({
922
956
  x: n.x,
923
957
  y: n.y,
924
958
  right: n.x + n.width,
925
959
  bottom: n.y + n.height
926
- }), t.push(...Dt(n.children));
960
+ }), t.push(...At(n.children));
927
961
  return t;
928
962
  }
929
- function Ot(e, t, n = !1) {
963
+ function jt(e, t, n = !1) {
930
964
  let r = [], i = [], a = [], o = /* @__PURE__ */ new Set();
931
- for (let e of t.subgraphs) Lt(e, o);
932
- kt(e, t, o, r, a, 0, 0);
933
- let s = Dt(a);
934
- Mt(e, t, i, 0, 0, s.length > 0 ? {
965
+ for (let e of t.subgraphs) Bt(e, o);
966
+ Mt(e, t, o, r, a, 0, 0);
967
+ let s = At(a);
968
+ Ft(e, t, i, 0, 0, s.length > 0 ? {
935
969
  leftX: Math.min(...s.map((e) => e.x)) - 20,
936
970
  rightX: Math.max(...s.map((e) => e.right)) + 20
937
971
  } : void 0), ut(r, i, t.direction);
938
972
  let c = new Map(r.map((e) => [e.id, e]));
939
- Et(t, c, i), n && _t(i, r, a, t.direction);
973
+ kt(t, c, i), n && _t(i, r, a, t.direction);
940
974
  for (let e of i) {
975
+ e.points = bt(e.points);
941
976
  let t = c.get(e.source), n = c.get(e.target);
942
977
  t && (e.points = ot(e.points, t, !0)), n && (e.points = ot(e.points, n, !1));
943
978
  }
@@ -954,13 +989,13 @@ function Ot(e, t, n = !1) {
954
989
  groups: a
955
990
  };
956
991
  }
957
- function kt(e, t, n, r, i, a, o) {
992
+ function Mt(e, t, n, r, i, a, o) {
958
993
  if (e.children) for (let s of e.children) {
959
994
  let e = (s.x ?? 0) + a, c = (s.y ?? 0) + o, l = s.width ?? 0, u = s.height ?? 0;
960
995
  if (n.has(s.id)) {
961
996
  let a = [];
962
- kt(s, t, n, r, a, e, c);
963
- let o = It(t.subgraphs, s.id);
997
+ Mt(s, t, n, r, a, e, c);
998
+ let o = zt(t.subgraphs, s.id);
964
999
  i.push({
965
1000
  id: s.id,
966
1001
  label: o?.label ?? "",
@@ -987,11 +1022,11 @@ function kt(e, t, n, r, i, a, o) {
987
1022
  interaction: t.interactions.get(s.id)
988
1023
  });
989
1024
  }
990
- s.children && s.children.length > 0 && kt(s, t, n, r, i, e, c);
1025
+ s.children && s.children.length > 0 && Mt(s, t, n, r, i, e, c);
991
1026
  }
992
1027
  }
993
1028
  }
994
- function At(e) {
1029
+ function Nt(e) {
995
1030
  let t = /^e(\d+)$/.exec(e);
996
1031
  if (t) return {
997
1032
  edgeIndex: parseInt(t[1], 10),
@@ -1004,7 +1039,7 @@ function At(e) {
1004
1039
  level: parseInt(n[3], 10)
1005
1040
  };
1006
1041
  }
1007
- function jt(e) {
1042
+ function Pt(e) {
1008
1043
  if (e.length === 0) return {
1009
1044
  x: 0,
1010
1045
  y: 0
@@ -1029,11 +1064,11 @@ function jt(e) {
1029
1064
  }
1030
1065
  return e[e.length - 1];
1031
1066
  }
1032
- function Mt(e, t, n, r, i, a) {
1067
+ function Ft(e, t, n, r, i, a) {
1033
1068
  let o = /* @__PURE__ */ new Map();
1034
- Nt(e, o, 0, 0);
1069
+ It(e, o, 0, 0);
1035
1070
  let s = /* @__PURE__ */ new Map();
1036
- Ft(e, s, 0, 0, o);
1071
+ Rt(e, s, 0, 0, o);
1037
1072
  let c = 0;
1038
1073
  for (let [e, r] of s) {
1039
1074
  let i = t.edges[e];
@@ -1046,9 +1081,9 @@ function Mt(e, t, n, r, i, a) {
1046
1081
  let u = [...r.targetHops.keys()].sort((e, t) => e - t);
1047
1082
  for (let e of u) s(r.targetHops.get(e));
1048
1083
  let d;
1049
- i.label && o.length >= 2 && (d = r.bridge?.labelPosition ?? jt(o));
1050
- let f = Pt(o, a, c);
1051
- f !== o && c++, i.label && f !== o && f.length >= 2 && (d = jt(f)), n.push({
1084
+ i.label && o.length >= 2 && (d = r.bridge?.labelPosition ?? Pt(o));
1085
+ let f = Lt(o, a, c);
1086
+ f !== o && c++, i.label && f !== o && f.length >= 2 && (d = Pt(f)), n.push({
1052
1087
  source: i.source,
1053
1088
  target: i.target,
1054
1089
  label: i.label,
@@ -1057,13 +1092,13 @@ function Mt(e, t, n, r, i, a) {
1057
1092
  hasArrowEnd: i.hasArrowEnd,
1058
1093
  points: We(t).has(e) ? [...f].reverse() : f,
1059
1094
  labelPosition: d,
1060
- inlineStyle: Rt(e, t),
1095
+ inlineStyle: Vt(e, t),
1061
1096
  id: i.id,
1062
1097
  animate: i.animate
1063
1098
  });
1064
1099
  }
1065
1100
  }
1066
- function Nt(e, t, n, r) {
1101
+ function It(e, t, n, r) {
1067
1102
  t.set(e.id, {
1068
1103
  x: n,
1069
1104
  y: r
@@ -1071,10 +1106,10 @@ function Nt(e, t, n, r) {
1071
1106
  for (let i of e.children ?? []) {
1072
1107
  /* v8 ignore next */
1073
1108
  let e = i.x ?? 0, a = i.y ?? 0;
1074
- Nt(i, t, n + e, r + a);
1109
+ It(i, t, n + e, r + a);
1075
1110
  }
1076
1111
  }
1077
- function Pt(e, t, n = 0) {
1112
+ function Lt(e, t, n = 0) {
1078
1113
  if (e.length < 2) return e;
1079
1114
  let r = !1;
1080
1115
  for (let t = 1; t < e.length; t++) {
@@ -1113,11 +1148,11 @@ function Pt(e, t, n = 0) {
1113
1148
  }
1114
1149
  return i;
1115
1150
  }
1116
- function Ft(e, t, n, r, i) {
1151
+ function Rt(e, t, n, r, i) {
1117
1152
  if (e.edges) for (let a of e.edges) {
1118
- let e = At(a.id);
1153
+ let e = Nt(a.id);
1119
1154
  if (!e) continue;
1120
- let { edgeIndex: o } = e, s = a.container, c = s ? i.get(s) : void 0, l = c?.x ?? n, u = c?.y ?? r, d = vt(a, l, u), f = yt(a, l, u), p = t.get(o) ?? {
1155
+ let { edgeIndex: o } = e, s = a.container, c = s ? i.get(s) : void 0, l = c?.x ?? n, u = c?.y ?? r, d = xt(a, l, u), f = St(a, l, u), p = t.get(o) ?? {
1121
1156
  sourceHops: /* @__PURE__ */ new Map(),
1122
1157
  targetHops: /* @__PURE__ */ new Map()
1123
1158
  };
@@ -1129,20 +1164,20 @@ function Ft(e, t, n, r, i) {
1129
1164
  };
1130
1165
  e.role === "bridge" ? p.bridge = m : e.role === "source" ? p.sourceHops.set(e.level, m) : p.targetHops.set(e.level, m);
1131
1166
  }
1132
- if (e.children) for (let a of e.children) Ft(a, t, n + (a.x ?? 0), r + (a.y ?? 0), i);
1167
+ if (e.children) for (let a of e.children) Rt(a, t, n + (a.x ?? 0), r + (a.y ?? 0), i);
1133
1168
  }
1134
- function It(e, t) {
1169
+ function zt(e, t) {
1135
1170
  for (let n of e) {
1136
1171
  if (n.id === t) return n;
1137
- let e = It(n.children, t);
1172
+ let e = zt(n.children, t);
1138
1173
  if (e) return e;
1139
1174
  }
1140
1175
  }
1141
- function Lt(e, t) {
1176
+ function Bt(e, t) {
1142
1177
  t.add(e.id);
1143
- for (let n of e.children) Lt(n, t);
1178
+ for (let n of e.children) Bt(n, t);
1144
1179
  }
1145
- function Rt(e, t) {
1180
+ function Vt(e, t) {
1146
1181
  let n, r = t.linkStyles.get("default");
1147
1182
  r && (n = { ...r });
1148
1183
  let i = t.linkStyles.get(e);
@@ -1153,12 +1188,12 @@ function Rt(e, t) {
1153
1188
  }
1154
1189
  //#endregion
1155
1190
  //#region packages/svg-renderer/src/layout-engine/inner-edges.ts
1156
- var zt = 10, Bt = 14, Vt = 14, Ht = 10, Ut = 24, Wt = 400, Gt = /* @__PURE__ */ new Set([
1191
+ var Ht = 10, Ut = 14, Wt = 14, Gt = 10, Kt = 24, qt = 400, Jt = /* @__PURE__ */ new Set([
1157
1192
  "rectangle",
1158
1193
  "rounded",
1159
1194
  "subroutine"
1160
1195
  ]);
1161
- function Kt(e) {
1196
+ function Yt(e) {
1162
1197
  let t = e === "TD" || e === "TB" || e === "BT", n = e === "BT" || e === "RL" ? -1 : 1;
1163
1198
  return {
1164
1199
  span: (e) => {
@@ -1179,17 +1214,17 @@ function Kt(e) {
1179
1214
  }
1180
1215
  };
1181
1216
  }
1182
- function qt(e, t, n) {
1217
+ function Xt(e, t, n) {
1183
1218
  let r = Math.min(e.a, t.a), i = Math.max(e.a, t.a), a = Math.min(e.c, t.c), o = Math.max(e.c, t.c);
1184
1219
  return i > n.a0 && r < n.a1 && o > n.c0 && a < n.c1;
1185
1220
  }
1186
- var Jt = (e, t) => ({
1221
+ var Zt = (e, t) => ({
1187
1222
  a0: e.a0 - t,
1188
1223
  a1: e.a1 + t,
1189
1224
  c0: e.c0 - t,
1190
1225
  c1: e.c1 + t
1191
1226
  });
1192
- function Yt(e, t) {
1227
+ function Qt(e, t) {
1193
1228
  let n = e.span({
1194
1229
  x: t.x,
1195
1230
  y: t.y,
@@ -1201,23 +1236,23 @@ function Yt(e, t) {
1201
1236
  c: n.c0
1202
1237
  };
1203
1238
  }
1204
- function Xt(e, t, n) {
1239
+ function $t(e, t, n) {
1205
1240
  let r = e.c === t.c;
1206
1241
  for (let i = 1; i < n.length; i++) {
1207
1242
  let a = n[i - 1], o = n[i];
1208
1243
  if (a.c === o.c === r) {
1209
1244
  if (r) {
1210
1245
  let n = Math.abs(e.c - a.c), r = Math.min(Math.max(e.a, t.a), Math.max(a.a, o.a)) - Math.max(Math.min(e.a, t.a), Math.min(a.a, o.a));
1211
- if (n < Bt && r > 0) return !0;
1246
+ if (n < Ut && r > 0) return !0;
1212
1247
  } else {
1213
1248
  let n = Math.abs(e.a - a.a), r = Math.min(Math.max(e.c, t.c), Math.max(a.c, o.c)) - Math.max(Math.min(e.c, t.c), Math.min(a.c, o.c));
1214
- if (n < Bt && r > 0) return !0;
1249
+ if (n < Ut && r > 0) return !0;
1215
1250
  }
1216
1251
  }
1217
1252
  }
1218
1253
  return !1;
1219
1254
  }
1220
- function Zt(e) {
1255
+ function en(e) {
1221
1256
  let t = [];
1222
1257
  for (let n of e) {
1223
1258
  let e = t[t.length - 1];
@@ -1229,24 +1264,24 @@ function Zt(e) {
1229
1264
  }
1230
1265
  return t;
1231
1266
  }
1232
- var Qt = (e) => {
1267
+ var tn = (e) => {
1233
1268
  let t = 0;
1234
1269
  for (let n = 1; n < e.length; n++) t += Math.abs(e[n].a - e[n - 1].a) + Math.abs(e[n].c - e[n - 1].c);
1235
1270
  return t;
1236
1271
  };
1237
- function $t(e, t, n, r, i, a = []) {
1238
- let o = Kt(i), s = o.span(e), c = o.span(t), l = s.a1 <= c.a0, u = c.a1 <= s.a0;
1272
+ function nn(e, t, n, r, i, a = []) {
1273
+ let o = Yt(i), s = o.span(e), c = o.span(t), l = s.a1 <= c.a0, u = c.a1 <= s.a0;
1239
1274
  if (!l && !u) return;
1240
1275
  let d = o.span(r), f = {
1241
- a0: d.a0 + Ht,
1242
- a1: d.a1 - Ht,
1243
- c0: d.c0 + Ht,
1244
- c1: d.c1 - Ht
1245
- }, p = a.map((e) => e.map((e) => Yt(o, e))), m = n.map((e) => Jt(o.span(e), zt)), h = (e) => (e.c0 + e.c1) / 2, g = (e) => (e.a0 + e.a1) / 2, _ = (e) => Gt.has(e.shape), v = (e) => {
1276
+ a0: d.a0 + Gt,
1277
+ a1: d.a1 - Gt,
1278
+ c0: d.c0 + Gt,
1279
+ c1: d.c1 - Gt
1280
+ }, p = a.map((e) => e.map((e) => Qt(o, e))), m = n.map((e) => Zt(o.span(e), Ht)), h = (e) => (e.c0 + e.c1) / 2, g = (e) => (e.a0 + e.a1) / 2, _ = (e) => Jt.has(e.shape), v = (e) => {
1246
1281
  for (let t of e) if (t.a < f.a0 || t.a > f.a1 || t.c < f.c0 || t.c > f.c1) return !1;
1247
1282
  for (let t = 1; t < e.length; t++) {
1248
1283
  let n = e[t - 1], r = e[t];
1249
- if (n.a !== r.a && n.c !== r.c || m.some((e) => qt(n, r, e)) || qt(n, r, s) || qt(n, r, c) || p.some((e) => Xt(n, r, e))) return !1;
1284
+ if (n.a !== r.a && n.c !== r.c || m.some((e) => Xt(n, r, e)) || Xt(n, r, s) || Xt(n, r, c) || p.some((e) => $t(n, r, e))) return !1;
1250
1285
  }
1251
1286
  return !0;
1252
1287
  }, y = /* @__PURE__ */ new Set([
@@ -1256,10 +1291,10 @@ function $t(e, t, n, r, i, a = []) {
1256
1291
  f.c1
1257
1292
  ]);
1258
1293
  for (let e of m) y.add(e.c0 - 1), y.add(e.c1 + 1);
1259
- for (let e of [s, c]) y.add(e.c0 - zt), y.add(e.c1 + zt);
1294
+ for (let e of [s, c]) y.add(e.c0 - Ht), y.add(e.c1 + Ht);
1260
1295
  let b = (e, t, n) => _(e) ? n >= t.c0 + 4 && n <= t.c1 - 4 : Math.abs(n - h(t)) < .5, x = [];
1261
1296
  if (l) {
1262
- let n = (c.a0 - s.a1) / 2, r = s.a1 + Math.min(Vt, n), i = c.a0 - Math.min(Vt, n);
1297
+ let n = (c.a0 - s.a1) / 2, r = s.a1 + Math.min(Wt, n), i = c.a0 - Math.min(Wt, n);
1263
1298
  for (let n of y) {
1264
1299
  b(e, s, n) && b(t, c, n) && x.push([{
1265
1300
  a: s.a1,
@@ -1398,14 +1433,14 @@ function $t(e, t, n, r, i, a = []) {
1398
1433
  }
1399
1434
  let S, C = Infinity;
1400
1435
  for (let t of x) {
1401
- let n = Zt(t);
1436
+ let n = en(t);
1402
1437
  if (n.length < 2 || !v(n)) continue;
1403
- let r = e.shape === "diamond" && n[0].a === s.a1 ? Wt : 0, i = Qt(n) + Ut * (n.length - 2) + r;
1438
+ let r = e.shape === "diamond" && n[0].a === s.a1 ? qt : 0, i = tn(n) + Kt * (n.length - 2) + r;
1404
1439
  i < C && (S = n, C = i);
1405
1440
  }
1406
1441
  return S?.map(o.toPoint);
1407
1442
  }
1408
- function en(e) {
1443
+ function rn(e) {
1409
1444
  let t = {
1410
1445
  x: e[0].x,
1411
1446
  y: e[0].y
@@ -1421,24 +1456,24 @@ function en(e) {
1421
1456
  }
1422
1457
  //#endregion
1423
1458
  //#region packages/svg-renderer/src/layout-engine/compound-flat.ts
1424
- var tn = "__zm_spine__", nn = 8, rn = 6, an = 12, on = 4, sn = 4, cn = .25, ln = .02, un = 40, dn = (e) => e === "TD" || e === "TB" || e === "BT", fn = (e) => e.startsWith(tn);
1425
- function pn(e) {
1426
- return e.flatMap((e) => [e, ...pn(e.children)]);
1459
+ var an = "__zm_spine__", on = 8, sn = 6, cn = 12, ln = 4, un = 4, dn = .25, fn = .02, pn = 40, mn = (e) => e === "TD" || e === "TB" || e === "BT", hn = (e) => e.startsWith(an);
1460
+ function gn(e) {
1461
+ return e.flatMap((e) => [e, ...gn(e.children)]);
1427
1462
  }
1428
1463
  function V(e) {
1429
1464
  let t = new Set(e.nodeIds);
1430
1465
  for (let n of e.children) for (let e of V(n)) t.add(e);
1431
1466
  return t;
1432
1467
  }
1433
- function mn(e) {
1468
+ function _n(e) {
1434
1469
  if (e.subgraphs.length === 0 || Ve(e) || Ze(e.subgraphs)) return !1;
1435
- for (let t of e.nodes.keys()) if (fn(t)) return !1;
1470
+ for (let t of e.nodes.keys()) if (hn(t)) return !1;
1436
1471
  for (let t of e.edges) if (!e.nodes.has(t.source) || !e.nodes.has(t.target)) return !1;
1437
- let t = pn(e.subgraphs);
1472
+ let t = gn(e.subgraphs);
1438
1473
  return !t.some((t) => e.nodes.has(t.id)) && t.every((t) => [...V(t)].some((t) => e.nodes.has(t)));
1439
1474
  }
1440
- function hn(e, t) {
1441
- let n = dn(t), r = (e) => n ? [e.y, e.y + e.height] : [e.x, e.x + e.width], i = [...e].sort((e, t) => {
1475
+ function vn(e, t) {
1476
+ let n = mn(t), r = (e) => n ? [e.y, e.y + e.height] : [e.x, e.x + e.width], i = [...e].sort((e, t) => {
1442
1477
  let [n, i] = r(e), [a, o] = r(t);
1443
1478
  return (n + i) / 2 - (a + o) / 2;
1444
1479
  }), a = [];
@@ -1453,7 +1488,7 @@ function hn(e, t) {
1453
1488
  let o = /* @__PURE__ */ new Map();
1454
1489
  return a.forEach((e, t) => e.ids.forEach((e) => o.set(e, t))), o;
1455
1490
  }
1456
- function gn(e, t, n) {
1491
+ function yn(e, t, n) {
1457
1492
  let r = {
1458
1493
  ghosts: [],
1459
1494
  edges: []
@@ -1466,7 +1501,7 @@ function gn(e, t, n) {
1466
1501
  let o = e.filter((e) => t.get(e) === a).sort((e, t) => n(e) - n(t));
1467
1502
  if (o.length > 0) c.set(a, o[0]);
1468
1503
  else {
1469
- let e = `${tn}${i.id}__${a}`;
1504
+ let e = `${an}${i.id}__${a}`;
1470
1505
  r.ghosts.push({
1471
1506
  id: e,
1472
1507
  subgraph: i.id
@@ -1475,7 +1510,7 @@ function gn(e, t, n) {
1475
1510
  }
1476
1511
  for (let e = o; e < s; e++) {
1477
1512
  let t = c.get(e), n = c.get(e + 1);
1478
- !fn(t) && !fn(n) || r.edges.push({
1513
+ !hn(t) && !hn(n) || r.edges.push({
1479
1514
  source: t,
1480
1515
  target: n,
1481
1516
  style: "invisible",
@@ -1486,7 +1521,7 @@ function gn(e, t, n) {
1486
1521
  }
1487
1522
  return r;
1488
1523
  }
1489
- function _n(e, t, n, r = () => !1) {
1524
+ function bn(e, t, n, r = () => !1) {
1490
1525
  let i = (e) => {
1491
1526
  let n = [...V(e)].filter((e) => t.has(e)).map((e) => t.get(e));
1492
1527
  return n.length > 0 ? [Math.min(...n), Math.max(...n)] : void 0;
@@ -1508,9 +1543,9 @@ function _n(e, t, n, r = () => !1) {
1508
1543
  for (let r of V(e)) n.has(r) && n.set(r, n.get(r) + s[t]);
1509
1544
  });
1510
1545
  }
1511
- for (let i of e) _n(i.children, t, n, r);
1546
+ for (let i of e) bn(i.children, t, n, r);
1512
1547
  }
1513
- function vn(e, t, n, r, i) {
1548
+ function xn(e, t, n, r, i) {
1514
1549
  let a = new Map(t);
1515
1550
  for (let t of r) {
1516
1551
  let r = V(t);
@@ -1519,7 +1554,7 @@ function vn(e, t, n, r, i) {
1519
1554
  if (s.length === 0) continue;
1520
1555
  let c = Math.min(...s.map((e) => n.get(e))), l = Math.max(...s.map((e) => n.get(e))), u = o.map((e) => a.get(e)), d = Math.min(...u), f = Math.max(...u), p = (d + f) / 2, m = 0;
1521
1556
  for (let t of e) {
1522
- if (r.has(t) || fn(t)) continue;
1557
+ if (r.has(t) || hn(t)) continue;
1523
1558
  let e = n.get(t);
1524
1559
  if (e === void 0 || e < c || e > l) continue;
1525
1560
  m++;
@@ -1530,8 +1565,8 @@ function vn(e, t, n, r, i) {
1530
1565
  let o = new Map(e.map((e, t) => [e, t]));
1531
1566
  return [...e].sort((e, t) => a.get(e) - a.get(t) || o.get(e) - o.get(t));
1532
1567
  }
1533
- var yn = (e, t) => t >= Math.min(...e) && t <= Math.max(...e);
1534
- function bn(e, t, n) {
1568
+ var Sn = (e, t) => t >= Math.min(...e) && t <= Math.max(...e);
1569
+ function Cn(e, t, n) {
1535
1570
  let r = (e) => {
1536
1571
  let i = e.children.map(r), a = [...[...V(e)].flatMap((e) => {
1537
1572
  let n = t.get(e);
@@ -1549,14 +1584,14 @@ function bn(e, t, n) {
1549
1584
  };
1550
1585
  return e.map(r);
1551
1586
  }
1552
- var xn = (e) => e.flatMap((e) => [e, ...xn(e.children)]);
1553
- function Sn(e, t, n, r, i, a) {
1554
- let o = dn(r), s = new Map(pn(t).map((e) => [e.id, V(e)])), c = /* @__PURE__ */ new Map(), l = !1, u = [], d = (e) => o ? [e.x, e.x + e.width] : [e.y, e.y + e.height], f = (e) => o ? [e.y, e.y + e.height] : [e.x, e.x + e.width], p = ([e, t], [n, r]) => Math.max(0, Math.min(t, r) - Math.max(e, n)), m = (e) => ({
1555
- x: e.x - un,
1556
- y: e.y - un,
1587
+ var wn = (e) => e.flatMap((e) => [e, ...wn(e.children)]);
1588
+ function Tn(e, t, n, r, i, a) {
1589
+ let o = mn(r), s = new Map(gn(t).map((e) => [e.id, V(e)])), c = /* @__PURE__ */ new Map(), l = !1, u = [], d = (e) => o ? [e.x, e.x + e.width] : [e.y, e.y + e.height], f = (e) => o ? [e.y, e.y + e.height] : [e.x, e.x + e.width], p = ([e, t], [n, r]) => Math.max(0, Math.min(t, r) - Math.max(e, n)), m = (e) => ({
1590
+ x: e.x - pn,
1591
+ y: e.y - pn,
1557
1592
  width: e.width + 80,
1558
1593
  height: e.height + 80
1559
- }), h = (e, t) => p(f(e), f(t)) > 0 ? p(d(e), d(t)) : 0, g = xn(e), _ = new Map(g.map((e) => [e, m(e)])), v = (e, t, n, r) => {
1594
+ }), h = (e, t) => p(f(e), f(t)) > 0 ? p(d(e), d(t)) : 0, g = wn(e), _ = new Map(g.map((e) => [e, m(e)])), v = (e, t, n, r) => {
1560
1595
  let i = p(d(e), d(t)), a = p(f(e), f(t));
1561
1596
  if (i <= 0 || a <= 0) return;
1562
1597
  let s = i <= a, c = s === o, l = (e) => c ? e.x : e.y, m = (e) => c ? e.x + e.width : e.y + e.height, h = (e) => (l(e) + m(e)) / 2, g = h(n) <= h(r) ? n : r;
@@ -1570,7 +1605,7 @@ function Sn(e, t, n, r, i, a) {
1570
1605
  let t = s.get(e.id), r = [...t].filter((e) => a.has(e)).map((e) => a.get(e)), o = new Set(r);
1571
1606
  for (let [s, u] of n) {
1572
1607
  if (t.has(s)) continue;
1573
- if (o.has(a.get(s)) || !yn(r, a.get(s))) {
1608
+ if (o.has(a.get(s)) || !Sn(r, a.get(s))) {
1574
1609
  v(_.get(e), u, e, u);
1575
1610
  continue;
1576
1611
  }
@@ -1578,7 +1613,7 @@ function Sn(e, t, n, r, i, a) {
1578
1613
  n <= 0 || (i.has(e.id) ? c.set(e.id, Math.max(c.get(e.id) ?? 0, n)) : l = !0);
1579
1614
  }
1580
1615
  }
1581
- let y = (e, t) => xn(e.children).includes(t);
1616
+ let y = (e, t) => wn(e.children).includes(t);
1582
1617
  for (let e = 0; e < g.length; e++) for (let t = e + 1; t < g.length; t++) {
1583
1618
  let n = g[e], r = g[t];
1584
1619
  y(n, r) || y(r, n) || v(_.get(n), r, n, r);
@@ -1589,17 +1624,17 @@ function Sn(e, t, n, r, i, a) {
1589
1624
  requests: u
1590
1625
  };
1591
1626
  }
1592
- function Cn(e, t, n) {
1627
+ function En(e, t, n) {
1593
1628
  let r = [...e.nodes.keys()], i = {
1594
1629
  ...e,
1595
1630
  subgraphs: []
1596
- }, a = t(i), o = hn(a.nodes, e.direction), s = dn(e.direction), c = new Map(a.nodes.map((e) => [e.id, e])), l = (e) => {
1631
+ }, a = t(i), o = vn(a.nodes, e.direction), s = mn(e.direction), c = new Map(a.nodes.map((e) => [e.id, e])), l = (e) => {
1597
1632
  let t = c.get(e);
1598
1633
  return s ? t.x : t.y;
1599
- }, u = pn(e.subgraphs), d = gn(u, o, l), f = /* @__PURE__ */ new Map();
1634
+ }, u = gn(e.subgraphs), d = yn(u, o, l), f = /* @__PURE__ */ new Map();
1600
1635
  for (let e of d.ghosts) f.set(e.subgraph, [...f.get(e.subgraph) ?? [], e.id]);
1601
1636
  let p = new Map(a.nodes.map((e) => [e.id, l(e.id)]));
1602
- _n(e.subgraphs, o, p, (t, n) => {
1637
+ bn(e.subgraphs, o, p, (t, n) => {
1603
1638
  let r = V(t), i = V(n), a = (t, n) => e.edges.some((e) => t.has(e.source) && n.has(e.target));
1604
1639
  return a(r, i) && a(i, r);
1605
1640
  });
@@ -1613,42 +1648,42 @@ function Cn(e, t, n) {
1613
1648
  label: " ",
1614
1649
  shape: "rectangle"
1615
1650
  });
1616
- let h = vn([...m.keys()], p, o, u, f), g = {
1651
+ let h = xn([...m.keys()], p, o, u, f), g = {
1617
1652
  ...i,
1618
1653
  nodes: new Map(h.map((e) => [e, m.get(e)])),
1619
1654
  edges: [...e.edges, ...d.edges]
1620
1655
  }, _ = new Set(d.edges.map((t, n) => e.edges.length + n)), v = (i) => {
1621
1656
  let a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1622
1657
  for (let c = 0;; c++) {
1623
- let l = new Map(d.ghosts.map((e) => [e.id, nn + (a.get(e.subgraph) ?? 0)])), p = t(g, {
1658
+ let l = new Map(d.ghosts.map((e) => [e.id, on + (a.get(e.subgraph) ?? 0)])), p = t(g, {
1624
1659
  fixedWidths: l,
1625
1660
  looseEdges: _,
1626
1661
  detachedEdges: i,
1627
1662
  walkOrder: r,
1628
1663
  forceNodeOrder: !0
1629
- }), m = new Map(p.nodes.filter((e) => !fn(e.id)).map((e) => [e.id, e])), h = bn(e.subgraphs, m, n), v = Sn(h, e.subgraphs, m, e.direction, new Set(f.keys()), o), { penetration: y, stuck: b } = v;
1664
+ }), m = new Map(p.nodes.filter((e) => !hn(e.id)).map((e) => [e.id, e])), h = Cn(e.subgraphs, m, n), v = Tn(h, e.subgraphs, m, e.direction, new Set(f.keys()), o), { penetration: y, stuck: b } = v;
1630
1665
  if (b) return;
1631
1666
  if (y.size === 0) {
1632
1667
  for (let t = 0; v.requests.length > 0; t++) {
1633
- if (t === an) return;
1634
- En(v.requests.reduce((e, t) => t.amount > e.amount ? t : e), [...m.values()], p.edges), h = bn(e.subgraphs, m, n), v = Sn(h, e.subgraphs, m, e.direction, new Set(f.keys()), o);
1668
+ if (t === cn) return;
1669
+ kn(v.requests.reduce((e, t) => t.amount > e.amount ? t : e), [...m.values()], p.edges), h = Cn(e.subgraphs, m, n), v = Tn(h, e.subgraphs, m, e.direction, new Set(f.keys()), o);
1635
1670
  }
1636
- let t = Tn(e, i, m, h, u);
1637
- return t && Dn(p, [...m.values()], h, t);
1671
+ let t = On(e, i, m, h, u);
1672
+ return t && An(p, [...m.values()], h, t);
1638
1673
  }
1639
- if (c === rn) return;
1674
+ if (c === sn) return;
1640
1675
  for (let [e, t] of y) {
1641
- let n = a.get(e) ?? 0, r = s.get(e), i = r ? (r.overlap - t) / (n - r.width) : 0, o = i > ln ? i : cn;
1676
+ let n = a.get(e) ?? 0, r = s.get(e), i = r ? (r.overlap - t) / (n - r.width) : 0, o = i > fn ? i : dn;
1642
1677
  s.set(e, {
1643
1678
  width: n,
1644
1679
  overlap: t
1645
- }), a.set(e, n + t / o + sn);
1680
+ }), a.set(e, n + t / o + un);
1646
1681
  }
1647
1682
  }
1648
- }, y = wn(e, d, o, u);
1683
+ }, y = Dn(e, d, o, u);
1649
1684
  return (y.size > 0 ? v(y) : void 0) ?? v(/* @__PURE__ */ new Set());
1650
1685
  }
1651
- function wn(e, t, n, r) {
1686
+ function Dn(e, t, n, r) {
1652
1687
  let i = r.map((e) => {
1653
1688
  let t = V(e);
1654
1689
  return {
@@ -1674,15 +1709,15 @@ function wn(e, t, n, r) {
1674
1709
  }
1675
1710
  return o;
1676
1711
  }
1677
- function Tn(e, t, n, r, i) {
1678
- let a = new Map(xn(r).map((e) => [e.id, e])), o = [];
1712
+ function On(e, t, n, r, i) {
1713
+ let a = new Map(wn(r).map((e) => [e.id, e])), o = [];
1679
1714
  for (let r of t) {
1680
1715
  let t = e.edges[r], s = n.get(t.source), c = n.get(t.target), l = i.filter((e) => {
1681
1716
  let n = V(e);
1682
1717
  return n.has(t.source) && n.has(t.target);
1683
1718
  }).sort((e, t) => V(e).size - V(t).size)[0], u = l && a.get(l.id);
1684
1719
  if (!s || !c || !u) return;
1685
- let d = $t(s, c, [...n.values()].filter((e) => e !== s && e !== c), u, e.direction, o.map((e) => e.points));
1720
+ let d = nn(s, c, [...n.values()].filter((e) => e !== s && e !== c), u, e.direction, o.map((e) => e.points));
1686
1721
  if (!d) return;
1687
1722
  o.push({
1688
1723
  source: t.source,
@@ -1692,24 +1727,24 @@ function Tn(e, t, n, r, i) {
1692
1727
  hasArrowStart: t.hasArrowStart,
1693
1728
  hasArrowEnd: t.hasArrowEnd,
1694
1729
  points: d,
1695
- labelPosition: t.label ? en(d) : void 0,
1696
- inlineStyle: Rt(r, e),
1730
+ labelPosition: t.label ? rn(d) : void 0,
1731
+ inlineStyle: Vt(r, e),
1697
1732
  id: t.id,
1698
1733
  animate: t.animate
1699
1734
  });
1700
1735
  }
1701
1736
  return o;
1702
1737
  }
1703
- function En(e, t, n) {
1704
- let { axis: r, amount: i, after: a } = e, o = i + on, s = t.filter((e) => e[r] >= a), c = Math.min(...s.map((e) => e[r]));
1738
+ function kn(e, t, n) {
1739
+ let { axis: r, amount: i, after: a } = e, o = i + ln, s = t.filter((e) => e[r] >= a), c = Math.min(...s.map((e) => e[r]));
1705
1740
  for (let e of s) e[r] += o;
1706
1741
  let l = (e) => {
1707
1742
  e[r] >= c && (e[r] += o);
1708
1743
  };
1709
1744
  for (let e of n) e.points.forEach(l), e.labelPosition && l(e.labelPosition);
1710
1745
  }
1711
- function Dn(e, t, n, r) {
1712
- let i = [...e.edges.filter((e) => !fn(e.source) && !fn(e.target)), ...r], a = xn(n), o = [
1746
+ function An(e, t, n, r) {
1747
+ let i = [...e.edges.filter((e) => !hn(e.source) && !hn(e.target)), ...r], a = wn(n), o = [
1713
1748
  ...t.map((e) => e.x),
1714
1749
  ...a.map((e) => e.x),
1715
1750
  ...i.flatMap((e) => e.points.map((e) => e.x))
@@ -1742,26 +1777,26 @@ function Dn(e, t, n, r) {
1742
1777
  }
1743
1778
  //#endregion
1744
1779
  //#region packages/svg-renderer/src/layout-engine.ts
1745
- function On(e, t = {}) {
1746
- return kn(e, t);
1780
+ function jn(e, t = {}) {
1781
+ return Mn(e, t);
1747
1782
  }
1748
- function kn(e, t, n) {
1783
+ function Mn(e, t, n) {
1749
1784
  let r = {
1750
1785
  ...B,
1751
1786
  ...t,
1752
1787
  fontSizes: Te(t.fontSizes)
1753
1788
  };
1754
- return Ot(ye(nt(e, r, n), t.layoutCache), e, r.mergeEdges);
1789
+ return jt(ye(nt(e, r, n), t.layoutCache), e, r.mergeEdges);
1755
1790
  }
1756
- function An(e, t = {}) {
1791
+ function Nn(e, t = {}) {
1757
1792
  let n = w(e);
1758
- if (mn(n)) {
1759
- let e = Cn(n, (e, n) => kn(e, t, n), Te(t.fontSizes));
1793
+ if (_n(n)) {
1794
+ let e = En(n, (e, n) => Mn(e, t, n), Te(t.fontSizes));
1760
1795
  if (e) return e;
1761
1796
  }
1762
- return On(n, t);
1797
+ return jn(n, t);
1763
1798
  }
1764
- function jn(e, t = {}) {
1799
+ function Pn(e, t = {}) {
1765
1800
  return nt(e, {
1766
1801
  ...B,
1767
1802
  ...t,
@@ -1770,23 +1805,23 @@ function jn(e, t = {}) {
1770
1805
  }
1771
1806
  //#endregion
1772
1807
  //#region packages/svg-renderer/src/title-gaps.ts
1773
- var Mn = 12, Nn = 2;
1774
- function Pn(e) {
1775
- return e.flatMap((e) => [e, ...Pn(e.children)]);
1808
+ var Fn = 12, In = 2;
1809
+ function Ln(e) {
1810
+ return e.flatMap((e) => [e, ...Ln(e.children)]);
1776
1811
  }
1777
- function Fn(e, t) {
1812
+ function Rn(e, t) {
1778
1813
  let n = t.groupHeader + 16;
1779
- return Pn(e).filter((e) => e.label !== "").map((e) => {
1814
+ return Ln(e).filter((e) => e.label !== "").map((e) => {
1780
1815
  let r = l(e.label, t.groupHeader, L.groupHeader);
1781
1816
  return {
1782
- x: e.x + Mn - Nn,
1783
- y: e.y + n / 2 - r.height / 2 - Nn,
1817
+ x: e.x + Fn - In,
1818
+ y: e.y + n / 2 - r.height / 2 - In,
1784
1819
  width: r.width + 4,
1785
1820
  height: r.height + 4
1786
1821
  };
1787
1822
  });
1788
1823
  }
1789
- function In(e, t, n) {
1824
+ function zn(e, t, n) {
1790
1825
  let r = t.x - e.x, i = t.y - e.y, a = [
1791
1826
  -r,
1792
1827
  r,
@@ -1809,26 +1844,26 @@ function In(e, t, n) {
1809
1844
  }
1810
1845
  return !0;
1811
1846
  }
1812
- function Ln(e) {
1847
+ function Bn(e) {
1813
1848
  return {
1814
- x: e.x + Nn,
1815
- y: e.y + Nn,
1849
+ x: e.x + In,
1850
+ y: e.y + In,
1816
1851
  width: e.width - 4,
1817
1852
  height: e.height - 4
1818
1853
  };
1819
1854
  }
1820
- function Rn(e, t) {
1821
- let n = e.points, r = t.map(Ln);
1822
- for (let e = 0; e + 1 < n.length; e++) if (r.some((t) => In(n[e], n[e + 1], t))) return !0;
1855
+ function Vn(e, t) {
1856
+ let n = e.points, r = t.map(Bn);
1857
+ for (let e = 0; e + 1 < n.length; e++) if (r.some((t) => zn(n[e], n[e + 1], t))) return !0;
1823
1858
  return !1;
1824
1859
  }
1825
- function zn(e) {
1860
+ function Hn(e) {
1826
1861
  let t = 2166136261;
1827
1862
  for (let n of e.map((e) => `${e.x},${e.y},${e.width},${e.height}`).join(";")) t = Math.imul(t ^ n.charCodeAt(0), 16777619);
1828
1863
  return (t >>> 0).toString(36);
1829
1864
  }
1830
- function Bn(e, t, n) {
1831
- let r = `zm-title-gap-${zn(e)}`;
1865
+ function Un(e, t, n) {
1866
+ let r = `zm-title-gap-${Hn(e)}`;
1832
1867
  return {
1833
1868
  id: r,
1834
1869
  markup: ` <mask id="${r}" maskUnits="userSpaceOnUse" x="0" y="0" width="${t}" height="${n}">\n <rect x="0" y="0" width="${t}" height="${n}" fill="#fff" />\n${e.map((e) => ` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000" />`).join("\n")}\n </mask>`
@@ -1836,25 +1871,25 @@ function Bn(e, t, n) {
1836
1871
  }
1837
1872
  //#endregion
1838
1873
  //#region packages/svg-renderer/src/renderer.ts
1839
- function Vn(e, n, r = "Inter", i = !1, a = I, o = "linear", s, c = !0, l = !0, u, d, f = {}) {
1874
+ function Wn(e, n, r = "Inter", i = !1, a = I, o = "linear", s, c = !0, l = !0, u, d, f = {}) {
1840
1875
  let p = [], m = l && e.nodes.some((e) => !!g(e.interaction?.href));
1841
- p.push(Lr(x(e.width, e.height, n, i, u, d, m, f.styleAttribute), s)), p.push(t(r, !1, f.nonce)), c && e.edges.some((e) => e.animate) && p.push(Hn(f.nonce)), p.push("<defs>"), p.push(Un());
1876
+ p.push(Br(x(e.width, e.height, n, i, u, d, m, f.styleAttribute), s)), p.push(t(r, !1, f.nonce)), c && e.edges.some((e) => e.animate) && p.push(Gn(f.nonce)), p.push("<defs>"), p.push(Kn());
1842
1877
  let h = /* @__PURE__ */ new Set();
1843
1878
  for (let t of e.edges) t.inlineStyle?.stroke && h.add(t.inlineStyle.stroke);
1844
- for (let e of h) p.push(Wn(e));
1845
- let _ = Fn(e.groups, a), v = new Set(e.edges.filter((e) => Rn(e, _))), y;
1879
+ for (let e of h) p.push(qn(e));
1880
+ let _ = Rn(e.groups, a), v = new Set(e.edges.filter((e) => Vn(e, _))), y;
1846
1881
  if (v.size > 0) {
1847
- let t = Bn(_, e.width, e.height);
1882
+ let t = Un(_, e.width, e.height);
1848
1883
  y = t.id, p.push(t.markup);
1849
1884
  }
1850
1885
  p.push("</defs>");
1851
- for (let t of e.groups) p.push(qn(t, r, a));
1852
- for (let t of e.edges) p.push(Jn(t, o, c, v.has(t) ? y : void 0));
1853
- for (let t of e.edges) t.label && p.push(Xn(t, r, a));
1854
- for (let t of e.nodes) p.push(er(t, r, a, l));
1886
+ for (let t of e.groups) p.push(Xn(t, r, a));
1887
+ for (let t of e.edges) p.push(Zn(t, o, c, v.has(t) ? y : void 0));
1888
+ for (let t of e.edges) t.label && p.push($n(t, r, a));
1889
+ for (let t of e.nodes) p.push(rr(t, r, a, l));
1855
1890
  return p.push("</svg>"), p.join("\n");
1856
1891
  }
1857
- function Hn(e) {
1892
+ function Gn(e) {
1858
1893
  return [
1859
1894
  b(e),
1860
1895
  " @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }",
@@ -1865,28 +1900,28 @@ function Hn(e) {
1865
1900
  "</style>"
1866
1901
  ].join("\n");
1867
1902
  }
1868
- function Un() {
1869
- return Gn("var(--_arrow)", "");
1903
+ function Kn() {
1904
+ return Jn("var(--_arrow)", "");
1870
1905
  }
1871
- function Wn(e) {
1872
- return Gn(r(e), a`-${Kn(e)}`);
1906
+ function qn(e) {
1907
+ return Jn(r(e), a`-${Yn(e)}`);
1873
1908
  }
1874
- function Gn(e, t) {
1909
+ function Jn(e, t) {
1875
1910
  let n = Oe.width, r = Oe.height, i = n - 1, o = a`fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`, s = a`<polygon points="0 0, ${n} ${r / 2}, 0 ${r}" ${o} />`, c = (e, t) => a` <marker id="${e}" markerWidth="${n}" markerHeight="${r}" refX="${i}" refY="${r / 2}" orient="${t}">` + a`\n ${s}` + "\n </marker>";
1876
1911
  return c(a`arrowhead${t}`, "auto") + "\n" + c(a`arrowhead-start${t}`, "auto-start-reverse");
1877
1912
  }
1878
- function Kn(e) {
1913
+ function Yn(e) {
1879
1914
  return e.replace(/[^a-zA-Z0-9]/g, (e) => e.charCodeAt(0).toString(16));
1880
1915
  }
1881
- function qn(e, t, n) {
1916
+ function Xn(e, t, n) {
1882
1917
  let i = n.groupHeader + 16, o = [];
1883
1918
  o.push(a`<g class="subgraph" data-id="${r(e.id)}" data-label="${r(e.label)}">`), o.push(a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + a`rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), o.push(a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${i}" ` + a`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), o.push(" " + p(e.label, e.x + 12, e.y + i / 2, n.groupHeader, a`font-size="${n.groupHeader}" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`));
1884
- for (let r of e.children) o.push(qn(r, t, n));
1919
+ for (let r of e.children) o.push(Xn(r, t, n));
1885
1920
  return o.push("</g>"), o.join("\n");
1886
1921
  }
1887
- function Jn(e, t, n = !0, i) {
1922
+ function Zn(e, t, n = !0, i) {
1888
1923
  if (e.points.length < 2) return "";
1889
- let o = n && (e.animate ?? !1), s = t !== "linear", c = e.style === "invisible", l = e.style === "dotted" ? " stroke-dasharray=\"4 4\"" : "", u = e.style === "thick" ? R.connector * 2 : R.connector, d = c ? "none" : r(e.inlineStyle?.stroke ?? "var(--_line)"), f = r(e.inlineStyle?.["stroke-width"] ?? String(u)), p = e.inlineStyle?.stroke ? a`-${Kn(e.inlineStyle.stroke)}` : "", m = "";
1924
+ let o = n && (e.animate ?? !1), s = t !== "linear", c = e.style === "invisible", l = e.style === "dotted" ? " stroke-dasharray=\"4 4\"" : "", u = e.style === "thick" ? R.connector * 2 : R.connector, d = c ? "none" : r(e.inlineStyle?.stroke ?? "var(--_line)"), f = r(e.inlineStyle?.["stroke-width"] ?? String(u)), p = e.inlineStyle?.stroke ? a`-${Yn(e.inlineStyle.stroke)}` : "", m = "";
1890
1925
  c || (e.hasArrowEnd && (m += a` marker-end="url(#arrowhead${p})"`), e.hasArrowStart && (m += a` marker-start="url(#arrowhead-start${p})"`));
1891
1926
  let h = [
1892
1927
  a`class="edge${o ? " edge-animated" : ""}"`,
@@ -1897,35 +1932,35 @@ function Jn(e, t, n = !0, i) {
1897
1932
  a`data-arrow-end="${e.hasArrowEnd}"`
1898
1933
  ];
1899
1934
  e.label && h.push(a`data-label="${r(e.label)}"`), e.id && h.push(a`data-id="${r(e.id)}"`);
1900
- let g = o && !l ? " stroke-dasharray=\"8 6\"" : "", _ = s ? a`d="${fe(e.points, t)}"` : a`points="${Yn(e.points)}"`;
1935
+ let g = o && !l ? " stroke-dasharray=\"8 6\"" : "", _ = s ? a`d="${fe(e.points, t)}"` : a`points="${Qn(e.points)}"`;
1901
1936
  return a`<${s ? "path" : "polyline"} ${h.join(" ")} ${_} ` + a`fill="none" stroke="${d}" ` + a`stroke-width="${f}"${l}${g}${m}` + (i ? a` mask="url(#${i})"` : "") + " />";
1902
1937
  }
1903
- function Yn(e) {
1938
+ function Qn(e) {
1904
1939
  return e.map((e) => a`${e.x},${e.y}`).join(" ");
1905
1940
  }
1906
- function Xn(e, t, n) {
1941
+ function $n(e, t, n) {
1907
1942
  if (!e.label) return "";
1908
- let i = e.label, o = e.labelPosition ?? Qn(e.points), s = l(i, n.edgeLabel, L.edgeLabel), c = m(i, o.x, o.y, s.width, s.height, n.edgeLabel, 8, a`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${L.edgeLabel}" fill="var(--_text-sec)"`, "rx=\"2\" ry=\"2\" fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"1\"");
1943
+ let i = e.label, o = e.labelPosition ?? tr(e.points), s = l(i, n.edgeLabel, L.edgeLabel), c = m(i, o.x, o.y, s.width, s.height, n.edgeLabel, 8, a`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${L.edgeLabel}" fill="var(--_text-sec)"`, "rx=\"2\" ry=\"2\" fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"1\"");
1909
1944
  return a`<g class="edge-label" data-from="${r(e.source)}" data-to="${r(e.target)}" data-label="${r(i)}">\n` + a` ${c.replace(/\n/g, "\n ")}\n` + "</g>";
1910
1945
  }
1911
- function Zn(e, t) {
1946
+ function er(e, t) {
1912
1947
  let n = e[t];
1913
1948
  if (!n)
1914
1949
  /* v8 ignore next */
1915
1950
  throw Error(a`edgeMidpoint: missing point at index ${t}`);
1916
1951
  return n;
1917
1952
  }
1918
- function Qn(e) {
1953
+ function tr(e) {
1919
1954
  if (e.length === 0) return {
1920
1955
  x: 0,
1921
1956
  y: 0
1922
1957
  };
1923
1958
  if (e.length === 1) return e[0];
1924
1959
  let t = 0;
1925
- for (let n = 1; n < e.length; n++) t += $n(Zn(e, n - 1), Zn(e, n));
1960
+ for (let n = 1; n < e.length; n++) t += nr(er(e, n - 1), er(e, n));
1926
1961
  let n = t / 2;
1927
1962
  for (let t = 1; t < e.length; t++) {
1928
- let r = Zn(e, t - 1), i = Zn(e, t), a = $n(r, i);
1963
+ let r = er(e, t - 1), i = er(e, t), a = nr(r, i);
1929
1964
  if (n <= a) {
1930
1965
  let e = n / a;
1931
1966
  return {
@@ -1937,11 +1972,11 @@ function Qn(e) {
1937
1972
  }
1938
1973
  return e[e.length - 1];
1939
1974
  }
1940
- function $n(e, t) {
1975
+ function nr(e, t) {
1941
1976
  return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2);
1942
1977
  }
1943
- function er(e, t, n, o = !0) {
1944
- let s = tr(e), c = Fr(e, t, n), l = [], u = _(e.className), d = u ? a`node ${u}` : "node", f = e.interaction, p = [
1978
+ function rr(e, t, n, o = !0) {
1979
+ let s = ir(e), c = Rr(e, t, n), l = [], u = _(e.className), d = u ? a`node ${u}` : "node", f = e.interaction, p = [
1945
1980
  a`class="${d}"`,
1946
1981
  a`data-id="${r(e.id)}"`,
1947
1982
  a`data-label="${r(e.label)}"`,
@@ -1955,65 +1990,65 @@ function er(e, t, n, o = !0) {
1955
1990
  }
1956
1991
  return o && f?.tooltip && l.push(a`${h}<title>${i(f.tooltip)}</title>`), l.push(a`${h}${s.replace(/\n/g, a`\n${h}`)}`), c && l.push(a`${h}${c.replace(/\n/g, a`\n${h}`)}`), m && l.push(" </a>"), l.push("</g>"), l.join("\n");
1957
1992
  }
1958
- function tr(e) {
1993
+ function ir(e) {
1959
1994
  let { x: t, y: n, width: i, height: a, shape: o, inlineStyle: s } = e, c = r(s?.fill ?? "var(--_node-fill)"), l = r(s?.stroke ?? "var(--_node-stroke)"), u = r(s?.["stroke-width"] ?? String(R.innerBox));
1960
1995
  switch (o) {
1961
- case "diamond": return or(t, n, i, a, c, l, u);
1962
- case "rounded": return rr(t, n, i, a, c, l, u);
1963
- case "stadium": return ir(t, n, i, a, c, l, u);
1964
- case "circle": return ar(t, n, i, a, c, l, u);
1965
- case "subroutine": return sr(t, n, i, a, c, l, u);
1966
- case "doublecircle": return cr(t, n, i, a, c, l, u);
1967
- case "hexagon": return lr(t, n, i, a, c, l, u);
1968
- case "cylinder": return ur(t, n, i, a, c, l, u);
1969
- case "asymmetric": return dr(t, n, i, a, c, l, u);
1970
- case "trapezoid": return fr(t, n, i, a, c, l, u);
1971
- case "trapezoid-alt": return pr(t, n, i, a, c, l, u);
1972
- case "parallelogram": return mr(t, n, i, a, c, l, u);
1973
- case "parallelogram-alt": return hr(t, n, i, a, c, l, u);
1974
- case "state-start": return Nr(t, n, i, a);
1975
- case "state-end": return Pr(t, n, i, a);
1976
- case "document": return gr(t, n, i, a, c, l, u);
1977
- case "stacked-document": return _r(t, n, i, a, c, l, u, !0);
1978
- case "stacked-process": return _r(t, n, i, a, c, l, u, !1);
1979
- case "card": return vr(t, n, i, a, c, l, u);
1980
- case "lined-process": return yr(t, n, i, a, c, l, u);
1981
- case "divided-process": return br(t, n, i, a, c, l, u);
1982
- case "window-pane": return xr(t, n, i, a, c, l, u);
1983
- case "triangle": return Sr(t, n, i, a, c, l, u, !1);
1984
- case "flipped-triangle": return Sr(t, n, i, a, c, l, u, !0);
1985
- case "filled-circle": return Cr(t, n, i, a, l);
1986
- case "crossed-circle": return wr(t, n, i, a, c, l, u);
1987
- case "fork-join": return Tr(t, n, i, a, l);
1988
- case "notched-pentagon": return Er(t, n, i, a, c, l, u);
1989
- case "sloped-rectangle": return Dr(t, n, i, a, c, l, u);
1990
- case "flag": return Or(t, n, i, a, c, l, u);
1991
- case "bow-tie-rectangle": return kr(t, n, i, a, c, l, u);
1992
- case "half-rounded-rectangle": return Ar(t, n, i, a, c, l, u);
1993
- case "brace": return jr(t, n, i, a, c, l, u, "left");
1994
- case "brace-right": return jr(t, n, i, a, c, l, u, "right");
1995
- case "braces": return jr(t, n, i, a, c, l, u, "both");
1996
- case "bolt": return Mr(t, n, i, a, c, l, u);
1996
+ case "diamond": return lr(t, n, i, a, c, l, u);
1997
+ case "rounded": return or(t, n, i, a, c, l, u);
1998
+ case "stadium": return sr(t, n, i, a, c, l, u);
1999
+ case "circle": return cr(t, n, i, a, c, l, u);
2000
+ case "subroutine": return ur(t, n, i, a, c, l, u);
2001
+ case "doublecircle": return dr(t, n, i, a, c, l, u);
2002
+ case "hexagon": return fr(t, n, i, a, c, l, u);
2003
+ case "cylinder": return pr(t, n, i, a, c, l, u);
2004
+ case "asymmetric": return mr(t, n, i, a, c, l, u);
2005
+ case "trapezoid": return hr(t, n, i, a, c, l, u);
2006
+ case "trapezoid-alt": return gr(t, n, i, a, c, l, u);
2007
+ case "parallelogram": return _r(t, n, i, a, c, l, u);
2008
+ case "parallelogram-alt": return vr(t, n, i, a, c, l, u);
2009
+ case "state-start": return Ir(t, n, i, a);
2010
+ case "state-end": return Lr(t, n, i, a);
2011
+ case "document": return yr(t, n, i, a, c, l, u);
2012
+ case "stacked-document": return br(t, n, i, a, c, l, u, !0);
2013
+ case "stacked-process": return br(t, n, i, a, c, l, u, !1);
2014
+ case "card": return xr(t, n, i, a, c, l, u);
2015
+ case "lined-process": return Sr(t, n, i, a, c, l, u);
2016
+ case "divided-process": return Cr(t, n, i, a, c, l, u);
2017
+ case "window-pane": return wr(t, n, i, a, c, l, u);
2018
+ case "triangle": return Tr(t, n, i, a, c, l, u, !1);
2019
+ case "flipped-triangle": return Tr(t, n, i, a, c, l, u, !0);
2020
+ case "filled-circle": return Er(t, n, i, a, l);
2021
+ case "crossed-circle": return Dr(t, n, i, a, c, l, u);
2022
+ case "fork-join": return Or(t, n, i, a, l);
2023
+ case "notched-pentagon": return kr(t, n, i, a, c, l, u);
2024
+ case "sloped-rectangle": return Ar(t, n, i, a, c, l, u);
2025
+ case "flag": return jr(t, n, i, a, c, l, u);
2026
+ case "bow-tie-rectangle": return Mr(t, n, i, a, c, l, u);
2027
+ case "half-rounded-rectangle": return Nr(t, n, i, a, c, l, u);
2028
+ case "brace": return Pr(t, n, i, a, c, l, u, "left");
2029
+ case "brace-right": return Pr(t, n, i, a, c, l, u, "right");
2030
+ case "braces": return Pr(t, n, i, a, c, l, u, "both");
2031
+ case "bolt": return Fr(t, n, i, a, c, l, u);
1997
2032
  case "text":
1998
2033
  case "anchor": return "";
1999
- default: return nr(t, n, i, a, c, l, u);
2034
+ default: return ar(t, n, i, a, c, l, u);
2000
2035
  }
2001
2036
  }
2002
- function nr(e, t, n, r, i, o, s) {
2037
+ function ar(e, t, n, r, i, o, s) {
2003
2038
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + a`rx="0" ry="0" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2004
2039
  }
2005
- function rr(e, t, n, r, i, o, s) {
2040
+ function or(e, t, n, r, i, o, s) {
2006
2041
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + a`rx="6" ry="6" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2007
2042
  }
2008
- function ir(e, t, n, r, i, o, s) {
2043
+ function sr(e, t, n, r, i, o, s) {
2009
2044
  let c = r / 2;
2010
2045
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + a`rx="${c}" ry="${c}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2011
2046
  }
2012
- function ar(e, t, n, r, i, o, s) {
2047
+ function cr(e, t, n, r, i, o, s) {
2013
2048
  let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2;
2014
2049
  return a`<circle cx="${c}" cy="${l}" r="${u}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2015
2050
  }
2016
- function or(e, t, n, r, i, o, s) {
2051
+ function lr(e, t, n, r, i, o, s) {
2017
2052
  let c = e + n / 2, l = t + r / 2, u = n / 2, d = r / 2, f = [
2018
2053
  a`${c},${l - d}`,
2019
2054
  a`${c + u},${l}`,
@@ -2022,14 +2057,14 @@ function or(e, t, n, r, i, o, s) {
2022
2057
  ].join(" ");
2023
2058
  return a`<polygon points="${f}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2024
2059
  }
2025
- function sr(e, t, n, r, i, o, s) {
2060
+ function ur(e, t, n, r, i, o, s) {
2026
2061
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + a`rx="0" ry="0" fill="${i}" stroke="${o}" stroke-width="${s}" />` + a`\n<line x1="${e + 8}" y1="${t}" x2="${e + 8}" y2="${t + r}" ` + a`stroke="${o}" stroke-width="${s}" />` + a`\n<line x1="${e + n - 8}" y1="${t}" x2="${e + n - 8}" y2="${t + r}" ` + a`stroke="${o}" stroke-width="${s}" />`;
2027
2062
  }
2028
- function cr(e, t, n, r, i, o, s) {
2063
+ function dr(e, t, n, r, i, o, s) {
2029
2064
  let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2, d = u - 5;
2030
2065
  return a`<circle cx="${c}" cy="${l}" r="${u}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />` + a`\n<circle cx="${c}" cy="${l}" r="${d}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2031
2066
  }
2032
- function lr(e, t, n, r, i, o, s) {
2067
+ function fr(e, t, n, r, i, o, s) {
2033
2068
  let c = r / 4, l = [
2034
2069
  a`${e + c},${t}`,
2035
2070
  a`${e + n - c},${t}`,
@@ -2040,11 +2075,11 @@ function lr(e, t, n, r, i, o, s) {
2040
2075
  ].join(" ");
2041
2076
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2042
2077
  }
2043
- function ur(e, t, n, r, i, o, s) {
2078
+ function pr(e, t, n, r, i, o, s) {
2044
2079
  let c = e + n / 2, l = t + 7, u = r - 14;
2045
2080
  return a`<rect x="${e}" y="${l}" width="${n}" height="${u}" ` + a`fill="${i}" stroke="none" />` + a`\n<line x1="${e}" y1="${l}" x2="${e}" y2="${l + u}" stroke="${o}" stroke-width="${s}" />` + a`\n<line x1="${e + n}" y1="${l}" x2="${e + n}" y2="${l + u}" stroke="${o}" stroke-width="${s}" />` + a`\n<ellipse cx="${c}" cy="${t + r - 7}" rx="${n / 2}" ry="${7}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />` + a`\n<ellipse cx="${c}" cy="${l}" rx="${n / 2}" ry="${7}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2046
2081
  }
2047
- function dr(e, t, n, r, i, o, s) {
2082
+ function mr(e, t, n, r, i, o, s) {
2048
2083
  let c = [
2049
2084
  a`${e + 12},${t}`,
2050
2085
  a`${e + n},${t}`,
@@ -2054,7 +2089,7 @@ function dr(e, t, n, r, i, o, s) {
2054
2089
  ].join(" ");
2055
2090
  return a`<polygon points="${c}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2056
2091
  }
2057
- function fr(e, t, n, r, i, o, s) {
2092
+ function hr(e, t, n, r, i, o, s) {
2058
2093
  let c = n * .15, l = [
2059
2094
  a`${e + c},${t}`,
2060
2095
  a`${e + n - c},${t}`,
@@ -2063,7 +2098,7 @@ function fr(e, t, n, r, i, o, s) {
2063
2098
  ].join(" ");
2064
2099
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2065
2100
  }
2066
- function pr(e, t, n, r, i, o, s) {
2101
+ function gr(e, t, n, r, i, o, s) {
2067
2102
  let c = n * .15, l = [
2068
2103
  a`${e},${t}`,
2069
2104
  a`${e + n},${t}`,
@@ -2072,7 +2107,7 @@ function pr(e, t, n, r, i, o, s) {
2072
2107
  ].join(" ");
2073
2108
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2074
2109
  }
2075
- function mr(e, t, n, r, i, o, s) {
2110
+ function _r(e, t, n, r, i, o, s) {
2076
2111
  let c = n * .15, l = [
2077
2112
  a`${e + c},${t}`,
2078
2113
  a`${e + n},${t}`,
@@ -2081,7 +2116,7 @@ function mr(e, t, n, r, i, o, s) {
2081
2116
  ].join(" ");
2082
2117
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2083
2118
  }
2084
- function hr(e, t, n, r, i, o, s) {
2119
+ function vr(e, t, n, r, i, o, s) {
2085
2120
  let c = n * .15, l = [
2086
2121
  a`${e},${t}`,
2087
2122
  a`${e + n - c},${t}`,
@@ -2093,16 +2128,16 @@ function hr(e, t, n, r, i, o, s) {
2093
2128
  function H(e, t, n) {
2094
2129
  return a`fill="${e}" stroke="${t}" stroke-width="${n}"`;
2095
2130
  }
2096
- function gr(e, t, n, r, i, o, s) {
2131
+ function yr(e, t, n, r, i, o, s) {
2097
2132
  let c = Math.min(10, r * .16), l = t + r - c, u = a`M ${e} ${t} L ${e + n} ${t} L ${e + n} ${l} ` + a`C ${e + n * .75} ${l + c * 1.8} ${e + n * .25} ${l - c * .8} ${e} ${l} Z`;
2098
2133
  return a`<path d="${u}" ${H(i, o, s)} />`;
2099
2134
  }
2100
- function _r(e, t, n, r, i, o, s, c) {
2135
+ function br(e, t, n, r, i, o, s, c) {
2101
2136
  let l = n - 10, u = r - 10, d = [];
2102
2137
  for (let n = 2; n >= 1; n--) d.push(a`<rect x="${e + 5 * n}" y="${t + 5 * (2 - n)}" width="${l}" height="${u}" ` + a`${H(i, o, s)} />`);
2103
- return d.push(c ? gr(e, t + 10, l, u, i, o, s) : a`<rect x="${e}" y="${t + 10}" width="${l}" height="${u}" ${H(i, o, s)} />`), d.join("\n");
2138
+ return d.push(c ? yr(e, t + 10, l, u, i, o, s) : a`<rect x="${e}" y="${t + 10}" width="${l}" height="${u}" ${H(i, o, s)} />`), d.join("\n");
2104
2139
  }
2105
- function vr(e, t, n, r, i, o, s) {
2140
+ function xr(e, t, n, r, i, o, s) {
2106
2141
  let c = Math.min(14, n * .12, r * .3), l = [
2107
2142
  a`${e + c},${t}`,
2108
2143
  a`${e + n},${t}`,
@@ -2112,19 +2147,19 @@ function vr(e, t, n, r, i, o, s) {
2112
2147
  ].join(" ");
2113
2148
  return a`<polygon points="${l}" ${H(i, o, s)} />`;
2114
2149
  }
2115
- function yr(e, t, n, r, i, o, s) {
2150
+ function Sr(e, t, n, r, i, o, s) {
2116
2151
  let c = Math.min(12, n * .12);
2117
2152
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, o, s)} />\n` + a`<line x1="${e + c}" y1="${t}" x2="${e + c}" y2="${t + r}" stroke="${o}" stroke-width="${s}" />`;
2118
2153
  }
2119
- function br(e, t, n, r, i, o, s) {
2154
+ function Cr(e, t, n, r, i, o, s) {
2120
2155
  let c = t + Math.min(16, r * .3);
2121
2156
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, o, s)} />\n` + a`<line x1="${e}" y1="${c}" x2="${e + n}" y2="${c}" stroke="${o}" stroke-width="${s}" />`;
2122
2157
  }
2123
- function xr(e, t, n, r, i, o, s) {
2158
+ function wr(e, t, n, r, i, o, s) {
2124
2159
  let c = e + Math.min(16, n * .16), l = t + Math.min(14, r * .28);
2125
2160
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, o, s)} />\n` + a`<line x1="${c}" y1="${t}" x2="${c}" y2="${t + r}" stroke="${o}" stroke-width="${s}" />\n` + a`<line x1="${e}" y1="${l}" x2="${e + n}" y2="${l}" stroke="${o}" stroke-width="${s}" />`;
2126
2161
  }
2127
- function Sr(e, t, n, r, i, o, s, c) {
2162
+ function Tr(e, t, n, r, i, o, s, c) {
2128
2163
  let l = c ? [
2129
2164
  a`${e},${t}`,
2130
2165
  a`${e + n},${t}`,
@@ -2136,19 +2171,19 @@ function Sr(e, t, n, r, i, o, s, c) {
2136
2171
  ];
2137
2172
  return a`<polygon points="${l.join(" ")}" ${H(i, o, s)} />`;
2138
2173
  }
2139
- function Cr(e, t, n, r, i) {
2174
+ function Er(e, t, n, r, i) {
2140
2175
  let o = Math.min(n, r) / 2 - 2;
2141
2176
  return a`<circle cx="${e + n / 2}" cy="${t + r / 2}" r="${o}" fill="${i}" stroke="${i}" />`;
2142
2177
  }
2143
- function wr(e, t, n, r, i, o, s) {
2178
+ function Dr(e, t, n, r, i, o, s) {
2144
2179
  let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2 - 2, d = u / Math.SQRT2;
2145
2180
  return a`<circle cx="${c}" cy="${l}" r="${u}" ${H(i, o, s)} />\n` + a`<line x1="${c - d}" y1="${l - d}" x2="${c + d}" y2="${l + d}" stroke="${o}" stroke-width="${s}" />\n` + a`<line x1="${c + d}" y1="${l - d}" x2="${c - d}" y2="${l + d}" stroke="${o}" stroke-width="${s}" />`;
2146
2181
  }
2147
- function Tr(e, t, n, r, i) {
2182
+ function Or(e, t, n, r, i) {
2148
2183
  let o = Math.min(8, r);
2149
2184
  return a`<rect x="${e}" y="${t + (r - o) / 2}" width="${n}" height="${o}" fill="${i}" stroke="${i}" />`;
2150
2185
  }
2151
- function Er(e, t, n, r, i, o, s) {
2186
+ function kr(e, t, n, r, i, o, s) {
2152
2187
  let c = Math.min(14, n * .12, r * .3), l = [
2153
2188
  a`${e + c},${t}`,
2154
2189
  a`${e + n - c},${t}`,
@@ -2159,7 +2194,7 @@ function Er(e, t, n, r, i, o, s) {
2159
2194
  ].join(" ");
2160
2195
  return a`<polygon points="${l}" ${H(i, o, s)} />`;
2161
2196
  }
2162
- function Dr(e, t, n, r, i, o, s) {
2197
+ function Ar(e, t, n, r, i, o, s) {
2163
2198
  let c = Math.min(12, r * .3), l = [
2164
2199
  a`${e},${t + c}`,
2165
2200
  a`${e + n},${t}`,
@@ -2168,23 +2203,23 @@ function Dr(e, t, n, r, i, o, s) {
2168
2203
  ].join(" ");
2169
2204
  return a`<polygon points="${l}" ${H(i, o, s)} />`;
2170
2205
  }
2171
- function Or(e, t, n, r, i, o, s) {
2206
+ function jr(e, t, n, r, i, o, s) {
2172
2207
  let c = Math.min(8, r * .14), l = a`M ${e} ${t + c} ` + a`C ${e + n * .25} ${t - c} ${e + n * .75} ${t + c * 2} ${e + n} ${t + c} ` + a`L ${e + n} ${t + r - c} ` + a`C ${e + n * .75} ${t + r + c} ${e + n * .25} ${t + r - c * 2} ${e} ${t + r - c} Z`;
2173
2208
  return a`<path d="${l}" ${H(i, o, s)} />`;
2174
2209
  }
2175
- function kr(e, t, n, r, i, o, s) {
2210
+ function Mr(e, t, n, r, i, o, s) {
2176
2211
  let c = Math.min(14, n * .12), l = a`M ${e + c} ${t} L ${e + n} ${t} ` + a`Q ${e + n - c * 1.4} ${t + r / 2} ${e + n} ${t + r} ` + a`L ${e + c} ${t + r} ` + a`Q ${e + c * 1.4} ${t + r / 2} ${e + c} ${t} Z`;
2177
2212
  return a`<path d="${l}" ${H(i, o, s)} />`;
2178
2213
  }
2179
- function Ar(e, t, n, r, i, o, s) {
2214
+ function Nr(e, t, n, r, i, o, s) {
2180
2215
  let c = r / 2, l = Math.max(0, n - c), u = a`M ${e} ${t} L ${e + l} ${t} ` + a`A ${c} ${c} 0 0 1 ${e + l} ${t + r} ` + a`L ${e} ${t + r} Z`;
2181
2216
  return a`<path d="${u}" ${H(i, o, s)} />`;
2182
2217
  }
2183
- function jr(e, t, n, r, i, o, s, c) {
2218
+ function Pr(e, t, n, r, i, o, s, c) {
2184
2219
  let l = Math.min(10, n * .12), u = [a`<rect x="${e}" y="${t}" width="${n}" height="${r}" fill="none" stroke="none" />`], d = a`M ${e + l} ${t} Q ${e} ${t} ${e} ${t + r * .25} ` + a`Q ${e} ${t + r / 2} ${e - l * .4} ${t + r / 2} ` + a`Q ${e} ${t + r / 2} ${e} ${t + r * .75} ` + a`Q ${e} ${t + r} ${e + l} ${t + r}`, f = a`M ${e + n - l} ${t} Q ${e + n} ${t} ${e + n} ${t + r * .25} ` + a`Q ${e + n} ${t + r / 2} ${e + n + l * .4} ${t + r / 2} ` + a`Q ${e + n} ${t + r / 2} ${e + n} ${t + r * .75} ` + a`Q ${e + n} ${t + r} ${e + n - l} ${t + r}`;
2185
2220
  return (c === "left" || c === "both") && u.push(a`<path d="${d}" fill="none" stroke="${o}" stroke-width="${s}" />`), (c === "right" || c === "both") && u.push(a`<path d="${f}" fill="none" stroke="${o}" stroke-width="${s}" />`), u.join("\n");
2186
2221
  }
2187
- function Mr(e, t, n, r, i, o, s) {
2222
+ function Fr(e, t, n, r, i, o, s) {
2188
2223
  let c = [
2189
2224
  a`${e + n * .42},${t}`,
2190
2225
  a`${e + n},${t}`,
@@ -2196,28 +2231,28 @@ function Mr(e, t, n, r, i, o, s) {
2196
2231
  ].join(" ");
2197
2232
  return a`<polygon points="${c}" ${H(i, o, s)} />`;
2198
2233
  }
2199
- function Nr(e, t, n, r) {
2234
+ function Ir(e, t, n, r) {
2200
2235
  let i = e + n / 2, o = t + r / 2, s = Math.min(n, r) / 2 - 2;
2201
2236
  return a`<circle cx="${i}" cy="${o}" r="${s}" fill="var(--_text)" stroke="none" />`;
2202
2237
  }
2203
- function Pr(e, t, n, r) {
2238
+ function Lr(e, t, n, r) {
2204
2239
  let i = e + n / 2, o = t + r / 2, s = Math.min(n, r) / 2 - 2, c = s - 4;
2205
2240
  return a`<circle cx="${i}" cy="${o}" r="${s}" ` + a`fill="none" stroke="var(--_text)" stroke-width="${R.innerBox * 2}" />` + a`\n<circle cx="${i}" cy="${o}" r="${c}" fill="var(--_text)" stroke="none" />`;
2206
2241
  }
2207
- function Fr(e, t, n) {
2242
+ function Rr(e, t, n) {
2208
2243
  if ((e.shape === "state-start" || e.shape === "state-end") && !e.label) return "";
2209
2244
  let i = e.x + e.width / 2, o = e.y + e.height / 2, c = r(e.inlineStyle?.color ?? s(e.inlineStyle?.fill, "var(--_text)")), l = a`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${L.nodeLabel}" fill="${c}"`, u = e.inlineStyle?.["font-family"];
2210
2245
  return u && (l += a` style="font-family: ${r(u)};"`), p(e.label, i, o, n.nodeLabel, l);
2211
2246
  }
2212
- function Ir(e) {
2247
+ function zr(e) {
2213
2248
  return r(e).replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\t/g, "&#9;");
2214
2249
  }
2215
- function Lr(e, t) {
2216
- return t === void 0 ? e : e.replace("<svg ", a`<svg data-src="${Ir(t)}" `);
2250
+ function Br(e, t) {
2251
+ return t === void 0 ? e : e.replace("<svg ", a`<svg data-src="${zr(t)}" `);
2217
2252
  }
2218
2253
  //#endregion
2219
2254
  //#region packages/svg-renderer/src/resolve-colors.ts
2220
- var Rr = class {
2255
+ var Vr = class {
2221
2256
  raw = /* @__PURE__ */ new Map();
2222
2257
  resolved = /* @__PURE__ */ new Map();
2223
2258
  inProgress = /* @__PURE__ */ new Set();
@@ -2229,13 +2264,13 @@ var Rr = class {
2229
2264
  let t = this.raw.get(e);
2230
2265
  if (t === void 0 || this.inProgress.has(e)) return;
2231
2266
  this.inProgress.add(e);
2232
- let n = Gr(t, this).trim();
2267
+ let n = Jr(t, this).trim();
2233
2268
  this.inProgress.delete(e);
2234
2269
  let r = !/\bvar\(|\bcolor-mix\(/.test(n);
2235
2270
  return this.resolved.set(e, r ? n : void 0), r ? n : void 0;
2236
2271
  }
2237
2272
  };
2238
- function zr(e, t) {
2273
+ function Hr(e, t) {
2239
2274
  let n = 0;
2240
2275
  for (let r = t; r < e.length; r++) {
2241
2276
  let t = e[r];
@@ -2244,7 +2279,7 @@ function zr(e, t) {
2244
2279
  }
2245
2280
  return -1;
2246
2281
  }
2247
- function Br(e) {
2282
+ function Ur(e) {
2248
2283
  let t = [], n = 0, r = 0;
2249
2284
  for (let i = 0; i < e.length; i++) {
2250
2285
  let a = e[i];
@@ -2252,12 +2287,12 @@ function Br(e) {
2252
2287
  }
2253
2288
  return t.push(e.slice(r)), t;
2254
2289
  }
2255
- var Vr = "(?<![\\w-])(var|color-mix)\\(";
2256
- function Hr(e, t) {
2257
- let [n, ...r] = Br(e), i = (n ?? "").trim(), a = t.lookup(i);
2290
+ var Wr = "(?<![\\w-])(var|color-mix)\\(";
2291
+ function Gr(e, t) {
2292
+ let [n, ...r] = Ur(e), i = (n ?? "").trim(), a = t.lookup(i);
2258
2293
  return a === void 0 ? r.length > 0 ? r.join(",").trim() : null : a;
2259
2294
  }
2260
- function Ur(e) {
2295
+ function Kr(e) {
2261
2296
  let t = e.trim().split(/\s+/), n, r;
2262
2297
  for (let e of t) if (/^[\d.]+%$/.test(e)) {
2263
2298
  if (r !== void 0) return null;
@@ -2271,61 +2306,61 @@ function Ur(e) {
2271
2306
  pct: r
2272
2307
  };
2273
2308
  }
2274
- function Wr(e) {
2275
- let t = Br(e);
2309
+ function qr(e) {
2310
+ let t = Ur(e);
2276
2311
  if (t.length !== 3) return null;
2277
2312
  let [n, r, i] = t;
2278
2313
  if (n === void 0 || r === void 0 || i === void 0 || !/^\s*in\s+srgb\s*$/i.test(n)) return null;
2279
- let a = Ur(r), s = Ur(i);
2314
+ let a = Kr(r), s = Kr(i);
2280
2315
  if (!a || !s) return null;
2281
2316
  let c = f(a.color), l = f(s.color);
2282
2317
  if (!c || !l) return null;
2283
2318
  let u = d(c, l, a.pct, s.pct);
2284
2319
  return u ? o(u) : null;
2285
2320
  }
2286
- function Gr(e, t) {
2287
- let n = "", r = 0, i = new RegExp(Vr, "g"), a;
2321
+ function Jr(e, t) {
2322
+ let n = "", r = 0, i = new RegExp(Wr, "g"), a;
2288
2323
  for (; (a = i.exec(e)) !== null;) {
2289
2324
  let o = a[1];
2290
2325
  if (o === void 0) continue;
2291
- let s = a.index, c = s + o.length, l = zr(e, c);
2326
+ let s = a.index, c = s + o.length, l = Hr(e, c);
2292
2327
  if (l === -1) break;
2293
- let u = Gr(e.slice(c + 1, l), t), d = o === "var" ? Hr(u, t) : Wr(u);
2328
+ let u = Jr(e.slice(c + 1, l), t), d = o === "var" ? Gr(u, t) : qr(u);
2294
2329
  n += e.slice(r, s), n += d ?? `${o}(${u})`, r = l + 1, i.lastIndex = r;
2295
2330
  }
2296
2331
  return n + e.slice(r);
2297
2332
  }
2298
- function Kr(e, t) {
2299
- let n = new Rr();
2333
+ function Yr(e, t) {
2334
+ let n = new Vr();
2300
2335
  for (let [e, r] of Object.entries(t)) n.declare(e, r);
2301
- return Gr(e, n);
2336
+ return Jr(e, n);
2302
2337
  }
2303
- var qr = /(--[\w-]+)\s*:\s*([^;{}]+)/g, Jr = /(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g, Yr = /* @__PURE__ */ new Set(["data-src"]);
2304
- function Xr(e, t) {
2305
- qr.lastIndex = 0;
2338
+ var Xr = /(--[\w-]+)\s*:\s*([^;{}]+)/g, Zr = /(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g, Qr = /* @__PURE__ */ new Set(["data-src"]);
2339
+ function $r(e, t) {
2340
+ Xr.lastIndex = 0;
2306
2341
  let n;
2307
- for (; (n = qr.exec(e)) !== null;) {
2342
+ for (; (n = Xr.exec(e)) !== null;) {
2308
2343
  let [, e, r] = n;
2309
2344
  e !== void 0 && r !== void 0 && t.declare(e, r.trim());
2310
2345
  }
2311
2346
  }
2312
- function Zr(e, t) {
2313
- return e.replace(Jr, (e, n, r, i, a) => {
2314
- if (Yr.has(r)) return e;
2347
+ function ei(e, t) {
2348
+ return e.replace(Zr, (e, n, r, i, a) => {
2349
+ if (Qr.has(r)) return e;
2315
2350
  let o = a[0] ?? "\"";
2316
- return `${n}${r}${i}${o}${Gr(a.slice(1, -1), t)}${o}`;
2351
+ return `${n}${r}${i}${o}${Jr(a.slice(1, -1), t)}${o}`;
2317
2352
  });
2318
2353
  }
2319
- function Qr(e, t) {
2320
- let n = new Rr();
2354
+ function ti(e, t) {
2355
+ let n = new Vr();
2321
2356
  n.declare("--bg", t.bg), n.declare("--fg", t.fg), t.line && n.declare("--line", t.line), t.accent && n.declare("--accent", t.accent), t.muted && n.declare("--muted", t.muted), t.surface && n.declare("--surface", t.surface), t.border && n.declare("--border", t.border);
2322
2357
  for (let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)) {
2323
2358
  let e = t[1];
2324
- e !== void 0 && Xr(e, n);
2359
+ e !== void 0 && $r(e, n);
2325
2360
  }
2326
2361
  for (let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)) {
2327
2362
  let e = t[1];
2328
- e !== void 0 && Xr(e.slice(1, -1), n);
2363
+ e !== void 0 && $r(e.slice(1, -1), n);
2329
2364
  }
2330
2365
  let r = "", i = 0;
2331
2366
  for (; i < e.length;) {
@@ -2334,7 +2369,7 @@ function Qr(e, t) {
2334
2369
  if (r += e.slice(i, t), e.startsWith("<style", t)) {
2335
2370
  let a = e.indexOf(">", t), o = e.indexOf("</style>", t);
2336
2371
  if (a === -1 || o === -1) break;
2337
- r += e.slice(t, a + 1), r += Gr(e.slice(a + 1, o), n), r += "</style>", i = o + 8;
2372
+ r += e.slice(t, a + 1), r += Jr(e.slice(a + 1, o), n), r += "</style>", i = o + 8;
2338
2373
  continue;
2339
2374
  }
2340
2375
  let a = -1, o = null;
@@ -2349,7 +2384,7 @@ function Qr(e, t) {
2349
2384
  }
2350
2385
  if (a === -1) break;
2351
2386
  let s = e.slice(t, a + 1);
2352
- r += s.startsWith("<!") || s.startsWith("<?") || s.startsWith("</") ? s : Zr(s, n), i = a + 1;
2387
+ r += s.startsWith("<!") || s.startsWith("<?") || s.startsWith("</") ? s : ei(s, n), i = a + 1;
2353
2388
  }
2354
2389
  return r + e.slice(i);
2355
2390
  }
@@ -2374,32 +2409,32 @@ var U = {
2374
2409
  namespacePad: 16,
2375
2410
  namespaceTitleFontSize: 12
2376
2411
  };
2377
- function $r(e) {
2412
+ function ni(e) {
2378
2413
  return `note ${e}`;
2379
2414
  }
2380
- function ei(e) {
2415
+ function ri(e) {
2381
2416
  return `${e} link`;
2382
2417
  }
2383
- function ti(e) {
2418
+ function ii(e) {
2384
2419
  return `namespace ${e}`;
2385
2420
  }
2386
- function ni(e) {
2421
+ function ai(e) {
2387
2422
  let t = new Set(e.classes.map((e) => e.id)), n = /* @__PURE__ */ new Set(), r = [];
2388
2423
  for (let [i, a] of e.namespaces.entries()) {
2389
2424
  let e = [];
2390
2425
  for (let r of a.classIds) !t.has(r) || n.has(r) || (n.add(r), e.push(r));
2391
2426
  e.length > 0 && r.push({
2392
- id: ti(i),
2427
+ id: ii(i),
2393
2428
  name: a.name,
2394
2429
  classIds: e
2395
2430
  });
2396
2431
  }
2397
2432
  return r;
2398
2433
  }
2399
- function ri(e, t) {
2434
+ function oi(e, t) {
2400
2435
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = Te(t.fontSizes);
2401
2436
  for (let t of e.classes) {
2402
- let e = t.annotation ? U.headerBaseHeight + U.annotationHeight : U.headerBaseHeight, r = t.attributes.length > 0 ? t.attributes.length * U.memberRowHeight + U.sectionPadY : U.emptySectionHeight, a = t.methods.length > 0 ? t.methods.length * U.memberRowHeight + U.sectionPadY : U.emptySectionHeight, o = F(t.label, i.nodeLabel, L.nodeLabel), s = si(t.attributes), c = si(t.methods), l = Math.max(U.minWidth, o + U.boxPadX * 2, s + U.boxPadX * 2, c + U.boxPadX * 2), u = e + r + a;
2437
+ let e = t.annotation ? U.headerBaseHeight + U.annotationHeight : U.headerBaseHeight, r = t.attributes.length > 0 ? t.attributes.length * U.memberRowHeight + U.sectionPadY : U.emptySectionHeight, a = t.methods.length > 0 ? t.methods.length * U.memberRowHeight + U.sectionPadY : U.emptySectionHeight, o = F(t.label, i.nodeLabel, L.nodeLabel), s = ui(t.attributes), c = ui(t.methods), l = Math.max(U.minWidth, o + U.boxPadX * 2, s + U.boxPadX * 2, c + U.boxPadX * 2), u = e + r + a;
2403
2438
  n.set(t.id, {
2404
2439
  width: l,
2405
2440
  height: u,
@@ -2408,7 +2443,7 @@ function ri(e, t) {
2408
2443
  methodHeight: a
2409
2444
  });
2410
2445
  }
2411
- let a = ni(e), o = /* @__PURE__ */ new Map();
2446
+ let a = ai(e), o = /* @__PURE__ */ new Map();
2412
2447
  for (let e of a) for (let t of e.classIds) o.set(t, e.id);
2413
2448
  let s = /* @__PURE__ */ new Map(), c = [];
2414
2449
  for (let e of a) {
@@ -2442,12 +2477,12 @@ function ri(e, t) {
2442
2477
  }));
2443
2478
  let f = new Set(n.keys());
2444
2479
  for (let [t, n] of e.notes.entries()) {
2445
- let e = $r(t), a = l(n.text, i.edgeLabel, L.edgeLabel), o = {
2480
+ let e = ni(t), a = l(n.text, i.edgeLabel, L.edgeLabel), o = {
2446
2481
  width: a.width + U.notePadX * 2,
2447
2482
  height: a.height + U.notePadY * 2
2448
2483
  };
2449
2484
  r.set(e, o), c.push(Fe(e, o)), n.forClass !== void 0 && f.has(n.forClass) && d.push(Re({
2450
- id: ei(e),
2485
+ id: ri(e),
2451
2486
  source: e,
2452
2487
  target: n.forClass,
2453
2488
  labelStyle: u
@@ -2476,7 +2511,7 @@ function ri(e, t) {
2476
2511
  namespaces: a
2477
2512
  };
2478
2513
  }
2479
- function ii(e, t, n, r, i) {
2514
+ function si(e, t, n, r, i) {
2480
2515
  let a = /* @__PURE__ */ new Map();
2481
2516
  for (let e of t.classes) a.set(e.id, e);
2482
2517
  let o = new Set(i.map((e) => e.id)), s = /* @__PURE__ */ new Map(), c = [];
@@ -2543,7 +2578,7 @@ function ii(e, t, n, r, i) {
2543
2578
  if (!t)
2544
2579
  /* v8 ignore next */
2545
2580
  throw Error(`Missing ELK edge for relationship ${e}`);
2546
- let r = l(t), i = vt(t, r.x, r.y), a = yt(t, r.x, r.y);
2581
+ let r = l(t), i = xt(t, r.x, r.y), a = St(t, r.x, r.y);
2547
2582
  f.push({
2548
2583
  from: n.from,
2549
2584
  to: n.to,
@@ -2562,11 +2597,11 @@ function ii(e, t, n, r, i) {
2562
2597
  for (let e of c) g.set(e.id, e);
2563
2598
  let _ = [];
2564
2599
  for (let [e, n] of t.notes.entries()) {
2565
- let t = $r(e), i = g.get(t), a = r.get(t);
2600
+ let t = ni(e), i = g.get(t), a = r.get(t);
2566
2601
  if (!i || !a)
2567
2602
  /* v8 ignore next */
2568
2603
  throw Error(`Missing layout for note ${e}`);
2569
- let o = m.get(ei(t));
2604
+ let o = m.get(ri(t));
2570
2605
  _.push({
2571
2606
  id: t,
2572
2607
  text: n.text,
@@ -2575,7 +2610,7 @@ function ii(e, t, n, r, i) {
2575
2610
  y: i.y ?? 0,
2576
2611
  width: i.width ?? a.width,
2577
2612
  height: i.height ?? a.height,
2578
- ...o ? { linkPoints: vt(o, l(o).x, l(o).y) } : {}
2613
+ ...o ? { linkPoints: xt(o, l(o).x, l(o).y) } : {}
2579
2614
  });
2580
2615
  }
2581
2616
  return {
@@ -2587,7 +2622,7 @@ function ii(e, t, n, r, i) {
2587
2622
  namespaces: u
2588
2623
  };
2589
2624
  }
2590
- function ai(e, t = {}) {
2625
+ function ci(e, t = {}) {
2591
2626
  if (e.classes.length === 0 && e.notes.length === 0) return {
2592
2627
  width: 0,
2593
2628
  height: 0,
@@ -2596,54 +2631,54 @@ function ai(e, t = {}) {
2596
2631
  notes: [],
2597
2632
  namespaces: []
2598
2633
  };
2599
- let { elkGraph: n, classSizes: r, noteSizes: i, namespaces: a } = ri(e, t);
2600
- return ii(ye(n, t.layoutCache), e, r, i, a);
2634
+ let { elkGraph: n, classSizes: r, noteSizes: i, namespaces: a } = oi(e, t);
2635
+ return si(ye(n, t.layoutCache), e, r, i, a);
2601
2636
  }
2602
- function oi(e) {
2637
+ function li(e) {
2603
2638
  return e.length * Math.ceil(Se("M", U.memberFontSize));
2604
2639
  }
2605
- function si(e) {
2640
+ function ui(e) {
2606
2641
  if (e.length === 0) return 0;
2607
2642
  let t = 0;
2608
2643
  for (let n of e) {
2609
- let e = oi(j(n));
2644
+ let e = li(ee(n));
2610
2645
  e > t && (t = e);
2611
2646
  }
2612
2647
  return t;
2613
2648
  }
2614
2649
  //#endregion
2615
2650
  //#region packages/svg-renderer/src/class/renderer.ts
2616
- var ci = {
2651
+ var di = {
2617
2652
  memberSize: 11,
2618
2653
  memberWeight: 400,
2619
2654
  annotationSize: 10,
2620
2655
  annotationWeight: 500
2621
2656
  };
2622
- function li(e, t, n = "Inter", r = !1, i = I, a, o, s, c = !0, l = {}) {
2657
+ function fi(e, t, n = "Inter", r = !1, i = I, a, o, s, c = !0, l = {}) {
2623
2658
  let u = [], d = c && e.classes.some((e) => !!g(e.interaction?.href));
2624
- u.push(Lr(x(e.width, e.height, t, r, o, s, d, l.styleAttribute), a)), u.push(ke(n, !0, l.nonce)), u.push("<defs>"), u.push(di()), u.push("</defs>");
2625
- for (let t of e.namespaces) u.push(ui(t));
2626
- for (let t of e.relationships) u.push(vi(t));
2627
- for (let t of e.notes) u.push(_i(t));
2628
- for (let t of e.classes) u.push(fi(t, i, c));
2629
- for (let t of e.notes) u.push(gi(t, i));
2630
- for (let t of e.relationships) u.push(xi(t, i));
2659
+ u.push(Br(x(e.width, e.height, t, r, o, s, d, l.styleAttribute), a)), u.push(ke(n, !0, l.nonce)), u.push("<defs>"), u.push(mi()), u.push("</defs>");
2660
+ for (let t of e.namespaces) u.push(pi(t));
2661
+ for (let t of e.relationships) u.push(xi(t));
2662
+ for (let t of e.notes) u.push(bi(t));
2663
+ for (let t of e.classes) u.push(hi(t, i, c));
2664
+ for (let t of e.notes) u.push(yi(t, i));
2665
+ for (let t of e.relationships) u.push(wi(t, i));
2631
2666
  return u.push("</svg>"), u.join("\n");
2632
2667
  }
2633
- function ui(e) {
2668
+ function pi(e) {
2634
2669
  let { x: t, y: n, width: i, height: o } = e, s = U.namespaceTitleHeight, c = R.outerBox;
2635
2670
  return [
2636
2671
  a`<g class="class-namespace" data-id="${r(e.name)}" data-label="${r(e.name)}">`,
2637
2672
  a` <rect x="${t}" y="${n}" width="${i}" height="${o}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${c}" />`,
2638
2673
  a` <rect x="${t}" y="${n}" width="${i}" height="${s}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${c}" />`,
2639
- a` <text x="${t + U.namespacePad}" y="${n + s / 2}" dy="${z}" font-size="${U.namespaceTitleFontSize}" font-weight="${L.groupHeader}" fill="var(--_text-sec)">${wi(e.name)}</text>`,
2674
+ a` <text x="${t + U.namespacePad}" y="${n + s / 2}" dy="${z}" font-size="${U.namespaceTitleFontSize}" font-weight="${L.groupHeader}" fill="var(--_text-sec)">${Di(e.name)}</text>`,
2640
2675
  "</g>"
2641
2676
  ].join("\n");
2642
2677
  }
2643
- function di() {
2678
+ function mi() {
2644
2679
  return " <marker id=\"cls-inherit\" markerWidth=\"12\" markerHeight=\"10\" refX=\"12\" refY=\"5\" orient=\"auto-start-reverse\">\n <polygon points=\"0 0, 12 5, 0 10\" fill=\"var(--bg)\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>\n <marker id=\"cls-composition\" markerWidth=\"18\" markerHeight=\"14\" refX=\"16.5\" refY=\"7\" orient=\"auto-start-reverse\">\n <polygon points=\"9 1.5, 16.5 7, 9 12.5, 1.5 7\" fill=\"var(--_arrow)\" stroke=\"var(--_arrow)\" stroke-width=\"1\" />\n </marker>\n <marker id=\"cls-aggregation\" markerWidth=\"18\" markerHeight=\"14\" refX=\"16.5\" refY=\"7\" orient=\"auto-start-reverse\">\n <polygon points=\"9 1.5, 16.5 7, 9 12.5, 1.5 7\" fill=\"var(--bg)\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>\n <marker id=\"cls-arrow\" markerWidth=\"8\" markerHeight=\"6\" refX=\"8\" refY=\"3\" orient=\"auto-start-reverse\">\n <polyline points=\"0 0, 8 3, 0 6\" fill=\"none\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>";
2645
2680
  }
2646
- function fi(e, t, n = !0) {
2681
+ function hi(e, t, n = !0) {
2647
2682
  let { x: i, y: o, width: c, height: l, headerHeight: u, attrHeight: d, inlineStyle: f } = e, m = [], h = e.interaction, v = r(f?.fill ?? "var(--_node-fill)"), y = r(f?.stroke ?? "var(--_node-stroke)"), b = r(f?.["stroke-width"] ?? String(R.outerBox)), x = f?.fill ? v : "var(--_group-hdr)", S = f?.color ? r(f.color) : f?.fill ? r(s(f.fill, "var(--_text)")) : void 0, C = e.annotation ? a` data-annotation="${r(e.annotation)}"` : "", w = _(e.className), T = [
2648
2683
  a`class="${w ? a`class-node ${w}` : "class-node"}"`,
2649
2684
  a`data-id="${r(e.id)}"`,
@@ -2655,53 +2690,53 @@ function fi(e, t, n = !0) {
2655
2690
  let e = h?.target ? a` target="${r(h.target)}"` : "";
2656
2691
  m.push(a` <a href="${r(E)}"${e}>`);
2657
2692
  }
2658
- n && h?.tooltip && m.push(a` <title>${wi(h.tooltip)}</title>`), m.push(a` <rect x="${i}" y="${o}" width="${c}" height="${l}" ` + a`rx="0" ry="0" fill="${v}" stroke="${y}" stroke-width="${b}" />`), m.push(a` <rect x="${i}" y="${o}" width="${c}" height="${u}" ` + a`rx="0" ry="0" fill="${x}" stroke="${y}" stroke-width="${b}" />`);
2693
+ n && h?.tooltip && m.push(a` <title>${Di(h.tooltip)}</title>`), m.push(a` <rect x="${i}" y="${o}" width="${c}" height="${l}" ` + a`rx="0" ry="0" fill="${v}" stroke="${y}" stroke-width="${b}" />`), m.push(a` <rect x="${i}" y="${o}" width="${c}" height="${u}" ` + a`rx="0" ry="0" fill="${x}" stroke="${y}" stroke-width="${b}" />`);
2659
2694
  let D = o + u / 2;
2660
2695
  if (e.annotation) {
2661
2696
  let t = o + 12;
2662
- m.push(a` <text x="${i + c / 2}" y="${t}" text-anchor="middle" dy="${z}" ` + a`font-size="${ci.annotationSize}" font-weight="${ci.annotationWeight}" ` + a`font-style="italic" fill="${S ?? "var(--_text-muted)"}">&lt;&lt;${wi(e.annotation)}&gt;&gt;</text>`), D = o + u / 2 + 6;
2697
+ m.push(a` <text x="${i + c / 2}" y="${t}" text-anchor="middle" dy="${z}" ` + a`font-size="${di.annotationSize}" font-weight="${di.annotationWeight}" ` + a`font-style="italic" fill="${S ?? "var(--_text-muted)"}">&lt;&lt;${Di(e.annotation)}&gt;&gt;</text>`), D = o + u / 2 + 6;
2663
2698
  }
2664
2699
  m.push(" " + p(e.label, i + c / 2, D, t.nodeLabel, a`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="${S ?? "var(--_text)"}"`));
2665
2700
  let O = o + u;
2666
2701
  m.push(a` <line x1="${i}" y1="${O}" x2="${i + c}" y2="${O}" ` + a`stroke="${y}" stroke-width="${R.innerBox}" />`);
2667
2702
  for (let t = 0; t < e.attributes.length; t++) {
2668
2703
  let n = e.attributes[t], r = O + 4 + t * 20 + 10;
2669
- m.push(" " + mi(n, i + U.boxPadX, r, S));
2704
+ m.push(" " + _i(n, i + U.boxPadX, r, S));
2670
2705
  }
2671
2706
  let k = O + d;
2672
2707
  m.push(a` <line x1="${i}" y1="${k}" x2="${i + c}" y2="${k}" ` + a`stroke="${y}" stroke-width="${R.innerBox}" />`);
2673
2708
  for (let t = 0; t < e.methods.length; t++) {
2674
2709
  let n = e.methods[t], r = k + 4 + t * 20 + 10;
2675
- m.push(" " + mi(n, i + U.boxPadX, r, S));
2710
+ m.push(" " + _i(n, i + U.boxPadX, r, S));
2676
2711
  }
2677
2712
  return E && m.push(" </a>"), m.push("</g>"), m.join("\n");
2678
2713
  }
2679
- var pi = 700;
2680
- function mi(e, t, n, r) {
2714
+ var gi = 700;
2715
+ function _i(e, t, n, r) {
2681
2716
  let i = e.isAbstract ? " font-style=\"italic\"" : "", o = e.isStatic ? " text-decoration=\"underline\"" : "", s = r ?? "var(--_text-faint)", c = r ?? "var(--_text-sec)", l = r ?? "var(--_text-muted)", u = [];
2682
- e.visibility && u.push(a`<tspan fill="${c}" font-weight="${pi}">${wi(e.visibility)}</tspan><tspan fill="${s}"> </tspan>`);
2717
+ e.visibility && u.push(a`<tspan fill="${c}" font-weight="${gi}">${Di(e.visibility)}</tspan><tspan fill="${s}"> </tspan>`);
2683
2718
  let d = e.isMethod ? a`${e.name}(${e.params || ""})` : e.name;
2684
- return u.push(a`<tspan fill="${c}">${wi(d)}</tspan>`), e.type && (u.push(a`<tspan fill="${s}">: </tspan>`), u.push(a`<tspan fill="${l}">${wi(e.type)}</tspan>`)), a`<text x="${t}" y="${n}" class="mono" dy="${z}" ` + a`font-size="${ci.memberSize}" font-weight="${ci.memberWeight}"${i}${o}>` + a`${u.join("")}</text>`;
2719
+ return u.push(a`<tspan fill="${c}">${Di(d)}</tspan>`), e.type && (u.push(a`<tspan fill="${s}">: </tspan>`), u.push(a`<tspan fill="${l}">${Di(e.type)}</tspan>`)), a`<text x="${t}" y="${n}" class="mono" dy="${z}" ` + a`font-size="${di.memberSize}" font-weight="${di.memberWeight}"${i}${o}>` + a`${u.join("")}</text>`;
2685
2720
  }
2686
- var hi = 6;
2687
- function gi(e, t) {
2721
+ var vi = 6;
2722
+ function yi(e, t) {
2688
2723
  let { x: n, y: i, width: o, height: s } = e, c = e.forClass === void 0 ? "" : a` data-for="${r(e.forClass)}"`, l = [
2689
2724
  a`${n},${i}`,
2690
- a`${n + o - hi},${i}`,
2691
- a`${n + o},${i + hi}`,
2725
+ a`${n + o - vi},${i}`,
2726
+ a`${n + o},${i + vi}`,
2692
2727
  a`${n + o},${i + s}`,
2693
2728
  a`${n},${i + s}`
2694
- ].join(" "), u = a`${n + o - hi},${i} ${n + o},${i + hi} ` + a`${n + o - hi},${i + hi}`;
2729
+ ].join(" "), u = a`${n + o - vi},${i} ${n + o},${i + vi} ` + a`${n + o - vi},${i + vi}`;
2695
2730
  return a`<g class="class-note"${c}>` + a`\n <polygon points="${l}" ` + a`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />` + a`\n <polygon points="${u}" ` + a`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />` + a`\n ${p(e.text, n + o / 2, i + s / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`)}` + "\n</g>";
2696
2731
  }
2697
- function _i(e) {
2732
+ function bi(e) {
2698
2733
  if (!e.linkPoints || e.linkPoints.length < 2) return "";
2699
2734
  let t = e.linkPoints.map((e) => a`${e.x},${e.y}`).join(" "), n = e.forClass === void 0 ? "" : a` data-for="${r(e.forClass)}"`;
2700
2735
  return a`<polyline class="class-note-link"${n} points="${t}" ` + a`fill="none" stroke="var(--_line)" stroke-width="${R.connector}" stroke-dasharray="2 3" />`;
2701
2736
  }
2702
- function vi(e) {
2737
+ function xi(e) {
2703
2738
  if (e.points.length < 2) return "";
2704
- let t = e.points.map((e) => a`${e.x},${e.y}`).join(" "), n = e.type === "dependency" || e.type === "realization" ? " stroke-dasharray=\"6 4\"" : "", i = yi(e.type, e.markerAt), o = [
2739
+ let t = e.points.map((e) => a`${e.x},${e.y}`).join(" "), n = e.type === "dependency" || e.type === "realization" ? " stroke-dasharray=\"6 4\"" : "", i = Si(e.type, e.markerAt), o = [
2705
2740
  "class=\"class-relationship\"",
2706
2741
  a`data-from="${r(e.from)}"`,
2707
2742
  a`data-to="${r(e.to)}"`,
@@ -2710,11 +2745,11 @@ function vi(e) {
2710
2745
  ];
2711
2746
  return e.label && o.push(a`data-label="${r(e.label)}"`), e.fromCardinality && o.push(a`data-from-cardinality="${r(e.fromCardinality)}"`), e.toCardinality && o.push(a`data-to-cardinality="${r(e.toCardinality)}"`), a`<polyline ${o.join(" ")} points="${t}" fill="none" stroke="var(--_line)" ` + a`stroke-width="${R.connector}"${n}${i} />`;
2712
2747
  }
2713
- function yi(e, t) {
2714
- let n = bi(e);
2748
+ function Si(e, t) {
2749
+ let n = Ci(e);
2715
2750
  return n ? t === "from" ? a` marker-start="url(#${n})"` : a` marker-end="url(#${n})"` : "";
2716
2751
  }
2717
- function bi(e) {
2752
+ function Ci(e) {
2718
2753
  switch (e) {
2719
2754
  case "inheritance":
2720
2755
  case "realization": return "cls-inherit";
@@ -2725,30 +2760,30 @@ function bi(e) {
2725
2760
  default: return null;
2726
2761
  }
2727
2762
  }
2728
- function xi(e, t) {
2763
+ function wi(e, t) {
2729
2764
  if (!e.label && !e.fromCardinality && !e.toCardinality || e.points.length < 2) return "";
2730
2765
  let n = [];
2731
2766
  if (e.label) {
2732
- let r = e.labelPosition ?? Si(e.points);
2767
+ let r = e.labelPosition ?? Ti(e.points);
2733
2768
  n.push(p(e.label, r.x, r.y - 8, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
2734
2769
  }
2735
2770
  if (e.fromCardinality && e.points.length >= 2) {
2736
- let r = e.points[0], i = e.points[1], o = Ci(r, i);
2771
+ let r = e.points[0], i = e.points[1], o = Ei(r, i);
2737
2772
  n.push(p(e.fromCardinality, r.x + o.x, r.y + o.y, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
2738
2773
  }
2739
2774
  if (e.toCardinality && e.points.length >= 2) {
2740
- let r = e.points[e.points.length - 1], i = e.points[e.points.length - 2], o = Ci(r, i);
2775
+ let r = e.points[e.points.length - 1], i = e.points[e.points.length - 2], o = Ei(r, i);
2741
2776
  n.push(p(e.toCardinality, r.x + o.x, r.y + o.y, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
2742
2777
  }
2743
2778
  return n.join("\n");
2744
2779
  }
2745
- function Si(e) {
2780
+ function Ti(e) {
2746
2781
  return e.length === 0 ? {
2747
2782
  x: 0,
2748
2783
  y: 0
2749
2784
  } : e[Math.floor(e.length / 2)];
2750
2785
  }
2751
- function Ci(e, t) {
2786
+ function Ei(e, t) {
2752
2787
  let n = t.x - e.x, r = t.y - e.y;
2753
2788
  return Math.abs(n) > Math.abs(r) ? {
2754
2789
  x: n > 0 ? 14 : -14,
@@ -2758,7 +2793,7 @@ function Ci(e, t) {
2758
2793
  y: r > 0 ? 14 : -14
2759
2794
  };
2760
2795
  }
2761
- var wi = i, W = {
2796
+ var Di = i, W = {
2762
2797
  padding: 40,
2763
2798
  boxPadX: 14,
2764
2799
  headerHeight: 34,
@@ -2769,15 +2804,15 @@ var wi = i, W = {
2769
2804
  nodeSpacing: 70,
2770
2805
  layerSpacing: 90
2771
2806
  };
2772
- function Ti(e) {
2807
+ function Oi(e) {
2773
2808
  return e.length * Math.ceil(Se("M", W.attrFontSize));
2774
2809
  }
2775
- function Ei(e, t) {
2810
+ function ki(e, t) {
2776
2811
  let n = /* @__PURE__ */ new Map(), r = Te(t.fontSizes);
2777
2812
  for (let t of e.entities) {
2778
2813
  let e = F(t.label, r.nodeLabel, L.nodeLabel), i = 0;
2779
2814
  for (let e of t.attributes) {
2780
- let t = Ti(`${e.type} ${e.name}${e.keys.length > 0 ? " " + e.keys.join(",") : ""}`);
2815
+ let t = Oi(`${e.type} ${e.name}${e.keys.length > 0 ? " " + e.keys.join(",") : ""}`);
2781
2816
  t > i && (i = t);
2782
2817
  }
2783
2818
  let a = Math.max(W.minWidth, e + W.boxPadX * 2, i + W.boxPadX * 2), o = W.headerHeight + Math.max(t.attributes.length, 1) * W.rowHeight;
@@ -2816,7 +2851,7 @@ function Ei(e, t) {
2816
2851
  entitySizes: n
2817
2852
  };
2818
2853
  }
2819
- function Di(e, t, n) {
2854
+ function Ai(e, t, n) {
2820
2855
  let r = /* @__PURE__ */ new Map();
2821
2856
  for (let e of t.entities) r.set(e.id, e);
2822
2857
  let i = [];
@@ -2842,7 +2877,7 @@ function Di(e, t, n) {
2842
2877
  }
2843
2878
  let a = [];
2844
2879
  for (let [n, r] of (e.edges ?? []).entries()) {
2845
- let e = t.relationships[n], i = vt(r);
2880
+ let e = t.relationships[n], i = xt(r);
2846
2881
  a.push({
2847
2882
  entity1: e.entity1,
2848
2883
  entity2: e.entity2,
@@ -2860,58 +2895,58 @@ function Di(e, t, n) {
2860
2895
  relationships: a
2861
2896
  };
2862
2897
  }
2863
- function Oi(e, t = {}) {
2898
+ function ji(e, t = {}) {
2864
2899
  if (e.entities.length === 0) return {
2865
2900
  width: 0,
2866
2901
  height: 0,
2867
2902
  entities: [],
2868
2903
  relationships: []
2869
2904
  };
2870
- let { elkGraph: n, entitySizes: r } = Ei(e, t);
2871
- return Di(ye(n, t.layoutCache), e, r);
2905
+ let { elkGraph: n, entitySizes: r } = ki(e, t);
2906
+ return Ai(ye(n, t.layoutCache), e, r);
2872
2907
  }
2873
2908
  //#endregion
2874
2909
  //#region packages/svg-renderer/src/er/renderer.ts
2875
- var ki = 70, Ai = {
2910
+ var Mi = 70, Ni = {
2876
2911
  attrSize: 11,
2877
2912
  attrWeight: 400,
2878
2913
  keySize: 9,
2879
2914
  keyWeight: 600
2880
2915
  };
2881
- function ji(e, t, n = "Inter", r = !1, i = I, a, o, s, c = {}) {
2916
+ function Pi(e, t, n = "Inter", r = !1, i = I, a, o, s, c = {}) {
2882
2917
  let l = [];
2883
- l.push(Lr(x(e.width, e.height, t, r, o, s, void 0, c.styleAttribute), a)), l.push(ke(n, !0, c.nonce)), l.push("<defs>"), l.push("</defs>");
2884
- for (let t of e.relationships) l.push(Pi(t));
2885
- for (let t of e.entities) l.push(Mi(t, i));
2886
- for (let t of e.relationships) l.push(Ii(t));
2887
- for (let t of e.relationships) l.push(Fi(t, i));
2918
+ l.push(Br(x(e.width, e.height, t, r, o, s, void 0, c.styleAttribute), a)), l.push(ke(n, !0, c.nonce)), l.push("<defs>"), l.push("</defs>");
2919
+ for (let t of e.relationships) l.push(Li(t));
2920
+ for (let t of e.entities) l.push(Fi(t, i));
2921
+ for (let t of e.relationships) l.push(zi(t));
2922
+ for (let t of e.relationships) l.push(Ri(t, i));
2888
2923
  return l.push("</svg>"), l.join("\n");
2889
2924
  }
2890
- function Mi(e, t) {
2925
+ function Fi(e, t) {
2891
2926
  let { id: n, x: i, y: o, width: s, height: c, headerHeight: l, rowHeight: u, label: d, attributes: f } = e, m = [];
2892
2927
  m.push(a`<g class="entity" data-id="${r(n)}" data-label="${r(d)}">`), m.push(a` <rect x="${i}" y="${o}" width="${s}" height="${c}" ` + a`rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), m.push(a` <rect x="${i}" y="${o}" width="${s}" height="${l}" ` + a`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), m.push(" " + p(d, i + s / 2, o + l / 2, t.nodeLabel, a`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="var(--_text)"`));
2893
2928
  let h = o + l;
2894
2929
  m.push(a` <line x1="${i}" y1="${h}" x2="${i + s}" y2="${h}" ` + a`stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`);
2895
2930
  for (let e = 0; e < f.length; e++) {
2896
2931
  let t = f[e], n = h + e * u + u / 2;
2897
- m.push(" " + Ni(t, i, n, s).replace(/\n/g, "\n "));
2932
+ m.push(" " + Ii(t, i, n, s).replace(/\n/g, "\n "));
2898
2933
  }
2899
- return f.length === 0 && m.push(a` <text x="${i + s / 2}" y="${h + u / 2}" text-anchor="middle" dy="${z}" ` + a`font-size="${Ai.attrSize}" fill="var(--_text-faint)" font-style="italic">(no attributes)</text>`), m.push("</g>"), m.join("\n");
2934
+ return f.length === 0 && m.push(a` <text x="${i + s / 2}" y="${h + u / 2}" text-anchor="middle" dy="${z}" ` + a`font-size="${Ni.attrSize}" fill="var(--_text-faint)" font-style="italic">(no attributes)</text>`), m.push("</g>"), m.join("\n");
2900
2935
  }
2901
- function Ni(e, t, n, r) {
2936
+ function Ii(e, t, n, r) {
2902
2937
  let i = [], o = e.comment && e.comment.length > 0;
2903
2938
  if (e.comment && e.comment.length > 0) {
2904
2939
  let t = e.comment.replace(/<br\s*\/?>/gi, "\n");
2905
- i.push(a`<g><title>${zi(t)}</title>`);
2940
+ i.push(a`<g><title>${Hi(t)}</title>`);
2906
2941
  }
2907
2942
  let s = 0;
2908
- e.keys.length > 0 && (s = F(e.keys.join(","), Ai.keySize, Ai.keyWeight) + 8, i.push(a`<rect x="${t + 6}" y="${n - 7}" width="${s}" height="14" rx="2" ry="2" ` + "fill=\"var(--_key-badge)\" />"), i.push(a`<text x="${t + 6 + s / 2}" y="${n}" text-anchor="middle" dy="${z}" ` + a`font-size="${Ai.keySize}" font-weight="${Ai.keyWeight}" fill="var(--_text-sec)">${e.keys.join(",")}</text>`));
2943
+ e.keys.length > 0 && (s = F(e.keys.join(","), Ni.keySize, Ni.keyWeight) + 8, i.push(a`<rect x="${t + 6}" y="${n - 7}" width="${s}" height="14" rx="2" ry="2" ` + "fill=\"var(--_key-badge)\" />"), i.push(a`<text x="${t + 6 + s / 2}" y="${n}" text-anchor="middle" dy="${z}" ` + a`font-size="${Ni.keySize}" font-weight="${Ni.keyWeight}" fill="var(--_text-sec)">${e.keys.join(",")}</text>`));
2909
2944
  let c = t + 8 + (s > 0 ? s + 6 : 0);
2910
- i.push(a`<text x="${c}" y="${n}" class="mono" dy="${z}" ` + a`font-size="${Ai.attrSize}" font-weight="${Ai.attrWeight}">` + a`<tspan fill="var(--_text-muted)">${zi(e.type)}</tspan></text>`);
2945
+ i.push(a`<text x="${c}" y="${n}" class="mono" dy="${z}" ` + a`font-size="${Ni.attrSize}" font-weight="${Ni.attrWeight}">` + a`<tspan fill="var(--_text-muted)">${Hi(e.type)}</tspan></text>`);
2911
2946
  let l = t + r - 8;
2912
- return i.push(a`<text x="${l}" y="${n}" class="mono" text-anchor="end" dy="${z}" ` + a`font-size="${Ai.attrSize}" font-weight="${Ai.attrWeight}">` + a`<tspan fill="var(--_text-sec)">${zi(e.name)}</tspan></text>`), o && i.push("</g>"), i.join("\n");
2947
+ return i.push(a`<text x="${l}" y="${n}" class="mono" text-anchor="end" dy="${z}" ` + a`font-size="${Ni.attrSize}" font-weight="${Ni.attrWeight}">` + a`<tspan fill="var(--_text-sec)">${Hi(e.name)}</tspan></text>`), o && i.push("</g>"), i.join("\n");
2913
2948
  }
2914
- function Pi(e) {
2949
+ function Li(e) {
2915
2950
  if (e.points.length < 2) return "";
2916
2951
  let t = e.points.map((e) => a`${e.x},${e.y}`).join(" "), n = e.identifying ? "" : " stroke-dasharray=\"6 4\"", i = e.label ? a` data-label="${r(e.label)}"` : "", o = [
2917
2952
  "class=\"er-relationship\"",
@@ -2923,19 +2958,19 @@ function Pi(e) {
2923
2958
  ];
2924
2959
  return a`<polyline ${o.join(" ")}${i} points="${t}" fill="none" stroke="var(--_line)" ` + a`stroke-width="${R.connector}"${n} />`;
2925
2960
  }
2926
- function Fi(e, t) {
2961
+ function Ri(e, t) {
2927
2962
  if (!e.label || e.points.length < 2) return "";
2928
- let n = Ri(e.points), r = l(e.label, t.edgeLabel, L.edgeLabel), i = r.width + 8, o = r.height + 6;
2929
- return a`<rect x="${n.x - i / 2}" y="${n.y - o / 2}" width="${i}" height="${o}" rx="2" ry="2" ` + "fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"0.5\" />" + a`\n${p(e.label, n.x, n.y, t.edgeLabel, a`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${L.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${ki}%, var(--bg))"`)}`;
2963
+ let n = Vi(e.points), r = l(e.label, t.edgeLabel, L.edgeLabel), i = r.width + 8, o = r.height + 6;
2964
+ return a`<rect x="${n.x - i / 2}" y="${n.y - o / 2}" width="${i}" height="${o}" rx="2" ry="2" ` + "fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"0.5\" />" + a`\n${p(e.label, n.x, n.y, t.edgeLabel, a`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${L.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${Mi}%, var(--bg))"`)}`;
2930
2965
  }
2931
- function Ii(e) {
2966
+ function zi(e) {
2932
2967
  if (e.points.length < 2) return "";
2933
2968
  let t = [], n = e.points[0], r = e.points[1];
2934
- t.push(Li(n, r, e.cardinality1));
2969
+ t.push(Bi(n, r, e.cardinality1));
2935
2970
  let i = e.points[e.points.length - 1], a = e.points[e.points.length - 2];
2936
- return t.push(Li(i, a, e.cardinality2)), t.join("\n");
2971
+ return t.push(Bi(i, a, e.cardinality2)), t.join("\n");
2937
2972
  }
2938
- function Li(e, t, n) {
2973
+ function Bi(e, t, n) {
2939
2974
  let r = [], i = R.connector + .25, o = e.x - t.x, s = e.y - t.y, c = Math.sqrt(o * o + s * s);
2940
2975
  if (c === 0) return "";
2941
2976
  let l = o / c, u = s / c, d = -u, f = l, p = e.x - l * 4, m = e.y - u * 4, h = e.x - l * 16, g = e.y - u * 16, _ = n === "one" || n === "zero-one", v = n === "many" || n === "zero-many", y = n === "zero-one" || n === "zero-many";
@@ -2958,7 +2993,7 @@ function Li(e, t, n) {
2958
2993
  }
2959
2994
  return r.join("\n");
2960
2995
  }
2961
- function Ri(e) {
2996
+ function Vi(e) {
2962
2997
  if (e.length === 0) return {
2963
2998
  x: 0,
2964
2999
  y: 0
@@ -2984,7 +3019,7 @@ function Ri(e) {
2984
3019
  }
2985
3020
  return e[e.length - 1];
2986
3021
  }
2987
- var zi = i, Bi = {
3022
+ var Hi = i, Ui = {
2988
3023
  padding: 30,
2989
3024
  actorGap: 140,
2990
3025
  actorHeight: 40,
@@ -3006,24 +3041,24 @@ var zi = i, Bi = {
3006
3041
  noteStackGap: 4,
3007
3042
  boxPad: 10
3008
3043
  };
3009
- function Vi(e) {
3044
+ function Wi(e) {
3010
3045
  return e + 8;
3011
3046
  }
3012
- var Hi = 14, Ui = 4;
3013
- function Wi(e, t, n) {
3047
+ var Gi = 14, Ki = 4;
3048
+ function qi(e, t, n) {
3014
3049
  return 14 + l(e, t, n).height / 2;
3015
3050
  }
3016
- function Gi(e) {
3051
+ function Ji(e) {
3017
3052
  return {
3018
- ...Bi,
3019
- actorHeight: e?.actorHeight ?? Bi.actorHeight,
3020
- headerGap: e?.headerGap ?? Bi.headerGap,
3021
- messageRowHeight: e?.messageRowHeight ?? Bi.messageRowHeight,
3022
- noteOffsetAfterMessage: e?.noteOffsetAfterMessage ?? Bi.noteOffsetAfterMessage,
3023
- noteStackGap: e?.noteStackGap ?? Bi.noteStackGap
3053
+ ...Ui,
3054
+ actorHeight: e?.actorHeight ?? Ui.actorHeight,
3055
+ headerGap: e?.headerGap ?? Ui.headerGap,
3056
+ messageRowHeight: e?.messageRowHeight ?? Ui.messageRowHeight,
3057
+ noteOffsetAfterMessage: e?.noteOffsetAfterMessage ?? Ui.noteOffsetAfterMessage,
3058
+ noteStackGap: e?.noteStackGap ?? Ui.noteStackGap
3024
3059
  };
3025
3060
  }
3026
- function Ki(e, t = {}) {
3061
+ function Yi(e, t = {}) {
3027
3062
  if (e.actors.length === 0) return {
3028
3063
  width: 0,
3029
3064
  height: 0,
@@ -3035,7 +3070,7 @@ function Ki(e, t = {}) {
3035
3070
  notes: [],
3036
3071
  boxes: []
3037
3072
  };
3038
- let n = Gi(t.sequence), r = Te(t.fontSizes), i = e.actors.map((e) => {
3073
+ let n = Ji(t.sequence), r = Te(t.fontSizes), i = e.actors.map((e) => {
3039
3074
  let t = F(e.label, r.nodeLabel, L.nodeLabel);
3040
3075
  return Math.max(t + n.actorPadX * 2, 80);
3041
3076
  }), a = [], o = n.padding + i[0] / 2;
@@ -3048,7 +3083,7 @@ function Ki(e, t = {}) {
3048
3083
  }
3049
3084
  let s = /* @__PURE__ */ new Map();
3050
3085
  for (let t = 0; t < e.actors.length; t++) s.set(e.actors[t].id, t);
3051
- let c = e.boxes.filter((e) => e.actorIds.length > 0), l = c.some((e) => e.label !== ""), u = c.length === 0 ? 0 : n.boxPad + (l ? Vi(r.edgeLabel) : 0), d = n.padding + u, f = e.actors.map((e, t) => ({
3086
+ let c = e.boxes.filter((e) => e.actorIds.length > 0), l = c.some((e) => e.label !== ""), u = c.length === 0 ? 0 : n.boxPad + (l ? Wi(r.edgeLabel) : 0), d = n.padding + u, f = e.actors.map((e, t) => ({
3052
3087
  id: e.id,
3053
3088
  label: e.label,
3054
3089
  type: e.type,
@@ -3065,7 +3100,7 @@ function Ki(e, t = {}) {
3065
3100
  height: 0
3066
3101
  };
3067
3102
  return e.color !== void 0 && (u.color = e.color), u;
3068
- }), m = e.actors.map((e) => e.type === "actor" ? Wi(e.label, r.nodeLabel, L.nodeLabel) : 0), h = Math.max(0, ...e.actors.map((e, t) => e.createdAt === void 0 ? m[t] : 0)), g = r.edgeLabel + 12, _ = d + n.actorHeight + Math.max(n.headerGap, h > 0 ? h + Ui + g : 0), v = [], y = /* @__PURE__ */ new Map();
3103
+ }), m = e.actors.map((e) => e.type === "actor" ? qi(e.label, r.nodeLabel, L.nodeLabel) : 0), h = Math.max(0, ...e.actors.map((e, t) => e.createdAt === void 0 ? m[t] : 0)), g = r.edgeLabel + 12, _ = d + n.actorHeight + Math.max(n.headerGap, h > 0 ? h + Ki + g : 0), v = [], y = /* @__PURE__ */ new Map();
3069
3104
  for (let t of e.blocks) {
3070
3105
  let e = y.get(t.startIndex) ?? 0;
3071
3106
  y.set(t.startIndex, Math.max(e, n.blockHeaderExtra));
@@ -3218,10 +3253,10 @@ function Ki(e, t = {}) {
3218
3253
  height: u - l,
3219
3254
  dividers: g
3220
3255
  };
3221
- }), j = x, ee = _ + n.padding, M = n.padding, N = 0;
3256
+ }), ee = x, j = _ + n.padding, M = n.padding, N = 0;
3222
3257
  for (let e of f) M = Math.min(M, e.x - e.width / 2), N = Math.max(N, e.x + e.width / 2);
3223
3258
  for (let e of A) M = Math.min(M, e.x), N = Math.max(N, e.x + e.width);
3224
- for (let e of j) M = Math.min(M, e.x), N = Math.max(N, e.x + e.width);
3259
+ for (let e of ee) M = Math.min(M, e.x), N = Math.max(N, e.x + e.width);
3225
3260
  for (let e of p) M = Math.min(M, e.x), N = Math.max(N, e.x + e.width);
3226
3261
  for (let e of v) if (e.isSelf && e.label) {
3227
3262
  let t = e.x1 + 30 + 8, n = F(e.label, r.edgeLabel, L.edgeLabel);
@@ -3233,7 +3268,7 @@ function Ki(e, t = {}) {
3233
3268
  for (let e of v) e.x1 += P, e.x2 += P;
3234
3269
  for (let e of w) e.x += P;
3235
3270
  for (let e of A) e.x += P;
3236
- for (let e of j) e.x += P;
3271
+ for (let e of ee) e.x += P;
3237
3272
  for (let e of p) e.x += P;
3238
3273
  for (let e = 0; e < a.length; e++) a[e] += P;
3239
3274
  }
@@ -3245,45 +3280,45 @@ function Ki(e, t = {}) {
3245
3280
  let r = e.destroyedAt, i = {
3246
3281
  actorId: e.id,
3247
3282
  x: a[t],
3248
- topY: f[t].y + n.actorHeight + (m[t] > 0 ? m[t] + Ui : 0),
3249
- bottomY: r === void 0 ? ee - n.padding : v[r]?.y ?? _
3283
+ topY: f[t].y + n.actorHeight + (m[t] > 0 ? m[t] + Ki : 0),
3284
+ bottomY: r === void 0 ? j - n.padding : v[r]?.y ?? _
3250
3285
  };
3251
3286
  return r !== void 0 && (i.destroyed = !0), i;
3252
3287
  });
3253
- for (let e of p) e.height = ee - n.padding + n.boxPad - e.y;
3288
+ for (let e of p) e.height = j - n.padding + n.boxPad - e.y;
3254
3289
  let ne = N + P + n.padding;
3255
3290
  return {
3256
3291
  width: Math.max(ne, 200),
3257
- height: Math.max(ee, 100),
3292
+ height: Math.max(j, 100),
3258
3293
  actors: f,
3259
3294
  lifelines: te,
3260
3295
  messages: v,
3261
3296
  activations: w,
3262
3297
  blocks: A,
3263
- notes: j,
3298
+ notes: ee,
3264
3299
  boxes: p
3265
3300
  };
3266
3301
  }
3267
3302
  //#endregion
3268
3303
  //#region packages/svg-renderer/src/sequence/renderer.ts
3269
- function qi(e, n, r = "Inter", i = !1, a = I, o, s, c, l = {}) {
3304
+ function Xi(e, n, r = "Inter", i = !1, a = I, o, s, c, l = {}) {
3270
3305
  let u = [];
3271
- u.push(Lr(x(e.width, e.height, n, i, s, c, void 0, l.styleAttribute), o)), u.push(t(r, !1, l.nonce)), u.push("<defs>"), u.push(Ji()), u.push("</defs>");
3272
- for (let t of e.boxes) u.push(fa(t, a));
3273
- for (let t of e.blocks) u.push(pa(t, a));
3274
- let d = ia(e, a);
3275
- for (let t of e.lifelines) u.push(oa(t, d));
3276
- for (let t of e.activations) u.push(ca(t));
3277
- for (let t of e.messages) u.push(la(t, a));
3278
- for (let t of e.notes) u.push(ma(t, a));
3279
- for (let t of e.actors) u.push(Yi(t, a));
3306
+ u.push(Br(x(e.width, e.height, n, i, s, c, void 0, l.styleAttribute), o)), u.push(t(r, !1, l.nonce)), u.push("<defs>"), u.push(Zi()), u.push("</defs>");
3307
+ for (let t of e.boxes) u.push(ha(t, a));
3308
+ for (let t of e.blocks) u.push(ga(t, a));
3309
+ let d = sa(e, a);
3310
+ for (let t of e.lifelines) u.push(la(t, d));
3311
+ for (let t of e.activations) u.push(da(t));
3312
+ for (let t of e.messages) u.push(fa(t, a));
3313
+ for (let t of e.notes) u.push(_a(t, a));
3314
+ for (let t of e.actors) u.push(Qi(t, a));
3280
3315
  return u.push("</svg>"), u.join("\n");
3281
3316
  }
3282
- function Ji() {
3317
+ function Zi() {
3283
3318
  let e = Oe.width, t = Oe.height;
3284
3319
  return a` <marker id="seq-arrow" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse">` + a`\n <polygon points="0 0, ${e} ${t / 2}, 0 ${t}" fill="var(--_arrow)" />` + "\n </marker>" + a`\n <marker id="seq-arrow-open" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse">` + a`\n <polyline points="0 0, ${e} ${t / 2}, 0 ${t}" fill="none" stroke="var(--_arrow)" stroke-width="1" />` + "\n </marker>";
3285
3320
  }
3286
- function Yi(e, t) {
3321
+ function Qi(e, t) {
3287
3322
  let { id: n, x: i, y: o, width: s, height: c, label: l, type: u } = e, d = [];
3288
3323
  if (d.push(a`<g class="actor" data-id="${r(n)}" data-label="${r(l)}" data-type="${u}">`), u === "actor") {
3289
3324
  let e = c / 24 * .9, n = i - 12 * e, r = o + (c - 24 * e) / 2, s = R.outerBox / e, u = "var(--_line)";
@@ -3294,8 +3329,8 @@ function Yi(e, t) {
3294
3329
  }
3295
3330
  return d.push("</g>"), d.join("\n");
3296
3331
  }
3297
- var Xi = 30, Zi = 20, Qi = 8, $i = 10, ea = 18, ta = 3, na = 2, ra = 3;
3298
- function ia(e, t) {
3332
+ var $i = 30, ea = 20, ta = 8, na = 10, ra = 18, ia = 3, aa = 2, oa = 3;
3333
+ function sa(e, t) {
3299
3334
  let n = [], r = (e) => l(e, t.edgeLabel, L.edgeLabel), i = (e, t, i) => {
3300
3335
  let a = r(e);
3301
3336
  n.push({
@@ -3313,64 +3348,64 @@ function ia(e, t) {
3313
3348
  y1: i + a.height / 2
3314
3349
  });
3315
3350
  };
3316
- for (let t of e.messages) t.label && (t.isSelf ? a(t.label, t.x1 + Xi + Qi, t.y + Zi / 2) : i(t.label, (t.x1 + t.x2) / 2, t.y - $i));
3351
+ for (let t of e.messages) t.label && (t.isSelf ? a(t.label, t.x1 + $i + ta, t.y + ea / 2) : i(t.label, (t.x1 + t.x2) / 2, t.y - na));
3317
3352
  for (let r of e.blocks) {
3318
3353
  let e = F(`${r.type}${r.label ? ` [${r.label}]` : ""}`.split("\n")[0] ?? "", t.edgeLabel, L.groupHeader) + 16;
3319
3354
  n.push({
3320
3355
  x0: r.x,
3321
3356
  x1: r.x + e,
3322
3357
  y0: r.y,
3323
- y1: r.y + ea
3358
+ y1: r.y + ra
3324
3359
  });
3325
3360
  for (let e of r.dividers) e.label && a(`[${e.label}]`, r.x + 8, e.y + 14);
3326
3361
  }
3327
3362
  return n;
3328
3363
  }
3329
- function aa(e, t) {
3330
- let n = t.filter((t) => e.x > t.x0 - ta && e.x < t.x1 + ta && t.y1 + na > e.topY && t.y0 - na < e.bottomY).map((e) => [e.y0 - na, e.y1 + na]).sort((e, t) => e[0] - t[0]), r = [], i = e.topY;
3331
- for (let [e, t] of n) e - i >= ra && r.push([i, e]), i = Math.max(i, t);
3332
- return e.bottomY - i >= ra && r.push([i, e.bottomY]), r.length > 0 ? r : [[e.topY, e.bottomY]];
3364
+ function ca(e, t) {
3365
+ let n = t.filter((t) => e.x > t.x0 - ia && e.x < t.x1 + ia && t.y1 + aa > e.topY && t.y0 - aa < e.bottomY).map((e) => [e.y0 - aa, e.y1 + aa]).sort((e, t) => e[0] - t[0]), r = [], i = e.topY;
3366
+ for (let [e, t] of n) e - i >= oa && r.push([i, e]), i = Math.max(i, t);
3367
+ return e.bottomY - i >= oa && r.push([i, e.bottomY]), r.length > 0 ? r : [[e.topY, e.bottomY]];
3333
3368
  }
3334
- function oa(e, t) {
3335
- let n = aa(e, t).map(([t, n]) => a`<line class="lifeline" data-actor="${r(e.actorId)}" ` + a`x1="${e.x}" y1="${t}" x2="${e.x}" y2="${n}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />").join("\n");
3369
+ function la(e, t) {
3370
+ let n = ca(e, t).map(([t, n]) => a`<line class="lifeline" data-actor="${r(e.actorId)}" ` + a`x1="${e.x}" y1="${t}" x2="${e.x}" y2="${n}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />").join("\n");
3336
3371
  if (!e.destroyed) return n;
3337
- let { x: i, bottomY: o } = e, s = sa;
3372
+ let { x: i, bottomY: o } = e, s = ua;
3338
3373
  return n + a`\n<path class="destroy" data-actor="${r(e.actorId)}" ` + a`d="M${i - s} ${o - s} L${i + s} ${o + s} M${i + s} ${o - s} L${i - s} ${o + s}" ` + a`fill="none" stroke="var(--_line)" stroke-width="${R.outerBox}" stroke-linecap="round" />`;
3339
3374
  }
3340
- var sa = 8;
3341
- function ca(e) {
3375
+ var ua = 8;
3376
+ function da(e) {
3342
3377
  return a`<rect class="activation" data-actor="${r(e.actorId)}" ` + a`x="${e.x}" y="${e.topY}" width="${e.width}" height="${e.bottomY - e.topY}" ` + a`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`;
3343
3378
  }
3344
- function la(e, t) {
3379
+ function fa(e, t) {
3345
3380
  let n = [], i = e.lineStyle === "dashed" ? " stroke-dasharray=\"6 4\"" : "", o = e.arrowHead === "filled" ? "seq-arrow" : "seq-arrow-open", s = e.bidirectional ? a` marker-start="url(#${o})"` : "";
3346
3381
  if (n.push(a`<g class="message" data-from="${r(e.from)}" data-to="${r(e.to)}" ` + a`data-label="${r(e.label)}" data-line-style="${e.lineStyle}" ` + a`data-arrow-head="${e.arrowHead}" data-self="${e.isSelf}" data-bidirectional="${e.bidirectional}">`), e.isSelf) {
3347
- let r = Xi, c = Zi, l = Qi;
3382
+ let r = $i, c = ea, l = ta;
3348
3383
  n.push(a` <polyline points="${e.x1},${e.y} ${e.x1 + r},${e.y} ${e.x1 + r},${e.y + c} ${e.x2},${e.y + c}" ` + a`fill="none" stroke="var(--_line)" stroke-width="${R.connector}"${i} marker-end="url(#${o})"${s} />`), n.push(" " + p(e.label, e.x1 + r + l, e.y + c / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3349
3384
  } else {
3350
3385
  n.push(a` <line x1="${e.x1}" y1="${e.y}" x2="${e.x2}" y2="${e.y}" ` + a`stroke="var(--_line)" stroke-width="${R.connector}"${i} marker-end="url(#${o})"${s} />`);
3351
3386
  let r = (e.x1 + e.x2) / 2;
3352
- n.push(" " + p(e.label, r, e.y - $i, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3387
+ n.push(" " + p(e.label, r, e.y - na, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3353
3388
  }
3354
- return e.seqNumber !== void 0 && n.push(" " + ua(e, t)), n.push("</g>"), n.join("\n");
3389
+ return e.seqNumber !== void 0 && n.push(" " + pa(e, t)), n.push("</g>"), n.join("\n");
3355
3390
  }
3356
- function ua(e, t) {
3391
+ function pa(e, t) {
3357
3392
  let n = Math.max(t.edgeLabel - 2, 8), r = e.bidirectional ? e.x1 + Math.sign(e.x2 - e.x1) * (8 + Oe.width) : e.x1;
3358
3393
  return "<g class=\"seq-number\">" + a`<circle cx="${r}" cy="${e.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${R.innerBox}" />` + p(String(e.seqNumber), r, e.y, n, a`font-size="${n}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_arrow)"`) + "</g>";
3359
3394
  }
3360
- var da = 35;
3361
- function fa(e, t) {
3362
- let n = e.label ? a` data-label="${r(e.label)}"` : "", i = e.color === void 0 ? "" : a` data-color="${r(e.color)}"`, o = e.color === void 0 ? "none" : a`color-mix(in srgb, ${r(e.color)} ${da}%, var(--bg))`, s = [a`<g class="participant-box"${n}${i}>`, a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" ` + a`fill="${o}" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`];
3363
- return e.label && s.push(" " + p(e.label, e.x + e.width / 2, e.y + Vi(t.edgeLabel) / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`)), s.push("</g>"), s.join("\n");
3395
+ var ma = 35;
3396
+ function ha(e, t) {
3397
+ let n = e.label ? a` data-label="${r(e.label)}"` : "", i = e.color === void 0 ? "" : a` data-color="${r(e.color)}"`, o = e.color === void 0 ? "none" : a`color-mix(in srgb, ${r(e.color)} ${ma}%, var(--bg))`, s = [a`<g class="participant-box"${n}${i}>`, a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" ` + a`fill="${o}" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`];
3398
+ return e.label && s.push(" " + p(e.label, e.x + e.width / 2, e.y + Wi(t.edgeLabel) / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`)), s.push("</g>"), s.join("\n");
3364
3399
  }
3365
- function pa(e, t) {
3400
+ function ga(e, t) {
3366
3401
  let n = [], i = e.label ? a` data-label="${r(e.label)}"` : "";
3367
3402
  n.push(a`<g class="block" data-type="${r(e.type)}"${i}>`), n.push(a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + a`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`);
3368
- let o = a`${e.type}${e.label ? a` [${e.label}]` : ""}`, s = o.split("\n")[0], c = F(s, t.edgeLabel, L.groupHeader) + 16, l = ea;
3403
+ let o = a`${e.type}${e.label ? a` [${e.label}]` : ""}`, s = o.split("\n")[0], c = F(s, t.edgeLabel, L.groupHeader) + 16, l = ra;
3369
3404
  n.push(a` <rect x="${e.x}" y="${e.y}" width="${c}" height="${l}" ` + a`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), n.push(" " + p(o, e.x + 6, e.y + l / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`));
3370
3405
  for (let r of e.dividers) n.push(a` <line x1="${e.x}" y1="${r.y}" x2="${e.x + e.width}" y2="${r.y}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />"), r.label && n.push(" " + p(a`[${r.label}]`, e.x + 8, r.y + 14, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3371
3406
  return n.push("</g>"), n.join("\n");
3372
3407
  }
3373
- function ma(e, t) {
3408
+ function _a(e, t) {
3374
3409
  let { x: n, y: i, width: o, height: s } = e, c = e.actors && e.actors.length > 0 ? a` data-actors="${e.actors.map(r).join(",")}"` : "", l = e.position ? a` data-position="${r(e.position)}"` : "", u = [
3375
3410
  a`${n},${i}`,
3376
3411
  a`${n + o - 6},${i}`,
@@ -3409,23 +3444,23 @@ var G = {
3409
3444
  legendGap: 6,
3410
3445
  legendItemGap: 16
3411
3446
  };
3412
- function ha(e, t = {}) {
3413
- return e.horizontal ? _a(e) : ga(e);
3447
+ function va(e, t = {}) {
3448
+ return e.horizontal ? ba(e) : ya(e);
3414
3449
  }
3415
- function ga(e) {
3450
+ function ya(e) {
3416
3451
  let t = !!e.title, n = !!e.xAxis.title, r = !!e.yAxis.title, i = e.series.length > 1, a = e.yAxis.range;
3417
3452
  if (!a)
3418
3453
  /* v8 ignore next */
3419
3454
  throw Error("XY chart: y-axis range was not set by the parser");
3420
- let o = Ta(a.min, a.max), s = Ea(o), c = Math.max(...s.map((e) => F(e, G.axisLabelFontSize, G.axisLabelFontWeight)), G.yLabelWidth), l = G.padding + (t ? G.titleHeight : 0) + (i ? G.legendHeight : 0), u = G.padding + G.xLabelHeight + (n ? G.axisTitlePad : 0), d = G.padding + c + G.yLabelGap + (r ? G.axisTitlePad : 0), f = G.padding, p = G.plotWidth, m = G.plotHeight, h = d + p + f, g = l + m + u, _ = {
3455
+ let o = Oa(a.min, a.max), s = ka(o), c = Math.max(...s.map((e) => F(e, G.axisLabelFontSize, G.axisLabelFontWeight)), G.yLabelWidth), l = G.padding + (t ? G.titleHeight : 0) + (i ? G.legendHeight : 0), u = G.padding + G.xLabelHeight + (n ? G.axisTitlePad : 0), d = G.padding + c + G.yLabelGap + (r ? G.axisTitlePad : 0), f = G.padding, p = G.plotWidth, m = G.plotHeight, h = d + p + f, g = l + m + u, _ = {
3421
3456
  x: d,
3422
3457
  y: l,
3423
3458
  width: p,
3424
3459
  height: m
3425
- }, v = va(e), y = (e) => d + (e + .5) * (p / v), b = p / v, x = (e) => {
3460
+ }, v = xa(e), y = (e) => d + (e + .5) * (p / v), b = p / v, x = (e) => {
3426
3461
  let t = (e - a.min) / (a.max - a.min || 1);
3427
3462
  return l + m - t * m;
3428
- }, S = Sa(e, y, l + m, b), C = o.map((e, t) => ({
3463
+ }, S = Ta(e, y, l + m, b), C = o.map((e, t) => ({
3429
3464
  label: s[t],
3430
3465
  x: d,
3431
3466
  y: x(e),
@@ -3439,19 +3474,19 @@ function ga(e) {
3439
3474
  y1: x(e),
3440
3475
  x2: d + p,
3441
3476
  y2: x(e)
3442
- })), T = ya(e, v), E = e.series.map((e, t) => t), D = Ca(e, y, x, b, a.min, T, E), O = wa(e, y, x, T, E), k = G.padding + (t ? G.titleHeight : 0) + G.legendHeight / 2, A = i ? Oa(e, h / 2, k, E) : [], j = {
3477
+ })), T = Sa(e, v), E = e.series.map((e, t) => t), D = Ea(e, y, x, b, a.min, T, E), O = Da(e, y, x, T, E), k = G.padding + (t ? G.titleHeight : 0) + G.legendHeight / 2, A = i ? ja(e, h / 2, k, E) : [], ee = {
3443
3478
  x1: d,
3444
3479
  y1: l + m,
3445
3480
  x2: d + p,
3446
3481
  y2: l + m
3447
- }, ee = {
3482
+ }, j = {
3448
3483
  x1: d,
3449
3484
  y1: l,
3450
3485
  x2: d,
3451
3486
  y2: l + m
3452
3487
  }, M = {
3453
3488
  ticks: S,
3454
- line: j,
3489
+ line: ee,
3455
3490
  ...e.xAxis.title ? { title: {
3456
3491
  text: e.xAxis.title,
3457
3492
  x: d + p / 2,
@@ -3459,7 +3494,7 @@ function ga(e) {
3459
3494
  } } : {}
3460
3495
  }, N = {
3461
3496
  ticks: C,
3462
- line: ee,
3497
+ line: j,
3463
3498
  ...e.yAxis.title ? { title: {
3464
3499
  text: e.yAxis.title,
3465
3500
  x: G.padding + 4,
@@ -3484,12 +3519,12 @@ function ga(e) {
3484
3519
  legend: A
3485
3520
  };
3486
3521
  }
3487
- function _a(e) {
3522
+ function ba(e) {
3488
3523
  let t = !!e.title, n = !!e.xAxis.title, r = !!e.yAxis.title, i = e.series.length > 1, a = e.yAxis.range;
3489
3524
  if (!a)
3490
3525
  /* v8 ignore next */
3491
3526
  throw Error("XY chart: y-axis range was not set by the parser");
3492
- let o = Ta(a.min, a.max), s = Ea(o), c = va(e), l = ya(e, c), u = Math.max(...l.map((e) => F(e, G.axisLabelFontSize, G.axisLabelFontWeight)), 40), d = G.padding + (t ? G.titleHeight : 0) + (i ? G.legendHeight : 0), f = G.padding + G.xLabelHeight + (r ? G.axisTitlePad : 0), p = G.padding + u + G.yLabelGap + (n ? G.axisTitlePad : 0), m = G.padding, h = G.plotWidth, g = G.plotHeight, _ = p + h + m, v = d + g + f, y = {
3527
+ let o = Oa(a.min, a.max), s = ka(o), c = xa(e), l = Sa(e, c), u = Math.max(...l.map((e) => F(e, G.axisLabelFontSize, G.axisLabelFontWeight)), 40), d = G.padding + (t ? G.titleHeight : 0) + (i ? G.legendHeight : 0), f = G.padding + G.xLabelHeight + (r ? G.axisTitlePad : 0), p = G.padding + u + G.yLabelGap + (n ? G.axisTitlePad : 0), m = G.padding, h = G.plotWidth, g = G.plotHeight, _ = p + h + m, v = d + g + f, y = {
3493
3528
  x: p,
3494
3529
  y: d,
3495
3530
  width: h,
@@ -3544,10 +3579,10 @@ function _a(e) {
3544
3579
  o++, s++;
3545
3580
  }
3546
3581
  }
3547
- let k = [], A = 0, j = 0;
3582
+ let k = [], A = 0, ee = 0;
3548
3583
  for (let t of e.series) {
3549
3584
  if (t.type !== "line") {
3550
- j++;
3585
+ ee++;
3551
3586
  continue;
3552
3587
  }
3553
3588
  let e = t.data.map((e, t) => ({
@@ -3559,10 +3594,10 @@ function _a(e) {
3559
3594
  k.push({
3560
3595
  points: e,
3561
3596
  seriesIndex: A,
3562
- colorIndex: E[j]
3563
- }), A++, j++;
3597
+ colorIndex: E[ee]
3598
+ }), A++, ee++;
3564
3599
  }
3565
- let ee = {
3600
+ let j = {
3566
3601
  x1: p,
3567
3602
  y1: d + g,
3568
3603
  x2: p + h,
@@ -3574,7 +3609,7 @@ function _a(e) {
3574
3609
  y2: d + g
3575
3610
  }, N = {
3576
3611
  ticks: C,
3577
- line: ee,
3612
+ line: j,
3578
3613
  ...e.yAxis.title ? { title: {
3579
3614
  text: e.yAxis.title,
3580
3615
  x: p + h / 2,
@@ -3605,28 +3640,28 @@ function _a(e) {
3605
3640
  bars: O,
3606
3641
  lines: k,
3607
3642
  gridLines: T,
3608
- legend: i ? Oa(e, _ / 2, ne, E) : []
3643
+ legend: i ? ja(e, _ / 2, ne, E) : []
3609
3644
  };
3610
3645
  }
3611
- function va(e) {
3646
+ function xa(e) {
3612
3647
  if (e.xAxis.categories) return e.xAxis.categories.length;
3613
3648
  for (let t of e.series) if (t.data.length > 0) return t.data.length;
3614
3649
  return 1;
3615
3650
  }
3616
- function ya(e, t) {
3651
+ function Sa(e, t) {
3617
3652
  if (e.xAxis.categories) return e.xAxis.categories;
3618
3653
  if (e.xAxis.range) {
3619
3654
  let { min: n, max: r } = e.xAxis.range, i = t > 1 ? (r - n) / (t - 1) : 0;
3620
- return Array.from({ length: t }, (e, t) => Da(n + i * t));
3655
+ return Array.from({ length: t }, (e, t) => Aa(n + i * t));
3621
3656
  }
3622
3657
  return Array.from({ length: t }, (e, t) => String(t + 1));
3623
3658
  }
3624
- var ba = 8;
3625
- function xa(e, t) {
3659
+ var Ca = 8;
3660
+ function wa(e, t) {
3626
3661
  let n = e.map((e) => F(e, G.axisLabelFontSize, G.axisLabelFontWeight));
3627
3662
  for (let r = 1; r < e.length; r++) {
3628
3663
  let i = !0;
3629
- for (let a = 0; a + r < e.length; a += r) if (r * t - (n[a] + n[a + r]) / 2 < ba) {
3664
+ for (let a = 0; a + r < e.length; a += r) if (r * t - (n[a] + n[a + r]) / 2 < Ca) {
3630
3665
  i = !1;
3631
3666
  break;
3632
3667
  }
@@ -3634,8 +3669,8 @@ function xa(e, t) {
3634
3669
  }
3635
3670
  return Math.max(1, e.length);
3636
3671
  }
3637
- function Sa(e, t, n, r) {
3638
- let i = ya(e, va(e)), a = xa(i, r);
3672
+ function Ta(e, t, n, r) {
3673
+ let i = Sa(e, xa(e)), a = wa(i, r);
3639
3674
  return i.map((e, r) => ({
3640
3675
  label: r % a === 0 ? e : "",
3641
3676
  x: t(r),
@@ -3647,7 +3682,7 @@ function Sa(e, t, n, r) {
3647
3682
  textAnchor: "middle"
3648
3683
  }));
3649
3684
  }
3650
- function Ca(e, t, n, r, i, a, o) {
3685
+ function Ea(e, t, n, r, i, a, o) {
3651
3686
  let s = e.series.filter((e) => e.type === "bar").length;
3652
3687
  if (s === 0) return [];
3653
3688
  let c = r * (1 - G.barPadRatio), l = s > 1 ? (c - (s - 1) * G.barGroupGap) / s : c, u = Math.min(l, G.maxBarWidth), d = s > 1 ? u * s + G.barGroupGap * (s - 1) : u, f = [], p = 0, m = 0;
@@ -3673,7 +3708,7 @@ function Ca(e, t, n, r, i, a, o) {
3673
3708
  }
3674
3709
  return f;
3675
3710
  }
3676
- function wa(e, t, n, r, i) {
3711
+ function Da(e, t, n, r, i) {
3677
3712
  let a = [], o = 0, s = 0;
3678
3713
  for (let c of e.series) {
3679
3714
  if (c.type !== "line") {
@@ -3694,7 +3729,7 @@ function wa(e, t, n, r, i) {
3694
3729
  }
3695
3730
  return a;
3696
3731
  }
3697
- function Ta(e, t) {
3732
+ function Oa(e, t) {
3698
3733
  let n = t - e;
3699
3734
  if (n <= 0) return [e];
3700
3735
  let r = n / 6, i = 10 ** Math.floor(Math.log10(r)), a = r / i, o;
@@ -3703,14 +3738,14 @@ function Ta(e, t) {
3703
3738
  for (let e = s; e <= t + o * .001; e += o) c.push(Math.round(e * 1e10) / 1e10);
3704
3739
  return c;
3705
3740
  }
3706
- function Ea(e) {
3741
+ function ka(e) {
3707
3742
  let t = e.length > 1 ? Math.abs(e[1] - e[0]) : 0, n = t > 0 && t < 1 ? Math.ceil(-Math.log10(t) - 1e-9) : 0;
3708
3743
  return e.map((e) => String(Number.isInteger(e) && n === 0 ? e : Number(e.toFixed(n))));
3709
3744
  }
3710
- function Da(e) {
3745
+ function Aa(e) {
3711
3746
  return Number.isInteger(e) ? String(e) : e.toFixed(+(Math.abs(e) < 10));
3712
3747
  }
3713
- function Oa(e, t, n, r) {
3748
+ function ja(e, t, n, r) {
3714
3749
  let i = [], a = 0, o = 0;
3715
3750
  for (let t = 0; t < e.series.length; t++) {
3716
3751
  let s = e.series[t], c = s.type === "bar" ? `Bar ${a + 1}` : `Line ${o + 1}`;
@@ -3754,24 +3789,24 @@ var K = {
3754
3789
  minY: 4,
3755
3790
  pointerSize: 6
3756
3791
  };
3757
- function ka(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
3758
- let u = [], d = Math.max(0, ...e.bars.map((e) => e.colorIndex), ...e.lines.map((e) => e.colorIndex)), f = Lr(x(e.width, e.height, n, i, s, c, void 0, l.styleAttribute).replace("<svg ", `<svg data-xychart-colors="${d}" `), o);
3792
+ function Ma(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
3793
+ let u = [], d = Math.max(0, ...e.bars.map((e) => e.colorIndex), ...e.lines.map((e) => e.colorIndex)), f = Br(x(e.width, e.height, n, i, s, c, void 0, l.styleAttribute).replace("<svg ", `<svg data-xychart-colors="${d}" `), o);
3759
3794
  u.push(f), u.push(t(r, !1, l.nonce));
3760
- let p = Math.max(...e.lines.map((e) => e.points.length), 0), m = p > 0 && p <= 12, { style: h, defs: g } = Aa(e, a, m, n.accent, n.bg, l.nonce);
3795
+ let p = Math.max(...e.lines.map((e) => e.points.length), 0), m = p > 0 && p <= 12, { style: h, defs: g } = Na(e, a, m, n.accent, n.bg, l.nonce);
3761
3796
  u.push(h), g && u.push(g);
3762
3797
  let { plotArea: _ } = e, v = e.xAxis.ticks.map((e) => e.x), y = e.horizontal ? e.yAxis.ticks.map((e) => e.y) : e.gridLines.map((e) => e.y1), b = v.length > 1 ? Math.abs(v[1] - v[0]) : _.width / 6, S = y.length > 1 ? Math.abs(y[1] - y[0]) : _.height / 6, C = b / Math.max(1, Math.round(b / 20)), w = S / Math.max(1, Math.round(S / 20)), T = v[0] ?? _.x, E = y[0] ?? _.y, D = T - Math.ceil((T - _.x) / C) * C, O = E - Math.ceil((E - _.y) / w) * w;
3763
3798
  for (let e = O; e <= _.y + _.height + .5; e += w) for (let t = D; t <= _.x + _.width + .5; t += C) u.push(`<circle cx="${J(t)}" cy="${J(e)}" r="1.5" class="xychart-grid"/>`);
3764
3799
  let k = [];
3765
3800
  for (let t of e.bars) {
3766
- let n = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`, r = e.horizontal ? Ma(t.x, t.y, t.width, t.height, K.barRadius) : ja(t.x, t.y, t.width, t.height, K.barRadius);
3801
+ let n = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`, r = e.horizontal ? Fa(t.x, t.y, t.width, t.height, K.barRadius) : Pa(t.x, t.y, t.width, t.height, K.barRadius);
3767
3802
  if (u.push(`<path d="${r}" class="xychart-bar xychart-color-${t.colorIndex}"${n}/>`), a) {
3768
- let e = Ia(t.value), n = t.label ? `${t.label}: ${e}` : e, r = Fa(t.x + t.width / 2, t.y, e);
3803
+ let e = za(t.value), n = t.label ? `${t.label}: ${e}` : e, r = Ra(t.x + t.width / 2, t.y, e);
3769
3804
  k.push(`<g class="xychart-bar-group"><rect x="${J(t.x)}" y="${J(t.y)}" width="${J(t.width)}" height="${J(t.height)}" fill="transparent"/><title>${Y(n)}</title>` + r + "</g>");
3770
3805
  }
3771
3806
  }
3772
3807
  for (let t of e.lines) {
3773
3808
  if (t.points.length === 0) continue;
3774
- let e = Na(t.points);
3809
+ let e = Ia(t.points);
3775
3810
  u.push(`<path d="${e}" class="xychart-line-shadow xychart-color-${t.colorIndex}" transform="translate(0,2)"/>`), u.push(`<path d="${e}" class="xychart-line xychart-color-${t.colorIndex}"/>`);
3776
3811
  }
3777
3812
  let A = [];
@@ -3794,16 +3829,16 @@ function ka(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
3794
3829
  let n = e[0].x, r = e[0].label || "";
3795
3830
  if (a && e.length > 1) {
3796
3831
  let i = Math.min(...e.map((e) => e.y)), a = Math.max(...e.map((e) => e.y)), o = K.dotRadius * 3, s = `<rect x="${J(n - o)}" y="${J(i - o)}" width="${J(o * 2)}" height="${J(a - i + o * 2)}" fill="transparent" class="xychart-hit"/>`, c = e.map((e) => ({
3797
- text: Ia(e.value),
3832
+ text: za(e.value),
3798
3833
  legendLabel: t.get(e.seriesIndex) || `Line ${e.seriesIndex + 1}`
3799
- })), l = Pa(n, i - K.dotRadius, r, c), u = c.map((e) => e.text), d = r ? `${r}: ${u.join(" · ")}` : u.join(" · "), f = `<g class="xychart-dot-group">${s}`;
3834
+ })), l = La(n, i - K.dotRadius, r, c), u = c.map((e) => e.text), d = r ? `${r}: ${u.join(" · ")}` : u.join(" · "), f = `<g class="xychart-dot-group">${s}`;
3800
3835
  for (let t of e) {
3801
3836
  let e = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`;
3802
3837
  f += `<circle cx="${J(t.x)}" cy="${J(t.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`;
3803
3838
  }
3804
3839
  f += `<title>${Y(d)}</title>${l}</g>`, A.push(f);
3805
3840
  } else if (a) {
3806
- let t = e[0], r = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`, i = Ia(t.value), a = t.label ? `${t.label}: ${i}` : i, o = Fa(n, t.y - K.dotRadius, i), s = m ? `<circle cx="${J(n)}" cy="${J(t.y)}" r="${K.dotRadius * 3}" fill="transparent" class="xychart-hit"/>` : "";
3841
+ let t = e[0], r = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`, i = za(t.value), a = t.label ? `${t.label}: ${i}` : i, o = Ra(n, t.y - K.dotRadius, i), s = m ? `<circle cx="${J(n)}" cy="${J(t.y)}" r="${K.dotRadius * 3}" fill="transparent" class="xychart-hit"/>` : "";
3807
3842
  A.push(`<g class="xychart-dot-group">${s}<circle cx="${J(t.x)}" cy="${J(t.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${Y(a)}</title>${o}</g>`);
3808
3843
  } else for (let t of e) {
3809
3844
  let e = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`;
@@ -3834,13 +3869,13 @@ function ka(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
3834
3869
  for (let e of A) u.push(e);
3835
3870
  return u.push("</svg>"), u.join("\n");
3836
3871
  }
3837
- function Aa(e, t, n, r, i, a) {
3872
+ function Na(e, t, n, r, i, a) {
3838
3873
  let o = r ?? E, s = /* @__PURE__ */ new Set();
3839
3874
  for (let t of e.bars) s.add(t.colorIndex);
3840
3875
  for (let t of e.lines) s.add(t.colorIndex);
3841
3876
  let c = [];
3842
3877
  for (let e of [...s].sort((e, t) => e - t)) {
3843
- let t = e === 0 ? `var(--accent, ${E})` : ee(e, o, i);
3878
+ let t = e === 0 ? `var(--accent, ${E})` : j(e, o, i);
3844
3879
  c.push(` --xychart-color-${e}: ${t};`), c.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`);
3845
3880
  }
3846
3881
  let l = [];
@@ -3870,7 +3905,7 @@ ${l.join("\n")}${u}
3870
3905
  defs: ""
3871
3906
  };
3872
3907
  }
3873
- function ja(e, t, n, r, i) {
3908
+ function Pa(e, t, n, r, i) {
3874
3909
  let a = Math.min(i, n / 2, r / 2);
3875
3910
  return a <= 0 ? `M${J(e)},${J(t)} h${J(n)} v${J(r)} h${J(-n)} Z` : [
3876
3911
  `M${J(e)},${J(t + a)}`,
@@ -3884,7 +3919,7 @@ function ja(e, t, n, r, i) {
3884
3919
  "Z"
3885
3920
  ].join(" ");
3886
3921
  }
3887
- function Ma(e, t, n, r, i) {
3922
+ function Fa(e, t, n, r, i) {
3888
3923
  let a = Math.min(i, n / 2, r / 2);
3889
3924
  return a <= 0 ? `M${J(e)},${J(t)} h${J(n)} v${J(r)} h${J(-n)} Z` : [
3890
3925
  `M${J(e + a)},${J(t)}`,
@@ -3899,7 +3934,7 @@ function Ma(e, t, n, r, i) {
3899
3934
  "Z"
3900
3935
  ].join(" ");
3901
3936
  }
3902
- function Na(e) {
3937
+ function Ia(e) {
3903
3938
  if (e.length === 0) return "";
3904
3939
  if (e.length === 1) return `M${J(e[0].x)},${J(e[0].y)}`;
3905
3940
  if (e.length === 2) return `M${J(e[0].x)},${J(e[0].y)} L${J(e[1].x)},${J(e[1].y)}`;
@@ -3924,7 +3959,7 @@ function Na(e) {
3924
3959
  }
3925
3960
  return o;
3926
3961
  }
3927
- function Pa(e, t, n, r) {
3962
+ function La(e, t, n, r) {
3928
3963
  let i = F(n, q.fontSize, 600), a = Math.max(...r.map((e) => {
3929
3964
  let t = F(e.legendLabel, q.fontSize, q.fontWeight), n = F(e.text, q.fontSize, q.fontWeight);
3930
3965
  return t + 10 + n;
@@ -3936,11 +3971,11 @@ function Pa(e, t, n, r) {
3936
3971
  for (let e of r) h += 20, m += `<text x="${J(g)}" y="${J(h)}" text-anchor="start" font-size="${q.fontSize}" font-weight="${q.fontWeight}" dy="${z}" class="xychart-tip xychart-tip-text">${Y(e.legendLabel)}</text>`, m += `<text x="${J(_)}" y="${J(h)}" text-anchor="end" font-size="${q.fontSize}" font-weight="${q.fontWeight}" dy="${z}" class="xychart-tip xychart-tip-text">${Y(e.text)}</text>`;
3937
3972
  return m;
3938
3973
  }
3939
- function Fa(e, t, n) {
3974
+ function Ra(e, t, n) {
3940
3975
  let r = F(n, q.fontSize, q.fontWeight) + q.padX * 2, i = q.height, a = Math.max(q.minY, t - q.offsetY - i - q.pointerSize), o = e - r / 2, s = e, c = a + i / 2, l = e, u = a + i, d = q.pointerSize, f = `<polygon points="${J(l - d)},${J(u)} ${J(l + d)},${J(u)} ${J(l)},${J(u + d)}" class="xychart-tip xychart-tip-ptr"/>`;
3941
3976
  return `<rect x="${J(o)}" y="${J(a)}" width="${J(r)}" height="${i}" rx="${q.rx}" class="xychart-tip xychart-tip-bg"/>` + f + `<text x="${J(s)}" y="${J(c)}" text-anchor="middle" dy="${z}" class="xychart-tip xychart-tip-text">${Y(n)}</text>`;
3942
3977
  }
3943
- function Ia(e) {
3978
+ function za(e) {
3944
3979
  return Number.isInteger(e) ? e.toLocaleString("en-US") : e.toFixed(+(Math.abs(e) < 10));
3945
3980
  }
3946
3981
  function J(e) {
@@ -3964,40 +3999,40 @@ var X = {
3964
3999
  fontWeight: 400,
3965
4000
  paletteSize: 12,
3966
4001
  minPercent: 1
3967
- }, La = Math.PI * 2;
4002
+ }, Ba = Math.PI * 2;
3968
4003
  function Z(e) {
3969
4004
  return String(Math.round(e * 100) / 100);
3970
4005
  }
3971
- function Ra(e, t, n, r) {
4006
+ function Va(e, t, n, r) {
3972
4007
  return {
3973
4008
  x: e + n * Math.sin(r),
3974
4009
  y: t - n * Math.cos(r)
3975
4010
  };
3976
4011
  }
3977
- function za(e, t, n, r, i) {
3978
- if (i - r >= La - 1e-9) return `M${Z(e)},${Z(t - n)}A${Z(n)},${Z(n)},0,1,1,${Z(e)},${Z(t + n)}A${Z(n)},${Z(n)},0,1,1,${Z(e)},${Z(t - n)}Z`;
3979
- let a = Ra(e, t, n, r), o = Ra(e, t, n, i), s = +(i - r > Math.PI);
4012
+ function Ha(e, t, n, r, i) {
4013
+ if (i - r >= Ba - 1e-9) return `M${Z(e)},${Z(t - n)}A${Z(n)},${Z(n)},0,1,1,${Z(e)},${Z(t + n)}A${Z(n)},${Z(n)},0,1,1,${Z(e)},${Z(t - n)}Z`;
4014
+ let a = Va(e, t, n, r), o = Va(e, t, n, i), s = +(i - r > Math.PI);
3980
4015
  return `M${Z(a.x)},${Z(a.y)}A${Z(n)},${Z(n)},0,${s},1,${Z(o.x)},${Z(o.y)}L${Z(e)},${Z(t)}Z`;
3981
4016
  }
3982
- function Ba(e, t, n) {
4017
+ function Ua(e, t, n) {
3983
4018
  return n ? `${e} [${String(t)}]` : e;
3984
4019
  }
3985
- function Va(e, t = {}) {
4020
+ function Wa(e, t = {}) {
3986
4021
  let n = X.height, r = n, i = Math.min(r, n) / 2 - X.margin, a = r / 2, o = n / 2, s = e.slices.reduce((e, t) => e + t.value, 0), c = e.slices.map((e, t) => ({
3987
4022
  slice: e,
3988
4023
  colorIndex: t % X.paletteSize
3989
- })).filter(({ slice: e }) => e.value / s * 100 >= X.minPercent), l = c.reduce((e, t) => e + t.slice.value, 0), u = X.legendRectSize + X.legendSpacing, d = e.slices.length, f = u * d / 2, p = a + 12 * X.legendRectSize, m = e.slices.map((t) => Ba(t.label, t.value, e.showData)), h = Math.max(0, ...m.map((e) => F(e, X.legendFontSize, X.fontWeight))), g = d > 0 ? r + X.margin + X.legendRectSize + X.legendSpacing + h : r + X.margin, _ = e.title ?? "", v = _.length > 0 ? F(_, X.titleFontSize, X.fontWeight) : 0, y = a - v / 2, b = a + v / 2, x = Math.min(0, y), S = Math.max(g, b), C = o - f, w = o + (d - 1) * u - f + X.legendRectSize, T = d > 0 ? Math.min(0, C) : 0, E = d > 0 ? Math.max(n, w) : n, D = -x, O = -T, k = a + D, A = o + O, j = [], ee = 0, M = i * X.textPosition;
4024
+ })).filter(({ slice: e }) => e.value / s * 100 >= X.minPercent), l = c.reduce((e, t) => e + t.slice.value, 0), u = X.legendRectSize + X.legendSpacing, d = e.slices.length, f = u * d / 2, p = a + 12 * X.legendRectSize, m = e.slices.map((t) => Ua(t.label, t.value, e.showData)), h = Math.max(0, ...m.map((e) => F(e, X.legendFontSize, X.fontWeight))), g = d > 0 ? r + X.margin + X.legendRectSize + X.legendSpacing + h : r + X.margin, _ = e.title ?? "", v = _.length > 0 ? F(_, X.titleFontSize, X.fontWeight) : 0, y = a - v / 2, b = a + v / 2, x = Math.min(0, y), S = Math.max(g, b), C = o - f, w = o + (d - 1) * u - f + X.legendRectSize, T = d > 0 ? Math.min(0, C) : 0, E = d > 0 ? Math.max(n, w) : n, D = -x, O = -T, k = a + D, A = o + O, ee = [], j = 0, M = i * X.textPosition;
3990
4025
  for (let { slice: e, colorIndex: t } of c) {
3991
- let n = ee, r = ee + e.value / l * La;
3992
- ee = r;
3993
- let a = Ra(k, A, M, (n + r) / 2);
3994
- j.push({
4026
+ let n = j, r = j + e.value / l * Ba;
4027
+ j = r;
4028
+ let a = Va(k, A, M, (n + r) / 2);
4029
+ ee.push({
3995
4030
  label: e.label,
3996
4031
  value: e.value,
3997
4032
  colorIndex: t,
3998
4033
  startAngle: n,
3999
4034
  endAngle: r,
4000
- path: za(k, A, i, n, r),
4035
+ path: Ha(k, A, i, n, r),
4001
4036
  percentText: `${(e.value / s * 100).toFixed(0)}%`,
4002
4037
  labelX: a.x,
4003
4038
  labelY: a.y
@@ -4027,7 +4062,7 @@ function Va(e, t = {}) {
4027
4062
  x: k,
4028
4063
  y: A - (n - 50) / 2
4029
4064
  } : void 0,
4030
- slices: j,
4065
+ slices: ee,
4031
4066
  legend: N,
4032
4067
  accTitle: e.accTitle,
4033
4068
  accDescr: e.accDescr
@@ -4038,14 +4073,14 @@ function Va(e, t = {}) {
4038
4073
  function Q(e) {
4039
4074
  return String(Math.round(e * 100) / 100);
4040
4075
  }
4041
- function Ha(e, t, n) {
4042
- return e === 0 ? `var(--accent, ${E})` : ee(e, t ?? E, n);
4076
+ function Ga(e, t, n) {
4077
+ return e === 0 ? `var(--accent, ${E})` : j(e, t ?? E, n);
4043
4078
  }
4044
- function Ua(e, t, n) {
4079
+ function Ka(e, t, n) {
4045
4080
  let r = /* @__PURE__ */ new Set();
4046
4081
  for (let t of e.slices) r.add(t.colorIndex);
4047
4082
  for (let t of e.legend) r.add(t.colorIndex);
4048
- let i = [...r].sort((e, t) => e - t), a = i.map((e) => ` --pie-color-${e}: ${Ha(e, t.accent, t.bg)};`), o = i.map((e) => ` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`), s = a.length > 0 ? `\n svg {\n${a.join("\n")}\n }` : "";
4083
+ let i = [...r].sort((e, t) => e - t), a = i.map((e) => ` --pie-color-${e}: ${Ga(e, t.accent, t.bg)};`), o = i.map((e) => ` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`), s = a.length > 0 ? `\n svg {\n${a.join("\n")}\n }` : "";
4049
4084
  return `${b(n)}
4050
4085
  .pie-outer { fill: none; stroke: var(--fg); stroke-width: ${X.outerStrokeWidth}px; }
4051
4086
  .pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }
@@ -4055,9 +4090,9 @@ function Ua(e, t, n) {
4055
4090
  ${o.join("\n")}
4056
4091
  </style>`;
4057
4092
  }
4058
- function Wa(e, n, a = "Inter", o = !1, s, c, l, u = {}) {
4093
+ function qa(e, n, a = "Inter", o = !1, s, c, l, u = {}) {
4059
4094
  let d = [];
4060
- d.push(Lr(x(e.width, e.height, n, o, c ?? e.accTitle, l, void 0, u.styleAttribute, e.accDescr), s)), d.push(t(a, !1, u.nonce)), d.push(Ua(e, n, u.nonce)), d.push(`<circle cx="${Q(e.cx)}" cy="${Q(e.cy)}" r="${Q(e.outerRadius)}" class="pie-outer"/>`);
4095
+ d.push(Br(x(e.width, e.height, n, o, c ?? e.accTitle, l, void 0, u.styleAttribute, e.accDescr), s)), d.push(t(a, !1, u.nonce)), d.push(Ka(e, n, u.nonce)), d.push(`<circle cx="${Q(e.cx)}" cy="${Q(e.cy)}" r="${Q(e.outerRadius)}" class="pie-outer"/>`);
4061
4096
  for (let t of e.slices) d.push(`<path d="${t.path}" class="pie-slice pie-color-${t.colorIndex}" data-label="${r(t.label)}" data-value="${t.value}"/>`);
4062
4097
  for (let t of e.slices) d.push(`<text x="${Q(t.labelX)}" y="${Q(t.labelY)}" text-anchor="middle" class="pie-slice-label">${i(t.percentText)}</text>`);
4063
4098
  e.title && d.push(`<text x="${Q(e.title.x)}" y="${Q(e.title.y)}" text-anchor="middle" class="pie-title">${i(e.title.text)}</text>`);
@@ -4066,7 +4101,7 @@ function Wa(e, n, a = "Inter", o = !1, s, c, l, u = {}) {
4066
4101
  }
4067
4102
  //#endregion
4068
4103
  //#region packages/svg-renderer/src/c4/arial-widths.ts
4069
- var Ga = 2048, Ka = [
4104
+ var Ja = 2048, Ya = [
4070
4105
  569,
4071
4106
  569,
4072
4107
  727,
@@ -4162,7 +4197,7 @@ var Ga = 2048, Ka = [
4162
4197
  532,
4163
4198
  684,
4164
4199
  1196
4165
- ], qa = [
4200
+ ], Xa = [
4166
4201
  569,
4167
4202
  682,
4168
4203
  971,
@@ -4259,9 +4294,9 @@ var Ga = 2048, Ka = [
4259
4294
  801,
4260
4295
  1196
4261
4296
  ];
4262
- function Ja(e, t) {
4297
+ function Za(e, t) {
4263
4298
  let n = e.codePointAt(0);
4264
- if (!(n < 32 || n > 126)) return (t ? qa : Ka)[n - 32] / Ga;
4299
+ if (!(n < 32 || n > 126)) return (t ? Xa : Ya)[n - 32] / Ja;
4265
4300
  }
4266
4301
  //#endregion
4267
4302
  //#region packages/svg-renderer/src/c4/metrics.ts
@@ -4300,20 +4335,20 @@ var $ = {
4300
4335
  personHeadOverlap: .27,
4301
4336
  dbTrim: 3.91,
4302
4337
  queueExtra: 10
4303
- }, Ya = $.width - 2 * $.shapePadding;
4304
- function Xa(e, t, n) {
4338
+ }, Qa = $.width - 2 * $.shapePadding;
4339
+ function $a(e, t, n) {
4305
4340
  let r = [];
4306
4341
  for (let i of e.split("\n")) {
4307
4342
  let e = "";
4308
4343
  for (let a of i.split(/\s+/).filter(Boolean)) {
4309
4344
  let i = e ? `${e} ${a}` : a;
4310
- e && no(i, n, 400) > t ? (r.push(e), e = a) : e = i;
4345
+ e && ao(i, n, 400) > t ? (r.push(e), e = a) : e = i;
4311
4346
  }
4312
4347
  r.push(e);
4313
4348
  }
4314
4349
  return r;
4315
4350
  }
4316
- function Za(e, t) {
4351
+ function eo(e, t) {
4317
4352
  let n = Math.min(Math.max(e * $.personHeadRatio, $.personHeadMin), $.personHeadMax), r = n * (2 - $.personHeadOverlap), i = t === void 0 ? Infinity : t - r;
4318
4353
  return {
4319
4354
  rx: Math.min(e * $.personRx, i * $.personRxMaxOfHeight),
@@ -4321,43 +4356,43 @@ function Za(e, t) {
4321
4356
  pillTop: r
4322
4357
  };
4323
4358
  }
4324
- function Qa(e, t) {
4325
- return e * $.nameLine + $.typeLine + $a(t);
4359
+ function to(e, t) {
4360
+ return e * $.nameLine + $.typeLine + no(t);
4326
4361
  }
4327
- function $a(e) {
4362
+ function no(e) {
4328
4363
  return e === 0 ? 0 : $.descrLine + (e - 1) * $.descrExtraLine;
4329
4364
  }
4330
- function eo(e) {
4365
+ function ro(e) {
4331
4366
  let t = e / 2;
4332
4367
  return {
4333
4368
  rx: t,
4334
4369
  ry: t / (2.5 + e / 50)
4335
4370
  };
4336
4371
  }
4337
- function to(e) {
4372
+ function io(e) {
4338
4373
  let t = e / 2;
4339
4374
  return {
4340
4375
  rx: t / (2.5 + e / 50),
4341
4376
  ry: t
4342
4377
  };
4343
4378
  }
4344
- function no(e, t, n) {
4379
+ function ao(e, t, n) {
4345
4380
  let r = 0;
4346
4381
  for (let i of e) {
4347
- let e = Ja(i, n >= 600);
4382
+ let e = Za(i, n >= 600);
4348
4383
  r += e === void 0 ? F(i, t, n) * $.textScale : e * t;
4349
4384
  }
4350
4385
  return r;
4351
4386
  }
4352
- function ro(e, t, n, r) {
4353
- let i = Qa(t, n), a = i + 2 * $.shapePadding, o = Math.max($.width, r + 2 * $.shapePadding);
4387
+ function oo(e, t, n, r) {
4388
+ let i = to(t, n), a = i + 2 * $.shapePadding, o = Math.max($.width, r + 2 * $.shapePadding);
4354
4389
  if (e.kind === "person") return {
4355
4390
  width: o,
4356
- height: Za(o).pillTop + a,
4391
+ height: eo(o).pillTop + a,
4357
4392
  textHeight: i
4358
4393
  };
4359
4394
  if (e.shape === "db") {
4360
- let { ry: e } = eo(o);
4395
+ let { ry: e } = ro(o);
4361
4396
  return {
4362
4397
  width: o,
4363
4398
  height: a + 2 * e - $.dbTrim,
@@ -4365,7 +4400,7 @@ function ro(e, t, n, r) {
4365
4400
  };
4366
4401
  }
4367
4402
  if (e.shape === "queue") {
4368
- let e = i + $.queueExtra, { rx: t } = to(e);
4403
+ let e = i + $.queueExtra, { rx: t } = io(e);
4369
4404
  return {
4370
4405
  width: o + 3 * t,
4371
4406
  height: e,
@@ -4378,7 +4413,7 @@ function ro(e, t, n, r) {
4378
4413
  textHeight: i
4379
4414
  };
4380
4415
  }
4381
- function io(e) {
4416
+ function so(e) {
4382
4417
  let t = "#ffffff";
4383
4418
  if (e.external) switch (e.kind) {
4384
4419
  case "person": return {
@@ -4427,33 +4462,33 @@ function io(e) {
4427
4462
  }
4428
4463
  //#endregion
4429
4464
  //#region packages/svg-renderer/src/c4/layout.ts
4430
- function ao() {
4465
+ function co() {
4431
4466
  return { next: { cnt: 0 } };
4432
4467
  }
4433
- function oo(e, t, n, r, i) {
4468
+ function lo(e, t, n, r, i) {
4434
4469
  e.next.startx = e.startx = t, e.next.stopx = e.stopx = n, e.next.starty = e.starty = r, e.next.stopy = e.stopy = i;
4435
4470
  }
4436
- function so(e, t, n, r) {
4471
+ function uo(e, t, n, r) {
4437
4472
  let i = e[t];
4438
4473
  e[t] = i === void 0 ? n : r(n, i);
4439
4474
  }
4440
- function co(e, t) {
4475
+ function fo(e, t) {
4441
4476
  e.next.cnt += 1;
4442
4477
  let n = $.shapeMargin, r = e.next.startx === e.next.stopx ? e.next.stopx + n : e.next.stopx + n * 2, i = r + t.width, a = e.next.starty + n * 2, o = a + t.height;
4443
- (r >= e.widthLimit || i >= e.widthLimit || e.next.cnt > $.shapeInRow) && (r = e.next.startx + n + $.nextLinePaddingX, a = e.next.stopy + n * 2, e.next.stopx = i = r + t.width, e.next.starty = e.next.stopy, e.next.stopy = o = a + t.height, e.next.cnt = 1), t.x = r, t.y = a, so(e, "startx", r, Math.min), so(e, "starty", a, Math.min), so(e, "stopx", i, Math.max), so(e, "stopy", o, Math.max), so(e.next, "startx", r, Math.min), so(e.next, "starty", a, Math.min), so(e.next, "stopx", i, Math.max), so(e.next, "stopy", o, Math.max);
4478
+ (r >= e.widthLimit || i >= e.widthLimit || e.next.cnt > $.shapeInRow) && (r = e.next.startx + n + $.nextLinePaddingX, a = e.next.stopy + n * 2, e.next.stopx = i = r + t.width, e.next.starty = e.next.stopy, e.next.stopy = o = a + t.height, e.next.cnt = 1), t.x = r, t.y = a, uo(e, "startx", r, Math.min), uo(e, "starty", a, Math.min), uo(e, "stopx", i, Math.max), uo(e, "stopy", o, Math.max), uo(e.next, "startx", r, Math.min), uo(e.next, "starty", a, Math.min), uo(e.next, "stopx", i, Math.max), uo(e.next, "stopy", o, Math.max);
4444
4479
  }
4445
- function lo(e) {
4446
- let t = Xa(e.label, Ya, $.nameSize), n = e.description ? Xa(e.description, Ya, $.descrSize) : [], r = Math.max(...t.map((e) => no(e, $.nameSize, 700)), no(A(e), $.typeSize, 400), ...n.map((e) => no(e, $.descrSize, 400)));
4480
+ function po(e) {
4481
+ let t = $a(e.label, Qa, $.nameSize), n = e.description ? $a(e.description, Qa, $.descrSize) : [], r = Math.max(...t.map((e) => ao(e, $.nameSize, 700)), ao(A(e), $.typeSize, 400), ...n.map((e) => ao(e, $.descrSize, 400)));
4447
4482
  return {
4448
4483
  el: e,
4449
4484
  nameLines: t,
4450
4485
  descriptionLines: n,
4451
4486
  x: 0,
4452
4487
  y: 0,
4453
- ...ro(e, t.length, n.length, r)
4488
+ ...oo(e, t.length, n.length, r)
4454
4489
  };
4455
4490
  }
4456
- function uo(e) {
4491
+ function mo(e) {
4457
4492
  let t = /* @__PURE__ */ new Set(), n = new Map(e.elements.map((e) => [e.alias, e])), r = (e) => {
4458
4493
  let i = e.elementAliases.flatMap((e) => {
4459
4494
  t.add(e);
@@ -4473,15 +4508,15 @@ function uo(e) {
4473
4508
  children: i
4474
4509
  };
4475
4510
  }
4476
- function fo(e) {
4511
+ function ho(e) {
4477
4512
  let t = /* @__PURE__ */ new Map(), n = [], r = $.diagramMarginX, i = $.diagramMarginY, a = (e, n) => {
4478
4513
  for (let r of n) {
4479
- let n = lo(r);
4480
- t.set(r.alias, n), co(e, n);
4514
+ let n = po(r);
4515
+ t.set(r.alias, n), fo(e, n);
4481
4516
  }
4482
4517
  e.stopx += $.shapeMargin, e.stopy += $.shapeMargin;
4483
4518
  }, o = (e, t, s) => {
4484
- let c = ao();
4519
+ let c = co();
4485
4520
  c.widthLimit = e.widthLimit / Math.min($.boundaryInRow, t.length);
4486
4521
  for (let [l, u] of t.entries()) {
4487
4522
  let t = u.boundary, d = 0, f = d + 8;
@@ -4491,10 +4526,10 @@ function fo(e) {
4491
4526
  let m;
4492
4527
  if (t?.description && (m = d + 20, d = m + $.boundaryDescrHeight), t || (d = $.rootHeadingHeight), l === 0 || l % $.boundaryInRow === 0) {
4493
4528
  let t = e.startx + $.diagramMarginX, n = e.stopy + $.diagramMarginY + d;
4494
- oo(c, t, t, n, n);
4529
+ lo(c, t, t, n, n);
4495
4530
  } else {
4496
4531
  let e = c.stopx === c.startx ? c.startx : c.stopx + $.diagramMarginX;
4497
- oo(c, e, e, c.starty, c.starty);
4532
+ lo(c, e, e, c.starty, c.starty);
4498
4533
  }
4499
4534
  if (u.elements.length > 0 && a(c, u.elements), u.children.length > 0 && o(c, u.children, s + 1), t) {
4500
4535
  let e = c.stopx - c.startx, r = c.stopy - c.starty;
@@ -4515,15 +4550,15 @@ function fo(e) {
4515
4550
  }
4516
4551
  e.stopy = Math.max(c.stopy + $.shapeMargin, e.stopy), e.stopx = Math.max(c.stopx + $.shapeMargin, e.stopx), r = Math.max(r, e.stopx), i = Math.max(i, e.stopy);
4517
4552
  }
4518
- }, s = ao();
4519
- return oo(s, $.diagramMarginX, $.diagramMarginX, $.diagramMarginY, $.diagramMarginY), s.widthLimit = $.screenWidth, o(s, [e], -1), {
4553
+ }, s = co();
4554
+ return lo(s, $.diagramMarginX, $.diagramMarginX, $.diagramMarginY, $.diagramMarginY), s.widthLimit = $.screenWidth, o(s, [e], -1), {
4520
4555
  elements: t,
4521
4556
  boundaries: n,
4522
4557
  maxX: r,
4523
4558
  maxY: i
4524
4559
  };
4525
4560
  }
4526
- function po(e, t) {
4561
+ function go(e, t) {
4527
4562
  let n = e.x + e.width / 2, r = e.y + e.height / 2, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2;
4528
4563
  if (i === 0 && a === 0) return {
4529
4564
  x: n,
@@ -4542,8 +4577,8 @@ function po(e, t) {
4542
4577
  y: r + l
4543
4578
  };
4544
4579
  }
4545
- function mo(e, t) {
4546
- let n = Za(e.width, e.height), r = e.x + e.width / 2, i = e.y + e.height / 2, a = e.width, o = e.height, s = -o / 2 + n.headRadius, c = -o / 2 + n.pillTop, l = n.rx, u = (e, t, n, r, i, a) => Array.from({ length: r }, (o, s) => {
4580
+ function _o(e, t) {
4581
+ let n = eo(e.width, e.height), r = e.x + e.width / 2, i = e.y + e.height / 2, a = e.width, o = e.height, s = -o / 2 + n.headRadius, c = -o / 2 + n.pillTop, l = n.rx, u = (e, t, n, r, i, a) => Array.from({ length: r }, (o, s) => {
4547
4582
  let c = (i + s * (a - i) / (r - 1)) * Math.PI / 180;
4548
4583
  return {
4549
4584
  x: e - n * Math.cos(c),
@@ -4556,7 +4591,7 @@ function mo(e, t) {
4556
4591
  ...u(a / 2 - l, o / 2 - l, l, 12, 270, 180),
4557
4592
  ...u(a / 2 - l, c + l, l, 12, 180, 90)
4558
4593
  ];
4559
- return go({
4594
+ return yo({
4560
4595
  x: r,
4561
4596
  y: i
4562
4597
  }, t, f.map((e) => ({
@@ -4564,7 +4599,7 @@ function mo(e, t) {
4564
4599
  y: i + e.y
4565
4600
  })));
4566
4601
  }
4567
- function ho(e, t, n, r) {
4602
+ function vo(e, t, n, r) {
4568
4603
  let i = t.y - e.y, a = e.x - t.x, o = t.x * e.y - e.x * t.y, s = i * n.x + a * n.y + o, c = i * r.x + a * r.y + o;
4569
4604
  if (s !== 0 && c !== 0 && s * c > 0) return;
4570
4605
  let l = r.y - n.y, u = n.x - r.x, d = r.x * n.y - n.x * r.y, f = l * e.x + u * e.y + d, p = l * t.x + u * t.y + d;
@@ -4577,18 +4612,18 @@ function ho(e, t, n, r) {
4577
4612
  y: g < 0 ? (g - h) / m : (g + h) / m
4578
4613
  };
4579
4614
  }
4580
- function go(e, t, n) {
4615
+ function yo(e, t, n) {
4581
4616
  let r, i = Infinity;
4582
4617
  return n.forEach((a, o) => {
4583
- let s = ho(e, t, a, n[(o + 1) % n.length]);
4618
+ let s = vo(e, t, a, n[(o + 1) % n.length]);
4584
4619
  if (!s) return;
4585
4620
  let c = Math.hypot(s.x - t.x, s.y - t.y);
4586
4621
  c < i && (r = s, i = c);
4587
4622
  }), r ?? e;
4588
4623
  }
4589
- var _o = 1e-6;
4590
- function vo(e, t) {
4591
- let n = po(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = eo(e.width), s = n.x - r, c = Math.abs(s) < e.width / 2 - _o || Math.abs(Math.abs(s) - e.width / 2) <= _o && Math.abs(n.y - i) > e.height / 2 - o;
4624
+ var bo = 1e-6;
4625
+ function xo(e, t) {
4626
+ let n = go(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = ro(e.width), s = n.x - r, c = Math.abs(s) < e.width / 2 - bo || Math.abs(Math.abs(s) - e.width / 2) <= bo && Math.abs(n.y - i) > e.height / 2 - o;
4592
4627
  if (a === 0 || !c) return n;
4593
4628
  let l = o * o * (1 - s * s / (a * a)), u = o - (l > 0 ? Math.sqrt(l) : l);
4594
4629
  return t.y - i > 0 && (u = -u), {
@@ -4596,8 +4631,8 @@ function vo(e, t) {
4596
4631
  y: n.y + u
4597
4632
  };
4598
4633
  }
4599
- function yo(e, t) {
4600
- let n = po(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = to(e.height), s = n.y - i, c = Math.abs(s) < e.height / 2 - _o || Math.abs(Math.abs(s) - e.height / 2) <= _o && Math.abs(n.x - r) > e.width / 2 - a;
4634
+ function So(e, t) {
4635
+ let n = go(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = io(e.height), s = n.y - i, c = Math.abs(s) < e.height / 2 - bo || Math.abs(Math.abs(s) - e.height / 2) <= bo && Math.abs(n.x - r) > e.width / 2 - a;
4601
4636
  if (o === 0 || !c) return n;
4602
4637
  let l = a * a * (1 - s * s / (o * o)), u = a - Math.sqrt(Math.abs(l));
4603
4638
  return t.x - r > 0 && (u = -u), {
@@ -4605,16 +4640,16 @@ function yo(e, t) {
4605
4640
  y: n.y
4606
4641
  };
4607
4642
  }
4608
- function bo(e, t) {
4643
+ function Co(e, t) {
4609
4644
  let n = e.el;
4610
- return n?.kind === "person" ? mo(e, t) : n?.shape === "db" ? vo(e, t) : n?.shape === "queue" ? yo(e, t) : po(e, t);
4645
+ return n?.kind === "person" ? _o(e, t) : n?.shape === "db" ? xo(e, t) : n?.shape === "queue" ? So(e, t) : go(e, t);
4611
4646
  }
4612
- var xo = (e) => ({
4647
+ var wo = (e) => ({
4613
4648
  x: e.x + e.width / 2,
4614
4649
  y: e.y + e.height / 2
4615
4650
  });
4616
- function So(e, t, n, r) {
4617
- let i = n.get(e.from), a = n.get(e.to), o = bo(i, xo(a)), s = bo(a, xo(i)), c = s.x - o.x, l = s.y - o.y, u = (e) => ({
4651
+ function To(e, t, n, r) {
4652
+ let i = n.get(e.from), a = n.get(e.to), o = Co(i, wo(a)), s = Co(a, wo(i)), c = s.x - o.x, l = s.y - o.y, u = (e) => ({
4618
4653
  x: e.x,
4619
4654
  y: e.y + r
4620
4655
  }), d = {
@@ -4628,41 +4663,41 @@ function So(e, t, n, r) {
4628
4663
  let t = {
4629
4664
  x: Math.min(o.x, s.x) + Math.abs(c) / 2,
4630
4665
  y: Math.min(o.y, s.y) + Math.abs(l) / 2
4631
- }, n = k(e)[0], r = e.label !== "" || e.index !== void 0 ? no(n ?? "", $.messageSize, 400) : 0;
4666
+ }, n = k(e)[0], r = e.label !== "" || e.index !== void 0 ? ao(n ?? "", $.messageSize, 400) : 0;
4632
4667
  if (d.labelPosition = u({
4633
4668
  x: t.x + r / 2,
4634
4669
  y: t.y
4635
4670
  }), e.technology) {
4636
- let n = no(`[${e.technology}]`, $.messageSize, 400);
4671
+ let n = ao(`[${e.technology}]`, $.messageSize, 400);
4637
4672
  d.technologyX = t.x + Math.max(r, n) / 2;
4638
4673
  }
4639
4674
  }
4640
4675
  return d;
4641
4676
  }
4642
- var Co = 2, wo = 2;
4643
- function To(e, t) {
4677
+ var Eo = 2, Do = 2;
4678
+ function Oo(e, t) {
4644
4679
  let n = e.labelPosition;
4645
4680
  return n ? k(e).map((r, i, a) => ({
4646
4681
  cx: (e.technology !== void 0 && i === a.length - 1 && e.technologyX !== void 0 ? e.technologyX : n.x) + t,
4647
4682
  cy: n.y + (i === 0 ? 0 : $.messageSize + 5),
4648
- w: no(r, $.messageSize, 400),
4683
+ w: ao(r, $.messageSize, 400),
4649
4684
  h: $.messageSize
4650
4685
  })) : [];
4651
4686
  }
4652
- var Eo = (e, t) => Math.abs(e.cx - t.cx) < (e.w + t.w) / 2 + Co && Math.abs(e.cy - t.cy) < (e.h + t.h) / 2 + Co;
4653
- function Do(e, t, n) {
4687
+ var ko = (e, t) => Math.abs(e.cx - t.cx) < (e.w + t.w) / 2 + Eo && Math.abs(e.cy - t.cy) < (e.h + t.h) / 2 + Eo;
4688
+ function Ao(e, t, n) {
4654
4689
  let r = e.points[0], i = e.points[e.points.length - 1];
4655
4690
  if (!e.labelPosition || !r || !i) return;
4656
4691
  let a = i.x - r.x, o = i.y - r.y, s = Math.hypot(a, o);
4657
4692
  if (s === 0) return;
4658
4693
  let c = a / s, l = o / s, u = (r) => {
4659
- let i = To(e, r * c).map((e) => ({
4694
+ let i = Oo(e, r * c).map((e) => ({
4660
4695
  ...e,
4661
4696
  cy: e.cy + r * l
4662
4697
  }));
4663
- return i.some((e) => [...t, ...n].some((t) => Eo(e, t))) ? void 0 : i;
4698
+ return i.some((e) => [...t, ...n].some((t) => ko(e, t))) ? void 0 : i;
4664
4699
  };
4665
- for (let t = 0; t <= s / 2; t += wo) for (let r of t === 0 ? [1] : [1, -1]) {
4700
+ for (let t = 0; t <= s / 2; t += Do) for (let r of t === 0 ? [1] : [1, -1]) {
4666
4701
  let i = u(r * t);
4667
4702
  if (i) {
4668
4703
  t !== 0 && (e.labelPosition = {
@@ -4672,9 +4707,9 @@ function Do(e, t, n) {
4672
4707
  return;
4673
4708
  }
4674
4709
  }
4675
- n.push(...To(e, 0));
4710
+ n.push(...Oo(e, 0));
4676
4711
  }
4677
- function Oo(e, t = {}) {
4712
+ function jo(e, t = {}) {
4678
4713
  if (e.elements.length === 0 && e.boundaries.length === 0) {
4679
4714
  let t = {
4680
4715
  variant: e.variant,
@@ -4686,7 +4721,7 @@ function Oo(e, t = {}) {
4686
4721
  };
4687
4722
  return e.title && (t.title = e.title), t;
4688
4723
  }
4689
- let n = fo(uo(e)), r = e.title ? $.titleExtra : 0, i = $.diagramMarginY + r, a = e.elements.flatMap((e) => {
4724
+ let n = ho(mo(e)), r = e.title ? $.titleExtra : 0, i = $.diagramMarginY + r, a = e.elements.flatMap((e) => {
4690
4725
  let t = n.elements.get(e.alias);
4691
4726
  return t ? [{
4692
4727
  ...e,
@@ -4703,13 +4738,13 @@ function Oo(e, t = {}) {
4703
4738
  })), s = /* @__PURE__ */ new Map();
4704
4739
  for (let e of n.elements.values()) s.set(e.el.alias, e);
4705
4740
  for (let e of n.boundaries) s.set(e.alias, e);
4706
- let c = e.relationships.map((e, t) => So(e, t, s, i)), l = a.map((e) => ({
4741
+ let c = e.relationships.map((e, t) => To(e, t, s, i)), l = a.map((e) => ({
4707
4742
  cx: e.x + e.width / 2,
4708
4743
  cy: e.y + e.height / 2,
4709
4744
  w: e.width + 12,
4710
4745
  h: e.height + 12
4711
4746
  })), u = [];
4712
- for (let e of c) Do(e, l, u);
4747
+ for (let e of c) Ao(e, l, u);
4713
4748
  let d = n.maxX + $.diagramMarginX, f = n.maxY + $.diagramMarginY + r, p = {
4714
4749
  variant: e.variant,
4715
4750
  width: d,
@@ -4725,22 +4760,22 @@ function Oo(e, t = {}) {
4725
4760
  }
4726
4761
  //#endregion
4727
4762
  //#region packages/svg-renderer/src/c4/renderer.ts
4728
- function ko(e, n, r = "Inter", o = !1, s = I, c, l, u, d = {}) {
4763
+ function Mo(e, n, r = "Inter", o = !1, s = I, c, l, u, d = {}) {
4729
4764
  let f = [];
4730
- f.push(Lr(x(e.width, e.height, n, o, l ?? e.title, u, void 0, d.styleAttribute), c)), f.push(t(r, !1, d.nonce)), e.title && e.titlePosition && f.push(a`<text class="c4-title" x="${e.titlePosition.x}" y="${e.titlePosition.y}" dy="${z}" ` + a`font-size="16" fill="var(--_text)">${i(e.title)}</text>`);
4731
- for (let t of e.boundaries) f.push(jo(t));
4732
- for (let t of e.elements) f.push(Mo(t));
4733
- for (let t of e.relationships) f.push(Lo(t)), f.push(Ro(t));
4765
+ f.push(Br(x(e.width, e.height, n, o, l ?? e.title, u, void 0, d.styleAttribute), c)), f.push(t(r, !1, d.nonce)), e.title && e.titlePosition && f.push(a`<text class="c4-title" x="${e.titlePosition.x}" y="${e.titlePosition.y}" dy="${z}" ` + a`font-size="16" fill="var(--_text)">${i(e.title)}</text>`);
4766
+ for (let t of e.boundaries) f.push(Po(t));
4767
+ for (let t of e.elements) f.push(Fo(t));
4768
+ for (let t of e.relationships) f.push(Bo(t)), f.push(Vo(t));
4734
4769
  return f.push("</svg>"), f.filter(Boolean).join("\n");
4735
4770
  }
4736
- function Ao(e, t, n, r, o) {
4771
+ function No(e, t, n, r, o) {
4737
4772
  return a` <text x="${t}" y="${n}" text-anchor="middle" dy="${z}" font-size="${r}" ` + a`${o}>${i(e)}</text>`;
4738
4773
  }
4739
- function jo(e) {
4774
+ function Po(e) {
4740
4775
  let t = [];
4741
4776
  t.push(a`<g class="c4-boundary" data-id="${r(e.alias)}" data-label="${r(e.label)}" data-depth="${e.depth}">`), t.push(a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="2.5" ry="2.5" ` + "fill=\"none\" stroke=\"var(--_text)\" stroke-width=\"1\" stroke-dasharray=\"7,7\" />");
4742
4777
  let n = e.x + e.width / 2;
4743
- t.push(Ao(e.label, n, e.y + (e.labelY ?? 8), $.boundarySize + 2, "font-weight=\"700\" fill=\"var(--_text)\""));
4778
+ t.push(No(e.label, n, e.y + (e.labelY ?? 8), $.boundarySize + 2, "font-weight=\"700\" fill=\"var(--_text)\""));
4744
4779
  let i = O({
4745
4780
  alias: e.alias,
4746
4781
  label: e.label,
@@ -4748,47 +4783,47 @@ function jo(e) {
4748
4783
  elementAliases: [],
4749
4784
  children: []
4750
4785
  });
4751
- return i && e.typeY !== void 0 && t.push(Ao(i, n, e.y + e.typeY, $.boundarySize, "fill=\"var(--_text)\"")), e.description && e.descrY !== void 0 && t.push(Ao(e.description, n, e.y + e.descrY, $.boundarySize - 2, "fill=\"var(--_text)\"")), t.push("</g>"), t.join("\n");
4786
+ return i && e.typeY !== void 0 && t.push(No(i, n, e.y + e.typeY, $.boundarySize, "fill=\"var(--_text)\"")), e.description && e.descrY !== void 0 && t.push(No(e.description, n, e.y + e.descrY, $.boundarySize - 2, "fill=\"var(--_text)\"")), t.push("</g>"), t.join("\n");
4752
4787
  }
4753
- function Mo(e) {
4754
- let t = io(e), { x: n, y: i, width: o, height: s } = e, c = n + o / 2, l = Qa(e.nameLines.length, e.descriptionLines.length), u = [];
4788
+ function Fo(e) {
4789
+ let t = so(e), { x: n, y: i, width: o, height: s } = e, c = n + o / 2, l = to(e.nameLines.length, e.descriptionLines.length), u = [];
4755
4790
  u.push(a`<g class="c4-element" data-id="${r(e.alias)}" data-kind="${e.kind}" data-shape="${e.shape}" ` + a`data-external="${e.external}" data-label="${r(e.label)}">`);
4756
4791
  let d, f = c;
4757
- if (e.kind === "person") u.push(...No(e, t)), d = i + Za(o).pillTop + $.shapePadding;
4792
+ if (e.kind === "person") u.push(...Io(e, t)), d = i + eo(o).pillTop + $.shapePadding;
4758
4793
  else if (e.shape === "db") {
4759
- u.push(...Po(e, t));
4760
- let { ry: n } = eo(o);
4794
+ u.push(...Lo(e, t));
4795
+ let { ry: n } = ro(o);
4761
4796
  d = i + (2 * n + s) / 2 - l / 2;
4762
4797
  } else if (e.shape === "queue") {
4763
- u.push(...Fo(e, t));
4764
- let { rx: n } = to(s);
4798
+ u.push(...Ro(e, t));
4799
+ let { rx: n } = io(s);
4765
4800
  f = c - n, d = i + s / 2 - l / 2;
4766
4801
  } else u.push(a` <rect x="${n}" y="${i}" width="${o}" height="${s}" rx="${$.cornerRadius}" ry="${$.cornerRadius}" ` + a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}" />`), d = i + $.shapePadding;
4767
4802
  let p = d;
4768
- for (let n of e.nameLines) u.push(Ao(n, f, p + $.nameLine / 2, $.nameSize, a`font-weight="700" fill="${t.text}"`)), p += $.nameLine;
4769
- return u.push(Ao(A(e), f, p + $.typeLine / 2, $.typeSize, a`fill="${t.text}"`)), p += $.typeLine, e.descriptionLines.forEach((e, n) => {
4770
- u.push(Ao(e, f, p + $.descrLine / 2 + n * $.descrExtraLine, $.descrSize, a`fill="${t.text}"`));
4771
- }), p += $a(e.descriptionLines.length), u.push("</g>"), u.join("\n");
4803
+ for (let n of e.nameLines) u.push(No(n, f, p + $.nameLine / 2, $.nameSize, a`font-weight="700" fill="${t.text}"`)), p += $.nameLine;
4804
+ return u.push(No(A(e), f, p + $.typeLine / 2, $.typeSize, a`fill="${t.text}"`)), p += $.typeLine, e.descriptionLines.forEach((e, n) => {
4805
+ u.push(No(e, f, p + $.descrLine / 2 + n * $.descrExtraLine, $.descrSize, a`fill="${t.text}"`));
4806
+ }), p += no(e.descriptionLines.length), u.push("</g>"), u.join("\n");
4772
4807
  }
4773
- function No(e, t) {
4774
- let { x: n, width: r } = e, { rx: i, headRadius: o, pillTop: s } = Za(r, e.height), c = e.y, l = n + r / 2, u = c + s, d = e.y + e.height - u, f = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4808
+ function Io(e, t) {
4809
+ let { x: n, width: r } = e, { rx: i, headRadius: o, pillTop: s } = eo(r, e.height), c = e.y, l = n + r / 2, u = c + s, d = e.y + e.height - u, f = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4775
4810
  return [a` <rect x="${n}" y="${u}" width="${r}" height="${d}" rx="${i}" ry="${i}" ${f} />`, a` <circle cx="${l}" cy="${c + o}" r="${o}" ${f} />`];
4776
4811
  }
4777
- function Po(e, t) {
4778
- let { x: n, y: r, width: i, height: o } = e, { rx: s, ry: c } = eo(i), l = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4812
+ function Lo(e, t) {
4813
+ let { x: n, y: r, width: i, height: o } = e, { rx: s, ry: c } = ro(i), l = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4779
4814
  return [a` <path d="M ${n} ${r + c} L ${n} ${r + o - c} A ${s} ${c} 0 0 0 ${n + i} ${r + o - c} L ${n + i} ${r + c} Z" ${l} />`, a` <ellipse cx="${n + s}" cy="${r + c}" rx="${s}" ry="${c}" ${l} />`];
4780
4815
  }
4781
- function Fo(e, t) {
4782
- let { x: n, y: r, width: i, height: o } = e, { rx: s, ry: c } = to(o), l = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4816
+ function Ro(e, t) {
4817
+ let { x: n, y: r, width: i, height: o } = e, { rx: s, ry: c } = io(o), l = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4783
4818
  return [a` <path d="M ${n + i - s} ${r} H ${n + s} A ${s} ${c} 0 0 0 ${n + s} ${r + o} H ${n + i - s} Z" ${l} />`, a` <ellipse cx="${n + i - s}" cy="${r + c}" rx="${s}" ry="${c}" ${l} />`];
4784
4819
  }
4785
- function Io(e, t) {
4820
+ function zo(e, t) {
4786
4821
  let n = e.x - t.x, r = e.y - t.y, i = Math.hypot(n, r);
4787
4822
  if (i === 0) return "";
4788
4823
  let o = n / i, s = r / i, c = e.x - o * 10, l = e.y - s * 10;
4789
4824
  return a`<polygon class="c4-arrowhead" points="${e.x},${e.y} ${c - s * 5},${l + o * 5} ${c + s * 5},${l - o * 5}" ` + "fill=\"var(--_text)\" />";
4790
4825
  }
4791
- function Lo(e) {
4826
+ function Bo(e) {
4792
4827
  let [t, n] = [e.points[0], e.points[e.points.length - 1]];
4793
4828
  if (!t || !n || t === n) return "";
4794
4829
  let i = [
@@ -4797,109 +4832,109 @@ function Lo(e) {
4797
4832
  a`data-to="${r(e.to)}"`
4798
4833
  ];
4799
4834
  e.label && i.push(a`data-label="${r(e.label)}"`), e.technology && i.push(a`data-technology="${r(e.technology)}"`);
4800
- let o = e.curve ? a`M ${t.x},${t.y} Q ${e.curve.x},${e.curve.y} ${n.x},${n.y}` : a`M ${t.x},${t.y} L ${n.x},${n.y}`, s = a`<path ${i.join(" ")} d="${o}" fill="none" stroke="var(--_text)" stroke-width="1" />`, c = e.curve ?? t, l = e.curve ?? n, u = Io(n, c), d = Io(t, l);
4835
+ let o = e.curve ? a`M ${t.x},${t.y} Q ${e.curve.x},${e.curve.y} ${n.x},${n.y}` : a`M ${t.x},${t.y} L ${n.x},${n.y}`, s = a`<path ${i.join(" ")} d="${o}" fill="none" stroke="var(--_text)" stroke-width="1" />`, c = e.curve ?? t, l = e.curve ?? n, u = zo(n, c), d = zo(t, l);
4801
4836
  return [s, ...e.bidirectional ? [u, d] : [e.reversed ? d : u]].filter(Boolean).join("\n");
4802
4837
  }
4803
- function Ro(e) {
4838
+ function Vo(e) {
4804
4839
  let t = k(e);
4805
4840
  if (t.length === 0 || !e.labelPosition) return "";
4806
4841
  let { x: n, y: i } = e.labelPosition, o = [a`<g class="c4-relationship-label" data-from="${r(e.from)}" data-to="${r(e.to)}">`];
4807
4842
  return t.forEach((r, a) => {
4808
4843
  let s = e.technology !== void 0 && a === t.length - 1, c = i + (a === 0 ? 0 : $.messageSize + 5);
4809
- o.push(Ao(r, s && e.technologyX !== void 0 ? e.technologyX : n, c, $.messageSize, s ? "font-style=\"italic\" fill=\"var(--_text)\"" : "fill=\"var(--_text)\""));
4844
+ o.push(No(r, s && e.technologyX !== void 0 ? e.technologyX : n, c, $.messageSize, s ? "font-style=\"italic\" fill=\"var(--_text)\"" : "fill=\"var(--_text)\""));
4810
4845
  }), o.push("</g>"), o.join("\n");
4811
4846
  }
4812
4847
  //#endregion
4813
4848
  //#region packages/svg-renderer/src/registry.ts
4814
- var zo = {
4849
+ var Ho = {
4815
4850
  type: "xychart",
4816
4851
  parse: ae,
4817
- layoutForSvg: ha,
4852
+ layoutForSvg: va,
4818
4853
  renderSvg(e, t, n) {
4819
4854
  let r = n.interactivity === void 0 ? n.interactive ?? !1 : n.interactivity === "full";
4820
- return ka(e, t.colors, t.font, t.transparent, r, t.embedSource, t.title, t.decorative, t.emit);
4855
+ return Ma(e, t.colors, t.font, t.transparent, r, t.embedSource, t.title, t.decorative, t.emit);
4821
4856
  }
4822
- }, Bo = {
4857
+ }, Uo = {
4823
4858
  type: "sequence",
4824
4859
  parse: ie,
4825
- layoutForSvg: Ki,
4860
+ layoutForSvg: Yi,
4826
4861
  renderSvg(e, t) {
4827
- return qi(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4862
+ return Xi(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4828
4863
  }
4829
4864
  };
4830
- function Vo(e) {
4865
+ function Wo(e) {
4831
4866
  return (e.interactivity ?? "static") !== "none";
4832
4867
  }
4833
- function Ho(e) {
4868
+ function Go(e) {
4834
4869
  return (e.interactivity ?? "static") === "full";
4835
4870
  }
4836
- var Uo = {
4871
+ var Ko = {
4837
4872
  type: "class",
4838
4873
  parse: P,
4839
- layoutForSvg: ai,
4874
+ layoutForSvg: ci,
4840
4875
  renderSvg(e, t, n) {
4841
- return li(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, Vo(n), t.emit);
4876
+ return fi(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, Wo(n), t.emit);
4842
4877
  }
4843
- }, Wo = {
4878
+ }, qo = {
4844
4879
  type: "er",
4845
4880
  parse: te,
4846
4881
  layoutForSvg(e, t) {
4847
- return Oi(C(e, t.direction), t);
4882
+ return ji(C(e, t.direction), t);
4848
4883
  },
4849
4884
  renderSvg(e, t) {
4850
- return ji(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4885
+ return Pi(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4851
4886
  }
4852
- }, Go = {
4887
+ }, Jo = {
4853
4888
  type: "flowchart",
4854
4889
  parse: (e, t) => ne(t),
4855
4890
  layoutForSvg(e, t) {
4856
4891
  return {
4857
- graph: An(C(e, t.direction), t),
4892
+ graph: Nn(C(e, t.direction), t),
4858
4893
  curve: t.curve ?? e.initConfig?.curve ?? "linear"
4859
4894
  };
4860
4895
  },
4861
4896
  renderSvg(e, t, n) {
4862
- return Vn(e.graph, t.colors, t.font, t.transparent, t.fontSizes, e.curve, t.embedSource, Ho(n), Vo(n), t.title, t.decorative, t.emit);
4897
+ return Wn(e.graph, t.colors, t.font, t.transparent, t.fontSizes, e.curve, t.embedSource, Go(n), Wo(n), t.title, t.decorative, t.emit);
4863
4898
  }
4864
- }, Ko = {
4899
+ }, Yo = {
4865
4900
  type: "c4",
4866
4901
  parse: N,
4867
4902
  layoutForSvg(e, t) {
4868
- return Oo(e, t);
4903
+ return jo(e, t);
4869
4904
  },
4870
4905
  renderSvg(e, t) {
4871
- return ko(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4872
- }
4873
- }, qo = {
4874
- xychart: zo,
4875
- er: Wo,
4876
- sequence: Bo,
4877
- class: Uo,
4878
- flowchart: Go,
4906
+ return Mo(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4907
+ }
4908
+ }, Xo = {
4909
+ xychart: Ho,
4910
+ er: qo,
4911
+ sequence: Uo,
4912
+ class: Ko,
4913
+ flowchart: Jo,
4879
4914
  architecture: {
4880
4915
  type: "architecture",
4881
4916
  parse: M,
4882
4917
  layoutForSvg(e, t) {
4883
4918
  return {
4884
- graph: On(C(D(e), t.direction), t),
4919
+ graph: jn(C(D(e), t.direction), t),
4885
4920
  curve: t.curve ?? "linear"
4886
4921
  };
4887
4922
  },
4888
- renderSvg: Go.renderSvg
4923
+ renderSvg: Jo.renderSvg
4889
4924
  },
4890
- c4: Ko,
4925
+ c4: Yo,
4891
4926
  pie: {
4892
4927
  type: "pie",
4893
4928
  parse: (e, t) => re(t),
4894
- layoutForSvg: Va,
4929
+ layoutForSvg: Wa,
4895
4930
  renderSvg(e, t) {
4896
- return Wa(e, t.colors, t.font, t.transparent, t.embedSource, t.title, t.decorative, t.emit);
4931
+ return qa(e, t.colors, t.font, t.transparent, t.embedSource, t.title, t.decorative, t.emit);
4897
4932
  }
4898
4933
  }
4899
4934
  };
4900
4935
  //#endregion
4901
4936
  //#region packages/svg-renderer/src/index.ts
4902
- function Jo(t) {
4937
+ function Zo(t) {
4903
4938
  return {
4904
4939
  bg: t.bg ?? e.bg,
4905
4940
  fg: t.fg ?? e.fg,
@@ -4910,23 +4945,23 @@ function Jo(t) {
4910
4945
  border: t.border
4911
4946
  };
4912
4947
  }
4913
- function Yo(e = {}) {
4914
- return S(Jo(e), e.transparent);
4948
+ function Qo(e = {}) {
4949
+ return S(Zo(e), e.transparent);
4915
4950
  }
4916
- function Xo(e) {
4951
+ function $o(e) {
4917
4952
  return {
4918
4953
  nonce: e.nonce,
4919
4954
  styleAttribute: e.styleAttribute
4920
4955
  };
4921
4956
  }
4922
- function Zo(e, t = {}) {
4923
- let n = Qo(e, t);
4924
- return t.resolveColors ? Qr(n, Jo(t)) : n;
4957
+ function es(e, t = {}) {
4958
+ let n = ts(e, t);
4959
+ return t.resolveColors ? ti(n, Zo(t)) : n;
4925
4960
  }
4926
- function Qo(e, t) {
4927
- let r = oe(e), i = Jo(t), a = t.font ?? "Inter";
4961
+ function ts(e, t) {
4962
+ let r = oe(e), i = Zo(t), a = t.font ?? "Inter";
4928
4963
  v(c(a));
4929
- let o = t.transparent ?? !1, s = Te(t.fontSizes), l = n(r), u = t.embedSource ? e : void 0, d = t.title, f = t.decorative, p = Xo(t), m = y(r), h = qo[l], g = h.parse(m, r), _ = h.layoutForSvg(g, t), b = {
4964
+ let o = t.transparent ?? !1, s = Te(t.fontSizes), l = n(r), u = t.embedSource ? e : void 0, d = t.title, f = t.decorative, p = $o(t), m = y(r), h = Xo[l], g = h.parse(m, r), _ = h.layoutForSvg(g, t), b = {
4930
4965
  colors: i,
4931
4966
  font: a,
4932
4967
  transparent: o,
@@ -4938,11 +4973,11 @@ function Qo(e, t) {
4938
4973
  };
4939
4974
  return h.renderSvg(_, b, t);
4940
4975
  }
4941
- async function $o(e, t = {}) {
4942
- return Zo(e, t);
4976
+ async function ns(e, t = {}) {
4977
+ return es(e, t);
4943
4978
  }
4944
- var es = Zo, ts = $o;
4979
+ var rs = es, is = ns;
4945
4980
  //#endregion
4946
- export { Hi as ACTOR_LABEL_OFFSET, Oe as ARROW_HEAD, U as CLS, je as ELK_DIRECTION_FALLBACK, I as FONT_SIZES, L as FONT_WEIGHTS, Ee as GROUP_HEADER_CONTENT_PAD, Ie as INLINE_CENTERED_EDGE_LABEL, Ce as MONO_FONT, we as MONO_FONT_STACK, De as NODE_PADDING, X as PIE, R as STROKE_WIDTHS, z as TEXT_BASELINE_SHIFT, Pe as baseElkLayoutOptions, Vi as boxLabelHeight, Re as buildElkEdge, Le as buildElkEdgeLabel, Fe as buildElkLeafNode, ke as buildSvgStyleBlock, $r as classNoteId, ot as clipEdgeToShape, jn as convertToElkFormat, ge as createLayoutCache, Me as directionToElk, ye as elkLayoutSync, Ne as elkPadding, Se as estimateMonoTextWidth, F as estimateTextWidth, Kr as evaluateCssColorValue, yt as extractEdgeLabelPosition, vt as extractEdgePoints, Ea as formatTickLabels, ai as layoutClassDiagramSync, Oi as layoutErDiagramSync, An as layoutFlowchartSync, On as layoutGraphSync, Va as layoutPieChart, Ki as layoutSequenceDiagram, ha as layoutXYChart, Ta as niceTickValues, Ha as pieColorValue, fe as pointsToPath, li as renderClassSvg, ji as renderErSvg, ts as renderMermaid, Zo as renderMermaidSVG, $o as renderMermaidSVGAsync, es as renderMermaidSync, Wa as renderPieSvg, qi as renderSequenceSvg, Vn as renderSvg, ka as renderXYChartSvg, Qr as resolveCssColors, Te as resolveFontSizes, Na as smoothCurvePath, Yo as themeCssVariables, Lr as withDataSrc, xa as xLabelStep };
4981
+ export { Gi as ACTOR_LABEL_OFFSET, Oe as ARROW_HEAD, U as CLS, je as ELK_DIRECTION_FALLBACK, I as FONT_SIZES, L as FONT_WEIGHTS, Ee as GROUP_HEADER_CONTENT_PAD, Ie as INLINE_CENTERED_EDGE_LABEL, Ce as MONO_FONT, we as MONO_FONT_STACK, De as NODE_PADDING, X as PIE, R as STROKE_WIDTHS, z as TEXT_BASELINE_SHIFT, Pe as baseElkLayoutOptions, Wi as boxLabelHeight, Re as buildElkEdge, Le as buildElkEdgeLabel, Fe as buildElkLeafNode, ke as buildSvgStyleBlock, ni as classNoteId, ot as clipEdgeToShape, Pn as convertToElkFormat, ge as createLayoutCache, Me as directionToElk, ye as elkLayoutSync, Ne as elkPadding, Se as estimateMonoTextWidth, F as estimateTextWidth, Yr as evaluateCssColorValue, St as extractEdgeLabelPosition, xt as extractEdgePoints, ka as formatTickLabels, ci as layoutClassDiagramSync, ji as layoutErDiagramSync, Nn as layoutFlowchartSync, jn as layoutGraphSync, Wa as layoutPieChart, Yi as layoutSequenceDiagram, va as layoutXYChart, Oa as niceTickValues, Ga as pieColorValue, fe as pointsToPath, fi as renderClassSvg, Pi as renderErSvg, is as renderMermaid, es as renderMermaidSVG, ns as renderMermaidSVGAsync, rs as renderMermaidSync, qa as renderPieSvg, Xi as renderSequenceSvg, Wn as renderSvg, Ma as renderXYChartSvg, ti as resolveCssColors, Te as resolveFontSizes, Ia as smoothCurvePath, Qo as themeCssVariables, Br as withDataSrc, wa as xLabelStep };
4947
4982
 
4948
4983
  //# sourceMappingURL=index.js.map