diff --git a/assets/lib/mermaid/arc-c0f908ab.js b/assets/lib/mermaid/arc-c0f908ab.js
new file mode 100644
index 00000000..024777db
--- /dev/null
+++ b/assets/lib/mermaid/arc-c0f908ab.js
@@ -0,0 +1,148 @@
+import { w as withPath, c as constant } from "./path-39bad7e2.js";
+import { aw as pi, ax as cos, ay as sin, az as halfPi, aA as epsilon, V as tau, aB as sqrt, aC as min, aD as abs, aE as atan2, aF as asin, aG as acos, aH as max } from "./mermaid-dcacb631.js";
+function arcInnerRadius(d) {
+ return d.innerRadius;
+}
+function arcOuterRadius(d) {
+ return d.outerRadius;
+}
+function arcStartAngle(d) {
+ return d.startAngle;
+}
+function arcEndAngle(d) {
+ return d.endAngle;
+}
+function arcPadAngle(d) {
+ return d && d.padAngle;
+}
+function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
+ var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10;
+ if (t * t < epsilon)
+ return;
+ t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
+ return [x0 + t * x10, y0 + t * y10];
+}
+function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
+ var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
+ if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1)
+ cx0 = cx1, cy0 = cy1;
+ return {
+ cx: cx0,
+ cy: cy0,
+ x01: -ox,
+ y01: -oy,
+ x11: cx0 * (r1 / r - 1),
+ y11: cy0 * (r1 / r - 1)
+ };
+}
+function d3arc() {
+ var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path = withPath(arc);
+ function arc() {
+ var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs(a1 - a0), cw = a1 > a0;
+ if (!context)
+ context = buffer = path();
+ if (r1 < r0)
+ r = r1, r1 = r0, r0 = r;
+ if (!(r1 > epsilon))
+ context.moveTo(0, 0);
+ else if (da > tau - epsilon) {
+ context.moveTo(r1 * cos(a0), r1 * sin(a0));
+ context.arc(0, 0, r1, a0, a1, !cw);
+ if (r0 > epsilon) {
+ context.moveTo(r0 * cos(a1), r0 * sin(a1));
+ context.arc(0, 0, r0, a1, a0, cw);
+ }
+ } else {
+ var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t0, t1;
+ if (rp > epsilon) {
+ var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
+ if ((da0 -= p0 * 2) > epsilon)
+ p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
+ else
+ da0 = 0, a00 = a10 = (a0 + a1) / 2;
+ if ((da1 -= p1 * 2) > epsilon)
+ p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
+ else
+ da1 = 0, a01 = a11 = (a0 + a1) / 2;
+ }
+ var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
+ if (rc > epsilon) {
+ var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
+ if (da < pi) {
+ if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
+ var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
+ rc0 = min(rc, (r0 - lc) / (kc - 1));
+ rc1 = min(rc, (r1 - lc) / (kc + 1));
+ } else {
+ rc0 = rc1 = 0;
+ }
+ }
+ }
+ if (!(da1 > epsilon))
+ context.moveTo(x01, y01);
+ else if (rc1 > epsilon) {
+ t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
+ t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
+ context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
+ if (rc1 < rc)
+ context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
+ else {
+ context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
+ context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
+ context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
+ }
+ } else
+ context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
+ if (!(r0 > epsilon) || !(da0 > epsilon))
+ context.lineTo(x10, y10);
+ else if (rc0 > epsilon) {
+ t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
+ t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
+ context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
+ if (rc0 < rc)
+ context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
+ else {
+ context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
+ context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
+ context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
+ }
+ } else
+ context.arc(0, 0, r0, a10, a00, cw);
+ }
+ context.closePath();
+ if (buffer)
+ return context = null, buffer + "" || null;
+ }
+ arc.centroid = function() {
+ var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
+ return [cos(a) * r, sin(a) * r];
+ };
+ arc.innerRadius = function(_) {
+ return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
+ };
+ arc.outerRadius = function(_) {
+ return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
+ };
+ arc.cornerRadius = function(_) {
+ return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
+ };
+ arc.padRadius = function(_) {
+ return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
+ };
+ arc.startAngle = function(_) {
+ return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
+ };
+ arc.endAngle = function(_) {
+ return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
+ };
+ arc.padAngle = function(_) {
+ return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
+ };
+ arc.context = function(_) {
+ return arguments.length ? (context = _ == null ? null : _, arc) : context;
+ };
+ return arc;
+}
+export {
+ d3arc as d
+};
diff --git a/assets/lib/mermaid/arc-d1f6357e.js b/assets/lib/mermaid/arc-d1f6357e.js
new file mode 100644
index 00000000..5589dbf4
--- /dev/null
+++ b/assets/lib/mermaid/arc-d1f6357e.js
@@ -0,0 +1,86 @@
+import { w as ln, c as H } from "./path-428ebac9.js";
+import { aw as an, ax as V, ay as D, az as rn, aA as y, V as on, aB as K, aC as _, aD as un, aE as t, aF as sn, aG as tn, aH as fn } from "./mermaid-9f2aa176.js";
+function cn(l) {
+ return l.innerRadius;
+}
+function yn(l) {
+ return l.outerRadius;
+}
+function gn(l) {
+ return l.startAngle;
+}
+function mn(l) {
+ return l.endAngle;
+}
+function pn(l) {
+ return l && l.padAngle;
+}
+function dn(l, h, z, E, v, A, I, a) {
+ var B = z - l, i = E - h, n = I - v, m = a - A, r = m * B - n * i;
+ if (!(r * r < y))
+ return r = (n * (h - A) - m * (l - v)) / r, [l + r * B, h + r * i];
+}
+function W(l, h, z, E, v, A, I) {
+ var a = l - z, B = h - E, i = (I ? A : -A) / K(a * a + B * B), n = i * B, m = -i * a, r = l + n, s = h + m, f = z + n, c = E + m, O = (r + f) / 2, o = (s + c) / 2, p = f - r, g = c - s, R = p * p + g * g, T = v - A, w = r * c - f * s, C = (g < 0 ? -1 : 1) * K(fn(0, T * T * R - w * w)), F = (w * g - p * C) / R, G = (-w * p - g * C) / R, P = (w * g + p * C) / R, d = (-w * p + g * C) / R, x = F - O, e = G - o, u = P - O, S = d - o;
+ return x * x + e * e > u * u + S * S && (F = P, G = d), {
+ cx: F,
+ cy: G,
+ x01: -n,
+ y01: -m,
+ x11: F * (v / T - 1),
+ y11: G * (v / T - 1)
+ };
+}
+function vn() {
+ var l = cn, h = yn, z = H(0), E = null, v = gn, A = mn, I = pn, a = null, B = ln(i);
+ function i() {
+ var n, m, r = +l.apply(this, arguments), s = +h.apply(this, arguments), f = v.apply(this, arguments) - rn, c = A.apply(this, arguments) - rn, O = un(c - f), o = c > f;
+ if (a || (a = n = B()), s < r && (m = s, s = r, r = m), !(s > y))
+ a.moveTo(0, 0);
+ else if (O > on - y)
+ a.moveTo(s * V(f), s * D(f)), a.arc(0, 0, s, f, c, !o), r > y && (a.moveTo(r * V(c), r * D(c)), a.arc(0, 0, r, c, f, o));
+ else {
+ var p = f, g = c, R = f, T = c, w = O, C = O, F = I.apply(this, arguments) / 2, G = F > y && (E ? +E.apply(this, arguments) : K(r * r + s * s)), P = _(un(s - r) / 2, +z.apply(this, arguments)), d = P, x = P, e, u;
+ if (G > y) {
+ var S = sn(G / r * D(F)), L = sn(G / s * D(F));
+ (w -= S * 2) > y ? (S *= o ? 1 : -1, R += S, T -= S) : (w = 0, R = T = (f + c) / 2), (C -= L * 2) > y ? (L *= o ? 1 : -1, p += L, g -= L) : (C = 0, p = g = (f + c) / 2);
+ }
+ var j = s * V(p), J = s * D(p), M = r * V(T), N = r * D(T);
+ if (P > y) {
+ var Q = s * V(g), U = s * D(g), X = r * V(R), Y = r * D(R), q;
+ if (O < an)
+ if (q = dn(j, J, X, Y, Q, U, M, N)) {
+ var Z = j - q[0], $ = J - q[1], k = Q - q[0], b = U - q[1], nn = 1 / D(tn((Z * k + $ * b) / (K(Z * Z + $ * $) * K(k * k + b * b))) / 2), en = K(q[0] * q[0] + q[1] * q[1]);
+ d = _(P, (r - en) / (nn - 1)), x = _(P, (s - en) / (nn + 1));
+ } else
+ d = x = 0;
+ }
+ C > y ? x > y ? (e = W(X, Y, j, J, s, x, o), u = W(Q, U, M, N, s, x, o), a.moveTo(e.cx + e.x01, e.cy + e.y01), x < P ? a.arc(e.cx, e.cy, x, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (a.arc(e.cx, e.cy, x, t(e.y01, e.x01), t(e.y11, e.x11), !o), a.arc(0, 0, s, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), !o), a.arc(u.cx, u.cy, x, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : (a.moveTo(j, J), a.arc(0, 0, s, p, g, !o)) : a.moveTo(j, J), !(r > y) || !(w > y) ? a.lineTo(M, N) : d > y ? (e = W(M, N, Q, U, r, -d, o), u = W(j, J, X, Y, r, -d, o), a.lineTo(e.cx + e.x01, e.cy + e.y01), d < P ? a.arc(e.cx, e.cy, d, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (a.arc(e.cx, e.cy, d, t(e.y01, e.x01), t(e.y11, e.x11), !o), a.arc(0, 0, r, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), o), a.arc(u.cx, u.cy, d, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : a.arc(0, 0, r, T, R, o);
+ }
+ if (a.closePath(), n)
+ return a = null, n + "" || null;
+ }
+ return i.centroid = function() {
+ var n = (+l.apply(this, arguments) + +h.apply(this, arguments)) / 2, m = (+v.apply(this, arguments) + +A.apply(this, arguments)) / 2 - an / 2;
+ return [V(m) * n, D(m) * n];
+ }, i.innerRadius = function(n) {
+ return arguments.length ? (l = typeof n == "function" ? n : H(+n), i) : l;
+ }, i.outerRadius = function(n) {
+ return arguments.length ? (h = typeof n == "function" ? n : H(+n), i) : h;
+ }, i.cornerRadius = function(n) {
+ return arguments.length ? (z = typeof n == "function" ? n : H(+n), i) : z;
+ }, i.padRadius = function(n) {
+ return arguments.length ? (E = n == null ? null : typeof n == "function" ? n : H(+n), i) : E;
+ }, i.startAngle = function(n) {
+ return arguments.length ? (v = typeof n == "function" ? n : H(+n), i) : v;
+ }, i.endAngle = function(n) {
+ return arguments.length ? (A = typeof n == "function" ? n : H(+n), i) : A;
+ }, i.padAngle = function(n) {
+ return arguments.length ? (I = typeof n == "function" ? n : H(+n), i) : I;
+ }, i.context = function(n) {
+ return arguments.length ? (a = n ?? null, i) : a;
+ }, i;
+}
+export {
+ vn as d
+};
diff --git a/assets/lib/mermaid/blockDiagram-5dc23a45.js b/assets/lib/mermaid/blockDiagram-5dc23a45.js
new file mode 100644
index 00000000..9b75fb3f
--- /dev/null
+++ b/assets/lib/mermaid/blockDiagram-5dc23a45.js
@@ -0,0 +1,1230 @@
+import { c as ge, _ as se, l as L, E as ye, f as _e, B as we, o as De, j as H, k as Ne } from "./mermaid-9f2aa176.js";
+import { c as Ie } from "./clone-afc2f047.js";
+import { c as Oe } from "./channel-ebbc4130.js";
+import { h as Te, f as ze, j as Ce, e as de, p as Ae, a as Re } from "./edges-16357fde.js";
+import { G as ve } from "./graph-0ee63739.js";
+import { o as Be } from "./ordinal-5695958c.js";
+import { d as ke } from "./Tableau10-558cc280.js";
+import "./createText-03b82060.js";
+import "./line-24d93f1b.js";
+import "./array-2ff2c7a6.js";
+import "./path-428ebac9.js";
+import "./init-f9637058.js";
+var ee = function() {
+ var e = function(D, l, s, r) {
+ for (s = s || {}, r = D.length; r--; s[D[r]] = l)
+ ;
+ return s;
+ }, c = [1, 7], u = [1, 13], a = [1, 14], i = [1, 15], g = [1, 19], o = [1, 16], p = [1, 17], f = [1, 18], m = [8, 30], S = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], y = [1, 23], z = [1, 24], I = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], w = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], C = [1, 49], E = {
+ trace: function() {
+ },
+ yy: {},
+ symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, block: 31, NODE_ID: 32, nodeShapeNLabel: 33, dirList: 34, DIR: 35, NODE_DSTART: 36, NODE_DEND: 37, BLOCK_ARROW_START: 38, BLOCK_ARROW_END: 39, classDef: 40, CLASSDEF_ID: 41, CLASSDEF_STYLEOPTS: 42, DEFAULT: 43, class: 44, CLASSENTITY_IDS: 45, STYLECLASS: 46, style: 47, STYLE_ENTITY_IDS: 48, STYLE_DEFINITION_DATA: 49, $accept: 0, $end: 1 },
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
+ performAction: function(l, s, r, h, d, t, x) {
+ var n = t.length - 1;
+ switch (d) {
+ case 4:
+ h.getLogger().debug("Rule: separator (NL) ");
+ break;
+ case 5:
+ h.getLogger().debug("Rule: separator (Space) ");
+ break;
+ case 6:
+ h.getLogger().debug("Rule: separator (EOF) ");
+ break;
+ case 7:
+ h.getLogger().debug("Rule: hierarchy: ", t[n - 1]), h.setHierarchy(t[n - 1]);
+ break;
+ case 8:
+ h.getLogger().debug("Stop NL ");
+ break;
+ case 9:
+ h.getLogger().debug("Stop EOF ");
+ break;
+ case 10:
+ h.getLogger().debug("Stop NL2 ");
+ break;
+ case 11:
+ h.getLogger().debug("Stop EOF2 ");
+ break;
+ case 12:
+ h.getLogger().debug("Rule: statement: ", t[n]), typeof t[n].length == "number" ? this.$ = t[n] : this.$ = [t[n]];
+ break;
+ case 13:
+ h.getLogger().debug("Rule: statement #2: ", t[n - 1]), this.$ = [t[n - 1]].concat(t[n]);
+ break;
+ case 14:
+ h.getLogger().debug("Rule: link: ", t[n], l), this.$ = { edgeTypeStr: t[n], label: "" };
+ break;
+ case 15:
+ h.getLogger().debug("Rule: LABEL link: ", t[n - 3], t[n - 1], t[n]), this.$ = { edgeTypeStr: t[n], label: t[n - 1] };
+ break;
+ case 18:
+ const B = parseInt(t[n]), Y = h.generateId();
+ this.$ = { id: Y, type: "space", label: "", width: B, children: [] };
+ break;
+ case 23:
+ h.getLogger().debug("Rule: (nodeStatement link node) ", t[n - 2], t[n - 1], t[n], " typestr: ", t[n - 1].edgeTypeStr);
+ const F = h.edgeStrToEdgeData(t[n - 1].edgeTypeStr);
+ this.$ = [
+ { id: t[n - 2].id, label: t[n - 2].label, type: t[n - 2].type, directions: t[n - 2].directions },
+ { id: t[n - 2].id + "-" + t[n].id, start: t[n - 2].id, end: t[n].id, label: t[n - 1].label, type: "edge", directions: t[n].directions, arrowTypeEnd: F, arrowTypeStart: "arrow_open" },
+ { id: t[n].id, label: t[n].label, type: h.typeStr2Type(t[n].typeStr), directions: t[n].directions }
+ ];
+ break;
+ case 24:
+ h.getLogger().debug("Rule: nodeStatement (abc88 node size) ", t[n - 1], t[n]), this.$ = { id: t[n - 1].id, label: t[n - 1].label, type: h.typeStr2Type(t[n - 1].typeStr), directions: t[n - 1].directions, widthInColumns: parseInt(t[n], 10) };
+ break;
+ case 25:
+ h.getLogger().debug("Rule: nodeStatement (node) ", t[n]), this.$ = { id: t[n].id, label: t[n].label, type: h.typeStr2Type(t[n].typeStr), directions: t[n].directions, widthInColumns: 1 };
+ break;
+ case 26:
+ h.getLogger().debug("APA123", this ? this : "na"), h.getLogger().debug("COLUMNS: ", t[n]), this.$ = { type: "column-setting", columns: t[n] === "auto" ? -1 : parseInt(t[n]) };
+ break;
+ case 27:
+ h.getLogger().debug("Rule: id-block statement : ", t[n - 2], t[n - 1]), h.generateId(), this.$ = { ...t[n - 2], type: "composite", children: t[n - 1] };
+ break;
+ case 28:
+ h.getLogger().debug("Rule: blockStatement : ", t[n - 2], t[n - 1], t[n]);
+ const R = h.generateId();
+ this.$ = { id: R, type: "composite", label: "", children: t[n - 1] };
+ break;
+ case 29:
+ h.getLogger().debug("Rule: node (NODE_ID separator): ", t[n]), this.$ = { id: t[n] };
+ break;
+ case 30:
+ h.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", t[n - 1], t[n]), this.$ = { id: t[n - 1], label: t[n].label, typeStr: t[n].typeStr, directions: t[n].directions };
+ break;
+ case 31:
+ h.getLogger().debug("Rule: dirList: ", t[n]), this.$ = [t[n]];
+ break;
+ case 32:
+ h.getLogger().debug("Rule: dirList: ", t[n - 1], t[n]), this.$ = [t[n - 1]].concat(t[n]);
+ break;
+ case 33:
+ h.getLogger().debug("Rule: nodeShapeNLabel: ", t[n - 2], t[n - 1], t[n]), this.$ = { typeStr: t[n - 2] + t[n], label: t[n - 1] };
+ break;
+ case 34:
+ h.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", t[n - 3], t[n - 2], " #3:", t[n - 1], t[n]), this.$ = { typeStr: t[n - 3] + t[n], label: t[n - 2], directions: t[n - 1] };
+ break;
+ case 35:
+ case 36:
+ this.$ = { type: "classDef", id: t[n - 1].trim(), css: t[n].trim() };
+ break;
+ case 37:
+ this.$ = { type: "applyClass", id: t[n - 1].trim(), styleClass: t[n].trim() };
+ break;
+ case 38:
+ this.$ = { type: "applyStyles", id: t[n - 1].trim(), stylesStr: t[n].trim() };
+ break;
+ }
+ },
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: c, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: u, 29: a, 31: i, 32: g, 40: o, 44: p, 47: f }, { 8: [1, 20] }, e(m, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: c, 28: u, 29: a, 31: i, 32: g, 40: o, 44: p, 47: f }), e(S, [2, 16], { 14: 22, 15: y, 16: z }), e(S, [2, 17]), e(S, [2, 18]), e(S, [2, 19]), e(S, [2, 20]), e(S, [2, 21]), e(S, [2, 22]), e(I, [2, 25], { 27: [1, 25] }), e(S, [2, 26]), { 19: 26, 26: 12, 32: g }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: c, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: u, 29: a, 31: i, 32: g, 40: o, 44: p, 47: f }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, e(w, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, e(m, [2, 13]), { 26: 35, 32: g }, { 32: [2, 14] }, { 17: [1, 36] }, e(I, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: y, 16: z, 19: 5, 20: 6, 21: c, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: u, 29: a, 31: i, 32: g, 40: o, 44: p, 47: f }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, e(w, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(I, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(S, [2, 28]), e(S, [2, 35]), e(S, [2, 36]), e(S, [2, 37]), e(S, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: C }, { 15: [1, 50] }, e(S, [2, 27]), e(w, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: C, 39: [2, 31] }, { 32: [2, 15] }, e(w, [2, 34]), { 39: [2, 32] }],
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
+ parseError: function(l, s) {
+ if (s.recoverable)
+ this.trace(l);
+ else {
+ var r = new Error(l);
+ throw r.hash = s, r;
+ }
+ },
+ parse: function(l) {
+ var s = this, r = [0], h = [], d = [null], t = [], x = this.table, n = "", B = 0, Y = 0, F = 2, R = 1, me = t.slice.call(arguments, 1), _ = Object.create(this.lexer), K = { yy: {} };
+ for (var Z in this.yy)
+ Object.prototype.hasOwnProperty.call(this.yy, Z) && (K.yy[Z] = this.yy[Z]);
+ _.setInput(l, K.yy), K.yy.lexer = _, K.yy.parser = this, typeof _.yylloc > "u" && (_.yylloc = {});
+ var J = _.yylloc;
+ t.push(J);
+ var be = _.options && _.options.ranges;
+ typeof K.yy.parseError == "function" ? this.parseError = K.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
+ function Ee() {
+ var P;
+ return P = h.pop() || _.lex() || R, typeof P != "number" && (P instanceof Array && (h = P, P = h.pop()), P = s.symbols_[P] || P), P;
+ }
+ for (var O, M, A, Q, W = {}, X, k, ae, G; ; ) {
+ if (M = r[r.length - 1], this.defaultActions[M] ? A = this.defaultActions[M] : ((O === null || typeof O > "u") && (O = Ee()), A = x[M] && x[M][O]), typeof A > "u" || !A.length || !A[0]) {
+ var $ = "";
+ G = [];
+ for (X in x[M])
+ this.terminals_[X] && X > F && G.push("'" + this.terminals_[X] + "'");
+ _.showPosition ? $ = "Parse error on line " + (B + 1) + `:
+` + _.showPosition() + `
+Expecting ` + G.join(", ") + ", got '" + (this.terminals_[O] || O) + "'" : $ = "Parse error on line " + (B + 1) + ": Unexpected " + (O == R ? "end of input" : "'" + (this.terminals_[O] || O) + "'"), this.parseError($, {
+ text: _.match,
+ token: this.terminals_[O] || O,
+ line: _.yylineno,
+ loc: J,
+ expected: G
+ });
+ }
+ if (A[0] instanceof Array && A.length > 1)
+ throw new Error("Parse Error: multiple actions possible at state: " + M + ", token: " + O);
+ switch (A[0]) {
+ case 1:
+ r.push(O), d.push(_.yytext), t.push(_.yylloc), r.push(A[1]), O = null, Y = _.yyleng, n = _.yytext, B = _.yylineno, J = _.yylloc;
+ break;
+ case 2:
+ if (k = this.productions_[A[1]][1], W.$ = d[d.length - k], W._$ = {
+ first_line: t[t.length - (k || 1)].first_line,
+ last_line: t[t.length - 1].last_line,
+ first_column: t[t.length - (k || 1)].first_column,
+ last_column: t[t.length - 1].last_column
+ }, be && (W._$.range = [
+ t[t.length - (k || 1)].range[0],
+ t[t.length - 1].range[1]
+ ]), Q = this.performAction.apply(W, [
+ n,
+ Y,
+ B,
+ K.yy,
+ A[1],
+ d,
+ t
+ ].concat(me)), typeof Q < "u")
+ return Q;
+ k && (r = r.slice(0, -1 * k * 2), d = d.slice(0, -1 * k), t = t.slice(0, -1 * k)), r.push(this.productions_[A[1]][0]), d.push(W.$), t.push(W._$), ae = x[r[r.length - 2]][r[r.length - 1]], r.push(ae);
+ break;
+ case 3:
+ return !0;
+ }
+ }
+ return !0;
+ }
+ }, v = function() {
+ var D = {
+ EOF: 1,
+ parseError: function(s, r) {
+ if (this.yy.parser)
+ this.yy.parser.parseError(s, r);
+ else
+ throw new Error(s);
+ },
+ // resets the lexer, sets new input
+ setInput: function(l, s) {
+ return this.yy = s || this.yy || {}, this._input = l, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
+ first_line: 1,
+ first_column: 0,
+ last_line: 1,
+ last_column: 0
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
+ },
+ // consumes and returns one char from the input
+ input: function() {
+ var l = this._input[0];
+ this.yytext += l, this.yyleng++, this.offset++, this.match += l, this.matched += l;
+ var s = l.match(/(?:\r\n?|\n).*/g);
+ return s ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), l;
+ },
+ // unshifts one char (or a string) into the input
+ unput: function(l) {
+ var s = l.length, r = l.split(/(?:\r\n?|\n)/g);
+ this._input = l + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - s), this.offset -= s;
+ var h = this.match.split(/(?:\r\n?|\n)/g);
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), r.length - 1 && (this.yylineno -= r.length - 1);
+ var d = this.yylloc.range;
+ return this.yylloc = {
+ first_line: this.yylloc.first_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.first_column,
+ last_column: r ? (r.length === h.length ? this.yylloc.first_column : 0) + h[h.length - r.length].length - r[0].length : this.yylloc.first_column - s
+ }, this.options.ranges && (this.yylloc.range = [d[0], d[0] + this.yyleng - s]), this.yyleng = this.yytext.length, this;
+ },
+ // When called from action, caches matched text and appends it on next action
+ more: function() {
+ return this._more = !0, this;
+ },
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
+ reject: function() {
+ if (this.options.backtrack_lexer)
+ this._backtrack = !0;
+ else
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
+` + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ return this;
+ },
+ // retain first n characters of the match
+ less: function(l) {
+ this.unput(this.match.slice(l));
+ },
+ // displays already matched input, i.e. for error messages
+ pastInput: function() {
+ var l = this.matched.substr(0, this.matched.length - this.match.length);
+ return (l.length > 20 ? "..." : "") + l.substr(-20).replace(/\n/g, "");
+ },
+ // displays upcoming input, i.e. for error messages
+ upcomingInput: function() {
+ var l = this.match;
+ return l.length < 20 && (l += this._input.substr(0, 20 - l.length)), (l.substr(0, 20) + (l.length > 20 ? "..." : "")).replace(/\n/g, "");
+ },
+ // displays the character position where the lexing error occurred, i.e. for error messages
+ showPosition: function() {
+ var l = this.pastInput(), s = new Array(l.length + 1).join("-");
+ return l + this.upcomingInput() + `
+` + s + "^";
+ },
+ // test the lexed token: return FALSE when not a match, otherwise return token
+ test_match: function(l, s) {
+ var r, h, d;
+ if (this.options.backtrack_lexer && (d = {
+ yylineno: this.yylineno,
+ yylloc: {
+ first_line: this.yylloc.first_line,
+ last_line: this.last_line,
+ first_column: this.yylloc.first_column,
+ last_column: this.yylloc.last_column
+ },
+ yytext: this.yytext,
+ match: this.match,
+ matches: this.matches,
+ matched: this.matched,
+ yyleng: this.yyleng,
+ offset: this.offset,
+ _more: this._more,
+ _input: this._input,
+ yy: this.yy,
+ conditionStack: this.conditionStack.slice(0),
+ done: this.done
+ }, this.options.ranges && (d.yylloc.range = this.yylloc.range.slice(0))), h = l[0].match(/(?:\r\n?|\n).*/g), h && (this.yylineno += h.length), this.yylloc = {
+ first_line: this.yylloc.last_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.last_column,
+ last_column: h ? h[h.length - 1].length - h[h.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + l[0].length
+ }, this.yytext += l[0], this.match += l[0], this.matches = l, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(l[0].length), this.matched += l[0], r = this.performAction.call(this, this.yy, this, s, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), r)
+ return r;
+ if (this._backtrack) {
+ for (var t in d)
+ this[t] = d[t];
+ return !1;
+ }
+ return !1;
+ },
+ // return next match in input
+ next: function() {
+ if (this.done)
+ return this.EOF;
+ this._input || (this.done = !0);
+ var l, s, r, h;
+ this._more || (this.yytext = "", this.match = "");
+ for (var d = this._currentRules(), t = 0; t < d.length; t++)
+ if (r = this._input.match(this.rules[d[t]]), r && (!s || r[0].length > s[0].length)) {
+ if (s = r, h = t, this.options.backtrack_lexer) {
+ if (l = this.test_match(r, d[t]), l !== !1)
+ return l;
+ if (this._backtrack) {
+ s = !1;
+ continue;
+ } else
+ return !1;
+ } else if (!this.options.flex)
+ break;
+ }
+ return s ? (l = this.test_match(s, d[h]), l !== !1 ? l : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
+` + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ },
+ // return next match that has a token
+ lex: function() {
+ var s = this.next();
+ return s || this.lex();
+ },
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
+ begin: function(s) {
+ this.conditionStack.push(s);
+ },
+ // pop the previously active lexer condition state off the condition stack
+ popState: function() {
+ var s = this.conditionStack.length - 1;
+ return s > 0 ? this.conditionStack.pop() : this.conditionStack[0];
+ },
+ // produce the lexer rule set which is active for the currently active lexer condition state
+ _currentRules: function() {
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
+ },
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
+ topState: function(s) {
+ return s = this.conditionStack.length - 1 - Math.abs(s || 0), s >= 0 ? this.conditionStack[s] : "INITIAL";
+ },
+ // alias for begin(condition)
+ pushState: function(s) {
+ this.begin(s);
+ },
+ // return the number of states currently on the stack
+ stateStackSize: function() {
+ return this.conditionStack.length;
+ },
+ options: {},
+ performAction: function(s, r, h, d) {
+ switch (h) {
+ case 0:
+ return 10;
+ case 1:
+ return s.getLogger().debug("Found space-block"), 31;
+ case 2:
+ return s.getLogger().debug("Found nl-block"), 31;
+ case 3:
+ return s.getLogger().debug("Found space-block"), 29;
+ case 4:
+ s.getLogger().debug(".", r.yytext);
+ break;
+ case 5:
+ s.getLogger().debug("_", r.yytext);
+ break;
+ case 6:
+ return 5;
+ case 7:
+ return r.yytext = -1, 28;
+ case 8:
+ return r.yytext = r.yytext.replace(/columns\s+/, ""), s.getLogger().debug("COLUMNS (LEX)", r.yytext), 28;
+ case 9:
+ this.pushState("md_string");
+ break;
+ case 10:
+ return "MD_STR";
+ case 11:
+ this.popState();
+ break;
+ case 12:
+ this.pushState("string");
+ break;
+ case 13:
+ s.getLogger().debug("LEX: POPPING STR:", r.yytext), this.popState();
+ break;
+ case 14:
+ return s.getLogger().debug("LEX: STR end:", r.yytext), "STR";
+ case 15:
+ return r.yytext = r.yytext.replace(/space\:/, ""), s.getLogger().debug("SPACE NUM (LEX)", r.yytext), 21;
+ case 16:
+ return r.yytext = "1", s.getLogger().debug("COLUMNS (LEX)", r.yytext), 21;
+ case 17:
+ return 43;
+ case 18:
+ return "LINKSTYLE";
+ case 19:
+ return "INTERPOLATE";
+ case 20:
+ return this.pushState("CLASSDEF"), 40;
+ case 21:
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
+ case 22:
+ return this.popState(), this.pushState("CLASSDEFID"), 41;
+ case 23:
+ return this.popState(), 42;
+ case 24:
+ return this.pushState("CLASS"), 44;
+ case 25:
+ return this.popState(), this.pushState("CLASS_STYLE"), 45;
+ case 26:
+ return this.popState(), 46;
+ case 27:
+ return this.pushState("STYLE_STMNT"), 47;
+ case 28:
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 48;
+ case 29:
+ return this.popState(), 49;
+ case 30:
+ return this.pushState("acc_title"), "acc_title";
+ case 31:
+ return this.popState(), "acc_title_value";
+ case 32:
+ return this.pushState("acc_descr"), "acc_descr";
+ case 33:
+ return this.popState(), "acc_descr_value";
+ case 34:
+ this.pushState("acc_descr_multiline");
+ break;
+ case 35:
+ this.popState();
+ break;
+ case 36:
+ return "acc_descr_multiline_value";
+ case 37:
+ return 30;
+ case 38:
+ return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
+ case 39:
+ return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
+ case 40:
+ return this.popState(), s.getLogger().debug("Lex: ))"), "NODE_DEND";
+ case 41:
+ return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
+ case 42:
+ return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
+ case 43:
+ return this.popState(), s.getLogger().debug("Lex: (-"), "NODE_DEND";
+ case 44:
+ return this.popState(), s.getLogger().debug("Lex: -)"), "NODE_DEND";
+ case 45:
+ return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
+ case 46:
+ return this.popState(), s.getLogger().debug("Lex: ]]"), "NODE_DEND";
+ case 47:
+ return this.popState(), s.getLogger().debug("Lex: ("), "NODE_DEND";
+ case 48:
+ return this.popState(), s.getLogger().debug("Lex: ])"), "NODE_DEND";
+ case 49:
+ return this.popState(), s.getLogger().debug("Lex: /]"), "NODE_DEND";
+ case 50:
+ return this.popState(), s.getLogger().debug("Lex: /]"), "NODE_DEND";
+ case 51:
+ return this.popState(), s.getLogger().debug("Lex: )]"), "NODE_DEND";
+ case 52:
+ return this.popState(), s.getLogger().debug("Lex: )"), "NODE_DEND";
+ case 53:
+ return this.popState(), s.getLogger().debug("Lex: ]>"), "NODE_DEND";
+ case 54:
+ return this.popState(), s.getLogger().debug("Lex: ]"), "NODE_DEND";
+ case 55:
+ return s.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 36;
+ case 56:
+ return s.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 36;
+ case 57:
+ return s.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 36;
+ case 58:
+ return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
+ case 59:
+ return s.getLogger().debug("Lex: ((("), this.pushState("NODE"), 36;
+ case 60:
+ return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
+ case 61:
+ return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
+ case 62:
+ return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
+ case 63:
+ return s.getLogger().debug("Lexc: >"), this.pushState("NODE"), 36;
+ case 64:
+ return s.getLogger().debug("Lexa: (["), this.pushState("NODE"), 36;
+ case 65:
+ return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
+ case 66:
+ return this.pushState("NODE"), 36;
+ case 67:
+ return this.pushState("NODE"), 36;
+ case 68:
+ return this.pushState("NODE"), 36;
+ case 69:
+ return this.pushState("NODE"), 36;
+ case 70:
+ return this.pushState("NODE"), 36;
+ case 71:
+ return this.pushState("NODE"), 36;
+ case 72:
+ return this.pushState("NODE"), 36;
+ case 73:
+ return s.getLogger().debug("Lexa: ["), this.pushState("NODE"), 36;
+ case 74:
+ return this.pushState("BLOCK_ARROW"), s.getLogger().debug("LEX ARR START"), 38;
+ case 75:
+ return s.getLogger().debug("Lex: NODE_ID", r.yytext), 32;
+ case 76:
+ return s.getLogger().debug("Lex: EOF", r.yytext), 8;
+ case 77:
+ this.pushState("md_string");
+ break;
+ case 78:
+ this.pushState("md_string");
+ break;
+ case 79:
+ return "NODE_DESCR";
+ case 80:
+ this.popState();
+ break;
+ case 81:
+ s.getLogger().debug("Lex: Starting string"), this.pushState("string");
+ break;
+ case 82:
+ s.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
+ break;
+ case 83:
+ return s.getLogger().debug("LEX: NODE_DESCR:", r.yytext), "NODE_DESCR";
+ case 84:
+ s.getLogger().debug("LEX POPPING"), this.popState();
+ break;
+ case 85:
+ s.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
+ break;
+ case 86:
+ return r.yytext = r.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (right): dir:", r.yytext), "DIR";
+ case 87:
+ return r.yytext = r.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (left):", r.yytext), "DIR";
+ case 88:
+ return r.yytext = r.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (x):", r.yytext), "DIR";
+ case 89:
+ return r.yytext = r.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (y):", r.yytext), "DIR";
+ case 90:
+ return r.yytext = r.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (up):", r.yytext), "DIR";
+ case 91:
+ return r.yytext = r.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (down):", r.yytext), "DIR";
+ case 92:
+ return r.yytext = "]>", s.getLogger().debug("Lex (ARROW_DIR end):", r.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
+ case 93:
+ return s.getLogger().debug("Lex: LINK", "#" + r.yytext + "#"), 15;
+ case 94:
+ return s.getLogger().debug("Lex: LINK", r.yytext), 15;
+ case 95:
+ return s.getLogger().debug("Lex: LINK", r.yytext), 15;
+ case 96:
+ return s.getLogger().debug("Lex: LINK", r.yytext), 15;
+ case 97:
+ return s.getLogger().debug("Lex: START_LINK", r.yytext), this.pushState("LLABEL"), 16;
+ case 98:
+ return s.getLogger().debug("Lex: START_LINK", r.yytext), this.pushState("LLABEL"), 16;
+ case 99:
+ return s.getLogger().debug("Lex: START_LINK", r.yytext), this.pushState("LLABEL"), 16;
+ case 100:
+ this.pushState("md_string");
+ break;
+ case 101:
+ return s.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
+ case 102:
+ return this.popState(), s.getLogger().debug("Lex: LINK", "#" + r.yytext + "#"), 15;
+ case 103:
+ return this.popState(), s.getLogger().debug("Lex: LINK", r.yytext), 15;
+ case 104:
+ return this.popState(), s.getLogger().debug("Lex: LINK", r.yytext), 15;
+ case 105:
+ return s.getLogger().debug("Lex: COLON", r.yytext), r.yytext = r.yytext.slice(1), 27;
+ }
+ },
+ rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
+ conditions: { STYLE_DEFINITION: { rules: [29], inclusive: !1 }, STYLE_STMNT: { rules: [28], inclusive: !1 }, CLASSDEFID: { rules: [23], inclusive: !1 }, CLASSDEF: { rules: [21, 22], inclusive: !1 }, CLASS_STYLE: { rules: [26], inclusive: !1 }, CLASS: { rules: [25], inclusive: !1 }, LLABEL: { rules: [100, 101, 102, 103, 104], inclusive: !1 }, ARROW_DIR: { rules: [86, 87, 88, 89, 90, 91, 92], inclusive: !1 }, BLOCK_ARROW: { rules: [77, 82, 85], inclusive: !1 }, NODE: { rules: [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], inclusive: !1 }, md_string: { rules: [10, 11, 79, 80], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [13, 14, 83, 84], inclusive: !1 }, acc_descr_multiline: { rules: [35, 36], inclusive: !1 }, acc_descr: { rules: [33], inclusive: !1 }, acc_title: { rules: [31], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], inclusive: !0 } }
+ };
+ return D;
+ }();
+ E.lexer = v;
+ function N() {
+ this.yy = {};
+ }
+ return N.prototype = E, E.Parser = N, new N();
+}();
+ee.parser = ee;
+const Pe = ee;
+let T = {}, ie = [], V = {};
+const oe = "color", ce = "fill", Fe = "bgFill", pe = ",", Ke = ge();
+let j = {};
+const Me = (e) => _e.sanitizeText(e, Ke), Ye = function(e, c = "") {
+ j[e] === void 0 && (j[e] = { id: e, styles: [], textStyles: [] });
+ const u = j[e];
+ c != null && c.split(pe).forEach((a) => {
+ const i = a.replace(/([^;]*);/, "$1").trim();
+ if (a.match(oe)) {
+ const o = i.replace(ce, Fe).replace(oe, ce);
+ u.textStyles.push(o);
+ }
+ u.styles.push(i);
+ });
+}, We = function(e, c = "") {
+ const u = T[e];
+ c != null && (u.styles = c.split(pe));
+}, Ve = function(e, c) {
+ e.split(",").forEach(function(u) {
+ let a = T[u];
+ if (a === void 0) {
+ const i = u.trim();
+ T[i] = { id: i, type: "na", children: [] }, a = T[i];
+ }
+ a.classes || (a.classes = []), a.classes.push(c);
+ });
+}, fe = (e, c) => {
+ const u = e.flat(), a = [];
+ for (const i of u) {
+ if (i.label && (i.label = Me(i.label)), i.type === "classDef") {
+ Ye(i.id, i.css);
+ continue;
+ }
+ if (i.type === "applyClass") {
+ Ve(i.id, (i == null ? void 0 : i.styleClass) || "");
+ continue;
+ }
+ if (i.type === "applyStyles") {
+ i != null && i.stylesStr && We(i.id, i == null ? void 0 : i.stylesStr);
+ continue;
+ }
+ if (i.type === "column-setting")
+ c.columns = i.columns || -1;
+ else if (i.type === "edge")
+ V[i.id] ? V[i.id]++ : V[i.id] = 1, i.id = V[i.id] + "-" + i.id, ie.push(i);
+ else {
+ i.label || (i.type === "composite" ? i.label = "" : i.label = i.id);
+ const g = !T[i.id];
+ if (g ? T[i.id] = i : (i.type !== "na" && (T[i.id].type = i.type), i.label !== i.id && (T[i.id].label = i.label)), i.children && fe(i.children, i), i.type === "space") {
+ const o = i.width || 1;
+ for (let p = 0; p < o; p++) {
+ const f = Ie(i);
+ f.id = f.id + "-" + p, T[f.id] = f, a.push(f);
+ }
+ } else
+ g && a.push(i);
+ }
+ }
+ c.children = a;
+};
+let re = [], U = { id: "root", type: "composite", children: [], columns: -1 };
+const je = () => {
+ L.debug("Clear called"), ye(), U = { id: "root", type: "composite", children: [], columns: -1 }, T = { root: U }, re = [], j = {}, ie = [], V = {};
+};
+function Ue(e) {
+ switch (L.debug("typeStr2Type", e), e) {
+ case "[]":
+ return "square";
+ case "()":
+ return L.debug("we have a round"), "round";
+ case "(())":
+ return "circle";
+ case ">]":
+ return "rect_left_inv_arrow";
+ case "{}":
+ return "diamond";
+ case "{{}}":
+ return "hexagon";
+ case "([])":
+ return "stadium";
+ case "[[]]":
+ return "subroutine";
+ case "[()]":
+ return "cylinder";
+ case "((()))":
+ return "doublecircle";
+ case "[//]":
+ return "lean_right";
+ case "[\\\\]":
+ return "lean_left";
+ case "[/\\]":
+ return "trapezoid";
+ case "[\\/]":
+ return "inv_trapezoid";
+ case "<[]>":
+ return "block_arrow";
+ default:
+ return "na";
+ }
+}
+function Xe(e) {
+ switch (L.debug("typeStr2Type", e), e) {
+ case "==":
+ return "thick";
+ default:
+ return "normal";
+ }
+}
+function Ge(e) {
+ switch (e.trim()) {
+ case "--x":
+ return "arrow_cross";
+ case "--o":
+ return "arrow_circle";
+ default:
+ return "arrow_point";
+ }
+}
+let le = 0;
+const He = () => (le++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + le), qe = (e) => {
+ U.children = e, fe(e, U), re = U.children;
+}, Ze = (e) => {
+ const c = T[e];
+ return c ? c.columns ? c.columns : c.children ? c.children.length : -1 : -1;
+}, Je = () => [...Object.values(T)], Qe = () => re || [], $e = () => ie, et = (e) => T[e], tt = (e) => {
+ T[e.id] = e;
+}, st = () => console, it = function() {
+ return j;
+}, rt = {
+ getConfig: () => se().block,
+ typeStr2Type: Ue,
+ edgeTypeStr2Type: Xe,
+ edgeStrToEdgeData: Ge,
+ getLogger: st,
+ getBlocksFlat: Je,
+ getBlocks: Qe,
+ getEdges: $e,
+ setHierarchy: qe,
+ getBlock: et,
+ setBlock: tt,
+ getColumns: Ze,
+ getClasses: it,
+ clear: je,
+ generateId: He
+}, nt = rt, q = (e, c) => {
+ const u = Oe, a = u(e, "r"), i = u(e, "g"), g = u(e, "b");
+ return we(a, i, g, c);
+}, at = (e) => `.label {
+ font-family: ${e.fontFamily};
+ color: ${e.nodeTextColor || e.textColor};
+ }
+ .cluster-label text {
+ fill: ${e.titleColor};
+ }
+ .cluster-label span,p {
+ color: ${e.titleColor};
+ }
+
+
+
+ .label text,span,p {
+ fill: ${e.nodeTextColor || e.textColor};
+ color: ${e.nodeTextColor || e.textColor};
+ }
+
+ .node rect,
+ .node circle,
+ .node ellipse,
+ .node polygon,
+ .node path {
+ fill: ${e.mainBkg};
+ stroke: ${e.nodeBorder};
+ stroke-width: 1px;
+ }
+ .flowchart-label text {
+ text-anchor: middle;
+ }
+ // .flowchart-label .text-outer-tspan {
+ // text-anchor: middle;
+ // }
+ // .flowchart-label .text-inner-tspan {
+ // text-anchor: start;
+ // }
+
+ .node .label {
+ text-align: center;
+ }
+ .node.clickable {
+ cursor: pointer;
+ }
+
+ .arrowheadPath {
+ fill: ${e.arrowheadColor};
+ }
+
+ .edgePath .path {
+ stroke: ${e.lineColor};
+ stroke-width: 2.0px;
+ }
+
+ .flowchart-link {
+ stroke: ${e.lineColor};
+ fill: none;
+ }
+
+ .edgeLabel {
+ background-color: ${e.edgeLabelBackground};
+ rect {
+ opacity: 0.5;
+ background-color: ${e.edgeLabelBackground};
+ fill: ${e.edgeLabelBackground};
+ }
+ text-align: center;
+ }
+
+ /* For html labels only */
+ .labelBkg {
+ background-color: ${q(e.edgeLabelBackground, 0.5)};
+ // background-color:
+ }
+
+ .node .cluster {
+ // fill: ${q(e.mainBkg, 0.5)};
+ fill: ${q(e.clusterBkg, 0.5)};
+ stroke: ${q(e.clusterBorder, 0.2)};
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
+ stroke-width: 1px;
+ }
+
+ .cluster text {
+ fill: ${e.titleColor};
+ }
+
+ .cluster span,p {
+ color: ${e.titleColor};
+ }
+ /* .cluster div {
+ color: ${e.titleColor};
+ } */
+
+ div.mermaidTooltip {
+ position: absolute;
+ text-align: center;
+ max-width: 200px;
+ padding: 2px;
+ font-family: ${e.fontFamily};
+ font-size: 12px;
+ background: ${e.tertiaryColor};
+ border: 1px solid ${e.border2};
+ border-radius: 2px;
+ pointer-events: none;
+ z-index: 100;
+ }
+
+ .flowchartTitleText {
+ text-anchor: middle;
+ font-size: 18px;
+ fill: ${e.textColor};
+ }
+`, ot = at;
+function Se(e, c, u = !1) {
+ var z, I, w;
+ const a = e;
+ let i = "default";
+ (((z = a == null ? void 0 : a.classes) == null ? void 0 : z.length) || 0) > 0 && (i = ((a == null ? void 0 : a.classes) || []).join(" ")), i = i + " flowchart-label";
+ let g = 0, o = "", p;
+ switch (a.type) {
+ case "round":
+ g = 5, o = "rect";
+ break;
+ case "composite":
+ g = 0, o = "composite", p = 0;
+ break;
+ case "square":
+ o = "rect";
+ break;
+ case "diamond":
+ o = "question";
+ break;
+ case "hexagon":
+ o = "hexagon";
+ break;
+ case "block_arrow":
+ o = "block_arrow";
+ break;
+ case "odd":
+ o = "rect_left_inv_arrow";
+ break;
+ case "lean_right":
+ o = "lean_right";
+ break;
+ case "lean_left":
+ o = "lean_left";
+ break;
+ case "trapezoid":
+ o = "trapezoid";
+ break;
+ case "inv_trapezoid":
+ o = "inv_trapezoid";
+ break;
+ case "rect_left_inv_arrow":
+ o = "rect_left_inv_arrow";
+ break;
+ case "circle":
+ o = "circle";
+ break;
+ case "ellipse":
+ o = "ellipse";
+ break;
+ case "stadium":
+ o = "stadium";
+ break;
+ case "subroutine":
+ o = "subroutine";
+ break;
+ case "cylinder":
+ o = "cylinder";
+ break;
+ case "group":
+ o = "rect";
+ break;
+ case "doublecircle":
+ o = "doublecircle";
+ break;
+ default:
+ o = "rect";
+ }
+ const f = De((a == null ? void 0 : a.styles) || []), m = a.label, S = a.size || { width: 0, height: 0, x: 0, y: 0 };
+ return {
+ labelStyle: f.labelStyle,
+ shape: o,
+ labelText: m,
+ rx: g,
+ ry: g,
+ class: i,
+ style: f.style,
+ id: a.id,
+ directions: a.directions,
+ width: S.width,
+ height: S.height,
+ x: S.x,
+ y: S.y,
+ positioned: u,
+ intersect: void 0,
+ type: a.type,
+ padding: p ?? (((w = (I = se()) == null ? void 0 : I.block) == null ? void 0 : w.padding) || 0)
+ };
+}
+async function ct(e, c, u) {
+ const a = Se(c, u, !1);
+ if (a.type === "group")
+ return;
+ const i = await de(e, a), g = i.node().getBBox(), o = u.getBlock(a.id);
+ o.size = { width: g.width, height: g.height, x: 0, y: 0, node: i }, u.setBlock(o), i.remove();
+}
+async function lt(e, c, u) {
+ const a = Se(c, u, !0);
+ u.getBlock(a.id).type !== "space" && (await de(e, a), c.intersect = a == null ? void 0 : a.intersect, Ae(a));
+}
+async function ne(e, c, u, a) {
+ for (const i of c)
+ await a(e, i, u), i.children && await ne(e, i.children, u, a);
+}
+async function ht(e, c, u) {
+ await ne(e, c, u, ct);
+}
+async function ut(e, c, u) {
+ await ne(e, c, u, lt);
+}
+async function gt(e, c, u, a, i) {
+ const g = new ve({
+ multigraph: !0,
+ compound: !0
+ });
+ g.setGraph({
+ rankdir: "TB",
+ nodesep: 10,
+ ranksep: 10,
+ marginx: 8,
+ marginy: 8
+ });
+ for (const o of u)
+ o.size && g.setNode(o.id, {
+ width: o.size.width,
+ height: o.size.height,
+ intersect: o.intersect
+ });
+ for (const o of c)
+ if (o.start && o.end) {
+ const p = a.getBlock(o.start), f = a.getBlock(o.end);
+ if (p != null && p.size && (f != null && f.size)) {
+ const m = p.size, S = f.size, y = [
+ { x: m.x, y: m.y },
+ { x: m.x + (S.x - m.x) / 2, y: m.y + (S.y - m.y) / 2 },
+ { x: S.x, y: S.y }
+ ];
+ await Te(
+ e,
+ { v: o.start, w: o.end, name: o.id },
+ {
+ ...o,
+ arrowTypeEnd: o.arrowTypeEnd,
+ arrowTypeStart: o.arrowTypeStart,
+ points: y,
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
+ },
+ void 0,
+ "block",
+ g,
+ i
+ ), o.label && (await ze(e, {
+ ...o,
+ label: o.label,
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
+ arrowTypeEnd: o.arrowTypeEnd,
+ arrowTypeStart: o.arrowTypeStart,
+ points: y,
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
+ }), await Ce(
+ { ...o, x: y[1].x, y: y[1].y },
+ {
+ originalPath: y
+ }
+ ));
+ }
+ }
+}
+var he, ue;
+const b = ((ue = (he = ge()) == null ? void 0 : he.block) == null ? void 0 : ue.padding) || 8;
+function dt(e, c) {
+ if (e === 0 || !Number.isInteger(e))
+ throw new Error("Columns must be an integer !== 0.");
+ if (c < 0 || !Number.isInteger(c))
+ throw new Error("Position must be a non-negative integer." + c);
+ if (e < 0)
+ return { px: c, py: 0 };
+ if (e === 1)
+ return { px: 0, py: c };
+ const u = c % e, a = Math.floor(c / e);
+ return { px: u, py: a };
+}
+const pt = (e) => {
+ let c = 0, u = 0;
+ for (const a of e.children) {
+ const { width: i, height: g, x: o, y: p } = a.size || { width: 0, height: 0, x: 0, y: 0 };
+ L.debug(
+ "getMaxChildSize abc95 child:",
+ a.id,
+ "width:",
+ i,
+ "height:",
+ g,
+ "x:",
+ o,
+ "y:",
+ p,
+ a.type
+ ), a.type !== "space" && (i > c && (c = i / (e.widthInColumns || 1)), g > u && (u = g));
+ }
+ return { width: c, height: u };
+};
+function te(e, c, u = 0, a = 0) {
+ var o, p, f, m, S, y, z, I, w, C, E;
+ L.debug(
+ "setBlockSizes abc95 (start)",
+ e.id,
+ (o = e == null ? void 0 : e.size) == null ? void 0 : o.x,
+ "block width =",
+ e == null ? void 0 : e.size,
+ "sieblingWidth",
+ u
+ ), (p = e == null ? void 0 : e.size) != null && p.width || (e.size = {
+ width: u,
+ height: a,
+ x: 0,
+ y: 0
+ });
+ let i = 0, g = 0;
+ if (((f = e.children) == null ? void 0 : f.length) > 0) {
+ for (const d of e.children)
+ te(d, c);
+ const v = pt(e);
+ i = v.width, g = v.height, L.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", i, g);
+ for (const d of e.children)
+ d.size && (L.debug(
+ `abc95 Setting size of children of ${e.id} id=${d.id} ${i} ${g} ${d.size}`
+ ), d.size.width = i * (d.widthInColumns || 1) + b * ((d.widthInColumns || 1) - 1), d.size.height = g, d.size.x = 0, d.size.y = 0, L.debug(
+ `abc95 updating size of ${e.id} children child:${d.id} maxWidth:${i} maxHeight:${g}`
+ ));
+ for (const d of e.children)
+ te(d, c, i, g);
+ const N = e.columns || -1;
+ let D = 0;
+ for (const d of e.children)
+ D += d.widthInColumns || 1;
+ let l = e.children.length;
+ N > 0 && N < D && (l = N), e.widthInColumns;
+ const s = Math.ceil(D / l);
+ let r = l * (i + b) + b, h = s * (g + b) + b;
+ if (r < u) {
+ L.debug(
+ `Detected to small siebling: abc95 ${e.id} sieblingWidth ${u} sieblingHeight ${a} width ${r}`
+ ), r = u, h = a;
+ const d = (u - l * b - b) / l, t = (a - s * b - b) / s;
+ L.debug("Size indata abc88", e.id, "childWidth", d, "maxWidth", i), L.debug("Size indata abc88", e.id, "childHeight", t, "maxHeight", g), L.debug("Size indata abc88 xSize", l, "padding", b);
+ for (const x of e.children)
+ x.size && (x.size.width = d, x.size.height = t, x.size.x = 0, x.size.y = 0);
+ }
+ if (L.debug(
+ `abc95 (finale calc) ${e.id} xSize ${l} ySize ${s} columns ${N}${e.children.length} width=${Math.max(r, ((m = e.size) == null ? void 0 : m.width) || 0)}`
+ ), r < (((S = e == null ? void 0 : e.size) == null ? void 0 : S.width) || 0)) {
+ r = ((y = e == null ? void 0 : e.size) == null ? void 0 : y.width) || 0;
+ const d = N > 0 ? Math.min(e.children.length, N) : e.children.length;
+ if (d > 0) {
+ const t = (r - d * b - b) / d;
+ L.debug("abc95 (growing to fit) width", e.id, r, (z = e.size) == null ? void 0 : z.width, t);
+ for (const x of e.children)
+ x.size && (x.size.width = t);
+ }
+ }
+ e.size = {
+ width: r,
+ height: h,
+ x: 0,
+ y: 0
+ };
+ }
+ L.debug(
+ "setBlockSizes abc94 (done)",
+ e.id,
+ (I = e == null ? void 0 : e.size) == null ? void 0 : I.x,
+ (w = e == null ? void 0 : e.size) == null ? void 0 : w.width,
+ (C = e == null ? void 0 : e.size) == null ? void 0 : C.y,
+ (E = e == null ? void 0 : e.size) == null ? void 0 : E.height
+ );
+}
+function Le(e, c) {
+ var a, i, g, o, p, f, m, S, y, z, I, w, C, E, v, N, D;
+ L.debug(
+ `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(a = e == null ? void 0 : e.size) == null ? void 0 : a.x} y: ${(i = e == null ? void 0 : e.size) == null ? void 0 : i.y} width: ${(g = e == null ? void 0 : e.size) == null ? void 0 : g.width}`
+ );
+ const u = e.columns || -1;
+ if (L.debug("layoutBlocks columns abc95", e.id, "=>", u, e), e.children && // find max width of children
+ e.children.length > 0) {
+ const l = ((p = (o = e == null ? void 0 : e.children[0]) == null ? void 0 : o.size) == null ? void 0 : p.width) || 0, s = e.children.length * l + (e.children.length - 1) * b;
+ L.debug("widthOfChildren 88", s, "posX");
+ let r = 0;
+ L.debug("abc91 block?.size?.x", e.id, (f = e == null ? void 0 : e.size) == null ? void 0 : f.x);
+ let h = (m = e == null ? void 0 : e.size) != null && m.x ? ((S = e == null ? void 0 : e.size) == null ? void 0 : S.x) + (-((y = e == null ? void 0 : e.size) == null ? void 0 : y.width) / 2 || 0) : -b, d = 0;
+ for (const t of e.children) {
+ const x = e;
+ if (!t.size)
+ continue;
+ const { width: n, height: B } = t.size, { px: Y, py: F } = dt(u, r);
+ if (F != d && (d = F, h = (z = e == null ? void 0 : e.size) != null && z.x ? ((I = e == null ? void 0 : e.size) == null ? void 0 : I.x) + (-((w = e == null ? void 0 : e.size) == null ? void 0 : w.width) / 2 || 0) : -b, L.debug("New row in layout for block", e.id, " and child ", t.id, d)), L.debug(
+ `abc89 layout blocks (child) id: ${t.id} Pos: ${r} (px, py) ${Y},${F} (${(C = x == null ? void 0 : x.size) == null ? void 0 : C.x},${(E = x == null ? void 0 : x.size) == null ? void 0 : E.y}) parent: ${x.id} width: ${n}${b}`
+ ), x.size) {
+ const R = n / 2;
+ t.size.x = h + b + R, L.debug(
+ `abc91 layout blocks (calc) px, pyid:${t.id} startingPos=X${h} new startingPosX${t.size.x} ${R} padding=${b} width=${n} halfWidth=${R} => x:${t.size.x} y:${t.size.y} ${t.widthInColumns} (width * (child?.w || 1)) / 2 ${n * ((t == null ? void 0 : t.widthInColumns) || 1) / 2}`
+ ), h = t.size.x + R, t.size.y = x.size.y - x.size.height / 2 + F * (B + b) + B / 2 + b, L.debug(
+ `abc88 layout blocks (calc) px, pyid:${t.id}startingPosX${h}${b}${R}=>x:${t.size.x}y:${t.size.y}${t.widthInColumns}(width * (child?.w || 1)) / 2${n * ((t == null ? void 0 : t.widthInColumns) || 1) / 2}`
+ );
+ }
+ t.children && Le(t), r += (t == null ? void 0 : t.widthInColumns) || 1, L.debug("abc88 columnsPos", t, r);
+ }
+ }
+ L.debug(
+ `layout blocks (<==layoutBlocks) ${e.id} x: ${(v = e == null ? void 0 : e.size) == null ? void 0 : v.x} y: ${(N = e == null ? void 0 : e.size) == null ? void 0 : N.y} width: ${(D = e == null ? void 0 : e.size) == null ? void 0 : D.width}`
+ );
+}
+function xe(e, { minX: c, minY: u, maxX: a, maxY: i } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
+ if (e.size && e.id !== "root") {
+ const { x: g, y: o, width: p, height: f } = e.size;
+ g - p / 2 < c && (c = g - p / 2), o - f / 2 < u && (u = o - f / 2), g + p / 2 > a && (a = g + p / 2), o + f / 2 > i && (i = o + f / 2);
+ }
+ if (e.children)
+ for (const g of e.children)
+ ({ minX: c, minY: u, maxX: a, maxY: i } = xe(g, { minX: c, minY: u, maxX: a, maxY: i }));
+ return { minX: c, minY: u, maxX: a, maxY: i };
+}
+function ft(e) {
+ const c = e.getBlock("root");
+ if (!c)
+ return;
+ te(c, e, 0, 0), Le(c), L.debug("getBlocks", JSON.stringify(c, null, 2));
+ const { minX: u, minY: a, maxX: i, maxY: g } = xe(c), o = g - a, p = i - u;
+ return { x: u, y: a, width: p, height: o };
+}
+const St = function(e, c) {
+ return c.db.getClasses();
+}, Lt = async function(e, c, u, a) {
+ const { securityLevel: i, block: g } = se(), o = a.db;
+ let p;
+ i === "sandbox" && (p = H("#i" + c));
+ const f = i === "sandbox" ? H(p.nodes()[0].contentDocument.body) : H("body"), m = i === "sandbox" ? f.select(`[id="${c}"]`) : H(`[id="${c}"]`);
+ Re(m, ["point", "circle", "cross"], a.type, c);
+ const y = o.getBlocks(), z = o.getBlocksFlat(), I = o.getEdges(), w = m.insert("g").attr("class", "block");
+ await ht(w, y, o);
+ const C = ft(o);
+ if (await ut(w, y, o), await gt(w, I, z, o, c), C) {
+ const E = C, v = Math.max(1, Math.round(0.125 * (E.width / E.height))), N = E.height + v + 10, D = E.width + 10, { useMaxWidth: l } = g;
+ Ne(m, N, D, !!l), L.debug("Here Bounds", C, E), m.attr(
+ "viewBox",
+ `${E.x - 5} ${E.y - 5} ${E.width + 10} ${E.height + 10}`
+ );
+ }
+ Be(ke);
+}, xt = {
+ draw: Lt,
+ getClasses: St
+}, Ct = {
+ parser: Pe,
+ db: nt,
+ renderer: xt,
+ styles: ot
+};
+export {
+ Ct as diagram
+};
diff --git a/assets/lib/mermaid/blockDiagram-9f4a6865.js b/assets/lib/mermaid/blockDiagram-9f4a6865.js
new file mode 100644
index 00000000..beb40834
--- /dev/null
+++ b/assets/lib/mermaid/blockDiagram-9f4a6865.js
@@ -0,0 +1,1822 @@
+var _a, _b;
+import { c as getConfig, F as getConfig$1, l as log, v as clear$1, e as common, k as getStylesFromArray, i as configureSvgSize } from "./mermaid-6dc72991.js";
+import clone from "lodash-es/clone.js";
+import * as khroma from "khroma";
+import { h as insertEdge, f as insertEdgeLabel, j as positionEdgeLabel, e as insertNode, p as positionNode, a as insertMarkers } from "./edges-066a5561.js";
+import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
+import { select, scaleOrdinal, schemeTableau10 } from "d3";
+import "ts-dedent";
+import "dayjs";
+import "@braintree/sanitize-url";
+import "dompurify";
+import "lodash-es/memoize.js";
+import "lodash-es/merge.js";
+import "stylis";
+import "lodash-es/isEmpty.js";
+import "./createText-ca0c5216.js";
+import "mdast-util-from-markdown";
+var parser = function() {
+ var o = function(k, v, o2, l) {
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
+ ;
+ return o2;
+ }, $V0 = [1, 7], $V1 = [1, 13], $V2 = [1, 14], $V3 = [1, 15], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Va = [1, 23], $Vb = [1, 24], $Vc = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Vd = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], $Ve = [1, 49];
+ var parser2 = {
+ trace: function trace() {
+ },
+ yy: {},
+ symbols_: { "error": 2, "spaceLines": 3, "SPACELINE": 4, "NL": 5, "separator": 6, "SPACE": 7, "EOF": 8, "start": 9, "BLOCK_DIAGRAM_KEY": 10, "document": 11, "stop": 12, "statement": 13, "link": 14, "LINK": 15, "START_LINK": 16, "LINK_LABEL": 17, "STR": 18, "nodeStatement": 19, "columnsStatement": 20, "SPACE_BLOCK": 21, "blockStatement": 22, "classDefStatement": 23, "cssClassStatement": 24, "styleStatement": 25, "node": 26, "SIZE": 27, "COLUMNS": 28, "id-block": 29, "end": 30, "block": 31, "NODE_ID": 32, "nodeShapeNLabel": 33, "dirList": 34, "DIR": 35, "NODE_DSTART": 36, "NODE_DEND": 37, "BLOCK_ARROW_START": 38, "BLOCK_ARROW_END": 39, "classDef": 40, "CLASSDEF_ID": 41, "CLASSDEF_STYLEOPTS": 42, "DEFAULT": 43, "class": 44, "CLASSENTITY_IDS": 45, "STYLECLASS": 46, "style": 47, "STYLE_ENTITY_IDS": 48, "STYLE_DEFINITION_DATA": 49, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
+ var $0 = $$.length - 1;
+ switch (yystate) {
+ case 4:
+ yy.getLogger().debug("Rule: separator (NL) ");
+ break;
+ case 5:
+ yy.getLogger().debug("Rule: separator (Space) ");
+ break;
+ case 6:
+ yy.getLogger().debug("Rule: separator (EOF) ");
+ break;
+ case 7:
+ yy.getLogger().debug("Rule: hierarchy: ", $$[$0 - 1]);
+ yy.setHierarchy($$[$0 - 1]);
+ break;
+ case 8:
+ yy.getLogger().debug("Stop NL ");
+ break;
+ case 9:
+ yy.getLogger().debug("Stop EOF ");
+ break;
+ case 10:
+ yy.getLogger().debug("Stop NL2 ");
+ break;
+ case 11:
+ yy.getLogger().debug("Stop EOF2 ");
+ break;
+ case 12:
+ yy.getLogger().debug("Rule: statement: ", $$[$0]);
+ typeof $$[$0].length === "number" ? this.$ = $$[$0] : this.$ = [$$[$0]];
+ break;
+ case 13:
+ yy.getLogger().debug("Rule: statement #2: ", $$[$0 - 1]);
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
+ break;
+ case 14:
+ yy.getLogger().debug("Rule: link: ", $$[$0], yytext);
+ this.$ = { edgeTypeStr: $$[$0], label: "" };
+ break;
+ case 15:
+ yy.getLogger().debug("Rule: LABEL link: ", $$[$0 - 3], $$[$0 - 1], $$[$0]);
+ this.$ = { edgeTypeStr: $$[$0], label: $$[$0 - 1] };
+ break;
+ case 18:
+ const num = parseInt($$[$0]);
+ const spaceId = yy.generateId();
+ this.$ = { id: spaceId, type: "space", label: "", width: num, children: [] };
+ break;
+ case 23:
+ yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr);
+ const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr);
+ this.$ = [
+ { id: $$[$0 - 2].id, label: $$[$0 - 2].label, type: $$[$0 - 2].type, directions: $$[$0 - 2].directions },
+ { id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData, arrowTypeStart: "arrow_open" },
+ { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions }
+ ];
+ break;
+ case 24:
+ yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ", $$[$0 - 1], $$[$0]);
+ this.$ = { id: $$[$0 - 1].id, label: $$[$0 - 1].label, type: yy.typeStr2Type($$[$0 - 1].typeStr), directions: $$[$0 - 1].directions, widthInColumns: parseInt($$[$0], 10) };
+ break;
+ case 25:
+ yy.getLogger().debug("Rule: nodeStatement (node) ", $$[$0]);
+ this.$ = { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions, widthInColumns: 1 };
+ break;
+ case 26:
+ yy.getLogger().debug("APA123", this ? this : "na");
+ yy.getLogger().debug("COLUMNS: ", $$[$0]);
+ this.$ = { type: "column-setting", columns: $$[$0] === "auto" ? -1 : parseInt($$[$0]) };
+ break;
+ case 27:
+ yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]);
+ yy.generateId();
+ this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] };
+ break;
+ case 28:
+ yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
+ const id = yy.generateId();
+ this.$ = { id, type: "composite", label: "", children: $$[$0 - 1] };
+ break;
+ case 29:
+ yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]);
+ this.$ = { id: $$[$0] };
+ break;
+ case 30:
+ yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", $$[$0 - 1], $$[$0]);
+ this.$ = { id: $$[$0 - 1], label: $$[$0].label, typeStr: $$[$0].typeStr, directions: $$[$0].directions };
+ break;
+ case 31:
+ yy.getLogger().debug("Rule: dirList: ", $$[$0]);
+ this.$ = [$$[$0]];
+ break;
+ case 32:
+ yy.getLogger().debug("Rule: dirList: ", $$[$0 - 1], $$[$0]);
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
+ break;
+ case 33:
+ yy.getLogger().debug("Rule: nodeShapeNLabel: ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
+ this.$ = { typeStr: $$[$0 - 2] + $$[$0], label: $$[$0 - 1] };
+ break;
+ case 34:
+ yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", $$[$0 - 3], $$[$0 - 2], " #3:", $$[$0 - 1], $$[$0]);
+ this.$ = { typeStr: $$[$0 - 3] + $$[$0], label: $$[$0 - 2], directions: $$[$0 - 1] };
+ break;
+ case 35:
+ case 36:
+ this.$ = { type: "classDef", id: $$[$0 - 1].trim(), css: $$[$0].trim() };
+ break;
+ case 37:
+ this.$ = { type: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
+ break;
+ case 38:
+ this.$ = { type: "applyStyles", id: $$[$0 - 1].trim(), stylesStr: $$[$0].trim() };
+ break;
+ }
+ },
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 8: [1, 20] }, o($V8, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: $V0, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }), o($V9, [2, 16], { 14: 22, 15: $Va, 16: $Vb }), o($V9, [2, 17]), o($V9, [2, 18]), o($V9, [2, 19]), o($V9, [2, 20]), o($V9, [2, 21]), o($V9, [2, 22]), o($Vc, [2, 25], { 27: [1, 25] }), o($V9, [2, 26]), { 19: 26, 26: 12, 32: $V4 }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, o($Vd, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, o($V8, [2, 13]), { 26: 35, 32: $V4 }, { 32: [2, 14] }, { 17: [1, 36] }, o($Vc, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: $Va, 16: $Vb, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, o($Vd, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, o($Vc, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, o($V9, [2, 28]), o($V9, [2, 35]), o($V9, [2, 36]), o($V9, [2, 37]), o($V9, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: $Ve }, { 15: [1, 50] }, o($V9, [2, 27]), o($Vd, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: $Ve, 39: [2, 31] }, { 32: [2, 15] }, o($Vd, [2, 34]), { 39: [2, 32] }],
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
+ parseError: function parseError(str, hash) {
+ if (hash.recoverable) {
+ this.trace(str);
+ } else {
+ var error = new Error(str);
+ error.hash = hash;
+ throw error;
+ }
+ },
+ parse: function parse(input) {
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
+ var args = lstack.slice.call(arguments, 1);
+ var lexer2 = Object.create(this.lexer);
+ var sharedState = { yy: {} };
+ for (var k in this.yy) {
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
+ sharedState.yy[k] = this.yy[k];
+ }
+ }
+ lexer2.setInput(input, sharedState.yy);
+ sharedState.yy.lexer = lexer2;
+ sharedState.yy.parser = this;
+ if (typeof lexer2.yylloc == "undefined") {
+ lexer2.yylloc = {};
+ }
+ var yyloc = lexer2.yylloc;
+ lstack.push(yyloc);
+ var ranges = lexer2.options && lexer2.options.ranges;
+ if (typeof sharedState.yy.parseError === "function") {
+ this.parseError = sharedState.yy.parseError;
+ } else {
+ this.parseError = Object.getPrototypeOf(this).parseError;
+ }
+ function lex() {
+ var token;
+ token = tstack.pop() || lexer2.lex() || EOF;
+ if (typeof token !== "number") {
+ if (token instanceof Array) {
+ tstack = token;
+ token = tstack.pop();
+ }
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol === null || typeof symbol == "undefined") {
+ symbol = lex();
+ }
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ var errStr = "";
+ expected = [];
+ for (p in table[state]) {
+ if (this.terminals_[p] && p > TERROR) {
+ expected.push("'" + this.terminals_[p] + "'");
+ }
+ }
+ if (lexer2.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {
+ text: lexer2.match,
+ token: this.terminals_[symbol] || symbol,
+ line: lexer2.yylineno,
+ loc: yyloc,
+ expected
+ });
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(lexer2.yytext);
+ lstack.push(lexer2.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ {
+ yyleng = lexer2.yyleng;
+ yytext = lexer2.yytext;
+ yylineno = lexer2.yylineno;
+ yyloc = lexer2.yylloc;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = {
+ first_line: lstack[lstack.length - (len || 1)].first_line,
+ last_line: lstack[lstack.length - 1].last_line,
+ first_column: lstack[lstack.length - (len || 1)].first_column,
+ last_column: lstack[lstack.length - 1].last_column
+ };
+ if (ranges) {
+ yyval._$.range = [
+ lstack[lstack.length - (len || 1)].range[0],
+ lstack[lstack.length - 1].range[1]
+ ];
+ }
+ r = this.performAction.apply(yyval, [
+ yytext,
+ yyleng,
+ yylineno,
+ sharedState.yy,
+ action[1],
+ vstack,
+ lstack
+ ].concat(args));
+ if (typeof r !== "undefined") {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+ }
+ };
+ var lexer = function() {
+ var lexer2 = {
+ EOF: 1,
+ parseError: function parseError(str, hash) {
+ if (this.yy.parser) {
+ this.yy.parser.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+ // resets the lexer, sets new input
+ setInput: function(input, yy) {
+ this.yy = yy || this.yy || {};
+ this._input = input;
+ this._more = this._backtrack = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = "";
+ this.conditionStack = ["INITIAL"];
+ this.yylloc = {
+ first_line: 1,
+ first_column: 0,
+ last_line: 1,
+ last_column: 0
+ };
+ if (this.options.ranges) {
+ this.yylloc.range = [0, 0];
+ }
+ this.offset = 0;
+ return this;
+ },
+ // consumes and returns one char from the input
+ input: function() {
+ var ch = this._input[0];
+ this.yytext += ch;
+ this.yyleng++;
+ this.offset++;
+ this.match += ch;
+ this.matched += ch;
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno++;
+ this.yylloc.last_line++;
+ } else {
+ this.yylloc.last_column++;
+ }
+ if (this.options.ranges) {
+ this.yylloc.range[1]++;
+ }
+ this._input = this._input.slice(1);
+ return ch;
+ },
+ // unshifts one char (or a string) into the input
+ unput: function(ch) {
+ var len = ch.length;
+ var lines = ch.split(/(?:\r\n?|\n)/g);
+ this._input = ch + this._input;
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
+ this.offset -= len;
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
+ this.match = this.match.substr(0, this.match.length - 1);
+ this.matched = this.matched.substr(0, this.matched.length - 1);
+ if (lines.length - 1) {
+ this.yylineno -= lines.length - 1;
+ }
+ var r = this.yylloc.range;
+ this.yylloc = {
+ first_line: this.yylloc.first_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.first_column,
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
+ };
+ if (this.options.ranges) {
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
+ }
+ this.yyleng = this.yytext.length;
+ return this;
+ },
+ // When called from action, caches matched text and appends it on next action
+ more: function() {
+ this._more = true;
+ return this;
+ },
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
+ reject: function() {
+ if (this.options.backtrack_lexer) {
+ this._backtrack = true;
+ } else {
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ }
+ return this;
+ },
+ // retain first n characters of the match
+ less: function(n) {
+ this.unput(this.match.slice(n));
+ },
+ // displays already matched input, i.e. for error messages
+ pastInput: function() {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
+ },
+ // displays upcoming input, i.e. for error messages
+ upcomingInput: function() {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20 - next.length);
+ }
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
+ },
+ // displays the character position where the lexing error occurred, i.e. for error messages
+ showPosition: function() {
+ var pre = this.pastInput();
+ var c = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c + "^";
+ },
+ // test the lexed token: return FALSE when not a match, otherwise return token
+ test_match: function(match, indexed_rule) {
+ var token, lines, backup;
+ if (this.options.backtrack_lexer) {
+ backup = {
+ yylineno: this.yylineno,
+ yylloc: {
+ first_line: this.yylloc.first_line,
+ last_line: this.last_line,
+ first_column: this.yylloc.first_column,
+ last_column: this.yylloc.last_column
+ },
+ yytext: this.yytext,
+ match: this.match,
+ matches: this.matches,
+ matched: this.matched,
+ yyleng: this.yyleng,
+ offset: this.offset,
+ _more: this._more,
+ _input: this._input,
+ yy: this.yy,
+ conditionStack: this.conditionStack.slice(0),
+ done: this.done
+ };
+ if (this.options.ranges) {
+ backup.yylloc.range = this.yylloc.range.slice(0);
+ }
+ }
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno += lines.length;
+ }
+ this.yylloc = {
+ first_line: this.yylloc.last_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
+ };
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ if (this.options.ranges) {
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
+ }
+ this._more = false;
+ this._backtrack = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
+ if (this.done && this._input) {
+ this.done = false;
+ }
+ if (token) {
+ return token;
+ } else if (this._backtrack) {
+ for (var k in backup) {
+ this[k] = backup[k];
+ }
+ return false;
+ }
+ return false;
+ },
+ // return next match in input
+ next: function() {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) {
+ this.done = true;
+ }
+ var token, match, tempMatch, index;
+ if (!this._more) {
+ this.yytext = "";
+ this.match = "";
+ }
+ var rules = this._currentRules();
+ for (var i = 0; i < rules.length; i++) {
+ tempMatch = this._input.match(this.rules[rules[i]]);
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
+ match = tempMatch;
+ index = i;
+ if (this.options.backtrack_lexer) {
+ token = this.test_match(tempMatch, rules[i]);
+ if (token !== false) {
+ return token;
+ } else if (this._backtrack) {
+ match = false;
+ continue;
+ } else {
+ return false;
+ }
+ } else if (!this.options.flex) {
+ break;
+ }
+ }
+ }
+ if (match) {
+ token = this.test_match(match, rules[index]);
+ if (token !== false) {
+ return token;
+ }
+ return false;
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ }
+ },
+ // return next match that has a token
+ lex: function lex() {
+ var r = this.next();
+ if (r) {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
+ begin: function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+ // pop the previously active lexer condition state off the condition stack
+ popState: function popState() {
+ var n = this.conditionStack.length - 1;
+ if (n > 0) {
+ return this.conditionStack.pop();
+ } else {
+ return this.conditionStack[0];
+ }
+ },
+ // produce the lexer rule set which is active for the currently active lexer condition state
+ _currentRules: function _currentRules() {
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
+ } else {
+ return this.conditions["INITIAL"].rules;
+ }
+ },
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
+ topState: function topState(n) {
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
+ if (n >= 0) {
+ return this.conditionStack[n];
+ } else {
+ return "INITIAL";
+ }
+ },
+ // alias for begin(condition)
+ pushState: function pushState(condition) {
+ this.begin(condition);
+ },
+ // return the number of states currently on the stack
+ stateStackSize: function stateStackSize() {
+ return this.conditionStack.length;
+ },
+ options: {},
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
+ switch ($avoiding_name_collisions) {
+ case 0:
+ return 10;
+ case 1:
+ yy.getLogger().debug("Found space-block");
+ return 31;
+ case 2:
+ yy.getLogger().debug("Found nl-block");
+ return 31;
+ case 3:
+ yy.getLogger().debug("Found space-block");
+ return 29;
+ case 4:
+ yy.getLogger().debug(".", yy_.yytext);
+ break;
+ case 5:
+ yy.getLogger().debug("_", yy_.yytext);
+ break;
+ case 6:
+ return 5;
+ case 7:
+ yy_.yytext = -1;
+ return 28;
+ case 8:
+ yy_.yytext = yy_.yytext.replace(/columns\s+/, "");
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
+ return 28;
+ case 9:
+ this.pushState("md_string");
+ break;
+ case 10:
+ return "MD_STR";
+ case 11:
+ this.popState();
+ break;
+ case 12:
+ this.pushState("string");
+ break;
+ case 13:
+ yy.getLogger().debug("LEX: POPPING STR:", yy_.yytext);
+ this.popState();
+ break;
+ case 14:
+ yy.getLogger().debug("LEX: STR end:", yy_.yytext);
+ return "STR";
+ case 15:
+ yy_.yytext = yy_.yytext.replace(/space\:/, "");
+ yy.getLogger().debug("SPACE NUM (LEX)", yy_.yytext);
+ return 21;
+ case 16:
+ yy_.yytext = "1";
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
+ return 21;
+ case 17:
+ return 43;
+ case 18:
+ return "LINKSTYLE";
+ case 19:
+ return "INTERPOLATE";
+ case 20:
+ this.pushState("CLASSDEF");
+ return 40;
+ case 21:
+ this.popState();
+ this.pushState("CLASSDEFID");
+ return "DEFAULT_CLASSDEF_ID";
+ case 22:
+ this.popState();
+ this.pushState("CLASSDEFID");
+ return 41;
+ case 23:
+ this.popState();
+ return 42;
+ case 24:
+ this.pushState("CLASS");
+ return 44;
+ case 25:
+ this.popState();
+ this.pushState("CLASS_STYLE");
+ return 45;
+ case 26:
+ this.popState();
+ return 46;
+ case 27:
+ this.pushState("STYLE_STMNT");
+ return 47;
+ case 28:
+ this.popState();
+ this.pushState("STYLE_DEFINITION");
+ return 48;
+ case 29:
+ this.popState();
+ return 49;
+ case 30:
+ this.pushState("acc_title");
+ return "acc_title";
+ case 31:
+ this.popState();
+ return "acc_title_value";
+ case 32:
+ this.pushState("acc_descr");
+ return "acc_descr";
+ case 33:
+ this.popState();
+ return "acc_descr_value";
+ case 34:
+ this.pushState("acc_descr_multiline");
+ break;
+ case 35:
+ this.popState();
+ break;
+ case 36:
+ return "acc_descr_multiline_value";
+ case 37:
+ return 30;
+ case 38:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 39:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 40:
+ this.popState();
+ yy.getLogger().debug("Lex: ))");
+ return "NODE_DEND";
+ case 41:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 42:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 43:
+ this.popState();
+ yy.getLogger().debug("Lex: (-");
+ return "NODE_DEND";
+ case 44:
+ this.popState();
+ yy.getLogger().debug("Lex: -)");
+ return "NODE_DEND";
+ case 45:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 46:
+ this.popState();
+ yy.getLogger().debug("Lex: ]]");
+ return "NODE_DEND";
+ case 47:
+ this.popState();
+ yy.getLogger().debug("Lex: (");
+ return "NODE_DEND";
+ case 48:
+ this.popState();
+ yy.getLogger().debug("Lex: ])");
+ return "NODE_DEND";
+ case 49:
+ this.popState();
+ yy.getLogger().debug("Lex: /]");
+ return "NODE_DEND";
+ case 50:
+ this.popState();
+ yy.getLogger().debug("Lex: /]");
+ return "NODE_DEND";
+ case 51:
+ this.popState();
+ yy.getLogger().debug("Lex: )]");
+ return "NODE_DEND";
+ case 52:
+ this.popState();
+ yy.getLogger().debug("Lex: )");
+ return "NODE_DEND";
+ case 53:
+ this.popState();
+ yy.getLogger().debug("Lex: ]>");
+ return "NODE_DEND";
+ case 54:
+ this.popState();
+ yy.getLogger().debug("Lex: ]");
+ return "NODE_DEND";
+ case 55:
+ yy.getLogger().debug("Lexa: -)");
+ this.pushState("NODE");
+ return 36;
+ case 56:
+ yy.getLogger().debug("Lexa: (-");
+ this.pushState("NODE");
+ return 36;
+ case 57:
+ yy.getLogger().debug("Lexa: ))");
+ this.pushState("NODE");
+ return 36;
+ case 58:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 59:
+ yy.getLogger().debug("Lex: (((");
+ this.pushState("NODE");
+ return 36;
+ case 60:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 61:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 62:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 63:
+ yy.getLogger().debug("Lexc: >");
+ this.pushState("NODE");
+ return 36;
+ case 64:
+ yy.getLogger().debug("Lexa: ([");
+ this.pushState("NODE");
+ return 36;
+ case 65:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 66:
+ this.pushState("NODE");
+ return 36;
+ case 67:
+ this.pushState("NODE");
+ return 36;
+ case 68:
+ this.pushState("NODE");
+ return 36;
+ case 69:
+ this.pushState("NODE");
+ return 36;
+ case 70:
+ this.pushState("NODE");
+ return 36;
+ case 71:
+ this.pushState("NODE");
+ return 36;
+ case 72:
+ this.pushState("NODE");
+ return 36;
+ case 73:
+ yy.getLogger().debug("Lexa: [");
+ this.pushState("NODE");
+ return 36;
+ case 74:
+ this.pushState("BLOCK_ARROW");
+ yy.getLogger().debug("LEX ARR START");
+ return 38;
+ case 75:
+ yy.getLogger().debug("Lex: NODE_ID", yy_.yytext);
+ return 32;
+ case 76:
+ yy.getLogger().debug("Lex: EOF", yy_.yytext);
+ return 8;
+ case 77:
+ this.pushState("md_string");
+ break;
+ case 78:
+ this.pushState("md_string");
+ break;
+ case 79:
+ return "NODE_DESCR";
+ case 80:
+ this.popState();
+ break;
+ case 81:
+ yy.getLogger().debug("Lex: Starting string");
+ this.pushState("string");
+ break;
+ case 82:
+ yy.getLogger().debug("LEX ARR: Starting string");
+ this.pushState("string");
+ break;
+ case 83:
+ yy.getLogger().debug("LEX: NODE_DESCR:", yy_.yytext);
+ return "NODE_DESCR";
+ case 84:
+ yy.getLogger().debug("LEX POPPING");
+ this.popState();
+ break;
+ case 85:
+ yy.getLogger().debug("Lex: =>BAE");
+ this.pushState("ARROW_DIR");
+ break;
+ case 86:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (right): dir:", yy_.yytext);
+ return "DIR";
+ case 87:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (left):", yy_.yytext);
+ return "DIR";
+ case 88:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (x):", yy_.yytext);
+ return "DIR";
+ case 89:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (y):", yy_.yytext);
+ return "DIR";
+ case 90:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (up):", yy_.yytext);
+ return "DIR";
+ case 91:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (down):", yy_.yytext);
+ return "DIR";
+ case 92:
+ yy_.yytext = "]>";
+ yy.getLogger().debug("Lex (ARROW_DIR end):", yy_.yytext);
+ this.popState();
+ this.popState();
+ return "BLOCK_ARROW_END";
+ case 93:
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
+ return 15;
+ case 94:
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 95:
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 96:
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 97:
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
+ this.pushState("LLABEL");
+ return 16;
+ case 98:
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
+ this.pushState("LLABEL");
+ return 16;
+ case 99:
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
+ this.pushState("LLABEL");
+ return 16;
+ case 100:
+ this.pushState("md_string");
+ break;
+ case 101:
+ yy.getLogger().debug("Lex: Starting string");
+ this.pushState("string");
+ return "LINK_LABEL";
+ case 102:
+ this.popState();
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
+ return 15;
+ case 103:
+ this.popState();
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 104:
+ this.popState();
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 105:
+ yy.getLogger().debug("Lex: COLON", yy_.yytext);
+ yy_.yytext = yy_.yytext.slice(1);
+ return 27;
+ }
+ },
+ rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
+ conditions: { "STYLE_DEFINITION": { "rules": [29], "inclusive": false }, "STYLE_STMNT": { "rules": [28], "inclusive": false }, "CLASSDEFID": { "rules": [23], "inclusive": false }, "CLASSDEF": { "rules": [21, 22], "inclusive": false }, "CLASS_STYLE": { "rules": [26], "inclusive": false }, "CLASS": { "rules": [25], "inclusive": false }, "LLABEL": { "rules": [100, 101, 102, 103, 104], "inclusive": false }, "ARROW_DIR": { "rules": [86, 87, 88, 89, 90, 91, 92], "inclusive": false }, "BLOCK_ARROW": { "rules": [77, 82, 85], "inclusive": false }, "NODE": { "rules": [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], "inclusive": false }, "md_string": { "rules": [10, 11, 79, 80], "inclusive": false }, "space": { "rules": [], "inclusive": false }, "string": { "rules": [13, 14, 83, 84], "inclusive": false }, "acc_descr_multiline": { "rules": [35, 36], "inclusive": false }, "acc_descr": { "rules": [33], "inclusive": false }, "acc_title": { "rules": [31], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], "inclusive": true } }
+ };
+ return lexer2;
+ }();
+ parser2.lexer = lexer;
+ function Parser() {
+ this.yy = {};
+ }
+ Parser.prototype = parser2;
+ parser2.Parser = Parser;
+ return new Parser();
+}();
+parser.parser = parser;
+const parser$1 = parser;
+let blockDatabase = {};
+let edgeList = [];
+let edgeCount = {};
+const COLOR_KEYWORD = "color";
+const FILL_KEYWORD = "fill";
+const BG_FILL = "bgFill";
+const STYLECLASS_SEP = ",";
+const config = getConfig();
+let classes = {};
+const sanitizeText = (txt) => common.sanitizeText(txt, config);
+const addStyleClass = function(id, styleAttributes = "") {
+ if (classes[id] === void 0) {
+ classes[id] = { id, styles: [], textStyles: [] };
+ }
+ const foundClass = classes[id];
+ if (styleAttributes !== void 0 && styleAttributes !== null) {
+ styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => {
+ const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
+ if (attrib.match(COLOR_KEYWORD)) {
+ const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
+ const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
+ foundClass.textStyles.push(newStyle2);
+ }
+ foundClass.styles.push(fixedAttrib);
+ });
+ }
+};
+const addStyle2Node = function(id, styles = "") {
+ const foundBlock = blockDatabase[id];
+ if (styles !== void 0 && styles !== null) {
+ foundBlock.styles = styles.split(STYLECLASS_SEP);
+ }
+};
+const setCssClass = function(itemIds, cssClassName) {
+ itemIds.split(",").forEach(function(id) {
+ let foundBlock = blockDatabase[id];
+ if (foundBlock === void 0) {
+ const trimmedId = id.trim();
+ blockDatabase[trimmedId] = { id: trimmedId, type: "na", children: [] };
+ foundBlock = blockDatabase[trimmedId];
+ }
+ if (!foundBlock.classes) {
+ foundBlock.classes = [];
+ }
+ foundBlock.classes.push(cssClassName);
+ });
+};
+const populateBlockDatabase = (_blockList, parent) => {
+ const blockList = _blockList.flat();
+ const children = [];
+ for (const block of blockList) {
+ if (block.label) {
+ block.label = sanitizeText(block.label);
+ }
+ if (block.type === "classDef") {
+ addStyleClass(block.id, block.css);
+ continue;
+ }
+ if (block.type === "applyClass") {
+ setCssClass(block.id, (block == null ? void 0 : block.styleClass) || "");
+ continue;
+ }
+ if (block.type === "applyStyles") {
+ if (block == null ? void 0 : block.stylesStr) {
+ addStyle2Node(block.id, block == null ? void 0 : block.stylesStr);
+ }
+ continue;
+ }
+ if (block.type === "column-setting") {
+ parent.columns = block.columns || -1;
+ } else if (block.type === "edge") {
+ if (edgeCount[block.id]) {
+ edgeCount[block.id]++;
+ } else {
+ edgeCount[block.id] = 1;
+ }
+ block.id = edgeCount[block.id] + "-" + block.id;
+ edgeList.push(block);
+ } else {
+ if (!block.label) {
+ if (block.type === "composite") {
+ block.label = "";
+ } else {
+ block.label = block.id;
+ }
+ }
+ const newBlock = !blockDatabase[block.id];
+ if (newBlock) {
+ blockDatabase[block.id] = block;
+ } else {
+ if (block.type !== "na") {
+ blockDatabase[block.id].type = block.type;
+ }
+ if (block.label !== block.id) {
+ blockDatabase[block.id].label = block.label;
+ }
+ }
+ if (block.children) {
+ populateBlockDatabase(block.children, block);
+ }
+ if (block.type === "space") {
+ const w = block.width || 1;
+ for (let j = 0; j < w; j++) {
+ const newBlock2 = clone(block);
+ newBlock2.id = newBlock2.id + "-" + j;
+ blockDatabase[newBlock2.id] = newBlock2;
+ children.push(newBlock2);
+ }
+ } else if (newBlock) {
+ children.push(block);
+ }
+ }
+ }
+ parent.children = children;
+};
+let blocks = [];
+let rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
+const clear = () => {
+ log.debug("Clear called");
+ clear$1();
+ rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
+ blockDatabase = { root: rootBlock };
+ blocks = [];
+ classes = {};
+ edgeList = [];
+ edgeCount = {};
+};
+function typeStr2Type(typeStr) {
+ log.debug("typeStr2Type", typeStr);
+ switch (typeStr) {
+ case "[]":
+ return "square";
+ case "()":
+ log.debug("we have a round");
+ return "round";
+ case "(())":
+ return "circle";
+ case ">]":
+ return "rect_left_inv_arrow";
+ case "{}":
+ return "diamond";
+ case "{{}}":
+ return "hexagon";
+ case "([])":
+ return "stadium";
+ case "[[]]":
+ return "subroutine";
+ case "[()]":
+ return "cylinder";
+ case "((()))":
+ return "doublecircle";
+ case "[//]":
+ return "lean_right";
+ case "[\\\\]":
+ return "lean_left";
+ case "[/\\]":
+ return "trapezoid";
+ case "[\\/]":
+ return "inv_trapezoid";
+ case "<[]>":
+ return "block_arrow";
+ default:
+ return "na";
+ }
+}
+function edgeTypeStr2Type(typeStr) {
+ log.debug("typeStr2Type", typeStr);
+ switch (typeStr) {
+ case "==":
+ return "thick";
+ default:
+ return "normal";
+ }
+}
+function edgeStrToEdgeData(typeStr) {
+ switch (typeStr.trim()) {
+ case "--x":
+ return "arrow_cross";
+ case "--o":
+ return "arrow_circle";
+ default:
+ return "arrow_point";
+ }
+}
+let cnt = 0;
+const generateId = () => {
+ cnt++;
+ return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
+};
+const setHierarchy = (block) => {
+ rootBlock.children = block;
+ populateBlockDatabase(block, rootBlock);
+ blocks = rootBlock.children;
+};
+const getColumns = (blockId) => {
+ const block = blockDatabase[blockId];
+ if (!block) {
+ return -1;
+ }
+ if (block.columns) {
+ return block.columns;
+ }
+ if (!block.children) {
+ return -1;
+ }
+ return block.children.length;
+};
+const getBlocksFlat = () => {
+ return [...Object.values(blockDatabase)];
+};
+const getBlocks = () => {
+ return blocks || [];
+};
+const getEdges = () => {
+ return edgeList;
+};
+const getBlock = (id) => {
+ return blockDatabase[id];
+};
+const setBlock = (block) => {
+ blockDatabase[block.id] = block;
+};
+const getLogger = () => console;
+const getClasses$1 = function() {
+ return classes;
+};
+const db = {
+ getConfig: () => getConfig$1().block,
+ typeStr2Type,
+ edgeTypeStr2Type,
+ edgeStrToEdgeData,
+ getLogger,
+ getBlocksFlat,
+ getBlocks,
+ getEdges,
+ setHierarchy,
+ getBlock,
+ setBlock,
+ getColumns,
+ getClasses: getClasses$1,
+ clear,
+ generateId
+};
+const db$1 = db;
+const fade = (color, opacity) => {
+ const channel = khroma.channel;
+ const r = channel(color, "r");
+ const g = channel(color, "g");
+ const b = channel(color, "b");
+ return khroma.rgba(r, g, b, opacity);
+};
+const getStyles = (options) => `.label {
+ font-family: ${options.fontFamily};
+ color: ${options.nodeTextColor || options.textColor};
+ }
+ .cluster-label text {
+ fill: ${options.titleColor};
+ }
+ .cluster-label span,p {
+ color: ${options.titleColor};
+ }
+
+
+
+ .label text,span,p {
+ fill: ${options.nodeTextColor || options.textColor};
+ color: ${options.nodeTextColor || options.textColor};
+ }
+
+ .node rect,
+ .node circle,
+ .node ellipse,
+ .node polygon,
+ .node path {
+ fill: ${options.mainBkg};
+ stroke: ${options.nodeBorder};
+ stroke-width: 1px;
+ }
+ .flowchart-label text {
+ text-anchor: middle;
+ }
+ // .flowchart-label .text-outer-tspan {
+ // text-anchor: middle;
+ // }
+ // .flowchart-label .text-inner-tspan {
+ // text-anchor: start;
+ // }
+
+ .node .label {
+ text-align: center;
+ }
+ .node.clickable {
+ cursor: pointer;
+ }
+
+ .arrowheadPath {
+ fill: ${options.arrowheadColor};
+ }
+
+ .edgePath .path {
+ stroke: ${options.lineColor};
+ stroke-width: 2.0px;
+ }
+
+ .flowchart-link {
+ stroke: ${options.lineColor};
+ fill: none;
+ }
+
+ .edgeLabel {
+ background-color: ${options.edgeLabelBackground};
+ rect {
+ opacity: 0.5;
+ background-color: ${options.edgeLabelBackground};
+ fill: ${options.edgeLabelBackground};
+ }
+ text-align: center;
+ }
+
+ /* For html labels only */
+ .labelBkg {
+ background-color: ${fade(options.edgeLabelBackground, 0.5)};
+ // background-color:
+ }
+
+ .node .cluster {
+ // fill: ${fade(options.mainBkg, 0.5)};
+ fill: ${fade(options.clusterBkg, 0.5)};
+ stroke: ${fade(options.clusterBorder, 0.2)};
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
+ stroke-width: 1px;
+ }
+
+ .cluster text {
+ fill: ${options.titleColor};
+ }
+
+ .cluster span,p {
+ color: ${options.titleColor};
+ }
+ /* .cluster div {
+ color: ${options.titleColor};
+ } */
+
+ div.mermaidTooltip {
+ position: absolute;
+ text-align: center;
+ max-width: 200px;
+ padding: 2px;
+ font-family: ${options.fontFamily};
+ font-size: 12px;
+ background: ${options.tertiaryColor};
+ border: 1px solid ${options.border2};
+ border-radius: 2px;
+ pointer-events: none;
+ z-index: 100;
+ }
+
+ .flowchartTitleText {
+ text-anchor: middle;
+ font-size: 18px;
+ fill: ${options.textColor};
+ }
+`;
+const flowStyles = getStyles;
+function getNodeFromBlock(block, db2, positioned = false) {
+ var _a2, _b2, _c;
+ const vertex = block;
+ let classStr = "default";
+ if ((((_a2 = vertex == null ? void 0 : vertex.classes) == null ? void 0 : _a2.length) || 0) > 0) {
+ classStr = ((vertex == null ? void 0 : vertex.classes) || []).join(" ");
+ }
+ classStr = classStr + " flowchart-label";
+ let radius = 0;
+ let shape = "";
+ let padding2;
+ switch (vertex.type) {
+ case "round":
+ radius = 5;
+ shape = "rect";
+ break;
+ case "composite":
+ radius = 0;
+ shape = "composite";
+ padding2 = 0;
+ break;
+ case "square":
+ shape = "rect";
+ break;
+ case "diamond":
+ shape = "question";
+ break;
+ case "hexagon":
+ shape = "hexagon";
+ break;
+ case "block_arrow":
+ shape = "block_arrow";
+ break;
+ case "odd":
+ shape = "rect_left_inv_arrow";
+ break;
+ case "lean_right":
+ shape = "lean_right";
+ break;
+ case "lean_left":
+ shape = "lean_left";
+ break;
+ case "trapezoid":
+ shape = "trapezoid";
+ break;
+ case "inv_trapezoid":
+ shape = "inv_trapezoid";
+ break;
+ case "rect_left_inv_arrow":
+ shape = "rect_left_inv_arrow";
+ break;
+ case "circle":
+ shape = "circle";
+ break;
+ case "ellipse":
+ shape = "ellipse";
+ break;
+ case "stadium":
+ shape = "stadium";
+ break;
+ case "subroutine":
+ shape = "subroutine";
+ break;
+ case "cylinder":
+ shape = "cylinder";
+ break;
+ case "group":
+ shape = "rect";
+ break;
+ case "doublecircle":
+ shape = "doublecircle";
+ break;
+ default:
+ shape = "rect";
+ }
+ const styles = getStylesFromArray((vertex == null ? void 0 : vertex.styles) || []);
+ const vertexText = vertex.label;
+ const bounds = vertex.size || { width: 0, height: 0, x: 0, y: 0 };
+ const node = {
+ labelStyle: styles.labelStyle,
+ shape,
+ labelText: vertexText,
+ rx: radius,
+ ry: radius,
+ class: classStr,
+ style: styles.style,
+ id: vertex.id,
+ directions: vertex.directions,
+ width: bounds.width,
+ height: bounds.height,
+ x: bounds.x,
+ y: bounds.y,
+ positioned,
+ intersect: void 0,
+ type: vertex.type,
+ padding: padding2 ?? (((_c = (_b2 = getConfig$1()) == null ? void 0 : _b2.block) == null ? void 0 : _c.padding) || 0)
+ };
+ return node;
+}
+async function calculateBlockSize(elem, block, db2) {
+ const node = getNodeFromBlock(block, db2, false);
+ if (node.type === "group") {
+ return;
+ }
+ const nodeEl = await insertNode(elem, node);
+ const boundingBox = nodeEl.node().getBBox();
+ const obj = db2.getBlock(node.id);
+ obj.size = { width: boundingBox.width, height: boundingBox.height, x: 0, y: 0, node: nodeEl };
+ db2.setBlock(obj);
+ nodeEl.remove();
+}
+async function insertBlockPositioned(elem, block, db2) {
+ const node = getNodeFromBlock(block, db2, true);
+ const obj = db2.getBlock(node.id);
+ if (obj.type !== "space") {
+ await insertNode(elem, node);
+ block.intersect = node == null ? void 0 : node.intersect;
+ positionNode(node);
+ }
+}
+async function performOperations(elem, blocks2, db2, operation) {
+ for (const block of blocks2) {
+ await operation(elem, block, db2);
+ if (block.children) {
+ await performOperations(elem, block.children, db2, operation);
+ }
+ }
+}
+async function calculateBlockSizes(elem, blocks2, db2) {
+ await performOperations(elem, blocks2, db2, calculateBlockSize);
+}
+async function insertBlocks(elem, blocks2, db2) {
+ await performOperations(elem, blocks2, db2, insertBlockPositioned);
+}
+async function insertEdges(elem, edges, blocks2, db2, id) {
+ const g = new graphlib.Graph({
+ multigraph: true,
+ compound: true
+ });
+ g.setGraph({
+ rankdir: "TB",
+ nodesep: 10,
+ ranksep: 10,
+ marginx: 8,
+ marginy: 8
+ });
+ for (const block of blocks2) {
+ if (block.size) {
+ g.setNode(block.id, {
+ width: block.size.width,
+ height: block.size.height,
+ intersect: block.intersect
+ });
+ }
+ }
+ for (const edge of edges) {
+ if (edge.start && edge.end) {
+ const startBlock = db2.getBlock(edge.start);
+ const endBlock = db2.getBlock(edge.end);
+ if ((startBlock == null ? void 0 : startBlock.size) && (endBlock == null ? void 0 : endBlock.size)) {
+ const start = startBlock.size;
+ const end = endBlock.size;
+ const points = [
+ { x: start.x, y: start.y },
+ { x: start.x + (end.x - start.x) / 2, y: start.y + (end.y - start.y) / 2 },
+ { x: end.x, y: end.y }
+ ];
+ await insertEdge(
+ elem,
+ { v: edge.start, w: edge.end, name: edge.id },
+ {
+ ...edge,
+ arrowTypeEnd: edge.arrowTypeEnd,
+ arrowTypeStart: edge.arrowTypeStart,
+ points,
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
+ },
+ void 0,
+ "block",
+ g,
+ id
+ );
+ if (edge.label) {
+ await insertEdgeLabel(elem, {
+ ...edge,
+ label: edge.label,
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
+ arrowTypeEnd: edge.arrowTypeEnd,
+ arrowTypeStart: edge.arrowTypeStart,
+ points,
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
+ });
+ await positionEdgeLabel(
+ { ...edge, x: points[1].x, y: points[1].y },
+ {
+ originalPath: points
+ }
+ );
+ }
+ }
+ }
+ }
+}
+const padding = ((_b = (_a = getConfig()) == null ? void 0 : _a.block) == null ? void 0 : _b.padding) || 8;
+function calculateBlockPosition(columns, position) {
+ if (columns === 0 || !Number.isInteger(columns)) {
+ throw new Error("Columns must be an integer !== 0.");
+ }
+ if (position < 0 || !Number.isInteger(position)) {
+ throw new Error("Position must be a non-negative integer." + position);
+ }
+ if (columns < 0) {
+ return { px: position, py: 0 };
+ }
+ if (columns === 1) {
+ return { px: 0, py: position };
+ }
+ const px = position % columns;
+ const py = Math.floor(position / columns);
+ return { px, py };
+}
+const getMaxChildSize = (block) => {
+ let maxWidth = 0;
+ let maxHeight = 0;
+ for (const child of block.children) {
+ const { width, height, x, y } = child.size || { width: 0, height: 0, x: 0, y: 0 };
+ log.debug(
+ "getMaxChildSize abc95 child:",
+ child.id,
+ "width:",
+ width,
+ "height:",
+ height,
+ "x:",
+ x,
+ "y:",
+ y,
+ child.type
+ );
+ if (child.type === "space") {
+ continue;
+ }
+ if (width > maxWidth) {
+ maxWidth = width / (block.widthInColumns || 1);
+ }
+ if (height > maxHeight) {
+ maxHeight = height;
+ }
+ }
+ return { width: maxWidth, height: maxHeight };
+};
+function setBlockSizes(block, db2, siblingWidth = 0, siblingHeight = 0) {
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
+ log.debug(
+ "setBlockSizes abc95 (start)",
+ block.id,
+ (_a2 = block == null ? void 0 : block.size) == null ? void 0 : _a2.x,
+ "block width =",
+ block == null ? void 0 : block.size,
+ "sieblingWidth",
+ siblingWidth
+ );
+ if (!((_b2 = block == null ? void 0 : block.size) == null ? void 0 : _b2.width)) {
+ block.size = {
+ width: siblingWidth,
+ height: siblingHeight,
+ x: 0,
+ y: 0
+ };
+ }
+ let maxWidth = 0;
+ let maxHeight = 0;
+ if (((_c = block.children) == null ? void 0 : _c.length) > 0) {
+ for (const child of block.children) {
+ setBlockSizes(child, db2);
+ }
+ const childSize = getMaxChildSize(block);
+ maxWidth = childSize.width;
+ maxHeight = childSize.height;
+ log.debug("setBlockSizes abc95 maxWidth of", block.id, ":s children is ", maxWidth, maxHeight);
+ for (const child of block.children) {
+ if (child.size) {
+ log.debug(
+ `abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${child.size}`
+ );
+ child.size.width = maxWidth * (child.widthInColumns || 1) + padding * ((child.widthInColumns || 1) - 1);
+ child.size.height = maxHeight;
+ child.size.x = 0;
+ child.size.y = 0;
+ log.debug(
+ `abc95 updating size of ${block.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}`
+ );
+ }
+ }
+ for (const child of block.children) {
+ setBlockSizes(child, db2, maxWidth, maxHeight);
+ }
+ const columns = block.columns || -1;
+ let numItems = 0;
+ for (const child of block.children) {
+ numItems += child.widthInColumns || 1;
+ }
+ let xSize = block.children.length;
+ if (columns > 0 && columns < numItems) {
+ xSize = columns;
+ }
+ block.widthInColumns || 1;
+ const ySize = Math.ceil(numItems / xSize);
+ let width = xSize * (maxWidth + padding) + padding;
+ let height = ySize * (maxHeight + padding) + padding;
+ if (width < siblingWidth) {
+ log.debug(
+ `Detected to small siebling: abc95 ${block.id} sieblingWidth ${siblingWidth} sieblingHeight ${siblingHeight} width ${width}`
+ );
+ width = siblingWidth;
+ height = siblingHeight;
+ const childWidth = (siblingWidth - xSize * padding - padding) / xSize;
+ const childHeight = (siblingHeight - ySize * padding - padding) / ySize;
+ log.debug("Size indata abc88", block.id, "childWidth", childWidth, "maxWidth", maxWidth);
+ log.debug("Size indata abc88", block.id, "childHeight", childHeight, "maxHeight", maxHeight);
+ log.debug("Size indata abc88 xSize", xSize, "padding", padding);
+ for (const child of block.children) {
+ if (child.size) {
+ child.size.width = childWidth;
+ child.size.height = childHeight;
+ child.size.x = 0;
+ child.size.y = 0;
+ }
+ }
+ }
+ log.debug(
+ `abc95 (finale calc) ${block.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block.children.length} width=${Math.max(width, ((_d = block.size) == null ? void 0 : _d.width) || 0)}`
+ );
+ if (width < (((_e = block == null ? void 0 : block.size) == null ? void 0 : _e.width) || 0)) {
+ width = ((_f = block == null ? void 0 : block.size) == null ? void 0 : _f.width) || 0;
+ const num = columns > 0 ? Math.min(block.children.length, columns) : block.children.length;
+ if (num > 0) {
+ const childWidth = (width - num * padding - padding) / num;
+ log.debug("abc95 (growing to fit) width", block.id, width, (_g = block.size) == null ? void 0 : _g.width, childWidth);
+ for (const child of block.children) {
+ if (child.size) {
+ child.size.width = childWidth;
+ }
+ }
+ }
+ }
+ block.size = {
+ width,
+ height,
+ x: 0,
+ y: 0
+ };
+ }
+ log.debug(
+ "setBlockSizes abc94 (done)",
+ block.id,
+ (_h = block == null ? void 0 : block.size) == null ? void 0 : _h.x,
+ (_i = block == null ? void 0 : block.size) == null ? void 0 : _i.width,
+ (_j = block == null ? void 0 : block.size) == null ? void 0 : _j.y,
+ (_k = block == null ? void 0 : block.size) == null ? void 0 : _k.height
+ );
+}
+function layoutBlocks(block, db2) {
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
+ log.debug(
+ `abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${(_a2 = block == null ? void 0 : block.size) == null ? void 0 : _a2.x} y: ${(_b2 = block == null ? void 0 : block.size) == null ? void 0 : _b2.y} width: ${(_c = block == null ? void 0 : block.size) == null ? void 0 : _c.width}`
+ );
+ const columns = block.columns || -1;
+ log.debug("layoutBlocks columns abc95", block.id, "=>", columns, block);
+ if (block.children && // find max width of children
+ block.children.length > 0) {
+ const width = ((_e = (_d = block == null ? void 0 : block.children[0]) == null ? void 0 : _d.size) == null ? void 0 : _e.width) || 0;
+ const widthOfChildren = block.children.length * width + (block.children.length - 1) * padding;
+ log.debug("widthOfChildren 88", widthOfChildren, "posX");
+ let columnPos = 0;
+ log.debug("abc91 block?.size?.x", block.id, (_f = block == null ? void 0 : block.size) == null ? void 0 : _f.x);
+ let startingPosX = ((_g = block == null ? void 0 : block.size) == null ? void 0 : _g.x) ? ((_h = block == null ? void 0 : block.size) == null ? void 0 : _h.x) + (-((_i = block == null ? void 0 : block.size) == null ? void 0 : _i.width) / 2 || 0) : -padding;
+ let rowPos = 0;
+ for (const child of block.children) {
+ const parent = block;
+ if (!child.size) {
+ continue;
+ }
+ const { width: width2, height } = child.size;
+ const { px, py } = calculateBlockPosition(columns, columnPos);
+ if (py != rowPos) {
+ rowPos = py;
+ startingPosX = ((_j = block == null ? void 0 : block.size) == null ? void 0 : _j.x) ? ((_k = block == null ? void 0 : block.size) == null ? void 0 : _k.x) + (-((_l = block == null ? void 0 : block.size) == null ? void 0 : _l.width) / 2 || 0) : -padding;
+ log.debug("New row in layout for block", block.id, " and child ", child.id, rowPos);
+ }
+ log.debug(
+ `abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${(_m = parent == null ? void 0 : parent.size) == null ? void 0 : _m.x},${(_n = parent == null ? void 0 : parent.size) == null ? void 0 : _n.y}) parent: ${parent.id} width: ${width2}${padding}`
+ );
+ if (parent.size) {
+ const halfWidth = width2 / 2;
+ child.size.x = startingPosX + padding + halfWidth;
+ log.debug(
+ `abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width2} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width2 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}`
+ );
+ startingPosX = child.size.x + halfWidth;
+ child.size.y = parent.size.y - parent.size.height / 2 + py * (height + padding) + height / 2 + padding;
+ log.debug(
+ `abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width2 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}`
+ );
+ }
+ if (child.children) {
+ layoutBlocks(child);
+ }
+ columnPos += (child == null ? void 0 : child.widthInColumns) || 1;
+ log.debug("abc88 columnsPos", child, columnPos);
+ }
+ }
+ log.debug(
+ `layout blocks (<==layoutBlocks) ${block.id} x: ${(_o = block == null ? void 0 : block.size) == null ? void 0 : _o.x} y: ${(_p = block == null ? void 0 : block.size) == null ? void 0 : _p.y} width: ${(_q = block == null ? void 0 : block.size) == null ? void 0 : _q.width}`
+ );
+}
+function findBounds(block, { minX, minY, maxX, maxY } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
+ if (block.size && block.id !== "root") {
+ const { x, y, width, height } = block.size;
+ if (x - width / 2 < minX) {
+ minX = x - width / 2;
+ }
+ if (y - height / 2 < minY) {
+ minY = y - height / 2;
+ }
+ if (x + width / 2 > maxX) {
+ maxX = x + width / 2;
+ }
+ if (y + height / 2 > maxY) {
+ maxY = y + height / 2;
+ }
+ }
+ if (block.children) {
+ for (const child of block.children) {
+ ({ minX, minY, maxX, maxY } = findBounds(child, { minX, minY, maxX, maxY }));
+ }
+ }
+ return { minX, minY, maxX, maxY };
+}
+function layout(db2) {
+ const root = db2.getBlock("root");
+ if (!root) {
+ return;
+ }
+ setBlockSizes(root, db2, 0, 0);
+ layoutBlocks(root);
+ log.debug("getBlocks", JSON.stringify(root, null, 2));
+ const { minX, minY, maxX, maxY } = findBounds(root);
+ const height = maxY - minY;
+ const width = maxX - minX;
+ return { x: minX, y: minY, width, height };
+}
+const getClasses = function(text, diagObj) {
+ return diagObj.db.getClasses();
+};
+const draw = async function(text, id, _version, diagObj) {
+ const { securityLevel, block: conf } = getConfig$1();
+ const db2 = diagObj.db;
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = select("#i" + id);
+ }
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
+ const svg = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
+ const markers = ["point", "circle", "cross"];
+ insertMarkers(svg, markers, diagObj.type, id);
+ const bl = db2.getBlocks();
+ const blArr = db2.getBlocksFlat();
+ const edges = db2.getEdges();
+ const nodes = svg.insert("g").attr("class", "block");
+ await calculateBlockSizes(nodes, bl, db2);
+ const bounds = layout(db2);
+ await insertBlocks(nodes, bl, db2);
+ await insertEdges(nodes, edges, blArr, db2, id);
+ if (bounds) {
+ const bounds2 = bounds;
+ const magicFactor = Math.max(1, Math.round(0.125 * (bounds2.width / bounds2.height)));
+ const height = bounds2.height + magicFactor + 10;
+ const width = bounds2.width + 10;
+ const { useMaxWidth } = conf;
+ configureSvgSize(svg, height, width, !!useMaxWidth);
+ log.debug("Here Bounds", bounds, bounds2);
+ svg.attr(
+ "viewBox",
+ `${bounds2.x - 5} ${bounds2.y - 5} ${bounds2.width + 10} ${bounds2.height + 10}`
+ );
+ }
+ scaleOrdinal(schemeTableau10);
+};
+const renderer = {
+ draw,
+ getClasses
+};
+const diagram = {
+ parser: parser$1,
+ db: db$1,
+ renderer,
+ styles: flowStyles
+};
+export {
+ diagram
+};
diff --git a/assets/lib/mermaid/blockDiagram-efe38566.js b/assets/lib/mermaid/blockDiagram-efe38566.js
new file mode 100644
index 00000000..17118fa8
--- /dev/null
+++ b/assets/lib/mermaid/blockDiagram-efe38566.js
@@ -0,0 +1,1818 @@
+var _a, _b;
+import { c as getConfig, _ as getConfig$1, l as log, E as clear$1, f as common, B as rgba, o as getStylesFromArray, j as d3select, k as configureSvgSize } from "./mermaid-dcacb631.js";
+import { c as clone } from "./clone-9ea6bfeb.js";
+import { c as channel } from "./channel-f9001828.js";
+import { h as insertEdge, f as insertEdgeLabel, j as positionEdgeLabel, e as insertNode, p as positionNode, a as insertMarkers } from "./edges-ce5cfb7c.js";
+import { G as Graph } from "./graph-fe24fab6.js";
+import { o as ordinal } from "./ordinal-475e0c0c.js";
+import { d as d3schemeTableau10 } from "./Tableau10-31042135.js";
+import "./createText-b70fe78a.js";
+import "./line-87f517ef.js";
+import "./array-b7dcf730.js";
+import "./path-39bad7e2.js";
+import "./init-cc95ec8e.js";
+var parser = function() {
+ var o = function(k, v, o2, l) {
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
+ ;
+ return o2;
+ }, $V0 = [1, 7], $V1 = [1, 13], $V2 = [1, 14], $V3 = [1, 15], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Va = [1, 23], $Vb = [1, 24], $Vc = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Vd = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], $Ve = [1, 49];
+ var parser2 = {
+ trace: function trace() {
+ },
+ yy: {},
+ symbols_: { "error": 2, "spaceLines": 3, "SPACELINE": 4, "NL": 5, "separator": 6, "SPACE": 7, "EOF": 8, "start": 9, "BLOCK_DIAGRAM_KEY": 10, "document": 11, "stop": 12, "statement": 13, "link": 14, "LINK": 15, "START_LINK": 16, "LINK_LABEL": 17, "STR": 18, "nodeStatement": 19, "columnsStatement": 20, "SPACE_BLOCK": 21, "blockStatement": 22, "classDefStatement": 23, "cssClassStatement": 24, "styleStatement": 25, "node": 26, "SIZE": 27, "COLUMNS": 28, "id-block": 29, "end": 30, "block": 31, "NODE_ID": 32, "nodeShapeNLabel": 33, "dirList": 34, "DIR": 35, "NODE_DSTART": 36, "NODE_DEND": 37, "BLOCK_ARROW_START": 38, "BLOCK_ARROW_END": 39, "classDef": 40, "CLASSDEF_ID": 41, "CLASSDEF_STYLEOPTS": 42, "DEFAULT": 43, "class": 44, "CLASSENTITY_IDS": 45, "STYLECLASS": 46, "style": 47, "STYLE_ENTITY_IDS": 48, "STYLE_DEFINITION_DATA": 49, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
+ var $0 = $$.length - 1;
+ switch (yystate) {
+ case 4:
+ yy.getLogger().debug("Rule: separator (NL) ");
+ break;
+ case 5:
+ yy.getLogger().debug("Rule: separator (Space) ");
+ break;
+ case 6:
+ yy.getLogger().debug("Rule: separator (EOF) ");
+ break;
+ case 7:
+ yy.getLogger().debug("Rule: hierarchy: ", $$[$0 - 1]);
+ yy.setHierarchy($$[$0 - 1]);
+ break;
+ case 8:
+ yy.getLogger().debug("Stop NL ");
+ break;
+ case 9:
+ yy.getLogger().debug("Stop EOF ");
+ break;
+ case 10:
+ yy.getLogger().debug("Stop NL2 ");
+ break;
+ case 11:
+ yy.getLogger().debug("Stop EOF2 ");
+ break;
+ case 12:
+ yy.getLogger().debug("Rule: statement: ", $$[$0]);
+ typeof $$[$0].length === "number" ? this.$ = $$[$0] : this.$ = [$$[$0]];
+ break;
+ case 13:
+ yy.getLogger().debug("Rule: statement #2: ", $$[$0 - 1]);
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
+ break;
+ case 14:
+ yy.getLogger().debug("Rule: link: ", $$[$0], yytext);
+ this.$ = { edgeTypeStr: $$[$0], label: "" };
+ break;
+ case 15:
+ yy.getLogger().debug("Rule: LABEL link: ", $$[$0 - 3], $$[$0 - 1], $$[$0]);
+ this.$ = { edgeTypeStr: $$[$0], label: $$[$0 - 1] };
+ break;
+ case 18:
+ const num = parseInt($$[$0]);
+ const spaceId = yy.generateId();
+ this.$ = { id: spaceId, type: "space", label: "", width: num, children: [] };
+ break;
+ case 23:
+ yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr);
+ const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr);
+ this.$ = [
+ { id: $$[$0 - 2].id, label: $$[$0 - 2].label, type: $$[$0 - 2].type, directions: $$[$0 - 2].directions },
+ { id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData, arrowTypeStart: "arrow_open" },
+ { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions }
+ ];
+ break;
+ case 24:
+ yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ", $$[$0 - 1], $$[$0]);
+ this.$ = { id: $$[$0 - 1].id, label: $$[$0 - 1].label, type: yy.typeStr2Type($$[$0 - 1].typeStr), directions: $$[$0 - 1].directions, widthInColumns: parseInt($$[$0], 10) };
+ break;
+ case 25:
+ yy.getLogger().debug("Rule: nodeStatement (node) ", $$[$0]);
+ this.$ = { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions, widthInColumns: 1 };
+ break;
+ case 26:
+ yy.getLogger().debug("APA123", this ? this : "na");
+ yy.getLogger().debug("COLUMNS: ", $$[$0]);
+ this.$ = { type: "column-setting", columns: $$[$0] === "auto" ? -1 : parseInt($$[$0]) };
+ break;
+ case 27:
+ yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]);
+ yy.generateId();
+ this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] };
+ break;
+ case 28:
+ yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
+ const id = yy.generateId();
+ this.$ = { id, type: "composite", label: "", children: $$[$0 - 1] };
+ break;
+ case 29:
+ yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]);
+ this.$ = { id: $$[$0] };
+ break;
+ case 30:
+ yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", $$[$0 - 1], $$[$0]);
+ this.$ = { id: $$[$0 - 1], label: $$[$0].label, typeStr: $$[$0].typeStr, directions: $$[$0].directions };
+ break;
+ case 31:
+ yy.getLogger().debug("Rule: dirList: ", $$[$0]);
+ this.$ = [$$[$0]];
+ break;
+ case 32:
+ yy.getLogger().debug("Rule: dirList: ", $$[$0 - 1], $$[$0]);
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
+ break;
+ case 33:
+ yy.getLogger().debug("Rule: nodeShapeNLabel: ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
+ this.$ = { typeStr: $$[$0 - 2] + $$[$0], label: $$[$0 - 1] };
+ break;
+ case 34:
+ yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", $$[$0 - 3], $$[$0 - 2], " #3:", $$[$0 - 1], $$[$0]);
+ this.$ = { typeStr: $$[$0 - 3] + $$[$0], label: $$[$0 - 2], directions: $$[$0 - 1] };
+ break;
+ case 35:
+ case 36:
+ this.$ = { type: "classDef", id: $$[$0 - 1].trim(), css: $$[$0].trim() };
+ break;
+ case 37:
+ this.$ = { type: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
+ break;
+ case 38:
+ this.$ = { type: "applyStyles", id: $$[$0 - 1].trim(), stylesStr: $$[$0].trim() };
+ break;
+ }
+ },
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 8: [1, 20] }, o($V8, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: $V0, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }), o($V9, [2, 16], { 14: 22, 15: $Va, 16: $Vb }), o($V9, [2, 17]), o($V9, [2, 18]), o($V9, [2, 19]), o($V9, [2, 20]), o($V9, [2, 21]), o($V9, [2, 22]), o($Vc, [2, 25], { 27: [1, 25] }), o($V9, [2, 26]), { 19: 26, 26: 12, 32: $V4 }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, o($Vd, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, o($V8, [2, 13]), { 26: 35, 32: $V4 }, { 32: [2, 14] }, { 17: [1, 36] }, o($Vc, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: $Va, 16: $Vb, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, o($Vd, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, o($Vc, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, o($V9, [2, 28]), o($V9, [2, 35]), o($V9, [2, 36]), o($V9, [2, 37]), o($V9, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: $Ve }, { 15: [1, 50] }, o($V9, [2, 27]), o($Vd, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: $Ve, 39: [2, 31] }, { 32: [2, 15] }, o($Vd, [2, 34]), { 39: [2, 32] }],
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
+ parseError: function parseError(str, hash) {
+ if (hash.recoverable) {
+ this.trace(str);
+ } else {
+ var error = new Error(str);
+ error.hash = hash;
+ throw error;
+ }
+ },
+ parse: function parse(input) {
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
+ var args = lstack.slice.call(arguments, 1);
+ var lexer2 = Object.create(this.lexer);
+ var sharedState = { yy: {} };
+ for (var k in this.yy) {
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
+ sharedState.yy[k] = this.yy[k];
+ }
+ }
+ lexer2.setInput(input, sharedState.yy);
+ sharedState.yy.lexer = lexer2;
+ sharedState.yy.parser = this;
+ if (typeof lexer2.yylloc == "undefined") {
+ lexer2.yylloc = {};
+ }
+ var yyloc = lexer2.yylloc;
+ lstack.push(yyloc);
+ var ranges = lexer2.options && lexer2.options.ranges;
+ if (typeof sharedState.yy.parseError === "function") {
+ this.parseError = sharedState.yy.parseError;
+ } else {
+ this.parseError = Object.getPrototypeOf(this).parseError;
+ }
+ function lex() {
+ var token;
+ token = tstack.pop() || lexer2.lex() || EOF;
+ if (typeof token !== "number") {
+ if (token instanceof Array) {
+ tstack = token;
+ token = tstack.pop();
+ }
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol === null || typeof symbol == "undefined") {
+ symbol = lex();
+ }
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ var errStr = "";
+ expected = [];
+ for (p in table[state]) {
+ if (this.terminals_[p] && p > TERROR) {
+ expected.push("'" + this.terminals_[p] + "'");
+ }
+ }
+ if (lexer2.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {
+ text: lexer2.match,
+ token: this.terminals_[symbol] || symbol,
+ line: lexer2.yylineno,
+ loc: yyloc,
+ expected
+ });
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(lexer2.yytext);
+ lstack.push(lexer2.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ {
+ yyleng = lexer2.yyleng;
+ yytext = lexer2.yytext;
+ yylineno = lexer2.yylineno;
+ yyloc = lexer2.yylloc;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = {
+ first_line: lstack[lstack.length - (len || 1)].first_line,
+ last_line: lstack[lstack.length - 1].last_line,
+ first_column: lstack[lstack.length - (len || 1)].first_column,
+ last_column: lstack[lstack.length - 1].last_column
+ };
+ if (ranges) {
+ yyval._$.range = [
+ lstack[lstack.length - (len || 1)].range[0],
+ lstack[lstack.length - 1].range[1]
+ ];
+ }
+ r = this.performAction.apply(yyval, [
+ yytext,
+ yyleng,
+ yylineno,
+ sharedState.yy,
+ action[1],
+ vstack,
+ lstack
+ ].concat(args));
+ if (typeof r !== "undefined") {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+ }
+ };
+ var lexer = function() {
+ var lexer2 = {
+ EOF: 1,
+ parseError: function parseError(str, hash) {
+ if (this.yy.parser) {
+ this.yy.parser.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+ // resets the lexer, sets new input
+ setInput: function(input, yy) {
+ this.yy = yy || this.yy || {};
+ this._input = input;
+ this._more = this._backtrack = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = "";
+ this.conditionStack = ["INITIAL"];
+ this.yylloc = {
+ first_line: 1,
+ first_column: 0,
+ last_line: 1,
+ last_column: 0
+ };
+ if (this.options.ranges) {
+ this.yylloc.range = [0, 0];
+ }
+ this.offset = 0;
+ return this;
+ },
+ // consumes and returns one char from the input
+ input: function() {
+ var ch = this._input[0];
+ this.yytext += ch;
+ this.yyleng++;
+ this.offset++;
+ this.match += ch;
+ this.matched += ch;
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno++;
+ this.yylloc.last_line++;
+ } else {
+ this.yylloc.last_column++;
+ }
+ if (this.options.ranges) {
+ this.yylloc.range[1]++;
+ }
+ this._input = this._input.slice(1);
+ return ch;
+ },
+ // unshifts one char (or a string) into the input
+ unput: function(ch) {
+ var len = ch.length;
+ var lines = ch.split(/(?:\r\n?|\n)/g);
+ this._input = ch + this._input;
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
+ this.offset -= len;
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
+ this.match = this.match.substr(0, this.match.length - 1);
+ this.matched = this.matched.substr(0, this.matched.length - 1);
+ if (lines.length - 1) {
+ this.yylineno -= lines.length - 1;
+ }
+ var r = this.yylloc.range;
+ this.yylloc = {
+ first_line: this.yylloc.first_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.first_column,
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
+ };
+ if (this.options.ranges) {
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
+ }
+ this.yyleng = this.yytext.length;
+ return this;
+ },
+ // When called from action, caches matched text and appends it on next action
+ more: function() {
+ this._more = true;
+ return this;
+ },
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
+ reject: function() {
+ if (this.options.backtrack_lexer) {
+ this._backtrack = true;
+ } else {
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ }
+ return this;
+ },
+ // retain first n characters of the match
+ less: function(n) {
+ this.unput(this.match.slice(n));
+ },
+ // displays already matched input, i.e. for error messages
+ pastInput: function() {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
+ },
+ // displays upcoming input, i.e. for error messages
+ upcomingInput: function() {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20 - next.length);
+ }
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
+ },
+ // displays the character position where the lexing error occurred, i.e. for error messages
+ showPosition: function() {
+ var pre = this.pastInput();
+ var c = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c + "^";
+ },
+ // test the lexed token: return FALSE when not a match, otherwise return token
+ test_match: function(match, indexed_rule) {
+ var token, lines, backup;
+ if (this.options.backtrack_lexer) {
+ backup = {
+ yylineno: this.yylineno,
+ yylloc: {
+ first_line: this.yylloc.first_line,
+ last_line: this.last_line,
+ first_column: this.yylloc.first_column,
+ last_column: this.yylloc.last_column
+ },
+ yytext: this.yytext,
+ match: this.match,
+ matches: this.matches,
+ matched: this.matched,
+ yyleng: this.yyleng,
+ offset: this.offset,
+ _more: this._more,
+ _input: this._input,
+ yy: this.yy,
+ conditionStack: this.conditionStack.slice(0),
+ done: this.done
+ };
+ if (this.options.ranges) {
+ backup.yylloc.range = this.yylloc.range.slice(0);
+ }
+ }
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno += lines.length;
+ }
+ this.yylloc = {
+ first_line: this.yylloc.last_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
+ };
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ if (this.options.ranges) {
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
+ }
+ this._more = false;
+ this._backtrack = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
+ if (this.done && this._input) {
+ this.done = false;
+ }
+ if (token) {
+ return token;
+ } else if (this._backtrack) {
+ for (var k in backup) {
+ this[k] = backup[k];
+ }
+ return false;
+ }
+ return false;
+ },
+ // return next match in input
+ next: function() {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) {
+ this.done = true;
+ }
+ var token, match, tempMatch, index;
+ if (!this._more) {
+ this.yytext = "";
+ this.match = "";
+ }
+ var rules = this._currentRules();
+ for (var i = 0; i < rules.length; i++) {
+ tempMatch = this._input.match(this.rules[rules[i]]);
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
+ match = tempMatch;
+ index = i;
+ if (this.options.backtrack_lexer) {
+ token = this.test_match(tempMatch, rules[i]);
+ if (token !== false) {
+ return token;
+ } else if (this._backtrack) {
+ match = false;
+ continue;
+ } else {
+ return false;
+ }
+ } else if (!this.options.flex) {
+ break;
+ }
+ }
+ }
+ if (match) {
+ token = this.test_match(match, rules[index]);
+ if (token !== false) {
+ return token;
+ }
+ return false;
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ }
+ },
+ // return next match that has a token
+ lex: function lex() {
+ var r = this.next();
+ if (r) {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
+ begin: function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+ // pop the previously active lexer condition state off the condition stack
+ popState: function popState() {
+ var n = this.conditionStack.length - 1;
+ if (n > 0) {
+ return this.conditionStack.pop();
+ } else {
+ return this.conditionStack[0];
+ }
+ },
+ // produce the lexer rule set which is active for the currently active lexer condition state
+ _currentRules: function _currentRules() {
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
+ } else {
+ return this.conditions["INITIAL"].rules;
+ }
+ },
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
+ topState: function topState(n) {
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
+ if (n >= 0) {
+ return this.conditionStack[n];
+ } else {
+ return "INITIAL";
+ }
+ },
+ // alias for begin(condition)
+ pushState: function pushState(condition) {
+ this.begin(condition);
+ },
+ // return the number of states currently on the stack
+ stateStackSize: function stateStackSize() {
+ return this.conditionStack.length;
+ },
+ options: {},
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
+ switch ($avoiding_name_collisions) {
+ case 0:
+ return 10;
+ case 1:
+ yy.getLogger().debug("Found space-block");
+ return 31;
+ case 2:
+ yy.getLogger().debug("Found nl-block");
+ return 31;
+ case 3:
+ yy.getLogger().debug("Found space-block");
+ return 29;
+ case 4:
+ yy.getLogger().debug(".", yy_.yytext);
+ break;
+ case 5:
+ yy.getLogger().debug("_", yy_.yytext);
+ break;
+ case 6:
+ return 5;
+ case 7:
+ yy_.yytext = -1;
+ return 28;
+ case 8:
+ yy_.yytext = yy_.yytext.replace(/columns\s+/, "");
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
+ return 28;
+ case 9:
+ this.pushState("md_string");
+ break;
+ case 10:
+ return "MD_STR";
+ case 11:
+ this.popState();
+ break;
+ case 12:
+ this.pushState("string");
+ break;
+ case 13:
+ yy.getLogger().debug("LEX: POPPING STR:", yy_.yytext);
+ this.popState();
+ break;
+ case 14:
+ yy.getLogger().debug("LEX: STR end:", yy_.yytext);
+ return "STR";
+ case 15:
+ yy_.yytext = yy_.yytext.replace(/space\:/, "");
+ yy.getLogger().debug("SPACE NUM (LEX)", yy_.yytext);
+ return 21;
+ case 16:
+ yy_.yytext = "1";
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
+ return 21;
+ case 17:
+ return 43;
+ case 18:
+ return "LINKSTYLE";
+ case 19:
+ return "INTERPOLATE";
+ case 20:
+ this.pushState("CLASSDEF");
+ return 40;
+ case 21:
+ this.popState();
+ this.pushState("CLASSDEFID");
+ return "DEFAULT_CLASSDEF_ID";
+ case 22:
+ this.popState();
+ this.pushState("CLASSDEFID");
+ return 41;
+ case 23:
+ this.popState();
+ return 42;
+ case 24:
+ this.pushState("CLASS");
+ return 44;
+ case 25:
+ this.popState();
+ this.pushState("CLASS_STYLE");
+ return 45;
+ case 26:
+ this.popState();
+ return 46;
+ case 27:
+ this.pushState("STYLE_STMNT");
+ return 47;
+ case 28:
+ this.popState();
+ this.pushState("STYLE_DEFINITION");
+ return 48;
+ case 29:
+ this.popState();
+ return 49;
+ case 30:
+ this.pushState("acc_title");
+ return "acc_title";
+ case 31:
+ this.popState();
+ return "acc_title_value";
+ case 32:
+ this.pushState("acc_descr");
+ return "acc_descr";
+ case 33:
+ this.popState();
+ return "acc_descr_value";
+ case 34:
+ this.pushState("acc_descr_multiline");
+ break;
+ case 35:
+ this.popState();
+ break;
+ case 36:
+ return "acc_descr_multiline_value";
+ case 37:
+ return 30;
+ case 38:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 39:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 40:
+ this.popState();
+ yy.getLogger().debug("Lex: ))");
+ return "NODE_DEND";
+ case 41:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 42:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 43:
+ this.popState();
+ yy.getLogger().debug("Lex: (-");
+ return "NODE_DEND";
+ case 44:
+ this.popState();
+ yy.getLogger().debug("Lex: -)");
+ return "NODE_DEND";
+ case 45:
+ this.popState();
+ yy.getLogger().debug("Lex: ((");
+ return "NODE_DEND";
+ case 46:
+ this.popState();
+ yy.getLogger().debug("Lex: ]]");
+ return "NODE_DEND";
+ case 47:
+ this.popState();
+ yy.getLogger().debug("Lex: (");
+ return "NODE_DEND";
+ case 48:
+ this.popState();
+ yy.getLogger().debug("Lex: ])");
+ return "NODE_DEND";
+ case 49:
+ this.popState();
+ yy.getLogger().debug("Lex: /]");
+ return "NODE_DEND";
+ case 50:
+ this.popState();
+ yy.getLogger().debug("Lex: /]");
+ return "NODE_DEND";
+ case 51:
+ this.popState();
+ yy.getLogger().debug("Lex: )]");
+ return "NODE_DEND";
+ case 52:
+ this.popState();
+ yy.getLogger().debug("Lex: )");
+ return "NODE_DEND";
+ case 53:
+ this.popState();
+ yy.getLogger().debug("Lex: ]>");
+ return "NODE_DEND";
+ case 54:
+ this.popState();
+ yy.getLogger().debug("Lex: ]");
+ return "NODE_DEND";
+ case 55:
+ yy.getLogger().debug("Lexa: -)");
+ this.pushState("NODE");
+ return 36;
+ case 56:
+ yy.getLogger().debug("Lexa: (-");
+ this.pushState("NODE");
+ return 36;
+ case 57:
+ yy.getLogger().debug("Lexa: ))");
+ this.pushState("NODE");
+ return 36;
+ case 58:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 59:
+ yy.getLogger().debug("Lex: (((");
+ this.pushState("NODE");
+ return 36;
+ case 60:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 61:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 62:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 63:
+ yy.getLogger().debug("Lexc: >");
+ this.pushState("NODE");
+ return 36;
+ case 64:
+ yy.getLogger().debug("Lexa: ([");
+ this.pushState("NODE");
+ return 36;
+ case 65:
+ yy.getLogger().debug("Lexa: )");
+ this.pushState("NODE");
+ return 36;
+ case 66:
+ this.pushState("NODE");
+ return 36;
+ case 67:
+ this.pushState("NODE");
+ return 36;
+ case 68:
+ this.pushState("NODE");
+ return 36;
+ case 69:
+ this.pushState("NODE");
+ return 36;
+ case 70:
+ this.pushState("NODE");
+ return 36;
+ case 71:
+ this.pushState("NODE");
+ return 36;
+ case 72:
+ this.pushState("NODE");
+ return 36;
+ case 73:
+ yy.getLogger().debug("Lexa: [");
+ this.pushState("NODE");
+ return 36;
+ case 74:
+ this.pushState("BLOCK_ARROW");
+ yy.getLogger().debug("LEX ARR START");
+ return 38;
+ case 75:
+ yy.getLogger().debug("Lex: NODE_ID", yy_.yytext);
+ return 32;
+ case 76:
+ yy.getLogger().debug("Lex: EOF", yy_.yytext);
+ return 8;
+ case 77:
+ this.pushState("md_string");
+ break;
+ case 78:
+ this.pushState("md_string");
+ break;
+ case 79:
+ return "NODE_DESCR";
+ case 80:
+ this.popState();
+ break;
+ case 81:
+ yy.getLogger().debug("Lex: Starting string");
+ this.pushState("string");
+ break;
+ case 82:
+ yy.getLogger().debug("LEX ARR: Starting string");
+ this.pushState("string");
+ break;
+ case 83:
+ yy.getLogger().debug("LEX: NODE_DESCR:", yy_.yytext);
+ return "NODE_DESCR";
+ case 84:
+ yy.getLogger().debug("LEX POPPING");
+ this.popState();
+ break;
+ case 85:
+ yy.getLogger().debug("Lex: =>BAE");
+ this.pushState("ARROW_DIR");
+ break;
+ case 86:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (right): dir:", yy_.yytext);
+ return "DIR";
+ case 87:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (left):", yy_.yytext);
+ return "DIR";
+ case 88:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (x):", yy_.yytext);
+ return "DIR";
+ case 89:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (y):", yy_.yytext);
+ return "DIR";
+ case 90:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (up):", yy_.yytext);
+ return "DIR";
+ case 91:
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
+ yy.getLogger().debug("Lex (down):", yy_.yytext);
+ return "DIR";
+ case 92:
+ yy_.yytext = "]>";
+ yy.getLogger().debug("Lex (ARROW_DIR end):", yy_.yytext);
+ this.popState();
+ this.popState();
+ return "BLOCK_ARROW_END";
+ case 93:
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
+ return 15;
+ case 94:
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 95:
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 96:
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 97:
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
+ this.pushState("LLABEL");
+ return 16;
+ case 98:
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
+ this.pushState("LLABEL");
+ return 16;
+ case 99:
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
+ this.pushState("LLABEL");
+ return 16;
+ case 100:
+ this.pushState("md_string");
+ break;
+ case 101:
+ yy.getLogger().debug("Lex: Starting string");
+ this.pushState("string");
+ return "LINK_LABEL";
+ case 102:
+ this.popState();
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
+ return 15;
+ case 103:
+ this.popState();
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 104:
+ this.popState();
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
+ return 15;
+ case 105:
+ yy.getLogger().debug("Lex: COLON", yy_.yytext);
+ yy_.yytext = yy_.yytext.slice(1);
+ return 27;
+ }
+ },
+ rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
+ conditions: { "STYLE_DEFINITION": { "rules": [29], "inclusive": false }, "STYLE_STMNT": { "rules": [28], "inclusive": false }, "CLASSDEFID": { "rules": [23], "inclusive": false }, "CLASSDEF": { "rules": [21, 22], "inclusive": false }, "CLASS_STYLE": { "rules": [26], "inclusive": false }, "CLASS": { "rules": [25], "inclusive": false }, "LLABEL": { "rules": [100, 101, 102, 103, 104], "inclusive": false }, "ARROW_DIR": { "rules": [86, 87, 88, 89, 90, 91, 92], "inclusive": false }, "BLOCK_ARROW": { "rules": [77, 82, 85], "inclusive": false }, "NODE": { "rules": [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], "inclusive": false }, "md_string": { "rules": [10, 11, 79, 80], "inclusive": false }, "space": { "rules": [], "inclusive": false }, "string": { "rules": [13, 14, 83, 84], "inclusive": false }, "acc_descr_multiline": { "rules": [35, 36], "inclusive": false }, "acc_descr": { "rules": [33], "inclusive": false }, "acc_title": { "rules": [31], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], "inclusive": true } }
+ };
+ return lexer2;
+ }();
+ parser2.lexer = lexer;
+ function Parser() {
+ this.yy = {};
+ }
+ Parser.prototype = parser2;
+ parser2.Parser = Parser;
+ return new Parser();
+}();
+parser.parser = parser;
+const parser$1 = parser;
+let blockDatabase = {};
+let edgeList = [];
+let edgeCount = {};
+const COLOR_KEYWORD = "color";
+const FILL_KEYWORD = "fill";
+const BG_FILL = "bgFill";
+const STYLECLASS_SEP = ",";
+const config = getConfig();
+let classes = {};
+const sanitizeText = (txt) => common.sanitizeText(txt, config);
+const addStyleClass = function(id, styleAttributes = "") {
+ if (classes[id] === void 0) {
+ classes[id] = { id, styles: [], textStyles: [] };
+ }
+ const foundClass = classes[id];
+ if (styleAttributes !== void 0 && styleAttributes !== null) {
+ styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => {
+ const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
+ if (attrib.match(COLOR_KEYWORD)) {
+ const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
+ const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
+ foundClass.textStyles.push(newStyle2);
+ }
+ foundClass.styles.push(fixedAttrib);
+ });
+ }
+};
+const addStyle2Node = function(id, styles = "") {
+ const foundBlock = blockDatabase[id];
+ if (styles !== void 0 && styles !== null) {
+ foundBlock.styles = styles.split(STYLECLASS_SEP);
+ }
+};
+const setCssClass = function(itemIds, cssClassName) {
+ itemIds.split(",").forEach(function(id) {
+ let foundBlock = blockDatabase[id];
+ if (foundBlock === void 0) {
+ const trimmedId = id.trim();
+ blockDatabase[trimmedId] = { id: trimmedId, type: "na", children: [] };
+ foundBlock = blockDatabase[trimmedId];
+ }
+ if (!foundBlock.classes) {
+ foundBlock.classes = [];
+ }
+ foundBlock.classes.push(cssClassName);
+ });
+};
+const populateBlockDatabase = (_blockList, parent) => {
+ const blockList = _blockList.flat();
+ const children = [];
+ for (const block of blockList) {
+ if (block.label) {
+ block.label = sanitizeText(block.label);
+ }
+ if (block.type === "classDef") {
+ addStyleClass(block.id, block.css);
+ continue;
+ }
+ if (block.type === "applyClass") {
+ setCssClass(block.id, (block == null ? void 0 : block.styleClass) || "");
+ continue;
+ }
+ if (block.type === "applyStyles") {
+ if (block == null ? void 0 : block.stylesStr) {
+ addStyle2Node(block.id, block == null ? void 0 : block.stylesStr);
+ }
+ continue;
+ }
+ if (block.type === "column-setting") {
+ parent.columns = block.columns || -1;
+ } else if (block.type === "edge") {
+ if (edgeCount[block.id]) {
+ edgeCount[block.id]++;
+ } else {
+ edgeCount[block.id] = 1;
+ }
+ block.id = edgeCount[block.id] + "-" + block.id;
+ edgeList.push(block);
+ } else {
+ if (!block.label) {
+ if (block.type === "composite") {
+ block.label = "";
+ } else {
+ block.label = block.id;
+ }
+ }
+ const newBlock = !blockDatabase[block.id];
+ if (newBlock) {
+ blockDatabase[block.id] = block;
+ } else {
+ if (block.type !== "na") {
+ blockDatabase[block.id].type = block.type;
+ }
+ if (block.label !== block.id) {
+ blockDatabase[block.id].label = block.label;
+ }
+ }
+ if (block.children) {
+ populateBlockDatabase(block.children, block);
+ }
+ if (block.type === "space") {
+ const w = block.width || 1;
+ for (let j = 0; j < w; j++) {
+ const newBlock2 = clone(block);
+ newBlock2.id = newBlock2.id + "-" + j;
+ blockDatabase[newBlock2.id] = newBlock2;
+ children.push(newBlock2);
+ }
+ } else if (newBlock) {
+ children.push(block);
+ }
+ }
+ }
+ parent.children = children;
+};
+let blocks = [];
+let rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
+const clear = () => {
+ log.debug("Clear called");
+ clear$1();
+ rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
+ blockDatabase = { root: rootBlock };
+ blocks = [];
+ classes = {};
+ edgeList = [];
+ edgeCount = {};
+};
+function typeStr2Type(typeStr) {
+ log.debug("typeStr2Type", typeStr);
+ switch (typeStr) {
+ case "[]":
+ return "square";
+ case "()":
+ log.debug("we have a round");
+ return "round";
+ case "(())":
+ return "circle";
+ case ">]":
+ return "rect_left_inv_arrow";
+ case "{}":
+ return "diamond";
+ case "{{}}":
+ return "hexagon";
+ case "([])":
+ return "stadium";
+ case "[[]]":
+ return "subroutine";
+ case "[()]":
+ return "cylinder";
+ case "((()))":
+ return "doublecircle";
+ case "[//]":
+ return "lean_right";
+ case "[\\\\]":
+ return "lean_left";
+ case "[/\\]":
+ return "trapezoid";
+ case "[\\/]":
+ return "inv_trapezoid";
+ case "<[]>":
+ return "block_arrow";
+ default:
+ return "na";
+ }
+}
+function edgeTypeStr2Type(typeStr) {
+ log.debug("typeStr2Type", typeStr);
+ switch (typeStr) {
+ case "==":
+ return "thick";
+ default:
+ return "normal";
+ }
+}
+function edgeStrToEdgeData(typeStr) {
+ switch (typeStr.trim()) {
+ case "--x":
+ return "arrow_cross";
+ case "--o":
+ return "arrow_circle";
+ default:
+ return "arrow_point";
+ }
+}
+let cnt = 0;
+const generateId = () => {
+ cnt++;
+ return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
+};
+const setHierarchy = (block) => {
+ rootBlock.children = block;
+ populateBlockDatabase(block, rootBlock);
+ blocks = rootBlock.children;
+};
+const getColumns = (blockId) => {
+ const block = blockDatabase[blockId];
+ if (!block) {
+ return -1;
+ }
+ if (block.columns) {
+ return block.columns;
+ }
+ if (!block.children) {
+ return -1;
+ }
+ return block.children.length;
+};
+const getBlocksFlat = () => {
+ return [...Object.values(blockDatabase)];
+};
+const getBlocks = () => {
+ return blocks || [];
+};
+const getEdges = () => {
+ return edgeList;
+};
+const getBlock = (id) => {
+ return blockDatabase[id];
+};
+const setBlock = (block) => {
+ blockDatabase[block.id] = block;
+};
+const getLogger = () => console;
+const getClasses$1 = function() {
+ return classes;
+};
+const db = {
+ getConfig: () => getConfig$1().block,
+ typeStr2Type,
+ edgeTypeStr2Type,
+ edgeStrToEdgeData,
+ getLogger,
+ getBlocksFlat,
+ getBlocks,
+ getEdges,
+ setHierarchy,
+ getBlock,
+ setBlock,
+ getColumns,
+ getClasses: getClasses$1,
+ clear,
+ generateId
+};
+const db$1 = db;
+const fade = (color, opacity) => {
+ const channel$1 = channel;
+ const r = channel$1(color, "r");
+ const g = channel$1(color, "g");
+ const b = channel$1(color, "b");
+ return rgba(r, g, b, opacity);
+};
+const getStyles = (options) => `.label {
+ font-family: ${options.fontFamily};
+ color: ${options.nodeTextColor || options.textColor};
+ }
+ .cluster-label text {
+ fill: ${options.titleColor};
+ }
+ .cluster-label span,p {
+ color: ${options.titleColor};
+ }
+
+
+
+ .label text,span,p {
+ fill: ${options.nodeTextColor || options.textColor};
+ color: ${options.nodeTextColor || options.textColor};
+ }
+
+ .node rect,
+ .node circle,
+ .node ellipse,
+ .node polygon,
+ .node path {
+ fill: ${options.mainBkg};
+ stroke: ${options.nodeBorder};
+ stroke-width: 1px;
+ }
+ .flowchart-label text {
+ text-anchor: middle;
+ }
+ // .flowchart-label .text-outer-tspan {
+ // text-anchor: middle;
+ // }
+ // .flowchart-label .text-inner-tspan {
+ // text-anchor: start;
+ // }
+
+ .node .label {
+ text-align: center;
+ }
+ .node.clickable {
+ cursor: pointer;
+ }
+
+ .arrowheadPath {
+ fill: ${options.arrowheadColor};
+ }
+
+ .edgePath .path {
+ stroke: ${options.lineColor};
+ stroke-width: 2.0px;
+ }
+
+ .flowchart-link {
+ stroke: ${options.lineColor};
+ fill: none;
+ }
+
+ .edgeLabel {
+ background-color: ${options.edgeLabelBackground};
+ rect {
+ opacity: 0.5;
+ background-color: ${options.edgeLabelBackground};
+ fill: ${options.edgeLabelBackground};
+ }
+ text-align: center;
+ }
+
+ /* For html labels only */
+ .labelBkg {
+ background-color: ${fade(options.edgeLabelBackground, 0.5)};
+ // background-color:
+ }
+
+ .node .cluster {
+ // fill: ${fade(options.mainBkg, 0.5)};
+ fill: ${fade(options.clusterBkg, 0.5)};
+ stroke: ${fade(options.clusterBorder, 0.2)};
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
+ stroke-width: 1px;
+ }
+
+ .cluster text {
+ fill: ${options.titleColor};
+ }
+
+ .cluster span,p {
+ color: ${options.titleColor};
+ }
+ /* .cluster div {
+ color: ${options.titleColor};
+ } */
+
+ div.mermaidTooltip {
+ position: absolute;
+ text-align: center;
+ max-width: 200px;
+ padding: 2px;
+ font-family: ${options.fontFamily};
+ font-size: 12px;
+ background: ${options.tertiaryColor};
+ border: 1px solid ${options.border2};
+ border-radius: 2px;
+ pointer-events: none;
+ z-index: 100;
+ }
+
+ .flowchartTitleText {
+ text-anchor: middle;
+ font-size: 18px;
+ fill: ${options.textColor};
+ }
+`;
+const flowStyles = getStyles;
+function getNodeFromBlock(block, db2, positioned = false) {
+ var _a2, _b2, _c;
+ const vertex = block;
+ let classStr = "default";
+ if ((((_a2 = vertex == null ? void 0 : vertex.classes) == null ? void 0 : _a2.length) || 0) > 0) {
+ classStr = ((vertex == null ? void 0 : vertex.classes) || []).join(" ");
+ }
+ classStr = classStr + " flowchart-label";
+ let radius = 0;
+ let shape = "";
+ let padding2;
+ switch (vertex.type) {
+ case "round":
+ radius = 5;
+ shape = "rect";
+ break;
+ case "composite":
+ radius = 0;
+ shape = "composite";
+ padding2 = 0;
+ break;
+ case "square":
+ shape = "rect";
+ break;
+ case "diamond":
+ shape = "question";
+ break;
+ case "hexagon":
+ shape = "hexagon";
+ break;
+ case "block_arrow":
+ shape = "block_arrow";
+ break;
+ case "odd":
+ shape = "rect_left_inv_arrow";
+ break;
+ case "lean_right":
+ shape = "lean_right";
+ break;
+ case "lean_left":
+ shape = "lean_left";
+ break;
+ case "trapezoid":
+ shape = "trapezoid";
+ break;
+ case "inv_trapezoid":
+ shape = "inv_trapezoid";
+ break;
+ case "rect_left_inv_arrow":
+ shape = "rect_left_inv_arrow";
+ break;
+ case "circle":
+ shape = "circle";
+ break;
+ case "ellipse":
+ shape = "ellipse";
+ break;
+ case "stadium":
+ shape = "stadium";
+ break;
+ case "subroutine":
+ shape = "subroutine";
+ break;
+ case "cylinder":
+ shape = "cylinder";
+ break;
+ case "group":
+ shape = "rect";
+ break;
+ case "doublecircle":
+ shape = "doublecircle";
+ break;
+ default:
+ shape = "rect";
+ }
+ const styles = getStylesFromArray((vertex == null ? void 0 : vertex.styles) || []);
+ const vertexText = vertex.label;
+ const bounds = vertex.size || { width: 0, height: 0, x: 0, y: 0 };
+ const node = {
+ labelStyle: styles.labelStyle,
+ shape,
+ labelText: vertexText,
+ rx: radius,
+ ry: radius,
+ class: classStr,
+ style: styles.style,
+ id: vertex.id,
+ directions: vertex.directions,
+ width: bounds.width,
+ height: bounds.height,
+ x: bounds.x,
+ y: bounds.y,
+ positioned,
+ intersect: void 0,
+ type: vertex.type,
+ padding: padding2 ?? (((_c = (_b2 = getConfig$1()) == null ? void 0 : _b2.block) == null ? void 0 : _c.padding) || 0)
+ };
+ return node;
+}
+async function calculateBlockSize(elem, block, db2) {
+ const node = getNodeFromBlock(block, db2, false);
+ if (node.type === "group") {
+ return;
+ }
+ const nodeEl = await insertNode(elem, node);
+ const boundingBox = nodeEl.node().getBBox();
+ const obj = db2.getBlock(node.id);
+ obj.size = { width: boundingBox.width, height: boundingBox.height, x: 0, y: 0, node: nodeEl };
+ db2.setBlock(obj);
+ nodeEl.remove();
+}
+async function insertBlockPositioned(elem, block, db2) {
+ const node = getNodeFromBlock(block, db2, true);
+ const obj = db2.getBlock(node.id);
+ if (obj.type !== "space") {
+ await insertNode(elem, node);
+ block.intersect = node == null ? void 0 : node.intersect;
+ positionNode(node);
+ }
+}
+async function performOperations(elem, blocks2, db2, operation) {
+ for (const block of blocks2) {
+ await operation(elem, block, db2);
+ if (block.children) {
+ await performOperations(elem, block.children, db2, operation);
+ }
+ }
+}
+async function calculateBlockSizes(elem, blocks2, db2) {
+ await performOperations(elem, blocks2, db2, calculateBlockSize);
+}
+async function insertBlocks(elem, blocks2, db2) {
+ await performOperations(elem, blocks2, db2, insertBlockPositioned);
+}
+async function insertEdges(elem, edges, blocks2, db2, id) {
+ const g = new Graph({
+ multigraph: true,
+ compound: true
+ });
+ g.setGraph({
+ rankdir: "TB",
+ nodesep: 10,
+ ranksep: 10,
+ marginx: 8,
+ marginy: 8
+ });
+ for (const block of blocks2) {
+ if (block.size) {
+ g.setNode(block.id, {
+ width: block.size.width,
+ height: block.size.height,
+ intersect: block.intersect
+ });
+ }
+ }
+ for (const edge of edges) {
+ if (edge.start && edge.end) {
+ const startBlock = db2.getBlock(edge.start);
+ const endBlock = db2.getBlock(edge.end);
+ if ((startBlock == null ? void 0 : startBlock.size) && (endBlock == null ? void 0 : endBlock.size)) {
+ const start = startBlock.size;
+ const end = endBlock.size;
+ const points = [
+ { x: start.x, y: start.y },
+ { x: start.x + (end.x - start.x) / 2, y: start.y + (end.y - start.y) / 2 },
+ { x: end.x, y: end.y }
+ ];
+ await insertEdge(
+ elem,
+ { v: edge.start, w: edge.end, name: edge.id },
+ {
+ ...edge,
+ arrowTypeEnd: edge.arrowTypeEnd,
+ arrowTypeStart: edge.arrowTypeStart,
+ points,
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
+ },
+ void 0,
+ "block",
+ g,
+ id
+ );
+ if (edge.label) {
+ await insertEdgeLabel(elem, {
+ ...edge,
+ label: edge.label,
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
+ arrowTypeEnd: edge.arrowTypeEnd,
+ arrowTypeStart: edge.arrowTypeStart,
+ points,
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
+ });
+ await positionEdgeLabel(
+ { ...edge, x: points[1].x, y: points[1].y },
+ {
+ originalPath: points
+ }
+ );
+ }
+ }
+ }
+ }
+}
+const padding = ((_b = (_a = getConfig()) == null ? void 0 : _a.block) == null ? void 0 : _b.padding) || 8;
+function calculateBlockPosition(columns, position) {
+ if (columns === 0 || !Number.isInteger(columns)) {
+ throw new Error("Columns must be an integer !== 0.");
+ }
+ if (position < 0 || !Number.isInteger(position)) {
+ throw new Error("Position must be a non-negative integer." + position);
+ }
+ if (columns < 0) {
+ return { px: position, py: 0 };
+ }
+ if (columns === 1) {
+ return { px: 0, py: position };
+ }
+ const px = position % columns;
+ const py = Math.floor(position / columns);
+ return { px, py };
+}
+const getMaxChildSize = (block) => {
+ let maxWidth = 0;
+ let maxHeight = 0;
+ for (const child of block.children) {
+ const { width, height, x, y } = child.size || { width: 0, height: 0, x: 0, y: 0 };
+ log.debug(
+ "getMaxChildSize abc95 child:",
+ child.id,
+ "width:",
+ width,
+ "height:",
+ height,
+ "x:",
+ x,
+ "y:",
+ y,
+ child.type
+ );
+ if (child.type === "space") {
+ continue;
+ }
+ if (width > maxWidth) {
+ maxWidth = width / (block.widthInColumns || 1);
+ }
+ if (height > maxHeight) {
+ maxHeight = height;
+ }
+ }
+ return { width: maxWidth, height: maxHeight };
+};
+function setBlockSizes(block, db2, siblingWidth = 0, siblingHeight = 0) {
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
+ log.debug(
+ "setBlockSizes abc95 (start)",
+ block.id,
+ (_a2 = block == null ? void 0 : block.size) == null ? void 0 : _a2.x,
+ "block width =",
+ block == null ? void 0 : block.size,
+ "sieblingWidth",
+ siblingWidth
+ );
+ if (!((_b2 = block == null ? void 0 : block.size) == null ? void 0 : _b2.width)) {
+ block.size = {
+ width: siblingWidth,
+ height: siblingHeight,
+ x: 0,
+ y: 0
+ };
+ }
+ let maxWidth = 0;
+ let maxHeight = 0;
+ if (((_c = block.children) == null ? void 0 : _c.length) > 0) {
+ for (const child of block.children) {
+ setBlockSizes(child, db2);
+ }
+ const childSize = getMaxChildSize(block);
+ maxWidth = childSize.width;
+ maxHeight = childSize.height;
+ log.debug("setBlockSizes abc95 maxWidth of", block.id, ":s children is ", maxWidth, maxHeight);
+ for (const child of block.children) {
+ if (child.size) {
+ log.debug(
+ `abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${child.size}`
+ );
+ child.size.width = maxWidth * (child.widthInColumns || 1) + padding * ((child.widthInColumns || 1) - 1);
+ child.size.height = maxHeight;
+ child.size.x = 0;
+ child.size.y = 0;
+ log.debug(
+ `abc95 updating size of ${block.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}`
+ );
+ }
+ }
+ for (const child of block.children) {
+ setBlockSizes(child, db2, maxWidth, maxHeight);
+ }
+ const columns = block.columns || -1;
+ let numItems = 0;
+ for (const child of block.children) {
+ numItems += child.widthInColumns || 1;
+ }
+ let xSize = block.children.length;
+ if (columns > 0 && columns < numItems) {
+ xSize = columns;
+ }
+ block.widthInColumns || 1;
+ const ySize = Math.ceil(numItems / xSize);
+ let width = xSize * (maxWidth + padding) + padding;
+ let height = ySize * (maxHeight + padding) + padding;
+ if (width < siblingWidth) {
+ log.debug(
+ `Detected to small siebling: abc95 ${block.id} sieblingWidth ${siblingWidth} sieblingHeight ${siblingHeight} width ${width}`
+ );
+ width = siblingWidth;
+ height = siblingHeight;
+ const childWidth = (siblingWidth - xSize * padding - padding) / xSize;
+ const childHeight = (siblingHeight - ySize * padding - padding) / ySize;
+ log.debug("Size indata abc88", block.id, "childWidth", childWidth, "maxWidth", maxWidth);
+ log.debug("Size indata abc88", block.id, "childHeight", childHeight, "maxHeight", maxHeight);
+ log.debug("Size indata abc88 xSize", xSize, "padding", padding);
+ for (const child of block.children) {
+ if (child.size) {
+ child.size.width = childWidth;
+ child.size.height = childHeight;
+ child.size.x = 0;
+ child.size.y = 0;
+ }
+ }
+ }
+ log.debug(
+ `abc95 (finale calc) ${block.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block.children.length} width=${Math.max(width, ((_d = block.size) == null ? void 0 : _d.width) || 0)}`
+ );
+ if (width < (((_e = block == null ? void 0 : block.size) == null ? void 0 : _e.width) || 0)) {
+ width = ((_f = block == null ? void 0 : block.size) == null ? void 0 : _f.width) || 0;
+ const num = columns > 0 ? Math.min(block.children.length, columns) : block.children.length;
+ if (num > 0) {
+ const childWidth = (width - num * padding - padding) / num;
+ log.debug("abc95 (growing to fit) width", block.id, width, (_g = block.size) == null ? void 0 : _g.width, childWidth);
+ for (const child of block.children) {
+ if (child.size) {
+ child.size.width = childWidth;
+ }
+ }
+ }
+ }
+ block.size = {
+ width,
+ height,
+ x: 0,
+ y: 0
+ };
+ }
+ log.debug(
+ "setBlockSizes abc94 (done)",
+ block.id,
+ (_h = block == null ? void 0 : block.size) == null ? void 0 : _h.x,
+ (_i = block == null ? void 0 : block.size) == null ? void 0 : _i.width,
+ (_j = block == null ? void 0 : block.size) == null ? void 0 : _j.y,
+ (_k = block == null ? void 0 : block.size) == null ? void 0 : _k.height
+ );
+}
+function layoutBlocks(block, db2) {
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
+ log.debug(
+ `abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${(_a2 = block == null ? void 0 : block.size) == null ? void 0 : _a2.x} y: ${(_b2 = block == null ? void 0 : block.size) == null ? void 0 : _b2.y} width: ${(_c = block == null ? void 0 : block.size) == null ? void 0 : _c.width}`
+ );
+ const columns = block.columns || -1;
+ log.debug("layoutBlocks columns abc95", block.id, "=>", columns, block);
+ if (block.children && // find max width of children
+ block.children.length > 0) {
+ const width = ((_e = (_d = block == null ? void 0 : block.children[0]) == null ? void 0 : _d.size) == null ? void 0 : _e.width) || 0;
+ const widthOfChildren = block.children.length * width + (block.children.length - 1) * padding;
+ log.debug("widthOfChildren 88", widthOfChildren, "posX");
+ let columnPos = 0;
+ log.debug("abc91 block?.size?.x", block.id, (_f = block == null ? void 0 : block.size) == null ? void 0 : _f.x);
+ let startingPosX = ((_g = block == null ? void 0 : block.size) == null ? void 0 : _g.x) ? ((_h = block == null ? void 0 : block.size) == null ? void 0 : _h.x) + (-((_i = block == null ? void 0 : block.size) == null ? void 0 : _i.width) / 2 || 0) : -padding;
+ let rowPos = 0;
+ for (const child of block.children) {
+ const parent = block;
+ if (!child.size) {
+ continue;
+ }
+ const { width: width2, height } = child.size;
+ const { px, py } = calculateBlockPosition(columns, columnPos);
+ if (py != rowPos) {
+ rowPos = py;
+ startingPosX = ((_j = block == null ? void 0 : block.size) == null ? void 0 : _j.x) ? ((_k = block == null ? void 0 : block.size) == null ? void 0 : _k.x) + (-((_l = block == null ? void 0 : block.size) == null ? void 0 : _l.width) / 2 || 0) : -padding;
+ log.debug("New row in layout for block", block.id, " and child ", child.id, rowPos);
+ }
+ log.debug(
+ `abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${(_m = parent == null ? void 0 : parent.size) == null ? void 0 : _m.x},${(_n = parent == null ? void 0 : parent.size) == null ? void 0 : _n.y}) parent: ${parent.id} width: ${width2}${padding}`
+ );
+ if (parent.size) {
+ const halfWidth = width2 / 2;
+ child.size.x = startingPosX + padding + halfWidth;
+ log.debug(
+ `abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width2} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width2 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}`
+ );
+ startingPosX = child.size.x + halfWidth;
+ child.size.y = parent.size.y - parent.size.height / 2 + py * (height + padding) + height / 2 + padding;
+ log.debug(
+ `abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width2 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}`
+ );
+ }
+ if (child.children) {
+ layoutBlocks(child);
+ }
+ columnPos += (child == null ? void 0 : child.widthInColumns) || 1;
+ log.debug("abc88 columnsPos", child, columnPos);
+ }
+ }
+ log.debug(
+ `layout blocks (<==layoutBlocks) ${block.id} x: ${(_o = block == null ? void 0 : block.size) == null ? void 0 : _o.x} y: ${(_p = block == null ? void 0 : block.size) == null ? void 0 : _p.y} width: ${(_q = block == null ? void 0 : block.size) == null ? void 0 : _q.width}`
+ );
+}
+function findBounds(block, { minX, minY, maxX, maxY } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
+ if (block.size && block.id !== "root") {
+ const { x, y, width, height } = block.size;
+ if (x - width / 2 < minX) {
+ minX = x - width / 2;
+ }
+ if (y - height / 2 < minY) {
+ minY = y - height / 2;
+ }
+ if (x + width / 2 > maxX) {
+ maxX = x + width / 2;
+ }
+ if (y + height / 2 > maxY) {
+ maxY = y + height / 2;
+ }
+ }
+ if (block.children) {
+ for (const child of block.children) {
+ ({ minX, minY, maxX, maxY } = findBounds(child, { minX, minY, maxX, maxY }));
+ }
+ }
+ return { minX, minY, maxX, maxY };
+}
+function layout(db2) {
+ const root = db2.getBlock("root");
+ if (!root) {
+ return;
+ }
+ setBlockSizes(root, db2, 0, 0);
+ layoutBlocks(root);
+ log.debug("getBlocks", JSON.stringify(root, null, 2));
+ const { minX, minY, maxX, maxY } = findBounds(root);
+ const height = maxY - minY;
+ const width = maxX - minX;
+ return { x: minX, y: minY, width, height };
+}
+const getClasses = function(text, diagObj) {
+ return diagObj.db.getClasses();
+};
+const draw = async function(text, id, _version, diagObj) {
+ const { securityLevel, block: conf } = getConfig$1();
+ const db2 = diagObj.db;
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = d3select("#i" + id);
+ }
+ const root = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body");
+ const svg = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : d3select(`[id="${id}"]`);
+ const markers = ["point", "circle", "cross"];
+ insertMarkers(svg, markers, diagObj.type, id);
+ const bl = db2.getBlocks();
+ const blArr = db2.getBlocksFlat();
+ const edges = db2.getEdges();
+ const nodes = svg.insert("g").attr("class", "block");
+ await calculateBlockSizes(nodes, bl, db2);
+ const bounds = layout(db2);
+ await insertBlocks(nodes, bl, db2);
+ await insertEdges(nodes, edges, blArr, db2, id);
+ if (bounds) {
+ const bounds2 = bounds;
+ const magicFactor = Math.max(1, Math.round(0.125 * (bounds2.width / bounds2.height)));
+ const height = bounds2.height + magicFactor + 10;
+ const width = bounds2.width + 10;
+ const { useMaxWidth } = conf;
+ configureSvgSize(svg, height, width, !!useMaxWidth);
+ log.debug("Here Bounds", bounds, bounds2);
+ svg.attr(
+ "viewBox",
+ `${bounds2.x - 5} ${bounds2.y - 5} ${bounds2.width + 10} ${bounds2.height + 10}`
+ );
+ }
+ ordinal(d3schemeTableau10);
+};
+const renderer = {
+ draw,
+ getClasses
+};
+const diagram = {
+ parser: parser$1,
+ db: db$1,
+ renderer,
+ styles: flowStyles
+};
+export {
+ diagram
+};
diff --git a/assets/lib/mermaid/c4Diagram-1e775db3.js b/assets/lib/mermaid/c4Diagram-1e775db3.js
new file mode 100644
index 00000000..8d262cc2
--- /dev/null
+++ b/assets/lib/mermaid/c4Diagram-1e775db3.js
@@ -0,0 +1,1579 @@
+import { s as we, g as Oe, a as Te, b as Re, c as Dt, d as ue, e as De, f as Kt, h as Se, i as wt, j as Nt, l as le, k as Pe, w as Me, m as oe } from "./mermaid-9f2aa176.js";
+import { d as Le, g as Ne } from "./svgDrawCommon-ecc5f780.js";
+var Yt = function() {
+ var e = function(bt, _, x, m) {
+ for (x = x || {}, m = bt.length; m--; x[bt[m]] = _)
+ ;
+ return x;
+ }, t = [1, 24], r = [1, 25], o = [1, 26], l = [1, 27], n = [1, 28], a = [1, 63], s = [1, 64], i = [1, 65], u = [1, 66], d = [1, 67], f = [1, 68], p = [1, 69], E = [1, 29], O = [1, 30], R = [1, 31], S = [1, 32], L = [1, 33], Y = [1, 34], Q = [1, 35], H = [1, 36], q = [1, 37], G = [1, 38], K = [1, 39], J = [1, 40], Z = [1, 41], $ = [1, 42], tt = [1, 43], et = [1, 44], nt = [1, 45], it = [1, 46], st = [1, 47], at = [1, 48], rt = [1, 50], lt = [1, 51], ot = [1, 52], ct = [1, 53], ht = [1, 54], ut = [1, 55], dt = [1, 56], ft = [1, 57], pt = [1, 58], yt = [1, 59], gt = [1, 60], Ct = [14, 42], Vt = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], Ot = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], k = [1, 82], A = [1, 83], C = [1, 84], v = [1, 85], w = [12, 14, 42], ie = [12, 14, 33, 42], Pt = [12, 14, 33, 42, 76, 77, 79, 80], mt = [12, 33], zt = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], Xt = {
+ trace: function() {
+ },
+ yy: {},
+ symbols_: { error: 2, start: 3, mermaidDoc: 4, direction: 5, direction_tb: 6, direction_bt: 7, direction_rl: 8, direction_lr: 9, graphConfig: 10, C4_CONTEXT: 11, NEWLINE: 12, statements: 13, EOF: 14, C4_CONTAINER: 15, C4_COMPONENT: 16, C4_DYNAMIC: 17, C4_DEPLOYMENT: 18, otherStatements: 19, diagramStatements: 20, otherStatement: 21, title: 22, accDescription: 23, acc_title: 24, acc_title_value: 25, acc_descr: 26, acc_descr_value: 27, acc_descr_multiline_value: 28, boundaryStatement: 29, boundaryStartStatement: 30, boundaryStopStatement: 31, boundaryStart: 32, LBRACE: 33, ENTERPRISE_BOUNDARY: 34, attributes: 35, SYSTEM_BOUNDARY: 36, BOUNDARY: 37, CONTAINER_BOUNDARY: 38, NODE: 39, NODE_L: 40, NODE_R: 41, RBRACE: 42, diagramStatement: 43, PERSON: 44, PERSON_EXT: 45, SYSTEM: 46, SYSTEM_DB: 47, SYSTEM_QUEUE: 48, SYSTEM_EXT: 49, SYSTEM_EXT_DB: 50, SYSTEM_EXT_QUEUE: 51, CONTAINER: 52, CONTAINER_DB: 53, CONTAINER_QUEUE: 54, CONTAINER_EXT: 55, CONTAINER_EXT_DB: 56, CONTAINER_EXT_QUEUE: 57, COMPONENT: 58, COMPONENT_DB: 59, COMPONENT_QUEUE: 60, COMPONENT_EXT: 61, COMPONENT_EXT_DB: 62, COMPONENT_EXT_QUEUE: 63, REL: 64, BIREL: 65, REL_U: 66, REL_D: 67, REL_L: 68, REL_R: 69, REL_B: 70, REL_INDEX: 71, UPDATE_EL_STYLE: 72, UPDATE_REL_STYLE: 73, UPDATE_LAYOUT_CONFIG: 74, attribute: 75, STR: 76, STR_KEY: 77, STR_VALUE: 78, ATTRIBUTE: 79, ATTRIBUTE_EMPTY: 80, $accept: 0, $end: 1 },
+ terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" },
+ productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]],
+ performAction: function(_, x, m, g, T, h, Tt) {
+ var y = h.length - 1;
+ switch (T) {
+ case 3:
+ g.setDirection("TB");
+ break;
+ case 4:
+ g.setDirection("BT");
+ break;
+ case 5:
+ g.setDirection("RL");
+ break;
+ case 6:
+ g.setDirection("LR");
+ break;
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ g.setC4Type(h[y - 3]);
+ break;
+ case 19:
+ g.setTitle(h[y].substring(6)), this.$ = h[y].substring(6);
+ break;
+ case 20:
+ g.setAccDescription(h[y].substring(15)), this.$ = h[y].substring(15);
+ break;
+ case 21:
+ this.$ = h[y].trim(), g.setTitle(this.$);
+ break;
+ case 22:
+ case 23:
+ this.$ = h[y].trim(), g.setAccDescription(this.$);
+ break;
+ case 28:
+ case 29:
+ h[y].splice(2, 0, "ENTERPRISE"), g.addPersonOrSystemBoundary(...h[y]), this.$ = h[y];
+ break;
+ case 30:
+ g.addPersonOrSystemBoundary(...h[y]), this.$ = h[y];
+ break;
+ case 31:
+ h[y].splice(2, 0, "CONTAINER"), g.addContainerBoundary(...h[y]), this.$ = h[y];
+ break;
+ case 32:
+ g.addDeploymentNode("node", ...h[y]), this.$ = h[y];
+ break;
+ case 33:
+ g.addDeploymentNode("nodeL", ...h[y]), this.$ = h[y];
+ break;
+ case 34:
+ g.addDeploymentNode("nodeR", ...h[y]), this.$ = h[y];
+ break;
+ case 35:
+ g.popBoundaryParseStack();
+ break;
+ case 39:
+ g.addPersonOrSystem("person", ...h[y]), this.$ = h[y];
+ break;
+ case 40:
+ g.addPersonOrSystem("external_person", ...h[y]), this.$ = h[y];
+ break;
+ case 41:
+ g.addPersonOrSystem("system", ...h[y]), this.$ = h[y];
+ break;
+ case 42:
+ g.addPersonOrSystem("system_db", ...h[y]), this.$ = h[y];
+ break;
+ case 43:
+ g.addPersonOrSystem("system_queue", ...h[y]), this.$ = h[y];
+ break;
+ case 44:
+ g.addPersonOrSystem("external_system", ...h[y]), this.$ = h[y];
+ break;
+ case 45:
+ g.addPersonOrSystem("external_system_db", ...h[y]), this.$ = h[y];
+ break;
+ case 46:
+ g.addPersonOrSystem("external_system_queue", ...h[y]), this.$ = h[y];
+ break;
+ case 47:
+ g.addContainer("container", ...h[y]), this.$ = h[y];
+ break;
+ case 48:
+ g.addContainer("container_db", ...h[y]), this.$ = h[y];
+ break;
+ case 49:
+ g.addContainer("container_queue", ...h[y]), this.$ = h[y];
+ break;
+ case 50:
+ g.addContainer("external_container", ...h[y]), this.$ = h[y];
+ break;
+ case 51:
+ g.addContainer("external_container_db", ...h[y]), this.$ = h[y];
+ break;
+ case 52:
+ g.addContainer("external_container_queue", ...h[y]), this.$ = h[y];
+ break;
+ case 53:
+ g.addComponent("component", ...h[y]), this.$ = h[y];
+ break;
+ case 54:
+ g.addComponent("component_db", ...h[y]), this.$ = h[y];
+ break;
+ case 55:
+ g.addComponent("component_queue", ...h[y]), this.$ = h[y];
+ break;
+ case 56:
+ g.addComponent("external_component", ...h[y]), this.$ = h[y];
+ break;
+ case 57:
+ g.addComponent("external_component_db", ...h[y]), this.$ = h[y];
+ break;
+ case 58:
+ g.addComponent("external_component_queue", ...h[y]), this.$ = h[y];
+ break;
+ case 60:
+ g.addRel("rel", ...h[y]), this.$ = h[y];
+ break;
+ case 61:
+ g.addRel("birel", ...h[y]), this.$ = h[y];
+ break;
+ case 62:
+ g.addRel("rel_u", ...h[y]), this.$ = h[y];
+ break;
+ case 63:
+ g.addRel("rel_d", ...h[y]), this.$ = h[y];
+ break;
+ case 64:
+ g.addRel("rel_l", ...h[y]), this.$ = h[y];
+ break;
+ case 65:
+ g.addRel("rel_r", ...h[y]), this.$ = h[y];
+ break;
+ case 66:
+ g.addRel("rel_b", ...h[y]), this.$ = h[y];
+ break;
+ case 67:
+ h[y].splice(0, 1), g.addRel("rel", ...h[y]), this.$ = h[y];
+ break;
+ case 68:
+ g.updateElStyle("update_el_style", ...h[y]), this.$ = h[y];
+ break;
+ case 69:
+ g.updateRelStyle("update_rel_style", ...h[y]), this.$ = h[y];
+ break;
+ case 70:
+ g.updateLayoutConfig("update_layout_config", ...h[y]), this.$ = h[y];
+ break;
+ case 71:
+ this.$ = [h[y]];
+ break;
+ case 72:
+ h[y].unshift(h[y - 1]), this.$ = h[y];
+ break;
+ case 73:
+ case 75:
+ this.$ = h[y].trim();
+ break;
+ case 74:
+ let Et = {};
+ Et[h[y - 1].trim()] = h[y].trim(), this.$ = Et;
+ break;
+ case 76:
+ this.$ = "";
+ break;
+ }
+ },
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: t, 23: r, 24: o, 26: l, 28: n, 29: 49, 30: 61, 32: 62, 34: a, 36: s, 37: i, 38: u, 39: d, 40: f, 41: p, 43: 23, 44: E, 45: O, 46: R, 47: S, 48: L, 49: Y, 50: Q, 51: H, 52: q, 53: G, 54: K, 55: J, 56: Z, 57: $, 58: tt, 59: et, 60: nt, 61: it, 62: st, 63: at, 64: rt, 65: lt, 66: ot, 67: ct, 68: ht, 69: ut, 70: dt, 71: ft, 72: pt, 73: yt, 74: gt }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: t, 23: r, 24: o, 26: l, 28: n, 29: 49, 30: 61, 32: 62, 34: a, 36: s, 37: i, 38: u, 39: d, 40: f, 41: p, 43: 23, 44: E, 45: O, 46: R, 47: S, 48: L, 49: Y, 50: Q, 51: H, 52: q, 53: G, 54: K, 55: J, 56: Z, 57: $, 58: tt, 59: et, 60: nt, 61: it, 62: st, 63: at, 64: rt, 65: lt, 66: ot, 67: ct, 68: ht, 69: ut, 70: dt, 71: ft, 72: pt, 73: yt, 74: gt }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: t, 23: r, 24: o, 26: l, 28: n, 29: 49, 30: 61, 32: 62, 34: a, 36: s, 37: i, 38: u, 39: d, 40: f, 41: p, 43: 23, 44: E, 45: O, 46: R, 47: S, 48: L, 49: Y, 50: Q, 51: H, 52: q, 53: G, 54: K, 55: J, 56: Z, 57: $, 58: tt, 59: et, 60: nt, 61: it, 62: st, 63: at, 64: rt, 65: lt, 66: ot, 67: ct, 68: ht, 69: ut, 70: dt, 71: ft, 72: pt, 73: yt, 74: gt }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: t, 23: r, 24: o, 26: l, 28: n, 29: 49, 30: 61, 32: 62, 34: a, 36: s, 37: i, 38: u, 39: d, 40: f, 41: p, 43: 23, 44: E, 45: O, 46: R, 47: S, 48: L, 49: Y, 50: Q, 51: H, 52: q, 53: G, 54: K, 55: J, 56: Z, 57: $, 58: tt, 59: et, 60: nt, 61: it, 62: st, 63: at, 64: rt, 65: lt, 66: ot, 67: ct, 68: ht, 69: ut, 70: dt, 71: ft, 72: pt, 73: yt, 74: gt }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: t, 23: r, 24: o, 26: l, 28: n, 29: 49, 30: 61, 32: 62, 34: a, 36: s, 37: i, 38: u, 39: d, 40: f, 41: p, 43: 23, 44: E, 45: O, 46: R, 47: S, 48: L, 49: Y, 50: Q, 51: H, 52: q, 53: G, 54: K, 55: J, 56: Z, 57: $, 58: tt, 59: et, 60: nt, 61: it, 62: st, 63: at, 64: rt, 65: lt, 66: ot, 67: ct, 68: ht, 69: ut, 70: dt, 71: ft, 72: pt, 73: yt, 74: gt }, { 14: [1, 74] }, e(Ct, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: a, 36: s, 37: i, 38: u, 39: d, 40: f, 41: p, 44: E, 45: O, 46: R, 47: S, 48: L, 49: Y, 50: Q, 51: H, 52: q, 53: G, 54: K, 55: J, 56: Z, 57: $, 58: tt, 59: et, 60: nt, 61: it, 62: st, 63: at, 64: rt, 65: lt, 66: ot, 67: ct, 68: ht, 69: ut, 70: dt, 71: ft, 72: pt, 73: yt, 74: gt }), e(Ct, [2, 14]), e(Vt, [2, 16], { 12: [1, 76] }), e(Ct, [2, 36], { 12: [1, 77] }), e(Ot, [2, 19]), e(Ot, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, e(Ot, [2, 23]), { 35: 80, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 86, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 87, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 88, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 89, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 90, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 91, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 92, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 93, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 94, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 95, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 96, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 97, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 98, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 99, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 100, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 101, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 102, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 103, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 104, 75: 81, 76: k, 77: A, 79: C, 80: v }, e(w, [2, 59]), { 35: 105, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 106, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 107, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 108, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 109, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 110, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 111, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 112, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 113, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 114, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 115, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: a, 36: s, 37: i, 38: u, 39: d, 40: f, 41: p, 43: 23, 44: E, 45: O, 46: R, 47: S, 48: L, 49: Y, 50: Q, 51: H, 52: q, 53: G, 54: K, 55: J, 56: Z, 57: $, 58: tt, 59: et, 60: nt, 61: it, 62: st, 63: at, 64: rt, 65: lt, 66: ot, 67: ct, 68: ht, 69: ut, 70: dt, 71: ft, 72: pt, 73: yt, 74: gt }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 120, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 121, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 122, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 123, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 124, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 35: 125, 75: 81, 76: k, 77: A, 79: C, 80: v }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, e(Ct, [2, 15]), e(Vt, [2, 17], { 21: 22, 19: 130, 22: t, 23: r, 24: o, 26: l, 28: n }), e(Ct, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: t, 23: r, 24: o, 26: l, 28: n, 34: a, 36: s, 37: i, 38: u, 39: d, 40: f, 41: p, 44: E, 45: O, 46: R, 47: S, 48: L, 49: Y, 50: Q, 51: H, 52: q, 53: G, 54: K, 55: J, 56: Z, 57: $, 58: tt, 59: et, 60: nt, 61: it, 62: st, 63: at, 64: rt, 65: lt, 66: ot, 67: ct, 68: ht, 69: ut, 70: dt, 71: ft, 72: pt, 73: yt, 74: gt }), e(Ot, [2, 21]), e(Ot, [2, 22]), e(w, [2, 39]), e(ie, [2, 71], { 75: 81, 35: 132, 76: k, 77: A, 79: C, 80: v }), e(Pt, [2, 73]), { 78: [1, 133] }, e(Pt, [2, 75]), e(Pt, [2, 76]), e(w, [2, 40]), e(w, [2, 41]), e(w, [2, 42]), e(w, [2, 43]), e(w, [2, 44]), e(w, [2, 45]), e(w, [2, 46]), e(w, [2, 47]), e(w, [2, 48]), e(w, [2, 49]), e(w, [2, 50]), e(w, [2, 51]), e(w, [2, 52]), e(w, [2, 53]), e(w, [2, 54]), e(w, [2, 55]), e(w, [2, 56]), e(w, [2, 57]), e(w, [2, 58]), e(w, [2, 60]), e(w, [2, 61]), e(w, [2, 62]), e(w, [2, 63]), e(w, [2, 64]), e(w, [2, 65]), e(w, [2, 66]), e(w, [2, 67]), e(w, [2, 68]), e(w, [2, 69]), e(w, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, e(mt, [2, 28]), e(mt, [2, 29]), e(mt, [2, 30]), e(mt, [2, 31]), e(mt, [2, 32]), e(mt, [2, 33]), e(mt, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, e(Vt, [2, 18]), e(Ct, [2, 38]), e(ie, [2, 72]), e(Pt, [2, 74]), e(w, [2, 24]), e(w, [2, 35]), e(zt, [2, 25]), e(zt, [2, 26], { 12: [1, 138] }), e(zt, [2, 27])],
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
+ parseError: function(_, x) {
+ if (x.recoverable)
+ this.trace(_);
+ else {
+ var m = new Error(_);
+ throw m.hash = x, m;
+ }
+ },
+ parse: function(_) {
+ var x = this, m = [0], g = [], T = [null], h = [], Tt = this.table, y = "", Et = 0, se = 0, ke = 2, ae = 1, Ae = h.slice.call(arguments, 1), D = Object.create(this.lexer), kt = { yy: {} };
+ for (var Qt in this.yy)
+ Object.prototype.hasOwnProperty.call(this.yy, Qt) && (kt.yy[Qt] = this.yy[Qt]);
+ D.setInput(_, kt.yy), kt.yy.lexer = D, kt.yy.parser = this, typeof D.yylloc > "u" && (D.yylloc = {});
+ var Ht = D.yylloc;
+ h.push(Ht);
+ var Ce = D.options && D.options.ranges;
+ typeof kt.yy.parseError == "function" ? this.parseError = kt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
+ function ve() {
+ var X;
+ return X = g.pop() || D.lex() || ae, typeof X != "number" && (X instanceof Array && (g = X, X = g.pop()), X = x.symbols_[X] || X), X;
+ }
+ for (var M, At, N, qt, vt = {}, Mt, z, re, Lt; ; ) {
+ if (At = m[m.length - 1], this.defaultActions[At] ? N = this.defaultActions[At] : ((M === null || typeof M > "u") && (M = ve()), N = Tt[At] && Tt[At][M]), typeof N > "u" || !N.length || !N[0]) {
+ var Gt = "";
+ Lt = [];
+ for (Mt in Tt[At])
+ this.terminals_[Mt] && Mt > ke && Lt.push("'" + this.terminals_[Mt] + "'");
+ D.showPosition ? Gt = "Parse error on line " + (Et + 1) + `:
+` + D.showPosition() + `
+Expecting ` + Lt.join(", ") + ", got '" + (this.terminals_[M] || M) + "'" : Gt = "Parse error on line " + (Et + 1) + ": Unexpected " + (M == ae ? "end of input" : "'" + (this.terminals_[M] || M) + "'"), this.parseError(Gt, {
+ text: D.match,
+ token: this.terminals_[M] || M,
+ line: D.yylineno,
+ loc: Ht,
+ expected: Lt
+ });
+ }
+ if (N[0] instanceof Array && N.length > 1)
+ throw new Error("Parse Error: multiple actions possible at state: " + At + ", token: " + M);
+ switch (N[0]) {
+ case 1:
+ m.push(M), T.push(D.yytext), h.push(D.yylloc), m.push(N[1]), M = null, se = D.yyleng, y = D.yytext, Et = D.yylineno, Ht = D.yylloc;
+ break;
+ case 2:
+ if (z = this.productions_[N[1]][1], vt.$ = T[T.length - z], vt._$ = {
+ first_line: h[h.length - (z || 1)].first_line,
+ last_line: h[h.length - 1].last_line,
+ first_column: h[h.length - (z || 1)].first_column,
+ last_column: h[h.length - 1].last_column
+ }, Ce && (vt._$.range = [
+ h[h.length - (z || 1)].range[0],
+ h[h.length - 1].range[1]
+ ]), qt = this.performAction.apply(vt, [
+ y,
+ se,
+ Et,
+ kt.yy,
+ N[1],
+ T,
+ h
+ ].concat(Ae)), typeof qt < "u")
+ return qt;
+ z && (m = m.slice(0, -1 * z * 2), T = T.slice(0, -1 * z), h = h.slice(0, -1 * z)), m.push(this.productions_[N[1]][0]), T.push(vt.$), h.push(vt._$), re = Tt[m[m.length - 2]][m[m.length - 1]], m.push(re);
+ break;
+ case 3:
+ return !0;
+ }
+ }
+ return !0;
+ }
+ }, Ee = function() {
+ var bt = {
+ EOF: 1,
+ parseError: function(x, m) {
+ if (this.yy.parser)
+ this.yy.parser.parseError(x, m);
+ else
+ throw new Error(x);
+ },
+ // resets the lexer, sets new input
+ setInput: function(_, x) {
+ return this.yy = x || this.yy || {}, this._input = _, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
+ first_line: 1,
+ first_column: 0,
+ last_line: 1,
+ last_column: 0
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
+ },
+ // consumes and returns one char from the input
+ input: function() {
+ var _ = this._input[0];
+ this.yytext += _, this.yyleng++, this.offset++, this.match += _, this.matched += _;
+ var x = _.match(/(?:\r\n?|\n).*/g);
+ return x ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), _;
+ },
+ // unshifts one char (or a string) into the input
+ unput: function(_) {
+ var x = _.length, m = _.split(/(?:\r\n?|\n)/g);
+ this._input = _ + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - x), this.offset -= x;
+ var g = this.match.split(/(?:\r\n?|\n)/g);
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), m.length - 1 && (this.yylineno -= m.length - 1);
+ var T = this.yylloc.range;
+ return this.yylloc = {
+ first_line: this.yylloc.first_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.first_column,
+ last_column: m ? (m.length === g.length ? this.yylloc.first_column : 0) + g[g.length - m.length].length - m[0].length : this.yylloc.first_column - x
+ }, this.options.ranges && (this.yylloc.range = [T[0], T[0] + this.yyleng - x]), this.yyleng = this.yytext.length, this;
+ },
+ // When called from action, caches matched text and appends it on next action
+ more: function() {
+ return this._more = !0, this;
+ },
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
+ reject: function() {
+ if (this.options.backtrack_lexer)
+ this._backtrack = !0;
+ else
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
+` + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ return this;
+ },
+ // retain first n characters of the match
+ less: function(_) {
+ this.unput(this.match.slice(_));
+ },
+ // displays already matched input, i.e. for error messages
+ pastInput: function() {
+ var _ = this.matched.substr(0, this.matched.length - this.match.length);
+ return (_.length > 20 ? "..." : "") + _.substr(-20).replace(/\n/g, "");
+ },
+ // displays upcoming input, i.e. for error messages
+ upcomingInput: function() {
+ var _ = this.match;
+ return _.length < 20 && (_ += this._input.substr(0, 20 - _.length)), (_.substr(0, 20) + (_.length > 20 ? "..." : "")).replace(/\n/g, "");
+ },
+ // displays the character position where the lexing error occurred, i.e. for error messages
+ showPosition: function() {
+ var _ = this.pastInput(), x = new Array(_.length + 1).join("-");
+ return _ + this.upcomingInput() + `
+` + x + "^";
+ },
+ // test the lexed token: return FALSE when not a match, otherwise return token
+ test_match: function(_, x) {
+ var m, g, T;
+ if (this.options.backtrack_lexer && (T = {
+ yylineno: this.yylineno,
+ yylloc: {
+ first_line: this.yylloc.first_line,
+ last_line: this.last_line,
+ first_column: this.yylloc.first_column,
+ last_column: this.yylloc.last_column
+ },
+ yytext: this.yytext,
+ match: this.match,
+ matches: this.matches,
+ matched: this.matched,
+ yyleng: this.yyleng,
+ offset: this.offset,
+ _more: this._more,
+ _input: this._input,
+ yy: this.yy,
+ conditionStack: this.conditionStack.slice(0),
+ done: this.done
+ }, this.options.ranges && (T.yylloc.range = this.yylloc.range.slice(0))), g = _[0].match(/(?:\r\n?|\n).*/g), g && (this.yylineno += g.length), this.yylloc = {
+ first_line: this.yylloc.last_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.last_column,
+ last_column: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + _[0].length
+ }, this.yytext += _[0], this.match += _[0], this.matches = _, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(_[0].length), this.matched += _[0], m = this.performAction.call(this, this.yy, this, x, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), m)
+ return m;
+ if (this._backtrack) {
+ for (var h in T)
+ this[h] = T[h];
+ return !1;
+ }
+ return !1;
+ },
+ // return next match in input
+ next: function() {
+ if (this.done)
+ return this.EOF;
+ this._input || (this.done = !0);
+ var _, x, m, g;
+ this._more || (this.yytext = "", this.match = "");
+ for (var T = this._currentRules(), h = 0; h < T.length; h++)
+ if (m = this._input.match(this.rules[T[h]]), m && (!x || m[0].length > x[0].length)) {
+ if (x = m, g = h, this.options.backtrack_lexer) {
+ if (_ = this.test_match(m, T[h]), _ !== !1)
+ return _;
+ if (this._backtrack) {
+ x = !1;
+ continue;
+ } else
+ return !1;
+ } else if (!this.options.flex)
+ break;
+ }
+ return x ? (_ = this.test_match(x, T[g]), _ !== !1 ? _ : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
+` + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ },
+ // return next match that has a token
+ lex: function() {
+ var x = this.next();
+ return x || this.lex();
+ },
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
+ begin: function(x) {
+ this.conditionStack.push(x);
+ },
+ // pop the previously active lexer condition state off the condition stack
+ popState: function() {
+ var x = this.conditionStack.length - 1;
+ return x > 0 ? this.conditionStack.pop() : this.conditionStack[0];
+ },
+ // produce the lexer rule set which is active for the currently active lexer condition state
+ _currentRules: function() {
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
+ },
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
+ topState: function(x) {
+ return x = this.conditionStack.length - 1 - Math.abs(x || 0), x >= 0 ? this.conditionStack[x] : "INITIAL";
+ },
+ // alias for begin(condition)
+ pushState: function(x) {
+ this.begin(x);
+ },
+ // return the number of states currently on the stack
+ stateStackSize: function() {
+ return this.conditionStack.length;
+ },
+ options: {},
+ performAction: function(x, m, g, T) {
+ switch (g) {
+ case 0:
+ return 6;
+ case 1:
+ return 7;
+ case 2:
+ return 8;
+ case 3:
+ return 9;
+ case 4:
+ return 22;
+ case 5:
+ return 23;
+ case 6:
+ return this.begin("acc_title"), 24;
+ case 7:
+ return this.popState(), "acc_title_value";
+ case 8:
+ return this.begin("acc_descr"), 26;
+ case 9:
+ return this.popState(), "acc_descr_value";
+ case 10:
+ this.begin("acc_descr_multiline");
+ break;
+ case 11:
+ this.popState();
+ break;
+ case 12:
+ return "acc_descr_multiline_value";
+ case 13:
+ break;
+ case 14:
+ c;
+ break;
+ case 15:
+ return 12;
+ case 16:
+ break;
+ case 17:
+ return 11;
+ case 18:
+ return 15;
+ case 19:
+ return 16;
+ case 20:
+ return 17;
+ case 21:
+ return 18;
+ case 22:
+ return this.begin("person_ext"), 45;
+ case 23:
+ return this.begin("person"), 44;
+ case 24:
+ return this.begin("system_ext_queue"), 51;
+ case 25:
+ return this.begin("system_ext_db"), 50;
+ case 26:
+ return this.begin("system_ext"), 49;
+ case 27:
+ return this.begin("system_queue"), 48;
+ case 28:
+ return this.begin("system_db"), 47;
+ case 29:
+ return this.begin("system"), 46;
+ case 30:
+ return this.begin("boundary"), 37;
+ case 31:
+ return this.begin("enterprise_boundary"), 34;
+ case 32:
+ return this.begin("system_boundary"), 36;
+ case 33:
+ return this.begin("container_ext_queue"), 57;
+ case 34:
+ return this.begin("container_ext_db"), 56;
+ case 35:
+ return this.begin("container_ext"), 55;
+ case 36:
+ return this.begin("container_queue"), 54;
+ case 37:
+ return this.begin("container_db"), 53;
+ case 38:
+ return this.begin("container"), 52;
+ case 39:
+ return this.begin("container_boundary"), 38;
+ case 40:
+ return this.begin("component_ext_queue"), 63;
+ case 41:
+ return this.begin("component_ext_db"), 62;
+ case 42:
+ return this.begin("component_ext"), 61;
+ case 43:
+ return this.begin("component_queue"), 60;
+ case 44:
+ return this.begin("component_db"), 59;
+ case 45:
+ return this.begin("component"), 58;
+ case 46:
+ return this.begin("node"), 39;
+ case 47:
+ return this.begin("node"), 39;
+ case 48:
+ return this.begin("node_l"), 40;
+ case 49:
+ return this.begin("node_r"), 41;
+ case 50:
+ return this.begin("rel"), 64;
+ case 51:
+ return this.begin("birel"), 65;
+ case 52:
+ return this.begin("rel_u"), 66;
+ case 53:
+ return this.begin("rel_u"), 66;
+ case 54:
+ return this.begin("rel_d"), 67;
+ case 55:
+ return this.begin("rel_d"), 67;
+ case 56:
+ return this.begin("rel_l"), 68;
+ case 57:
+ return this.begin("rel_l"), 68;
+ case 58:
+ return this.begin("rel_r"), 69;
+ case 59:
+ return this.begin("rel_r"), 69;
+ case 60:
+ return this.begin("rel_b"), 70;
+ case 61:
+ return this.begin("rel_index"), 71;
+ case 62:
+ return this.begin("update_el_style"), 72;
+ case 63:
+ return this.begin("update_rel_style"), 73;
+ case 64:
+ return this.begin("update_layout_config"), 74;
+ case 65:
+ return "EOF_IN_STRUCT";
+ case 66:
+ return this.begin("attribute"), "ATTRIBUTE_EMPTY";
+ case 67:
+ this.begin("attribute");
+ break;
+ case 68:
+ this.popState(), this.popState();
+ break;
+ case 69:
+ return 80;
+ case 70:
+ break;
+ case 71:
+ return 80;
+ case 72:
+ this.begin("string");
+ break;
+ case 73:
+ this.popState();
+ break;
+ case 74:
+ return "STR";
+ case 75:
+ this.begin("string_kv");
+ break;
+ case 76:
+ return this.begin("string_kv_key"), "STR_KEY";
+ case 77:
+ this.popState(), this.begin("string_kv_value");
+ break;
+ case 78:
+ return "STR_VALUE";
+ case 79:
+ this.popState(), this.popState();
+ break;
+ case 80:
+ return "STR";
+ case 81:
+ return "LBRACE";
+ case 82:
+ return "RBRACE";
+ case 83:
+ return "SPACE";
+ case 84:
+ return "EOL";
+ case 85:
+ return 14;
+ }
+ },
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/],
+ conditions: { acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, acc_descr: { rules: [9], inclusive: !1 }, acc_title: { rules: [7], inclusive: !1 }, string_kv_value: { rules: [78, 79], inclusive: !1 }, string_kv_key: { rules: [77], inclusive: !1 }, string_kv: { rules: [76], inclusive: !1 }, string: { rules: [73, 74], inclusive: !1 }, attribute: { rules: [68, 69, 70, 71, 72, 75, 80], inclusive: !1 }, update_layout_config: { rules: [65, 66, 67, 68], inclusive: !1 }, update_rel_style: { rules: [65, 66, 67, 68], inclusive: !1 }, update_el_style: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_b: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_r: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_l: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_d: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_u: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_bi: { rules: [], inclusive: !1 }, rel: { rules: [65, 66, 67, 68], inclusive: !1 }, node_r: { rules: [65, 66, 67, 68], inclusive: !1 }, node_l: { rules: [65, 66, 67, 68], inclusive: !1 }, node: { rules: [65, 66, 67, 68], inclusive: !1 }, index: { rules: [], inclusive: !1 }, rel_index: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext_queue: { rules: [], inclusive: !1 }, component_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, component_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, component_db: { rules: [65, 66, 67, 68], inclusive: !1 }, component: { rules: [65, 66, 67, 68], inclusive: !1 }, container_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, container_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, container_db: { rules: [65, 66, 67, 68], inclusive: !1 }, container: { rules: [65, 66, 67, 68], inclusive: !1 }, birel: { rules: [65, 66, 67, 68], inclusive: !1 }, system_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, enterprise_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, system_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, system_db: { rules: [65, 66, 67, 68], inclusive: !1 }, system: { rules: [65, 66, 67, 68], inclusive: !1 }, person_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, person: { rules: [65, 66, 67, 68], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], inclusive: !0 } }
+ };
+ return bt;
+ }();
+ Xt.lexer = Ee;
+ function Wt() {
+ this.yy = {};
+ }
+ return Wt.prototype = Xt, Xt.Parser = Wt, new Wt();
+}();
+Yt.parser = Yt;
+const Be = Yt;
+let U = [], _t = [""], P = "global", j = "", V = [
+ {
+ alias: "global",
+ label: { text: "global" },
+ type: { text: "global" },
+ tags: null,
+ link: null,
+ parentBoundary: ""
+ }
+], St = [], te = "", ee = !1, It = 4, jt = 2;
+var de;
+const Ye = function() {
+ return de;
+}, Ie = function(e) {
+ de = ue(e, Dt());
+}, je = function(e, t, r, o, l, n, a, s, i) {
+ if (e == null || t === void 0 || t === null || r === void 0 || r === null || o === void 0 || o === null)
+ return;
+ let u = {};
+ const d = St.find((f) => f.from === t && f.to === r);
+ if (d ? u = d : St.push(u), u.type = e, u.from = t, u.to = r, u.label = { text: o }, l == null)
+ u.techn = { text: "" };
+ else if (typeof l == "object") {
+ let [f, p] = Object.entries(l)[0];
+ u[f] = { text: p };
+ } else
+ u.techn = { text: l };
+ if (n == null)
+ u.descr = { text: "" };
+ else if (typeof n == "object") {
+ let [f, p] = Object.entries(n)[0];
+ u[f] = { text: p };
+ } else
+ u.descr = { text: n };
+ if (typeof a == "object") {
+ let [f, p] = Object.entries(a)[0];
+ u[f] = p;
+ } else
+ u.sprite = a;
+ if (typeof s == "object") {
+ let [f, p] = Object.entries(s)[0];
+ u[f] = p;
+ } else
+ u.tags = s;
+ if (typeof i == "object") {
+ let [f, p] = Object.entries(i)[0];
+ u[f] = p;
+ } else
+ u.link = i;
+ u.wrap = xt();
+}, Ue = function(e, t, r, o, l, n, a) {
+ if (t === null || r === null)
+ return;
+ let s = {};
+ const i = U.find((u) => u.alias === t);
+ if (i && t === i.alias ? s = i : (s.alias = t, U.push(s)), r == null ? s.label = { text: "" } : s.label = { text: r }, o == null)
+ s.descr = { text: "" };
+ else if (typeof o == "object") {
+ let [u, d] = Object.entries(o)[0];
+ s[u] = { text: d };
+ } else
+ s.descr = { text: o };
+ if (typeof l == "object") {
+ let [u, d] = Object.entries(l)[0];
+ s[u] = d;
+ } else
+ s.sprite = l;
+ if (typeof n == "object") {
+ let [u, d] = Object.entries(n)[0];
+ s[u] = d;
+ } else
+ s.tags = n;
+ if (typeof a == "object") {
+ let [u, d] = Object.entries(a)[0];
+ s[u] = d;
+ } else
+ s.link = a;
+ s.typeC4Shape = { text: e }, s.parentBoundary = P, s.wrap = xt();
+}, Fe = function(e, t, r, o, l, n, a, s) {
+ if (t === null || r === null)
+ return;
+ let i = {};
+ const u = U.find((d) => d.alias === t);
+ if (u && t === u.alias ? i = u : (i.alias = t, U.push(i)), r == null ? i.label = { text: "" } : i.label = { text: r }, o == null)
+ i.techn = { text: "" };
+ else if (typeof o == "object") {
+ let [d, f] = Object.entries(o)[0];
+ i[d] = { text: f };
+ } else
+ i.techn = { text: o };
+ if (l == null)
+ i.descr = { text: "" };
+ else if (typeof l == "object") {
+ let [d, f] = Object.entries(l)[0];
+ i[d] = { text: f };
+ } else
+ i.descr = { text: l };
+ if (typeof n == "object") {
+ let [d, f] = Object.entries(n)[0];
+ i[d] = f;
+ } else
+ i.sprite = n;
+ if (typeof a == "object") {
+ let [d, f] = Object.entries(a)[0];
+ i[d] = f;
+ } else
+ i.tags = a;
+ if (typeof s == "object") {
+ let [d, f] = Object.entries(s)[0];
+ i[d] = f;
+ } else
+ i.link = s;
+ i.wrap = xt(), i.typeC4Shape = { text: e }, i.parentBoundary = P;
+}, Ve = function(e, t, r, o, l, n, a, s) {
+ if (t === null || r === null)
+ return;
+ let i = {};
+ const u = U.find((d) => d.alias === t);
+ if (u && t === u.alias ? i = u : (i.alias = t, U.push(i)), r == null ? i.label = { text: "" } : i.label = { text: r }, o == null)
+ i.techn = { text: "" };
+ else if (typeof o == "object") {
+ let [d, f] = Object.entries(o)[0];
+ i[d] = { text: f };
+ } else
+ i.techn = { text: o };
+ if (l == null)
+ i.descr = { text: "" };
+ else if (typeof l == "object") {
+ let [d, f] = Object.entries(l)[0];
+ i[d] = { text: f };
+ } else
+ i.descr = { text: l };
+ if (typeof n == "object") {
+ let [d, f] = Object.entries(n)[0];
+ i[d] = f;
+ } else
+ i.sprite = n;
+ if (typeof a == "object") {
+ let [d, f] = Object.entries(a)[0];
+ i[d] = f;
+ } else
+ i.tags = a;
+ if (typeof s == "object") {
+ let [d, f] = Object.entries(s)[0];
+ i[d] = f;
+ } else
+ i.link = s;
+ i.wrap = xt(), i.typeC4Shape = { text: e }, i.parentBoundary = P;
+}, ze = function(e, t, r, o, l) {
+ if (e === null || t === null)
+ return;
+ let n = {};
+ const a = V.find((s) => s.alias === e);
+ if (a && e === a.alias ? n = a : (n.alias = e, V.push(n)), t == null ? n.label = { text: "" } : n.label = { text: t }, r == null)
+ n.type = { text: "system" };
+ else if (typeof r == "object") {
+ let [s, i] = Object.entries(r)[0];
+ n[s] = { text: i };
+ } else
+ n.type = { text: r };
+ if (typeof o == "object") {
+ let [s, i] = Object.entries(o)[0];
+ n[s] = i;
+ } else
+ n.tags = o;
+ if (typeof l == "object") {
+ let [s, i] = Object.entries(l)[0];
+ n[s] = i;
+ } else
+ n.link = l;
+ n.parentBoundary = P, n.wrap = xt(), j = P, P = e, _t.push(j);
+}, Xe = function(e, t, r, o, l) {
+ if (e === null || t === null)
+ return;
+ let n = {};
+ const a = V.find((s) => s.alias === e);
+ if (a && e === a.alias ? n = a : (n.alias = e, V.push(n)), t == null ? n.label = { text: "" } : n.label = { text: t }, r == null)
+ n.type = { text: "container" };
+ else if (typeof r == "object") {
+ let [s, i] = Object.entries(r)[0];
+ n[s] = { text: i };
+ } else
+ n.type = { text: r };
+ if (typeof o == "object") {
+ let [s, i] = Object.entries(o)[0];
+ n[s] = i;
+ } else
+ n.tags = o;
+ if (typeof l == "object") {
+ let [s, i] = Object.entries(l)[0];
+ n[s] = i;
+ } else
+ n.link = l;
+ n.parentBoundary = P, n.wrap = xt(), j = P, P = e, _t.push(j);
+}, We = function(e, t, r, o, l, n, a, s) {
+ if (t === null || r === null)
+ return;
+ let i = {};
+ const u = V.find((d) => d.alias === t);
+ if (u && t === u.alias ? i = u : (i.alias = t, V.push(i)), r == null ? i.label = { text: "" } : i.label = { text: r }, o == null)
+ i.type = { text: "node" };
+ else if (typeof o == "object") {
+ let [d, f] = Object.entries(o)[0];
+ i[d] = { text: f };
+ } else
+ i.type = { text: o };
+ if (l == null)
+ i.descr = { text: "" };
+ else if (typeof l == "object") {
+ let [d, f] = Object.entries(l)[0];
+ i[d] = { text: f };
+ } else
+ i.descr = { text: l };
+ if (typeof a == "object") {
+ let [d, f] = Object.entries(a)[0];
+ i[d] = f;
+ } else
+ i.tags = a;
+ if (typeof s == "object") {
+ let [d, f] = Object.entries(s)[0];
+ i[d] = f;
+ } else
+ i.link = s;
+ i.nodeType = e, i.parentBoundary = P, i.wrap = xt(), j = P, P = t, _t.push(j);
+}, Qe = function() {
+ P = j, _t.pop(), j = _t.pop(), _t.push(j);
+}, He = function(e, t, r, o, l, n, a, s, i, u, d) {
+ let f = U.find((p) => p.alias === t);
+ if (!(f === void 0 && (f = V.find((p) => p.alias === t), f === void 0))) {
+ if (r != null)
+ if (typeof r == "object") {
+ let [p, E] = Object.entries(r)[0];
+ f[p] = E;
+ } else
+ f.bgColor = r;
+ if (o != null)
+ if (typeof o == "object") {
+ let [p, E] = Object.entries(o)[0];
+ f[p] = E;
+ } else
+ f.fontColor = o;
+ if (l != null)
+ if (typeof l == "object") {
+ let [p, E] = Object.entries(l)[0];
+ f[p] = E;
+ } else
+ f.borderColor = l;
+ if (n != null)
+ if (typeof n == "object") {
+ let [p, E] = Object.entries(n)[0];
+ f[p] = E;
+ } else
+ f.shadowing = n;
+ if (a != null)
+ if (typeof a == "object") {
+ let [p, E] = Object.entries(a)[0];
+ f[p] = E;
+ } else
+ f.shape = a;
+ if (s != null)
+ if (typeof s == "object") {
+ let [p, E] = Object.entries(s)[0];
+ f[p] = E;
+ } else
+ f.sprite = s;
+ if (i != null)
+ if (typeof i == "object") {
+ let [p, E] = Object.entries(i)[0];
+ f[p] = E;
+ } else
+ f.techn = i;
+ if (u != null)
+ if (typeof u == "object") {
+ let [p, E] = Object.entries(u)[0];
+ f[p] = E;
+ } else
+ f.legendText = u;
+ if (d != null)
+ if (typeof d == "object") {
+ let [p, E] = Object.entries(d)[0];
+ f[p] = E;
+ } else
+ f.legendSprite = d;
+ }
+}, qe = function(e, t, r, o, l, n, a) {
+ const s = St.find((i) => i.from === t && i.to === r);
+ if (s !== void 0) {
+ if (o != null)
+ if (typeof o == "object") {
+ let [i, u] = Object.entries(o)[0];
+ s[i] = u;
+ } else
+ s.textColor = o;
+ if (l != null)
+ if (typeof l == "object") {
+ let [i, u] = Object.entries(l)[0];
+ s[i] = u;
+ } else
+ s.lineColor = l;
+ if (n != null)
+ if (typeof n == "object") {
+ let [i, u] = Object.entries(n)[0];
+ s[i] = parseInt(u);
+ } else
+ s.offsetX = parseInt(n);
+ if (a != null)
+ if (typeof a == "object") {
+ let [i, u] = Object.entries(a)[0];
+ s[i] = parseInt(u);
+ } else
+ s.offsetY = parseInt(a);
+ }
+}, Ge = function(e, t, r) {
+ let o = It, l = jt;
+ if (typeof t == "object") {
+ const n = Object.values(t)[0];
+ o = parseInt(n);
+ } else
+ o = parseInt(t);
+ if (typeof r == "object") {
+ const n = Object.values(r)[0];
+ l = parseInt(n);
+ } else
+ l = parseInt(r);
+ o >= 1 && (It = o), l >= 1 && (jt = l);
+}, Ke = function() {
+ return It;
+}, Je = function() {
+ return jt;
+}, Ze = function() {
+ return P;
+}, $e = function() {
+ return j;
+}, fe = function(e) {
+ return e == null ? U : U.filter((t) => t.parentBoundary === e);
+}, t0 = function(e) {
+ return U.find((t) => t.alias === e);
+}, e0 = function(e) {
+ return Object.keys(fe(e));
+}, pe = function(e) {
+ return e == null ? V : V.filter((t) => t.parentBoundary === e);
+}, n0 = pe, i0 = function() {
+ return St;
+}, s0 = function() {
+ return te;
+}, a0 = function(e) {
+ ee = e;
+}, xt = function() {
+ return ee;
+}, r0 = function() {
+ U = [], V = [
+ {
+ alias: "global",
+ label: { text: "global" },
+ type: { text: "global" },
+ tags: null,
+ link: null,
+ parentBoundary: ""
+ }
+ ], j = "", P = "global", _t = [""], St = [], _t = [""], te = "", ee = !1, It = 4, jt = 2;
+}, l0 = {
+ SOLID: 0,
+ DOTTED: 1,
+ NOTE: 2,
+ SOLID_CROSS: 3,
+ DOTTED_CROSS: 4,
+ SOLID_OPEN: 5,
+ DOTTED_OPEN: 6,
+ LOOP_START: 10,
+ LOOP_END: 11,
+ ALT_START: 12,
+ ALT_ELSE: 13,
+ ALT_END: 14,
+ OPT_START: 15,
+ OPT_END: 16,
+ ACTIVE_START: 17,
+ ACTIVE_END: 18,
+ PAR_START: 19,
+ PAR_AND: 20,
+ PAR_END: 21,
+ RECT_START: 22,
+ RECT_END: 23,
+ SOLID_POINT: 24,
+ DOTTED_POINT: 25
+}, o0 = {
+ FILLED: 0,
+ OPEN: 1
+}, c0 = {
+ LEFTOF: 0,
+ RIGHTOF: 1,
+ OVER: 2
+}, h0 = function(e) {
+ te = ue(e, Dt());
+}, Jt = {
+ addPersonOrSystem: Ue,
+ addPersonOrSystemBoundary: ze,
+ addContainer: Fe,
+ addContainerBoundary: Xe,
+ addComponent: Ve,
+ addDeploymentNode: We,
+ popBoundaryParseStack: Qe,
+ addRel: je,
+ updateElStyle: He,
+ updateRelStyle: qe,
+ updateLayoutConfig: Ge,
+ autoWrap: xt,
+ setWrap: a0,
+ getC4ShapeArray: fe,
+ getC4Shape: t0,
+ getC4ShapeKeys: e0,
+ getBoundaries: pe,
+ getBoundarys: n0,
+ getCurrentBoundaryParse: Ze,
+ getParentBoundaryParse: $e,
+ getRels: i0,
+ getTitle: s0,
+ getC4Type: Ye,
+ getC4ShapeInRow: Ke,
+ getC4BoundaryInRow: Je,
+ setAccTitle: we,
+ getAccTitle: Oe,
+ getAccDescription: Te,
+ setAccDescription: Re,
+ getConfig: () => Dt().c4,
+ clear: r0,
+ LINETYPE: l0,
+ ARROWTYPE: o0,
+ PLACEMENT: c0,
+ setTitle: h0,
+ setC4Type: Ie
+ // apply,
+}, ne = function(e, t) {
+ return Le(e, t);
+}, ye = function(e, t, r, o, l, n) {
+ const a = e.append("image");
+ a.attr("width", t), a.attr("height", r), a.attr("x", o), a.attr("y", l);
+ let s = n.startsWith("data:image/png;base64") ? n : De.sanitizeUrl(n);
+ a.attr("xlink:href", s);
+}, u0 = (e, t, r) => {
+ const o = e.append("g");
+ let l = 0;
+ for (let n of t) {
+ let a = n.textColor ? n.textColor : "#444444", s = n.lineColor ? n.lineColor : "#444444", i = n.offsetX ? parseInt(n.offsetX) : 0, u = n.offsetY ? parseInt(n.offsetY) : 0, d = "";
+ if (l === 0) {
+ let p = o.append("line");
+ p.attr("x1", n.startPoint.x), p.attr("y1", n.startPoint.y), p.attr("x2", n.endPoint.x), p.attr("y2", n.endPoint.y), p.attr("stroke-width", "1"), p.attr("stroke", s), p.style("fill", "none"), n.type !== "rel_b" && p.attr("marker-end", "url(" + d + "#arrowhead)"), (n.type === "birel" || n.type === "rel_b") && p.attr("marker-start", "url(" + d + "#arrowend)"), l = -1;
+ } else {
+ let p = o.append("path");
+ p.attr("fill", "none").attr("stroke-width", "1").attr("stroke", s).attr(
+ "d",
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", n.startPoint.x).replaceAll("starty", n.startPoint.y).replaceAll(
+ "controlx",
+ n.startPoint.x + (n.endPoint.x - n.startPoint.x) / 2 - (n.endPoint.x - n.startPoint.x) / 4
+ ).replaceAll("controly", n.startPoint.y + (n.endPoint.y - n.startPoint.y) / 2).replaceAll("stopx", n.endPoint.x).replaceAll("stopy", n.endPoint.y)
+ ), n.type !== "rel_b" && p.attr("marker-end", "url(" + d + "#arrowhead)"), (n.type === "birel" || n.type === "rel_b") && p.attr("marker-start", "url(" + d + "#arrowend)");
+ }
+ let f = r.messageFont();
+ W(r)(
+ n.label.text,
+ o,
+ Math.min(n.startPoint.x, n.endPoint.x) + Math.abs(n.endPoint.x - n.startPoint.x) / 2 + i,
+ Math.min(n.startPoint.y, n.endPoint.y) + Math.abs(n.endPoint.y - n.startPoint.y) / 2 + u,
+ n.label.width,
+ n.label.height,
+ { fill: a },
+ f
+ ), n.techn && n.techn.text !== "" && (f = r.messageFont(), W(r)(
+ "[" + n.techn.text + "]",
+ o,
+ Math.min(n.startPoint.x, n.endPoint.x) + Math.abs(n.endPoint.x - n.startPoint.x) / 2 + i,
+ Math.min(n.startPoint.y, n.endPoint.y) + Math.abs(n.endPoint.y - n.startPoint.y) / 2 + r.messageFontSize + 5 + u,
+ Math.max(n.label.width, n.techn.width),
+ n.techn.height,
+ { fill: a, "font-style": "italic" },
+ f
+ ));
+ }
+}, d0 = function(e, t, r) {
+ const o = e.append("g");
+ let l = t.bgColor ? t.bgColor : "none", n = t.borderColor ? t.borderColor : "#444444", a = t.fontColor ? t.fontColor : "black", s = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
+ t.nodeType && (s = { "stroke-width": 1 });
+ let i = {
+ x: t.x,
+ y: t.y,
+ fill: l,
+ stroke: n,
+ width: t.width,
+ height: t.height,
+ rx: 2.5,
+ ry: 2.5,
+ attrs: s
+ };
+ ne(o, i);
+ let u = r.boundaryFont();
+ u.fontWeight = "bold", u.fontSize = u.fontSize + 2, u.fontColor = a, W(r)(
+ t.label.text,
+ o,
+ t.x,
+ t.y + t.label.Y,
+ t.width,
+ t.height,
+ { fill: "#444444" },
+ u
+ ), t.type && t.type.text !== "" && (u = r.boundaryFont(), u.fontColor = a, W(r)(
+ t.type.text,
+ o,
+ t.x,
+ t.y + t.type.Y,
+ t.width,
+ t.height,
+ { fill: "#444444" },
+ u
+ )), t.descr && t.descr.text !== "" && (u = r.boundaryFont(), u.fontSize = u.fontSize - 2, u.fontColor = a, W(r)(
+ t.descr.text,
+ o,
+ t.x,
+ t.y + t.descr.Y,
+ t.width,
+ t.height,
+ { fill: "#444444" },
+ u
+ ));
+}, f0 = function(e, t, r) {
+ var f;
+ let o = t.bgColor ? t.bgColor : r[t.typeC4Shape.text + "_bg_color"], l = t.borderColor ? t.borderColor : r[t.typeC4Shape.text + "_border_color"], n = t.fontColor ? t.fontColor : "#FFFFFF", a = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
+ switch (t.typeC4Shape.text) {
+ case "person":
+ a = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
+ break;
+ case "external_person":
+ a = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
+ break;
+ }
+ const s = e.append("g");
+ s.attr("class", "person-man");
+ const i = Ne();
+ switch (t.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ case "system":
+ case "external_system":
+ case "container":
+ case "external_container":
+ case "component":
+ case "external_component":
+ i.x = t.x, i.y = t.y, i.fill = o, i.width = t.width, i.height = t.height, i.stroke = l, i.rx = 2.5, i.ry = 2.5, i.attrs = { "stroke-width": 0.5 }, ne(s, i);
+ break;
+ case "system_db":
+ case "external_system_db":
+ case "container_db":
+ case "external_container_db":
+ case "component_db":
+ case "external_component_db":
+ s.append("path").attr("fill", o).attr("stroke-width", "0.5").attr("stroke", l).attr(
+ "d",
+ "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", t.x).replaceAll("starty", t.y).replaceAll("half", t.width / 2).replaceAll("height", t.height)
+ ), s.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", l).attr(
+ "d",
+ "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", t.x).replaceAll("starty", t.y).replaceAll("half", t.width / 2)
+ );
+ break;
+ case "system_queue":
+ case "external_system_queue":
+ case "container_queue":
+ case "external_container_queue":
+ case "component_queue":
+ case "external_component_queue":
+ s.append("path").attr("fill", o).attr("stroke-width", "0.5").attr("stroke", l).attr(
+ "d",
+ "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", t.x).replaceAll("starty", t.y).replaceAll("width", t.width).replaceAll("half", t.height / 2)
+ ), s.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", l).attr(
+ "d",
+ "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", t.x + t.width).replaceAll("starty", t.y).replaceAll("half", t.height / 2)
+ );
+ break;
+ }
+ let u = k0(r, t.typeC4Shape.text);
+ switch (s.append("text").attr("fill", n).attr("font-family", u.fontFamily).attr("font-size", u.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", t.typeC4Shape.width).attr("x", t.x + t.width / 2 - t.typeC4Shape.width / 2).attr("y", t.y + t.typeC4Shape.Y).text("<<" + t.typeC4Shape.text + ">>"), t.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ ye(
+ s,
+ 48,
+ 48,
+ t.x + t.width / 2 - 24,
+ t.y + t.image.Y,
+ a
+ );
+ break;
+ }
+ let d = r[t.typeC4Shape.text + "Font"]();
+ return d.fontWeight = "bold", d.fontSize = d.fontSize + 2, d.fontColor = n, W(r)(
+ t.label.text,
+ s,
+ t.x,
+ t.y + t.label.Y,
+ t.width,
+ t.height,
+ { fill: n },
+ d
+ ), d = r[t.typeC4Shape.text + "Font"](), d.fontColor = n, t.techn && ((f = t.techn) == null ? void 0 : f.text) !== "" ? W(r)(
+ t.techn.text,
+ s,
+ t.x,
+ t.y + t.techn.Y,
+ t.width,
+ t.height,
+ { fill: n, "font-style": "italic" },
+ d
+ ) : t.type && t.type.text !== "" && W(r)(
+ t.type.text,
+ s,
+ t.x,
+ t.y + t.type.Y,
+ t.width,
+ t.height,
+ { fill: n, "font-style": "italic" },
+ d
+ ), t.descr && t.descr.text !== "" && (d = r.personFont(), d.fontColor = n, W(r)(
+ t.descr.text,
+ s,
+ t.x,
+ t.y + t.descr.Y,
+ t.width,
+ t.height,
+ { fill: n },
+ d
+ )), t.height;
+}, p0 = function(e) {
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
+ );
+}, y0 = function(e) {
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
+ );
+}, g0 = function(e) {
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
+ );
+}, b0 = function(e) {
+ e.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
+}, _0 = function(e) {
+ e.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");
+}, x0 = function(e) {
+ e.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
+}, m0 = function(e) {
+ e.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
+}, E0 = function(e) {
+ const r = e.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
+ r.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z"), r.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");
+}, k0 = (e, t) => ({
+ fontFamily: e[t + "FontFamily"],
+ fontSize: e[t + "FontSize"],
+ fontWeight: e[t + "FontWeight"]
+}), W = function() {
+ function e(l, n, a, s, i, u, d) {
+ const f = n.append("text").attr("x", a + i / 2).attr("y", s + u / 2 + 5).style("text-anchor", "middle").text(l);
+ o(f, d);
+ }
+ function t(l, n, a, s, i, u, d, f) {
+ const { fontSize: p, fontFamily: E, fontWeight: O } = f, R = l.split(Kt.lineBreakRegex);
+ for (let S = 0; S < R.length; S++) {
+ const L = S * p - p * (R.length - 1) / 2, Y = n.append("text").attr("x", a + i / 2).attr("y", s).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", p).style("font-weight", O).style("font-family", E);
+ Y.append("tspan").attr("dy", L).text(R[S]).attr("alignment-baseline", "mathematical"), o(Y, d);
+ }
+ }
+ function r(l, n, a, s, i, u, d, f) {
+ const p = n.append("switch"), O = p.append("foreignObject").attr("x", a).attr("y", s).attr("width", i).attr("height", u).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
+ O.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(l), t(l, p, a, s, i, u, d, f), o(O, d);
+ }
+ function o(l, n) {
+ for (const a in n)
+ n.hasOwnProperty(a) && l.attr(a, n[a]);
+ }
+ return function(l) {
+ return l.textPlacement === "fo" ? r : l.textPlacement === "old" ? e : t;
+ };
+}(), F = {
+ drawRect: ne,
+ drawBoundary: d0,
+ drawC4Shape: f0,
+ drawRels: u0,
+ drawImage: ye,
+ insertArrowHead: b0,
+ insertArrowEnd: _0,
+ insertArrowFilledHead: x0,
+ insertDynamicNumber: m0,
+ insertArrowCrossHead: E0,
+ insertDatabaseIcon: p0,
+ insertComputerIcon: y0,
+ insertClockIcon: g0
+};
+let Ut = 0, Ft = 0, ge = 4, Zt = 2;
+Yt.yy = Jt;
+let b = {};
+class be {
+ constructor(t) {
+ this.name = "", this.data = {}, this.data.startx = void 0, this.data.stopx = void 0, this.data.starty = void 0, this.data.stopy = void 0, this.data.widthLimit = void 0, this.nextData = {}, this.nextData.startx = void 0, this.nextData.stopx = void 0, this.nextData.starty = void 0, this.nextData.stopy = void 0, this.nextData.cnt = 0, $t(t.db.getConfig());
+ }
+ setData(t, r, o, l) {
+ this.nextData.startx = this.data.startx = t, this.nextData.stopx = this.data.stopx = r, this.nextData.starty = this.data.starty = o, this.nextData.stopy = this.data.stopy = l;
+ }
+ updateVal(t, r, o, l) {
+ t[r] === void 0 ? t[r] = o : t[r] = l(o, t[r]);
+ }
+ insert(t) {
+ this.nextData.cnt = this.nextData.cnt + 1;
+ let r = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + t.margin : this.nextData.stopx + t.margin * 2, o = r + t.width, l = this.nextData.starty + t.margin * 2, n = l + t.height;
+ (r >= this.data.widthLimit || o >= this.data.widthLimit || this.nextData.cnt > ge) && (r = this.nextData.startx + t.margin + b.nextLinePaddingX, l = this.nextData.stopy + t.margin * 2, this.nextData.stopx = o = r + t.width, this.nextData.starty = this.nextData.stopy, this.nextData.stopy = n = l + t.height, this.nextData.cnt = 1), t.x = r, t.y = l, this.updateVal(this.data, "startx", r, Math.min), this.updateVal(this.data, "starty", l, Math.min), this.updateVal(this.data, "stopx", o, Math.max), this.updateVal(this.data, "stopy", n, Math.max), this.updateVal(this.nextData, "startx", r, Math.min), this.updateVal(this.nextData, "starty", l, Math.min), this.updateVal(this.nextData, "stopx", o, Math.max), this.updateVal(this.nextData, "stopy", n, Math.max);
+ }
+ init(t) {
+ this.name = "", this.data = {
+ startx: void 0,
+ stopx: void 0,
+ starty: void 0,
+ stopy: void 0,
+ widthLimit: void 0
+ }, this.nextData = {
+ startx: void 0,
+ stopx: void 0,
+ starty: void 0,
+ stopy: void 0,
+ cnt: 0
+ }, $t(t.db.getConfig());
+ }
+ bumpLastMargin(t) {
+ this.data.stopx += t, this.data.stopy += t;
+ }
+}
+const $t = function(e) {
+ Se(b, e), e.fontFamily && (b.personFontFamily = b.systemFontFamily = b.messageFontFamily = e.fontFamily), e.fontSize && (b.personFontSize = b.systemFontSize = b.messageFontSize = e.fontSize), e.fontWeight && (b.personFontWeight = b.systemFontWeight = b.messageFontWeight = e.fontWeight);
+}, Rt = (e, t) => ({
+ fontFamily: e[t + "FontFamily"],
+ fontSize: e[t + "FontSize"],
+ fontWeight: e[t + "FontWeight"]
+}), Bt = (e) => ({
+ fontFamily: e.boundaryFontFamily,
+ fontSize: e.boundaryFontSize,
+ fontWeight: e.boundaryFontWeight
+}), A0 = (e) => ({
+ fontFamily: e.messageFontFamily,
+ fontSize: e.messageFontSize,
+ fontWeight: e.messageFontWeight
+});
+function I(e, t, r, o, l) {
+ if (!t[e].width)
+ if (r)
+ t[e].text = Me(t[e].text, l, o), t[e].textLines = t[e].text.split(Kt.lineBreakRegex).length, t[e].width = l, t[e].height = oe(t[e].text, o);
+ else {
+ let n = t[e].text.split(Kt.lineBreakRegex);
+ t[e].textLines = n.length;
+ let a = 0;
+ t[e].height = 0, t[e].width = 0;
+ for (const s of n)
+ t[e].width = Math.max(
+ wt(s, o),
+ t[e].width
+ ), a = oe(s, o), t[e].height = t[e].height + a;
+ }
+}
+const _e = function(e, t, r) {
+ t.x = r.data.startx, t.y = r.data.starty, t.width = r.data.stopx - r.data.startx, t.height = r.data.stopy - r.data.starty, t.label.y = b.c4ShapeMargin - 35;
+ let o = t.wrap && b.wrap, l = Bt(b);
+ l.fontSize = l.fontSize + 2, l.fontWeight = "bold";
+ let n = wt(t.label.text, l);
+ I("label", t, o, l, n), F.drawBoundary(e, t, b);
+}, xe = function(e, t, r, o) {
+ let l = 0;
+ for (const n of o) {
+ l = 0;
+ const a = r[n];
+ let s = Rt(b, a.typeC4Shape.text);
+ switch (s.fontSize = s.fontSize - 2, a.typeC4Shape.width = wt(
+ "«" + a.typeC4Shape.text + "»",
+ s
+ ), a.typeC4Shape.height = s.fontSize + 2, a.typeC4Shape.Y = b.c4ShapePadding, l = a.typeC4Shape.Y + a.typeC4Shape.height - 4, a.image = { width: 0, height: 0, Y: 0 }, a.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ a.image.width = 48, a.image.height = 48, a.image.Y = l, l = a.image.Y + a.image.height;
+ break;
+ }
+ a.sprite && (a.image.width = 48, a.image.height = 48, a.image.Y = l, l = a.image.Y + a.image.height);
+ let i = a.wrap && b.wrap, u = b.width - b.c4ShapePadding * 2, d = Rt(b, a.typeC4Shape.text);
+ if (d.fontSize = d.fontSize + 2, d.fontWeight = "bold", I("label", a, i, d, u), a.label.Y = l + 8, l = a.label.Y + a.label.height, a.type && a.type.text !== "") {
+ a.type.text = "[" + a.type.text + "]";
+ let E = Rt(b, a.typeC4Shape.text);
+ I("type", a, i, E, u), a.type.Y = l + 5, l = a.type.Y + a.type.height;
+ } else if (a.techn && a.techn.text !== "") {
+ a.techn.text = "[" + a.techn.text + "]";
+ let E = Rt(b, a.techn.text);
+ I("techn", a, i, E, u), a.techn.Y = l + 5, l = a.techn.Y + a.techn.height;
+ }
+ let f = l, p = a.label.width;
+ if (a.descr && a.descr.text !== "") {
+ let E = Rt(b, a.typeC4Shape.text);
+ I("descr", a, i, E, u), a.descr.Y = l + 20, l = a.descr.Y + a.descr.height, p = Math.max(a.label.width, a.descr.width), f = l - a.descr.textLines * 5;
+ }
+ p = p + b.c4ShapePadding, a.width = Math.max(a.width || b.width, p, b.width), a.height = Math.max(a.height || b.height, f, b.height), a.margin = a.margin || b.c4ShapeMargin, e.insert(a), F.drawC4Shape(t, a, b);
+ }
+ e.bumpLastMargin(b.c4ShapeMargin);
+};
+class B {
+ constructor(t, r) {
+ this.x = t, this.y = r;
+ }
+}
+let ce = function(e, t) {
+ let r = e.x, o = e.y, l = t.x, n = t.y, a = r + e.width / 2, s = o + e.height / 2, i = Math.abs(r - l), u = Math.abs(o - n), d = u / i, f = e.height / e.width, p = null;
+ return o == n && r < l ? p = new B(r + e.width, s) : o == n && r > l ? p = new B(r, s) : r == l && o < n ? p = new B(a, o + e.height) : r == l && o > n && (p = new B(a, o)), r > l && o < n ? f >= d ? p = new B(r, s + d * e.width / 2) : p = new B(
+ a - i / u * e.height / 2,
+ o + e.height
+ ) : r < l && o < n ? f >= d ? p = new B(r + e.width, s + d * e.width / 2) : p = new B(
+ a + i / u * e.height / 2,
+ o + e.height
+ ) : r < l && o > n ? f >= d ? p = new B(r + e.width, s - d * e.width / 2) : p = new B(a + e.height / 2 * i / u, o) : r > l && o > n && (f >= d ? p = new B(r, s - e.width / 2 * d) : p = new B(a - e.height / 2 * i / u, o)), p;
+}, C0 = function(e, t) {
+ let r = { x: 0, y: 0 };
+ r.x = t.x + t.width / 2, r.y = t.y + t.height / 2;
+ let o = ce(e, r);
+ r.x = e.x + e.width / 2, r.y = e.y + e.height / 2;
+ let l = ce(t, r);
+ return { startPoint: o, endPoint: l };
+};
+const v0 = function(e, t, r, o) {
+ let l = 0;
+ for (let n of t) {
+ l = l + 1;
+ let a = n.wrap && b.wrap, s = A0(b);
+ o.db.getC4Type() === "C4Dynamic" && (n.label.text = l + ": " + n.label.text);
+ let u = wt(n.label.text, s);
+ I("label", n, a, s, u), n.techn && n.techn.text !== "" && (u = wt(n.techn.text, s), I("techn", n, a, s, u)), n.descr && n.descr.text !== "" && (u = wt(n.descr.text, s), I("descr", n, a, s, u));
+ let d = r(n.from), f = r(n.to), p = C0(d, f);
+ n.startPoint = p.startPoint, n.endPoint = p.endPoint;
+ }
+ F.drawRels(e, t, b);
+};
+function me(e, t, r, o, l) {
+ let n = new be(l);
+ n.data.widthLimit = r.data.widthLimit / Math.min(Zt, o.length);
+ for (let [a, s] of o.entries()) {
+ let i = 0;
+ s.image = { width: 0, height: 0, Y: 0 }, s.sprite && (s.image.width = 48, s.image.height = 48, s.image.Y = i, i = s.image.Y + s.image.height);
+ let u = s.wrap && b.wrap, d = Bt(b);
+ if (d.fontSize = d.fontSize + 2, d.fontWeight = "bold", I(
+ "label",
+ s,
+ u,
+ d,
+ n.data.widthLimit
+ ), s.label.Y = i + 8, i = s.label.Y + s.label.height, s.type && s.type.text !== "") {
+ s.type.text = "[" + s.type.text + "]";
+ let O = Bt(b);
+ I(
+ "type",
+ s,
+ u,
+ O,
+ n.data.widthLimit
+ ), s.type.Y = i + 5, i = s.type.Y + s.type.height;
+ }
+ if (s.descr && s.descr.text !== "") {
+ let O = Bt(b);
+ O.fontSize = O.fontSize - 2, I(
+ "descr",
+ s,
+ u,
+ O,
+ n.data.widthLimit
+ ), s.descr.Y = i + 20, i = s.descr.Y + s.descr.height;
+ }
+ if (a == 0 || a % Zt === 0) {
+ let O = r.data.startx + b.diagramMarginX, R = r.data.stopy + b.diagramMarginY + i;
+ n.setData(O, O, R, R);
+ } else {
+ let O = n.data.stopx !== n.data.startx ? n.data.stopx + b.diagramMarginX : n.data.startx, R = n.data.starty;
+ n.setData(O, O, R, R);
+ }
+ n.name = s.alias;
+ let f = l.db.getC4ShapeArray(s.alias), p = l.db.getC4ShapeKeys(s.alias);
+ p.length > 0 && xe(
+ n,
+ e,
+ f,
+ p
+ ), t = s.alias;
+ let E = l.db.getBoundarys(t);
+ E.length > 0 && me(
+ e,
+ t,
+ n,
+ E,
+ l
+ ), s.alias !== "global" && _e(e, s, n), r.data.stopy = Math.max(
+ n.data.stopy + b.c4ShapeMargin,
+ r.data.stopy
+ ), r.data.stopx = Math.max(
+ n.data.stopx + b.c4ShapeMargin,
+ r.data.stopx
+ ), Ut = Math.max(Ut, r.data.stopx), Ft = Math.max(Ft, r.data.stopy);
+ }
+}
+const w0 = function(e, t, r, o) {
+ b = Dt().c4;
+ const l = Dt().securityLevel;
+ let n;
+ l === "sandbox" && (n = Nt("#i" + t));
+ const a = l === "sandbox" ? Nt(n.nodes()[0].contentDocument.body) : Nt("body");
+ let s = o.db;
+ o.db.setWrap(b.wrap), ge = s.getC4ShapeInRow(), Zt = s.getC4BoundaryInRow(), le.debug(`C:${JSON.stringify(b, null, 2)}`);
+ const i = l === "sandbox" ? a.select(`[id="${t}"]`) : Nt(`[id="${t}"]`);
+ F.insertComputerIcon(i), F.insertDatabaseIcon(i), F.insertClockIcon(i);
+ let u = new be(o);
+ u.setData(
+ b.diagramMarginX,
+ b.diagramMarginX,
+ b.diagramMarginY,
+ b.diagramMarginY
+ ), u.data.widthLimit = screen.availWidth, Ut = b.diagramMarginX, Ft = b.diagramMarginY;
+ const d = o.db.getTitle();
+ let f = o.db.getBoundarys("");
+ me(i, "", u, f, o), F.insertArrowHead(i), F.insertArrowEnd(i), F.insertArrowCrossHead(i), F.insertArrowFilledHead(i), v0(i, o.db.getRels(), o.db.getC4Shape, o), u.data.stopx = Ut, u.data.stopy = Ft;
+ const p = u.data;
+ let O = p.stopy - p.starty + 2 * b.diagramMarginY;
+ const S = p.stopx - p.startx + 2 * b.diagramMarginX;
+ d && i.append("text").text(d).attr("x", (p.stopx - p.startx) / 2 - 4 * b.diagramMarginX).attr("y", p.starty + b.diagramMarginY), Pe(i, O, S, b.useMaxWidth);
+ const L = d ? 60 : 0;
+ i.attr(
+ "viewBox",
+ p.startx - b.diagramMarginX + " -" + (b.diagramMarginY + L) + " " + S + " " + (O + L)
+ ), le.debug("models:", p);
+}, he = {
+ drawPersonOrSystemArray: xe,
+ drawBoundary: _e,
+ setConf: $t,
+ draw: w0
+}, O0 = (e) => `.person {
+ stroke: ${e.personBorder};
+ fill: ${e.personBkg};
+ }
+`, T0 = O0, S0 = {
+ parser: Be,
+ db: Jt,
+ renderer: he,
+ styles: T0,
+ init: ({ c4: e, wrap: t }) => {
+ he.setConf(e), Jt.setWrap(t);
+ }
+};
+export {
+ S0 as diagram
+};
diff --git a/assets/lib/mermaid/c4Diagram-ae766693.js b/assets/lib/mermaid/c4Diagram-ae766693.js
new file mode 100644
index 00000000..5daf9f83
--- /dev/null
+++ b/assets/lib/mermaid/c4Diagram-ae766693.js
@@ -0,0 +1,2473 @@
+import { s as setAccTitle, g as getAccTitle, a as getAccDescription, b as setAccDescription, c as getConfig, d as sanitizeText, e as common, f as assignWithDepth, h as calculateTextWidth, l as log, i as configureSvgSize, w as wrapLabel, j as calculateTextHeight } from "./mermaid-6dc72991.js";
+import { select } from "d3";
+import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-5e1cfd1d.js";
+import { sanitizeUrl } from "@braintree/sanitize-url";
+import "ts-dedent";
+import "dayjs";
+import "dompurify";
+import "khroma";
+import "lodash-es/memoize.js";
+import "lodash-es/merge.js";
+import "stylis";
+import "lodash-es/isEmpty.js";
+var parser = function() {
+ var o = function(k, v, o2, l) {
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
+ ;
+ return o2;
+ }, $V0 = [1, 24], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 63], $V6 = [1, 64], $V7 = [1, 65], $V8 = [1, 66], $V9 = [1, 67], $Va = [1, 68], $Vb = [1, 69], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 43], $Vr = [1, 44], $Vs = [1, 45], $Vt = [1, 46], $Vu = [1, 47], $Vv = [1, 48], $Vw = [1, 50], $Vx = [1, 51], $Vy = [1, 52], $Vz = [1, 53], $VA = [1, 54], $VB = [1, 55], $VC = [1, 56], $VD = [1, 57], $VE = [1, 58], $VF = [1, 59], $VG = [1, 60], $VH = [14, 42], $VI = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VJ = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VK = [1, 82], $VL = [1, 83], $VM = [1, 84], $VN = [1, 85], $VO = [12, 14, 42], $VP = [12, 14, 33, 42], $VQ = [12, 14, 33, 42, 76, 77, 79, 80], $VR = [12, 33], $VS = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74];
+ var parser2 = {
+ trace: function trace() {
+ },
+ yy: {},
+ symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "direction_tb": 6, "direction_bt": 7, "direction_rl": 8, "direction_lr": 9, "graphConfig": 10, "C4_CONTEXT": 11, "NEWLINE": 12, "statements": 13, "EOF": 14, "C4_CONTAINER": 15, "C4_COMPONENT": 16, "C4_DYNAMIC": 17, "C4_DEPLOYMENT": 18, "otherStatements": 19, "diagramStatements": 20, "otherStatement": 21, "title": 22, "accDescription": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "boundaryStatement": 29, "boundaryStartStatement": 30, "boundaryStopStatement": 31, "boundaryStart": 32, "LBRACE": 33, "ENTERPRISE_BOUNDARY": 34, "attributes": 35, "SYSTEM_BOUNDARY": 36, "BOUNDARY": 37, "CONTAINER_BOUNDARY": 38, "NODE": 39, "NODE_L": 40, "NODE_R": 41, "RBRACE": 42, "diagramStatement": 43, "PERSON": 44, "PERSON_EXT": 45, "SYSTEM": 46, "SYSTEM_DB": 47, "SYSTEM_QUEUE": 48, "SYSTEM_EXT": 49, "SYSTEM_EXT_DB": 50, "SYSTEM_EXT_QUEUE": 51, "CONTAINER": 52, "CONTAINER_DB": 53, "CONTAINER_QUEUE": 54, "CONTAINER_EXT": 55, "CONTAINER_EXT_DB": 56, "CONTAINER_EXT_QUEUE": 57, "COMPONENT": 58, "COMPONENT_DB": 59, "COMPONENT_QUEUE": 60, "COMPONENT_EXT": 61, "COMPONENT_EXT_DB": 62, "COMPONENT_EXT_QUEUE": 63, "REL": 64, "BIREL": 65, "REL_U": 66, "REL_D": 67, "REL_L": 68, "REL_R": 69, "REL_B": 70, "REL_INDEX": 71, "UPDATE_EL_STYLE": 72, "UPDATE_REL_STYLE": 73, "UPDATE_LAYOUT_CONFIG": 74, "attribute": 75, "STR": 76, "STR_KEY": 77, "STR_VALUE": 78, "ATTRIBUTE": 79, "ATTRIBUTE_EMPTY": 80, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" },
+ productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]],
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
+ var $0 = $$.length - 1;
+ switch (yystate) {
+ case 3:
+ yy.setDirection("TB");
+ break;
+ case 4:
+ yy.setDirection("BT");
+ break;
+ case 5:
+ yy.setDirection("RL");
+ break;
+ case 6:
+ yy.setDirection("LR");
+ break;
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ yy.setC4Type($$[$0 - 3]);
+ break;
+ case 19:
+ yy.setTitle($$[$0].substring(6));
+ this.$ = $$[$0].substring(6);
+ break;
+ case 20:
+ yy.setAccDescription($$[$0].substring(15));
+ this.$ = $$[$0].substring(15);
+ break;
+ case 21:
+ this.$ = $$[$0].trim();
+ yy.setTitle(this.$);
+ break;
+ case 22:
+ case 23:
+ this.$ = $$[$0].trim();
+ yy.setAccDescription(this.$);
+ break;
+ case 28:
+ case 29:
+ $$[$0].splice(2, 0, "ENTERPRISE");
+ yy.addPersonOrSystemBoundary(...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 30:
+ yy.addPersonOrSystemBoundary(...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 31:
+ $$[$0].splice(2, 0, "CONTAINER");
+ yy.addContainerBoundary(...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 32:
+ yy.addDeploymentNode("node", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 33:
+ yy.addDeploymentNode("nodeL", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 34:
+ yy.addDeploymentNode("nodeR", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 35:
+ yy.popBoundaryParseStack();
+ break;
+ case 39:
+ yy.addPersonOrSystem("person", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 40:
+ yy.addPersonOrSystem("external_person", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 41:
+ yy.addPersonOrSystem("system", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 42:
+ yy.addPersonOrSystem("system_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 43:
+ yy.addPersonOrSystem("system_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 44:
+ yy.addPersonOrSystem("external_system", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 45:
+ yy.addPersonOrSystem("external_system_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 46:
+ yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 47:
+ yy.addContainer("container", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 48:
+ yy.addContainer("container_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 49:
+ yy.addContainer("container_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 50:
+ yy.addContainer("external_container", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 51:
+ yy.addContainer("external_container_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 52:
+ yy.addContainer("external_container_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 53:
+ yy.addComponent("component", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 54:
+ yy.addComponent("component_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 55:
+ yy.addComponent("component_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 56:
+ yy.addComponent("external_component", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 57:
+ yy.addComponent("external_component_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 58:
+ yy.addComponent("external_component_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 60:
+ yy.addRel("rel", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 61:
+ yy.addRel("birel", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 62:
+ yy.addRel("rel_u", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 63:
+ yy.addRel("rel_d", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 64:
+ yy.addRel("rel_l", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 65:
+ yy.addRel("rel_r", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 66:
+ yy.addRel("rel_b", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 67:
+ $$[$0].splice(0, 1);
+ yy.addRel("rel", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 68:
+ yy.updateElStyle("update_el_style", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 69:
+ yy.updateRelStyle("update_rel_style", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 70:
+ yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 71:
+ this.$ = [$$[$0]];
+ break;
+ case 72:
+ $$[$0].unshift($$[$0 - 1]);
+ this.$ = $$[$0];
+ break;
+ case 73:
+ case 75:
+ this.$ = $$[$0].trim();
+ break;
+ case 74:
+ let kv = {};
+ kv[$$[$0 - 1].trim()] = $$[$0].trim();
+ this.$ = kv;
+ break;
+ case 76:
+ this.$ = "";
+ break;
+ }
+ },
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VH, [2, 14]), o($VI, [2, 16], { 12: [1, 76] }), o($VH, [2, 36], { 12: [1, 77] }), o($VJ, [2, 19]), o($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o($VH, [2, 15]), o($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VJ, [2, 21]), o($VJ, [2, 22]), o($VO, [2, 39]), o($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o($VQ, [2, 73]), { 78: [1, 133] }, o($VQ, [2, 75]), o($VQ, [2, 76]), o($VO, [2, 40]), o($VO, [2, 41]), o($VO, [2, 42]), o($VO, [2, 43]), o($VO, [2, 44]), o($VO, [2, 45]), o($VO, [2, 46]), o($VO, [2, 47]), o($VO, [2, 48]), o($VO, [2, 49]), o($VO, [2, 50]), o($VO, [2, 51]), o($VO, [2, 52]), o($VO, [2, 53]), o($VO, [2, 54]), o($VO, [2, 55]), o($VO, [2, 56]), o($VO, [2, 57]), o($VO, [2, 58]), o($VO, [2, 60]), o($VO, [2, 61]), o($VO, [2, 62]), o($VO, [2, 63]), o($VO, [2, 64]), o($VO, [2, 65]), o($VO, [2, 66]), o($VO, [2, 67]), o($VO, [2, 68]), o($VO, [2, 69]), o($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o($VR, [2, 28]), o($VR, [2, 29]), o($VR, [2, 30]), o($VR, [2, 31]), o($VR, [2, 32]), o($VR, [2, 33]), o($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o($VI, [2, 18]), o($VH, [2, 38]), o($VP, [2, 72]), o($VQ, [2, 74]), o($VO, [2, 24]), o($VO, [2, 35]), o($VS, [2, 25]), o($VS, [2, 26], { 12: [1, 138] }), o($VS, [2, 27])],
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
+ parseError: function parseError(str, hash) {
+ if (hash.recoverable) {
+ this.trace(str);
+ } else {
+ var error = new Error(str);
+ error.hash = hash;
+ throw error;
+ }
+ },
+ parse: function parse(input) {
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
+ var args = lstack.slice.call(arguments, 1);
+ var lexer2 = Object.create(this.lexer);
+ var sharedState = { yy: {} };
+ for (var k in this.yy) {
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
+ sharedState.yy[k] = this.yy[k];
+ }
+ }
+ lexer2.setInput(input, sharedState.yy);
+ sharedState.yy.lexer = lexer2;
+ sharedState.yy.parser = this;
+ if (typeof lexer2.yylloc == "undefined") {
+ lexer2.yylloc = {};
+ }
+ var yyloc = lexer2.yylloc;
+ lstack.push(yyloc);
+ var ranges = lexer2.options && lexer2.options.ranges;
+ if (typeof sharedState.yy.parseError === "function") {
+ this.parseError = sharedState.yy.parseError;
+ } else {
+ this.parseError = Object.getPrototypeOf(this).parseError;
+ }
+ function lex() {
+ var token;
+ token = tstack.pop() || lexer2.lex() || EOF;
+ if (typeof token !== "number") {
+ if (token instanceof Array) {
+ tstack = token;
+ token = tstack.pop();
+ }
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol === null || typeof symbol == "undefined") {
+ symbol = lex();
+ }
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ var errStr = "";
+ expected = [];
+ for (p in table[state]) {
+ if (this.terminals_[p] && p > TERROR) {
+ expected.push("'" + this.terminals_[p] + "'");
+ }
+ }
+ if (lexer2.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {
+ text: lexer2.match,
+ token: this.terminals_[symbol] || symbol,
+ line: lexer2.yylineno,
+ loc: yyloc,
+ expected
+ });
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(lexer2.yytext);
+ lstack.push(lexer2.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ {
+ yyleng = lexer2.yyleng;
+ yytext = lexer2.yytext;
+ yylineno = lexer2.yylineno;
+ yyloc = lexer2.yylloc;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = {
+ first_line: lstack[lstack.length - (len || 1)].first_line,
+ last_line: lstack[lstack.length - 1].last_line,
+ first_column: lstack[lstack.length - (len || 1)].first_column,
+ last_column: lstack[lstack.length - 1].last_column
+ };
+ if (ranges) {
+ yyval._$.range = [
+ lstack[lstack.length - (len || 1)].range[0],
+ lstack[lstack.length - 1].range[1]
+ ];
+ }
+ r = this.performAction.apply(yyval, [
+ yytext,
+ yyleng,
+ yylineno,
+ sharedState.yy,
+ action[1],
+ vstack,
+ lstack
+ ].concat(args));
+ if (typeof r !== "undefined") {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+ }
+ };
+ var lexer = function() {
+ var lexer2 = {
+ EOF: 1,
+ parseError: function parseError(str, hash) {
+ if (this.yy.parser) {
+ this.yy.parser.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+ // resets the lexer, sets new input
+ setInput: function(input, yy) {
+ this.yy = yy || this.yy || {};
+ this._input = input;
+ this._more = this._backtrack = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = "";
+ this.conditionStack = ["INITIAL"];
+ this.yylloc = {
+ first_line: 1,
+ first_column: 0,
+ last_line: 1,
+ last_column: 0
+ };
+ if (this.options.ranges) {
+ this.yylloc.range = [0, 0];
+ }
+ this.offset = 0;
+ return this;
+ },
+ // consumes and returns one char from the input
+ input: function() {
+ var ch = this._input[0];
+ this.yytext += ch;
+ this.yyleng++;
+ this.offset++;
+ this.match += ch;
+ this.matched += ch;
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno++;
+ this.yylloc.last_line++;
+ } else {
+ this.yylloc.last_column++;
+ }
+ if (this.options.ranges) {
+ this.yylloc.range[1]++;
+ }
+ this._input = this._input.slice(1);
+ return ch;
+ },
+ // unshifts one char (or a string) into the input
+ unput: function(ch) {
+ var len = ch.length;
+ var lines = ch.split(/(?:\r\n?|\n)/g);
+ this._input = ch + this._input;
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
+ this.offset -= len;
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
+ this.match = this.match.substr(0, this.match.length - 1);
+ this.matched = this.matched.substr(0, this.matched.length - 1);
+ if (lines.length - 1) {
+ this.yylineno -= lines.length - 1;
+ }
+ var r = this.yylloc.range;
+ this.yylloc = {
+ first_line: this.yylloc.first_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.first_column,
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
+ };
+ if (this.options.ranges) {
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
+ }
+ this.yyleng = this.yytext.length;
+ return this;
+ },
+ // When called from action, caches matched text and appends it on next action
+ more: function() {
+ this._more = true;
+ return this;
+ },
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
+ reject: function() {
+ if (this.options.backtrack_lexer) {
+ this._backtrack = true;
+ } else {
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ }
+ return this;
+ },
+ // retain first n characters of the match
+ less: function(n) {
+ this.unput(this.match.slice(n));
+ },
+ // displays already matched input, i.e. for error messages
+ pastInput: function() {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
+ },
+ // displays upcoming input, i.e. for error messages
+ upcomingInput: function() {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20 - next.length);
+ }
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
+ },
+ // displays the character position where the lexing error occurred, i.e. for error messages
+ showPosition: function() {
+ var pre = this.pastInput();
+ var c2 = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c2 + "^";
+ },
+ // test the lexed token: return FALSE when not a match, otherwise return token
+ test_match: function(match, indexed_rule) {
+ var token, lines, backup;
+ if (this.options.backtrack_lexer) {
+ backup = {
+ yylineno: this.yylineno,
+ yylloc: {
+ first_line: this.yylloc.first_line,
+ last_line: this.last_line,
+ first_column: this.yylloc.first_column,
+ last_column: this.yylloc.last_column
+ },
+ yytext: this.yytext,
+ match: this.match,
+ matches: this.matches,
+ matched: this.matched,
+ yyleng: this.yyleng,
+ offset: this.offset,
+ _more: this._more,
+ _input: this._input,
+ yy: this.yy,
+ conditionStack: this.conditionStack.slice(0),
+ done: this.done
+ };
+ if (this.options.ranges) {
+ backup.yylloc.range = this.yylloc.range.slice(0);
+ }
+ }
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno += lines.length;
+ }
+ this.yylloc = {
+ first_line: this.yylloc.last_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
+ };
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ if (this.options.ranges) {
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
+ }
+ this._more = false;
+ this._backtrack = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
+ if (this.done && this._input) {
+ this.done = false;
+ }
+ if (token) {
+ return token;
+ } else if (this._backtrack) {
+ for (var k in backup) {
+ this[k] = backup[k];
+ }
+ return false;
+ }
+ return false;
+ },
+ // return next match in input
+ next: function() {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) {
+ this.done = true;
+ }
+ var token, match, tempMatch, index;
+ if (!this._more) {
+ this.yytext = "";
+ this.match = "";
+ }
+ var rules = this._currentRules();
+ for (var i = 0; i < rules.length; i++) {
+ tempMatch = this._input.match(this.rules[rules[i]]);
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
+ match = tempMatch;
+ index = i;
+ if (this.options.backtrack_lexer) {
+ token = this.test_match(tempMatch, rules[i]);
+ if (token !== false) {
+ return token;
+ } else if (this._backtrack) {
+ match = false;
+ continue;
+ } else {
+ return false;
+ }
+ } else if (!this.options.flex) {
+ break;
+ }
+ }
+ }
+ if (match) {
+ token = this.test_match(match, rules[index]);
+ if (token !== false) {
+ return token;
+ }
+ return false;
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ }
+ },
+ // return next match that has a token
+ lex: function lex() {
+ var r = this.next();
+ if (r) {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
+ begin: function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+ // pop the previously active lexer condition state off the condition stack
+ popState: function popState() {
+ var n = this.conditionStack.length - 1;
+ if (n > 0) {
+ return this.conditionStack.pop();
+ } else {
+ return this.conditionStack[0];
+ }
+ },
+ // produce the lexer rule set which is active for the currently active lexer condition state
+ _currentRules: function _currentRules() {
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
+ } else {
+ return this.conditions["INITIAL"].rules;
+ }
+ },
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
+ topState: function topState(n) {
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
+ if (n >= 0) {
+ return this.conditionStack[n];
+ } else {
+ return "INITIAL";
+ }
+ },
+ // alias for begin(condition)
+ pushState: function pushState(condition) {
+ this.begin(condition);
+ },
+ // return the number of states currently on the stack
+ stateStackSize: function stateStackSize() {
+ return this.conditionStack.length;
+ },
+ options: {},
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
+ switch ($avoiding_name_collisions) {
+ case 0:
+ return 6;
+ case 1:
+ return 7;
+ case 2:
+ return 8;
+ case 3:
+ return 9;
+ case 4:
+ return 22;
+ case 5:
+ return 23;
+ case 6:
+ this.begin("acc_title");
+ return 24;
+ case 7:
+ this.popState();
+ return "acc_title_value";
+ case 8:
+ this.begin("acc_descr");
+ return 26;
+ case 9:
+ this.popState();
+ return "acc_descr_value";
+ case 10:
+ this.begin("acc_descr_multiline");
+ break;
+ case 11:
+ this.popState();
+ break;
+ case 12:
+ return "acc_descr_multiline_value";
+ case 13:
+ break;
+ case 14:
+ c;
+ break;
+ case 15:
+ return 12;
+ case 16:
+ break;
+ case 17:
+ return 11;
+ case 18:
+ return 15;
+ case 19:
+ return 16;
+ case 20:
+ return 17;
+ case 21:
+ return 18;
+ case 22:
+ this.begin("person_ext");
+ return 45;
+ case 23:
+ this.begin("person");
+ return 44;
+ case 24:
+ this.begin("system_ext_queue");
+ return 51;
+ case 25:
+ this.begin("system_ext_db");
+ return 50;
+ case 26:
+ this.begin("system_ext");
+ return 49;
+ case 27:
+ this.begin("system_queue");
+ return 48;
+ case 28:
+ this.begin("system_db");
+ return 47;
+ case 29:
+ this.begin("system");
+ return 46;
+ case 30:
+ this.begin("boundary");
+ return 37;
+ case 31:
+ this.begin("enterprise_boundary");
+ return 34;
+ case 32:
+ this.begin("system_boundary");
+ return 36;
+ case 33:
+ this.begin("container_ext_queue");
+ return 57;
+ case 34:
+ this.begin("container_ext_db");
+ return 56;
+ case 35:
+ this.begin("container_ext");
+ return 55;
+ case 36:
+ this.begin("container_queue");
+ return 54;
+ case 37:
+ this.begin("container_db");
+ return 53;
+ case 38:
+ this.begin("container");
+ return 52;
+ case 39:
+ this.begin("container_boundary");
+ return 38;
+ case 40:
+ this.begin("component_ext_queue");
+ return 63;
+ case 41:
+ this.begin("component_ext_db");
+ return 62;
+ case 42:
+ this.begin("component_ext");
+ return 61;
+ case 43:
+ this.begin("component_queue");
+ return 60;
+ case 44:
+ this.begin("component_db");
+ return 59;
+ case 45:
+ this.begin("component");
+ return 58;
+ case 46:
+ this.begin("node");
+ return 39;
+ case 47:
+ this.begin("node");
+ return 39;
+ case 48:
+ this.begin("node_l");
+ return 40;
+ case 49:
+ this.begin("node_r");
+ return 41;
+ case 50:
+ this.begin("rel");
+ return 64;
+ case 51:
+ this.begin("birel");
+ return 65;
+ case 52:
+ this.begin("rel_u");
+ return 66;
+ case 53:
+ this.begin("rel_u");
+ return 66;
+ case 54:
+ this.begin("rel_d");
+ return 67;
+ case 55:
+ this.begin("rel_d");
+ return 67;
+ case 56:
+ this.begin("rel_l");
+ return 68;
+ case 57:
+ this.begin("rel_l");
+ return 68;
+ case 58:
+ this.begin("rel_r");
+ return 69;
+ case 59:
+ this.begin("rel_r");
+ return 69;
+ case 60:
+ this.begin("rel_b");
+ return 70;
+ case 61:
+ this.begin("rel_index");
+ return 71;
+ case 62:
+ this.begin("update_el_style");
+ return 72;
+ case 63:
+ this.begin("update_rel_style");
+ return 73;
+ case 64:
+ this.begin("update_layout_config");
+ return 74;
+ case 65:
+ return "EOF_IN_STRUCT";
+ case 66:
+ this.begin("attribute");
+ return "ATTRIBUTE_EMPTY";
+ case 67:
+ this.begin("attribute");
+ break;
+ case 68:
+ this.popState();
+ this.popState();
+ break;
+ case 69:
+ return 80;
+ case 70:
+ break;
+ case 71:
+ return 80;
+ case 72:
+ this.begin("string");
+ break;
+ case 73:
+ this.popState();
+ break;
+ case 74:
+ return "STR";
+ case 75:
+ this.begin("string_kv");
+ break;
+ case 76:
+ this.begin("string_kv_key");
+ return "STR_KEY";
+ case 77:
+ this.popState();
+ this.begin("string_kv_value");
+ break;
+ case 78:
+ return "STR_VALUE";
+ case 79:
+ this.popState();
+ this.popState();
+ break;
+ case 80:
+ return "STR";
+ case 81:
+ return "LBRACE";
+ case 82:
+ return "RBRACE";
+ case 83:
+ return "SPACE";
+ case 84:
+ return "EOL";
+ case 85:
+ return 14;
+ }
+ },
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/],
+ conditions: { "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "string_kv_value": { "rules": [78, 79], "inclusive": false }, "string_kv_key": { "rules": [77], "inclusive": false }, "string_kv": { "rules": [76], "inclusive": false }, "string": { "rules": [73, 74], "inclusive": false }, "attribute": { "rules": [68, 69, 70, 71, 72, 75, 80], "inclusive": false }, "update_layout_config": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_rel_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_el_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_b": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_d": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_u": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "node": { "rules": [65, 66, 67, 68], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container": { "rules": [65, 66, 67, 68], "inclusive": false }, "birel": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "enterprise_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system": { "rules": [65, 66, 67, 68], "inclusive": false }, "person_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "person": { "rules": [65, 66, 67, 68], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], "inclusive": true } }
+ };
+ return lexer2;
+ }();
+ parser2.lexer = lexer;
+ function Parser() {
+ this.yy = {};
+ }
+ Parser.prototype = parser2;
+ parser2.Parser = Parser;
+ return new Parser();
+}();
+parser.parser = parser;
+const parser$1 = parser;
+let c4ShapeArray = [];
+let boundaryParseStack = [""];
+let currentBoundaryParse = "global";
+let parentBoundaryParse = "";
+let boundaries = [
+ {
+ alias: "global",
+ label: { text: "global" },
+ type: { text: "global" },
+ tags: null,
+ link: null,
+ parentBoundary: ""
+ }
+];
+let rels = [];
+let title = "";
+let wrapEnabled = false;
+let c4ShapeInRow$1 = 4;
+let c4BoundaryInRow$1 = 2;
+var c4Type;
+const getC4Type = function() {
+ return c4Type;
+};
+const setC4Type = function(c4TypeParam) {
+ let sanitizedText = sanitizeText(c4TypeParam, getConfig());
+ c4Type = sanitizedText;
+};
+const addRel = function(type, from, to, label, techn, descr, sprite, tags, link) {
+ if (type === void 0 || type === null || from === void 0 || from === null || to === void 0 || to === null || label === void 0 || label === null) {
+ return;
+ }
+ let rel = {};
+ const old = rels.find((rel2) => rel2.from === from && rel2.to === to);
+ if (old) {
+ rel = old;
+ } else {
+ rels.push(rel);
+ }
+ rel.type = type;
+ rel.from = from;
+ rel.to = to;
+ rel.label = { text: label };
+ if (techn === void 0 || techn === null) {
+ rel.techn = { text: "" };
+ } else {
+ if (typeof techn === "object") {
+ let [key, value] = Object.entries(techn)[0];
+ rel[key] = { text: value };
+ } else {
+ rel.techn = { text: techn };
+ }
+ }
+ if (descr === void 0 || descr === null) {
+ rel.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ rel[key] = { text: value };
+ } else {
+ rel.descr = { text: descr };
+ }
+ }
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ rel[key] = value;
+ } else {
+ rel.sprite = sprite;
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ rel[key] = value;
+ } else {
+ rel.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ rel[key] = value;
+ } else {
+ rel.link = link;
+ }
+ rel.wrap = autoWrap();
+};
+const addPersonOrSystem = function(typeC4Shape, alias, label, descr, sprite, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let personOrSystem = {};
+ const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias);
+ if (old && alias === old.alias) {
+ personOrSystem = old;
+ } else {
+ personOrSystem.alias = alias;
+ c4ShapeArray.push(personOrSystem);
+ }
+ if (label === void 0 || label === null) {
+ personOrSystem.label = { text: "" };
+ } else {
+ personOrSystem.label = { text: label };
+ }
+ if (descr === void 0 || descr === null) {
+ personOrSystem.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ personOrSystem[key] = { text: value };
+ } else {
+ personOrSystem.descr = { text: descr };
+ }
+ }
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ personOrSystem[key] = value;
+ } else {
+ personOrSystem.sprite = sprite;
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ personOrSystem[key] = value;
+ } else {
+ personOrSystem.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ personOrSystem[key] = value;
+ } else {
+ personOrSystem.link = link;
+ }
+ personOrSystem.typeC4Shape = { text: typeC4Shape };
+ personOrSystem.parentBoundary = currentBoundaryParse;
+ personOrSystem.wrap = autoWrap();
+};
+const addContainer = function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let container = {};
+ const old = c4ShapeArray.find((container2) => container2.alias === alias);
+ if (old && alias === old.alias) {
+ container = old;
+ } else {
+ container.alias = alias;
+ c4ShapeArray.push(container);
+ }
+ if (label === void 0 || label === null) {
+ container.label = { text: "" };
+ } else {
+ container.label = { text: label };
+ }
+ if (techn === void 0 || techn === null) {
+ container.techn = { text: "" };
+ } else {
+ if (typeof techn === "object") {
+ let [key, value] = Object.entries(techn)[0];
+ container[key] = { text: value };
+ } else {
+ container.techn = { text: techn };
+ }
+ }
+ if (descr === void 0 || descr === null) {
+ container.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ container[key] = { text: value };
+ } else {
+ container.descr = { text: descr };
+ }
+ }
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ container[key] = value;
+ } else {
+ container.sprite = sprite;
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ container[key] = value;
+ } else {
+ container.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ container[key] = value;
+ } else {
+ container.link = link;
+ }
+ container.wrap = autoWrap();
+ container.typeC4Shape = { text: typeC4Shape };
+ container.parentBoundary = currentBoundaryParse;
+};
+const addComponent = function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let component = {};
+ const old = c4ShapeArray.find((component2) => component2.alias === alias);
+ if (old && alias === old.alias) {
+ component = old;
+ } else {
+ component.alias = alias;
+ c4ShapeArray.push(component);
+ }
+ if (label === void 0 || label === null) {
+ component.label = { text: "" };
+ } else {
+ component.label = { text: label };
+ }
+ if (techn === void 0 || techn === null) {
+ component.techn = { text: "" };
+ } else {
+ if (typeof techn === "object") {
+ let [key, value] = Object.entries(techn)[0];
+ component[key] = { text: value };
+ } else {
+ component.techn = { text: techn };
+ }
+ }
+ if (descr === void 0 || descr === null) {
+ component.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ component[key] = { text: value };
+ } else {
+ component.descr = { text: descr };
+ }
+ }
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ component[key] = value;
+ } else {
+ component.sprite = sprite;
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ component[key] = value;
+ } else {
+ component.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ component[key] = value;
+ } else {
+ component.link = link;
+ }
+ component.wrap = autoWrap();
+ component.typeC4Shape = { text: typeC4Shape };
+ component.parentBoundary = currentBoundaryParse;
+};
+const addPersonOrSystemBoundary = function(alias, label, type, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let boundary = {};
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
+ if (old && alias === old.alias) {
+ boundary = old;
+ } else {
+ boundary.alias = alias;
+ boundaries.push(boundary);
+ }
+ if (label === void 0 || label === null) {
+ boundary.label = { text: "" };
+ } else {
+ boundary.label = { text: label };
+ }
+ if (type === void 0 || type === null) {
+ boundary.type = { text: "system" };
+ } else {
+ if (typeof type === "object") {
+ let [key, value] = Object.entries(type)[0];
+ boundary[key] = { text: value };
+ } else {
+ boundary.type = { text: type };
+ }
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ boundary[key] = value;
+ } else {
+ boundary.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ boundary[key] = value;
+ } else {
+ boundary.link = link;
+ }
+ boundary.parentBoundary = currentBoundaryParse;
+ boundary.wrap = autoWrap();
+ parentBoundaryParse = currentBoundaryParse;
+ currentBoundaryParse = alias;
+ boundaryParseStack.push(parentBoundaryParse);
+};
+const addContainerBoundary = function(alias, label, type, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let boundary = {};
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
+ if (old && alias === old.alias) {
+ boundary = old;
+ } else {
+ boundary.alias = alias;
+ boundaries.push(boundary);
+ }
+ if (label === void 0 || label === null) {
+ boundary.label = { text: "" };
+ } else {
+ boundary.label = { text: label };
+ }
+ if (type === void 0 || type === null) {
+ boundary.type = { text: "container" };
+ } else {
+ if (typeof type === "object") {
+ let [key, value] = Object.entries(type)[0];
+ boundary[key] = { text: value };
+ } else {
+ boundary.type = { text: type };
+ }
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ boundary[key] = value;
+ } else {
+ boundary.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ boundary[key] = value;
+ } else {
+ boundary.link = link;
+ }
+ boundary.parentBoundary = currentBoundaryParse;
+ boundary.wrap = autoWrap();
+ parentBoundaryParse = currentBoundaryParse;
+ currentBoundaryParse = alias;
+ boundaryParseStack.push(parentBoundaryParse);
+};
+const addDeploymentNode = function(nodeType, alias, label, type, descr, sprite, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let boundary = {};
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
+ if (old && alias === old.alias) {
+ boundary = old;
+ } else {
+ boundary.alias = alias;
+ boundaries.push(boundary);
+ }
+ if (label === void 0 || label === null) {
+ boundary.label = { text: "" };
+ } else {
+ boundary.label = { text: label };
+ }
+ if (type === void 0 || type === null) {
+ boundary.type = { text: "node" };
+ } else {
+ if (typeof type === "object") {
+ let [key, value] = Object.entries(type)[0];
+ boundary[key] = { text: value };
+ } else {
+ boundary.type = { text: type };
+ }
+ }
+ if (descr === void 0 || descr === null) {
+ boundary.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ boundary[key] = { text: value };
+ } else {
+ boundary.descr = { text: descr };
+ }
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ boundary[key] = value;
+ } else {
+ boundary.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ boundary[key] = value;
+ } else {
+ boundary.link = link;
+ }
+ boundary.nodeType = nodeType;
+ boundary.parentBoundary = currentBoundaryParse;
+ boundary.wrap = autoWrap();
+ parentBoundaryParse = currentBoundaryParse;
+ currentBoundaryParse = alias;
+ boundaryParseStack.push(parentBoundaryParse);
+};
+const popBoundaryParseStack = function() {
+ currentBoundaryParse = parentBoundaryParse;
+ boundaryParseStack.pop();
+ parentBoundaryParse = boundaryParseStack.pop();
+ boundaryParseStack.push(parentBoundaryParse);
+};
+const updateElStyle = function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) {
+ let old = c4ShapeArray.find((element) => element.alias === elementName);
+ if (old === void 0) {
+ old = boundaries.find((element) => element.alias === elementName);
+ if (old === void 0) {
+ return;
+ }
+ }
+ if (bgColor !== void 0 && bgColor !== null) {
+ if (typeof bgColor === "object") {
+ let [key, value] = Object.entries(bgColor)[0];
+ old[key] = value;
+ } else {
+ old.bgColor = bgColor;
+ }
+ }
+ if (fontColor !== void 0 && fontColor !== null) {
+ if (typeof fontColor === "object") {
+ let [key, value] = Object.entries(fontColor)[0];
+ old[key] = value;
+ } else {
+ old.fontColor = fontColor;
+ }
+ }
+ if (borderColor !== void 0 && borderColor !== null) {
+ if (typeof borderColor === "object") {
+ let [key, value] = Object.entries(borderColor)[0];
+ old[key] = value;
+ } else {
+ old.borderColor = borderColor;
+ }
+ }
+ if (shadowing !== void 0 && shadowing !== null) {
+ if (typeof shadowing === "object") {
+ let [key, value] = Object.entries(shadowing)[0];
+ old[key] = value;
+ } else {
+ old.shadowing = shadowing;
+ }
+ }
+ if (shape !== void 0 && shape !== null) {
+ if (typeof shape === "object") {
+ let [key, value] = Object.entries(shape)[0];
+ old[key] = value;
+ } else {
+ old.shape = shape;
+ }
+ }
+ if (sprite !== void 0 && sprite !== null) {
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ old[key] = value;
+ } else {
+ old.sprite = sprite;
+ }
+ }
+ if (techn !== void 0 && techn !== null) {
+ if (typeof techn === "object") {
+ let [key, value] = Object.entries(techn)[0];
+ old[key] = value;
+ } else {
+ old.techn = techn;
+ }
+ }
+ if (legendText !== void 0 && legendText !== null) {
+ if (typeof legendText === "object") {
+ let [key, value] = Object.entries(legendText)[0];
+ old[key] = value;
+ } else {
+ old.legendText = legendText;
+ }
+ }
+ if (legendSprite !== void 0 && legendSprite !== null) {
+ if (typeof legendSprite === "object") {
+ let [key, value] = Object.entries(legendSprite)[0];
+ old[key] = value;
+ } else {
+ old.legendSprite = legendSprite;
+ }
+ }
+};
+const updateRelStyle = function(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) {
+ const old = rels.find((rel) => rel.from === from && rel.to === to);
+ if (old === void 0) {
+ return;
+ }
+ if (textColor !== void 0 && textColor !== null) {
+ if (typeof textColor === "object") {
+ let [key, value] = Object.entries(textColor)[0];
+ old[key] = value;
+ } else {
+ old.textColor = textColor;
+ }
+ }
+ if (lineColor !== void 0 && lineColor !== null) {
+ if (typeof lineColor === "object") {
+ let [key, value] = Object.entries(lineColor)[0];
+ old[key] = value;
+ } else {
+ old.lineColor = lineColor;
+ }
+ }
+ if (offsetX !== void 0 && offsetX !== null) {
+ if (typeof offsetX === "object") {
+ let [key, value] = Object.entries(offsetX)[0];
+ old[key] = parseInt(value);
+ } else {
+ old.offsetX = parseInt(offsetX);
+ }
+ }
+ if (offsetY !== void 0 && offsetY !== null) {
+ if (typeof offsetY === "object") {
+ let [key, value] = Object.entries(offsetY)[0];
+ old[key] = parseInt(value);
+ } else {
+ old.offsetY = parseInt(offsetY);
+ }
+ }
+};
+const updateLayoutConfig = function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {
+ let c4ShapeInRowValue = c4ShapeInRow$1;
+ let c4BoundaryInRowValue = c4BoundaryInRow$1;
+ if (typeof c4ShapeInRowParam === "object") {
+ const value = Object.values(c4ShapeInRowParam)[0];
+ c4ShapeInRowValue = parseInt(value);
+ } else {
+ c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
+ }
+ if (typeof c4BoundaryInRowParam === "object") {
+ const value = Object.values(c4BoundaryInRowParam)[0];
+ c4BoundaryInRowValue = parseInt(value);
+ } else {
+ c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
+ }
+ if (c4ShapeInRowValue >= 1) {
+ c4ShapeInRow$1 = c4ShapeInRowValue;
+ }
+ if (c4BoundaryInRowValue >= 1) {
+ c4BoundaryInRow$1 = c4BoundaryInRowValue;
+ }
+};
+const getC4ShapeInRow = function() {
+ return c4ShapeInRow$1;
+};
+const getC4BoundaryInRow = function() {
+ return c4BoundaryInRow$1;
+};
+const getCurrentBoundaryParse = function() {
+ return currentBoundaryParse;
+};
+const getParentBoundaryParse = function() {
+ return parentBoundaryParse;
+};
+const getC4ShapeArray = function(parentBoundary) {
+ if (parentBoundary === void 0 || parentBoundary === null) {
+ return c4ShapeArray;
+ } else {
+ return c4ShapeArray.filter((personOrSystem) => {
+ return personOrSystem.parentBoundary === parentBoundary;
+ });
+ }
+};
+const getC4Shape = function(alias) {
+ return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);
+};
+const getC4ShapeKeys = function(parentBoundary) {
+ return Object.keys(getC4ShapeArray(parentBoundary));
+};
+const getBoundaries = function(parentBoundary) {
+ if (parentBoundary === void 0 || parentBoundary === null) {
+ return boundaries;
+ } else {
+ return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary);
+ }
+};
+const getBoundarys = getBoundaries;
+const getRels = function() {
+ return rels;
+};
+const getTitle = function() {
+ return title;
+};
+const setWrap = function(wrapSetting) {
+ wrapEnabled = wrapSetting;
+};
+const autoWrap = function() {
+ return wrapEnabled;
+};
+const clear = function() {
+ c4ShapeArray = [];
+ boundaries = [
+ {
+ alias: "global",
+ label: { text: "global" },
+ type: { text: "global" },
+ tags: null,
+ link: null,
+ parentBoundary: ""
+ }
+ ];
+ parentBoundaryParse = "";
+ currentBoundaryParse = "global";
+ boundaryParseStack = [""];
+ rels = [];
+ boundaryParseStack = [""];
+ title = "";
+ wrapEnabled = false;
+ c4ShapeInRow$1 = 4;
+ c4BoundaryInRow$1 = 2;
+};
+const LINETYPE = {
+ SOLID: 0,
+ DOTTED: 1,
+ NOTE: 2,
+ SOLID_CROSS: 3,
+ DOTTED_CROSS: 4,
+ SOLID_OPEN: 5,
+ DOTTED_OPEN: 6,
+ LOOP_START: 10,
+ LOOP_END: 11,
+ ALT_START: 12,
+ ALT_ELSE: 13,
+ ALT_END: 14,
+ OPT_START: 15,
+ OPT_END: 16,
+ ACTIVE_START: 17,
+ ACTIVE_END: 18,
+ PAR_START: 19,
+ PAR_AND: 20,
+ PAR_END: 21,
+ RECT_START: 22,
+ RECT_END: 23,
+ SOLID_POINT: 24,
+ DOTTED_POINT: 25
+};
+const ARROWTYPE = {
+ FILLED: 0,
+ OPEN: 1
+};
+const PLACEMENT = {
+ LEFTOF: 0,
+ RIGHTOF: 1,
+ OVER: 2
+};
+const setTitle = function(txt) {
+ let sanitizedText = sanitizeText(txt, getConfig());
+ title = sanitizedText;
+};
+const db = {
+ addPersonOrSystem,
+ addPersonOrSystemBoundary,
+ addContainer,
+ addContainerBoundary,
+ addComponent,
+ addDeploymentNode,
+ popBoundaryParseStack,
+ addRel,
+ updateElStyle,
+ updateRelStyle,
+ updateLayoutConfig,
+ autoWrap,
+ setWrap,
+ getC4ShapeArray,
+ getC4Shape,
+ getC4ShapeKeys,
+ getBoundaries,
+ getBoundarys,
+ getCurrentBoundaryParse,
+ getParentBoundaryParse,
+ getRels,
+ getTitle,
+ getC4Type,
+ getC4ShapeInRow,
+ getC4BoundaryInRow,
+ setAccTitle,
+ getAccTitle,
+ getAccDescription,
+ setAccDescription,
+ getConfig: () => getConfig().c4,
+ clear,
+ LINETYPE,
+ ARROWTYPE,
+ PLACEMENT,
+ setTitle,
+ setC4Type
+ // apply,
+};
+const drawRect = function(elem, rectData) {
+ return drawRect$1(elem, rectData);
+};
+const drawImage = function(elem, width, height, x, y, link) {
+ const imageElem = elem.append("image");
+ imageElem.attr("width", width);
+ imageElem.attr("height", height);
+ imageElem.attr("x", x);
+ imageElem.attr("y", y);
+ let sanitizedLink = link.startsWith("data:image/png;base64") ? link : sanitizeUrl(link);
+ imageElem.attr("xlink:href", sanitizedLink);
+};
+const drawRels$1 = (elem, rels2, conf2) => {
+ const relsElem = elem.append("g");
+ let i = 0;
+ for (let rel of rels2) {
+ let textColor = rel.textColor ? rel.textColor : "#444444";
+ let strokeColor = rel.lineColor ? rel.lineColor : "#444444";
+ let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;
+ let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;
+ let url = "";
+ if (i === 0) {
+ let line = relsElem.append("line");
+ line.attr("x1", rel.startPoint.x);
+ line.attr("y1", rel.startPoint.y);
+ line.attr("x2", rel.endPoint.x);
+ line.attr("y2", rel.endPoint.y);
+ line.attr("stroke-width", "1");
+ line.attr("stroke", strokeColor);
+ line.style("fill", "none");
+ if (rel.type !== "rel_b") {
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
+ }
+ if (rel.type === "birel" || rel.type === "rel_b") {
+ line.attr("marker-start", "url(" + url + "#arrowend)");
+ }
+ i = -1;
+ } else {
+ let line = relsElem.append("path");
+ line.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll(
+ "controlx",
+ rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4
+ ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y)
+ );
+ if (rel.type !== "rel_b") {
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
+ }
+ if (rel.type === "birel" || rel.type === "rel_b") {
+ line.attr("marker-start", "url(" + url + "#arrowend)");
+ }
+ }
+ let messageConf = conf2.messageFont();
+ _drawTextCandidateFunc(conf2)(
+ rel.label.text,
+ relsElem,
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY,
+ rel.label.width,
+ rel.label.height,
+ { fill: textColor },
+ messageConf
+ );
+ if (rel.techn && rel.techn.text !== "") {
+ messageConf = conf2.messageFont();
+ _drawTextCandidateFunc(conf2)(
+ "[" + rel.techn.text + "]",
+ relsElem,
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY,
+ Math.max(rel.label.width, rel.techn.width),
+ rel.techn.height,
+ { fill: textColor, "font-style": "italic" },
+ messageConf
+ );
+ }
+ }
+};
+const drawBoundary$1 = function(elem, boundary, conf2) {
+ const boundaryElem = elem.append("g");
+ let fillColor = boundary.bgColor ? boundary.bgColor : "none";
+ let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444";
+ let fontColor = boundary.fontColor ? boundary.fontColor : "black";
+ let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
+ if (boundary.nodeType) {
+ attrsValue = { "stroke-width": 1 };
+ }
+ let rectData = {
+ x: boundary.x,
+ y: boundary.y,
+ fill: fillColor,
+ stroke: strokeColor,
+ width: boundary.width,
+ height: boundary.height,
+ rx: 2.5,
+ ry: 2.5,
+ attrs: attrsValue
+ };
+ drawRect(boundaryElem, rectData);
+ let boundaryConf = conf2.boundaryFont();
+ boundaryConf.fontWeight = "bold";
+ boundaryConf.fontSize = boundaryConf.fontSize + 2;
+ boundaryConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ boundary.label.text,
+ boundaryElem,
+ boundary.x,
+ boundary.y + boundary.label.Y,
+ boundary.width,
+ boundary.height,
+ { fill: "#444444" },
+ boundaryConf
+ );
+ if (boundary.type && boundary.type.text !== "") {
+ boundaryConf = conf2.boundaryFont();
+ boundaryConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ boundary.type.text,
+ boundaryElem,
+ boundary.x,
+ boundary.y + boundary.type.Y,
+ boundary.width,
+ boundary.height,
+ { fill: "#444444" },
+ boundaryConf
+ );
+ }
+ if (boundary.descr && boundary.descr.text !== "") {
+ boundaryConf = conf2.boundaryFont();
+ boundaryConf.fontSize = boundaryConf.fontSize - 2;
+ boundaryConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ boundary.descr.text,
+ boundaryElem,
+ boundary.x,
+ boundary.y + boundary.descr.Y,
+ boundary.width,
+ boundary.height,
+ { fill: "#444444" },
+ boundaryConf
+ );
+ }
+};
+const drawC4Shape = function(elem, c4Shape, conf2) {
+ var _a;
+ let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"];
+ let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"];
+ let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF";
+ let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
+ switch (c4Shape.typeC4Shape.text) {
+ case "person":
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
+ break;
+ case "external_person":
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
+ break;
+ }
+ const c4ShapeElem = elem.append("g");
+ c4ShapeElem.attr("class", "person-man");
+ const rect = getNoteRect();
+ switch (c4Shape.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ case "system":
+ case "external_system":
+ case "container":
+ case "external_container":
+ case "component":
+ case "external_component":
+ rect.x = c4Shape.x;
+ rect.y = c4Shape.y;
+ rect.fill = fillColor;
+ rect.width = c4Shape.width;
+ rect.height = c4Shape.height;
+ rect.stroke = strokeColor;
+ rect.rx = 2.5;
+ rect.ry = 2.5;
+ rect.attrs = { "stroke-width": 0.5 };
+ drawRect(c4ShapeElem, rect);
+ break;
+ case "system_db":
+ case "external_system_db":
+ case "container_db":
+ case "external_container_db":
+ case "component_db":
+ case "external_component_db":
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height)
+ );
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2)
+ );
+ break;
+ case "system_queue":
+ case "external_system_queue":
+ case "container_queue":
+ case "external_container_queue":
+ case "component_queue":
+ case "external_component_queue":
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2)
+ );
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2)
+ );
+ break;
+ }
+ let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text);
+ c4ShapeElem.append("text").attr("fill", fontColor).attr("font-family", c4ShapeFontConf.fontFamily).attr("font-size", c4ShapeFontConf.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", c4Shape.typeC4Shape.width).attr("x", c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr("y", c4Shape.y + c4Shape.typeC4Shape.Y).text("<<" + c4Shape.typeC4Shape.text + ">>");
+ switch (c4Shape.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ drawImage(
+ c4ShapeElem,
+ 48,
+ 48,
+ c4Shape.x + c4Shape.width / 2 - 24,
+ c4Shape.y + c4Shape.image.Y,
+ personImg
+ );
+ break;
+ }
+ let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
+ textFontConf.fontWeight = "bold";
+ textFontConf.fontSize = textFontConf.fontSize + 2;
+ textFontConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ c4Shape.label.text,
+ c4ShapeElem,
+ c4Shape.x,
+ c4Shape.y + c4Shape.label.Y,
+ c4Shape.width,
+ c4Shape.height,
+ { fill: fontColor },
+ textFontConf
+ );
+ textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
+ textFontConf.fontColor = fontColor;
+ if (c4Shape.techn && ((_a = c4Shape.techn) == null ? void 0 : _a.text) !== "") {
+ _drawTextCandidateFunc(conf2)(
+ c4Shape.techn.text,
+ c4ShapeElem,
+ c4Shape.x,
+ c4Shape.y + c4Shape.techn.Y,
+ c4Shape.width,
+ c4Shape.height,
+ { fill: fontColor, "font-style": "italic" },
+ textFontConf
+ );
+ } else if (c4Shape.type && c4Shape.type.text !== "") {
+ _drawTextCandidateFunc(conf2)(
+ c4Shape.type.text,
+ c4ShapeElem,
+ c4Shape.x,
+ c4Shape.y + c4Shape.type.Y,
+ c4Shape.width,
+ c4Shape.height,
+ { fill: fontColor, "font-style": "italic" },
+ textFontConf
+ );
+ }
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
+ textFontConf = conf2.personFont();
+ textFontConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ c4Shape.descr.text,
+ c4ShapeElem,
+ c4Shape.x,
+ c4Shape.y + c4Shape.descr.Y,
+ c4Shape.width,
+ c4Shape.height,
+ { fill: fontColor },
+ textFontConf
+ );
+ }
+ return c4Shape.height;
+};
+const insertDatabaseIcon = function(elem) {
+ elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
+ );
+};
+const insertComputerIcon = function(elem) {
+ elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
+ );
+};
+const insertClockIcon = function(elem) {
+ elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
+ );
+};
+const insertArrowHead = function(elem) {
+ elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
+};
+const insertArrowEnd = function(elem) {
+ elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");
+};
+const insertArrowFilledHead = function(elem) {
+ elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
+};
+const insertDynamicNumber = function(elem) {
+ elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
+};
+const insertArrowCrossHead = function(elem) {
+ const defs = elem.append("defs");
+ const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
+ marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z");
+ marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");
+};
+const getC4ShapeFont = (cnf, typeC4Shape) => {
+ return {
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
+ fontSize: cnf[typeC4Shape + "FontSize"],
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
+ };
+};
+const _drawTextCandidateFunc = function() {
+ function byText(content, g, x, y, width, height, textAttrs) {
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
+ _setTextAttrs(text, textAttrs);
+ }
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
+ const { fontSize, fontFamily, fontWeight } = conf2;
+ const lines = content.split(common.lineBreakRegex);
+ for (let i = 0; i < lines.length; i++) {
+ const dy = i * fontSize - fontSize * (lines.length - 1) / 2;
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily);
+ text.append("tspan").attr("dy", dy).text(lines[i]).attr("alignment-baseline", "mathematical");
+ _setTextAttrs(text, textAttrs);
+ }
+ }
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
+ const s = g.append("switch");
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
+ _setTextAttrs(text, textAttrs);
+ }
+ function _setTextAttrs(toText, fromTextAttrsDict) {
+ for (const key in fromTextAttrsDict) {
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
+ toText.attr(key, fromTextAttrsDict[key]);
+ }
+ }
+ }
+ return function(conf2) {
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
+ };
+}();
+const svgDraw = {
+ drawRect,
+ drawBoundary: drawBoundary$1,
+ drawC4Shape,
+ drawRels: drawRels$1,
+ drawImage,
+ insertArrowHead,
+ insertArrowEnd,
+ insertArrowFilledHead,
+ insertDynamicNumber,
+ insertArrowCrossHead,
+ insertDatabaseIcon,
+ insertComputerIcon,
+ insertClockIcon
+};
+let globalBoundaryMaxX = 0, globalBoundaryMaxY = 0;
+let c4ShapeInRow = 4;
+let c4BoundaryInRow = 2;
+parser.yy = db;
+let conf = {};
+class Bounds {
+ constructor(diagObj) {
+ this.name = "";
+ this.data = {};
+ this.data.startx = void 0;
+ this.data.stopx = void 0;
+ this.data.starty = void 0;
+ this.data.stopy = void 0;
+ this.data.widthLimit = void 0;
+ this.nextData = {};
+ this.nextData.startx = void 0;
+ this.nextData.stopx = void 0;
+ this.nextData.starty = void 0;
+ this.nextData.stopy = void 0;
+ this.nextData.cnt = 0;
+ setConf(diagObj.db.getConfig());
+ }
+ setData(startx, stopx, starty, stopy) {
+ this.nextData.startx = this.data.startx = startx;
+ this.nextData.stopx = this.data.stopx = stopx;
+ this.nextData.starty = this.data.starty = starty;
+ this.nextData.stopy = this.data.stopy = stopy;
+ }
+ updateVal(obj, key, val, fun) {
+ if (obj[key] === void 0) {
+ obj[key] = val;
+ } else {
+ obj[key] = fun(val, obj[key]);
+ }
+ }
+ insert(c4Shape) {
+ this.nextData.cnt = this.nextData.cnt + 1;
+ let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2;
+ let _stopx = _startx + c4Shape.width;
+ let _starty = this.nextData.starty + c4Shape.margin * 2;
+ let _stopy = _starty + c4Shape.height;
+ if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow) {
+ _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;
+ _starty = this.nextData.stopy + c4Shape.margin * 2;
+ this.nextData.stopx = _stopx = _startx + c4Shape.width;
+ this.nextData.starty = this.nextData.stopy;
+ this.nextData.stopy = _stopy = _starty + c4Shape.height;
+ this.nextData.cnt = 1;
+ }
+ c4Shape.x = _startx;
+ c4Shape.y = _starty;
+ this.updateVal(this.data, "startx", _startx, Math.min);
+ this.updateVal(this.data, "starty", _starty, Math.min);
+ this.updateVal(this.data, "stopx", _stopx, Math.max);
+ this.updateVal(this.data, "stopy", _stopy, Math.max);
+ this.updateVal(this.nextData, "startx", _startx, Math.min);
+ this.updateVal(this.nextData, "starty", _starty, Math.min);
+ this.updateVal(this.nextData, "stopx", _stopx, Math.max);
+ this.updateVal(this.nextData, "stopy", _stopy, Math.max);
+ }
+ init(diagObj) {
+ this.name = "";
+ this.data = {
+ startx: void 0,
+ stopx: void 0,
+ starty: void 0,
+ stopy: void 0,
+ widthLimit: void 0
+ };
+ this.nextData = {
+ startx: void 0,
+ stopx: void 0,
+ starty: void 0,
+ stopy: void 0,
+ cnt: 0
+ };
+ setConf(diagObj.db.getConfig());
+ }
+ bumpLastMargin(margin) {
+ this.data.stopx += margin;
+ this.data.stopy += margin;
+ }
+}
+const setConf = function(cnf) {
+ assignWithDepth(conf, cnf);
+ if (cnf.fontFamily) {
+ conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;
+ }
+ if (cnf.fontSize) {
+ conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;
+ }
+ if (cnf.fontWeight) {
+ conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;
+ }
+};
+const c4ShapeFont = (cnf, typeC4Shape) => {
+ return {
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
+ fontSize: cnf[typeC4Shape + "FontSize"],
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
+ };
+};
+const boundaryFont = (cnf) => {
+ return {
+ fontFamily: cnf.boundaryFontFamily,
+ fontSize: cnf.boundaryFontSize,
+ fontWeight: cnf.boundaryFontWeight
+ };
+};
+const messageFont = (cnf) => {
+ return {
+ fontFamily: cnf.messageFontFamily,
+ fontSize: cnf.messageFontSize,
+ fontWeight: cnf.messageFontWeight
+ };
+};
+function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {
+ if (!c4Shape[textType].width) {
+ if (c4ShapeTextWrap) {
+ c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);
+ c4Shape[textType].textLines = c4Shape[textType].text.split(common.lineBreakRegex).length;
+ c4Shape[textType].width = textLimitWidth;
+ c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);
+ } else {
+ let lines = c4Shape[textType].text.split(common.lineBreakRegex);
+ c4Shape[textType].textLines = lines.length;
+ let lineHeight = 0;
+ c4Shape[textType].height = 0;
+ c4Shape[textType].width = 0;
+ for (const line of lines) {
+ c4Shape[textType].width = Math.max(
+ calculateTextWidth(line, textConf),
+ c4Shape[textType].width
+ );
+ lineHeight = calculateTextHeight(line, textConf);
+ c4Shape[textType].height = c4Shape[textType].height + lineHeight;
+ }
+ }
+ }
+}
+const drawBoundary = function(diagram2, boundary, bounds) {
+ boundary.x = bounds.data.startx;
+ boundary.y = bounds.data.starty;
+ boundary.width = bounds.data.stopx - bounds.data.startx;
+ boundary.height = bounds.data.stopy - bounds.data.starty;
+ boundary.label.y = conf.c4ShapeMargin - 35;
+ let boundaryTextWrap = boundary.wrap && conf.wrap;
+ let boundaryLabelConf = boundaryFont(conf);
+ boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;
+ boundaryLabelConf.fontWeight = "bold";
+ let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
+ calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
+ svgDraw.drawBoundary(diagram2, boundary, conf);
+};
+const drawC4ShapeArray = function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) {
+ let Y = 0;
+ for (const c4ShapeKey of c4ShapeKeys) {
+ Y = 0;
+ const c4Shape = c4ShapeArray2[c4ShapeKey];
+ let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
+ c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;
+ c4Shape.typeC4Shape.width = calculateTextWidth(
+ "«" + c4Shape.typeC4Shape.text + "»",
+ c4ShapeTypeConf
+ );
+ c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;
+ c4Shape.typeC4Shape.Y = conf.c4ShapePadding;
+ Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;
+ c4Shape.image = { width: 0, height: 0, Y: 0 };
+ switch (c4Shape.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ c4Shape.image.width = 48;
+ c4Shape.image.height = 48;
+ c4Shape.image.Y = Y;
+ Y = c4Shape.image.Y + c4Shape.image.height;
+ break;
+ }
+ if (c4Shape.sprite) {
+ c4Shape.image.width = 48;
+ c4Shape.image.height = 48;
+ c4Shape.image.Y = Y;
+ Y = c4Shape.image.Y + c4Shape.image.height;
+ }
+ let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;
+ let textLimitWidth = conf.width - conf.c4ShapePadding * 2;
+ let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
+ c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
+ c4ShapeLabelConf.fontWeight = "bold";
+ calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
+ c4Shape["label"].Y = Y + 8;
+ Y = c4Shape["label"].Y + c4Shape["label"].height;
+ if (c4Shape.type && c4Shape.type.text !== "") {
+ c4Shape.type.text = "[" + c4Shape.type.text + "]";
+ let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
+ calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth);
+ c4Shape["type"].Y = Y + 5;
+ Y = c4Shape["type"].Y + c4Shape["type"].height;
+ } else if (c4Shape.techn && c4Shape.techn.text !== "") {
+ c4Shape.techn.text = "[" + c4Shape.techn.text + "]";
+ let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
+ calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
+ c4Shape["techn"].Y = Y + 5;
+ Y = c4Shape["techn"].Y + c4Shape["techn"].height;
+ }
+ let rectHeight = Y;
+ let rectWidth = c4Shape.label.width;
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
+ let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
+ calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
+ c4Shape["descr"].Y = Y + 20;
+ Y = c4Shape["descr"].Y + c4Shape["descr"].height;
+ rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
+ rectHeight = Y - c4Shape["descr"].textLines * 5;
+ }
+ rectWidth = rectWidth + conf.c4ShapePadding;
+ c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);
+ c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
+ c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
+ currentBounds.insert(c4Shape);
+ svgDraw.drawC4Shape(diagram2, c4Shape, conf);
+ }
+ currentBounds.bumpLastMargin(conf.c4ShapeMargin);
+};
+class Point {
+ constructor(x, y) {
+ this.x = x;
+ this.y = y;
+ }
+}
+let getIntersectPoint = function(fromNode, endPoint) {
+ let x1 = fromNode.x;
+ let y1 = fromNode.y;
+ let x2 = endPoint.x;
+ let y2 = endPoint.y;
+ let fromCenterX = x1 + fromNode.width / 2;
+ let fromCenterY = y1 + fromNode.height / 2;
+ let dx = Math.abs(x1 - x2);
+ let dy = Math.abs(y1 - y2);
+ let tanDYX = dy / dx;
+ let fromDYX = fromNode.height / fromNode.width;
+ let returnPoint = null;
+ if (y1 == y2 && x1 < x2) {
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY);
+ } else if (y1 == y2 && x1 > x2) {
+ returnPoint = new Point(x1, fromCenterY);
+ } else if (x1 == x2 && y1 < y2) {
+ returnPoint = new Point(fromCenterX, y1 + fromNode.height);
+ } else if (x1 == x2 && y1 > y2) {
+ returnPoint = new Point(fromCenterX, y1);
+ }
+ if (x1 > x2 && y1 < y2) {
+ if (fromDYX >= tanDYX) {
+ returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2);
+ } else {
+ returnPoint = new Point(
+ fromCenterX - dx / dy * fromNode.height / 2,
+ y1 + fromNode.height
+ );
+ }
+ } else if (x1 < x2 && y1 < y2) {
+ if (fromDYX >= tanDYX) {
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2);
+ } else {
+ returnPoint = new Point(
+ fromCenterX + dx / dy * fromNode.height / 2,
+ y1 + fromNode.height
+ );
+ }
+ } else if (x1 < x2 && y1 > y2) {
+ if (fromDYX >= tanDYX) {
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2);
+ } else {
+ returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1);
+ }
+ } else if (x1 > x2 && y1 > y2) {
+ if (fromDYX >= tanDYX) {
+ returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX);
+ } else {
+ returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1);
+ }
+ }
+ return returnPoint;
+};
+let getIntersectPoints = function(fromNode, endNode) {
+ let endIntersectPoint = { x: 0, y: 0 };
+ endIntersectPoint.x = endNode.x + endNode.width / 2;
+ endIntersectPoint.y = endNode.y + endNode.height / 2;
+ let startPoint = getIntersectPoint(fromNode, endIntersectPoint);
+ endIntersectPoint.x = fromNode.x + fromNode.width / 2;
+ endIntersectPoint.y = fromNode.y + fromNode.height / 2;
+ let endPoint = getIntersectPoint(endNode, endIntersectPoint);
+ return { startPoint, endPoint };
+};
+const drawRels = function(diagram2, rels2, getC4ShapeObj, diagObj) {
+ let i = 0;
+ for (let rel of rels2) {
+ i = i + 1;
+ let relTextWrap = rel.wrap && conf.wrap;
+ let relConf = messageFont(conf);
+ let diagramType = diagObj.db.getC4Type();
+ if (diagramType === "C4Dynamic") {
+ rel.label.text = i + ": " + rel.label.text;
+ }
+ let textLimitWidth = calculateTextWidth(rel.label.text, relConf);
+ calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth);
+ if (rel.techn && rel.techn.text !== "") {
+ textLimitWidth = calculateTextWidth(rel.techn.text, relConf);
+ calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth);
+ }
+ if (rel.descr && rel.descr.text !== "") {
+ textLimitWidth = calculateTextWidth(rel.descr.text, relConf);
+ calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth);
+ }
+ let fromNode = getC4ShapeObj(rel.from);
+ let endNode = getC4ShapeObj(rel.to);
+ let points = getIntersectPoints(fromNode, endNode);
+ rel.startPoint = points.startPoint;
+ rel.endPoint = points.endPoint;
+ }
+ svgDraw.drawRels(diagram2, rels2, conf);
+};
+function drawInsideBoundary(diagram2, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
+ let currentBounds = new Bounds(diagObj);
+ currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow, currentBoundaries.length);
+ for (let [i, currentBoundary] of currentBoundaries.entries()) {
+ let Y = 0;
+ currentBoundary.image = { width: 0, height: 0, Y: 0 };
+ if (currentBoundary.sprite) {
+ currentBoundary.image.width = 48;
+ currentBoundary.image.height = 48;
+ currentBoundary.image.Y = Y;
+ Y = currentBoundary.image.Y + currentBoundary.image.height;
+ }
+ let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;
+ let currentBoundaryLabelConf = boundaryFont(conf);
+ currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;
+ currentBoundaryLabelConf.fontWeight = "bold";
+ calcC4ShapeTextWH(
+ "label",
+ currentBoundary,
+ currentBoundaryTextWrap,
+ currentBoundaryLabelConf,
+ currentBounds.data.widthLimit
+ );
+ currentBoundary["label"].Y = Y + 8;
+ Y = currentBoundary["label"].Y + currentBoundary["label"].height;
+ if (currentBoundary.type && currentBoundary.type.text !== "") {
+ currentBoundary.type.text = "[" + currentBoundary.type.text + "]";
+ let currentBoundaryTypeConf = boundaryFont(conf);
+ calcC4ShapeTextWH(
+ "type",
+ currentBoundary,
+ currentBoundaryTextWrap,
+ currentBoundaryTypeConf,
+ currentBounds.data.widthLimit
+ );
+ currentBoundary["type"].Y = Y + 5;
+ Y = currentBoundary["type"].Y + currentBoundary["type"].height;
+ }
+ if (currentBoundary.descr && currentBoundary.descr.text !== "") {
+ let currentBoundaryDescrConf = boundaryFont(conf);
+ currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;
+ calcC4ShapeTextWH(
+ "descr",
+ currentBoundary,
+ currentBoundaryTextWrap,
+ currentBoundaryDescrConf,
+ currentBounds.data.widthLimit
+ );
+ currentBoundary["descr"].Y = Y + 20;
+ Y = currentBoundary["descr"].Y + currentBoundary["descr"].height;
+ }
+ if (i == 0 || i % c4BoundaryInRow === 0) {
+ let _x = parentBounds.data.startx + conf.diagramMarginX;
+ let _y = parentBounds.data.stopy + conf.diagramMarginY + Y;
+ currentBounds.setData(_x, _x, _y, _y);
+ } else {
+ let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx;
+ let _y = currentBounds.data.starty;
+ currentBounds.setData(_x, _x, _y, _y);
+ }
+ currentBounds.name = currentBoundary.alias;
+ let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias);
+ let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias);
+ if (currentPersonOrSystemKeys.length > 0) {
+ drawC4ShapeArray(
+ currentBounds,
+ diagram2,
+ currentPersonOrSystemArray,
+ currentPersonOrSystemKeys
+ );
+ }
+ parentBoundaryAlias = currentBoundary.alias;
+ let nextCurrentBoundaries = diagObj.db.getBoundarys(parentBoundaryAlias);
+ if (nextCurrentBoundaries.length > 0) {
+ drawInsideBoundary(
+ diagram2,
+ parentBoundaryAlias,
+ currentBounds,
+ nextCurrentBoundaries,
+ diagObj
+ );
+ }
+ if (currentBoundary.alias !== "global") {
+ drawBoundary(diagram2, currentBoundary, currentBounds);
+ }
+ parentBounds.data.stopy = Math.max(
+ currentBounds.data.stopy + conf.c4ShapeMargin,
+ parentBounds.data.stopy
+ );
+ parentBounds.data.stopx = Math.max(
+ currentBounds.data.stopx + conf.c4ShapeMargin,
+ parentBounds.data.stopx
+ );
+ globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);
+ globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);
+ }
+}
+const draw = function(_text, id, _version, diagObj) {
+ conf = getConfig().c4;
+ const securityLevel = getConfig().securityLevel;
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = select("#i" + id);
+ }
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
+ let db2 = diagObj.db;
+ diagObj.db.setWrap(conf.wrap);
+ c4ShapeInRow = db2.getC4ShapeInRow();
+ c4BoundaryInRow = db2.getC4BoundaryInRow();
+ log.debug(`C:${JSON.stringify(conf, null, 2)}`);
+ const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
+ svgDraw.insertComputerIcon(diagram2);
+ svgDraw.insertDatabaseIcon(diagram2);
+ svgDraw.insertClockIcon(diagram2);
+ let screenBounds = new Bounds(diagObj);
+ screenBounds.setData(
+ conf.diagramMarginX,
+ conf.diagramMarginX,
+ conf.diagramMarginY,
+ conf.diagramMarginY
+ );
+ screenBounds.data.widthLimit = screen.availWidth;
+ globalBoundaryMaxX = conf.diagramMarginX;
+ globalBoundaryMaxY = conf.diagramMarginY;
+ const title2 = diagObj.db.getTitle();
+ let currentBoundaries = diagObj.db.getBoundarys("");
+ drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj);
+ svgDraw.insertArrowHead(diagram2);
+ svgDraw.insertArrowEnd(diagram2);
+ svgDraw.insertArrowCrossHead(diagram2);
+ svgDraw.insertArrowFilledHead(diagram2);
+ drawRels(diagram2, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj);
+ screenBounds.data.stopx = globalBoundaryMaxX;
+ screenBounds.data.stopy = globalBoundaryMaxY;
+ const box = screenBounds.data;
+ let boxHeight = box.stopy - box.starty;
+ let height = boxHeight + 2 * conf.diagramMarginY;
+ let boxWidth = box.stopx - box.startx;
+ const width = boxWidth + 2 * conf.diagramMarginX;
+ if (title2) {
+ diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
+ }
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
+ const extraVertForTitle = title2 ? 60 : 0;
+ diagram2.attr(
+ "viewBox",
+ box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
+ );
+ log.debug(`models:`, box);
+};
+const renderer = {
+ drawPersonOrSystemArray: drawC4ShapeArray,
+ drawBoundary,
+ setConf,
+ draw
+};
+const getStyles = (options) => `.person {
+ stroke: ${options.personBorder};
+ fill: ${options.personBkg};
+ }
+`;
+const styles = getStyles;
+const diagram = {
+ parser: parser$1,
+ db,
+ renderer,
+ styles,
+ init: ({ c4, wrap }) => {
+ renderer.setConf(c4);
+ db.setWrap(wrap);
+ }
+};
+export {
+ diagram
+};
diff --git a/assets/lib/mermaid/c4Diagram-af207393.js b/assets/lib/mermaid/c4Diagram-af207393.js
new file mode 100644
index 00000000..89fa63ad
--- /dev/null
+++ b/assets/lib/mermaid/c4Diagram-af207393.js
@@ -0,0 +1,2463 @@
+import { s as setAccTitle, g as getAccTitle, a as getAccDescription, b as setAccDescription, c as getConfig, d as sanitizeText, e as dist, f as common, h as assignWithDepth, i as calculateTextWidth, j as d3select, l as log, k as configureSvgSize, w as wrapLabel, m as calculateTextHeight } from "./mermaid-dcacb631.js";
+import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-d6ab583c.js";
+var parser = function() {
+ var o = function(k, v, o2, l) {
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
+ ;
+ return o2;
+ }, $V0 = [1, 24], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 63], $V6 = [1, 64], $V7 = [1, 65], $V8 = [1, 66], $V9 = [1, 67], $Va = [1, 68], $Vb = [1, 69], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 43], $Vr = [1, 44], $Vs = [1, 45], $Vt = [1, 46], $Vu = [1, 47], $Vv = [1, 48], $Vw = [1, 50], $Vx = [1, 51], $Vy = [1, 52], $Vz = [1, 53], $VA = [1, 54], $VB = [1, 55], $VC = [1, 56], $VD = [1, 57], $VE = [1, 58], $VF = [1, 59], $VG = [1, 60], $VH = [14, 42], $VI = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VJ = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VK = [1, 82], $VL = [1, 83], $VM = [1, 84], $VN = [1, 85], $VO = [12, 14, 42], $VP = [12, 14, 33, 42], $VQ = [12, 14, 33, 42, 76, 77, 79, 80], $VR = [12, 33], $VS = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74];
+ var parser2 = {
+ trace: function trace() {
+ },
+ yy: {},
+ symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "direction_tb": 6, "direction_bt": 7, "direction_rl": 8, "direction_lr": 9, "graphConfig": 10, "C4_CONTEXT": 11, "NEWLINE": 12, "statements": 13, "EOF": 14, "C4_CONTAINER": 15, "C4_COMPONENT": 16, "C4_DYNAMIC": 17, "C4_DEPLOYMENT": 18, "otherStatements": 19, "diagramStatements": 20, "otherStatement": 21, "title": 22, "accDescription": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "boundaryStatement": 29, "boundaryStartStatement": 30, "boundaryStopStatement": 31, "boundaryStart": 32, "LBRACE": 33, "ENTERPRISE_BOUNDARY": 34, "attributes": 35, "SYSTEM_BOUNDARY": 36, "BOUNDARY": 37, "CONTAINER_BOUNDARY": 38, "NODE": 39, "NODE_L": 40, "NODE_R": 41, "RBRACE": 42, "diagramStatement": 43, "PERSON": 44, "PERSON_EXT": 45, "SYSTEM": 46, "SYSTEM_DB": 47, "SYSTEM_QUEUE": 48, "SYSTEM_EXT": 49, "SYSTEM_EXT_DB": 50, "SYSTEM_EXT_QUEUE": 51, "CONTAINER": 52, "CONTAINER_DB": 53, "CONTAINER_QUEUE": 54, "CONTAINER_EXT": 55, "CONTAINER_EXT_DB": 56, "CONTAINER_EXT_QUEUE": 57, "COMPONENT": 58, "COMPONENT_DB": 59, "COMPONENT_QUEUE": 60, "COMPONENT_EXT": 61, "COMPONENT_EXT_DB": 62, "COMPONENT_EXT_QUEUE": 63, "REL": 64, "BIREL": 65, "REL_U": 66, "REL_D": 67, "REL_L": 68, "REL_R": 69, "REL_B": 70, "REL_INDEX": 71, "UPDATE_EL_STYLE": 72, "UPDATE_REL_STYLE": 73, "UPDATE_LAYOUT_CONFIG": 74, "attribute": 75, "STR": 76, "STR_KEY": 77, "STR_VALUE": 78, "ATTRIBUTE": 79, "ATTRIBUTE_EMPTY": 80, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" },
+ productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]],
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
+ var $0 = $$.length - 1;
+ switch (yystate) {
+ case 3:
+ yy.setDirection("TB");
+ break;
+ case 4:
+ yy.setDirection("BT");
+ break;
+ case 5:
+ yy.setDirection("RL");
+ break;
+ case 6:
+ yy.setDirection("LR");
+ break;
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ yy.setC4Type($$[$0 - 3]);
+ break;
+ case 19:
+ yy.setTitle($$[$0].substring(6));
+ this.$ = $$[$0].substring(6);
+ break;
+ case 20:
+ yy.setAccDescription($$[$0].substring(15));
+ this.$ = $$[$0].substring(15);
+ break;
+ case 21:
+ this.$ = $$[$0].trim();
+ yy.setTitle(this.$);
+ break;
+ case 22:
+ case 23:
+ this.$ = $$[$0].trim();
+ yy.setAccDescription(this.$);
+ break;
+ case 28:
+ case 29:
+ $$[$0].splice(2, 0, "ENTERPRISE");
+ yy.addPersonOrSystemBoundary(...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 30:
+ yy.addPersonOrSystemBoundary(...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 31:
+ $$[$0].splice(2, 0, "CONTAINER");
+ yy.addContainerBoundary(...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 32:
+ yy.addDeploymentNode("node", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 33:
+ yy.addDeploymentNode("nodeL", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 34:
+ yy.addDeploymentNode("nodeR", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 35:
+ yy.popBoundaryParseStack();
+ break;
+ case 39:
+ yy.addPersonOrSystem("person", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 40:
+ yy.addPersonOrSystem("external_person", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 41:
+ yy.addPersonOrSystem("system", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 42:
+ yy.addPersonOrSystem("system_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 43:
+ yy.addPersonOrSystem("system_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 44:
+ yy.addPersonOrSystem("external_system", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 45:
+ yy.addPersonOrSystem("external_system_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 46:
+ yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 47:
+ yy.addContainer("container", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 48:
+ yy.addContainer("container_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 49:
+ yy.addContainer("container_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 50:
+ yy.addContainer("external_container", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 51:
+ yy.addContainer("external_container_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 52:
+ yy.addContainer("external_container_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 53:
+ yy.addComponent("component", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 54:
+ yy.addComponent("component_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 55:
+ yy.addComponent("component_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 56:
+ yy.addComponent("external_component", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 57:
+ yy.addComponent("external_component_db", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 58:
+ yy.addComponent("external_component_queue", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 60:
+ yy.addRel("rel", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 61:
+ yy.addRel("birel", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 62:
+ yy.addRel("rel_u", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 63:
+ yy.addRel("rel_d", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 64:
+ yy.addRel("rel_l", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 65:
+ yy.addRel("rel_r", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 66:
+ yy.addRel("rel_b", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 67:
+ $$[$0].splice(0, 1);
+ yy.addRel("rel", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 68:
+ yy.updateElStyle("update_el_style", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 69:
+ yy.updateRelStyle("update_rel_style", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 70:
+ yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
+ this.$ = $$[$0];
+ break;
+ case 71:
+ this.$ = [$$[$0]];
+ break;
+ case 72:
+ $$[$0].unshift($$[$0 - 1]);
+ this.$ = $$[$0];
+ break;
+ case 73:
+ case 75:
+ this.$ = $$[$0].trim();
+ break;
+ case 74:
+ let kv = {};
+ kv[$$[$0 - 1].trim()] = $$[$0].trim();
+ this.$ = kv;
+ break;
+ case 76:
+ this.$ = "";
+ break;
+ }
+ },
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VH, [2, 14]), o($VI, [2, 16], { 12: [1, 76] }), o($VH, [2, 36], { 12: [1, 77] }), o($VJ, [2, 19]), o($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o($VH, [2, 15]), o($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VJ, [2, 21]), o($VJ, [2, 22]), o($VO, [2, 39]), o($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o($VQ, [2, 73]), { 78: [1, 133] }, o($VQ, [2, 75]), o($VQ, [2, 76]), o($VO, [2, 40]), o($VO, [2, 41]), o($VO, [2, 42]), o($VO, [2, 43]), o($VO, [2, 44]), o($VO, [2, 45]), o($VO, [2, 46]), o($VO, [2, 47]), o($VO, [2, 48]), o($VO, [2, 49]), o($VO, [2, 50]), o($VO, [2, 51]), o($VO, [2, 52]), o($VO, [2, 53]), o($VO, [2, 54]), o($VO, [2, 55]), o($VO, [2, 56]), o($VO, [2, 57]), o($VO, [2, 58]), o($VO, [2, 60]), o($VO, [2, 61]), o($VO, [2, 62]), o($VO, [2, 63]), o($VO, [2, 64]), o($VO, [2, 65]), o($VO, [2, 66]), o($VO, [2, 67]), o($VO, [2, 68]), o($VO, [2, 69]), o($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o($VR, [2, 28]), o($VR, [2, 29]), o($VR, [2, 30]), o($VR, [2, 31]), o($VR, [2, 32]), o($VR, [2, 33]), o($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o($VI, [2, 18]), o($VH, [2, 38]), o($VP, [2, 72]), o($VQ, [2, 74]), o($VO, [2, 24]), o($VO, [2, 35]), o($VS, [2, 25]), o($VS, [2, 26], { 12: [1, 138] }), o($VS, [2, 27])],
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
+ parseError: function parseError(str, hash) {
+ if (hash.recoverable) {
+ this.trace(str);
+ } else {
+ var error = new Error(str);
+ error.hash = hash;
+ throw error;
+ }
+ },
+ parse: function parse(input) {
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
+ var args = lstack.slice.call(arguments, 1);
+ var lexer2 = Object.create(this.lexer);
+ var sharedState = { yy: {} };
+ for (var k in this.yy) {
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
+ sharedState.yy[k] = this.yy[k];
+ }
+ }
+ lexer2.setInput(input, sharedState.yy);
+ sharedState.yy.lexer = lexer2;
+ sharedState.yy.parser = this;
+ if (typeof lexer2.yylloc == "undefined") {
+ lexer2.yylloc = {};
+ }
+ var yyloc = lexer2.yylloc;
+ lstack.push(yyloc);
+ var ranges = lexer2.options && lexer2.options.ranges;
+ if (typeof sharedState.yy.parseError === "function") {
+ this.parseError = sharedState.yy.parseError;
+ } else {
+ this.parseError = Object.getPrototypeOf(this).parseError;
+ }
+ function lex() {
+ var token;
+ token = tstack.pop() || lexer2.lex() || EOF;
+ if (typeof token !== "number") {
+ if (token instanceof Array) {
+ tstack = token;
+ token = tstack.pop();
+ }
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol === null || typeof symbol == "undefined") {
+ symbol = lex();
+ }
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ var errStr = "";
+ expected = [];
+ for (p in table[state]) {
+ if (this.terminals_[p] && p > TERROR) {
+ expected.push("'" + this.terminals_[p] + "'");
+ }
+ }
+ if (lexer2.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {
+ text: lexer2.match,
+ token: this.terminals_[symbol] || symbol,
+ line: lexer2.yylineno,
+ loc: yyloc,
+ expected
+ });
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(lexer2.yytext);
+ lstack.push(lexer2.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ {
+ yyleng = lexer2.yyleng;
+ yytext = lexer2.yytext;
+ yylineno = lexer2.yylineno;
+ yyloc = lexer2.yylloc;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = {
+ first_line: lstack[lstack.length - (len || 1)].first_line,
+ last_line: lstack[lstack.length - 1].last_line,
+ first_column: lstack[lstack.length - (len || 1)].first_column,
+ last_column: lstack[lstack.length - 1].last_column
+ };
+ if (ranges) {
+ yyval._$.range = [
+ lstack[lstack.length - (len || 1)].range[0],
+ lstack[lstack.length - 1].range[1]
+ ];
+ }
+ r = this.performAction.apply(yyval, [
+ yytext,
+ yyleng,
+ yylineno,
+ sharedState.yy,
+ action[1],
+ vstack,
+ lstack
+ ].concat(args));
+ if (typeof r !== "undefined") {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+ }
+ };
+ var lexer = function() {
+ var lexer2 = {
+ EOF: 1,
+ parseError: function parseError(str, hash) {
+ if (this.yy.parser) {
+ this.yy.parser.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+ // resets the lexer, sets new input
+ setInput: function(input, yy) {
+ this.yy = yy || this.yy || {};
+ this._input = input;
+ this._more = this._backtrack = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = "";
+ this.conditionStack = ["INITIAL"];
+ this.yylloc = {
+ first_line: 1,
+ first_column: 0,
+ last_line: 1,
+ last_column: 0
+ };
+ if (this.options.ranges) {
+ this.yylloc.range = [0, 0];
+ }
+ this.offset = 0;
+ return this;
+ },
+ // consumes and returns one char from the input
+ input: function() {
+ var ch = this._input[0];
+ this.yytext += ch;
+ this.yyleng++;
+ this.offset++;
+ this.match += ch;
+ this.matched += ch;
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno++;
+ this.yylloc.last_line++;
+ } else {
+ this.yylloc.last_column++;
+ }
+ if (this.options.ranges) {
+ this.yylloc.range[1]++;
+ }
+ this._input = this._input.slice(1);
+ return ch;
+ },
+ // unshifts one char (or a string) into the input
+ unput: function(ch) {
+ var len = ch.length;
+ var lines = ch.split(/(?:\r\n?|\n)/g);
+ this._input = ch + this._input;
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
+ this.offset -= len;
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
+ this.match = this.match.substr(0, this.match.length - 1);
+ this.matched = this.matched.substr(0, this.matched.length - 1);
+ if (lines.length - 1) {
+ this.yylineno -= lines.length - 1;
+ }
+ var r = this.yylloc.range;
+ this.yylloc = {
+ first_line: this.yylloc.first_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.first_column,
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
+ };
+ if (this.options.ranges) {
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
+ }
+ this.yyleng = this.yytext.length;
+ return this;
+ },
+ // When called from action, caches matched text and appends it on next action
+ more: function() {
+ this._more = true;
+ return this;
+ },
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
+ reject: function() {
+ if (this.options.backtrack_lexer) {
+ this._backtrack = true;
+ } else {
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ }
+ return this;
+ },
+ // retain first n characters of the match
+ less: function(n) {
+ this.unput(this.match.slice(n));
+ },
+ // displays already matched input, i.e. for error messages
+ pastInput: function() {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
+ },
+ // displays upcoming input, i.e. for error messages
+ upcomingInput: function() {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20 - next.length);
+ }
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
+ },
+ // displays the character position where the lexing error occurred, i.e. for error messages
+ showPosition: function() {
+ var pre = this.pastInput();
+ var c2 = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c2 + "^";
+ },
+ // test the lexed token: return FALSE when not a match, otherwise return token
+ test_match: function(match, indexed_rule) {
+ var token, lines, backup;
+ if (this.options.backtrack_lexer) {
+ backup = {
+ yylineno: this.yylineno,
+ yylloc: {
+ first_line: this.yylloc.first_line,
+ last_line: this.last_line,
+ first_column: this.yylloc.first_column,
+ last_column: this.yylloc.last_column
+ },
+ yytext: this.yytext,
+ match: this.match,
+ matches: this.matches,
+ matched: this.matched,
+ yyleng: this.yyleng,
+ offset: this.offset,
+ _more: this._more,
+ _input: this._input,
+ yy: this.yy,
+ conditionStack: this.conditionStack.slice(0),
+ done: this.done
+ };
+ if (this.options.ranges) {
+ backup.yylloc.range = this.yylloc.range.slice(0);
+ }
+ }
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno += lines.length;
+ }
+ this.yylloc = {
+ first_line: this.yylloc.last_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
+ };
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ if (this.options.ranges) {
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
+ }
+ this._more = false;
+ this._backtrack = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
+ if (this.done && this._input) {
+ this.done = false;
+ }
+ if (token) {
+ return token;
+ } else if (this._backtrack) {
+ for (var k in backup) {
+ this[k] = backup[k];
+ }
+ return false;
+ }
+ return false;
+ },
+ // return next match in input
+ next: function() {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) {
+ this.done = true;
+ }
+ var token, match, tempMatch, index;
+ if (!this._more) {
+ this.yytext = "";
+ this.match = "";
+ }
+ var rules = this._currentRules();
+ for (var i = 0; i < rules.length; i++) {
+ tempMatch = this._input.match(this.rules[rules[i]]);
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
+ match = tempMatch;
+ index = i;
+ if (this.options.backtrack_lexer) {
+ token = this.test_match(tempMatch, rules[i]);
+ if (token !== false) {
+ return token;
+ } else if (this._backtrack) {
+ match = false;
+ continue;
+ } else {
+ return false;
+ }
+ } else if (!this.options.flex) {
+ break;
+ }
+ }
+ }
+ if (match) {
+ token = this.test_match(match, rules[index]);
+ if (token !== false) {
+ return token;
+ }
+ return false;
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
+ text: "",
+ token: null,
+ line: this.yylineno
+ });
+ }
+ },
+ // return next match that has a token
+ lex: function lex() {
+ var r = this.next();
+ if (r) {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
+ begin: function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+ // pop the previously active lexer condition state off the condition stack
+ popState: function popState() {
+ var n = this.conditionStack.length - 1;
+ if (n > 0) {
+ return this.conditionStack.pop();
+ } else {
+ return this.conditionStack[0];
+ }
+ },
+ // produce the lexer rule set which is active for the currently active lexer condition state
+ _currentRules: function _currentRules() {
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
+ } else {
+ return this.conditions["INITIAL"].rules;
+ }
+ },
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
+ topState: function topState(n) {
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
+ if (n >= 0) {
+ return this.conditionStack[n];
+ } else {
+ return "INITIAL";
+ }
+ },
+ // alias for begin(condition)
+ pushState: function pushState(condition) {
+ this.begin(condition);
+ },
+ // return the number of states currently on the stack
+ stateStackSize: function stateStackSize() {
+ return this.conditionStack.length;
+ },
+ options: {},
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
+ switch ($avoiding_name_collisions) {
+ case 0:
+ return 6;
+ case 1:
+ return 7;
+ case 2:
+ return 8;
+ case 3:
+ return 9;
+ case 4:
+ return 22;
+ case 5:
+ return 23;
+ case 6:
+ this.begin("acc_title");
+ return 24;
+ case 7:
+ this.popState();
+ return "acc_title_value";
+ case 8:
+ this.begin("acc_descr");
+ return 26;
+ case 9:
+ this.popState();
+ return "acc_descr_value";
+ case 10:
+ this.begin("acc_descr_multiline");
+ break;
+ case 11:
+ this.popState();
+ break;
+ case 12:
+ return "acc_descr_multiline_value";
+ case 13:
+ break;
+ case 14:
+ c;
+ break;
+ case 15:
+ return 12;
+ case 16:
+ break;
+ case 17:
+ return 11;
+ case 18:
+ return 15;
+ case 19:
+ return 16;
+ case 20:
+ return 17;
+ case 21:
+ return 18;
+ case 22:
+ this.begin("person_ext");
+ return 45;
+ case 23:
+ this.begin("person");
+ return 44;
+ case 24:
+ this.begin("system_ext_queue");
+ return 51;
+ case 25:
+ this.begin("system_ext_db");
+ return 50;
+ case 26:
+ this.begin("system_ext");
+ return 49;
+ case 27:
+ this.begin("system_queue");
+ return 48;
+ case 28:
+ this.begin("system_db");
+ return 47;
+ case 29:
+ this.begin("system");
+ return 46;
+ case 30:
+ this.begin("boundary");
+ return 37;
+ case 31:
+ this.begin("enterprise_boundary");
+ return 34;
+ case 32:
+ this.begin("system_boundary");
+ return 36;
+ case 33:
+ this.begin("container_ext_queue");
+ return 57;
+ case 34:
+ this.begin("container_ext_db");
+ return 56;
+ case 35:
+ this.begin("container_ext");
+ return 55;
+ case 36:
+ this.begin("container_queue");
+ return 54;
+ case 37:
+ this.begin("container_db");
+ return 53;
+ case 38:
+ this.begin("container");
+ return 52;
+ case 39:
+ this.begin("container_boundary");
+ return 38;
+ case 40:
+ this.begin("component_ext_queue");
+ return 63;
+ case 41:
+ this.begin("component_ext_db");
+ return 62;
+ case 42:
+ this.begin("component_ext");
+ return 61;
+ case 43:
+ this.begin("component_queue");
+ return 60;
+ case 44:
+ this.begin("component_db");
+ return 59;
+ case 45:
+ this.begin("component");
+ return 58;
+ case 46:
+ this.begin("node");
+ return 39;
+ case 47:
+ this.begin("node");
+ return 39;
+ case 48:
+ this.begin("node_l");
+ return 40;
+ case 49:
+ this.begin("node_r");
+ return 41;
+ case 50:
+ this.begin("rel");
+ return 64;
+ case 51:
+ this.begin("birel");
+ return 65;
+ case 52:
+ this.begin("rel_u");
+ return 66;
+ case 53:
+ this.begin("rel_u");
+ return 66;
+ case 54:
+ this.begin("rel_d");
+ return 67;
+ case 55:
+ this.begin("rel_d");
+ return 67;
+ case 56:
+ this.begin("rel_l");
+ return 68;
+ case 57:
+ this.begin("rel_l");
+ return 68;
+ case 58:
+ this.begin("rel_r");
+ return 69;
+ case 59:
+ this.begin("rel_r");
+ return 69;
+ case 60:
+ this.begin("rel_b");
+ return 70;
+ case 61:
+ this.begin("rel_index");
+ return 71;
+ case 62:
+ this.begin("update_el_style");
+ return 72;
+ case 63:
+ this.begin("update_rel_style");
+ return 73;
+ case 64:
+ this.begin("update_layout_config");
+ return 74;
+ case 65:
+ return "EOF_IN_STRUCT";
+ case 66:
+ this.begin("attribute");
+ return "ATTRIBUTE_EMPTY";
+ case 67:
+ this.begin("attribute");
+ break;
+ case 68:
+ this.popState();
+ this.popState();
+ break;
+ case 69:
+ return 80;
+ case 70:
+ break;
+ case 71:
+ return 80;
+ case 72:
+ this.begin("string");
+ break;
+ case 73:
+ this.popState();
+ break;
+ case 74:
+ return "STR";
+ case 75:
+ this.begin("string_kv");
+ break;
+ case 76:
+ this.begin("string_kv_key");
+ return "STR_KEY";
+ case 77:
+ this.popState();
+ this.begin("string_kv_value");
+ break;
+ case 78:
+ return "STR_VALUE";
+ case 79:
+ this.popState();
+ this.popState();
+ break;
+ case 80:
+ return "STR";
+ case 81:
+ return "LBRACE";
+ case 82:
+ return "RBRACE";
+ case 83:
+ return "SPACE";
+ case 84:
+ return "EOL";
+ case 85:
+ return 14;
+ }
+ },
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/],
+ conditions: { "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "string_kv_value": { "rules": [78, 79], "inclusive": false }, "string_kv_key": { "rules": [77], "inclusive": false }, "string_kv": { "rules": [76], "inclusive": false }, "string": { "rules": [73, 74], "inclusive": false }, "attribute": { "rules": [68, 69, 70, 71, 72, 75, 80], "inclusive": false }, "update_layout_config": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_rel_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_el_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_b": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_d": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_u": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "node": { "rules": [65, 66, 67, 68], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container": { "rules": [65, 66, 67, 68], "inclusive": false }, "birel": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "enterprise_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system": { "rules": [65, 66, 67, 68], "inclusive": false }, "person_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "person": { "rules": [65, 66, 67, 68], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], "inclusive": true } }
+ };
+ return lexer2;
+ }();
+ parser2.lexer = lexer;
+ function Parser() {
+ this.yy = {};
+ }
+ Parser.prototype = parser2;
+ parser2.Parser = Parser;
+ return new Parser();
+}();
+parser.parser = parser;
+const parser$1 = parser;
+let c4ShapeArray = [];
+let boundaryParseStack = [""];
+let currentBoundaryParse = "global";
+let parentBoundaryParse = "";
+let boundaries = [
+ {
+ alias: "global",
+ label: { text: "global" },
+ type: { text: "global" },
+ tags: null,
+ link: null,
+ parentBoundary: ""
+ }
+];
+let rels = [];
+let title = "";
+let wrapEnabled = false;
+let c4ShapeInRow$1 = 4;
+let c4BoundaryInRow$1 = 2;
+var c4Type;
+const getC4Type = function() {
+ return c4Type;
+};
+const setC4Type = function(c4TypeParam) {
+ let sanitizedText = sanitizeText(c4TypeParam, getConfig());
+ c4Type = sanitizedText;
+};
+const addRel = function(type, from, to, label, techn, descr, sprite, tags, link) {
+ if (type === void 0 || type === null || from === void 0 || from === null || to === void 0 || to === null || label === void 0 || label === null) {
+ return;
+ }
+ let rel = {};
+ const old = rels.find((rel2) => rel2.from === from && rel2.to === to);
+ if (old) {
+ rel = old;
+ } else {
+ rels.push(rel);
+ }
+ rel.type = type;
+ rel.from = from;
+ rel.to = to;
+ rel.label = { text: label };
+ if (techn === void 0 || techn === null) {
+ rel.techn = { text: "" };
+ } else {
+ if (typeof techn === "object") {
+ let [key, value] = Object.entries(techn)[0];
+ rel[key] = { text: value };
+ } else {
+ rel.techn = { text: techn };
+ }
+ }
+ if (descr === void 0 || descr === null) {
+ rel.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ rel[key] = { text: value };
+ } else {
+ rel.descr = { text: descr };
+ }
+ }
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ rel[key] = value;
+ } else {
+ rel.sprite = sprite;
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ rel[key] = value;
+ } else {
+ rel.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ rel[key] = value;
+ } else {
+ rel.link = link;
+ }
+ rel.wrap = autoWrap();
+};
+const addPersonOrSystem = function(typeC4Shape, alias, label, descr, sprite, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let personOrSystem = {};
+ const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias);
+ if (old && alias === old.alias) {
+ personOrSystem = old;
+ } else {
+ personOrSystem.alias = alias;
+ c4ShapeArray.push(personOrSystem);
+ }
+ if (label === void 0 || label === null) {
+ personOrSystem.label = { text: "" };
+ } else {
+ personOrSystem.label = { text: label };
+ }
+ if (descr === void 0 || descr === null) {
+ personOrSystem.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ personOrSystem[key] = { text: value };
+ } else {
+ personOrSystem.descr = { text: descr };
+ }
+ }
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ personOrSystem[key] = value;
+ } else {
+ personOrSystem.sprite = sprite;
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ personOrSystem[key] = value;
+ } else {
+ personOrSystem.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ personOrSystem[key] = value;
+ } else {
+ personOrSystem.link = link;
+ }
+ personOrSystem.typeC4Shape = { text: typeC4Shape };
+ personOrSystem.parentBoundary = currentBoundaryParse;
+ personOrSystem.wrap = autoWrap();
+};
+const addContainer = function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let container = {};
+ const old = c4ShapeArray.find((container2) => container2.alias === alias);
+ if (old && alias === old.alias) {
+ container = old;
+ } else {
+ container.alias = alias;
+ c4ShapeArray.push(container);
+ }
+ if (label === void 0 || label === null) {
+ container.label = { text: "" };
+ } else {
+ container.label = { text: label };
+ }
+ if (techn === void 0 || techn === null) {
+ container.techn = { text: "" };
+ } else {
+ if (typeof techn === "object") {
+ let [key, value] = Object.entries(techn)[0];
+ container[key] = { text: value };
+ } else {
+ container.techn = { text: techn };
+ }
+ }
+ if (descr === void 0 || descr === null) {
+ container.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ container[key] = { text: value };
+ } else {
+ container.descr = { text: descr };
+ }
+ }
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ container[key] = value;
+ } else {
+ container.sprite = sprite;
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ container[key] = value;
+ } else {
+ container.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ container[key] = value;
+ } else {
+ container.link = link;
+ }
+ container.wrap = autoWrap();
+ container.typeC4Shape = { text: typeC4Shape };
+ container.parentBoundary = currentBoundaryParse;
+};
+const addComponent = function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let component = {};
+ const old = c4ShapeArray.find((component2) => component2.alias === alias);
+ if (old && alias === old.alias) {
+ component = old;
+ } else {
+ component.alias = alias;
+ c4ShapeArray.push(component);
+ }
+ if (label === void 0 || label === null) {
+ component.label = { text: "" };
+ } else {
+ component.label = { text: label };
+ }
+ if (techn === void 0 || techn === null) {
+ component.techn = { text: "" };
+ } else {
+ if (typeof techn === "object") {
+ let [key, value] = Object.entries(techn)[0];
+ component[key] = { text: value };
+ } else {
+ component.techn = { text: techn };
+ }
+ }
+ if (descr === void 0 || descr === null) {
+ component.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ component[key] = { text: value };
+ } else {
+ component.descr = { text: descr };
+ }
+ }
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ component[key] = value;
+ } else {
+ component.sprite = sprite;
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ component[key] = value;
+ } else {
+ component.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ component[key] = value;
+ } else {
+ component.link = link;
+ }
+ component.wrap = autoWrap();
+ component.typeC4Shape = { text: typeC4Shape };
+ component.parentBoundary = currentBoundaryParse;
+};
+const addPersonOrSystemBoundary = function(alias, label, type, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let boundary = {};
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
+ if (old && alias === old.alias) {
+ boundary = old;
+ } else {
+ boundary.alias = alias;
+ boundaries.push(boundary);
+ }
+ if (label === void 0 || label === null) {
+ boundary.label = { text: "" };
+ } else {
+ boundary.label = { text: label };
+ }
+ if (type === void 0 || type === null) {
+ boundary.type = { text: "system" };
+ } else {
+ if (typeof type === "object") {
+ let [key, value] = Object.entries(type)[0];
+ boundary[key] = { text: value };
+ } else {
+ boundary.type = { text: type };
+ }
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ boundary[key] = value;
+ } else {
+ boundary.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ boundary[key] = value;
+ } else {
+ boundary.link = link;
+ }
+ boundary.parentBoundary = currentBoundaryParse;
+ boundary.wrap = autoWrap();
+ parentBoundaryParse = currentBoundaryParse;
+ currentBoundaryParse = alias;
+ boundaryParseStack.push(parentBoundaryParse);
+};
+const addContainerBoundary = function(alias, label, type, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let boundary = {};
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
+ if (old && alias === old.alias) {
+ boundary = old;
+ } else {
+ boundary.alias = alias;
+ boundaries.push(boundary);
+ }
+ if (label === void 0 || label === null) {
+ boundary.label = { text: "" };
+ } else {
+ boundary.label = { text: label };
+ }
+ if (type === void 0 || type === null) {
+ boundary.type = { text: "container" };
+ } else {
+ if (typeof type === "object") {
+ let [key, value] = Object.entries(type)[0];
+ boundary[key] = { text: value };
+ } else {
+ boundary.type = { text: type };
+ }
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ boundary[key] = value;
+ } else {
+ boundary.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ boundary[key] = value;
+ } else {
+ boundary.link = link;
+ }
+ boundary.parentBoundary = currentBoundaryParse;
+ boundary.wrap = autoWrap();
+ parentBoundaryParse = currentBoundaryParse;
+ currentBoundaryParse = alias;
+ boundaryParseStack.push(parentBoundaryParse);
+};
+const addDeploymentNode = function(nodeType, alias, label, type, descr, sprite, tags, link) {
+ if (alias === null || label === null) {
+ return;
+ }
+ let boundary = {};
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
+ if (old && alias === old.alias) {
+ boundary = old;
+ } else {
+ boundary.alias = alias;
+ boundaries.push(boundary);
+ }
+ if (label === void 0 || label === null) {
+ boundary.label = { text: "" };
+ } else {
+ boundary.label = { text: label };
+ }
+ if (type === void 0 || type === null) {
+ boundary.type = { text: "node" };
+ } else {
+ if (typeof type === "object") {
+ let [key, value] = Object.entries(type)[0];
+ boundary[key] = { text: value };
+ } else {
+ boundary.type = { text: type };
+ }
+ }
+ if (descr === void 0 || descr === null) {
+ boundary.descr = { text: "" };
+ } else {
+ if (typeof descr === "object") {
+ let [key, value] = Object.entries(descr)[0];
+ boundary[key] = { text: value };
+ } else {
+ boundary.descr = { text: descr };
+ }
+ }
+ if (typeof tags === "object") {
+ let [key, value] = Object.entries(tags)[0];
+ boundary[key] = value;
+ } else {
+ boundary.tags = tags;
+ }
+ if (typeof link === "object") {
+ let [key, value] = Object.entries(link)[0];
+ boundary[key] = value;
+ } else {
+ boundary.link = link;
+ }
+ boundary.nodeType = nodeType;
+ boundary.parentBoundary = currentBoundaryParse;
+ boundary.wrap = autoWrap();
+ parentBoundaryParse = currentBoundaryParse;
+ currentBoundaryParse = alias;
+ boundaryParseStack.push(parentBoundaryParse);
+};
+const popBoundaryParseStack = function() {
+ currentBoundaryParse = parentBoundaryParse;
+ boundaryParseStack.pop();
+ parentBoundaryParse = boundaryParseStack.pop();
+ boundaryParseStack.push(parentBoundaryParse);
+};
+const updateElStyle = function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) {
+ let old = c4ShapeArray.find((element) => element.alias === elementName);
+ if (old === void 0) {
+ old = boundaries.find((element) => element.alias === elementName);
+ if (old === void 0) {
+ return;
+ }
+ }
+ if (bgColor !== void 0 && bgColor !== null) {
+ if (typeof bgColor === "object") {
+ let [key, value] = Object.entries(bgColor)[0];
+ old[key] = value;
+ } else {
+ old.bgColor = bgColor;
+ }
+ }
+ if (fontColor !== void 0 && fontColor !== null) {
+ if (typeof fontColor === "object") {
+ let [key, value] = Object.entries(fontColor)[0];
+ old[key] = value;
+ } else {
+ old.fontColor = fontColor;
+ }
+ }
+ if (borderColor !== void 0 && borderColor !== null) {
+ if (typeof borderColor === "object") {
+ let [key, value] = Object.entries(borderColor)[0];
+ old[key] = value;
+ } else {
+ old.borderColor = borderColor;
+ }
+ }
+ if (shadowing !== void 0 && shadowing !== null) {
+ if (typeof shadowing === "object") {
+ let [key, value] = Object.entries(shadowing)[0];
+ old[key] = value;
+ } else {
+ old.shadowing = shadowing;
+ }
+ }
+ if (shape !== void 0 && shape !== null) {
+ if (typeof shape === "object") {
+ let [key, value] = Object.entries(shape)[0];
+ old[key] = value;
+ } else {
+ old.shape = shape;
+ }
+ }
+ if (sprite !== void 0 && sprite !== null) {
+ if (typeof sprite === "object") {
+ let [key, value] = Object.entries(sprite)[0];
+ old[key] = value;
+ } else {
+ old.sprite = sprite;
+ }
+ }
+ if (techn !== void 0 && techn !== null) {
+ if (typeof techn === "object") {
+ let [key, value] = Object.entries(techn)[0];
+ old[key] = value;
+ } else {
+ old.techn = techn;
+ }
+ }
+ if (legendText !== void 0 && legendText !== null) {
+ if (typeof legendText === "object") {
+ let [key, value] = Object.entries(legendText)[0];
+ old[key] = value;
+ } else {
+ old.legendText = legendText;
+ }
+ }
+ if (legendSprite !== void 0 && legendSprite !== null) {
+ if (typeof legendSprite === "object") {
+ let [key, value] = Object.entries(legendSprite)[0];
+ old[key] = value;
+ } else {
+ old.legendSprite = legendSprite;
+ }
+ }
+};
+const updateRelStyle = function(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) {
+ const old = rels.find((rel) => rel.from === from && rel.to === to);
+ if (old === void 0) {
+ return;
+ }
+ if (textColor !== void 0 && textColor !== null) {
+ if (typeof textColor === "object") {
+ let [key, value] = Object.entries(textColor)[0];
+ old[key] = value;
+ } else {
+ old.textColor = textColor;
+ }
+ }
+ if (lineColor !== void 0 && lineColor !== null) {
+ if (typeof lineColor === "object") {
+ let [key, value] = Object.entries(lineColor)[0];
+ old[key] = value;
+ } else {
+ old.lineColor = lineColor;
+ }
+ }
+ if (offsetX !== void 0 && offsetX !== null) {
+ if (typeof offsetX === "object") {
+ let [key, value] = Object.entries(offsetX)[0];
+ old[key] = parseInt(value);
+ } else {
+ old.offsetX = parseInt(offsetX);
+ }
+ }
+ if (offsetY !== void 0 && offsetY !== null) {
+ if (typeof offsetY === "object") {
+ let [key, value] = Object.entries(offsetY)[0];
+ old[key] = parseInt(value);
+ } else {
+ old.offsetY = parseInt(offsetY);
+ }
+ }
+};
+const updateLayoutConfig = function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {
+ let c4ShapeInRowValue = c4ShapeInRow$1;
+ let c4BoundaryInRowValue = c4BoundaryInRow$1;
+ if (typeof c4ShapeInRowParam === "object") {
+ const value = Object.values(c4ShapeInRowParam)[0];
+ c4ShapeInRowValue = parseInt(value);
+ } else {
+ c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
+ }
+ if (typeof c4BoundaryInRowParam === "object") {
+ const value = Object.values(c4BoundaryInRowParam)[0];
+ c4BoundaryInRowValue = parseInt(value);
+ } else {
+ c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
+ }
+ if (c4ShapeInRowValue >= 1) {
+ c4ShapeInRow$1 = c4ShapeInRowValue;
+ }
+ if (c4BoundaryInRowValue >= 1) {
+ c4BoundaryInRow$1 = c4BoundaryInRowValue;
+ }
+};
+const getC4ShapeInRow = function() {
+ return c4ShapeInRow$1;
+};
+const getC4BoundaryInRow = function() {
+ return c4BoundaryInRow$1;
+};
+const getCurrentBoundaryParse = function() {
+ return currentBoundaryParse;
+};
+const getParentBoundaryParse = function() {
+ return parentBoundaryParse;
+};
+const getC4ShapeArray = function(parentBoundary) {
+ if (parentBoundary === void 0 || parentBoundary === null) {
+ return c4ShapeArray;
+ } else {
+ return c4ShapeArray.filter((personOrSystem) => {
+ return personOrSystem.parentBoundary === parentBoundary;
+ });
+ }
+};
+const getC4Shape = function(alias) {
+ return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);
+};
+const getC4ShapeKeys = function(parentBoundary) {
+ return Object.keys(getC4ShapeArray(parentBoundary));
+};
+const getBoundaries = function(parentBoundary) {
+ if (parentBoundary === void 0 || parentBoundary === null) {
+ return boundaries;
+ } else {
+ return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary);
+ }
+};
+const getBoundarys = getBoundaries;
+const getRels = function() {
+ return rels;
+};
+const getTitle = function() {
+ return title;
+};
+const setWrap = function(wrapSetting) {
+ wrapEnabled = wrapSetting;
+};
+const autoWrap = function() {
+ return wrapEnabled;
+};
+const clear = function() {
+ c4ShapeArray = [];
+ boundaries = [
+ {
+ alias: "global",
+ label: { text: "global" },
+ type: { text: "global" },
+ tags: null,
+ link: null,
+ parentBoundary: ""
+ }
+ ];
+ parentBoundaryParse = "";
+ currentBoundaryParse = "global";
+ boundaryParseStack = [""];
+ rels = [];
+ boundaryParseStack = [""];
+ title = "";
+ wrapEnabled = false;
+ c4ShapeInRow$1 = 4;
+ c4BoundaryInRow$1 = 2;
+};
+const LINETYPE = {
+ SOLID: 0,
+ DOTTED: 1,
+ NOTE: 2,
+ SOLID_CROSS: 3,
+ DOTTED_CROSS: 4,
+ SOLID_OPEN: 5,
+ DOTTED_OPEN: 6,
+ LOOP_START: 10,
+ LOOP_END: 11,
+ ALT_START: 12,
+ ALT_ELSE: 13,
+ ALT_END: 14,
+ OPT_START: 15,
+ OPT_END: 16,
+ ACTIVE_START: 17,
+ ACTIVE_END: 18,
+ PAR_START: 19,
+ PAR_AND: 20,
+ PAR_END: 21,
+ RECT_START: 22,
+ RECT_END: 23,
+ SOLID_POINT: 24,
+ DOTTED_POINT: 25
+};
+const ARROWTYPE = {
+ FILLED: 0,
+ OPEN: 1
+};
+const PLACEMENT = {
+ LEFTOF: 0,
+ RIGHTOF: 1,
+ OVER: 2
+};
+const setTitle = function(txt) {
+ let sanitizedText = sanitizeText(txt, getConfig());
+ title = sanitizedText;
+};
+const db = {
+ addPersonOrSystem,
+ addPersonOrSystemBoundary,
+ addContainer,
+ addContainerBoundary,
+ addComponent,
+ addDeploymentNode,
+ popBoundaryParseStack,
+ addRel,
+ updateElStyle,
+ updateRelStyle,
+ updateLayoutConfig,
+ autoWrap,
+ setWrap,
+ getC4ShapeArray,
+ getC4Shape,
+ getC4ShapeKeys,
+ getBoundaries,
+ getBoundarys,
+ getCurrentBoundaryParse,
+ getParentBoundaryParse,
+ getRels,
+ getTitle,
+ getC4Type,
+ getC4ShapeInRow,
+ getC4BoundaryInRow,
+ setAccTitle,
+ getAccTitle,
+ getAccDescription,
+ setAccDescription,
+ getConfig: () => getConfig().c4,
+ clear,
+ LINETYPE,
+ ARROWTYPE,
+ PLACEMENT,
+ setTitle,
+ setC4Type
+ // apply,
+};
+const drawRect = function(elem, rectData) {
+ return drawRect$1(elem, rectData);
+};
+const drawImage = function(elem, width, height, x, y, link) {
+ const imageElem = elem.append("image");
+ imageElem.attr("width", width);
+ imageElem.attr("height", height);
+ imageElem.attr("x", x);
+ imageElem.attr("y", y);
+ let sanitizedLink = link.startsWith("data:image/png;base64") ? link : dist.sanitizeUrl(link);
+ imageElem.attr("xlink:href", sanitizedLink);
+};
+const drawRels$1 = (elem, rels2, conf2) => {
+ const relsElem = elem.append("g");
+ let i = 0;
+ for (let rel of rels2) {
+ let textColor = rel.textColor ? rel.textColor : "#444444";
+ let strokeColor = rel.lineColor ? rel.lineColor : "#444444";
+ let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;
+ let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;
+ let url = "";
+ if (i === 0) {
+ let line = relsElem.append("line");
+ line.attr("x1", rel.startPoint.x);
+ line.attr("y1", rel.startPoint.y);
+ line.attr("x2", rel.endPoint.x);
+ line.attr("y2", rel.endPoint.y);
+ line.attr("stroke-width", "1");
+ line.attr("stroke", strokeColor);
+ line.style("fill", "none");
+ if (rel.type !== "rel_b") {
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
+ }
+ if (rel.type === "birel" || rel.type === "rel_b") {
+ line.attr("marker-start", "url(" + url + "#arrowend)");
+ }
+ i = -1;
+ } else {
+ let line = relsElem.append("path");
+ line.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll(
+ "controlx",
+ rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4
+ ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y)
+ );
+ if (rel.type !== "rel_b") {
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
+ }
+ if (rel.type === "birel" || rel.type === "rel_b") {
+ line.attr("marker-start", "url(" + url + "#arrowend)");
+ }
+ }
+ let messageConf = conf2.messageFont();
+ _drawTextCandidateFunc(conf2)(
+ rel.label.text,
+ relsElem,
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY,
+ rel.label.width,
+ rel.label.height,
+ { fill: textColor },
+ messageConf
+ );
+ if (rel.techn && rel.techn.text !== "") {
+ messageConf = conf2.messageFont();
+ _drawTextCandidateFunc(conf2)(
+ "[" + rel.techn.text + "]",
+ relsElem,
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY,
+ Math.max(rel.label.width, rel.techn.width),
+ rel.techn.height,
+ { fill: textColor, "font-style": "italic" },
+ messageConf
+ );
+ }
+ }
+};
+const drawBoundary$1 = function(elem, boundary, conf2) {
+ const boundaryElem = elem.append("g");
+ let fillColor = boundary.bgColor ? boundary.bgColor : "none";
+ let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444";
+ let fontColor = boundary.fontColor ? boundary.fontColor : "black";
+ let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
+ if (boundary.nodeType) {
+ attrsValue = { "stroke-width": 1 };
+ }
+ let rectData = {
+ x: boundary.x,
+ y: boundary.y,
+ fill: fillColor,
+ stroke: strokeColor,
+ width: boundary.width,
+ height: boundary.height,
+ rx: 2.5,
+ ry: 2.5,
+ attrs: attrsValue
+ };
+ drawRect(boundaryElem, rectData);
+ let boundaryConf = conf2.boundaryFont();
+ boundaryConf.fontWeight = "bold";
+ boundaryConf.fontSize = boundaryConf.fontSize + 2;
+ boundaryConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ boundary.label.text,
+ boundaryElem,
+ boundary.x,
+ boundary.y + boundary.label.Y,
+ boundary.width,
+ boundary.height,
+ { fill: "#444444" },
+ boundaryConf
+ );
+ if (boundary.type && boundary.type.text !== "") {
+ boundaryConf = conf2.boundaryFont();
+ boundaryConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ boundary.type.text,
+ boundaryElem,
+ boundary.x,
+ boundary.y + boundary.type.Y,
+ boundary.width,
+ boundary.height,
+ { fill: "#444444" },
+ boundaryConf
+ );
+ }
+ if (boundary.descr && boundary.descr.text !== "") {
+ boundaryConf = conf2.boundaryFont();
+ boundaryConf.fontSize = boundaryConf.fontSize - 2;
+ boundaryConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ boundary.descr.text,
+ boundaryElem,
+ boundary.x,
+ boundary.y + boundary.descr.Y,
+ boundary.width,
+ boundary.height,
+ { fill: "#444444" },
+ boundaryConf
+ );
+ }
+};
+const drawC4Shape = function(elem, c4Shape, conf2) {
+ var _a;
+ let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"];
+ let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"];
+ let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF";
+ let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
+ switch (c4Shape.typeC4Shape.text) {
+ case "person":
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
+ break;
+ case "external_person":
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
+ break;
+ }
+ const c4ShapeElem = elem.append("g");
+ c4ShapeElem.attr("class", "person-man");
+ const rect = getNoteRect();
+ switch (c4Shape.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ case "system":
+ case "external_system":
+ case "container":
+ case "external_container":
+ case "component":
+ case "external_component":
+ rect.x = c4Shape.x;
+ rect.y = c4Shape.y;
+ rect.fill = fillColor;
+ rect.width = c4Shape.width;
+ rect.height = c4Shape.height;
+ rect.stroke = strokeColor;
+ rect.rx = 2.5;
+ rect.ry = 2.5;
+ rect.attrs = { "stroke-width": 0.5 };
+ drawRect(c4ShapeElem, rect);
+ break;
+ case "system_db":
+ case "external_system_db":
+ case "container_db":
+ case "external_container_db":
+ case "component_db":
+ case "external_component_db":
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height)
+ );
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2)
+ );
+ break;
+ case "system_queue":
+ case "external_system_queue":
+ case "container_queue":
+ case "external_container_queue":
+ case "component_queue":
+ case "external_component_queue":
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2)
+ );
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
+ "d",
+ "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2)
+ );
+ break;
+ }
+ let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text);
+ c4ShapeElem.append("text").attr("fill", fontColor).attr("font-family", c4ShapeFontConf.fontFamily).attr("font-size", c4ShapeFontConf.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", c4Shape.typeC4Shape.width).attr("x", c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr("y", c4Shape.y + c4Shape.typeC4Shape.Y).text("<<" + c4Shape.typeC4Shape.text + ">>");
+ switch (c4Shape.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ drawImage(
+ c4ShapeElem,
+ 48,
+ 48,
+ c4Shape.x + c4Shape.width / 2 - 24,
+ c4Shape.y + c4Shape.image.Y,
+ personImg
+ );
+ break;
+ }
+ let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
+ textFontConf.fontWeight = "bold";
+ textFontConf.fontSize = textFontConf.fontSize + 2;
+ textFontConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ c4Shape.label.text,
+ c4ShapeElem,
+ c4Shape.x,
+ c4Shape.y + c4Shape.label.Y,
+ c4Shape.width,
+ c4Shape.height,
+ { fill: fontColor },
+ textFontConf
+ );
+ textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
+ textFontConf.fontColor = fontColor;
+ if (c4Shape.techn && ((_a = c4Shape.techn) == null ? void 0 : _a.text) !== "") {
+ _drawTextCandidateFunc(conf2)(
+ c4Shape.techn.text,
+ c4ShapeElem,
+ c4Shape.x,
+ c4Shape.y + c4Shape.techn.Y,
+ c4Shape.width,
+ c4Shape.height,
+ { fill: fontColor, "font-style": "italic" },
+ textFontConf
+ );
+ } else if (c4Shape.type && c4Shape.type.text !== "") {
+ _drawTextCandidateFunc(conf2)(
+ c4Shape.type.text,
+ c4ShapeElem,
+ c4Shape.x,
+ c4Shape.y + c4Shape.type.Y,
+ c4Shape.width,
+ c4Shape.height,
+ { fill: fontColor, "font-style": "italic" },
+ textFontConf
+ );
+ }
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
+ textFontConf = conf2.personFont();
+ textFontConf.fontColor = fontColor;
+ _drawTextCandidateFunc(conf2)(
+ c4Shape.descr.text,
+ c4ShapeElem,
+ c4Shape.x,
+ c4Shape.y + c4Shape.descr.Y,
+ c4Shape.width,
+ c4Shape.height,
+ { fill: fontColor },
+ textFontConf
+ );
+ }
+ return c4Shape.height;
+};
+const insertDatabaseIcon = function(elem) {
+ elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
+ );
+};
+const insertComputerIcon = function(elem) {
+ elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
+ );
+};
+const insertClockIcon = function(elem) {
+ elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
+ "d",
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
+ );
+};
+const insertArrowHead = function(elem) {
+ elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
+};
+const insertArrowEnd = function(elem) {
+ elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");
+};
+const insertArrowFilledHead = function(elem) {
+ elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
+};
+const insertDynamicNumber = function(elem) {
+ elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
+};
+const insertArrowCrossHead = function(elem) {
+ const defs = elem.append("defs");
+ const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
+ marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z");
+ marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");
+};
+const getC4ShapeFont = (cnf, typeC4Shape) => {
+ return {
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
+ fontSize: cnf[typeC4Shape + "FontSize"],
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
+ };
+};
+const _drawTextCandidateFunc = function() {
+ function byText(content, g, x, y, width, height, textAttrs) {
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
+ _setTextAttrs(text, textAttrs);
+ }
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
+ const { fontSize, fontFamily, fontWeight } = conf2;
+ const lines = content.split(common.lineBreakRegex);
+ for (let i = 0; i < lines.length; i++) {
+ const dy = i * fontSize - fontSize * (lines.length - 1) / 2;
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily);
+ text.append("tspan").attr("dy", dy).text(lines[i]).attr("alignment-baseline", "mathematical");
+ _setTextAttrs(text, textAttrs);
+ }
+ }
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
+ const s = g.append("switch");
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
+ _setTextAttrs(text, textAttrs);
+ }
+ function _setTextAttrs(toText, fromTextAttrsDict) {
+ for (const key in fromTextAttrsDict) {
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
+ toText.attr(key, fromTextAttrsDict[key]);
+ }
+ }
+ }
+ return function(conf2) {
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
+ };
+}();
+const svgDraw = {
+ drawRect,
+ drawBoundary: drawBoundary$1,
+ drawC4Shape,
+ drawRels: drawRels$1,
+ drawImage,
+ insertArrowHead,
+ insertArrowEnd,
+ insertArrowFilledHead,
+ insertDynamicNumber,
+ insertArrowCrossHead,
+ insertDatabaseIcon,
+ insertComputerIcon,
+ insertClockIcon
+};
+let globalBoundaryMaxX = 0, globalBoundaryMaxY = 0;
+let c4ShapeInRow = 4;
+let c4BoundaryInRow = 2;
+parser.yy = db;
+let conf = {};
+class Bounds {
+ constructor(diagObj) {
+ this.name = "";
+ this.data = {};
+ this.data.startx = void 0;
+ this.data.stopx = void 0;
+ this.data.starty = void 0;
+ this.data.stopy = void 0;
+ this.data.widthLimit = void 0;
+ this.nextData = {};
+ this.nextData.startx = void 0;
+ this.nextData.stopx = void 0;
+ this.nextData.starty = void 0;
+ this.nextData.stopy = void 0;
+ this.nextData.cnt = 0;
+ setConf(diagObj.db.getConfig());
+ }
+ setData(startx, stopx, starty, stopy) {
+ this.nextData.startx = this.data.startx = startx;
+ this.nextData.stopx = this.data.stopx = stopx;
+ this.nextData.starty = this.data.starty = starty;
+ this.nextData.stopy = this.data.stopy = stopy;
+ }
+ updateVal(obj, key, val, fun) {
+ if (obj[key] === void 0) {
+ obj[key] = val;
+ } else {
+ obj[key] = fun(val, obj[key]);
+ }
+ }
+ insert(c4Shape) {
+ this.nextData.cnt = this.nextData.cnt + 1;
+ let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2;
+ let _stopx = _startx + c4Shape.width;
+ let _starty = this.nextData.starty + c4Shape.margin * 2;
+ let _stopy = _starty + c4Shape.height;
+ if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow) {
+ _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;
+ _starty = this.nextData.stopy + c4Shape.margin * 2;
+ this.nextData.stopx = _stopx = _startx + c4Shape.width;
+ this.nextData.starty = this.nextData.stopy;
+ this.nextData.stopy = _stopy = _starty + c4Shape.height;
+ this.nextData.cnt = 1;
+ }
+ c4Shape.x = _startx;
+ c4Shape.y = _starty;
+ this.updateVal(this.data, "startx", _startx, Math.min);
+ this.updateVal(this.data, "starty", _starty, Math.min);
+ this.updateVal(this.data, "stopx", _stopx, Math.max);
+ this.updateVal(this.data, "stopy", _stopy, Math.max);
+ this.updateVal(this.nextData, "startx", _startx, Math.min);
+ this.updateVal(this.nextData, "starty", _starty, Math.min);
+ this.updateVal(this.nextData, "stopx", _stopx, Math.max);
+ this.updateVal(this.nextData, "stopy", _stopy, Math.max);
+ }
+ init(diagObj) {
+ this.name = "";
+ this.data = {
+ startx: void 0,
+ stopx: void 0,
+ starty: void 0,
+ stopy: void 0,
+ widthLimit: void 0
+ };
+ this.nextData = {
+ startx: void 0,
+ stopx: void 0,
+ starty: void 0,
+ stopy: void 0,
+ cnt: 0
+ };
+ setConf(diagObj.db.getConfig());
+ }
+ bumpLastMargin(margin) {
+ this.data.stopx += margin;
+ this.data.stopy += margin;
+ }
+}
+const setConf = function(cnf) {
+ assignWithDepth(conf, cnf);
+ if (cnf.fontFamily) {
+ conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;
+ }
+ if (cnf.fontSize) {
+ conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;
+ }
+ if (cnf.fontWeight) {
+ conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;
+ }
+};
+const c4ShapeFont = (cnf, typeC4Shape) => {
+ return {
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
+ fontSize: cnf[typeC4Shape + "FontSize"],
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
+ };
+};
+const boundaryFont = (cnf) => {
+ return {
+ fontFamily: cnf.boundaryFontFamily,
+ fontSize: cnf.boundaryFontSize,
+ fontWeight: cnf.boundaryFontWeight
+ };
+};
+const messageFont = (cnf) => {
+ return {
+ fontFamily: cnf.messageFontFamily,
+ fontSize: cnf.messageFontSize,
+ fontWeight: cnf.messageFontWeight
+ };
+};
+function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {
+ if (!c4Shape[textType].width) {
+ if (c4ShapeTextWrap) {
+ c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);
+ c4Shape[textType].textLines = c4Shape[textType].text.split(common.lineBreakRegex).length;
+ c4Shape[textType].width = textLimitWidth;
+ c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);
+ } else {
+ let lines = c4Shape[textType].text.split(common.lineBreakRegex);
+ c4Shape[textType].textLines = lines.length;
+ let lineHeight = 0;
+ c4Shape[textType].height = 0;
+ c4Shape[textType].width = 0;
+ for (const line of lines) {
+ c4Shape[textType].width = Math.max(
+ calculateTextWidth(line, textConf),
+ c4Shape[textType].width
+ );
+ lineHeight = calculateTextHeight(line, textConf);
+ c4Shape[textType].height = c4Shape[textType].height + lineHeight;
+ }
+ }
+ }
+}
+const drawBoundary = function(diagram2, boundary, bounds) {
+ boundary.x = bounds.data.startx;
+ boundary.y = bounds.data.starty;
+ boundary.width = bounds.data.stopx - bounds.data.startx;
+ boundary.height = bounds.data.stopy - bounds.data.starty;
+ boundary.label.y = conf.c4ShapeMargin - 35;
+ let boundaryTextWrap = boundary.wrap && conf.wrap;
+ let boundaryLabelConf = boundaryFont(conf);
+ boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;
+ boundaryLabelConf.fontWeight = "bold";
+ let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
+ calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
+ svgDraw.drawBoundary(diagram2, boundary, conf);
+};
+const drawC4ShapeArray = function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) {
+ let Y = 0;
+ for (const c4ShapeKey of c4ShapeKeys) {
+ Y = 0;
+ const c4Shape = c4ShapeArray2[c4ShapeKey];
+ let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
+ c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;
+ c4Shape.typeC4Shape.width = calculateTextWidth(
+ "«" + c4Shape.typeC4Shape.text + "»",
+ c4ShapeTypeConf
+ );
+ c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;
+ c4Shape.typeC4Shape.Y = conf.c4ShapePadding;
+ Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;
+ c4Shape.image = { width: 0, height: 0, Y: 0 };
+ switch (c4Shape.typeC4Shape.text) {
+ case "person":
+ case "external_person":
+ c4Shape.image.width = 48;
+ c4Shape.image.height = 48;
+ c4Shape.image.Y = Y;
+ Y = c4Shape.image.Y + c4Shape.image.height;
+ break;
+ }
+ if (c4Shape.sprite) {
+ c4Shape.image.width = 48;
+ c4Shape.image.height = 48;
+ c4Shape.image.Y = Y;
+ Y = c4Shape.image.Y + c4Shape.image.height;
+ }
+ let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;
+ let textLimitWidth = conf.width - conf.c4ShapePadding * 2;
+ let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
+ c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
+ c4ShapeLabelConf.fontWeight = "bold";
+ calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
+ c4Shape["label"].Y = Y + 8;
+ Y = c4Shape["label"].Y + c4Shape["label"].height;
+ if (c4Shape.type && c4Shape.type.text !== "") {
+ c4Shape.type.text = "[" + c4Shape.type.text + "]";
+ let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
+ calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth);
+ c4Shape["type"].Y = Y + 5;
+ Y = c4Shape["type"].Y + c4Shape["type"].height;
+ } else if (c4Shape.techn && c4Shape.techn.text !== "") {
+ c4Shape.techn.text = "[" + c4Shape.techn.text + "]";
+ let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
+ calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
+ c4Shape["techn"].Y = Y + 5;
+ Y = c4Shape["techn"].Y + c4Shape["techn"].height;
+ }
+ let rectHeight = Y;
+ let rectWidth = c4Shape.label.width;
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
+ let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
+ calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
+ c4Shape["descr"].Y = Y + 20;
+ Y = c4Shape["descr"].Y + c4Shape["descr"].height;
+ rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
+ rectHeight = Y - c4Shape["descr"].textLines * 5;
+ }
+ rectWidth = rectWidth + conf.c4ShapePadding;
+ c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);
+ c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
+ c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
+ currentBounds.insert(c4Shape);
+ svgDraw.drawC4Shape(diagram2, c4Shape, conf);
+ }
+ currentBounds.bumpLastMargin(conf.c4ShapeMargin);
+};
+class Point {
+ constructor(x, y) {
+ this.x = x;
+ this.y = y;
+ }
+}
+let getIntersectPoint = function(fromNode, endPoint) {
+ let x1 = fromNode.x;
+ let y1 = fromNode.y;
+ let x2 = endPoint.x;
+ let y2 = endPoint.y;
+ let fromCenterX = x1 + fromNode.width / 2;
+ let fromCenterY = y1 + fromNode.height / 2;
+ let dx = Math.abs(x1 - x2);
+ let dy = Math.abs(y1 - y2);
+ let tanDYX = dy / dx;
+ let fromDYX = fromNode.height / fromNode.width;
+ let returnPoint = null;
+ if (y1 == y2 && x1 < x2) {
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY);
+ } else if (y1 == y2 && x1 > x2) {
+ returnPoint = new Point(x1, fromCenterY);
+ } else if (x1 == x2 && y1 < y2) {
+ returnPoint = new Point(fromCenterX, y1 + fromNode.height);
+ } else if (x1 == x2 && y1 > y2) {
+ returnPoint = new Point(fromCenterX, y1);
+ }
+ if (x1 > x2 && y1 < y2) {
+ if (fromDYX >= tanDYX) {
+ returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2);
+ } else {
+ returnPoint = new Point(
+ fromCenterX - dx / dy * fromNode.height / 2,
+ y1 + fromNode.height
+ );
+ }
+ } else if (x1 < x2 && y1 < y2) {
+ if (fromDYX >= tanDYX) {
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2);
+ } else {
+ returnPoint = new Point(
+ fromCenterX + dx / dy * fromNode.height / 2,
+ y1 + fromNode.height
+ );
+ }
+ } else if (x1 < x2 && y1 > y2) {
+ if (fromDYX >= tanDYX) {
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2);
+ } else {
+ returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1);
+ }
+ } else if (x1 > x2 && y1 > y2) {
+ if (fromDYX >= tanDYX) {
+ returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX);
+ } else {
+ returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1);
+ }
+ }
+ return returnPoint;
+};
+let getIntersectPoints = function(fromNode, endNode) {
+ let endIntersectPoint = { x: 0, y: 0 };
+ endIntersectPoint.x = endNode.x + endNode.width / 2;
+ endIntersectPoint.y = endNode.y + endNode.height / 2;
+ let startPoint = getIntersectPoint(fromNode, endIntersectPoint);
+ endIntersectPoint.x = fromNode.x + fromNode.width / 2;
+ endIntersectPoint.y = fromNode.y + fromNode.height / 2;
+ let endPoint = getIntersectPoint(endNode, endIntersectPoint);
+ return { startPoint, endPoint };
+};
+const drawRels = function(diagram2, rels2, getC4ShapeObj, diagObj) {
+ let i = 0;
+ for (let rel of rels2) {
+ i = i + 1;
+ let relTextWrap = rel.wrap && conf.wrap;
+ let relConf = messageFont(conf);
+ let diagramType = diagObj.db.getC4Type();
+ if (diagramType === "C4Dynamic") {
+ rel.label.text = i + ": " + rel.label.text;
+ }
+ let textLimitWidth = calculateTextWidth(rel.label.text, relConf);
+ calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth);
+ if (rel.techn && rel.techn.text !== "") {
+ textLimitWidth = calculateTextWidth(rel.techn.text, relConf);
+ calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth);
+ }
+ if (rel.descr && rel.descr.text !== "") {
+ textLimitWidth = calculateTextWidth(rel.descr.text, relConf);
+ calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth);
+ }
+ let fromNode = getC4ShapeObj(rel.from);
+ let endNode = getC4ShapeObj(rel.to);
+ let points = getIntersectPoints(fromNode, endNode);
+ rel.startPoint = points.startPoint;
+ rel.endPoint = points.endPoint;
+ }
+ svgDraw.drawRels(diagram2, rels2, conf);
+};
+function drawInsideBoundary(diagram2, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
+ let currentBounds = new Bounds(diagObj);
+ currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow, currentBoundaries.length);
+ for (let [i, currentBoundary] of currentBoundaries.entries()) {
+ let Y = 0;
+ currentBoundary.image = { width: 0, height: 0, Y: 0 };
+ if (currentBoundary.sprite) {
+ currentBoundary.image.width = 48;
+ currentBoundary.image.height = 48;
+ currentBoundary.image.Y = Y;
+ Y = currentBoundary.image.Y + currentBoundary.image.height;
+ }
+ let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;
+ let currentBoundaryLabelConf = boundaryFont(conf);
+ currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;
+ currentBoundaryLabelConf.fontWeight = "bold";
+ calcC4ShapeTextWH(
+ "label",
+ currentBoundary,
+ currentBoundaryTextWrap,
+ currentBoundaryLabelConf,
+ currentBounds.data.widthLimit
+ );
+ currentBoundary["label"].Y = Y + 8;
+ Y = currentBoundary["label"].Y + currentBoundary["label"].height;
+ if (currentBoundary.type && currentBoundary.type.text !== "") {
+ currentBoundary.type.text = "[" + currentBoundary.type.text + "]";
+ let currentBoundaryTypeConf = boundaryFont(conf);
+ calcC4ShapeTextWH(
+ "type",
+ currentBoundary,
+ currentBoundaryTextWrap,
+ currentBoundaryTypeConf,
+ currentBounds.data.widthLimit
+ );
+ currentBoundary["type"].Y = Y + 5;
+ Y = currentBoundary["type"].Y + currentBoundary["type"].height;
+ }
+ if (currentBoundary.descr && currentBoundary.descr.text !== "") {
+ let currentBoundaryDescrConf = boundaryFont(conf);
+ currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;
+ calcC4ShapeTextWH(
+ "descr",
+ currentBoundary,
+ currentBoundaryTextWrap,
+ currentBoundaryDescrConf,
+ currentBounds.data.widthLimit
+ );
+ currentBoundary["descr"].Y = Y + 20;
+ Y = currentBoundary["descr"].Y + currentBoundary["descr"].height;
+ }
+ if (i == 0 || i % c4BoundaryInRow === 0) {
+ let _x = parentBounds.data.startx + conf.diagramMarginX;
+ let _y = parentBounds.data.stopy + conf.diagramMarginY + Y;
+ currentBounds.setData(_x, _x, _y, _y);
+ } else {
+ let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx;
+ let _y = currentBounds.data.starty;
+ currentBounds.setData(_x, _x, _y, _y);
+ }
+ currentBounds.name = currentBoundary.alias;
+ let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias);
+ let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias);
+ if (currentPersonOrSystemKeys.length > 0) {
+ drawC4ShapeArray(
+ currentBounds,
+ diagram2,
+ currentPersonOrSystemArray,
+ currentPersonOrSystemKeys
+ );
+ }
+ parentBoundaryAlias = currentBoundary.alias;
+ let nextCurrentBoundaries = diagObj.db.getBoundarys(parentBoundaryAlias);
+ if (nextCurrentBoundaries.length > 0) {
+ drawInsideBoundary(
+ diagram2,
+ parentBoundaryAlias,
+ currentBounds,
+ nextCurrentBoundaries,
+ diagObj
+ );
+ }
+ if (currentBoundary.alias !== "global") {
+ drawBoundary(diagram2, currentBoundary, currentBounds);
+ }
+ parentBounds.data.stopy = Math.max(
+ currentBounds.data.stopy + conf.c4ShapeMargin,
+ parentBounds.data.stopy
+ );
+ parentBounds.data.stopx = Math.max(
+ currentBounds.data.stopx + conf.c4ShapeMargin,
+ parentBounds.data.stopx
+ );
+ globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);
+ globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);
+ }
+}
+const draw = function(_text, id, _version, diagObj) {
+ conf = getConfig().c4;
+ const securityLevel = getConfig().securityLevel;
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = d3select("#i" + id);
+ }
+ const root = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body");
+ let db2 = diagObj.db;
+ diagObj.db.setWrap(conf.wrap);
+ c4ShapeInRow = db2.getC4ShapeInRow();
+ c4BoundaryInRow = db2.getC4BoundaryInRow();
+ log.debug(`C:${JSON.stringify(conf, null, 2)}`);
+ const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : d3select(`[id="${id}"]`);
+ svgDraw.insertComputerIcon(diagram2);
+ svgDraw.insertDatabaseIcon(diagram2);
+ svgDraw.insertClockIcon(diagram2);
+ let screenBounds = new Bounds(diagObj);
+ screenBounds.setData(
+ conf.diagramMarginX,
+ conf.diagramMarginX,
+ conf.diagramMarginY,
+ conf.diagramMarginY
+ );
+ screenBounds.data.widthLimit = screen.availWidth;
+ globalBoundaryMaxX = conf.diagramMarginX;
+ globalBoundaryMaxY = conf.diagramMarginY;
+ const title2 = diagObj.db.getTitle();
+ let currentBoundaries = diagObj.db.getBoundarys("");
+ drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj);
+ svgDraw.insertArrowHead(diagram2);
+ svgDraw.insertArrowEnd(diagram2);
+ svgDraw.insertArrowCrossHead(diagram2);
+ svgDraw.insertArrowFilledHead(diagram2);
+ drawRels(diagram2, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj);
+ screenBounds.data.stopx = globalBoundaryMaxX;
+ screenBounds.data.stopy = globalBoundaryMaxY;
+ const box = screenBounds.data;
+ let boxHeight = box.stopy - box.starty;
+ let height = boxHeight + 2 * conf.diagramMarginY;
+ let boxWidth = box.stopx - box.startx;
+ const width = boxWidth + 2 * conf.diagramMarginX;
+ if (title2) {
+ diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
+ }
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
+ const extraVertForTitle = title2 ? 60 : 0;
+ diagram2.attr(
+ "viewBox",
+ box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
+ );
+ log.debug(`models:`, box);
+};
+const renderer = {
+ drawPersonOrSystemArray: drawC4ShapeArray,
+ drawBoundary,
+ setConf,
+ draw
+};
+const getStyles = (options) => `.person {
+ stroke: ${options.personBorder};
+ fill: ${options.personBkg};
+ }
+`;
+const styles = getStyles;
+const diagram = {
+ parser: parser$1,
+ db,
+ renderer,
+ styles,
+ init: ({ c4, wrap }) => {
+ renderer.setConf(c4);
+ db.setWrap(wrap);
+ }
+};
+export {
+ diagram
+};
diff --git a/assets/lib/mermaid/channel-ebbc4130.js b/assets/lib/mermaid/channel-ebbc4130.js
new file mode 100644
index 00000000..76399404
--- /dev/null
+++ b/assets/lib/mermaid/channel-ebbc4130.js
@@ -0,0 +1,5 @@
+import { aI as o, aJ as r } from "./mermaid-9f2aa176.js";
+const s = (a, n) => o.lang.round(r.parse(a)[n]), e = s;
+export {
+ e as c
+};
diff --git a/assets/lib/mermaid/channel-f9001828.js b/assets/lib/mermaid/channel-f9001828.js
new file mode 100644
index 00000000..3db027fe
--- /dev/null
+++ b/assets/lib/mermaid/channel-f9001828.js
@@ -0,0 +1,8 @@
+import { aI as _, aJ as Color } from "./mermaid-dcacb631.js";
+const channel = (color, channel2) => {
+ return _.lang.round(Color.parse(color)[channel2]);
+};
+const channel$1 = channel;
+export {
+ channel$1 as c
+};
diff --git a/assets/lib/mermaid/classDiagram-72b9c71d.js b/assets/lib/mermaid/classDiagram-72b9c71d.js
new file mode 100644
index 00000000..31888f40
--- /dev/null
+++ b/assets/lib/mermaid/classDiagram-72b9c71d.js
@@ -0,0 +1,356 @@
+import { p as parser, d as db, s as styles } from "./styles-36a1a2e8.js";
+import { F as curveBasis, A as utils, l as log, G as parseGenericTypes, c as getConfig, j as d3select, k as configureSvgSize } from "./mermaid-dcacb631.js";
+import { G as Graph } from "./graph-fe24fab6.js";
+import { l as layout } from "./layout-163b9689.js";
+import { l as line } from "./line-87f517ef.js";
+import "./array-b7dcf730.js";
+import "./path-39bad7e2.js";
+let edgeCount = 0;
+const drawEdge = function(elem, path, relation, conf, diagObj) {
+ const getRelationType = function(type) {
+ switch (type) {
+ case diagObj.db.relationType.AGGREGATION:
+ return "aggregation";
+ case diagObj.db.relationType.EXTENSION:
+ return "extension";
+ case diagObj.db.relationType.COMPOSITION:
+ return "composition";
+ case diagObj.db.relationType.DEPENDENCY:
+ return "dependency";
+ case diagObj.db.relationType.LOLLIPOP:
+ return "lollipop";
+ }
+ };
+ path.points = path.points.filter((p) => !Number.isNaN(p.y));
+ const lineData = path.points;
+ const lineFunction = line().x(function(d) {
+ return d.x;
+ }).y(function(d) {
+ return d.y;
+ }).curve(curveBasis);
+ const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "relation");
+ let url = "";
+ if (conf.arrowMarkerAbsolute) {
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
+ url = url.replace(/\(/g, "\\(");
+ url = url.replace(/\)/g, "\\)");
+ }
+ if (relation.relation.lineType == 1) {
+ svgPath.attr("class", "relation dashed-line");
+ }
+ if (relation.relation.lineType == 10) {
+ svgPath.attr("class", "relation dotted-line");
+ }
+ if (relation.relation.type1 !== "none") {
+ svgPath.attr(
+ "marker-start",
+ "url(" + url + "#" + getRelationType(relation.relation.type1) + "Start)"
+ );
+ }
+ if (relation.relation.type2 !== "none") {
+ svgPath.attr(
+ "marker-end",
+ "url(" + url + "#" + getRelationType(relation.relation.type2) + "End)"
+ );
+ }
+ let x, y;
+ const l = path.points.length;
+ let labelPosition = utils.calcLabelPosition(path.points);
+ x = labelPosition.x;
+ y = labelPosition.y;
+ let p1_card_x, p1_card_y;
+ let p2_card_x, p2_card_y;
+ if (l % 2 !== 0 && l > 1) {
+ let cardinality_1_point = utils.calcCardinalityPosition(
+ relation.relation.type1 !== "none",
+ path.points,
+ path.points[0]
+ );
+ let cardinality_2_point = utils.calcCardinalityPosition(
+ relation.relation.type2 !== "none",
+ path.points,
+ path.points[l - 1]
+ );
+ log.debug("cardinality_1_point " + JSON.stringify(cardinality_1_point));
+ log.debug("cardinality_2_point " + JSON.stringify(cardinality_2_point));
+ p1_card_x = cardinality_1_point.x;
+ p1_card_y = cardinality_1_point.y;
+ p2_card_x = cardinality_2_point.x;
+ p2_card_y = cardinality_2_point.y;
+ }
+ if (relation.title !== void 0) {
+ const g = elem.append("g").attr("class", "classLabel");
+ const label = g.append("text").attr("class", "label").attr("x", x).attr("y", y).attr("fill", "red").attr("text-anchor", "middle").text(relation.title);
+ window.label = label;
+ const bounds = label.node().getBBox();
+ g.insert("rect", ":first-child").attr("class", "box").attr("x", bounds.x - conf.padding / 2).attr("y", bounds.y - conf.padding / 2).attr("width", bounds.width + conf.padding).attr("height", bounds.height + conf.padding);
+ }
+ log.info("Rendering relation " + JSON.stringify(relation));
+ if (relation.relationTitle1 !== void 0 && relation.relationTitle1 !== "none") {
+ const g = elem.append("g").attr("class", "cardinality");
+ g.append("text").attr("class", "type1").attr("x", p1_card_x).attr("y", p1_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle1);
+ }
+ if (relation.relationTitle2 !== void 0 && relation.relationTitle2 !== "none") {
+ const g = elem.append("g").attr("class", "cardinality");
+ g.append("text").attr("class", "type2").attr("x", p2_card_x).attr("y", p2_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle2);
+ }
+ edgeCount++;
+};
+const drawClass = function(elem, classDef, conf, diagObj) {
+ log.debug("Rendering class ", classDef, conf);
+ const id = classDef.id;
+ const classInfo = {
+ id,
+ label: classDef.id,
+ width: 0,
+ height: 0
+ };
+ const g = elem.append("g").attr("id", diagObj.db.lookUpDomId(id)).attr("class", "classGroup");
+ let title;
+ if (classDef.link) {
+ title = g.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
+ } else {
+ title = g.append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
+ }
+ let isFirst = true;
+ classDef.annotations.forEach(function(member) {
+ const titleText2 = title.append("tspan").text("«" + member + "»");
+ if (!isFirst) {
+ titleText2.attr("dy", conf.textHeight);
+ }
+ isFirst = false;
+ });
+ let classTitleString = getClassTitleString(classDef);
+ const classTitle = title.append("tspan").text(classTitleString).attr("class", "title");
+ if (!isFirst) {
+ classTitle.attr("dy", conf.textHeight);
+ }
+ const titleHeight = title.node().getBBox().height;
+ let membersLine;
+ let membersBox;
+ let methodsLine;
+ if (classDef.members.length > 0) {
+ membersLine = g.append("line").attr("x1", 0).attr("y1", conf.padding + titleHeight + conf.dividerMargin / 2).attr("y2", conf.padding + titleHeight + conf.dividerMargin / 2);
+ const members = g.append("text").attr("x", conf.padding).attr("y", titleHeight + conf.dividerMargin + conf.textHeight).attr("fill", "white").attr("class", "classText");
+ isFirst = true;
+ classDef.members.forEach(function(member) {
+ addTspan(members, member, isFirst, conf);
+ isFirst = false;
+ });
+ membersBox = members.node().getBBox();
+ }
+ if (classDef.methods.length > 0) {
+ methodsLine = g.append("line").attr("x1", 0).attr("y1", conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr("y2", conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
+ const methods = g.append("text").attr("x", conf.padding).attr("y", titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr("fill", "white").attr("class", "classText");
+ isFirst = true;
+ classDef.methods.forEach(function(method) {
+ addTspan(methods, method, isFirst, conf);
+ isFirst = false;
+ });
+ }
+ const classBox = g.node().getBBox();
+ var cssClassStr = " ";
+ if (classDef.cssClasses.length > 0) {
+ cssClassStr = cssClassStr + classDef.cssClasses.join(" ");
+ }
+ const rect = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", classBox.width + 2 * conf.padding).attr("height", classBox.height + conf.padding + 0.5 * conf.dividerMargin).attr("class", cssClassStr);
+ const rectWidth = rect.node().getBBox().width;
+ title.node().childNodes.forEach(function(x) {
+ x.setAttribute("x", (rectWidth - x.getBBox().width) / 2);
+ });
+ if (classDef.tooltip) {
+ title.insert("title").text(classDef.tooltip);
+ }
+ if (membersLine) {
+ membersLine.attr("x2", rectWidth);
+ }
+ if (methodsLine) {
+ methodsLine.attr("x2", rectWidth);
+ }
+ classInfo.width = rectWidth;
+ classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
+ return classInfo;
+};
+const getClassTitleString = function(classDef) {
+ let classTitleString = classDef.id;
+ if (classDef.type) {
+ classTitleString += "<" + parseGenericTypes(classDef.type) + ">";
+ }
+ return classTitleString;
+};
+const drawNote = function(elem, note, conf, diagObj) {
+ log.debug("Rendering note ", note, conf);
+ const id = note.id;
+ const noteInfo = {
+ id,
+ text: note.text,
+ width: 0,
+ height: 0
+ };
+ const g = elem.append("g").attr("id", id).attr("class", "classGroup");
+ let text = g.append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
+ const lines = JSON.parse(`"${note.text}"`).split("\n");
+ lines.forEach(function(line2) {
+ log.debug(`Adding line: ${line2}`);
+ text.append("tspan").text(line2).attr("class", "title").attr("dy", conf.textHeight);
+ });
+ const noteBox = g.node().getBBox();
+ const rect = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", noteBox.width + 2 * conf.padding).attr(
+ "height",
+ noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin
+ );
+ const rectWidth = rect.node().getBBox().width;
+ text.node().childNodes.forEach(function(x) {
+ x.setAttribute("x", (rectWidth - x.getBBox().width) / 2);
+ });
+ noteInfo.width = rectWidth;
+ noteInfo.height = noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin;
+ return noteInfo;
+};
+const addTspan = function(textEl, member, isFirst, conf) {
+ const { displayText, cssStyle } = member.getDisplayDetails();
+ const tSpan = textEl.append("tspan").attr("x", conf.padding).text(displayText);
+ if (cssStyle !== "") {
+ tSpan.attr("style", member.cssStyle);
+ }
+ if (!isFirst) {
+ tSpan.attr("dy", conf.textHeight);
+ }
+};
+const svgDraw = {
+ getClassTitleString,
+ drawClass,
+ drawEdge,
+ drawNote
+};
+let idCache = {};
+const padding = 20;
+const getGraphId = function(label) {
+ const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);
+ if (foundEntry) {
+ return foundEntry[0];
+ }
+};
+const insertMarkers = function(elem) {
+ elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
+ elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
+ elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
+};
+const draw = function(text, id, _version, diagObj) {
+ const conf = getConfig().class;
+ idCache = {};
+ log.info("Rendering diagram " + text);
+ const securityLevel = getConfig().securityLevel;
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = d3select("#i" + id);
+ }
+ const root = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body");
+ const diagram2 = root.select(`[id='${id}']`);
+ insertMarkers(diagram2);
+ const g = new Graph({
+ multigraph: true
+ });
+ g.setGraph({
+ isMultiGraph: true
+ });
+ g.setDefaultEdgeLabel(function() {
+ return {};
+ });
+ const classes = diagObj.db.getClasses();
+ const keys = Object.keys(classes);
+ for (const key of keys) {
+ const classDef = classes[key];
+ const node = svgDraw.drawClass(diagram2, classDef, conf, diagObj);
+ idCache[node.id] = node;
+ g.setNode(node.id, node);
+ log.info("Org height: " + node.height);
+ }
+ const relations = diagObj.db.getRelations();
+ relations.forEach(function(relation) {
+ log.info(
+ // cspell:ignore tjoho
+ "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)
+ );
+ g.setEdge(
+ getGraphId(relation.id1),
+ getGraphId(relation.id2),
+ {
+ relation
+ },
+ relation.title || "DEFAULT"
+ );
+ });
+ const notes = diagObj.db.getNotes();
+ notes.forEach(function(note) {
+ log.debug(`Adding note: ${JSON.stringify(note)}`);
+ const node = svgDraw.drawNote(diagram2, note, conf, diagObj);
+ idCache[node.id] = node;
+ g.setNode(node.id, node);
+ if (note.class && note.class in classes) {
+ g.setEdge(
+ note.id,
+ getGraphId(note.class),
+ {
+ relation: {
+ id1: note.id,
+ id2: note.class,
+ relation: {
+ type1: "none",
+ type2: "none",
+ lineType: 10
+ }
+ }
+ },
+ "DEFAULT"
+ );
+ }
+ });
+ layout(g);
+ g.nodes().forEach(function(v) {
+ if (v !== void 0 && g.node(v) !== void 0) {
+ log.debug("Node " + v + ": " + JSON.stringify(g.node(v)));
+ root.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr(
+ "transform",
+ "translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )"
+ );
+ }
+ });
+ g.edges().forEach(function(e) {
+ if (e !== void 0 && g.edge(e) !== void 0) {
+ log.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e)));
+ svgDraw.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf, diagObj);
+ }
+ });
+ const svgBounds = diagram2.node().getBBox();
+ const width = svgBounds.width + padding * 2;
+ const height = svgBounds.height + padding * 2;
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
+ const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;
+ log.debug(`viewBox ${vBox}`);
+ diagram2.attr("viewBox", vBox);
+};
+const renderer = {
+ draw
+};
+const diagram = {
+ parser,
+ db,
+ renderer,
+ styles,
+ init: (cnf) => {
+ if (!cnf.class) {
+ cnf.class = {};
+ }
+ cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
+ db.clear();
+ }
+};
+export {
+ diagram
+};
diff --git a/assets/lib/mermaid/classDiagram-f52caa06.js b/assets/lib/mermaid/classDiagram-f52caa06.js
new file mode 100644
index 00000000..1ac385eb
--- /dev/null
+++ b/assets/lib/mermaid/classDiagram-f52caa06.js
@@ -0,0 +1,220 @@
+import { p as A, d as S, s as G } from "./styles-11e81fdd.js";
+import { F as W, A as B, l as u, G as I, c as H, j as M, k as O } from "./mermaid-9f2aa176.js";
+import { G as P } from "./graph-0ee63739.js";
+import { l as X } from "./layout-fd473db2.js";
+import { l as Y } from "./line-24d93f1b.js";
+import "./array-2ff2c7a6.js";
+import "./path-428ebac9.js";
+let _ = 0;
+const $ = function(i, a, t, o, p) {
+ const g = function(e) {
+ switch (e) {
+ case p.db.relationType.AGGREGATION:
+ return "aggregation";
+ case p.db.relationType.EXTENSION:
+ return "extension";
+ case p.db.relationType.COMPOSITION:
+ return "composition";
+ case p.db.relationType.DEPENDENCY:
+ return "dependency";
+ case p.db.relationType.LOLLIPOP:
+ return "lollipop";
+ }
+ };
+ a.points = a.points.filter((e) => !Number.isNaN(e.y));
+ const s = a.points, c = Y().x(function(e) {
+ return e.x;
+ }).y(function(e) {
+ return e.y;
+ }).curve(W), n = i.append("path").attr("d", c(s)).attr("id", "edge" + _).attr("class", "relation");
+ let r = "";
+ o.arrowMarkerAbsolute && (r = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, r = r.replace(/\(/g, "\\("), r = r.replace(/\)/g, "\\)")), t.relation.lineType == 1 && n.attr("class", "relation dashed-line"), t.relation.lineType == 10 && n.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && n.attr(
+ "marker-start",
+ "url(" + r + "#" + g(t.relation.type1) + "Start)"
+ ), t.relation.type2 !== "none" && n.attr(
+ "marker-end",
+ "url(" + r + "#" + g(t.relation.type2) + "End)"
+ );
+ let f, h;
+ const x = a.points.length;
+ let k = B.calcLabelPosition(a.points);
+ f = k.x, h = k.y;
+ let y, m, w, b;
+ if (x % 2 !== 0 && x > 1) {
+ let e = B.calcCardinalityPosition(
+ t.relation.type1 !== "none",
+ a.points,
+ a.points[0]
+ ), d = B.calcCardinalityPosition(
+ t.relation.type2 !== "none",
+ a.points,
+ a.points[x - 1]
+ );
+ u.debug("cardinality_1_point " + JSON.stringify(e)), u.debug("cardinality_2_point " + JSON.stringify(d)), y = e.x, m = e.y, w = d.x, b = d.y;
+ }
+ if (t.title !== void 0) {
+ const e = i.append("g").attr("class", "classLabel"), d = e.append("text").attr("class", "label").attr("x", f).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
+ window.label = d;
+ const l = d.node().getBBox();
+ e.insert("rect", ":first-child").attr("class", "box").attr("x", l.x - o.padding / 2).attr("y", l.y - o.padding / 2).attr("width", l.width + o.padding).attr("height", l.height + o.padding);
+ }
+ u.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", y).attr("y", m).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", w).attr("y", b).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), _++;
+}, J = function(i, a, t, o) {
+ u.debug("Rendering class ", a, t);
+ const p = a.id, g = {
+ id: p,
+ label: a.id,
+ width: 0,
+ height: 0
+ }, s = i.append("g").attr("id", o.db.lookUpDomId(p)).attr("class", "classGroup");
+ let c;
+ a.link ? c = s.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
+ let n = !0;
+ a.annotations.forEach(function(d) {
+ const l = c.append("tspan").text("«" + d + "»");
+ n || l.attr("dy", t.textHeight), n = !1;
+ });
+ let r = C(a);
+ const f = c.append("tspan").text(r).attr("class", "title");
+ n || f.attr("dy", t.textHeight);
+ const h = c.node().getBBox().height;
+ let x, k, y;
+ if (a.members.length > 0) {
+ x = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin / 2).attr("y2", t.padding + h + t.dividerMargin / 2);
+ const d = s.append("text").attr("x", t.padding).attr("y", h + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
+ n = !0, a.members.forEach(function(l) {
+ v(d, l, n, t), n = !1;
+ }), k = d.node().getBBox();
+ }
+ if (a.methods.length > 0) {
+ y = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin + k.height).attr("y2", t.padding + h + t.dividerMargin + k.height);
+ const d = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + k.height + t.textHeight).attr("fill", "white").attr("class", "classText");
+ n = !0, a.methods.forEach(function(l) {
+ v(d, l, n, t), n = !1;
+ });
+ }
+ const m = s.node().getBBox();
+ var w = " ";
+ a.cssClasses.length > 0 && (w = w + a.cssClasses.join(" "));
+ const e = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", m.width + 2 * t.padding).attr("height", m.height + t.padding + 0.5 * t.dividerMargin).attr("class", w).node().getBBox().width;
+ return c.node().childNodes.forEach(function(d) {
+ d.setAttribute("x", (e - d.getBBox().width) / 2);
+ }), a.tooltip && c.insert("title").text(a.tooltip), x && x.attr("x2", e), y && y.attr("x2", e), g.width = e, g.height = m.height + t.padding + 0.5 * t.dividerMargin, g;
+}, C = function(i) {
+ let a = i.id;
+ return i.type && (a += "<" + I(i.type) + ">"), a;
+}, Z = function(i, a, t, o) {
+ u.debug("Rendering note ", a, t);
+ const p = a.id, g = {
+ id: p,
+ text: a.text,
+ width: 0,
+ height: 0
+ }, s = i.append("g").attr("id", p).attr("class", "classGroup");
+ let c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
+ const n = JSON.parse(`"${a.text}"`).split(`
+`);
+ n.forEach(function(x) {
+ u.debug(`Adding line: ${x}`), c.append("tspan").text(x).attr("class", "title").attr("dy", t.textHeight);
+ });
+ const r = s.node().getBBox(), h = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr(
+ "height",
+ r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin
+ ).node().getBBox().width;
+ return c.node().childNodes.forEach(function(x) {
+ x.setAttribute("x", (h - x.getBBox().width) / 2);
+ }), g.width = h, g.height = r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, g;
+}, v = function(i, a, t, o) {
+ const { displayText: p, cssStyle: g } = a.getDisplayDetails(), s = i.append("tspan").attr("x", o.padding).text(p);
+ g !== "" && s.attr("style", a.cssStyle), t || s.attr("dy", o.textHeight);
+}, N = {
+ getClassTitleString: C,
+ drawClass: J,
+ drawEdge: $,
+ drawNote: Z
+};
+let T = {};
+const E = 20, L = function(i) {
+ const a = Object.entries(T).find((t) => t[1].label === i);
+ if (a)
+ return a[0];
+}, R = function(i) {
+ i.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), i.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), i.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
+}, F = function(i, a, t, o) {
+ const p = H().class;
+ T = {}, u.info("Rendering diagram " + i);
+ const g = H().securityLevel;
+ let s;
+ g === "sandbox" && (s = M("#i" + a));
+ const c = g === "sandbox" ? M(s.nodes()[0].contentDocument.body) : M("body"), n = c.select(`[id='${a}']`);
+ R(n);
+ const r = new P({
+ multigraph: !0
+ });
+ r.setGraph({
+ isMultiGraph: !0
+ }), r.setDefaultEdgeLabel(function() {
+ return {};
+ });
+ const f = o.db.getClasses(), h = Object.keys(f);
+ for (const e of h) {
+ const d = f[e], l = N.drawClass(n, d, p, o);
+ T[l.id] = l, r.setNode(l.id, l), u.info("Org height: " + l.height);
+ }
+ o.db.getRelations().forEach(function(e) {
+ u.info(
+ // cspell:ignore tjoho
+ "tjoho" + L(e.id1) + L(e.id2) + JSON.stringify(e)
+ ), r.setEdge(
+ L(e.id1),
+ L(e.id2),
+ {
+ relation: e
+ },
+ e.title || "DEFAULT"
+ );
+ }), o.db.getNotes().forEach(function(e) {
+ u.debug(`Adding note: ${JSON.stringify(e)}`);
+ const d = N.drawNote(n, e, p, o);
+ T[d.id] = d, r.setNode(d.id, d), e.class && e.class in f && r.setEdge(
+ e.id,
+ L(e.class),
+ {
+ relation: {
+ id1: e.id,
+ id2: e.class,
+ relation: {
+ type1: "none",
+ type2: "none",
+ lineType: 10
+ }
+ }
+ },
+ "DEFAULT"
+ );
+ }), X(r), r.nodes().forEach(function(e) {
+ e !== void 0 && r.node(e) !== void 0 && (u.debug("Node " + e + ": " + JSON.stringify(r.node(e))), c.select("#" + (o.db.lookUpDomId(e) || e)).attr(
+ "transform",
+ "translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"
+ ));
+ }), r.edges().forEach(function(e) {
+ e !== void 0 && r.edge(e) !== void 0 && (u.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), N.drawEdge(n, r.edge(e), r.edge(e).relation, p, o));
+ });
+ const y = n.node().getBBox(), m = y.width + E * 2, w = y.height + E * 2;
+ O(n, w, m, p.useMaxWidth);
+ const b = `${y.x - E} ${y.y - E} ${m} ${w}`;
+ u.debug(`viewBox ${b}`), n.attr("viewBox", b);
+}, U = {
+ draw: F
+}, tt = {
+ parser: A,
+ db: S,
+ renderer: U,
+ styles: G,
+ init: (i) => {
+ i.class || (i.class = {}), i.class.arrowMarkerAbsolute = i.arrowMarkerAbsolute, S.clear();
+ }
+};
+export {
+ tt as diagram
+};
diff --git a/assets/lib/mermaid/classDiagram-fb54d2a0.js b/assets/lib/mermaid/classDiagram-fb54d2a0.js
new file mode 100644
index 00000000..df43ffe9
--- /dev/null
+++ b/assets/lib/mermaid/classDiagram-fb54d2a0.js
@@ -0,0 +1,363 @@
+import { p as parser, d as db, s as styles } from "./styles-b83b31c9.js";
+import { line, curveBasis, select } from "d3";
+import { layout } from "dagre-d3-es/src/dagre/index.js";
+import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
+import { u as utils, l as log, x as parseGenericTypes, c as getConfig, i as configureSvgSize } from "./mermaid-6dc72991.js";
+import "ts-dedent";
+import "dayjs";
+import "@braintree/sanitize-url";
+import "dompurify";
+import "khroma";
+import "lodash-es/memoize.js";
+import "lodash-es/merge.js";
+import "stylis";
+import "lodash-es/isEmpty.js";
+let edgeCount = 0;
+const drawEdge = function(elem, path, relation, conf, diagObj) {
+ const getRelationType = function(type) {
+ switch (type) {
+ case diagObj.db.relationType.AGGREGATION:
+ return "aggregation";
+ case diagObj.db.relationType.EXTENSION:
+ return "extension";
+ case diagObj.db.relationType.COMPOSITION:
+ return "composition";
+ case diagObj.db.relationType.DEPENDENCY:
+ return "dependency";
+ case diagObj.db.relationType.LOLLIPOP:
+ return "lollipop";
+ }
+ };
+ path.points = path.points.filter((p) => !Number.isNaN(p.y));
+ const lineData = path.points;
+ const lineFunction = line().x(function(d) {
+ return d.x;
+ }).y(function(d) {
+ return d.y;
+ }).curve(curveBasis);
+ const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "relation");
+ let url = "";
+ if (conf.arrowMarkerAbsolute) {
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
+ url = url.replace(/\(/g, "\\(");
+ url = url.replace(/\)/g, "\\)");
+ }
+ if (relation.relation.lineType == 1) {
+ svgPath.attr("class", "relation dashed-line");
+ }
+ if (relation.relation.lineType == 10) {
+ svgPath.attr("class", "relation dotted-line");
+ }
+ if (relation.relation.type1 !== "none") {
+ svgPath.attr(
+ "marker-start",
+ "url(" + url + "#" + getRelationType(relation.relation.type1) + "Start)"
+ );
+ }
+ if (relation.relation.type2 !== "none") {
+ svgPath.attr(
+ "marker-end",
+ "url(" + url + "#" + getRelationType(relation.relation.type2) + "End)"
+ );
+ }
+ let x, y;
+ const l = path.points.length;
+ let labelPosition = utils.calcLabelPosition(path.points);
+ x = labelPosition.x;
+ y = labelPosition.y;
+ let p1_card_x, p1_card_y;
+ let p2_card_x, p2_card_y;
+ if (l % 2 !== 0 && l > 1) {
+ let cardinality_1_point = utils.calcCardinalityPosition(
+ relation.relation.type1 !== "none",
+ path.points,
+ path.points[0]
+ );
+ let cardinality_2_point = utils.calcCardinalityPosition(
+ relation.relation.type2 !== "none",
+ path.points,
+ path.points[l - 1]
+ );
+ log.debug("cardinality_1_point " + JSON.stringify(cardinality_1_point));
+ log.debug("cardinality_2_point " + JSON.stringify(cardinality_2_point));
+ p1_card_x = cardinality_1_point.x;
+ p1_card_y = cardinality_1_point.y;
+ p2_card_x = cardinality_2_point.x;
+ p2_card_y = cardinality_2_point.y;
+ }
+ if (relation.title !== void 0) {
+ const g = elem.append("g").attr("class", "classLabel");
+ const label = g.append("text").attr("class", "label").attr("x", x).attr("y", y).attr("fill", "red").attr("text-anchor", "middle").text(relation.title);
+ window.label = label;
+ const bounds = label.node().getBBox();
+ g.insert("rect", ":first-child").attr("class", "box").attr("x", bounds.x - conf.padding / 2).attr("y", bounds.y - conf.padding / 2).attr("width", bounds.width + conf.padding).attr("height", bounds.height + conf.padding);
+ }
+ log.info("Rendering relation " + JSON.stringify(relation));
+ if (relation.relationTitle1 !== void 0 && relation.relationTitle1 !== "none") {
+ const g = elem.append("g").attr("class", "cardinality");
+ g.append("text").attr("class", "type1").attr("x", p1_card_x).attr("y", p1_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle1);
+ }
+ if (relation.relationTitle2 !== void 0 && relation.relationTitle2 !== "none") {
+ const g = elem.append("g").attr("class", "cardinality");
+ g.append("text").attr("class", "type2").attr("x", p2_card_x).attr("y", p2_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle2);
+ }
+ edgeCount++;
+};
+const drawClass = function(elem, classDef, conf, diagObj) {
+ log.debug("Rendering class ", classDef, conf);
+ const id = classDef.id;
+ const classInfo = {
+ id,
+ label: classDef.id,
+ width: 0,
+ height: 0
+ };
+ const g = elem.append("g").attr("id", diagObj.db.lookUpDomId(id)).attr("class", "classGroup");
+ let title;
+ if (classDef.link) {
+ title = g.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
+ } else {
+ title = g.append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
+ }
+ let isFirst = true;
+ classDef.annotations.forEach(function(member) {
+ const titleText2 = title.append("tspan").text("«" + member + "»");
+ if (!isFirst) {
+ titleText2.attr("dy", conf.textHeight);
+ }
+ isFirst = false;
+ });
+ let classTitleString = getClassTitleString(classDef);
+ const classTitle = title.append("tspan").text(classTitleString).attr("class", "title");
+ if (!isFirst) {
+ classTitle.attr("dy", conf.textHeight);
+ }
+ const titleHeight = title.node().getBBox().height;
+ let membersLine;
+ let membersBox;
+ let methodsLine;
+ if (classDef.members.length > 0) {
+ membersLine = g.append("line").attr("x1", 0).attr("y1", conf.padding + titleHeight + conf.dividerMargin / 2).attr("y2", conf.padding + titleHeight + conf.dividerMargin / 2);
+ const members = g.append("text").attr("x", conf.padding).attr("y", titleHeight + conf.dividerMargin + conf.textHeight).attr("fill", "white").attr("class", "classText");
+ isFirst = true;
+ classDef.members.forEach(function(member) {
+ addTspan(members, member, isFirst, conf);
+ isFirst = false;
+ });
+ membersBox = members.node().getBBox();
+ }
+ if (classDef.methods.length > 0) {
+ methodsLine = g.append("line").attr("x1", 0).attr("y1", conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr("y2", conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
+ const methods = g.append("text").attr("x", conf.padding).attr("y", titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr("fill", "white").attr("class", "classText");
+ isFirst = true;
+ classDef.methods.forEach(function(method) {
+ addTspan(methods, method, isFirst, conf);
+ isFirst = false;
+ });
+ }
+ const classBox = g.node().getBBox();
+ var cssClassStr = " ";
+ if (classDef.cssClasses.length > 0) {
+ cssClassStr = cssClassStr + classDef.cssClasses.join(" ");
+ }
+ const rect = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", classBox.width + 2 * conf.padding).attr("height", classBox.height + conf.padding + 0.5 * conf.dividerMargin).attr("class", cssClassStr);
+ const rectWidth = rect.node().getBBox().width;
+ title.node().childNodes.forEach(function(x) {
+ x.setAttribute("x", (rectWidth - x.getBBox().width) / 2);
+ });
+ if (classDef.tooltip) {
+ title.insert("title").text(classDef.tooltip);
+ }
+ if (membersLine) {
+ membersLine.attr("x2", rectWidth);
+ }
+ if (methodsLine) {
+ methodsLine.attr("x2", rectWidth);
+ }
+ classInfo.width = rectWidth;
+ classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
+ return classInfo;
+};
+const getClassTitleString = function(classDef) {
+ let classTitleString = classDef.id;
+ if (classDef.type) {
+ classTitleString += "<" + parseGenericTypes(classDef.type) + ">";
+ }
+ return classTitleString;
+};
+const drawNote = function(elem, note, conf, diagObj) {
+ log.debug("Rendering note ", note, conf);
+ const id = note.id;
+ const noteInfo = {
+ id,
+ text: note.text,
+ width: 0,
+ height: 0
+ };
+ const g = elem.append("g").attr("id", id).attr("class", "classGroup");
+ let text = g.append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
+ const lines = JSON.parse(`"${note.text}"`).split("\n");
+ lines.forEach(function(line2) {
+ log.debug(`Adding line: ${line2}`);
+ text.append("tspan").text(line2).attr("class", "title").attr("dy", conf.textHeight);
+ });
+ const noteBox = g.node().getBBox();
+ const rect = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", noteBox.width + 2 * conf.padding).attr(
+ "height",
+ noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin
+ );
+ const rectWidth = rect.node().getBBox().width;
+ text.node().childNodes.forEach(function(x) {
+ x.setAttribute("x", (rectWidth - x.getBBox().width) / 2);
+ });
+ noteInfo.width = rectWidth;
+ noteInfo.height = noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin;
+ return noteInfo;
+};
+const addTspan = function(textEl, member, isFirst, conf) {
+ const { displayText, cssStyle } = member.getDisplayDetails();
+ const tSpan = textEl.append("tspan").attr("x", conf.padding).text(displayText);
+ if (cssStyle !== "") {
+ tSpan.attr("style", member.cssStyle);
+ }
+ if (!isFirst) {
+ tSpan.attr("dy", conf.textHeight);
+ }
+};
+const svgDraw = {
+ getClassTitleString,
+ drawClass,
+ drawEdge,
+ drawNote
+};
+let idCache = {};
+const padding = 20;
+const getGraphId = function(label) {
+ const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);
+ if (foundEntry) {
+ return foundEntry[0];
+ }
+};
+const insertMarkers = function(elem) {
+ elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
+ elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
+ elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
+ elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
+};
+const draw = function(text, id, _version, diagObj) {
+ const conf = getConfig().class;
+ idCache = {};
+ log.info("Rendering diagram " + text);
+ const securityLevel = getConfig().securityLevel;
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = select("#i" + id);
+ }
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
+ const diagram2 = root.select(`[id='${id}']`);
+ insertMarkers(diagram2);
+ const g = new graphlib.Graph({
+ multigraph: true
+ });
+ g.setGraph({
+ isMultiGraph: true
+ });
+ g.setDefaultEdgeLabel(function() {
+ return {};
+ });
+ const classes = diagObj.db.getClasses();
+ const keys = Object.keys(classes);
+ for (const key of keys) {
+ const classDef = classes[key];
+ const node = svgDraw.drawClass(diagram2, classDef, conf, diagObj);
+ idCache[node.id] = node;
+ g.setNode(node.id, node);
+ log.info("Org height: " + node.height);
+ }
+ const relations = diagObj.db.getRelations();
+ relations.forEach(function(relation) {
+ log.info(
+ // cspell:ignore tjoho
+ "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)
+ );
+ g.setEdge(
+ getGraphId(relation.id1),
+ getGraphId(relation.id2),
+ {
+ relation
+ },
+ relation.title || "DEFAULT"
+ );
+ });
+ const notes = diagObj.db.getNotes();
+ notes.forEach(function(note) {
+ log.debug(`Adding note: ${JSON.stringify(note)}`);
+ const node = svgDraw.drawNote(diagram2, note, conf, diagObj);
+ idCache[node.id] = node;
+ g.setNode(node.id, node);
+ if (note.class && note.class in classes) {
+ g.setEdge(
+ note.id,
+ getGraphId(note.class),
+ {
+ relation: {
+ id1: note.id,
+ id2: note.class,
+ relation: {
+ type1: "none",
+ type2: "none",
+ lineType: 10
+ }
+ }
+ },
+ "DEFAULT"
+ );
+ }
+ });
+ layout(g);
+ g.nodes().forEach(function(v) {
+ if (v !== void 0 && g.node(v) !== void 0) {
+ log.debug("Node " + v + ": " + JSON.stringify(g.node(v)));
+ root.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr(
+ "transform",
+ "translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )"
+ );
+ }
+ });
+ g.edges().forEach(function(e) {
+ if (e !== void 0 && g.edge(e) !== void 0) {
+ log.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e)));
+ svgDraw.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf, diagObj);
+ }
+ });
+ const svgBounds = diagram2.node().getBBox();
+ const width = svgBounds.width + padding * 2;
+ const height = svgBounds.height + padding * 2;
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
+ const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;
+ log.debug(`viewBox ${vBox}`);
+ diagram2.attr("viewBox", vBox);
+};
+const renderer = {
+ draw
+};
+const diagram = {
+ parser,
+ db,
+ renderer,
+ styles,
+ init: (cnf) => {
+ if (!cnf.class) {
+ cnf.class = {};
+ }
+ cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
+ db.clear();
+ }
+};
+export {
+ diagram
+};
diff --git a/assets/lib/mermaid/classDiagram-v2-640c694e.js b/assets/lib/mermaid/classDiagram-v2-640c694e.js
new file mode 100644
index 00000000..3cb5c0cc
--- /dev/null
+++ b/assets/lib/mermaid/classDiagram-v2-640c694e.js
@@ -0,0 +1,206 @@
+import { p as R, d as N, s as $ } from "./styles-11e81fdd.js";
+import { l as c, c as r, j as k, A as B, t as G, o as E, q as A, n as C, f as _ } from "./mermaid-9f2aa176.js";
+import { G as q } from "./graph-0ee63739.js";
+import { r as z } from "./index-bb6d8841.js";
+import "./layout-fd473db2.js";
+import "./clone-afc2f047.js";
+import "./edges-16357fde.js";
+import "./createText-03b82060.js";
+import "./line-24d93f1b.js";
+import "./array-2ff2c7a6.js";
+import "./path-428ebac9.js";
+const S = (o) => _.sanitizeText(o, r());
+let v = {
+ dividerMargin: 10,
+ padding: 5,
+ textHeight: 10,
+ curve: void 0
+};
+const P = function(o, e, p, n) {
+ const t = Object.keys(o);
+ c.info("keys:", t), c.info(o), t.forEach(function(s) {
+ var y, d;
+ const l = o[s], i = {
+ shape: "rect",
+ id: l.id,
+ domId: l.domId,
+ labelText: S(l.id),
+ labelStyle: "",
+ style: "fill: none; stroke: black",
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((y = r().flowchart) == null ? void 0 : y.padding) ?? ((d = r().class) == null ? void 0 : d.padding)
+ };
+ e.setNode(l.id, i), I(l.classes, e, p, n, l.id), c.info("setNode", i);
+ });
+}, I = function(o, e, p, n, t) {
+ const s = Object.keys(o);
+ c.info("keys:", s), c.info(o), s.filter((l) => o[l].parent == t).forEach(function(l) {
+ var u, m;
+ const a = o[l], i = a.cssClasses.join(" "), y = E(a.styles), d = a.label ?? a.id, f = 0, h = "class_box", b = {
+ labelStyle: y.labelStyle,
+ shape: h,
+ labelText: S(d),
+ classData: a,
+ rx: f,
+ ry: f,
+ class: i,
+ style: y.style,
+ id: a.id,
+ domId: a.domId,
+ tooltip: n.db.getTooltip(a.id, t) || "",
+ haveCallback: a.haveCallback,
+ link: a.link,
+ width: a.type === "group" ? 500 : void 0,
+ type: a.type,
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((u = r().flowchart) == null ? void 0 : u.padding) ?? ((m = r().class) == null ? void 0 : m.padding)
+ };
+ e.setNode(a.id, b), t && e.setParent(a.id, t), c.info("setNode", b);
+ });
+}, F = function(o, e, p, n) {
+ c.info(o), o.forEach(function(t, s) {
+ var m, g;
+ const l = t, a = "", i = { labelStyle: "", style: "" }, y = l.text, d = 0, f = "note", h = {
+ labelStyle: i.labelStyle,
+ shape: f,
+ labelText: S(y),
+ noteData: l,
+ rx: d,
+ ry: d,
+ class: a,
+ style: i.style,
+ id: l.id,
+ domId: l.id,
+ tooltip: "",
+ type: "note",
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((m = r().flowchart) == null ? void 0 : m.padding) ?? ((g = r().class) == null ? void 0 : g.padding)
+ };
+ if (e.setNode(l.id, h), c.info("setNode", h), !l.class || !(l.class in n))
+ return;
+ const b = p + s, u = {
+ id: `edgeNote${b}`,
+ //Set relationship style and line type
+ classes: "relation",
+ pattern: "dotted",
+ // Set link type for rendering
+ arrowhead: "none",
+ //Set edge extra labels
+ startLabelRight: "",
+ endLabelLeft: "",
+ //Set relation arrow types
+ arrowTypeStart: "none",
+ arrowTypeEnd: "none",
+ style: "fill:none",
+ labelStyle: "",
+ curve: A(v.curve, C)
+ };
+ e.setEdge(l.id, l.class, u, b);
+ });
+}, H = function(o, e) {
+ const p = r().flowchart;
+ let n = 0;
+ o.forEach(function(t) {
+ var l;
+ n++;
+ const s = {
+ //Set relationship style and line type
+ classes: "relation",
+ pattern: t.relation.lineType == 1 ? "dashed" : "solid",
+ id: `id_${t.id1}_${t.id2}_${n}`,
+ // Set link type for rendering
+ arrowhead: t.type === "arrow_open" ? "none" : "normal",
+ //Set edge extra labels
+ startLabelRight: t.relationTitle1 === "none" ? "" : t.relationTitle1,
+ endLabelLeft: t.relationTitle2 === "none" ? "" : t.relationTitle2,
+ //Set relation arrow types
+ arrowTypeStart: D(t.relation.type1),
+ arrowTypeEnd: D(t.relation.type2),
+ style: "fill:none",
+ labelStyle: "",
+ curve: A(p == null ? void 0 : p.curve, C)
+ };
+ if (c.info(s, t), t.style !== void 0) {
+ const a = E(t.style);
+ s.style = a.style, s.labelStyle = a.labelStyle;
+ }
+ t.text = t.title, t.text === void 0 ? t.style !== void 0 && (s.arrowheadStyle = "fill: #333") : (s.arrowheadStyle = "fill: #333", s.labelpos = "c", ((l = r().flowchart) == null ? void 0 : l.htmlLabels) ?? r().htmlLabels ? (s.labelType = "html", s.label = '' + t.text + "") : (s.labelType = "text", s.label = t.text.replace(_.lineBreakRegex, `
+`), t.style === void 0 && (s.style = s.style || "stroke: #333; stroke-width: 1.5px;fill:none"), s.labelStyle = s.labelStyle.replace("color:", "fill:"))), e.setEdge(t.id1, t.id2, s, n);
+ });
+}, V = function(o) {
+ v = {
+ ...v,
+ ...o
+ };
+}, W = async function(o, e, p, n) {
+ c.info("Drawing class - ", e);
+ const t = r().flowchart ?? r().class, s = r().securityLevel;
+ c.info("config:", t);
+ const l = (t == null ? void 0 : t.nodeSpacing) ?? 50, a = (t == null ? void 0 : t.rankSpacing) ?? 50, i = new q({
+ multigraph: !0,
+ compound: !0
+ }).setGraph({
+ rankdir: n.db.getDirection(),
+ nodesep: l,
+ ranksep: a,
+ marginx: 8,
+ marginy: 8
+ }).setDefaultEdgeLabel(function() {
+ return {};
+ }), y = n.db.getNamespaces(), d = n.db.getClasses(), f = n.db.getRelations(), h = n.db.getNotes();
+ c.info(f), P(y, i, e, n), I(d, i, e, n), H(f, i), F(h, i, f.length + 1, d);
+ let b;
+ s === "sandbox" && (b = k("#i" + e));
+ const u = s === "sandbox" ? k(b.nodes()[0].contentDocument.body) : k("body"), m = u.select(`[id="${e}"]`), g = u.select("#" + e + " g");
+ if (await z(
+ g,
+ i,
+ ["aggregation", "extension", "composition", "dependency", "lollipop"],
+ "classDiagram",
+ e
+ ), B.insertTitle(m, "classTitleText", (t == null ? void 0 : t.titleTopMargin) ?? 5, n.db.getDiagramTitle()), G(i, m, t == null ? void 0 : t.diagramPadding, t == null ? void 0 : t.useMaxWidth), !(t != null && t.htmlLabels)) {
+ const T = s === "sandbox" ? b.nodes()[0].contentDocument : document, M = T.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
+ for (const w of M) {
+ const L = w.getBBox(), x = T.createElementNS("http://www.w3.org/2000/svg", "rect");
+ x.setAttribute("rx", 0), x.setAttribute("ry", 0), x.setAttribute("width", L.width), x.setAttribute("height", L.height), w.insertBefore(x, w.firstChild);
+ }
+ }
+};
+function D(o) {
+ let e;
+ switch (o) {
+ case 0:
+ e = "aggregation";
+ break;
+ case 1:
+ e = "extension";
+ break;
+ case 2:
+ e = "composition";
+ break;
+ case 3:
+ e = "dependency";
+ break;
+ case 4:
+ e = "lollipop";
+ break;
+ default:
+ e = "none";
+ }
+ return e;
+}
+const J = {
+ setConf: V,
+ draw: W
+}, ot = {
+ parser: R,
+ db: N,
+ renderer: J,
+ styles: $,
+ init: (o) => {
+ o.class || (o.class = {}), o.class.arrowMarkerAbsolute = o.arrowMarkerAbsolute, N.clear();
+ }
+};
+export {
+ ot as diagram
+};
diff --git a/assets/lib/mermaid/classDiagram-v2-a2b738ad.js b/assets/lib/mermaid/classDiagram-v2-a2b738ad.js
new file mode 100644
index 00000000..10a75847
--- /dev/null
+++ b/assets/lib/mermaid/classDiagram-v2-a2b738ad.js
@@ -0,0 +1,298 @@
+import { p as parser, d as db, s as styles } from "./styles-b83b31c9.js";
+import { select, curveLinear } from "d3";
+import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
+import { l as log, c as getConfig, u as utils, o as setupGraphViewbox, k as getStylesFromArray, n as interpolateToCurve, e as common } from "./mermaid-6dc72991.js";
+import { r as render } from "./index-01f381cb.js";
+import "ts-dedent";
+import "dayjs";
+import "@braintree/sanitize-url";
+import "dompurify";
+import "khroma";
+import "lodash-es/memoize.js";
+import "lodash-es/merge.js";
+import "stylis";
+import "lodash-es/isEmpty.js";
+import "dagre-d3-es/src/dagre/index.js";
+import "dagre-d3-es/src/graphlib/json.js";
+import "./edges-066a5561.js";
+import "./createText-ca0c5216.js";
+import "mdast-util-from-markdown";
+const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
+let conf = {
+ dividerMargin: 10,
+ padding: 5,
+ textHeight: 10,
+ curve: void 0
+};
+const addNamespaces = function(namespaces, g, _id, diagObj) {
+ const keys = Object.keys(namespaces);
+ log.info("keys:", keys);
+ log.info(namespaces);
+ keys.forEach(function(id) {
+ var _a, _b;
+ const vertex = namespaces[id];
+ const shape = "rect";
+ const node = {
+ shape,
+ id: vertex.id,
+ domId: vertex.domId,
+ labelText: sanitizeText(vertex.id),
+ labelStyle: "",
+ style: "fill: none; stroke: black",
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
+ };
+ g.setNode(vertex.id, node);
+ addClasses(vertex.classes, g, _id, diagObj, vertex.id);
+ log.info("setNode", node);
+ });
+};
+const addClasses = function(classes, g, _id, diagObj, parent) {
+ const keys = Object.keys(classes);
+ log.info("keys:", keys);
+ log.info(classes);
+ keys.filter((id) => classes[id].parent == parent).forEach(function(id) {
+ var _a, _b;
+ const vertex = classes[id];
+ const cssClassStr = vertex.cssClasses.join(" ");
+ const styles2 = getStylesFromArray(vertex.styles);
+ const vertexText = vertex.label ?? vertex.id;
+ const radius = 0;
+ const shape = "class_box";
+ const node = {
+ labelStyle: styles2.labelStyle,
+ shape,
+ labelText: sanitizeText(vertexText),
+ classData: vertex,
+ rx: radius,
+ ry: radius,
+ class: cssClassStr,
+ style: styles2.style,
+ id: vertex.id,
+ domId: vertex.domId,
+ tooltip: diagObj.db.getTooltip(vertex.id, parent) || "",
+ haveCallback: vertex.haveCallback,
+ link: vertex.link,
+ width: vertex.type === "group" ? 500 : void 0,
+ type: vertex.type,
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
+ };
+ g.setNode(vertex.id, node);
+ if (parent) {
+ g.setParent(vertex.id, parent);
+ }
+ log.info("setNode", node);
+ });
+};
+const addNotes = function(notes, g, startEdgeId, classes) {
+ log.info(notes);
+ notes.forEach(function(note, i) {
+ var _a, _b;
+ const vertex = note;
+ const cssNoteStr = "";
+ const styles2 = { labelStyle: "", style: "" };
+ const vertexText = vertex.text;
+ const radius = 0;
+ const shape = "note";
+ const node = {
+ labelStyle: styles2.labelStyle,
+ shape,
+ labelText: sanitizeText(vertexText),
+ noteData: vertex,
+ rx: radius,
+ ry: radius,
+ class: cssNoteStr,
+ style: styles2.style,
+ id: vertex.id,
+ domId: vertex.id,
+ tooltip: "",
+ type: "note",
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
+ };
+ g.setNode(vertex.id, node);
+ log.info("setNode", node);
+ if (!vertex.class || !(vertex.class in classes)) {
+ return;
+ }
+ const edgeId = startEdgeId + i;
+ const edgeData = {
+ id: `edgeNote${edgeId}`,
+ //Set relationship style and line type
+ classes: "relation",
+ pattern: "dotted",
+ // Set link type for rendering
+ arrowhead: "none",
+ //Set edge extra labels
+ startLabelRight: "",
+ endLabelLeft: "",
+ //Set relation arrow types
+ arrowTypeStart: "none",
+ arrowTypeEnd: "none",
+ style: "fill:none",
+ labelStyle: "",
+ curve: interpolateToCurve(conf.curve, curveLinear)
+ };
+ g.setEdge(vertex.id, vertex.class, edgeData, edgeId);
+ });
+};
+const addRelations = function(relations, g) {
+ const conf2 = getConfig().flowchart;
+ let cnt = 0;
+ relations.forEach(function(edge) {
+ var _a;
+ cnt++;
+ const edgeData = {
+ //Set relationship style and line type
+ classes: "relation",
+ pattern: edge.relation.lineType == 1 ? "dashed" : "solid",
+ id: `id_${edge.id1}_${edge.id2}_${cnt}`,
+ // Set link type for rendering
+ arrowhead: edge.type === "arrow_open" ? "none" : "normal",
+ //Set edge extra labels
+ startLabelRight: edge.relationTitle1 === "none" ? "" : edge.relationTitle1,
+ endLabelLeft: edge.relationTitle2 === "none" ? "" : edge.relationTitle2,
+ //Set relation arrow types
+ arrowTypeStart: getArrowMarker(edge.relation.type1),
+ arrowTypeEnd: getArrowMarker(edge.relation.type2),
+ style: "fill:none",
+ labelStyle: "",
+ curve: interpolateToCurve(conf2 == null ? void 0 : conf2.curve, curveLinear)
+ };
+ log.info(edgeData, edge);
+ if (edge.style !== void 0) {
+ const styles2 = getStylesFromArray(edge.style);
+ edgeData.style = styles2.style;
+ edgeData.labelStyle = styles2.labelStyle;
+ }
+ edge.text = edge.title;
+ if (edge.text === void 0) {
+ if (edge.style !== void 0) {
+ edgeData.arrowheadStyle = "fill: #333";
+ }
+ } else {
+ edgeData.arrowheadStyle = "fill: #333";
+ edgeData.labelpos = "c";
+ if (((_a = getConfig().flowchart) == null ? void 0 : _a.htmlLabels) ?? getConfig().htmlLabels) {
+ edgeData.labelType = "html";
+ edgeData.label = '' + edge.text + "";
+ } else {
+ edgeData.labelType = "text";
+ edgeData.label = edge.text.replace(common.lineBreakRegex, "\n");
+ if (edge.style === void 0) {
+ edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none";
+ }
+ edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:");
+ }
+ }
+ g.setEdge(edge.id1, edge.id2, edgeData, cnt);
+ });
+};
+const setConf = function(cnf) {
+ conf = {
+ ...conf,
+ ...cnf
+ };
+};
+const draw = async function(text, id, _version, diagObj) {
+ log.info("Drawing class - ", id);
+ const conf2 = getConfig().flowchart ?? getConfig().class;
+ const securityLevel = getConfig().securityLevel;
+ log.info("config:", conf2);
+ const nodeSpacing = (conf2 == null ? void 0 : conf2.nodeSpacing) ?? 50;
+ const rankSpacing = (conf2 == null ? void 0 : conf2.rankSpacing) ?? 50;
+ const g = new graphlib.Graph({
+ multigraph: true,
+ compound: true
+ }).setGraph({
+ rankdir: diagObj.db.getDirection(),
+ nodesep: nodeSpacing,
+ ranksep: rankSpacing,
+ marginx: 8,
+ marginy: 8
+ }).setDefaultEdgeLabel(function() {
+ return {};
+ });
+ const namespaces = diagObj.db.getNamespaces();
+ const classes = diagObj.db.getClasses();
+ const relations = diagObj.db.getRelations();
+ const notes = diagObj.db.getNotes();
+ log.info(relations);
+ addNamespaces(namespaces, g, id, diagObj);
+ addClasses(classes, g, id, diagObj);
+ addRelations(relations, g);
+ addNotes(notes, g, relations.length + 1, classes);
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = select("#i" + id);
+ }
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
+ const svg = root.select(`[id="${id}"]`);
+ const element = root.select("#" + id + " g");
+ await render(
+ element,
+ g,
+ ["aggregation", "extension", "composition", "dependency", "lollipop"],
+ "classDiagram",
+ id
+ );
+ utils.insertTitle(svg, "classTitleText", (conf2 == null ? void 0 : conf2.titleTopMargin) ?? 5, diagObj.db.getDiagramTitle());
+ setupGraphViewbox(g, svg, conf2 == null ? void 0 : conf2.diagramPadding, conf2 == null ? void 0 : conf2.useMaxWidth);
+ if (!(conf2 == null ? void 0 : conf2.htmlLabels)) {
+ const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
+ const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label');
+ for (const label of labels) {
+ const dim = label.getBBox();
+ const rect = doc.createElementNS("http://www.w3.org/2000/svg", "rect");
+ rect.setAttribute("rx", 0);
+ rect.setAttribute("ry", 0);
+ rect.setAttribute("width", dim.width);
+ rect.setAttribute("height", dim.height);
+ label.insertBefore(rect, label.firstChild);
+ }
+ }
+};
+function getArrowMarker(type) {
+ let marker;
+ switch (type) {
+ case 0:
+ marker = "aggregation";
+ break;
+ case 1:
+ marker = "extension";
+ break;
+ case 2:
+ marker = "composition";
+ break;
+ case 3:
+ marker = "dependency";
+ break;
+ case 4:
+ marker = "lollipop";
+ break;
+ default:
+ marker = "none";
+ }
+ return marker;
+}
+const renderer = {
+ setConf,
+ draw
+};
+const diagram = {
+ parser,
+ db,
+ renderer,
+ styles,
+ init: (cnf) => {
+ if (!cnf.class) {
+ cnf.class = {};
+ }
+ cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
+ db.clear();
+ }
+};
+export {
+ diagram
+};
diff --git a/assets/lib/mermaid/classDiagram-v2-fedb80f6.js b/assets/lib/mermaid/classDiagram-v2-fedb80f6.js
new file mode 100644
index 00000000..d5005fa8
--- /dev/null
+++ b/assets/lib/mermaid/classDiagram-v2-fedb80f6.js
@@ -0,0 +1,290 @@
+import { p as parser, d as db, s as styles } from "./styles-36a1a2e8.js";
+import { l as log, c as getConfig, j as d3select, A as utils, t as setupGraphViewbox, o as getStylesFromArray, q as interpolateToCurve, n as curveLinear, f as common } from "./mermaid-dcacb631.js";
+import { G as Graph } from "./graph-fe24fab6.js";
+import { r as render } from "./index-fc479858.js";
+import "./layout-163b9689.js";
+import "./clone-9ea6bfeb.js";
+import "./edges-ce5cfb7c.js";
+import "./createText-b70fe78a.js";
+import "./line-87f517ef.js";
+import "./array-b7dcf730.js";
+import "./path-39bad7e2.js";
+const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
+let conf = {
+ dividerMargin: 10,
+ padding: 5,
+ textHeight: 10,
+ curve: void 0
+};
+const addNamespaces = function(namespaces, g, _id, diagObj) {
+ const keys = Object.keys(namespaces);
+ log.info("keys:", keys);
+ log.info(namespaces);
+ keys.forEach(function(id) {
+ var _a, _b;
+ const vertex = namespaces[id];
+ const shape = "rect";
+ const node = {
+ shape,
+ id: vertex.id,
+ domId: vertex.domId,
+ labelText: sanitizeText(vertex.id),
+ labelStyle: "",
+ style: "fill: none; stroke: black",
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
+ };
+ g.setNode(vertex.id, node);
+ addClasses(vertex.classes, g, _id, diagObj, vertex.id);
+ log.info("setNode", node);
+ });
+};
+const addClasses = function(classes, g, _id, diagObj, parent) {
+ const keys = Object.keys(classes);
+ log.info("keys:", keys);
+ log.info(classes);
+ keys.filter((id) => classes[id].parent == parent).forEach(function(id) {
+ var _a, _b;
+ const vertex = classes[id];
+ const cssClassStr = vertex.cssClasses.join(" ");
+ const styles2 = getStylesFromArray(vertex.styles);
+ const vertexText = vertex.label ?? vertex.id;
+ const radius = 0;
+ const shape = "class_box";
+ const node = {
+ labelStyle: styles2.labelStyle,
+ shape,
+ labelText: sanitizeText(vertexText),
+ classData: vertex,
+ rx: radius,
+ ry: radius,
+ class: cssClassStr,
+ style: styles2.style,
+ id: vertex.id,
+ domId: vertex.domId,
+ tooltip: diagObj.db.getTooltip(vertex.id, parent) || "",
+ haveCallback: vertex.haveCallback,
+ link: vertex.link,
+ width: vertex.type === "group" ? 500 : void 0,
+ type: vertex.type,
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
+ };
+ g.setNode(vertex.id, node);
+ if (parent) {
+ g.setParent(vertex.id, parent);
+ }
+ log.info("setNode", node);
+ });
+};
+const addNotes = function(notes, g, startEdgeId, classes) {
+ log.info(notes);
+ notes.forEach(function(note, i) {
+ var _a, _b;
+ const vertex = note;
+ const cssNoteStr = "";
+ const styles2 = { labelStyle: "", style: "" };
+ const vertexText = vertex.text;
+ const radius = 0;
+ const shape = "note";
+ const node = {
+ labelStyle: styles2.labelStyle,
+ shape,
+ labelText: sanitizeText(vertexText),
+ noteData: vertex,
+ rx: radius,
+ ry: radius,
+ class: cssNoteStr,
+ style: styles2.style,
+ id: vertex.id,
+ domId: vertex.id,
+ tooltip: "",
+ type: "note",
+ // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
+ padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
+ };
+ g.setNode(vertex.id, node);
+ log.info("setNode", node);
+ if (!vertex.class || !(vertex.class in classes)) {
+ return;
+ }
+ const edgeId = startEdgeId + i;
+ const edgeData = {
+ id: `edgeNote${edgeId}`,
+ //Set relationship style and line type
+ classes: "relation",
+ pattern: "dotted",
+ // Set link type for rendering
+ arrowhead: "none",
+ //Set edge extra labels
+ startLabelRight: "",
+ endLabelLeft: "",
+ //Set relation arrow types
+ arrowTypeStart: "none",
+ arrowTypeEnd: "none",
+ style: "fill:none",
+ labelStyle: "",
+ curve: interpolateToCurve(conf.curve, curveLinear)
+ };
+ g.setEdge(vertex.id, vertex.class, edgeData, edgeId);
+ });
+};
+const addRelations = function(relations, g) {
+ const conf2 = getConfig().flowchart;
+ let cnt = 0;
+ relations.forEach(function(edge) {
+ var _a;
+ cnt++;
+ const edgeData = {
+ //Set relationship style and line type
+ classes: "relation",
+ pattern: edge.relation.lineType == 1 ? "dashed" : "solid",
+ id: `id_${edge.id1}_${edge.id2}_${cnt}`,
+ // Set link type for rendering
+ arrowhead: edge.type === "arrow_open" ? "none" : "normal",
+ //Set edge extra labels
+ startLabelRight: edge.relationTitle1 === "none" ? "" : edge.relationTitle1,
+ endLabelLeft: edge.relationTitle2 === "none" ? "" : edge.relationTitle2,
+ //Set relation arrow types
+ arrowTypeStart: getArrowMarker(edge.relation.type1),
+ arrowTypeEnd: getArrowMarker(edge.relation.type2),
+ style: "fill:none",
+ labelStyle: "",
+ curve: interpolateToCurve(conf2 == null ? void 0 : conf2.curve, curveLinear)
+ };
+ log.info(edgeData, edge);
+ if (edge.style !== void 0) {
+ const styles2 = getStylesFromArray(edge.style);
+ edgeData.style = styles2.style;
+ edgeData.labelStyle = styles2.labelStyle;
+ }
+ edge.text = edge.title;
+ if (edge.text === void 0) {
+ if (edge.style !== void 0) {
+ edgeData.arrowheadStyle = "fill: #333";
+ }
+ } else {
+ edgeData.arrowheadStyle = "fill: #333";
+ edgeData.labelpos = "c";
+ if (((_a = getConfig().flowchart) == null ? void 0 : _a.htmlLabels) ?? getConfig().htmlLabels) {
+ edgeData.labelType = "html";
+ edgeData.label = '' + edge.text + "";
+ } else {
+ edgeData.labelType = "text";
+ edgeData.label = edge.text.replace(common.lineBreakRegex, "\n");
+ if (edge.style === void 0) {
+ edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none";
+ }
+ edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:");
+ }
+ }
+ g.setEdge(edge.id1, edge.id2, edgeData, cnt);
+ });
+};
+const setConf = function(cnf) {
+ conf = {
+ ...conf,
+ ...cnf
+ };
+};
+const draw = async function(text, id, _version, diagObj) {
+ log.info("Drawing class - ", id);
+ const conf2 = getConfig().flowchart ?? getConfig().class;
+ const securityLevel = getConfig().securityLevel;
+ log.info("config:", conf2);
+ const nodeSpacing = (conf2 == null ? void 0 : conf2.nodeSpacing) ?? 50;
+ const rankSpacing = (conf2 == null ? void 0 : conf2.rankSpacing) ?? 50;
+ const g = new Graph({
+ multigraph: true,
+ compound: true
+ }).setGraph({
+ rankdir: diagObj.db.getDirection(),
+ nodesep: nodeSpacing,
+ ranksep: rankSpacing,
+ marginx: 8,
+ marginy: 8
+ }).setDefaultEdgeLabel(function() {
+ return {};
+ });
+ const namespaces = diagObj.db.getNamespaces();
+ const classes = diagObj.db.getClasses();
+ const relations = diagObj.db.getRelations();
+ const notes = diagObj.db.getNotes();
+ log.info(relations);
+ addNamespaces(namespaces, g, id, diagObj);
+ addClasses(classes, g, id, diagObj);
+ addRelations(relations, g);
+ addNotes(notes, g, relations.length + 1, classes);
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = d3select("#i" + id);
+ }
+ const root = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body");
+ const svg = root.select(`[id="${id}"]`);
+ const element = root.select("#" + id + " g");
+ await render(
+ element,
+ g,
+ ["aggregation", "extension", "composition", "dependency", "lollipop"],
+ "classDiagram",
+ id
+ );
+ utils.insertTitle(svg, "classTitleText", (conf2 == null ? void 0 : conf2.titleTopMargin) ?? 5, diagObj.db.getDiagramTitle());
+ setupGraphViewbox(g, svg, conf2 == null ? void 0 : conf2.diagramPadding, conf2 == null ? void 0 : conf2.useMaxWidth);
+ if (!(conf2 == null ? void 0 : conf2.htmlLabels)) {
+ const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
+ const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label');
+ for (const label of labels) {
+ const dim = label.getBBox();
+ const rect = doc.createElementNS("http://www.w3.org/2000/svg", "rect");
+ rect.setAttribute("rx", 0);
+ rect.setAttribute("ry", 0);
+ rect.setAttribute("width", dim.width);
+ rect.setAttribute("height", dim.height);
+ label.insertBefore(rect, label.firstChild);
+ }
+ }
+};
+function getArrowMarker(type) {
+ let marker;
+ switch (type) {
+ case 0:
+ marker = "aggregation";
+ break;
+ case 1:
+ marker = "extension";
+ break;
+ case 2:
+ marker = "composition";
+ break;
+ case 3:
+ marker = "dependency";
+ break;
+ case 4:
+ marker = "lollipop";
+ break;
+ default:
+ marker = "none";
+ }
+ return marker;
+}
+const renderer = {
+ setConf,
+ draw
+};
+const diagram = {
+ parser,
+ db,
+ renderer,
+ styles,
+ init: (cnf) => {
+ if (!cnf.class) {
+ cnf.class = {};
+ }
+ cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
+ db.clear();
+ }
+};
+export {
+ diagram
+};
diff --git a/assets/lib/mermaid/clone-9ea6bfeb.js b/assets/lib/mermaid/clone-9ea6bfeb.js
new file mode 100644
index 00000000..34954ff3
--- /dev/null
+++ b/assets/lib/mermaid/clone-9ea6bfeb.js
@@ -0,0 +1,8 @@
+import { c as baseClone } from "./graph-fe24fab6.js";
+var CLONE_SYMBOLS_FLAG = 4;
+function clone(value) {
+ return baseClone(value, CLONE_SYMBOLS_FLAG);
+}
+export {
+ clone as c
+};
diff --git a/assets/lib/mermaid/clone-afc2f047.js b/assets/lib/mermaid/clone-afc2f047.js
new file mode 100644
index 00000000..316875ce
--- /dev/null
+++ b/assets/lib/mermaid/clone-afc2f047.js
@@ -0,0 +1,8 @@
+import { c as r } from "./graph-0ee63739.js";
+var e = 4;
+function a(o) {
+ return r(o, e);
+}
+export {
+ a as c
+};
diff --git a/assets/lib/mermaid/createText-03b82060.js b/assets/lib/mermaid/createText-03b82060.js
new file mode 100644
index 00000000..a09c5f68
--- /dev/null
+++ b/assets/lib/mermaid/createText-03b82060.js
@@ -0,0 +1,2966 @@
+import { b8 as At, l as zt, b7 as It } from "./mermaid-9f2aa176.js";
+const Tt = {};
+function Bt(n, r) {
+ const t = r || Tt, e = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, u = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
+ return et(n, e, u);
+}
+function et(n, r, t) {
+ if (Lt(n)) {
+ if ("value" in n)
+ return n.type === "html" && !t ? "" : n.value;
+ if (r && "alt" in n && n.alt)
+ return n.alt;
+ if ("children" in n)
+ return Vn(n.children, r, t);
+ }
+ return Array.isArray(n) ? Vn(n, r, t) : "";
+}
+function Vn(n, r, t) {
+ const e = [];
+ let u = -1;
+ for (; ++u < n.length; )
+ e[u] = et(n[u], r, t);
+ return e.join("");
+}
+function Lt(n) {
+ return !!(n && typeof n == "object");
+}
+function tn(n, r, t, e) {
+ const u = n.length;
+ let i = 0, l;
+ if (r < 0 ? r = -r > u ? 0 : u + r : r = r > u ? u : r, t = t > 0 ? t : 0, e.length < 1e4)
+ l = Array.from(e), l.unshift(r, t), n.splice(...l);
+ else
+ for (t && n.splice(r, t); i < e.length; )
+ l = e.slice(i, i + 1e4), l.unshift(r, 0), n.splice(...l), i += 1e4, r += 1e4;
+}
+function Y(n, r) {
+ return n.length > 0 ? (tn(n, n.length, 0, r), n) : r;
+}
+const Wn = {}.hasOwnProperty;
+function Ot(n) {
+ const r = {};
+ let t = -1;
+ for (; ++t < n.length; )
+ Dt(r, n[t]);
+ return r;
+}
+function Dt(n, r) {
+ let t;
+ for (t in r) {
+ const u = (Wn.call(n, t) ? n[t] : void 0) || (n[t] = {}), i = r[t];
+ let l;
+ if (i)
+ for (l in i) {
+ Wn.call(u, l) || (u[l] = []);
+ const a = i[l];
+ Pt(
+ // @ts-expect-error Looks like a list.
+ u[l],
+ Array.isArray(a) ? a : a ? [a] : []
+ );
+ }
+ }
+}
+function Pt(n, r) {
+ let t = -1;
+ const e = [];
+ for (; ++t < r.length; )
+ (r[t].add === "after" ? n : e).push(r[t]);
+ tn(n, 0, 0, e);
+}
+const _t = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/, nn = cn(/[A-Za-z]/), v = cn(/[\dA-Za-z]/), Mt = cn(/[#-'*+\--9=?A-Z^-~]/);
+function An(n) {
+ return (
+ // Special whitespace codes (which have negative values), C0 and Control
+ // character DEL
+ n !== null && (n < 32 || n === 127)
+ );
+}
+const zn = cn(/\d/), jt = cn(/[\dA-Fa-f]/), Rt = cn(/[!-/:-@[-`{-~]/);
+function C(n) {
+ return n !== null && n < -2;
+}
+function Z(n) {
+ return n !== null && (n < 0 || n === 32);
+}
+function z(n) {
+ return n === -2 || n === -1 || n === 32;
+}
+const qt = cn(_t), Ht = cn(/\s/);
+function cn(n) {
+ return r;
+ function r(t) {
+ return t !== null && n.test(String.fromCharCode(t));
+ }
+}
+function O(n, r, t, e) {
+ const u = e ? e - 1 : Number.POSITIVE_INFINITY;
+ let i = 0;
+ return l;
+ function l(m) {
+ return z(m) ? (n.enter(t), a(m)) : r(m);
+ }
+ function a(m) {
+ return z(m) && i++ < u ? (n.consume(m), a) : (n.exit(t), r(m));
+ }
+}
+const Nt = {
+ tokenize: Vt
+};
+function Vt(n) {
+ const r = n.attempt(
+ this.parser.constructs.contentInitial,
+ e,
+ u
+ );
+ let t;
+ return r;
+ function e(a) {
+ if (a === null) {
+ n.consume(a);
+ return;
+ }
+ return n.enter("lineEnding"), n.consume(a), n.exit("lineEnding"), O(n, r, "linePrefix");
+ }
+ function u(a) {
+ return n.enter("paragraph"), i(a);
+ }
+ function i(a) {
+ const m = n.enter("chunkText", {
+ contentType: "text",
+ previous: t
+ });
+ return t && (t.next = m), t = m, l(a);
+ }
+ function l(a) {
+ if (a === null) {
+ n.exit("chunkText"), n.exit("paragraph"), n.consume(a);
+ return;
+ }
+ return C(a) ? (n.consume(a), n.exit("chunkText"), i) : (n.consume(a), l);
+ }
+}
+const Wt = {
+ tokenize: Qt
+}, Qn = {
+ tokenize: Ut
+};
+function Qt(n) {
+ const r = this, t = [];
+ let e = 0, u, i, l;
+ return a;
+ function a(F) {
+ if (e < t.length) {
+ const D = t[e];
+ return r.containerState = D[1], n.attempt(
+ D[0].continuation,
+ m,
+ c
+ )(F);
+ }
+ return c(F);
+ }
+ function m(F) {
+ if (e++, r.containerState._closeFlow) {
+ r.containerState._closeFlow = void 0, u && j();
+ const D = r.events.length;
+ let _ = D, k;
+ for (; _--; )
+ if (r.events[_][0] === "exit" && r.events[_][1].type === "chunkFlow") {
+ k = r.events[_][1].end;
+ break;
+ }
+ b(e);
+ let T = D;
+ for (; T < r.events.length; )
+ r.events[T][1].end = Object.assign({}, k), T++;
+ return tn(
+ r.events,
+ _ + 1,
+ 0,
+ r.events.slice(D)
+ ), r.events.length = T, c(F);
+ }
+ return a(F);
+ }
+ function c(F) {
+ if (e === t.length) {
+ if (!u)
+ return x(F);
+ if (u.currentConstruct && u.currentConstruct.concrete)
+ return A(F);
+ r.interrupt = !!(u.currentConstruct && !u._gfmTableDynamicInterruptHack);
+ }
+ return r.containerState = {}, n.check(
+ Qn,
+ p,
+ f
+ )(F);
+ }
+ function p(F) {
+ return u && j(), b(e), x(F);
+ }
+ function f(F) {
+ return r.parser.lazy[r.now().line] = e !== t.length, l = r.now().offset, A(F);
+ }
+ function x(F) {
+ return r.containerState = {}, n.attempt(
+ Qn,
+ h,
+ A
+ )(F);
+ }
+ function h(F) {
+ return e++, t.push([r.currentConstruct, r.containerState]), x(F);
+ }
+ function A(F) {
+ if (F === null) {
+ u && j(), b(0), n.consume(F);
+ return;
+ }
+ return u = u || r.parser.flow(r.now()), n.enter("chunkFlow", {
+ contentType: "flow",
+ previous: i,
+ _tokenizer: u
+ }), I(F);
+ }
+ function I(F) {
+ if (F === null) {
+ M(n.exit("chunkFlow"), !0), b(0), n.consume(F);
+ return;
+ }
+ return C(F) ? (n.consume(F), M(n.exit("chunkFlow")), e = 0, r.interrupt = void 0, a) : (n.consume(F), I);
+ }
+ function M(F, D) {
+ const _ = r.sliceStream(F);
+ if (D && _.push(null), F.previous = i, i && (i.next = F), i = F, u.defineSkip(F.start), u.write(_), r.parser.lazy[F.start.line]) {
+ let k = u.events.length;
+ for (; k--; )
+ if (
+ // The token starts before the line ending…
+ u.events[k][1].start.offset < l && // …and either is not ended yet…
+ (!u.events[k][1].end || // …or ends after it.
+ u.events[k][1].end.offset > l)
+ )
+ return;
+ const T = r.events.length;
+ let H = T, N, V;
+ for (; H--; )
+ if (r.events[H][0] === "exit" && r.events[H][1].type === "chunkFlow") {
+ if (N) {
+ V = r.events[H][1].end;
+ break;
+ }
+ N = !0;
+ }
+ for (b(e), k = T; k < r.events.length; )
+ r.events[k][1].end = Object.assign({}, V), k++;
+ tn(
+ r.events,
+ H + 1,
+ 0,
+ r.events.slice(T)
+ ), r.events.length = k;
+ }
+ }
+ function b(F) {
+ let D = t.length;
+ for (; D-- > F; ) {
+ const _ = t[D];
+ r.containerState = _[1], _[0].exit.call(r, n);
+ }
+ t.length = F;
+ }
+ function j() {
+ u.write([null]), i = void 0, u = void 0, r.containerState._closeFlow = void 0;
+ }
+}
+function Ut(n, r, t) {
+ return O(
+ n,
+ n.attempt(this.parser.constructs.document, r, t),
+ "linePrefix",
+ this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
+ );
+}
+function Un(n) {
+ if (n === null || Z(n) || Ht(n))
+ return 1;
+ if (qt(n))
+ return 2;
+}
+function Ln(n, r, t) {
+ const e = [];
+ let u = -1;
+ for (; ++u < n.length; ) {
+ const i = n[u].resolveAll;
+ i && !e.includes(i) && (r = i(r, t), e.push(i));
+ }
+ return r;
+}
+const In = {
+ name: "attention",
+ tokenize: Zt,
+ resolveAll: $t
+};
+function $t(n, r) {
+ let t = -1, e, u, i, l, a, m, c, p;
+ for (; ++t < n.length; )
+ if (n[t][0] === "enter" && n[t][1].type === "attentionSequence" && n[t][1]._close) {
+ for (e = t; e--; )
+ if (n[e][0] === "exit" && n[e][1].type === "attentionSequence" && n[e][1]._open && // If the markers are the same:
+ r.sliceSerialize(n[e][1]).charCodeAt(0) === r.sliceSerialize(n[t][1]).charCodeAt(0)) {
+ if ((n[e][1]._close || n[t][1]._open) && (n[t][1].end.offset - n[t][1].start.offset) % 3 && !((n[e][1].end.offset - n[e][1].start.offset + n[t][1].end.offset - n[t][1].start.offset) % 3))
+ continue;
+ m = n[e][1].end.offset - n[e][1].start.offset > 1 && n[t][1].end.offset - n[t][1].start.offset > 1 ? 2 : 1;
+ const f = Object.assign({}, n[e][1].end), x = Object.assign({}, n[t][1].start);
+ $n(f, -m), $n(x, m), l = {
+ type: m > 1 ? "strongSequence" : "emphasisSequence",
+ start: f,
+ end: Object.assign({}, n[e][1].end)
+ }, a = {
+ type: m > 1 ? "strongSequence" : "emphasisSequence",
+ start: Object.assign({}, n[t][1].start),
+ end: x
+ }, i = {
+ type: m > 1 ? "strongText" : "emphasisText",
+ start: Object.assign({}, n[e][1].end),
+ end: Object.assign({}, n[t][1].start)
+ }, u = {
+ type: m > 1 ? "strong" : "emphasis",
+ start: Object.assign({}, l.start),
+ end: Object.assign({}, a.end)
+ }, n[e][1].end = Object.assign({}, l.start), n[t][1].start = Object.assign({}, a.end), c = [], n[e][1].end.offset - n[e][1].start.offset && (c = Y(c, [
+ ["enter", n[e][1], r],
+ ["exit", n[e][1], r]
+ ])), c = Y(c, [
+ ["enter", u, r],
+ ["enter", l, r],
+ ["exit", l, r],
+ ["enter", i, r]
+ ]), c = Y(
+ c,
+ Ln(
+ r.parser.constructs.insideSpan.null,
+ n.slice(e + 1, t),
+ r
+ )
+ ), c = Y(c, [
+ ["exit", i, r],
+ ["enter", a, r],
+ ["exit", a, r],
+ ["exit", u, r]
+ ]), n[t][1].end.offset - n[t][1].start.offset ? (p = 2, c = Y(c, [
+ ["enter", n[t][1], r],
+ ["exit", n[t][1], r]
+ ])) : p = 0, tn(n, e - 1, t - e + 3, c), t = e + c.length - p - 2;
+ break;
+ }
+ }
+ for (t = -1; ++t < n.length; )
+ n[t][1].type === "attentionSequence" && (n[t][1].type = "data");
+ return n;
+}
+function Zt(n, r) {
+ const t = this.parser.constructs.attentionMarkers.null, e = this.previous, u = Un(e);
+ let i;
+ return l;
+ function l(m) {
+ return i = m, n.enter("attentionSequence"), a(m);
+ }
+ function a(m) {
+ if (m === i)
+ return n.consume(m), a;
+ const c = n.exit("attentionSequence"), p = Un(m), f = !p || p === 2 && u || t.includes(m), x = !u || u === 2 && p || t.includes(e);
+ return c._open = !!(i === 42 ? f : f && (u || !x)), c._close = !!(i === 42 ? x : x && (p || !f)), r(m);
+ }
+}
+function $n(n, r) {
+ n.column += r, n.offset += r, n._bufferIndex += r;
+}
+const Yt = {
+ name: "autolink",
+ tokenize: Gt
+};
+function Gt(n, r, t) {
+ let e = 0;
+ return u;
+ function u(h) {
+ return n.enter("autolink"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.enter("autolinkProtocol"), i;
+ }
+ function i(h) {
+ return nn(h) ? (n.consume(h), l) : c(h);
+ }
+ function l(h) {
+ return h === 43 || h === 45 || h === 46 || v(h) ? (e = 1, a(h)) : c(h);
+ }
+ function a(h) {
+ return h === 58 ? (n.consume(h), e = 0, m) : (h === 43 || h === 45 || h === 46 || v(h)) && e++ < 32 ? (n.consume(h), a) : (e = 0, c(h));
+ }
+ function m(h) {
+ return h === 62 ? (n.exit("autolinkProtocol"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : h === null || h === 32 || h === 60 || An(h) ? t(h) : (n.consume(h), m);
+ }
+ function c(h) {
+ return h === 64 ? (n.consume(h), p) : Mt(h) ? (n.consume(h), c) : t(h);
+ }
+ function p(h) {
+ return v(h) ? f(h) : t(h);
+ }
+ function f(h) {
+ return h === 46 ? (n.consume(h), e = 0, p) : h === 62 ? (n.exit("autolinkProtocol").type = "autolinkEmail", n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : x(h);
+ }
+ function x(h) {
+ if ((h === 45 || v(h)) && e++ < 63) {
+ const A = h === 45 ? x : f;
+ return n.consume(h), A;
+ }
+ return t(h);
+ }
+}
+const Sn = {
+ tokenize: Jt,
+ partial: !0
+};
+function Jt(n, r, t) {
+ return e;
+ function e(i) {
+ return z(i) ? O(n, u, "linePrefix")(i) : u(i);
+ }
+ function u(i) {
+ return i === null || C(i) ? r(i) : t(i);
+ }
+}
+const rt = {
+ name: "blockQuote",
+ tokenize: Kt,
+ continuation: {
+ tokenize: Xt
+ },
+ exit: vt
+};
+function Kt(n, r, t) {
+ const e = this;
+ return u;
+ function u(l) {
+ if (l === 62) {
+ const a = e.containerState;
+ return a.open || (n.enter("blockQuote", {
+ _container: !0
+ }), a.open = !0), n.enter("blockQuotePrefix"), n.enter("blockQuoteMarker"), n.consume(l), n.exit("blockQuoteMarker"), i;
+ }
+ return t(l);
+ }
+ function i(l) {
+ return z(l) ? (n.enter("blockQuotePrefixWhitespace"), n.consume(l), n.exit("blockQuotePrefixWhitespace"), n.exit("blockQuotePrefix"), r) : (n.exit("blockQuotePrefix"), r(l));
+ }
+}
+function Xt(n, r, t) {
+ const e = this;
+ return u;
+ function u(l) {
+ return z(l) ? O(
+ n,
+ i,
+ "linePrefix",
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
+ )(l) : i(l);
+ }
+ function i(l) {
+ return n.attempt(rt, r, t)(l);
+ }
+}
+function vt(n) {
+ n.exit("blockQuote");
+}
+const it = {
+ name: "characterEscape",
+ tokenize: ne
+};
+function ne(n, r, t) {
+ return e;
+ function e(i) {
+ return n.enter("characterEscape"), n.enter("escapeMarker"), n.consume(i), n.exit("escapeMarker"), u;
+ }
+ function u(i) {
+ return Rt(i) ? (n.enter("characterEscapeValue"), n.consume(i), n.exit("characterEscapeValue"), n.exit("characterEscape"), r) : t(i);
+ }
+}
+const Zn = document.createElement("i");
+function On(n) {
+ const r = "&" + n + ";";
+ Zn.innerHTML = r;
+ const t = Zn.textContent;
+ return t.charCodeAt(t.length - 1) === 59 && n !== "semi" || t === r ? !1 : t;
+}
+const ut = {
+ name: "characterReference",
+ tokenize: te
+};
+function te(n, r, t) {
+ const e = this;
+ let u = 0, i, l;
+ return a;
+ function a(f) {
+ return n.enter("characterReference"), n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), m;
+ }
+ function m(f) {
+ return f === 35 ? (n.enter("characterReferenceMarkerNumeric"), n.consume(f), n.exit("characterReferenceMarkerNumeric"), c) : (n.enter("characterReferenceValue"), i = 31, l = v, p(f));
+ }
+ function c(f) {
+ return f === 88 || f === 120 ? (n.enter("characterReferenceMarkerHexadecimal"), n.consume(f), n.exit("characterReferenceMarkerHexadecimal"), n.enter("characterReferenceValue"), i = 6, l = jt, p) : (n.enter("characterReferenceValue"), i = 7, l = zn, p(f));
+ }
+ function p(f) {
+ if (f === 59 && u) {
+ const x = n.exit("characterReferenceValue");
+ return l === v && !On(e.sliceSerialize(x)) ? t(f) : (n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), n.exit("characterReference"), r);
+ }
+ return l(f) && u++ < i ? (n.consume(f), p) : t(f);
+ }
+}
+const Yn = {
+ tokenize: re,
+ partial: !0
+}, Gn = {
+ name: "codeFenced",
+ tokenize: ee,
+ concrete: !0
+};
+function ee(n, r, t) {
+ const e = this, u = {
+ tokenize: _,
+ partial: !0
+ };
+ let i = 0, l = 0, a;
+ return m;
+ function m(k) {
+ return c(k);
+ }
+ function c(k) {
+ const T = e.events[e.events.length - 1];
+ return i = T && T[1].type === "linePrefix" ? T[2].sliceSerialize(T[1], !0).length : 0, a = k, n.enter("codeFenced"), n.enter("codeFencedFence"), n.enter("codeFencedFenceSequence"), p(k);
+ }
+ function p(k) {
+ return k === a ? (l++, n.consume(k), p) : l < 3 ? t(k) : (n.exit("codeFencedFenceSequence"), z(k) ? O(n, f, "whitespace")(k) : f(k));
+ }
+ function f(k) {
+ return k === null || C(k) ? (n.exit("codeFencedFence"), e.interrupt ? r(k) : n.check(Yn, I, D)(k)) : (n.enter("codeFencedFenceInfo"), n.enter("chunkString", {
+ contentType: "string"
+ }), x(k));
+ }
+ function x(k) {
+ return k === null || C(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), f(k)) : z(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), O(n, h, "whitespace")(k)) : k === 96 && k === a ? t(k) : (n.consume(k), x);
+ }
+ function h(k) {
+ return k === null || C(k) ? f(k) : (n.enter("codeFencedFenceMeta"), n.enter("chunkString", {
+ contentType: "string"
+ }), A(k));
+ }
+ function A(k) {
+ return k === null || C(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceMeta"), f(k)) : k === 96 && k === a ? t(k) : (n.consume(k), A);
+ }
+ function I(k) {
+ return n.attempt(u, D, M)(k);
+ }
+ function M(k) {
+ return n.enter("lineEnding"), n.consume(k), n.exit("lineEnding"), b;
+ }
+ function b(k) {
+ return i > 0 && z(k) ? O(
+ n,
+ j,
+ "linePrefix",
+ i + 1
+ )(k) : j(k);
+ }
+ function j(k) {
+ return k === null || C(k) ? n.check(Yn, I, D)(k) : (n.enter("codeFlowValue"), F(k));
+ }
+ function F(k) {
+ return k === null || C(k) ? (n.exit("codeFlowValue"), j(k)) : (n.consume(k), F);
+ }
+ function D(k) {
+ return n.exit("codeFenced"), r(k);
+ }
+ function _(k, T, H) {
+ let N = 0;
+ return V;
+ function V(w) {
+ return k.enter("lineEnding"), k.consume(w), k.exit("lineEnding"), y;
+ }
+ function y(w) {
+ return k.enter("codeFencedFence"), z(w) ? O(
+ k,
+ S,
+ "linePrefix",
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
+ )(w) : S(w);
+ }
+ function S(w) {
+ return w === a ? (k.enter("codeFencedFenceSequence"), P(w)) : H(w);
+ }
+ function P(w) {
+ return w === a ? (N++, k.consume(w), P) : N >= l ? (k.exit("codeFencedFenceSequence"), z(w) ? O(k, R, "whitespace")(w) : R(w)) : H(w);
+ }
+ function R(w) {
+ return w === null || C(w) ? (k.exit("codeFencedFence"), T(w)) : H(w);
+ }
+ }
+}
+function re(n, r, t) {
+ const e = this;
+ return u;
+ function u(l) {
+ return l === null ? t(l) : (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i);
+ }
+ function i(l) {
+ return e.parser.lazy[e.now().line] ? t(l) : r(l);
+ }
+}
+const Cn = {
+ name: "codeIndented",
+ tokenize: ue
+}, ie = {
+ tokenize: le,
+ partial: !0
+};
+function ue(n, r, t) {
+ const e = this;
+ return u;
+ function u(c) {
+ return n.enter("codeIndented"), O(n, i, "linePrefix", 4 + 1)(c);
+ }
+ function i(c) {
+ const p = e.events[e.events.length - 1];
+ return p && p[1].type === "linePrefix" && p[2].sliceSerialize(p[1], !0).length >= 4 ? l(c) : t(c);
+ }
+ function l(c) {
+ return c === null ? m(c) : C(c) ? n.attempt(ie, l, m)(c) : (n.enter("codeFlowValue"), a(c));
+ }
+ function a(c) {
+ return c === null || C(c) ? (n.exit("codeFlowValue"), l(c)) : (n.consume(c), a);
+ }
+ function m(c) {
+ return n.exit("codeIndented"), r(c);
+ }
+}
+function le(n, r, t) {
+ const e = this;
+ return u;
+ function u(l) {
+ return e.parser.lazy[e.now().line] ? t(l) : C(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), u) : O(n, i, "linePrefix", 4 + 1)(l);
+ }
+ function i(l) {
+ const a = e.events[e.events.length - 1];
+ return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : C(l) ? u(l) : t(l);
+ }
+}
+const ae = {
+ name: "codeText",
+ tokenize: ce,
+ resolve: oe,
+ previous: se
+};
+function oe(n) {
+ let r = n.length - 4, t = 3, e, u;
+ if ((n[t][1].type === "lineEnding" || n[t][1].type === "space") && (n[r][1].type === "lineEnding" || n[r][1].type === "space")) {
+ for (e = t; ++e < r; )
+ if (n[e][1].type === "codeTextData") {
+ n[t][1].type = "codeTextPadding", n[r][1].type = "codeTextPadding", t += 2, r -= 2;
+ break;
+ }
+ }
+ for (e = t - 1, r++; ++e <= r; )
+ u === void 0 ? e !== r && n[e][1].type !== "lineEnding" && (u = e) : (e === r || n[e][1].type === "lineEnding") && (n[u][1].type = "codeTextData", e !== u + 2 && (n[u][1].end = n[e - 1][1].end, n.splice(u + 2, e - u - 2), r -= e - u - 2, e = u + 2), u = void 0);
+ return n;
+}
+function se(n) {
+ return n !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
+}
+function ce(n, r, t) {
+ let e = 0, u, i;
+ return l;
+ function l(f) {
+ return n.enter("codeText"), n.enter("codeTextSequence"), a(f);
+ }
+ function a(f) {
+ return f === 96 ? (n.consume(f), e++, a) : (n.exit("codeTextSequence"), m(f));
+ }
+ function m(f) {
+ return f === null ? t(f) : f === 32 ? (n.enter("space"), n.consume(f), n.exit("space"), m) : f === 96 ? (i = n.enter("codeTextSequence"), u = 0, p(f)) : C(f) ? (n.enter("lineEnding"), n.consume(f), n.exit("lineEnding"), m) : (n.enter("codeTextData"), c(f));
+ }
+ function c(f) {
+ return f === null || f === 32 || f === 96 || C(f) ? (n.exit("codeTextData"), m(f)) : (n.consume(f), c);
+ }
+ function p(f) {
+ return f === 96 ? (n.consume(f), u++, p) : u === e ? (n.exit("codeTextSequence"), n.exit("codeText"), r(f)) : (i.type = "codeTextData", c(f));
+ }
+}
+function lt(n) {
+ const r = {};
+ let t = -1, e, u, i, l, a, m, c;
+ for (; ++t < n.length; ) {
+ for (; t in r; )
+ t = r[t];
+ if (e = n[t], t && e[1].type === "chunkFlow" && n[t - 1][1].type === "listItemPrefix" && (m = e[1]._tokenizer.events, i = 0, i < m.length && m[i][1].type === "lineEndingBlank" && (i += 2), i < m.length && m[i][1].type === "content"))
+ for (; ++i < m.length && m[i][1].type !== "content"; )
+ m[i][1].type === "chunkText" && (m[i][1]._isInFirstContentOfListItem = !0, i++);
+ if (e[0] === "enter")
+ e[1].contentType && (Object.assign(r, he(n, t)), t = r[t], c = !0);
+ else if (e[1]._container) {
+ for (i = t, u = void 0; i-- && (l = n[i], l[1].type === "lineEnding" || l[1].type === "lineEndingBlank"); )
+ l[0] === "enter" && (u && (n[u][1].type = "lineEndingBlank"), l[1].type = "lineEnding", u = i);
+ u && (e[1].end = Object.assign({}, n[u][1].start), a = n.slice(u, t), a.unshift(e), tn(n, u, t - u + 1, a));
+ }
+ }
+ return !c;
+}
+function he(n, r) {
+ const t = n[r][1], e = n[r][2];
+ let u = r - 1;
+ const i = [], l = t._tokenizer || e.parser[t.contentType](t.start), a = l.events, m = [], c = {};
+ let p, f, x = -1, h = t, A = 0, I = 0;
+ const M = [I];
+ for (; h; ) {
+ for (; n[++u][1] !== h; )
+ ;
+ i.push(u), h._tokenizer || (p = e.sliceStream(h), h.next || p.push(null), f && l.defineSkip(h.start), h._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = !0), l.write(p), h._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = void 0)), f = h, h = h.next;
+ }
+ for (h = t; ++x < a.length; )
+ // Find a void token that includes a break.
+ a[x][0] === "exit" && a[x - 1][0] === "enter" && a[x][1].type === a[x - 1][1].type && a[x][1].start.line !== a[x][1].end.line && (I = x + 1, M.push(I), h._tokenizer = void 0, h.previous = void 0, h = h.next);
+ for (l.events = [], h ? (h._tokenizer = void 0, h.previous = void 0) : M.pop(), x = M.length; x--; ) {
+ const b = a.slice(M[x], M[x + 1]), j = i.pop();
+ m.unshift([j, j + b.length - 1]), tn(n, j, 2, b);
+ }
+ for (x = -1; ++x < m.length; )
+ c[A + m[x][0]] = A + m[x][1], A += m[x][1] - m[x][0] - 1;
+ return c;
+}
+const pe = {
+ tokenize: xe,
+ resolve: me
+}, fe = {
+ tokenize: ge,
+ partial: !0
+};
+function me(n) {
+ return lt(n), n;
+}
+function xe(n, r) {
+ let t;
+ return e;
+ function e(a) {
+ return n.enter("content"), t = n.enter("chunkContent", {
+ contentType: "content"
+ }), u(a);
+ }
+ function u(a) {
+ return a === null ? i(a) : C(a) ? n.check(
+ fe,
+ l,
+ i
+ )(a) : (n.consume(a), u);
+ }
+ function i(a) {
+ return n.exit("chunkContent"), n.exit("content"), r(a);
+ }
+ function l(a) {
+ return n.consume(a), n.exit("chunkContent"), t.next = n.enter("chunkContent", {
+ contentType: "content",
+ previous: t
+ }), t = t.next, u;
+ }
+}
+function ge(n, r, t) {
+ const e = this;
+ return u;
+ function u(l) {
+ return n.exit("chunkContent"), n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), O(n, i, "linePrefix");
+ }
+ function i(l) {
+ if (l === null || C(l))
+ return t(l);
+ const a = e.events[e.events.length - 1];
+ return !e.parser.constructs.disable.null.includes("codeIndented") && a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : n.interrupt(e.parser.constructs.flow, t, r)(l);
+ }
+}
+function at(n, r, t, e, u, i, l, a, m) {
+ const c = m || Number.POSITIVE_INFINITY;
+ let p = 0;
+ return f;
+ function f(b) {
+ return b === 60 ? (n.enter(e), n.enter(u), n.enter(i), n.consume(b), n.exit(i), x) : b === null || b === 32 || b === 41 || An(b) ? t(b) : (n.enter(e), n.enter(l), n.enter(a), n.enter("chunkString", {
+ contentType: "string"
+ }), I(b));
+ }
+ function x(b) {
+ return b === 62 ? (n.enter(i), n.consume(b), n.exit(i), n.exit(u), n.exit(e), r) : (n.enter(a), n.enter("chunkString", {
+ contentType: "string"
+ }), h(b));
+ }
+ function h(b) {
+ return b === 62 ? (n.exit("chunkString"), n.exit(a), x(b)) : b === null || b === 60 || C(b) ? t(b) : (n.consume(b), b === 92 ? A : h);
+ }
+ function A(b) {
+ return b === 60 || b === 62 || b === 92 ? (n.consume(b), h) : h(b);
+ }
+ function I(b) {
+ return !p && (b === null || b === 41 || Z(b)) ? (n.exit("chunkString"), n.exit(a), n.exit(l), n.exit(e), r(b)) : p < c && b === 40 ? (n.consume(b), p++, I) : b === 41 ? (n.consume(b), p--, I) : b === null || b === 32 || b === 40 || An(b) ? t(b) : (n.consume(b), b === 92 ? M : I);
+ }
+ function M(b) {
+ return b === 40 || b === 41 || b === 92 ? (n.consume(b), I) : I(b);
+ }
+}
+function ot(n, r, t, e, u, i) {
+ const l = this;
+ let a = 0, m;
+ return c;
+ function c(h) {
+ return n.enter(e), n.enter(u), n.consume(h), n.exit(u), n.enter(i), p;
+ }
+ function p(h) {
+ return a > 999 || h === null || h === 91 || h === 93 && !m || // To do: remove in the future once we’ve switched from
+ // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
+ // which doesn’t need this.
+ // Hidden footnotes hook.
+ /* c8 ignore next 3 */
+ h === 94 && !a && "_hiddenFootnoteSupport" in l.parser.constructs ? t(h) : h === 93 ? (n.exit(i), n.enter(u), n.consume(h), n.exit(u), n.exit(e), r) : C(h) ? (n.enter("lineEnding"), n.consume(h), n.exit("lineEnding"), p) : (n.enter("chunkString", {
+ contentType: "string"
+ }), f(h));
+ }
+ function f(h) {
+ return h === null || h === 91 || h === 93 || C(h) || a++ > 999 ? (n.exit("chunkString"), p(h)) : (n.consume(h), m || (m = !z(h)), h === 92 ? x : f);
+ }
+ function x(h) {
+ return h === 91 || h === 92 || h === 93 ? (n.consume(h), a++, f) : f(h);
+ }
+}
+function st(n, r, t, e, u, i) {
+ let l;
+ return a;
+ function a(x) {
+ return x === 34 || x === 39 || x === 40 ? (n.enter(e), n.enter(u), n.consume(x), n.exit(u), l = x === 40 ? 41 : x, m) : t(x);
+ }
+ function m(x) {
+ return x === l ? (n.enter(u), n.consume(x), n.exit(u), n.exit(e), r) : (n.enter(i), c(x));
+ }
+ function c(x) {
+ return x === l ? (n.exit(i), m(l)) : x === null ? t(x) : C(x) ? (n.enter("lineEnding"), n.consume(x), n.exit("lineEnding"), O(n, c, "linePrefix")) : (n.enter("chunkString", {
+ contentType: "string"
+ }), p(x));
+ }
+ function p(x) {
+ return x === l || x === null || C(x) ? (n.exit("chunkString"), c(x)) : (n.consume(x), x === 92 ? f : p);
+ }
+ function f(x) {
+ return x === l || x === 92 ? (n.consume(x), p) : p(x);
+ }
+}
+function dn(n, r) {
+ let t;
+ return e;
+ function e(u) {
+ return C(u) ? (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), t = !0, e) : z(u) ? O(
+ n,
+ e,
+ t ? "linePrefix" : "lineSuffix"
+ )(u) : r(u);
+ }
+}
+function xn(n) {
+ return n.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
+}
+const ke = {
+ name: "definition",
+ tokenize: be
+}, de = {
+ tokenize: ye,
+ partial: !0
+};
+function be(n, r, t) {
+ const e = this;
+ let u;
+ return i;
+ function i(h) {
+ return n.enter("definition"), l(h);
+ }
+ function l(h) {
+ return ot.call(
+ e,
+ n,
+ a,
+ // Note: we don’t need to reset the way `markdown-rs` does.
+ t,
+ "definitionLabel",
+ "definitionLabelMarker",
+ "definitionLabelString"
+ )(h);
+ }
+ function a(h) {
+ return u = xn(
+ e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)
+ ), h === 58 ? (n.enter("definitionMarker"), n.consume(h), n.exit("definitionMarker"), m) : t(h);
+ }
+ function m(h) {
+ return Z(h) ? dn(n, c)(h) : c(h);
+ }
+ function c(h) {
+ return at(
+ n,
+ p,
+ // Note: we don’t need to reset the way `markdown-rs` does.
+ t,
+ "definitionDestination",
+ "definitionDestinationLiteral",
+ "definitionDestinationLiteralMarker",
+ "definitionDestinationRaw",
+ "definitionDestinationString"
+ )(h);
+ }
+ function p(h) {
+ return n.attempt(de, f, f)(h);
+ }
+ function f(h) {
+ return z(h) ? O(n, x, "whitespace")(h) : x(h);
+ }
+ function x(h) {
+ return h === null || C(h) ? (n.exit("definition"), e.parser.defined.push(u), r(h)) : t(h);
+ }
+}
+function ye(n, r, t) {
+ return e;
+ function e(a) {
+ return Z(a) ? dn(n, u)(a) : t(a);
+ }
+ function u(a) {
+ return st(
+ n,
+ i,
+ t,
+ "definitionTitle",
+ "definitionTitleMarker",
+ "definitionTitleString"
+ )(a);
+ }
+ function i(a) {
+ return z(a) ? O(n, l, "whitespace")(a) : l(a);
+ }
+ function l(a) {
+ return a === null || C(a) ? r(a) : t(a);
+ }
+}
+const Se = {
+ name: "hardBreakEscape",
+ tokenize: Fe
+};
+function Fe(n, r, t) {
+ return e;
+ function e(i) {
+ return n.enter("hardBreakEscape"), n.consume(i), u;
+ }
+ function u(i) {
+ return C(i) ? (n.exit("hardBreakEscape"), r(i)) : t(i);
+ }
+}
+const Ee = {
+ name: "headingAtx",
+ tokenize: we,
+ resolve: Ce
+};
+function Ce(n, r) {
+ let t = n.length - 2, e = 3, u, i;
+ return n[e][1].type === "whitespace" && (e += 2), t - 2 > e && n[t][1].type === "whitespace" && (t -= 2), n[t][1].type === "atxHeadingSequence" && (e === t - 1 || t - 4 > e && n[t - 2][1].type === "whitespace") && (t -= e + 1 === t ? 2 : 4), t > e && (u = {
+ type: "atxHeadingText",
+ start: n[e][1].start,
+ end: n[t][1].end
+ }, i = {
+ type: "chunkText",
+ start: n[e][1].start,
+ end: n[t][1].end,
+ contentType: "text"
+ }, tn(n, e, t - e + 1, [
+ ["enter", u, r],
+ ["enter", i, r],
+ ["exit", i, r],
+ ["exit", u, r]
+ ])), n;
+}
+function we(n, r, t) {
+ let e = 0;
+ return u;
+ function u(p) {
+ return n.enter("atxHeading"), i(p);
+ }
+ function i(p) {
+ return n.enter("atxHeadingSequence"), l(p);
+ }
+ function l(p) {
+ return p === 35 && e++ < 6 ? (n.consume(p), l) : p === null || Z(p) ? (n.exit("atxHeadingSequence"), a(p)) : t(p);
+ }
+ function a(p) {
+ return p === 35 ? (n.enter("atxHeadingSequence"), m(p)) : p === null || C(p) ? (n.exit("atxHeading"), r(p)) : z(p) ? O(n, a, "whitespace")(p) : (n.enter("atxHeadingText"), c(p));
+ }
+ function m(p) {
+ return p === 35 ? (n.consume(p), m) : (n.exit("atxHeadingSequence"), a(p));
+ }
+ function c(p) {
+ return p === null || p === 35 || Z(p) ? (n.exit("atxHeadingText"), a(p)) : (n.consume(p), c);
+ }
+}
+const Ae = [
+ "address",
+ "article",
+ "aside",
+ "base",
+ "basefont",
+ "blockquote",
+ "body",
+ "caption",
+ "center",
+ "col",
+ "colgroup",
+ "dd",
+ "details",
+ "dialog",
+ "dir",
+ "div",
+ "dl",
+ "dt",
+ "fieldset",
+ "figcaption",
+ "figure",
+ "footer",
+ "form",
+ "frame",
+ "frameset",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "head",
+ "header",
+ "hr",
+ "html",
+ "iframe",
+ "legend",
+ "li",
+ "link",
+ "main",
+ "menu",
+ "menuitem",
+ "nav",
+ "noframes",
+ "ol",
+ "optgroup",
+ "option",
+ "p",
+ "param",
+ "search",
+ "section",
+ "summary",
+ "table",
+ "tbody",
+ "td",
+ "tfoot",
+ "th",
+ "thead",
+ "title",
+ "tr",
+ "track",
+ "ul"
+], Jn = ["pre", "script", "style", "textarea"], ze = {
+ name: "htmlFlow",
+ tokenize: Le,
+ resolveTo: Be,
+ concrete: !0
+}, Ie = {
+ tokenize: De,
+ partial: !0
+}, Te = {
+ tokenize: Oe,
+ partial: !0
+};
+function Be(n) {
+ let r = n.length;
+ for (; r-- && !(n[r][0] === "enter" && n[r][1].type === "htmlFlow"); )
+ ;
+ return r > 1 && n[r - 2][1].type === "linePrefix" && (n[r][1].start = n[r - 2][1].start, n[r + 1][1].start = n[r - 2][1].start, n.splice(r - 2, 2)), n;
+}
+function Le(n, r, t) {
+ const e = this;
+ let u, i, l, a, m;
+ return c;
+ function c(s) {
+ return p(s);
+ }
+ function p(s) {
+ return n.enter("htmlFlow"), n.enter("htmlFlowData"), n.consume(s), f;
+ }
+ function f(s) {
+ return s === 33 ? (n.consume(s), x) : s === 47 ? (n.consume(s), i = !0, I) : s === 63 ? (n.consume(s), u = 3, e.interrupt ? r : o) : nn(s) ? (n.consume(s), l = String.fromCharCode(s), M) : t(s);
+ }
+ function x(s) {
+ return s === 45 ? (n.consume(s), u = 2, h) : s === 91 ? (n.consume(s), u = 5, a = 0, A) : nn(s) ? (n.consume(s), u = 4, e.interrupt ? r : o) : t(s);
+ }
+ function h(s) {
+ return s === 45 ? (n.consume(s), e.interrupt ? r : o) : t(s);
+ }
+ function A(s) {
+ const K = "CDATA[";
+ return s === K.charCodeAt(a++) ? (n.consume(s), a === K.length ? e.interrupt ? r : S : A) : t(s);
+ }
+ function I(s) {
+ return nn(s) ? (n.consume(s), l = String.fromCharCode(s), M) : t(s);
+ }
+ function M(s) {
+ if (s === null || s === 47 || s === 62 || Z(s)) {
+ const K = s === 47, hn = l.toLowerCase();
+ return !K && !i && Jn.includes(hn) ? (u = 1, e.interrupt ? r(s) : S(s)) : Ae.includes(l.toLowerCase()) ? (u = 6, K ? (n.consume(s), b) : e.interrupt ? r(s) : S(s)) : (u = 7, e.interrupt && !e.parser.lazy[e.now().line] ? t(s) : i ? j(s) : F(s));
+ }
+ return s === 45 || v(s) ? (n.consume(s), l += String.fromCharCode(s), M) : t(s);
+ }
+ function b(s) {
+ return s === 62 ? (n.consume(s), e.interrupt ? r : S) : t(s);
+ }
+ function j(s) {
+ return z(s) ? (n.consume(s), j) : V(s);
+ }
+ function F(s) {
+ return s === 47 ? (n.consume(s), V) : s === 58 || s === 95 || nn(s) ? (n.consume(s), D) : z(s) ? (n.consume(s), F) : V(s);
+ }
+ function D(s) {
+ return s === 45 || s === 46 || s === 58 || s === 95 || v(s) ? (n.consume(s), D) : _(s);
+ }
+ function _(s) {
+ return s === 61 ? (n.consume(s), k) : z(s) ? (n.consume(s), _) : F(s);
+ }
+ function k(s) {
+ return s === null || s === 60 || s === 61 || s === 62 || s === 96 ? t(s) : s === 34 || s === 39 ? (n.consume(s), m = s, T) : z(s) ? (n.consume(s), k) : H(s);
+ }
+ function T(s) {
+ return s === m ? (n.consume(s), m = null, N) : s === null || C(s) ? t(s) : (n.consume(s), T);
+ }
+ function H(s) {
+ return s === null || s === 34 || s === 39 || s === 47 || s === 60 || s === 61 || s === 62 || s === 96 || Z(s) ? _(s) : (n.consume(s), H);
+ }
+ function N(s) {
+ return s === 47 || s === 62 || z(s) ? F(s) : t(s);
+ }
+ function V(s) {
+ return s === 62 ? (n.consume(s), y) : t(s);
+ }
+ function y(s) {
+ return s === null || C(s) ? S(s) : z(s) ? (n.consume(s), y) : t(s);
+ }
+ function S(s) {
+ return s === 45 && u === 2 ? (n.consume(s), U) : s === 60 && u === 1 ? (n.consume(s), W) : s === 62 && u === 4 ? (n.consume(s), J) : s === 63 && u === 3 ? (n.consume(s), o) : s === 93 && u === 5 ? (n.consume(s), en) : C(s) && (u === 6 || u === 7) ? (n.exit("htmlFlowData"), n.check(
+ Ie,
+ rn,
+ P
+ )(s)) : s === null || C(s) ? (n.exit("htmlFlowData"), P(s)) : (n.consume(s), S);
+ }
+ function P(s) {
+ return n.check(
+ Te,
+ R,
+ rn
+ )(s);
+ }
+ function R(s) {
+ return n.enter("lineEnding"), n.consume(s), n.exit("lineEnding"), w;
+ }
+ function w(s) {
+ return s === null || C(s) ? P(s) : (n.enter("htmlFlowData"), S(s));
+ }
+ function U(s) {
+ return s === 45 ? (n.consume(s), o) : S(s);
+ }
+ function W(s) {
+ return s === 47 ? (n.consume(s), l = "", G) : S(s);
+ }
+ function G(s) {
+ if (s === 62) {
+ const K = l.toLowerCase();
+ return Jn.includes(K) ? (n.consume(s), J) : S(s);
+ }
+ return nn(s) && l.length < 8 ? (n.consume(s), l += String.fromCharCode(s), G) : S(s);
+ }
+ function en(s) {
+ return s === 93 ? (n.consume(s), o) : S(s);
+ }
+ function o(s) {
+ return s === 62 ? (n.consume(s), J) : s === 45 && u === 2 ? (n.consume(s), o) : S(s);
+ }
+ function J(s) {
+ return s === null || C(s) ? (n.exit("htmlFlowData"), rn(s)) : (n.consume(s), J);
+ }
+ function rn(s) {
+ return n.exit("htmlFlow"), r(s);
+ }
+}
+function Oe(n, r, t) {
+ const e = this;
+ return u;
+ function u(l) {
+ return C(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i) : t(l);
+ }
+ function i(l) {
+ return e.parser.lazy[e.now().line] ? t(l) : r(l);
+ }
+}
+function De(n, r, t) {
+ return e;
+ function e(u) {
+ return n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), n.attempt(Sn, r, t);
+ }
+}
+const Pe = {
+ name: "htmlText",
+ tokenize: _e
+};
+function _e(n, r, t) {
+ const e = this;
+ let u, i, l;
+ return a;
+ function a(o) {
+ return n.enter("htmlText"), n.enter("htmlTextData"), n.consume(o), m;
+ }
+ function m(o) {
+ return o === 33 ? (n.consume(o), c) : o === 47 ? (n.consume(o), _) : o === 63 ? (n.consume(o), F) : nn(o) ? (n.consume(o), H) : t(o);
+ }
+ function c(o) {
+ return o === 45 ? (n.consume(o), p) : o === 91 ? (n.consume(o), i = 0, A) : nn(o) ? (n.consume(o), j) : t(o);
+ }
+ function p(o) {
+ return o === 45 ? (n.consume(o), h) : t(o);
+ }
+ function f(o) {
+ return o === null ? t(o) : o === 45 ? (n.consume(o), x) : C(o) ? (l = f, W(o)) : (n.consume(o), f);
+ }
+ function x(o) {
+ return o === 45 ? (n.consume(o), h) : f(o);
+ }
+ function h(o) {
+ return o === 62 ? U(o) : o === 45 ? x(o) : f(o);
+ }
+ function A(o) {
+ const J = "CDATA[";
+ return o === J.charCodeAt(i++) ? (n.consume(o), i === J.length ? I : A) : t(o);
+ }
+ function I(o) {
+ return o === null ? t(o) : o === 93 ? (n.consume(o), M) : C(o) ? (l = I, W(o)) : (n.consume(o), I);
+ }
+ function M(o) {
+ return o === 93 ? (n.consume(o), b) : I(o);
+ }
+ function b(o) {
+ return o === 62 ? U(o) : o === 93 ? (n.consume(o), b) : I(o);
+ }
+ function j(o) {
+ return o === null || o === 62 ? U(o) : C(o) ? (l = j, W(o)) : (n.consume(o), j);
+ }
+ function F(o) {
+ return o === null ? t(o) : o === 63 ? (n.consume(o), D) : C(o) ? (l = F, W(o)) : (n.consume(o), F);
+ }
+ function D(o) {
+ return o === 62 ? U(o) : F(o);
+ }
+ function _(o) {
+ return nn(o) ? (n.consume(o), k) : t(o);
+ }
+ function k(o) {
+ return o === 45 || v(o) ? (n.consume(o), k) : T(o);
+ }
+ function T(o) {
+ return C(o) ? (l = T, W(o)) : z(o) ? (n.consume(o), T) : U(o);
+ }
+ function H(o) {
+ return o === 45 || v(o) ? (n.consume(o), H) : o === 47 || o === 62 || Z(o) ? N(o) : t(o);
+ }
+ function N(o) {
+ return o === 47 ? (n.consume(o), U) : o === 58 || o === 95 || nn(o) ? (n.consume(o), V) : C(o) ? (l = N, W(o)) : z(o) ? (n.consume(o), N) : U(o);
+ }
+ function V(o) {
+ return o === 45 || o === 46 || o === 58 || o === 95 || v(o) ? (n.consume(o), V) : y(o);
+ }
+ function y(o) {
+ return o === 61 ? (n.consume(o), S) : C(o) ? (l = y, W(o)) : z(o) ? (n.consume(o), y) : N(o);
+ }
+ function S(o) {
+ return o === null || o === 60 || o === 61 || o === 62 || o === 96 ? t(o) : o === 34 || o === 39 ? (n.consume(o), u = o, P) : C(o) ? (l = S, W(o)) : z(o) ? (n.consume(o), S) : (n.consume(o), R);
+ }
+ function P(o) {
+ return o === u ? (n.consume(o), u = void 0, w) : o === null ? t(o) : C(o) ? (l = P, W(o)) : (n.consume(o), P);
+ }
+ function R(o) {
+ return o === null || o === 34 || o === 39 || o === 60 || o === 61 || o === 96 ? t(o) : o === 47 || o === 62 || Z(o) ? N(o) : (n.consume(o), R);
+ }
+ function w(o) {
+ return o === 47 || o === 62 || Z(o) ? N(o) : t(o);
+ }
+ function U(o) {
+ return o === 62 ? (n.consume(o), n.exit("htmlTextData"), n.exit("htmlText"), r) : t(o);
+ }
+ function W(o) {
+ return n.exit("htmlTextData"), n.enter("lineEnding"), n.consume(o), n.exit("lineEnding"), G;
+ }
+ function G(o) {
+ return z(o) ? O(
+ n,
+ en,
+ "linePrefix",
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
+ )(o) : en(o);
+ }
+ function en(o) {
+ return n.enter("htmlTextData"), l(o);
+ }
+}
+const Dn = {
+ name: "labelEnd",
+ tokenize: Ne,
+ resolveTo: He,
+ resolveAll: qe
+}, Me = {
+ tokenize: Ve
+}, je = {
+ tokenize: We
+}, Re = {
+ tokenize: Qe
+};
+function qe(n) {
+ let r = -1;
+ for (; ++r < n.length; ) {
+ const t = n[r][1];
+ (t.type === "labelImage" || t.type === "labelLink" || t.type === "labelEnd") && (n.splice(r + 1, t.type === "labelImage" ? 4 : 2), t.type = "data", r++);
+ }
+ return n;
+}
+function He(n, r) {
+ let t = n.length, e = 0, u, i, l, a;
+ for (; t--; )
+ if (u = n[t][1], i) {
+ if (u.type === "link" || u.type === "labelLink" && u._inactive)
+ break;
+ n[t][0] === "enter" && u.type === "labelLink" && (u._inactive = !0);
+ } else if (l) {
+ if (n[t][0] === "enter" && (u.type === "labelImage" || u.type === "labelLink") && !u._balanced && (i = t, u.type !== "labelLink")) {
+ e = 2;
+ break;
+ }
+ } else
+ u.type === "labelEnd" && (l = t);
+ const m = {
+ type: n[i][1].type === "labelLink" ? "link" : "image",
+ start: Object.assign({}, n[i][1].start),
+ end: Object.assign({}, n[n.length - 1][1].end)
+ }, c = {
+ type: "label",
+ start: Object.assign({}, n[i][1].start),
+ end: Object.assign({}, n[l][1].end)
+ }, p = {
+ type: "labelText",
+ start: Object.assign({}, n[i + e + 2][1].end),
+ end: Object.assign({}, n[l - 2][1].start)
+ };
+ return a = [
+ ["enter", m, r],
+ ["enter", c, r]
+ ], a = Y(a, n.slice(i + 1, i + e + 3)), a = Y(a, [["enter", p, r]]), a = Y(
+ a,
+ Ln(
+ r.parser.constructs.insideSpan.null,
+ n.slice(i + e + 4, l - 3),
+ r
+ )
+ ), a = Y(a, [
+ ["exit", p, r],
+ n[l - 2],
+ n[l - 1],
+ ["exit", c, r]
+ ]), a = Y(a, n.slice(l + 1)), a = Y(a, [["exit", m, r]]), tn(n, i, n.length, a), n;
+}
+function Ne(n, r, t) {
+ const e = this;
+ let u = e.events.length, i, l;
+ for (; u--; )
+ if ((e.events[u][1].type === "labelImage" || e.events[u][1].type === "labelLink") && !e.events[u][1]._balanced) {
+ i = e.events[u][1];
+ break;
+ }
+ return a;
+ function a(x) {
+ return i ? i._inactive ? f(x) : (l = e.parser.defined.includes(
+ xn(
+ e.sliceSerialize({
+ start: i.end,
+ end: e.now()
+ })
+ )
+ ), n.enter("labelEnd"), n.enter("labelMarker"), n.consume(x), n.exit("labelMarker"), n.exit("labelEnd"), m) : t(x);
+ }
+ function m(x) {
+ return x === 40 ? n.attempt(
+ Me,
+ p,
+ l ? p : f
+ )(x) : x === 91 ? n.attempt(
+ je,
+ p,
+ l ? c : f
+ )(x) : l ? p(x) : f(x);
+ }
+ function c(x) {
+ return n.attempt(
+ Re,
+ p,
+ f
+ )(x);
+ }
+ function p(x) {
+ return r(x);
+ }
+ function f(x) {
+ return i._balanced = !0, t(x);
+ }
+}
+function Ve(n, r, t) {
+ return e;
+ function e(f) {
+ return n.enter("resource"), n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), u;
+ }
+ function u(f) {
+ return Z(f) ? dn(n, i)(f) : i(f);
+ }
+ function i(f) {
+ return f === 41 ? p(f) : at(
+ n,
+ l,
+ a,
+ "resourceDestination",
+ "resourceDestinationLiteral",
+ "resourceDestinationLiteralMarker",
+ "resourceDestinationRaw",
+ "resourceDestinationString",
+ 32
+ )(f);
+ }
+ function l(f) {
+ return Z(f) ? dn(n, m)(f) : p(f);
+ }
+ function a(f) {
+ return t(f);
+ }
+ function m(f) {
+ return f === 34 || f === 39 || f === 40 ? st(
+ n,
+ c,
+ t,
+ "resourceTitle",
+ "resourceTitleMarker",
+ "resourceTitleString"
+ )(f) : p(f);
+ }
+ function c(f) {
+ return Z(f) ? dn(n, p)(f) : p(f);
+ }
+ function p(f) {
+ return f === 41 ? (n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), n.exit("resource"), r) : t(f);
+ }
+}
+function We(n, r, t) {
+ const e = this;
+ return u;
+ function u(a) {
+ return ot.call(
+ e,
+ n,
+ i,
+ l,
+ "reference",
+ "referenceMarker",
+ "referenceString"
+ )(a);
+ }
+ function i(a) {
+ return e.parser.defined.includes(
+ xn(
+ e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)
+ )
+ ) ? r(a) : t(a);
+ }
+ function l(a) {
+ return t(a);
+ }
+}
+function Qe(n, r, t) {
+ return e;
+ function e(i) {
+ return n.enter("reference"), n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), u;
+ }
+ function u(i) {
+ return i === 93 ? (n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), n.exit("reference"), r) : t(i);
+ }
+}
+const Ue = {
+ name: "labelStartImage",
+ tokenize: $e,
+ resolveAll: Dn.resolveAll
+};
+function $e(n, r, t) {
+ const e = this;
+ return u;
+ function u(a) {
+ return n.enter("labelImage"), n.enter("labelImageMarker"), n.consume(a), n.exit("labelImageMarker"), i;
+ }
+ function i(a) {
+ return a === 91 ? (n.enter("labelMarker"), n.consume(a), n.exit("labelMarker"), n.exit("labelImage"), l) : t(a);
+ }
+ function l(a) {
+ return a === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(a) : r(a);
+ }
+}
+const Ze = {
+ name: "labelStartLink",
+ tokenize: Ye,
+ resolveAll: Dn.resolveAll
+};
+function Ye(n, r, t) {
+ const e = this;
+ return u;
+ function u(l) {
+ return n.enter("labelLink"), n.enter("labelMarker"), n.consume(l), n.exit("labelMarker"), n.exit("labelLink"), i;
+ }
+ function i(l) {
+ return l === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(l) : r(l);
+ }
+}
+const wn = {
+ name: "lineEnding",
+ tokenize: Ge
+};
+function Ge(n, r) {
+ return t;
+ function t(e) {
+ return n.enter("lineEnding"), n.consume(e), n.exit("lineEnding"), O(n, r, "linePrefix");
+ }
+}
+const bn = {
+ name: "thematicBreak",
+ tokenize: Je
+};
+function Je(n, r, t) {
+ let e = 0, u;
+ return i;
+ function i(c) {
+ return n.enter("thematicBreak"), l(c);
+ }
+ function l(c) {
+ return u = c, a(c);
+ }
+ function a(c) {
+ return c === u ? (n.enter("thematicBreakSequence"), m(c)) : e >= 3 && (c === null || C(c)) ? (n.exit("thematicBreak"), r(c)) : t(c);
+ }
+ function m(c) {
+ return c === u ? (n.consume(c), e++, m) : (n.exit("thematicBreakSequence"), z(c) ? O(n, a, "whitespace")(c) : a(c));
+ }
+}
+const $ = {
+ name: "list",
+ tokenize: ve,
+ continuation: {
+ tokenize: nr
+ },
+ exit: er
+}, Ke = {
+ tokenize: rr,
+ partial: !0
+}, Xe = {
+ tokenize: tr,
+ partial: !0
+};
+function ve(n, r, t) {
+ const e = this, u = e.events[e.events.length - 1];
+ let i = u && u[1].type === "linePrefix" ? u[2].sliceSerialize(u[1], !0).length : 0, l = 0;
+ return a;
+ function a(h) {
+ const A = e.containerState.type || (h === 42 || h === 43 || h === 45 ? "listUnordered" : "listOrdered");
+ if (A === "listUnordered" ? !e.containerState.marker || h === e.containerState.marker : zn(h)) {
+ if (e.containerState.type || (e.containerState.type = A, n.enter(A, {
+ _container: !0
+ })), A === "listUnordered")
+ return n.enter("listItemPrefix"), h === 42 || h === 45 ? n.check(bn, t, c)(h) : c(h);
+ if (!e.interrupt || h === 49)
+ return n.enter("listItemPrefix"), n.enter("listItemValue"), m(h);
+ }
+ return t(h);
+ }
+ function m(h) {
+ return zn(h) && ++l < 10 ? (n.consume(h), m) : (!e.interrupt || l < 2) && (e.containerState.marker ? h === e.containerState.marker : h === 41 || h === 46) ? (n.exit("listItemValue"), c(h)) : t(h);
+ }
+ function c(h) {
+ return n.enter("listItemMarker"), n.consume(h), n.exit("listItemMarker"), e.containerState.marker = e.containerState.marker || h, n.check(
+ Sn,
+ // Can’t be empty when interrupting.
+ e.interrupt ? t : p,
+ n.attempt(
+ Ke,
+ x,
+ f
+ )
+ );
+ }
+ function p(h) {
+ return e.containerState.initialBlankLine = !0, i++, x(h);
+ }
+ function f(h) {
+ return z(h) ? (n.enter("listItemPrefixWhitespace"), n.consume(h), n.exit("listItemPrefixWhitespace"), x) : t(h);
+ }
+ function x(h) {
+ return e.containerState.size = i + e.sliceSerialize(n.exit("listItemPrefix"), !0).length, r(h);
+ }
+}
+function nr(n, r, t) {
+ const e = this;
+ return e.containerState._closeFlow = void 0, n.check(Sn, u, i);
+ function u(a) {
+ return e.containerState.furtherBlankLines = e.containerState.furtherBlankLines || e.containerState.initialBlankLine, O(
+ n,
+ r,
+ "listItemIndent",
+ e.containerState.size + 1
+ )(a);
+ }
+ function i(a) {
+ return e.containerState.furtherBlankLines || !z(a) ? (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, l(a)) : (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, n.attempt(Xe, r, l)(a));
+ }
+ function l(a) {
+ return e.containerState._closeFlow = !0, e.interrupt = void 0, O(
+ n,
+ n.attempt($, r, t),
+ "linePrefix",
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
+ )(a);
+ }
+}
+function tr(n, r, t) {
+ const e = this;
+ return O(
+ n,
+ u,
+ "listItemIndent",
+ e.containerState.size + 1
+ );
+ function u(i) {
+ const l = e.events[e.events.length - 1];
+ return l && l[1].type === "listItemIndent" && l[2].sliceSerialize(l[1], !0).length === e.containerState.size ? r(i) : t(i);
+ }
+}
+function er(n) {
+ n.exit(this.containerState.type);
+}
+function rr(n, r, t) {
+ const e = this;
+ return O(
+ n,
+ u,
+ "listItemPrefixWhitespace",
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1
+ );
+ function u(i) {
+ const l = e.events[e.events.length - 1];
+ return !z(i) && l && l[1].type === "listItemPrefixWhitespace" ? r(i) : t(i);
+ }
+}
+const Kn = {
+ name: "setextUnderline",
+ tokenize: ur,
+ resolveTo: ir
+};
+function ir(n, r) {
+ let t = n.length, e, u, i;
+ for (; t--; )
+ if (n[t][0] === "enter") {
+ if (n[t][1].type === "content") {
+ e = t;
+ break;
+ }
+ n[t][1].type === "paragraph" && (u = t);
+ } else
+ n[t][1].type === "content" && n.splice(t, 1), !i && n[t][1].type === "definition" && (i = t);
+ const l = {
+ type: "setextHeading",
+ start: Object.assign({}, n[u][1].start),
+ end: Object.assign({}, n[n.length - 1][1].end)
+ };
+ return n[u][1].type = "setextHeadingText", i ? (n.splice(u, 0, ["enter", l, r]), n.splice(i + 1, 0, ["exit", n[e][1], r]), n[e][1].end = Object.assign({}, n[i][1].end)) : n[e][1] = l, n.push(["exit", l, r]), n;
+}
+function ur(n, r, t) {
+ const e = this;
+ let u;
+ return i;
+ function i(c) {
+ let p = e.events.length, f;
+ for (; p--; )
+ if (e.events[p][1].type !== "lineEnding" && e.events[p][1].type !== "linePrefix" && e.events[p][1].type !== "content") {
+ f = e.events[p][1].type === "paragraph";
+ break;
+ }
+ return !e.parser.lazy[e.now().line] && (e.interrupt || f) ? (n.enter("setextHeadingLine"), u = c, l(c)) : t(c);
+ }
+ function l(c) {
+ return n.enter("setextHeadingLineSequence"), a(c);
+ }
+ function a(c) {
+ return c === u ? (n.consume(c), a) : (n.exit("setextHeadingLineSequence"), z(c) ? O(n, m, "lineSuffix")(c) : m(c));
+ }
+ function m(c) {
+ return c === null || C(c) ? (n.exit("setextHeadingLine"), r(c)) : t(c);
+ }
+}
+const lr = {
+ tokenize: ar
+};
+function ar(n) {
+ const r = this, t = n.attempt(
+ // Try to parse a blank line.
+ Sn,
+ e,
+ // Try to parse initial flow (essentially, only code).
+ n.attempt(
+ this.parser.constructs.flowInitial,
+ u,
+ O(
+ n,
+ n.attempt(
+ this.parser.constructs.flow,
+ u,
+ n.attempt(pe, u)
+ ),
+ "linePrefix"
+ )
+ )
+ );
+ return t;
+ function e(i) {
+ if (i === null) {
+ n.consume(i);
+ return;
+ }
+ return n.enter("lineEndingBlank"), n.consume(i), n.exit("lineEndingBlank"), r.currentConstruct = void 0, t;
+ }
+ function u(i) {
+ if (i === null) {
+ n.consume(i);
+ return;
+ }
+ return n.enter("lineEnding"), n.consume(i), n.exit("lineEnding"), r.currentConstruct = void 0, t;
+ }
+}
+const or = {
+ resolveAll: ht()
+}, sr = ct("string"), cr = ct("text");
+function ct(n) {
+ return {
+ tokenize: r,
+ resolveAll: ht(
+ n === "text" ? hr : void 0
+ )
+ };
+ function r(t) {
+ const e = this, u = this.parser.constructs[n], i = t.attempt(u, l, a);
+ return l;
+ function l(p) {
+ return c(p) ? i(p) : a(p);
+ }
+ function a(p) {
+ if (p === null) {
+ t.consume(p);
+ return;
+ }
+ return t.enter("data"), t.consume(p), m;
+ }
+ function m(p) {
+ return c(p) ? (t.exit("data"), i(p)) : (t.consume(p), m);
+ }
+ function c(p) {
+ if (p === null)
+ return !0;
+ const f = u[p];
+ let x = -1;
+ if (f)
+ for (; ++x < f.length; ) {
+ const h = f[x];
+ if (!h.previous || h.previous.call(e, e.previous))
+ return !0;
+ }
+ return !1;
+ }
+ }
+}
+function ht(n) {
+ return r;
+ function r(t, e) {
+ let u = -1, i;
+ for (; ++u <= t.length; )
+ i === void 0 ? t[u] && t[u][1].type === "data" && (i = u, u++) : (!t[u] || t[u][1].type !== "data") && (u !== i + 2 && (t[i][1].end = t[u - 1][1].end, t.splice(i + 2, u - i - 2), u = i + 2), i = void 0);
+ return n ? n(t, e) : t;
+ }
+}
+function hr(n, r) {
+ let t = 0;
+ for (; ++t <= n.length; )
+ if ((t === n.length || n[t][1].type === "lineEnding") && n[t - 1][1].type === "data") {
+ const e = n[t - 1][1], u = r.sliceStream(e);
+ let i = u.length, l = -1, a = 0, m;
+ for (; i--; ) {
+ const c = u[i];
+ if (typeof c == "string") {
+ for (l = c.length; c.charCodeAt(l - 1) === 32; )
+ a++, l--;
+ if (l)
+ break;
+ l = -1;
+ } else if (c === -2)
+ m = !0, a++;
+ else if (c !== -1) {
+ i++;
+ break;
+ }
+ }
+ if (a) {
+ const c = {
+ type: t === n.length || m || a < 2 ? "lineSuffix" : "hardBreakTrailing",
+ start: {
+ line: e.end.line,
+ column: e.end.column - a,
+ offset: e.end.offset - a,
+ _index: e.start._index + i,
+ _bufferIndex: i ? l : e.start._bufferIndex + l
+ },
+ end: Object.assign({}, e.end)
+ };
+ e.end = Object.assign({}, c.start), e.start.offset === e.end.offset ? Object.assign(e, c) : (n.splice(
+ t,
+ 0,
+ ["enter", c, r],
+ ["exit", c, r]
+ ), t += 2);
+ }
+ t++;
+ }
+ return n;
+}
+function pr(n, r, t) {
+ let e = Object.assign(
+ t ? Object.assign({}, t) : {
+ line: 1,
+ column: 1,
+ offset: 0
+ },
+ {
+ _index: 0,
+ _bufferIndex: -1
+ }
+ );
+ const u = {}, i = [];
+ let l = [], a = [];
+ const m = {
+ consume: j,
+ enter: F,
+ exit: D,
+ attempt: T(_),
+ check: T(k),
+ interrupt: T(k, {
+ interrupt: !0
+ })
+ }, c = {
+ previous: null,
+ code: null,
+ containerState: {},
+ events: [],
+ parser: n,
+ sliceStream: h,
+ sliceSerialize: x,
+ now: A,
+ defineSkip: I,
+ write: f
+ };
+ let p = r.tokenize.call(c, m);
+ return r.resolveAll && i.push(r), c;
+ function f(y) {
+ return l = Y(l, y), M(), l[l.length - 1] !== null ? [] : (H(r, 0), c.events = Ln(i, c.events, c), c.events);
+ }
+ function x(y, S) {
+ return mr(h(y), S);
+ }
+ function h(y) {
+ return fr(l, y);
+ }
+ function A() {
+ const { line: y, column: S, offset: P, _index: R, _bufferIndex: w } = e;
+ return {
+ line: y,
+ column: S,
+ offset: P,
+ _index: R,
+ _bufferIndex: w
+ };
+ }
+ function I(y) {
+ u[y.line] = y.column, V();
+ }
+ function M() {
+ let y;
+ for (; e._index < l.length; ) {
+ const S = l[e._index];
+ if (typeof S == "string")
+ for (y = e._index, e._bufferIndex < 0 && (e._bufferIndex = 0); e._index === y && e._bufferIndex < S.length; )
+ b(S.charCodeAt(e._bufferIndex));
+ else
+ b(S);
+ }
+ }
+ function b(y) {
+ p = p(y);
+ }
+ function j(y) {
+ C(y) ? (e.line++, e.column = 1, e.offset += y === -3 ? 2 : 1, V()) : y !== -1 && (e.column++, e.offset++), e._bufferIndex < 0 ? e._index++ : (e._bufferIndex++, e._bufferIndex === l[e._index].length && (e._bufferIndex = -1, e._index++)), c.previous = y;
+ }
+ function F(y, S) {
+ const P = S || {};
+ return P.type = y, P.start = A(), c.events.push(["enter", P, c]), a.push(P), P;
+ }
+ function D(y) {
+ const S = a.pop();
+ return S.end = A(), c.events.push(["exit", S, c]), S;
+ }
+ function _(y, S) {
+ H(y, S.from);
+ }
+ function k(y, S) {
+ S.restore();
+ }
+ function T(y, S) {
+ return P;
+ function P(R, w, U) {
+ let W, G, en, o;
+ return Array.isArray(R) ? rn(R) : "tokenize" in R ? (
+ // @ts-expect-error Looks like a construct.
+ rn([R])
+ ) : J(R);
+ function J(Q) {
+ return pn;
+ function pn(an) {
+ const fn = an !== null && Q[an], mn = an !== null && Q.null, Fn = [
+ // To do: add more extension tests.
+ /* c8 ignore next 2 */
+ ...Array.isArray(fn) ? fn : fn ? [fn] : [],
+ ...Array.isArray(mn) ? mn : mn ? [mn] : []
+ ];
+ return rn(Fn)(an);
+ }
+ }
+ function rn(Q) {
+ return W = Q, G = 0, Q.length === 0 ? U : s(Q[G]);
+ }
+ function s(Q) {
+ return pn;
+ function pn(an) {
+ return o = N(), en = Q, Q.partial || (c.currentConstruct = Q), Q.name && c.parser.constructs.disable.null.includes(Q.name) ? hn() : Q.tokenize.call(
+ // If we do have fields, create an object w/ `context` as its
+ // prototype.
+ // This allows a “live binding”, which is needed for `interrupt`.
+ S ? Object.assign(Object.create(c), S) : c,
+ m,
+ K,
+ hn
+ )(an);
+ }
+ }
+ function K(Q) {
+ return y(en, o), w;
+ }
+ function hn(Q) {
+ return o.restore(), ++G < W.length ? s(W[G]) : U;
+ }
+ }
+ }
+ function H(y, S) {
+ y.resolveAll && !i.includes(y) && i.push(y), y.resolve && tn(
+ c.events,
+ S,
+ c.events.length - S,
+ y.resolve(c.events.slice(S), c)
+ ), y.resolveTo && (c.events = y.resolveTo(c.events, c));
+ }
+ function N() {
+ const y = A(), S = c.previous, P = c.currentConstruct, R = c.events.length, w = Array.from(a);
+ return {
+ restore: U,
+ from: R
+ };
+ function U() {
+ e = y, c.previous = S, c.currentConstruct = P, c.events.length = R, a = w, V();
+ }
+ }
+ function V() {
+ e.line in u && e.column < 2 && (e.column = u[e.line], e.offset += u[e.line] - 1);
+ }
+}
+function fr(n, r) {
+ const t = r.start._index, e = r.start._bufferIndex, u = r.end._index, i = r.end._bufferIndex;
+ let l;
+ if (t === u)
+ l = [n[t].slice(e, i)];
+ else {
+ if (l = n.slice(t, u), e > -1) {
+ const a = l[0];
+ typeof a == "string" ? l[0] = a.slice(e) : l.shift();
+ }
+ i > 0 && l.push(n[u].slice(0, i));
+ }
+ return l;
+}
+function mr(n, r) {
+ let t = -1;
+ const e = [];
+ let u;
+ for (; ++t < n.length; ) {
+ const i = n[t];
+ let l;
+ if (typeof i == "string")
+ l = i;
+ else
+ switch (i) {
+ case -5: {
+ l = "\r";
+ break;
+ }
+ case -4: {
+ l = `
+`;
+ break;
+ }
+ case -3: {
+ l = `\r
+`;
+ break;
+ }
+ case -2: {
+ l = r ? " " : " ";
+ break;
+ }
+ case -1: {
+ if (!r && u)
+ continue;
+ l = " ";
+ break;
+ }
+ default:
+ l = String.fromCharCode(i);
+ }
+ u = i === -2, e.push(l);
+ }
+ return e.join("");
+}
+const xr = {
+ 42: $,
+ 43: $,
+ 45: $,
+ 48: $,
+ 49: $,
+ 50: $,
+ 51: $,
+ 52: $,
+ 53: $,
+ 54: $,
+ 55: $,
+ 56: $,
+ 57: $,
+ 62: rt
+}, gr = {
+ 91: ke
+}, kr = {
+ [-2]: Cn,
+ [-1]: Cn,
+ 32: Cn
+}, dr = {
+ 35: Ee,
+ 42: bn,
+ 45: [Kn, bn],
+ 60: ze,
+ 61: Kn,
+ 95: bn,
+ 96: Gn,
+ 126: Gn
+}, br = {
+ 38: ut,
+ 92: it
+}, yr = {
+ [-5]: wn,
+ [-4]: wn,
+ [-3]: wn,
+ 33: Ue,
+ 38: ut,
+ 42: In,
+ 60: [Yt, Pe],
+ 91: Ze,
+ 92: [Se, it],
+ 93: Dn,
+ 95: In,
+ 96: ae
+}, Sr = {
+ null: [In, or]
+}, Fr = {
+ null: [42, 95]
+}, Er = {
+ null: []
+}, Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
+ __proto__: null,
+ attentionMarkers: Fr,
+ contentInitial: gr,
+ disable: Er,
+ document: xr,
+ flow: dr,
+ flowInitial: kr,
+ insideSpan: Sr,
+ string: br,
+ text: yr
+}, Symbol.toStringTag, { value: "Module" }));
+function wr(n) {
+ const t = (
+ /** @type {FullNormalizedExtension} */
+ Ot([Cr, ...(n || {}).extensions || []])
+ ), e = {
+ defined: [],
+ lazy: {},
+ constructs: t,
+ content: u(Nt),
+ document: u(Wt),
+ flow: u(lr),
+ string: u(sr),
+ text: u(cr)
+ };
+ return e;
+ function u(i) {
+ return l;
+ function l(a) {
+ return pr(e, i, a);
+ }
+ }
+}
+const Xn = /[\0\t\n\r]/g;
+function Ar() {
+ let n = 1, r = "", t = !0, e;
+ return u;
+ function u(i, l, a) {
+ const m = [];
+ let c, p, f, x, h;
+ for (i = r + i.toString(l), f = 0, r = "", t && (i.charCodeAt(0) === 65279 && f++, t = void 0); f < i.length; ) {
+ if (Xn.lastIndex = f, c = Xn.exec(i), x = c && c.index !== void 0 ? c.index : i.length, h = i.charCodeAt(x), !c) {
+ r = i.slice(f);
+ break;
+ }
+ if (h === 10 && f === x && e)
+ m.push(-3), e = void 0;
+ else
+ switch (e && (m.push(-5), e = void 0), f < x && (m.push(i.slice(f, x)), n += x - f), h) {
+ case 0: {
+ m.push(65533), n++;
+ break;
+ }
+ case 9: {
+ for (p = Math.ceil(n / 4) * 4, m.push(-2); n++ < p; )
+ m.push(-1);
+ break;
+ }
+ case 10: {
+ m.push(-4), n = 1;
+ break;
+ }
+ default:
+ e = !0, n = 1;
+ }
+ f = x + 1;
+ }
+ return a && (e && m.push(-5), r && m.push(r), m.push(null)), m;
+ }
+}
+function zr(n) {
+ for (; !lt(n); )
+ ;
+ return n;
+}
+function pt(n, r) {
+ const t = Number.parseInt(n, r);
+ return (
+ // C0 except for HT, LF, FF, CR, space.
+ t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of C0, and C1 controls.
+ t > 126 && t < 160 || // Lone high surrogates and low surrogates.
+ t > 55295 && t < 57344 || // Noncharacters.
+ t > 64975 && t < 65008 || (t & 65535) === 65535 || (t & 65535) === 65534 || // Out of range
+ t > 1114111 ? "�" : String.fromCharCode(t)
+ );
+}
+const Ir = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
+function Tr(n) {
+ return n.replace(Ir, Br);
+}
+function Br(n, r, t) {
+ if (r)
+ return r;
+ if (t.charCodeAt(0) === 35) {
+ const u = t.charCodeAt(1), i = u === 120 || u === 88;
+ return pt(t.slice(i ? 2 : 1), i ? 16 : 10);
+ }
+ return On(t) || n;
+}
+function yn(n) {
+ return !n || typeof n != "object" ? "" : "position" in n || "type" in n ? vn(n.position) : "start" in n || "end" in n ? vn(n) : "line" in n || "column" in n ? Tn(n) : "";
+}
+function Tn(n) {
+ return nt(n && n.line) + ":" + nt(n && n.column);
+}
+function vn(n) {
+ return Tn(n && n.start) + "-" + Tn(n && n.end);
+}
+function nt(n) {
+ return n && typeof n == "number" ? n : 1;
+}
+const ft = {}.hasOwnProperty, mt = (
+ /**
+ * @type {(
+ * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &
+ * ((value: Value, options?: Options | null | undefined) => Root)
+ * )}
+ */
+ /**
+ * @param {Value} value
+ * @param {Encoding | Options | null | undefined} [encoding]
+ * @param {Options | null | undefined} [options]
+ * @returns {Root}
+ */
+ function(n, r, t) {
+ return typeof r != "string" && (t = r, r = void 0), Lr(t)(
+ zr(
+ wr(t).document().write(Ar()(n, r, !0))
+ )
+ );
+ }
+);
+function Lr(n) {
+ const r = {
+ transforms: [],
+ canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
+ enter: {
+ autolink: a(Hn),
+ autolinkProtocol: y,
+ autolinkEmail: y,
+ atxHeading: a(jn),
+ blockQuote: a(Fn),
+ characterEscape: y,
+ characterReference: y,
+ codeFenced: a(Mn),
+ codeFencedFenceInfo: m,
+ codeFencedFenceMeta: m,
+ codeIndented: a(Mn, m),
+ codeText: a(kt, m),
+ codeTextData: y,
+ data: y,
+ codeFlowValue: y,
+ definition: a(dt),
+ definitionDestinationString: m,
+ definitionLabelString: m,
+ definitionTitleString: m,
+ emphasis: a(bt),
+ hardBreakEscape: a(Rn),
+ hardBreakTrailing: a(Rn),
+ htmlFlow: a(qn, m),
+ htmlFlowData: y,
+ htmlText: a(qn, m),
+ htmlTextData: y,
+ image: a(yt),
+ label: m,
+ link: a(Hn),
+ listItem: a(St),
+ listItemValue: A,
+ listOrdered: a(Nn, h),
+ listUnordered: a(Nn),
+ paragraph: a(Ft),
+ reference: hn,
+ referenceString: m,
+ resourceDestinationString: m,
+ resourceTitleString: m,
+ setextHeading: a(jn),
+ strong: a(Et),
+ thematicBreak: a(wt)
+ },
+ exit: {
+ atxHeading: p(),
+ atxHeadingSequence: T,
+ autolink: p(),
+ autolinkEmail: mn,
+ autolinkProtocol: fn,
+ blockQuote: p(),
+ characterEscapeValue: S,
+ characterReferenceMarkerHexadecimal: pn,
+ characterReferenceMarkerNumeric: pn,
+ characterReferenceValue: an,
+ codeFenced: p(j),
+ codeFencedFence: b,
+ codeFencedFenceInfo: I,
+ codeFencedFenceMeta: M,
+ codeFlowValue: S,
+ codeIndented: p(F),
+ codeText: p(W),
+ codeTextData: S,
+ data: S,
+ definition: p(),
+ definitionDestinationString: k,
+ definitionLabelString: D,
+ definitionTitleString: _,
+ emphasis: p(),
+ hardBreakEscape: p(R),
+ hardBreakTrailing: p(R),
+ htmlFlow: p(w),
+ htmlFlowData: S,
+ htmlText: p(U),
+ htmlTextData: S,
+ image: p(en),
+ label: J,
+ labelText: o,
+ lineEnding: P,
+ link: p(G),
+ listItem: p(),
+ listOrdered: p(),
+ listUnordered: p(),
+ paragraph: p(),
+ referenceString: Q,
+ resourceDestinationString: rn,
+ resourceTitleString: s,
+ resource: K,
+ setextHeading: p(V),
+ setextHeadingLineSequence: N,
+ setextHeadingText: H,
+ strong: p(),
+ thematicBreak: p()
+ }
+ };
+ xt(r, (n || {}).mdastExtensions || []);
+ const t = {};
+ return e;
+ function e(g) {
+ let d = {
+ type: "root",
+ children: []
+ };
+ const E = {
+ stack: [d],
+ tokenStack: [],
+ config: r,
+ enter: c,
+ exit: f,
+ buffer: m,
+ resume: x,
+ setData: i,
+ getData: l
+ }, B = [];
+ let L = -1;
+ for (; ++L < g.length; )
+ if (g[L][1].type === "listOrdered" || g[L][1].type === "listUnordered")
+ if (g[L][0] === "enter")
+ B.push(L);
+ else {
+ const X = B.pop();
+ L = u(g, X, L);
+ }
+ for (L = -1; ++L < g.length; ) {
+ const X = r[g[L][0]];
+ ft.call(X, g[L][1].type) && X[g[L][1].type].call(
+ Object.assign(
+ {
+ sliceSerialize: g[L][2].sliceSerialize
+ },
+ E
+ ),
+ g[L][1]
+ );
+ }
+ if (E.tokenStack.length > 0) {
+ const X = E.tokenStack[E.tokenStack.length - 1];
+ (X[1] || tt).call(E, void 0, X[0]);
+ }
+ for (d.position = {
+ start: sn(
+ g.length > 0 ? g[0][1].start : {
+ line: 1,
+ column: 1,
+ offset: 0
+ }
+ ),
+ end: sn(
+ g.length > 0 ? g[g.length - 2][1].end : {
+ line: 1,
+ column: 1,
+ offset: 0
+ }
+ )
+ }, L = -1; ++L < r.transforms.length; )
+ d = r.transforms[L](d) || d;
+ return d;
+ }
+ function u(g, d, E) {
+ let B = d - 1, L = -1, X = !1, on, un, gn, kn;
+ for (; ++B <= E; ) {
+ const q = g[B];
+ if (q[1].type === "listUnordered" || q[1].type === "listOrdered" || q[1].type === "blockQuote" ? (q[0] === "enter" ? L++ : L--, kn = void 0) : q[1].type === "lineEndingBlank" ? q[0] === "enter" && (on && !kn && !L && !gn && (gn = B), kn = void 0) : q[1].type === "linePrefix" || q[1].type === "listItemValue" || q[1].type === "listItemMarker" || q[1].type === "listItemPrefix" || q[1].type === "listItemPrefixWhitespace" || (kn = void 0), !L && q[0] === "enter" && q[1].type === "listItemPrefix" || L === -1 && q[0] === "exit" && (q[1].type === "listUnordered" || q[1].type === "listOrdered")) {
+ if (on) {
+ let En = B;
+ for (un = void 0; En--; ) {
+ const ln = g[En];
+ if (ln[1].type === "lineEnding" || ln[1].type === "lineEndingBlank") {
+ if (ln[0] === "exit")
+ continue;
+ un && (g[un][1].type = "lineEndingBlank", X = !0), ln[1].type = "lineEnding", un = En;
+ } else if (!(ln[1].type === "linePrefix" || ln[1].type === "blockQuotePrefix" || ln[1].type === "blockQuotePrefixWhitespace" || ln[1].type === "blockQuoteMarker" || ln[1].type === "listItemIndent"))
+ break;
+ }
+ gn && (!un || gn < un) && (on._spread = !0), on.end = Object.assign(
+ {},
+ un ? g[un][1].start : q[1].end
+ ), g.splice(un || B, 0, ["exit", on, q[2]]), B++, E++;
+ }
+ q[1].type === "listItemPrefix" && (on = {
+ type: "listItem",
+ _spread: !1,
+ start: Object.assign({}, q[1].start),
+ // @ts-expect-error: we’ll add `end` in a second.
+ end: void 0
+ }, g.splice(B, 0, ["enter", on, q[2]]), B++, E++, gn = void 0, kn = !0);
+ }
+ }
+ return g[d][1]._spread = X, E;
+ }
+ function i(g, d) {
+ t[g] = d;
+ }
+ function l(g) {
+ return t[g];
+ }
+ function a(g, d) {
+ return E;
+ function E(B) {
+ c.call(this, g(B), B), d && d.call(this, B);
+ }
+ }
+ function m() {
+ this.stack.push({
+ type: "fragment",
+ children: []
+ });
+ }
+ function c(g, d, E) {
+ return this.stack[this.stack.length - 1].children.push(g), this.stack.push(g), this.tokenStack.push([d, E]), g.position = {
+ start: sn(d.start)
+ }, g;
+ }
+ function p(g) {
+ return d;
+ function d(E) {
+ g && g.call(this, E), f.call(this, E);
+ }
+ }
+ function f(g, d) {
+ const E = this.stack.pop(), B = this.tokenStack.pop();
+ if (B)
+ B[0].type !== g.type && (d ? d.call(this, g, B[0]) : (B[1] || tt).call(this, g, B[0]));
+ else
+ throw new Error(
+ "Cannot close `" + g.type + "` (" + yn({
+ start: g.start,
+ end: g.end
+ }) + "): it’s not open"
+ );
+ return E.position.end = sn(g.end), E;
+ }
+ function x() {
+ return Bt(this.stack.pop());
+ }
+ function h() {
+ i("expectingFirstListItemValue", !0);
+ }
+ function A(g) {
+ if (l("expectingFirstListItemValue")) {
+ const d = this.stack[this.stack.length - 2];
+ d.start = Number.parseInt(this.sliceSerialize(g), 10), i("expectingFirstListItemValue");
+ }
+ }
+ function I() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.lang = g;
+ }
+ function M() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.meta = g;
+ }
+ function b() {
+ l("flowCodeInside") || (this.buffer(), i("flowCodeInside", !0));
+ }
+ function j() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.value = g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), i("flowCodeInside");
+ }
+ function F() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.value = g.replace(/(\r?\n|\r)$/g, "");
+ }
+ function D(g) {
+ const d = this.resume(), E = this.stack[this.stack.length - 1];
+ E.label = d, E.identifier = xn(
+ this.sliceSerialize(g)
+ ).toLowerCase();
+ }
+ function _() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.title = g;
+ }
+ function k() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.url = g;
+ }
+ function T(g) {
+ const d = this.stack[this.stack.length - 1];
+ if (!d.depth) {
+ const E = this.sliceSerialize(g).length;
+ d.depth = E;
+ }
+ }
+ function H() {
+ i("setextHeadingSlurpLineEnding", !0);
+ }
+ function N(g) {
+ const d = this.stack[this.stack.length - 1];
+ d.depth = this.sliceSerialize(g).charCodeAt(0) === 61 ? 1 : 2;
+ }
+ function V() {
+ i("setextHeadingSlurpLineEnding");
+ }
+ function y(g) {
+ const d = this.stack[this.stack.length - 1];
+ let E = d.children[d.children.length - 1];
+ (!E || E.type !== "text") && (E = Ct(), E.position = {
+ start: sn(g.start)
+ }, d.children.push(E)), this.stack.push(E);
+ }
+ function S(g) {
+ const d = this.stack.pop();
+ d.value += this.sliceSerialize(g), d.position.end = sn(g.end);
+ }
+ function P(g) {
+ const d = this.stack[this.stack.length - 1];
+ if (l("atHardBreak")) {
+ const E = d.children[d.children.length - 1];
+ E.position.end = sn(g.end), i("atHardBreak");
+ return;
+ }
+ !l("setextHeadingSlurpLineEnding") && r.canContainEols.includes(d.type) && (y.call(this, g), S.call(this, g));
+ }
+ function R() {
+ i("atHardBreak", !0);
+ }
+ function w() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.value = g;
+ }
+ function U() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.value = g;
+ }
+ function W() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.value = g;
+ }
+ function G() {
+ const g = this.stack[this.stack.length - 1];
+ if (l("inReference")) {
+ const d = l("referenceType") || "shortcut";
+ g.type += "Reference", g.referenceType = d, delete g.url, delete g.title;
+ } else
+ delete g.identifier, delete g.label;
+ i("referenceType");
+ }
+ function en() {
+ const g = this.stack[this.stack.length - 1];
+ if (l("inReference")) {
+ const d = l("referenceType") || "shortcut";
+ g.type += "Reference", g.referenceType = d, delete g.url, delete g.title;
+ } else
+ delete g.identifier, delete g.label;
+ i("referenceType");
+ }
+ function o(g) {
+ const d = this.sliceSerialize(g), E = this.stack[this.stack.length - 2];
+ E.label = Tr(d), E.identifier = xn(d).toLowerCase();
+ }
+ function J() {
+ const g = this.stack[this.stack.length - 1], d = this.resume(), E = this.stack[this.stack.length - 1];
+ if (i("inReference", !0), E.type === "link") {
+ const B = g.children;
+ E.children = B;
+ } else
+ E.alt = d;
+ }
+ function rn() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.url = g;
+ }
+ function s() {
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
+ d.title = g;
+ }
+ function K() {
+ i("inReference");
+ }
+ function hn() {
+ i("referenceType", "collapsed");
+ }
+ function Q(g) {
+ const d = this.resume(), E = this.stack[this.stack.length - 1];
+ E.label = d, E.identifier = xn(
+ this.sliceSerialize(g)
+ ).toLowerCase(), i("referenceType", "full");
+ }
+ function pn(g) {
+ i("characterReferenceType", g.type);
+ }
+ function an(g) {
+ const d = this.sliceSerialize(g), E = l("characterReferenceType");
+ let B;
+ E ? (B = pt(
+ d,
+ E === "characterReferenceMarkerNumeric" ? 10 : 16
+ ), i("characterReferenceType")) : B = On(d);
+ const L = this.stack.pop();
+ L.value += B, L.position.end = sn(g.end);
+ }
+ function fn(g) {
+ S.call(this, g);
+ const d = this.stack[this.stack.length - 1];
+ d.url = this.sliceSerialize(g);
+ }
+ function mn(g) {
+ S.call(this, g);
+ const d = this.stack[this.stack.length - 1];
+ d.url = "mailto:" + this.sliceSerialize(g);
+ }
+ function Fn() {
+ return {
+ type: "blockquote",
+ children: []
+ };
+ }
+ function Mn() {
+ return {
+ type: "code",
+ lang: null,
+ meta: null,
+ value: ""
+ };
+ }
+ function kt() {
+ return {
+ type: "inlineCode",
+ value: ""
+ };
+ }
+ function dt() {
+ return {
+ type: "definition",
+ identifier: "",
+ label: null,
+ title: null,
+ url: ""
+ };
+ }
+ function bt() {
+ return {
+ type: "emphasis",
+ children: []
+ };
+ }
+ function jn() {
+ return {
+ type: "heading",
+ depth: void 0,
+ children: []
+ };
+ }
+ function Rn() {
+ return {
+ type: "break"
+ };
+ }
+ function qn() {
+ return {
+ type: "html",
+ value: ""
+ };
+ }
+ function yt() {
+ return {
+ type: "image",
+ title: null,
+ url: "",
+ alt: null
+ };
+ }
+ function Hn() {
+ return {
+ type: "link",
+ title: null,
+ url: "",
+ children: []
+ };
+ }
+ function Nn(g) {
+ return {
+ type: "list",
+ ordered: g.type === "listOrdered",
+ start: null,
+ spread: g._spread,
+ children: []
+ };
+ }
+ function St(g) {
+ return {
+ type: "listItem",
+ spread: g._spread,
+ checked: null,
+ children: []
+ };
+ }
+ function Ft() {
+ return {
+ type: "paragraph",
+ children: []
+ };
+ }
+ function Et() {
+ return {
+ type: "strong",
+ children: []
+ };
+ }
+ function Ct() {
+ return {
+ type: "text",
+ value: ""
+ };
+ }
+ function wt() {
+ return {
+ type: "thematicBreak"
+ };
+ }
+}
+function sn(n) {
+ return {
+ line: n.line,
+ column: n.column,
+ offset: n.offset
+ };
+}
+function xt(n, r) {
+ let t = -1;
+ for (; ++t < r.length; ) {
+ const e = r[t];
+ Array.isArray(e) ? xt(n, e) : Or(n, e);
+ }
+}
+function Or(n, r) {
+ let t;
+ for (t in r)
+ if (ft.call(r, t)) {
+ if (t === "canContainEols") {
+ const e = r[t];
+ e && n[t].push(...e);
+ } else if (t === "transforms") {
+ const e = r[t];
+ e && n[t].push(...e);
+ } else if (t === "enter" || t === "exit") {
+ const e = r[t];
+ e && Object.assign(n[t], e);
+ }
+ }
+}
+function tt(n, r) {
+ throw n ? new Error(
+ "Cannot close `" + n.type + "` (" + yn({
+ start: n.start,
+ end: n.end
+ }) + "): a different token (`" + r.type + "`, " + yn({
+ start: r.start,
+ end: r.end
+ }) + ") is open"
+ ) : new Error(
+ "Cannot close document, a token (`" + r.type + "`, " + yn({
+ start: r.start,
+ end: r.end
+ }) + ") is still open"
+ );
+}
+function Dr(n) {
+ const r = n.replace(/\n{2,}/g, `
+`);
+ return At(r);
+}
+function Pr(n) {
+ const r = Dr(n), { children: t } = mt(r), e = [[]];
+ let u = 0;
+ function i(l, a = "normal") {
+ l.type === "text" ? l.value.split(`
+`).forEach((c, p) => {
+ p !== 0 && (u++, e.push([])), c.split(" ").forEach((f) => {
+ f && e[u].push({ content: f, type: a });
+ });
+ }) : (l.type === "strong" || l.type === "emphasis") && l.children.forEach((m) => {
+ i(m, l.type);
+ });
+ }
+ return t.forEach((l) => {
+ l.type === "paragraph" && l.children.forEach((a) => {
+ i(a);
+ });
+ }), e;
+}
+function _r(n) {
+ const { children: r } = mt(n);
+ function t(e) {
+ return e.type === "text" ? e.value.replace(/\n/g, "
") : e.type === "strong" ? `${e.children.map(t).join("")}` : e.type === "emphasis" ? `${e.children.map(t).join("")}` : e.type === "paragraph" ? `
${e.children.map(t).join("")}
` : `Unsupported markdown: ${e.type}`; + } + return r.map(t).join(""); +} +function Mr(n) { + return Intl.Segmenter ? [...new Intl.Segmenter().segment(n)].map((r) => r.segment) : [...n]; +} +function jr(n, r) { + const t = Mr(r.content); + return gt(n, [], t, r.type); +} +function gt(n, r, t, e) { + if (t.length === 0) + return [ + { content: r.join(""), type: e }, + { content: "", type: e } + ]; + const [u, ...i] = t, l = [...r, u]; + return n([{ content: l.join(""), type: e }]) ? gt(n, l, i, e) : (r.length === 0 && u && (r.push(u), t.shift()), [ + { content: r.join(""), type: e }, + { content: t.join(""), type: e } + ]); +} +function Rr(n, r) { + if (n.some(({ content: t }) => t.includes(` +`))) + throw new Error("splitLineToFitWidth does not support newlines in the line"); + return Bn(n, r); +} +function Bn(n, r, t = [], e = []) { + if (n.length === 0) + return e.length > 0 && t.push(e), t.length > 0 ? t : []; + let u = ""; + n[0].content === " " && (u = " ", n.shift()); + const i = n.shift() ?? { content: " ", type: "normal" }, l = [...e]; + if (u !== "" && l.push({ content: u, type: "normal" }), l.push(i), r(l)) + return Bn(n, r, t, l); + if (e.length > 0) + t.push(e), n.unshift(i); + else if (i.content) { + const [a, m] = jr(r, i); + t.push([a]), m.content && n.unshift(m); + } + return Bn(n, r, t); +} +function qr(n, r) { + r && n.attr("style", r); +} +function Hr(n, r, t, e, u = !1) { + const i = n.append("foreignObject"), l = i.append("xhtml:div"), a = r.label, m = r.isNode ? "nodeLabel" : "edgeLabel"; + l.html( + ` + " + a + "" + ), qr(l, r.labelStyle), l.style("display", "table-cell"), l.style("white-space", "nowrap"), l.style("max-width", t + "px"), l.attr("xmlns", "http://www.w3.org/1999/xhtml"), u && l.attr("class", "labelBkg"); + let c = l.node().getBoundingClientRect(); + return c.width === t && (l.style("display", "table"), l.style("white-space", "break-spaces"), l.style("width", t + "px"), c = l.node().getBoundingClientRect()), i.style("width", c.width), i.style("height", c.height), i.node(); +} +function Pn(n, r, t) { + return n.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", r * t - 0.1 + "em").attr("dy", t + "em"); +} +function Nr(n, r, t) { + const e = n.append("text"), u = Pn(e, 1, r); + _n(u, t); + const i = u.node().getComputedTextLength(); + return e.remove(), i; +} +function Qr(n, r, t) { + var l; + const e = n.append("text"), u = Pn(e, 1, r); + _n(u, [{ content: t, type: "normal" }]); + const i = (l = u.node()) == null ? void 0 : l.getBoundingClientRect(); + return i && e.remove(), i; +} +function Vr(n, r, t, e = !1) { + const i = r.append("g"), l = i.insert("rect").attr("class", "background"), a = i.append("text").attr("y", "-10.1"); + let m = 0; + for (const c of t) { + const p = (x) => Nr(i, 1.1, x) <= n, f = p(c) ? [c] : Rr(c, p); + for (const x of f) { + const h = Pn(a, m, 1.1); + _n(h, x), m++; + } + } + if (e) { + const c = a.node().getBBox(), p = 2; + return l.attr("x", -p).attr("y", -p).attr("width", c.width + 2 * p).attr("height", c.height + 2 * p), i.node(); + } else + return a.node(); +} +function _n(n, r) { + n.text(""), r.forEach((t, e) => { + const u = n.append("tspan").attr("font-style", t.type === "emphasis" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal"); + e === 0 ? u.text(t.content) : u.text(" " + t.content); + }); +} +const Ur = (n, r = "", { + style: t = "", + isTitle: e = !1, + classes: u = "", + useHtmlLabels: i = !0, + isNode: l = !0, + width: a = 200, + addSvgBackground: m = !1 +} = {}) => { + if (zt.info("createText", r, t, e, u, i, l, m), i) { + const c = _r(r), p = { + isNode: l, + label: It(c).replace( + /fa[blrs]?:fa-[\w-]+/g, + // cspell: disable-line + (x) => `` + ), + labelStyle: t.replace("fill:", "color:") + }; + return Hr(n, p, a, u, m); + } else { + const c = Pr(r); + return Vr(a, n, c, m); + } +}; +export { + Ur as a, + Qr as c +}; diff --git a/assets/lib/mermaid/createText-b70fe78a.js b/assets/lib/mermaid/createText-b70fe78a.js new file mode 100644 index 00000000..2b6e8ff1 --- /dev/null +++ b/assets/lib/mermaid/createText-b70fe78a.js @@ -0,0 +1,4929 @@ +import { b8 as dedent, l as log, b7 as decodeEntities } from "./mermaid-dcacb631.js"; +const emptyOptions = {}; +function toString(value, options) { + const settings = options || emptyOptions; + const includeImageAlt = typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true; + const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true; + return one(value, includeImageAlt, includeHtml); +} +function one(value, includeImageAlt, includeHtml) { + if (node(value)) { + if ("value" in value) { + return value.type === "html" && !includeHtml ? "" : value.value; + } + if (includeImageAlt && "alt" in value && value.alt) { + return value.alt; + } + if ("children" in value) { + return all(value.children, includeImageAlt, includeHtml); + } + } + if (Array.isArray(value)) { + return all(value, includeImageAlt, includeHtml); + } + return ""; +} +function all(values, includeImageAlt, includeHtml) { + const result = []; + let index2 = -1; + while (++index2 < values.length) { + result[index2] = one(values[index2], includeImageAlt, includeHtml); + } + return result.join(""); +} +function node(value) { + return Boolean(value && typeof value === "object"); +} +function splice(list2, start, remove, items) { + const end = list2.length; + let chunkStart = 0; + let parameters; + if (start < 0) { + start = -start > end ? 0 : end + start; + } else { + start = start > end ? end : start; + } + remove = remove > 0 ? remove : 0; + if (items.length < 1e4) { + parameters = Array.from(items); + parameters.unshift(start, remove); + list2.splice(...parameters); + } else { + if (remove) + list2.splice(start, remove); + while (chunkStart < items.length) { + parameters = items.slice(chunkStart, chunkStart + 1e4); + parameters.unshift(start, 0); + list2.splice(...parameters); + chunkStart += 1e4; + start += 1e4; + } + } +} +function push(list2, items) { + if (list2.length > 0) { + splice(list2, list2.length, 0, items); + return list2; + } + return items; +} +const hasOwnProperty = {}.hasOwnProperty; +function combineExtensions(extensions) { + const all2 = {}; + let index2 = -1; + while (++index2 < extensions.length) { + syntaxExtension(all2, extensions[index2]); + } + return all2; +} +function syntaxExtension(all2, extension2) { + let hook; + for (hook in extension2) { + const maybe = hasOwnProperty.call(all2, hook) ? all2[hook] : void 0; + const left = maybe || (all2[hook] = {}); + const right = extension2[hook]; + let code; + if (right) { + for (code in right) { + if (!hasOwnProperty.call(left, code)) + left[code] = []; + const value = right[code]; + constructs( + // @ts-expect-error Looks like a list. + left[code], + Array.isArray(value) ? value : value ? [value] : [] + ); + } + } + } +} +function constructs(existing, list2) { + let index2 = -1; + const before = []; + while (++index2 < list2.length) { + (list2[index2].add === "after" ? existing : before).push(list2[index2]); + } + splice(existing, 0, 0, before); +} +const unicodePunctuationRegex = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; +const asciiAlpha = regexCheck(/[A-Za-z]/); +const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); +const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); +function asciiControl(code) { + return ( + // Special whitespace codes (which have negative values), C0 and Control + // character DEL + code !== null && (code < 32 || code === 127) + ); +} +const asciiDigit = regexCheck(/\d/); +const asciiHexDigit = regexCheck(/[\dA-Fa-f]/); +const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); +function markdownLineEnding(code) { + return code !== null && code < -2; +} +function markdownLineEndingOrSpace(code) { + return code !== null && (code < 0 || code === 32); +} +function markdownSpace(code) { + return code === -2 || code === -1 || code === 32; +} +const unicodePunctuation = regexCheck(unicodePunctuationRegex); +const unicodeWhitespace = regexCheck(/\s/); +function regexCheck(regex) { + return check; + function check(code) { + return code !== null && regex.test(String.fromCharCode(code)); + } +} +function factorySpace(effects, ok, type, max) { + const limit = max ? max - 1 : Number.POSITIVE_INFINITY; + let size = 0; + return start; + function start(code) { + if (markdownSpace(code)) { + effects.enter(type); + return prefix(code); + } + return ok(code); + } + function prefix(code) { + if (markdownSpace(code) && size++ < limit) { + effects.consume(code); + return prefix; + } + effects.exit(type); + return ok(code); + } +} +const content$1 = { + tokenize: initializeContent +}; +function initializeContent(effects) { + const contentStart = effects.attempt( + this.parser.constructs.contentInitial, + afterContentStartConstruct, + paragraphInitial + ); + let previous2; + return contentStart; + function afterContentStartConstruct(code) { + if (code === null) { + effects.consume(code); + return; + } + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return factorySpace(effects, contentStart, "linePrefix"); + } + function paragraphInitial(code) { + effects.enter("paragraph"); + return lineStart(code); + } + function lineStart(code) { + const token = effects.enter("chunkText", { + contentType: "text", + previous: previous2 + }); + if (previous2) { + previous2.next = token; + } + previous2 = token; + return data(code); + } + function data(code) { + if (code === null) { + effects.exit("chunkText"); + effects.exit("paragraph"); + effects.consume(code); + return; + } + if (markdownLineEnding(code)) { + effects.consume(code); + effects.exit("chunkText"); + return lineStart; + } + effects.consume(code); + return data; + } +} +const document$2 = { + tokenize: initializeDocument +}; +const containerConstruct = { + tokenize: tokenizeContainer +}; +function initializeDocument(effects) { + const self = this; + const stack = []; + let continued = 0; + let childFlow; + let childToken; + let lineStartOffset; + return start; + function start(code) { + if (continued < stack.length) { + const item = stack[continued]; + self.containerState = item[1]; + return effects.attempt( + item[0].continuation, + documentContinue, + checkNewContainers + )(code); + } + return checkNewContainers(code); + } + function documentContinue(code) { + continued++; + if (self.containerState._closeFlow) { + self.containerState._closeFlow = void 0; + if (childFlow) { + closeFlow(); + } + const indexBeforeExits = self.events.length; + let indexBeforeFlow = indexBeforeExits; + let point2; + while (indexBeforeFlow--) { + if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") { + point2 = self.events[indexBeforeFlow][1].end; + break; + } + } + exitContainers(continued); + let index2 = indexBeforeExits; + while (index2 < self.events.length) { + self.events[index2][1].end = Object.assign({}, point2); + index2++; + } + splice( + self.events, + indexBeforeFlow + 1, + 0, + self.events.slice(indexBeforeExits) + ); + self.events.length = index2; + return checkNewContainers(code); + } + return start(code); + } + function checkNewContainers(code) { + if (continued === stack.length) { + if (!childFlow) { + return documentContinued(code); + } + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { + return flowStart(code); + } + self.interrupt = Boolean( + childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack + ); + } + self.containerState = {}; + return effects.check( + containerConstruct, + thereIsANewContainer, + thereIsNoNewContainer + )(code); + } + function thereIsANewContainer(code) { + if (childFlow) + closeFlow(); + exitContainers(continued); + return documentContinued(code); + } + function thereIsNoNewContainer(code) { + self.parser.lazy[self.now().line] = continued !== stack.length; + lineStartOffset = self.now().offset; + return flowStart(code); + } + function documentContinued(code) { + self.containerState = {}; + return effects.attempt( + containerConstruct, + containerContinue, + flowStart + )(code); + } + function containerContinue(code) { + continued++; + stack.push([self.currentConstruct, self.containerState]); + return documentContinued(code); + } + function flowStart(code) { + if (code === null) { + if (childFlow) + closeFlow(); + exitContainers(0); + effects.consume(code); + return; + } + childFlow = childFlow || self.parser.flow(self.now()); + effects.enter("chunkFlow", { + contentType: "flow", + previous: childToken, + _tokenizer: childFlow + }); + return flowContinue(code); + } + function flowContinue(code) { + if (code === null) { + writeToChild(effects.exit("chunkFlow"), true); + exitContainers(0); + effects.consume(code); + return; + } + if (markdownLineEnding(code)) { + effects.consume(code); + writeToChild(effects.exit("chunkFlow")); + continued = 0; + self.interrupt = void 0; + return start; + } + effects.consume(code); + return flowContinue; + } + function writeToChild(token, eof) { + const stream = self.sliceStream(token); + if (eof) + stream.push(null); + token.previous = childToken; + if (childToken) + childToken.next = token; + childToken = token; + childFlow.defineSkip(token.start); + childFlow.write(stream); + if (self.parser.lazy[token.start.line]) { + let index2 = childFlow.events.length; + while (index2--) { + if ( + // The token starts before the line ending… + childFlow.events[index2][1].start.offset < lineStartOffset && // …and either is not ended yet… + (!childFlow.events[index2][1].end || // …or ends after it. + childFlow.events[index2][1].end.offset > lineStartOffset) + ) { + return; + } + } + const indexBeforeExits = self.events.length; + let indexBeforeFlow = indexBeforeExits; + let seen; + let point2; + while (indexBeforeFlow--) { + if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") { + if (seen) { + point2 = self.events[indexBeforeFlow][1].end; + break; + } + seen = true; + } + } + exitContainers(continued); + index2 = indexBeforeExits; + while (index2 < self.events.length) { + self.events[index2][1].end = Object.assign({}, point2); + index2++; + } + splice( + self.events, + indexBeforeFlow + 1, + 0, + self.events.slice(indexBeforeExits) + ); + self.events.length = index2; + } + } + function exitContainers(size) { + let index2 = stack.length; + while (index2-- > size) { + const entry = stack[index2]; + self.containerState = entry[1]; + entry[0].exit.call(self, effects); + } + stack.length = size; + } + function closeFlow() { + childFlow.write([null]); + childToken = void 0; + childFlow = void 0; + self.containerState._closeFlow = void 0; + } +} +function tokenizeContainer(effects, ok, nok) { + return factorySpace( + effects, + effects.attempt(this.parser.constructs.document, ok, nok), + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); +} +function classifyCharacter(code) { + if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) { + return 1; + } + if (unicodePunctuation(code)) { + return 2; + } +} +function resolveAll(constructs2, events, context) { + const called = []; + let index2 = -1; + while (++index2 < constructs2.length) { + const resolve = constructs2[index2].resolveAll; + if (resolve && !called.includes(resolve)) { + events = resolve(events, context); + called.push(resolve); + } + } + return events; +} +const attention = { + name: "attention", + tokenize: tokenizeAttention, + resolveAll: resolveAllAttention +}; +function resolveAllAttention(events, context) { + let index2 = -1; + let open; + let group; + let text2; + let openingSequence; + let closingSequence; + let use; + let nextEvents; + let offset; + while (++index2 < events.length) { + if (events[index2][0] === "enter" && events[index2][1].type === "attentionSequence" && events[index2][1]._close) { + open = index2; + while (open--) { + if (events[open][0] === "exit" && events[open][1].type === "attentionSequence" && events[open][1]._open && // If the markers are the same: + context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index2][1]).charCodeAt(0)) { + if ((events[open][1]._close || events[index2][1]._open) && (events[index2][1].end.offset - events[index2][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index2][1].end.offset - events[index2][1].start.offset) % 3)) { + continue; + } + use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1; + const start = Object.assign({}, events[open][1].end); + const end = Object.assign({}, events[index2][1].start); + movePoint(start, -use); + movePoint(end, use); + openingSequence = { + type: use > 1 ? "strongSequence" : "emphasisSequence", + start, + end: Object.assign({}, events[open][1].end) + }; + closingSequence = { + type: use > 1 ? "strongSequence" : "emphasisSequence", + start: Object.assign({}, events[index2][1].start), + end + }; + text2 = { + type: use > 1 ? "strongText" : "emphasisText", + start: Object.assign({}, events[open][1].end), + end: Object.assign({}, events[index2][1].start) + }; + group = { + type: use > 1 ? "strong" : "emphasis", + start: Object.assign({}, openingSequence.start), + end: Object.assign({}, closingSequence.end) + }; + events[open][1].end = Object.assign({}, openingSequence.start); + events[index2][1].start = Object.assign({}, closingSequence.end); + nextEvents = []; + if (events[open][1].end.offset - events[open][1].start.offset) { + nextEvents = push(nextEvents, [ + ["enter", events[open][1], context], + ["exit", events[open][1], context] + ]); + } + nextEvents = push(nextEvents, [ + ["enter", group, context], + ["enter", openingSequence, context], + ["exit", openingSequence, context], + ["enter", text2, context] + ]); + nextEvents = push( + nextEvents, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + 1, index2), + context + ) + ); + nextEvents = push(nextEvents, [ + ["exit", text2, context], + ["enter", closingSequence, context], + ["exit", closingSequence, context], + ["exit", group, context] + ]); + if (events[index2][1].end.offset - events[index2][1].start.offset) { + offset = 2; + nextEvents = push(nextEvents, [ + ["enter", events[index2][1], context], + ["exit", events[index2][1], context] + ]); + } else { + offset = 0; + } + splice(events, open - 1, index2 - open + 3, nextEvents); + index2 = open + nextEvents.length - offset - 2; + break; + } + } + } + } + index2 = -1; + while (++index2 < events.length) { + if (events[index2][1].type === "attentionSequence") { + events[index2][1].type = "data"; + } + } + return events; +} +function tokenizeAttention(effects, ok) { + const attentionMarkers2 = this.parser.constructs.attentionMarkers.null; + const previous2 = this.previous; + const before = classifyCharacter(previous2); + let marker; + return start; + function start(code) { + marker = code; + effects.enter("attentionSequence"); + return inside(code); + } + function inside(code) { + if (code === marker) { + effects.consume(code); + return inside; + } + const token = effects.exit("attentionSequence"); + const after = classifyCharacter(code); + const open = !after || after === 2 && before || attentionMarkers2.includes(code); + const close = !before || before === 2 && after || attentionMarkers2.includes(previous2); + token._open = Boolean(marker === 42 ? open : open && (before || !close)); + token._close = Boolean(marker === 42 ? close : close && (after || !open)); + return ok(code); + } +} +function movePoint(point2, offset) { + point2.column += offset; + point2.offset += offset; + point2._bufferIndex += offset; +} +const autolink = { + name: "autolink", + tokenize: tokenizeAutolink +}; +function tokenizeAutolink(effects, ok, nok) { + let size = 0; + return start; + function start(code) { + effects.enter("autolink"); + effects.enter("autolinkMarker"); + effects.consume(code); + effects.exit("autolinkMarker"); + effects.enter("autolinkProtocol"); + return open; + } + function open(code) { + if (asciiAlpha(code)) { + effects.consume(code); + return schemeOrEmailAtext; + } + return emailAtext(code); + } + function schemeOrEmailAtext(code) { + if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) { + size = 1; + return schemeInsideOrEmailAtext(code); + } + return emailAtext(code); + } + function schemeInsideOrEmailAtext(code) { + if (code === 58) { + effects.consume(code); + size = 0; + return urlInside; + } + if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) { + effects.consume(code); + return schemeInsideOrEmailAtext; + } + size = 0; + return emailAtext(code); + } + function urlInside(code) { + if (code === 62) { + effects.exit("autolinkProtocol"); + effects.enter("autolinkMarker"); + effects.consume(code); + effects.exit("autolinkMarker"); + effects.exit("autolink"); + return ok; + } + if (code === null || code === 32 || code === 60 || asciiControl(code)) { + return nok(code); + } + effects.consume(code); + return urlInside; + } + function emailAtext(code) { + if (code === 64) { + effects.consume(code); + return emailAtSignOrDot; + } + if (asciiAtext(code)) { + effects.consume(code); + return emailAtext; + } + return nok(code); + } + function emailAtSignOrDot(code) { + return asciiAlphanumeric(code) ? emailLabel(code) : nok(code); + } + function emailLabel(code) { + if (code === 46) { + effects.consume(code); + size = 0; + return emailAtSignOrDot; + } + if (code === 62) { + effects.exit("autolinkProtocol").type = "autolinkEmail"; + effects.enter("autolinkMarker"); + effects.consume(code); + effects.exit("autolinkMarker"); + effects.exit("autolink"); + return ok; + } + return emailValue(code); + } + function emailValue(code) { + if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) { + const next = code === 45 ? emailValue : emailLabel; + effects.consume(code); + return next; + } + return nok(code); + } +} +const blankLine = { + tokenize: tokenizeBlankLine, + partial: true +}; +function tokenizeBlankLine(effects, ok, nok) { + return start; + function start(code) { + return markdownSpace(code) ? factorySpace(effects, after, "linePrefix")(code) : after(code); + } + function after(code) { + return code === null || markdownLineEnding(code) ? ok(code) : nok(code); + } +} +const blockQuote = { + name: "blockQuote", + tokenize: tokenizeBlockQuoteStart, + continuation: { + tokenize: tokenizeBlockQuoteContinuation + }, + exit +}; +function tokenizeBlockQuoteStart(effects, ok, nok) { + const self = this; + return start; + function start(code) { + if (code === 62) { + const state = self.containerState; + if (!state.open) { + effects.enter("blockQuote", { + _container: true + }); + state.open = true; + } + effects.enter("blockQuotePrefix"); + effects.enter("blockQuoteMarker"); + effects.consume(code); + effects.exit("blockQuoteMarker"); + return after; + } + return nok(code); + } + function after(code) { + if (markdownSpace(code)) { + effects.enter("blockQuotePrefixWhitespace"); + effects.consume(code); + effects.exit("blockQuotePrefixWhitespace"); + effects.exit("blockQuotePrefix"); + return ok; + } + effects.exit("blockQuotePrefix"); + return ok(code); + } +} +function tokenizeBlockQuoteContinuation(effects, ok, nok) { + const self = this; + return contStart; + function contStart(code) { + if (markdownSpace(code)) { + return factorySpace( + effects, + contBefore, + "linePrefix", + self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(code); + } + return contBefore(code); + } + function contBefore(code) { + return effects.attempt(blockQuote, ok, nok)(code); + } +} +function exit(effects) { + effects.exit("blockQuote"); +} +const characterEscape = { + name: "characterEscape", + tokenize: tokenizeCharacterEscape +}; +function tokenizeCharacterEscape(effects, ok, nok) { + return start; + function start(code) { + effects.enter("characterEscape"); + effects.enter("escapeMarker"); + effects.consume(code); + effects.exit("escapeMarker"); + return inside; + } + function inside(code) { + if (asciiPunctuation(code)) { + effects.enter("characterEscapeValue"); + effects.consume(code); + effects.exit("characterEscapeValue"); + effects.exit("characterEscape"); + return ok; + } + return nok(code); + } +} +const element = document.createElement("i"); +function decodeNamedCharacterReference(value) { + const characterReference2 = "&" + value + ";"; + element.innerHTML = characterReference2; + const char = element.textContent; + if (char.charCodeAt(char.length - 1) === 59 && value !== "semi") { + return false; + } + return char === characterReference2 ? false : char; +} +const characterReference = { + name: "characterReference", + tokenize: tokenizeCharacterReference +}; +function tokenizeCharacterReference(effects, ok, nok) { + const self = this; + let size = 0; + let max; + let test; + return start; + function start(code) { + effects.enter("characterReference"); + effects.enter("characterReferenceMarker"); + effects.consume(code); + effects.exit("characterReferenceMarker"); + return open; + } + function open(code) { + if (code === 35) { + effects.enter("characterReferenceMarkerNumeric"); + effects.consume(code); + effects.exit("characterReferenceMarkerNumeric"); + return numeric; + } + effects.enter("characterReferenceValue"); + max = 31; + test = asciiAlphanumeric; + return value(code); + } + function numeric(code) { + if (code === 88 || code === 120) { + effects.enter("characterReferenceMarkerHexadecimal"); + effects.consume(code); + effects.exit("characterReferenceMarkerHexadecimal"); + effects.enter("characterReferenceValue"); + max = 6; + test = asciiHexDigit; + return value; + } + effects.enter("characterReferenceValue"); + max = 7; + test = asciiDigit; + return value(code); + } + function value(code) { + if (code === 59 && size) { + const token = effects.exit("characterReferenceValue"); + if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) { + return nok(code); + } + effects.enter("characterReferenceMarker"); + effects.consume(code); + effects.exit("characterReferenceMarker"); + effects.exit("characterReference"); + return ok; + } + if (test(code) && size++ < max) { + effects.consume(code); + return value; + } + return nok(code); + } +} +const nonLazyContinuation = { + tokenize: tokenizeNonLazyContinuation, + partial: true +}; +const codeFenced = { + name: "codeFenced", + tokenize: tokenizeCodeFenced, + concrete: true +}; +function tokenizeCodeFenced(effects, ok, nok) { + const self = this; + const closeStart = { + tokenize: tokenizeCloseStart, + partial: true + }; + let initialPrefix = 0; + let sizeOpen = 0; + let marker; + return start; + function start(code) { + return beforeSequenceOpen(code); + } + function beforeSequenceOpen(code) { + const tail = self.events[self.events.length - 1]; + initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + marker = code; + effects.enter("codeFenced"); + effects.enter("codeFencedFence"); + effects.enter("codeFencedFenceSequence"); + return sequenceOpen(code); + } + function sequenceOpen(code) { + if (code === marker) { + sizeOpen++; + effects.consume(code); + return sequenceOpen; + } + if (sizeOpen < 3) { + return nok(code); + } + effects.exit("codeFencedFenceSequence"); + return markdownSpace(code) ? factorySpace(effects, infoBefore, "whitespace")(code) : infoBefore(code); + } + function infoBefore(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("codeFencedFence"); + return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code); + } + effects.enter("codeFencedFenceInfo"); + effects.enter("chunkString", { + contentType: "string" + }); + return info(code); + } + function info(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceInfo"); + return infoBefore(code); + } + if (markdownSpace(code)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceInfo"); + return factorySpace(effects, metaBefore, "whitespace")(code); + } + if (code === 96 && code === marker) { + return nok(code); + } + effects.consume(code); + return info; + } + function metaBefore(code) { + if (code === null || markdownLineEnding(code)) { + return infoBefore(code); + } + effects.enter("codeFencedFenceMeta"); + effects.enter("chunkString", { + contentType: "string" + }); + return meta(code); + } + function meta(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceMeta"); + return infoBefore(code); + } + if (code === 96 && code === marker) { + return nok(code); + } + effects.consume(code); + return meta; + } + function atNonLazyBreak(code) { + return effects.attempt(closeStart, after, contentBefore)(code); + } + function contentBefore(code) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return contentStart; + } + function contentStart(code) { + return initialPrefix > 0 && markdownSpace(code) ? factorySpace( + effects, + beforeContentChunk, + "linePrefix", + initialPrefix + 1 + )(code) : beforeContentChunk(code); + } + function beforeContentChunk(code) { + if (code === null || markdownLineEnding(code)) { + return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code); + } + effects.enter("codeFlowValue"); + return contentChunk(code); + } + function contentChunk(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("codeFlowValue"); + return beforeContentChunk(code); + } + effects.consume(code); + return contentChunk; + } + function after(code) { + effects.exit("codeFenced"); + return ok(code); + } + function tokenizeCloseStart(effects2, ok2, nok2) { + let size = 0; + return startBefore; + function startBefore(code) { + effects2.enter("lineEnding"); + effects2.consume(code); + effects2.exit("lineEnding"); + return start2; + } + function start2(code) { + effects2.enter("codeFencedFence"); + return markdownSpace(code) ? factorySpace( + effects2, + beforeSequenceClose, + "linePrefix", + self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(code) : beforeSequenceClose(code); + } + function beforeSequenceClose(code) { + if (code === marker) { + effects2.enter("codeFencedFenceSequence"); + return sequenceClose(code); + } + return nok2(code); + } + function sequenceClose(code) { + if (code === marker) { + size++; + effects2.consume(code); + return sequenceClose; + } + if (size >= sizeOpen) { + effects2.exit("codeFencedFenceSequence"); + return markdownSpace(code) ? factorySpace(effects2, sequenceCloseAfter, "whitespace")(code) : sequenceCloseAfter(code); + } + return nok2(code); + } + function sequenceCloseAfter(code) { + if (code === null || markdownLineEnding(code)) { + effects2.exit("codeFencedFence"); + return ok2(code); + } + return nok2(code); + } + } +} +function tokenizeNonLazyContinuation(effects, ok, nok) { + const self = this; + return start; + function start(code) { + if (code === null) { + return nok(code); + } + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return lineStart; + } + function lineStart(code) { + return self.parser.lazy[self.now().line] ? nok(code) : ok(code); + } +} +const codeIndented = { + name: "codeIndented", + tokenize: tokenizeCodeIndented +}; +const furtherStart = { + tokenize: tokenizeFurtherStart, + partial: true +}; +function tokenizeCodeIndented(effects, ok, nok) { + const self = this; + return start; + function start(code) { + effects.enter("codeIndented"); + return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code); + } + function afterPrefix(code) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? atBreak(code) : nok(code); + } + function atBreak(code) { + if (code === null) { + return after(code); + } + if (markdownLineEnding(code)) { + return effects.attempt(furtherStart, atBreak, after)(code); + } + effects.enter("codeFlowValue"); + return inside(code); + } + function inside(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("codeFlowValue"); + return atBreak(code); + } + effects.consume(code); + return inside; + } + function after(code) { + effects.exit("codeIndented"); + return ok(code); + } +} +function tokenizeFurtherStart(effects, ok, nok) { + const self = this; + return furtherStart2; + function furtherStart2(code) { + if (self.parser.lazy[self.now().line]) { + return nok(code); + } + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return furtherStart2; + } + return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code); + } + function afterPrefix(code) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok(code) : markdownLineEnding(code) ? furtherStart2(code) : nok(code); + } +} +const codeText = { + name: "codeText", + tokenize: tokenizeCodeText, + resolve: resolveCodeText, + previous +}; +function resolveCodeText(events) { + let tailExitIndex = events.length - 4; + let headEnterIndex = 3; + let index2; + let enter; + if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) { + index2 = headEnterIndex; + while (++index2 < tailExitIndex) { + if (events[index2][1].type === "codeTextData") { + events[headEnterIndex][1].type = "codeTextPadding"; + events[tailExitIndex][1].type = "codeTextPadding"; + headEnterIndex += 2; + tailExitIndex -= 2; + break; + } + } + } + index2 = headEnterIndex - 1; + tailExitIndex++; + while (++index2 <= tailExitIndex) { + if (enter === void 0) { + if (index2 !== tailExitIndex && events[index2][1].type !== "lineEnding") { + enter = index2; + } + } else if (index2 === tailExitIndex || events[index2][1].type === "lineEnding") { + events[enter][1].type = "codeTextData"; + if (index2 !== enter + 2) { + events[enter][1].end = events[index2 - 1][1].end; + events.splice(enter + 2, index2 - enter - 2); + tailExitIndex -= index2 - enter - 2; + index2 = enter + 2; + } + enter = void 0; + } + } + return events; +} +function previous(code) { + return code !== 96 || this.events[this.events.length - 1][1].type === "characterEscape"; +} +function tokenizeCodeText(effects, ok, nok) { + let sizeOpen = 0; + let size; + let token; + return start; + function start(code) { + effects.enter("codeText"); + effects.enter("codeTextSequence"); + return sequenceOpen(code); + } + function sequenceOpen(code) { + if (code === 96) { + effects.consume(code); + sizeOpen++; + return sequenceOpen; + } + effects.exit("codeTextSequence"); + return between(code); + } + function between(code) { + if (code === null) { + return nok(code); + } + if (code === 32) { + effects.enter("space"); + effects.consume(code); + effects.exit("space"); + return between; + } + if (code === 96) { + token = effects.enter("codeTextSequence"); + size = 0; + return sequenceClose(code); + } + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return between; + } + effects.enter("codeTextData"); + return data(code); + } + function data(code) { + if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) { + effects.exit("codeTextData"); + return between(code); + } + effects.consume(code); + return data; + } + function sequenceClose(code) { + if (code === 96) { + effects.consume(code); + size++; + return sequenceClose; + } + if (size === sizeOpen) { + effects.exit("codeTextSequence"); + effects.exit("codeText"); + return ok(code); + } + token.type = "codeTextData"; + return data(code); + } +} +function subtokenize(events) { + const jumps = {}; + let index2 = -1; + let event; + let lineIndex; + let otherIndex; + let otherEvent; + let parameters; + let subevents; + let more; + while (++index2 < events.length) { + while (index2 in jumps) { + index2 = jumps[index2]; + } + event = events[index2]; + if (index2 && event[1].type === "chunkFlow" && events[index2 - 1][1].type === "listItemPrefix") { + subevents = event[1]._tokenizer.events; + otherIndex = 0; + if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") { + otherIndex += 2; + } + if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") { + while (++otherIndex < subevents.length) { + if (subevents[otherIndex][1].type === "content") { + break; + } + if (subevents[otherIndex][1].type === "chunkText") { + subevents[otherIndex][1]._isInFirstContentOfListItem = true; + otherIndex++; + } + } + } + } + if (event[0] === "enter") { + if (event[1].contentType) { + Object.assign(jumps, subcontent(events, index2)); + index2 = jumps[index2]; + more = true; + } + } else if (event[1]._container) { + otherIndex = index2; + lineIndex = void 0; + while (otherIndex--) { + otherEvent = events[otherIndex]; + if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") { + if (otherEvent[0] === "enter") { + if (lineIndex) { + events[lineIndex][1].type = "lineEndingBlank"; + } + otherEvent[1].type = "lineEnding"; + lineIndex = otherIndex; + } + } else { + break; + } + } + if (lineIndex) { + event[1].end = Object.assign({}, events[lineIndex][1].start); + parameters = events.slice(lineIndex, index2); + parameters.unshift(event); + splice(events, lineIndex, index2 - lineIndex + 1, parameters); + } + } + } + return !more; +} +function subcontent(events, eventIndex) { + const token = events[eventIndex][1]; + const context = events[eventIndex][2]; + let startPosition = eventIndex - 1; + const startPositions = []; + const tokenizer = token._tokenizer || context.parser[token.contentType](token.start); + const childEvents = tokenizer.events; + const jumps = []; + const gaps = {}; + let stream; + let previous2; + let index2 = -1; + let current = token; + let adjust = 0; + let start = 0; + const breaks = [start]; + while (current) { + while (events[++startPosition][1] !== current) { + } + startPositions.push(startPosition); + if (!current._tokenizer) { + stream = context.sliceStream(current); + if (!current.next) { + stream.push(null); + } + if (previous2) { + tokenizer.defineSkip(current.start); + } + if (current._isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = true; + } + tokenizer.write(stream); + if (current._isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = void 0; + } + } + previous2 = current; + current = current.next; + } + current = token; + while (++index2 < childEvents.length) { + if ( + // Find a void token that includes a break. + childEvents[index2][0] === "exit" && childEvents[index2 - 1][0] === "enter" && childEvents[index2][1].type === childEvents[index2 - 1][1].type && childEvents[index2][1].start.line !== childEvents[index2][1].end.line + ) { + start = index2 + 1; + breaks.push(start); + current._tokenizer = void 0; + current.previous = void 0; + current = current.next; + } + } + tokenizer.events = []; + if (current) { + current._tokenizer = void 0; + current.previous = void 0; + } else { + breaks.pop(); + } + index2 = breaks.length; + while (index2--) { + const slice = childEvents.slice(breaks[index2], breaks[index2 + 1]); + const start2 = startPositions.pop(); + jumps.unshift([start2, start2 + slice.length - 1]); + splice(events, start2, 2, slice); + } + index2 = -1; + while (++index2 < jumps.length) { + gaps[adjust + jumps[index2][0]] = adjust + jumps[index2][1]; + adjust += jumps[index2][1] - jumps[index2][0] - 1; + } + return gaps; +} +const content = { + tokenize: tokenizeContent, + resolve: resolveContent +}; +const continuationConstruct = { + tokenize: tokenizeContinuation, + partial: true +}; +function resolveContent(events) { + subtokenize(events); + return events; +} +function tokenizeContent(effects, ok) { + let previous2; + return chunkStart; + function chunkStart(code) { + effects.enter("content"); + previous2 = effects.enter("chunkContent", { + contentType: "content" + }); + return chunkInside(code); + } + function chunkInside(code) { + if (code === null) { + return contentEnd(code); + } + if (markdownLineEnding(code)) { + return effects.check( + continuationConstruct, + contentContinue, + contentEnd + )(code); + } + effects.consume(code); + return chunkInside; + } + function contentEnd(code) { + effects.exit("chunkContent"); + effects.exit("content"); + return ok(code); + } + function contentContinue(code) { + effects.consume(code); + effects.exit("chunkContent"); + previous2.next = effects.enter("chunkContent", { + contentType: "content", + previous: previous2 + }); + previous2 = previous2.next; + return chunkInside; + } +} +function tokenizeContinuation(effects, ok, nok) { + const self = this; + return startLookahead; + function startLookahead(code) { + effects.exit("chunkContent"); + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return factorySpace(effects, prefixed, "linePrefix"); + } + function prefixed(code) { + if (code === null || markdownLineEnding(code)) { + return nok(code); + } + const tail = self.events[self.events.length - 1]; + if (!self.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) { + return ok(code); + } + return effects.interrupt(self.parser.constructs.flow, nok, ok)(code); + } +} +function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) { + const limit = max || Number.POSITIVE_INFINITY; + let balance = 0; + return start; + function start(code) { + if (code === 60) { + effects.enter(type); + effects.enter(literalType); + effects.enter(literalMarkerType); + effects.consume(code); + effects.exit(literalMarkerType); + return enclosedBefore; + } + if (code === null || code === 32 || code === 41 || asciiControl(code)) { + return nok(code); + } + effects.enter(type); + effects.enter(rawType); + effects.enter(stringType); + effects.enter("chunkString", { + contentType: "string" + }); + return raw(code); + } + function enclosedBefore(code) { + if (code === 62) { + effects.enter(literalMarkerType); + effects.consume(code); + effects.exit(literalMarkerType); + effects.exit(literalType); + effects.exit(type); + return ok; + } + effects.enter(stringType); + effects.enter("chunkString", { + contentType: "string" + }); + return enclosed(code); + } + function enclosed(code) { + if (code === 62) { + effects.exit("chunkString"); + effects.exit(stringType); + return enclosedBefore(code); + } + if (code === null || code === 60 || markdownLineEnding(code)) { + return nok(code); + } + effects.consume(code); + return code === 92 ? enclosedEscape : enclosed; + } + function enclosedEscape(code) { + if (code === 60 || code === 62 || code === 92) { + effects.consume(code); + return enclosed; + } + return enclosed(code); + } + function raw(code) { + if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) { + effects.exit("chunkString"); + effects.exit(stringType); + effects.exit(rawType); + effects.exit(type); + return ok(code); + } + if (balance < limit && code === 40) { + effects.consume(code); + balance++; + return raw; + } + if (code === 41) { + effects.consume(code); + balance--; + return raw; + } + if (code === null || code === 32 || code === 40 || asciiControl(code)) { + return nok(code); + } + effects.consume(code); + return code === 92 ? rawEscape : raw; + } + function rawEscape(code) { + if (code === 40 || code === 41 || code === 92) { + effects.consume(code); + return raw; + } + return raw(code); + } +} +function factoryLabel(effects, ok, nok, type, markerType, stringType) { + const self = this; + let size = 0; + let seen; + return start; + function start(code) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + effects.enter(stringType); + return atBreak; + } + function atBreak(code) { + if (size > 999 || code === null || code === 91 || code === 93 && !seen || // To do: remove in the future once we’ve switched from + // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`, + // which doesn’t need this. + // Hidden footnotes hook. + /* c8 ignore next 3 */ + code === 94 && !size && "_hiddenFootnoteSupport" in self.parser.constructs) { + return nok(code); + } + if (code === 93) { + effects.exit(stringType); + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + effects.exit(type); + return ok; + } + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return atBreak; + } + effects.enter("chunkString", { + contentType: "string" + }); + return labelInside(code); + } + function labelInside(code) { + if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) { + effects.exit("chunkString"); + return atBreak(code); + } + effects.consume(code); + if (!seen) + seen = !markdownSpace(code); + return code === 92 ? labelEscape : labelInside; + } + function labelEscape(code) { + if (code === 91 || code === 92 || code === 93) { + effects.consume(code); + size++; + return labelInside; + } + return labelInside(code); + } +} +function factoryTitle(effects, ok, nok, type, markerType, stringType) { + let marker; + return start; + function start(code) { + if (code === 34 || code === 39 || code === 40) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + marker = code === 40 ? 41 : code; + return begin; + } + return nok(code); + } + function begin(code) { + if (code === marker) { + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + effects.exit(type); + return ok; + } + effects.enter(stringType); + return atBreak(code); + } + function atBreak(code) { + if (code === marker) { + effects.exit(stringType); + return begin(marker); + } + if (code === null) { + return nok(code); + } + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return factorySpace(effects, atBreak, "linePrefix"); + } + effects.enter("chunkString", { + contentType: "string" + }); + return inside(code); + } + function inside(code) { + if (code === marker || code === null || markdownLineEnding(code)) { + effects.exit("chunkString"); + return atBreak(code); + } + effects.consume(code); + return code === 92 ? escape : inside; + } + function escape(code) { + if (code === marker || code === 92) { + effects.consume(code); + return inside; + } + return inside(code); + } +} +function factoryWhitespace(effects, ok) { + let seen; + return start; + function start(code) { + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + seen = true; + return start; + } + if (markdownSpace(code)) { + return factorySpace( + effects, + start, + seen ? "linePrefix" : "lineSuffix" + )(code); + } + return ok(code); + } +} +function normalizeIdentifier(value) { + return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase(); +} +const definition = { + name: "definition", + tokenize: tokenizeDefinition +}; +const titleBefore = { + tokenize: tokenizeTitleBefore, + partial: true +}; +function tokenizeDefinition(effects, ok, nok) { + const self = this; + let identifier; + return start; + function start(code) { + effects.enter("definition"); + return before(code); + } + function before(code) { + return factoryLabel.call( + self, + effects, + labelAfter, + // Note: we don’t need to reset the way `markdown-rs` does. + nok, + "definitionLabel", + "definitionLabelMarker", + "definitionLabelString" + )(code); + } + function labelAfter(code) { + identifier = normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ); + if (code === 58) { + effects.enter("definitionMarker"); + effects.consume(code); + effects.exit("definitionMarker"); + return markerAfter; + } + return nok(code); + } + function markerAfter(code) { + return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code); + } + function destinationBefore(code) { + return factoryDestination( + effects, + destinationAfter, + // Note: we don’t need to reset the way `markdown-rs` does. + nok, + "definitionDestination", + "definitionDestinationLiteral", + "definitionDestinationLiteralMarker", + "definitionDestinationRaw", + "definitionDestinationString" + )(code); + } + function destinationAfter(code) { + return effects.attempt(titleBefore, after, after)(code); + } + function after(code) { + return markdownSpace(code) ? factorySpace(effects, afterWhitespace, "whitespace")(code) : afterWhitespace(code); + } + function afterWhitespace(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("definition"); + self.parser.defined.push(identifier); + return ok(code); + } + return nok(code); + } +} +function tokenizeTitleBefore(effects, ok, nok) { + return titleBefore2; + function titleBefore2(code) { + return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code); + } + function beforeMarker(code) { + return factoryTitle( + effects, + titleAfter, + nok, + "definitionTitle", + "definitionTitleMarker", + "definitionTitleString" + )(code); + } + function titleAfter(code) { + return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, "whitespace")(code) : titleAfterOptionalWhitespace(code); + } + function titleAfterOptionalWhitespace(code) { + return code === null || markdownLineEnding(code) ? ok(code) : nok(code); + } +} +const hardBreakEscape = { + name: "hardBreakEscape", + tokenize: tokenizeHardBreakEscape +}; +function tokenizeHardBreakEscape(effects, ok, nok) { + return start; + function start(code) { + effects.enter("hardBreakEscape"); + effects.consume(code); + return after; + } + function after(code) { + if (markdownLineEnding(code)) { + effects.exit("hardBreakEscape"); + return ok(code); + } + return nok(code); + } +} +const headingAtx = { + name: "headingAtx", + tokenize: tokenizeHeadingAtx, + resolve: resolveHeadingAtx +}; +function resolveHeadingAtx(events, context) { + let contentEnd = events.length - 2; + let contentStart = 3; + let content2; + let text2; + if (events[contentStart][1].type === "whitespace") { + contentStart += 2; + } + if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") { + contentEnd -= 2; + } + if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) { + contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; + } + if (contentEnd > contentStart) { + content2 = { + type: "atxHeadingText", + start: events[contentStart][1].start, + end: events[contentEnd][1].end + }; + text2 = { + type: "chunkText", + start: events[contentStart][1].start, + end: events[contentEnd][1].end, + contentType: "text" + }; + splice(events, contentStart, contentEnd - contentStart + 1, [ + ["enter", content2, context], + ["enter", text2, context], + ["exit", text2, context], + ["exit", content2, context] + ]); + } + return events; +} +function tokenizeHeadingAtx(effects, ok, nok) { + let size = 0; + return start; + function start(code) { + effects.enter("atxHeading"); + return before(code); + } + function before(code) { + effects.enter("atxHeadingSequence"); + return sequenceOpen(code); + } + function sequenceOpen(code) { + if (code === 35 && size++ < 6) { + effects.consume(code); + return sequenceOpen; + } + if (code === null || markdownLineEndingOrSpace(code)) { + effects.exit("atxHeadingSequence"); + return atBreak(code); + } + return nok(code); + } + function atBreak(code) { + if (code === 35) { + effects.enter("atxHeadingSequence"); + return sequenceFurther(code); + } + if (code === null || markdownLineEnding(code)) { + effects.exit("atxHeading"); + return ok(code); + } + if (markdownSpace(code)) { + return factorySpace(effects, atBreak, "whitespace")(code); + } + effects.enter("atxHeadingText"); + return data(code); + } + function sequenceFurther(code) { + if (code === 35) { + effects.consume(code); + return sequenceFurther; + } + effects.exit("atxHeadingSequence"); + return atBreak(code); + } + function data(code) { + if (code === null || code === 35 || markdownLineEndingOrSpace(code)) { + effects.exit("atxHeadingText"); + return atBreak(code); + } + effects.consume(code); + return data; + } +} +const htmlBlockNames = [ + "address", + "article", + "aside", + "base", + "basefont", + "blockquote", + "body", + "caption", + "center", + "col", + "colgroup", + "dd", + "details", + "dialog", + "dir", + "div", + "dl", + "dt", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hr", + "html", + "iframe", + "legend", + "li", + "link", + "main", + "menu", + "menuitem", + "nav", + "noframes", + "ol", + "optgroup", + "option", + "p", + "param", + "search", + "section", + "summary", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "title", + "tr", + "track", + "ul" +]; +const htmlRawNames = ["pre", "script", "style", "textarea"]; +const htmlFlow = { + name: "htmlFlow", + tokenize: tokenizeHtmlFlow, + resolveTo: resolveToHtmlFlow, + concrete: true +}; +const blankLineBefore = { + tokenize: tokenizeBlankLineBefore, + partial: true +}; +const nonLazyContinuationStart = { + tokenize: tokenizeNonLazyContinuationStart, + partial: true +}; +function resolveToHtmlFlow(events) { + let index2 = events.length; + while (index2--) { + if (events[index2][0] === "enter" && events[index2][1].type === "htmlFlow") { + break; + } + } + if (index2 > 1 && events[index2 - 2][1].type === "linePrefix") { + events[index2][1].start = events[index2 - 2][1].start; + events[index2 + 1][1].start = events[index2 - 2][1].start; + events.splice(index2 - 2, 2); + } + return events; +} +function tokenizeHtmlFlow(effects, ok, nok) { + const self = this; + let marker; + let closingTag; + let buffer; + let index2; + let markerB; + return start; + function start(code) { + return before(code); + } + function before(code) { + effects.enter("htmlFlow"); + effects.enter("htmlFlowData"); + effects.consume(code); + return open; + } + function open(code) { + if (code === 33) { + effects.consume(code); + return declarationOpen; + } + if (code === 47) { + effects.consume(code); + closingTag = true; + return tagCloseStart; + } + if (code === 63) { + effects.consume(code); + marker = 3; + return self.interrupt ? ok : continuationDeclarationInside; + } + if (asciiAlpha(code)) { + effects.consume(code); + buffer = String.fromCharCode(code); + return tagName; + } + return nok(code); + } + function declarationOpen(code) { + if (code === 45) { + effects.consume(code); + marker = 2; + return commentOpenInside; + } + if (code === 91) { + effects.consume(code); + marker = 5; + index2 = 0; + return cdataOpenInside; + } + if (asciiAlpha(code)) { + effects.consume(code); + marker = 4; + return self.interrupt ? ok : continuationDeclarationInside; + } + return nok(code); + } + function commentOpenInside(code) { + if (code === 45) { + effects.consume(code); + return self.interrupt ? ok : continuationDeclarationInside; + } + return nok(code); + } + function cdataOpenInside(code) { + const value = "CDATA["; + if (code === value.charCodeAt(index2++)) { + effects.consume(code); + if (index2 === value.length) { + return self.interrupt ? ok : continuation; + } + return cdataOpenInside; + } + return nok(code); + } + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code); + buffer = String.fromCharCode(code); + return tagName; + } + return nok(code); + } + function tagName(code) { + if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { + const slash = code === 47; + const name = buffer.toLowerCase(); + if (!slash && !closingTag && htmlRawNames.includes(name)) { + marker = 1; + return self.interrupt ? ok(code) : continuation(code); + } + if (htmlBlockNames.includes(buffer.toLowerCase())) { + marker = 6; + if (slash) { + effects.consume(code); + return basicSelfClosing; + } + return self.interrupt ? ok(code) : continuation(code); + } + marker = 7; + return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code); + } + if (code === 45 || asciiAlphanumeric(code)) { + effects.consume(code); + buffer += String.fromCharCode(code); + return tagName; + } + return nok(code); + } + function basicSelfClosing(code) { + if (code === 62) { + effects.consume(code); + return self.interrupt ? ok : continuation; + } + return nok(code); + } + function completeClosingTagAfter(code) { + if (markdownSpace(code)) { + effects.consume(code); + return completeClosingTagAfter; + } + return completeEnd(code); + } + function completeAttributeNameBefore(code) { + if (code === 47) { + effects.consume(code); + return completeEnd; + } + if (code === 58 || code === 95 || asciiAlpha(code)) { + effects.consume(code); + return completeAttributeName; + } + if (markdownSpace(code)) { + effects.consume(code); + return completeAttributeNameBefore; + } + return completeEnd(code); + } + function completeAttributeName(code) { + if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) { + effects.consume(code); + return completeAttributeName; + } + return completeAttributeNameAfter(code); + } + function completeAttributeNameAfter(code) { + if (code === 61) { + effects.consume(code); + return completeAttributeValueBefore; + } + if (markdownSpace(code)) { + effects.consume(code); + return completeAttributeNameAfter; + } + return completeAttributeNameBefore(code); + } + function completeAttributeValueBefore(code) { + if (code === null || code === 60 || code === 61 || code === 62 || code === 96) { + return nok(code); + } + if (code === 34 || code === 39) { + effects.consume(code); + markerB = code; + return completeAttributeValueQuoted; + } + if (markdownSpace(code)) { + effects.consume(code); + return completeAttributeValueBefore; + } + return completeAttributeValueUnquoted(code); + } + function completeAttributeValueQuoted(code) { + if (code === markerB) { + effects.consume(code); + markerB = null; + return completeAttributeValueQuotedAfter; + } + if (code === null || markdownLineEnding(code)) { + return nok(code); + } + effects.consume(code); + return completeAttributeValueQuoted; + } + function completeAttributeValueUnquoted(code) { + if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) { + return completeAttributeNameAfter(code); + } + effects.consume(code); + return completeAttributeValueUnquoted; + } + function completeAttributeValueQuotedAfter(code) { + if (code === 47 || code === 62 || markdownSpace(code)) { + return completeAttributeNameBefore(code); + } + return nok(code); + } + function completeEnd(code) { + if (code === 62) { + effects.consume(code); + return completeAfter; + } + return nok(code); + } + function completeAfter(code) { + if (code === null || markdownLineEnding(code)) { + return continuation(code); + } + if (markdownSpace(code)) { + effects.consume(code); + return completeAfter; + } + return nok(code); + } + function continuation(code) { + if (code === 45 && marker === 2) { + effects.consume(code); + return continuationCommentInside; + } + if (code === 60 && marker === 1) { + effects.consume(code); + return continuationRawTagOpen; + } + if (code === 62 && marker === 4) { + effects.consume(code); + return continuationClose; + } + if (code === 63 && marker === 3) { + effects.consume(code); + return continuationDeclarationInside; + } + if (code === 93 && marker === 5) { + effects.consume(code); + return continuationCdataInside; + } + if (markdownLineEnding(code) && (marker === 6 || marker === 7)) { + effects.exit("htmlFlowData"); + return effects.check( + blankLineBefore, + continuationAfter, + continuationStart + )(code); + } + if (code === null || markdownLineEnding(code)) { + effects.exit("htmlFlowData"); + return continuationStart(code); + } + effects.consume(code); + return continuation; + } + function continuationStart(code) { + return effects.check( + nonLazyContinuationStart, + continuationStartNonLazy, + continuationAfter + )(code); + } + function continuationStartNonLazy(code) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return continuationBefore; + } + function continuationBefore(code) { + if (code === null || markdownLineEnding(code)) { + return continuationStart(code); + } + effects.enter("htmlFlowData"); + return continuation(code); + } + function continuationCommentInside(code) { + if (code === 45) { + effects.consume(code); + return continuationDeclarationInside; + } + return continuation(code); + } + function continuationRawTagOpen(code) { + if (code === 47) { + effects.consume(code); + buffer = ""; + return continuationRawEndTag; + } + return continuation(code); + } + function continuationRawEndTag(code) { + if (code === 62) { + const name = buffer.toLowerCase(); + if (htmlRawNames.includes(name)) { + effects.consume(code); + return continuationClose; + } + return continuation(code); + } + if (asciiAlpha(code) && buffer.length < 8) { + effects.consume(code); + buffer += String.fromCharCode(code); + return continuationRawEndTag; + } + return continuation(code); + } + function continuationCdataInside(code) { + if (code === 93) { + effects.consume(code); + return continuationDeclarationInside; + } + return continuation(code); + } + function continuationDeclarationInside(code) { + if (code === 62) { + effects.consume(code); + return continuationClose; + } + if (code === 45 && marker === 2) { + effects.consume(code); + return continuationDeclarationInside; + } + return continuation(code); + } + function continuationClose(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("htmlFlowData"); + return continuationAfter(code); + } + effects.consume(code); + return continuationClose; + } + function continuationAfter(code) { + effects.exit("htmlFlow"); + return ok(code); + } +} +function tokenizeNonLazyContinuationStart(effects, ok, nok) { + const self = this; + return start; + function start(code) { + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return after; + } + return nok(code); + } + function after(code) { + return self.parser.lazy[self.now().line] ? nok(code) : ok(code); + } +} +function tokenizeBlankLineBefore(effects, ok, nok) { + return start; + function start(code) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return effects.attempt(blankLine, ok, nok); + } +} +const htmlText = { + name: "htmlText", + tokenize: tokenizeHtmlText +}; +function tokenizeHtmlText(effects, ok, nok) { + const self = this; + let marker; + let index2; + let returnState; + return start; + function start(code) { + effects.enter("htmlText"); + effects.enter("htmlTextData"); + effects.consume(code); + return open; + } + function open(code) { + if (code === 33) { + effects.consume(code); + return declarationOpen; + } + if (code === 47) { + effects.consume(code); + return tagCloseStart; + } + if (code === 63) { + effects.consume(code); + return instruction; + } + if (asciiAlpha(code)) { + effects.consume(code); + return tagOpen; + } + return nok(code); + } + function declarationOpen(code) { + if (code === 45) { + effects.consume(code); + return commentOpenInside; + } + if (code === 91) { + effects.consume(code); + index2 = 0; + return cdataOpenInside; + } + if (asciiAlpha(code)) { + effects.consume(code); + return declaration; + } + return nok(code); + } + function commentOpenInside(code) { + if (code === 45) { + effects.consume(code); + return commentEnd; + } + return nok(code); + } + function comment(code) { + if (code === null) { + return nok(code); + } + if (code === 45) { + effects.consume(code); + return commentClose; + } + if (markdownLineEnding(code)) { + returnState = comment; + return lineEndingBefore(code); + } + effects.consume(code); + return comment; + } + function commentClose(code) { + if (code === 45) { + effects.consume(code); + return commentEnd; + } + return comment(code); + } + function commentEnd(code) { + return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code); + } + function cdataOpenInside(code) { + const value = "CDATA["; + if (code === value.charCodeAt(index2++)) { + effects.consume(code); + return index2 === value.length ? cdata : cdataOpenInside; + } + return nok(code); + } + function cdata(code) { + if (code === null) { + return nok(code); + } + if (code === 93) { + effects.consume(code); + return cdataClose; + } + if (markdownLineEnding(code)) { + returnState = cdata; + return lineEndingBefore(code); + } + effects.consume(code); + return cdata; + } + function cdataClose(code) { + if (code === 93) { + effects.consume(code); + return cdataEnd; + } + return cdata(code); + } + function cdataEnd(code) { + if (code === 62) { + return end(code); + } + if (code === 93) { + effects.consume(code); + return cdataEnd; + } + return cdata(code); + } + function declaration(code) { + if (code === null || code === 62) { + return end(code); + } + if (markdownLineEnding(code)) { + returnState = declaration; + return lineEndingBefore(code); + } + effects.consume(code); + return declaration; + } + function instruction(code) { + if (code === null) { + return nok(code); + } + if (code === 63) { + effects.consume(code); + return instructionClose; + } + if (markdownLineEnding(code)) { + returnState = instruction; + return lineEndingBefore(code); + } + effects.consume(code); + return instruction; + } + function instructionClose(code) { + return code === 62 ? end(code) : instruction(code); + } + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code); + return tagClose; + } + return nok(code); + } + function tagClose(code) { + if (code === 45 || asciiAlphanumeric(code)) { + effects.consume(code); + return tagClose; + } + return tagCloseBetween(code); + } + function tagCloseBetween(code) { + if (markdownLineEnding(code)) { + returnState = tagCloseBetween; + return lineEndingBefore(code); + } + if (markdownSpace(code)) { + effects.consume(code); + return tagCloseBetween; + } + return end(code); + } + function tagOpen(code) { + if (code === 45 || asciiAlphanumeric(code)) { + effects.consume(code); + return tagOpen; + } + if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { + return tagOpenBetween(code); + } + return nok(code); + } + function tagOpenBetween(code) { + if (code === 47) { + effects.consume(code); + return end; + } + if (code === 58 || code === 95 || asciiAlpha(code)) { + effects.consume(code); + return tagOpenAttributeName; + } + if (markdownLineEnding(code)) { + returnState = tagOpenBetween; + return lineEndingBefore(code); + } + if (markdownSpace(code)) { + effects.consume(code); + return tagOpenBetween; + } + return end(code); + } + function tagOpenAttributeName(code) { + if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) { + effects.consume(code); + return tagOpenAttributeName; + } + return tagOpenAttributeNameAfter(code); + } + function tagOpenAttributeNameAfter(code) { + if (code === 61) { + effects.consume(code); + return tagOpenAttributeValueBefore; + } + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeNameAfter; + return lineEndingBefore(code); + } + if (markdownSpace(code)) { + effects.consume(code); + return tagOpenAttributeNameAfter; + } + return tagOpenBetween(code); + } + function tagOpenAttributeValueBefore(code) { + if (code === null || code === 60 || code === 61 || code === 62 || code === 96) { + return nok(code); + } + if (code === 34 || code === 39) { + effects.consume(code); + marker = code; + return tagOpenAttributeValueQuoted; + } + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeValueBefore; + return lineEndingBefore(code); + } + if (markdownSpace(code)) { + effects.consume(code); + return tagOpenAttributeValueBefore; + } + effects.consume(code); + return tagOpenAttributeValueUnquoted; + } + function tagOpenAttributeValueQuoted(code) { + if (code === marker) { + effects.consume(code); + marker = void 0; + return tagOpenAttributeValueQuotedAfter; + } + if (code === null) { + return nok(code); + } + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeValueQuoted; + return lineEndingBefore(code); + } + effects.consume(code); + return tagOpenAttributeValueQuoted; + } + function tagOpenAttributeValueUnquoted(code) { + if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) { + return nok(code); + } + if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { + return tagOpenBetween(code); + } + effects.consume(code); + return tagOpenAttributeValueUnquoted; + } + function tagOpenAttributeValueQuotedAfter(code) { + if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { + return tagOpenBetween(code); + } + return nok(code); + } + function end(code) { + if (code === 62) { + effects.consume(code); + effects.exit("htmlTextData"); + effects.exit("htmlText"); + return ok; + } + return nok(code); + } + function lineEndingBefore(code) { + effects.exit("htmlTextData"); + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return lineEndingAfter; + } + function lineEndingAfter(code) { + return markdownSpace(code) ? factorySpace( + effects, + lineEndingAfterPrefix, + "linePrefix", + self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(code) : lineEndingAfterPrefix(code); + } + function lineEndingAfterPrefix(code) { + effects.enter("htmlTextData"); + return returnState(code); + } +} +const labelEnd = { + name: "labelEnd", + tokenize: tokenizeLabelEnd, + resolveTo: resolveToLabelEnd, + resolveAll: resolveAllLabelEnd +}; +const resourceConstruct = { + tokenize: tokenizeResource +}; +const referenceFullConstruct = { + tokenize: tokenizeReferenceFull +}; +const referenceCollapsedConstruct = { + tokenize: tokenizeReferenceCollapsed +}; +function resolveAllLabelEnd(events) { + let index2 = -1; + while (++index2 < events.length) { + const token = events[index2][1]; + if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd") { + events.splice(index2 + 1, token.type === "labelImage" ? 4 : 2); + token.type = "data"; + index2++; + } + } + return events; +} +function resolveToLabelEnd(events, context) { + let index2 = events.length; + let offset = 0; + let token; + let open; + let close; + let media; + while (index2--) { + token = events[index2][1]; + if (open) { + if (token.type === "link" || token.type === "labelLink" && token._inactive) { + break; + } + if (events[index2][0] === "enter" && token.type === "labelLink") { + token._inactive = true; + } + } else if (close) { + if (events[index2][0] === "enter" && (token.type === "labelImage" || token.type === "labelLink") && !token._balanced) { + open = index2; + if (token.type !== "labelLink") { + offset = 2; + break; + } + } + } else if (token.type === "labelEnd") { + close = index2; + } + } + const group = { + type: events[open][1].type === "labelLink" ? "link" : "image", + start: Object.assign({}, events[open][1].start), + end: Object.assign({}, events[events.length - 1][1].end) + }; + const label = { + type: "label", + start: Object.assign({}, events[open][1].start), + end: Object.assign({}, events[close][1].end) + }; + const text2 = { + type: "labelText", + start: Object.assign({}, events[open + offset + 2][1].end), + end: Object.assign({}, events[close - 2][1].start) + }; + media = [ + ["enter", group, context], + ["enter", label, context] + ]; + media = push(media, events.slice(open + 1, open + offset + 3)); + media = push(media, [["enter", text2, context]]); + media = push( + media, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + offset + 4, close - 3), + context + ) + ); + media = push(media, [ + ["exit", text2, context], + events[close - 2], + events[close - 1], + ["exit", label, context] + ]); + media = push(media, events.slice(close + 1)); + media = push(media, [["exit", group, context]]); + splice(events, open, events.length, media); + return events; +} +function tokenizeLabelEnd(effects, ok, nok) { + const self = this; + let index2 = self.events.length; + let labelStart; + let defined; + while (index2--) { + if ((self.events[index2][1].type === "labelImage" || self.events[index2][1].type === "labelLink") && !self.events[index2][1]._balanced) { + labelStart = self.events[index2][1]; + break; + } + } + return start; + function start(code) { + if (!labelStart) { + return nok(code); + } + if (labelStart._inactive) { + return labelEndNok(code); + } + defined = self.parser.defined.includes( + normalizeIdentifier( + self.sliceSerialize({ + start: labelStart.end, + end: self.now() + }) + ) + ); + effects.enter("labelEnd"); + effects.enter("labelMarker"); + effects.consume(code); + effects.exit("labelMarker"); + effects.exit("labelEnd"); + return after; + } + function after(code) { + if (code === 40) { + return effects.attempt( + resourceConstruct, + labelEndOk, + defined ? labelEndOk : labelEndNok + )(code); + } + if (code === 91) { + return effects.attempt( + referenceFullConstruct, + labelEndOk, + defined ? referenceNotFull : labelEndNok + )(code); + } + return defined ? labelEndOk(code) : labelEndNok(code); + } + function referenceNotFull(code) { + return effects.attempt( + referenceCollapsedConstruct, + labelEndOk, + labelEndNok + )(code); + } + function labelEndOk(code) { + return ok(code); + } + function labelEndNok(code) { + labelStart._balanced = true; + return nok(code); + } +} +function tokenizeResource(effects, ok, nok) { + return resourceStart; + function resourceStart(code) { + effects.enter("resource"); + effects.enter("resourceMarker"); + effects.consume(code); + effects.exit("resourceMarker"); + return resourceBefore; + } + function resourceBefore(code) { + return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code); + } + function resourceOpen(code) { + if (code === 41) { + return resourceEnd(code); + } + return factoryDestination( + effects, + resourceDestinationAfter, + resourceDestinationMissing, + "resourceDestination", + "resourceDestinationLiteral", + "resourceDestinationLiteralMarker", + "resourceDestinationRaw", + "resourceDestinationString", + 32 + )(code); + } + function resourceDestinationAfter(code) { + return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code); + } + function resourceDestinationMissing(code) { + return nok(code); + } + function resourceBetween(code) { + if (code === 34 || code === 39 || code === 40) { + return factoryTitle( + effects, + resourceTitleAfter, + nok, + "resourceTitle", + "resourceTitleMarker", + "resourceTitleString" + )(code); + } + return resourceEnd(code); + } + function resourceTitleAfter(code) { + return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code); + } + function resourceEnd(code) { + if (code === 41) { + effects.enter("resourceMarker"); + effects.consume(code); + effects.exit("resourceMarker"); + effects.exit("resource"); + return ok; + } + return nok(code); + } +} +function tokenizeReferenceFull(effects, ok, nok) { + const self = this; + return referenceFull; + function referenceFull(code) { + return factoryLabel.call( + self, + effects, + referenceFullAfter, + referenceFullMissing, + "reference", + "referenceMarker", + "referenceString" + )(code); + } + function referenceFullAfter(code) { + return self.parser.defined.includes( + normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ) + ) ? ok(code) : nok(code); + } + function referenceFullMissing(code) { + return nok(code); + } +} +function tokenizeReferenceCollapsed(effects, ok, nok) { + return referenceCollapsedStart; + function referenceCollapsedStart(code) { + effects.enter("reference"); + effects.enter("referenceMarker"); + effects.consume(code); + effects.exit("referenceMarker"); + return referenceCollapsedOpen; + } + function referenceCollapsedOpen(code) { + if (code === 93) { + effects.enter("referenceMarker"); + effects.consume(code); + effects.exit("referenceMarker"); + effects.exit("reference"); + return ok; + } + return nok(code); + } +} +const labelStartImage = { + name: "labelStartImage", + tokenize: tokenizeLabelStartImage, + resolveAll: labelEnd.resolveAll +}; +function tokenizeLabelStartImage(effects, ok, nok) { + const self = this; + return start; + function start(code) { + effects.enter("labelImage"); + effects.enter("labelImageMarker"); + effects.consume(code); + effects.exit("labelImageMarker"); + return open; + } + function open(code) { + if (code === 91) { + effects.enter("labelMarker"); + effects.consume(code); + effects.exit("labelMarker"); + effects.exit("labelImage"); + return after; + } + return nok(code); + } + function after(code) { + return code === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code) : ok(code); + } +} +const labelStartLink = { + name: "labelStartLink", + tokenize: tokenizeLabelStartLink, + resolveAll: labelEnd.resolveAll +}; +function tokenizeLabelStartLink(effects, ok, nok) { + const self = this; + return start; + function start(code) { + effects.enter("labelLink"); + effects.enter("labelMarker"); + effects.consume(code); + effects.exit("labelMarker"); + effects.exit("labelLink"); + return after; + } + function after(code) { + return code === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code) : ok(code); + } +} +const lineEnding = { + name: "lineEnding", + tokenize: tokenizeLineEnding +}; +function tokenizeLineEnding(effects, ok) { + return start; + function start(code) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return factorySpace(effects, ok, "linePrefix"); + } +} +const thematicBreak = { + name: "thematicBreak", + tokenize: tokenizeThematicBreak +}; +function tokenizeThematicBreak(effects, ok, nok) { + let size = 0; + let marker; + return start; + function start(code) { + effects.enter("thematicBreak"); + return before(code); + } + function before(code) { + marker = code; + return atBreak(code); + } + function atBreak(code) { + if (code === marker) { + effects.enter("thematicBreakSequence"); + return sequence(code); + } + if (size >= 3 && (code === null || markdownLineEnding(code))) { + effects.exit("thematicBreak"); + return ok(code); + } + return nok(code); + } + function sequence(code) { + if (code === marker) { + effects.consume(code); + size++; + return sequence; + } + effects.exit("thematicBreakSequence"); + return markdownSpace(code) ? factorySpace(effects, atBreak, "whitespace")(code) : atBreak(code); + } +} +const list = { + name: "list", + tokenize: tokenizeListStart, + continuation: { + tokenize: tokenizeListContinuation + }, + exit: tokenizeListEnd +}; +const listItemPrefixWhitespaceConstruct = { + tokenize: tokenizeListItemPrefixWhitespace, + partial: true +}; +const indentConstruct = { + tokenize: tokenizeIndent, + partial: true +}; +function tokenizeListStart(effects, ok, nok) { + const self = this; + const tail = self.events[self.events.length - 1]; + let initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + let size = 0; + return start; + function start(code) { + const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? "listUnordered" : "listOrdered"); + if (kind === "listUnordered" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) { + if (!self.containerState.type) { + self.containerState.type = kind; + effects.enter(kind, { + _container: true + }); + } + if (kind === "listUnordered") { + effects.enter("listItemPrefix"); + return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code); + } + if (!self.interrupt || code === 49) { + effects.enter("listItemPrefix"); + effects.enter("listItemValue"); + return inside(code); + } + } + return nok(code); + } + function inside(code) { + if (asciiDigit(code) && ++size < 10) { + effects.consume(code); + return inside; + } + if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) { + effects.exit("listItemValue"); + return atMarker(code); + } + return nok(code); + } + function atMarker(code) { + effects.enter("listItemMarker"); + effects.consume(code); + effects.exit("listItemMarker"); + self.containerState.marker = self.containerState.marker || code; + return effects.check( + blankLine, + // Can’t be empty when interrupting. + self.interrupt ? nok : onBlank, + effects.attempt( + listItemPrefixWhitespaceConstruct, + endOfPrefix, + otherPrefix + ) + ); + } + function onBlank(code) { + self.containerState.initialBlankLine = true; + initialSize++; + return endOfPrefix(code); + } + function otherPrefix(code) { + if (markdownSpace(code)) { + effects.enter("listItemPrefixWhitespace"); + effects.consume(code); + effects.exit("listItemPrefixWhitespace"); + return endOfPrefix; + } + return nok(code); + } + function endOfPrefix(code) { + self.containerState.size = initialSize + self.sliceSerialize(effects.exit("listItemPrefix"), true).length; + return ok(code); + } +} +function tokenizeListContinuation(effects, ok, nok) { + const self = this; + self.containerState._closeFlow = void 0; + return effects.check(blankLine, onBlank, notBlank); + function onBlank(code) { + self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine; + return factorySpace( + effects, + ok, + "listItemIndent", + self.containerState.size + 1 + )(code); + } + function notBlank(code) { + if (self.containerState.furtherBlankLines || !markdownSpace(code)) { + self.containerState.furtherBlankLines = void 0; + self.containerState.initialBlankLine = void 0; + return notInCurrentItem(code); + } + self.containerState.furtherBlankLines = void 0; + self.containerState.initialBlankLine = void 0; + return effects.attempt(indentConstruct, ok, notInCurrentItem)(code); + } + function notInCurrentItem(code) { + self.containerState._closeFlow = true; + self.interrupt = void 0; + return factorySpace( + effects, + effects.attempt(list, ok, nok), + "linePrefix", + self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(code); + } +} +function tokenizeIndent(effects, ok, nok) { + const self = this; + return factorySpace( + effects, + afterPrefix, + "listItemIndent", + self.containerState.size + 1 + ); + function afterPrefix(code) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "listItemIndent" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code); + } +} +function tokenizeListEnd(effects) { + effects.exit(this.containerState.type); +} +function tokenizeListItemPrefixWhitespace(effects, ok, nok) { + const self = this; + return factorySpace( + effects, + afterPrefix, + "listItemPrefixWhitespace", + self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1 + ); + function afterPrefix(code) { + const tail = self.events[self.events.length - 1]; + return !markdownSpace(code) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok(code) : nok(code); + } +} +const setextUnderline = { + name: "setextUnderline", + tokenize: tokenizeSetextUnderline, + resolveTo: resolveToSetextUnderline +}; +function resolveToSetextUnderline(events, context) { + let index2 = events.length; + let content2; + let text2; + let definition2; + while (index2--) { + if (events[index2][0] === "enter") { + if (events[index2][1].type === "content") { + content2 = index2; + break; + } + if (events[index2][1].type === "paragraph") { + text2 = index2; + } + } else { + if (events[index2][1].type === "content") { + events.splice(index2, 1); + } + if (!definition2 && events[index2][1].type === "definition") { + definition2 = index2; + } + } + } + const heading = { + type: "setextHeading", + start: Object.assign({}, events[text2][1].start), + end: Object.assign({}, events[events.length - 1][1].end) + }; + events[text2][1].type = "setextHeadingText"; + if (definition2) { + events.splice(text2, 0, ["enter", heading, context]); + events.splice(definition2 + 1, 0, ["exit", events[content2][1], context]); + events[content2][1].end = Object.assign({}, events[definition2][1].end); + } else { + events[content2][1] = heading; + } + events.push(["exit", heading, context]); + return events; +} +function tokenizeSetextUnderline(effects, ok, nok) { + const self = this; + let marker; + return start; + function start(code) { + let index2 = self.events.length; + let paragraph; + while (index2--) { + if (self.events[index2][1].type !== "lineEnding" && self.events[index2][1].type !== "linePrefix" && self.events[index2][1].type !== "content") { + paragraph = self.events[index2][1].type === "paragraph"; + break; + } + } + if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) { + effects.enter("setextHeadingLine"); + marker = code; + return before(code); + } + return nok(code); + } + function before(code) { + effects.enter("setextHeadingLineSequence"); + return inside(code); + } + function inside(code) { + if (code === marker) { + effects.consume(code); + return inside; + } + effects.exit("setextHeadingLineSequence"); + return markdownSpace(code) ? factorySpace(effects, after, "lineSuffix")(code) : after(code); + } + function after(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("setextHeadingLine"); + return ok(code); + } + return nok(code); + } +} +const flow$1 = { + tokenize: initializeFlow +}; +function initializeFlow(effects) { + const self = this; + const initial = effects.attempt( + // Try to parse a blank line. + blankLine, + atBlankEnding, + // Try to parse initial flow (essentially, only code). + effects.attempt( + this.parser.constructs.flowInitial, + afterConstruct, + factorySpace( + effects, + effects.attempt( + this.parser.constructs.flow, + afterConstruct, + effects.attempt(content, afterConstruct) + ), + "linePrefix" + ) + ) + ); + return initial; + function atBlankEnding(code) { + if (code === null) { + effects.consume(code); + return; + } + effects.enter("lineEndingBlank"); + effects.consume(code); + effects.exit("lineEndingBlank"); + self.currentConstruct = void 0; + return initial; + } + function afterConstruct(code) { + if (code === null) { + effects.consume(code); + return; + } + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + self.currentConstruct = void 0; + return initial; + } +} +const resolver = { + resolveAll: createResolver() +}; +const string$1 = initializeFactory("string"); +const text$1 = initializeFactory("text"); +function initializeFactory(field) { + return { + tokenize: initializeText, + resolveAll: createResolver( + field === "text" ? resolveAllLineSuffixes : void 0 + ) + }; + function initializeText(effects) { + const self = this; + const constructs2 = this.parser.constructs[field]; + const text2 = effects.attempt(constructs2, start, notText); + return start; + function start(code) { + return atBreak(code) ? text2(code) : notText(code); + } + function notText(code) { + if (code === null) { + effects.consume(code); + return; + } + effects.enter("data"); + effects.consume(code); + return data; + } + function data(code) { + if (atBreak(code)) { + effects.exit("data"); + return text2(code); + } + effects.consume(code); + return data; + } + function atBreak(code) { + if (code === null) { + return true; + } + const list2 = constructs2[code]; + let index2 = -1; + if (list2) { + while (++index2 < list2.length) { + const item = list2[index2]; + if (!item.previous || item.previous.call(self, self.previous)) { + return true; + } + } + } + return false; + } + } +} +function createResolver(extraResolver) { + return resolveAllText; + function resolveAllText(events, context) { + let index2 = -1; + let enter; + while (++index2 <= events.length) { + if (enter === void 0) { + if (events[index2] && events[index2][1].type === "data") { + enter = index2; + index2++; + } + } else if (!events[index2] || events[index2][1].type !== "data") { + if (index2 !== enter + 2) { + events[enter][1].end = events[index2 - 1][1].end; + events.splice(enter + 2, index2 - enter - 2); + index2 = enter + 2; + } + enter = void 0; + } + } + return extraResolver ? extraResolver(events, context) : events; + } +} +function resolveAllLineSuffixes(events, context) { + let eventIndex = 0; + while (++eventIndex <= events.length) { + if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") { + const data = events[eventIndex - 1][1]; + const chunks = context.sliceStream(data); + let index2 = chunks.length; + let bufferIndex = -1; + let size = 0; + let tabs; + while (index2--) { + const chunk = chunks[index2]; + if (typeof chunk === "string") { + bufferIndex = chunk.length; + while (chunk.charCodeAt(bufferIndex - 1) === 32) { + size++; + bufferIndex--; + } + if (bufferIndex) + break; + bufferIndex = -1; + } else if (chunk === -2) { + tabs = true; + size++; + } else if (chunk === -1) + ; + else { + index2++; + break; + } + } + if (size) { + const token = { + type: eventIndex === events.length || tabs || size < 2 ? "lineSuffix" : "hardBreakTrailing", + start: { + line: data.end.line, + column: data.end.column - size, + offset: data.end.offset - size, + _index: data.start._index + index2, + _bufferIndex: index2 ? bufferIndex : data.start._bufferIndex + bufferIndex + }, + end: Object.assign({}, data.end) + }; + data.end = Object.assign({}, token.start); + if (data.start.offset === data.end.offset) { + Object.assign(data, token); + } else { + events.splice( + eventIndex, + 0, + ["enter", token, context], + ["exit", token, context] + ); + eventIndex += 2; + } + } + eventIndex++; + } + } + return events; +} +function createTokenizer(parser, initialize, from) { + let point2 = Object.assign( + from ? Object.assign({}, from) : { + line: 1, + column: 1, + offset: 0 + }, + { + _index: 0, + _bufferIndex: -1 + } + ); + const columnStart = {}; + const resolveAllConstructs = []; + let chunks = []; + let stack = []; + const effects = { + consume, + enter, + exit: exit2, + attempt: constructFactory(onsuccessfulconstruct), + check: constructFactory(onsuccessfulcheck), + interrupt: constructFactory(onsuccessfulcheck, { + interrupt: true + }) + }; + const context = { + previous: null, + code: null, + containerState: {}, + events: [], + parser, + sliceStream, + sliceSerialize, + now, + defineSkip, + write + }; + let state = initialize.tokenize.call(context, effects); + if (initialize.resolveAll) { + resolveAllConstructs.push(initialize); + } + return context; + function write(slice) { + chunks = push(chunks, slice); + main(); + if (chunks[chunks.length - 1] !== null) { + return []; + } + addResult(initialize, 0); + context.events = resolveAll(resolveAllConstructs, context.events, context); + return context.events; + } + function sliceSerialize(token, expandTabs) { + return serializeChunks(sliceStream(token), expandTabs); + } + function sliceStream(token) { + return sliceChunks(chunks, token); + } + function now() { + const { line, column, offset, _index, _bufferIndex } = point2; + return { + line, + column, + offset, + _index, + _bufferIndex + }; + } + function defineSkip(value) { + columnStart[value.line] = value.column; + accountForPotentialSkip(); + } + function main() { + let chunkIndex; + while (point2._index < chunks.length) { + const chunk = chunks[point2._index]; + if (typeof chunk === "string") { + chunkIndex = point2._index; + if (point2._bufferIndex < 0) { + point2._bufferIndex = 0; + } + while (point2._index === chunkIndex && point2._bufferIndex < chunk.length) { + go(chunk.charCodeAt(point2._bufferIndex)); + } + } else { + go(chunk); + } + } + } + function go(code) { + state = state(code); + } + function consume(code) { + if (markdownLineEnding(code)) { + point2.line++; + point2.column = 1; + point2.offset += code === -3 ? 2 : 1; + accountForPotentialSkip(); + } else if (code !== -1) { + point2.column++; + point2.offset++; + } + if (point2._bufferIndex < 0) { + point2._index++; + } else { + point2._bufferIndex++; + if (point2._bufferIndex === chunks[point2._index].length) { + point2._bufferIndex = -1; + point2._index++; + } + } + context.previous = code; + } + function enter(type, fields) { + const token = fields || {}; + token.type = type; + token.start = now(); + context.events.push(["enter", token, context]); + stack.push(token); + return token; + } + function exit2(type) { + const token = stack.pop(); + token.end = now(); + context.events.push(["exit", token, context]); + return token; + } + function onsuccessfulconstruct(construct, info) { + addResult(construct, info.from); + } + function onsuccessfulcheck(_, info) { + info.restore(); + } + function constructFactory(onreturn, fields) { + return hook; + function hook(constructs2, returnState, bogusState) { + let listOfConstructs; + let constructIndex; + let currentConstruct; + let info; + return Array.isArray(constructs2) ? handleListOfConstructs(constructs2) : "tokenize" in constructs2 ? ( + // @ts-expect-error Looks like a construct. + handleListOfConstructs([constructs2]) + ) : handleMapOfConstructs(constructs2); + function handleMapOfConstructs(map) { + return start; + function start(code) { + const def = code !== null && map[code]; + const all2 = code !== null && map.null; + const list2 = [ + // To do: add more extension tests. + /* c8 ignore next 2 */ + ...Array.isArray(def) ? def : def ? [def] : [], + ...Array.isArray(all2) ? all2 : all2 ? [all2] : [] + ]; + return handleListOfConstructs(list2)(code); + } + } + function handleListOfConstructs(list2) { + listOfConstructs = list2; + constructIndex = 0; + if (list2.length === 0) { + return bogusState; + } + return handleConstruct(list2[constructIndex]); + } + function handleConstruct(construct) { + return start; + function start(code) { + info = store(); + currentConstruct = construct; + if (!construct.partial) { + context.currentConstruct = construct; + } + if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) { + return nok(); + } + return construct.tokenize.call( + // If we do have fields, create an object w/ `context` as its + // prototype. + // This allows a “live binding”, which is needed for `interrupt`. + fields ? Object.assign(Object.create(context), fields) : context, + effects, + ok, + nok + )(code); + } + } + function ok(code) { + onreturn(currentConstruct, info); + return returnState; + } + function nok(code) { + info.restore(); + if (++constructIndex < listOfConstructs.length) { + return handleConstruct(listOfConstructs[constructIndex]); + } + return bogusState; + } + } + } + function addResult(construct, from2) { + if (construct.resolveAll && !resolveAllConstructs.includes(construct)) { + resolveAllConstructs.push(construct); + } + if (construct.resolve) { + splice( + context.events, + from2, + context.events.length - from2, + construct.resolve(context.events.slice(from2), context) + ); + } + if (construct.resolveTo) { + context.events = construct.resolveTo(context.events, context); + } + } + function store() { + const startPoint = now(); + const startPrevious = context.previous; + const startCurrentConstruct = context.currentConstruct; + const startEventsIndex = context.events.length; + const startStack = Array.from(stack); + return { + restore, + from: startEventsIndex + }; + function restore() { + point2 = startPoint; + context.previous = startPrevious; + context.currentConstruct = startCurrentConstruct; + context.events.length = startEventsIndex; + stack = startStack; + accountForPotentialSkip(); + } + } + function accountForPotentialSkip() { + if (point2.line in columnStart && point2.column < 2) { + point2.column = columnStart[point2.line]; + point2.offset += columnStart[point2.line] - 1; + } + } +} +function sliceChunks(chunks, token) { + const startIndex = token.start._index; + const startBufferIndex = token.start._bufferIndex; + const endIndex = token.end._index; + const endBufferIndex = token.end._bufferIndex; + let view; + if (startIndex === endIndex) { + view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; + } else { + view = chunks.slice(startIndex, endIndex); + if (startBufferIndex > -1) { + const head = view[0]; + if (typeof head === "string") { + view[0] = head.slice(startBufferIndex); + } else { + view.shift(); + } + } + if (endBufferIndex > 0) { + view.push(chunks[endIndex].slice(0, endBufferIndex)); + } + } + return view; +} +function serializeChunks(chunks, expandTabs) { + let index2 = -1; + const result = []; + let atTab; + while (++index2 < chunks.length) { + const chunk = chunks[index2]; + let value; + if (typeof chunk === "string") { + value = chunk; + } else + switch (chunk) { + case -5: { + value = "\r"; + break; + } + case -4: { + value = "\n"; + break; + } + case -3: { + value = "\r\n"; + break; + } + case -2: { + value = expandTabs ? " " : " "; + break; + } + case -1: { + if (!expandTabs && atTab) + continue; + value = " "; + break; + } + default: { + value = String.fromCharCode(chunk); + } + } + atTab = chunk === -2; + result.push(value); + } + return result.join(""); +} +const document$1 = { + [42]: list, + [43]: list, + [45]: list, + [48]: list, + [49]: list, + [50]: list, + [51]: list, + [52]: list, + [53]: list, + [54]: list, + [55]: list, + [56]: list, + [57]: list, + [62]: blockQuote +}; +const contentInitial = { + [91]: definition +}; +const flowInitial = { + [-2]: codeIndented, + [-1]: codeIndented, + [32]: codeIndented +}; +const flow = { + [35]: headingAtx, + [42]: thematicBreak, + [45]: [setextUnderline, thematicBreak], + [60]: htmlFlow, + [61]: setextUnderline, + [95]: thematicBreak, + [96]: codeFenced, + [126]: codeFenced +}; +const string = { + [38]: characterReference, + [92]: characterEscape +}; +const text = { + [-5]: lineEnding, + [-4]: lineEnding, + [-3]: lineEnding, + [33]: labelStartImage, + [38]: characterReference, + [42]: attention, + [60]: [autolink, htmlText], + [91]: labelStartLink, + [92]: [hardBreakEscape, characterEscape], + [93]: labelEnd, + [95]: attention, + [96]: codeText +}; +const insideSpan = { + null: [attention, resolver] +}; +const attentionMarkers = { + null: [42, 95] +}; +const disable = { + null: [] +}; +const defaultConstructs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + attentionMarkers, + contentInitial, + disable, + document: document$1, + flow, + flowInitial, + insideSpan, + string, + text +}, Symbol.toStringTag, { value: "Module" })); +function parse(options) { + const settings = options || {}; + const constructs2 = ( + /** @type {FullNormalizedExtension} */ + combineExtensions([defaultConstructs, ...settings.extensions || []]) + ); + const parser = { + defined: [], + lazy: {}, + constructs: constructs2, + content: create(content$1), + document: create(document$2), + flow: create(flow$1), + string: create(string$1), + text: create(text$1) + }; + return parser; + function create(initial) { + return creator; + function creator(from) { + return createTokenizer(parser, initial, from); + } + } +} +const search = /[\0\t\n\r]/g; +function preprocess() { + let column = 1; + let buffer = ""; + let start = true; + let atCarriageReturn; + return preprocessor; + function preprocessor(value, encoding, end) { + const chunks = []; + let match; + let next; + let startPosition; + let endPosition; + let code; + value = buffer + value.toString(encoding); + startPosition = 0; + buffer = ""; + if (start) { + if (value.charCodeAt(0) === 65279) { + startPosition++; + } + start = void 0; + } + while (startPosition < value.length) { + search.lastIndex = startPosition; + match = search.exec(value); + endPosition = match && match.index !== void 0 ? match.index : value.length; + code = value.charCodeAt(endPosition); + if (!match) { + buffer = value.slice(startPosition); + break; + } + if (code === 10 && startPosition === endPosition && atCarriageReturn) { + chunks.push(-3); + atCarriageReturn = void 0; + } else { + if (atCarriageReturn) { + chunks.push(-5); + atCarriageReturn = void 0; + } + if (startPosition < endPosition) { + chunks.push(value.slice(startPosition, endPosition)); + column += endPosition - startPosition; + } + switch (code) { + case 0: { + chunks.push(65533); + column++; + break; + } + case 9: { + next = Math.ceil(column / 4) * 4; + chunks.push(-2); + while (column++ < next) + chunks.push(-1); + break; + } + case 10: { + chunks.push(-4); + column = 1; + break; + } + default: { + atCarriageReturn = true; + column = 1; + } + } + } + startPosition = endPosition + 1; + } + if (end) { + if (atCarriageReturn) + chunks.push(-5); + if (buffer) + chunks.push(buffer); + chunks.push(null); + } + return chunks; + } +} +function postprocess(events) { + while (!subtokenize(events)) { + } + return events; +} +function decodeNumericCharacterReference(value, base) { + const code = Number.parseInt(value, base); + if ( + // C0 except for HT, LF, FF, CR, space. + code < 9 || code === 11 || code > 13 && code < 32 || // Control character (DEL) of C0, and C1 controls. + code > 126 && code < 160 || // Lone high surrogates and low surrogates. + code > 55295 && code < 57344 || // Noncharacters. + code > 64975 && code < 65008 || (code & 65535) === 65535 || (code & 65535) === 65534 || // Out of range + code > 1114111 + ) { + return "�"; + } + return String.fromCharCode(code); +} +const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; +function decodeString(value) { + return value.replace(characterEscapeOrReference, decode); +} +function decode($0, $1, $2) { + if ($1) { + return $1; + } + const head = $2.charCodeAt(0); + if (head === 35) { + const head2 = $2.charCodeAt(1); + const hex = head2 === 120 || head2 === 88; + return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10); + } + return decodeNamedCharacterReference($2) || $0; +} +function stringifyPosition(value) { + if (!value || typeof value !== "object") { + return ""; + } + if ("position" in value || "type" in value) { + return position(value.position); + } + if ("start" in value || "end" in value) { + return position(value); + } + if ("line" in value || "column" in value) { + return point$1(value); + } + return ""; +} +function point$1(point2) { + return index(point2 && point2.line) + ":" + index(point2 && point2.column); +} +function position(pos) { + return point$1(pos && pos.start) + "-" + point$1(pos && pos.end); +} +function index(value) { + return value && typeof value === "number" ? value : 1; +} +const own = {}.hasOwnProperty; +const fromMarkdown = ( + /** + * @type {( + * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) & + * ((value: Value, options?: Options | null | undefined) => Root) + * )} + */ + /** + * @param {Value} value + * @param {Encoding | Options | null | undefined} [encoding] + * @param {Options | null | undefined} [options] + * @returns {Root} + */ + function(value, encoding, options) { + if (typeof encoding !== "string") { + options = encoding; + encoding = void 0; + } + return compiler(options)( + postprocess( + parse(options).document().write(preprocess()(value, encoding, true)) + ) + ); + } +); +function compiler(options) { + const config = { + transforms: [], + canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"], + enter: { + autolink: opener(link), + autolinkProtocol: onenterdata, + autolinkEmail: onenterdata, + atxHeading: opener(heading), + blockQuote: opener(blockQuote2), + characterEscape: onenterdata, + characterReference: onenterdata, + codeFenced: opener(codeFlow), + codeFencedFenceInfo: buffer, + codeFencedFenceMeta: buffer, + codeIndented: opener(codeFlow, buffer), + codeText: opener(codeText2, buffer), + codeTextData: onenterdata, + data: onenterdata, + codeFlowValue: onenterdata, + definition: opener(definition2), + definitionDestinationString: buffer, + definitionLabelString: buffer, + definitionTitleString: buffer, + emphasis: opener(emphasis), + hardBreakEscape: opener(hardBreak), + hardBreakTrailing: opener(hardBreak), + htmlFlow: opener(html, buffer), + htmlFlowData: onenterdata, + htmlText: opener(html, buffer), + htmlTextData: onenterdata, + image: opener(image), + label: buffer, + link: opener(link), + listItem: opener(listItem), + listItemValue: onenterlistitemvalue, + listOrdered: opener(list2, onenterlistordered), + listUnordered: opener(list2), + paragraph: opener(paragraph), + reference: onenterreference, + referenceString: buffer, + resourceDestinationString: buffer, + resourceTitleString: buffer, + setextHeading: opener(heading), + strong: opener(strong), + thematicBreak: opener(thematicBreak2) + }, + exit: { + atxHeading: closer(), + atxHeadingSequence: onexitatxheadingsequence, + autolink: closer(), + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: closer(), + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: closer(onexitcodefenced), + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: onexitcodefencedfencemeta, + codeFlowValue: onexitdata, + codeIndented: closer(onexitcodeindented), + codeText: closer(onexitcodetext), + codeTextData: onexitdata, + data: onexitdata, + definition: closer(), + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: closer(), + hardBreakEscape: closer(onexithardbreak), + hardBreakTrailing: closer(onexithardbreak), + htmlFlow: closer(onexithtmlflow), + htmlFlowData: onexitdata, + htmlText: closer(onexithtmltext), + htmlTextData: onexitdata, + image: closer(onexitimage), + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: closer(onexitlink), + listItem: closer(), + listOrdered: closer(), + listUnordered: closer(), + paragraph: closer(), + referenceString: onexitreferencestring, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + resource: onexitresource, + setextHeading: closer(onexitsetextheading), + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: closer(), + thematicBreak: closer() + } + }; + configure(config, (options || {}).mdastExtensions || []); + const data = {}; + return compile; + function compile(events) { + let tree = { + type: "root", + children: [] + }; + const context = { + stack: [tree], + tokenStack: [], + config, + enter, + exit: exit2, + buffer, + resume, + setData, + getData + }; + const listStack = []; + let index2 = -1; + while (++index2 < events.length) { + if (events[index2][1].type === "listOrdered" || events[index2][1].type === "listUnordered") { + if (events[index2][0] === "enter") { + listStack.push(index2); + } else { + const tail = listStack.pop(); + index2 = prepareList(events, tail, index2); + } + } + } + index2 = -1; + while (++index2 < events.length) { + const handler = config[events[index2][0]]; + if (own.call(handler, events[index2][1].type)) { + handler[events[index2][1].type].call( + Object.assign( + { + sliceSerialize: events[index2][2].sliceSerialize + }, + context + ), + events[index2][1] + ); + } + } + if (context.tokenStack.length > 0) { + const tail = context.tokenStack[context.tokenStack.length - 1]; + const handler = tail[1] || defaultOnError; + handler.call(context, void 0, tail[0]); + } + tree.position = { + start: point( + events.length > 0 ? events[0][1].start : { + line: 1, + column: 1, + offset: 0 + } + ), + end: point( + events.length > 0 ? events[events.length - 2][1].end : { + line: 1, + column: 1, + offset: 0 + } + ) + }; + index2 = -1; + while (++index2 < config.transforms.length) { + tree = config.transforms[index2](tree) || tree; + } + return tree; + } + function prepareList(events, start, length) { + let index2 = start - 1; + let containerBalance = -1; + let listSpread = false; + let listItem2; + let lineIndex; + let firstBlankLineIndex; + let atMarker; + while (++index2 <= length) { + const event = events[index2]; + if (event[1].type === "listUnordered" || event[1].type === "listOrdered" || event[1].type === "blockQuote") { + if (event[0] === "enter") { + containerBalance++; + } else { + containerBalance--; + } + atMarker = void 0; + } else if (event[1].type === "lineEndingBlank") { + if (event[0] === "enter") { + if (listItem2 && !atMarker && !containerBalance && !firstBlankLineIndex) { + firstBlankLineIndex = index2; + } + atMarker = void 0; + } + } else if (event[1].type === "linePrefix" || event[1].type === "listItemValue" || event[1].type === "listItemMarker" || event[1].type === "listItemPrefix" || event[1].type === "listItemPrefixWhitespace") + ; + else { + atMarker = void 0; + } + if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) { + if (listItem2) { + let tailIndex = index2; + lineIndex = void 0; + while (tailIndex--) { + const tailEvent = events[tailIndex]; + if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") { + if (tailEvent[0] === "exit") + continue; + if (lineIndex) { + events[lineIndex][1].type = "lineEndingBlank"; + listSpread = true; + } + tailEvent[1].type = "lineEnding"; + lineIndex = tailIndex; + } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") + ; + else { + break; + } + } + if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) { + listItem2._spread = true; + } + listItem2.end = Object.assign( + {}, + lineIndex ? events[lineIndex][1].start : event[1].end + ); + events.splice(lineIndex || index2, 0, ["exit", listItem2, event[2]]); + index2++; + length++; + } + if (event[1].type === "listItemPrefix") { + listItem2 = { + type: "listItem", + _spread: false, + start: Object.assign({}, event[1].start), + // @ts-expect-error: we’ll add `end` in a second. + end: void 0 + }; + events.splice(index2, 0, ["enter", listItem2, event[2]]); + index2++; + length++; + firstBlankLineIndex = void 0; + atMarker = true; + } + } + } + events[start][1]._spread = listSpread; + return length; + } + function setData(key, value) { + data[key] = value; + } + function getData(key) { + return data[key]; + } + function opener(create, and) { + return open; + function open(token) { + enter.call(this, create(token), token); + if (and) + and.call(this, token); + } + } + function buffer() { + this.stack.push({ + type: "fragment", + children: [] + }); + } + function enter(node2, token, errorHandler) { + const parent = this.stack[this.stack.length - 1]; + parent.children.push(node2); + this.stack.push(node2); + this.tokenStack.push([token, errorHandler]); + node2.position = { + start: point(token.start) + }; + return node2; + } + function closer(and) { + return close; + function close(token) { + if (and) + and.call(this, token); + exit2.call(this, token); + } + } + function exit2(token, onExitError) { + const node2 = this.stack.pop(); + const open = this.tokenStack.pop(); + if (!open) { + throw new Error( + "Cannot close `" + token.type + "` (" + stringifyPosition({ + start: token.start, + end: token.end + }) + "): it’s not open" + ); + } else if (open[0].type !== token.type) { + if (onExitError) { + onExitError.call(this, token, open[0]); + } else { + const handler = open[1] || defaultOnError; + handler.call(this, token, open[0]); + } + } + node2.position.end = point(token.end); + return node2; + } + function resume() { + return toString(this.stack.pop()); + } + function onenterlistordered() { + setData("expectingFirstListItemValue", true); + } + function onenterlistitemvalue(token) { + if (getData("expectingFirstListItemValue")) { + const ancestor = this.stack[this.stack.length - 2]; + ancestor.start = Number.parseInt(this.sliceSerialize(token), 10); + setData("expectingFirstListItemValue"); + } + } + function onexitcodefencedfenceinfo() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.lang = data2; + } + function onexitcodefencedfencemeta() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.meta = data2; + } + function onexitcodefencedfence() { + if (getData("flowCodeInside")) + return; + this.buffer(); + setData("flowCodeInside", true); + } + function onexitcodefenced() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.value = data2.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""); + setData("flowCodeInside"); + } + function onexitcodeindented() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.value = data2.replace(/(\r?\n|\r)$/g, ""); + } + function onexitdefinitionlabelstring(token) { + const label = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.label = label; + node2.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase(); + } + function onexitdefinitiontitlestring() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.title = data2; + } + function onexitdefinitiondestinationstring() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.url = data2; + } + function onexitatxheadingsequence(token) { + const node2 = this.stack[this.stack.length - 1]; + if (!node2.depth) { + const depth = this.sliceSerialize(token).length; + node2.depth = depth; + } + } + function onexitsetextheadingtext() { + setData("setextHeadingSlurpLineEnding", true); + } + function onexitsetextheadinglinesequence(token) { + const node2 = this.stack[this.stack.length - 1]; + node2.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2; + } + function onexitsetextheading() { + setData("setextHeadingSlurpLineEnding"); + } + function onenterdata(token) { + const node2 = this.stack[this.stack.length - 1]; + let tail = node2.children[node2.children.length - 1]; + if (!tail || tail.type !== "text") { + tail = text2(); + tail.position = { + start: point(token.start) + }; + node2.children.push(tail); + } + this.stack.push(tail); + } + function onexitdata(token) { + const tail = this.stack.pop(); + tail.value += this.sliceSerialize(token); + tail.position.end = point(token.end); + } + function onexitlineending(token) { + const context = this.stack[this.stack.length - 1]; + if (getData("atHardBreak")) { + const tail = context.children[context.children.length - 1]; + tail.position.end = point(token.end); + setData("atHardBreak"); + return; + } + if (!getData("setextHeadingSlurpLineEnding") && config.canContainEols.includes(context.type)) { + onenterdata.call(this, token); + onexitdata.call(this, token); + } + } + function onexithardbreak() { + setData("atHardBreak", true); + } + function onexithtmlflow() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.value = data2; + } + function onexithtmltext() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.value = data2; + } + function onexitcodetext() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.value = data2; + } + function onexitlink() { + const node2 = this.stack[this.stack.length - 1]; + if (getData("inReference")) { + const referenceType = getData("referenceType") || "shortcut"; + node2.type += "Reference"; + node2.referenceType = referenceType; + delete node2.url; + delete node2.title; + } else { + delete node2.identifier; + delete node2.label; + } + setData("referenceType"); + } + function onexitimage() { + const node2 = this.stack[this.stack.length - 1]; + if (getData("inReference")) { + const referenceType = getData("referenceType") || "shortcut"; + node2.type += "Reference"; + node2.referenceType = referenceType; + delete node2.url; + delete node2.title; + } else { + delete node2.identifier; + delete node2.label; + } + setData("referenceType"); + } + function onexitlabeltext(token) { + const string2 = this.sliceSerialize(token); + const ancestor = this.stack[this.stack.length - 2]; + ancestor.label = decodeString(string2); + ancestor.identifier = normalizeIdentifier(string2).toLowerCase(); + } + function onexitlabel() { + const fragment = this.stack[this.stack.length - 1]; + const value = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + setData("inReference", true); + if (node2.type === "link") { + const children = fragment.children; + node2.children = children; + } else { + node2.alt = value; + } + } + function onexitresourcedestinationstring() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.url = data2; + } + function onexitresourcetitlestring() { + const data2 = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.title = data2; + } + function onexitresource() { + setData("inReference"); + } + function onenterreference() { + setData("referenceType", "collapsed"); + } + function onexitreferencestring(token) { + const label = this.resume(); + const node2 = this.stack[this.stack.length - 1]; + node2.label = label; + node2.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase(); + setData("referenceType", "full"); + } + function onexitcharacterreferencemarker(token) { + setData("characterReferenceType", token.type); + } + function onexitcharacterreferencevalue(token) { + const data2 = this.sliceSerialize(token); + const type = getData("characterReferenceType"); + let value; + if (type) { + value = decodeNumericCharacterReference( + data2, + type === "characterReferenceMarkerNumeric" ? 10 : 16 + ); + setData("characterReferenceType"); + } else { + const result = decodeNamedCharacterReference(data2); + value = result; + } + const tail = this.stack.pop(); + tail.value += value; + tail.position.end = point(token.end); + } + function onexitautolinkprotocol(token) { + onexitdata.call(this, token); + const node2 = this.stack[this.stack.length - 1]; + node2.url = this.sliceSerialize(token); + } + function onexitautolinkemail(token) { + onexitdata.call(this, token); + const node2 = this.stack[this.stack.length - 1]; + node2.url = "mailto:" + this.sliceSerialize(token); + } + function blockQuote2() { + return { + type: "blockquote", + children: [] + }; + } + function codeFlow() { + return { + type: "code", + lang: null, + meta: null, + value: "" + }; + } + function codeText2() { + return { + type: "inlineCode", + value: "" + }; + } + function definition2() { + return { + type: "definition", + identifier: "", + label: null, + title: null, + url: "" + }; + } + function emphasis() { + return { + type: "emphasis", + children: [] + }; + } + function heading() { + return { + type: "heading", + depth: void 0, + children: [] + }; + } + function hardBreak() { + return { + type: "break" + }; + } + function html() { + return { + type: "html", + value: "" + }; + } + function image() { + return { + type: "image", + title: null, + url: "", + alt: null + }; + } + function link() { + return { + type: "link", + title: null, + url: "", + children: [] + }; + } + function list2(token) { + return { + type: "list", + ordered: token.type === "listOrdered", + start: null, + spread: token._spread, + children: [] + }; + } + function listItem(token) { + return { + type: "listItem", + spread: token._spread, + checked: null, + children: [] + }; + } + function paragraph() { + return { + type: "paragraph", + children: [] + }; + } + function strong() { + return { + type: "strong", + children: [] + }; + } + function text2() { + return { + type: "text", + value: "" + }; + } + function thematicBreak2() { + return { + type: "thematicBreak" + }; + } +} +function point(d) { + return { + line: d.line, + column: d.column, + offset: d.offset + }; +} +function configure(combined, extensions) { + let index2 = -1; + while (++index2 < extensions.length) { + const value = extensions[index2]; + if (Array.isArray(value)) { + configure(combined, value); + } else { + extension(combined, value); + } + } +} +function extension(combined, extension2) { + let key; + for (key in extension2) { + if (own.call(extension2, key)) { + if (key === "canContainEols") { + const right = extension2[key]; + if (right) { + combined[key].push(...right); + } + } else if (key === "transforms") { + const right = extension2[key]; + if (right) { + combined[key].push(...right); + } + } else if (key === "enter" || key === "exit") { + const right = extension2[key]; + if (right) { + Object.assign(combined[key], right); + } + } + } + } +} +function defaultOnError(left, right) { + if (left) { + throw new Error( + "Cannot close `" + left.type + "` (" + stringifyPosition({ + start: left.start, + end: left.end + }) + "): a different token (`" + right.type + "`, " + stringifyPosition({ + start: right.start, + end: right.end + }) + ") is open" + ); + } else { + throw new Error( + "Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({ + start: right.start, + end: right.end + }) + ") is still open" + ); + } +} +function preprocessMarkdown(markdown) { + const withoutMultipleNewlines = markdown.replace(/\n{2,}/g, "\n"); + const withoutExtraSpaces = dedent(withoutMultipleNewlines); + return withoutExtraSpaces; +} +function markdownToLines(markdown) { + const preprocessedMarkdown = preprocessMarkdown(markdown); + const { children } = fromMarkdown(preprocessedMarkdown); + const lines = [[]]; + let currentLine = 0; + function processNode(node2, parentType = "normal") { + if (node2.type === "text") { + const textLines = node2.value.split("\n"); + textLines.forEach((textLine, index2) => { + if (index2 !== 0) { + currentLine++; + lines.push([]); + } + textLine.split(" ").forEach((word) => { + if (word) { + lines[currentLine].push({ content: word, type: parentType }); + } + }); + }); + } else if (node2.type === "strong" || node2.type === "emphasis") { + node2.children.forEach((contentNode) => { + processNode(contentNode, node2.type); + }); + } + } + children.forEach((treeNode) => { + if (treeNode.type === "paragraph") { + treeNode.children.forEach((contentNode) => { + processNode(contentNode); + }); + } + }); + return lines; +} +function markdownToHTML(markdown) { + const { children } = fromMarkdown(markdown); + function output(node2) { + if (node2.type === "text") { + return node2.value.replace(/\n/g, "${node2.children.map(output).join("")}
`; + } + return `Unsupported markdown: ${node2.type}`; + } + return children.map(output).join(""); +} +function splitTextToChars(text2) { + if (Intl.Segmenter) { + return [...new Intl.Segmenter().segment(text2)].map((s) => s.segment); + } + return [...text2]; +} +function splitWordToFitWidth(checkFit, word) { + const characters = splitTextToChars(word.content); + return splitWordToFitWidthRecursion(checkFit, [], characters, word.type); +} +function splitWordToFitWidthRecursion(checkFit, usedChars, remainingChars, type) { + if (remainingChars.length === 0) { + return [ + { content: usedChars.join(""), type }, + { content: "", type } + ]; + } + const [nextChar, ...rest] = remainingChars; + const newWord = [...usedChars, nextChar]; + if (checkFit([{ content: newWord.join(""), type }])) { + return splitWordToFitWidthRecursion(checkFit, newWord, rest, type); + } + if (usedChars.length === 0 && nextChar) { + usedChars.push(nextChar); + remainingChars.shift(); + } + return [ + { content: usedChars.join(""), type }, + { content: remainingChars.join(""), type } + ]; +} +function splitLineToFitWidth(line, checkFit) { + if (line.some(({ content: content2 }) => content2.includes("\n"))) { + throw new Error("splitLineToFitWidth does not support newlines in the line"); + } + return splitLineToFitWidthRecursion(line, checkFit); +} +function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) { + if (words.length === 0) { + if (newLine.length > 0) { + lines.push(newLine); + } + return lines.length > 0 ? lines : []; + } + let joiner = ""; + if (words[0].content === " ") { + joiner = " "; + words.shift(); + } + const nextWord = words.shift() ?? { content: " ", type: "normal" }; + const lineWithNextWord = [...newLine]; + if (joiner !== "") { + lineWithNextWord.push({ content: joiner, type: "normal" }); + } + lineWithNextWord.push(nextWord); + if (checkFit(lineWithNextWord)) { + return splitLineToFitWidthRecursion(words, checkFit, lines, lineWithNextWord); + } + if (newLine.length > 0) { + lines.push(newLine); + words.unshift(nextWord); + } else if (nextWord.content) { + const [line, rest] = splitWordToFitWidth(checkFit, nextWord); + lines.push([line]); + if (rest.content) { + words.unshift(rest); + } + } + return splitLineToFitWidthRecursion(words, checkFit, lines); +} +function applyStyle(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); + } +} +function addHtmlSpan(element2, node2, width, classes, addBackground = false) { + const fo = element2.append("foreignObject"); + const div = fo.append("xhtml:div"); + const label = node2.label; + const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel"; + div.html( + ` + " + label + "" + ); + applyStyle(div, node2.labelStyle); + div.style("display", "table-cell"); + div.style("white-space", "nowrap"); + div.style("max-width", width + "px"); + div.attr("xmlns", "http://www.w3.org/1999/xhtml"); + if (addBackground) { + div.attr("class", "labelBkg"); + } + let bbox = div.node().getBoundingClientRect(); + if (bbox.width === width) { + div.style("display", "table"); + div.style("white-space", "break-spaces"); + div.style("width", width + "px"); + bbox = div.node().getBoundingClientRect(); + } + fo.style("width", bbox.width); + fo.style("height", bbox.height); + return fo.node(); +} +function createTspan(textElement, lineIndex, lineHeight) { + return textElement.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", lineIndex * lineHeight - 0.1 + "em").attr("dy", lineHeight + "em"); +} +function computeWidthOfText(parentNode, lineHeight, line) { + const testElement = parentNode.append("text"); + const testSpan = createTspan(testElement, 1, lineHeight); + updateTextContentAndStyles(testSpan, line); + const textLength = testSpan.node().getComputedTextLength(); + testElement.remove(); + return textLength; +} +function computeDimensionOfText(parentNode, lineHeight, text2) { + var _a; + const testElement = parentNode.append("text"); + const testSpan = createTspan(testElement, 1, lineHeight); + updateTextContentAndStyles(testSpan, [{ content: text2, type: "normal" }]); + const textDimension = (_a = testSpan.node()) == null ? void 0 : _a.getBoundingClientRect(); + if (textDimension) { + testElement.remove(); + } + return textDimension; +} +function createFormattedText(width, g, structuredText, addBackground = false) { + const lineHeight = 1.1; + const labelGroup = g.append("g"); + const bkg = labelGroup.insert("rect").attr("class", "background"); + const textElement = labelGroup.append("text").attr("y", "-10.1"); + let lineIndex = 0; + for (const line of structuredText) { + const checkWidth = (line2) => computeWidthOfText(labelGroup, lineHeight, line2) <= width; + const linesUnderWidth = checkWidth(line) ? [line] : splitLineToFitWidth(line, checkWidth); + for (const preparedLine of linesUnderWidth) { + const tspan = createTspan(textElement, lineIndex, lineHeight); + updateTextContentAndStyles(tspan, preparedLine); + lineIndex++; + } + } + if (addBackground) { + const bbox = textElement.node().getBBox(); + const padding = 2; + bkg.attr("x", -padding).attr("y", -padding).attr("width", bbox.width + 2 * padding).attr("height", bbox.height + 2 * padding); + return labelGroup.node(); + } else { + return textElement.node(); + } +} +function updateTextContentAndStyles(tspan, wrappedLine) { + tspan.text(""); + wrappedLine.forEach((word, index2) => { + const innerTspan = tspan.append("tspan").attr("font-style", word.type === "emphasis" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", word.type === "strong" ? "bold" : "normal"); + if (index2 === 0) { + innerTspan.text(word.content); + } else { + innerTspan.text(" " + word.content); + } + }); +} +const createText = (el, text2 = "", { + style = "", + isTitle = false, + classes = "", + useHtmlLabels = true, + isNode = true, + width = 200, + addSvgBackground = false +} = {}) => { + log.info("createText", text2, style, isTitle, classes, useHtmlLabels, isNode, addSvgBackground); + if (useHtmlLabels) { + const htmlText2 = markdownToHTML(text2); + const node2 = { + isNode, + label: decodeEntities(htmlText2).replace( + /fa[blrs]?:fa-[\w-]+/g, + // cspell: disable-line + (s) => `` + ), + labelStyle: style.replace("fill:", "color:") + }; + const vertexNode = addHtmlSpan(el, node2, width, classes, addSvgBackground); + return vertexNode; + } else { + const structuredText = markdownToLines(text2); + const svgLabel = createFormattedText(width, el, structuredText, addSvgBackground); + return svgLabel; + } +}; +export { + createText as a, + computeDimensionOfText as c +}; diff --git a/assets/lib/mermaid/createText-ca0c5216.js b/assets/lib/mermaid/createText-ca0c5216.js new file mode 100644 index 00000000..f0810a25 --- /dev/null +++ b/assets/lib/mermaid/createText-ca0c5216.js @@ -0,0 +1,251 @@ +import { l as log, M as decodeEntities } from "./mermaid-6dc72991.js"; +import { fromMarkdown } from "mdast-util-from-markdown"; +import { dedent } from "ts-dedent"; +function preprocessMarkdown(markdown) { + const withoutMultipleNewlines = markdown.replace(/\n{2,}/g, "\n"); + const withoutExtraSpaces = dedent(withoutMultipleNewlines); + return withoutExtraSpaces; +} +function markdownToLines(markdown) { + const preprocessedMarkdown = preprocessMarkdown(markdown); + const { children } = fromMarkdown(preprocessedMarkdown); + const lines = [[]]; + let currentLine = 0; + function processNode(node, parentType = "normal") { + if (node.type === "text") { + const textLines = node.value.split("\n"); + textLines.forEach((textLine, index) => { + if (index !== 0) { + currentLine++; + lines.push([]); + } + textLine.split(" ").forEach((word) => { + if (word) { + lines[currentLine].push({ content: word, type: parentType }); + } + }); + }); + } else if (node.type === "strong" || node.type === "emphasis") { + node.children.forEach((contentNode) => { + processNode(contentNode, node.type); + }); + } + } + children.forEach((treeNode) => { + if (treeNode.type === "paragraph") { + treeNode.children.forEach((contentNode) => { + processNode(contentNode); + }); + } + }); + return lines; +} +function markdownToHTML(markdown) { + const { children } = fromMarkdown(markdown); + function output(node) { + if (node.type === "text") { + return node.value.replace(/\n/g, "${node.children.map(output).join("")}
`; + } + return `Unsupported markdown: ${node.type}`; + } + return children.map(output).join(""); +} +function splitTextToChars(text) { + if (Intl.Segmenter) { + return [...new Intl.Segmenter().segment(text)].map((s) => s.segment); + } + return [...text]; +} +function splitWordToFitWidth(checkFit, word) { + const characters = splitTextToChars(word.content); + return splitWordToFitWidthRecursion(checkFit, [], characters, word.type); +} +function splitWordToFitWidthRecursion(checkFit, usedChars, remainingChars, type) { + if (remainingChars.length === 0) { + return [ + { content: usedChars.join(""), type }, + { content: "", type } + ]; + } + const [nextChar, ...rest] = remainingChars; + const newWord = [...usedChars, nextChar]; + if (checkFit([{ content: newWord.join(""), type }])) { + return splitWordToFitWidthRecursion(checkFit, newWord, rest, type); + } + if (usedChars.length === 0 && nextChar) { + usedChars.push(nextChar); + remainingChars.shift(); + } + return [ + { content: usedChars.join(""), type }, + { content: remainingChars.join(""), type } + ]; +} +function splitLineToFitWidth(line, checkFit) { + if (line.some(({ content }) => content.includes("\n"))) { + throw new Error("splitLineToFitWidth does not support newlines in the line"); + } + return splitLineToFitWidthRecursion(line, checkFit); +} +function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) { + if (words.length === 0) { + if (newLine.length > 0) { + lines.push(newLine); + } + return lines.length > 0 ? lines : []; + } + let joiner = ""; + if (words[0].content === " ") { + joiner = " "; + words.shift(); + } + const nextWord = words.shift() ?? { content: " ", type: "normal" }; + const lineWithNextWord = [...newLine]; + if (joiner !== "") { + lineWithNextWord.push({ content: joiner, type: "normal" }); + } + lineWithNextWord.push(nextWord); + if (checkFit(lineWithNextWord)) { + return splitLineToFitWidthRecursion(words, checkFit, lines, lineWithNextWord); + } + if (newLine.length > 0) { + lines.push(newLine); + words.unshift(nextWord); + } else if (nextWord.content) { + const [line, rest] = splitWordToFitWidth(checkFit, nextWord); + lines.push([line]); + if (rest.content) { + words.unshift(rest); + } + } + return splitLineToFitWidthRecursion(words, checkFit, lines); +} +function applyStyle(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); + } +} +function addHtmlSpan(element, node, width, classes, addBackground = false) { + const fo = element.append("foreignObject"); + const div = fo.append("xhtml:div"); + const label = node.label; + const labelClass = node.isNode ? "nodeLabel" : "edgeLabel"; + div.html( + ` + " + label + "" + ); + applyStyle(div, node.labelStyle); + div.style("display", "table-cell"); + div.style("white-space", "nowrap"); + div.style("max-width", width + "px"); + div.attr("xmlns", "http://www.w3.org/1999/xhtml"); + if (addBackground) { + div.attr("class", "labelBkg"); + } + let bbox = div.node().getBoundingClientRect(); + if (bbox.width === width) { + div.style("display", "table"); + div.style("white-space", "break-spaces"); + div.style("width", width + "px"); + bbox = div.node().getBoundingClientRect(); + } + fo.style("width", bbox.width); + fo.style("height", bbox.height); + return fo.node(); +} +function createTspan(textElement, lineIndex, lineHeight) { + return textElement.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", lineIndex * lineHeight - 0.1 + "em").attr("dy", lineHeight + "em"); +} +function computeWidthOfText(parentNode, lineHeight, line) { + const testElement = parentNode.append("text"); + const testSpan = createTspan(testElement, 1, lineHeight); + updateTextContentAndStyles(testSpan, line); + const textLength = testSpan.node().getComputedTextLength(); + testElement.remove(); + return textLength; +} +function computeDimensionOfText(parentNode, lineHeight, text) { + var _a; + const testElement = parentNode.append("text"); + const testSpan = createTspan(testElement, 1, lineHeight); + updateTextContentAndStyles(testSpan, [{ content: text, type: "normal" }]); + const textDimension = (_a = testSpan.node()) == null ? void 0 : _a.getBoundingClientRect(); + if (textDimension) { + testElement.remove(); + } + return textDimension; +} +function createFormattedText(width, g, structuredText, addBackground = false) { + const lineHeight = 1.1; + const labelGroup = g.append("g"); + const bkg = labelGroup.insert("rect").attr("class", "background"); + const textElement = labelGroup.append("text").attr("y", "-10.1"); + let lineIndex = 0; + for (const line of structuredText) { + const checkWidth = (line2) => computeWidthOfText(labelGroup, lineHeight, line2) <= width; + const linesUnderWidth = checkWidth(line) ? [line] : splitLineToFitWidth(line, checkWidth); + for (const preparedLine of linesUnderWidth) { + const tspan = createTspan(textElement, lineIndex, lineHeight); + updateTextContentAndStyles(tspan, preparedLine); + lineIndex++; + } + } + if (addBackground) { + const bbox = textElement.node().getBBox(); + const padding = 2; + bkg.attr("x", -padding).attr("y", -padding).attr("width", bbox.width + 2 * padding).attr("height", bbox.height + 2 * padding); + return labelGroup.node(); + } else { + return textElement.node(); + } +} +function updateTextContentAndStyles(tspan, wrappedLine) { + tspan.text(""); + wrappedLine.forEach((word, index) => { + const innerTspan = tspan.append("tspan").attr("font-style", word.type === "emphasis" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", word.type === "strong" ? "bold" : "normal"); + if (index === 0) { + innerTspan.text(word.content); + } else { + innerTspan.text(" " + word.content); + } + }); +} +const createText = (el, text = "", { + style = "", + isTitle = false, + classes = "", + useHtmlLabels = true, + isNode = true, + width = 200, + addSvgBackground = false +} = {}) => { + log.info("createText", text, style, isTitle, classes, useHtmlLabels, isNode, addSvgBackground); + if (useHtmlLabels) { + const htmlText = markdownToHTML(text); + const node = { + isNode, + label: decodeEntities(htmlText).replace( + /fa[blrs]?:fa-[\w-]+/g, + // cspell: disable-line + (s) => `` + ), + labelStyle: style.replace("fill:", "color:") + }; + const vertexNode = addHtmlSpan(el, node, width, classes, addSvgBackground); + return vertexNode; + } else { + const structuredText = markdownToLines(text); + const svgLabel = createFormattedText(width, el, structuredText, addSvgBackground); + return svgLabel; + } +}; +export { + createText as a, + computeDimensionOfText as c +}; diff --git a/assets/lib/mermaid/edges-066a5561.js b/assets/lib/mermaid/edges-066a5561.js new file mode 100644 index 00000000..aee0212f --- /dev/null +++ b/assets/lib/mermaid/edges-066a5561.js @@ -0,0 +1,1840 @@ +import { l as log, m as evaluate, c as getConfig, M as decodeEntities, d as sanitizeText, u as utils } from "./mermaid-6dc72991.js"; +import { select, line, curveBasis } from "d3"; +import { a as createText } from "./createText-ca0c5216.js"; +const insertMarkers = (elem, markerArray, type, id) => { + markerArray.forEach((markerName) => { + markers[markerName](elem, type, id); + }); +}; +const extension = (elem, type, id) => { + log.trace("Making markers for ", id); + elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionStart").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); + elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd").attr("class", "marker extension " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); +}; +const composition = (elem, type, id) => { + elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart").attr("class", "marker composition " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd").attr("class", "marker composition " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); +}; +const aggregation = (elem, type, id) => { + elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart").attr("class", "marker aggregation " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd").attr("class", "marker aggregation " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); +}; +const dependency = (elem, type, id) => { + elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart").attr("class", "marker dependency " + type).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd").attr("class", "marker dependency " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); +}; +const lollipop = (elem, type, id) => { + elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); + elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); +}; +const point = (elem, type, id) => { + elem.append("marker").attr("id", id + "_" + type + "-pointEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id + "_" + type + "-pointStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); +}; +const circle$1 = (elem, type, id) => { + elem.append("marker").attr("id", id + "_" + type + "-circleEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id + "_" + type + "-circleStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); +}; +const cross = (elem, type, id) => { + elem.append("marker").attr("id", id + "_" + type + "-crossEnd").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id + "_" + type + "-crossStart").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); +}; +const barb = (elem, type, id) => { + elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); +}; +const markers = { + extension, + composition, + aggregation, + dependency, + lollipop, + point, + circle: circle$1, + cross, + barb +}; +const insertMarkers$1 = insertMarkers; +function applyStyle(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); + } +} +function addHtmlLabel(node) { + const fo = select(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")); + const div = fo.append("xhtml:div"); + const label = node.label; + const labelClass = node.isNode ? "nodeLabel" : "edgeLabel"; + div.html( + '" + label + "" + ); + applyStyle(div, node.labelStyle); + div.style("display", "inline-block"); + div.style("white-space", "nowrap"); + div.attr("xmlns", "http://www.w3.org/1999/xhtml"); + return fo.node(); +} +const createLabel = (_vertexText, style, isTitle, isNode) => { + let vertexText = _vertexText || ""; + if (typeof vertexText === "object") { + vertexText = vertexText[0]; + } + if (evaluate(getConfig().flowchart.htmlLabels)) { + vertexText = vertexText.replace(/\\n|\n/g, "y.args);SX(b),d=id(d,[...b])}else d=u.args;if(!d)return;let p=_X(i,s);const v="config";return d[v]!==void 0&&(p==="flowchart-v2"&&(p="flowchart"),d[p]=d[v],delete d[v]),d},fje=function(i,s=null){try{const u=new RegExp(`[%]{2}(?![{]${mRt.source})(?=[}][%]{2}).*
-`,"ig");i=i.trim().replace(u,"").replace(/'/gm,'"'),Xe.debug(`Detecting diagram directive${s!==null?" type:"+s:""} based on the text:${i}`);let d;const p=[];for(;(d=UF.exec(i))!==null;)if(d.index===UF.lastIndex&&UF.lastIndex++,d&&!s||s&&d[1]&&d[1].match(s)||s&&d[2]&&d[2].match(s)){const v=d[1]?d[1]:d[2],b=d[3]?d[3].trim():d[4]?JSON.parse(d[4].trim()):null;p.push({type:v,args:b})}return p.length===0?{type:i,args:null}:p.length===1?p[0]:p}catch(u){return Xe.error(`ERROR: ${u.message} - Unable to parse directive type: '${s}' based on the text: '${i}'`),{type:void 0,args:null}}},wRt=function(i){return i.replace(UF,"")},yRt=function(i,s){for(const[u,d]of s.entries())if(d.match(i))return u;return-1};function Ov(i,s){if(!i)return s;const u=`curve${i.charAt(0).toUpperCase()+i.slice(1)}`;return bRt[u]??s}function xRt(i,s){const u=i.trim();if(u)return s.securityLevel!=="loose"?p9.sanitizeUrl(u):u}const kRt=(i,...s)=>{const u=i.split("."),d=u.length-1,p=u[d];let v=window;for(let b=0;b p?R=new jv(u,y):u==p&&d =A?R=new jv(u+i.width,y+A*i.width/2):R=new jv(b+T/_*i.height/2,d+i.height):u v?P>=A?R=new jv(u+i.width,y-A*i.width/2):R=new jv(b+i.height/2*T/_,d):u>p&&d>v&&(P>=A?R=new jv(u,y-i.width/2*A):R=new jv(b-i.height/2*T/_,d)),R},mUt=function(i,s){let u={x:0,y:0};u.x=s.x+s.width/2,u.y=s.y+s.height/2;let d=Mqe(i,u);u.x=i.x+i.width/2,u.y=i.y+i.height/2;let p=Mqe(s,u);return{startPoint:d,endPoint:p}};const vUt=function(i,s,u,d){let p=0;for(let v of s){p=p+1;let b=v.wrap&&$s.wrap,y=bUt($s);d.db.getC4Type()==="C4Dynamic"&&(v.label.text=p+": "+v.label.text);let _=H4(v.label.text,y);$3("label",v,b,y,_),v.techn&&v.techn.text!==""&&(_=H4(v.techn.text,y),$3("techn",v,b,y,_)),v.descr&&v.descr.text!==""&&(_=H4(v.descr.text,y),$3("descr",v,b,y,_));let A=u(v.from),P=u(v.to),R=mUt(A,P);v.startPoint=R.startPoint,v.endPoint=R.endPoint}J4.drawRels(i,s,$s)};function Dqe(i,s,u,d,p){let v=new _qe(p);v.data.widthLimit=u.data.widthLimit/Math.min(Hbe,d.length);for(let[b,y]of d.entries()){let T=0;y.image={width:0,height:0,Y:0},y.sprite&&(y.image.width=48,y.image.height=48,y.image.Y=T,T=y.image.Y+y.image.height);let _=y.wrap&&$s.wrap,A=DQ($s);if(A.fontSize=A.fontSize+2,A.fontWeight="bold",$3("label",y,_,A,v.data.widthLimit),y.label.Y=T+8,T=y.label.Y+y.label.height,y.type&&y.type.text!==""){y.type.text="["+y.type.text+"]";let j=DQ($s);$3("type",y,_,j,v.data.widthLimit),y.type.Y=T+5,T=y.type.Y+y.type.height}if(y.descr&&y.descr.text!==""){let j=DQ($s);j.fontSize=j.fontSize-2,$3("descr",y,_,j,v.data.widthLimit),y.descr.Y=T+20,T=y.descr.Y+y.descr.height}if(b==0||b%Hbe===0){let j=u.data.startx+$s.diagramMarginX,K=u.data.stopy+$s.diagramMarginY+T;v.setData(j,j,K,K)}else{let j=v.data.stopx!==v.data.startx?v.data.stopx+$s.diagramMarginX:v.data.startx,K=v.data.starty;v.setData(j,j,K,K)}v.name=y.alias;let P=p.db.getC4ShapeArray(y.alias),R=p.db.getC4ShapeKeys(y.alias);R.length>0&&Lqe(v,i,P,R),s=y.alias;let F=p.db.getBoundarys(s);F.length>0&&Dqe(i,s,v,F,p),y.alias!=="global"&&Aqe(i,y,v),u.data.stopy=Math.max(v.data.stopy+$s.c4ShapeMargin,u.data.stopy),u.data.stopx=Math.max(v.data.stopx+$s.c4ShapeMargin,u.data.stopx),LQ=Math.max(LQ,u.data.stopx),MQ=Math.max(MQ,u.data.stopy)}}const Iqe={drawPersonOrSystemArray:Lqe,drawBoundary:Aqe,setConf:Vbe,draw:function(i,s,u,d){$s=qt().c4;const p=qt().securityLevel;let v;p==="sandbox"&&(v=Ir("#i"+s));const b=Ir(p==="sandbox"?v.nodes()[0].contentDocument.body:"body");let y=d.db;d.db.setWrap($s.wrap),Sqe=y.getC4ShapeInRow(),Hbe=y.getC4BoundaryInRow(),Xe.debug(`C:${JSON.stringify($s,null,2)}`);const T=p==="sandbox"?b.select(`[id="${s}"]`):Ir(`[id="${s}"]`);J4.insertComputerIcon(T),J4.insertDatabaseIcon(T),J4.insertClockIcon(T);let _=new _qe(d);_.setData($s.diagramMarginX,$s.diagramMarginX,$s.diagramMarginY,$s.diagramMarginY),_.data.widthLimit=screen.availWidth,LQ=$s.diagramMarginX,MQ=$s.diagramMarginY;const A=d.db.getTitle();let P=d.db.getBoundarys("");Dqe(T,"",_,P,d),J4.insertArrowHead(T),J4.insertArrowEnd(T),J4.insertArrowCrossHead(T),J4.insertArrowFilledHead(T),vUt(T,d.db.getRels(),d.db.getC4Shape,d),_.data.stopx=LQ,_.data.stopy=MQ;const R=_.data;let j=R.stopy-R.starty+2*$s.diagramMarginY;const ee=R.stopx-R.startx+2*$s.diagramMarginX;A&&T.append("text").text(A).attr("x",(R.stopx-R.startx)/2-4*$s.diagramMarginX).attr("y",R.starty+$s.diagramMarginY),Ng(T,j,ee,$s.useMaxWidth);const ie=A?60:0;T.attr("viewBox",R.startx-$s.diagramMarginX+" -"+($s.diagramMarginY+ie)+" "+ee+" "+(j+ie)),Xe.debug("models:",R)}},wUt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:DVt,db:$be,renderer:Iqe,styles:i=>`.person {
+`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var qn=this.next();return qn||this.lex()},begin:function(qn){this.conditionStack.push(qn)},popState:function(){var qn=this.conditionStack.length-1;return qn>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(qn){return qn=this.conditionStack.length-1-Math.abs(qn||0),qn>=0?this.conditionStack[qn]:"INITIAL"},pushState:function(qn){this.begin(qn)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(qn,Un,At,wt){switch(At){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return Tr}();Ma.lexer=zs;function ao(){this.yy={}}return ao.prototype=Ma,Ma.Parser=ao,new ao}();CQ.parser=CQ;const DVt=CQ;let R3=[],M9=[""],Op="global",j3="",Q4=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],pR=[],Rbe="",jbe=!1,SQ=4,_Q=2;var xqe;const IVt=function(){return xqe},OVt=function(i){xqe=Yf(i,qt())},NVt=function(i,s,u,d,p,v,b,y,T){if(i==null||s===void 0||s===null||u===void 0||u===null||d===void 0||d===null)return;let _={};const A=pR.find(P=>P.from===s&&P.to===u);if(A?_=A:pR.push(_),_.type=i,_.from=s,_.to=u,_.label={text:d},p==null)_.techn={text:""};else if(typeof p=="object"){let[P,R]=Object.entries(p)[0];_[P]={text:R}}else _.techn={text:p};if(v==null)_.descr={text:""};else if(typeof v=="object"){let[P,R]=Object.entries(v)[0];_[P]={text:R}}else _.descr={text:v};if(typeof b=="object"){let[P,R]=Object.entries(b)[0];_[P]=R}else _.sprite=b;if(typeof y=="object"){let[P,R]=Object.entries(y)[0];_[P]=R}else _.tags=y;if(typeof T=="object"){let[P,R]=Object.entries(T)[0];_[P]=R}else _.link=T;_.wrap=D9()},PVt=function(i,s,u,d,p,v,b){if(s===null||u===null)return;let y={};const T=R3.find(_=>_.alias===s);if(T&&s===T.alias?y=T:(y.alias=s,R3.push(y)),u==null?y.label={text:""}:y.label={text:u},d==null)y.descr={text:""};else if(typeof d=="object"){let[_,A]=Object.entries(d)[0];y[_]={text:A}}else y.descr={text:d};if(typeof p=="object"){let[_,A]=Object.entries(p)[0];y[_]=A}else y.sprite=p;if(typeof v=="object"){let[_,A]=Object.entries(v)[0];y[_]=A}else y.tags=v;if(typeof b=="object"){let[_,A]=Object.entries(b)[0];y[_]=A}else y.link=b;y.typeC4Shape={text:i},y.parentBoundary=Op,y.wrap=D9()},BVt=function(i,s,u,d,p,v,b,y){if(s===null||u===null)return;let T={};const _=R3.find(A=>A.alias===s);if(_&&s===_.alias?T=_:(T.alias=s,R3.push(T)),u==null?T.label={text:""}:T.label={text:u},d==null)T.techn={text:""};else if(typeof d=="object"){let[A,P]=Object.entries(d)[0];T[A]={text:P}}else T.techn={text:d};if(p==null)T.descr={text:""};else if(typeof p=="object"){let[A,P]=Object.entries(p)[0];T[A]={text:P}}else T.descr={text:p};if(typeof v=="object"){let[A,P]=Object.entries(v)[0];T[A]=P}else T.sprite=v;if(typeof b=="object"){let[A,P]=Object.entries(b)[0];T[A]=P}else T.tags=b;if(typeof y=="object"){let[A,P]=Object.entries(y)[0];T[A]=P}else T.link=y;T.wrap=D9(),T.typeC4Shape={text:i},T.parentBoundary=Op},FVt=function(i,s,u,d,p,v,b,y){if(s===null||u===null)return;let T={};const _=R3.find(A=>A.alias===s);if(_&&s===_.alias?T=_:(T.alias=s,R3.push(T)),u==null?T.label={text:""}:T.label={text:u},d==null)T.techn={text:""};else if(typeof d=="object"){let[A,P]=Object.entries(d)[0];T[A]={text:P}}else T.techn={text:d};if(p==null)T.descr={text:""};else if(typeof p=="object"){let[A,P]=Object.entries(p)[0];T[A]={text:P}}else T.descr={text:p};if(typeof v=="object"){let[A,P]=Object.entries(v)[0];T[A]=P}else T.sprite=v;if(typeof b=="object"){let[A,P]=Object.entries(b)[0];T[A]=P}else T.tags=b;if(typeof y=="object"){let[A,P]=Object.entries(y)[0];T[A]=P}else T.link=y;T.wrap=D9(),T.typeC4Shape={text:i},T.parentBoundary=Op},RVt=function(i,s,u,d,p){if(i===null||s===null)return;let v={};const b=Q4.find(y=>y.alias===i);if(b&&i===b.alias?v=b:(v.alias=i,Q4.push(v)),s==null?v.label={text:""}:v.label={text:s},u==null)v.type={text:"system"};else if(typeof u=="object"){let[y,T]=Object.entries(u)[0];v[y]={text:T}}else v.type={text:u};if(typeof d=="object"){let[y,T]=Object.entries(d)[0];v[y]=T}else v.tags=d;if(typeof p=="object"){let[y,T]=Object.entries(p)[0];v[y]=T}else v.link=p;v.parentBoundary=Op,v.wrap=D9(),j3=Op,Op=i,M9.push(j3)},jVt=function(i,s,u,d,p){if(i===null||s===null)return;let v={};const b=Q4.find(y=>y.alias===i);if(b&&i===b.alias?v=b:(v.alias=i,Q4.push(v)),s==null?v.label={text:""}:v.label={text:s},u==null)v.type={text:"container"};else if(typeof u=="object"){let[y,T]=Object.entries(u)[0];v[y]={text:T}}else v.type={text:u};if(typeof d=="object"){let[y,T]=Object.entries(d)[0];v[y]=T}else v.tags=d;if(typeof p=="object"){let[y,T]=Object.entries(p)[0];v[y]=T}else v.link=p;v.parentBoundary=Op,v.wrap=D9(),j3=Op,Op=i,M9.push(j3)},$Vt=function(i,s,u,d,p,v,b,y){if(s===null||u===null)return;let T={};const _=Q4.find(A=>A.alias===s);if(_&&s===_.alias?T=_:(T.alias=s,Q4.push(T)),u==null?T.label={text:""}:T.label={text:u},d==null)T.type={text:"node"};else if(typeof d=="object"){let[A,P]=Object.entries(d)[0];T[A]={text:P}}else T.type={text:d};if(p==null)T.descr={text:""};else if(typeof p=="object"){let[A,P]=Object.entries(p)[0];T[A]={text:P}}else T.descr={text:p};if(typeof b=="object"){let[A,P]=Object.entries(b)[0];T[A]=P}else T.tags=b;if(typeof y=="object"){let[A,P]=Object.entries(y)[0];T[A]=P}else T.link=y;T.nodeType=i,T.parentBoundary=Op,T.wrap=D9(),j3=Op,Op=s,M9.push(j3)},zVt=function(){Op=j3,M9.pop(),j3=M9.pop(),M9.push(j3)},qVt=function(i,s,u,d,p,v,b,y,T,_,A){let P=R3.find(R=>R.alias===s);if(!(P===void 0&&(P=Q4.find(R=>R.alias===s),P===void 0))){if(u!=null)if(typeof u=="object"){let[R,F]=Object.entries(u)[0];P[R]=F}else P.bgColor=u;if(d!=null)if(typeof d=="object"){let[R,F]=Object.entries(d)[0];P[R]=F}else P.fontColor=d;if(p!=null)if(typeof p=="object"){let[R,F]=Object.entries(p)[0];P[R]=F}else P.borderColor=p;if(v!=null)if(typeof v=="object"){let[R,F]=Object.entries(v)[0];P[R]=F}else P.shadowing=v;if(b!=null)if(typeof b=="object"){let[R,F]=Object.entries(b)[0];P[R]=F}else P.shape=b;if(y!=null)if(typeof y=="object"){let[R,F]=Object.entries(y)[0];P[R]=F}else P.sprite=y;if(T!=null)if(typeof T=="object"){let[R,F]=Object.entries(T)[0];P[R]=F}else P.techn=T;if(_!=null)if(typeof _=="object"){let[R,F]=Object.entries(_)[0];P[R]=F}else P.legendText=_;if(A!=null)if(typeof A=="object"){let[R,F]=Object.entries(A)[0];P[R]=F}else P.legendSprite=A}},HVt=function(i,s,u,d,p,v,b){const y=pR.find(T=>T.from===s&&T.to===u);if(y!==void 0){if(d!=null)if(typeof d=="object"){let[T,_]=Object.entries(d)[0];y[T]=_}else y.textColor=d;if(p!=null)if(typeof p=="object"){let[T,_]=Object.entries(p)[0];y[T]=_}else y.lineColor=p;if(v!=null)if(typeof v=="object"){let[T,_]=Object.entries(v)[0];y[T]=parseInt(_)}else y.offsetX=parseInt(v);if(b!=null)if(typeof b=="object"){let[T,_]=Object.entries(b)[0];y[T]=parseInt(_)}else y.offsetY=parseInt(b)}},VVt=function(i,s,u){let d=SQ,p=_Q;if(typeof s=="object"){const v=Object.values(s)[0];d=parseInt(v)}else d=parseInt(s);if(typeof u=="object"){const v=Object.values(u)[0];p=parseInt(v)}else p=parseInt(u);d>=1&&(SQ=d),p>=1&&(_Q=p)},UVt=function(){return SQ},GVt=function(){return _Q},KVt=function(){return Op},WVt=function(){return j3},kqe=function(i){return i==null?R3:R3.filter(s=>s.parentBoundary===i)},YVt=function(i){return R3.find(s=>s.alias===i)},XVt=function(i){return Object.keys(kqe(i))},Eqe=function(i){return i==null?Q4:Q4.filter(s=>s.parentBoundary===i)},QVt=Eqe,JVt=function(){return pR},ZVt=function(){return Rbe},eUt=function(i){jbe=i},D9=function(){return jbe},$be={addPersonOrSystem:PVt,addPersonOrSystemBoundary:RVt,addContainer:BVt,addContainerBoundary:jVt,addComponent:FVt,addDeploymentNode:$Vt,popBoundaryParseStack:zVt,addRel:NVt,updateElStyle:qVt,updateRelStyle:HVt,updateLayoutConfig:VVt,autoWrap:D9,setWrap:eUt,getC4ShapeArray:kqe,getC4Shape:YVt,getC4ShapeKeys:XVt,getBoundaries:Eqe,getBoundarys:QVt,getCurrentBoundaryParse:KVt,getParentBoundaryParse:WVt,getRels:JVt,getTitle:ZVt,getC4Type:IVt,getC4ShapeInRow:UVt,getC4BoundaryInRow:GVt,setAccTitle:Bg,getAccTitle:Cp,getAccDescription:_p,setAccDescription:Sp,getConfig:()=>qt().c4,clear:function(){R3=[],Q4=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],j3="",Op="global",M9=[""],pR=[],M9=[""],Rbe="",jbe=!1,SQ=4,_Q=2},LINETYPE:{SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:function(i){Rbe=Yf(i,qt())},setC4Type:OVt},AQ=(i,s)=>{const u=i.append("rect");if(u.attr("x",s.x),u.attr("y",s.y),u.attr("fill",s.fill),u.attr("stroke",s.stroke),u.attr("width",s.width),u.attr("height",s.height),s.name&&u.attr("name",s.name),s.rx!==void 0&&u.attr("rx",s.rx),s.ry!==void 0&&u.attr("ry",s.ry),s.attrs!==void 0)for(const d in s.attrs)u.attr(d,s.attrs[d]);return s.class!==void 0&&u.attr("class",s.class),u},Tqe=(i,s)=>{const u={x:s.startx,y:s.starty,width:s.stopx-s.startx,height:s.stopy-s.starty,fill:s.fill,stroke:s.stroke,class:"rect"};AQ(i,u).lower()},tUt=(i,s)=>{const u=s.text.replace(fD," "),d=i.append("text");d.attr("x",s.x),d.attr("y",s.y),d.attr("class","legend"),d.style("text-anchor",s.anchor),s.class!==void 0&&d.attr("class",s.class);const p=d.append("tspan");return p.attr("x",s.x+s.textMargin*2),p.text(u),d},nUt=(i,s,u,d)=>{const p=i.append("image");p.attr("x",s),p.attr("y",u);const v=p9.sanitizeUrl(d);p.attr("xlink:href",v)},rUt=(i,s,u,d)=>{const p=i.append("use");p.attr("x",s),p.attr("y",u);const v=p9.sanitizeUrl(d);p.attr("xlink:href",`#${v}`)},qC=()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),zbe=()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),qbe=function(i,s){return AQ(i,s)},Cqe=function(i,s,u,d,p,v){const b=i.append("image");b.attr("width",s),b.attr("height",u),b.attr("x",d),b.attr("y",p);let y=v.startsWith("data:image/png;base64")?v:p9.sanitizeUrl(v);b.attr("xlink:href",y)},iUt=(i,s,u)=>{const d=i.append("g");let p=0;for(let v of s){let b=v.textColor?v.textColor:"#444444",y=v.lineColor?v.lineColor:"#444444",T=v.offsetX?parseInt(v.offsetX):0,_=v.offsetY?parseInt(v.offsetY):0,A="";if(p===0){let R=d.append("line");R.attr("x1",v.startPoint.x),R.attr("y1",v.startPoint.y),R.attr("x2",v.endPoint.x),R.attr("y2",v.endPoint.y),R.attr("stroke-width","1"),R.attr("stroke",y),R.style("fill","none"),v.type!=="rel_b"&&R.attr("marker-end","url("+A+"#arrowhead)"),(v.type==="birel"||v.type==="rel_b")&&R.attr("marker-start","url("+A+"#arrowend)"),p=-1}else{let R=d.append("path");R.attr("fill","none").attr("stroke-width","1").attr("stroke",y).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",v.startPoint.x).replaceAll("starty",v.startPoint.y).replaceAll("controlx",v.startPoint.x+(v.endPoint.x-v.startPoint.x)/2-(v.endPoint.x-v.startPoint.x)/4).replaceAll("controly",v.startPoint.y+(v.endPoint.y-v.startPoint.y)/2).replaceAll("stopx",v.endPoint.x).replaceAll("stopy",v.endPoint.y)),v.type!=="rel_b"&&R.attr("marker-end","url("+A+"#arrowhead)"),(v.type==="birel"||v.type==="rel_b")&&R.attr("marker-start","url("+A+"#arrowend)")}let P=u.messageFont();F7(u)(v.label.text,d,Math.min(v.startPoint.x,v.endPoint.x)+Math.abs(v.endPoint.x-v.startPoint.x)/2+T,Math.min(v.startPoint.y,v.endPoint.y)+Math.abs(v.endPoint.y-v.startPoint.y)/2+_,v.label.width,v.label.height,{fill:b},P),v.techn&&v.techn.text!==""&&(P=u.messageFont(),F7(u)("["+v.techn.text+"]",d,Math.min(v.startPoint.x,v.endPoint.x)+Math.abs(v.endPoint.x-v.startPoint.x)/2+T,Math.min(v.startPoint.y,v.endPoint.y)+Math.abs(v.endPoint.y-v.startPoint.y)/2+u.messageFontSize+5+_,Math.max(v.label.width,v.techn.width),v.techn.height,{fill:b,"font-style":"italic"},P))}},sUt=function(i,s,u){const d=i.append("g");let p=s.bgColor?s.bgColor:"none",v=s.borderColor?s.borderColor:"#444444",b=s.fontColor?s.fontColor:"black",y={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};s.nodeType&&(y={"stroke-width":1});let T={x:s.x,y:s.y,fill:p,stroke:v,width:s.width,height:s.height,rx:2.5,ry:2.5,attrs:y};qbe(d,T);let _=u.boundaryFont();_.fontWeight="bold",_.fontSize=_.fontSize+2,_.fontColor=b,F7(u)(s.label.text,d,s.x,s.y+s.label.Y,s.width,s.height,{fill:"#444444"},_),s.type&&s.type.text!==""&&(_=u.boundaryFont(),_.fontColor=b,F7(u)(s.type.text,d,s.x,s.y+s.type.Y,s.width,s.height,{fill:"#444444"},_)),s.descr&&s.descr.text!==""&&(_=u.boundaryFont(),_.fontSize=_.fontSize-2,_.fontColor=b,F7(u)(s.descr.text,d,s.x,s.y+s.descr.Y,s.width,s.height,{fill:"#444444"},_))},aUt=function(i,s,u){var P;let d=s.bgColor?s.bgColor:u[s.typeC4Shape.text+"_bg_color"],p=s.borderColor?s.borderColor:u[s.typeC4Shape.text+"_border_color"],v=s.fontColor?s.fontColor:"#FFFFFF",b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(s.typeC4Shape.text){case"person":b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const y=i.append("g");y.attr("class","person-man");const T=qC();switch(s.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":T.x=s.x,T.y=s.y,T.fill=d,T.width=s.width,T.height=s.height,T.stroke=p,T.rx=2.5,T.ry=2.5,T.attrs={"stroke-width":.5},qbe(y,T);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":y.append("path").attr("fill",d).attr("stroke-width","0.5").attr("stroke",p).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",s.x).replaceAll("starty",s.y).replaceAll("half",s.width/2).replaceAll("height",s.height)),y.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",p).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",s.x).replaceAll("starty",s.y).replaceAll("half",s.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":y.append("path").attr("fill",d).attr("stroke-width","0.5").attr("stroke",p).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",s.x).replaceAll("starty",s.y).replaceAll("width",s.width).replaceAll("half",s.height/2)),y.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",p).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",s.x+s.width).replaceAll("starty",s.y).replaceAll("half",s.height/2));break}let _=pUt(u,s.typeC4Shape.text);switch(y.append("text").attr("fill",v).attr("font-family",_.fontFamily).attr("font-size",_.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",s.typeC4Shape.width).attr("x",s.x+s.width/2-s.typeC4Shape.width/2).attr("y",s.y+s.typeC4Shape.Y).text("<<"+s.typeC4Shape.text+">>"),s.typeC4Shape.text){case"person":case"external_person":Cqe(y,48,48,s.x+s.width/2-24,s.y+s.image.Y,b);break}let A=u[s.typeC4Shape.text+"Font"]();return A.fontWeight="bold",A.fontSize=A.fontSize+2,A.fontColor=v,F7(u)(s.label.text,y,s.x,s.y+s.label.Y,s.width,s.height,{fill:v},A),A=u[s.typeC4Shape.text+"Font"](),A.fontColor=v,s.techn&&((P=s.techn)==null?void 0:P.text)!==""?F7(u)(s.techn.text,y,s.x,s.y+s.techn.Y,s.width,s.height,{fill:v,"font-style":"italic"},A):s.type&&s.type.text!==""&&F7(u)(s.type.text,y,s.x,s.y+s.type.Y,s.width,s.height,{fill:v,"font-style":"italic"},A),s.descr&&s.descr.text!==""&&(A=u.personFont(),A.fontColor=v,F7(u)(s.descr.text,y,s.x,s.y+s.descr.Y,s.width,s.height,{fill:v},A)),s.height},oUt=function(i){i.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},cUt=function(i){i.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},uUt=function(i){i.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},lUt=function(i){i.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},hUt=function(i){i.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},fUt=function(i){i.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},dUt=function(i){i.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},gUt=function(i){const u=i.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);u.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),u.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},pUt=(i,s)=>({fontFamily:i[s+"FontFamily"],fontSize:i[s+"FontSize"],fontWeight:i[s+"FontWeight"]}),F7=function(){function i(p,v,b,y,T,_,A){const P=v.append("text").attr("x",b+T/2).attr("y",y+_/2+5).style("text-anchor","middle").text(p);d(P,A)}function s(p,v,b,y,T,_,A,P){const{fontSize:R,fontFamily:F,fontWeight:j}=P,K=p.split(ci.lineBreakRegex);for(let ee=0;ee p?R=new jv(u,y):u==p&&d =A?R=new jv(u+i.width,y+A*i.width/2):R=new jv(b+T/_*i.height/2,d+i.height):u v?P>=A?R=new jv(u+i.width,y-A*i.width/2):R=new jv(b+i.height/2*T/_,d):u>p&&d>v&&(P>=A?R=new jv(u,y-i.width/2*A):R=new jv(b-i.height/2*T/_,d)),R},mUt=function(i,s){let u={x:0,y:0};u.x=s.x+s.width/2,u.y=s.y+s.height/2;let d=Mqe(i,u);u.x=i.x+i.width/2,u.y=i.y+i.height/2;let p=Mqe(s,u);return{startPoint:d,endPoint:p}};const vUt=function(i,s,u,d){let p=0;for(let v of s){p=p+1;let b=v.wrap&&$s.wrap,y=bUt($s);d.db.getC4Type()==="C4Dynamic"&&(v.label.text=p+": "+v.label.text);let _=H4(v.label.text,y);$3("label",v,b,y,_),v.techn&&v.techn.text!==""&&(_=H4(v.techn.text,y),$3("techn",v,b,y,_)),v.descr&&v.descr.text!==""&&(_=H4(v.descr.text,y),$3("descr",v,b,y,_));let A=u(v.from),P=u(v.to),R=mUt(A,P);v.startPoint=R.startPoint,v.endPoint=R.endPoint}J4.drawRels(i,s,$s)};function Dqe(i,s,u,d,p){let v=new _qe(p);v.data.widthLimit=u.data.widthLimit/Math.min(Hbe,d.length);for(let[b,y]of d.entries()){let T=0;y.image={width:0,height:0,Y:0},y.sprite&&(y.image.width=48,y.image.height=48,y.image.Y=T,T=y.image.Y+y.image.height);let _=y.wrap&&$s.wrap,A=DQ($s);if(A.fontSize=A.fontSize+2,A.fontWeight="bold",$3("label",y,_,A,v.data.widthLimit),y.label.Y=T+8,T=y.label.Y+y.label.height,y.type&&y.type.text!==""){y.type.text="["+y.type.text+"]";let j=DQ($s);$3("type",y,_,j,v.data.widthLimit),y.type.Y=T+5,T=y.type.Y+y.type.height}if(y.descr&&y.descr.text!==""){let j=DQ($s);j.fontSize=j.fontSize-2,$3("descr",y,_,j,v.data.widthLimit),y.descr.Y=T+20,T=y.descr.Y+y.descr.height}if(b==0||b%Hbe===0){let j=u.data.startx+$s.diagramMarginX,K=u.data.stopy+$s.diagramMarginY+T;v.setData(j,j,K,K)}else{let j=v.data.stopx!==v.data.startx?v.data.stopx+$s.diagramMarginX:v.data.startx,K=v.data.starty;v.setData(j,j,K,K)}v.name=y.alias;let P=p.db.getC4ShapeArray(y.alias),R=p.db.getC4ShapeKeys(y.alias);R.length>0&&Lqe(v,i,P,R),s=y.alias;let F=p.db.getBoundarys(s);F.length>0&&Dqe(i,s,v,F,p),y.alias!=="global"&&Aqe(i,y,v),u.data.stopy=Math.max(v.data.stopy+$s.c4ShapeMargin,u.data.stopy),u.data.stopx=Math.max(v.data.stopx+$s.c4ShapeMargin,u.data.stopx),LQ=Math.max(LQ,u.data.stopx),MQ=Math.max(MQ,u.data.stopy)}}const Iqe={drawPersonOrSystemArray:Lqe,drawBoundary:Aqe,setConf:Vbe,draw:function(i,s,u,d){$s=qt().c4;const p=qt().securityLevel;let v;p==="sandbox"&&(v=Ir("#i"+s));const b=Ir(p==="sandbox"?v.nodes()[0].contentDocument.body:"body");let y=d.db;d.db.setWrap($s.wrap),Sqe=y.getC4ShapeInRow(),Hbe=y.getC4BoundaryInRow(),Xe.debug(`C:${JSON.stringify($s,null,2)}`);const T=p==="sandbox"?b.select(`[id="${s}"]`):Ir(`[id="${s}"]`);J4.insertComputerIcon(T),J4.insertDatabaseIcon(T),J4.insertClockIcon(T);let _=new _qe(d);_.setData($s.diagramMarginX,$s.diagramMarginX,$s.diagramMarginY,$s.diagramMarginY),_.data.widthLimit=screen.availWidth,LQ=$s.diagramMarginX,MQ=$s.diagramMarginY;const A=d.db.getTitle();let P=d.db.getBoundarys("");Dqe(T,"",_,P,d),J4.insertArrowHead(T),J4.insertArrowEnd(T),J4.insertArrowCrossHead(T),J4.insertArrowFilledHead(T),vUt(T,d.db.getRels(),d.db.getC4Shape,d),_.data.stopx=LQ,_.data.stopy=MQ;const R=_.data;let j=R.stopy-R.starty+2*$s.diagramMarginY;const ee=R.stopx-R.startx+2*$s.diagramMarginX;A&&T.append("text").text(A).attr("x",(R.stopx-R.startx)/2-4*$s.diagramMarginX).attr("y",R.starty+$s.diagramMarginY),Ng(T,j,ee,$s.useMaxWidth);const ie=A?60:0;T.attr("viewBox",R.startx-$s.diagramMarginX+" -"+($s.diagramMarginY+ie)+" "+ee+" "+(j+ie)),Xe.debug("models:",R)}},wUt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:DVt,db:$be,renderer:Iqe,styles:i=>`.person {
stroke: ${i.personBorder};
fill: ${i.personBkg};
}
@@ -361,13 +361,13 @@ Expecting `+Ba.join(", ")+", got '"+(this.terminals_[Xc]||Xc)+"'":ga="Parse erro
Expecting `+l5.join(", ")+", got '"+(this.terminals_[y1]||y1)+"'":X3="Parse error on line "+(z0+1)+": Unexpected "+(y1==$9?"end of input":"'"+(this.terminals_[y1]||y1)+"'"),this.parseError(X3,{text:Eh.match,token:this.terminals_[y1]||y1,line:Eh.yylineno,loc:z9,expected:l5})}if(ld[0]instanceof Array&&ld.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ud+", token: "+y1);switch(ld[0]){case 1:Qa.push(y1),Nu.push(Eh.yytext),Ot.push(Eh.yylloc),Qa.push(ld[1]),y1=null,Bp=Eh.yyleng,Kt=Eh.yytext,z0=Eh.yylineno,z9=Eh.yylloc;break;case 2:if(G2=this.productions_[ld[1]][1],Vv.$=Nu[Nu.length-G2],Vv._$={first_line:Ot[Ot.length-(G2||1)].first_line,last_line:Ot[Ot.length-1].last_line,first_column:Ot[Ot.length-(G2||1)].first_column,last_column:Ot[Ot.length-1].last_column},mm&&(Vv._$.range=[Ot[Ot.length-(G2||1)].range[0],Ot[Ot.length-1].range[1]]),q9=this.performAction.apply(Vv,[Kt,Bp,z0,zg.yy,ld[1],Nu,Ot].concat(c5)),typeof q9<"u")return q9;G2&&(Qa=Qa.slice(0,-1*G2*2),Nu=Nu.slice(0,-1*G2),Ot=Ot.slice(0,-1*G2)),Qa.push(this.productions_[ld[1]][0]),Nu.push(Vv.$),Ot.push(Vv._$),X7=W3[Qa[Qa.length-2]][Qa[Qa.length-1]],Qa.push(X7);break;case 3:return!0}}return!0}},Yh=function(){var $0={EOF:1,parseError:function(Bs,Qa){if(this.yy.parser)this.yy.parser.parseError(Bs,Qa);else throw new Error(Bs)},setInput:function(Wi,Bs){return this.yy=Bs||this.yy||{},this._input=Wi,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var Wi=this._input[0];this.yytext+=Wi,this.yyleng++,this.offset++,this.match+=Wi,this.matched+=Wi;var Bs=Wi.match(/(?:\r\n?|\n).*/g);return Bs?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Wi},unput:function(Wi){var Bs=Wi.length,Qa=Wi.split(/(?:\r\n?|\n)/g);this._input=Wi+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Bs),this.offset-=Bs;var Bi=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Qa.length-1&&(this.yylineno-=Qa.length-1);var Nu=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Qa?(Qa.length===Bi.length?this.yylloc.first_column:0)+Bi[Bi.length-Qa.length].length-Qa[0].length:this.yylloc.first_column-Bs},this.options.ranges&&(this.yylloc.range=[Nu[0],Nu[0]+this.yyleng-Bs]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(Wi){this.unput(this.match.slice(Wi))},pastInput:function(){var Wi=this.matched.substr(0,this.matched.length-this.match.length);return(Wi.length>20?"...":"")+Wi.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Wi=this.match;return Wi.length<20&&(Wi+=this._input.substr(0,20-Wi.length)),(Wi.substr(0,20)+(Wi.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Wi=this.pastInput(),Bs=new Array(Wi.length+1).join("-");return Wi+this.upcomingInput()+`
`+Bs+"^"},test_match:function(Wi,Bs){var Qa,Bi,Nu;if(this.options.backtrack_lexer&&(Nu={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Nu.yylloc.range=this.yylloc.range.slice(0))),Bi=Wi[0].match(/(?:\r\n?|\n).*/g),Bi&&(this.yylineno+=Bi.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Bi?Bi[Bi.length-1].length-Bi[Bi.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Wi[0].length},this.yytext+=Wi[0],this.match+=Wi[0],this.matches=Wi,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Wi[0].length),this.matched+=Wi[0],Qa=this.performAction.call(this,this.yy,this,Bs,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Qa)return Qa;if(this._backtrack){for(var Ot in Nu)this[Ot]=Nu[Ot];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Wi,Bs,Qa,Bi;this._more||(this.yytext="",this.match="");for(var Nu=this._currentRules(),Ot=0;Ot 0}function e5(i,s,u){var d=i.x,p=i.y,v=[],b=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY;s.forEach(function(j){b=Math.min(b,j.x),y=Math.min(y,j.y)});for(var T=d-i.width/2-b,_=p-i.height/2-y,A=0;A 0}function KZt(i,s,u){var d=i.x,p=i.y,v=[],b=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY;typeof s.forEach=="function"?s.forEach(function(j){b=Math.min(b,j.x),y=Math.min(y,j.y)}):(b=Math.min(b,s.x),y=Math.min(y,s.y));for(var T=d-i.width/2-b,_=p-i.height/2-y,A=0;A {Se.add(Ce.from),Se.add(Ce.to)}),j=j.filter(Ce=>Se.has(Ce))}await din(_,A,P,j,0,K,!1);const be=await xin(K,A,pe,d);Zf.insertArrowHead(_),Zf.insertArrowCrossHead(_),Zf.insertArrowFilledHead(_),Zf.insertSequenceNumber(_);function ae(Se,Ce){const ke=ni.endActivation(Se);ke.starty+18>Ce&&(ke.starty=Ce-6,Ce+=12),Zf.drawActivation(_,ke,Ce,En,bJ(Se.from.actor).length),ni.insert(ke.startx,Ce-10,ke.stopx,Ce)}let ne=1,se=1;const de=[],X=[];let ge=0;for(const Se of K){let Ce,ke,Ke;switch(Se.type){case d.db.LINETYPE.NOTE:ni.resetVerticalPos(),ke=Se.noteModel,await lin(_,ke);break;case d.db.LINETYPE.ACTIVE_START:ni.newActivation(Se,_,A);break;case d.db.LINETYPE.ACTIVE_END:ae(Se,ni.getVerticalPos());break;case d.db.LINETYPE.LOOP_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.LOOP_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"loop",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.RECT_START:a5(be,Se,En.boxMargin,En.boxMargin,Ft=>ni.newLoop(void 0,Ft.message));break;case d.db.LINETYPE.RECT_END:Ce=ni.endLoop(),X.push(Ce),ni.models.addLoop(Ce),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos());break;case d.db.LINETYPE.OPT_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.OPT_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"opt",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.ALT_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.ALT_ELSE:a5(be,Se,En.boxMargin+En.boxTextMargin,En.boxMargin,Ft=>ni.addSectionToLoop(Ft));break;case d.db.LINETYPE.ALT_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"alt",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.PAR_START:case d.db.LINETYPE.PAR_OVER_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft)),ni.saveVerticalPos();break;case d.db.LINETYPE.PAR_AND:a5(be,Se,En.boxMargin+En.boxTextMargin,En.boxMargin,Ft=>ni.addSectionToLoop(Ft));break;case d.db.LINETYPE.PAR_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"par",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.AUTONUMBER:ne=Se.message.start||ne,se=Se.message.step||se,Se.message.visible?d.db.enableSequenceNumbers():d.db.disableSequenceNumbers();break;case d.db.LINETYPE.CRITICAL_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.CRITICAL_OPTION:a5(be,Se,En.boxMargin+En.boxTextMargin,En.boxMargin,Ft=>ni.addSectionToLoop(Ft));break;case d.db.LINETYPE.CRITICAL_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"critical",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.BREAK_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.BREAK_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"break",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;default:try{Ke=Se.msgModel,Ke.starty=ni.getVerticalPos(),Ke.sequenceIndex=ne,Ke.sequenceVisible=d.db.showSequenceNumbers();const Ft=await hin(_,Ke);gin(Se,Ke,Ft,ge,A,P,R),de.push({messageModel:Ke,lineStartY:Ft}),ni.models.addMessage(Ke)}catch(Ft){Xe.error("error while drawing message",Ft)}}[d.db.LINETYPE.SOLID_OPEN,d.db.LINETYPE.DOTTED_OPEN,d.db.LINETYPE.SOLID,d.db.LINETYPE.DOTTED,d.db.LINETYPE.SOLID_CROSS,d.db.LINETYPE.DOTTED_CROSS,d.db.LINETYPE.SOLID_POINT,d.db.LINETYPE.DOTTED_POINT].includes(Se.type)&&(ne=ne+se),ge++}Xe.debug("createdActors",P),Xe.debug("destroyedActors",R),await Sve(_,A,j,!1);for(const Se of de)await fin(_,Se.messageModel,Se.lineStartY,d);En.mirrorActors&&await Sve(_,A,j,!0),X.forEach(Se=>Zf.drawBackgroundRect(_,Se)),zGe(_,A,j,En);for(const Se of ni.models.boxes)Se.height=ni.getVerticalPos()-Se.y,ni.insert(Se.x,Se.y,Se.x+Se.width,Se.height),Se.startx=Se.x,Se.starty=Se.y,Se.stopx=Se.startx+Se.width,Se.stopy=Se.starty+Se.height,Se.stroke="rgb(0,0,0, 0.5)",await Zf.drawBox(_,Se,En);ie&&ni.bumpVerticalPos(En.boxMargin);const W=VGe(_,A,j,T),{bounds:xe}=ni.getBounds();let U=xe.stopy-xe.starty;U 2,P=K=>y?-K:K;i.from===i.to?_=T:(i.activate&&!A&&(_+=P(En.activationWidth/2-1)),[u.db.LINETYPE.SOLID_OPEN,u.db.LINETYPE.DOTTED_OPEN].includes(i.type)||(_+=P(3)));const R=[d,p,v,b],F=Math.abs(T-_);i.wrap&&i.message&&(i.message=Ao.wrapLabel(i.message,li.getMax(F+2*En.wrapPadding,En.width),eS(En)));const j=Ao.calculateTextDimensions(i.message,eS(En));return{width:li.getMax(i.wrap?0:j.width+2*En.wrapPadding,F+2*En.wrapPadding,En.width),height:0,startx:T,stopx:_,starty:0,stopy:0,message:i.message,type:i.type,wrap:i.wrap,fromBounds:Math.min.apply(null,R),toBounds:Math.max.apply(null,R)}},xin=async function(i,s,u,d){const p={},v=[];let b,y,T;for(const _ of i){switch(_.id=Ao.random({length:10}),_.type){case d.db.LINETYPE.LOOP_START:case d.db.LINETYPE.ALT_START:case d.db.LINETYPE.OPT_START:case d.db.LINETYPE.PAR_START:case d.db.LINETYPE.PAR_OVER_START:case d.db.LINETYPE.CRITICAL_START:case d.db.LINETYPE.BREAK_START:v.push({id:_.id,msg:_.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case d.db.LINETYPE.ALT_ELSE:case d.db.LINETYPE.PAR_AND:case d.db.LINETYPE.CRITICAL_OPTION:_.message&&(b=v.pop(),p[b.id]=b,p[_.id]=b,v.push(b));break;case d.db.LINETYPE.LOOP_END:case d.db.LINETYPE.ALT_END:case d.db.LINETYPE.OPT_END:case d.db.LINETYPE.PAR_END:case d.db.LINETYPE.CRITICAL_END:case d.db.LINETYPE.BREAK_END:b=v.pop(),p[b.id]=b;break;case d.db.LINETYPE.ACTIVE_START:{const P=s[_.from?_.from.actor:_.to.actor],R=bJ(_.from?_.from.actor:_.to.actor).length,F=P.x+P.width/2+(R-1)*En.activationWidth/2,j={startx:F,stopx:F+En.activationWidth,actor:_.from.actor,enabled:!0};ni.activations.push(j)}break;case d.db.LINETYPE.ACTIVE_END:{const P=ni.activations.map(R=>R.actor).lastIndexOf(_.from.actor);delete ni.activations.splice(P,1)[0]}break}_.placement!==void 0?(y=await win(_,s,d),_.noteModel=y,v.forEach(P=>{b=P,b.from=li.getMin(b.from,y.startx),b.to=li.getMax(b.to,y.startx+y.width),b.width=li.getMax(b.width,Math.abs(b.from-b.to))-En.labelBoxWidth})):(T=yin(_,s,d),_.msgModel=T,T.startx&&T.stopx&&v.length>0&&v.forEach(P=>{if(b=P,T.startx===T.stopx){const R=s[_.from],F=s[_.to];b.from=li.getMin(R.x-T.width/2,R.x-R.width/2,b.from),b.to=li.getMax(F.x+T.width/2,F.x+R.width/2,b.to),b.width=li.getMax(b.width,Math.abs(b.to-b.from))-En.labelBoxWidth}else b.from=li.getMin(T.startx,b.from),b.to=li.getMax(T.stopx,b.to),b.width=li.getMax(b.width,T.width)-En.labelBoxWidth}))}return ni.activations=[],Xe.debug("Loop type widths:",p),p},kin=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:yrn,db:FGe,renderer:{bounds:ni,drawActors:Sve,drawActorsPopup:VGe,setConf:UGe,draw:pin},styles:Urn,init:({wrap:i})=>{FGe.setWrap(i)}}},Symbol.toStringTag,{value:"Module"}));var _ve=function(){var i=function(ao,Tr,Fn,qn){for(Fn=Fn||{},qn=ao.length;qn--;Fn[ao[qn]]=Tr);return Fn},s=[1,17],u=[1,18],d=[1,19],p=[1,39],v=[1,40],b=[1,25],y=[1,23],T=[1,24],_=[1,31],A=[1,32],P=[1,33],R=[1,34],F=[1,35],j=[1,36],K=[1,26],ee=[1,27],ie=[1,28],oe=[1,29],pe=[1,43],be=[1,30],ae=[1,42],ne=[1,44],se=[1,41],de=[1,45],X=[1,9],ge=[1,8,9],W=[1,56],xe=[1,57],U=[1,58],Fe=[1,59],Pe=[1,60],je=[1,61],Ie=[1,62],Se=[1,8,9,39],Ce=[1,74],ke=[1,8,9,12,13,21,37,39,42,59,60,61,62,63,64,65,70,72],Ke=[1,8,9,12,13,19,21,37,39,42,46,59,60,61,62,63,64,65,70,72,74,80,95,97,98],Ft=[13,74,80,95,97,98],Ne=[13,64,65,74,80,95,97,98],gn=[13,59,60,61,62,63,74,80,95,97,98],_t=[1,93],Et=[1,110],Gt=[1,108],ln=[1,102],xt=[1,103],Pt=[1,104],Qe=[1,105],Dt=[1,106],kt=[1,107],On=[1,109],ht=[1,8,9,37,39,42],zr=[1,8,9,21],yt=[1,8,9,78],ji=[1,8,9,21,73,74,78,80,81,82,83,84,85],xi={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,className:17,classLiteralName:18,GENERICTYPE:19,relationStatement:20,LABEL:21,namespaceStatement:22,classStatement:23,memberStatement:24,annotationStatement:25,clickStatement:26,styleStatement:27,cssClassStatement:28,noteStatement:29,direction:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,namespaceIdentifier:36,STRUCT_START:37,classStatements:38,STRUCT_STOP:39,NAMESPACE:40,classIdentifier:41,STYLE_SEPARATOR:42,members:43,CLASS:44,ANNOTATION_START:45,ANNOTATION_END:46,MEMBER:47,SEPARATOR:48,relation:49,NOTE_FOR:50,noteText:51,NOTE:52,direction_tb:53,direction_bt:54,direction_rl:55,direction_lr:56,relationType:57,lineType:58,AGGREGATION:59,EXTENSION:60,COMPOSITION:61,DEPENDENCY:62,LOLLIPOP:63,LINE:64,DOTTED_LINE:65,CALLBACK:66,LINK:67,LINK_TARGET:68,CLICK:69,CALLBACK_NAME:70,CALLBACK_ARGS:71,HREF:72,STYLE:73,ALPHA:74,stylesOpt:75,CSSCLASS:76,style:77,COMMA:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,commentToken:86,textToken:87,graphCodeTokens:88,textNoTagsToken:89,TAGSTART:90,TAGEND:91,"==":92,"--":93,DEFAULT:94,MINUS:95,keywords:96,UNICODE_TEXT:97,BQUOTE_STR:98,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",19:"GENERICTYPE",21:"LABEL",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",37:"STRUCT_START",39:"STRUCT_STOP",40:"NAMESPACE",42:"STYLE_SEPARATOR",44:"CLASS",45:"ANNOTATION_START",46:"ANNOTATION_END",47:"MEMBER",48:"SEPARATOR",50:"NOTE_FOR",52:"NOTE",53:"direction_tb",54:"direction_bt",55:"direction_rl",56:"direction_lr",59:"AGGREGATION",60:"EXTENSION",61:"COMPOSITION",62:"DEPENDENCY",63:"LOLLIPOP",64:"LINE",65:"DOTTED_LINE",66:"CALLBACK",67:"LINK",68:"LINK_TARGET",69:"CLICK",70:"CALLBACK_NAME",71:"CALLBACK_ARGS",72:"HREF",73:"STYLE",74:"ALPHA",76:"CSSCLASS",78:"COMMA",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",88:"graphCodeTokens",90:"TAGSTART",91:"TAGEND",92:"==",93:"--",94:"DEFAULT",95:"MINUS",96:"keywords",97:"UNICODE_TEXT",98:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,2],[17,1],[17,1],[17,2],[17,2],[17,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[22,4],[22,5],[36,2],[38,1],[38,2],[38,3],[23,1],[23,3],[23,4],[23,6],[41,2],[41,3],[25,4],[43,1],[43,2],[24,1],[24,2],[24,1],[24,1],[20,3],[20,4],[20,4],[20,5],[29,3],[29,2],[30,1],[30,1],[30,1],[30,1],[49,3],[49,2],[49,2],[49,1],[57,1],[57,1],[57,1],[57,1],[57,1],[58,1],[58,1],[26,3],[26,4],[26,3],[26,4],[26,4],[26,5],[26,3],[26,4],[26,4],[26,5],[26,4],[26,5],[26,5],[26,6],[27,3],[28,3],[75,1],[75,3],[77,1],[77,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[86,1],[86,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,1],[89,1],[89,1],[89,1],[89,1],[16,1],[16,1],[16,1],[16,1],[18,1],[51,1]],performAction:function(Tr,Fn,qn,Un,At,wt,on){var fn=wt.length-1;switch(At){case 8:this.$=wt[fn-1];break;case 9:case 11:case 12:this.$=wt[fn];break;case 10:case 13:this.$=wt[fn-1]+wt[fn];break;case 14:case 15:this.$=wt[fn-1]+"~"+wt[fn]+"~";break;case 16:Un.addRelation(wt[fn]);break;case 17:wt[fn-1].title=Un.cleanupLabel(wt[fn]),Un.addRelation(wt[fn-1]);break;case 27:this.$=wt[fn].trim(),Un.setAccTitle(this.$);break;case 28:case 29:this.$=wt[fn].trim(),Un.setAccDescription(this.$);break;case 30:Un.addClassesToNamespace(wt[fn-3],wt[fn-1]);break;case 31:Un.addClassesToNamespace(wt[fn-4],wt[fn-1]);break;case 32:this.$=wt[fn],Un.addNamespace(wt[fn]);break;case 33:this.$=[wt[fn]];break;case 34:this.$=[wt[fn-1]];break;case 35:wt[fn].unshift(wt[fn-2]),this.$=wt[fn];break;case 37:Un.setCssClass(wt[fn-2],wt[fn]);break;case 38:Un.addMembers(wt[fn-3],wt[fn-1]);break;case 39:Un.setCssClass(wt[fn-5],wt[fn-3]),Un.addMembers(wt[fn-5],wt[fn-1]);break;case 40:this.$=wt[fn],Un.addClass(wt[fn]);break;case 41:this.$=wt[fn-1],Un.addClass(wt[fn-1]),Un.setClassLabel(wt[fn-1],wt[fn]);break;case 42:Un.addAnnotation(wt[fn],wt[fn-2]);break;case 43:this.$=[wt[fn]];break;case 44:wt[fn].push(wt[fn-1]),this.$=wt[fn];break;case 45:break;case 46:Un.addMember(wt[fn-1],Un.cleanupLabel(wt[fn]));break;case 47:break;case 48:break;case 49:this.$={id1:wt[fn-2],id2:wt[fn],relation:wt[fn-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:wt[fn-3],id2:wt[fn],relation:wt[fn-1],relationTitle1:wt[fn-2],relationTitle2:"none"};break;case 51:this.$={id1:wt[fn-3],id2:wt[fn],relation:wt[fn-2],relationTitle1:"none",relationTitle2:wt[fn-1]};break;case 52:this.$={id1:wt[fn-4],id2:wt[fn],relation:wt[fn-2],relationTitle1:wt[fn-3],relationTitle2:wt[fn-1]};break;case 53:Un.addNote(wt[fn],wt[fn-1]);break;case 54:Un.addNote(wt[fn]);break;case 55:Un.setDirection("TB");break;case 56:Un.setDirection("BT");break;case 57:Un.setDirection("RL");break;case 58:Un.setDirection("LR");break;case 59:this.$={type1:wt[fn-2],type2:wt[fn],lineType:wt[fn-1]};break;case 60:this.$={type1:"none",type2:wt[fn],lineType:wt[fn-1]};break;case 61:this.$={type1:wt[fn-1],type2:"none",lineType:wt[fn]};break;case 62:this.$={type1:"none",type2:"none",lineType:wt[fn]};break;case 63:this.$=Un.relationType.AGGREGATION;break;case 64:this.$=Un.relationType.EXTENSION;break;case 65:this.$=Un.relationType.COMPOSITION;break;case 66:this.$=Un.relationType.DEPENDENCY;break;case 67:this.$=Un.relationType.LOLLIPOP;break;case 68:this.$=Un.lineType.LINE;break;case 69:this.$=Un.lineType.DOTTED_LINE;break;case 70:case 76:this.$=wt[fn-2],Un.setClickEvent(wt[fn-1],wt[fn]);break;case 71:case 77:this.$=wt[fn-3],Un.setClickEvent(wt[fn-2],wt[fn-1]),Un.setTooltip(wt[fn-2],wt[fn]);break;case 72:this.$=wt[fn-2],Un.setLink(wt[fn-1],wt[fn]);break;case 73:this.$=wt[fn-3],Un.setLink(wt[fn-2],wt[fn-1],wt[fn]);break;case 74:this.$=wt[fn-3],Un.setLink(wt[fn-2],wt[fn-1]),Un.setTooltip(wt[fn-2],wt[fn]);break;case 75:this.$=wt[fn-4],Un.setLink(wt[fn-3],wt[fn-2],wt[fn]),Un.setTooltip(wt[fn-3],wt[fn-1]);break;case 78:this.$=wt[fn-3],Un.setClickEvent(wt[fn-2],wt[fn-1],wt[fn]);break;case 79:this.$=wt[fn-4],Un.setClickEvent(wt[fn-3],wt[fn-2],wt[fn-1]),Un.setTooltip(wt[fn-3],wt[fn]);break;case 80:this.$=wt[fn-3],Un.setLink(wt[fn-2],wt[fn]);break;case 81:this.$=wt[fn-4],Un.setLink(wt[fn-3],wt[fn-1],wt[fn]);break;case 82:this.$=wt[fn-4],Un.setLink(wt[fn-3],wt[fn-1]),Un.setTooltip(wt[fn-3],wt[fn]);break;case 83:this.$=wt[fn-5],Un.setLink(wt[fn-4],wt[fn-2],wt[fn]),Un.setTooltip(wt[fn-4],wt[fn-1]);break;case 84:this.$=wt[fn-2],Un.setCssStyle(wt[fn-1],wt[fn]);break;case 85:Un.setCssClass(wt[fn-1],wt[fn]);break;case 86:this.$=[wt[fn]];break;case 87:wt[fn-2].push(wt[fn]),this.$=wt[fn-2];break;case 89:this.$=wt[fn-1]+wt[fn];break}},table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:37,17:20,18:38,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,31:s,33:u,35:d,36:21,40:p,41:22,44:v,45:b,47:y,48:T,50:_,52:A,53:P,54:R,55:F,56:j,66:K,67:ee,69:ie,73:oe,74:pe,76:be,80:ae,95:ne,97:se,98:de},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},i(X,[2,5],{8:[1,46]}),{8:[1,47]},i(ge,[2,16],{21:[1,48]}),i(ge,[2,18]),i(ge,[2,19]),i(ge,[2,20]),i(ge,[2,21]),i(ge,[2,22]),i(ge,[2,23]),i(ge,[2,24]),i(ge,[2,25]),i(ge,[2,26]),{32:[1,49]},{34:[1,50]},i(ge,[2,29]),i(ge,[2,45],{49:51,57:54,58:55,13:[1,52],21:[1,53],59:W,60:xe,61:U,62:Fe,63:Pe,64:je,65:Ie}),{37:[1,63]},i(Se,[2,36],{37:[1,65],42:[1,64]}),i(ge,[2,47]),i(ge,[2,48]),{16:66,74:pe,80:ae,95:ne,97:se},{16:37,17:67,18:38,74:pe,80:ae,95:ne,97:se,98:de},{16:37,17:68,18:38,74:pe,80:ae,95:ne,97:se,98:de},{16:37,17:69,18:38,74:pe,80:ae,95:ne,97:se,98:de},{74:[1,70]},{13:[1,71]},{16:37,17:72,18:38,74:pe,80:ae,95:ne,97:se,98:de},{13:Ce,51:73},i(ge,[2,55]),i(ge,[2,56]),i(ge,[2,57]),i(ge,[2,58]),i(ke,[2,11],{16:37,18:38,17:75,19:[1,76],74:pe,80:ae,95:ne,97:se,98:de}),i(ke,[2,12],{19:[1,77]}),{15:78,16:79,74:pe,80:ae,95:ne,97:se},{16:37,17:80,18:38,74:pe,80:ae,95:ne,97:se,98:de},i(Ke,[2,112]),i(Ke,[2,113]),i(Ke,[2,114]),i(Ke,[2,115]),i([1,8,9,12,13,19,21,37,39,42,59,60,61,62,63,64,65,70,72],[2,116]),i(X,[2,6],{10:5,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,17:20,36:21,41:22,16:37,18:38,5:81,31:s,33:u,35:d,40:p,44:v,45:b,47:y,48:T,50:_,52:A,53:P,54:R,55:F,56:j,66:K,67:ee,69:ie,73:oe,74:pe,76:be,80:ae,95:ne,97:se,98:de}),{5:82,10:5,16:37,17:20,18:38,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,31:s,33:u,35:d,36:21,40:p,41:22,44:v,45:b,47:y,48:T,50:_,52:A,53:P,54:R,55:F,56:j,66:K,67:ee,69:ie,73:oe,74:pe,76:be,80:ae,95:ne,97:se,98:de},i(ge,[2,17]),i(ge,[2,27]),i(ge,[2,28]),{13:[1,84],16:37,17:83,18:38,74:pe,80:ae,95:ne,97:se,98:de},{49:85,57:54,58:55,59:W,60:xe,61:U,62:Fe,63:Pe,64:je,65:Ie},i(ge,[2,46]),{58:86,64:je,65:Ie},i(Ft,[2,62],{57:87,59:W,60:xe,61:U,62:Fe,63:Pe}),i(Ne,[2,63]),i(Ne,[2,64]),i(Ne,[2,65]),i(Ne,[2,66]),i(Ne,[2,67]),i(gn,[2,68]),i(gn,[2,69]),{8:[1,89],23:90,38:88,41:22,44:v},{16:91,74:pe,80:ae,95:ne,97:se},{43:92,47:_t},{46:[1,94]},{13:[1,95]},{13:[1,96]},{70:[1,97],72:[1,98]},{21:Et,73:Gt,74:ln,75:99,77:100,79:101,80:xt,81:Pt,82:Qe,83:Dt,84:kt,85:On},{74:[1,111]},{13:Ce,51:112},i(ge,[2,54]),i(ge,[2,117]),i(ke,[2,13]),i(ke,[2,14]),i(ke,[2,15]),{37:[2,32]},{15:113,16:79,37:[2,9],74:pe,80:ae,95:ne,97:se},i(ht,[2,40],{11:114,12:[1,115]}),i(X,[2,7]),{9:[1,116]},i(zr,[2,49]),{16:37,17:117,18:38,74:pe,80:ae,95:ne,97:se,98:de},{13:[1,119],16:37,17:118,18:38,74:pe,80:ae,95:ne,97:se,98:de},i(Ft,[2,61],{57:120,59:W,60:xe,61:U,62:Fe,63:Pe}),i(Ft,[2,60]),{39:[1,121]},{23:90,38:122,41:22,44:v},{8:[1,123],39:[2,33]},i(Se,[2,37],{37:[1,124]}),{39:[1,125]},{39:[2,43],43:126,47:_t},{16:37,17:127,18:38,74:pe,80:ae,95:ne,97:se,98:de},i(ge,[2,70],{13:[1,128]}),i(ge,[2,72],{13:[1,130],68:[1,129]}),i(ge,[2,76],{13:[1,131],71:[1,132]}),{13:[1,133]},i(ge,[2,84],{78:[1,134]}),i(yt,[2,86],{79:135,21:Et,73:Gt,74:ln,80:xt,81:Pt,82:Qe,83:Dt,84:kt,85:On}),i(ji,[2,88]),i(ji,[2,90]),i(ji,[2,91]),i(ji,[2,92]),i(ji,[2,93]),i(ji,[2,94]),i(ji,[2,95]),i(ji,[2,96]),i(ji,[2,97]),i(ji,[2,98]),i(ge,[2,85]),i(ge,[2,53]),{37:[2,10]},i(ht,[2,41]),{13:[1,136]},{1:[2,4]},i(zr,[2,51]),i(zr,[2,50]),{16:37,17:137,18:38,74:pe,80:ae,95:ne,97:se,98:de},i(Ft,[2,59]),i(ge,[2,30]),{39:[1,138]},{23:90,38:139,39:[2,34],41:22,44:v},{43:140,47:_t},i(Se,[2,38]),{39:[2,44]},i(ge,[2,42]),i(ge,[2,71]),i(ge,[2,73]),i(ge,[2,74],{68:[1,141]}),i(ge,[2,77]),i(ge,[2,78],{13:[1,142]}),i(ge,[2,80],{13:[1,144],68:[1,143]}),{21:Et,73:Gt,74:ln,77:145,79:101,80:xt,81:Pt,82:Qe,83:Dt,84:kt,85:On},i(ji,[2,89]),{14:[1,146]},i(zr,[2,52]),i(ge,[2,31]),{39:[2,35]},{39:[1,147]},i(ge,[2,75]),i(ge,[2,79]),i(ge,[2,81]),i(ge,[2,82],{68:[1,148]}),i(yt,[2,87],{79:135,21:Et,73:Gt,74:ln,80:xt,81:Pt,82:Qe,83:Dt,84:kt,85:On}),i(ht,[2,8]),i(Se,[2,39]),i(ge,[2,83])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],78:[2,32],113:[2,10],116:[2,4],126:[2,44],139:[2,35]},parseError:function(Tr,Fn){if(Fn.recoverable)this.trace(Tr);else{var qn=new Error(Tr);throw qn.hash=Fn,qn}},parse:function(Tr){var Fn=this,qn=[0],Un=[],At=[null],wt=[],on=this.table,fn="",An=0,oo=0,jo=2,$o=1,Pa=wt.slice.call(arguments,1),wo=Object.create(this.lexer),_s={yy:{}};for(var tl in this.yy)Object.prototype.hasOwnProperty.call(this.yy,tl)&&(_s.yy[tl]=this.yy[tl]);wo.setInput(Tr,_s.yy),_s.yy.lexer=wo,_s.yy.parser=this,typeof wo.yylloc>"u"&&(wo.yylloc={});var da=wo.yylloc;wt.push(da);var j0=wo.options&&wo.options.ranges;typeof _s.yy.parseError=="function"?this.parseError=_s.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pm(){var ga;return ga=Un.pop()||wo.lex()||$o,typeof ga!="number"&&(ga instanceof Array&&(Un=ga,ga=Un.pop()),ga=Fn.symbols_[ga]||ga),ga}for(var Ml,Xc,Bc,ja,Ou={},Sa,Po,Fc,xa;;){if(Xc=qn[qn.length-1],this.defaultActions[Xc]?Bc=this.defaultActions[Xc]:((Ml===null||typeof Ml>"u")&&(Ml=pm()),Bc=on[Xc]&&on[Xc][Ml]),typeof Bc>"u"||!Bc.length||!Bc[0]){var Ba="";xa=[];for(Sa in on[Xc])this.terminals_[Sa]&&Sa>jo&&xa.push("'"+this.terminals_[Sa]+"'");wo.showPosition?Ba="Parse error on line "+(An+1)+`:
+`,ZC=18*2,RGe="actor-top",jGe="actor-bottom",Eve=function(i,s){return AQ(i,s)},Grn=function(i,s,u,d,p){if(s.links===void 0||s.links===null||Object.keys(s.links).length===0)return{height:0,width:0};const v=s.links,b=s.actorCnt,y=s.rectData;var T="none";p&&(T="block !important");const _=i.append("g");_.attr("id","actor"+b+"_popup"),_.attr("class","actorPopupMenu"),_.attr("display",T);var A="";y.class!==void 0&&(A=" "+y.class);let P=y.width>u?y.width:u;const R=_.append("rect");if(R.attr("class","actorPopupMenuPanel"+A),R.attr("x",y.x),R.attr("y",y.height),R.attr("fill",y.fill),R.attr("stroke",y.stroke),R.attr("width",P),R.attr("height",y.height),R.attr("rx",y.rx),R.attr("ry",y.ry),v!=null){var F=20;for(let ee in v){var j=_.append("a"),K=p9.sanitizeUrl(v[ee]);j.attr("xlink:href",K),j.attr("target","_blank"),uin(d)(ee,j,y.x+10,y.height+F,P,20,{class:"actor"},d),F+=30}}return R.attr("height",F),{height:y.height+F,width:P}},Krn=function(i){return"var pu = document.getElementById('"+i+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},pJ=async function(i,s,u=null){let d=i.append("foreignObject");const p=await CC(s.text,Vh()),b=d.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(p).node().getBoundingClientRect();if(d.attr("height",Math.round(b.height)).attr("width",Math.round(b.width)),s.class==="noteText"){const y=i.node().firstChild;y.setAttribute("height",b.height+2*s.textMargin);const T=y.getBBox();d.attr("x",Math.round(T.x+T.width/2-b.width/2)).attr("y",Math.round(T.y+T.height/2-b.height/2))}else if(u){let{startx:y,stopx:T,starty:_}=u;if(y>T){const A=y;y=T,T=A}d.attr("x",Math.round(y+Math.abs(y-T)/2-b.width/2)),s.class==="loopText"?d.attr("y",Math.round(_)):d.attr("y",Math.round(_-b.height))}return[d]},YD=function(i,s){let u=0,d=0;const p=s.text.split(ci.lineBreakRegex),[v,b]=NC(s.fontSize);let y=[],T=0,_=()=>s.y;if(s.valign!==void 0&&s.textMargin!==void 0&&s.textMargin>0)switch(s.valign){case"top":case"start":_=()=>Math.round(s.y+s.textMargin);break;case"middle":case"center":_=()=>Math.round(s.y+(u+d+s.textMargin)/2);break;case"bottom":case"end":_=()=>Math.round(s.y+(u+d+2*s.textMargin)-s.textMargin);break}if(s.anchor!==void 0&&s.textMargin!==void 0&&s.width!==void 0)switch(s.anchor){case"left":case"start":s.x=Math.round(s.x+s.textMargin),s.anchor="start",s.dominantBaseline="middle",s.alignmentBaseline="middle";break;case"middle":case"center":s.x=Math.round(s.x+s.width/2),s.anchor="middle",s.dominantBaseline="middle",s.alignmentBaseline="middle";break;case"right":case"end":s.x=Math.round(s.x+s.width-s.textMargin),s.anchor="end",s.dominantBaseline="middle",s.alignmentBaseline="middle";break}for(let[A,P]of p.entries()){s.textMargin!==void 0&&s.textMargin===0&&v!==void 0&&(T=A*v);const R=i.append("text");R.attr("x",s.x),R.attr("y",_()),s.anchor!==void 0&&R.attr("text-anchor",s.anchor).attr("dominant-baseline",s.dominantBaseline).attr("alignment-baseline",s.alignmentBaseline),s.fontFamily!==void 0&&R.style("font-family",s.fontFamily),b!==void 0&&R.style("font-size",b),s.fontWeight!==void 0&&R.style("font-weight",s.fontWeight),s.fill!==void 0&&R.attr("fill",s.fill),s.class!==void 0&&R.attr("class",s.class),s.dy!==void 0?R.attr("dy",s.dy):T!==0&&R.attr("dy",T);const F=P||hje;if(s.tspan){const j=R.append("tspan");j.attr("x",s.x),s.fill!==void 0&&j.attr("fill",s.fill),j.text(F)}else R.text(F);s.valign!==void 0&&s.textMargin!==void 0&&s.textMargin>0&&(d+=(R._groups||R)[0][0].getBBox().height,u=d),y.push(R)}return y},$Ge=function(i,s){function u(p,v,b,y,T){return p+","+v+" "+(p+b)+","+v+" "+(p+b)+","+(v+y-T)+" "+(p+b-T*1.2)+","+(v+y)+" "+p+","+(v+y)}const d=i.append("polygon");return d.attr("points",u(s.x,s.y,s.width,s.height,7)),d.attr("class","labelBox"),s.y=s.y+s.height/2,YD(i,s),d};let s5=-1;const zGe=(i,s,u,d)=>{i.select&&u.forEach(p=>{const v=s[p],b=i.select("#actor"+v.actorCnt);!d.mirrorActors&&v.stopy?b.attr("y2",v.stopy+v.height/2):d.mirrorActors&&b.attr("y2",v.stopy)})},Wrn=async function(i,s,u,d){const p=d?s.stopy:s.starty,v=s.x+s.width/2,b=p+5,y=i.append("g").lower();var T=y;d||(s5++,Object.keys(s.links||{}).length&&!u.forceMenus&&T.attr("onclick",Krn(`actor${s5}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+s5).attr("x1",v).attr("y1",b).attr("x2",v).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),T=y.append("g"),s.actorCnt=s5,s.links!=null&&T.attr("id","root-"+s5));const _=qC();var A="actor";s.properties!=null&&s.properties.class?A=s.properties.class:_.fill="#eaeaea",d?A+=` ${jGe}`:A+=` ${RGe}`,_.x=s.x,_.y=p,_.width=s.width,_.height=s.height,_.class=A,_.rx=3,_.ry=3,_.name=s.name;const P=Eve(T,_);if(s.rectData=_,s.properties!=null&&s.properties.icon){const F=s.properties.icon.trim();F.charAt(0)==="@"?rUt(T,_.x+_.width-20,_.y+10,F.substr(1)):nUt(T,_.x+_.width-20,_.y+10,F)}await Tve(u,Dv(s.description))(s.description,T,_.x,_.y,_.width,_.height,{class:"actor"},u);let R=s.height;if(P.node){const F=P.node().getBBox();s.height=F.height,R=F.height}return R},Yrn=async function(i,s,u,d){const p=d?s.stopy:s.starty,v=s.x+s.width/2,b=p+80;i.lower(),d||(s5++,i.append("line").attr("id","actor"+s5).attr("x1",v).attr("y1",b).attr("x2",v).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),s.actorCnt=s5);const y=i.append("g");let T="actor-man";d?T+=` ${jGe}`:T+=` ${RGe}`,y.attr("class",T),y.attr("name",s.name);const _=qC();_.x=s.x,_.y=p,_.fill="#eaeaea",_.width=s.width,_.height=s.height,_.class="actor",_.rx=3,_.ry=3,y.append("line").attr("id","actor-man-torso"+s5).attr("x1",v).attr("y1",p+25).attr("x2",v).attr("y2",p+45),y.append("line").attr("id","actor-man-arms"+s5).attr("x1",v-ZC/2).attr("y1",p+33).attr("x2",v+ZC/2).attr("y2",p+33),y.append("line").attr("x1",v-ZC/2).attr("y1",p+60).attr("x2",v).attr("y2",p+45),y.append("line").attr("x1",v).attr("y1",p+45).attr("x2",v+ZC/2-2).attr("y2",p+60);const A=y.append("circle");A.attr("cx",s.x+s.width/2),A.attr("cy",p+10),A.attr("r",15),A.attr("width",s.width),A.attr("height",s.height);const P=y.node().getBBox();return s.height=P.height,await Tve(u,Dv(s.description))(s.description,y,_.x,_.y+35,_.width,_.height,{class:"actor"},u),s.height},Xrn=async function(i,s,u,d){switch(s.type){case"actor":return await Yrn(i,s,u,d);case"participant":return await Wrn(i,s,u,d)}},Qrn=async function(i,s,u){const p=i.append("g");qGe(p,s),s.name&&await Tve(u)(s.name,p,s.x,s.y+(s.textMaxHeight||0)/2,s.width,0,{class:"text"},u),p.lower()},Jrn=function(i){return i.append("g")},Zrn=function(i,s,u,d,p){const v=qC(),b=s.anchored;v.x=s.startx,v.y=s.starty,v.class="activation"+p%3,v.width=s.stopx-s.startx,v.height=u-s.starty,Eve(b,v)},ein=async function(i,s,u,d){const{boxMargin:p,boxTextMargin:v,labelBoxHeight:b,labelBoxWidth:y,messageFontFamily:T,messageFontSize:_,messageFontWeight:A}=d,P=i.append("g"),R=function(K,ee,ie,oe){return P.append("line").attr("x1",K).attr("y1",ee).attr("x2",ie).attr("y2",oe).attr("class","loopLine")};R(s.startx,s.starty,s.stopx,s.starty),R(s.stopx,s.starty,s.stopx,s.stopy),R(s.startx,s.stopy,s.stopx,s.stopy),R(s.startx,s.starty,s.startx,s.stopy),s.sections!==void 0&&s.sections.forEach(function(K){R(s.startx,K.y,s.stopx,K.y).style("stroke-dasharray","3, 3")});let F=zbe();F.text=u,F.x=s.startx,F.y=s.starty,F.fontFamily=T,F.fontSize=_,F.fontWeight=A,F.anchor="middle",F.valign="middle",F.tspan=!1,F.width=y||50,F.height=b||20,F.textMargin=v,F.class="labelText",$Ge(P,F),F=HGe(),F.text=s.title,F.x=s.startx+y/2+(s.stopx-s.startx)/2,F.y=s.starty+p+v,F.anchor="middle",F.valign="middle",F.textMargin=v,F.class="loopText",F.fontFamily=T,F.fontSize=_,F.fontWeight=A,F.wrap=!0;let j=Dv(F.text)?await pJ(P,F,s):YD(P,F);if(s.sectionTitles!==void 0){for(const[K,ee]of Object.entries(s.sectionTitles))if(ee.message){F.text=ee.message,F.x=s.startx+(s.stopx-s.startx)/2,F.y=s.sections[K].y+p+v,F.class="loopText",F.anchor="middle",F.valign="middle",F.tspan=!1,F.fontFamily=T,F.fontSize=_,F.fontWeight=A,F.wrap=s.wrap,Dv(F.text)?(s.starty=s.sections[K].y,await pJ(P,F,s)):YD(P,F);let ie=Math.round(j.map(oe=>(oe._groups||oe)[0][0].getBBox().height).reduce((oe,pe)=>oe+pe));s.sections[K].height+=ie-(p+v)}}return s.height=Math.round(s.stopy-s.starty),P},qGe=function(i,s){Tqe(i,s)},tin=function(i){i.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},nin=function(i){i.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},rin=function(i){i.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},iin=function(i){i.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},sin=function(i){i.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},ain=function(i){i.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},oin=function(i){i.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},HGe=function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},cin=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},Tve=function(){function i(v,b,y,T,_,A,P){const R=b.append("text").attr("x",y+_/2).attr("y",T+A/2+5).style("text-anchor","middle").text(v);p(R,P)}function s(v,b,y,T,_,A,P,R){const{actorFontSize:F,actorFontFamily:j,actorFontWeight:K}=R,[ee,ie]=NC(F),oe=v.split(ci.lineBreakRegex);for(let pe=0;pe {Se.add(Ce.from),Se.add(Ce.to)}),j=j.filter(Ce=>Se.has(Ce))}await din(_,A,P,j,0,K,!1);const be=await xin(K,A,pe,d);Zf.insertArrowHead(_),Zf.insertArrowCrossHead(_),Zf.insertArrowFilledHead(_),Zf.insertSequenceNumber(_);function ae(Se,Ce){const ke=ni.endActivation(Se);ke.starty+18>Ce&&(ke.starty=Ce-6,Ce+=12),Zf.drawActivation(_,ke,Ce,En,bJ(Se.from.actor).length),ni.insert(ke.startx,Ce-10,ke.stopx,Ce)}let ne=1,se=1;const de=[],X=[];let ge=0;for(const Se of K){let Ce,ke,Ke;switch(Se.type){case d.db.LINETYPE.NOTE:ni.resetVerticalPos(),ke=Se.noteModel,await lin(_,ke);break;case d.db.LINETYPE.ACTIVE_START:ni.newActivation(Se,_,A);break;case d.db.LINETYPE.ACTIVE_END:ae(Se,ni.getVerticalPos());break;case d.db.LINETYPE.LOOP_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.LOOP_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"loop",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.RECT_START:a5(be,Se,En.boxMargin,En.boxMargin,Ft=>ni.newLoop(void 0,Ft.message));break;case d.db.LINETYPE.RECT_END:Ce=ni.endLoop(),X.push(Ce),ni.models.addLoop(Ce),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos());break;case d.db.LINETYPE.OPT_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.OPT_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"opt",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.ALT_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.ALT_ELSE:a5(be,Se,En.boxMargin+En.boxTextMargin,En.boxMargin,Ft=>ni.addSectionToLoop(Ft));break;case d.db.LINETYPE.ALT_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"alt",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.PAR_START:case d.db.LINETYPE.PAR_OVER_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft)),ni.saveVerticalPos();break;case d.db.LINETYPE.PAR_AND:a5(be,Se,En.boxMargin+En.boxTextMargin,En.boxMargin,Ft=>ni.addSectionToLoop(Ft));break;case d.db.LINETYPE.PAR_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"par",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.AUTONUMBER:ne=Se.message.start||ne,se=Se.message.step||se,Se.message.visible?d.db.enableSequenceNumbers():d.db.disableSequenceNumbers();break;case d.db.LINETYPE.CRITICAL_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.CRITICAL_OPTION:a5(be,Se,En.boxMargin+En.boxTextMargin,En.boxMargin,Ft=>ni.addSectionToLoop(Ft));break;case d.db.LINETYPE.CRITICAL_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"critical",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;case d.db.LINETYPE.BREAK_START:a5(be,Se,En.boxMargin,En.boxMargin+En.boxTextMargin,Ft=>ni.newLoop(Ft));break;case d.db.LINETYPE.BREAK_END:Ce=ni.endLoop(),await Zf.drawLoop(_,Ce,"break",En),ni.bumpVerticalPos(Ce.stopy-ni.getVerticalPos()),ni.models.addLoop(Ce);break;default:try{Ke=Se.msgModel,Ke.starty=ni.getVerticalPos(),Ke.sequenceIndex=ne,Ke.sequenceVisible=d.db.showSequenceNumbers();const Ft=await hin(_,Ke);gin(Se,Ke,Ft,ge,A,P,R),de.push({messageModel:Ke,lineStartY:Ft}),ni.models.addMessage(Ke)}catch(Ft){Xe.error("error while drawing message",Ft)}}[d.db.LINETYPE.SOLID_OPEN,d.db.LINETYPE.DOTTED_OPEN,d.db.LINETYPE.SOLID,d.db.LINETYPE.DOTTED,d.db.LINETYPE.SOLID_CROSS,d.db.LINETYPE.DOTTED_CROSS,d.db.LINETYPE.SOLID_POINT,d.db.LINETYPE.DOTTED_POINT].includes(Se.type)&&(ne=ne+se),ge++}Xe.debug("createdActors",P),Xe.debug("destroyedActors",R),await Sve(_,A,j,!1);for(const Se of de)await fin(_,Se.messageModel,Se.lineStartY,d);En.mirrorActors&&await Sve(_,A,j,!0),X.forEach(Se=>Zf.drawBackgroundRect(_,Se)),zGe(_,A,j,En);for(const Se of ni.models.boxes)Se.height=ni.getVerticalPos()-Se.y,ni.insert(Se.x,Se.y,Se.x+Se.width,Se.height),Se.startx=Se.x,Se.starty=Se.y,Se.stopx=Se.startx+Se.width,Se.stopy=Se.starty+Se.height,Se.stroke="rgb(0,0,0, 0.5)",await Zf.drawBox(_,Se,En);ie&&ni.bumpVerticalPos(En.boxMargin);const W=VGe(_,A,j,T),{bounds:xe}=ni.getBounds();let U=xe.stopy-xe.starty;U 2,P=K=>y?-K:K;i.from===i.to?_=T:(i.activate&&!A&&(_+=P(En.activationWidth/2-1)),[u.db.LINETYPE.SOLID_OPEN,u.db.LINETYPE.DOTTED_OPEN].includes(i.type)||(_+=P(3)));const R=[d,p,v,b],F=Math.abs(T-_);i.wrap&&i.message&&(i.message=Ao.wrapLabel(i.message,ci.getMax(F+2*En.wrapPadding,En.width),eS(En)));const j=Ao.calculateTextDimensions(i.message,eS(En));return{width:ci.getMax(i.wrap?0:j.width+2*En.wrapPadding,F+2*En.wrapPadding,En.width),height:0,startx:T,stopx:_,starty:0,stopy:0,message:i.message,type:i.type,wrap:i.wrap,fromBounds:Math.min.apply(null,R),toBounds:Math.max.apply(null,R)}},xin=async function(i,s,u,d){const p={},v=[];let b,y,T;for(const _ of i){switch(_.id=Ao.random({length:10}),_.type){case d.db.LINETYPE.LOOP_START:case d.db.LINETYPE.ALT_START:case d.db.LINETYPE.OPT_START:case d.db.LINETYPE.PAR_START:case d.db.LINETYPE.PAR_OVER_START:case d.db.LINETYPE.CRITICAL_START:case d.db.LINETYPE.BREAK_START:v.push({id:_.id,msg:_.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case d.db.LINETYPE.ALT_ELSE:case d.db.LINETYPE.PAR_AND:case d.db.LINETYPE.CRITICAL_OPTION:_.message&&(b=v.pop(),p[b.id]=b,p[_.id]=b,v.push(b));break;case d.db.LINETYPE.LOOP_END:case d.db.LINETYPE.ALT_END:case d.db.LINETYPE.OPT_END:case d.db.LINETYPE.PAR_END:case d.db.LINETYPE.CRITICAL_END:case d.db.LINETYPE.BREAK_END:b=v.pop(),p[b.id]=b;break;case d.db.LINETYPE.ACTIVE_START:{const P=s[_.from?_.from.actor:_.to.actor],R=bJ(_.from?_.from.actor:_.to.actor).length,F=P.x+P.width/2+(R-1)*En.activationWidth/2,j={startx:F,stopx:F+En.activationWidth,actor:_.from.actor,enabled:!0};ni.activations.push(j)}break;case d.db.LINETYPE.ACTIVE_END:{const P=ni.activations.map(R=>R.actor).lastIndexOf(_.from.actor);delete ni.activations.splice(P,1)[0]}break}_.placement!==void 0?(y=await win(_,s,d),_.noteModel=y,v.forEach(P=>{b=P,b.from=ci.getMin(b.from,y.startx),b.to=ci.getMax(b.to,y.startx+y.width),b.width=ci.getMax(b.width,Math.abs(b.from-b.to))-En.labelBoxWidth})):(T=yin(_,s,d),_.msgModel=T,T.startx&&T.stopx&&v.length>0&&v.forEach(P=>{if(b=P,T.startx===T.stopx){const R=s[_.from],F=s[_.to];b.from=ci.getMin(R.x-T.width/2,R.x-R.width/2,b.from),b.to=ci.getMax(F.x+T.width/2,F.x+R.width/2,b.to),b.width=ci.getMax(b.width,Math.abs(b.to-b.from))-En.labelBoxWidth}else b.from=ci.getMin(T.startx,b.from),b.to=ci.getMax(T.stopx,b.to),b.width=ci.getMax(b.width,T.width)-En.labelBoxWidth}))}return ni.activations=[],Xe.debug("Loop type widths:",p),p},kin=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:yrn,db:FGe,renderer:{bounds:ni,drawActors:Sve,drawActorsPopup:VGe,setConf:UGe,draw:pin},styles:Urn,init:({wrap:i})=>{FGe.setWrap(i)}}},Symbol.toStringTag,{value:"Module"}));var _ve=function(){var i=function(ao,Tr,Fn,qn){for(Fn=Fn||{},qn=ao.length;qn--;Fn[ao[qn]]=Tr);return Fn},s=[1,17],u=[1,18],d=[1,19],p=[1,39],v=[1,40],b=[1,25],y=[1,23],T=[1,24],_=[1,31],A=[1,32],P=[1,33],R=[1,34],F=[1,35],j=[1,36],K=[1,26],ee=[1,27],ie=[1,28],oe=[1,29],pe=[1,43],be=[1,30],ae=[1,42],ne=[1,44],se=[1,41],de=[1,45],X=[1,9],ge=[1,8,9],W=[1,56],xe=[1,57],U=[1,58],Fe=[1,59],Pe=[1,60],je=[1,61],Ie=[1,62],Se=[1,8,9,39],Ce=[1,74],ke=[1,8,9,12,13,21,37,39,42,59,60,61,62,63,64,65,70,72],Ke=[1,8,9,12,13,19,21,37,39,42,46,59,60,61,62,63,64,65,70,72,74,80,95,97,98],Ft=[13,74,80,95,97,98],Ne=[13,64,65,74,80,95,97,98],gn=[13,59,60,61,62,63,74,80,95,97,98],_t=[1,93],Et=[1,110],Gt=[1,108],ln=[1,102],xt=[1,103],Pt=[1,104],Qe=[1,105],Dt=[1,106],kt=[1,107],On=[1,109],ht=[1,8,9,37,39,42],zr=[1,8,9,21],yt=[1,8,9,78],ji=[1,8,9,21,73,74,78,80,81,82,83,84,85],xi={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,className:17,classLiteralName:18,GENERICTYPE:19,relationStatement:20,LABEL:21,namespaceStatement:22,classStatement:23,memberStatement:24,annotationStatement:25,clickStatement:26,styleStatement:27,cssClassStatement:28,noteStatement:29,direction:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,namespaceIdentifier:36,STRUCT_START:37,classStatements:38,STRUCT_STOP:39,NAMESPACE:40,classIdentifier:41,STYLE_SEPARATOR:42,members:43,CLASS:44,ANNOTATION_START:45,ANNOTATION_END:46,MEMBER:47,SEPARATOR:48,relation:49,NOTE_FOR:50,noteText:51,NOTE:52,direction_tb:53,direction_bt:54,direction_rl:55,direction_lr:56,relationType:57,lineType:58,AGGREGATION:59,EXTENSION:60,COMPOSITION:61,DEPENDENCY:62,LOLLIPOP:63,LINE:64,DOTTED_LINE:65,CALLBACK:66,LINK:67,LINK_TARGET:68,CLICK:69,CALLBACK_NAME:70,CALLBACK_ARGS:71,HREF:72,STYLE:73,ALPHA:74,stylesOpt:75,CSSCLASS:76,style:77,COMMA:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,commentToken:86,textToken:87,graphCodeTokens:88,textNoTagsToken:89,TAGSTART:90,TAGEND:91,"==":92,"--":93,DEFAULT:94,MINUS:95,keywords:96,UNICODE_TEXT:97,BQUOTE_STR:98,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",19:"GENERICTYPE",21:"LABEL",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",37:"STRUCT_START",39:"STRUCT_STOP",40:"NAMESPACE",42:"STYLE_SEPARATOR",44:"CLASS",45:"ANNOTATION_START",46:"ANNOTATION_END",47:"MEMBER",48:"SEPARATOR",50:"NOTE_FOR",52:"NOTE",53:"direction_tb",54:"direction_bt",55:"direction_rl",56:"direction_lr",59:"AGGREGATION",60:"EXTENSION",61:"COMPOSITION",62:"DEPENDENCY",63:"LOLLIPOP",64:"LINE",65:"DOTTED_LINE",66:"CALLBACK",67:"LINK",68:"LINK_TARGET",69:"CLICK",70:"CALLBACK_NAME",71:"CALLBACK_ARGS",72:"HREF",73:"STYLE",74:"ALPHA",76:"CSSCLASS",78:"COMMA",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",88:"graphCodeTokens",90:"TAGSTART",91:"TAGEND",92:"==",93:"--",94:"DEFAULT",95:"MINUS",96:"keywords",97:"UNICODE_TEXT",98:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,2],[17,1],[17,1],[17,2],[17,2],[17,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[22,4],[22,5],[36,2],[38,1],[38,2],[38,3],[23,1],[23,3],[23,4],[23,6],[41,2],[41,3],[25,4],[43,1],[43,2],[24,1],[24,2],[24,1],[24,1],[20,3],[20,4],[20,4],[20,5],[29,3],[29,2],[30,1],[30,1],[30,1],[30,1],[49,3],[49,2],[49,2],[49,1],[57,1],[57,1],[57,1],[57,1],[57,1],[58,1],[58,1],[26,3],[26,4],[26,3],[26,4],[26,4],[26,5],[26,3],[26,4],[26,4],[26,5],[26,4],[26,5],[26,5],[26,6],[27,3],[28,3],[75,1],[75,3],[77,1],[77,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[86,1],[86,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,1],[89,1],[89,1],[89,1],[89,1],[16,1],[16,1],[16,1],[16,1],[18,1],[51,1]],performAction:function(Tr,Fn,qn,Un,At,wt,on){var fn=wt.length-1;switch(At){case 8:this.$=wt[fn-1];break;case 9:case 11:case 12:this.$=wt[fn];break;case 10:case 13:this.$=wt[fn-1]+wt[fn];break;case 14:case 15:this.$=wt[fn-1]+"~"+wt[fn]+"~";break;case 16:Un.addRelation(wt[fn]);break;case 17:wt[fn-1].title=Un.cleanupLabel(wt[fn]),Un.addRelation(wt[fn-1]);break;case 27:this.$=wt[fn].trim(),Un.setAccTitle(this.$);break;case 28:case 29:this.$=wt[fn].trim(),Un.setAccDescription(this.$);break;case 30:Un.addClassesToNamespace(wt[fn-3],wt[fn-1]);break;case 31:Un.addClassesToNamespace(wt[fn-4],wt[fn-1]);break;case 32:this.$=wt[fn],Un.addNamespace(wt[fn]);break;case 33:this.$=[wt[fn]];break;case 34:this.$=[wt[fn-1]];break;case 35:wt[fn].unshift(wt[fn-2]),this.$=wt[fn];break;case 37:Un.setCssClass(wt[fn-2],wt[fn]);break;case 38:Un.addMembers(wt[fn-3],wt[fn-1]);break;case 39:Un.setCssClass(wt[fn-5],wt[fn-3]),Un.addMembers(wt[fn-5],wt[fn-1]);break;case 40:this.$=wt[fn],Un.addClass(wt[fn]);break;case 41:this.$=wt[fn-1],Un.addClass(wt[fn-1]),Un.setClassLabel(wt[fn-1],wt[fn]);break;case 42:Un.addAnnotation(wt[fn],wt[fn-2]);break;case 43:this.$=[wt[fn]];break;case 44:wt[fn].push(wt[fn-1]),this.$=wt[fn];break;case 45:break;case 46:Un.addMember(wt[fn-1],Un.cleanupLabel(wt[fn]));break;case 47:break;case 48:break;case 49:this.$={id1:wt[fn-2],id2:wt[fn],relation:wt[fn-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:wt[fn-3],id2:wt[fn],relation:wt[fn-1],relationTitle1:wt[fn-2],relationTitle2:"none"};break;case 51:this.$={id1:wt[fn-3],id2:wt[fn],relation:wt[fn-2],relationTitle1:"none",relationTitle2:wt[fn-1]};break;case 52:this.$={id1:wt[fn-4],id2:wt[fn],relation:wt[fn-2],relationTitle1:wt[fn-3],relationTitle2:wt[fn-1]};break;case 53:Un.addNote(wt[fn],wt[fn-1]);break;case 54:Un.addNote(wt[fn]);break;case 55:Un.setDirection("TB");break;case 56:Un.setDirection("BT");break;case 57:Un.setDirection("RL");break;case 58:Un.setDirection("LR");break;case 59:this.$={type1:wt[fn-2],type2:wt[fn],lineType:wt[fn-1]};break;case 60:this.$={type1:"none",type2:wt[fn],lineType:wt[fn-1]};break;case 61:this.$={type1:wt[fn-1],type2:"none",lineType:wt[fn]};break;case 62:this.$={type1:"none",type2:"none",lineType:wt[fn]};break;case 63:this.$=Un.relationType.AGGREGATION;break;case 64:this.$=Un.relationType.EXTENSION;break;case 65:this.$=Un.relationType.COMPOSITION;break;case 66:this.$=Un.relationType.DEPENDENCY;break;case 67:this.$=Un.relationType.LOLLIPOP;break;case 68:this.$=Un.lineType.LINE;break;case 69:this.$=Un.lineType.DOTTED_LINE;break;case 70:case 76:this.$=wt[fn-2],Un.setClickEvent(wt[fn-1],wt[fn]);break;case 71:case 77:this.$=wt[fn-3],Un.setClickEvent(wt[fn-2],wt[fn-1]),Un.setTooltip(wt[fn-2],wt[fn]);break;case 72:this.$=wt[fn-2],Un.setLink(wt[fn-1],wt[fn]);break;case 73:this.$=wt[fn-3],Un.setLink(wt[fn-2],wt[fn-1],wt[fn]);break;case 74:this.$=wt[fn-3],Un.setLink(wt[fn-2],wt[fn-1]),Un.setTooltip(wt[fn-2],wt[fn]);break;case 75:this.$=wt[fn-4],Un.setLink(wt[fn-3],wt[fn-2],wt[fn]),Un.setTooltip(wt[fn-3],wt[fn-1]);break;case 78:this.$=wt[fn-3],Un.setClickEvent(wt[fn-2],wt[fn-1],wt[fn]);break;case 79:this.$=wt[fn-4],Un.setClickEvent(wt[fn-3],wt[fn-2],wt[fn-1]),Un.setTooltip(wt[fn-3],wt[fn]);break;case 80:this.$=wt[fn-3],Un.setLink(wt[fn-2],wt[fn]);break;case 81:this.$=wt[fn-4],Un.setLink(wt[fn-3],wt[fn-1],wt[fn]);break;case 82:this.$=wt[fn-4],Un.setLink(wt[fn-3],wt[fn-1]),Un.setTooltip(wt[fn-3],wt[fn]);break;case 83:this.$=wt[fn-5],Un.setLink(wt[fn-4],wt[fn-2],wt[fn]),Un.setTooltip(wt[fn-4],wt[fn-1]);break;case 84:this.$=wt[fn-2],Un.setCssStyle(wt[fn-1],wt[fn]);break;case 85:Un.setCssClass(wt[fn-1],wt[fn]);break;case 86:this.$=[wt[fn]];break;case 87:wt[fn-2].push(wt[fn]),this.$=wt[fn-2];break;case 89:this.$=wt[fn-1]+wt[fn];break}},table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:37,17:20,18:38,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,31:s,33:u,35:d,36:21,40:p,41:22,44:v,45:b,47:y,48:T,50:_,52:A,53:P,54:R,55:F,56:j,66:K,67:ee,69:ie,73:oe,74:pe,76:be,80:ae,95:ne,97:se,98:de},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},i(X,[2,5],{8:[1,46]}),{8:[1,47]},i(ge,[2,16],{21:[1,48]}),i(ge,[2,18]),i(ge,[2,19]),i(ge,[2,20]),i(ge,[2,21]),i(ge,[2,22]),i(ge,[2,23]),i(ge,[2,24]),i(ge,[2,25]),i(ge,[2,26]),{32:[1,49]},{34:[1,50]},i(ge,[2,29]),i(ge,[2,45],{49:51,57:54,58:55,13:[1,52],21:[1,53],59:W,60:xe,61:U,62:Fe,63:Pe,64:je,65:Ie}),{37:[1,63]},i(Se,[2,36],{37:[1,65],42:[1,64]}),i(ge,[2,47]),i(ge,[2,48]),{16:66,74:pe,80:ae,95:ne,97:se},{16:37,17:67,18:38,74:pe,80:ae,95:ne,97:se,98:de},{16:37,17:68,18:38,74:pe,80:ae,95:ne,97:se,98:de},{16:37,17:69,18:38,74:pe,80:ae,95:ne,97:se,98:de},{74:[1,70]},{13:[1,71]},{16:37,17:72,18:38,74:pe,80:ae,95:ne,97:se,98:de},{13:Ce,51:73},i(ge,[2,55]),i(ge,[2,56]),i(ge,[2,57]),i(ge,[2,58]),i(ke,[2,11],{16:37,18:38,17:75,19:[1,76],74:pe,80:ae,95:ne,97:se,98:de}),i(ke,[2,12],{19:[1,77]}),{15:78,16:79,74:pe,80:ae,95:ne,97:se},{16:37,17:80,18:38,74:pe,80:ae,95:ne,97:se,98:de},i(Ke,[2,112]),i(Ke,[2,113]),i(Ke,[2,114]),i(Ke,[2,115]),i([1,8,9,12,13,19,21,37,39,42,59,60,61,62,63,64,65,70,72],[2,116]),i(X,[2,6],{10:5,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,17:20,36:21,41:22,16:37,18:38,5:81,31:s,33:u,35:d,40:p,44:v,45:b,47:y,48:T,50:_,52:A,53:P,54:R,55:F,56:j,66:K,67:ee,69:ie,73:oe,74:pe,76:be,80:ae,95:ne,97:se,98:de}),{5:82,10:5,16:37,17:20,18:38,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,31:s,33:u,35:d,36:21,40:p,41:22,44:v,45:b,47:y,48:T,50:_,52:A,53:P,54:R,55:F,56:j,66:K,67:ee,69:ie,73:oe,74:pe,76:be,80:ae,95:ne,97:se,98:de},i(ge,[2,17]),i(ge,[2,27]),i(ge,[2,28]),{13:[1,84],16:37,17:83,18:38,74:pe,80:ae,95:ne,97:se,98:de},{49:85,57:54,58:55,59:W,60:xe,61:U,62:Fe,63:Pe,64:je,65:Ie},i(ge,[2,46]),{58:86,64:je,65:Ie},i(Ft,[2,62],{57:87,59:W,60:xe,61:U,62:Fe,63:Pe}),i(Ne,[2,63]),i(Ne,[2,64]),i(Ne,[2,65]),i(Ne,[2,66]),i(Ne,[2,67]),i(gn,[2,68]),i(gn,[2,69]),{8:[1,89],23:90,38:88,41:22,44:v},{16:91,74:pe,80:ae,95:ne,97:se},{43:92,47:_t},{46:[1,94]},{13:[1,95]},{13:[1,96]},{70:[1,97],72:[1,98]},{21:Et,73:Gt,74:ln,75:99,77:100,79:101,80:xt,81:Pt,82:Qe,83:Dt,84:kt,85:On},{74:[1,111]},{13:Ce,51:112},i(ge,[2,54]),i(ge,[2,117]),i(ke,[2,13]),i(ke,[2,14]),i(ke,[2,15]),{37:[2,32]},{15:113,16:79,37:[2,9],74:pe,80:ae,95:ne,97:se},i(ht,[2,40],{11:114,12:[1,115]}),i(X,[2,7]),{9:[1,116]},i(zr,[2,49]),{16:37,17:117,18:38,74:pe,80:ae,95:ne,97:se,98:de},{13:[1,119],16:37,17:118,18:38,74:pe,80:ae,95:ne,97:se,98:de},i(Ft,[2,61],{57:120,59:W,60:xe,61:U,62:Fe,63:Pe}),i(Ft,[2,60]),{39:[1,121]},{23:90,38:122,41:22,44:v},{8:[1,123],39:[2,33]},i(Se,[2,37],{37:[1,124]}),{39:[1,125]},{39:[2,43],43:126,47:_t},{16:37,17:127,18:38,74:pe,80:ae,95:ne,97:se,98:de},i(ge,[2,70],{13:[1,128]}),i(ge,[2,72],{13:[1,130],68:[1,129]}),i(ge,[2,76],{13:[1,131],71:[1,132]}),{13:[1,133]},i(ge,[2,84],{78:[1,134]}),i(yt,[2,86],{79:135,21:Et,73:Gt,74:ln,80:xt,81:Pt,82:Qe,83:Dt,84:kt,85:On}),i(ji,[2,88]),i(ji,[2,90]),i(ji,[2,91]),i(ji,[2,92]),i(ji,[2,93]),i(ji,[2,94]),i(ji,[2,95]),i(ji,[2,96]),i(ji,[2,97]),i(ji,[2,98]),i(ge,[2,85]),i(ge,[2,53]),{37:[2,10]},i(ht,[2,41]),{13:[1,136]},{1:[2,4]},i(zr,[2,51]),i(zr,[2,50]),{16:37,17:137,18:38,74:pe,80:ae,95:ne,97:se,98:de},i(Ft,[2,59]),i(ge,[2,30]),{39:[1,138]},{23:90,38:139,39:[2,34],41:22,44:v},{43:140,47:_t},i(Se,[2,38]),{39:[2,44]},i(ge,[2,42]),i(ge,[2,71]),i(ge,[2,73]),i(ge,[2,74],{68:[1,141]}),i(ge,[2,77]),i(ge,[2,78],{13:[1,142]}),i(ge,[2,80],{13:[1,144],68:[1,143]}),{21:Et,73:Gt,74:ln,77:145,79:101,80:xt,81:Pt,82:Qe,83:Dt,84:kt,85:On},i(ji,[2,89]),{14:[1,146]},i(zr,[2,52]),i(ge,[2,31]),{39:[2,35]},{39:[1,147]},i(ge,[2,75]),i(ge,[2,79]),i(ge,[2,81]),i(ge,[2,82],{68:[1,148]}),i(yt,[2,87],{79:135,21:Et,73:Gt,74:ln,80:xt,81:Pt,82:Qe,83:Dt,84:kt,85:On}),i(ht,[2,8]),i(Se,[2,39]),i(ge,[2,83])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],78:[2,32],113:[2,10],116:[2,4],126:[2,44],139:[2,35]},parseError:function(Tr,Fn){if(Fn.recoverable)this.trace(Tr);else{var qn=new Error(Tr);throw qn.hash=Fn,qn}},parse:function(Tr){var Fn=this,qn=[0],Un=[],At=[null],wt=[],on=this.table,fn="",An=0,oo=0,jo=2,$o=1,Pa=wt.slice.call(arguments,1),wo=Object.create(this.lexer),_s={yy:{}};for(var tl in this.yy)Object.prototype.hasOwnProperty.call(this.yy,tl)&&(_s.yy[tl]=this.yy[tl]);wo.setInput(Tr,_s.yy),_s.yy.lexer=wo,_s.yy.parser=this,typeof wo.yylloc>"u"&&(wo.yylloc={});var da=wo.yylloc;wt.push(da);var j0=wo.options&&wo.options.ranges;typeof _s.yy.parseError=="function"?this.parseError=_s.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pm(){var ga;return ga=Un.pop()||wo.lex()||$o,typeof ga!="number"&&(ga instanceof Array&&(Un=ga,ga=Un.pop()),ga=Fn.symbols_[ga]||ga),ga}for(var Ml,Xc,Bc,ja,Ou={},Sa,Po,Fc,xa;;){if(Xc=qn[qn.length-1],this.defaultActions[Xc]?Bc=this.defaultActions[Xc]:((Ml===null||typeof Ml>"u")&&(Ml=pm()),Bc=on[Xc]&&on[Xc][Ml]),typeof Bc>"u"||!Bc.length||!Bc[0]){var Ba="";xa=[];for(Sa in on[Xc])this.terminals_[Sa]&&Sa>jo&&xa.push("'"+this.terminals_[Sa]+"'");wo.showPosition?Ba="Parse error on line "+(An+1)+`:
`+wo.showPosition()+`
Expecting `+xa.join(", ")+", got '"+(this.terminals_[Ml]||Ml)+"'":Ba="Parse error on line "+(An+1)+": Unexpected "+(Ml==$o?"end of input":"'"+(this.terminals_[Ml]||Ml)+"'"),this.parseError(Ba,{text:wo.match,token:this.terminals_[Ml]||Ml,line:wo.yylineno,loc:da,expected:xa})}if(Bc[0]instanceof Array&&Bc.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Xc+", token: "+Ml);switch(Bc[0]){case 1:qn.push(Ml),At.push(wo.yytext),wt.push(wo.yylloc),qn.push(Bc[1]),Ml=null,oo=wo.yyleng,fn=wo.yytext,An=wo.yylineno,da=wo.yylloc;break;case 2:if(Po=this.productions_[Bc[1]][1],Ou.$=At[At.length-Po],Ou._$={first_line:wt[wt.length-(Po||1)].first_line,last_line:wt[wt.length-1].last_line,first_column:wt[wt.length-(Po||1)].first_column,last_column:wt[wt.length-1].last_column},j0&&(Ou._$.range=[wt[wt.length-(Po||1)].range[0],wt[wt.length-1].range[1]]),ja=this.performAction.apply(Ou,[fn,oo,An,_s.yy,Bc[1],At,wt].concat(Pa)),typeof ja<"u")return ja;Po&&(qn=qn.slice(0,-1*Po*2),At=At.slice(0,-1*Po),wt=wt.slice(0,-1*Po)),qn.push(this.productions_[Bc[1]][0]),At.push(Ou.$),wt.push(Ou._$),Fc=on[qn[qn.length-2]][qn[qn.length-1]],qn.push(Fc);break;case 3:return!0}}return!0}},Ma=function(){var ao={EOF:1,parseError:function(Fn,qn){if(this.yy.parser)this.yy.parser.parseError(Fn,qn);else throw new Error(Fn)},setInput:function(Tr,Fn){return this.yy=Fn||this.yy||{},this._input=Tr,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var Tr=this._input[0];this.yytext+=Tr,this.yyleng++,this.offset++,this.match+=Tr,this.matched+=Tr;var Fn=Tr.match(/(?:\r\n?|\n).*/g);return Fn?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Tr},unput:function(Tr){var Fn=Tr.length,qn=Tr.split(/(?:\r\n?|\n)/g);this._input=Tr+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Fn),this.offset-=Fn;var Un=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),qn.length-1&&(this.yylineno-=qn.length-1);var At=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:qn?(qn.length===Un.length?this.yylloc.first_column:0)+Un[Un.length-qn.length].length-qn[0].length:this.yylloc.first_column-Fn},this.options.ranges&&(this.yylloc.range=[At[0],At[0]+this.yyleng-Fn]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(Tr){this.unput(this.match.slice(Tr))},pastInput:function(){var Tr=this.matched.substr(0,this.matched.length-this.match.length);return(Tr.length>20?"...":"")+Tr.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Tr=this.match;return Tr.length<20&&(Tr+=this._input.substr(0,20-Tr.length)),(Tr.substr(0,20)+(Tr.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Tr=this.pastInput(),Fn=new Array(Tr.length+1).join("-");return Tr+this.upcomingInput()+`
`+Fn+"^"},test_match:function(Tr,Fn){var qn,Un,At;if(this.options.backtrack_lexer&&(At={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(At.yylloc.range=this.yylloc.range.slice(0))),Un=Tr[0].match(/(?:\r\n?|\n).*/g),Un&&(this.yylineno+=Un.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Un?Un[Un.length-1].length-Un[Un.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Tr[0].length},this.yytext+=Tr[0],this.match+=Tr[0],this.matches=Tr,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Tr[0].length),this.matched+=Tr[0],qn=this.performAction.call(this,this.yy,this,Fn,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),qn)return qn;if(this._backtrack){for(var wt in At)this[wt]=At[wt];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Tr,Fn,qn,Un;this._more||(this.yytext="",this.match="");for(var At=this._currentRules(),wt=0;wt
"},u),li.lineBreakRegex.test(i)))return i;const d=i.split(" "),p=[];let v="";return d.forEach((b,y)=>{const T=H4(`${b} `,u),_=H4(v,u);if(T>s){const{hyphenatedStrings:R,remainingWord:F}=MRt(b,s,"-",u);p.push(v,...R),v=F}else _+T>=s?(p.push(v),v=b):v=[v,b].filter(Boolean).join(" ");y+1===d.length&&p.push(v)}),p.filter(b=>b!=="").join(u.joinWith)},(i,s,u)=>`${i}${s}${u.fontSize}${u.fontWeight}${u.fontFamily}${u.joinWith}`),MRt=bD((i,s,u="-",d)=>{d=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},d);const p=[...i],v=[];let b="";return p.forEach((y,T)=>{const _=`${b}${y}`;if(H4(_,d)>=s){const P=T+1,R=p.length===P,F=`${_}${u}`;v.push(R?_:F),b=""}else b=_}),{hyphenatedStrings:v,remainingWord:b}},(i,s,u="-",d)=>`${i}${s}${u}${d.fontSize}${d.fontWeight}${d.fontFamily}`);function E2e(i,s){return T2e(i,s).height}function H4(i,s){return T2e(i,s).width}const T2e=bD((i,s)=>{const{fontSize:u=12,fontFamily:d="Arial",fontWeight:p=400}=s;if(!i)return{width:0,height:0};const[,v]=NC(u),b=["sans-serif",d],y=i.split(li.lineBreakRegex),T=[],_=Ir("body");if(!_.remove)return{width:0,height:0,lineHeight:0};const A=_.append("svg");for(const R of b){let F=0;const j={width:0,height:0,lineHeight:0};for(const K of y){const ee=ARt();ee.text=K||hje;const ie=LRt(A,ee).style("font-size",v).style("font-weight",p).style("font-family",R),oe=(ie._groups||ie)[0][0].getBBox();if(oe.width===0&&oe.height===0)throw new Error("svg element not in render tree");j.width=Math.round(Math.max(j.width,oe.width)),F=Math.round(oe.height),j.height+=F,j.lineHeight=Math.round(Math.max(j.lineHeight,F))}T.push(j)}A.remove();const P=isNaN(T[1].height)||isNaN(T[1].width)||isNaN(T[1].lineHeight)||T[0].height>T[1].height&&T[0].width>T[1].width&&T[0].lineHeight>T[1].lineHeight?0:1;return T[P]},(i,s)=>`${i}${s.fontSize}${s.fontWeight}${s.fontFamily}`);class DRt{constructor(s=!1,u){this.count=0,this.count=u?u.length:0,this.next=s?()=>this.count++:()=>Date.now()}}let $X;const IRt=function(i){return $X=$X||document.createElement("div"),i=escape(i).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),$X.innerHTML=i,unescape($X.textContent)};function wje(i){return"str"in i}const ORt=(i,s,u,d)=>{var v;if(!d)return;const p=(v=i.node())==null?void 0:v.getBBox();p&&i.append("text").text(d).attr("x",p.x+p.width/2).attr("y",-u).attr("class",s)},NC=i=>{if(typeof i=="number")return[i,i+"px"];const s=parseInt(i??"",10);return Number.isNaN(s)?[void 0,void 0]:i===String(s)?[s,i+"px"]:[s,i]};function JF(i,s){return jX({},i,s)}const Ao={assignWithDepth:id,wrapLabel:vje,calculateTextHeight:E2e,calculateTextWidth:H4,calculateTextDimensions:T2e,cleanAndMerge:JF,detectInit:vRt,detectDirective:fje,isSubstringInArray:yRt,interpolateToCurve:Ov,calcLabelPosition:TRt,calcCardinalityPosition:CRt,calcTerminalLabelPosition:SRt,formatUrl:xRt,getStylesFromArray:om,generateId:bje,random:mje,runFunc:kRt,entityDecode:IRt,insertTitle:ORt,parseFontSize:NC,InitIDGenerator:DRt},NRt=function(i){let s=i;return s=s.replace(/style.*:\S*#.*;/g,function(u){return u.substring(0,u.length-1)}),s=s.replace(/classDef.*:\S*#.*;/g,function(u){return u.substring(0,u.length-1)}),s=s.replace(/#\w+;/g,function(u){const d=u.substring(1,u.length-1);return/^\+?\d+$/.test(d)?"fl°°"+d+"¶ß":"fl°"+d+"¶ß"}),s},ZF=function(i){return i.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")};var yje="comm",xje="rule",kje="decl",PRt="@import",BRt="@keyframes",FRt="@layer",Eje=Math.abs,C2e=String.fromCharCode;function Tje(i){return i.trim()}function zX(i,s,u){return i.replace(s,u)}function RRt(i,s,u){return i.indexOf(s,u)}function eR(i,s){return i.charCodeAt(s)|0}function tR(i,s,u){return i.slice(s,u)}function _7(i){return i.length}function jRt(i){return i.length}function qX(i,s){return s.push(i),i}var HX=1,xD=1,Cje=0,Nv=0,I0=0,kD="";function S2e(i,s,u,d,p,v,b,y){return{value:i,root:s,parent:u,type:d,props:p,children:v,line:HX,column:xD,length:b,return:"",siblings:y}}function $Rt(){return I0}function zRt(){return I0=Nv>0?eR(kD,--Nv):0,xD--,I0===10&&(xD=1,HX--),I0}function B3(){return I0=Nv
"},u),ci.lineBreakRegex.test(i)))return i;const d=i.split(" "),p=[];let v="";return d.forEach((b,y)=>{const T=H4(`${b} `,u),_=H4(v,u);if(T>s){const{hyphenatedStrings:R,remainingWord:F}=MRt(b,s,"-",u);p.push(v,...R),v=F}else _+T>=s?(p.push(v),v=b):v=[v,b].filter(Boolean).join(" ");y+1===d.length&&p.push(v)}),p.filter(b=>b!=="").join(u.joinWith)},(i,s,u)=>`${i}${s}${u.fontSize}${u.fontWeight}${u.fontFamily}${u.joinWith}`),MRt=bD((i,s,u="-",d)=>{d=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},d);const p=[...i],v=[];let b="";return p.forEach((y,T)=>{const _=`${b}${y}`;if(H4(_,d)>=s){const P=T+1,R=p.length===P,F=`${_}${u}`;v.push(R?_:F),b=""}else b=_}),{hyphenatedStrings:v,remainingWord:b}},(i,s,u="-",d)=>`${i}${s}${u}${d.fontSize}${d.fontWeight}${d.fontFamily}`);function E2e(i,s){return T2e(i,s).height}function H4(i,s){return T2e(i,s).width}const T2e=bD((i,s)=>{const{fontSize:u=12,fontFamily:d="Arial",fontWeight:p=400}=s;if(!i)return{width:0,height:0};const[,v]=NC(u),b=["sans-serif",d],y=i.split(ci.lineBreakRegex),T=[],_=Ir("body");if(!_.remove)return{width:0,height:0,lineHeight:0};const A=_.append("svg");for(const R of b){let F=0;const j={width:0,height:0,lineHeight:0};for(const K of y){const ee=ARt();ee.text=K||hje;const ie=LRt(A,ee).style("font-size",v).style("font-weight",p).style("font-family",R),oe=(ie._groups||ie)[0][0].getBBox();if(oe.width===0&&oe.height===0)throw new Error("svg element not in render tree");j.width=Math.round(Math.max(j.width,oe.width)),F=Math.round(oe.height),j.height+=F,j.lineHeight=Math.round(Math.max(j.lineHeight,F))}T.push(j)}A.remove();const P=isNaN(T[1].height)||isNaN(T[1].width)||isNaN(T[1].lineHeight)||T[0].height>T[1].height&&T[0].width>T[1].width&&T[0].lineHeight>T[1].lineHeight?0:1;return T[P]},(i,s)=>`${i}${s.fontSize}${s.fontWeight}${s.fontFamily}`);class DRt{constructor(s=!1,u){this.count=0,this.count=u?u.length:0,this.next=s?()=>this.count++:()=>Date.now()}}let $X;const IRt=function(i){return $X=$X||document.createElement("div"),i=escape(i).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),$X.innerHTML=i,unescape($X.textContent)};function wje(i){return"str"in i}const ORt=(i,s,u,d)=>{var v;if(!d)return;const p=(v=i.node())==null?void 0:v.getBBox();p&&i.append("text").text(d).attr("x",p.x+p.width/2).attr("y",-u).attr("class",s)},NC=i=>{if(typeof i=="number")return[i,i+"px"];const s=parseInt(i??"",10);return Number.isNaN(s)?[void 0,void 0]:i===String(s)?[s,i+"px"]:[s,i]};function JF(i,s){return jX({},i,s)}const Ao={assignWithDepth:id,wrapLabel:vje,calculateTextHeight:E2e,calculateTextWidth:H4,calculateTextDimensions:T2e,cleanAndMerge:JF,detectInit:vRt,detectDirective:fje,isSubstringInArray:yRt,interpolateToCurve:Ov,calcLabelPosition:TRt,calcCardinalityPosition:CRt,calcTerminalLabelPosition:SRt,formatUrl:xRt,getStylesFromArray:om,generateId:bje,random:mje,runFunc:kRt,entityDecode:IRt,insertTitle:ORt,parseFontSize:NC,InitIDGenerator:DRt},NRt=function(i){let s=i;return s=s.replace(/style.*:\S*#.*;/g,function(u){return u.substring(0,u.length-1)}),s=s.replace(/classDef.*:\S*#.*;/g,function(u){return u.substring(0,u.length-1)}),s=s.replace(/#\w+;/g,function(u){const d=u.substring(1,u.length-1);return/^\+?\d+$/.test(d)?"fl°°"+d+"¶ß":"fl°"+d+"¶ß"}),s},ZF=function(i){return i.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")};var yje="comm",xje="rule",kje="decl",PRt="@import",BRt="@keyframes",FRt="@layer",Eje=Math.abs,C2e=String.fromCharCode;function Tje(i){return i.trim()}function zX(i,s,u){return i.replace(s,u)}function RRt(i,s,u){return i.indexOf(s,u)}function eR(i,s){return i.charCodeAt(s)|0}function tR(i,s,u){return i.slice(s,u)}function _7(i){return i.length}function jRt(i){return i.length}function qX(i,s){return s.push(i),i}var HX=1,xD=1,Cje=0,Nv=0,I0=0,kD="";function S2e(i,s,u,d,p,v,b,y){return{value:i,root:s,parent:u,type:d,props:p,children:v,line:HX,column:xD,length:b,return:"",siblings:y}}function $Rt(){return I0}function zRt(){return I0=Nv>0?eR(kD,--Nv):0,xD--,I0===10&&(xD=1,HX--),I0}function B3(){return I0=Nvs||v&&b&&T&&!y&&!_||d&&b&&T||!u&&T||!p)return 1;if(!d&&!v&&!_&&i=y)return T;var _=u[d];return T*(_=="desc"?-1:1)}}return i.index-s.index}function PWt(i,s,u){s.length?s=RD(s,function(v){return D0(v)?function(b){return zQ(b,v.length===1?v[0]:v)}:v}):s=[OC];var d=-1;s=RD(s,NX(I9));var p=VHe(i,function(v,b,y){var T=RD(s,function(_){return _(v)});return{criteria:T,index:++d,value:v}});return IWt(p,function(v,b){return NWt(v,b,u)})}function BWt(i,s){return DWt(i,s,function(u,d){return zHe(i,d)})}var FWt=rGt(function(i,s){return i==null?{}:BWt(i,s)});const ER=FWt;var RWt=Math.ceil,jWt=Math.max;function $Wt(i,s,u,d){for(var p=-1,v=jWt(RWt((s-i)/(u||1)),0),b=Array(v);v--;)b[d?v:++p]=i,i+=u;return b}function zWt(i){return function(s,u,d){return d&&typeof d!="number"&&QF(s,u,d)&&(u=d=void 0),s=jQ(s),u===void 0?(u=s,s=0):u=jQ(u),d=d===void 0?s1&&QF(i,s[0],s[1])?s=[]:u>2&&QF(s[0],s[1],s[2])&&(s=[s[0]]),PWt(i,qQ(s,1),[])});const CR=VWt;var UWt=1/0,GWt=CD&&1/Jbe(new CD([,-0]))[1]==UWt?function(i){return new CD(i)}:zUt;const KWt=GWt;var WWt=200;function YWt(i,s,u){var d=-1,p=UUt,v=i.length,b=!0,y=[],T=y;if(u)b=!1,p=mWt;else if(v>=WWt){var _=s?null:KWt(i);if(_)return Jbe(_);b=!1,p=IHe,T=new xR}else T=s?[]:y;e:for(;++d
"),Xe.debug("vertexText"+p);const v={isNode:d,label:ZF(p).replace(/fa[blrs]?:fa-[\w-]+/g,y=>``),labelStyle:s.replace("fill:","color:")};return OQt(v)}else{const v=document.createElementNS("http://www.w3.org/2000/svg","text");v.setAttribute("style",s.replace("color:","fill:"));let b=[];typeof p=="string"?b=p.split(/\\n|\n|
/gi):Array.isArray(p)?b=p:b=[];for(const y of b){const T=document.createElementNS("http://www.w3.org/2000/svg","tspan");T.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),T.setAttribute("dy","1em"),T.setAttribute("x","0"),u?T.setAttribute("class","title-row"):T.setAttribute("class","row"),T.textContent=y.trim(),v.appendChild(T)}return v}},NQt={};function PQt(i,s){const u=s||NQt,d=typeof u.includeImageAlt=="boolean"?u.includeImageAlt:!0,p=typeof u.includeHtml=="boolean"?u.includeHtml:!0;return $Ve(i,d,p)}function $Ve(i,s,u){if(BQt(i)){if("value"in i)return i.type==="html"&&!u?"":i.value;if(s&&"alt"in i&&i.alt)return i.alt;if("children"in i)return zVe(i.children,s,u)}return Array.isArray(i)?zVe(i,s,u):""}function zVe(i,s,u){const d=[];let p=-1;for(;++p=4?s(b):i.interrupt(d.parser.constructs.flow,u,s)(b)}}function ZVe(i,s,u,d,p,v,b,y,T){const _=T||Number.POSITIVE_INFINITY;let A=0;return P;function P(ie){return ie===60?(i.enter(d),i.enter(p),i.enter(v),i.consume(ie),i.exit(v),R):ie===null||ie===32||ie===41||_me(ie)?u(ie):(i.enter(d),i.enter(b),i.enter(y),i.enter("chunkString",{contentType:"string"}),K(ie))}function R(ie){return ie===62?(i.enter(v),i.consume(ie),i.exit(v),i.exit(p),i.exit(d),s):(i.enter(y),i.enter("chunkString",{contentType:"string"}),F(ie))}function F(ie){return ie===62?(i.exit("chunkString"),i.exit(y),R(ie)):ie===null||ie===60||so(ie)?u(ie):(i.consume(ie),ie===92?j:F)}function j(ie){return ie===60||ie===62||ie===92?(i.consume(ie),F):F(ie)}function K(ie){return!A&&(ie===null||ie===41||z2(ie))?(i.exit("chunkString"),i.exit(y),i.exit(b),i.exit(d),s(ie)):A<_&&ie===40?(i.consume(ie),A++,K):ie===41?(i.consume(ie),A--,K):ie===null||ie===32||ie===40||_me(ie)?u(ie):(i.consume(ie),ie===92?ee:K)}function ee(ie){return ie===40||ie===41||ie===92?(i.consume(ie),K):K(ie)}}function eUe(i,s,u,d,p,v){const b=this;let y=0,T;return _;function _(F){return i.enter(d),i.enter(p),i.consume(F),i.exit(p),i.enter(v),A}function A(F){return y>999||F===null||F===91||F===93&&!T||F===94&&!y&&"_hiddenFootnoteSupport"in b.parser.constructs?u(F):F===93?(i.exit(v),i.enter(p),i.consume(F),i.exit(p),i.exit(d),s):so(F)?(i.enter("lineEnding"),i.consume(F),i.exit("lineEnding"),A):(i.enter("chunkString",{contentType:"string"}),P(F))}function P(F){return F===null||F===91||F===93||so(F)||y++>999?(i.exit("chunkString"),A(F)):(i.consume(F),T||(T=!Iu(F)),F===92?R:P)}function R(F){return F===91||F===92||F===93?(i.consume(F),y++,P):P(F)}}function tUe(i,s,u,d,p,v){let b;return y;function y(R){return R===34||R===39||R===40?(i.enter(d),i.enter(p),i.consume(R),i.exit(p),b=R===40?41:R,T):u(R)}function T(R){return R===b?(i.enter(p),i.consume(R),i.exit(p),i.exit(d),s):(i.enter(v),_(R))}function _(R){return R===b?(i.exit(v),T(b)):R===null?u(R):so(R)?(i.enter("lineEnding"),i.consume(R),i.exit("lineEnding"),Kl(i,_,"linePrefix")):(i.enter("chunkString",{contentType:"string"}),A(R))}function A(R){return R===b||R===null||so(R)?(i.exit("chunkString"),_(R)):(i.consume(R),R===92?P:A)}function P(R){return R===b||R===92?(i.consume(R),A):A(R)}}function LR(i,s){let u;return d;function d(p){return so(p)?(i.enter("lineEnding"),i.consume(p),i.exit("lineEnding"),u=!0,d):Iu(p)?Kl(i,d,u?"linePrefix":"lineSuffix")(p):s(p)}}function HD(i){return i.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kJt={name:"definition",tokenize:TJt},EJt={tokenize:CJt,partial:!0};function TJt(i,s,u){const d=this;let p;return v;function v(F){return i.enter("definition"),b(F)}function b(F){return eUe.call(d,i,y,u,"definitionLabel","definitionLabelMarker","definitionLabelString")(F)}function y(F){return p=HD(d.sliceSerialize(d.events[d.events.length-1][1]).slice(1,-1)),F===58?(i.enter("definitionMarker"),i.consume(F),i.exit("definitionMarker"),T):u(F)}function T(F){return z2(F)?LR(i,_)(F):_(F)}function _(F){return ZVe(i,A,u,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(F)}function A(F){return i.attempt(EJt,P,P)(F)}function P(F){return Iu(F)?Kl(i,R,"whitespace")(F):R(F)}function R(F){return F===null||so(F)?(i.exit("definition"),d.parser.defined.push(p),s(F)):u(F)}}function CJt(i,s,u){return d;function d(y){return z2(y)?LR(i,p)(y):u(y)}function p(y){return tUe(i,v,u,"definitionTitle","definitionTitleMarker","definitionTitleString")(y)}function v(y){return Iu(y)?Kl(i,b,"whitespace")(y):b(y)}function b(y){return y===null||so(y)?s(y):u(y)}}const SJt={name:"hardBreakEscape",tokenize:_Jt};function _Jt(i,s,u){return d;function d(v){return i.enter("hardBreakEscape"),i.consume(v),p}function p(v){return so(v)?(i.exit("hardBreakEscape"),s(v)):u(v)}}const AJt={name:"headingAtx",tokenize:MJt,resolve:LJt};function LJt(i,s){let u=i.length-2,d=3,p,v;return i[d][1].type==="whitespace"&&(d+=2),u-2>d&&i[u][1].type==="whitespace"&&(u-=2),i[u][1].type==="atxHeadingSequence"&&(d===u-1||u-4>d&&i[u-2][1].type==="whitespace")&&(u-=d+1===u?2:4),u>d&&(p={type:"atxHeadingText",start:i[d][1].start,end:i[u][1].end},v={type:"chunkText",start:i[d][1].start,end:i[u][1].end,contentType:"text"},t5(i,d,u-d+1,[["enter",p,s],["enter",v,s],["exit",v,s],["exit",p,s]])),i}function MJt(i,s,u){let d=0;return p;function p(A){return i.enter("atxHeading"),v(A)}function v(A){return i.enter("atxHeadingSequence"),b(A)}function b(A){return A===35&&d++<6?(i.consume(A),b):A===null||z2(A)?(i.exit("atxHeadingSequence"),y(A)):u(A)}function y(A){return A===35?(i.enter("atxHeadingSequence"),T(A)):A===null||so(A)?(i.exit("atxHeading"),s(A)):Iu(A)?Kl(i,y,"whitespace")(A):(i.enter("atxHeadingText"),_(A))}function T(A){return A===35?(i.consume(A),T):(i.exit("atxHeadingSequence"),y(A))}function _(A){return A===null||A===35||z2(A)?(i.exit("atxHeadingText"),y(A)):(i.consume(A),_)}}const DJt=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nUe=["pre","script","style","textarea"],IJt={name:"htmlFlow",tokenize:BJt,resolveTo:PJt,concrete:!0},OJt={tokenize:RJt,partial:!0},NJt={tokenize:FJt,partial:!0};function PJt(i){let s=i.length;for(;s--&&!(i[s][0]==="enter"&&i[s][1].type==="htmlFlow"););return s>1&&i[s-2][1].type==="linePrefix"&&(i[s][1].start=i[s-2][1].start,i[s+1][1].start=i[s-2][1].start,i.splice(s-2,2)),i}function BJt(i,s,u){const d=this;let p,v,b,y,T;return _;function _(Ne){return A(Ne)}function A(Ne){return i.enter("htmlFlow"),i.enter("htmlFlowData"),i.consume(Ne),P}function P(Ne){return Ne===33?(i.consume(Ne),R):Ne===47?(i.consume(Ne),v=!0,K):Ne===63?(i.consume(Ne),p=3,d.interrupt?s:ke):n5(Ne)?(i.consume(Ne),b=String.fromCharCode(Ne),ee):u(Ne)}function R(Ne){return Ne===45?(i.consume(Ne),p=2,F):Ne===91?(i.consume(Ne),p=5,y=0,j):n5(Ne)?(i.consume(Ne),p=4,d.interrupt?s:ke):u(Ne)}function F(Ne){return Ne===45?(i.consume(Ne),d.interrupt?s:ke):u(Ne)}function j(Ne){const gn="CDATA[";return Ne===gn.charCodeAt(y++)?(i.consume(Ne),y===gn.length?d.interrupt?s:xe:j):u(Ne)}function K(Ne){return n5(Ne)?(i.consume(Ne),b=String.fromCharCode(Ne),ee):u(Ne)}function ee(Ne){if(Ne===null||Ne===47||Ne===62||z2(Ne)){const gn=Ne===47,_t=b.toLowerCase();return!gn&&!v&&nUe.includes(_t)?(p=1,d.interrupt?s(Ne):xe(Ne)):DJt.includes(b.toLowerCase())?(p=6,gn?(i.consume(Ne),ie):d.interrupt?s(Ne):xe(Ne)):(p=7,d.interrupt&&!d.parser.lazy[d.now().line]?u(Ne):v?oe(Ne):pe(Ne))}return Ne===45||H3(Ne)?(i.consume(Ne),b+=String.fromCharCode(Ne),ee):u(Ne)}function ie(Ne){return Ne===62?(i.consume(Ne),d.interrupt?s:xe):u(Ne)}function oe(Ne){return Iu(Ne)?(i.consume(Ne),oe):ge(Ne)}function pe(Ne){return Ne===47?(i.consume(Ne),ge):Ne===58||Ne===95||n5(Ne)?(i.consume(Ne),be):Iu(Ne)?(i.consume(Ne),pe):ge(Ne)}function be(Ne){return Ne===45||Ne===46||Ne===58||Ne===95||H3(Ne)?(i.consume(Ne),be):ae(Ne)}function ae(Ne){return Ne===61?(i.consume(Ne),ne):Iu(Ne)?(i.consume(Ne),ae):pe(Ne)}function ne(Ne){return Ne===null||Ne===60||Ne===61||Ne===62||Ne===96?u(Ne):Ne===34||Ne===39?(i.consume(Ne),T=Ne,se):Iu(Ne)?(i.consume(Ne),ne):de(Ne)}function se(Ne){return Ne===T?(i.consume(Ne),T=null,X):Ne===null||so(Ne)?u(Ne):(i.consume(Ne),se)}function de(Ne){return Ne===null||Ne===34||Ne===39||Ne===47||Ne===60||Ne===61||Ne===62||Ne===96||z2(Ne)?ae(Ne):(i.consume(Ne),de)}function X(Ne){return Ne===47||Ne===62||Iu(Ne)?pe(Ne):u(Ne)}function ge(Ne){return Ne===62?(i.consume(Ne),W):u(Ne)}function W(Ne){return Ne===null||so(Ne)?xe(Ne):Iu(Ne)?(i.consume(Ne),W):u(Ne)}function xe(Ne){return Ne===45&&p===2?(i.consume(Ne),je):Ne===60&&p===1?(i.consume(Ne),Ie):Ne===62&&p===4?(i.consume(Ne),Ke):Ne===63&&p===3?(i.consume(Ne),ke):Ne===93&&p===5?(i.consume(Ne),Ce):so(Ne)&&(p===6||p===7)?(i.exit("htmlFlowData"),i.check(OJt,Ft,U)(Ne)):Ne===null||so(Ne)?(i.exit("htmlFlowData"),U(Ne)):(i.consume(Ne),xe)}function U(Ne){return i.check(NJt,Fe,Ft)(Ne)}function Fe(Ne){return i.enter("lineEnding"),i.consume(Ne),i.exit("lineEnding"),Pe}function Pe(Ne){return Ne===null||so(Ne)?U(Ne):(i.enter("htmlFlowData"),xe(Ne))}function je(Ne){return Ne===45?(i.consume(Ne),ke):xe(Ne)}function Ie(Ne){return Ne===47?(i.consume(Ne),b="",Se):xe(Ne)}function Se(Ne){if(Ne===62){const gn=b.toLowerCase();return nUe.includes(gn)?(i.consume(Ne),Ke):xe(Ne)}return n5(Ne)&&b.length<8?(i.consume(Ne),b+=String.fromCharCode(Ne),Se):xe(Ne)}function Ce(Ne){return Ne===93?(i.consume(Ne),ke):xe(Ne)}function ke(Ne){return Ne===62?(i.consume(Ne),Ke):Ne===45&&p===2?(i.consume(Ne),ke):xe(Ne)}function Ke(Ne){return Ne===null||so(Ne)?(i.exit("htmlFlowData"),Ft(Ne)):(i.consume(Ne),Ke)}function Ft(Ne){return i.exit("htmlFlow"),s(Ne)}}function FJt(i,s,u){const d=this;return p;function p(b){return so(b)?(i.enter("lineEnding"),i.consume(b),i.exit("lineEnding"),v):u(b)}function v(b){return d.parser.lazy[d.now().line]?u(b):s(b)}}function RJt(i,s,u){return d;function d(p){return i.enter("lineEnding"),i.consume(p),i.exit("lineEnding"),i.attempt(YQ,s,u)}}const jJt={name:"htmlText",tokenize:$Jt};function $Jt(i,s,u){const d=this;let p,v,b;return y;function y(ke){return i.enter("htmlText"),i.enter("htmlTextData"),i.consume(ke),T}function T(ke){return ke===33?(i.consume(ke),_):ke===47?(i.consume(ke),ae):ke===63?(i.consume(ke),pe):n5(ke)?(i.consume(ke),de):u(ke)}function _(ke){return ke===45?(i.consume(ke),A):ke===91?(i.consume(ke),v=0,j):n5(ke)?(i.consume(ke),oe):u(ke)}function A(ke){return ke===45?(i.consume(ke),F):u(ke)}function P(ke){return ke===null?u(ke):ke===45?(i.consume(ke),R):so(ke)?(b=P,Ie(ke)):(i.consume(ke),P)}function R(ke){return ke===45?(i.consume(ke),F):P(ke)}function F(ke){return ke===62?je(ke):ke===45?R(ke):P(ke)}function j(ke){const Ke="CDATA[";return ke===Ke.charCodeAt(v++)?(i.consume(ke),v===Ke.length?K:j):u(ke)}function K(ke){return ke===null?u(ke):ke===93?(i.consume(ke),ee):so(ke)?(b=K,Ie(ke)):(i.consume(ke),K)}function ee(ke){return ke===93?(i.consume(ke),ie):K(ke)}function ie(ke){return ke===62?je(ke):ke===93?(i.consume(ke),ie):K(ke)}function oe(ke){return ke===null||ke===62?je(ke):so(ke)?(b=oe,Ie(ke)):(i.consume(ke),oe)}function pe(ke){return ke===null?u(ke):ke===63?(i.consume(ke),be):so(ke)?(b=pe,Ie(ke)):(i.consume(ke),pe)}function be(ke){return ke===62?je(ke):pe(ke)}function ae(ke){return n5(ke)?(i.consume(ke),ne):u(ke)}function ne(ke){return ke===45||H3(ke)?(i.consume(ke),ne):se(ke)}function se(ke){return so(ke)?(b=se,Ie(ke)):Iu(ke)?(i.consume(ke),se):je(ke)}function de(ke){return ke===45||H3(ke)?(i.consume(ke),de):ke===47||ke===62||z2(ke)?X(ke):u(ke)}function X(ke){return ke===47?(i.consume(ke),je):ke===58||ke===95||n5(ke)?(i.consume(ke),ge):so(ke)?(b=X,Ie(ke)):Iu(ke)?(i.consume(ke),X):je(ke)}function ge(ke){return ke===45||ke===46||ke===58||ke===95||H3(ke)?(i.consume(ke),ge):W(ke)}function W(ke){return ke===61?(i.consume(ke),xe):so(ke)?(b=W,Ie(ke)):Iu(ke)?(i.consume(ke),W):X(ke)}function xe(ke){return ke===null||ke===60||ke===61||ke===62||ke===96?u(ke):ke===34||ke===39?(i.consume(ke),p=ke,U):so(ke)?(b=xe,Ie(ke)):Iu(ke)?(i.consume(ke),xe):(i.consume(ke),Fe)}function U(ke){return ke===p?(i.consume(ke),p=void 0,Pe):ke===null?u(ke):so(ke)?(b=U,Ie(ke)):(i.consume(ke),U)}function Fe(ke){return ke===null||ke===34||ke===39||ke===60||ke===61||ke===96?u(ke):ke===47||ke===62||z2(ke)?X(ke):(i.consume(ke),Fe)}function Pe(ke){return ke===47||ke===62||z2(ke)?X(ke):u(ke)}function je(ke){return ke===62?(i.consume(ke),i.exit("htmlTextData"),i.exit("htmlText"),s):u(ke)}function Ie(ke){return i.exit("htmlTextData"),i.enter("lineEnding"),i.consume(ke),i.exit("lineEnding"),Se}function Se(ke){return Iu(ke)?Kl(i,Ce,"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ke):Ce(ke)}function Ce(ke){return i.enter("htmlTextData"),b(ke)}}const Ome={name:"labelEnd",tokenize:GJt,resolveTo:UJt,resolveAll:VJt},zJt={tokenize:KJt},qJt={tokenize:WJt},HJt={tokenize:YJt};function VJt(i){let s=-1;for(;++s]*>/g,"").trim()==="";await Promise.all([...K].map(ie=>new Promise(oe=>{function pe(){if(ie.style.display="flex",ie.style.flexDirection="column",ee){const be=qt().fontSize?qt().fontSize:window.getComputedStyle(document.body).fontSize,ae=5,ne=parseInt(be,10)*ae+"px";ie.style.minWidth=ne,ie.style.maxWidth=ne}else ie.style.width="100%";oe(ie)}setTimeout(()=>{ie.complete&&pe()}),ie.addEventListener("error",pe),ie.addEventListener("load",pe)})))}P=F.getBoundingClientRect(),j.attr("width",P.width),j.attr("height",P.height)}return v?y.attr("transform","translate("+-P.width/2+", "+-P.height/2+")"):y.attr("transform","translate(0, "+-P.height/2+")"),s.centerLabel&&y.attr("transform","translate("+-P.width/2+", "+-P.height/2+")"),y.insert("rect",":first-child"),{shapeSvg:b,bbox:P,halfPadding:R,label:y}},Kh=(i,s)=>{const u=s.node().getBBox();i.width=u.width,i.height=u.height};function r5(i,s,u,d){return i.insert("polygon",":first-child").attr("points",d.map(function(p){return p.x+","+p.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-s/2+","+u/2+")")}let Mo={},V3={},pUe={};const $Zt=()=>{V3={},pUe={},Mo={}},ZQ=(i,s)=>(Xe.trace("In isDescendant",s," ",i," = ",V3[s].includes(i)),!!V3[s].includes(i)),zZt=(i,s)=>(Xe.info("Descendants of ",s," is ",V3[s]),Xe.info("Edge is ",i),i.v===s||i.w===s?!1:V3[s]?V3[s].includes(i.v)||ZQ(i.v,s)||ZQ(i.w,s)||V3[s].includes(i.w):(Xe.debug("Tilt, ",s,",not in descendants"),!1)),bUe=(i,s,u,d)=>{Xe.warn("Copying children of ",i,"root",d,"data",s.node(i),d);const p=s.children(i)||[];i!==d&&p.push(i),Xe.warn("Copying (nodes) clusterId",i,"nodes",p),p.forEach(v=>{if(s.children(v).length>0)bUe(v,s,u,d);else{const b=s.node(v);Xe.info("cp ",v," to ",d," with parent ",i),u.setNode(v,b),d!==s.parent(v)&&(Xe.warn("Setting parent",v,s.parent(v)),u.setParent(v,s.parent(v))),i!==d&&v!==i?(Xe.debug("Setting parent",v,i),u.setParent(v,i)):(Xe.info("In copy ",i,"root",d,"data",s.node(i),d),Xe.debug("Not Setting parent for node=",v,"cluster!==rootId",i!==d,"node!==clusterId",v!==i));const y=s.edges(v);Xe.debug("Copying Edges",y),y.forEach(T=>{Xe.info("Edge",T);const _=s.edge(T.v,T.w,T.name);Xe.info("Edge data",_,d);try{zZt(T,d)?(Xe.info("Copying as ",T.v,T.w,_,T.name),u.setEdge(T.v,T.w,_,T.name),Xe.info("newGraph edges ",u.edges(),u.edge(u.edges()[0]))):Xe.info("Skipping copy of edge ",T.v,"-->",T.w," rootId: ",d," clusterId:",i)}catch(A){Xe.error(A)}})}Xe.debug("Removing node",v),s.removeNode(v)})},mUe=(i,s)=>{const u=s.children(i);let d=[...u];for(const p of u)pUe[p]=i,d=[...d,...mUe(p,s)];return d},MR=(i,s)=>{Xe.trace("Searching",i);const u=s.children(i);if(Xe.trace("Searching children of id ",i,u),u.length<1)return Xe.trace("This is a valid node",i),i;for(const d of u){const p=MR(d,s);if(p)return Xe.trace("Found replacement for",i," => ",p),p}},eJ=i=>!Mo[i]||!Mo[i].externalConnections?i:Mo[i]?Mo[i].id:i,qZt=(i,s)=>{if(!i||s>10){Xe.debug("Opting out, no graph ");return}else Xe.debug("Opting in, graph ");i.nodes().forEach(function(u){i.children(u).length>0&&(Xe.warn("Cluster identified",u," Replacement id in edges: ",MR(u,i)),V3[u]=mUe(u,i),Mo[u]={id:MR(u,i),clusterData:i.node(u)})}),i.nodes().forEach(function(u){const d=i.children(u),p=i.edges();d.length>0?(Xe.debug("Cluster identified",u,V3),p.forEach(v=>{if(v.v!==u&&v.w!==u){const b=ZQ(v.v,u),y=ZQ(v.w,u);b^y&&(Xe.warn("Edge: ",v," leaves cluster ",u),Xe.warn("Descendants of XXX ",u,": ",V3[u]),Mo[u].externalConnections=!0)}})):Xe.debug("Not a cluster ",u,V3)});for(let u of Object.keys(Mo)){const d=Mo[u].id,p=i.parent(d);p!==u&&Mo[p]&&!Mo[p].externalConnections&&(Mo[u].id=p)}i.edges().forEach(function(u){const d=i.edge(u);Xe.warn("Edge "+u.v+" -> "+u.w+": "+JSON.stringify(u)),Xe.warn("Edge "+u.v+" -> "+u.w+": "+JSON.stringify(i.edge(u)));let p=u.v,v=u.w;if(Xe.warn("Fix XXX",Mo,"ids:",u.v,u.w,"Translating: ",Mo[u.v]," --- ",Mo[u.w]),Mo[u.v]&&Mo[u.w]&&Mo[u.v]===Mo[u.w]){Xe.warn("Fixing and trixing link to self - removing XXX",u.v,u.w,u.name),Xe.warn("Fixing and trixing - removing XXX",u.v,u.w,u.name),p=eJ(u.v),v=eJ(u.w),i.removeEdge(u.v,u.w,u.name);const b=u.w+"---"+u.v;i.setNode(b,{domId:b,id:b,labelStyle:"",labelText:d.label,padding:0,shape:"labelRect",style:""});const y=structuredClone(d),T=structuredClone(d);y.label="",y.arrowTypeEnd="none",T.label="",y.fromCluster=u.v,T.toCluster=u.v,i.setEdge(p,b,y,u.name+"-cyclic-special"),i.setEdge(b,v,T,u.name+"-cyclic-special")}else if(Mo[u.v]||Mo[u.w]){if(Xe.warn("Fixing and trixing - removing XXX",u.v,u.w,u.name),p=eJ(u.v),v=eJ(u.w),i.removeEdge(u.v,u.w,u.name),p!==u.v){const b=i.parent(p);Mo[b].externalConnections=!0,d.fromCluster=u.v}if(v!==u.w){const b=i.parent(v);Mo[b].externalConnections=!0,d.toCluster=u.w}Xe.warn("Fix Replacing with XXX",p,v,u.name),i.setEdge(p,v,d,u.name)}}),Xe.warn("Adjusted Graph",q7(i)),vUe(i,0),Xe.trace(Mo)},vUe=(i,s)=>{if(Xe.warn("extractor - ",s,q7(i),i.children("D")),s>10){Xe.error("Bailing out");return}let u=i.nodes(),d=!1;for(const p of u){const v=i.children(p);d=d||v.length>0}if(!d){Xe.debug("Done, no node has children",i.nodes());return}Xe.debug("Nodes = ",u,s);for(const p of u)if(Xe.debug("Extracting node",p,Mo,Mo[p]&&!Mo[p].externalConnections,!i.parent(p),i.node(p),i.children("D")," Depth ",s),!Mo[p])Xe.debug("Not a cluster",p,s);else if(!Mo[p].externalConnections&&i.children(p)&&i.children(p).length>0){Xe.warn("Cluster without external connections, without a parent and with children",p,s);let b=i.graph().rankdir==="TB"?"LR":"TB";Mo[p]&&Mo[p].clusterData&&Mo[p].clusterData.dir&&(b=Mo[p].clusterData.dir,Xe.warn("Fixing dir",Mo[p].clusterData.dir,b));const y=new B0({multigraph:!0,compound:!0}).setGraph({rankdir:b,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Xe.warn("Old graph before copy",q7(i)),bUe(p,i,y,p),i.setNode(p,{clusterNode:!0,id:p,clusterData:Mo[p].clusterData,labelText:Mo[p].labelText,graph:y}),Xe.warn("New graph after copy node: (",p,")",q7(y)),Xe.debug("Old graph after copy",q7(i))}else Xe.warn("Cluster ** ",p," **not meeting the criteria !externalConnections:",!Mo[p].externalConnections," no parent: ",!i.parent(p)," children ",i.children(p)&&i.children(p).length>0,i.children("D"),s),Xe.debug(Mo);u=i.nodes(),Xe.warn("New list of nodes",u);for(const p of u){const v=i.node(p);Xe.warn(" Now next level",p,v),v.clusterNode&&vUe(v.graph,s+1)}},wUe=(i,s)=>{if(s.length===0)return[];let u=Object.assign(s);return s.forEach(d=>{const p=i.children(d),v=wUe(i,p);u=[...u,...v]}),u},HZt=i=>wUe(i,i.children());function VZt(i,s){return i.intersect(s)}function yUe(i,s,u,d){var p=i.x,v=i.y,b=p-d.x,y=v-d.y,T=Math.sqrt(s*s*y*y+u*u*b*b),_=Math.abs(s*u*b/T);d.x
"):P,s.labelStyle,!0,!0));if(f1(qt().flowchart.htmlLabels)){const K=F.children[0],ee=Ir(F);A=K.getBoundingClientRect(),ee.attr("width",A.width),ee.attr("height",A.height)}const j=s.padding/2;return Ir(F).attr("transform","translate( "+(A.width>R.width?0:(R.width-A.width)/2)+", "+(R.height+j+5)+")"),Ir(_).attr("transform","translate( "+(A.width
/gi):Array.isArray(i)?u=i:u=[];for(const d of u){const p=document.createElementNS("http://www.w3.org/2000/svg","tspan");p.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),p.setAttribute("dy","1em"),p.setAttribute("x","0"),p.setAttribute("class","row"),p.textContent=d.trim(),s.appendChild(p)}return s},xtn=i=>{let s="",u=0;return i.forEach(d=>{const p=R0==="TB"?H7[d].y:H7[d].x;p>=u&&(s=d,u=p)}),s||void 0},YUe=(i,s,u)=>{const d=qt().gitGraph,p=i.append("g").attr("class","commit-bullets"),v=i.append("g").attr("class","commit-labels");let b=0;R0==="TB"&&(b=30);const T=Object.keys(s).sort((R,F)=>s[R].seq-s[F].seq),_=d.parallelCommits,A=10,P=40;T.forEach(R=>{const F=s[R];if(_)if(F.parents.length){const ie=xtn(F.parents);b=R0==="TB"?H7[ie].y+P:H7[ie].x+P}else b=0,R0==="TB"&&(b=30);const j=b+A,K=R0==="TB"?j:H2[F.branch].pos,ee=R0==="TB"?H2[F.branch].pos:j;if(u){let ie,oe=F.customType!==void 0&&F.customType!==""?F.customType:F.type;switch(oe){case ad.NORMAL:ie="commit-normal";break;case ad.REVERSE:ie="commit-reverse";break;case ad.HIGHLIGHT:ie="commit-highlight";break;case ad.MERGE:ie="commit-merge";break;case ad.CHERRY_PICK:ie="commit-cherry-pick";break;default:ie="commit-normal"}if(oe===ad.HIGHLIGHT){const pe=p.append("rect");pe.attr("x",ee-10),pe.attr("y",K-10),pe.attr("height",20),pe.attr("width",20),pe.attr("class",`commit ${F.id} commit-highlight${H2[F.branch].index%XC} ${ie}-outer`),p.append("rect").attr("x",ee-6).attr("y",K-6).attr("height",12).attr("width",12).attr("class",`commit ${F.id} commit${H2[F.branch].index%XC} ${ie}-inner`)}else if(oe===ad.CHERRY_PICK)p.append("circle").attr("cx",ee).attr("cy",K).attr("r",10).attr("class",`commit ${F.id} ${ie}`),p.append("circle").attr("cx",ee-3).attr("cy",K+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${F.id} ${ie}`),p.append("circle").attr("cx",ee+3).attr("cy",K+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${F.id} ${ie}`),p.append("line").attr("x1",ee+3).attr("y1",K+1).attr("x2",ee).attr("y2",K-5).attr("stroke","#fff").attr("class",`commit ${F.id} ${ie}`),p.append("line").attr("x1",ee-3).attr("y1",K+1).attr("x2",ee).attr("y2",K-5).attr("stroke","#fff").attr("class",`commit ${F.id} ${ie}`);else{const pe=p.append("circle");if(pe.attr("cx",ee),pe.attr("cy",K),pe.attr("r",F.type===ad.MERGE?9:10),pe.attr("class",`commit ${F.id} commit${H2[F.branch].index%XC}`),oe===ad.MERGE){const be=p.append("circle");be.attr("cx",ee),be.attr("cy",K),be.attr("r",6),be.attr("class",`commit ${ie} ${F.id} commit${H2[F.branch].index%XC}`)}oe===ad.REVERSE&&p.append("path").attr("d",`M ${ee-5},${K-5}L${ee+5},${K+5}M${ee-5},${K+5}L${ee+5},${K-5}`).attr("class",`commit ${ie} ${F.id} commit${H2[F.branch].index%XC}`)}}if(R0==="TB"?H7[F.id]={x:ee,y:j}:H7[F.id]={x:j,y:K},u){if(F.type!==ad.CHERRY_PICK&&(F.customId&&F.type===ad.MERGE||F.type!==ad.MERGE)&&d.showCommitLabel){const pe=v.append("g"),be=pe.insert("rect").attr("class","commit-label-bkg"),ae=pe.append("text").attr("x",b).attr("y",K+25).attr("class","commit-label").text(F.id);let ne=ae.node().getBBox();if(be.attr("x",j-ne.width/2-2).attr("y",K+13.5).attr("width",ne.width+2*2).attr("height",ne.height+2*2),R0==="TB"&&(be.attr("x",ee-(ne.width+4*4+5)).attr("y",K-12),ae.attr("x",ee-(ne.width+4*4)).attr("y",K+ne.height-12)),R0!=="TB"&&ae.attr("x",j-ne.width/2),d.rotateCommitLabel)if(R0==="TB")ae.attr("transform","rotate(-45, "+ee+", "+K+")"),be.attr("transform","rotate(-45, "+ee+", "+K+")");else{let se=-7.5-(ne.width+10)/25*9.5,de=10+ne.width/25*8.5;pe.attr("transform","translate("+se+", "+de+") rotate(-45, "+b+", "+K+")")}}if(F.tag){const pe=v.insert("polygon"),be=v.append("circle"),ae=v.append("text").attr("y",K-16).attr("class","tag-label").text(F.tag);let ne=ae.node().getBBox();ae.attr("x",j-ne.width/2);const se=ne.height/2,de=K-19.2;pe.attr("class","tag-label-bkg").attr("points",`
+`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var se=this.next();return se||this.lex()},begin:function(se){this.conditionStack.push(se)},popState:function(){var se=this.conditionStack.length-1;return se>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(se){return se=this.conditionStack.length-1-Math.abs(se||0),se>=0?this.conditionStack[se]:"INITIAL"},pushState:function(se){this.begin(se)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(se,de,X,ge){switch(X){case 0:return this.begin("acc_title"),19;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),21;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 13;case 8:break;case 9:break;case 10:return 5;case 11:return 40;case 12:return 32;case 13:return 38;case 14:return 42;case 15:return 43;case 16:return 44;case 17:return 45;case 18:return 35;case 19:return 28;case 20:return 29;case 21:return 37;case 22:return 31;case 23:return 34;case 24:return 26;case 25:return 9;case 26:return 9;case 27:return 8;case 28:return"CARET";case 29:this.begin("options");break;case 30:this.popState();break;case 31:return 12;case 32:return 36;case 33:this.begin("string");break;case 34:this.popState();break;case 35:return 33;case 36:return 30;case 37:return 46;case 38:return 7}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit(?=\s|$))/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch(?=\s|$))/i,/^(?:order:)/i,/^(?:merge(?=\s|$))/i,/^(?:cherry-pick(?=\s|$))/i,/^(?:parent:)/i,/^(?:checkout(?=\s|$))/i,/^(?:LR\b)/i,/^(?:TB\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[0-9]+(?=\s|$))/i,/^(?:\w([-\./\w]*[-\w])?)/i,/^(?:$)/i,/^(?:\s+)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},options:{rules:[30,31],inclusive:!1},string:{rules:[34,35],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,32,33,36,37,38,39],inclusive:!0}}};return ae}();oe.lexer=pe;function be(){this.yy={}}return be.prototype=oe,oe.Parser=be,new be}();Kme.parser=Kme;const ttn=Kme;let oJ=qt().gitGraph.mainBranchName,ntn=qt().gitGraph.mainBranchOrder,b1={},Np=null,OR={};OR[oJ]={name:oJ,order:ntn};let F0={};F0[oJ]=Np;let sd=oJ,qUe="LR",YC=0;function Wme(){return mje({length:7})}function rtn(i,s){const u=Object.create(null);return i.reduce((d,p)=>{const v=s(p);return u[v]||(u[v]=!0,d.push(p)),d},[])}const itn=function(i){qUe=i};let HUe={};const stn=function(i){Xe.debug("options str",i),i=i&&i.trim(),i=i||"{}";try{HUe=JSON.parse(i)}catch(s){Xe.error("error while parsing gitGraph options",s.message)}},atn=function(){return HUe},otn=function(i,s,u,d){Xe.debug("Entering commit:",i,s,u,d),s=ci.sanitizeText(s,qt()),i=ci.sanitizeText(i,qt()),d=ci.sanitizeText(d,qt());const p={id:s||YC+"-"+Wme(),message:i,seq:YC++,type:u||UD.NORMAL,tag:d||"",parents:Np==null?[]:[Np.id],branch:sd};Np=p,b1[p.id]=p,F0[sd]=p.id,Xe.debug("in pushCommit "+p.id)},ctn=function(i,s){if(i=ci.sanitizeText(i,qt()),F0[i]===void 0)F0[i]=Np!=null?Np.id:null,OR[i]={name:i,order:s?parseInt(s,10):null},VUe(i),Xe.debug("in createBranch");else{let u=new Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout '+i+'")');throw u.hash={text:"branch "+i,token:"branch "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+i+'"']},u}},utn=function(i,s,u,d){i=ci.sanitizeText(i,qt()),s=ci.sanitizeText(s,qt());const p=b1[F0[sd]],v=b1[F0[i]];if(sd===i){let y=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw y.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},y}else if(p===void 0||!p){let y=new Error('Incorrect usage of "merge". Current branch ('+sd+")has no commits");throw y.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["commit"]},y}else if(F0[i]===void 0){let y=new Error('Incorrect usage of "merge". Branch to be merged ('+i+") does not exist");throw y.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch "+i]},y}else if(v===void 0||!v){let y=new Error('Incorrect usage of "merge". Branch to be merged ('+i+") has no commits");throw y.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"commit"']},y}else if(p===v){let y=new Error('Incorrect usage of "merge". Both branches have same head');throw y.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},y}else if(s&&b1[s]!==void 0){let y=new Error('Incorrect usage of "merge". Commit with id:'+s+" already exists, use different custom Id");throw y.hash={text:"merge "+i+s+u+d,token:"merge "+i+s+u+d,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["merge "+i+" "+s+"_UNIQUE "+u+" "+d]},y}const b={id:s||YC+"-"+Wme(),message:"merged branch "+i+" into "+sd,seq:YC++,parents:[Np==null?null:Np.id,F0[i]],branch:sd,type:UD.MERGE,customType:u,customId:!!s,tag:d||""};Np=b,b1[b.id]=b,F0[sd]=b.id,Xe.debug(F0),Xe.debug("in mergeBranch")},ltn=function(i,s,u,d){if(Xe.debug("Entering cherryPick:",i,s,u),i=ci.sanitizeText(i,qt()),s=ci.sanitizeText(s,qt()),u=ci.sanitizeText(u,qt()),d=ci.sanitizeText(d,qt()),!i||b1[i]===void 0){let b=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw b.hash={text:"cherryPick "+i+" "+s,token:"cherryPick "+i+" "+s,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},b}let p=b1[i],v=p.branch;if(d&&!(Array.isArray(p.parents)&&p.parents.includes(d)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");if(p.type===UD.MERGE&&!d)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!s||b1[s]===void 0){if(v===sd){let T=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw T.hash={text:"cherryPick "+i+" "+s,token:"cherryPick "+i+" "+s,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},T}const b=b1[F0[sd]];if(b===void 0||!b){let T=new Error('Incorrect usage of "cherry-pick". Current branch ('+sd+")has no commits");throw T.hash={text:"cherryPick "+i+" "+s,token:"cherryPick "+i+" "+s,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},T}const y={id:YC+"-"+Wme(),message:"cherry-picked "+p+" into "+sd,seq:YC++,parents:[Np==null?null:Np.id,p.id],branch:sd,type:UD.CHERRY_PICK,tag:u??`cherry-pick:${p.id}${p.type===UD.MERGE?`|parent:${d}`:""}`};Np=y,b1[y.id]=y,F0[sd]=y.id,Xe.debug(F0),Xe.debug("in cherryPick")}},VUe=function(i){if(i=ci.sanitizeText(i,qt()),F0[i]===void 0){let s=new Error('Trying to checkout branch which is not yet created. (Help try using "branch '+i+'")');throw s.hash={text:"checkout "+i,token:"checkout "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"branch '+i+'"']},s}else{sd=i;const s=F0[sd];Np=b1[s]}};function UUe(i,s,u){const d=i.indexOf(s);d===-1?i.push(u):i.splice(d,1,u)}function GUe(i){const s=i.reduce((p,v)=>p.seq>v.seq?p:v,i[0]);let u="";i.forEach(function(p){p===s?u+=" *":u+=" |"});const d=[u,s.id,s.seq];for(let p in F0)F0[p]===s.id&&d.push(p);if(Xe.debug(d.join(" ")),s.parents&&s.parents.length==2){const p=b1[s.parents[0]];UUe(i,s,p),i.push(b1[s.parents[1]])}else{if(s.parents.length==0)return;{const p=b1[s.parents];UUe(i,s,p)}}i=rtn(i,p=>p.id),GUe(i)}const htn=function(){Xe.debug(b1);const i=KUe()[0];GUe([i])},ftn=function(){b1={},Np=null;let i=qt().gitGraph.mainBranchName,s=qt().gitGraph.mainBranchOrder;F0={},F0[i]=null,OR={},OR[i]={name:i,order:s},sd=i,YC=0,Pg()},dtn=function(){return Object.values(OR).map((s,u)=>s.order!==null?s:{...s,order:parseFloat(`0.${u}`,10)}).sort((s,u)=>s.order-u.order).map(({name:s})=>({name:s}))},gtn=function(){return F0},ptn=function(){return b1},KUe=function(){const i=Object.keys(b1).map(function(s){return b1[s]});return i.forEach(function(s){Xe.debug(s.id)}),i.sort((s,u)=>s.seq-u.seq),i},btn=function(){return sd},mtn=function(){return qUe},vtn=function(){return Np},UD={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},wtn={getConfig:()=>qt().gitGraph,setDirection:itn,setOptions:stn,getOptions:atn,commit:otn,branch:ctn,merge:utn,cherryPick:ltn,checkout:VUe,prettyPrint:htn,clear:ftn,getBranchesAsObjArray:dtn,getBranches:gtn,getCommits:ptn,getCommitsArray:KUe,getCurrentBranch:btn,getDirection:mtn,getHead:vtn,setAccTitle:Bg,getAccTitle:Cp,getAccDescription:_p,setAccDescription:Sp,setDiagramTitle:cm,getDiagramTitle:Ap,commitType:UD};let NR={};const ad={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},XC=8;let H2={},H7={},cJ=[],PR=0,R0="LR";const ytn=()=>{H2={},H7={},NR={},PR=0,cJ=[],R0="LR"},WUe=i=>{const s=document.createElementNS("http://www.w3.org/2000/svg","text");let u=[];typeof i=="string"?u=i.split(/\\n|\n|
/gi):Array.isArray(i)?u=i:u=[];for(const d of u){const p=document.createElementNS("http://www.w3.org/2000/svg","tspan");p.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),p.setAttribute("dy","1em"),p.setAttribute("x","0"),p.setAttribute("class","row"),p.textContent=d.trim(),s.appendChild(p)}return s},xtn=i=>{let s="",u=0;return i.forEach(d=>{const p=R0==="TB"?H7[d].y:H7[d].x;p>=u&&(s=d,u=p)}),s||void 0},YUe=(i,s,u)=>{const d=qt().gitGraph,p=i.append("g").attr("class","commit-bullets"),v=i.append("g").attr("class","commit-labels");let b=0;R0==="TB"&&(b=30);const T=Object.keys(s).sort((R,F)=>s[R].seq-s[F].seq),_=d.parallelCommits,A=10,P=40;T.forEach(R=>{const F=s[R];if(_)if(F.parents.length){const ie=xtn(F.parents);b=R0==="TB"?H7[ie].y+P:H7[ie].x+P}else b=0,R0==="TB"&&(b=30);const j=b+A,K=R0==="TB"?j:H2[F.branch].pos,ee=R0==="TB"?H2[F.branch].pos:j;if(u){let ie,oe=F.customType!==void 0&&F.customType!==""?F.customType:F.type;switch(oe){case ad.NORMAL:ie="commit-normal";break;case ad.REVERSE:ie="commit-reverse";break;case ad.HIGHLIGHT:ie="commit-highlight";break;case ad.MERGE:ie="commit-merge";break;case ad.CHERRY_PICK:ie="commit-cherry-pick";break;default:ie="commit-normal"}if(oe===ad.HIGHLIGHT){const pe=p.append("rect");pe.attr("x",ee-10),pe.attr("y",K-10),pe.attr("height",20),pe.attr("width",20),pe.attr("class",`commit ${F.id} commit-highlight${H2[F.branch].index%XC} ${ie}-outer`),p.append("rect").attr("x",ee-6).attr("y",K-6).attr("height",12).attr("width",12).attr("class",`commit ${F.id} commit${H2[F.branch].index%XC} ${ie}-inner`)}else if(oe===ad.CHERRY_PICK)p.append("circle").attr("cx",ee).attr("cy",K).attr("r",10).attr("class",`commit ${F.id} ${ie}`),p.append("circle").attr("cx",ee-3).attr("cy",K+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${F.id} ${ie}`),p.append("circle").attr("cx",ee+3).attr("cy",K+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${F.id} ${ie}`),p.append("line").attr("x1",ee+3).attr("y1",K+1).attr("x2",ee).attr("y2",K-5).attr("stroke","#fff").attr("class",`commit ${F.id} ${ie}`),p.append("line").attr("x1",ee-3).attr("y1",K+1).attr("x2",ee).attr("y2",K-5).attr("stroke","#fff").attr("class",`commit ${F.id} ${ie}`);else{const pe=p.append("circle");if(pe.attr("cx",ee),pe.attr("cy",K),pe.attr("r",F.type===ad.MERGE?9:10),pe.attr("class",`commit ${F.id} commit${H2[F.branch].index%XC}`),oe===ad.MERGE){const be=p.append("circle");be.attr("cx",ee),be.attr("cy",K),be.attr("r",6),be.attr("class",`commit ${ie} ${F.id} commit${H2[F.branch].index%XC}`)}oe===ad.REVERSE&&p.append("path").attr("d",`M ${ee-5},${K-5}L${ee+5},${K+5}M${ee-5},${K+5}L${ee+5},${K-5}`).attr("class",`commit ${ie} ${F.id} commit${H2[F.branch].index%XC}`)}}if(R0==="TB"?H7[F.id]={x:ee,y:j}:H7[F.id]={x:j,y:K},u){if(F.type!==ad.CHERRY_PICK&&(F.customId&&F.type===ad.MERGE||F.type!==ad.MERGE)&&d.showCommitLabel){const pe=v.append("g"),be=pe.insert("rect").attr("class","commit-label-bkg"),ae=pe.append("text").attr("x",b).attr("y",K+25).attr("class","commit-label").text(F.id);let ne=ae.node().getBBox();if(be.attr("x",j-ne.width/2-2).attr("y",K+13.5).attr("width",ne.width+2*2).attr("height",ne.height+2*2),R0==="TB"&&(be.attr("x",ee-(ne.width+4*4+5)).attr("y",K-12),ae.attr("x",ee-(ne.width+4*4)).attr("y",K+ne.height-12)),R0!=="TB"&&ae.attr("x",j-ne.width/2),d.rotateCommitLabel)if(R0==="TB")ae.attr("transform","rotate(-45, "+ee+", "+K+")"),be.attr("transform","rotate(-45, "+ee+", "+K+")");else{let se=-7.5-(ne.width+10)/25*9.5,de=10+ne.width/25*8.5;pe.attr("transform","translate("+se+", "+de+") rotate(-45, "+b+", "+K+")")}}if(F.tag){const pe=v.insert("polygon"),be=v.append("circle"),ae=v.append("text").attr("y",K-16).attr("class","tag-label").text(F.tag);let ne=ae.node().getBBox();ae.attr("x",j-ne.width/2);const se=ne.height/2,de=K-19.2;pe.attr("class","tag-label-bkg").attr("points",`
${b-ne.width/2-4/2},${de+2}
${b-ne.width/2-4/2},${de-2}
${j-ne.width/2-4},${de-se-2}
@@ -616,7 +616,7 @@ Expecting `+kt.join(", ")+", got '"+(this.terminals_[_t]||_t)+"'":On="Parse erro
Expecting `+xi.join(", ")+", got '"+(this.terminals_[Qe]||Qe)+"'":Ma="Parse error on line "+(ke+1)+": Unexpected "+(Qe==Ne?"end of input":"'"+(this.terminals_[Qe]||Qe)+"'"),this.parseError(Ma,{text:_t.match,token:this.terminals_[Qe]||Qe,line:_t.yylineno,loc:ln,expected:xi})}if(kt[0]instanceof Array&&kt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Dt+", token: "+Qe);switch(kt[0]){case 1:Fe.push(Qe),je.push(_t.yytext),Ie.push(_t.yylloc),Fe.push(kt[1]),Qe=null,Ke=_t.yyleng,Ce=_t.yytext,ke=_t.yylineno,ln=_t.yylloc;break;case 2:if(yt=this.productions_[kt[1]][1],ht.$=je[je.length-yt],ht._$={first_line:Ie[Ie.length-(yt||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-(yt||1)].first_column,last_column:Ie[Ie.length-1].last_column},xt&&(ht._$.range=[Ie[Ie.length-(yt||1)].range[0],Ie[Ie.length-1].range[1]]),On=this.performAction.apply(ht,[Ce,Ke,ke,Et.yy,kt[1],je,Ie].concat(gn)),typeof On<"u")return On;yt&&(Fe=Fe.slice(0,-1*yt*2),je=je.slice(0,-1*yt),Ie=Ie.slice(0,-1*yt)),Fe.push(this.productions_[kt[1]][0]),je.push(ht.$),Ie.push(ht._$),ji=Se[Fe[Fe.length-2]][Fe[Fe.length-1]],Fe.push(ji);break;case 3:return!0}}return!0}},X=function(){var W={EOF:1,parseError:function(U,Fe){if(this.yy.parser)this.yy.parser.parseError(U,Fe);else throw new Error(U)},setInput:function(xe,U){return this.yy=U||this.yy||{},this._input=xe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var xe=this._input[0];this.yytext+=xe,this.yyleng++,this.offset++,this.match+=xe,this.matched+=xe;var U=xe.match(/(?:\r\n?|\n).*/g);return U?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),xe},unput:function(xe){var U=xe.length,Fe=xe.split(/(?:\r\n?|\n)/g);this._input=xe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-U),this.offset-=U;var Pe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Fe.length-1&&(this.yylineno-=Fe.length-1);var je=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Fe?(Fe.length===Pe.length?this.yylloc.first_column:0)+Pe[Pe.length-Fe.length].length-Fe[0].length:this.yylloc.first_column-U},this.options.ranges&&(this.yylloc.range=[je[0],je[0]+this.yyleng-U]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(xe){this.unput(this.match.slice(xe))},pastInput:function(){var xe=this.matched.substr(0,this.matched.length-this.match.length);return(xe.length>20?"...":"")+xe.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var xe=this.match;return xe.length<20&&(xe+=this._input.substr(0,20-xe.length)),(xe.substr(0,20)+(xe.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var xe=this.pastInput(),U=new Array(xe.length+1).join("-");return xe+this.upcomingInput()+`
`+U+"^"},test_match:function(xe,U){var Fe,Pe,je;if(this.options.backtrack_lexer&&(je={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(je.yylloc.range=this.yylloc.range.slice(0))),Pe=xe[0].match(/(?:\r\n?|\n).*/g),Pe&&(this.yylineno+=Pe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Pe?Pe[Pe.length-1].length-Pe[Pe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+xe[0].length},this.yytext+=xe[0],this.match+=xe[0],this.matches=xe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(xe[0].length),this.matched+=xe[0],Fe=this.performAction.call(this,this.yy,this,U,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Fe)return Fe;if(this._backtrack){for(var Ie in je)this[Ie]=je[Ie];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var xe,U,Fe,Pe;this._more||(this.yytext="",this.match="");for(var je=this._currentRules(),Ie=0;Ie=6&&u.includes("weekends")||u.includes(i.format("dddd").toLowerCase())?!0:u.includes(i.format(s.trim()))},rnn=function(i){ive=i},inn=function(){return ive},tGe=function(i,s,u,d){if(!u.length||i.manualEndTime)return;let p;i.startTime instanceof Date?p=Lg(i.startTime):p=Lg(i.startTime,s,!0),p=p.add(1,"d");let v;i.endTime instanceof Date?v=Lg(i.endTime):v=Lg(i.endTime,s,!0);const[b,y]=snn(p,v,s,u,d);i.endTime=b.toDate(),i.renderEndTime=y},snn=function(i,s,u,d,p){let v=!1,b=null;for(;i<=s;)v||(b=s.toDate()),v=eGe(i,u,d,p),v&&(s=s.add(1,"d")),i=i.add(1,"d");return[s,b]},ave=function(i,s,u){u=u.trim();const p=/^after\s+(?=6&&u.includes("weekends")||u.includes(i.format("dddd").toLowerCase())?!0:u.includes(i.format(s.trim()))},rnn=function(i){ive=i},inn=function(){return ive},tGe=function(i,s,u,d){if(!u.length||i.manualEndTime)return;let p;i.startTime instanceof Date?p=Lg(i.startTime):p=Lg(i.startTime,s,!0),p=p.add(1,"d");let v;i.endTime instanceof Date?v=Lg(i.endTime):v=Lg(i.endTime,s,!0);const[b,y]=snn(p,v,s,u,d);i.endTime=b.toDate(),i.renderEndTime=y},snn=function(i,s,u,d,p){let v=!1,b=null;for(;i<=s;)v||(b=s.toDate()),v=eGe(i,u,d,p),v&&(s=s.add(1,"d")),i=i.add(1,"d");return[s,b]},ave=function(i,s,u){u=u.trim();const p=/^after\s+(?
");b=b.replace(/\n/g,"
");const y=b.split(li.lineBreakRegex);let T=1.25*qt().state.noteMargin;for(const _ of y){const A=_.trim();if(A.length>0){const P=v.append("tspan");if(P.text(A),T===0){const R=P.node().getBBox();T+=R.height}p+=T,P.attr("x",s+qt().state.noteMargin),P.attr("y",u+p+1.25*qt().state.noteMargin)}}return{textWidth:v.node().getBBox().width,textHeight:p}},Osn=(i,s)=>{s.attr("class","state-note");const u=s.append("rect").attr("x",0).attr("y",qt().state.padding),d=s.append("g"),{textWidth:p,textHeight:v}=Isn(i,0,0,d);return u.attr("height",v+2*qt().state.noteMargin),u.attr("width",p+qt().state.noteMargin*2),u},EKe=function(i,s){const u=s.id,d={id:u,label:s.id,width:0,height:0},p=i.append("g").attr("id",u).attr("class","stateGroup");s.type==="start"&&Csn(p),s.type==="end"&&Msn(p),(s.type==="fork"||s.type==="join")&&Dsn(p,s),s.type==="note"&&Osn(s.note.text,p),s.type==="divider"&&Ssn(p),s.type==="default"&&s.descriptions.length===0&&_sn(p,s),s.type==="default"&&s.descriptions.length>0&&Asn(p,s);const v=p.node().getBBox();return d.width=v.width+2*qt().state.padding,d.height=v.height+2*qt().state.padding,Tsn.set(u,d),d};let TKe=0;const Nsn=function(i,s,u){const d=function(T){switch(T){case G7.relationType.AGGREGATION:return"aggregation";case G7.relationType.EXTENSION:return"extension";case G7.relationType.COMPOSITION:return"composition";case G7.relationType.DEPENDENCY:return"dependency"}};s.points=s.points.filter(T=>!Number.isNaN(T.y));const p=s.points,v=k7().x(function(T){return T.x}).y(function(T){return T.y}).curve(FF),b=i.append("path").attr("d",v(p)).attr("id","edge"+TKe).attr("class","transition");let y="";if(qt().state.arrowMarkerAbsolute&&(y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,y=y.replace(/\(/g,"\\("),y=y.replace(/\)/g,"\\)")),b.attr("marker-end","url("+y+"#"+d(G7.relationType.DEPENDENCY)+"End)"),u.title!==void 0){const T=i.append("g").attr("class","stateLabel"),{x:_,y:A}=Ao.calcLabelPosition(s.points),P=li.getRows(u.title);let R=0;const F=[];let j=0,K=0;for(let oe=0;oe<=P.length;oe++){const pe=T.append("text").attr("text-anchor","middle").text(P[oe]).attr("x",_).attr("y",A+R),be=pe.node().getBBox();j=Math.max(j,be.width),K=Math.min(K,be.x),Xe.info(be.x,_,A+R),R===0&&(R=pe.node().getBBox().height,Xe.info("Title height",R,A)),F.push(pe)}let ee=R*P.length;if(P.length>1){const oe=(P.length-1)*R*.5;F.forEach((pe,be)=>pe.attr("y",A+be*R-oe)),ee=R*P.length}const ie=T.node().getBBox();T.insert("rect",":first-child").attr("class","box").attr("x",_-j/2-qt().state.padding/2).attr("y",A-ee/2-qt().state.padding/2-3.5).attr("width",j+qt().state.padding).attr("height",ee+qt().state.padding),Xe.info(ie)}TKe++};let gm;const qve={},Psn=function(){},Bsn=function(i){i.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},Fsn=function(i,s,u,d){gm=qt().state;const p=qt().securityLevel;let v;p==="sandbox"&&(v=Ir("#i"+s));const b=Ir(p==="sandbox"?v.nodes()[0].contentDocument.body:"body"),y=p==="sandbox"?v.nodes()[0].contentDocument:document;Xe.debug("Rendering diagram "+i);const T=b.select(`[id='${s}']`);Bsn(T);const _=d.db.getRootDoc();CKe(_,T,void 0,!1,b,y,d);const A=gm.padding,P=T.node().getBBox(),R=P.width+A*2,F=P.height+A*2,j=R*1.75;Ng(T,F,j,gm.useMaxWidth),T.attr("viewBox",`${P.x-gm.padding} ${P.y-gm.padding} `+R+" "+F)},Rsn=i=>i?i.length*gm.fontSizeFactor:1,CKe=(i,s,u,d,p,v,b)=>{const y=new B0({compound:!0,multigraph:!0});let T,_=!0;for(T=0;T
");b=b.replace(/\n/g,"
");const y=b.split(ci.lineBreakRegex);let T=1.25*qt().state.noteMargin;for(const _ of y){const A=_.trim();if(A.length>0){const P=v.append("tspan");if(P.text(A),T===0){const R=P.node().getBBox();T+=R.height}p+=T,P.attr("x",s+qt().state.noteMargin),P.attr("y",u+p+1.25*qt().state.noteMargin)}}return{textWidth:v.node().getBBox().width,textHeight:p}},Osn=(i,s)=>{s.attr("class","state-note");const u=s.append("rect").attr("x",0).attr("y",qt().state.padding),d=s.append("g"),{textWidth:p,textHeight:v}=Isn(i,0,0,d);return u.attr("height",v+2*qt().state.noteMargin),u.attr("width",p+qt().state.noteMargin*2),u},EKe=function(i,s){const u=s.id,d={id:u,label:s.id,width:0,height:0},p=i.append("g").attr("id",u).attr("class","stateGroup");s.type==="start"&&Csn(p),s.type==="end"&&Msn(p),(s.type==="fork"||s.type==="join")&&Dsn(p,s),s.type==="note"&&Osn(s.note.text,p),s.type==="divider"&&Ssn(p),s.type==="default"&&s.descriptions.length===0&&_sn(p,s),s.type==="default"&&s.descriptions.length>0&&Asn(p,s);const v=p.node().getBBox();return d.width=v.width+2*qt().state.padding,d.height=v.height+2*qt().state.padding,Tsn.set(u,d),d};let TKe=0;const Nsn=function(i,s,u){const d=function(T){switch(T){case G7.relationType.AGGREGATION:return"aggregation";case G7.relationType.EXTENSION:return"extension";case G7.relationType.COMPOSITION:return"composition";case G7.relationType.DEPENDENCY:return"dependency"}};s.points=s.points.filter(T=>!Number.isNaN(T.y));const p=s.points,v=k7().x(function(T){return T.x}).y(function(T){return T.y}).curve(FF),b=i.append("path").attr("d",v(p)).attr("id","edge"+TKe).attr("class","transition");let y="";if(qt().state.arrowMarkerAbsolute&&(y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,y=y.replace(/\(/g,"\\("),y=y.replace(/\)/g,"\\)")),b.attr("marker-end","url("+y+"#"+d(G7.relationType.DEPENDENCY)+"End)"),u.title!==void 0){const T=i.append("g").attr("class","stateLabel"),{x:_,y:A}=Ao.calcLabelPosition(s.points),P=ci.getRows(u.title);let R=0;const F=[];let j=0,K=0;for(let oe=0;oe<=P.length;oe++){const pe=T.append("text").attr("text-anchor","middle").text(P[oe]).attr("x",_).attr("y",A+R),be=pe.node().getBBox();j=Math.max(j,be.width),K=Math.min(K,be.x),Xe.info(be.x,_,A+R),R===0&&(R=pe.node().getBBox().height,Xe.info("Title height",R,A)),F.push(pe)}let ee=R*P.length;if(P.length>1){const oe=(P.length-1)*R*.5;F.forEach((pe,be)=>pe.attr("y",A+be*R-oe)),ee=R*P.length}const ie=T.node().getBBox();T.insert("rect",":first-child").attr("class","box").attr("x",_-j/2-qt().state.padding/2).attr("y",A-ee/2-qt().state.padding/2-3.5).attr("width",j+qt().state.padding).attr("height",ee+qt().state.padding),Xe.info(ie)}TKe++};let gm;const qve={},Psn=function(){},Bsn=function(i){i.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},Fsn=function(i,s,u,d){gm=qt().state;const p=qt().securityLevel;let v;p==="sandbox"&&(v=Ir("#i"+s));const b=Ir(p==="sandbox"?v.nodes()[0].contentDocument.body:"body"),y=p==="sandbox"?v.nodes()[0].contentDocument:document;Xe.debug("Rendering diagram "+i);const T=b.select(`[id='${s}']`);Bsn(T);const _=d.db.getRootDoc();CKe(_,T,void 0,!1,b,y,d);const A=gm.padding,P=T.node().getBBox(),R=P.width+A*2,F=P.height+A*2,j=R*1.75;Ng(T,F,j,gm.useMaxWidth),T.attr("viewBox",`${P.x-gm.padding} ${P.y-gm.padding} `+R+" "+F)},Rsn=i=>i?i.length*gm.fontSizeFactor:1,CKe=(i,s,u,d,p,v,b)=>{const y=new B0({compound:!0,multigraph:!0});let T,_=!0;for(T=0;T
/gi);for(let ee=0;ee
/gi);for(let ee=0;ee