diff --git a/.github/workflows/test-smokes.yml b/.github/workflows/test-smokes.yml
index 0fd1d425376..277646caa55 100644
--- a/.github/workflows/test-smokes.yml
+++ b/.github/workflows/test-smokes.yml
@@ -142,6 +142,16 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
+ - name: Show R session information
+ working-directory: tests
+ run: |
+ # Session info
+ cat("::group::Session info\n")
+ renv::install("sessioninfo")
+ sessioninfo::session_info(pkgs = "installed", include_base = TRUE)
+ cat("::endgroup::\n")
+ shell: Rscript {0}
+
- name: Install uv for Python
uses: astral-sh/setup-uv@v3
with:
diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md
index 6a0c891664e..e704845551b 100644
--- a/news/changelog-1.8.md
+++ b/news/changelog-1.8.md
@@ -95,3 +95,4 @@ All changes included in 1.8:
- ([#11321](https://github.com/quarto-dev/quarto-cli/issues/11321)): Follow [recommendation from LaTeX project](https://latex-project.org/news/latex2e-news/ltnews40.pdf) and use `lualatex` instead of `xelatex` as the default PDF engine.
- ([#12782](https://github.com/quarto-dev/quarto-cli/pull/12782)): fix bug on `safeRemoveDirSync`'s detection of safe directory boundaries.
- ([#12853](https://github.com/quarto-dev/quarto-cli/issues/12853)): fix replaceAll() escaping issue with embedded notebooks containing `$` in their Markdown.
+- ([#12939](https://github.com/quarto-dev/quarto-cli/pull/12939)): Upgrade `mermaidjs` to 11.6.0.
diff --git a/src/resources/formats/html/mermaid/mermaid.js b/src/resources/formats/html/mermaid/mermaid.js
index cd95d1c5d14..de795860f5c 100644
--- a/src/resources/formats/html/mermaid/mermaid.js
+++ b/src/resources/formats/html/mermaid/mermaid.js
@@ -44,7 +44,7 @@ var __esbuild_esm_mermaid = (() => {
"object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e3() : "function" == typeof define && define.amd ? define(e3) : (t4 = "undefined" != typeof globalThis ? globalThis : t4 || self).dayjs = e3();
}(exports2, function() {
"use strict";
- var t4 = 1e3, e3 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c3 = "month", f3 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $3 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y5 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: /* @__PURE__ */ __name(function(t5) {
+ var t4 = 1e3, e3 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c3 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $3 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y5 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: /* @__PURE__ */ __name(function(t5) {
var e4 = ["th", "st", "nd", "rd"], n3 = t5 % 100;
return "[" + t5 + (e4[(n3 - 20) % 10] || e4[n3] || e4[0]) + "]";
}, "ordinal") }, m2 = /* @__PURE__ */ __name(function(t5, e4, n3) {
@@ -60,7 +60,7 @@ var __esbuild_esm_mermaid = (() => {
}, "t"), a: /* @__PURE__ */ __name(function(t5) {
return t5 < 0 ? Math.ceil(t5) || 0 : Math.floor(t5);
}, "a"), p: /* @__PURE__ */ __name(function(t5) {
- return { M: c3, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f3 }[t5] || String(t5 || "").toLowerCase().replace(/s$/, "");
+ return { M: c3, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t5] || String(t5 || "").toLowerCase().replace(/s$/, "");
}, "p"), u: /* @__PURE__ */ __name(function(t5) {
return void 0 === t5;
}, "u") }, g2 = "en", D3 = {};
@@ -130,13 +130,13 @@ var __esbuild_esm_mermaid = (() => {
}, m3.valueOf = function() {
return this.$d.getTime();
}, m3.startOf = function(t5, e4) {
- var n3 = this, r3 = !!b2.u(e4) || e4, f4 = b2.p(t5), l3 = /* @__PURE__ */ __name(function(t6, e6) {
+ var n3 = this, r3 = !!b2.u(e4) || e4, f3 = b2.p(t5), l3 = /* @__PURE__ */ __name(function(t6, e6) {
var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e6, t6) : new Date(n3.$y, e6, t6), n3);
return r3 ? i3 : i3.endOf(a2);
}, "l"), $4 = /* @__PURE__ */ __name(function(t6, e6) {
return b2.w(n3.toDate()[t6].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e6)), n3);
}, "$"), y6 = this.$W, M4 = this.$M, m4 = this.$D, v4 = "set" + (this.$u ? "UTC" : "");
- switch (f4) {
+ switch (f3) {
case h2:
return r3 ? l3(1, 0) : l3(31, 11);
case c3:
@@ -159,7 +159,7 @@ var __esbuild_esm_mermaid = (() => {
}, m3.endOf = function(t5) {
return this.startOf(t5, false);
}, m3.$set = function(t5, e4) {
- var n3, o3 = b2.p(t5), f4 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f4 + "Date", n3[d2] = f4 + "Date", n3[c3] = f4 + "Month", n3[h2] = f4 + "FullYear", n3[u2] = f4 + "Hours", n3[s2] = f4 + "Minutes", n3[i2] = f4 + "Seconds", n3[r2] = f4 + "Milliseconds", n3)[o3], $4 = o3 === a2 ? this.$D + (e4 - this.$W) : e4;
+ var n3, o3 = b2.p(t5), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c3] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $4 = o3 === a2 ? this.$D + (e4 - this.$W) : e4;
if (o3 === c3 || o3 === h2) {
var y6 = this.clone().set(d2, 1);
y6.$d[l3]($4), y6.init(), this.$d = y6.set(d2, Math.min(this.$D, y6.daysInMonth())).$d;
@@ -169,10 +169,10 @@ var __esbuild_esm_mermaid = (() => {
return this.clone().$set(t5, e4);
}, m3.get = function(t5) {
return this[b2.p(t5)]();
- }, m3.add = function(r3, f4) {
+ }, m3.add = function(r3, f3) {
var d3, l3 = this;
r3 = Number(r3);
- var $4 = b2.p(f4), y6 = /* @__PURE__ */ __name(function(t5) {
+ var $4 = b2.p(f3), y6 = /* @__PURE__ */ __name(function(t5) {
var e4 = O2(l3);
return b2.w(e4.date(e4.date() + Math.round(t5 * r3)), l3);
}, "y");
@@ -187,11 +187,11 @@ var __esbuild_esm_mermaid = (() => {
}, m3.format = function(t5) {
var e4 = this, n3 = this.$locale();
if (!this.isValid()) return n3.invalidDate || l2;
- var r3 = t5 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c4 = n3.months, f4 = n3.meridiem, h3 = /* @__PURE__ */ __name(function(t6, n4, i4, s4) {
+ var r3 = t5 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c4 = n3.months, f3 = n3.meridiem, h3 = /* @__PURE__ */ __name(function(t6, n4, i4, s4) {
return t6 && (t6[n4] || t6(e4, r3)) || i4[n4].slice(0, s4);
}, "h"), d3 = /* @__PURE__ */ __name(function(t6) {
return b2.s(s3 % 12 || 12, t6, "0");
- }, "d"), $4 = f4 || function(t6, e6, n4) {
+ }, "d"), $4 = f3 || function(t6, e6, n4) {
var r4 = t6 < 12 ? "AM" : "PM";
return n4 ? r4.toLowerCase() : r4;
};
@@ -263,7 +263,7 @@ var __esbuild_esm_mermaid = (() => {
case c3:
$4 = D4();
break;
- case f3:
+ case f2:
$4 = D4() / 3;
break;
case o2:
@@ -393,10 +393,10 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/defaults.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon/defaults.mjs
var defaultIconDimensions, defaultIconTransformations, defaultIconProps, defaultExtendedIconProps;
var init_defaults = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/defaults.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon/defaults.mjs"() {
"use strict";
defaultIconDimensions = Object.freeze(
{
@@ -423,10 +423,10 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/customisations/defaults.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/customisations/defaults.mjs
var defaultIconSizeCustomisations, defaultIconCustomisations;
var init_defaults2 = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/customisations/defaults.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/customisations/defaults.mjs"() {
"use strict";
init_defaults();
defaultIconSizeCustomisations = Object.freeze({
@@ -442,13 +442,12 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/name.mjs
- var matchIconName, stringToIcon, validateIconName;
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon/name.mjs
+ var stringToIcon, validateIconName;
var init_name = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/name.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon/name.mjs"() {
"use strict";
- matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
- stringToIcon = /* @__PURE__ */ __name((value2, validate2, allowSimpleName, provider = "") => {
+ stringToIcon = /* @__PURE__ */ __name((value2, validate, allowSimpleName, provider = "") => {
const colonSeparated = value2.split(":");
if (value2.slice(0, 1) === "@") {
if (colonSeparated.length < 2 || colonSeparated.length > 3) {
@@ -468,7 +467,7 @@ var __esbuild_esm_mermaid = (() => {
prefix,
name: name2
};
- return validate2 && !validateIconName(result) ? null : result;
+ return validate && !validateIconName(result) ? null : result;
}
const name = colonSeparated[0];
const dashSeparated = name.split("-");
@@ -478,7 +477,7 @@ var __esbuild_esm_mermaid = (() => {
prefix: dashSeparated.shift(),
name: dashSeparated.join("-")
};
- return validate2 && !validateIconName(result) ? null : result;
+ return validate && !validateIconName(result) ? null : result;
}
if (allowSimpleName && provider === "") {
const result = {
@@ -486,20 +485,22 @@ var __esbuild_esm_mermaid = (() => {
prefix: "",
name
};
- return validate2 && !validateIconName(result, allowSimpleName) ? null : result;
+ return validate && !validateIconName(result, allowSimpleName) ? null : result;
}
return null;
}, "stringToIcon");
- validateIconName = /* @__PURE__ */ __name((icon, allowSimpleName) => {
- if (!icon) {
+ validateIconName = /* @__PURE__ */ __name((icon2, allowSimpleName) => {
+ if (!icon2) {
return false;
}
- return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
+ return !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
+ // Check name: cannot be empty
+ ((allowSimpleName && icon2.prefix === "" || !!icon2.prefix) && !!icon2.name);
}, "validateIconName");
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/transformations.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon/transformations.mjs
function mergeIconTransformations(obj1, obj2) {
const result = {};
if (!obj1.hFlip !== !obj2.hFlip) {
@@ -508,20 +509,20 @@ var __esbuild_esm_mermaid = (() => {
if (!obj1.vFlip !== !obj2.vFlip) {
result.vFlip = true;
}
- const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
- if (rotate) {
- result.rotate = rotate;
+ const rotate2 = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
+ if (rotate2) {
+ result.rotate = rotate2;
}
return result;
}
var init_transformations = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/transformations.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon/transformations.mjs"() {
"use strict";
__name(mergeIconTransformations, "mergeIconTransformations");
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/merge.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon/merge.mjs
function mergeIconData(parent4, child) {
const result = mergeIconTransformations(parent4, child);
for (const key in defaultExtendedIconProps) {
@@ -538,7 +539,7 @@ var __esbuild_esm_mermaid = (() => {
return result;
}
var init_merge = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/merge.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon/merge.mjs"() {
"use strict";
init_defaults();
init_transformations();
@@ -546,10 +547,10 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/tree.mjs
- function getIconsTree(data5, names) {
- const icons = data5.icons;
- const aliases = data5.aliases || /* @__PURE__ */ Object.create(null);
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon-set/tree.mjs
+ function getIconsTree(data6, names) {
+ const icons = data6.icons;
+ const aliases = data6.aliases || /* @__PURE__ */ Object.create(null);
const resolved = /* @__PURE__ */ Object.create(null);
function resolve3(name) {
if (icons[name]) {
@@ -570,37 +571,37 @@ var __esbuild_esm_mermaid = (() => {
return resolved;
}
var init_tree = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/tree.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon-set/tree.mjs"() {
"use strict";
__name(getIconsTree, "getIconsTree");
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs
- function internalGetIconData(data5, name, tree) {
- const icons = data5.icons;
- const aliases = data5.aliases || /* @__PURE__ */ Object.create(null);
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs
+ function internalGetIconData(data6, name, tree) {
+ const icons = data6.icons;
+ const aliases = data6.aliases || /* @__PURE__ */ Object.create(null);
let currentProps = {};
- function parse8(name2) {
+ function parse7(name2) {
currentProps = mergeIconData(
icons[name2] || aliases[name2],
currentProps
);
}
- __name(parse8, "parse");
- parse8(name);
- tree.forEach(parse8);
- return mergeIconData(data5, currentProps);
+ __name(parse7, "parse");
+ parse7(name);
+ tree.forEach(parse7);
+ return mergeIconData(data6, currentProps);
}
- function getIconData(data5, name) {
- if (data5.icons[name]) {
- return internalGetIconData(data5, name, []);
+ function getIconData(data6, name) {
+ if (data6.icons[name]) {
+ return internalGetIconData(data6, name, []);
}
- const tree = getIconsTree(data5, [name])[name];
- return tree ? internalGetIconData(data5, name, tree) : null;
+ const tree = getIconsTree(data6, [name])[name];
+ return tree ? internalGetIconData(data6, name, tree) : null;
}
var init_get_icon = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs"() {
"use strict";
init_merge();
init_tree();
@@ -609,7 +610,7 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/size.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/size.mjs
function calculateSize(size5, ratio, precision) {
if (ratio === 1) {
return size5;
@@ -648,7 +649,7 @@ var __esbuild_esm_mermaid = (() => {
}
var unitsSplit, unitsTest;
var init_size = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/size.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/size.mjs"() {
"use strict";
unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
@@ -656,7 +657,7 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/defs.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/defs.mjs
function splitSVGDefs(content, tag2 = "defs") {
let defs2 = "";
const index = content.indexOf("<" + tag2);
@@ -686,7 +687,7 @@ var __esbuild_esm_mermaid = (() => {
return mergeDefsAndContent(split.defs, start3 + split.content + end2);
}
var init_defs = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/defs.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/defs.mjs"() {
"use strict";
__name(splitSVGDefs, "splitSVGDefs");
__name(mergeDefsAndContent, "mergeDefsAndContent");
@@ -694,11 +695,11 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/build.mjs
- function iconToSVG(icon, customisations) {
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/build.mjs
+ function iconToSVG(icon2, customisations) {
const fullIcon = {
...defaultIconProps,
- ...icon
+ ...icon2
};
const fullCustomisations = {
...defaultIconCustomisations,
@@ -808,7 +809,7 @@ var __esbuild_esm_mermaid = (() => {
}
var isUnsetKeyword;
var init_build = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/build.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/build.mjs"() {
"use strict";
init_defaults();
init_defaults2();
@@ -819,7 +820,7 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/id.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/id.mjs
function replaceIDs(body, prefix = randomPrefix) {
const ids = [];
let match2;
@@ -830,9 +831,9 @@ var __esbuild_esm_mermaid = (() => {
return body;
}
const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
- ids.forEach((id27) => {
- const newID = typeof prefix === "function" ? prefix(id27) : prefix + (counter++).toString();
- const escapedID = id27.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+ ids.forEach((id29) => {
+ const newID = typeof prefix === "function" ? prefix(id29) : prefix + (counter++).toString();
+ const escapedID = id29.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
body = body.replace(
// Allowed characters before id: [#;"]
// Allowed characters after id: [)"], .[a-z]
@@ -845,7 +846,7 @@ var __esbuild_esm_mermaid = (() => {
}
var regex, randomPrefix, counter;
var init_id = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/id.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/id.mjs"() {
"use strict";
regex = /\sid="(\S+)"/g;
randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
@@ -854,7 +855,7 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/html.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/html.mjs
function iconToHTML(body, attributes) {
let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
for (const attr in attributes) {
@@ -863,15 +864,15 @@ var __esbuild_esm_mermaid = (() => {
return '" + body + " ";
}
var init_html = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/html.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/svg/html.mjs"() {
"use strict";
__name(iconToHTML, "iconToHTML");
}
});
- // ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
+ // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
var require_ms = __commonJS({
- "../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) {
+ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
"use strict";
var s2 = 1e3;
var m2 = s2 * 60;
@@ -883,7 +884,7 @@ var __esbuild_esm_mermaid = (() => {
options3 = options3 || {};
var type3 = typeof val;
if (type3 === "string" && val.length > 0) {
- return parse8(val);
+ return parse7(val);
} else if (type3 === "number" && isFinite(val)) {
return options3.long ? fmtLong(val) : fmtShort(val);
}
@@ -891,7 +892,7 @@ var __esbuild_esm_mermaid = (() => {
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
);
};
- function parse8(str2) {
+ function parse7(str2) {
str2 = String(str2);
if (str2.length > 100) {
return;
@@ -947,7 +948,7 @@ var __esbuild_esm_mermaid = (() => {
return void 0;
}
}
- __name(parse8, "parse");
+ __name(parse7, "parse");
function fmtShort(ms3) {
var msAbs = Math.abs(ms3);
if (msAbs >= d2) {
@@ -990,9 +991,9 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/common.js
+ // ../../node_modules/.pnpm/debug@4.4.0_supports-color@8.1.1/node_modules/debug/src/common.js
var require_common = __commonJS({
- "../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/common.js"(exports2, module2) {
+ "../../node_modules/.pnpm/debug@4.4.0_supports-color@8.1.1/node_modules/debug/src/common.js"(exports2, module2) {
"use strict";
function setup(env) {
createDebug.debug = createDebug;
@@ -1093,59 +1094,73 @@ var __esbuild_esm_mermaid = (() => {
return newDebug;
}
__name(extend5, "extend");
- function enable(namespaces2) {
- createDebug.save(namespaces2);
- createDebug.namespaces = namespaces2;
+ function enable(namespaces) {
+ createDebug.save(namespaces);
+ createDebug.namespaces = namespaces;
createDebug.names = [];
createDebug.skips = [];
- let i2;
- const split = (typeof namespaces2 === "string" ? namespaces2 : "").split(/[\s,]+/);
- const len = split.length;
- for (i2 = 0; i2 < len; i2++) {
- if (!split[i2]) {
- continue;
- }
- namespaces2 = split[i2].replace(/\*/g, ".*?");
- if (namespaces2[0] === "-") {
- createDebug.skips.push(new RegExp("^" + namespaces2.slice(1) + "$"));
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
+ for (const ns of split) {
+ if (ns[0] === "-") {
+ createDebug.skips.push(ns.slice(1));
} else {
- createDebug.names.push(new RegExp("^" + namespaces2 + "$"));
+ createDebug.names.push(ns);
}
}
}
__name(enable, "enable");
+ function matchesTemplate(search, template) {
+ let searchIndex = 0;
+ let templateIndex = 0;
+ let starIndex = -1;
+ let matchIndex = 0;
+ while (searchIndex < search.length) {
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
+ if (template[templateIndex] === "*") {
+ starIndex = templateIndex;
+ matchIndex = searchIndex;
+ templateIndex++;
+ } else {
+ searchIndex++;
+ templateIndex++;
+ }
+ } else if (starIndex !== -1) {
+ templateIndex = starIndex + 1;
+ matchIndex++;
+ searchIndex = matchIndex;
+ } else {
+ return false;
+ }
+ }
+ while (templateIndex < template.length && template[templateIndex] === "*") {
+ templateIndex++;
+ }
+ return templateIndex === template.length;
+ }
+ __name(matchesTemplate, "matchesTemplate");
function disable() {
- const namespaces2 = [
- ...createDebug.names.map(toNamespace),
- ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
+ const namespaces = [
+ ...createDebug.names,
+ ...createDebug.skips.map((namespace) => "-" + namespace)
].join(",");
createDebug.enable("");
- return namespaces2;
+ return namespaces;
}
__name(disable, "disable");
function enabled(name) {
- if (name[name.length - 1] === "*") {
- return true;
- }
- let i2;
- let len;
- for (i2 = 0, len = createDebug.skips.length; i2 < len; i2++) {
- if (createDebug.skips[i2].test(name)) {
+ for (const skip of createDebug.skips) {
+ if (matchesTemplate(name, skip)) {
return false;
}
}
- for (i2 = 0, len = createDebug.names.length; i2 < len; i2++) {
- if (createDebug.names[i2].test(name)) {
+ for (const ns of createDebug.names) {
+ if (matchesTemplate(name, ns)) {
return true;
}
}
return false;
}
__name(enabled, "enabled");
- function toNamespace(regexp) {
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
- }
- __name(toNamespace, "toNamespace");
function coerce(val) {
if (val instanceof Error) {
return val.stack || val.message;
@@ -1165,9 +1180,9 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/browser.js
+ // ../../node_modules/.pnpm/debug@4.4.0_supports-color@8.1.1/node_modules/debug/src/browser.js
var require_browser = __commonJS({
- "../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports2, module2) {
+ "../../node_modules/.pnpm/debug@4.4.0_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports2, module2) {
"use strict";
exports2.formatArgs = formatArgs;
exports2.save = save;
@@ -1299,10 +1314,10 @@ var __esbuild_esm_mermaid = (() => {
__name(formatArgs, "formatArgs");
exports2.log = console.debug || console.log || (() => {
});
- function save(namespaces2) {
+ function save(namespaces) {
try {
- if (namespaces2) {
- exports2.storage.setItem("debug", namespaces2);
+ if (namespaces) {
+ exports2.storage.setItem("debug", namespaces);
} else {
exports2.storage.removeItem("debug");
}
@@ -1341,10 +1356,10 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/index.mjs
+ // ../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/index.mjs
var import_debug;
var init_lib = __esm({
- "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/index.mjs"() {
+ "../../node_modules/.pnpm/@iconify+utils@2.3.0/node_modules/@iconify/utils/lib/index.mjs"() {
"use strict";
init_name();
init_get_icon();
@@ -1388,30 +1403,30 @@ var __esbuild_esm_mermaid = (() => {
}
}, "registerIconPacks");
getRegisteredIconData = /* @__PURE__ */ __name(async (iconName, fallbackPrefix) => {
- const data5 = stringToIcon(iconName, true, fallbackPrefix !== void 0);
- if (!data5) {
+ const data6 = stringToIcon(iconName, true, fallbackPrefix !== void 0);
+ if (!data6) {
throw new Error(`Invalid icon name: ${iconName}`);
}
- const prefix = data5.prefix || fallbackPrefix;
+ const prefix = data6.prefix || fallbackPrefix;
if (!prefix) {
throw new Error(`Icon name must contain a prefix: ${iconName}`);
}
let icons = iconsStore.get(prefix);
if (!icons) {
- const loader26 = loaderStore.get(prefix);
- if (!loader26) {
- throw new Error(`Icon set not found: ${data5.prefix}`);
+ const loader28 = loaderStore.get(prefix);
+ if (!loader28) {
+ throw new Error(`Icon set not found: ${data6.prefix}`);
}
try {
- const loaded = await loader26();
+ const loaded = await loader28();
icons = { ...loaded, prefix };
iconsStore.set(prefix, icons);
} catch (e3) {
log.error(e3);
- throw new Error(`Failed to load icon set: ${data5.prefix}`);
+ throw new Error(`Failed to load icon set: ${data6.prefix}`);
}
}
- const iconData = getIconData(icons, data5.name);
+ const iconData = getIconData(icons, data6.name);
if (!iconData) {
throw new Error(`Icon not found: ${iconName}`);
}
@@ -1426,8 +1441,8 @@ var __esbuild_esm_mermaid = (() => {
iconData = unknownIcon;
}
const renderData = iconToSVG(iconData, customisations);
- const svg = iconToHTML(replaceIDs(renderData.body), renderData.attributes);
- return svg;
+ const svg2 = iconToHTML(replaceIDs(renderData.body), renderData.attributes);
+ return svg2;
}, "getIconSVG");
}
});
@@ -1515,29 +1530,29 @@ var __esbuild_esm_mermaid = (() => {
init_regexes();
init_errors();
detectors = {};
- detectType = /* @__PURE__ */ __name(function(text2, config6) {
- text2 = text2.replace(frontMatterRegex, "").replace(directiveRegex, "").replace(anyCommentRegex, "\n");
- for (const [key, { detector: detector25 }] of Object.entries(detectors)) {
- const diagram24 = detector25(text2, config6);
- if (diagram24) {
+ detectType = /* @__PURE__ */ __name(function(text4, config5) {
+ text4 = text4.replace(frontMatterRegex, "").replace(directiveRegex, "").replace(anyCommentRegex, "\n");
+ for (const [key, { detector: detector27 }] of Object.entries(detectors)) {
+ const diagram26 = detector27(text4, config5);
+ if (diagram26) {
return key;
}
}
throw new UnknownDiagramError(
- `No diagram type detected matching given configuration for text: ${text2}`
+ `No diagram type detected matching given configuration for text: ${text4}`
);
}, "detectType");
registerLazyLoadedDiagrams = /* @__PURE__ */ __name((...diagrams2) => {
- for (const { id: id27, detector: detector25, loader: loader26 } of diagrams2) {
- addDetector(id27, detector25, loader26);
+ for (const { id: id29, detector: detector27, loader: loader28 } of diagrams2) {
+ addDetector(id29, detector27, loader28);
}
}, "registerLazyLoadedDiagrams");
- addDetector = /* @__PURE__ */ __name((key, detector25, loader26) => {
+ addDetector = /* @__PURE__ */ __name((key, detector27, loader28) => {
if (detectors[key]) {
log.warn(`Detector with key ${key} already exists. Overwriting.`);
}
- detectors[key] = { detector: detector25, loader: loader26 };
- log.debug(`Detector with key ${key} added${loader26 ? " with loader" : ""}`);
+ detectors[key] = { detector: detector27, loader: loader28 };
+ log.debug(`Detector with key ${key} added${loader28 ? " with loader" : ""}`);
}, "addDetector");
getDiagramLoader = /* @__PURE__ */ __name((key) => {
return detectors[key].loader;
@@ -1555,7 +1570,7 @@ var __esbuild_esm_mermaid = (() => {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $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 parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -1792,7 +1807,7 @@ var __esbuild_esm_mermaid = (() => {
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -1822,7 +1837,7 @@ var __esbuild_esm_mermaid = (() => {
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -1834,22 +1849,22 @@ var __esbuild_esm_mermaid = (() => {
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -1868,7 +1883,7 @@ var __esbuild_esm_mermaid = (() => {
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -2168,7 +2183,7 @@ var __esbuild_esm_mermaid = (() => {
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -2532,13 +2547,13 @@ var __esbuild_esm_mermaid = (() => {
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser.parser = parser;
@@ -2552,9 +2567,9 @@ var __esbuild_esm_mermaid = (() => {
"src/assignWithDepth.ts"() {
"use strict";
assignWithDepth = /* @__PURE__ */ __name((dst, src, { depth = 2, clobber = false } = {}) => {
- const config6 = { depth, clobber };
+ const config5 = { depth, clobber };
if (Array.isArray(src) && !Array.isArray(dst)) {
- src.forEach((s2) => assignWithDepth(dst, s2, config6));
+ src.forEach((s2) => assignWithDepth(dst, s2, config5));
return dst;
} else if (Array.isArray(src) && Array.isArray(dst)) {
src.forEach((s2) => {
@@ -2806,89 +2821,89 @@ var __esbuild_esm_mermaid = (() => {
__name(this, "Channels");
}
/* CONSTRUCTOR */
- constructor(data5, color2) {
+ constructor(data6, color2) {
this.color = color2;
this.changed = false;
- this.data = data5;
+ this.data = data6;
this.type = new type_default();
}
/* API */
- set(data5, color2) {
+ set(data6, color2) {
this.color = color2;
this.changed = false;
- this.data = data5;
+ this.data = data6;
this.type.type = TYPE.ALL;
return this;
}
/* HELPERS */
_ensureHSL() {
- const data5 = this.data;
- const { h: h2, s: s2, l: l2 } = data5;
+ const data6 = this.data;
+ const { h: h2, s: s2, l: l2 } = data6;
if (h2 === void 0)
- data5.h = utils_default.channel.rgb2hsl(data5, "h");
+ data6.h = utils_default.channel.rgb2hsl(data6, "h");
if (s2 === void 0)
- data5.s = utils_default.channel.rgb2hsl(data5, "s");
+ data6.s = utils_default.channel.rgb2hsl(data6, "s");
if (l2 === void 0)
- data5.l = utils_default.channel.rgb2hsl(data5, "l");
+ data6.l = utils_default.channel.rgb2hsl(data6, "l");
}
_ensureRGB() {
- const data5 = this.data;
- const { r: r2, g: g2, b: b2 } = data5;
+ const data6 = this.data;
+ const { r: r2, g: g2, b: b2 } = data6;
if (r2 === void 0)
- data5.r = utils_default.channel.hsl2rgb(data5, "r");
+ data6.r = utils_default.channel.hsl2rgb(data6, "r");
if (g2 === void 0)
- data5.g = utils_default.channel.hsl2rgb(data5, "g");
+ data6.g = utils_default.channel.hsl2rgb(data6, "g");
if (b2 === void 0)
- data5.b = utils_default.channel.hsl2rgb(data5, "b");
+ data6.b = utils_default.channel.hsl2rgb(data6, "b");
}
/* GETTERS */
get r() {
- const data5 = this.data;
- const r2 = data5.r;
+ const data6 = this.data;
+ const r2 = data6.r;
if (!this.type.is(TYPE.HSL) && r2 !== void 0)
return r2;
this._ensureHSL();
- return utils_default.channel.hsl2rgb(data5, "r");
+ return utils_default.channel.hsl2rgb(data6, "r");
}
get g() {
- const data5 = this.data;
- const g2 = data5.g;
+ const data6 = this.data;
+ const g2 = data6.g;
if (!this.type.is(TYPE.HSL) && g2 !== void 0)
return g2;
this._ensureHSL();
- return utils_default.channel.hsl2rgb(data5, "g");
+ return utils_default.channel.hsl2rgb(data6, "g");
}
get b() {
- const data5 = this.data;
- const b2 = data5.b;
+ const data6 = this.data;
+ const b2 = data6.b;
if (!this.type.is(TYPE.HSL) && b2 !== void 0)
return b2;
this._ensureHSL();
- return utils_default.channel.hsl2rgb(data5, "b");
+ return utils_default.channel.hsl2rgb(data6, "b");
}
get h() {
- const data5 = this.data;
- const h2 = data5.h;
+ const data6 = this.data;
+ const h2 = data6.h;
if (!this.type.is(TYPE.RGB) && h2 !== void 0)
return h2;
this._ensureRGB();
- return utils_default.channel.rgb2hsl(data5, "h");
+ return utils_default.channel.rgb2hsl(data6, "h");
}
get s() {
- const data5 = this.data;
- const s2 = data5.s;
+ const data6 = this.data;
+ const s2 = data6.s;
if (!this.type.is(TYPE.RGB) && s2 !== void 0)
return s2;
this._ensureRGB();
- return utils_default.channel.rgb2hsl(data5, "s");
+ return utils_default.channel.rgb2hsl(data6, "s");
}
get l() {
- const data5 = this.data;
- const l2 = data5.l;
+ const data6 = this.data;
+ const l2 = data6.l;
if (!this.type.is(TYPE.RGB) && l2 !== void 0)
return l2;
this._ensureRGB();
- return utils_default.channel.rgb2hsl(data5, "l");
+ return utils_default.channel.rgb2hsl(data6, "l");
}
get a() {
return this.data.a;
@@ -3640,6 +3655,13 @@ var __esbuild_esm_mermaid = (() => {
this.taskTextClickableColor = this.taskTextClickableColor || "#003163";
this.personBorder = this.personBorder || this.primaryBorderColor;
this.personBkg = this.personBkg || this.mainBkg;
+ if (this.darkMode) {
+ this.rowOdd = this.rowOdd || darken_default(this.mainBkg, 5) || "#ffffff";
+ this.rowEven = this.rowEven || darken_default(this.mainBkg, 10);
+ } else {
+ this.rowOdd = this.rowOdd || lighten_default(this.mainBkg, 75) || "#ffffff";
+ this.rowEven = this.rowEven || lighten_default(this.mainBkg, 5);
+ }
this.transitionColor = this.transitionColor || this.lineColor;
this.transitionLabelColor = this.transitionLabelColor || this.textColor;
this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
@@ -3726,6 +3748,18 @@ var __esbuild_esm_mermaid = (() => {
this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
this.pieOpacity = this.pieOpacity || "0.7";
+ this.radar = {
+ axisColor: this.radar?.axisColor || this.lineColor,
+ axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
+ axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
+ curveOpacity: this.radar?.curveOpacity || 0.5,
+ curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
+ graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
+ graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
+ graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
+ legendBoxSize: this.radar?.legendBoxSize || 12,
+ legendFontSize: this.radar?.legendFontSize || 12
+ };
this.archEdgeColor = this.archEdgeColor || "#777";
this.archEdgeArrowColor = this.archEdgeArrowColor || "#777";
this.archEdgeWidth = this.archEdgeWidth || "3";
@@ -3929,6 +3963,8 @@ var __esbuild_esm_mermaid = (() => {
this.archEdgeWidth = "3";
this.archGroupBorderColor = this.primaryBorderColor;
this.archGroupBorderWidth = "2px";
+ this.rowOdd = this.rowOdd || lighten_default(this.mainBkg, 5) || "#ffffff";
+ this.rowEven = this.rowEven || darken_default(this.mainBkg, 10);
this.labelColor = "calculated";
this.errorBkgColor = "#a44141";
this.errorTextColor = "#ddd";
@@ -4077,6 +4113,18 @@ var __esbuild_esm_mermaid = (() => {
blockStrokeColor: this.primaryTextColor,
blockFillColor: this.background
};
+ this.radar = {
+ axisColor: this.radar?.axisColor || this.lineColor,
+ axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
+ axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
+ curveOpacity: this.radar?.curveOpacity || 0.5,
+ curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
+ graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
+ graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
+ graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
+ legendBoxSize: this.radar?.legendBoxSize || 12,
+ legendFontSize: this.radar?.legendFontSize || 12
+ };
this.classText = this.primaryTextColor;
this.requirementBackground = this.requirementBackground || this.primaryColor;
this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
@@ -4248,6 +4296,8 @@ var __esbuild_esm_mermaid = (() => {
this.archEdgeWidth = "3";
this.archGroupBorderColor = this.primaryBorderColor;
this.archGroupBorderWidth = "2px";
+ this.rowOdd = "calculated";
+ this.rowEven = "calculated";
this.labelColor = "black";
this.errorBkgColor = "#552222";
this.errorTextColor = "#552222";
@@ -4309,6 +4359,8 @@ var __esbuild_esm_mermaid = (() => {
this.taskTextOutsideColor = this.taskTextDarkColor;
this.archEdgeColor = this.lineColor;
this.archEdgeArrowColor = this.lineColor;
+ this.rowOdd = this.rowOdd || lighten_default(this.primaryColor, 75) || "#ffffff";
+ this.rowEven = this.rowEven || lighten_default(this.primaryColor, 1);
this.transitionColor = this.transitionColor || this.lineColor;
this.transitionLabelColor = this.transitionLabelColor || this.textColor;
this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
@@ -4370,6 +4422,18 @@ var __esbuild_esm_mermaid = (() => {
this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
+ this.radar = {
+ axisColor: this.radar?.axisColor || this.lineColor,
+ axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
+ axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
+ curveOpacity: this.radar?.curveOpacity || 0.5,
+ curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
+ graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
+ graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
+ graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
+ legendBoxSize: this.radar?.legendBoxSize || 12,
+ legendFontSize: this.radar?.legendFontSize || 12
+ };
this.xyChart = {
backgroundColor: this.xyChart?.backgroundColor || this.background,
titleColor: this.xyChart?.titleColor || this.primaryTextColor,
@@ -4444,6 +4508,11 @@ var __esbuild_esm_mermaid = (() => {
this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
}
calculate(overrides) {
+ Object.keys(this).forEach((k2) => {
+ if (this[k2] === "calculated") {
+ this[k2] = void 0;
+ }
+ });
if (typeof overrides !== "object") {
this.updateColors();
return;
@@ -4604,6 +4673,8 @@ var __esbuild_esm_mermaid = (() => {
this.activeTaskBkgColor = this.mainBkg;
this.archEdgeColor = this.lineColor;
this.archEdgeArrowColor = this.lineColor;
+ this.rowOdd = this.rowOdd || lighten_default(this.mainBkg, 75) || "#ffffff";
+ this.rowEven = this.rowEven || lighten_default(this.mainBkg, 20);
this.transitionColor = this.transitionColor || this.lineColor;
this.transitionLabelColor = this.transitionLabelColor || this.textColor;
this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
@@ -4673,6 +4744,18 @@ var __esbuild_esm_mermaid = (() => {
blockStrokeColor: this.primaryTextColor,
blockFillColor: this.mainBkg
};
+ this.radar = {
+ axisColor: this.radar?.axisColor || this.lineColor,
+ axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
+ axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
+ curveOpacity: this.radar?.curveOpacity || 0.5,
+ curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
+ graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
+ graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
+ graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
+ legendBoxSize: this.radar?.legendBoxSize || 12,
+ legendFontSize: this.radar?.legendFontSize || 12
+ };
this.xyChart = {
backgroundColor: this.xyChart?.backgroundColor || this.background,
titleColor: this.xyChart?.titleColor || this.primaryTextColor,
@@ -4857,6 +4940,8 @@ var __esbuild_esm_mermaid = (() => {
this.archEdgeWidth = "3";
this.archGroupBorderColor = this.primaryBorderColor;
this.archGroupBorderWidth = "2px";
+ this.rowOdd = this.rowOdd || lighten_default(this.mainBkg, 75) || "#ffffff";
+ this.rowEven = this.rowEven || "#f4f4f4";
this.labelColor = "black";
this.errorBkgColor = "#552222";
this.errorTextColor = "#552222";
@@ -4997,6 +5082,18 @@ var __esbuild_esm_mermaid = (() => {
yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
plotColorPalette: this.xyChart?.plotColorPalette || "#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"
};
+ this.radar = {
+ axisColor: this.radar?.axisColor || this.lineColor,
+ axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
+ axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
+ curveOpacity: this.radar?.curveOpacity || 0.5,
+ curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
+ graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
+ graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
+ graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
+ legendBoxSize: this.radar?.legendBoxSize || 12,
+ legendFontSize: this.radar?.legendFontSize || 12
+ };
this.requirementBackground = this.requirementBackground || this.primaryColor;
this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
this.requirementBorderSize = this.requirementBorderSize || "1";
@@ -5213,7 +5310,8 @@ var __esbuild_esm_mermaid = (() => {
"padding": 5,
"textHeight": 10,
"defaultRenderer": "dagre-wrapper",
- "htmlLabels": false
+ "htmlLabels": false,
+ "hideEmptyMembersBox": false
},
"state": {
"useMaxWidth": true,
@@ -5243,6 +5341,8 @@ var __esbuild_esm_mermaid = (() => {
"minEntityWidth": 100,
"minEntityHeight": 75,
"entityPadding": 15,
+ "nodeSpacing": 140,
+ "rankSpacing": 80,
"stroke": "gray",
"fill": "honeydew",
"fontSize": 12
@@ -5327,6 +5427,12 @@ var __esbuild_esm_mermaid = (() => {
"padding": 10,
"maxNodeWidth": 200
},
+ "kanban": {
+ "useMaxWidth": true,
+ "padding": 8,
+ "sectionWidth": 200,
+ "ticketBaseUrl": ""
+ },
"timeline": {
"useMaxWidth": true,
"diagramMarginX": 50,
@@ -5536,6 +5642,18 @@ var __esbuild_esm_mermaid = (() => {
"iconSize": 80,
"fontSize": 16
},
+ "radar": {
+ "useMaxWidth": true,
+ "width": 600,
+ "height": 600,
+ "marginTop": 50,
+ "marginRight": 50,
+ "marginBottom": 50,
+ "marginLeft": 50,
+ "axisScaleFactor": 1,
+ "axisLabelFactor": 1.05,
+ "curveTension": 0.17
+ },
"theme": "default",
"look": "classic",
"handDrawnSeed": 0,
@@ -5579,8 +5697,9 @@ var __esbuild_esm_mermaid = (() => {
// TODO: Should we replace these with `null` so that they can go in the JSON Schema?
deterministicIDSeed: void 0,
elk: {
+ // mergeEdges is needed here to be considered
mergeEdges: false,
- nodePlacementStrategy: "SIMPLE"
+ nodePlacementStrategy: "BRANDES_KOEPF"
},
themeCSS: void 0,
// add non-JSON default config values
@@ -5609,6 +5728,9 @@ var __esbuild_esm_mermaid = (() => {
};
}, "actorFont")
},
+ class: {
+ hideEmptyMembersBox: false
+ },
gantt: {
...config_schema_default.gantt,
tickInterval: void 0,
@@ -5787,6 +5909,9 @@ var __esbuild_esm_mermaid = (() => {
},
packet: {
...config_schema_default.packet
+ },
+ radar: {
+ ...config_schema_default.radar
}
};
keyify = /* @__PURE__ */ __name((obj, prefix = "") => Object.keys(obj).reduce((res, el) => {
@@ -5905,29 +6030,29 @@ var __esbuild_esm_mermaid = (() => {
checkConfig(currentConfig);
return currentConfig;
}, "updateCurrentConfig");
- setSiteConfig = /* @__PURE__ */ __name((conf8) => {
+ setSiteConfig = /* @__PURE__ */ __name((conf5) => {
siteConfig = assignWithDepth_default({}, defaultConfig);
- siteConfig = assignWithDepth_default(siteConfig, conf8);
- if (conf8.theme && themes_default[conf8.theme]) {
- siteConfig.themeVariables = themes_default[conf8.theme].getThemeVariables(conf8.themeVariables);
+ siteConfig = assignWithDepth_default(siteConfig, conf5);
+ if (conf5.theme && themes_default[conf5.theme]) {
+ siteConfig.themeVariables = themes_default[conf5.theme].getThemeVariables(conf5.themeVariables);
}
updateCurrentConfig(siteConfig, directives);
return siteConfig;
}, "setSiteConfig");
- saveConfigFromInitialize = /* @__PURE__ */ __name((conf8) => {
- configFromInitialize = assignWithDepth_default({}, conf8);
+ saveConfigFromInitialize = /* @__PURE__ */ __name((conf5) => {
+ configFromInitialize = assignWithDepth_default({}, conf5);
}, "saveConfigFromInitialize");
- updateSiteConfig = /* @__PURE__ */ __name((conf8) => {
- siteConfig = assignWithDepth_default(siteConfig, conf8);
+ updateSiteConfig = /* @__PURE__ */ __name((conf5) => {
+ siteConfig = assignWithDepth_default(siteConfig, conf5);
updateCurrentConfig(siteConfig, directives);
return siteConfig;
}, "updateSiteConfig");
getSiteConfig = /* @__PURE__ */ __name(() => {
return assignWithDepth_default({}, siteConfig);
}, "getSiteConfig");
- setConfig = /* @__PURE__ */ __name((conf8) => {
- checkConfig(conf8);
- assignWithDepth_default(currentConfig, conf8);
+ setConfig = /* @__PURE__ */ __name((conf5) => {
+ checkConfig(conf5);
+ assignWithDepth_default(currentConfig, conf5);
return getConfig();
}, "setConfig");
getConfig = /* @__PURE__ */ __name(() => {
@@ -5968,9 +6093,9 @@ var __esbuild_esm_mermaid = (() => {
directives.push(directive);
updateCurrentConfig(siteConfig, directives);
}, "addDirective");
- reset = /* @__PURE__ */ __name((config6 = siteConfig) => {
+ reset = /* @__PURE__ */ __name((config5 = siteConfig) => {
directives = [];
- updateCurrentConfig(config6, directives);
+ updateCurrentConfig(config5, directives);
}, "reset");
ConfigWarning = {
LAZY_LOAD_DEPRECATED: "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."
@@ -5983,1009 +6108,1001 @@ var __esbuild_esm_mermaid = (() => {
log.warn(ConfigWarning[warning]);
issuedWarnings[warning] = true;
}, "issueWarning");
- checkConfig = /* @__PURE__ */ __name((config6) => {
- if (!config6) {
+ checkConfig = /* @__PURE__ */ __name((config5) => {
+ if (!config5) {
return;
}
- if (config6.lazyLoadedDiagrams || config6.loadExternalDiagramsAtStartup) {
+ if (config5.lazyLoadedDiagrams || config5.loadExternalDiagramsAtStartup) {
issueWarning("LAZY_LOAD_DEPRECATED");
}
}, "checkConfig");
}
});
- // ../../node_modules/.pnpm/dompurify@3.1.6/node_modules/dompurify/dist/purify.js
- var require_purify = __commonJS({
- "../../node_modules/.pnpm/dompurify@3.1.6/node_modules/dompurify/dist/purify.js"(exports2, module2) {
- "use strict";
- (function(global2, factory) {
- typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.DOMPurify = factory());
- })(exports2, function() {
- "use strict";
- const {
- entries,
- setPrototypeOf,
- isFrozen,
- getPrototypeOf,
- getOwnPropertyDescriptor
- } = Object;
- let {
- freeze,
- seal,
- create: create2
- } = Object;
- let {
- apply: apply4,
- construct
- } = typeof Reflect !== "undefined" && Reflect;
- if (!freeze) {
- freeze = /* @__PURE__ */ __name(function freeze2(x5) {
- return x5;
- }, "freeze");
- }
- if (!seal) {
- seal = /* @__PURE__ */ __name(function seal2(x5) {
- return x5;
- }, "seal");
- }
- if (!apply4) {
- apply4 = /* @__PURE__ */ __name(function apply5(fun, thisValue, args) {
- return fun.apply(thisValue, args);
- }, "apply");
- }
- if (!construct) {
- construct = /* @__PURE__ */ __name(function construct2(Func, args) {
- return new Func(...args);
- }, "construct");
- }
- const arrayForEach = unapply(Array.prototype.forEach);
- const arrayPop = unapply(Array.prototype.pop);
- const arrayPush2 = unapply(Array.prototype.push);
- const stringToLowerCase = unapply(String.prototype.toLowerCase);
- const stringToString = unapply(String.prototype.toString);
- const stringMatch = unapply(String.prototype.match);
- const stringReplace = unapply(String.prototype.replace);
- const stringIndexOf = unapply(String.prototype.indexOf);
- const stringTrim = unapply(String.prototype.trim);
- const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
- const regExpTest = unapply(RegExp.prototype.test);
- const typeErrorCreate = unconstruct(TypeError);
- function unapply(func) {
- return function(thisArg) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- return apply4(func, thisArg, args);
- };
+ // ../../node_modules/.pnpm/dompurify@3.2.4/node_modules/dompurify/dist/purify.es.mjs
+ function unapply(func) {
+ return function(thisArg) {
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+ return apply(func, thisArg, args);
+ };
+ }
+ function unconstruct(func) {
+ return function() {
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ args[_key2] = arguments[_key2];
+ }
+ return construct(func, args);
+ };
+ }
+ function addToSet(set6, array4) {
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
+ if (setPrototypeOf) {
+ setPrototypeOf(set6, null);
+ }
+ let l2 = array4.length;
+ while (l2--) {
+ let element3 = array4[l2];
+ if (typeof element3 === "string") {
+ const lcElement = transformCaseFunc(element3);
+ if (lcElement !== element3) {
+ if (!isFrozen(array4)) {
+ array4[l2] = lcElement;
+ }
+ element3 = lcElement;
}
- __name(unapply, "unapply");
- function unconstruct(func) {
- return function() {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- return construct(func, args);
- };
+ }
+ set6[element3] = true;
+ }
+ return set6;
+ }
+ function cleanArray(array4) {
+ for (let index = 0; index < array4.length; index++) {
+ const isPropertyExist = objectHasOwnProperty(array4, index);
+ if (!isPropertyExist) {
+ array4[index] = null;
+ }
+ }
+ return array4;
+ }
+ function clone(object3) {
+ const newObject = create(null);
+ for (const [property2, value2] of entries(object3)) {
+ const isPropertyExist = objectHasOwnProperty(object3, property2);
+ if (isPropertyExist) {
+ if (Array.isArray(value2)) {
+ newObject[property2] = cleanArray(value2);
+ } else if (value2 && typeof value2 === "object" && value2.constructor === Object) {
+ newObject[property2] = clone(value2);
+ } else {
+ newObject[property2] = value2;
+ }
+ }
+ }
+ return newObject;
+ }
+ function lookupGetter(object3, prop) {
+ while (object3 !== null) {
+ const desc = getOwnPropertyDescriptor(object3, prop);
+ if (desc) {
+ if (desc.get) {
+ return unapply(desc.get);
+ }
+ if (typeof desc.value === "function") {
+ return unapply(desc.value);
+ }
+ }
+ object3 = getPrototypeOf(object3);
+ }
+ function fallbackValue() {
+ return null;
+ }
+ __name(fallbackValue, "fallbackValue");
+ return fallbackValue;
+ }
+ function createDOMPurify() {
+ let window3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
+ const DOMPurify = /* @__PURE__ */ __name((root4) => createDOMPurify(root4), "DOMPurify");
+ DOMPurify.version = "3.2.4";
+ DOMPurify.removed = [];
+ if (!window3 || !window3.document || window3.document.nodeType !== NODE_TYPE.document || !window3.Element) {
+ DOMPurify.isSupported = false;
+ return DOMPurify;
+ }
+ let {
+ document: document2
+ } = window3;
+ const originalDocument = document2;
+ const currentScript = originalDocument.currentScript;
+ const {
+ DocumentFragment: DocumentFragment2,
+ HTMLTemplateElement,
+ Node,
+ Element: Element4,
+ NodeFilter,
+ NamedNodeMap = window3.NamedNodeMap || window3.MozNamedAttrMap,
+ HTMLFormElement,
+ DOMParser,
+ trustedTypes
+ } = window3;
+ const ElementPrototype = Element4.prototype;
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
+ const remove3 = lookupGetter(ElementPrototype, "remove");
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
+ if (typeof HTMLTemplateElement === "function") {
+ const template = document2.createElement("template");
+ if (template.content && template.content.ownerDocument) {
+ document2 = template.content.ownerDocument;
+ }
+ }
+ let trustedTypesPolicy;
+ let emptyHTML = "";
+ const {
+ implementation,
+ createNodeIterator,
+ createDocumentFragment,
+ getElementsByTagName
+ } = document2;
+ const {
+ importNode
+ } = originalDocument;
+ let hooks = _createHooksMap();
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
+ const {
+ MUSTACHE_EXPR: MUSTACHE_EXPR2,
+ ERB_EXPR: ERB_EXPR2,
+ TMPLIT_EXPR: TMPLIT_EXPR2,
+ DATA_ATTR: DATA_ATTR2,
+ ARIA_ATTR: ARIA_ATTR2,
+ IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2,
+ ATTR_WHITESPACE: ATTR_WHITESPACE2,
+ CUSTOM_ELEMENT: CUSTOM_ELEMENT2
+ } = EXPRESSIONS;
+ let {
+ IS_ALLOWED_URI: IS_ALLOWED_URI$1
+ } = EXPRESSIONS;
+ let ALLOWED_TAGS = null;
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
+ let ALLOWED_ATTR = null;
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
+ tagNameCheck: {
+ writable: true,
+ configurable: false,
+ enumerable: true,
+ value: null
+ },
+ attributeNameCheck: {
+ writable: true,
+ configurable: false,
+ enumerable: true,
+ value: null
+ },
+ allowCustomizedBuiltInElements: {
+ writable: true,
+ configurable: false,
+ enumerable: true,
+ value: false
+ }
+ }));
+ let FORBID_TAGS = null;
+ let FORBID_ATTR = null;
+ let ALLOW_ARIA_ATTR = true;
+ let ALLOW_DATA_ATTR = true;
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
+ let SAFE_FOR_TEMPLATES = false;
+ let SAFE_FOR_XML = true;
+ let WHOLE_DOCUMENT = false;
+ let SET_CONFIG = false;
+ let FORCE_BODY = false;
+ let RETURN_DOM = false;
+ let RETURN_DOM_FRAGMENT = false;
+ let RETURN_TRUSTED_TYPE = false;
+ let SANITIZE_DOM = true;
+ let SANITIZE_NAMED_PROPS = false;
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
+ let KEEP_CONTENT = true;
+ let IN_PLACE = false;
+ let USE_PROFILES = {};
+ let FORBID_CONTENTS = null;
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
+ let DATA_URI_TAGS = null;
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
+ let URI_SAFE_ATTRIBUTES = null;
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
+ let NAMESPACE2 = HTML_NAMESPACE;
+ let IS_EMPTY_INPUT = false;
+ let ALLOWED_NAMESPACES = null;
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
+ let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
+ let PARSER_MEDIA_TYPE = null;
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
+ let transformCaseFunc = null;
+ let CONFIG = null;
+ const formElement = document2.createElement("form");
+ const isRegexOrFunction = /* @__PURE__ */ __name(function isRegexOrFunction2(testValue) {
+ return testValue instanceof RegExp || testValue instanceof Function;
+ }, "isRegexOrFunction");
+ const _parseConfig = /* @__PURE__ */ __name(function _parseConfig2() {
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
+ if (CONFIG && CONFIG === cfg) {
+ return;
+ }
+ if (!cfg || typeof cfg !== "object") {
+ cfg = {};
+ }
+ cfg = clone(cfg);
+ PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
+ ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
+ ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
+ ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
+ URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
+ DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
+ FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
+ FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
+ FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
+ RETURN_DOM = cfg.RETURN_DOM || false;
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
+ FORCE_BODY = cfg.FORCE_BODY || false;
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
+ IN_PLACE = cfg.IN_PLACE || false;
+ IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
+ NAMESPACE2 = cfg.NAMESPACE || HTML_NAMESPACE;
+ MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
+ HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
+ CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
+ }
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
+ }
+ if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
+ }
+ if (SAFE_FOR_TEMPLATES) {
+ ALLOW_DATA_ATTR = false;
+ }
+ if (RETURN_DOM_FRAGMENT) {
+ RETURN_DOM = true;
+ }
+ if (USE_PROFILES) {
+ ALLOWED_TAGS = addToSet({}, text);
+ ALLOWED_ATTR = [];
+ if (USE_PROFILES.html === true) {
+ addToSet(ALLOWED_TAGS, html$1);
+ addToSet(ALLOWED_ATTR, html);
+ }
+ if (USE_PROFILES.svg === true) {
+ addToSet(ALLOWED_TAGS, svg$1);
+ addToSet(ALLOWED_ATTR, svg);
+ addToSet(ALLOWED_ATTR, xml);
+ }
+ if (USE_PROFILES.svgFilters === true) {
+ addToSet(ALLOWED_TAGS, svgFilters);
+ addToSet(ALLOWED_ATTR, svg);
+ addToSet(ALLOWED_ATTR, xml);
+ }
+ if (USE_PROFILES.mathMl === true) {
+ addToSet(ALLOWED_TAGS, mathMl$1);
+ addToSet(ALLOWED_ATTR, mathMl);
+ addToSet(ALLOWED_ATTR, xml);
+ }
+ }
+ if (cfg.ADD_TAGS) {
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
+ }
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
+ }
+ if (cfg.ADD_ATTR) {
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
+ }
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
+ }
+ if (cfg.ADD_URI_SAFE_ATTR) {
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
+ }
+ if (cfg.FORBID_CONTENTS) {
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
+ }
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
+ }
+ if (KEEP_CONTENT) {
+ ALLOWED_TAGS["#text"] = true;
+ }
+ if (WHOLE_DOCUMENT) {
+ addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
+ }
+ if (ALLOWED_TAGS.table) {
+ addToSet(ALLOWED_TAGS, ["tbody"]);
+ delete FORBID_TAGS.tbody;
+ }
+ if (cfg.TRUSTED_TYPES_POLICY) {
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
+ }
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
+ }
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
+ emptyHTML = trustedTypesPolicy.createHTML("");
+ } else {
+ if (trustedTypesPolicy === void 0) {
+ trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
+ }
+ if (trustedTypesPolicy !== null && typeof emptyHTML === "string") {
+ emptyHTML = trustedTypesPolicy.createHTML("");
+ }
+ }
+ if (freeze) {
+ freeze(cfg);
+ }
+ CONFIG = cfg;
+ }, "_parseConfig");
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
+ const _checkValidNamespace = /* @__PURE__ */ __name(function _checkValidNamespace2(element3) {
+ let parent4 = getParentNode(element3);
+ if (!parent4 || !parent4.tagName) {
+ parent4 = {
+ namespaceURI: NAMESPACE2,
+ tagName: "template"
+ };
+ }
+ const tagName = stringToLowerCase(element3.tagName);
+ const parentTagName = stringToLowerCase(parent4.tagName);
+ if (!ALLOWED_NAMESPACES[element3.namespaceURI]) {
+ return false;
+ }
+ if (element3.namespaceURI === SVG_NAMESPACE) {
+ if (parent4.namespaceURI === HTML_NAMESPACE) {
+ return tagName === "svg";
+ }
+ if (parent4.namespaceURI === MATHML_NAMESPACE) {
+ return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
+ }
+ return Boolean(ALL_SVG_TAGS[tagName]);
+ }
+ if (element3.namespaceURI === MATHML_NAMESPACE) {
+ if (parent4.namespaceURI === HTML_NAMESPACE) {
+ return tagName === "math";
+ }
+ if (parent4.namespaceURI === SVG_NAMESPACE) {
+ return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
+ }
+ return Boolean(ALL_MATHML_TAGS[tagName]);
+ }
+ if (element3.namespaceURI === HTML_NAMESPACE) {
+ if (parent4.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
+ return false;
}
- __name(unconstruct, "unconstruct");
- function addToSet(set6, array4) {
- let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
- if (setPrototypeOf) {
- setPrototypeOf(set6, null);
+ if (parent4.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
+ return false;
+ }
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
+ }
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element3.namespaceURI]) {
+ return true;
+ }
+ return false;
+ }, "_checkValidNamespace");
+ const _forceRemove = /* @__PURE__ */ __name(function _forceRemove2(node2) {
+ arrayPush(DOMPurify.removed, {
+ element: node2
+ });
+ try {
+ getParentNode(node2).removeChild(node2);
+ } catch (_2) {
+ remove3(node2);
+ }
+ }, "_forceRemove");
+ const _removeAttribute = /* @__PURE__ */ __name(function _removeAttribute2(name, element3) {
+ try {
+ arrayPush(DOMPurify.removed, {
+ attribute: element3.getAttributeNode(name),
+ from: element3
+ });
+ } catch (_2) {
+ arrayPush(DOMPurify.removed, {
+ attribute: null,
+ from: element3
+ });
+ }
+ element3.removeAttribute(name);
+ if (name === "is") {
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
+ try {
+ _forceRemove(element3);
+ } catch (_2) {
}
- let l2 = array4.length;
- while (l2--) {
- let element3 = array4[l2];
- if (typeof element3 === "string") {
- const lcElement = transformCaseFunc(element3);
- if (lcElement !== element3) {
- if (!isFrozen(array4)) {
- array4[l2] = lcElement;
- }
- element3 = lcElement;
- }
- }
- set6[element3] = true;
+ } else {
+ try {
+ element3.setAttribute(name, "");
+ } catch (_2) {
}
- return set6;
}
- __name(addToSet, "addToSet");
- function cleanArray(array4) {
- for (let index = 0; index < array4.length; index++) {
- const isPropertyExist = objectHasOwnProperty(array4, index);
- if (!isPropertyExist) {
- array4[index] = null;
- }
+ }
+ }, "_removeAttribute");
+ const _initDocument = /* @__PURE__ */ __name(function _initDocument2(dirty) {
+ let doc = null;
+ let leadingWhitespace = null;
+ if (FORCE_BODY) {
+ dirty = " " + dirty;
+ } else {
+ const matches33 = stringMatch(dirty, /^[\r\n\t ]+/);
+ leadingWhitespace = matches33 && matches33[0];
+ }
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE2 === HTML_NAMESPACE) {
+ dirty = '
' + dirty + "";
+ }
+ const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
+ if (NAMESPACE2 === HTML_NAMESPACE) {
+ try {
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
+ } catch (_2) {
+ }
+ }
+ if (!doc || !doc.documentElement) {
+ doc = implementation.createDocument(NAMESPACE2, "template", null);
+ try {
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
+ } catch (_2) {
+ }
+ }
+ const body = doc.body || doc.documentElement;
+ if (dirty && leadingWhitespace) {
+ body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
+ }
+ if (NAMESPACE2 === HTML_NAMESPACE) {
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
+ }
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
+ }, "_initDocument");
+ const _createNodeIterator = /* @__PURE__ */ __name(function _createNodeIterator2(root4) {
+ return createNodeIterator.call(
+ root4.ownerDocument || root4,
+ root4,
+ // eslint-disable-next-line no-bitwise
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
+ null
+ );
+ }, "_createNodeIterator");
+ const _isClobbered = /* @__PURE__ */ __name(function _isClobbered2(element3) {
+ return element3 instanceof HTMLFormElement && (typeof element3.nodeName !== "string" || typeof element3.textContent !== "string" || typeof element3.removeChild !== "function" || !(element3.attributes instanceof NamedNodeMap) || typeof element3.removeAttribute !== "function" || typeof element3.setAttribute !== "function" || typeof element3.namespaceURI !== "string" || typeof element3.insertBefore !== "function" || typeof element3.hasChildNodes !== "function");
+ }, "_isClobbered");
+ const _isNode = /* @__PURE__ */ __name(function _isNode2(value2) {
+ return typeof Node === "function" && value2 instanceof Node;
+ }, "_isNode");
+ function _executeHooks(hooks2, currentNode, data6) {
+ arrayForEach(hooks2, (hook2) => {
+ hook2.call(DOMPurify, currentNode, data6, CONFIG);
+ });
+ }
+ __name(_executeHooks, "_executeHooks");
+ const _sanitizeElements = /* @__PURE__ */ __name(function _sanitizeElements2(currentNode) {
+ let content = null;
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
+ if (_isClobbered(currentNode)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ const tagName = transformCaseFunc(currentNode.nodeName);
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
+ tagName,
+ allowedTags: ALLOWED_TAGS
+ });
+ if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
+ return false;
+ }
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
+ return false;
}
- return array4;
}
- __name(cleanArray, "cleanArray");
- function clone5(object3) {
- const newObject = create2(null);
- for (const [property2, value2] of entries(object3)) {
- const isPropertyExist = objectHasOwnProperty(object3, property2);
- if (isPropertyExist) {
- if (Array.isArray(value2)) {
- newObject[property2] = cleanArray(value2);
- } else if (value2 && typeof value2 === "object" && value2.constructor === Object) {
- newObject[property2] = clone5(value2);
- } else {
- newObject[property2] = value2;
- }
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
+ const parentNode = getParentNode(currentNode) || currentNode.parentNode;
+ const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
+ if (childNodes && parentNode) {
+ const childCount = childNodes.length;
+ for (let i2 = childCount - 1; i2 >= 0; --i2) {
+ const childClone = cloneNode(childNodes[i2], true);
+ childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
}
}
- return newObject;
}
- __name(clone5, "clone");
- function lookupGetter(object3, prop) {
- while (object3 !== null) {
- const desc = getOwnPropertyDescriptor(object3, prop);
- if (desc) {
- if (desc.get) {
- return unapply(desc.get);
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (currentNode instanceof Element4 && !_checkValidNamespace(currentNode)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
+ content = currentNode.textContent;
+ arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
+ content = stringReplace(content, expr, " ");
+ });
+ if (currentNode.textContent !== content) {
+ arrayPush(DOMPurify.removed, {
+ element: currentNode.cloneNode()
+ });
+ currentNode.textContent = content;
+ }
+ }
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
+ return false;
+ }, "_sanitizeElements");
+ const _isValidAttribute = /* @__PURE__ */ __name(function _isValidAttribute2(lcTag, lcName, value2) {
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value2 in document2 || value2 in formElement)) {
+ return false;
+ }
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName)) ;
+ else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR2, lcName)) ;
+ else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
+ if (
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
+ _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || // Alternative, second condition checks if it's an `is`-attribute, AND
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
+ lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value2) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value2))
+ ) ;
+ else {
+ return false;
+ }
+ } else if (URI_SAFE_ATTRIBUTES[lcName]) ;
+ else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value2, ATTR_WHITESPACE2, ""))) ;
+ else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value2, "data:") === 0 && DATA_URI_TAGS[lcTag]) ;
+ else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value2, ATTR_WHITESPACE2, ""))) ;
+ else if (value2) {
+ return false;
+ } else ;
+ return true;
+ }, "_isValidAttribute");
+ const _isBasicCustomElement = /* @__PURE__ */ __name(function _isBasicCustomElement2(tagName) {
+ return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT2);
+ }, "_isBasicCustomElement");
+ const _sanitizeAttributes = /* @__PURE__ */ __name(function _sanitizeAttributes2(currentNode) {
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
+ const {
+ attributes
+ } = currentNode;
+ if (!attributes || _isClobbered(currentNode)) {
+ return;
+ }
+ const hookEvent = {
+ attrName: "",
+ attrValue: "",
+ keepAttr: true,
+ allowedAttributes: ALLOWED_ATTR,
+ forceKeepAttr: void 0
+ };
+ let l2 = attributes.length;
+ while (l2--) {
+ const attr = attributes[l2];
+ const {
+ name,
+ namespaceURI,
+ value: attrValue
+ } = attr;
+ const lcName = transformCaseFunc(name);
+ let value2 = name === "value" ? attrValue : stringTrim(attrValue);
+ hookEvent.attrName = lcName;
+ hookEvent.attrValue = value2;
+ hookEvent.keepAttr = true;
+ hookEvent.forceKeepAttr = void 0;
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
+ value2 = hookEvent.attrValue;
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
+ _removeAttribute(name, currentNode);
+ value2 = SANITIZE_NAMED_PROPS_PREFIX + value2;
+ }
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value2)) {
+ _removeAttribute(name, currentNode);
+ continue;
+ }
+ if (hookEvent.forceKeepAttr) {
+ continue;
+ }
+ _removeAttribute(name, currentNode);
+ if (!hookEvent.keepAttr) {
+ continue;
+ }
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value2)) {
+ _removeAttribute(name, currentNode);
+ continue;
+ }
+ if (SAFE_FOR_TEMPLATES) {
+ arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
+ value2 = stringReplace(value2, expr, " ");
+ });
+ }
+ const lcTag = transformCaseFunc(currentNode.nodeName);
+ if (!_isValidAttribute(lcTag, lcName, value2)) {
+ continue;
+ }
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
+ if (namespaceURI) ;
+ else {
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
+ case "TrustedHTML": {
+ value2 = trustedTypesPolicy.createHTML(value2);
+ break;
}
- if (typeof desc.value === "function") {
- return unapply(desc.value);
+ case "TrustedScriptURL": {
+ value2 = trustedTypesPolicy.createScriptURL(value2);
+ break;
}
}
- object3 = getPrototypeOf(object3);
}
- function fallbackValue() {
- return null;
+ }
+ try {
+ if (namespaceURI) {
+ currentNode.setAttributeNS(namespaceURI, name, value2);
+ } else {
+ currentNode.setAttribute(name, value2);
}
- __name(fallbackValue, "fallbackValue");
- return fallbackValue;
- }
- __name(lookupGetter, "lookupGetter");
- const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
- const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
- const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
- const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
- const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
- const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
- const text2 = freeze(["#text"]);
- const html2 = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]);
- const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
- const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
- const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
- const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
- const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
- const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
- const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
- const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
- const IS_ALLOWED_URI = seal(
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
- // eslint-disable-line no-useless-escape
- );
- const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
- const ATTR_WHITESPACE = seal(
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
- // eslint-disable-line no-control-regex
- );
- const DOCTYPE_NAME = seal(/^html$/i);
- const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
- var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
- __proto__: null,
- MUSTACHE_EXPR,
- ERB_EXPR,
- TMPLIT_EXPR,
- DATA_ATTR,
- ARIA_ATTR,
- IS_ALLOWED_URI,
- IS_SCRIPT_OR_DATA,
- ATTR_WHITESPACE,
- DOCTYPE_NAME,
- CUSTOM_ELEMENT
- });
- const NODE_TYPE = {
- element: 1,
- attribute: 2,
- text: 3,
- cdataSection: 4,
- entityReference: 5,
- // Deprecated
- entityNode: 6,
- // Deprecated
- progressingInstruction: 7,
- comment: 8,
- document: 9,
- documentType: 10,
- documentFragment: 11,
- notation: 12
- // Deprecated
- };
- const getGlobal = /* @__PURE__ */ __name(function getGlobal2() {
- return typeof window === "undefined" ? null : window;
- }, "getGlobal");
- const _createTrustedTypesPolicy = /* @__PURE__ */ __name(function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
- if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
- return null;
+ if (_isClobbered(currentNode)) {
+ _forceRemove(currentNode);
+ } else {
+ arrayPop(DOMPurify.removed);
+ }
+ } catch (_2) {
+ }
+ }
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
+ }, "_sanitizeAttributes");
+ const _sanitizeShadowDOM = /* @__PURE__ */ __name(function _sanitizeShadowDOM2(fragment) {
+ let shadowNode = null;
+ const shadowIterator = _createNodeIterator(fragment);
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
+ while (shadowNode = shadowIterator.nextNode()) {
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
+ _sanitizeElements(shadowNode);
+ _sanitizeAttributes(shadowNode);
+ if (shadowNode.content instanceof DocumentFragment2) {
+ _sanitizeShadowDOM2(shadowNode.content);
+ }
+ }
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
+ }, "_sanitizeShadowDOM");
+ DOMPurify.sanitize = function(dirty) {
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
+ let body = null;
+ let importedNode = null;
+ let currentNode = null;
+ let returnNode = null;
+ IS_EMPTY_INPUT = !dirty;
+ if (IS_EMPTY_INPUT) {
+ dirty = "";
+ }
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
+ if (typeof dirty.toString === "function") {
+ dirty = dirty.toString();
+ if (typeof dirty !== "string") {
+ throw typeErrorCreate("dirty is not a string, aborting");
}
- let suffix = null;
- const ATTR_NAME = "data-tt-policy-suffix";
- if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
- suffix = purifyHostElement.getAttribute(ATTR_NAME);
+ } else {
+ throw typeErrorCreate("toString is not a function");
+ }
+ }
+ if (!DOMPurify.isSupported) {
+ return dirty;
+ }
+ if (!SET_CONFIG) {
+ _parseConfig(cfg);
+ }
+ DOMPurify.removed = [];
+ if (typeof dirty === "string") {
+ IN_PLACE = false;
+ }
+ if (IN_PLACE) {
+ if (dirty.nodeName) {
+ const tagName = transformCaseFunc(dirty.nodeName);
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
+ throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
}
- const policyName = "dompurify" + (suffix ? "#" + suffix : "");
- try {
- return trustedTypes.createPolicy(policyName, {
- createHTML(html3) {
- return html3;
- },
- createScriptURL(scriptUrl) {
- return scriptUrl;
- }
- });
- } catch (_2) {
- console.warn("TrustedTypes policy " + policyName + " could not be created.");
- return null;
+ }
+ } else if (dirty instanceof Node) {
+ body = _initDocument("");
+ importedNode = body.ownerDocument.importNode(dirty, true);
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
+ body = importedNode;
+ } else if (importedNode.nodeName === "HTML") {
+ body = importedNode;
+ } else {
+ body.appendChild(importedNode);
+ }
+ } else {
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
+ dirty.indexOf("<") === -1) {
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
+ }
+ body = _initDocument(dirty);
+ if (!body) {
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
+ }
+ }
+ if (body && FORCE_BODY) {
+ _forceRemove(body.firstChild);
+ }
+ const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
+ while (currentNode = nodeIterator.nextNode()) {
+ _sanitizeElements(currentNode);
+ _sanitizeAttributes(currentNode);
+ if (currentNode.content instanceof DocumentFragment2) {
+ _sanitizeShadowDOM(currentNode.content);
+ }
+ }
+ if (IN_PLACE) {
+ return dirty;
+ }
+ if (RETURN_DOM) {
+ if (RETURN_DOM_FRAGMENT) {
+ returnNode = createDocumentFragment.call(body.ownerDocument);
+ while (body.firstChild) {
+ returnNode.appendChild(body.firstChild);
}
- }, "_createTrustedTypesPolicy");
- function createDOMPurify() {
- let window3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
- const DOMPurify3 = /* @__PURE__ */ __name((root4) => createDOMPurify(root4), "DOMPurify");
- DOMPurify3.version = "3.1.6";
- DOMPurify3.removed = [];
- if (!window3 || !window3.document || window3.document.nodeType !== NODE_TYPE.document) {
- DOMPurify3.isSupported = false;
- return DOMPurify3;
- }
- let {
- document: document2
- } = window3;
- const originalDocument = document2;
- const currentScript = originalDocument.currentScript;
- const {
- DocumentFragment: DocumentFragment2,
- HTMLTemplateElement,
- Node,
- Element: Element3,
- NodeFilter,
- NamedNodeMap = window3.NamedNodeMap || window3.MozNamedAttrMap,
- HTMLFormElement,
- DOMParser,
- trustedTypes
- } = window3;
- const ElementPrototype = Element3.prototype;
- const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
- const remove3 = lookupGetter(ElementPrototype, "remove");
- const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
- const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
- const getParentNode = lookupGetter(ElementPrototype, "parentNode");
- if (typeof HTMLTemplateElement === "function") {
- const template = document2.createElement("template");
- if (template.content && template.content.ownerDocument) {
- document2 = template.content.ownerDocument;
- }
- }
- let trustedTypesPolicy;
- let emptyHTML = "";
- const {
- implementation,
- createNodeIterator,
- createDocumentFragment,
- getElementsByTagName
- } = document2;
- const {
- importNode
- } = originalDocument;
- let hooks = {};
- DOMPurify3.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
- const {
- MUSTACHE_EXPR: MUSTACHE_EXPR2,
- ERB_EXPR: ERB_EXPR2,
- TMPLIT_EXPR: TMPLIT_EXPR2,
- DATA_ATTR: DATA_ATTR2,
- ARIA_ATTR: ARIA_ATTR2,
- IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2,
- ATTR_WHITESPACE: ATTR_WHITESPACE2,
- CUSTOM_ELEMENT: CUSTOM_ELEMENT2
- } = EXPRESSIONS;
- let {
- IS_ALLOWED_URI: IS_ALLOWED_URI$1
- } = EXPRESSIONS;
- let ALLOWED_TAGS = null;
- const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text2]);
- let ALLOWED_ATTR = null;
- const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html2, ...svg, ...mathMl, ...xml]);
- let CUSTOM_ELEMENT_HANDLING = Object.seal(create2(null, {
- tagNameCheck: {
- writable: true,
- configurable: false,
- enumerable: true,
- value: null
- },
- attributeNameCheck: {
- writable: true,
- configurable: false,
- enumerable: true,
- value: null
+ } else {
+ returnNode = body;
+ }
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
+ returnNode = importNode.call(originalDocument, returnNode, true);
+ }
+ return returnNode;
+ }
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
+ serializedHTML = "\n" + serializedHTML;
+ }
+ if (SAFE_FOR_TEMPLATES) {
+ arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
+ serializedHTML = stringReplace(serializedHTML, expr, " ");
+ });
+ }
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
+ };
+ DOMPurify.setConfig = function() {
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
+ _parseConfig(cfg);
+ SET_CONFIG = true;
+ };
+ DOMPurify.clearConfig = function() {
+ CONFIG = null;
+ SET_CONFIG = false;
+ };
+ DOMPurify.isValidAttribute = function(tag2, attr, value2) {
+ if (!CONFIG) {
+ _parseConfig({});
+ }
+ const lcTag = transformCaseFunc(tag2);
+ const lcName = transformCaseFunc(attr);
+ return _isValidAttribute(lcTag, lcName, value2);
+ };
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
+ if (typeof hookFunction !== "function") {
+ return;
+ }
+ arrayPush(hooks[entryPoint], hookFunction);
+ };
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
+ if (hookFunction !== void 0) {
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
+ }
+ return arrayPop(hooks[entryPoint]);
+ };
+ DOMPurify.removeHooks = function(entryPoint) {
+ hooks[entryPoint] = [];
+ };
+ DOMPurify.removeAllHooks = function() {
+ hooks = _createHooksMap();
+ };
+ return DOMPurify;
+ }
+ var entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor, freeze, seal, create, apply, construct, arrayForEach, arrayLastIndexOf, arrayPop, arrayPush, arraySplice, stringToLowerCase, stringToString, stringMatch, stringReplace, stringIndexOf, stringTrim, objectHasOwnProperty, regExpTest, typeErrorCreate, html$1, svg$1, svgFilters, svgDisallowed, mathMl$1, mathMlDisallowed, text, html, svg, mathMl, xml, MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR, DATA_ATTR, ARIA_ATTR, IS_ALLOWED_URI, IS_SCRIPT_OR_DATA, ATTR_WHITESPACE, DOCTYPE_NAME, CUSTOM_ELEMENT, EXPRESSIONS, NODE_TYPE, getGlobal, _createTrustedTypesPolicy, _createHooksMap, purify;
+ var init_purify_es = __esm({
+ "../../node_modules/.pnpm/dompurify@3.2.4/node_modules/dompurify/dist/purify.es.mjs"() {
+ "use strict";
+ ({
+ entries,
+ setPrototypeOf,
+ isFrozen,
+ getPrototypeOf,
+ getOwnPropertyDescriptor
+ } = Object);
+ ({
+ freeze,
+ seal,
+ create
+ } = Object);
+ ({
+ apply,
+ construct
+ } = typeof Reflect !== "undefined" && Reflect);
+ if (!freeze) {
+ freeze = /* @__PURE__ */ __name(function freeze2(x5) {
+ return x5;
+ }, "freeze");
+ }
+ if (!seal) {
+ seal = /* @__PURE__ */ __name(function seal2(x5) {
+ return x5;
+ }, "seal");
+ }
+ if (!apply) {
+ apply = /* @__PURE__ */ __name(function apply4(fun, thisValue, args) {
+ return fun.apply(thisValue, args);
+ }, "apply");
+ }
+ if (!construct) {
+ construct = /* @__PURE__ */ __name(function construct2(Func, args) {
+ return new Func(...args);
+ }, "construct");
+ }
+ arrayForEach = unapply(Array.prototype.forEach);
+ arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
+ arrayPop = unapply(Array.prototype.pop);
+ arrayPush = unapply(Array.prototype.push);
+ arraySplice = unapply(Array.prototype.splice);
+ stringToLowerCase = unapply(String.prototype.toLowerCase);
+ stringToString = unapply(String.prototype.toString);
+ stringMatch = unapply(String.prototype.match);
+ stringReplace = unapply(String.prototype.replace);
+ stringIndexOf = unapply(String.prototype.indexOf);
+ stringTrim = unapply(String.prototype.trim);
+ objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
+ regExpTest = unapply(RegExp.prototype.test);
+ typeErrorCreate = unconstruct(TypeError);
+ __name(unapply, "unapply");
+ __name(unconstruct, "unconstruct");
+ __name(addToSet, "addToSet");
+ __name(cleanArray, "cleanArray");
+ __name(clone, "clone");
+ __name(lookupGetter, "lookupGetter");
+ html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
+ svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
+ svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
+ svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
+ mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
+ mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
+ text = freeze(["#text"]);
+ html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]);
+ svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
+ mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
+ xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
+ MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
+ ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
+ TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
+ DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
+ ARIA_ATTR = seal(/^aria-[\-\w]+$/);
+ IS_ALLOWED_URI = seal(
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
+ // eslint-disable-line no-useless-escape
+ );
+ IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
+ ATTR_WHITESPACE = seal(
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
+ // eslint-disable-line no-control-regex
+ );
+ DOCTYPE_NAME = seal(/^html$/i);
+ CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
+ EXPRESSIONS = /* @__PURE__ */ Object.freeze({
+ __proto__: null,
+ ARIA_ATTR,
+ ATTR_WHITESPACE,
+ CUSTOM_ELEMENT,
+ DATA_ATTR,
+ DOCTYPE_NAME,
+ ERB_EXPR,
+ IS_ALLOWED_URI,
+ IS_SCRIPT_OR_DATA,
+ MUSTACHE_EXPR,
+ TMPLIT_EXPR
+ });
+ NODE_TYPE = {
+ element: 1,
+ attribute: 2,
+ text: 3,
+ cdataSection: 4,
+ entityReference: 5,
+ // Deprecated
+ entityNode: 6,
+ // Deprecated
+ progressingInstruction: 7,
+ comment: 8,
+ document: 9,
+ documentType: 10,
+ documentFragment: 11,
+ notation: 12
+ // Deprecated
+ };
+ getGlobal = /* @__PURE__ */ __name(function getGlobal2() {
+ return typeof window === "undefined" ? null : window;
+ }, "getGlobal");
+ _createTrustedTypesPolicy = /* @__PURE__ */ __name(function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
+ return null;
+ }
+ let suffix = null;
+ const ATTR_NAME = "data-tt-policy-suffix";
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
+ }
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
+ try {
+ return trustedTypes.createPolicy(policyName, {
+ createHTML(html3) {
+ return html3;
},
- allowCustomizedBuiltInElements: {
- writable: true,
- configurable: false,
- enumerable: true,
- value: false
- }
- }));
- let FORBID_TAGS = null;
- let FORBID_ATTR = null;
- let ALLOW_ARIA_ATTR = true;
- let ALLOW_DATA_ATTR = true;
- let ALLOW_UNKNOWN_PROTOCOLS = false;
- let ALLOW_SELF_CLOSE_IN_ATTR = true;
- let SAFE_FOR_TEMPLATES = false;
- let SAFE_FOR_XML = true;
- let WHOLE_DOCUMENT = false;
- let SET_CONFIG = false;
- let FORCE_BODY = false;
- let RETURN_DOM = false;
- let RETURN_DOM_FRAGMENT = false;
- let RETURN_TRUSTED_TYPE = false;
- let SANITIZE_DOM = true;
- let SANITIZE_NAMED_PROPS = false;
- const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
- let KEEP_CONTENT = true;
- let IN_PLACE = false;
- let USE_PROFILES = {};
- let FORBID_CONTENTS = null;
- const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
- let DATA_URI_TAGS = null;
- const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
- let URI_SAFE_ATTRIBUTES = null;
- const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
- const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
- const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
- const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
- let NAMESPACE = HTML_NAMESPACE;
- let IS_EMPTY_INPUT = false;
- let ALLOWED_NAMESPACES = null;
- const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
- let PARSER_MEDIA_TYPE = null;
- const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
- const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
- let transformCaseFunc = null;
- let CONFIG = null;
- const formElement = document2.createElement("form");
- const isRegexOrFunction = /* @__PURE__ */ __name(function isRegexOrFunction2(testValue) {
- return testValue instanceof RegExp || testValue instanceof Function;
- }, "isRegexOrFunction");
- const _parseConfig = /* @__PURE__ */ __name(function _parseConfig2() {
- let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- if (CONFIG && CONFIG === cfg) {
- return;
- }
- if (!cfg || typeof cfg !== "object") {
- cfg = {};
- }
- cfg = clone5(cfg);
- PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
- SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
- transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
- ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
- ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
- ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
- URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(
- clone5(DEFAULT_URI_SAFE_ATTRIBUTES),
- // eslint-disable-line indent
- cfg.ADD_URI_SAFE_ATTR,
- // eslint-disable-line indent
- transformCaseFunc
- // eslint-disable-line indent
- ) : DEFAULT_URI_SAFE_ATTRIBUTES;
- DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(
- clone5(DEFAULT_DATA_URI_TAGS),
- // eslint-disable-line indent
- cfg.ADD_DATA_URI_TAGS,
- // eslint-disable-line indent
- transformCaseFunc
- // eslint-disable-line indent
- ) : DEFAULT_DATA_URI_TAGS;
- FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
- FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
- FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
- USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
- ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
- ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
- ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
- ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
- SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
- SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
- WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
- RETURN_DOM = cfg.RETURN_DOM || false;
- RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
- RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
- FORCE_BODY = cfg.FORCE_BODY || false;
- SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
- SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
- KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
- IN_PLACE = cfg.IN_PLACE || false;
- IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
- NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
- CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
- if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
- CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
- }
- if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
- CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
- }
- if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
- CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
- }
- if (SAFE_FOR_TEMPLATES) {
- ALLOW_DATA_ATTR = false;
- }
- if (RETURN_DOM_FRAGMENT) {
- RETURN_DOM = true;
- }
- if (USE_PROFILES) {
- ALLOWED_TAGS = addToSet({}, text2);
- ALLOWED_ATTR = [];
- if (USE_PROFILES.html === true) {
- addToSet(ALLOWED_TAGS, html$1);
- addToSet(ALLOWED_ATTR, html2);
- }
- if (USE_PROFILES.svg === true) {
- addToSet(ALLOWED_TAGS, svg$1);
- addToSet(ALLOWED_ATTR, svg);
- addToSet(ALLOWED_ATTR, xml);
- }
- if (USE_PROFILES.svgFilters === true) {
- addToSet(ALLOWED_TAGS, svgFilters);
- addToSet(ALLOWED_ATTR, svg);
- addToSet(ALLOWED_ATTR, xml);
- }
- if (USE_PROFILES.mathMl === true) {
- addToSet(ALLOWED_TAGS, mathMl$1);
- addToSet(ALLOWED_ATTR, mathMl);
- addToSet(ALLOWED_ATTR, xml);
- }
- }
- if (cfg.ADD_TAGS) {
- if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
- ALLOWED_TAGS = clone5(ALLOWED_TAGS);
- }
- addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
- }
- if (cfg.ADD_ATTR) {
- if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
- ALLOWED_ATTR = clone5(ALLOWED_ATTR);
- }
- addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
- }
- if (cfg.ADD_URI_SAFE_ATTR) {
- addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
- }
- if (cfg.FORBID_CONTENTS) {
- if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
- FORBID_CONTENTS = clone5(FORBID_CONTENTS);
- }
- addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
- }
- if (KEEP_CONTENT) {
- ALLOWED_TAGS["#text"] = true;
- }
- if (WHOLE_DOCUMENT) {
- addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
- }
- if (ALLOWED_TAGS.table) {
- addToSet(ALLOWED_TAGS, ["tbody"]);
- delete FORBID_TAGS.tbody;
- }
- if (cfg.TRUSTED_TYPES_POLICY) {
- if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
- throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
- }
- if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
- throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
- }
- trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
- emptyHTML = trustedTypesPolicy.createHTML("");
- } else {
- if (trustedTypesPolicy === void 0) {
- trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
- }
- if (trustedTypesPolicy !== null && typeof emptyHTML === "string") {
- emptyHTML = trustedTypesPolicy.createHTML("");
- }
- }
- if (freeze) {
- freeze(cfg);
- }
- CONFIG = cfg;
- }, "_parseConfig");
- const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
- const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "annotation-xml"]);
- const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
- const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
- const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
- const _checkValidNamespace = /* @__PURE__ */ __name(function _checkValidNamespace2(element3) {
- let parent4 = getParentNode(element3);
- if (!parent4 || !parent4.tagName) {
- parent4 = {
- namespaceURI: NAMESPACE,
- tagName: "template"
- };
- }
- const tagName = stringToLowerCase(element3.tagName);
- const parentTagName = stringToLowerCase(parent4.tagName);
- if (!ALLOWED_NAMESPACES[element3.namespaceURI]) {
- return false;
- }
- if (element3.namespaceURI === SVG_NAMESPACE) {
- if (parent4.namespaceURI === HTML_NAMESPACE) {
- return tagName === "svg";
- }
- if (parent4.namespaceURI === MATHML_NAMESPACE) {
- return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
- }
- return Boolean(ALL_SVG_TAGS[tagName]);
- }
- if (element3.namespaceURI === MATHML_NAMESPACE) {
- if (parent4.namespaceURI === HTML_NAMESPACE) {
- return tagName === "math";
- }
- if (parent4.namespaceURI === SVG_NAMESPACE) {
- return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
- }
- return Boolean(ALL_MATHML_TAGS[tagName]);
+ createScriptURL(scriptUrl) {
+ return scriptUrl;
}
- if (element3.namespaceURI === HTML_NAMESPACE) {
- if (parent4.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
- return false;
- }
- if (parent4.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
- return false;
- }
- return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
- }
- if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element3.namespaceURI]) {
- return true;
- }
- return false;
- }, "_checkValidNamespace");
- const _forceRemove = /* @__PURE__ */ __name(function _forceRemove2(node2) {
- arrayPush2(DOMPurify3.removed, {
- element: node2
- });
- try {
- getParentNode(node2).removeChild(node2);
- } catch (_2) {
- remove3(node2);
- }
- }, "_forceRemove");
- const _removeAttribute = /* @__PURE__ */ __name(function _removeAttribute2(name, node2) {
- try {
- arrayPush2(DOMPurify3.removed, {
- attribute: node2.getAttributeNode(name),
- from: node2
- });
- } catch (_2) {
- arrayPush2(DOMPurify3.removed, {
- attribute: null,
- from: node2
- });
- }
- node2.removeAttribute(name);
- if (name === "is" && !ALLOWED_ATTR[name]) {
- if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
- try {
- _forceRemove(node2);
- } catch (_2) {
- }
- } else {
- try {
- node2.setAttribute(name, "");
- } catch (_2) {
- }
- }
- }
- }, "_removeAttribute");
- const _initDocument = /* @__PURE__ */ __name(function _initDocument2(dirty) {
- let doc = null;
- let leadingWhitespace = null;
- if (FORCE_BODY) {
- dirty = " " + dirty;
- } else {
- const matches33 = stringMatch(dirty, /^[\r\n\t ]+/);
- leadingWhitespace = matches33 && matches33[0];
- }
- if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
- dirty = '' + dirty + "";
- }
- const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
- if (NAMESPACE === HTML_NAMESPACE) {
- try {
- doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
- } catch (_2) {
- }
- }
- if (!doc || !doc.documentElement) {
- doc = implementation.createDocument(NAMESPACE, "template", null);
- try {
- doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
- } catch (_2) {
- }
- }
- const body = doc.body || doc.documentElement;
- if (dirty && leadingWhitespace) {
- body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
- }
- if (NAMESPACE === HTML_NAMESPACE) {
- return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
- }
- return WHOLE_DOCUMENT ? doc.documentElement : body;
- }, "_initDocument");
- const _createNodeIterator = /* @__PURE__ */ __name(function _createNodeIterator2(root4) {
- return createNodeIterator.call(
- root4.ownerDocument || root4,
- root4,
- // eslint-disable-next-line no-bitwise
- NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
- null
- );
- }, "_createNodeIterator");
- const _isClobbered = /* @__PURE__ */ __name(function _isClobbered2(elm) {
- return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
- }, "_isClobbered");
- const _isNode = /* @__PURE__ */ __name(function _isNode2(object3) {
- return typeof Node === "function" && object3 instanceof Node;
- }, "_isNode");
- const _executeHook = /* @__PURE__ */ __name(function _executeHook2(entryPoint, currentNode, data5) {
- if (!hooks[entryPoint]) {
- return;
- }
- arrayForEach(hooks[entryPoint], (hook2) => {
- hook2.call(DOMPurify3, currentNode, data5, CONFIG);
- });
- }, "_executeHook");
- const _sanitizeElements = /* @__PURE__ */ __name(function _sanitizeElements2(currentNode) {
- let content = null;
- _executeHook("beforeSanitizeElements", currentNode, null);
- if (_isClobbered(currentNode)) {
- _forceRemove(currentNode);
- return true;
- }
- const tagName = transformCaseFunc(currentNode.nodeName);
- _executeHook("uponSanitizeElement", currentNode, {
- tagName,
- allowedTags: ALLOWED_TAGS
- });
- if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
- _forceRemove(currentNode);
- return true;
- }
- if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
- _forceRemove(currentNode);
- return true;
- }
- if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
- _forceRemove(currentNode);
- return true;
- }
- if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
- if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
- if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
- return false;
- }
- if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
- return false;
- }
- }
- if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
- const parentNode = getParentNode(currentNode) || currentNode.parentNode;
- const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
- if (childNodes && parentNode) {
- const childCount = childNodes.length;
- for (let i2 = childCount - 1; i2 >= 0; --i2) {
- const childClone = cloneNode(childNodes[i2], true);
- childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
- parentNode.insertBefore(childClone, getNextSibling(currentNode));
- }
- }
- }
- _forceRemove(currentNode);
- return true;
- }
- if (currentNode instanceof Element3 && !_checkValidNamespace(currentNode)) {
- _forceRemove(currentNode);
- return true;
- }
- if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
- _forceRemove(currentNode);
- return true;
- }
- if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
- content = currentNode.textContent;
- arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
- content = stringReplace(content, expr, " ");
- });
- if (currentNode.textContent !== content) {
- arrayPush2(DOMPurify3.removed, {
- element: currentNode.cloneNode()
- });
- currentNode.textContent = content;
- }
- }
- _executeHook("afterSanitizeElements", currentNode, null);
- return false;
- }, "_sanitizeElements");
- const _isValidAttribute = /* @__PURE__ */ __name(function _isValidAttribute2(lcTag, lcName, value2) {
- if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value2 in document2 || value2 in formElement)) {
- return false;
- }
- if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName)) ;
- else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR2, lcName)) ;
- else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
- if (
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
- _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || // Alternative, second condition checks if it's an `is`-attribute, AND
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
- lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value2) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value2))
- ) ;
- else {
- return false;
- }
- } else if (URI_SAFE_ATTRIBUTES[lcName]) ;
- else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value2, ATTR_WHITESPACE2, ""))) ;
- else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value2, "data:") === 0 && DATA_URI_TAGS[lcTag]) ;
- else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value2, ATTR_WHITESPACE2, ""))) ;
- else if (value2) {
- return false;
- } else ;
- return true;
- }, "_isValidAttribute");
- const _isBasicCustomElement = /* @__PURE__ */ __name(function _isBasicCustomElement2(tagName) {
- return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT2);
- }, "_isBasicCustomElement");
- const _sanitizeAttributes = /* @__PURE__ */ __name(function _sanitizeAttributes2(currentNode) {
- _executeHook("beforeSanitizeAttributes", currentNode, null);
- const {
- attributes
- } = currentNode;
- if (!attributes) {
- return;
- }
- const hookEvent = {
- attrName: "",
- attrValue: "",
- keepAttr: true,
- allowedAttributes: ALLOWED_ATTR
- };
- let l2 = attributes.length;
- while (l2--) {
- const attr = attributes[l2];
- const {
- name,
- namespaceURI,
- value: attrValue
- } = attr;
- const lcName = transformCaseFunc(name);
- let value2 = name === "value" ? attrValue : stringTrim(attrValue);
- hookEvent.attrName = lcName;
- hookEvent.attrValue = value2;
- hookEvent.keepAttr = true;
- hookEvent.forceKeepAttr = void 0;
- _executeHook("uponSanitizeAttribute", currentNode, hookEvent);
- value2 = hookEvent.attrValue;
- if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value2)) {
- _removeAttribute(name, currentNode);
- continue;
- }
- if (hookEvent.forceKeepAttr) {
- continue;
- }
- _removeAttribute(name, currentNode);
- if (!hookEvent.keepAttr) {
- continue;
- }
- if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value2)) {
- _removeAttribute(name, currentNode);
- continue;
- }
- if (SAFE_FOR_TEMPLATES) {
- arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
- value2 = stringReplace(value2, expr, " ");
- });
- }
- const lcTag = transformCaseFunc(currentNode.nodeName);
- if (!_isValidAttribute(lcTag, lcName, value2)) {
- continue;
- }
- if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
- _removeAttribute(name, currentNode);
- value2 = SANITIZE_NAMED_PROPS_PREFIX + value2;
- }
- if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
- if (namespaceURI) ;
- else {
- switch (trustedTypes.getAttributeType(lcTag, lcName)) {
- case "TrustedHTML": {
- value2 = trustedTypesPolicy.createHTML(value2);
- break;
- }
- case "TrustedScriptURL": {
- value2 = trustedTypesPolicy.createScriptURL(value2);
- break;
- }
- }
- }
- }
- try {
- if (namespaceURI) {
- currentNode.setAttributeNS(namespaceURI, name, value2);
- } else {
- currentNode.setAttribute(name, value2);
- }
- if (_isClobbered(currentNode)) {
- _forceRemove(currentNode);
- } else {
- arrayPop(DOMPurify3.removed);
- }
- } catch (_2) {
- }
- }
- _executeHook("afterSanitizeAttributes", currentNode, null);
- }, "_sanitizeAttributes");
- const _sanitizeShadowDOM = /* @__PURE__ */ __name(function _sanitizeShadowDOM2(fragment) {
- let shadowNode = null;
- const shadowIterator = _createNodeIterator(fragment);
- _executeHook("beforeSanitizeShadowDOM", fragment, null);
- while (shadowNode = shadowIterator.nextNode()) {
- _executeHook("uponSanitizeShadowNode", shadowNode, null);
- if (_sanitizeElements(shadowNode)) {
- continue;
- }
- if (shadowNode.content instanceof DocumentFragment2) {
- _sanitizeShadowDOM2(shadowNode.content);
- }
- _sanitizeAttributes(shadowNode);
- }
- _executeHook("afterSanitizeShadowDOM", fragment, null);
- }, "_sanitizeShadowDOM");
- DOMPurify3.sanitize = function(dirty) {
- let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- let body = null;
- let importedNode = null;
- let currentNode = null;
- let returnNode = null;
- IS_EMPTY_INPUT = !dirty;
- if (IS_EMPTY_INPUT) {
- dirty = "";
- }
- if (typeof dirty !== "string" && !_isNode(dirty)) {
- if (typeof dirty.toString === "function") {
- dirty = dirty.toString();
- if (typeof dirty !== "string") {
- throw typeErrorCreate("dirty is not a string, aborting");
- }
- } else {
- throw typeErrorCreate("toString is not a function");
- }
- }
- if (!DOMPurify3.isSupported) {
- return dirty;
- }
- if (!SET_CONFIG) {
- _parseConfig(cfg);
- }
- DOMPurify3.removed = [];
- if (typeof dirty === "string") {
- IN_PLACE = false;
- }
- if (IN_PLACE) {
- if (dirty.nodeName) {
- const tagName = transformCaseFunc(dirty.nodeName);
- if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
- throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
- }
- }
- } else if (dirty instanceof Node) {
- body = _initDocument("");
- importedNode = body.ownerDocument.importNode(dirty, true);
- if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
- body = importedNode;
- } else if (importedNode.nodeName === "HTML") {
- body = importedNode;
- } else {
- body.appendChild(importedNode);
- }
- } else {
- if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
- dirty.indexOf("<") === -1) {
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
- }
- body = _initDocument(dirty);
- if (!body) {
- return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
- }
- }
- if (body && FORCE_BODY) {
- _forceRemove(body.firstChild);
- }
- const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
- while (currentNode = nodeIterator.nextNode()) {
- if (_sanitizeElements(currentNode)) {
- continue;
- }
- if (currentNode.content instanceof DocumentFragment2) {
- _sanitizeShadowDOM(currentNode.content);
- }
- _sanitizeAttributes(currentNode);
- }
- if (IN_PLACE) {
- return dirty;
- }
- if (RETURN_DOM) {
- if (RETURN_DOM_FRAGMENT) {
- returnNode = createDocumentFragment.call(body.ownerDocument);
- while (body.firstChild) {
- returnNode.appendChild(body.firstChild);
- }
- } else {
- returnNode = body;
- }
- if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
- returnNode = importNode.call(originalDocument, returnNode, true);
- }
- return returnNode;
- }
- let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
- if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
- serializedHTML = "\n" + serializedHTML;
- }
- if (SAFE_FOR_TEMPLATES) {
- arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
- serializedHTML = stringReplace(serializedHTML, expr, " ");
- });
- }
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
- };
- DOMPurify3.setConfig = function() {
- let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- _parseConfig(cfg);
- SET_CONFIG = true;
- };
- DOMPurify3.clearConfig = function() {
- CONFIG = null;
- SET_CONFIG = false;
- };
- DOMPurify3.isValidAttribute = function(tag2, attr, value2) {
- if (!CONFIG) {
- _parseConfig({});
- }
- const lcTag = transformCaseFunc(tag2);
- const lcName = transformCaseFunc(attr);
- return _isValidAttribute(lcTag, lcName, value2);
- };
- DOMPurify3.addHook = function(entryPoint, hookFunction) {
- if (typeof hookFunction !== "function") {
- return;
- }
- hooks[entryPoint] = hooks[entryPoint] || [];
- arrayPush2(hooks[entryPoint], hookFunction);
- };
- DOMPurify3.removeHook = function(entryPoint) {
- if (hooks[entryPoint]) {
- return arrayPop(hooks[entryPoint]);
- }
- };
- DOMPurify3.removeHooks = function(entryPoint) {
- if (hooks[entryPoint]) {
- hooks[entryPoint] = [];
- }
- };
- DOMPurify3.removeAllHooks = function() {
- hooks = {};
- };
- return DOMPurify3;
+ });
+ } catch (_2) {
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
+ return null;
}
- __name(createDOMPurify, "createDOMPurify");
- var purify = createDOMPurify();
- return purify;
- });
+ }, "_createTrustedTypesPolicy");
+ _createHooksMap = /* @__PURE__ */ __name(function _createHooksMap2() {
+ return {
+ afterSanitizeAttributes: [],
+ afterSanitizeElements: [],
+ afterSanitizeShadowDOM: [],
+ beforeSanitizeAttributes: [],
+ beforeSanitizeElements: [],
+ beforeSanitizeShadowDOM: [],
+ uponSanitizeAttribute: [],
+ uponSanitizeElement: [],
+ uponSanitizeShadowNode: []
+ };
+ }, "_createHooksMap");
+ __name(createDOMPurify, "createDOMPurify");
+ purify = createDOMPurify();
}
});
@@ -6994,8 +7111,8 @@ var __esbuild_esm_mermaid = (() => {
__export(katex_exports, {
default: () => katex
});
- function escape2(text2) {
- return String(text2).replace(ESCAPE_REGEX, (match2) => ESCAPE_LOOKUP[match2]);
+ function escape2(text4) {
+ return String(text4).replace(ESCAPE_REGEX, (match2) => ESCAPE_LOOKUP[match2]);
}
function getDefaultValue(schema2) {
if (schema2.default) {
@@ -7119,7 +7236,7 @@ var __esbuild_esm_mermaid = (() => {
htmlBuilder: htmlBuilder3,
mathmlBuilder: mathmlBuilder3
} = _ref;
- var data5 = {
+ var data6 = {
type: type3,
numArgs: props.numArgs,
argTypes: props.argTypes,
@@ -7132,7 +7249,7 @@ var __esbuild_esm_mermaid = (() => {
handler
};
for (var i2 = 0; i2 < names.length; ++i2) {
- _functions[names[i2]] = data5;
+ _functions[names[i2]] = data6;
}
if (type3) {
if (htmlBuilder3) {
@@ -7311,39 +7428,39 @@ var __esbuild_esm_mermaid = (() => {
}
return node2;
}
- function cdArrow(arrowChar, labels, parser22) {
+ function cdArrow(arrowChar, labels, parser24) {
var funcName = cdArrowFunctionName[arrowChar];
switch (funcName) {
case "\\\\cdrightarrow":
case "\\\\cdleftarrow":
- return parser22.callFunction(funcName, [labels[0]], [labels[1]]);
+ return parser24.callFunction(funcName, [labels[0]], [labels[1]]);
case "\\uparrow":
case "\\downarrow": {
- var leftLabel = parser22.callFunction("\\\\cdleft", [labels[0]], []);
+ var leftLabel = parser24.callFunction("\\\\cdleft", [labels[0]], []);
var bareArrow = {
type: "atom",
text: funcName,
mode: "math",
family: "rel"
};
- var sizedArrow = parser22.callFunction("\\Big", [bareArrow], []);
- var rightLabel = parser22.callFunction("\\\\cdright", [labels[1]], []);
+ var sizedArrow = parser24.callFunction("\\Big", [bareArrow], []);
+ var rightLabel = parser24.callFunction("\\\\cdright", [labels[1]], []);
var arrowGroup = {
type: "ordgroup",
mode: "math",
body: [leftLabel, sizedArrow, rightLabel]
};
- return parser22.callFunction("\\\\cdparent", [arrowGroup], []);
+ return parser24.callFunction("\\\\cdparent", [arrowGroup], []);
}
case "\\\\cdlongequal":
- return parser22.callFunction("\\\\cdlongequal", [], []);
+ return parser24.callFunction("\\\\cdlongequal", [], []);
case "\\Vert": {
var arrow = {
type: "textord",
text: "\\Vert",
mode: "math"
};
- return parser22.callFunction("\\Big", [arrow], []);
+ return parser24.callFunction("\\Big", [arrow], []);
}
default:
return {
@@ -7353,25 +7470,25 @@ var __esbuild_esm_mermaid = (() => {
};
}
}
- function parseCD(parser22) {
+ function parseCD(parser24) {
var parsedRows = [];
- parser22.gullet.beginGroup();
- parser22.gullet.macros.set("\\cr", "\\\\\\relax");
- parser22.gullet.beginGroup();
+ parser24.gullet.beginGroup();
+ parser24.gullet.macros.set("\\cr", "\\\\\\relax");
+ parser24.gullet.beginGroup();
while (true) {
- parsedRows.push(parser22.parseExpression(false, "\\\\"));
- parser22.gullet.endGroup();
- parser22.gullet.beginGroup();
- var next3 = parser22.fetch().text;
+ parsedRows.push(parser24.parseExpression(false, "\\\\"));
+ parser24.gullet.endGroup();
+ parser24.gullet.beginGroup();
+ var next3 = parser24.fetch().text;
if (next3 === "&" || next3 === "\\\\") {
- parser22.consume();
+ parser24.consume();
} else if (next3 === "\\end") {
if (parsedRows[parsedRows.length - 1].length === 0) {
parsedRows.pop();
}
break;
} else {
- throw new ParseError("Expected \\\\ or \\cr or \\end", parser22.nextToken);
+ throw new ParseError("Expected \\\\ or \\cr or \\end", parser24.nextToken);
}
}
var row = [];
@@ -7419,7 +7536,7 @@ var __esbuild_esm_mermaid = (() => {
} else {
throw new ParseError('Expected one of "<>AV=|." after @', rowNodes[j2]);
}
- var arrow = cdArrow(arrowChar, labels, parser22);
+ var arrow = cdArrow(arrowChar, labels, parser24);
var wrappedArrow = {
type: "styling",
body: [arrow],
@@ -7439,8 +7556,8 @@ var __esbuild_esm_mermaid = (() => {
row = [];
body.push(row);
}
- parser22.gullet.endGroup();
- parser22.gullet.endGroup();
+ parser24.gullet.endGroup();
+ parser24.gullet.endGroup();
var cols = new Array(body[0].length).fill({
type: "align",
align: "c",
@@ -7485,7 +7602,7 @@ var __esbuild_esm_mermaid = (() => {
htmlBuilder: htmlBuilder3,
mathmlBuilder: mathmlBuilder3
} = _ref;
- var data5 = {
+ var data6 = {
type: type3,
numArgs: props.numArgs || 0,
allowedInText: false,
@@ -7493,7 +7610,7 @@ var __esbuild_esm_mermaid = (() => {
handler
};
for (var i2 = 0; i2 < names.length; ++i2) {
- _environments[names[i2]] = data5;
+ _environments[names[i2]] = data6;
}
if (htmlBuilder3) {
_htmlGroupBuilders[type3] = htmlBuilder3;
@@ -7505,20 +7622,20 @@ var __esbuild_esm_mermaid = (() => {
function defineMacro(name, body) {
_macros[name] = body;
}
- function getHLines(parser22) {
+ function getHLines(parser24) {
var hlineInfo = [];
- parser22.consumeSpaces();
- var nxt = parser22.fetch().text;
+ parser24.consumeSpaces();
+ var nxt = parser24.fetch().text;
if (nxt === "\\relax") {
- parser22.consume();
- parser22.consumeSpaces();
- nxt = parser22.fetch().text;
+ parser24.consume();
+ parser24.consumeSpaces();
+ nxt = parser24.fetch().text;
}
while (nxt === "\\hline" || nxt === "\\hdashline") {
- parser22.consume();
+ parser24.consume();
hlineInfo.push(nxt === "\\hdashline");
- parser22.consumeSpaces();
- nxt = parser22.fetch().text;
+ parser24.consumeSpaces();
+ nxt = parser24.fetch().text;
}
return hlineInfo;
}
@@ -7527,7 +7644,7 @@ var __esbuild_esm_mermaid = (() => {
return name.indexOf("*") === -1;
}
}
- function parseArray(parser22, _ref, style3) {
+ function parseArray(parser24, _ref, style3) {
var {
hskipBeforeAndAfter,
addJot,
@@ -7540,12 +7657,12 @@ var __esbuild_esm_mermaid = (() => {
maxNumCols,
leqno
} = _ref;
- parser22.gullet.beginGroup();
+ parser24.gullet.beginGroup();
if (!singleRow) {
- parser22.gullet.macros.set("\\cr", "\\\\\\relax");
+ parser24.gullet.macros.set("\\cr", "\\\\\\relax");
}
if (!arraystretch) {
- var stretch = parser22.gullet.expandMacroAsText("\\arraystretch");
+ var stretch = parser24.gullet.expandMacroAsText("\\arraystretch");
if (stretch == null) {
arraystretch = 1;
} else {
@@ -7555,7 +7672,7 @@ var __esbuild_esm_mermaid = (() => {
}
}
}
- parser22.gullet.beginGroup();
+ parser24.gullet.beginGroup();
var row = [];
var body = [row];
var rowGaps = [];
@@ -7563,51 +7680,51 @@ var __esbuild_esm_mermaid = (() => {
var tags2 = autoTag != null ? [] : void 0;
function beginRow() {
if (autoTag) {
- parser22.gullet.macros.set("\\@eqnsw", "1", true);
+ parser24.gullet.macros.set("\\@eqnsw", "1", true);
}
}
__name(beginRow, "beginRow");
function endRow() {
if (tags2) {
- if (parser22.gullet.macros.get("\\df@tag")) {
- tags2.push(parser22.subparse([new Token("\\df@tag")]));
- parser22.gullet.macros.set("\\df@tag", void 0, true);
+ if (parser24.gullet.macros.get("\\df@tag")) {
+ tags2.push(parser24.subparse([new Token("\\df@tag")]));
+ parser24.gullet.macros.set("\\df@tag", void 0, true);
} else {
- tags2.push(Boolean(autoTag) && parser22.gullet.macros.get("\\@eqnsw") === "1");
+ tags2.push(Boolean(autoTag) && parser24.gullet.macros.get("\\@eqnsw") === "1");
}
}
}
__name(endRow, "endRow");
beginRow();
- hLinesBeforeRow.push(getHLines(parser22));
+ hLinesBeforeRow.push(getHLines(parser24));
while (true) {
- var cell = parser22.parseExpression(false, singleRow ? "\\end" : "\\\\");
- parser22.gullet.endGroup();
- parser22.gullet.beginGroup();
+ var cell = parser24.parseExpression(false, singleRow ? "\\end" : "\\\\");
+ parser24.gullet.endGroup();
+ parser24.gullet.beginGroup();
cell = {
type: "ordgroup",
- mode: parser22.mode,
+ mode: parser24.mode,
body: cell
};
if (style3) {
cell = {
type: "styling",
- mode: parser22.mode,
+ mode: parser24.mode,
style: style3,
body: [cell]
};
}
row.push(cell);
- var next3 = parser22.fetch().text;
+ var next3 = parser24.fetch().text;
if (next3 === "&") {
if (maxNumCols && row.length === maxNumCols) {
if (singleRow || colSeparationType) {
- throw new ParseError("Too many tab characters: &", parser22.nextToken);
+ throw new ParseError("Too many tab characters: &", parser24.nextToken);
} else {
- parser22.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
+ parser24.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
}
}
- parser22.consume();
+ parser24.consume();
} else if (next3 === "\\end") {
endRow();
if (row.length === 1 && cell.type === "styling" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow)) {
@@ -7618,26 +7735,26 @@ var __esbuild_esm_mermaid = (() => {
}
break;
} else if (next3 === "\\\\") {
- parser22.consume();
+ parser24.consume();
var size5 = void 0;
- if (parser22.gullet.future().text !== " ") {
- size5 = parser22.parseSizeGroup(true);
+ if (parser24.gullet.future().text !== " ") {
+ size5 = parser24.parseSizeGroup(true);
}
rowGaps.push(size5 ? size5.value : null);
endRow();
- hLinesBeforeRow.push(getHLines(parser22));
+ hLinesBeforeRow.push(getHLines(parser24));
row = [];
body.push(row);
beginRow();
} else {
- throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser22.nextToken);
+ throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser24.nextToken);
}
}
- parser22.gullet.endGroup();
- parser22.gullet.endGroup();
+ parser24.gullet.endGroup();
+ parser24.gullet.endGroup();
return {
type: "array",
- mode: parser22.mode,
+ mode: parser24.mode,
addJot,
arraystretch,
body,
@@ -7672,7 +7789,7 @@ var __esbuild_esm_mermaid = (() => {
}
return buildCommon.makeFragment(inner2);
}
- var SourceLocation, Token, ParseError, contains, deflt, uppercase, hyphenate, ESCAPE_LOOKUP, ESCAPE_REGEX, getBaseElem, isCharacterBox, assert, protocolFromUrl, utils, SETTINGS_SCHEMA, Settings, Style, D, Dc, T, Tc, S, Sc, SS, SSc, styles, sup, sub, fracNum, fracDen, cramp, text$1, Style$1, scriptData, allBlocks, hLinePad, sqrtMain, sqrtSize1, sqrtSize2, sqrtSize3, sqrtSize4, phasePath, sqrtTall, sqrtPath, innerPath, path, tallDelim, DocumentFragment, fontMetricsData, sigmasAndXis, extraCharacterMap, fontMetricsBySizeIndex, sizeStyleMap, sizeMultipliers, sizeAtStyle, Options, ptPerUnit, relativeUnit, validUnit, calculateSize2, makeEm, createClass, initNode, toNode, toMarkup, Span, Anchor, Img, iCombinations, SymbolNode, SvgNode, PathNode, LineNode, ATOMS, NON_ATOMS, symbols, math, text, main, ams, accent, bin, close, inner, mathord, op, open, punct, rel, spacing, textord, ligatures, mathTextSymbols, ch, i2, textSymbols, _ch, _i, letters, _ch2, _i2, wideChar, _ch3, _i3, _ch4, _i4, extraLatin, _ch5, _i5, wideLatinLetterData, wideNumeralData, wideCharacterFont, lookupSymbol, makeSymbol, mathsym, boldsymbol, makeOrd, canCombine, tryCombineChars, sizeElementFromChildren, makeSpan$2, makeSvgSpan, makeLineSpan, makeAnchor, makeFragment, wrapFragment, getVListChildrenAndDepth, makeVList, makeGlue, retrieveTextFontName, fontMap, svgData, staticSvg, buildCommon, thinspace, mediumspace, thickspace, spacings, tightSpacings, _functions, _htmlGroupBuilders, _mathmlGroupBuilders, normalizeArgument, ordargument, makeSpan$1, binLeftCanceller, binRightCanceller, styleMap$1, DomEnum, buildExpression$1, traverseNonSpaceNodes, checkPartialGroup, getOutermostNode, getTypeOfDomTree, makeNullDelimiter, buildGroup$1, MathNode, TextNode, SpaceNode, mathMLTree, makeText, makeRow, getVariant, buildExpression2, buildExpressionRow, buildGroup2, optionsFromSettings, displayWrap, buildTree, buildHTMLTree, stretchyCodePoint, mathMLnode, katexImagesData, groupLength, svgSpan, encloseSpan, stretchy, htmlBuilder$a, mathmlBuilder$9, NON_STRETCHY_ACCENT_REGEX, paddedNode, makeSpan2, binrelClass, cdArrowFunctionName, newCell, isStartOfArrow, isLabelEnd, htmlBuilder$8, mathmlBuilder$7, globalMap, checkControlSequence, getRHS, letCommand, getMetrics, styleWrap, centerSpan, makeSmallDelim, mathrmSize, makeLargeDelim, makeGlyphSpan, makeInner, lapInEms, lap, verts, doubleVerts, makeStackedDelim, vbPad, emPad, sqrtSvg, makeSqrtImage, stackLargeDelimiters, stackAlwaysDelimiters, stackNeverDelimiters, sizeToMaxHeight, makeSizedDelim, stackNeverDelimiterSequence, stackAlwaysDelimiterSequence, stackLargeDelimiterSequence, delimTypeToFont, traverseSequence, makeCustomSizedDelim, makeLeftRightDelim, delimiter, delimiterSizes, delimiters, htmlBuilder$7, mathmlBuilder$6, _environments, _macros, validateAmsEnvironmentContext, htmlBuilder$6, alignMap, mathmlBuilder$5, alignedHandler, environments, htmlBuilder$5, mathmlBuilder$4, fontAliases, adjustStyle, htmlBuilder$4, mathmlBuilder$3, stylArray, delimFromValue, htmlBuilder$3, mathmlBuilder$2, sizeData, chooseMathStyle, assembleSupSub, noSuccessor, htmlBuilder$2, mathmlBuilder$1, singleCharBigOps, singleCharIntegrals, htmlBuilder$1, mathmlBuilder2, sizeFuncs, htmlBuilder2, styleMap, htmlBuilderDelegate, defaultVariant, cssSpace, regularSpace, pad, textFontFamilies, textFontWeights, textFontShapes, optionsWithFont, makeVerb, functions, spaceRegexString, controlWordRegexString, controlSymbolRegexString, controlWordWhitespaceRegexString, controlSpaceRegexString, combiningDiacriticalMarkString, combiningDiacriticalMarksEndRegex, tokenRegexString, Lexer, Namespace, macros, digitToNumber, newcommand, dotsByToken, spaceAfterDots, latexRaiseA, braketHelper, implicitCommands, MacroExpander, unicodeSubRegEx, uSubsAndSups, unicodeAccents, unicodeSymbols, Parser, parseTree, render, renderToString, generateParseTree, renderError, renderToDomTree, renderToHTMLTree, katex;
+ var SourceLocation, Token, ParseError, contains, deflt, uppercase, hyphenate, ESCAPE_LOOKUP, ESCAPE_REGEX, getBaseElem, isCharacterBox, assert, protocolFromUrl, utils, SETTINGS_SCHEMA, Settings, Style, D, Dc, T, Tc, S, Sc, SS, SSc, styles, sup, sub, fracNum, fracDen, cramp, text$1, Style$1, scriptData, allBlocks, hLinePad, sqrtMain, sqrtSize1, sqrtSize2, sqrtSize3, sqrtSize4, phasePath, sqrtTall, sqrtPath, innerPath, path, tallDelim, DocumentFragment, fontMetricsData, sigmasAndXis, extraCharacterMap, fontMetricsBySizeIndex, sizeStyleMap, sizeMultipliers, sizeAtStyle, Options, ptPerUnit, relativeUnit, validUnit, calculateSize2, makeEm, createClass, initNode, toNode, toMarkup, Span, Anchor, Img, iCombinations, SymbolNode, SvgNode, PathNode, LineNode, ATOMS, NON_ATOMS, symbols, math, text2, main, ams, accent, bin, close, inner, mathord, op, open, punct, rel, spacing, textord, ligatures, mathTextSymbols, ch, i2, textSymbols, _ch, _i, letters, _ch2, _i2, wideChar, _ch3, _i3, _ch4, _i4, extraLatin, _ch5, _i5, wideLatinLetterData, wideNumeralData, wideCharacterFont, lookupSymbol, makeSymbol, mathsym, boldsymbol, makeOrd, canCombine, tryCombineChars, sizeElementFromChildren, makeSpan$2, makeSvgSpan, makeLineSpan, makeAnchor, makeFragment, wrapFragment, getVListChildrenAndDepth, makeVList, makeGlue, retrieveTextFontName, fontMap, svgData, staticSvg, buildCommon, thinspace, mediumspace, thickspace, spacings, tightSpacings, _functions, _htmlGroupBuilders, _mathmlGroupBuilders, normalizeArgument, ordargument, makeSpan$1, binLeftCanceller, binRightCanceller, styleMap$1, DomEnum, buildExpression$1, traverseNonSpaceNodes, checkPartialGroup, getOutermostNode, getTypeOfDomTree, makeNullDelimiter, buildGroup$1, MathNode, TextNode, SpaceNode, mathMLTree, makeText, makeRow, getVariant, buildExpression2, buildExpressionRow, buildGroup2, optionsFromSettings, displayWrap, buildTree, buildHTMLTree, stretchyCodePoint, mathMLnode, katexImagesData, groupLength, svgSpan, encloseSpan, stretchy, htmlBuilder$a, mathmlBuilder$9, NON_STRETCHY_ACCENT_REGEX, paddedNode, makeSpan2, binrelClass, cdArrowFunctionName, newCell, isStartOfArrow, isLabelEnd, htmlBuilder$8, mathmlBuilder$7, globalMap, checkControlSequence, getRHS, letCommand, getMetrics, styleWrap, centerSpan, makeSmallDelim, mathrmSize, makeLargeDelim, makeGlyphSpan, makeInner, lapInEms, lap, verts, doubleVerts, makeStackedDelim, vbPad, emPad, sqrtSvg, makeSqrtImage, stackLargeDelimiters, stackAlwaysDelimiters, stackNeverDelimiters, sizeToMaxHeight, makeSizedDelim, stackNeverDelimiterSequence, stackAlwaysDelimiterSequence, stackLargeDelimiterSequence, delimTypeToFont, traverseSequence, makeCustomSizedDelim, makeLeftRightDelim, delimiter, delimiterSizes, delimiters, htmlBuilder$7, mathmlBuilder$6, _environments, _macros, validateAmsEnvironmentContext, htmlBuilder$6, alignMap, mathmlBuilder$5, alignedHandler, environments, htmlBuilder$5, mathmlBuilder$4, fontAliases, adjustStyle, htmlBuilder$4, mathmlBuilder$3, stylArray, delimFromValue, htmlBuilder$3, mathmlBuilder$2, sizeData, chooseMathStyle, assembleSupSub, noSuccessor, htmlBuilder$2, mathmlBuilder$1, singleCharBigOps, singleCharIntegrals, htmlBuilder$1, mathmlBuilder2, sizeFuncs, htmlBuilder2, styleMap, htmlBuilderDelegate, defaultVariant, cssSpace, regularSpace, pad, textFontFamilies, textFontWeights, textFontShapes, optionsWithFont, makeVerb, functions, spaceRegexString, controlWordRegexString, controlSymbolRegexString, controlWordWhitespaceRegexString, controlSpaceRegexString, combiningDiacriticalMarkString, combiningDiacriticalMarksEndRegex, tokenRegexString, Lexer, Namespace, macros, digitToNumber, newcommand, dotsByToken, spaceAfterDots, latexRaiseA, braketHelper, implicitCommands, MacroExpander, unicodeSubRegEx, uSubsAndSups, unicodeAccents, unicodeSymbols, Parser, parseTree, render, renderToString, generateParseTree, renderError, renderToDomTree, renderToHTMLTree, katex;
var init_katex = __esm({
"../../node_modules/.pnpm/katex@0.16.11/node_modules/katex/dist/katex.mjs"() {
"use strict";
@@ -7716,20 +7833,20 @@ var __esbuild_esm_mermaid = (() => {
}
// don't expand the token
// used in \noexpand
- constructor(text2, loc) {
+ constructor(text4, loc) {
this.text = void 0;
this.loc = void 0;
this.noexpand = void 0;
this.treatAsRelax = void 0;
- this.text = text2;
+ this.text = text4;
this.loc = loc;
}
/**
* Given a pair of tokens (this and endToken), compute a `Token` encompassing
* the whole input range enclosed by these two.
*/
- range(endToken, text2) {
- return new _Token(text2, SourceLocation.range(this, endToken));
+ range(endToken, text4) {
+ return new _Token(text4, SourceLocation.range(this, endToken));
}
};
ParseError = class _ParseError {
@@ -8044,11 +8161,11 @@ var __esbuild_esm_mermaid = (() => {
static {
__name(this, "Style");
}
- constructor(id27, size5, cramped) {
+ constructor(id29, size5, cramped) {
this.id = void 0;
this.size = void 0;
this.cramped = void 0;
- this.id = id27;
+ this.id = id29;
this.size = size5;
this.cramped = cramped;
}
@@ -10696,7 +10813,7 @@ var __esbuild_esm_mermaid = (() => {
/**
* The base size index.
*/
- constructor(data5) {
+ constructor(data6) {
this.style = void 0;
this.color = void 0;
this.size = void 0;
@@ -10710,18 +10827,18 @@ var __esbuild_esm_mermaid = (() => {
this.maxSize = void 0;
this.minRuleThickness = void 0;
this._fontMetrics = void 0;
- this.style = data5.style;
- this.color = data5.color;
- this.size = data5.size || _Options.BASESIZE;
- this.textSize = data5.textSize || this.size;
- this.phantom = !!data5.phantom;
- this.font = data5.font || "";
- this.fontFamily = data5.fontFamily || "";
- this.fontWeight = data5.fontWeight || "";
- this.fontShape = data5.fontShape || "";
+ this.style = data6.style;
+ this.color = data6.color;
+ this.size = data6.size || _Options.BASESIZE;
+ this.textSize = data6.textSize || this.size;
+ this.phantom = !!data6.phantom;
+ this.font = data6.font || "";
+ this.fontFamily = data6.fontFamily || "";
+ this.fontWeight = data6.fontWeight || "";
+ this.fontShape = data6.fontShape || "";
this.sizeMultiplier = sizeMultipliers[this.size - 1];
- this.maxSize = data5.maxSize;
- this.minRuleThickness = data5.minRuleThickness;
+ this.maxSize = data6.maxSize;
+ this.minRuleThickness = data6.minRuleThickness;
this._fontMetrics = void 0;
}
/**
@@ -10729,7 +10846,7 @@ var __esbuild_esm_mermaid = (() => {
* from "extension" will be copied to the new options object.
*/
extend(extension5) {
- var data5 = {
+ var data6 = {
style: this.style,
size: this.size,
textSize: this.textSize,
@@ -10744,10 +10861,10 @@ var __esbuild_esm_mermaid = (() => {
};
for (var key in extension5) {
if (extension5.hasOwnProperty(key)) {
- data5[key] = extension5[key];
+ data6[key] = extension5[key];
}
}
- return new _Options(data5);
+ return new _Options(data6);
}
/**
* Return an options object with the given style. If `this.style === style`,
@@ -10961,11 +11078,11 @@ var __esbuild_esm_mermaid = (() => {
return unit2 in ptPerUnit || unit2 in relativeUnit || unit2 === "ex";
}, "validUnit");
calculateSize2 = /* @__PURE__ */ __name(function calculateSize3(sizeValue, options3) {
- var scale;
+ var scale2;
if (sizeValue.unit in ptPerUnit) {
- scale = ptPerUnit[sizeValue.unit] / options3.fontMetrics().ptPerEm / options3.sizeMultiplier;
+ scale2 = ptPerUnit[sizeValue.unit] / options3.fontMetrics().ptPerEm / options3.sizeMultiplier;
} else if (sizeValue.unit === "mu") {
- scale = options3.fontMetrics().cssEmPerMu;
+ scale2 = options3.fontMetrics().cssEmPerMu;
} else {
var unitOptions;
if (options3.style.isTight()) {
@@ -10974,26 +11091,26 @@ var __esbuild_esm_mermaid = (() => {
unitOptions = options3;
}
if (sizeValue.unit === "ex") {
- scale = unitOptions.fontMetrics().xHeight;
+ scale2 = unitOptions.fontMetrics().xHeight;
} else if (sizeValue.unit === "em") {
- scale = unitOptions.fontMetrics().quad;
+ scale2 = unitOptions.fontMetrics().quad;
} else {
throw new ParseError("Invalid unit: '" + sizeValue.unit + "'");
}
if (unitOptions !== options3) {
- scale *= unitOptions.sizeMultiplier / options3.sizeMultiplier;
+ scale2 *= unitOptions.sizeMultiplier / options3.sizeMultiplier;
}
}
- return Math.min(sizeValue.number * scale, options3.maxSize);
+ return Math.min(sizeValue.number * scale2, options3.maxSize);
}, "calculateSize");
makeEm = /* @__PURE__ */ __name(function makeEm2(n2) {
return +n2.toFixed(4) + "em";
}, "makeEm");
- createClass = /* @__PURE__ */ __name(function createClass2(classes6) {
- return classes6.filter((cls) => cls).join(" ");
+ createClass = /* @__PURE__ */ __name(function createClass2(classes3) {
+ return classes3.filter((cls) => cls).join(" ");
}, "createClass");
- initNode = /* @__PURE__ */ __name(function initNode2(classes6, options3, style3) {
- this.classes = classes6 || [];
+ initNode = /* @__PURE__ */ __name(function initNode2(classes3, options3, style3) {
+ this.classes = classes3 || [];
this.attributes = {};
this.height = 0;
this.depth = 0;
@@ -11032,14 +11149,14 @@ var __esbuild_esm_mermaid = (() => {
if (this.classes.length) {
markup += ' class="' + utils.escape(createClass(this.classes)) + '"';
}
- var styles3 = "";
+ var styles4 = "";
for (var style3 in this.style) {
if (this.style.hasOwnProperty(style3)) {
- styles3 += utils.hyphenate(style3) + ":" + this.style[style3] + ";";
+ styles4 += utils.hyphenate(style3) + ":" + this.style[style3] + ";";
}
}
- if (styles3) {
- markup += ' style="' + utils.escape(styles3) + '"';
+ if (styles4) {
+ markup += ' style="' + utils.escape(styles4) + '"';
}
for (var attr in this.attributes) {
if (this.attributes.hasOwnProperty(attr)) {
@@ -11057,7 +11174,7 @@ var __esbuild_esm_mermaid = (() => {
static {
__name(this, "Span");
}
- constructor(classes6, children2, options3, style3) {
+ constructor(classes3, children2, options3, style3) {
this.children = void 0;
this.attributes = void 0;
this.classes = void 0;
@@ -11066,7 +11183,7 @@ var __esbuild_esm_mermaid = (() => {
this.width = void 0;
this.maxFontSize = void 0;
this.style = void 0;
- initNode.call(this, classes6, options3, style3);
+ initNode.call(this, classes3, options3, style3);
this.children = children2 || [];
}
/**
@@ -11091,7 +11208,7 @@ var __esbuild_esm_mermaid = (() => {
static {
__name(this, "Anchor");
}
- constructor(href, classes6, children2, options3) {
+ constructor(href, classes3, children2, options3) {
this.children = void 0;
this.attributes = void 0;
this.classes = void 0;
@@ -11099,7 +11216,7 @@ var __esbuild_esm_mermaid = (() => {
this.depth = void 0;
this.maxFontSize = void 0;
this.style = void 0;
- initNode.call(this, classes6, options3);
+ initNode.call(this, classes3, options3);
this.children = children2 || [];
this.setAttribute("href", href);
}
@@ -11150,14 +11267,14 @@ var __esbuild_esm_mermaid = (() => {
}
toMarkup() {
var markup = ' ";
return markup;
@@ -11174,7 +11291,7 @@ var __esbuild_esm_mermaid = (() => {
static {
__name(this, "SymbolNode");
}
- constructor(text2, height2, depth, italic, skew, width3, classes6, style3) {
+ constructor(text4, height2, depth, italic, skew, width3, classes3, style3) {
this.text = void 0;
this.height = void 0;
this.depth = void 0;
@@ -11184,13 +11301,13 @@ var __esbuild_esm_mermaid = (() => {
this.maxFontSize = void 0;
this.classes = void 0;
this.style = void 0;
- this.text = text2;
+ this.text = text4;
this.height = height2 || 0;
this.depth = depth || 0;
this.italic = italic || 0;
this.skew = skew || 0;
this.width = width3 || 0;
- this.classes = classes6 || [];
+ this.classes = classes3 || [];
this.style = style3 || {};
this.maxFontSize = 0;
var script = scriptFromCodepoint(this.text.charCodeAt(0));
@@ -11244,18 +11361,18 @@ var __esbuild_esm_mermaid = (() => {
markup += utils.escape(createClass(this.classes));
markup += '"';
}
- var styles3 = "";
+ var styles4 = "";
if (this.italic > 0) {
- styles3 += "margin-right:" + this.italic + "em;";
+ styles4 += "margin-right:" + this.italic + "em;";
}
for (var style3 in this.style) {
if (this.style.hasOwnProperty(style3)) {
- styles3 += utils.hyphenate(style3) + ":" + this.style[style3] + ";";
+ styles4 += utils.hyphenate(style3) + ":" + this.style[style3] + ";";
}
}
- if (styles3) {
+ if (styles4) {
needsSpan = true;
- markup += ' style="' + utils.escape(styles3) + '"';
+ markup += ' style="' + utils.escape(styles4) + '"';
}
var escaped = utils.escape(this.text);
if (needsSpan) {
@@ -11386,7 +11503,7 @@ var __esbuild_esm_mermaid = (() => {
};
__name(defineSymbol, "defineSymbol");
math = "math";
- text = "text";
+ text2 = "text";
main = "main";
ams = "ams";
accent = "accent-token";
@@ -11427,9 +11544,9 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, main, punct, ".", "\\ldotp");
defineSymbol(math, main, punct, "\u22C5", "\\cdotp");
defineSymbol(math, main, textord, "#", "\\#");
- defineSymbol(text, main, textord, "#", "\\#");
+ defineSymbol(text2, main, textord, "#", "\\#");
defineSymbol(math, main, textord, "&", "\\&");
- defineSymbol(text, main, textord, "&", "\\&");
+ defineSymbol(text2, main, textord, "&", "\\&");
defineSymbol(math, main, textord, "\u2135", "\\aleph", true);
defineSymbol(math, main, textord, "\u2200", "\\forall", true);
defineSymbol(math, main, textord, "\u210F", "\\hbar", true);
@@ -11447,15 +11564,15 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, main, textord, "\u2111", "\\Im", true);
defineSymbol(math, main, textord, "\u2660", "\\spadesuit", true);
defineSymbol(math, main, textord, "\xA7", "\\S", true);
- defineSymbol(text, main, textord, "\xA7", "\\S");
+ defineSymbol(text2, main, textord, "\xA7", "\\S");
defineSymbol(math, main, textord, "\xB6", "\\P", true);
- defineSymbol(text, main, textord, "\xB6", "\\P");
+ defineSymbol(text2, main, textord, "\xB6", "\\P");
defineSymbol(math, main, textord, "\u2020", "\\dag");
- defineSymbol(text, main, textord, "\u2020", "\\dag");
- defineSymbol(text, main, textord, "\u2020", "\\textdagger");
+ defineSymbol(text2, main, textord, "\u2020", "\\dag");
+ defineSymbol(text2, main, textord, "\u2020", "\\textdagger");
defineSymbol(math, main, textord, "\u2021", "\\ddag");
- defineSymbol(text, main, textord, "\u2021", "\\ddag");
- defineSymbol(text, main, textord, "\u2021", "\\textdaggerdbl");
+ defineSymbol(text2, main, textord, "\u2021", "\\ddag");
+ defineSymbol(text2, main, textord, "\u2021", "\\textdaggerdbl");
defineSymbol(math, main, close, "\u23B1", "\\rmoustache", true);
defineSymbol(math, main, open, "\u23B0", "\\lmoustache", true);
defineSymbol(math, main, close, "\u27EF", "\\rgroup", true);
@@ -11559,7 +11676,7 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, ams, textord, "\u25CA", "\\lozenge");
defineSymbol(math, ams, textord, "\u24C8", "\\circledS");
defineSymbol(math, ams, textord, "\xAE", "\\circledR");
- defineSymbol(text, ams, textord, "\xAE", "\\circledR");
+ defineSymbol(text2, ams, textord, "\xAE", "\\circledR");
defineSymbol(math, ams, textord, "\u2221", "\\measuredangle", true);
defineSymbol(math, ams, textord, "\u2204", "\\nexists");
defineSymbol(math, ams, textord, "\u2127", "\\mho");
@@ -11574,16 +11691,16 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle", true);
defineSymbol(math, ams, textord, "\u2201", "\\complement", true);
defineSymbol(math, ams, textord, "\xF0", "\\eth", true);
- defineSymbol(text, main, textord, "\xF0", "\xF0");
+ defineSymbol(text2, main, textord, "\xF0", "\xF0");
defineSymbol(math, ams, textord, "\u2571", "\\diagup");
defineSymbol(math, ams, textord, "\u2572", "\\diagdown");
defineSymbol(math, ams, textord, "\u25A1", "\\square");
defineSymbol(math, ams, textord, "\u25A1", "\\Box");
defineSymbol(math, ams, textord, "\u25CA", "\\Diamond");
defineSymbol(math, ams, textord, "\xA5", "\\yen", true);
- defineSymbol(text, ams, textord, "\xA5", "\\yen", true);
+ defineSymbol(text2, ams, textord, "\xA5", "\\yen", true);
defineSymbol(math, ams, textord, "\u2713", "\\checkmark", true);
- defineSymbol(text, ams, textord, "\u2713", "\\checkmark");
+ defineSymbol(text2, ams, textord, "\u2713", "\\checkmark");
defineSymbol(math, ams, textord, "\u2136", "\\beth", true);
defineSymbol(math, ams, textord, "\u2138", "\\daleth", true);
defineSymbol(math, ams, textord, "\u2137", "\\gimel", true);
@@ -11723,13 +11840,13 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, ams, rel, "\u21BE", "\\restriction");
defineSymbol(math, main, textord, "\u2018", "`");
defineSymbol(math, main, textord, "$", "\\$");
- defineSymbol(text, main, textord, "$", "\\$");
- defineSymbol(text, main, textord, "$", "\\textdollar");
+ defineSymbol(text2, main, textord, "$", "\\$");
+ defineSymbol(text2, main, textord, "$", "\\textdollar");
defineSymbol(math, main, textord, "%", "\\%");
- defineSymbol(text, main, textord, "%", "\\%");
+ defineSymbol(text2, main, textord, "%", "\\%");
defineSymbol(math, main, textord, "_", "\\_");
- defineSymbol(text, main, textord, "_", "\\_");
- defineSymbol(text, main, textord, "_", "\\textunderscore");
+ defineSymbol(text2, main, textord, "_", "\\_");
+ defineSymbol(text2, main, textord, "_", "\\textunderscore");
defineSymbol(math, main, textord, "\u2220", "\\angle", true);
defineSymbol(math, main, textord, "\u221E", "\\infty", true);
defineSymbol(math, main, textord, "\u2032", "\\prime");
@@ -11846,10 +11963,10 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, main, spacing, "\xA0", "\\ ");
defineSymbol(math, main, spacing, "\xA0", "\\space");
defineSymbol(math, main, spacing, "\xA0", "\\nobreakspace");
- defineSymbol(text, main, spacing, "\xA0", "\\ ");
- defineSymbol(text, main, spacing, "\xA0", " ");
- defineSymbol(text, main, spacing, "\xA0", "\\space");
- defineSymbol(text, main, spacing, "\xA0", "\\nobreakspace");
+ defineSymbol(text2, main, spacing, "\xA0", "\\ ");
+ defineSymbol(text2, main, spacing, "\xA0", " ");
+ defineSymbol(text2, main, spacing, "\xA0", "\\space");
+ defineSymbol(text2, main, spacing, "\xA0", "\\nobreakspace");
defineSymbol(math, main, spacing, null, "\\nobreak");
defineSymbol(math, main, spacing, null, "\\allowbreak");
defineSymbol(math, main, punct, ",", ",");
@@ -11871,21 +11988,21 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, main, bin, "\u25C3", "\\triangleleft");
defineSymbol(math, main, bin, "\u25B9", "\\triangleright");
defineSymbol(math, main, open, "{", "\\{");
- defineSymbol(text, main, textord, "{", "\\{");
- defineSymbol(text, main, textord, "{", "\\textbraceleft");
+ defineSymbol(text2, main, textord, "{", "\\{");
+ defineSymbol(text2, main, textord, "{", "\\textbraceleft");
defineSymbol(math, main, close, "}", "\\}");
- defineSymbol(text, main, textord, "}", "\\}");
- defineSymbol(text, main, textord, "}", "\\textbraceright");
+ defineSymbol(text2, main, textord, "}", "\\}");
+ defineSymbol(text2, main, textord, "}", "\\textbraceright");
defineSymbol(math, main, open, "{", "\\lbrace");
defineSymbol(math, main, close, "}", "\\rbrace");
defineSymbol(math, main, open, "[", "\\lbrack", true);
- defineSymbol(text, main, textord, "[", "\\lbrack", true);
+ defineSymbol(text2, main, textord, "[", "\\lbrack", true);
defineSymbol(math, main, close, "]", "\\rbrack", true);
- defineSymbol(text, main, textord, "]", "\\rbrack", true);
+ defineSymbol(text2, main, textord, "]", "\\rbrack", true);
defineSymbol(math, main, open, "(", "\\lparen", true);
defineSymbol(math, main, close, ")", "\\rparen", true);
- defineSymbol(text, main, textord, "<", "\\textless", true);
- defineSymbol(text, main, textord, ">", "\\textgreater", true);
+ defineSymbol(text2, main, textord, "<", "\\textless", true);
+ defineSymbol(text2, main, textord, ">", "\\textgreater", true);
defineSymbol(math, main, open, "\u230A", "\\lfloor", true);
defineSymbol(math, main, close, "\u230B", "\\rfloor", true);
defineSymbol(math, main, open, "\u2308", "\\lceil", true);
@@ -11893,13 +12010,13 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, main, textord, "\\", "\\backslash");
defineSymbol(math, main, textord, "\u2223", "|");
defineSymbol(math, main, textord, "\u2223", "\\vert");
- defineSymbol(text, main, textord, "|", "\\textbar", true);
+ defineSymbol(text2, main, textord, "|", "\\textbar", true);
defineSymbol(math, main, textord, "\u2225", "\\|");
defineSymbol(math, main, textord, "\u2225", "\\Vert");
- defineSymbol(text, main, textord, "\u2225", "\\textbardbl");
- defineSymbol(text, main, textord, "~", "\\textasciitilde");
- defineSymbol(text, main, textord, "\\", "\\textbackslash");
- defineSymbol(text, main, textord, "^", "\\textasciicircum");
+ defineSymbol(text2, main, textord, "\u2225", "\\textbardbl");
+ defineSymbol(text2, main, textord, "~", "\\textasciitilde");
+ defineSymbol(text2, main, textord, "\\", "\\textbackslash");
+ defineSymbol(text2, main, textord, "^", "\\textasciicircum");
defineSymbol(math, main, rel, "\u2191", "\\uparrow", true);
defineSymbol(math, main, rel, "\u21D1", "\\Uparrow", true);
defineSymbol(math, main, rel, "\u2193", "\\downarrow", true);
@@ -11926,9 +12043,9 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, main, op, "\u2230", "\\oiiint");
defineSymbol(math, main, op, "\u2A06", "\\bigsqcup");
defineSymbol(math, main, op, "\u222B", "\\smallint");
- defineSymbol(text, main, inner, "\u2026", "\\textellipsis");
+ defineSymbol(text2, main, inner, "\u2026", "\\textellipsis");
defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");
- defineSymbol(text, main, inner, "\u2026", "\\ldots", true);
+ defineSymbol(text2, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u22EF", "\\@cdots", true);
defineSymbol(math, main, inner, "\u22F1", "\\ddots", true);
@@ -11948,55 +12065,55 @@ var __esbuild_esm_mermaid = (() => {
defineSymbol(math, main, mathord, "\uE237", "\\@jmath");
defineSymbol(math, main, textord, "\u0131", "\u0131");
defineSymbol(math, main, textord, "\u0237", "\u0237");
- defineSymbol(text, main, textord, "\u0131", "\\i", true);
- defineSymbol(text, main, textord, "\u0237", "\\j", true);
- defineSymbol(text, main, textord, "\xDF", "\\ss", true);
- defineSymbol(text, main, textord, "\xE6", "\\ae", true);
- defineSymbol(text, main, textord, "\u0153", "\\oe", true);
- defineSymbol(text, main, textord, "\xF8", "\\o", true);
- defineSymbol(text, main, textord, "\xC6", "\\AE", true);
- defineSymbol(text, main, textord, "\u0152", "\\OE", true);
- defineSymbol(text, main, textord, "\xD8", "\\O", true);
- defineSymbol(text, main, accent, "\u02CA", "\\'");
- defineSymbol(text, main, accent, "\u02CB", "\\`");
- defineSymbol(text, main, accent, "\u02C6", "\\^");
- defineSymbol(text, main, accent, "\u02DC", "\\~");
- defineSymbol(text, main, accent, "\u02C9", "\\=");
- defineSymbol(text, main, accent, "\u02D8", "\\u");
- defineSymbol(text, main, accent, "\u02D9", "\\.");
- defineSymbol(text, main, accent, "\xB8", "\\c");
- defineSymbol(text, main, accent, "\u02DA", "\\r");
- defineSymbol(text, main, accent, "\u02C7", "\\v");
- defineSymbol(text, main, accent, "\xA8", '\\"');
- defineSymbol(text, main, accent, "\u02DD", "\\H");
- defineSymbol(text, main, accent, "\u25EF", "\\textcircled");
+ defineSymbol(text2, main, textord, "\u0131", "\\i", true);
+ defineSymbol(text2, main, textord, "\u0237", "\\j", true);
+ defineSymbol(text2, main, textord, "\xDF", "\\ss", true);
+ defineSymbol(text2, main, textord, "\xE6", "\\ae", true);
+ defineSymbol(text2, main, textord, "\u0153", "\\oe", true);
+ defineSymbol(text2, main, textord, "\xF8", "\\o", true);
+ defineSymbol(text2, main, textord, "\xC6", "\\AE", true);
+ defineSymbol(text2, main, textord, "\u0152", "\\OE", true);
+ defineSymbol(text2, main, textord, "\xD8", "\\O", true);
+ defineSymbol(text2, main, accent, "\u02CA", "\\'");
+ defineSymbol(text2, main, accent, "\u02CB", "\\`");
+ defineSymbol(text2, main, accent, "\u02C6", "\\^");
+ defineSymbol(text2, main, accent, "\u02DC", "\\~");
+ defineSymbol(text2, main, accent, "\u02C9", "\\=");
+ defineSymbol(text2, main, accent, "\u02D8", "\\u");
+ defineSymbol(text2, main, accent, "\u02D9", "\\.");
+ defineSymbol(text2, main, accent, "\xB8", "\\c");
+ defineSymbol(text2, main, accent, "\u02DA", "\\r");
+ defineSymbol(text2, main, accent, "\u02C7", "\\v");
+ defineSymbol(text2, main, accent, "\xA8", '\\"');
+ defineSymbol(text2, main, accent, "\u02DD", "\\H");
+ defineSymbol(text2, main, accent, "\u25EF", "\\textcircled");
ligatures = {
"--": true,
"---": true,
"``": true,
"''": true
};
- defineSymbol(text, main, textord, "\u2013", "--", true);
- defineSymbol(text, main, textord, "\u2013", "\\textendash");
- defineSymbol(text, main, textord, "\u2014", "---", true);
- defineSymbol(text, main, textord, "\u2014", "\\textemdash");
- defineSymbol(text, main, textord, "\u2018", "`", true);
- defineSymbol(text, main, textord, "\u2018", "\\textquoteleft");
- defineSymbol(text, main, textord, "\u2019", "'", true);
- defineSymbol(text, main, textord, "\u2019", "\\textquoteright");
- defineSymbol(text, main, textord, "\u201C", "``", true);
- defineSymbol(text, main, textord, "\u201C", "\\textquotedblleft");
- defineSymbol(text, main, textord, "\u201D", "''", true);
- defineSymbol(text, main, textord, "\u201D", "\\textquotedblright");
+ defineSymbol(text2, main, textord, "\u2013", "--", true);
+ defineSymbol(text2, main, textord, "\u2013", "\\textendash");
+ defineSymbol(text2, main, textord, "\u2014", "---", true);
+ defineSymbol(text2, main, textord, "\u2014", "\\textemdash");
+ defineSymbol(text2, main, textord, "\u2018", "`", true);
+ defineSymbol(text2, main, textord, "\u2018", "\\textquoteleft");
+ defineSymbol(text2, main, textord, "\u2019", "'", true);
+ defineSymbol(text2, main, textord, "\u2019", "\\textquoteright");
+ defineSymbol(text2, main, textord, "\u201C", "``", true);
+ defineSymbol(text2, main, textord, "\u201C", "\\textquotedblleft");
+ defineSymbol(text2, main, textord, "\u201D", "''", true);
+ defineSymbol(text2, main, textord, "\u201D", "\\textquotedblright");
defineSymbol(math, main, textord, "\xB0", "\\degree", true);
- defineSymbol(text, main, textord, "\xB0", "\\degree");
- defineSymbol(text, main, textord, "\xB0", "\\textdegree", true);
+ defineSymbol(text2, main, textord, "\xB0", "\\degree");
+ defineSymbol(text2, main, textord, "\xB0", "\\textdegree", true);
defineSymbol(math, main, textord, "\xA3", "\\pounds");
defineSymbol(math, main, textord, "\xA3", "\\mathsterling", true);
- defineSymbol(text, main, textord, "\xA3", "\\pounds");
- defineSymbol(text, main, textord, "\xA3", "\\textsterling", true);
+ defineSymbol(text2, main, textord, "\xA3", "\\pounds");
+ defineSymbol(text2, main, textord, "\xA3", "\\textsterling", true);
defineSymbol(math, ams, textord, "\u2720", "\\maltese");
- defineSymbol(text, ams, textord, "\u2720", "\\maltese");
+ defineSymbol(text2, ams, textord, "\u2720", "\\maltese");
mathTextSymbols = '0123456789/@."';
for (i2 = 0; i2 < mathTextSymbols.length; i2++) {
ch = mathTextSymbols.charAt(i2);
@@ -12005,92 +12122,92 @@ var __esbuild_esm_mermaid = (() => {
textSymbols = '0123456789!@*()-=+";:?/.,';
for (_i = 0; _i < textSymbols.length; _i++) {
_ch = textSymbols.charAt(_i);
- defineSymbol(text, main, textord, _ch, _ch);
+ defineSymbol(text2, main, textord, _ch, _ch);
}
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (_i2 = 0; _i2 < letters.length; _i2++) {
_ch2 = letters.charAt(_i2);
defineSymbol(math, main, mathord, _ch2, _ch2);
- defineSymbol(text, main, textord, _ch2, _ch2);
+ defineSymbol(text2, main, textord, _ch2, _ch2);
}
defineSymbol(math, ams, textord, "C", "\u2102");
- defineSymbol(text, ams, textord, "C", "\u2102");
+ defineSymbol(text2, ams, textord, "C", "\u2102");
defineSymbol(math, ams, textord, "H", "\u210D");
- defineSymbol(text, ams, textord, "H", "\u210D");
+ defineSymbol(text2, ams, textord, "H", "\u210D");
defineSymbol(math, ams, textord, "N", "\u2115");
- defineSymbol(text, ams, textord, "N", "\u2115");
+ defineSymbol(text2, ams, textord, "N", "\u2115");
defineSymbol(math, ams, textord, "P", "\u2119");
- defineSymbol(text, ams, textord, "P", "\u2119");
+ defineSymbol(text2, ams, textord, "P", "\u2119");
defineSymbol(math, ams, textord, "Q", "\u211A");
- defineSymbol(text, ams, textord, "Q", "\u211A");
+ defineSymbol(text2, ams, textord, "Q", "\u211A");
defineSymbol(math, ams, textord, "R", "\u211D");
- defineSymbol(text, ams, textord, "R", "\u211D");
+ defineSymbol(text2, ams, textord, "R", "\u211D");
defineSymbol(math, ams, textord, "Z", "\u2124");
- defineSymbol(text, ams, textord, "Z", "\u2124");
+ defineSymbol(text2, ams, textord, "Z", "\u2124");
defineSymbol(math, main, mathord, "h", "\u210E");
- defineSymbol(text, main, mathord, "h", "\u210E");
+ defineSymbol(text2, main, mathord, "h", "\u210E");
wideChar = "";
for (_i3 = 0; _i3 < letters.length; _i3++) {
_ch3 = letters.charAt(_i3);
wideChar = String.fromCharCode(55349, 56320 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56372 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56424 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56580 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56684 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56736 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56788 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56840 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56944 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
if (_i3 < 26) {
wideChar = String.fromCharCode(55349, 56632 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56476 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
- defineSymbol(text, main, textord, _ch3, wideChar);
+ defineSymbol(text2, main, textord, _ch3, wideChar);
}
}
wideChar = String.fromCharCode(55349, 56668);
defineSymbol(math, main, mathord, "k", wideChar);
- defineSymbol(text, main, textord, "k", wideChar);
+ defineSymbol(text2, main, textord, "k", wideChar);
for (_i4 = 0; _i4 < 10; _i4++) {
_ch4 = _i4.toString();
wideChar = String.fromCharCode(55349, 57294 + _i4);
defineSymbol(math, main, mathord, _ch4, wideChar);
- defineSymbol(text, main, textord, _ch4, wideChar);
+ defineSymbol(text2, main, textord, _ch4, wideChar);
wideChar = String.fromCharCode(55349, 57314 + _i4);
defineSymbol(math, main, mathord, _ch4, wideChar);
- defineSymbol(text, main, textord, _ch4, wideChar);
+ defineSymbol(text2, main, textord, _ch4, wideChar);
wideChar = String.fromCharCode(55349, 57324 + _i4);
defineSymbol(math, main, mathord, _ch4, wideChar);
- defineSymbol(text, main, textord, _ch4, wideChar);
+ defineSymbol(text2, main, textord, _ch4, wideChar);
wideChar = String.fromCharCode(55349, 57334 + _i4);
defineSymbol(math, main, mathord, _ch4, wideChar);
- defineSymbol(text, main, textord, _ch4, wideChar);
+ defineSymbol(text2, main, textord, _ch4, wideChar);
}
extraLatin = "\xD0\xDE\xFE";
for (_i5 = 0; _i5 < extraLatin.length; _i5++) {
_ch5 = extraLatin.charAt(_i5);
defineSymbol(math, main, mathord, _ch5, _ch5);
- defineSymbol(text, main, textord, _ch5, _ch5);
+ defineSymbol(text2, main, textord, _ch5, _ch5);
}
wideLatinLetterData = [
["mathbf", "textbf", "Main-Bold"],
@@ -12189,7 +12306,7 @@ var __esbuild_esm_mermaid = (() => {
metrics: getCharacterMetrics(value2, fontName, mode)
};
}, "lookupSymbol");
- makeSymbol = /* @__PURE__ */ __name(function makeSymbol2(value2, fontName, mode, options3, classes6) {
+ makeSymbol = /* @__PURE__ */ __name(function makeSymbol2(value2, fontName, mode, options3, classes3) {
var lookup2 = lookupSymbol(value2, fontName, mode);
var metrics = lookup2.metrics;
value2 = lookup2.value;
@@ -12199,10 +12316,10 @@ var __esbuild_esm_mermaid = (() => {
if (mode === "text" || options3 && options3.font === "mathit") {
italic = 0;
}
- symbolNode = new SymbolNode(value2, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes6);
+ symbolNode = new SymbolNode(value2, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes3);
} else {
typeof console !== "undefined" && console.warn("No character metrics " + ("for '" + value2 + "' in style '" + fontName + "' and mode '" + mode + "'"));
- symbolNode = new SymbolNode(value2, 0, 0, 0, 0, 0, classes6);
+ symbolNode = new SymbolNode(value2, 0, 0, 0, 0, 0, classes3);
}
if (options3) {
symbolNode.maxFontSize = options3.sizeMultiplier;
@@ -12216,19 +12333,19 @@ var __esbuild_esm_mermaid = (() => {
}
return symbolNode;
}, "makeSymbol");
- mathsym = /* @__PURE__ */ __name(function mathsym2(value2, mode, options3, classes6) {
- if (classes6 === void 0) {
- classes6 = [];
+ mathsym = /* @__PURE__ */ __name(function mathsym2(value2, mode, options3, classes3) {
+ if (classes3 === void 0) {
+ classes3 = [];
}
if (options3.font === "boldsymbol" && lookupSymbol(value2, "Main-Bold", mode).metrics) {
- return makeSymbol(value2, "Main-Bold", mode, options3, classes6.concat(["mathbf"]));
+ return makeSymbol(value2, "Main-Bold", mode, options3, classes3.concat(["mathbf"]));
} else if (value2 === "\\" || symbols[mode][value2].font === "main") {
- return makeSymbol(value2, "Main-Regular", mode, options3, classes6);
+ return makeSymbol(value2, "Main-Regular", mode, options3, classes3);
} else {
- return makeSymbol(value2, "AMS-Regular", mode, options3, classes6.concat(["amsrm"]));
+ return makeSymbol(value2, "AMS-Regular", mode, options3, classes3.concat(["amsrm"]));
}
}, "mathsym");
- boldsymbol = /* @__PURE__ */ __name(function boldsymbol2(value2, mode, options3, classes6, type3) {
+ boldsymbol = /* @__PURE__ */ __name(function boldsymbol2(value2, mode, options3, classes3, type3) {
if (type3 !== "textord" && lookupSymbol(value2, "Math-BoldItalic", mode).metrics) {
return {
fontName: "Math-BoldItalic",
@@ -12243,22 +12360,22 @@ var __esbuild_esm_mermaid = (() => {
}, "boldsymbol");
makeOrd = /* @__PURE__ */ __name(function makeOrd2(group2, options3, type3) {
var mode = group2.mode;
- var text2 = group2.text;
- var classes6 = ["mord"];
+ var text4 = group2.text;
+ var classes3 = ["mord"];
var isFont = mode === "math" || mode === "text" && options3.font;
var fontOrFamily = isFont ? options3.font : options3.fontFamily;
var wideFontName = "";
var wideFontClass = "";
- if (text2.charCodeAt(0) === 55349) {
- [wideFontName, wideFontClass] = wideCharacterFont(text2, mode);
+ if (text4.charCodeAt(0) === 55349) {
+ [wideFontName, wideFontClass] = wideCharacterFont(text4, mode);
}
if (wideFontName.length > 0) {
- return makeSymbol(text2, wideFontName, mode, options3, classes6.concat(wideFontClass));
+ return makeSymbol(text4, wideFontName, mode, options3, classes3.concat(wideFontClass));
} else if (fontOrFamily) {
var fontName;
var fontClasses;
if (fontOrFamily === "boldsymbol") {
- var fontData = boldsymbol(text2, mode, options3, classes6, type3);
+ var fontData = boldsymbol(text4, mode, options3, classes3, type3);
fontName = fontData.fontName;
fontClasses = [fontData.fontClass];
} else if (isFont) {
@@ -12268,29 +12385,29 @@ var __esbuild_esm_mermaid = (() => {
fontName = retrieveTextFontName(fontOrFamily, options3.fontWeight, options3.fontShape);
fontClasses = [fontOrFamily, options3.fontWeight, options3.fontShape];
}
- if (lookupSymbol(text2, fontName, mode).metrics) {
- return makeSymbol(text2, fontName, mode, options3, classes6.concat(fontClasses));
- } else if (ligatures.hasOwnProperty(text2) && fontName.slice(0, 10) === "Typewriter") {
+ if (lookupSymbol(text4, fontName, mode).metrics) {
+ return makeSymbol(text4, fontName, mode, options3, classes3.concat(fontClasses));
+ } else if (ligatures.hasOwnProperty(text4) && fontName.slice(0, 10) === "Typewriter") {
var parts = [];
- for (var i2 = 0; i2 < text2.length; i2++) {
- parts.push(makeSymbol(text2[i2], fontName, mode, options3, classes6.concat(fontClasses)));
+ for (var i2 = 0; i2 < text4.length; i2++) {
+ parts.push(makeSymbol(text4[i2], fontName, mode, options3, classes3.concat(fontClasses)));
}
return makeFragment(parts);
}
}
if (type3 === "mathord") {
- return makeSymbol(text2, "Math-Italic", mode, options3, classes6.concat(["mathnormal"]));
+ return makeSymbol(text4, "Math-Italic", mode, options3, classes3.concat(["mathnormal"]));
} else if (type3 === "textord") {
- var font = symbols[mode][text2] && symbols[mode][text2].font;
+ var font = symbols[mode][text4] && symbols[mode][text4].font;
if (font === "ams") {
var _fontName = retrieveTextFontName("amsrm", options3.fontWeight, options3.fontShape);
- return makeSymbol(text2, _fontName, mode, options3, classes6.concat("amsrm", options3.fontWeight, options3.fontShape));
+ return makeSymbol(text4, _fontName, mode, options3, classes3.concat("amsrm", options3.fontWeight, options3.fontShape));
} else if (font === "main" || !font) {
var _fontName2 = retrieveTextFontName("textrm", options3.fontWeight, options3.fontShape);
- return makeSymbol(text2, _fontName2, mode, options3, classes6.concat(options3.fontWeight, options3.fontShape));
+ return makeSymbol(text4, _fontName2, mode, options3, classes3.concat(options3.fontWeight, options3.fontShape));
} else {
var _fontName3 = retrieveTextFontName(font, options3.fontWeight, options3.fontShape);
- return makeSymbol(text2, _fontName3, mode, options3, classes6.concat(_fontName3, options3.fontWeight, options3.fontShape));
+ return makeSymbol(text4, _fontName3, mode, options3, classes3.concat(_fontName3, options3.fontWeight, options3.fontShape));
}
} else {
throw new Error("unexpected type: " + type3 + " in makeOrd");
@@ -12353,12 +12470,12 @@ var __esbuild_esm_mermaid = (() => {
elem.depth = depth;
elem.maxFontSize = maxFontSize;
}, "sizeElementFromChildren");
- makeSpan$2 = /* @__PURE__ */ __name(function makeSpan(classes6, children2, options3, style3) {
- var span = new Span(classes6, children2, options3, style3);
+ makeSpan$2 = /* @__PURE__ */ __name(function makeSpan(classes3, children2, options3, style3) {
+ var span = new Span(classes3, children2, options3, style3);
sizeElementFromChildren(span);
return span;
}, "makeSpan");
- makeSvgSpan = /* @__PURE__ */ __name((classes6, children2, options3, style3) => new Span(classes6, children2, options3, style3), "makeSvgSpan");
+ makeSvgSpan = /* @__PURE__ */ __name((classes3, children2, options3, style3) => new Span(classes3, children2, options3, style3), "makeSvgSpan");
makeLineSpan = /* @__PURE__ */ __name(function makeLineSpan2(className, options3, thickness) {
var line2 = makeSpan$2([className], [], options3);
line2.height = Math.max(thickness || options3.fontMetrics().defaultRuleThickness, options3.minRuleThickness);
@@ -12366,10 +12483,10 @@ var __esbuild_esm_mermaid = (() => {
line2.maxFontSize = 1;
return line2;
}, "makeLineSpan");
- makeAnchor = /* @__PURE__ */ __name(function makeAnchor2(href, classes6, children2, options3) {
- var anchor = new Anchor(href, classes6, children2, options3);
- sizeElementFromChildren(anchor);
- return anchor;
+ makeAnchor = /* @__PURE__ */ __name(function makeAnchor2(href, classes3, children2, options3) {
+ var anchor2 = new Anchor(href, classes3, children2, options3);
+ sizeElementFromChildren(anchor2);
+ return anchor2;
}, "makeAnchor");
makeFragment = /* @__PURE__ */ __name(function makeFragment2(children2) {
var fragment = new DocumentFragment(children2);
@@ -12457,9 +12574,9 @@ var __esbuild_esm_mermaid = (() => {
currPos += _child.size;
} else {
var _elem = _child.elem;
- var classes6 = _child.wrapperClasses || [];
+ var classes3 = _child.wrapperClasses || [];
var style3 = _child.wrapperStyle || {};
- var childWrap = makeSpan$2(classes6, [pstrut, _elem], void 0, style3);
+ var childWrap = makeSpan$2(classes3, [pstrut, _elem], void 0, style3);
childWrap.style.top = makeEm(-pstrutSize - currPos - _elem.depth);
if (_child.marginLeft) {
childWrap.style.marginLeft = _child.marginLeft;
@@ -12856,9 +12973,9 @@ var __esbuild_esm_mermaid = (() => {
}
return DomEnum[node2.classes[0]] || null;
}, "getTypeOfDomTree");
- makeNullDelimiter = /* @__PURE__ */ __name(function makeNullDelimiter2(options3, classes6) {
+ makeNullDelimiter = /* @__PURE__ */ __name(function makeNullDelimiter2(options3, classes3) {
var moreClasses = ["nulldelimiter"].concat(options3.baseSizingClasses());
- return makeSpan$1(classes6.concat(moreClasses));
+ return makeSpan$1(classes3.concat(moreClasses));
}, "makeNullDelimiter");
buildGroup$1 = /* @__PURE__ */ __name(function buildGroup(group2, options3, baseOptions) {
if (!group2) {
@@ -12884,7 +13001,7 @@ var __esbuild_esm_mermaid = (() => {
static {
__name(this, "MathNode");
}
- constructor(type3, children2, classes6) {
+ constructor(type3, children2, classes3) {
this.type = void 0;
this.attributes = void 0;
this.children = void 0;
@@ -12892,7 +13009,7 @@ var __esbuild_esm_mermaid = (() => {
this.type = type3;
this.attributes = {};
this.children = children2 || [];
- this.classes = classes6 || [];
+ this.classes = classes3 || [];
}
/**
* Sets an attribute on a MathML node. MathML depends on attributes to convey a
@@ -12958,9 +13075,9 @@ var __esbuild_esm_mermaid = (() => {
static {
__name(this, "TextNode");
}
- constructor(text2) {
+ constructor(text4) {
this.text = void 0;
- this.text = text2;
+ this.text = text4;
}
/**
* Converts the text node into a DOM text node.
@@ -13053,11 +13170,11 @@ var __esbuild_esm_mermaid = (() => {
SpaceNode,
newDocumentFragment
};
- makeText = /* @__PURE__ */ __name(function makeText2(text2, mode, options3) {
- if (symbols[mode][text2] && symbols[mode][text2].replace && text2.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(text2) && options3 && (options3.fontFamily && options3.fontFamily.slice(4, 6) === "tt" || options3.font && options3.font.slice(4, 6) === "tt"))) {
- text2 = symbols[mode][text2].replace;
+ makeText = /* @__PURE__ */ __name(function makeText2(text4, mode, options3) {
+ if (symbols[mode][text4] && symbols[mode][text4].replace && text4.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(text4) && options3 && (options3.fontFamily && options3.fontFamily.slice(4, 6) === "tt" || options3.font && options3.font.slice(4, 6) === "tt"))) {
+ text4 = symbols[mode][text4].replace;
}
- return new mathMLTree.TextNode(text2);
+ return new mathMLTree.TextNode(text4);
}, "makeText");
makeRow = /* @__PURE__ */ __name(function makeRow2(body) {
if (body.length === 1) {
@@ -13108,15 +13225,15 @@ var __esbuild_esm_mermaid = (() => {
} else if (font === "mathtt") {
return "monospace";
}
- var text2 = group2.text;
- if (utils.contains(["\\imath", "\\jmath"], text2)) {
+ var text4 = group2.text;
+ if (utils.contains(["\\imath", "\\jmath"], text4)) {
return null;
}
- if (symbols[mode][text2] && symbols[mode][text2].replace) {
- text2 = symbols[mode][text2].replace;
+ if (symbols[mode][text4] && symbols[mode][text4].replace) {
+ text4 = symbols[mode][text4].replace;
}
var fontName = buildCommon.fontMap[font].fontName;
- if (getCharacterMetrics(text2, fontName, mode)) {
+ if (getCharacterMetrics(text4, fontName, mode)) {
return buildCommon.fontMap[font].variant;
}
return null;
@@ -13187,14 +13304,14 @@ var __esbuild_esm_mermaid = (() => {
}, "optionsFromSettings");
displayWrap = /* @__PURE__ */ __name(function displayWrap2(node2, settings) {
if (settings.displayMode) {
- var classes6 = ["katex-display"];
+ var classes3 = ["katex-display"];
if (settings.leqno) {
- classes6.push("leqno");
+ classes3.push("leqno");
}
if (settings.fleqn) {
- classes6.push("fleqn");
+ classes3.push("fleqn");
}
- node2 = buildCommon.makeSpan(classes6, [node2]);
+ node2 = buildCommon.makeSpan(classes3, [node2]);
}
return node2;
}, "displayWrap");
@@ -13375,14 +13492,14 @@ var __esbuild_esm_mermaid = (() => {
};
} else {
var spans = [];
- var data5 = katexImagesData[label];
- var [paths, _minWidth, _viewBoxHeight] = data5;
+ var data6 = katexImagesData[label];
+ var [paths, _minWidth, _viewBoxHeight] = data6;
var _height2 = _viewBoxHeight / 1e3;
var numSvgChildren = paths.length;
var widthClasses;
var aligns;
if (numSvgChildren === 1) {
- var align1 = data5[3];
+ var align1 = data6[3];
widthClasses = ["hide-tail"];
aligns = [align1];
} else if (numSvgChildren === 2) {
@@ -13647,13 +13764,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var base = args[0];
return {
type: "accentUnder",
- mode: parser22.mode,
+ mode: parser24.mode,
label: funcName,
base
};
@@ -13730,12 +13847,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args, optArgs) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
return {
type: "xArrow",
- mode: parser22.mode,
+ mode: parser24.mode,
label: funcName,
body: args[0],
below: optArgs[0]
@@ -13831,13 +13948,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var body = args[0];
return {
type: "mclass",
- mode: parser22.mode,
+ mode: parser24.mode,
mclass: "m" + funcName.slice(5),
// TODO(kevinb): don't prefix with 'm'
body: ordargument(body),
@@ -13863,11 +13980,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref2, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref2;
return {
type: "mclass",
- mode: parser22.mode,
+ mode: parser24.mode,
mclass: binrelClass(args[0]),
body: ordargument(args[1]),
isCharacterBox: utils.isCharacterBox(args[1])
@@ -13882,7 +13999,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref3, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref3;
var baseArg = args[1];
@@ -13912,7 +14029,7 @@ var __esbuild_esm_mermaid = (() => {
};
return {
type: "mclass",
- mode: parser22.mode,
+ mode: parser24.mode,
mclass,
body: [supsub],
isCharacterBox: utils.isCharacterBox(supsub)
@@ -13930,11 +14047,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
return {
type: "pmb",
- mode: parser22.mode,
+ mode: parser24.mode,
mclass: binrelClass(args[0]),
body: ordargument(args[0])
};
@@ -13985,12 +14102,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
return {
type: "cdlabel",
- mode: parser22.mode,
+ mode: parser24.mode,
side: funcName.slice(4),
label: args[0]
};
@@ -14026,11 +14143,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref2, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref2;
return {
type: "cdlabelparent",
- mode: parser22.mode,
+ mode: parser24.mode,
fragment: args[0]
};
},
@@ -14052,7 +14169,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var arg = assertNodeType(args[0], "ordgroup");
var group2 = arg.body;
@@ -14062,21 +14179,21 @@ var __esbuild_esm_mermaid = (() => {
number7 += node2.text;
}
var code = parseInt(number7);
- var text2;
+ var text4;
if (isNaN(code)) {
throw new ParseError("\\@char has non-numeric argument " + number7);
} else if (code < 0 || code >= 1114111) {
throw new ParseError("\\@char with invalid code point " + number7);
} else if (code <= 65535) {
- text2 = String.fromCharCode(code);
+ text4 = String.fromCharCode(code);
} else {
code -= 65536;
- text2 = String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
+ text4 = String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
}
return {
type: "textord",
- mode: parser22.mode,
- text: text2
+ mode: parser24.mode,
+ text: text4
};
}
});
@@ -14100,13 +14217,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var color2 = assertNodeType(args[0], "color-token").color;
var body = args[1];
return {
type: "color",
- mode: parser22.mode,
+ mode: parser24.mode,
color: color2,
body: ordargument(body)
};
@@ -14124,15 +14241,15 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref2, args) {
var {
- parser: parser22,
+ parser: parser24,
breakOnTokenText
} = _ref2;
var color2 = assertNodeType(args[0], "color-token").color;
- parser22.gullet.macros.set("\\current@color", color2);
- var body = parser22.parseExpression(true, breakOnTokenText);
+ parser24.gullet.macros.set("\\current@color", color2);
+ var body = parser24.parseExpression(true, breakOnTokenText);
return {
type: "color",
- mode: parser22.mode,
+ mode: parser24.mode,
color: color2,
body
};
@@ -14150,13 +14267,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args, optArgs) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
- var size5 = parser22.gullet.future().text === "[" ? parser22.parseSizeGroup(true) : null;
- var newLine = !parser22.settings.displayMode || !parser22.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
+ var size5 = parser24.gullet.future().text === "[" ? parser24.parseSizeGroup(true) : null;
+ var newLine = !parser24.settings.displayMode || !parser24.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
return {
type: "cr",
- mode: parser22.mode,
+ mode: parser24.mode,
newLine,
size: size5 && assertNodeType(size5, "size").value
};
@@ -14202,28 +14319,28 @@ var __esbuild_esm_mermaid = (() => {
}
return name;
}, "checkControlSequence");
- getRHS = /* @__PURE__ */ __name((parser22) => {
- var tok = parser22.gullet.popToken();
+ getRHS = /* @__PURE__ */ __name((parser24) => {
+ var tok = parser24.gullet.popToken();
if (tok.text === "=") {
- tok = parser22.gullet.popToken();
+ tok = parser24.gullet.popToken();
if (tok.text === " ") {
- tok = parser22.gullet.popToken();
+ tok = parser24.gullet.popToken();
}
}
return tok;
}, "getRHS");
- letCommand = /* @__PURE__ */ __name((parser22, name, tok, global2) => {
- var macro = parser22.gullet.macros.get(tok.text);
+ letCommand = /* @__PURE__ */ __name((parser24, name, tok, global2) => {
+ var macro = parser24.gullet.macros.get(tok.text);
if (macro == null) {
tok.noexpand = true;
macro = {
tokens: [tok],
numArgs: 0,
// reproduce the same behavior in expansion
- unexpandable: !parser22.gullet.isExpandable(tok.text)
+ unexpandable: !parser24.gullet.isExpandable(tok.text)
};
}
- parser22.gullet.macros.set(name, macro, global2);
+ parser24.gullet.macros.set(name, macro, global2);
}, "letCommand");
defineFunction({
type: "internal",
@@ -14239,16 +14356,16 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
- parser22.consumeSpaces();
- var token2 = parser22.fetch();
+ parser24.consumeSpaces();
+ var token2 = parser24.fetch();
if (globalMap[token2.text]) {
if (funcName === "\\global" || funcName === "\\\\globallong") {
token2.text = globalMap[token2.text];
}
- return assertNodeType(parser22.parseFunction(), "internal");
+ return assertNodeType(parser24.parseFunction(), "internal");
}
throw new ParseError("Invalid token after macro prefix", token2);
}
@@ -14263,10 +14380,10 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref2) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref2;
- var tok = parser22.gullet.popToken();
+ var tok = parser24.gullet.popToken();
var name = tok.text;
if (/^(?:[\\{}$^_]|EOF)$/.test(name)) {
throw new ParseError("Expected a control sequence", tok);
@@ -14274,15 +14391,15 @@ var __esbuild_esm_mermaid = (() => {
var numArgs = 0;
var insert;
var delimiters2 = [[]];
- while (parser22.gullet.future().text !== "{") {
- tok = parser22.gullet.popToken();
+ while (parser24.gullet.future().text !== "{") {
+ tok = parser24.gullet.popToken();
if (tok.text === "#") {
- if (parser22.gullet.future().text === "{") {
- insert = parser22.gullet.future();
+ if (parser24.gullet.future().text === "{") {
+ insert = parser24.gullet.future();
delimiters2[numArgs].push("{");
break;
}
- tok = parser22.gullet.popToken();
+ tok = parser24.gullet.popToken();
if (!/^[1-9]$/.test(tok.text)) {
throw new ParseError('Invalid argument number "' + tok.text + '"');
}
@@ -14299,22 +14416,22 @@ var __esbuild_esm_mermaid = (() => {
}
var {
tokens: tokens2
- } = parser22.gullet.consumeArg();
+ } = parser24.gullet.consumeArg();
if (insert) {
tokens2.unshift(insert);
}
if (funcName === "\\edef" || funcName === "\\xdef") {
- tokens2 = parser22.gullet.expandTokens(tokens2);
+ tokens2 = parser24.gullet.expandTokens(tokens2);
tokens2.reverse();
}
- parser22.gullet.macros.set(name, {
+ parser24.gullet.macros.set(name, {
tokens: tokens2,
numArgs,
delimiters: delimiters2
}, funcName === globalMap[funcName]);
return {
type: "internal",
- mode: parser22.mode
+ mode: parser24.mode
};
}
});
@@ -14332,16 +14449,16 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref3) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref3;
- var name = checkControlSequence(parser22.gullet.popToken());
- parser22.gullet.consumeSpaces();
- var tok = getRHS(parser22);
- letCommand(parser22, name, tok, funcName === "\\\\globallet");
+ var name = checkControlSequence(parser24.gullet.popToken());
+ parser24.gullet.consumeSpaces();
+ var tok = getRHS(parser24);
+ letCommand(parser24, name, tok, funcName === "\\\\globallet");
return {
type: "internal",
- mode: parser22.mode
+ mode: parser24.mode
};
}
});
@@ -14359,18 +14476,18 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref4) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref4;
- var name = checkControlSequence(parser22.gullet.popToken());
- var middle = parser22.gullet.popToken();
- var tok = parser22.gullet.popToken();
- letCommand(parser22, name, tok, funcName === "\\\\globalfuture");
- parser22.gullet.pushToken(tok);
- parser22.gullet.pushToken(middle);
+ var name = checkControlSequence(parser24.gullet.popToken());
+ var middle = parser24.gullet.popToken();
+ var tok = parser24.gullet.popToken();
+ letCommand(parser24, name, tok, funcName === "\\\\globalfuture");
+ parser24.gullet.pushToken(tok);
+ parser24.gullet.pushToken(middle);
return {
type: "internal",
- mode: parser22.mode
+ mode: parser24.mode
};
}
});
@@ -14382,9 +14499,9 @@ var __esbuild_esm_mermaid = (() => {
}
return metrics;
}, "getMetrics");
- styleWrap = /* @__PURE__ */ __name(function styleWrap2(delim, toStyle, options3, classes6) {
+ styleWrap = /* @__PURE__ */ __name(function styleWrap2(delim, toStyle, options3, classes3) {
var newOptions = options3.havingBaseStyle(toStyle);
- var span = buildCommon.makeSpan(classes6.concat(newOptions.sizingClasses(options3)), [delim], options3);
+ var span = buildCommon.makeSpan(classes3.concat(newOptions.sizingClasses(options3)), [delim], options3);
var delimSizeMultiplier = newOptions.sizeMultiplier / options3.sizeMultiplier;
span.height *= delimSizeMultiplier;
span.depth *= delimSizeMultiplier;
@@ -14399,9 +14516,9 @@ var __esbuild_esm_mermaid = (() => {
span.height -= shift2;
span.depth += shift2;
}, "centerSpan");
- makeSmallDelim = /* @__PURE__ */ __name(function makeSmallDelim2(delim, style3, center4, options3, mode, classes6) {
- var text2 = buildCommon.makeSymbol(delim, "Main-Regular", mode, options3);
- var span = styleWrap(text2, style3, options3, classes6);
+ makeSmallDelim = /* @__PURE__ */ __name(function makeSmallDelim2(delim, style3, center4, options3, mode, classes3) {
+ var text4 = buildCommon.makeSymbol(delim, "Main-Regular", mode, options3);
+ var span = styleWrap(text4, style3, options3, classes3);
if (center4) {
centerSpan(span, options3, style3);
}
@@ -14410,9 +14527,9 @@ var __esbuild_esm_mermaid = (() => {
mathrmSize = /* @__PURE__ */ __name(function mathrmSize2(value2, size5, mode, options3) {
return buildCommon.makeSymbol(value2, "Size" + size5 + "-Regular", mode, options3);
}, "mathrmSize");
- makeLargeDelim = /* @__PURE__ */ __name(function makeLargeDelim2(delim, size5, center4, options3, mode, classes6) {
+ makeLargeDelim = /* @__PURE__ */ __name(function makeLargeDelim2(delim, size5, center4, options3, mode, classes3) {
var inner2 = mathrmSize(delim, size5, mode, options3);
- var span = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + size5], [inner2], options3), Style$1.TEXT, options3, classes6);
+ var span = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + size5], [inner2], options3), Style$1.TEXT, options3, classes3);
if (center4) {
centerSpan(span, options3, Style$1.TEXT);
}
@@ -14458,7 +14575,7 @@ var __esbuild_esm_mermaid = (() => {
};
verts = ["|", "\\lvert", "\\rvert", "\\vert"];
doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"];
- makeStackedDelim = /* @__PURE__ */ __name(function makeStackedDelim2(delim, heightTotal, center4, options3, mode, classes6) {
+ makeStackedDelim = /* @__PURE__ */ __name(function makeStackedDelim2(delim, heightTotal, center4, options3, mode, classes3) {
var top2;
var middle;
var repeat2;
@@ -14606,12 +14723,12 @@ var __esbuild_esm_mermaid = (() => {
var path4 = new PathNode(svgLabel, pathStr);
var width3 = (viewBoxWidth / 1e3).toFixed(3) + "em";
var height2 = (viewBoxHeight / 1e3).toFixed(3) + "em";
- var svg = new SvgNode([path4], {
+ var svg2 = new SvgNode([path4], {
"width": width3,
"height": height2,
"viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight
});
- var wrapper = buildCommon.makeSvgSpan([], [svg], options3);
+ var wrapper = buildCommon.makeSvgSpan([], [svg2], options3);
wrapper.height = viewBoxHeight / 1e3;
wrapper.style.width = width3;
wrapper.style.height = height2;
@@ -14642,21 +14759,21 @@ var __esbuild_esm_mermaid = (() => {
positionData: depth,
children: stack
}, newOptions);
- return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [inner2], newOptions), Style$1.TEXT, options3, classes6);
+ return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [inner2], newOptions), Style$1.TEXT, options3, classes3);
}, "makeStackedDelim");
vbPad = 80;
emPad = 0.08;
sqrtSvg = /* @__PURE__ */ __name(function sqrtSvg2(sqrtName, height2, viewBoxHeight, extraVinculum, options3) {
var path4 = sqrtPath(sqrtName, extraVinculum, viewBoxHeight);
var pathNode = new PathNode(sqrtName, path4);
- var svg = new SvgNode([pathNode], {
+ var svg2 = new SvgNode([pathNode], {
// Note: 1000:1 ratio of viewBox to document em width.
"width": "400em",
"height": makeEm(height2),
"viewBox": "0 0 400000 " + viewBoxHeight,
"preserveAspectRatio": "xMinYMin slice"
});
- return buildCommon.makeSvgSpan(["hide-tail"], [svg], options3);
+ return buildCommon.makeSvgSpan(["hide-tail"], [svg2], options3);
}, "sqrtSvg");
makeSqrtImage = /* @__PURE__ */ __name(function makeSqrtImage2(height2, options3) {
var newOptions = options3.havingBaseSizing();
@@ -14711,16 +14828,16 @@ var __esbuild_esm_mermaid = (() => {
stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27EE", "\u27EF", "\\lmoustache", "\\rmoustache", "\u23B0", "\u23B1"];
stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"];
sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3];
- makeSizedDelim = /* @__PURE__ */ __name(function makeSizedDelim2(delim, size5, options3, mode, classes6) {
+ makeSizedDelim = /* @__PURE__ */ __name(function makeSizedDelim2(delim, size5, options3, mode, classes3) {
if (delim === "<" || delim === "\\lt" || delim === "\u27E8") {
delim = "\\langle";
} else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") {
delim = "\\rangle";
}
if (utils.contains(stackLargeDelimiters, delim) || utils.contains(stackNeverDelimiters, delim)) {
- return makeLargeDelim(delim, size5, false, options3, mode, classes6);
+ return makeLargeDelim(delim, size5, false, options3, mode, classes3);
} else if (utils.contains(stackAlwaysDelimiters, delim)) {
- return makeStackedDelim(delim, sizeToMaxHeight[size5], false, options3, mode, classes6);
+ return makeStackedDelim(delim, sizeToMaxHeight[size5], false, options3, mode, classes3);
} else {
throw new ParseError("Illegal delimiter: '" + delim + "'");
}
@@ -14812,7 +14929,7 @@ var __esbuild_esm_mermaid = (() => {
}
return sequence[sequence.length - 1];
}, "traverseSequence");
- makeCustomSizedDelim = /* @__PURE__ */ __name(function makeCustomSizedDelim2(delim, height2, center4, options3, mode, classes6) {
+ makeCustomSizedDelim = /* @__PURE__ */ __name(function makeCustomSizedDelim2(delim, height2, center4, options3, mode, classes3) {
if (delim === "<" || delim === "\\lt" || delim === "\u27E8") {
delim = "\\langle";
} else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") {
@@ -14828,14 +14945,14 @@ var __esbuild_esm_mermaid = (() => {
}
var delimType = traverseSequence(delim, height2, sequence, options3);
if (delimType.type === "small") {
- return makeSmallDelim(delim, delimType.style, center4, options3, mode, classes6);
+ return makeSmallDelim(delim, delimType.style, center4, options3, mode, classes3);
} else if (delimType.type === "large") {
- return makeLargeDelim(delim, delimType.size, center4, options3, mode, classes6);
+ return makeLargeDelim(delim, delimType.size, center4, options3, mode, classes3);
} else {
- return makeStackedDelim(delim, height2, center4, options3, mode, classes6);
+ return makeStackedDelim(delim, height2, center4, options3, mode, classes3);
}
}, "makeCustomSizedDelim");
- makeLeftRightDelim = /* @__PURE__ */ __name(function makeLeftRightDelim2(delim, height2, depth, options3, mode, classes6) {
+ makeLeftRightDelim = /* @__PURE__ */ __name(function makeLeftRightDelim2(delim, height2, depth, options3, mode, classes3) {
var axisHeight = options3.fontMetrics().axisHeight * options3.sizeMultiplier;
var delimiterFactor = 901;
var delimiterExtend = 5 / options3.fontMetrics().ptPerEm;
@@ -14853,7 +14970,7 @@ var __esbuild_esm_mermaid = (() => {
maxDistFromAxis / 500 * delimiterFactor,
2 * maxDistFromAxis - delimiterExtend
);
- return makeCustomSizedDelim(delim, totalHeight, true, options3, mode, classes6);
+ return makeCustomSizedDelim(delim, totalHeight, true, options3, mode, classes3);
}, "makeLeftRightDelim");
delimiter = {
sqrtImage: makeSqrtImage,
@@ -15002,15 +15119,15 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((context, args) => {
var delim = checkDelimiter(args[0], context);
- var parser22 = context.parser;
- ++parser22.leftrightDepth;
- var body = parser22.parseExpression(false);
- --parser22.leftrightDepth;
- parser22.expect("\\right", false);
- var right3 = assertNodeType(parser22.parseFunction(), "leftright-right");
+ var parser24 = context.parser;
+ ++parser24.leftrightDepth;
+ var body = parser24.parseExpression(false);
+ --parser24.leftrightDepth;
+ parser24.expect("\\right", false);
+ var right3 = assertNodeType(parser24.parseFunction(), "leftright-right");
return {
type: "leftright",
- mode: parser22.mode,
+ mode: parser24.mode,
body,
left: delim.text,
right: right3.delim,
@@ -15122,13 +15239,13 @@ var __esbuild_esm_mermaid = (() => {
htmlBuilder$7 = /* @__PURE__ */ __name((group2, options3) => {
var inner2 = buildCommon.wrapFragment(buildGroup$1(group2.body, options3), options3);
var label = group2.label.slice(1);
- var scale = options3.sizeMultiplier;
+ var scale2 = options3.sizeMultiplier;
var img;
var imgShift = 0;
var isSingleChar = utils.isCharacterBox(group2.body);
if (label === "sout") {
img = buildCommon.makeSpan(["stretchy", "sout"]);
- img.height = options3.fontMetrics().defaultRuleThickness / scale;
+ img.height = options3.fontMetrics().defaultRuleThickness / scale2;
imgShift = -0.5 * options3.fontMetrics().xHeight;
} else if (label === "phase") {
var lineWeight = calculateSize2({
@@ -15140,10 +15257,10 @@ var __esbuild_esm_mermaid = (() => {
unit: "ex"
}, options3);
var newOptions = options3.havingBaseSizing();
- scale = scale / newOptions.sizeMultiplier;
+ scale2 = scale2 / newOptions.sizeMultiplier;
var angleHeight = inner2.height + inner2.depth + lineWeight + clearance;
inner2.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight);
- var viewBoxHeight = Math.floor(1e3 * angleHeight * scale);
+ var viewBoxHeight = Math.floor(1e3 * angleHeight * scale2);
var path4 = phasePath(viewBoxHeight);
var svgNode2 = new SvgNode([new PathNode("phase", path4)], {
"width": "400em",
@@ -15219,7 +15336,7 @@ var __esbuild_esm_mermaid = (() => {
]
}, options3);
} else {
- var classes6 = /cancel|phase/.test(label) ? ["svg-align"] : [];
+ var classes3 = /cancel|phase/.test(label) ? ["svg-align"] : [];
vlist = buildCommon.makeVList({
positionType: "individualShift",
children: [
@@ -15233,7 +15350,7 @@ var __esbuild_esm_mermaid = (() => {
type: "elem",
elem: img,
shift: imgShift,
- wrapperClasses: classes6
+ wrapperClasses: classes3
}
]
}, options3);
@@ -15306,14 +15423,14 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args, optArgs) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var color2 = assertNodeType(args[0], "color-token").color;
var body = args[1];
return {
type: "enclose",
- mode: parser22.mode,
+ mode: parser24.mode,
label: funcName,
backgroundColor: color2,
body
@@ -15332,7 +15449,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref2, args, optArgs) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref2;
var borderColor = assertNodeType(args[0], "color-token").color;
@@ -15340,7 +15457,7 @@ var __esbuild_esm_mermaid = (() => {
var body = args[2];
return {
type: "enclose",
- mode: parser22.mode,
+ mode: parser24.mode,
label: funcName,
backgroundColor,
borderColor,
@@ -15360,11 +15477,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref3, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref3;
return {
type: "enclose",
- mode: parser22.mode,
+ mode: parser24.mode,
label: "\\fbox",
body: args[0]
};
@@ -15378,13 +15495,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref4, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref4;
var body = args[0];
return {
type: "enclose",
- mode: parser22.mode,
+ mode: parser24.mode,
label: funcName,
body
};
@@ -15402,11 +15519,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref5, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref5;
return {
type: "enclose",
- mode: parser22.mode,
+ mode: parser24.mode,
label: "\\angl",
body: args[0]
};
@@ -15553,11 +15670,11 @@ var __esbuild_esm_mermaid = (() => {
cols.push(colSep);
}
if (colDescr.separator === "|" || colDescr.separator === ":") {
- var lineType3 = colDescr.separator === "|" ? "solid" : "dashed";
+ var lineType = colDescr.separator === "|" ? "solid" : "dashed";
var separator = buildCommon.makeSpan(["vertical-separator"], [], options3);
separator.style.height = makeEm(totalHeight);
separator.style.borderRightWidth = makeEm(ruleThickness);
- separator.style.borderRightStyle = lineType3;
+ separator.style.borderRightStyle = lineType;
separator.style.margin = "0 " + makeEm(-ruleThickness / 2);
var _shift = totalHeight - offset;
if (_shift) {
@@ -15887,19 +16004,19 @@ var __esbuild_esm_mermaid = (() => {
}]
};
if (context.envName.charAt(context.envName.length - 1) === "*") {
- var parser22 = context.parser;
- parser22.consumeSpaces();
- if (parser22.fetch().text === "[") {
- parser22.consume();
- parser22.consumeSpaces();
- colAlign = parser22.fetch().text;
+ var parser24 = context.parser;
+ parser24.consumeSpaces();
+ if (parser24.fetch().text === "[") {
+ parser24.consume();
+ parser24.consumeSpaces();
+ colAlign = parser24.fetch().text;
if ("lcr".indexOf(colAlign) === -1) {
- throw new ParseError("Expected l or c or r", parser22.nextToken);
+ throw new ParseError("Expected l or c or r", parser24.nextToken);
}
- parser22.consume();
- parser22.consumeSpaces();
- parser22.expect("]");
- parser22.consume();
+ parser24.consume();
+ parser24.consumeSpaces();
+ parser24.expect("]");
+ parser24.consume();
payload.cols = [{
type: "align",
align: colAlign
@@ -16122,7 +16239,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var nameGroup = args[0];
@@ -16141,16 +16258,16 @@ var __esbuild_esm_mermaid = (() => {
var {
args: _args,
optArgs
- } = parser22.parseArguments("\\begin{" + envName + "}", env);
+ } = parser24.parseArguments("\\begin{" + envName + "}", env);
var context = {
- mode: parser22.mode,
+ mode: parser24.mode,
envName,
- parser: parser22
+ parser: parser24
};
var result = env.handler(context, _args, optArgs);
- parser22.expect("\\end", false);
- var endNameToken = parser22.nextToken;
- var end2 = assertNodeType(parser22.parseFunction(), "environment");
+ parser24.expect("\\end", false);
+ var endNameToken = parser24.nextToken;
+ var end2 = assertNodeType(parser24.parseFunction(), "environment");
if (end2.name !== envName) {
throw new ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end2.name + "}", endNameToken);
}
@@ -16158,7 +16275,7 @@ var __esbuild_esm_mermaid = (() => {
}
return {
type: "environment",
- mode: parser22.mode,
+ mode: parser24.mode,
name: envName,
nameGroup
};
@@ -16206,7 +16323,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var body = normalizeArgument(args[0]);
@@ -16216,7 +16333,7 @@ var __esbuild_esm_mermaid = (() => {
}
return {
type: "font",
- mode: parser22.mode,
+ mode: parser24.mode,
font: func.slice(1),
body
};
@@ -16232,17 +16349,17 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref2;
var body = args[0];
var isCharacterBox3 = utils.isCharacterBox(body);
return {
type: "mclass",
- mode: parser22.mode,
+ mode: parser24.mode,
mclass: binrelClass(body),
body: [{
type: "font",
- mode: parser22.mode,
+ mode: parser24.mode,
font: "boldsymbol",
body
}],
@@ -16259,14 +16376,14 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref3, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName,
breakOnTokenText
} = _ref3;
var {
mode
- } = parser22;
- var body = parser22.parseExpression(true, breakOnTokenText);
+ } = parser24;
+ var body = parser24.parseExpression(true, breakOnTokenText);
var style3 = "math" + funcName.slice(1);
return {
type: "font",
@@ -16274,7 +16391,7 @@ var __esbuild_esm_mermaid = (() => {
font: style3,
body: {
type: "ordgroup",
- mode: parser22.mode,
+ mode: parser24.mode,
body
}
};
@@ -16473,7 +16590,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var numer = args[0];
@@ -16523,7 +16640,7 @@ var __esbuild_esm_mermaid = (() => {
}
return {
type: "genfrac",
- mode: parser22.mode,
+ mode: parser24.mode,
continued: false,
numer,
denom,
@@ -16545,14 +16662,14 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref2;
var numer = args[0];
var denom = args[1];
return {
type: "genfrac",
- mode: parser22.mode,
+ mode: parser24.mode,
continued: true,
numer,
denom,
@@ -16573,7 +16690,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref3) {
var {
- parser: parser22,
+ parser: parser24,
funcName,
token: token2
} = _ref3;
@@ -16599,7 +16716,7 @@ var __esbuild_esm_mermaid = (() => {
}
return {
type: "infix",
- mode: parser22.mode,
+ mode: parser24.mode,
replaceWith,
token: token2
};
@@ -16624,7 +16741,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref4, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref4;
var numer = args[4];
var denom = args[5];
@@ -16654,7 +16771,7 @@ var __esbuild_esm_mermaid = (() => {
}
return {
type: "genfrac",
- mode: parser22.mode,
+ mode: parser24.mode,
numer,
denom,
continued: false,
@@ -16678,13 +16795,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref5, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName,
token: token2
} = _ref5;
return {
type: "infix",
- mode: parser22.mode,
+ mode: parser24.mode,
replaceWith: "\\\\abovefrac",
size: assertNodeType(args[0], "size").value,
token: token2
@@ -16700,7 +16817,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref6, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref6;
var numer = args[0];
@@ -16709,7 +16826,7 @@ var __esbuild_esm_mermaid = (() => {
var hasBarLine = barSize.number > 0;
return {
type: "genfrac",
- mode: parser22.mode,
+ mode: parser24.mode,
numer,
denom,
continued: false,
@@ -16815,12 +16932,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
return {
type: "horizBrace",
- mode: parser22.mode,
+ mode: parser24.mode,
label: funcName,
isOver: /^\\over/.test(funcName),
base: args[0]
@@ -16839,19 +16956,19 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var body = args[1];
var href = assertNodeType(args[0], "url").url;
- if (!parser22.settings.isTrusted({
+ if (!parser24.settings.isTrusted({
command: "\\href",
url: href
})) {
- return parser22.formatUnsupportedCmd("\\href");
+ return parser24.formatUnsupportedCmd("\\href");
}
return {
type: "href",
- mode: parser22.mode,
+ mode: parser24.mode,
href,
body: ordargument(body)
};
@@ -16879,14 +16996,14 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref2;
var href = assertNodeType(args[0], "url").url;
- if (!parser22.settings.isTrusted({
+ if (!parser24.settings.isTrusted({
command: "\\url",
url: href
})) {
- return parser22.formatUnsupportedCmd("\\url");
+ return parser24.formatUnsupportedCmd("\\url");
}
var chars = [];
for (var i2 = 0; i2 < href.length; i2++) {
@@ -16902,13 +17019,13 @@ var __esbuild_esm_mermaid = (() => {
}
var body = {
type: "text",
- mode: parser22.mode,
+ mode: parser24.mode,
font: "\\texttt",
body: chars
};
return {
type: "href",
- mode: parser22.mode,
+ mode: parser24.mode,
href,
body: ordargument(body)
};
@@ -16925,11 +17042,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
return {
type: "hbox",
- mode: parser22.mode,
+ mode: parser24.mode,
body: ordargument(args[0])
};
},
@@ -16951,14 +17068,14 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName,
token: token2
} = _ref;
var value2 = assertNodeType(args[0], "raw").string;
var body = args[1];
- if (parser22.settings.strict) {
- parser22.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
+ if (parser24.settings.strict) {
+ parser24.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
}
var trustContext;
var attributes = {};
@@ -16985,9 +17102,9 @@ var __esbuild_esm_mermaid = (() => {
};
break;
case "\\htmlData": {
- var data5 = value2.split(",");
- for (var i2 = 0; i2 < data5.length; i2++) {
- var keyVal = data5[i2].split("=");
+ var data6 = value2.split(",");
+ for (var i2 = 0; i2 < data6.length; i2++) {
+ var keyVal = data6[i2].split("=");
if (keyVal.length !== 2) {
throw new ParseError("Error parsing key-value for \\htmlData");
}
@@ -17002,23 +17119,23 @@ var __esbuild_esm_mermaid = (() => {
default:
throw new Error("Unrecognized html command");
}
- if (!parser22.settings.isTrusted(trustContext)) {
- return parser22.formatUnsupportedCmd(funcName);
+ if (!parser24.settings.isTrusted(trustContext)) {
+ return parser24.formatUnsupportedCmd(funcName);
}
return {
type: "html",
- mode: parser22.mode,
+ mode: parser24.mode,
attributes,
body: ordargument(body)
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options3) => {
var elements3 = buildExpression$1(group2.body, options3, false);
- var classes6 = ["enclosing"];
+ var classes3 = ["enclosing"];
if (group2.attributes.class) {
- classes6.push(...group2.attributes.class.trim().split(/\s+/));
+ classes3.push(...group2.attributes.class.trim().split(/\s+/));
}
- var span = buildCommon.makeSpan(classes6, elements3, options3);
+ var span = buildCommon.makeSpan(classes3, elements3, options3);
for (var attr in group2.attributes) {
if (attr !== "class" && group2.attributes.hasOwnProperty(attr)) {
span.setAttribute(attr, group2.attributes[attr]);
@@ -17039,11 +17156,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref;
return {
type: "htmlmathml",
- mode: parser22.mode,
+ mode: parser24.mode,
html: ordargument(args[0]),
mathml: ordargument(args[1])
};
@@ -17067,15 +17184,15 @@ var __esbuild_esm_mermaid = (() => {
if (!match2) {
throw new ParseError("Invalid size: '" + str2 + "' in \\includegraphics");
}
- var data5 = {
+ var data6 = {
number: +(match2[1] + match2[2]),
// sign + magnitude, cast to number
unit: match2[3]
};
- if (!validUnit(data5)) {
- throw new ParseError("Invalid unit: '" + data5.unit + "' in \\includegraphics.");
+ if (!validUnit(data6)) {
+ throw new ParseError("Invalid unit: '" + data6.unit + "' in \\includegraphics.");
}
- return data5;
+ return data6;
}
}, "sizeData");
defineFunction({
@@ -17089,7 +17206,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args, optArgs) => {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var width3 = {
number: 0,
@@ -17136,15 +17253,15 @@ var __esbuild_esm_mermaid = (() => {
alt = alt.replace(/^.*[\\/]/, "");
alt = alt.substring(0, alt.lastIndexOf("."));
}
- if (!parser22.settings.isTrusted({
+ if (!parser24.settings.isTrusted({
command: "\\includegraphics",
url: src
})) {
- return parser22.formatUnsupportedCmd("\\includegraphics");
+ return parser24.formatUnsupportedCmd("\\includegraphics");
}
return {
type: "includegraphics",
- mode: parser22.mode,
+ mode: parser24.mode,
alt,
width: width3,
height: height2,
@@ -17205,29 +17322,29 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var size5 = assertNodeType(args[0], "size");
- if (parser22.settings.strict) {
+ if (parser24.settings.strict) {
var mathFunction = funcName[1] === "m";
var muUnit = size5.value.unit === "mu";
if (mathFunction) {
if (!muUnit) {
- parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size5.value.unit + " units"));
+ parser24.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size5.value.unit + " units"));
}
- if (parser22.mode !== "math") {
- parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode");
+ if (parser24.mode !== "math") {
+ parser24.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode");
}
} else {
if (muUnit) {
- parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units");
+ parser24.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units");
}
}
}
return {
type: "kern",
- mode: parser22.mode,
+ mode: parser24.mode,
dimension: size5.value
};
},
@@ -17248,13 +17365,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var body = args[0];
return {
type: "lap",
- mode: parser22.mode,
+ mode: parser24.mode,
alignment: funcName.slice(5),
body
};
@@ -17299,17 +17416,17 @@ var __esbuild_esm_mermaid = (() => {
handler(_ref, args) {
var {
funcName,
- parser: parser22
+ parser: parser24
} = _ref;
- var outerMode = parser22.mode;
- parser22.switchMode("math");
+ var outerMode = parser24.mode;
+ parser24.switchMode("math");
var close2 = funcName === "\\(" ? "\\)" : "$";
- var body = parser22.parseExpression(false, close2);
- parser22.expect(close2);
- parser22.switchMode(outerMode);
+ var body = parser24.parseExpression(false, close2);
+ parser24.expect(close2);
+ parser24.switchMode(outerMode);
return {
type: "styling",
- mode: parser22.mode,
+ mode: parser24.mode,
style: "text",
body
};
@@ -17351,11 +17468,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref;
return {
type: "mathchoice",
- mode: parser22.mode,
+ mode: parser24.mode,
display: ordargument(args[0]),
text: ordargument(args[1]),
script: ordargument(args[2]),
@@ -17593,7 +17710,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var fName = funcName;
@@ -17602,7 +17719,7 @@ var __esbuild_esm_mermaid = (() => {
}
return {
type: "op",
- mode: parser22.mode,
+ mode: parser24.mode,
limits: true,
parentIsSupSub: false,
symbol: true,
@@ -17621,12 +17738,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref2;
var body = args[0];
return {
type: "op",
- mode: parser22.mode,
+ mode: parser24.mode,
limits: false,
parentIsSupSub: false,
symbol: false,
@@ -17652,12 +17769,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref3) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref3;
return {
type: "op",
- mode: parser22.mode,
+ mode: parser24.mode,
limits: false,
parentIsSupSub: false,
symbol: false,
@@ -17675,12 +17792,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref4) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref4;
return {
type: "op",
- mode: parser22.mode,
+ mode: parser24.mode,
limits: true,
parentIsSupSub: false,
symbol: false,
@@ -17698,7 +17815,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref5) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref5;
var fName = funcName;
@@ -17707,7 +17824,7 @@ var __esbuild_esm_mermaid = (() => {
}
return {
type: "op",
- mode: parser22.mode,
+ mode: parser24.mode,
limits: false,
parentIsSupSub: false,
symbol: true,
@@ -17775,6 +17892,7 @@ var __esbuild_esm_mermaid = (() => {
case "mspace":
case "mtext":
break;
+ // Do nothing yet.
case "mo": {
var child = node2.children[0];
if (node2.children.length === 1 && child instanceof mathMLTree.TextNode) {
@@ -17812,13 +17930,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var body = args[0];
return {
type: "operatorname",
- mode: parser22.mode,
+ mode: parser24.mode,
body: ordargument(body),
alwaysHandleSupSub: funcName === "\\operatornamewithlimits",
limits: false,
@@ -17849,12 +17967,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var body = args[0];
return {
type: "overline",
- mode: parser22.mode,
+ mode: parser24.mode,
body
};
},
@@ -17897,12 +18015,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var body = args[0];
return {
type: "phantom",
- mode: parser22.mode,
+ mode: parser24.mode,
body: ordargument(body)
};
}, "handler"),
@@ -17924,12 +18042,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref2;
var body = args[0];
return {
type: "hphantom",
- mode: parser22.mode,
+ mode: parser24.mode,
body
};
}, "handler"),
@@ -17970,12 +18088,12 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref3, args) => {
var {
- parser: parser22
+ parser: parser24
} = _ref3;
var body = args[0];
return {
type: "vphantom",
- mode: parser22.mode,
+ mode: parser24.mode,
body
};
}, "handler"),
@@ -18002,13 +18120,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var amount = assertNodeType(args[0], "size").value;
var body = args[1];
return {
type: "raisebox",
- mode: parser22.mode,
+ mode: parser24.mode,
dy: amount,
body
};
@@ -18041,11 +18159,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
return {
type: "internal",
- mode: parser22.mode
+ mode: parser24.mode
};
}
});
@@ -18059,14 +18177,14 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args, optArgs) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var shift2 = optArgs[0];
var width3 = assertNodeType(args[0], "size");
var height2 = assertNodeType(args[1], "size");
return {
type: "rule",
- mode: parser22.mode,
+ mode: parser24.mode,
shift: shift2 && assertNodeType(shift2, "size").value,
width: width3.value,
height: height2.value
@@ -18123,12 +18241,12 @@ var __esbuild_esm_mermaid = (() => {
var {
breakOnTokenText,
funcName,
- parser: parser22
+ parser: parser24
} = _ref;
- var body = parser22.parseExpression(false, breakOnTokenText);
+ var body = parser24.parseExpression(false, breakOnTokenText);
return {
type: "sizing",
- mode: parser22.mode,
+ mode: parser24.mode,
// Figure out what size to use based on the list of functions above
size: sizeFuncs.indexOf(funcName) + 1,
body
@@ -18153,7 +18271,7 @@ var __esbuild_esm_mermaid = (() => {
},
handler: /* @__PURE__ */ __name((_ref, args, optArgs) => {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var smashHeight = false;
var smashDepth = false;
@@ -18180,7 +18298,7 @@ var __esbuild_esm_mermaid = (() => {
var body = args[0];
return {
type: "smash",
- mode: parser22.mode,
+ mode: parser24.mode,
body,
smashHeight,
smashDepth
@@ -18236,13 +18354,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args, optArgs) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
var index = optArgs[0];
var body = args[0];
return {
type: "sqrt",
- mode: parser22.mode,
+ mode: parser24.mode,
body,
index
};
@@ -18333,13 +18451,13 @@ var __esbuild_esm_mermaid = (() => {
var {
breakOnTokenText,
funcName,
- parser: parser22
+ parser: parser24
} = _ref;
- var body = parser22.parseExpression(true, breakOnTokenText);
+ var body = parser24.parseExpression(true, breakOnTokenText);
var style3 = funcName.slice(1, funcName.length - 5);
return {
type: "styling",
- mode: parser22.mode,
+ mode: parser24.mode,
// Figure out what style to use by pulling out the style from
// the function name
style: style3,
@@ -18518,38 +18636,38 @@ var __esbuild_esm_mermaid = (() => {
if (group2.sup) {
children2.push(buildGroup2(group2.sup, options3));
}
- var nodeType2;
+ var nodeType3;
if (isBrace) {
- nodeType2 = isOver ? "mover" : "munder";
+ nodeType3 = isOver ? "mover" : "munder";
} else if (!group2.sub) {
var base = group2.base;
if (base && base.type === "op" && base.limits && (options3.style === Style$1.DISPLAY || base.alwaysHandleSupSub)) {
- nodeType2 = "mover";
+ nodeType3 = "mover";
} else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options3.style === Style$1.DISPLAY)) {
- nodeType2 = "mover";
+ nodeType3 = "mover";
} else {
- nodeType2 = "msup";
+ nodeType3 = "msup";
}
} else if (!group2.sup) {
var _base = group2.base;
if (_base && _base.type === "op" && _base.limits && (options3.style === Style$1.DISPLAY || _base.alwaysHandleSupSub)) {
- nodeType2 = "munder";
+ nodeType3 = "munder";
} else if (_base && _base.type === "operatorname" && _base.alwaysHandleSupSub && (_base.limits || options3.style === Style$1.DISPLAY)) {
- nodeType2 = "munder";
+ nodeType3 = "munder";
} else {
- nodeType2 = "msub";
+ nodeType3 = "msub";
}
} else {
var _base2 = group2.base;
if (_base2 && _base2.type === "op" && _base2.limits && options3.style === Style$1.DISPLAY) {
- nodeType2 = "munderover";
+ nodeType3 = "munderover";
} else if (_base2 && _base2.type === "operatorname" && _base2.alwaysHandleSupSub && (options3.style === Style$1.DISPLAY || _base2.limits)) {
- nodeType2 = "munderover";
+ nodeType3 = "munderover";
} else {
- nodeType2 = "msubsup";
+ nodeType3 = "msubsup";
}
}
- return new mathMLTree.MathNode(nodeType2, children2);
+ return new mathMLTree.MathNode(nodeType3, children2);
}
});
defineFunctionBuilders({
@@ -18597,17 +18715,17 @@ var __esbuild_esm_mermaid = (() => {
return buildCommon.makeOrd(group2, options3, "textord");
},
mathmlBuilder(group2, options3) {
- var text2 = makeText(group2.text, group2.mode, options3);
+ var text4 = makeText(group2.text, group2.mode, options3);
var variant = getVariant(group2, options3) || "normal";
var node2;
if (group2.mode === "text") {
- node2 = new mathMLTree.MathNode("mtext", [text2]);
+ node2 = new mathMLTree.MathNode("mtext", [text4]);
} else if (/[0-9]/.test(group2.text)) {
- node2 = new mathMLTree.MathNode("mn", [text2]);
+ node2 = new mathMLTree.MathNode("mn", [text4]);
} else if (group2.text === "\\prime") {
- node2 = new mathMLTree.MathNode("mo", [text2]);
+ node2 = new mathMLTree.MathNode("mo", [text4]);
} else {
- node2 = new mathMLTree.MathNode("mi", [text2]);
+ node2 = new mathMLTree.MathNode("mi", [text4]);
}
if (variant !== defaultVariant[node2.type]) {
node2.setAttribute("mathvariant", variant);
@@ -18726,13 +18844,13 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22,
+ parser: parser24,
funcName
} = _ref;
var body = args[0];
return {
type: "text",
- mode: parser22.mode,
+ mode: parser24.mode,
body: ordargument(body),
font: funcName
};
@@ -18756,11 +18874,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
return {
type: "underline",
- mode: parser22.mode,
+ mode: parser24.mode,
body: args[0]
};
},
@@ -18806,11 +18924,11 @@ var __esbuild_esm_mermaid = (() => {
},
handler(_ref, args) {
var {
- parser: parser22
+ parser: parser24
} = _ref;
return {
type: "vcenter",
- mode: parser22.mode,
+ mode: parser24.mode,
body: args[0]
};
},
@@ -18842,11 +18960,11 @@ var __esbuild_esm_mermaid = (() => {
throw new ParseError("\\verb ended by end of line instead of matching delimiter");
},
htmlBuilder(group2, options3) {
- var text2 = makeVerb(group2);
+ var text4 = makeVerb(group2);
var body = [];
var newOptions = options3.havingStyle(options3.style.text());
- for (var i2 = 0; i2 < text2.length; i2++) {
- var c3 = text2[i2];
+ for (var i2 = 0; i2 < text4.length; i2++) {
+ var c3 = text4[i2];
if (c3 === "~") {
c3 = "\\textasciitilde";
}
@@ -18855,8 +18973,8 @@ var __esbuild_esm_mermaid = (() => {
return buildCommon.makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options3)), buildCommon.tryCombineChars(body), newOptions);
},
mathmlBuilder(group2, options3) {
- var text2 = new mathMLTree.TextNode(makeVerb(group2));
- var node2 = new mathMLTree.MathNode("mtext", [text2]);
+ var text4 = new mathMLTree.TextNode(makeVerb(group2));
+ var node2 = new mathMLTree.MathNode("mtext", [text4]);
node2.setAttribute("mathvariant", "monospace");
return node2;
}
@@ -18916,8 +19034,8 @@ var __esbuild_esm_mermaid = (() => {
if (match2 === null || match2.index !== pos) {
throw new ParseError("Unexpected character: '" + input[pos] + "'", new Token(input[pos], new SourceLocation(this, pos, pos + 1)));
}
- var text2 = match2[6] || match2[3] || (match2[2] ? "\\ " : " ");
- if (this.catcodes[text2] === 14) {
+ var text4 = match2[6] || match2[3] || (match2[2] ? "\\ " : " ");
+ if (this.catcodes[text4] === 14) {
var nlIndex = input.indexOf("\n", this.tokenRegex.lastIndex);
if (nlIndex === -1) {
this.tokenRegex.lastIndex = input.length;
@@ -18927,7 +19045,7 @@ var __esbuild_esm_mermaid = (() => {
}
return this.lex();
}
- return new Token(text2, new SourceLocation(this, pos, this.tokenRegex.lastIndex));
+ return new Token(text4, new SourceLocation(this, pos, this.tokenRegex.lastIndex));
}
};
Namespace = class {
@@ -19171,11 +19289,11 @@ var __esbuild_esm_mermaid = (() => {
throw new ParseError("\\newcommand's first argument must be a macro name");
}
var name = arg[0].text;
- var exists2 = context.isDefined(name);
- if (exists2 && !existsOK) {
+ var exists = context.isDefined(name);
+ if (exists && !existsOK) {
throw new ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand"));
}
- if (!exists2 && !nonexistsOK) {
+ if (!exists && !nonexistsOK) {
throw new ParseError("\\renewcommand{" + name + "} when command " + name + " does not yet exist; use \\newcommand");
}
var numArgs = 0;
@@ -20612,12 +20730,12 @@ var __esbuild_esm_mermaid = (() => {
* Checks a result to make sure it has the right type, and throws an
* appropriate error otherwise.
*/
- expect(text2, consume) {
+ expect(text4, consume) {
if (consume === void 0) {
consume = true;
}
- if (this.fetch().text !== text2) {
- throw new ParseError("Expected '" + text2 + "', got '" + this.fetch().text + "'", this.fetch());
+ if (this.fetch().text !== text4) {
+ throw new ParseError("Expected '" + text4 + "', got '" + this.fetch().text + "'", this.fetch());
}
if (consume) {
this.consume();
@@ -20658,12 +20776,12 @@ var __esbuild_esm_mermaid = (() => {
this.gullet.macros.set("\\color", "\\textcolor");
}
try {
- var parse8 = this.parseExpression(false);
+ var parse7 = this.parseExpression(false);
this.expect("EOF");
if (!this.settings.globalGroup) {
this.gullet.endGroup();
}
- return parse8;
+ return parse7;
} finally {
this.gullet.endGroups();
}
@@ -20677,10 +20795,10 @@ var __esbuild_esm_mermaid = (() => {
this.consume();
this.gullet.pushToken(new Token("}"));
this.gullet.pushTokens(tokens2);
- var parse8 = this.parseExpression(false);
+ var parse7 = this.parseExpression(false);
this.expect("}");
this.nextToken = oldToken;
- return parse8;
+ return parse7;
}
/**
* Parses an "expression", which is a list of atoms.
@@ -20699,14 +20817,14 @@ var __esbuild_esm_mermaid = (() => {
if (this.mode === "math") {
this.consumeSpaces();
}
- var lex2 = this.fetch();
- if (_Parser2.endOfExpression.indexOf(lex2.text) !== -1) {
+ var lex = this.fetch();
+ if (_Parser2.endOfExpression.indexOf(lex.text) !== -1) {
break;
}
- if (breakOnTokenText && lex2.text === breakOnTokenText) {
+ if (breakOnTokenText && lex.text === breakOnTokenText) {
break;
}
- if (breakOnInfix && functions[lex2.text] && functions[lex2.text].infix) {
+ if (breakOnInfix && functions[lex.text] && functions[lex.text].infix) {
break;
}
var atom2 = this.parseAtom(breakOnTokenText);
@@ -20793,13 +20911,13 @@ var __esbuild_esm_mermaid = (() => {
* Converts the textual input of an unsupported command into a text node
* contained within a color node whose color is determined by errorColor
*/
- formatUnsupportedCmd(text2) {
+ formatUnsupportedCmd(text4) {
var textordArray = [];
- for (var i2 = 0; i2 < text2.length; i2++) {
+ for (var i2 = 0; i2 < text4.length; i2++) {
textordArray.push({
type: "textord",
mode: "text",
- text: text2[i2]
+ text: text4[i2]
});
}
var textNode = {
@@ -20827,33 +20945,33 @@ var __esbuild_esm_mermaid = (() => {
var subscript;
while (true) {
this.consumeSpaces();
- var lex2 = this.fetch();
- if (lex2.text === "\\limits" || lex2.text === "\\nolimits") {
+ var lex = this.fetch();
+ if (lex.text === "\\limits" || lex.text === "\\nolimits") {
if (base && base.type === "op") {
- var limits = lex2.text === "\\limits";
+ var limits = lex.text === "\\limits";
base.limits = limits;
base.alwaysHandleSupSub = true;
} else if (base && base.type === "operatorname") {
if (base.alwaysHandleSupSub) {
- base.limits = lex2.text === "\\limits";
+ base.limits = lex.text === "\\limits";
}
} else {
- throw new ParseError("Limit controls must follow a math operator", lex2);
+ throw new ParseError("Limit controls must follow a math operator", lex);
}
this.consume();
- } else if (lex2.text === "^") {
+ } else if (lex.text === "^") {
if (superscript) {
- throw new ParseError("Double superscript", lex2);
+ throw new ParseError("Double superscript", lex);
}
superscript = this.handleSupSubscript("superscript");
- } else if (lex2.text === "_") {
+ } else if (lex.text === "_") {
if (subscript) {
- throw new ParseError("Double subscript", lex2);
+ throw new ParseError("Double subscript", lex);
}
subscript = this.handleSupSubscript("subscript");
- } else if (lex2.text === "'") {
+ } else if (lex.text === "'") {
if (superscript) {
- throw new ParseError("Double superscript", lex2);
+ throw new ParseError("Double superscript", lex);
}
var prime = {
type: "textord",
@@ -20874,10 +20992,10 @@ var __esbuild_esm_mermaid = (() => {
mode: this.mode,
body: primes
};
- } else if (uSubsAndSups[lex2.text]) {
- var isSub = unicodeSubRegEx.test(lex2.text);
+ } else if (uSubsAndSups[lex.text]) {
+ var isSub = unicodeSubRegEx.test(lex.text);
var subsupTokens = [];
- subsupTokens.push(new Token(uSubsAndSups[lex2.text]));
+ subsupTokens.push(new Token(uSubsAndSups[lex.text]));
this.consume();
while (true) {
var token2 = this.fetch().text;
@@ -21137,18 +21255,18 @@ var __esbuild_esm_mermaid = (() => {
if (!match2) {
throw new ParseError("Invalid size: '" + res.text + "'", res);
}
- var data5 = {
+ var data6 = {
number: +(match2[1] + match2[2]),
// sign + magnitude, cast to number
unit: match2[3]
};
- if (!validUnit(data5)) {
- throw new ParseError("Invalid unit: '" + data5.unit + "'", res);
+ if (!validUnit(data6)) {
+ throw new ParseError("Invalid unit: '" + data6.unit + "'", res);
}
return {
type: "size",
mode: this.mode,
- value: data5,
+ value: data6,
isBlank
};
}
@@ -21207,11 +21325,11 @@ var __esbuild_esm_mermaid = (() => {
*/
parseGroup(name, breakOnTokenText) {
var firstToken = this.fetch();
- var text2 = firstToken.text;
+ var text4 = firstToken.text;
var result;
- if (text2 === "{" || text2 === "\\begingroup") {
+ if (text4 === "{" || text4 === "\\begingroup") {
this.consume();
- var groupEnd = text2 === "{" ? "}" : "\\endgroup";
+ var groupEnd = text4 === "{" ? "}" : "\\endgroup";
this.gullet.beginGroup();
var expression = this.parseExpression(false, groupEnd);
var lastToken = this.fetch();
@@ -21226,15 +21344,15 @@ var __esbuild_esm_mermaid = (() => {
// which doesn't affect spacing in math mode, i.e., is transparent.
// https://tex.stackexchange.com/questions/1930/when-should-one-
// use-begingroup-instead-of-bgroup
- semisimple: text2 === "\\begingroup" || void 0
+ semisimple: text4 === "\\begingroup" || void 0
};
} else {
result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol();
- if (result == null && text2[0] === "\\" && !implicitCommands.hasOwnProperty(text2)) {
+ if (result == null && text4[0] === "\\" && !implicitCommands.hasOwnProperty(text4)) {
if (this.settings.throwOnError) {
- throw new ParseError("Undefined control sequence: " + text2, firstToken);
+ throw new ParseError("Undefined control sequence: " + text4, firstToken);
}
- result = this.formatUnsupportedCmd(text2);
+ result = this.formatUnsupportedCmd(text4);
this.consume();
}
}
@@ -21289,10 +21407,10 @@ var __esbuild_esm_mermaid = (() => {
*/
parseSymbol() {
var nucleus = this.fetch();
- var text2 = nucleus.text;
- if (/^\\verb[^a-zA-Z]/.test(text2)) {
+ var text4 = nucleus.text;
+ if (/^\\verb[^a-zA-Z]/.test(text4)) {
this.consume();
- var arg = text2.slice(5);
+ var arg = text4.slice(5);
var star2 = arg.charAt(0) === "*";
if (star2) {
arg = arg.slice(1);
@@ -21308,27 +21426,27 @@ var __esbuild_esm_mermaid = (() => {
star: star2
};
}
- if (unicodeSymbols.hasOwnProperty(text2[0]) && !symbols[this.mode][text2[0]]) {
+ if (unicodeSymbols.hasOwnProperty(text4[0]) && !symbols[this.mode][text4[0]]) {
if (this.settings.strict && this.mode === "math") {
- this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + text2[0] + '" used in math mode', nucleus);
+ this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + text4[0] + '" used in math mode', nucleus);
}
- text2 = unicodeSymbols[text2[0]] + text2.slice(1);
+ text4 = unicodeSymbols[text4[0]] + text4.slice(1);
}
- var match2 = combiningDiacriticalMarksEndRegex.exec(text2);
+ var match2 = combiningDiacriticalMarksEndRegex.exec(text4);
if (match2) {
- text2 = text2.substring(0, match2.index);
- if (text2 === "i") {
- text2 = "\u0131";
- } else if (text2 === "j") {
- text2 = "\u0237";
+ text4 = text4.substring(0, match2.index);
+ if (text4 === "i") {
+ text4 = "\u0131";
+ } else if (text4 === "j") {
+ text4 = "\u0237";
}
}
var symbol;
- if (symbols[this.mode][text2]) {
- if (this.settings.strict && this.mode === "math" && extraLatin.indexOf(text2) >= 0) {
- this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + text2[0] + '" used in math mode', nucleus);
+ if (symbols[this.mode][text4]) {
+ if (this.settings.strict && this.mode === "math" && extraLatin.indexOf(text4) >= 0) {
+ this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + text4[0] + '" used in math mode', nucleus);
}
- var group2 = symbols[this.mode][text2].group;
+ var group2 = symbols[this.mode][text4].group;
var loc = SourceLocation.range(nucleus);
var s2;
if (ATOMS.hasOwnProperty(group2)) {
@@ -21338,30 +21456,30 @@ var __esbuild_esm_mermaid = (() => {
mode: this.mode,
family,
loc,
- text: text2
+ text: text4
};
} else {
s2 = {
type: group2,
mode: this.mode,
loc,
- text: text2
+ text: text4
};
}
symbol = s2;
- } else if (text2.charCodeAt(0) >= 128) {
+ } else if (text4.charCodeAt(0) >= 128) {
if (this.settings.strict) {
- if (!supportedCodepoint(text2.charCodeAt(0))) {
- this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + text2[0] + '"' + (" (" + text2.charCodeAt(0) + ")"), nucleus);
+ if (!supportedCodepoint(text4.charCodeAt(0))) {
+ this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + text4[0] + '"' + (" (" + text4.charCodeAt(0) + ")"), nucleus);
} else if (this.mode === "math") {
- this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + text2[0] + '" used in math mode', nucleus);
+ this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + text4[0] + '" used in math mode', nucleus);
}
}
symbol = {
type: "textord",
mode: "text",
loc: SourceLocation.range(nucleus),
- text: text2
+ text: text4
};
} else {
return null;
@@ -21397,12 +21515,12 @@ var __esbuild_esm_mermaid = (() => {
if (!(typeof toParse === "string" || toParse instanceof String)) {
throw new TypeError("KaTeX can only parse string typed expression");
}
- var parser22 = new Parser(toParse, settings);
- delete parser22.gullet.macros.current["\\df@tag"];
- var tree = parser22.parse();
- delete parser22.gullet.macros.current["\\current@color"];
- delete parser22.gullet.macros.current["\\color"];
- if (parser22.gullet.macros.get("\\df@tag")) {
+ var parser24 = new Parser(toParse, settings);
+ delete parser24.gullet.macros.current["\\df@tag"];
+ var tree = parser24.parse();
+ delete parser24.gullet.macros.current["\\current@color"];
+ delete parser24.gullet.macros.current["\\color"];
+ if (parser24.gullet.macros.get("\\df@tag")) {
if (!settings.displayMode) {
throw new ParseError("\\tag works only in display equations");
}
@@ -21410,7 +21528,7 @@ var __esbuild_esm_mermaid = (() => {
type: "tag",
mode: "text",
body: tree,
- tag: parser22.subparse([new Token("\\df@tag")])
+ tag: parser24.subparse([new Token("\\df@tag")])
}];
}
return tree;
@@ -21423,7 +21541,7 @@ var __esbuild_esm_mermaid = (() => {
if (typeof document !== "undefined") {
if (document.compatMode !== "CSS1Compat") {
typeof console !== "undefined" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.");
- render = /* @__PURE__ */ __name(function render8() {
+ render = /* @__PURE__ */ __name(function render7() {
throw new ParseError("KaTeX doesn't work in quirks mode.");
}, "render");
}
@@ -21554,13 +21672,13 @@ var __esbuild_esm_mermaid = (() => {
// src/diagrams/common/common.ts
function setupDompurifyHooks() {
const TEMPORARY_ATTRIBUTE = "data-temp-href-target";
- import_dompurify.default.addHook("beforeSanitizeAttributes", (node2) => {
- if (node2.tagName === "A" && node2.hasAttribute("target")) {
+ purify.addHook("beforeSanitizeAttributes", (node2) => {
+ if (node2 instanceof Element && node2.tagName === "A" && node2.hasAttribute("target")) {
node2.setAttribute(TEMPORARY_ATTRIBUTE, node2.getAttribute("target") ?? "");
}
});
- import_dompurify.default.addHook("afterSanitizeAttributes", (node2) => {
- if (node2.tagName === "A" && node2.hasAttribute(TEMPORARY_ATTRIBUTE)) {
+ purify.addHook("afterSanitizeAttributes", (node2) => {
+ if (node2 instanceof Element && node2.tagName === "A" && node2.hasAttribute(TEMPORARY_ATTRIBUTE)) {
node2.setAttribute("target", node2.getAttribute(TEMPORARY_ATTRIBUTE) ?? "");
node2.removeAttribute(TEMPORARY_ATTRIBUTE);
if (node2.getAttribute("target") === "_blank") {
@@ -21569,11 +21687,11 @@ var __esbuild_esm_mermaid = (() => {
}
});
}
- var import_dompurify, lineBreakRegex, getRows, setupDompurifyHooksIfNotSetup, removeScript, sanitizeMore, sanitizeText, sanitizeTextOrArray, hasBreaks, splitBreaks, placeholderToBreak, breakToPlaceholder, getUrl, evaluate, getMax, getMin, parseGenericTypes, countOccurrence, shouldCombineSets, processSet, isMathMLSupported, katexRegex, hasKatex, calculateMathMLDimensions, renderKatex, common_default;
+ var lineBreakRegex, getRows, setupDompurifyHooksIfNotSetup, removeScript, sanitizeMore, sanitizeText, sanitizeTextOrArray, hasBreaks, splitBreaks, placeholderToBreak, breakToPlaceholder, getUrl, evaluate, getMax, getMin, parseGenericTypes, countOccurrence, shouldCombineSets, processSet, isMathMLSupported, katexRegex, hasKatex, calculateMathMLDimensions, renderKatex, common_default;
var init_common = __esm({
"src/diagrams/common/common.ts"() {
"use strict";
- import_dompurify = __toESM(require_purify(), 1);
+ init_purify_es();
lineBreakRegex = / /gi;
getRows = /* @__PURE__ */ __name((s2) => {
if (!s2) {
@@ -21594,47 +21712,47 @@ var __esbuild_esm_mermaid = (() => {
__name(setupDompurifyHooks, "setupDompurifyHooks");
removeScript = /* @__PURE__ */ __name((txt) => {
setupDompurifyHooksIfNotSetup();
- const sanitizedText = import_dompurify.default.sanitize(txt);
+ const sanitizedText = purify.sanitize(txt);
return sanitizedText;
}, "removeScript");
- sanitizeMore = /* @__PURE__ */ __name((text2, config6) => {
- if (config6.flowchart?.htmlLabels !== false) {
- const level = config6.securityLevel;
+ sanitizeMore = /* @__PURE__ */ __name((text4, config5) => {
+ if (config5.flowchart?.htmlLabels !== false) {
+ const level = config5.securityLevel;
if (level === "antiscript" || level === "strict") {
- text2 = removeScript(text2);
+ text4 = removeScript(text4);
} else if (level !== "loose") {
- text2 = breakToPlaceholder(text2);
- text2 = text2.replace(//g, ">");
- text2 = text2.replace(/=/g, "=");
- text2 = placeholderToBreak(text2);
+ text4 = breakToPlaceholder(text4);
+ text4 = text4.replace(//g, ">");
+ text4 = text4.replace(/=/g, "=");
+ text4 = placeholderToBreak(text4);
}
}
- return text2;
+ return text4;
}, "sanitizeMore");
- sanitizeText = /* @__PURE__ */ __name((text2, config6) => {
- if (!text2) {
- return text2;
+ sanitizeText = /* @__PURE__ */ __name((text4, config5) => {
+ if (!text4) {
+ return text4;
}
- if (config6.dompurifyConfig) {
- text2 = import_dompurify.default.sanitize(sanitizeMore(text2, config6), config6.dompurifyConfig).toString();
+ if (config5.dompurifyConfig) {
+ text4 = purify.sanitize(sanitizeMore(text4, config5), config5.dompurifyConfig).toString();
} else {
- text2 = import_dompurify.default.sanitize(sanitizeMore(text2, config6), {
+ text4 = purify.sanitize(sanitizeMore(text4, config5), {
FORBID_TAGS: ["style"]
}).toString();
}
- return text2;
+ return text4;
}, "sanitizeText");
- sanitizeTextOrArray = /* @__PURE__ */ __name((a2, config6) => {
+ sanitizeTextOrArray = /* @__PURE__ */ __name((a2, config5) => {
if (typeof a2 === "string") {
- return sanitizeText(a2, config6);
+ return sanitizeText(a2, config5);
}
- return a2.flat().map((x5) => sanitizeText(x5, config6));
+ return a2.flat().map((x5) => sanitizeText(x5, config5));
}, "sanitizeTextOrArray");
- hasBreaks = /* @__PURE__ */ __name((text2) => {
- return lineBreakRegex.test(text2);
+ hasBreaks = /* @__PURE__ */ __name((text4) => {
+ return lineBreakRegex.test(text4);
}, "hasBreaks");
- splitBreaks = /* @__PURE__ */ __name((text2) => {
- return text2.split(lineBreakRegex);
+ splitBreaks = /* @__PURE__ */ __name((text4) => {
+ return text4.split(lineBreakRegex);
}, "splitBreaks");
placeholderToBreak = /* @__PURE__ */ __name((s2) => {
return s2.replace(/#br#/g, " ");
@@ -21716,11 +21834,11 @@ var __esbuild_esm_mermaid = (() => {
}, "processSet");
isMathMLSupported = /* @__PURE__ */ __name(() => window.MathMLElement !== void 0, "isMathMLSupported");
katexRegex = /\$\$(.*)\$\$/g;
- hasKatex = /* @__PURE__ */ __name((text2) => (text2.match(katexRegex)?.length ?? 0) > 0, "hasKatex");
- calculateMathMLDimensions = /* @__PURE__ */ __name(async (text2, config6) => {
- text2 = await renderKatex(text2, config6);
+ hasKatex = /* @__PURE__ */ __name((text4) => (text4.match(katexRegex)?.length ?? 0) > 0, "hasKatex");
+ calculateMathMLDimensions = /* @__PURE__ */ __name(async (text4, config5) => {
+ text4 = await renderKatex(text4, config5);
const divElem = document.createElement("div");
- divElem.innerHTML = text2;
+ divElem.innerHTML = text4;
divElem.id = "katex-temp";
divElem.style.visibility = "hidden";
divElem.style.position = "absolute";
@@ -21731,16 +21849,16 @@ var __esbuild_esm_mermaid = (() => {
divElem.remove();
return dim;
}, "calculateMathMLDimensions");
- renderKatex = /* @__PURE__ */ __name(async (text2, config6) => {
- if (!hasKatex(text2)) {
- return text2;
+ renderKatex = /* @__PURE__ */ __name(async (text4, config5) => {
+ if (!hasKatex(text4)) {
+ return text4;
}
- if (!(isMathMLSupported() || config6.legacyMathML || config6.forceLegacyMathML)) {
- return text2.replace(katexRegex, "MathML is unsupported in this environment.");
+ if (!(isMathMLSupported() || config5.legacyMathML || config5.forceLegacyMathML)) {
+ return text4.replace(katexRegex, "MathML is unsupported in this environment.");
}
const { default: katex2 } = await Promise.resolve().then(() => (init_katex(), katex_exports));
- const outputMode = config6.forceLegacyMathML || !isMathMLSupported() && config6.legacyMathML ? "htmlAndMathml" : "mathml";
- return text2.split(lineBreakRegex).map(
+ const outputMode = config5.forceLegacyMathML || !isMathMLSupported() && config5.legacyMathML ? "htmlAndMathml" : "mathml";
+ return text4.split(lineBreakRegex).map(
(line2) => hasKatex(line2) ? `${line2}
` : `${line2}
`
).join("").replace(
katexRegex,
@@ -21793,7 +21911,7 @@ var __esbuild_esm_mermaid = (() => {
const attrs = calculateSvgSizeAttrs(height2, width3, useMaxWidth);
d3Attrs(svgElem, attrs);
}, "configureSvgSize");
- setupGraphViewbox = /* @__PURE__ */ __name(function(graph, svgElem, padding3, useMaxWidth) {
+ setupGraphViewbox = /* @__PURE__ */ __name(function(graph, svgElem, padding2, useMaxWidth) {
const svgBounds = svgElem.node().getBBox();
const sWidth = svgBounds.width;
const sHeight = svgBounds.height;
@@ -21801,11 +21919,11 @@ var __esbuild_esm_mermaid = (() => {
let width3 = 0;
let height2 = 0;
log.info(`Graph bounds: ${width3}x${height2}`, graph);
- width3 = sWidth + padding3 * 2;
- height2 = sHeight + padding3 * 2;
+ width3 = sWidth + padding2 * 2;
+ height2 = sHeight + padding2 * 2;
log.info(`Calculated bounds: ${width3}x${height2}`);
configureSvgSize(svgElem, height2, width3, useMaxWidth);
- const vBox = `${svgBounds.x - padding3} ${svgBounds.y - padding3} ${svgBounds.width + 2 * padding3} ${svgBounds.height + 2 * padding3}`;
+ const vBox = `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${svgBounds.width + 2 * padding2} ${svgBounds.height + 2 * padding2}`;
svgElem.attr("viewBox", vBox);
}, "setupGraphViewbox");
}
@@ -21830,7 +21948,28 @@ var __esbuild_esm_mermaid = (() => {
font-size: ${options3.fontSize};
fill: ${options3.textColor}
}
-
+ @keyframes edge-animation-frame {
+ from {
+ stroke-dashoffset: 0;
+ }
+ }
+ @keyframes dash {
+ to {
+ stroke-dashoffset: 0;
+ }
+ }
+ & .edge-animation-slow {
+ stroke-dasharray: 9,5 !important;
+ stroke-dashoffset: 900;
+ animation: dash 50s linear infinite;
+ stroke-linecap: round;
+ }
+ & .edge-animation-fast {
+ stroke-dasharray: 9,5 !important;
+ stroke-dashoffset: 900;
+ animation: dash 20s linear infinite;
+ stroke-linecap: round;
+ }
/* Classes common for multiple diagrams */
& .error-icon {
@@ -21949,22 +22088,22 @@ var __esbuild_esm_mermaid = (() => {
getConfig2 = getConfig;
setConfig2 = setConfig;
defaultConfig2 = defaultConfig;
- sanitizeText3 = /* @__PURE__ */ __name((text2) => sanitizeText(text2, getConfig2()), "sanitizeText");
+ sanitizeText3 = /* @__PURE__ */ __name((text4) => sanitizeText(text4, getConfig2()), "sanitizeText");
setupGraphViewbox2 = setupGraphViewbox;
getCommonDb = /* @__PURE__ */ __name(() => {
return commonDb_exports;
}, "getCommonDb");
diagrams = {};
- registerDiagram = /* @__PURE__ */ __name((id27, diagram24, detector25) => {
- if (diagrams[id27]) {
- log2.warn(`Diagram with id ${id27} already registered. Overwriting.`);
+ registerDiagram = /* @__PURE__ */ __name((id29, diagram26, detector27) => {
+ if (diagrams[id29]) {
+ log2.warn(`Diagram with id ${id29} already registered. Overwriting.`);
}
- diagrams[id27] = diagram24;
- if (detector25) {
- addDetector(id27, detector25);
+ diagrams[id29] = diagram26;
+ if (detector27) {
+ addDetector(id29, detector27);
}
- addStylesForDiagram(id27, diagram24.styles);
- diagram24.injectUtils?.(
+ addStylesForDiagram(id29, diagram26.styles);
+ diagram26.injectUtils?.(
log2,
setLogLevel2,
getConfig2,
@@ -22338,7 +22477,7 @@ var __esbuild_esm_mermaid = (() => {
currentBoundaryParse = alias;
boundaryParseStack.push(parentBoundaryParse);
}, "addContainerBoundary");
- addDeploymentNode = /* @__PURE__ */ __name(function(nodeType2, alias, label, type3, descr, sprite, tags2, link3) {
+ addDeploymentNode = /* @__PURE__ */ __name(function(nodeType3, alias, label, type3, descr, sprite, tags2, link3) {
if (alias === null || label === null) {
return;
}
@@ -22387,7 +22526,7 @@ var __esbuild_esm_mermaid = (() => {
} else {
boundary.link = link3;
}
- boundary.nodeType = nodeType2;
+ boundary.nodeType = nodeType3;
boundary.parentBoundary = currentBoundaryParse;
boundary.wrap = autoWrap();
parentBoundaryParse = currentBoundaryParse;
@@ -22713,16 +22852,16 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js
- function bisector(f3) {
+ function bisector(f2) {
let compare1, compare2, delta;
- if (f3.length !== 2) {
+ if (f2.length !== 2) {
compare1 = ascending;
- compare2 = /* @__PURE__ */ __name((d2, x5) => ascending(f3(d2), x5), "compare2");
- delta = /* @__PURE__ */ __name((d2, x5) => f3(d2) - x5, "delta");
+ compare2 = /* @__PURE__ */ __name((d2, x5) => ascending(f2(d2), x5), "compare2");
+ delta = /* @__PURE__ */ __name((d2, x5) => f2(d2) - x5, "delta");
} else {
- compare1 = f3 === ascending || f3 === descending ? f3 : zero;
- compare2 = f3;
- delta = f3;
+ compare1 = f2 === ascending || f2 === descending ? f2 : zero;
+ compare2 = f2;
+ delta = f2;
}
function left3(a2, x5, lo = 0, hi = a2.length) {
if (lo < hi) {
@@ -22825,10 +22964,10 @@ var __esbuild_esm_mermaid = (() => {
static {
__name(this, "InternMap");
}
- constructor(entries, key = keyof) {
+ constructor(entries2, key = keyof) {
super();
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } });
- if (entries != null) for (const [key2, value2] of entries) this.set(key2, value2);
+ if (entries2 != null) for (const [key2, value2] of entries2) this.set(key2, value2);
}
get(key) {
return super.get(intern_get(this, key));
@@ -23010,30 +23149,30 @@ var __esbuild_esm_mermaid = (() => {
function translateY(y5) {
return "translate(0," + y5 + ")";
}
- function number2(scale) {
- return (d2) => +scale(d2);
+ function number2(scale2) {
+ return (d2) => +scale2(d2);
}
- function center(scale, offset) {
- offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;
- if (scale.round()) offset = Math.round(offset);
- return (d2) => +scale(d2) + offset;
+ function center(scale2, offset) {
+ offset = Math.max(0, scale2.bandwidth() - offset * 2) / 2;
+ if (scale2.round()) offset = Math.round(offset);
+ return (d2) => +scale2(d2) + offset;
}
function entering() {
return !this.__axis;
}
- function axis(orient, scale) {
+ function axis(orient, scale2) {
var tickArguments = [], tickValues = null, tickFormat2 = null, tickSizeInner = 6, tickSizeOuter = 6, tickPadding = 3, offset = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : 0.5, k2 = orient === top || orient === left ? -1 : 1, x5 = orient === left || orient === right ? "x" : "y", transform8 = orient === top || orient === bottom ? translateX : translateY;
function axis2(context) {
- var values2 = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain() : tickValues, format3 = tickFormat2 == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity_default : tickFormat2, spacing2 = Math.max(tickSizeInner, 0) + tickPadding, range3 = scale.range(), range0 = +range3[0] + offset, range1 = +range3[range3.length - 1] + offset, position5 = (scale.bandwidth ? center : number2)(scale.copy(), offset), selection2 = context.selection ? context.selection() : context, path4 = selection2.selectAll(".domain").data([null]), tick = selection2.selectAll(".tick").data(values2, scale).order(), tickExit = tick.exit(), tickEnter = tick.enter().append("g").attr("class", "tick"), line2 = tick.select("line"), text2 = tick.select("text");
+ var values2 = tickValues == null ? scale2.ticks ? scale2.ticks.apply(scale2, tickArguments) : scale2.domain() : tickValues, format3 = tickFormat2 == null ? scale2.tickFormat ? scale2.tickFormat.apply(scale2, tickArguments) : identity_default : tickFormat2, spacing2 = Math.max(tickSizeInner, 0) + tickPadding, range3 = scale2.range(), range0 = +range3[0] + offset, range1 = +range3[range3.length - 1] + offset, position5 = (scale2.bandwidth ? center : number2)(scale2.copy(), offset), selection2 = context.selection ? context.selection() : context, path4 = selection2.selectAll(".domain").data([null]), tick = selection2.selectAll(".tick").data(values2, scale2).order(), tickExit = tick.exit(), tickEnter = tick.enter().append("g").attr("class", "tick"), line2 = tick.select("line"), text4 = tick.select("text");
path4 = path4.merge(path4.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor"));
tick = tick.merge(tickEnter);
line2 = line2.merge(tickEnter.append("line").attr("stroke", "currentColor").attr(x5 + "2", k2 * tickSizeInner));
- text2 = text2.merge(tickEnter.append("text").attr("fill", "currentColor").attr(x5, k2 * spacing2).attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
+ text4 = text4.merge(tickEnter.append("text").attr("fill", "currentColor").attr(x5, k2 * spacing2).attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
if (context !== selection2) {
path4 = path4.transition(context);
tick = tick.transition(context);
line2 = line2.transition(context);
- text2 = text2.transition(context);
+ text4 = text4.transition(context);
tickExit = tickExit.transition(context).attr("opacity", epsilon).attr("transform", function(d2) {
return isFinite(d2 = position5(d2)) ? transform8(d2 + offset) : this.getAttribute("transform");
});
@@ -23048,7 +23187,7 @@ var __esbuild_esm_mermaid = (() => {
return transform8(position5(d2) + offset);
});
line2.attr(x5 + "2", k2 * tickSizeInner);
- text2.attr(x5, k2 * spacing2).text(format3);
+ text4.attr(x5, k2 * spacing2).text(format3);
selection2.filter(entering).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");
selection2.each(function() {
this.__axis = position5;
@@ -23056,7 +23195,7 @@ var __esbuild_esm_mermaid = (() => {
}
__name(axis2, "axis");
axis2.scale = function(_2) {
- return arguments.length ? (scale = _2, axis2) : scale;
+ return arguments.length ? (scale2 = _2, axis2) : scale2;
};
axis2.ticks = function() {
return tickArguments = Array.from(arguments), axis2;
@@ -23087,11 +23226,11 @@ var __esbuild_esm_mermaid = (() => {
};
return axis2;
}
- function axisTop(scale) {
- return axis(top, scale);
+ function axisTop(scale2) {
+ return axis(top, scale2);
}
- function axisBottom(scale) {
- return axis(bottom, scale);
+ function axisBottom(scale2) {
+ return axis(bottom, scale2);
}
var top, right, bottom, left, epsilon;
var init_axis = __esm({
@@ -23183,9 +23322,9 @@ var __esbuild_esm_mermaid = (() => {
return this;
}, "on"),
copy: /* @__PURE__ */ __name(function() {
- var copy6 = {}, _2 = this._;
- for (var t4 in _2) copy6[t4] = _2[t4].slice();
- return new Dispatch(copy6);
+ var copy5 = {}, _2 = this._;
+ for (var t4 in _2) copy5[t4] = _2[t4].slice();
+ return new Dispatch(copy5);
}, "copy"),
call: /* @__PURE__ */ __name(function(type3, that) {
if ((n2 = arguments.length - 2) > 0) for (var args = new Array(n2), i2 = 0, n2, t4; i2 < n2; ++i2) args[i2] = arguments[i2 + 2];
@@ -23343,15 +23482,15 @@ var __esbuild_esm_mermaid = (() => {
function selectAll_default(select) {
if (typeof select === "function") select = arrayAll(select);
else select = selectorAll_default(select);
- for (var groups = this._groups, m2 = groups.length, subgroups = [], parents4 = [], j2 = 0; j2 < m2; ++j2) {
+ for (var groups = this._groups, m2 = groups.length, subgroups = [], parents3 = [], j2 = 0; j2 < m2; ++j2) {
for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group2[i2]) {
subgroups.push(select.call(node2, node2.__data__, i2, group2));
- parents4.push(node2);
+ parents3.push(node2);
}
}
}
- return new Selection(subgroups, parents4);
+ return new Selection(subgroups, parents3);
}
var init_selectAll = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js"() {
@@ -23513,14 +23652,14 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js
- function bindIndex(parent4, group2, enter, update2, exit, data5) {
- var i2 = 0, node2, groupLength3 = group2.length, dataLength = data5.length;
+ function bindIndex(parent4, group2, enter, update2, exit, data6) {
+ var i2 = 0, node2, groupLength3 = group2.length, dataLength = data6.length;
for (; i2 < dataLength; ++i2) {
if (node2 = group2[i2]) {
- node2.__data__ = data5[i2];
+ node2.__data__ = data6[i2];
update2[i2] = node2;
} else {
- enter[i2] = new EnterNode(parent4, data5[i2]);
+ enter[i2] = new EnterNode(parent4, data6[i2]);
}
}
for (; i2 < groupLength3; ++i2) {
@@ -23529,8 +23668,8 @@ var __esbuild_esm_mermaid = (() => {
}
}
}
- function bindKey(parent4, group2, enter, update2, exit, data5, key) {
- var i2, node2, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength3 = group2.length, dataLength = data5.length, keyValues = new Array(groupLength3), keyValue;
+ function bindKey(parent4, group2, enter, update2, exit, data6, key) {
+ var i2, node2, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength3 = group2.length, dataLength = data6.length, keyValues = new Array(groupLength3), keyValue;
for (i2 = 0; i2 < groupLength3; ++i2) {
if (node2 = group2[i2]) {
keyValues[i2] = keyValue = key.call(node2, node2.__data__, i2, group2) + "";
@@ -23542,13 +23681,13 @@ var __esbuild_esm_mermaid = (() => {
}
}
for (i2 = 0; i2 < dataLength; ++i2) {
- keyValue = key.call(parent4, data5[i2], i2, data5) + "";
+ keyValue = key.call(parent4, data6[i2], i2, data6) + "";
if (node2 = nodeByKeyValue.get(keyValue)) {
update2[i2] = node2;
- node2.__data__ = data5[i2];
+ node2.__data__ = data6[i2];
nodeByKeyValue.delete(keyValue);
} else {
- enter[i2] = new EnterNode(parent4, data5[i2]);
+ enter[i2] = new EnterNode(parent4, data6[i2]);
}
}
for (i2 = 0; i2 < groupLength3; ++i2) {
@@ -23562,11 +23701,11 @@ var __esbuild_esm_mermaid = (() => {
}
function data_default(value2, key) {
if (!arguments.length) return Array.from(this, datum);
- var bind = key ? bindKey : bindIndex, parents4 = this._parents, groups = this._groups;
+ var bind = key ? bindKey : bindIndex, parents3 = this._parents, groups = this._groups;
if (typeof value2 !== "function") value2 = constant_default(value2);
for (var m2 = groups.length, update2 = new Array(m2), enter = new Array(m2), exit = new Array(m2), j2 = 0; j2 < m2; ++j2) {
- var parent4 = parents4[j2], group2 = groups[j2], groupLength3 = group2.length, data5 = arraylike(value2.call(parent4, parent4 && parent4.__data__, j2, parents4)), dataLength = data5.length, enterGroup = enter[j2] = new Array(dataLength), updateGroup = update2[j2] = new Array(dataLength), exitGroup = exit[j2] = new Array(groupLength3);
- bind(parent4, group2, enterGroup, updateGroup, exitGroup, data5, key);
+ var parent4 = parents3[j2], group2 = groups[j2], groupLength3 = group2.length, data6 = arraylike(value2.call(parent4, parent4 && parent4.__data__, j2, parents3)), dataLength = data6.length, enterGroup = enter[j2] = new Array(dataLength), updateGroup = update2[j2] = new Array(dataLength), exitGroup = exit[j2] = new Array(groupLength3);
+ bind(parent4, group2, enterGroup, updateGroup, exitGroup, data6, key);
for (var i0 = 0, i1 = 0, previous, next3; i0 < dataLength; ++i0) {
if (previous = enterGroup[i0]) {
if (i0 >= i1) i1 = i0 + 1;
@@ -23575,13 +23714,13 @@ var __esbuild_esm_mermaid = (() => {
}
}
}
- update2 = new Selection(update2, parents4);
+ update2 = new Selection(update2, parents3);
update2._enter = enter;
update2._exit = exit;
return update2;
}
- function arraylike(data5) {
- return typeof data5 === "object" && "length" in data5 ? data5 : Array.from(data5);
+ function arraylike(data6) {
+ return typeof data6 === "object" && "length" in data6 ? data6 : Array.from(data6);
}
var init_data = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js"() {
@@ -24087,9 +24226,9 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js
function append_default(name) {
- var create2 = typeof name === "function" ? name : creator_default(name);
+ var create4 = typeof name === "function" ? name : creator_default(name);
return this.select(function() {
- return this.appendChild(create2.apply(this, arguments));
+ return this.appendChild(create4.apply(this, arguments));
});
}
var init_append = __esm({
@@ -24105,9 +24244,9 @@ var __esbuild_esm_mermaid = (() => {
return null;
}
function insert_default(name, before) {
- var create2 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before);
+ var create4 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before);
return this.select(function() {
- return this.insertBefore(create2.apply(this, arguments), select.apply(this, arguments) || null);
+ return this.insertBefore(create4.apply(this, arguments), select.apply(this, arguments) || null);
});
}
var init_insert = __esm({
@@ -24138,12 +24277,12 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js
function selection_cloneShallow() {
- var clone5 = this.cloneNode(false), parent4 = this.parentNode;
- return parent4 ? parent4.insertBefore(clone5, this.nextSibling) : clone5;
+ var clone6 = this.cloneNode(false), parent4 = this.parentNode;
+ return parent4 ? parent4.insertBefore(clone6, this.nextSibling) : clone6;
}
function selection_cloneDeep() {
- var clone5 = this.cloneNode(true), parent4 = this.parentNode;
- return parent4 ? parent4.insertBefore(clone5, this.nextSibling) : clone5;
+ var clone6 = this.cloneNode(true), parent4 = this.parentNode;
+ return parent4 ? parent4.insertBefore(clone6, this.nextSibling) : clone6;
}
function clone_default(deep) {
return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
@@ -24293,9 +24432,9 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js
- function Selection(groups, parents4) {
+ function Selection(groups, parents3) {
this._groups = groups;
- this._parents = parents4;
+ this._parents = parents3;
}
function selection() {
return new Selection([[document.documentElement]], root);
@@ -25250,7 +25389,7 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js
- function decompose_default(a2, b2, c3, d2, e3, f3) {
+ function decompose_default(a2, b2, c3, d2, e3, f2) {
var scaleX, scaleY, skewX;
if (scaleX = Math.sqrt(a2 * a2 + b2 * b2)) a2 /= scaleX, b2 /= scaleX;
if (skewX = a2 * c3 + b2 * d2) c3 -= a2 * skewX, d2 -= b2 * skewX;
@@ -25258,7 +25397,7 @@ var __esbuild_esm_mermaid = (() => {
if (a2 * d2 < b2 * c3) a2 = -a2, b2 = -b2, skewX = -skewX, scaleX = -scaleX;
return {
translateX: e3,
- translateY: f3,
+ translateY: f2,
rotate: Math.atan2(b2, a2) * degrees2,
skewX: Math.atan(skewX) * degrees2,
scaleX,
@@ -25306,12 +25445,12 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js
- function interpolateTransform(parse8, pxComma, pxParen, degParen) {
+ function interpolateTransform(parse7, pxComma, pxParen, degParen) {
function pop(s2) {
return s2.length ? s2.pop() + " " : "";
}
__name(pop, "pop");
- function translate(xa, ya, xb, yb, s2, q2) {
+ function translate2(xa, ya, xb, yb, s2, q2) {
if (xa !== xb || ya !== yb) {
var i2 = s2.push("translate(", null, pxComma, null, pxParen);
q2.push({ i: i2 - 4, x: number_default(xa, xb) }, { i: i2 - 2, x: number_default(ya, yb) });
@@ -25319,8 +25458,8 @@ var __esbuild_esm_mermaid = (() => {
s2.push("translate(" + xb + pxComma + yb + pxParen);
}
}
- __name(translate, "translate");
- function rotate(a2, b2, s2, q2) {
+ __name(translate2, "translate");
+ function rotate2(a2, b2, s2, q2) {
if (a2 !== b2) {
if (a2 - b2 > 180) b2 += 360;
else if (b2 - a2 > 180) a2 += 360;
@@ -25329,7 +25468,7 @@ var __esbuild_esm_mermaid = (() => {
s2.push(pop(s2) + "rotate(" + b2 + degParen);
}
}
- __name(rotate, "rotate");
+ __name(rotate2, "rotate");
function skewX(a2, b2, s2, q2) {
if (a2 !== b2) {
q2.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default(a2, b2) });
@@ -25338,7 +25477,7 @@ var __esbuild_esm_mermaid = (() => {
}
}
__name(skewX, "skewX");
- function scale(xa, ya, xb, yb, s2, q2) {
+ function scale2(xa, ya, xb, yb, s2, q2) {
if (xa !== xb || ya !== yb) {
var i2 = s2.push(pop(s2) + "scale(", null, ",", null, ")");
q2.push({ i: i2 - 4, x: number_default(xa, xb) }, { i: i2 - 2, x: number_default(ya, yb) });
@@ -25346,14 +25485,14 @@ var __esbuild_esm_mermaid = (() => {
s2.push(pop(s2) + "scale(" + xb + "," + yb + ")");
}
}
- __name(scale, "scale");
+ __name(scale2, "scale");
return function(a2, b2) {
var s2 = [], q2 = [];
- a2 = parse8(a2), b2 = parse8(b2);
- translate(a2.translateX, a2.translateY, b2.translateX, b2.translateY, s2, q2);
- rotate(a2.rotate, b2.rotate, s2, q2);
+ a2 = parse7(a2), b2 = parse7(b2);
+ translate2(a2.translateX, a2.translateY, b2.translateX, b2.translateY, s2, q2);
+ rotate2(a2.rotate, b2.rotate, s2, q2);
skewX(a2.skewX, b2.skewX, s2, q2);
- scale(a2.scaleX, a2.scaleY, b2.scaleX, b2.scaleY, s2, q2);
+ scale2(a2.scaleX, a2.scaleY, b2.scaleX, b2.scaleY, s2, q2);
a2 = b2 = null;
return function(t4) {
var i2 = -1, n2 = q2.length, o2;
@@ -25491,8 +25630,8 @@ var __esbuild_esm_mermaid = (() => {
clockNow = 0;
clockSkew = 0;
clock = typeof performance === "object" && performance.now ? performance : Date;
- setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f3) {
- setTimeout(f3, 17);
+ setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f2) {
+ setTimeout(f2, 17);
};
__name(now, "now");
__name(clearNow, "clearNow");
@@ -25556,11 +25695,11 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js
- function schedule_default(node2, name, id27, index, group2, timing) {
+ function schedule_default(node2, name, id29, index, group2, timing) {
var schedules = node2.__transition;
if (!schedules) node2.__transition = {};
- else if (id27 in schedules) return;
- create(node2, id27, {
+ else if (id29 in schedules) return;
+ create2(node2, id29, {
name,
index,
// For context during callback.
@@ -25576,24 +25715,24 @@ var __esbuild_esm_mermaid = (() => {
state: CREATED
});
}
- function init(node2, id27) {
- var schedule = get2(node2, id27);
+ function init(node2, id29) {
+ var schedule = get2(node2, id29);
if (schedule.state > CREATED) throw new Error("too late; already scheduled");
return schedule;
}
- function set2(node2, id27) {
- var schedule = get2(node2, id27);
+ function set2(node2, id29) {
+ var schedule = get2(node2, id29);
if (schedule.state > STARTED) throw new Error("too late; already running");
return schedule;
}
- function get2(node2, id27) {
+ function get2(node2, id29) {
var schedule = node2.__transition;
- if (!schedule || !(schedule = schedule[id27])) throw new Error("transition not found");
+ if (!schedule || !(schedule = schedule[id29])) throw new Error("transition not found");
return schedule;
}
- function create(node2, id27, self2) {
+ function create2(node2, id29, self2) {
var schedules = node2.__transition, tween;
- schedules[id27] = self2;
+ schedules[id29] = self2;
self2.timer = timer(schedule, 0, self2.time);
function schedule(elapsed) {
self2.state = SCHEDULED;
@@ -25613,7 +25752,7 @@ var __esbuild_esm_mermaid = (() => {
o2.timer.stop();
o2.on.call("interrupt", node2, node2.__data__, o2.index, o2.group);
delete schedules[i2];
- } else if (+i2 < id27) {
+ } else if (+i2 < id29) {
o2.state = ENDED;
o2.timer.stop();
o2.on.call("cancel", node2, node2.__data__, o2.index, o2.group);
@@ -25654,7 +25793,7 @@ var __esbuild_esm_mermaid = (() => {
function stop5() {
self2.state = ENDED;
self2.timer.stop();
- delete schedules[id27];
+ delete schedules[id29];
for (var i2 in schedules) return;
delete node2.__transition;
}
@@ -25679,7 +25818,7 @@ var __esbuild_esm_mermaid = (() => {
__name(init, "init");
__name(set2, "set");
__name(get2, "get");
- __name(create, "create");
+ __name(create2, "create");
}
});
@@ -25724,10 +25863,10 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js
- function tweenRemove(id27, name) {
+ function tweenRemove(id29, name) {
var tween0, tween1;
return function() {
- var schedule = set2(this, id27), tween = schedule.tween;
+ var schedule = set2(this, id29), tween = schedule.tween;
if (tween !== tween0) {
tween1 = tween0 = tween;
for (var i2 = 0, n2 = tween1.length; i2 < n2; ++i2) {
@@ -25741,11 +25880,11 @@ var __esbuild_esm_mermaid = (() => {
schedule.tween = tween1;
};
}
- function tweenFunction(id27, name, value2) {
+ function tweenFunction(id29, name, value2) {
var tween0, tween1;
if (typeof value2 !== "function") throw new Error();
return function() {
- var schedule = set2(this, id27), tween = schedule.tween;
+ var schedule = set2(this, id29), tween = schedule.tween;
if (tween !== tween0) {
tween1 = (tween0 = tween).slice();
for (var t4 = { name, value: value2 }, i2 = 0, n2 = tween1.length; i2 < n2; ++i2) {
@@ -25760,10 +25899,10 @@ var __esbuild_esm_mermaid = (() => {
};
}
function tween_default(name, value2) {
- var id27 = this._id;
+ var id29 = this._id;
name += "";
if (arguments.length < 2) {
- var tween = get2(this.node(), id27).tween;
+ var tween = get2(this.node(), id29).tween;
for (var i2 = 0, n2 = tween.length, t4; i2 < n2; ++i2) {
if ((t4 = tween[i2]).name === name) {
return t4.value;
@@ -25771,16 +25910,16 @@ var __esbuild_esm_mermaid = (() => {
}
return null;
}
- return this.each((value2 == null ? tweenRemove : tweenFunction)(id27, name, value2));
+ return this.each((value2 == null ? tweenRemove : tweenFunction)(id29, name, value2));
}
function tweenValue(transition2, name, value2) {
- var id27 = transition2._id;
+ var id29 = transition2._id;
transition2.each(function() {
- var schedule = set2(this, id27);
+ var schedule = set2(this, id29);
(schedule.value || (schedule.value = {}))[name] = value2.apply(this, arguments);
});
return function(node2) {
- return get2(node2, id27).value[name];
+ return get2(node2, id29).value[name];
};
}
var init_tween = __esm({
@@ -25928,19 +26067,19 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js
- function delayFunction(id27, value2) {
+ function delayFunction(id29, value2) {
return function() {
- init(this, id27).delay = +value2.apply(this, arguments);
+ init(this, id29).delay = +value2.apply(this, arguments);
};
}
- function delayConstant(id27, value2) {
+ function delayConstant(id29, value2) {
return value2 = +value2, function() {
- init(this, id27).delay = value2;
+ init(this, id29).delay = value2;
};
}
function delay_default(value2) {
- var id27 = this._id;
- return arguments.length ? this.each((typeof value2 === "function" ? delayFunction : delayConstant)(id27, value2)) : get2(this.node(), id27).delay;
+ var id29 = this._id;
+ return arguments.length ? this.each((typeof value2 === "function" ? delayFunction : delayConstant)(id29, value2)) : get2(this.node(), id29).delay;
}
var init_delay = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js"() {
@@ -25953,19 +26092,19 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js
- function durationFunction(id27, value2) {
+ function durationFunction(id29, value2) {
return function() {
- set2(this, id27).duration = +value2.apply(this, arguments);
+ set2(this, id29).duration = +value2.apply(this, arguments);
};
}
- function durationConstant(id27, value2) {
+ function durationConstant(id29, value2) {
return value2 = +value2, function() {
- set2(this, id27).duration = value2;
+ set2(this, id29).duration = value2;
};
}
function duration_default(value2) {
- var id27 = this._id;
- return arguments.length ? this.each((typeof value2 === "function" ? durationFunction : durationConstant)(id27, value2)) : get2(this.node(), id27).duration;
+ var id29 = this._id;
+ return arguments.length ? this.each((typeof value2 === "function" ? durationFunction : durationConstant)(id29, value2)) : get2(this.node(), id29).duration;
}
var init_duration = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js"() {
@@ -25978,15 +26117,15 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js
- function easeConstant(id27, value2) {
+ function easeConstant(id29, value2) {
if (typeof value2 !== "function") throw new Error();
return function() {
- set2(this, id27).ease = value2;
+ set2(this, id29).ease = value2;
};
}
function ease_default(value2) {
- var id27 = this._id;
- return arguments.length ? this.each(easeConstant(id27, value2)) : get2(this.node(), id27).ease;
+ var id29 = this._id;
+ return arguments.length ? this.each(easeConstant(id29, value2)) : get2(this.node(), id29).ease;
}
var init_ease = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js"() {
@@ -25998,11 +26137,11 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js
- function easeVarying(id27, value2) {
+ function easeVarying(id29, value2) {
return function() {
var v3 = value2.apply(this, arguments);
if (typeof v3 !== "function") throw new Error();
- set2(this, id27).ease = v3;
+ set2(this, id29).ease = v3;
};
}
function easeVarying_default(value2) {
@@ -26070,17 +26209,17 @@ var __esbuild_esm_mermaid = (() => {
return !t4 || t4 === "start";
});
}
- function onFunction(id27, name, listener) {
+ function onFunction(id29, name, listener) {
var on0, on1, sit = start(name) ? init : set2;
return function() {
- var schedule = sit(this, id27), on3 = schedule.on;
+ var schedule = sit(this, id29), on3 = schedule.on;
if (on3 !== on0) (on1 = (on0 = on3).copy()).on(name, listener);
schedule.on = on1;
};
}
function on_default2(name, listener) {
- var id27 = this._id;
- return arguments.length < 2 ? get2(this.node(), id27).on.on(name) : this.each(onFunction(id27, name, listener));
+ var id29 = this._id;
+ return arguments.length < 2 ? get2(this.node(), id29).on.on(name) : this.each(onFunction(id29, name, listener));
}
var init_on2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js"() {
@@ -26093,10 +26232,10 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js
- function removeFunction(id27) {
+ function removeFunction(id29) {
return function() {
var parent4 = this.parentNode;
- for (var i2 in this.__transition) if (+i2 !== id27) return;
+ for (var i2 in this.__transition) if (+i2 !== id29) return;
if (parent4) parent4.removeChild(this);
};
}
@@ -26113,18 +26252,18 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js
function select_default3(select) {
- var name = this._name, id27 = this._id;
+ var name = this._name, id29 = this._id;
if (typeof select !== "function") select = selector_default(select);
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j2 = 0; j2 < m2; ++j2) {
for (var group2 = groups[j2], n2 = group2.length, subgroup = subgroups[j2] = new Array(n2), node2, subnode, i2 = 0; i2 < n2; ++i2) {
if ((node2 = group2[i2]) && (subnode = select.call(node2, node2.__data__, i2, group2))) {
if ("__data__" in node2) subnode.__data__ = node2.__data__;
subgroup[i2] = subnode;
- schedule_default(subgroup[i2], name, id27, i2, subgroup, get2(node2, id27));
+ schedule_default(subgroup[i2], name, id29, i2, subgroup, get2(node2, id29));
}
}
}
- return new Transition(subgroups, this._parents, name, id27);
+ return new Transition(subgroups, this._parents, name, id29);
}
var init_select3 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js"() {
@@ -26138,22 +26277,22 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js
function selectAll_default2(select) {
- var name = this._name, id27 = this._id;
+ var name = this._name, id29 = this._id;
if (typeof select !== "function") select = selectorAll_default(select);
- for (var groups = this._groups, m2 = groups.length, subgroups = [], parents4 = [], j2 = 0; j2 < m2; ++j2) {
+ for (var groups = this._groups, m2 = groups.length, subgroups = [], parents3 = [], j2 = 0; j2 < m2; ++j2) {
for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group2[i2]) {
- for (var children2 = select.call(node2, node2.__data__, i2, group2), child, inherit2 = get2(node2, id27), k2 = 0, l2 = children2.length; k2 < l2; ++k2) {
+ for (var children2 = select.call(node2, node2.__data__, i2, group2), child, inherit2 = get2(node2, id29), k2 = 0, l2 = children2.length; k2 < l2; ++k2) {
if (child = children2[k2]) {
- schedule_default(child, name, id27, k2, children2, inherit2);
+ schedule_default(child, name, id29, k2, children2, inherit2);
}
}
subgroups.push(children2);
- parents4.push(node2);
+ parents3.push(node2);
}
}
}
- return new Transition(subgroups, parents4, name, id27);
+ return new Transition(subgroups, parents3, name, id29);
}
var init_selectAll2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js"() {
@@ -26207,10 +26346,10 @@ var __esbuild_esm_mermaid = (() => {
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
};
}
- function styleMaybeRemove(id27, name) {
+ function styleMaybeRemove(id29, name) {
var on0, on1, listener0, key = "style." + name, event3 = "end." + key, remove3;
return function() {
- var schedule = set2(this, id27), on3 = schedule.on, listener = schedule.value[key] == null ? remove3 || (remove3 = styleRemove2(name)) : void 0;
+ var schedule = set2(this, id29), on3 = schedule.on, listener = schedule.value[key] == null ? remove3 || (remove3 = styleRemove2(name)) : void 0;
if (on3 !== on0 || listener0 !== listener) (on1 = (on0 = on3).copy()).on(event3, listener0 = listener);
schedule.on = on1;
};
@@ -26356,13 +26495,13 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js
function end_default() {
- var on0, on1, that = this, id27 = that._id, size5 = that.size();
+ var on0, on1, that = this, id29 = that._id, size5 = that.size();
return new Promise(function(resolve3, reject3) {
var cancel = { value: reject3 }, end2 = { value: /* @__PURE__ */ __name(function() {
if (--size5 === 0) resolve3();
}, "value") };
that.each(function() {
- var schedule = set2(this, id27), on3 = schedule.on;
+ var schedule = set2(this, id29), on3 = schedule.on;
if (on3 !== on0) {
on1 = (on0 = on3).copy();
on1._.cancel.push(cancel);
@@ -26383,11 +26522,11 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js
- function Transition(groups, parents4, name, id27) {
+ function Transition(groups, parents3, name, id29) {
this._groups = groups;
- this._parents = parents4;
+ this._parents = parents3;
this._name = name;
- this._id = id27;
+ this._id = id29;
}
function transition(name) {
return selection_default().transition(name);
@@ -26480,30 +26619,30 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js
- function inherit(node2, id27) {
+ function inherit(node2, id29) {
var timing;
- while (!(timing = node2.__transition) || !(timing = timing[id27])) {
+ while (!(timing = node2.__transition) || !(timing = timing[id29])) {
if (!(node2 = node2.parentNode)) {
- throw new Error(`transition ${id27} not found`);
+ throw new Error(`transition ${id29} not found`);
}
}
return timing;
}
function transition_default2(name) {
- var id27, timing;
+ var id29, timing;
if (name instanceof Transition) {
- id27 = name._id, name = name._name;
+ id29 = name._id, name = name._name;
} else {
- id27 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
+ id29 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
}
for (var groups = this._groups, m2 = groups.length, j2 = 0; j2 < m2; ++j2) {
for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group2[i2]) {
- schedule_default(node2, name, id27, i2, group2, timing || inherit(node2, id27));
+ schedule_default(node2, name, id29, i2, group2, timing || inherit(node2, id29));
}
}
}
- return new Transition(groups, this._parents, name, id27);
+ return new Transition(groups, this._parents, name, id29);
}
var defaultTiming;
var init_transition3 = __esm({
@@ -27033,20 +27172,20 @@ var __esbuild_esm_mermaid = (() => {
}
}
if (comma && !zero3) value2 = group2(value2, Infinity);
- var length2 = valuePrefix.length + value2.length + valueSuffix.length, padding3 = length2 < width3 ? new Array(width3 - length2 + 1).join(fill) : "";
- if (comma && zero3) value2 = group2(padding3 + value2, padding3.length ? width3 - valueSuffix.length : Infinity), padding3 = "";
+ var length2 = valuePrefix.length + value2.length + valueSuffix.length, padding2 = length2 < width3 ? new Array(width3 - length2 + 1).join(fill) : "";
+ if (comma && zero3) value2 = group2(padding2 + value2, padding2.length ? width3 - valueSuffix.length : Infinity), padding2 = "";
switch (align) {
case "<":
- value2 = valuePrefix + value2 + valueSuffix + padding3;
+ value2 = valuePrefix + value2 + valueSuffix + padding2;
break;
case "=":
- value2 = valuePrefix + padding3 + value2 + valueSuffix;
+ value2 = valuePrefix + padding2 + value2 + valueSuffix;
break;
case "^":
- value2 = padding3.slice(0, length2 = padding3.length >> 1) + valuePrefix + value2 + valueSuffix + padding3.slice(length2);
+ value2 = padding2.slice(0, length2 = padding2.length >> 1) + valuePrefix + value2 + valueSuffix + padding2.slice(length2);
break;
default:
- value2 = padding3 + valuePrefix + value2 + valueSuffix;
+ value2 = padding2 + valuePrefix + value2 + valueSuffix;
break;
}
return numerals(value2);
@@ -27059,9 +27198,9 @@ var __esbuild_esm_mermaid = (() => {
}
__name(newFormat, "newFormat");
function formatPrefix2(specifier, value2) {
- var f3 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e3 = Math.max(-8, Math.min(8, Math.floor(exponent_default(value2) / 3))) * 3, k2 = Math.pow(10, -e3), prefix = prefixes[8 + e3 / 3];
+ var f2 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e3 = Math.max(-8, Math.min(8, Math.floor(exponent_default(value2) / 3))) * 3, k2 = Math.pow(10, -e3), prefix = prefixes[8 + e3 / 3];
return function(value3) {
- return f3(k2 * value3) + prefix;
+ return f2(k2 * value3) + prefix;
};
}
__name(formatPrefix2, "formatPrefix");
@@ -27210,7 +27349,7 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js
function ordinal() {
var index = new InternMap(), domain = [], range3 = [], unknown = implicit;
- function scale(d2) {
+ function scale2(d2) {
let i2 = index.get(d2);
if (i2 === void 0) {
if (unknown !== implicit) return unknown;
@@ -27218,27 +27357,27 @@ var __esbuild_esm_mermaid = (() => {
}
return range3[i2 % range3.length];
}
- __name(scale, "scale");
- scale.domain = function(_2) {
+ __name(scale2, "scale");
+ scale2.domain = function(_2) {
if (!arguments.length) return domain.slice();
domain = [], index = new InternMap();
for (const value2 of _2) {
if (index.has(value2)) continue;
index.set(value2, domain.push(value2) - 1);
}
- return scale;
+ return scale2;
};
- scale.range = function(_2) {
- return arguments.length ? (range3 = Array.from(_2), scale) : range3.slice();
+ scale2.range = function(_2) {
+ return arguments.length ? (range3 = Array.from(_2), scale2) : range3.slice();
};
- scale.unknown = function(_2) {
- return arguments.length ? (unknown = _2, scale) : unknown;
+ scale2.unknown = function(_2) {
+ return arguments.length ? (unknown = _2, scale2) : unknown;
};
- scale.copy = function() {
+ scale2.copy = function() {
return ordinal(domain, range3).unknown(unknown);
};
- initRange.apply(scale, arguments);
- return scale;
+ initRange.apply(scale2, arguments);
+ return scale2;
}
var implicit;
var init_ordinal = __esm({
@@ -27253,8 +27392,8 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js
function band() {
- var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step3, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
- delete scale.unknown;
+ var scale2 = ordinal().unknown(void 0), domain = scale2.domain, ordinalRange = scale2.range, r0 = 0, r1 = 1, step3, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
+ delete scale2.unknown;
function rescale() {
var n2 = domain().length, reverse2 = r1 < r0, start3 = reverse2 ? r1 : r0, stop5 = reverse2 ? r0 : r1;
step3 = (stop5 - start3) / Math.max(1, n2 - paddingInner + paddingOuter * 2);
@@ -27268,37 +27407,37 @@ var __esbuild_esm_mermaid = (() => {
return ordinalRange(reverse2 ? values2.reverse() : values2);
}
__name(rescale, "rescale");
- scale.domain = function(_2) {
+ scale2.domain = function(_2) {
return arguments.length ? (domain(_2), rescale()) : domain();
};
- scale.range = function(_2) {
+ scale2.range = function(_2) {
return arguments.length ? ([r0, r1] = _2, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
};
- scale.rangeRound = function(_2) {
+ scale2.rangeRound = function(_2) {
return [r0, r1] = _2, r0 = +r0, r1 = +r1, round = true, rescale();
};
- scale.bandwidth = function() {
+ scale2.bandwidth = function() {
return bandwidth;
};
- scale.step = function() {
+ scale2.step = function() {
return step3;
};
- scale.round = function(_2) {
+ scale2.round = function(_2) {
return arguments.length ? (round = !!_2, rescale()) : round;
};
- scale.padding = function(_2) {
+ scale2.padding = function(_2) {
return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_2), rescale()) : paddingInner;
};
- scale.paddingInner = function(_2) {
+ scale2.paddingInner = function(_2) {
return arguments.length ? (paddingInner = Math.min(1, _2), rescale()) : paddingInner;
};
- scale.paddingOuter = function(_2) {
+ scale2.paddingOuter = function(_2) {
return arguments.length ? (paddingOuter = +_2, rescale()) : paddingOuter;
};
- scale.align = function(_2) {
+ scale2.align = function(_2) {
return arguments.length ? (align = Math.max(0, Math.min(1, _2)), rescale()) : align;
};
- scale.copy = function() {
+ scale2.copy = function() {
return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
};
return initRange.apply(rescale(), arguments);
@@ -27386,33 +27525,33 @@ var __esbuild_esm_mermaid = (() => {
if (clamp !== identity2) clamp = clamper(domain[0], domain[n2 - 1]);
piecewise = n2 > 2 ? polymap : bimap;
output2 = input = null;
- return scale;
+ return scale2;
}
__name(rescale, "rescale");
- function scale(x5) {
+ function scale2(x5) {
return x5 == null || isNaN(x5 = +x5) ? unknown : (output2 || (output2 = piecewise(domain.map(transform8), range3, interpolate)))(transform8(clamp(x5)));
}
- __name(scale, "scale");
- scale.invert = function(y5) {
+ __name(scale2, "scale");
+ scale2.invert = function(y5) {
return clamp(untransform((input || (input = piecewise(range3, domain.map(transform8), number_default)))(y5)));
};
- scale.domain = function(_2) {
+ scale2.domain = function(_2) {
return arguments.length ? (domain = Array.from(_2, number3), rescale()) : domain.slice();
};
- scale.range = function(_2) {
+ scale2.range = function(_2) {
return arguments.length ? (range3 = Array.from(_2), rescale()) : range3.slice();
};
- scale.rangeRound = function(_2) {
+ scale2.rangeRound = function(_2) {
return range3 = Array.from(_2), interpolate = round_default, rescale();
};
- scale.clamp = function(_2) {
+ scale2.clamp = function(_2) {
return arguments.length ? (clamp = _2 ? true : identity2, rescale()) : clamp !== identity2;
};
- scale.interpolate = function(_2) {
+ scale2.interpolate = function(_2) {
return arguments.length ? (interpolate = _2, rescale()) : interpolate;
};
- scale.unknown = function(_2) {
- return arguments.length ? (unknown = _2, scale) : unknown;
+ scale2.unknown = function(_2) {
+ return arguments.length ? (unknown = _2, scale2) : unknown;
};
return function(t4, u2) {
transform8 = t4, untransform = u2;
@@ -27478,17 +27617,17 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js
- function linearish(scale) {
- var domain = scale.domain;
- scale.ticks = function(count) {
+ function linearish(scale2) {
+ var domain = scale2.domain;
+ scale2.ticks = function(count) {
var d2 = domain();
return ticks(d2[0], d2[d2.length - 1], count == null ? 10 : count);
};
- scale.tickFormat = function(count, specifier) {
+ scale2.tickFormat = function(count, specifier) {
var d2 = domain();
return tickFormat(d2[0], d2[d2.length - 1], count == null ? 10 : count, specifier);
};
- scale.nice = function(count) {
+ scale2.nice = function(count) {
if (count == null) count = 10;
var d2 = domain();
var i0 = 0;
@@ -27519,17 +27658,17 @@ var __esbuild_esm_mermaid = (() => {
}
prestep = step3;
}
- return scale;
+ return scale2;
};
- return scale;
+ return scale2;
}
function linear2() {
- var scale = continuous();
- scale.copy = function() {
- return copy(scale, linear2());
+ var scale2 = continuous();
+ scale2.copy = function() {
+ return copy(scale2, linear2());
};
- initRange.apply(scale, arguments);
- return linearish(scale);
+ initRange.apply(scale2, arguments);
+ return linearish(scale2);
}
var init_linear = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js"() {
@@ -28201,14 +28340,14 @@ var __esbuild_esm_mermaid = (() => {
}
__name(newParse, "newParse");
function parseSpecifier(d2, specifier, string3, j2) {
- var i2 = 0, n2 = specifier.length, m2 = string3.length, c3, parse8;
+ var i2 = 0, n2 = specifier.length, m2 = string3.length, c3, parse7;
while (i2 < n2) {
if (j2 >= m2) return -1;
c3 = specifier.charCodeAt(i2++);
if (c3 === 37) {
c3 = specifier.charAt(i2++);
- parse8 = parses[c3 in pads ? specifier.charAt(i2++) : c3];
- if (!parse8 || (j2 = parse8(d2, string3, j2)) < 0) return -1;
+ parse7 = parses[c3 in pads ? specifier.charAt(i2++) : c3];
+ if (!parse7 || (j2 = parse7(d2, string3, j2)) < 0) return -1;
} else if (c3 != string3.charCodeAt(j2++)) {
return -1;
}
@@ -28303,11 +28442,11 @@ var __esbuild_esm_mermaid = (() => {
__name(formatUTCQuarter, "formatUTCQuarter");
return {
format: /* @__PURE__ */ __name(function(specifier) {
- var f3 = newFormat(specifier += "", formats);
- f3.toString = function() {
+ var f2 = newFormat(specifier += "", formats);
+ f2.toString = function() {
return specifier;
};
- return f3;
+ return f2;
}, "format"),
parse: /* @__PURE__ */ __name(function(specifier) {
var p3 = newParse(specifier += "", false);
@@ -28317,11 +28456,11 @@ var __esbuild_esm_mermaid = (() => {
return p3;
}, "parse"),
utcFormat: /* @__PURE__ */ __name(function(specifier) {
- var f3 = newFormat(specifier += "", utcFormats);
- f3.toString = function() {
+ var f2 = newFormat(specifier += "", utcFormats);
+ f2.toString = function() {
return specifier;
};
- return f3;
+ return f2;
}, "utcFormat"),
utcParse: /* @__PURE__ */ __name(function(specifier) {
var p3 = newParse(specifier += "", true);
@@ -28694,34 +28833,34 @@ var __esbuild_esm_mermaid = (() => {
return t4 instanceof Date ? +t4 : +/* @__PURE__ */ new Date(+t4);
}
function calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format3) {
- var scale = continuous(), invert2 = scale.invert, domain = scale.domain;
+ var scale2 = continuous(), invert2 = scale2.invert, domain = scale2.domain;
var formatMillisecond = format3(".%L"), formatSecond = format3(":%S"), formatMinute = format3("%I:%M"), formatHour = format3("%I %p"), formatDay = format3("%a %d"), formatWeek = format3("%b %d"), formatMonth = format3("%B"), formatYear2 = format3("%Y");
function tickFormat2(date2) {
return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2);
}
__name(tickFormat2, "tickFormat");
- scale.invert = function(y5) {
+ scale2.invert = function(y5) {
return new Date(invert2(y5));
};
- scale.domain = function(_2) {
+ scale2.domain = function(_2) {
return arguments.length ? domain(Array.from(_2, number4)) : domain().map(date);
};
- scale.ticks = function(interval2) {
+ scale2.ticks = function(interval2) {
var d2 = domain();
return ticks2(d2[0], d2[d2.length - 1], interval2 == null ? 10 : interval2);
};
- scale.tickFormat = function(count, specifier) {
+ scale2.tickFormat = function(count, specifier) {
return specifier == null ? tickFormat2 : format3(specifier);
};
- scale.nice = function(interval2) {
+ scale2.nice = function(interval2) {
var d2 = domain();
if (!interval2 || typeof interval2.range !== "function") interval2 = tickInterval2(d2[0], d2[d2.length - 1], interval2 == null ? 10 : interval2);
- return interval2 ? domain(nice(d2, interval2)) : scale;
+ return interval2 ? domain(nice(d2, interval2)) : scale2;
};
- scale.copy = function() {
- return copy(scale, calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format3));
+ scale2.copy = function() {
+ return copy(scale2, calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format3));
};
- return scale;
+ return scale2;
}
function time() {
return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
@@ -29040,6 +29179,7 @@ var __esbuild_esm_mermaid = (() => {
break;
case 1:
this._point = 2;
+ // falls through
default:
this._context.lineTo(x5, y5);
break;
@@ -29070,15 +29210,15 @@ var __esbuild_esm_mermaid = (() => {
var defined = constant_default4(true), context = null, curve = linear_default, output2 = null, path4 = withPath(line2);
x5 = typeof x5 === "function" ? x5 : x5 === void 0 ? x : constant_default4(x5);
y5 = typeof y5 === "function" ? y5 : y5 === void 0 ? y : constant_default4(y5);
- function line2(data5) {
- var i2, n2 = (data5 = array_default(data5)).length, d2, defined0 = false, buffer;
+ function line2(data6) {
+ var i2, n2 = (data6 = array_default(data6)).length, d2, defined0 = false, buffer;
if (context == null) output2 = curve(buffer = path4());
for (i2 = 0; i2 <= n2; ++i2) {
- if (!(i2 < n2 && defined(d2 = data5[i2], i2, data5)) === defined0) {
+ if (!(i2 < n2 && defined(d2 = data6[i2], i2, data6)) === defined0) {
if (defined0 = !defined0) output2.lineStart();
else output2.lineEnd();
}
- if (defined0) output2.point(+x5(d2, i2, data5), +y5(d2, i2, data5));
+ if (defined0) output2.point(+x5(d2, i2, data6), +y5(d2, i2, data6));
}
if (buffer) return output2 = null, buffer + "" || null;
}
@@ -29137,10 +29277,10 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/pie.js
function pie_default() {
var value2 = identity_default3, sortValues = descending_default, sort3 = null, startAngle = constant_default4(0), endAngle = constant_default4(tau2), padAngle = constant_default4(0);
- function pie2(data5) {
- var i2, n2 = (data5 = array_default(data5)).length, j2, k2, sum2 = 0, index = new Array(n2), arcs = new Array(n2), a0 = +startAngle.apply(this, arguments), da = Math.min(tau2, Math.max(-tau2, endAngle.apply(this, arguments) - a0)), a1, p3 = Math.min(Math.abs(da) / n2, padAngle.apply(this, arguments)), pa = p3 * (da < 0 ? -1 : 1), v3;
+ function pie2(data6) {
+ var i2, n2 = (data6 = array_default(data6)).length, j2, k2, sum2 = 0, index = new Array(n2), arcs = new Array(n2), a0 = +startAngle.apply(this, arguments), da = Math.min(tau2, Math.max(-tau2, endAngle.apply(this, arguments) - a0)), a1, p3 = Math.min(Math.abs(da) / n2, padAngle.apply(this, arguments)), pa = p3 * (da < 0 ? -1 : 1), v3;
for (i2 = 0; i2 < n2; ++i2) {
- if ((v3 = arcs[index[i2] = i2] = +value2(data5[i2], i2, data5)) > 0) {
+ if ((v3 = arcs[index[i2] = i2] = +value2(data6[i2], i2, data6)) > 0) {
sum2 += v3;
}
}
@@ -29148,11 +29288,11 @@ var __esbuild_esm_mermaid = (() => {
return sortValues(arcs[i3], arcs[j3]);
});
else if (sort3 != null) index.sort(function(i3, j3) {
- return sort3(data5[i3], data5[j3]);
+ return sort3(data6[i3], data6[j3]);
});
for (i2 = 0, k2 = sum2 ? (da - n2 * pa) / sum2 : 0; i2 < n2; ++i2, a0 = a1) {
j2 = index[i2], v3 = arcs[j2], a1 = a0 + (v3 > 0 ? v3 * k2 : 0) + pa, arcs[j2] = {
- data: data5[j2],
+ data: data6[j2],
index: i2,
value: v3,
startAngle: a0,
@@ -29238,6 +29378,7 @@ var __esbuild_esm_mermaid = (() => {
}
case 1:
this._point = 2;
+ // falls through
default: {
if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x5) / 2, this._y0, this._x0, y5, x5, y5);
else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y5) / 2, x5, this._y0, x5, y5);
@@ -29299,6 +29440,7 @@ var __esbuild_esm_mermaid = (() => {
switch (this._point) {
case 3:
point2(this, this._x1, this._y1);
+ // falls through
case 2:
this._context.lineTo(this._x1, this._y1);
break;
@@ -29319,6 +29461,7 @@ var __esbuild_esm_mermaid = (() => {
case 2:
this._point = 3;
this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
+ // falls through
default:
point2(this, x5, y5);
break;
@@ -29443,6 +29586,7 @@ var __esbuild_esm_mermaid = (() => {
break;
case 3:
this._point = 4;
+ // falls through
default:
point2(this, x5, y5);
break;
@@ -29562,6 +29706,7 @@ var __esbuild_esm_mermaid = (() => {
break;
case 2:
this._point = 3;
+ // falls through
default:
point3(this, x5, y5);
break;
@@ -29699,6 +29844,7 @@ var __esbuild_esm_mermaid = (() => {
break;
case 3:
this._point = 4;
+ // falls through
default:
point3(this, x5, y5);
break;
@@ -29786,6 +29932,7 @@ var __esbuild_esm_mermaid = (() => {
break;
case 2:
this._point = 3;
+ // falls through
default:
point4(this, x5, y5);
break;
@@ -29937,6 +30084,7 @@ var __esbuild_esm_mermaid = (() => {
break;
case 3:
this._point = 4;
+ // falls through
default:
point4(this, x5, y5);
break;
@@ -30206,6 +30354,7 @@ var __esbuild_esm_mermaid = (() => {
break;
case 1:
this._point = 2;
+ // falls through
default: {
if (this._t <= 0) {
this._context.lineTo(this._x, y5);
@@ -30611,7 +30760,7 @@ var __esbuild_esm_mermaid = (() => {
let sanitizedLink = link3.startsWith("data:image/png;base64") ? link3 : (0, import_sanitize_url2.sanitizeUrl)(link3);
imageElem.attr("xlink:href", sanitizedLink);
}, "drawImage");
- drawRels = /* @__PURE__ */ __name((elem, rels2, conf8) => {
+ drawRels = /* @__PURE__ */ __name((elem, rels2, conf5) => {
const relsElem = elem.append("g");
let i2 = 0;
for (let rel2 of rels2) {
@@ -30652,8 +30801,8 @@ var __esbuild_esm_mermaid = (() => {
line2.attr("marker-start", "url(" + url + "#arrowend)");
}
}
- let messageConf = conf8.messageFont();
- _drawTextCandidateFunc(conf8)(
+ let messageConf = conf5.messageFont();
+ _drawTextCandidateFunc(conf5)(
rel2.label.text,
relsElem,
Math.min(rel2.startPoint.x, rel2.endPoint.x) + Math.abs(rel2.endPoint.x - rel2.startPoint.x) / 2 + offsetX,
@@ -30664,12 +30813,12 @@ var __esbuild_esm_mermaid = (() => {
messageConf
);
if (rel2.techn && rel2.techn.text !== "") {
- messageConf = conf8.messageFont();
- _drawTextCandidateFunc(conf8)(
+ messageConf = conf5.messageFont();
+ _drawTextCandidateFunc(conf5)(
"[" + rel2.techn.text + "]",
relsElem,
Math.min(rel2.startPoint.x, rel2.endPoint.x) + Math.abs(rel2.endPoint.x - rel2.startPoint.x) / 2 + offsetX,
- Math.min(rel2.startPoint.y, rel2.endPoint.y) + Math.abs(rel2.endPoint.y - rel2.startPoint.y) / 2 + conf8.messageFontSize + 5 + offsetY,
+ Math.min(rel2.startPoint.y, rel2.endPoint.y) + Math.abs(rel2.endPoint.y - rel2.startPoint.y) / 2 + conf5.messageFontSize + 5 + offsetY,
Math.max(rel2.label.width, rel2.techn.width),
rel2.techn.height,
{ fill: textColor, "font-style": "italic" },
@@ -30678,7 +30827,7 @@ var __esbuild_esm_mermaid = (() => {
}
}
}, "drawRels");
- drawBoundary = /* @__PURE__ */ __name(function(elem, boundary, conf8) {
+ drawBoundary = /* @__PURE__ */ __name(function(elem, boundary, conf5) {
const boundaryElem = elem.append("g");
let fillColor = boundary.bgColor ? boundary.bgColor : "none";
let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444";
@@ -30699,11 +30848,11 @@ var __esbuild_esm_mermaid = (() => {
attrs: attrsValue
};
drawRect2(boundaryElem, rectData);
- let boundaryConf = conf8.boundaryFont();
+ let boundaryConf = conf5.boundaryFont();
boundaryConf.fontWeight = "bold";
boundaryConf.fontSize = boundaryConf.fontSize + 2;
boundaryConf.fontColor = fontColor;
- _drawTextCandidateFunc(conf8)(
+ _drawTextCandidateFunc(conf5)(
boundary.label.text,
boundaryElem,
boundary.x,
@@ -30714,9 +30863,9 @@ var __esbuild_esm_mermaid = (() => {
boundaryConf
);
if (boundary.type && boundary.type.text !== "") {
- boundaryConf = conf8.boundaryFont();
+ boundaryConf = conf5.boundaryFont();
boundaryConf.fontColor = fontColor;
- _drawTextCandidateFunc(conf8)(
+ _drawTextCandidateFunc(conf5)(
boundary.type.text,
boundaryElem,
boundary.x,
@@ -30728,10 +30877,10 @@ var __esbuild_esm_mermaid = (() => {
);
}
if (boundary.descr && boundary.descr.text !== "") {
- boundaryConf = conf8.boundaryFont();
+ boundaryConf = conf5.boundaryFont();
boundaryConf.fontSize = boundaryConf.fontSize - 2;
boundaryConf.fontColor = fontColor;
- _drawTextCandidateFunc(conf8)(
+ _drawTextCandidateFunc(conf5)(
boundary.descr.text,
boundaryElem,
boundary.x,
@@ -30743,9 +30892,9 @@ var __esbuild_esm_mermaid = (() => {
);
}
}, "drawBoundary");
- drawC4Shape = /* @__PURE__ */ __name(function(elem, c4Shape, conf8) {
- let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf8[c4Shape.typeC4Shape.text + "_bg_color"];
- let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf8[c4Shape.typeC4Shape.text + "_border_color"];
+ drawC4Shape = /* @__PURE__ */ __name(function(elem, c4Shape, conf5) {
+ let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf5[c4Shape.typeC4Shape.text + "_bg_color"];
+ let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf5[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) {
@@ -30758,7 +30907,7 @@ var __esbuild_esm_mermaid = (() => {
}
const c4ShapeElem = elem.append("g");
c4ShapeElem.attr("class", "person-man");
- const rect4 = getNoteRect();
+ const rect3 = getNoteRect();
switch (c4Shape.typeC4Shape.text) {
case "person":
case "external_person":
@@ -30768,16 +30917,16 @@ var __esbuild_esm_mermaid = (() => {
case "external_container":
case "component":
case "external_component":
- rect4.x = c4Shape.x;
- rect4.y = c4Shape.y;
- rect4.fill = fillColor;
- rect4.width = c4Shape.width;
- rect4.height = c4Shape.height;
- rect4.stroke = strokeColor;
- rect4.rx = 2.5;
- rect4.ry = 2.5;
- rect4.attrs = { "stroke-width": 0.5 };
- drawRect2(c4ShapeElem, rect4);
+ rect3.x = c4Shape.x;
+ rect3.y = c4Shape.y;
+ rect3.fill = fillColor;
+ rect3.width = c4Shape.width;
+ rect3.height = c4Shape.height;
+ rect3.stroke = strokeColor;
+ rect3.rx = 2.5;
+ rect3.ry = 2.5;
+ rect3.attrs = { "stroke-width": 0.5 };
+ drawRect2(c4ShapeElem, rect3);
break;
case "system_db":
case "external_system_db":
@@ -30810,7 +30959,7 @@ var __esbuild_esm_mermaid = (() => {
);
break;
}
- let c4ShapeFontConf = getC4ShapeFont(conf8, c4Shape.typeC4Shape.text);
+ let c4ShapeFontConf = getC4ShapeFont(conf5, 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":
@@ -30825,11 +30974,11 @@ var __esbuild_esm_mermaid = (() => {
);
break;
}
- let textFontConf = conf8[c4Shape.typeC4Shape.text + "Font"]();
+ let textFontConf = conf5[c4Shape.typeC4Shape.text + "Font"]();
textFontConf.fontWeight = "bold";
textFontConf.fontSize = textFontConf.fontSize + 2;
textFontConf.fontColor = fontColor;
- _drawTextCandidateFunc(conf8)(
+ _drawTextCandidateFunc(conf5)(
c4Shape.label.text,
c4ShapeElem,
c4Shape.x,
@@ -30839,10 +30988,10 @@ var __esbuild_esm_mermaid = (() => {
{ fill: fontColor },
textFontConf
);
- textFontConf = conf8[c4Shape.typeC4Shape.text + "Font"]();
+ textFontConf = conf5[c4Shape.typeC4Shape.text + "Font"]();
textFontConf.fontColor = fontColor;
if (c4Shape.techn && c4Shape.techn?.text !== "") {
- _drawTextCandidateFunc(conf8)(
+ _drawTextCandidateFunc(conf5)(
c4Shape.techn.text,
c4ShapeElem,
c4Shape.x,
@@ -30853,7 +31002,7 @@ var __esbuild_esm_mermaid = (() => {
textFontConf
);
} else if (c4Shape.type && c4Shape.type.text !== "") {
- _drawTextCandidateFunc(conf8)(
+ _drawTextCandidateFunc(conf5)(
c4Shape.type.text,
c4ShapeElem,
c4Shape.x,
@@ -30865,9 +31014,9 @@ var __esbuild_esm_mermaid = (() => {
);
}
if (c4Shape.descr && c4Shape.descr.text !== "") {
- textFontConf = conf8.personFont();
+ textFontConf = conf5.personFont();
textFontConf.fontColor = fontColor;
- _drawTextCandidateFunc(conf8)(
+ _drawTextCandidateFunc(conf5)(
c4Shape.descr.text,
c4ShapeElem,
c4Shape.x,
@@ -30925,28 +31074,28 @@ var __esbuild_esm_mermaid = (() => {
}, "getC4ShapeFont");
_drawTextCandidateFunc = /* @__PURE__ */ function() {
function byText(content, g2, x5, y5, width3, height2, textAttrs) {
- const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("text-anchor", "middle").text(content);
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("text-anchor", "middle").text(content);
+ _setTextAttrs(text4, textAttrs);
}
__name(byText, "byText");
- function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
- const { fontSize, fontFamily, fontWeight } = conf8;
+ function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
+ const { fontSize, fontFamily, fontWeight } = conf5;
const lines = content.split(common_default.lineBreakRegex);
for (let i2 = 0; i2 < lines.length; i2++) {
const dy = i2 * fontSize - fontSize * (lines.length - 1) / 2;
- const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily);
- text2.append("tspan").attr("dy", dy).text(lines[i2]).attr("alignment-baseline", "mathematical");
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily);
+ text4.append("tspan").attr("dy", dy).text(lines[i2]).attr("alignment-baseline", "mathematical");
+ _setTextAttrs(text4, textAttrs);
}
}
__name(byTspan, "byTspan");
- function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
+ function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
const s2 = g2.append("switch");
- const f3 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
- const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
- text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
- byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf8);
- _setTextAttrs(text2, textAttrs);
+ const f2 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
+ const text4 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
+ text4.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
+ byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf5);
+ _setTextAttrs(text4, textAttrs);
}
__name(byFo, "byFo");
function _setTextAttrs(toText, fromTextAttrsDict) {
@@ -30957,8 +31106,8 @@ var __esbuild_esm_mermaid = (() => {
}
}
__name(_setTextAttrs, "_setTextAttrs");
- return function(conf8) {
- return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan;
+ return function(conf5) {
+ return conf5.textPlacement === "fo" ? byFo : conf5.textPlacement === "old" ? byText : byTspan;
};
}();
svgDraw_default = {
@@ -31274,12 +31423,12 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js
function hashGet(key) {
- var data5 = this.__data__;
+ var data6 = this.__data__;
if (nativeCreate_default) {
- var result = data5[key];
+ var result = data6[key];
return result === HASH_UNDEFINED ? void 0 : result;
}
- return hasOwnProperty3.call(data5, key) ? data5[key] : void 0;
+ return hasOwnProperty3.call(data6, key) ? data6[key] : void 0;
}
var HASH_UNDEFINED, objectProto4, hasOwnProperty3, hashGet_default;
var init_hashGet = __esm({
@@ -31296,8 +31445,8 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js
function hashHas(key) {
- var data5 = this.__data__;
- return nativeCreate_default ? data5[key] !== void 0 : hasOwnProperty4.call(data5, key);
+ var data6 = this.__data__;
+ return nativeCreate_default ? data6[key] !== void 0 : hasOwnProperty4.call(data6, key);
}
var objectProto5, hasOwnProperty4, hashHas_default;
var init_hashHas = __esm({
@@ -31313,9 +31462,9 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js
function hashSet(key, value2) {
- var data5 = this.__data__;
+ var data6 = this.__data__;
this.size += this.has(key) ? 0 : 1;
- data5[key] = nativeCreate_default && value2 === void 0 ? HASH_UNDEFINED2 : value2;
+ data6[key] = nativeCreate_default && value2 === void 0 ? HASH_UNDEFINED2 : value2;
return this;
}
var HASH_UNDEFINED2, hashSet_default;
@@ -31330,11 +31479,11 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js
- function Hash(entries) {
- var index = -1, length2 = entries == null ? 0 : entries.length;
+ function Hash(entries2) {
+ var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
- var entry = entries[index];
+ var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
@@ -31372,8 +31521,8 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js
- function eq(value2, other) {
- return value2 === other || value2 !== value2 && other !== other;
+ function eq(value2, other2) {
+ return value2 === other2 || value2 !== value2 && other2 !== other2;
}
var eq_default;
var init_eq = __esm({
@@ -31406,15 +31555,15 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js
function listCacheDelete(key) {
- var data5 = this.__data__, index = assocIndexOf_default(data5, key);
+ var data6 = this.__data__, index = assocIndexOf_default(data6, key);
if (index < 0) {
return false;
}
- var lastIndex = data5.length - 1;
+ var lastIndex = data6.length - 1;
if (index == lastIndex) {
- data5.pop();
+ data6.pop();
} else {
- splice.call(data5, index, 1);
+ splice.call(data6, index, 1);
}
--this.size;
return true;
@@ -31433,8 +31582,8 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js
function listCacheGet(key) {
- var data5 = this.__data__, index = assocIndexOf_default(data5, key);
- return index < 0 ? void 0 : data5[index][1];
+ var data6 = this.__data__, index = assocIndexOf_default(data6, key);
+ return index < 0 ? void 0 : data6[index][1];
}
var listCacheGet_default;
var init_listCacheGet = __esm({
@@ -31462,12 +31611,12 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js
function listCacheSet(key, value2) {
- var data5 = this.__data__, index = assocIndexOf_default(data5, key);
+ var data6 = this.__data__, index = assocIndexOf_default(data6, key);
if (index < 0) {
++this.size;
- data5.push([key, value2]);
+ data6.push([key, value2]);
} else {
- data5[index][1] = value2;
+ data6[index][1] = value2;
}
return this;
}
@@ -31482,11 +31631,11 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js
- function ListCache(entries) {
- var index = -1, length2 = entries == null ? 0 : entries.length;
+ function ListCache(entries2) {
+ var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
- var entry = entries[index];
+ var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
@@ -31558,8 +31707,8 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js
function getMapData(map5, key) {
- var data5 = map5.__data__;
- return isKeyable_default(key) ? data5[typeof key == "string" ? "string" : "hash"] : data5.map;
+ var data6 = map5.__data__;
+ return isKeyable_default(key) ? data6[typeof key == "string" ? "string" : "hash"] : data6.map;
}
var getMapData_default;
var init_getMapData = __esm({
@@ -31617,9 +31766,9 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js
function mapCacheSet(key, value2) {
- var data5 = getMapData_default(this, key), size5 = data5.size;
- data5.set(key, value2);
- this.size += data5.size == size5 ? 0 : 1;
+ var data6 = getMapData_default(this, key), size5 = data6.size;
+ data6.set(key, value2);
+ this.size += data6.size == size5 ? 0 : 1;
return this;
}
var mapCacheSet_default;
@@ -31633,11 +31782,11 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js
- function MapCache(entries) {
- var index = -1, length2 = entries == null ? 0 : entries.length;
+ function MapCache(entries2) {
+ var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
- var entry = entries[index];
+ var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
@@ -31706,8 +31855,8 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js
function stackDelete(key) {
- var data5 = this.__data__, result = data5["delete"](key);
- this.size = data5.size;
+ var data6 = this.__data__, result = data6["delete"](key);
+ this.size = data6.size;
return result;
}
var stackDelete_default;
@@ -31747,18 +31896,18 @@ var __esbuild_esm_mermaid = (() => {
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js
function stackSet(key, value2) {
- var data5 = this.__data__;
- if (data5 instanceof ListCache_default) {
- var pairs2 = data5.__data__;
+ var data6 = this.__data__;
+ if (data6 instanceof ListCache_default) {
+ var pairs2 = data6.__data__;
if (!Map_default || pairs2.length < LARGE_ARRAY_SIZE - 1) {
pairs2.push([key, value2]);
- this.size = ++data5.size;
+ this.size = ++data6.size;
return this;
}
- data5 = this.__data__ = new MapCache_default(pairs2);
+ data6 = this.__data__ = new MapCache_default(pairs2);
}
- data5.set(key, value2);
- this.size = data5.size;
+ data6.set(key, value2);
+ this.size = data6.size;
return this;
}
var LARGE_ARRAY_SIZE, stackSet_default;
@@ -31775,9 +31924,9 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js
- function Stack(entries) {
- var data5 = this.__data__ = new ListCache_default(entries);
- this.size = data5.size;
+ function Stack(entries2) {
+ var data6 = this.__data__ = new ListCache_default(entries2);
+ this.size = data6.size;
}
var Stack_default;
var init_Stack = __esm({
@@ -32644,7 +32793,7 @@ var __esbuild_esm_mermaid = (() => {
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js
- function apply(func, thisArg, args) {
+ function apply2(func, thisArg, args) {
switch (args.length) {
case 0:
return func.call(thisArg);
@@ -32661,8 +32810,8 @@ var __esbuild_esm_mermaid = (() => {
var init_apply = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js"() {
"use strict";
- __name(apply, "apply");
- apply_default = apply;
+ __name(apply2, "apply");
+ apply_default = apply2;
}
});
@@ -32861,12 +33010,12 @@ var __esbuild_esm_mermaid = (() => {
const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;
return d3CurveTypes[curveName] ?? defaultCurve;
}
- function formatUrl(linkStr, config6) {
+ function formatUrl(linkStr, config5) {
const url = linkStr.trim();
if (!url) {
return void 0;
}
- if (config6.securityLevel !== "loose") {
+ if (config5.securityLevel !== "loose") {
return (0, import_sanitize_url3.sanitizeUrl)(url);
}
return url;
@@ -32942,17 +33091,20 @@ var __esbuild_esm_mermaid = (() => {
}
return result;
}
- function calculateTextHeight(text2, config6) {
- return calculateTextDimensions(text2, config6).height;
+ function calculateTextHeight(text4, config5) {
+ return calculateTextDimensions(text4, config5).height;
}
- function calculateTextWidth(text2, config6) {
- return calculateTextDimensions(text2, config6).width;
+ function calculateTextWidth(text4, config5) {
+ return calculateTextDimensions(text4, config5).width;
}
function isDetailedError(error3) {
return "str" in error3;
}
- function cleanAndMerge(defaultData, data5) {
- return merge_default3({}, defaultData, data5);
+ function cleanAndMerge(defaultData, data6) {
+ return merge_default3({}, defaultData, data6);
+ }
+ function handleUndefinedAttr(attrValue) {
+ return attrValue ?? null;
}
var import_sanitize_url3, ZERO_WIDTH_SPACE, d3CurveTypes, directiveWithoutOpen, detectInit, detectDirective, removeDirectives, isSubstringInArray, runFunc, roundNumber, calculatePoint, calcCardinalityPosition, cnt, generateId, random, getTextObj2, drawSimpleText, wrapLabel, breakString, calculateTextDimensions, InitIDGenerator, decoder, entityDecode, insertTitle, parseFontSize, utils_default2, encodeEntities, decodeEntities, getEdgeId;
var init_utils2 = __esm({
@@ -32992,8 +33144,8 @@ var __esbuild_esm_mermaid = (() => {
curveStepBefore: stepBefore
};
directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
- detectInit = /* @__PURE__ */ __name(function(text2, config6) {
- const inits = detectDirective(text2, /(?:init\b)|(?:initialize\b)/);
+ detectInit = /* @__PURE__ */ __name(function(text4, config5) {
+ const inits = detectDirective(text4, /(?:init\b)|(?:initialize\b)/);
let results = {};
if (Array.isArray(inits)) {
const args = inits.map((init3) => init3.args);
@@ -33005,7 +33157,7 @@ var __esbuild_esm_mermaid = (() => {
if (!results) {
return;
}
- let type3 = detectType(text2, config6);
+ let type3 = detectType(text4, config5);
const prop = "config";
if (results[prop] !== void 0) {
if (type3 === "flowchart-v2") {
@@ -33016,20 +33168,20 @@ var __esbuild_esm_mermaid = (() => {
}
return results;
}, "detectInit");
- detectDirective = /* @__PURE__ */ __name(function(text2, type3 = null) {
+ detectDirective = /* @__PURE__ */ __name(function(text4, type3 = null) {
try {
const commentWithoutDirectives = new RegExp(
`[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*
`,
"ig"
);
- text2 = text2.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"');
+ text4 = text4.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"');
log.debug(
- `Detecting diagram directive${type3 !== null ? " type:" + type3 : ""} based on the text:${text2}`
+ `Detecting diagram directive${type3 !== null ? " type:" + type3 : ""} based on the text:${text4}`
);
let match2;
const result = [];
- while ((match2 = directiveRegex.exec(text2)) !== null) {
+ while ((match2 = directiveRegex.exec(text4)) !== null) {
if (match2.index === directiveRegex.lastIndex) {
directiveRegex.lastIndex++;
}
@@ -33040,18 +33192,18 @@ var __esbuild_esm_mermaid = (() => {
}
}
if (result.length === 0) {
- return { type: text2, args: null };
+ return { type: text4, args: null };
}
return result.length === 1 ? result[0] : result;
} catch (error3) {
log.error(
- `ERROR: ${error3.message} - Unable to parse directive type: '${type3}' based on the text: '${text2}'`
+ `ERROR: ${error3.message} - Unable to parse directive type: '${type3}' based on the text: '${text4}'`
);
return { type: void 0, args: null };
}
}, "detectDirective");
- removeDirectives = /* @__PURE__ */ __name(function(text2) {
- return text2.replace(directiveRegex, "");
+ removeDirectives = /* @__PURE__ */ __name(function(text4) {
+ return text4.replace(directiveRegex, "");
}, "removeDirectives");
isSubstringInArray = /* @__PURE__ */ __name(function(str2, arr) {
for (const [i2, element3] of arr.entries()) {
@@ -33090,6 +33242,9 @@ var __esbuild_esm_mermaid = (() => {
for (const point8 of points) {
if (prevPoint) {
const vectorDistance = distance(point8, prevPoint);
+ if (vectorDistance === 0) {
+ return prevPoint;
+ }
if (vectorDistance < remainingDistance) {
remainingDistance -= vectorDistance;
} else {
@@ -33174,13 +33329,13 @@ var __esbuild_esm_mermaid = (() => {
return textElem;
}, "drawSimpleText");
wrapLabel = memoize_default(
- (label, maxWidth, config6) => {
+ (label, maxWidth, config5) => {
if (!label) {
return label;
}
- config6 = Object.assign(
+ config5 = Object.assign(
{ fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: " " },
- config6
+ config5
);
if (common_default.lineBreakRegex.test(label)) {
return label;
@@ -33189,10 +33344,10 @@ var __esbuild_esm_mermaid = (() => {
const completedLines = [];
let nextLine = "";
words.forEach((word, index) => {
- const wordLength = calculateTextWidth(`${word} `, config6);
- const nextLineLength = calculateTextWidth(nextLine, config6);
+ const wordLength = calculateTextWidth(`${word} `, config5);
+ const nextLineLength = calculateTextWidth(nextLine, config5);
if (wordLength > maxWidth) {
- const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config6);
+ const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config5);
completedLines.push(nextLine, ...hyphenatedStrings);
nextLine = remainingWord;
} else if (nextLineLength + wordLength >= maxWidth) {
@@ -33207,22 +33362,22 @@ var __esbuild_esm_mermaid = (() => {
completedLines.push(nextLine);
}
});
- return completedLines.filter((line2) => line2 !== "").join(config6.joinWith);
+ return completedLines.filter((line2) => line2 !== "").join(config5.joinWith);
},
- (label, maxWidth, config6) => `${label}${maxWidth}${config6.fontSize}${config6.fontWeight}${config6.fontFamily}${config6.joinWith}`
+ (label, maxWidth, config5) => `${label}${maxWidth}${config5.fontSize}${config5.fontWeight}${config5.fontFamily}${config5.joinWith}`
);
breakString = memoize_default(
- (word, maxWidth, hyphenCharacter = "-", config6) => {
- config6 = Object.assign(
+ (word, maxWidth, hyphenCharacter = "-", config5) => {
+ config5 = Object.assign(
{ fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 },
- config6
+ config5
);
const characters2 = [...word];
const lines = [];
let currentLine = "";
characters2.forEach((character2, index) => {
const nextLine = `${currentLine}${character2}`;
- const lineWidth = calculateTextWidth(nextLine, config6);
+ const lineWidth = calculateTextWidth(nextLine, config5);
if (lineWidth >= maxWidth) {
const currentCharacter = index + 1;
const isLastLine = characters2.length === currentCharacter;
@@ -33235,19 +33390,19 @@ var __esbuild_esm_mermaid = (() => {
});
return { hyphenatedStrings: lines, remainingWord: currentLine };
},
- (word, maxWidth, hyphenCharacter = "-", config6) => `${word}${maxWidth}${hyphenCharacter}${config6.fontSize}${config6.fontWeight}${config6.fontFamily}`
+ (word, maxWidth, hyphenCharacter = "-", config5) => `${word}${maxWidth}${hyphenCharacter}${config5.fontSize}${config5.fontWeight}${config5.fontFamily}`
);
__name(calculateTextHeight, "calculateTextHeight");
__name(calculateTextWidth, "calculateTextWidth");
calculateTextDimensions = memoize_default(
- (text2, config6) => {
- const { fontSize = 12, fontFamily = "Arial", fontWeight = 400 } = config6;
- if (!text2) {
+ (text4, config5) => {
+ const { fontSize = 12, fontFamily = "Arial", fontWeight = 400 } = config5;
+ if (!text4) {
return { width: 0, height: 0 };
}
const [, _fontSizePx] = parseFontSize(fontSize);
const fontFamilies = ["sans-serif", fontFamily];
- const lines = text2.split(common_default.lineBreakRegex);
+ const lines = text4.split(common_default.lineBreakRegex);
const dims = [];
const body = select_default2("body");
if (!body.remove) {
@@ -33276,7 +33431,7 @@ var __esbuild_esm_mermaid = (() => {
const index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1;
return dims[index];
},
- (text2, config6) => `${text2}${config6.fontSize}${config6.fontWeight}${config6.fontFamily}`
+ (text4, config5) => `${text4}${config5.fontSize}${config5.fontWeight}${config5.fontFamily}`
);
InitIDGenerator = class {
constructor(deterministic = false, seed) {
@@ -33288,10 +33443,10 @@ var __esbuild_esm_mermaid = (() => {
__name(this, "InitIDGenerator");
}
};
- entityDecode = /* @__PURE__ */ __name(function(html2) {
+ entityDecode = /* @__PURE__ */ __name(function(html3) {
decoder = decoder || document.createElement("div");
- html2 = escape(html2).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";");
- decoder.innerHTML = html2;
+ html3 = escape(html3).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";");
+ decoder.innerHTML = html3;
return unescape(decoder.textContent);
}, "entityDecode");
__name(isDetailedError, "isDetailedError");
@@ -33303,7 +33458,7 @@ var __esbuild_esm_mermaid = (() => {
if (!bounds4) {
return;
}
- parent4.append("text").text(title2).attr("x", bounds4.x + bounds4.width / 2).attr("y", -titleTopMargin).attr("class", cssClass);
+ parent4.append("text").text(title2).attr("text-anchor", "middle").attr("x", bounds4.x + bounds4.width / 2).attr("y", -titleTopMargin).attr("class", cssClass);
}, "insertTitle");
parseFontSize = /* @__PURE__ */ __name((fontSize) => {
if (typeof fontSize === "number") {
@@ -33343,8 +33498,8 @@ var __esbuild_esm_mermaid = (() => {
parseFontSize,
InitIDGenerator
};
- encodeEntities = /* @__PURE__ */ __name(function(text2) {
- let txt = text2;
+ encodeEntities = /* @__PURE__ */ __name(function(text4) {
+ let txt = text4;
txt = txt.replace(/style.*:\S*#.*;/g, function(s2) {
return s2.substring(0, s2.length - 1);
});
@@ -33362,16 +33517,20 @@ var __esbuild_esm_mermaid = (() => {
});
return txt;
}, "encodeEntities");
- decodeEntities = /* @__PURE__ */ __name(function(text2) {
- return text2.replace(/fl°°/g, "").replace(/fl°/g, "&").replace(/¶ß/g, ";");
+ decodeEntities = /* @__PURE__ */ __name(function(text4) {
+ return text4.replace(/fl°°/g, "").replace(/fl°/g, "&").replace(/¶ß/g, ";");
}, "decodeEntities");
getEdgeId = /* @__PURE__ */ __name((from2, to, {
counter: counter2 = 0,
prefix,
suffix
- }) => {
+ }, id29) => {
+ if (id29) {
+ return id29;
+ }
return `${prefix ? `${prefix}_` : ""}${from2}_${to}_${counter2}${suffix ? `_${suffix}` : ""}`;
}, "getEdgeId");
+ __name(handleUndefinedAttr, "handleUndefinedAttr");
}
});
@@ -33400,7 +33559,7 @@ var __esbuild_esm_mermaid = (() => {
}
}
}
- function drawInsideBoundary(diagram24, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
+ function drawInsideBoundary(diagram26, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
let currentBounds = new Bounds(diagObj);
currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow2, currentBoundaries.length);
for (let [i2, currentBoundary] of currentBoundaries.entries()) {
@@ -33466,7 +33625,7 @@ var __esbuild_esm_mermaid = (() => {
if (currentPersonOrSystemKeys.length > 0) {
drawC4ShapeArray(
currentBounds,
- diagram24,
+ diagram26,
currentPersonOrSystemArray,
currentPersonOrSystemKeys
);
@@ -33475,7 +33634,7 @@ var __esbuild_esm_mermaid = (() => {
let nextCurrentBoundaries = diagObj.db.getBoundarys(parentBoundaryAlias);
if (nextCurrentBoundaries.length > 0) {
drawInsideBoundary(
- diagram24,
+ diagram26,
parentBoundaryAlias,
currentBounds,
nextCurrentBoundaries,
@@ -33483,7 +33642,7 @@ var __esbuild_esm_mermaid = (() => {
);
}
if (currentBoundary.alias !== "global") {
- drawBoundary2(diagram24, currentBoundary, currentBounds);
+ drawBoundary2(diagram26, currentBoundary, currentBounds);
}
parentBounds.data.stopy = Math.max(
currentBounds.data.stopy + conf.c4ShapeMargin,
@@ -33632,7 +33791,7 @@ var __esbuild_esm_mermaid = (() => {
};
}, "messageFont");
__name(calcC4ShapeTextWH, "calcC4ShapeTextWH");
- drawBoundary2 = /* @__PURE__ */ __name(function(diagram24, boundary, bounds4) {
+ drawBoundary2 = /* @__PURE__ */ __name(function(diagram26, boundary, bounds4) {
boundary.x = bounds4.data.startx;
boundary.y = bounds4.data.starty;
boundary.width = bounds4.data.stopx - bounds4.data.startx;
@@ -33644,9 +33803,9 @@ var __esbuild_esm_mermaid = (() => {
boundaryLabelConf.fontWeight = "bold";
let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
- svgDraw_default.drawBoundary(diagram24, boundary, conf);
+ svgDraw_default.drawBoundary(diagram26, boundary, conf);
}, "drawBoundary");
- drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram24, c4ShapeArray2, c4ShapeKeys) {
+ drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram26, c4ShapeArray2, c4ShapeKeys) {
let Y3 = 0;
for (const c4ShapeKey of c4ShapeKeys) {
Y3 = 0;
@@ -33712,7 +33871,7 @@ var __esbuild_esm_mermaid = (() => {
c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
currentBounds.insert(c4Shape);
- svgDraw_default.drawC4Shape(diagram24, c4Shape, conf);
+ svgDraw_default.drawC4Shape(diagram26, c4Shape, conf);
}
currentBounds.bumpLastMargin(conf.c4ShapeMargin);
}, "drawC4ShapeArray");
@@ -33789,7 +33948,7 @@ var __esbuild_esm_mermaid = (() => {
let endPoint = getIntersectPoint(endNode, endIntersectPoint);
return { startPoint, endPoint };
}, "getIntersectPoints");
- drawRels2 = /* @__PURE__ */ __name(function(diagram24, rels2, getC4ShapeObj, diagObj) {
+ drawRels2 = /* @__PURE__ */ __name(function(diagram26, rels2, getC4ShapeObj, diagObj) {
let i2 = 0;
for (let rel2 of rels2) {
i2 = i2 + 1;
@@ -33815,26 +33974,26 @@ var __esbuild_esm_mermaid = (() => {
rel2.startPoint = points.startPoint;
rel2.endPoint = points.endPoint;
}
- svgDraw_default.drawRels(diagram24, rels2, conf);
+ svgDraw_default.drawRels(diagram26, rels2, conf);
}, "drawRels");
__name(drawInsideBoundary, "drawInsideBoundary");
- draw = /* @__PURE__ */ __name(function(_text, id27, _version, diagObj) {
+ draw = /* @__PURE__ */ __name(function(_text, id29, _version, diagObj) {
conf = getConfig2().c4;
const securityLevel = getConfig2().securityLevel;
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- let db8 = diagObj.db;
+ let db10 = diagObj.db;
diagObj.db.setWrap(conf.wrap);
- c4ShapeInRow2 = db8.getC4ShapeInRow();
- c4BoundaryInRow2 = db8.getC4BoundaryInRow();
+ c4ShapeInRow2 = db10.getC4ShapeInRow();
+ c4BoundaryInRow2 = db10.getC4BoundaryInRow();
log.debug(`C:${JSON.stringify(conf, null, 2)}`);
- const diagram24 = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`);
- svgDraw_default.insertComputerIcon(diagram24);
- svgDraw_default.insertDatabaseIcon(diagram24);
- svgDraw_default.insertClockIcon(diagram24);
+ const diagram26 = securityLevel === "sandbox" ? root4.select(`[id="${id29}"]`) : select_default2(`[id="${id29}"]`);
+ svgDraw_default.insertComputerIcon(diagram26);
+ svgDraw_default.insertDatabaseIcon(diagram26);
+ svgDraw_default.insertClockIcon(diagram26);
let screenBounds = new Bounds(diagObj);
screenBounds.setData(
conf.diagramMarginX,
@@ -33847,12 +34006,12 @@ var __esbuild_esm_mermaid = (() => {
globalBoundaryMaxY = conf.diagramMarginY;
const title2 = diagObj.db.getTitle();
let currentBoundaries = diagObj.db.getBoundarys("");
- drawInsideBoundary(diagram24, "", screenBounds, currentBoundaries, diagObj);
- svgDraw_default.insertArrowHead(diagram24);
- svgDraw_default.insertArrowEnd(diagram24);
- svgDraw_default.insertArrowCrossHead(diagram24);
- svgDraw_default.insertArrowFilledHead(diagram24);
- drawRels2(diagram24, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj);
+ drawInsideBoundary(diagram26, "", screenBounds, currentBoundaries, diagObj);
+ svgDraw_default.insertArrowHead(diagram26);
+ svgDraw_default.insertArrowEnd(diagram26);
+ svgDraw_default.insertArrowCrossHead(diagram26);
+ svgDraw_default.insertArrowFilledHead(diagram26);
+ drawRels2(diagram26, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj);
screenBounds.data.stopx = globalBoundaryMaxX;
screenBounds.data.stopy = globalBoundaryMaxY;
const box = screenBounds.data;
@@ -33861,11 +34020,11 @@ var __esbuild_esm_mermaid = (() => {
let boxWidth = box.stopx - box.startx;
const width3 = boxWidth + 2 * conf.diagramMarginX;
if (title2) {
- diagram24.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
+ diagram26.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
}
- configureSvgSize(diagram24, height2, width3, conf.useMaxWidth);
+ configureSvgSize(diagram26, height2, width3, conf.useMaxWidth);
const extraVertForTitle = title2 ? 60 : 0;
- diagram24.attr(
+ diagram26.attr(
"viewBox",
box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width3 + " " + (height2 + extraVertForTitle)
);
@@ -33920,1899 +34079,3015 @@ var __esbuild_esm_mermaid = (() => {
}
});
- // src/diagrams/flowchart/flowDb.ts
- function getCompiledStyles(classDefs) {
- let compiledStyles = [];
- for (const customClass of classDefs) {
- const cssClass = classes.get(customClass);
- if (cssClass?.styles) {
- compiledStyles = [...compiledStyles, ...cssClass.styles ?? []].map((s2) => s2.trim());
+ // ../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs
+ function isNothing(subject) {
+ return typeof subject === "undefined" || subject === null;
+ }
+ function isObject2(subject) {
+ return typeof subject === "object" && subject !== null;
+ }
+ function toArray(sequence) {
+ if (Array.isArray(sequence)) return sequence;
+ else if (isNothing(sequence)) return [];
+ return [sequence];
+ }
+ function extend2(target, source) {
+ var index, length2, key, sourceKeys;
+ if (source) {
+ sourceKeys = Object.keys(source);
+ for (index = 0, length2 = sourceKeys.length; index < length2; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
}
- if (cssClass?.textStyles) {
- compiledStyles = [...compiledStyles, ...cssClass.textStyles ?? []].map((s2) => s2.trim());
+ }
+ return target;
+ }
+ function repeat(string3, count) {
+ var result = "", cycle;
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string3;
+ }
+ return result;
+ }
+ function isNegativeZero(number7) {
+ return number7 === 0 && Number.NEGATIVE_INFINITY === 1 / number7;
+ }
+ function formatError(exception2, compact2) {
+ var where = "", message = exception2.reason || "(unknown reason)";
+ if (!exception2.mark) return message;
+ if (exception2.mark.name) {
+ where += 'in "' + exception2.mark.name + '" ';
+ }
+ where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
+ if (!compact2 && exception2.mark.snippet) {
+ where += "\n\n" + exception2.mark.snippet;
+ }
+ return message + " " + where;
+ }
+ function YAMLException$1(reason, mark) {
+ Error.call(this);
+ this.name = "YAMLException";
+ this.reason = reason;
+ this.mark = mark;
+ this.message = formatError(this, false);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ this.stack = new Error().stack || "";
+ }
+ }
+ function getLine(buffer, lineStart, lineEnd, position5, maxLineLength) {
+ var head2 = "";
+ var tail = "";
+ var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
+ if (position5 - lineStart > maxHalfLength) {
+ head2 = " ... ";
+ lineStart = position5 - maxHalfLength + head2.length;
+ }
+ if (lineEnd - position5 > maxHalfLength) {
+ tail = " ...";
+ lineEnd = position5 + maxHalfLength - tail.length;
+ }
+ return {
+ str: head2 + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
+ pos: position5 - lineStart + head2.length
+ // relative position
+ };
+ }
+ function padStart(string3, max10) {
+ return common.repeat(" ", max10 - string3.length) + string3;
+ }
+ function makeSnippet(mark, options3) {
+ options3 = Object.create(options3 || null);
+ if (!mark.buffer) return null;
+ if (!options3.maxLength) options3.maxLength = 79;
+ if (typeof options3.indent !== "number") options3.indent = 1;
+ if (typeof options3.linesBefore !== "number") options3.linesBefore = 3;
+ if (typeof options3.linesAfter !== "number") options3.linesAfter = 2;
+ var re2 = /\r?\n|\r|\0/g;
+ var lineStarts = [0];
+ var lineEnds = [];
+ var match2;
+ var foundLineNo = -1;
+ while (match2 = re2.exec(mark.buffer)) {
+ lineEnds.push(match2.index);
+ lineStarts.push(match2.index + match2[0].length);
+ if (mark.position <= match2.index && foundLineNo < 0) {
+ foundLineNo = lineStarts.length - 2;
}
}
- return compiledStyles;
+ if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
+ var result = "", i2, line2;
+ var lineNoLength = Math.min(mark.line + options3.linesAfter, lineEnds.length).toString().length;
+ var maxLineLength = options3.maxLength - (options3.indent + lineNoLength + 3);
+ for (i2 = 1; i2 <= options3.linesBefore; i2++) {
+ if (foundLineNo - i2 < 0) break;
+ line2 = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo - i2],
+ lineEnds[foundLineNo - i2],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i2]),
+ maxLineLength
+ );
+ result = common.repeat(" ", options3.indent) + padStart((mark.line - i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n" + result;
+ }
+ line2 = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
+ result += common.repeat(" ", options3.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
+ result += common.repeat("-", options3.indent + lineNoLength + 3 + line2.pos) + "^\n";
+ for (i2 = 1; i2 <= options3.linesAfter; i2++) {
+ if (foundLineNo + i2 >= lineEnds.length) break;
+ line2 = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo + i2],
+ lineEnds[foundLineNo + i2],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i2]),
+ maxLineLength
+ );
+ result += common.repeat(" ", options3.indent) + padStart((mark.line + i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
+ }
+ return result.replace(/\n$/, "");
}
- var MERMAID_DOM_ID_PREFIX, vertexCounter, config2, vertices, edges, classes, subGraphs, subGraphLookup, tooltips, subCount, firstGraphFlag, direction, version, funs, sanitizeText4, lookUpDomId, addVertex, addSingleLink, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setTooltip, setClickFun, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, setupToolTips, clear3, setGen, defaultStyle, addSubGraph, getPosForId, secCount, posCrossRef, indexNodes2, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, destructStartLink, countChar, destructEndLink, destructLink, exists, makeUniq, lex, getTypeFromVertex, findNode, destructEdgeType, addNodeFromVertex, getData, flowDb_default;
- var init_flowDb = __esm({
- "src/diagrams/flowchart/flowDb.ts"() {
- "use strict";
- init_src32();
- init_utils2();
- init_diagramAPI();
- init_common();
- init_logger();
- init_commonDb();
- MERMAID_DOM_ID_PREFIX = "flowchart-";
- vertexCounter = 0;
- config2 = getConfig2();
- vertices = /* @__PURE__ */ new Map();
- edges = [];
- classes = /* @__PURE__ */ new Map();
- subGraphs = [];
- subGraphLookup = /* @__PURE__ */ new Map();
- tooltips = /* @__PURE__ */ new Map();
- subCount = 0;
- firstGraphFlag = true;
- funs = [];
- sanitizeText4 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, config2), "sanitizeText");
- lookUpDomId = /* @__PURE__ */ __name(function(id27) {
- for (const vertex of vertices.values()) {
- if (vertex.id === id27) {
- return vertex.domId;
- }
- }
- return id27;
- }, "lookUpDomId");
- addVertex = /* @__PURE__ */ __name(function(id27, textObj, type3, style3, classes6, dir2, props = {}) {
- if (!id27 || id27.trim().length === 0) {
- return;
- }
- let txt;
- let vertex = vertices.get(id27);
- if (vertex === void 0) {
- vertex = {
- id: id27,
- labelType: "text",
- domId: MERMAID_DOM_ID_PREFIX + id27 + "-" + vertexCounter,
- styles: [],
- classes: []
- };
- vertices.set(id27, vertex);
- }
- vertexCounter++;
- if (textObj !== void 0) {
- config2 = getConfig2();
- txt = sanitizeText4(textObj.text.trim());
- vertex.labelType = textObj.type;
- if (txt.startsWith('"') && txt.endsWith('"')) {
- txt = txt.substring(1, txt.length - 1);
- }
- vertex.text = txt;
- } else {
- if (vertex.text === void 0) {
- vertex.text = id27;
- }
- }
- if (type3 !== void 0) {
- vertex.type = type3;
- }
- if (style3 !== void 0 && style3 !== null) {
- style3.forEach(function(s2) {
- vertex.styles.push(s2);
- });
- }
- if (classes6 !== void 0 && classes6 !== null) {
- classes6.forEach(function(s2) {
- vertex.classes.push(s2);
- });
- }
- if (dir2 !== void 0) {
- vertex.dir = dir2;
- }
- if (vertex.props === void 0) {
- vertex.props = props;
- } else if (props !== void 0) {
- Object.assign(vertex.props, props);
- }
- }, "addVertex");
- addSingleLink = /* @__PURE__ */ __name(function(_start, _end, type3) {
- const start3 = _start;
- const end2 = _end;
- const edge = { start: start3, end: end2, type: void 0, text: "", labelType: "text" };
- log.info("abc78 Got edge...", edge);
- const linkTextObj = type3.text;
- if (linkTextObj !== void 0) {
- edge.text = sanitizeText4(linkTextObj.text.trim());
- if (edge.text.startsWith('"') && edge.text.endsWith('"')) {
- edge.text = edge.text.substring(1, edge.text.length - 1);
- }
- edge.labelType = linkTextObj.type;
- }
- if (type3 !== void 0) {
- edge.type = type3.type;
- edge.stroke = type3.stroke;
- edge.length = type3.length > 10 ? 10 : type3.length;
- }
- if (edges.length < (config2.maxEdges ?? 500)) {
- log.info("Pushing edge...");
- edges.push(edge);
- } else {
- throw new Error(
- `Edge limit exceeded. ${edges.length} edges found, but the limit is ${config2.maxEdges}.
-
-Initialize mermaid with maxEdges set to a higher number to allow more edges.
-You cannot set this config via configuration inside the diagram as it is a secure config.
-You have to call mermaid.initialize.`
- );
- }
- }, "addSingleLink");
- addLink = /* @__PURE__ */ __name(function(_start, _end, type3) {
- log.info("addLink", _start, _end, type3);
- for (const start3 of _start) {
- for (const end2 of _end) {
- addSingleLink(start3, end2, type3);
- }
- }
- }, "addLink");
- updateLinkInterpolate = /* @__PURE__ */ __name(function(positions2, interpolate) {
- positions2.forEach(function(pos) {
- if (pos === "default") {
- edges.defaultInterpolate = interpolate;
- } else {
- edges[pos].interpolate = interpolate;
- }
- });
- }, "updateLinkInterpolate");
- updateLink = /* @__PURE__ */ __name(function(positions2, style3) {
- positions2.forEach(function(pos) {
- if (typeof pos === "number" && pos >= edges.length) {
- throw new Error(
- `The index ${pos} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)`
- );
- }
- if (pos === "default") {
- edges.defaultStyle = style3;
- } else {
- edges[pos].style = style3;
- if ((edges[pos]?.style?.length ?? 0) > 0 && !edges[pos]?.style?.some((s2) => s2?.startsWith("fill"))) {
- edges[pos]?.style?.push("fill:none");
- }
- }
- });
- }, "updateLink");
- addClass = /* @__PURE__ */ __name(function(ids, style3) {
- ids.split(",").forEach(function(id27) {
- let classNode = classes.get(id27);
- if (classNode === void 0) {
- classNode = { id: id27, styles: [], textStyles: [] };
- classes.set(id27, classNode);
- }
- if (style3 !== void 0 && style3 !== null) {
- style3.forEach(function(s2) {
- if (/color/.exec(s2)) {
- const newStyle = s2.replace("fill", "bgFill");
- classNode.textStyles.push(newStyle);
- }
- classNode.styles.push(s2);
- });
- }
- });
- }, "addClass");
- setDirection = /* @__PURE__ */ __name(function(dir2) {
- direction = dir2;
- if (/.*/.exec(direction)) {
- direction = "LR";
- }
- if (/.*v/.exec(direction)) {
- direction = "TB";
- }
- if (direction === "TD") {
- direction = "TB";
- }
- }, "setDirection");
- setClass = /* @__PURE__ */ __name(function(ids, className) {
- for (const id27 of ids.split(",")) {
- const vertex = vertices.get(id27);
- if (vertex) {
- vertex.classes.push(className);
- }
- const subGraph = subGraphLookup.get(id27);
- if (subGraph) {
- subGraph.classes.push(className);
- }
- }
- }, "setClass");
- setTooltip = /* @__PURE__ */ __name(function(ids, tooltip) {
- if (tooltip === void 0) {
- return;
- }
- tooltip = sanitizeText4(tooltip);
- for (const id27 of ids.split(",")) {
- tooltips.set(version === "gen-1" ? lookUpDomId(id27) : id27, tooltip);
- }
- }, "setTooltip");
- setClickFun = /* @__PURE__ */ __name(function(id27, functionName, functionArgs) {
- const domId = lookUpDomId(id27);
- if (getConfig2().securityLevel !== "loose") {
- return;
- }
- if (functionName === void 0) {
- return;
- }
- let argList = [];
- if (typeof functionArgs === "string") {
- argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
- for (let i2 = 0; i2 < argList.length; i2++) {
- let item = argList[i2].trim();
- if (item.startsWith('"') && item.endsWith('"')) {
- item = item.substr(1, item.length - 2);
- }
- argList[i2] = item;
- }
- }
- if (argList.length === 0) {
- argList.push(id27);
- }
- const vertex = vertices.get(id27);
- if (vertex) {
- vertex.haveCallback = true;
- funs.push(function() {
- const elem = document.querySelector(`[id="${domId}"]`);
- if (elem !== null) {
- elem.addEventListener(
- "click",
- function() {
- utils_default2.runFunc(functionName, ...argList);
- },
- false
- );
- }
- });
- }
- }, "setClickFun");
- setLink = /* @__PURE__ */ __name(function(ids, linkStr, target) {
- ids.split(",").forEach(function(id27) {
- const vertex = vertices.get(id27);
- if (vertex !== void 0) {
- vertex.link = utils_default2.formatUrl(linkStr, config2);
- vertex.linkTarget = target;
- }
- });
- setClass(ids, "clickable");
- }, "setLink");
- getTooltip = /* @__PURE__ */ __name(function(id27) {
- return tooltips.get(id27);
- }, "getTooltip");
- setClickEvent = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) {
- ids.split(",").forEach(function(id27) {
- setClickFun(id27, functionName, functionArgs);
- });
- setClass(ids, "clickable");
- }, "setClickEvent");
- bindFunctions = /* @__PURE__ */ __name(function(element3) {
- funs.forEach(function(fun) {
- fun(element3);
- });
- }, "bindFunctions");
- getDirection = /* @__PURE__ */ __name(function() {
- return direction.trim();
- }, "getDirection");
- getVertices = /* @__PURE__ */ __name(function() {
- return vertices;
- }, "getVertices");
- getEdges = /* @__PURE__ */ __name(function() {
- return edges;
- }, "getEdges");
- getClasses = /* @__PURE__ */ __name(function() {
- return classes;
- }, "getClasses");
- setupToolTips = /* @__PURE__ */ __name(function(element3) {
- let tooltipElem = select_default2(".mermaidTooltip");
- if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
- tooltipElem = select_default2("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0);
- }
- const svg = select_default2(element3).select("svg");
- const nodes6 = svg.selectAll("g.node");
- nodes6.on("mouseover", function() {
- const el = select_default2(this);
- const title2 = el.attr("title");
- if (title2 === null) {
- return;
- }
- const rect4 = this?.getBoundingClientRect();
- tooltipElem.transition().duration(200).style("opacity", ".9");
- tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect4.left + (rect4.right - rect4.left) / 2 + "px").style("top", window.scrollY + rect4.bottom + "px");
- tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, " "));
- el.classed("hover", true);
- }).on("mouseout", function() {
- tooltipElem.transition().duration(500).style("opacity", 0);
- const el = select_default2(this);
- el.classed("hover", false);
+ function compileStyleAliases(map5) {
+ var result = {};
+ if (map5 !== null) {
+ Object.keys(map5).forEach(function(style3) {
+ map5[style3].forEach(function(alias) {
+ result[String(alias)] = style3;
});
- }, "setupToolTips");
- funs.push(setupToolTips);
- clear3 = /* @__PURE__ */ __name(function(ver = "gen-1") {
- vertices = /* @__PURE__ */ new Map();
- classes = /* @__PURE__ */ new Map();
- edges = [];
- funs = [setupToolTips];
- subGraphs = [];
- subGraphLookup = /* @__PURE__ */ new Map();
- subCount = 0;
- tooltips = /* @__PURE__ */ new Map();
- firstGraphFlag = true;
- version = ver;
- config2 = getConfig2();
- clear();
- }, "clear");
- setGen = /* @__PURE__ */ __name((ver) => {
- version = ver || "gen-2";
- }, "setGen");
- defaultStyle = /* @__PURE__ */ __name(function() {
- return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
- }, "defaultStyle");
- addSubGraph = /* @__PURE__ */ __name(function(_id, list2, _title) {
- let id27 = _id.text.trim();
- let title2 = _title.text;
- if (_id === _title && /\s/.exec(_title.text)) {
- id27 = void 0;
- }
- function uniq2(a2) {
- const prims = { boolean: {}, number: {}, string: {} };
- const objs = [];
- let dir3;
- const nodeList2 = a2.filter(function(item) {
- const type3 = typeof item;
- if (item.stmt && item.stmt === "dir") {
- dir3 = item.value;
- return false;
- }
- if (item.trim() === "") {
- return false;
- }
- if (type3 in prims) {
- return prims[type3].hasOwnProperty(item) ? false : prims[type3][item] = true;
- } else {
- return objs.includes(item) ? false : objs.push(item);
- }
- });
- return { nodeList: nodeList2, dir: dir3 };
- }
- __name(uniq2, "uniq");
- const { nodeList, dir: dir2 } = uniq2(list2.flat());
- if (version === "gen-1") {
- for (let i2 = 0; i2 < nodeList.length; i2++) {
- nodeList[i2] = lookUpDomId(nodeList[i2]);
- }
- }
- id27 = id27 ?? "subGraph" + subCount;
- title2 = title2 || "";
- title2 = sanitizeText4(title2);
- subCount = subCount + 1;
- const subGraph = {
- id: id27,
- nodes: nodeList,
- title: title2.trim(),
- classes: [],
- dir: dir2,
- labelType: _title.type
- };
- log.info("Adding", subGraph.id, subGraph.nodes, subGraph.dir);
- subGraph.nodes = makeUniq(subGraph, subGraphs).nodes;
- subGraphs.push(subGraph);
- subGraphLookup.set(id27, subGraph);
- return id27;
- }, "addSubGraph");
- getPosForId = /* @__PURE__ */ __name(function(id27) {
- for (const [i2, subGraph] of subGraphs.entries()) {
- if (subGraph.id === id27) {
- return i2;
- }
- }
- return -1;
- }, "getPosForId");
- secCount = -1;
- posCrossRef = [];
- indexNodes2 = /* @__PURE__ */ __name(function(id27, pos) {
- const nodes6 = subGraphs[pos].nodes;
- secCount = secCount + 1;
- if (secCount > 2e3) {
- return {
- result: false,
- count: 0
- };
- }
- posCrossRef[secCount] = pos;
- if (subGraphs[pos].id === id27) {
- return {
- result: true,
- count: 0
- };
- }
- let count = 0;
- let posCount = 1;
- while (count < nodes6.length) {
- const childPos = getPosForId(nodes6[count]);
- if (childPos >= 0) {
- const res = indexNodes2(id27, childPos);
- if (res.result) {
- return {
- result: true,
- count: posCount + res.count
- };
- } else {
- posCount = posCount + res.count;
- }
- }
- count = count + 1;
- }
- return {
- result: false,
- count: posCount
- };
- }, "indexNodes2");
- getDepthFirstPos = /* @__PURE__ */ __name(function(pos) {
- return posCrossRef[pos];
- }, "getDepthFirstPos");
- indexNodes = /* @__PURE__ */ __name(function() {
- secCount = -1;
- if (subGraphs.length > 0) {
- indexNodes2("none", subGraphs.length - 1);
- }
- }, "indexNodes");
- getSubGraphs = /* @__PURE__ */ __name(function() {
- return subGraphs;
- }, "getSubGraphs");
- firstGraph = /* @__PURE__ */ __name(() => {
- if (firstGraphFlag) {
- firstGraphFlag = false;
- return true;
- }
- return false;
- }, "firstGraph");
- destructStartLink = /* @__PURE__ */ __name((_str) => {
- let str2 = _str.trim();
- let type3 = "arrow_open";
- switch (str2[0]) {
- case "<":
- type3 = "arrow_point";
- str2 = str2.slice(1);
- break;
- case "x":
- type3 = "arrow_cross";
- str2 = str2.slice(1);
- break;
- case "o":
- type3 = "arrow_circle";
- str2 = str2.slice(1);
- break;
+ });
+ }
+ return result;
+ }
+ function Type$1(tag2, options3) {
+ options3 = options3 || {};
+ Object.keys(options3).forEach(function(name) {
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
+ throw new exception('Unknown option "' + name + '" is met in definition of "' + tag2 + '" YAML type.');
+ }
+ });
+ this.options = options3;
+ this.tag = tag2;
+ this.kind = options3["kind"] || null;
+ this.resolve = options3["resolve"] || function() {
+ return true;
+ };
+ this.construct = options3["construct"] || function(data6) {
+ return data6;
+ };
+ this.instanceOf = options3["instanceOf"] || null;
+ this.predicate = options3["predicate"] || null;
+ this.represent = options3["represent"] || null;
+ this.representName = options3["representName"] || null;
+ this.defaultStyle = options3["defaultStyle"] || null;
+ this.multi = options3["multi"] || false;
+ this.styleAliases = compileStyleAliases(options3["styleAliases"] || null);
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
+ throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag2 + '" YAML type.');
+ }
+ }
+ function compileList(schema2, name) {
+ var result = [];
+ schema2[name].forEach(function(currentType) {
+ var newIndex = result.length;
+ result.forEach(function(previousType, previousIndex) {
+ if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
+ newIndex = previousIndex;
}
- let stroke = "normal";
- if (str2.includes("=")) {
- stroke = "thick";
- }
- if (str2.includes(".")) {
- stroke = "dotted";
- }
- return { type: type3, stroke };
- }, "destructStartLink");
- countChar = /* @__PURE__ */ __name((char2, str2) => {
- const length2 = str2.length;
- let count = 0;
- for (let i2 = 0; i2 < length2; ++i2) {
- if (str2[i2] === char2) {
- ++count;
- }
- }
- return count;
- }, "countChar");
- destructEndLink = /* @__PURE__ */ __name((_str) => {
- const str2 = _str.trim();
- let line2 = str2.slice(0, -1);
- let type3 = "arrow_open";
- switch (str2.slice(-1)) {
- case "x":
- type3 = "arrow_cross";
- if (str2.startsWith("x")) {
- type3 = "double_" + type3;
- line2 = line2.slice(1);
- }
- break;
- case ">":
- type3 = "arrow_point";
- if (str2.startsWith("<")) {
- type3 = "double_" + type3;
- line2 = line2.slice(1);
- }
- break;
- case "o":
- type3 = "arrow_circle";
- if (str2.startsWith("o")) {
- type3 = "double_" + type3;
- line2 = line2.slice(1);
- }
- break;
+ });
+ result[newIndex] = currentType;
+ });
+ return result;
+ }
+ function compileMap() {
+ var result = {
+ scalar: {},
+ sequence: {},
+ mapping: {},
+ fallback: {},
+ multi: {
+ scalar: [],
+ sequence: [],
+ mapping: [],
+ fallback: []
+ }
+ }, index, length2;
+ function collectType(type3) {
+ if (type3.multi) {
+ result.multi[type3.kind].push(type3);
+ result.multi["fallback"].push(type3);
+ } else {
+ result[type3.kind][type3.tag] = result["fallback"][type3.tag] = type3;
+ }
+ }
+ __name(collectType, "collectType");
+ for (index = 0, length2 = arguments.length; index < length2; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+ return result;
+ }
+ function Schema$1(definition) {
+ return this.extend(definition);
+ }
+ function resolveYamlNull(data6) {
+ if (data6 === null) return true;
+ var max10 = data6.length;
+ return max10 === 1 && data6 === "~" || max10 === 4 && (data6 === "null" || data6 === "Null" || data6 === "NULL");
+ }
+ function constructYamlNull() {
+ return null;
+ }
+ function isNull(object3) {
+ return object3 === null;
+ }
+ function resolveYamlBoolean(data6) {
+ if (data6 === null) return false;
+ var max10 = data6.length;
+ return max10 === 4 && (data6 === "true" || data6 === "True" || data6 === "TRUE") || max10 === 5 && (data6 === "false" || data6 === "False" || data6 === "FALSE");
+ }
+ function constructYamlBoolean(data6) {
+ return data6 === "true" || data6 === "True" || data6 === "TRUE";
+ }
+ function isBoolean(object3) {
+ return Object.prototype.toString.call(object3) === "[object Boolean]";
+ }
+ function isHexCode(c3) {
+ return 48 <= c3 && c3 <= 57 || 65 <= c3 && c3 <= 70 || 97 <= c3 && c3 <= 102;
+ }
+ function isOctCode(c3) {
+ return 48 <= c3 && c3 <= 55;
+ }
+ function isDecCode(c3) {
+ return 48 <= c3 && c3 <= 57;
+ }
+ function resolveYamlInteger(data6) {
+ if (data6 === null) return false;
+ var max10 = data6.length, index = 0, hasDigits = false, ch;
+ if (!max10) return false;
+ ch = data6[index];
+ if (ch === "-" || ch === "+") {
+ ch = data6[++index];
+ }
+ if (ch === "0") {
+ if (index + 1 === max10) return true;
+ ch = data6[++index];
+ if (ch === "b") {
+ index++;
+ for (; index < max10; index++) {
+ ch = data6[index];
+ if (ch === "_") continue;
+ if (ch !== "0" && ch !== "1") return false;
+ hasDigits = true;
}
- let stroke = "normal";
- let length2 = line2.length - 1;
- if (line2.startsWith("=")) {
- stroke = "thick";
- }
- if (line2.startsWith("~")) {
- stroke = "invisible";
- }
- const dots = countChar(".", line2);
- if (dots) {
- stroke = "dotted";
- length2 = dots;
- }
- return { type: type3, stroke, length: length2 };
- }, "destructEndLink");
- destructLink = /* @__PURE__ */ __name((_str, _startStr) => {
- const info2 = destructEndLink(_str);
- let startInfo;
- if (_startStr) {
- startInfo = destructStartLink(_startStr);
- if (startInfo.stroke !== info2.stroke) {
- return { type: "INVALID", stroke: "INVALID" };
- }
- if (startInfo.type === "arrow_open") {
- startInfo.type = info2.type;
- } else {
- if (startInfo.type !== info2.type) {
- return { type: "INVALID", stroke: "INVALID" };
- }
- startInfo.type = "double_" + startInfo.type;
- }
- if (startInfo.type === "double_arrow") {
- startInfo.type = "double_arrow_point";
- }
- startInfo.length = info2.length;
- return startInfo;
+ return hasDigits && ch !== "_";
+ }
+ if (ch === "x") {
+ index++;
+ for (; index < max10; index++) {
+ ch = data6[index];
+ if (ch === "_") continue;
+ if (!isHexCode(data6.charCodeAt(index))) return false;
+ hasDigits = true;
}
- return info2;
- }, "destructLink");
- exists = /* @__PURE__ */ __name((allSgs, _id) => {
- for (const sg of allSgs) {
- if (sg.nodes.includes(_id)) {
- return true;
- }
+ return hasDigits && ch !== "_";
+ }
+ if (ch === "o") {
+ index++;
+ for (; index < max10; index++) {
+ ch = data6[index];
+ if (ch === "_") continue;
+ if (!isOctCode(data6.charCodeAt(index))) return false;
+ hasDigits = true;
}
+ return hasDigits && ch !== "_";
+ }
+ }
+ if (ch === "_") return false;
+ for (; index < max10; index++) {
+ ch = data6[index];
+ if (ch === "_") continue;
+ if (!isDecCode(data6.charCodeAt(index))) {
return false;
- }, "exists");
- makeUniq = /* @__PURE__ */ __name((sg, allSubgraphs) => {
- const res = [];
- sg.nodes.forEach((_id, pos) => {
- if (!exists(allSubgraphs, _id)) {
- res.push(sg.nodes[pos]);
- }
- });
- return { nodes: res };
- }, "makeUniq");
- lex = {
- firstGraph
- };
- getTypeFromVertex = /* @__PURE__ */ __name((vertex) => {
- if (vertex.type === "square") {
- return "squareRect";
- }
- if (vertex.type === "round") {
- return "roundedRect";
- }
- return vertex.type ?? "squareRect";
- }, "getTypeFromVertex");
- findNode = /* @__PURE__ */ __name((nodes6, id27) => nodes6.find((node2) => node2.id === id27), "findNode");
- destructEdgeType = /* @__PURE__ */ __name((type3) => {
- let arrowTypeStart = "none";
- let arrowTypeEnd = "arrow_point";
- switch (type3) {
- case "arrow_point":
- case "arrow_circle":
- case "arrow_cross":
- arrowTypeEnd = type3;
- break;
- case "double_arrow_point":
- case "double_arrow_circle":
- case "double_arrow_cross":
- arrowTypeStart = type3.replace("double_", "");
- arrowTypeEnd = arrowTypeStart;
- break;
- }
- return { arrowTypeStart, arrowTypeEnd };
- }, "destructEdgeType");
- addNodeFromVertex = /* @__PURE__ */ __name((vertex, nodes6, parentDB, subGraphDB, config6, look) => {
- const parentId = parentDB.get(vertex.id);
- const isGroup2 = subGraphDB.get(vertex.id) ?? false;
- const node2 = findNode(nodes6, vertex.id);
- if (node2) {
- node2.cssStyles = vertex.styles;
- node2.cssCompiledStyles = getCompiledStyles(vertex.classes);
- node2.cssClasses = vertex.classes.join(" ");
- } else {
- nodes6.push({
- id: vertex.id,
- label: vertex.text,
- labelStyle: "",
- parentId,
- padding: config6.flowchart?.padding || 8,
- cssStyles: vertex.styles,
- cssCompiledStyles: getCompiledStyles(["default", "node", ...vertex.classes]),
- cssClasses: "default " + vertex.classes.join(" "),
- shape: getTypeFromVertex(vertex),
- dir: vertex.dir,
- domId: vertex.domId,
- isGroup: isGroup2,
- look,
- link: vertex.link,
- linkTarget: vertex.linkTarget,
- tooltip: getTooltip(vertex.id)
- });
- }
- }, "addNodeFromVertex");
- __name(getCompiledStyles, "getCompiledStyles");
- getData = /* @__PURE__ */ __name(() => {
- const config6 = getConfig2();
- const nodes6 = [];
- const edges5 = [];
- const subGraphs2 = getSubGraphs();
- const parentDB = /* @__PURE__ */ new Map();
- const subGraphDB = /* @__PURE__ */ new Map();
- for (let i2 = subGraphs2.length - 1; i2 >= 0; i2--) {
- const subGraph = subGraphs2[i2];
- if (subGraph.nodes.length > 0) {
- subGraphDB.set(subGraph.id, true);
- }
- for (const id27 of subGraph.nodes) {
- parentDB.set(id27, subGraph.id);
- }
- }
- for (let i2 = subGraphs2.length - 1; i2 >= 0; i2--) {
- const subGraph = subGraphs2[i2];
- nodes6.push({
- id: subGraph.id,
- label: subGraph.title,
- labelStyle: "",
- parentId: parentDB.get(subGraph.id),
- padding: 8,
- cssCompiledStyles: getCompiledStyles(subGraph.classes),
- cssClasses: subGraph.classes.join(" "),
- shape: "rect",
- dir: subGraph.dir,
- isGroup: true,
- look: config6.look
- });
- }
- const n2 = getVertices();
- n2.forEach((vertex) => {
- addNodeFromVertex(vertex, nodes6, parentDB, subGraphDB, config6, config6.look || "classic");
- });
- const e3 = getEdges();
- e3.forEach((rawEdge, index) => {
- const { arrowTypeStart, arrowTypeEnd } = destructEdgeType(rawEdge.type);
- const styles3 = [...e3.defaultStyle ?? []];
- if (rawEdge.style) {
- styles3.push(...rawEdge.style);
- }
- const edge = {
- id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: "L" }),
- start: rawEdge.start,
- end: rawEdge.end,
- type: rawEdge.type ?? "normal",
- label: rawEdge.text,
- labelpos: "c",
- thickness: rawEdge.stroke,
- minlen: rawEdge.length,
- classes: rawEdge?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
- arrowTypeStart: rawEdge?.stroke === "invisible" ? "none" : arrowTypeStart,
- arrowTypeEnd: rawEdge?.stroke === "invisible" ? "none" : arrowTypeEnd,
- arrowheadStyle: "fill: #333",
- labelStyle: styles3,
- style: styles3,
- pattern: rawEdge.stroke,
- look: config6.look
- };
- edges5.push(edge);
- });
- return { nodes: nodes6, edges: edges5, other: {}, config: config6 };
- }, "getData");
- flowDb_default = {
- defaultConfig: /* @__PURE__ */ __name(() => defaultConfig2.flowchart, "defaultConfig"),
- setAccTitle,
- getAccTitle,
- getAccDescription,
- getData,
- setAccDescription,
- addVertex,
- lookUpDomId,
- addLink,
- updateLinkInterpolate,
- updateLink,
- addClass,
- setDirection,
- setClass,
- setTooltip,
- getTooltip,
- setClickEvent,
- setLink,
- bindFunctions,
- getDirection,
- getVertices,
- getEdges,
- getClasses,
- clear: clear3,
- setGen,
- defaultStyle,
- addSubGraph,
- getDepthFirstPos,
- indexNodes,
- getSubGraphs,
- destructLink,
- lex,
- exists,
- makeUniq,
- setDiagramTitle,
- getDiagramTitle
- };
+ }
+ hasDigits = true;
}
- });
-
- // src/dagre-wrapper/blockArrowHelper.ts
- var expandAndDeduplicateDirections, getArrowPoints;
- var init_blockArrowHelper = __esm({
- "src/dagre-wrapper/blockArrowHelper.ts"() {
- "use strict";
- expandAndDeduplicateDirections = /* @__PURE__ */ __name((directions) => {
- const uniqueDirections = /* @__PURE__ */ new Set();
- for (const direction4 of directions) {
- switch (direction4) {
- case "x":
- uniqueDirections.add("right");
- uniqueDirections.add("left");
- break;
- case "y":
- uniqueDirections.add("up");
- uniqueDirections.add("down");
- break;
- default:
- uniqueDirections.add(direction4);
- break;
- }
- }
- return uniqueDirections;
- }, "expandAndDeduplicateDirections");
- getArrowPoints = /* @__PURE__ */ __name((duplicatedDirections, bbox, node2) => {
- const directions = expandAndDeduplicateDirections(duplicatedDirections);
- const f3 = 2;
- const height2 = bbox.height + 2 * node2.padding;
- const midpoint3 = height2 / f3;
- const width3 = bbox.width + 2 * midpoint3 + node2.padding;
- const padding3 = node2.padding / 2;
- if (directions.has("right") && directions.has("left") && directions.has("up") && directions.has("down")) {
- return [
- // Bottom
- { x: 0, y: 0 },
- { x: midpoint3, y: 0 },
- { x: width3 / 2, y: 2 * padding3 },
- { x: width3 - midpoint3, y: 0 },
- { x: width3, y: 0 },
- // Right
- { x: width3, y: -height2 / 3 },
- { x: width3 + 2 * padding3, y: -height2 / 2 },
- { x: width3, y: -2 * height2 / 3 },
- { x: width3, y: -height2 },
- // Top
- { x: width3 - midpoint3, y: -height2 },
- { x: width3 / 2, y: -height2 - 2 * padding3 },
- { x: midpoint3, y: -height2 },
- // Left
- { x: 0, y: -height2 },
- { x: 0, y: -2 * height2 / 3 },
- { x: -2 * padding3, y: -height2 / 2 },
- { x: 0, y: -height2 / 3 }
- ];
- }
- if (directions.has("right") && directions.has("left") && directions.has("up")) {
- return [
- { x: midpoint3, y: 0 },
- { x: width3 - midpoint3, y: 0 },
- { x: width3, y: -height2 / 2 },
- { x: width3 - midpoint3, y: -height2 },
- { x: midpoint3, y: -height2 },
- { x: 0, y: -height2 / 2 }
- ];
- }
- if (directions.has("right") && directions.has("left") && directions.has("down")) {
- return [
- { x: 0, y: 0 },
- { x: midpoint3, y: -height2 },
- { x: width3 - midpoint3, y: -height2 },
- { x: width3, y: 0 }
- ];
- }
- if (directions.has("right") && directions.has("up") && directions.has("down")) {
- return [
- { x: 0, y: 0 },
- { x: width3, y: -midpoint3 },
- { x: width3, y: -height2 + midpoint3 },
- { x: 0, y: -height2 }
- ];
- }
- if (directions.has("left") && directions.has("up") && directions.has("down")) {
- return [
- { x: width3, y: 0 },
- { x: 0, y: -midpoint3 },
- { x: 0, y: -height2 + midpoint3 },
- { x: width3, y: -height2 }
- ];
- }
- if (directions.has("right") && directions.has("left")) {
- return [
- { x: midpoint3, y: 0 },
- { x: midpoint3, y: -padding3 },
- { x: width3 - midpoint3, y: -padding3 },
- { x: width3 - midpoint3, y: 0 },
- { x: width3, y: -height2 / 2 },
- { x: width3 - midpoint3, y: -height2 },
- { x: width3 - midpoint3, y: -height2 + padding3 },
- { x: midpoint3, y: -height2 + padding3 },
- { x: midpoint3, y: -height2 },
- { x: 0, y: -height2 / 2 }
- ];
- }
- if (directions.has("up") && directions.has("down")) {
- return [
- // Bottom center
- { x: width3 / 2, y: 0 },
- // Left pont of bottom arrow
- { x: 0, y: -padding3 },
- { x: midpoint3, y: -padding3 },
- // Left top over vertical section
- { x: midpoint3, y: -height2 + padding3 },
- { x: 0, y: -height2 + padding3 },
- // Top of arrow
- { x: width3 / 2, y: -height2 },
- { x: width3, y: -height2 + padding3 },
- // Top of right vertical bar
- { x: width3 - midpoint3, y: -height2 + padding3 },
- { x: width3 - midpoint3, y: -padding3 },
- { x: width3, y: -padding3 }
- ];
- }
- if (directions.has("right") && directions.has("up")) {
- return [
- { x: 0, y: 0 },
- { x: width3, y: -midpoint3 },
- { x: 0, y: -height2 }
- ];
- }
- if (directions.has("right") && directions.has("down")) {
- return [
- { x: 0, y: 0 },
- { x: width3, y: 0 },
- { x: 0, y: -height2 }
- ];
- }
- if (directions.has("left") && directions.has("up")) {
- return [
- { x: width3, y: 0 },
- { x: 0, y: -midpoint3 },
- { x: width3, y: -height2 }
- ];
- }
- if (directions.has("left") && directions.has("down")) {
- return [
- { x: width3, y: 0 },
- { x: 0, y: 0 },
- { x: width3, y: -height2 }
- ];
- }
- if (directions.has("right")) {
- return [
- { x: midpoint3, y: -padding3 },
- { x: midpoint3, y: -padding3 },
- { x: width3 - midpoint3, y: -padding3 },
- { x: width3 - midpoint3, y: 0 },
- { x: width3, y: -height2 / 2 },
- { x: width3 - midpoint3, y: -height2 },
- { x: width3 - midpoint3, y: -height2 + padding3 },
- // top left corner of arrow
- { x: midpoint3, y: -height2 + padding3 },
- { x: midpoint3, y: -height2 + padding3 }
- ];
- }
- if (directions.has("left")) {
- return [
- { x: midpoint3, y: 0 },
- { x: midpoint3, y: -padding3 },
- // Two points, the right corners
- { x: width3 - midpoint3, y: -padding3 },
- { x: width3 - midpoint3, y: -height2 + padding3 },
- { x: midpoint3, y: -height2 + padding3 },
- { x: midpoint3, y: -height2 },
- { x: 0, y: -height2 / 2 }
- ];
- }
- if (directions.has("up")) {
- return [
- // Bottom center
- { x: midpoint3, y: -padding3 },
- // Left top over vertical section
- { x: midpoint3, y: -height2 + padding3 },
- { x: 0, y: -height2 + padding3 },
- // Top of arrow
- { x: width3 / 2, y: -height2 },
- { x: width3, y: -height2 + padding3 },
- // Top of right vertical bar
- { x: width3 - midpoint3, y: -height2 + padding3 },
- { x: width3 - midpoint3, y: -padding3 }
- ];
- }
- if (directions.has("down")) {
- return [
- // Bottom center
- { x: width3 / 2, y: 0 },
- // Left pont of bottom arrow
- { x: 0, y: -padding3 },
- { x: midpoint3, y: -padding3 },
- // Left top over vertical section
- { x: midpoint3, y: -height2 + padding3 },
- { x: width3 - midpoint3, y: -height2 + padding3 },
- { x: width3 - midpoint3, y: -padding3 },
- { x: width3, y: -padding3 }
- ];
- }
- return [{ x: 0, y: 0 }];
- }, "getArrowPoints");
+ if (!hasDigits || ch === "_") return false;
+ return true;
+ }
+ function constructYamlInteger(data6) {
+ var value2 = data6, sign2 = 1, ch;
+ if (value2.indexOf("_") !== -1) {
+ value2 = value2.replace(/_/g, "");
}
- });
-
- // ../../node_modules/.pnpm/marked@13.0.3/node_modules/marked/lib/marked.esm.js
- function _getDefaults() {
- return {
- async: false,
- breaks: false,
- extensions: null,
- gfm: true,
- hooks: null,
- pedantic: false,
- renderer: null,
- silent: false,
- tokenizer: null,
- walkTokens: null
- };
+ ch = value2[0];
+ if (ch === "-" || ch === "+") {
+ if (ch === "-") sign2 = -1;
+ value2 = value2.slice(1);
+ ch = value2[0];
+ }
+ if (value2 === "0") return 0;
+ if (ch === "0") {
+ if (value2[1] === "b") return sign2 * parseInt(value2.slice(2), 2);
+ if (value2[1] === "x") return sign2 * parseInt(value2.slice(2), 16);
+ if (value2[1] === "o") return sign2 * parseInt(value2.slice(2), 8);
+ }
+ return sign2 * parseInt(value2, 10);
}
- function changeDefaults(newDefaults) {
- _defaults = newDefaults;
+ function isInteger(object3) {
+ return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 === 0 && !common.isNegativeZero(object3));
}
- function escape$1(html2, encode) {
- if (encode) {
- if (escapeTest.test(html2)) {
- return html2.replace(escapeReplace, getEscapeReplacement);
+ function resolveYamlFloat(data6) {
+ if (data6 === null) return false;
+ if (!YAML_FLOAT_PATTERN.test(data6) || // Quick hack to not allow integers end with `_`
+ // Probably should update regexp & check speed
+ data6[data6.length - 1] === "_") {
+ return false;
+ }
+ return true;
+ }
+ function constructYamlFloat(data6) {
+ var value2, sign2;
+ value2 = data6.replace(/_/g, "").toLowerCase();
+ sign2 = value2[0] === "-" ? -1 : 1;
+ if ("+-".indexOf(value2[0]) >= 0) {
+ value2 = value2.slice(1);
+ }
+ if (value2 === ".inf") {
+ return sign2 === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+ } else if (value2 === ".nan") {
+ return NaN;
+ }
+ return sign2 * parseFloat(value2, 10);
+ }
+ function representYamlFloat(object3, style3) {
+ var res;
+ if (isNaN(object3)) {
+ switch (style3) {
+ case "lowercase":
+ return ".nan";
+ case "uppercase":
+ return ".NAN";
+ case "camelcase":
+ return ".NaN";
}
- } else {
- if (escapeTestNoEncode.test(html2)) {
- return html2.replace(escapeReplaceNoEncode, getEscapeReplacement);
+ } else if (Number.POSITIVE_INFINITY === object3) {
+ switch (style3) {
+ case "lowercase":
+ return ".inf";
+ case "uppercase":
+ return ".INF";
+ case "camelcase":
+ return ".Inf";
+ }
+ } else if (Number.NEGATIVE_INFINITY === object3) {
+ switch (style3) {
+ case "lowercase":
+ return "-.inf";
+ case "uppercase":
+ return "-.INF";
+ case "camelcase":
+ return "-.Inf";
}
+ } else if (common.isNegativeZero(object3)) {
+ return "-0.0";
}
- return html2;
+ res = object3.toString(10);
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
+ }
+ function isFloat(object3) {
+ return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 !== 0 || common.isNegativeZero(object3));
+ }
+ function resolveYamlTimestamp(data6) {
+ if (data6 === null) return false;
+ if (YAML_DATE_REGEXP.exec(data6) !== null) return true;
+ if (YAML_TIMESTAMP_REGEXP.exec(data6) !== null) return true;
+ return false;
}
- function unescape2(html2) {
- return html2.replace(unescapeTest, (_2, n2) => {
- n2 = n2.toLowerCase();
- if (n2 === "colon")
- return ":";
- if (n2.charAt(0) === "#") {
- return n2.charAt(1) === "x" ? String.fromCharCode(parseInt(n2.substring(2), 16)) : String.fromCharCode(+n2.substring(1));
+ function constructYamlTimestamp(data6) {
+ var match2, year, month, day, hour, minute, second2, fraction = 0, delta = null, tz_hour, tz_minute, date2;
+ match2 = YAML_DATE_REGEXP.exec(data6);
+ if (match2 === null) match2 = YAML_TIMESTAMP_REGEXP.exec(data6);
+ if (match2 === null) throw new Error("Date resolve error");
+ year = +match2[1];
+ month = +match2[2] - 1;
+ day = +match2[3];
+ if (!match2[4]) {
+ return new Date(Date.UTC(year, month, day));
+ }
+ hour = +match2[4];
+ minute = +match2[5];
+ second2 = +match2[6];
+ if (match2[7]) {
+ fraction = match2[7].slice(0, 3);
+ while (fraction.length < 3) {
+ fraction += "0";
}
- return "";
- });
+ fraction = +fraction;
+ }
+ if (match2[9]) {
+ tz_hour = +match2[10];
+ tz_minute = +(match2[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 6e4;
+ if (match2[9] === "-") delta = -delta;
+ }
+ date2 = new Date(Date.UTC(year, month, day, hour, minute, second2, fraction));
+ if (delta) date2.setTime(date2.getTime() - delta);
+ return date2;
}
- function edit(regex2, opt) {
- let source = typeof regex2 === "string" ? regex2 : regex2.source;
- opt = opt || "";
- const obj = {
- replace: /* @__PURE__ */ __name((name, val) => {
- let valSource = typeof val === "string" ? val : val.source;
- valSource = valSource.replace(caret, "$1");
- source = source.replace(name, valSource);
- return obj;
- }, "replace"),
- getRegex: /* @__PURE__ */ __name(() => {
- return new RegExp(source, opt);
- }, "getRegex")
- };
- return obj;
+ function representYamlTimestamp(object3) {
+ return object3.toISOString();
}
- function cleanUrl(href) {
- try {
- href = encodeURI(href).replace(/%25/g, "%");
- } catch {
- return null;
+ function resolveYamlMerge(data6) {
+ return data6 === "<<" || data6 === null;
+ }
+ function resolveYamlBinary(data6) {
+ if (data6 === null) return false;
+ var code, idx, bitlen = 0, max10 = data6.length, map5 = BASE64_MAP;
+ for (idx = 0; idx < max10; idx++) {
+ code = map5.indexOf(data6.charAt(idx));
+ if (code > 64) continue;
+ if (code < 0) return false;
+ bitlen += 6;
}
- return href;
+ return bitlen % 8 === 0;
}
- function splitCells(tableRow, count) {
- const row = tableRow.replace(/\|/g, (match2, offset, str2) => {
- let escaped = false;
- let curr = offset;
- while (--curr >= 0 && str2[curr] === "\\")
- escaped = !escaped;
- if (escaped) {
- return "|";
- } else {
- return " |";
+ function constructYamlBinary(data6) {
+ var idx, tailbits, input = data6.replace(/[\r\n=]/g, ""), max10 = input.length, map5 = BASE64_MAP, bits = 0, result = [];
+ for (idx = 0; idx < max10; idx++) {
+ if (idx % 4 === 0 && idx) {
+ result.push(bits >> 16 & 255);
+ result.push(bits >> 8 & 255);
+ result.push(bits & 255);
}
- }), cells = row.split(/ \|/);
- let i2 = 0;
- if (!cells[0].trim()) {
- cells.shift();
+ bits = bits << 6 | map5.indexOf(input.charAt(idx));
}
- if (cells.length > 0 && !cells[cells.length - 1].trim()) {
- cells.pop();
+ tailbits = max10 % 4 * 6;
+ if (tailbits === 0) {
+ result.push(bits >> 16 & 255);
+ result.push(bits >> 8 & 255);
+ result.push(bits & 255);
+ } else if (tailbits === 18) {
+ result.push(bits >> 10 & 255);
+ result.push(bits >> 2 & 255);
+ } else if (tailbits === 12) {
+ result.push(bits >> 4 & 255);
}
- if (count) {
- if (cells.length > count) {
- cells.splice(count);
- } else {
- while (cells.length < count)
- cells.push("");
+ return new Uint8Array(result);
+ }
+ function representYamlBinary(object3) {
+ var result = "", bits = 0, idx, tail, max10 = object3.length, map5 = BASE64_MAP;
+ for (idx = 0; idx < max10; idx++) {
+ if (idx % 3 === 0 && idx) {
+ result += map5[bits >> 18 & 63];
+ result += map5[bits >> 12 & 63];
+ result += map5[bits >> 6 & 63];
+ result += map5[bits & 63];
}
+ bits = (bits << 8) + object3[idx];
}
- for (; i2 < cells.length; i2++) {
- cells[i2] = cells[i2].trim().replace(/\\\|/g, "|");
+ tail = max10 % 3;
+ if (tail === 0) {
+ result += map5[bits >> 18 & 63];
+ result += map5[bits >> 12 & 63];
+ result += map5[bits >> 6 & 63];
+ result += map5[bits & 63];
+ } else if (tail === 2) {
+ result += map5[bits >> 10 & 63];
+ result += map5[bits >> 4 & 63];
+ result += map5[bits << 2 & 63];
+ result += map5[64];
+ } else if (tail === 1) {
+ result += map5[bits >> 2 & 63];
+ result += map5[bits << 4 & 63];
+ result += map5[64];
+ result += map5[64];
}
- return cells;
+ return result;
}
- function rtrim(str2, c3, invert2) {
- const l2 = str2.length;
- if (l2 === 0) {
- return "";
- }
- let suffLen = 0;
- while (suffLen < l2) {
- const currChar = str2.charAt(l2 - suffLen - 1);
- if (currChar === c3 && !invert2) {
- suffLen++;
- } else if (currChar !== c3 && invert2) {
- suffLen++;
- } else {
- break;
+ function isBinary(obj) {
+ return Object.prototype.toString.call(obj) === "[object Uint8Array]";
+ }
+ function resolveYamlOmap(data6) {
+ if (data6 === null) return true;
+ var objectKeys = [], index, length2, pair, pairKey, pairHasKey, object3 = data6;
+ for (index = 0, length2 = object3.length; index < length2; index += 1) {
+ pair = object3[index];
+ pairHasKey = false;
+ if (_toString$2.call(pair) !== "[object Object]") return false;
+ for (pairKey in pair) {
+ if (_hasOwnProperty$3.call(pair, pairKey)) {
+ if (!pairHasKey) pairHasKey = true;
+ else return false;
+ }
}
+ if (!pairHasKey) return false;
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
+ else return false;
}
- return str2.slice(0, l2 - suffLen);
+ return true;
}
- function findClosingBracket(str2, b2) {
- if (str2.indexOf(b2[1]) === -1) {
- return -1;
+ function constructYamlOmap(data6) {
+ return data6 !== null ? data6 : [];
+ }
+ function resolveYamlPairs(data6) {
+ if (data6 === null) return true;
+ var index, length2, pair, keys3, result, object3 = data6;
+ result = new Array(object3.length);
+ for (index = 0, length2 = object3.length; index < length2; index += 1) {
+ pair = object3[index];
+ if (_toString$1.call(pair) !== "[object Object]") return false;
+ keys3 = Object.keys(pair);
+ if (keys3.length !== 1) return false;
+ result[index] = [keys3[0], pair[keys3[0]]];
}
- let level = 0;
- for (let i2 = 0; i2 < str2.length; i2++) {
- if (str2[i2] === "\\") {
- i2++;
- } else if (str2[i2] === b2[0]) {
- level++;
- } else if (str2[i2] === b2[1]) {
- level--;
- if (level < 0) {
- return i2;
- }
+ return true;
+ }
+ function constructYamlPairs(data6) {
+ if (data6 === null) return [];
+ var index, length2, pair, keys3, result, object3 = data6;
+ result = new Array(object3.length);
+ for (index = 0, length2 = object3.length; index < length2; index += 1) {
+ pair = object3[index];
+ keys3 = Object.keys(pair);
+ result[index] = [keys3[0], pair[keys3[0]]];
+ }
+ return result;
+ }
+ function resolveYamlSet(data6) {
+ if (data6 === null) return true;
+ var key, object3 = data6;
+ for (key in object3) {
+ if (_hasOwnProperty$2.call(object3, key)) {
+ if (object3[key] !== null) return false;
}
}
+ return true;
+ }
+ function constructYamlSet(data6) {
+ return data6 !== null ? data6 : {};
+ }
+ function _class(obj) {
+ return Object.prototype.toString.call(obj);
+ }
+ function is_EOL(c3) {
+ return c3 === 10 || c3 === 13;
+ }
+ function is_WHITE_SPACE(c3) {
+ return c3 === 9 || c3 === 32;
+ }
+ function is_WS_OR_EOL(c3) {
+ return c3 === 9 || c3 === 32 || c3 === 10 || c3 === 13;
+ }
+ function is_FLOW_INDICATOR(c3) {
+ return c3 === 44 || c3 === 91 || c3 === 93 || c3 === 123 || c3 === 125;
+ }
+ function fromHexCode(c3) {
+ var lc;
+ if (48 <= c3 && c3 <= 57) {
+ return c3 - 48;
+ }
+ lc = c3 | 32;
+ if (97 <= lc && lc <= 102) {
+ return lc - 97 + 10;
+ }
return -1;
}
- function outputLink(cap, link3, raw, lexer2) {
- const href = link3.href;
- const title2 = link3.title ? escape$1(link3.title) : null;
- const text2 = cap[1].replace(/\\([\[\]])/g, "$1");
- if (cap[0].charAt(0) !== "!") {
- lexer2.state.inLink = true;
- const token2 = {
- type: "link",
- raw,
- href,
- title: title2,
- text: text2,
- tokens: lexer2.inlineTokens(text2)
- };
- lexer2.state.inLink = false;
- return token2;
+ function escapedHexLen(c3) {
+ if (c3 === 120) {
+ return 2;
}
- return {
- type: "image",
- raw,
- href,
- title: title2,
- text: escape$1(text2)
- };
+ if (c3 === 117) {
+ return 4;
+ }
+ if (c3 === 85) {
+ return 8;
+ }
+ return 0;
}
- function indentCodeCompensation(raw, text2) {
- const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
- if (matchIndentToCode === null) {
- return text2;
+ function fromDecimalCode(c3) {
+ if (48 <= c3 && c3 <= 57) {
+ return c3 - 48;
}
- const indentToCode = matchIndentToCode[1];
- return text2.split("\n").map((node2) => {
- const matchIndentInNode = node2.match(/^\s+/);
- if (matchIndentInNode === null) {
- return node2;
- }
- const [indentInNode] = matchIndentInNode;
- if (indentInNode.length >= indentToCode.length) {
- return node2.slice(indentToCode.length);
- }
- return node2;
- }).join("\n");
+ return -1;
}
- function marked(src, opt) {
- return markedInstance.parse(src, opt);
+ function simpleEscapeSequence(c3) {
+ return c3 === 48 ? "\0" : c3 === 97 ? "\x07" : c3 === 98 ? "\b" : c3 === 116 ? " " : c3 === 9 ? " " : c3 === 110 ? "\n" : c3 === 118 ? "\v" : c3 === 102 ? "\f" : c3 === 114 ? "\r" : c3 === 101 ? "\x1B" : c3 === 32 ? " " : c3 === 34 ? '"' : c3 === 47 ? "/" : c3 === 92 ? "\\" : c3 === 78 ? "\x85" : c3 === 95 ? "\xA0" : c3 === 76 ? "\u2028" : c3 === 80 ? "\u2029" : "";
}
- var _defaults, escapeTest, escapeReplace, escapeTestNoEncode, escapeReplaceNoEncode, escapeReplacements, getEscapeReplacement, unescapeTest, caret, noopTest, _Tokenizer, newline, blockCode, fences, hr, heading, bullet, lheading, _paragraph, blockText, _blockLabel, def, list, _tag, _comment, html, paragraph, blockquote, blockNormal, gfmTable, blockGfm, blockPedantic, escape3, inlineCode, br, inlineText, _punctuation, punctuation, blockSkip, emStrongLDelim, emStrongRDelimAst, emStrongRDelimUnd, anyPunctuation, autolink, _inlineComment, tag, _inlineLabel, link, reflink, nolink, reflinkSearch, inlineNormal, inlinePedantic, inlineGfm, inlineBreaks, block, inline, _Lexer, _Renderer, _TextRenderer, _Parser, _Hooks, Marked, markedInstance, options, setOptions, use, walkTokens, parseInline, parser2, lexer;
- var init_marked_esm = __esm({
- "../../node_modules/.pnpm/marked@13.0.3/node_modules/marked/lib/marked.esm.js"() {
- "use strict";
- __name(_getDefaults, "_getDefaults");
- _defaults = _getDefaults();
- __name(changeDefaults, "changeDefaults");
- escapeTest = /[&<>"']/;
- escapeReplace = new RegExp(escapeTest.source, "g");
- escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;
- escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, "g");
- escapeReplacements = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'"
- };
- getEscapeReplacement = /* @__PURE__ */ __name((ch) => escapeReplacements[ch], "getEscapeReplacement");
- __name(escape$1, "escape$1");
- unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
- __name(unescape2, "unescape");
- caret = /(^|[^\[])\^/g;
- __name(edit, "edit");
- __name(cleanUrl, "cleanUrl");
- noopTest = { exec: /* @__PURE__ */ __name(() => null, "exec") };
- __name(splitCells, "splitCells");
- __name(rtrim, "rtrim");
- __name(findClosingBracket, "findClosingBracket");
- __name(outputLink, "outputLink");
- __name(indentCodeCompensation, "indentCodeCompensation");
- _Tokenizer = class {
- static {
- __name(this, "_Tokenizer");
- }
- options;
- rules;
- // set by the lexer
- lexer;
- // set by the lexer
- constructor(options3) {
- this.options = options3 || _defaults;
- }
- space(src) {
- const cap = this.rules.block.newline.exec(src);
- if (cap && cap[0].length > 0) {
- return {
- type: "space",
- raw: cap[0]
- };
+ function charFromCodepoint(c3) {
+ if (c3 <= 65535) {
+ return String.fromCharCode(c3);
+ }
+ return String.fromCharCode(
+ (c3 - 65536 >> 10) + 55296,
+ (c3 - 65536 & 1023) + 56320
+ );
+ }
+ function State$1(input, options3) {
+ this.input = input;
+ this.filename = options3["filename"] || null;
+ this.schema = options3["schema"] || _default;
+ this.onWarning = options3["onWarning"] || null;
+ this.legacy = options3["legacy"] || false;
+ this.json = options3["json"] || false;
+ this.listener = options3["listener"] || null;
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+ this.firstTabInLine = -1;
+ this.documents = [];
+ }
+ function generateError(state4, message) {
+ var mark = {
+ name: state4.filename,
+ buffer: state4.input.slice(0, -1),
+ // omit trailing \0
+ position: state4.position,
+ line: state4.line,
+ column: state4.position - state4.lineStart
+ };
+ mark.snippet = snippet(mark);
+ return new exception(message, mark);
+ }
+ function throwError(state4, message) {
+ throw generateError(state4, message);
+ }
+ function throwWarning(state4, message) {
+ if (state4.onWarning) {
+ state4.onWarning.call(null, generateError(state4, message));
+ }
+ }
+ function captureSegment(state4, start3, end2, checkJson) {
+ var _position, _length, _character, _result;
+ if (start3 < end2) {
+ _result = state4.input.slice(start3, end2);
+ if (checkJson) {
+ for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
+ throwError(state4, "expected valid JSON character");
}
}
- code(src) {
- const cap = this.rules.block.code.exec(src);
- if (cap) {
- const text2 = cap[0].replace(/^ {1,4}/gm, "");
- return {
- type: "code",
- raw: cap[0],
- codeBlockStyle: "indented",
- text: !this.options.pedantic ? rtrim(text2, "\n") : text2
- };
- }
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
+ throwError(state4, "the stream contains non-printable characters");
+ }
+ state4.result += _result;
+ }
+ }
+ function mergeMappings(state4, destination, source, overridableKeys) {
+ var sourceKeys, key, index, quantity;
+ if (!common.isObject(source)) {
+ throwError(state4, "cannot merge mappings; the provided source object is unacceptable");
+ }
+ sourceKeys = Object.keys(source);
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+ if (!_hasOwnProperty$1.call(destination, key)) {
+ destination[key] = source[key];
+ overridableKeys[key] = true;
+ }
+ }
+ }
+ function storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
+ var index, quantity;
+ if (Array.isArray(keyNode)) {
+ keyNode = Array.prototype.slice.call(keyNode);
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
+ if (Array.isArray(keyNode[index])) {
+ throwError(state4, "nested arrays are not supported inside keys");
}
- fences(src) {
- const cap = this.rules.block.fences.exec(src);
- if (cap) {
- const raw = cap[0];
- const text2 = indentCodeCompensation(raw, cap[3] || "");
- return {
- type: "code",
- raw,
- lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2],
- text: text2
- };
- }
+ if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
+ keyNode[index] = "[object Object]";
}
- heading(src) {
- const cap = this.rules.block.heading.exec(src);
- if (cap) {
- let text2 = cap[2].trim();
- if (/#$/.test(text2)) {
- const trimmed = rtrim(text2, "#");
- if (this.options.pedantic) {
- text2 = trimmed.trim();
- } else if (!trimmed || / $/.test(trimmed)) {
- text2 = trimmed.trim();
- }
- }
- return {
- type: "heading",
- raw: cap[0],
- depth: cap[1].length,
- text: text2,
- tokens: this.lexer.inline(text2)
- };
- }
+ }
+ }
+ if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
+ keyNode = "[object Object]";
+ }
+ keyNode = String(keyNode);
+ if (_result === null) {
+ _result = {};
+ }
+ if (keyTag === "tag:yaml.org,2002:merge") {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state4, _result, valueNode[index], overridableKeys);
}
- hr(src) {
- const cap = this.rules.block.hr.exec(src);
- if (cap) {
- return {
- type: "hr",
- raw: rtrim(cap[0], "\n")
- };
- }
+ } else {
+ mergeMappings(state4, _result, valueNode, overridableKeys);
+ }
+ } else {
+ if (!state4.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
+ state4.line = startLine || state4.line;
+ state4.lineStart = startLineStart || state4.lineStart;
+ state4.position = startPos || state4.position;
+ throwError(state4, "duplicated mapping key");
+ }
+ if (keyNode === "__proto__") {
+ Object.defineProperty(_result, keyNode, {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: valueNode
+ });
+ } else {
+ _result[keyNode] = valueNode;
+ }
+ delete overridableKeys[keyNode];
+ }
+ return _result;
+ }
+ function readLineBreak(state4) {
+ var ch;
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch === 10) {
+ state4.position++;
+ } else if (ch === 13) {
+ state4.position++;
+ if (state4.input.charCodeAt(state4.position) === 10) {
+ state4.position++;
+ }
+ } else {
+ throwError(state4, "a line break is expected");
+ }
+ state4.line += 1;
+ state4.lineStart = state4.position;
+ state4.firstTabInLine = -1;
+ }
+ function skipSeparationSpace(state4, allowComments, checkIndent) {
+ var lineBreaks = 0, ch = state4.input.charCodeAt(state4.position);
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ if (ch === 9 && state4.firstTabInLine === -1) {
+ state4.firstTabInLine = state4.position;
}
- blockquote(src) {
- const cap = this.rules.block.blockquote.exec(src);
- if (cap) {
- let lines = rtrim(cap[0], "\n").split("\n");
- let raw = "";
- let text2 = "";
- const tokens2 = [];
- while (lines.length > 0) {
- let inBlockquote = false;
- const currentLines = [];
- let i2;
- for (i2 = 0; i2 < lines.length; i2++) {
- if (/^ {0,3}>/.test(lines[i2])) {
- currentLines.push(lines[i2]);
- inBlockquote = true;
- } else if (!inBlockquote) {
- currentLines.push(lines[i2]);
- } else {
- break;
- }
- }
- lines = lines.slice(i2);
- const currentRaw = currentLines.join("\n");
- const currentText = currentRaw.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, "\n $1").replace(/^ {0,3}>[ \t]?/gm, "");
- raw = raw ? `${raw}
-${currentRaw}` : currentRaw;
- text2 = text2 ? `${text2}
-${currentText}` : currentText;
- const top2 = this.lexer.state.top;
- this.lexer.state.top = true;
- this.lexer.blockTokens(currentText, tokens2, true);
- this.lexer.state.top = top2;
- if (lines.length === 0) {
- break;
- }
- const lastToken = tokens2[tokens2.length - 1];
- if (lastToken?.type === "code") {
- break;
- } else if (lastToken?.type === "blockquote") {
- const oldToken = lastToken;
- const newText = oldToken.raw + "\n" + lines.join("\n");
- const newToken = this.blockquote(newText);
- tokens2[tokens2.length - 1] = newToken;
- raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;
- text2 = text2.substring(0, text2.length - oldToken.text.length) + newToken.text;
- break;
- } else if (lastToken?.type === "list") {
- const oldToken = lastToken;
- const newText = oldToken.raw + "\n" + lines.join("\n");
- const newToken = this.list(newText);
- tokens2[tokens2.length - 1] = newToken;
- raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;
- text2 = text2.substring(0, text2.length - oldToken.raw.length) + newToken.raw;
- lines = newText.substring(tokens2[tokens2.length - 1].raw.length).split("\n");
- continue;
- }
- }
- return {
- type: "blockquote",
- raw,
- tokens: tokens2,
- text: text2
- };
- }
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ if (allowComments && ch === 35) {
+ do {
+ ch = state4.input.charCodeAt(++state4.position);
+ } while (ch !== 10 && ch !== 13 && ch !== 0);
+ }
+ if (is_EOL(ch)) {
+ readLineBreak(state4);
+ ch = state4.input.charCodeAt(state4.position);
+ lineBreaks++;
+ state4.lineIndent = 0;
+ while (ch === 32) {
+ state4.lineIndent++;
+ ch = state4.input.charCodeAt(++state4.position);
}
- list(src) {
- let cap = this.rules.block.list.exec(src);
- if (cap) {
- let bull = cap[1].trim();
- const isordered = bull.length > 1;
- const list2 = {
- type: "list",
- raw: "",
- ordered: isordered,
- start: isordered ? +bull.slice(0, -1) : "",
- loose: false,
- items: []
- };
- bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
- if (this.options.pedantic) {
- bull = isordered ? bull : "[*+-]";
- }
- const itemRegex = new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`);
- let endsWithBlankLine = false;
- while (src) {
- let endEarly = false;
- let raw = "";
- let itemContents = "";
- if (!(cap = itemRegex.exec(src))) {
- break;
- }
- if (this.rules.block.hr.test(src)) {
- break;
- }
- raw = cap[0];
- src = src.substring(raw.length);
- let line2 = cap[2].split("\n", 1)[0].replace(/^\t+/, (t4) => " ".repeat(3 * t4.length));
- let nextLine = src.split("\n", 1)[0];
- let blankLine = !line2.trim();
- let indent = 0;
- if (this.options.pedantic) {
- indent = 2;
- itemContents = line2.trimStart();
- } else if (blankLine) {
- indent = cap[1].length + 1;
- } else {
- indent = cap[2].search(/[^ ]/);
- indent = indent > 4 ? 1 : indent;
- itemContents = line2.slice(indent);
- indent += cap[1].length;
- }
- if (blankLine && /^ *$/.test(nextLine)) {
- raw += nextLine + "\n";
- src = src.substring(nextLine.length + 1);
- endEarly = true;
- }
- if (!endEarly) {
- const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`);
- const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
- const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
- const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
- while (src) {
- const rawLine = src.split("\n", 1)[0];
- nextLine = rawLine;
- if (this.options.pedantic) {
- nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ");
- }
- if (fencesBeginRegex.test(nextLine)) {
- break;
- }
- if (headingBeginRegex.test(nextLine)) {
- break;
- }
- if (nextBulletRegex.test(nextLine)) {
- break;
- }
- if (hrRegex.test(src)) {
- break;
- }
- if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) {
- itemContents += "\n" + nextLine.slice(indent);
- } else {
- if (blankLine) {
- break;
- }
- if (line2.search(/[^ ]/) >= 4) {
- break;
- }
- if (fencesBeginRegex.test(line2)) {
- break;
- }
- if (headingBeginRegex.test(line2)) {
- break;
- }
- if (hrRegex.test(line2)) {
- break;
- }
- itemContents += "\n" + nextLine;
- }
- if (!blankLine && !nextLine.trim()) {
- blankLine = true;
- }
- raw += rawLine + "\n";
- src = src.substring(rawLine.length + 1);
- line2 = nextLine.slice(indent);
- }
- }
- if (!list2.loose) {
- if (endsWithBlankLine) {
- list2.loose = true;
- } else if (/\n *\n *$/.test(raw)) {
- endsWithBlankLine = true;
- }
- }
- let istask = null;
- let ischecked;
- if (this.options.gfm) {
- istask = /^\[[ xX]\] /.exec(itemContents);
- if (istask) {
- ischecked = istask[0] !== "[ ] ";
- itemContents = itemContents.replace(/^\[[ xX]\] +/, "");
- }
- }
- list2.items.push({
- type: "list_item",
- raw,
- task: !!istask,
- checked: ischecked,
- loose: false,
- text: itemContents,
- tokens: []
- });
- list2.raw += raw;
- }
- list2.items[list2.items.length - 1].raw = list2.items[list2.items.length - 1].raw.trimEnd();
- list2.items[list2.items.length - 1].text = list2.items[list2.items.length - 1].text.trimEnd();
- list2.raw = list2.raw.trimEnd();
- for (let i2 = 0; i2 < list2.items.length; i2++) {
- this.lexer.state.top = false;
- list2.items[i2].tokens = this.lexer.blockTokens(list2.items[i2].text, []);
- if (!list2.loose) {
- const spacers = list2.items[i2].tokens.filter((t4) => t4.type === "space");
- const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t4) => /\n.*\n/.test(t4.raw));
- list2.loose = hasMultipleLineBreaks;
- }
- }
- if (list2.loose) {
- for (let i2 = 0; i2 < list2.items.length; i2++) {
- list2.items[i2].loose = true;
- }
- }
- return list2;
- }
+ } else {
+ break;
+ }
+ }
+ if (checkIndent !== -1 && lineBreaks !== 0 && state4.lineIndent < checkIndent) {
+ throwWarning(state4, "deficient indentation");
+ }
+ return lineBreaks;
+ }
+ function testDocumentSeparator(state4) {
+ var _position = state4.position, ch;
+ ch = state4.input.charCodeAt(_position);
+ if ((ch === 45 || ch === 46) && ch === state4.input.charCodeAt(_position + 1) && ch === state4.input.charCodeAt(_position + 2)) {
+ _position += 3;
+ ch = state4.input.charCodeAt(_position);
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ function writeFoldedLines(state4, count) {
+ if (count === 1) {
+ state4.result += " ";
+ } else if (count > 1) {
+ state4.result += common.repeat("\n", count - 1);
+ }
+ }
+ function readPlainScalar(state4, nodeIndent, withinFlowCollection) {
+ var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state4.kind, _result = state4.result, ch;
+ ch = state4.input.charCodeAt(state4.position);
+ if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
+ return false;
+ }
+ if (ch === 63 || ch === 45) {
+ following = state4.input.charCodeAt(state4.position + 1);
+ if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+ state4.kind = "scalar";
+ state4.result = "";
+ captureStart = captureEnd = state4.position;
+ hasPendingContent = false;
+ while (ch !== 0) {
+ if (ch === 58) {
+ following = state4.input.charCodeAt(state4.position + 1);
+ if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
}
- html(src) {
- const cap = this.rules.block.html.exec(src);
- if (cap) {
- const token2 = {
- type: "html",
- block: true,
- raw: cap[0],
- pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style",
- text: cap[0]
- };
- return token2;
- }
+ } else if (ch === 35) {
+ preceding = state4.input.charCodeAt(state4.position - 1);
+ if (is_WS_OR_EOL(preceding)) {
+ break;
}
- def(src) {
- const cap = this.rules.block.def.exec(src);
- if (cap) {
- const tag2 = cap[1].toLowerCase().replace(/\s+/g, " ");
- const href = cap[2] ? cap[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "";
- const title2 = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : cap[3];
- return {
- type: "def",
- tag: tag2,
- raw: cap[0],
- href,
- title: title2
- };
- }
+ } else if (state4.position === state4.lineStart && testDocumentSeparator(state4) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+ } else if (is_EOL(ch)) {
+ _line = state4.line;
+ _lineStart = state4.lineStart;
+ _lineIndent = state4.lineIndent;
+ skipSeparationSpace(state4, false, -1);
+ if (state4.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state4.input.charCodeAt(state4.position);
+ continue;
+ } else {
+ state4.position = captureEnd;
+ state4.line = _line;
+ state4.lineStart = _lineStart;
+ state4.lineIndent = _lineIndent;
+ break;
}
- table(src) {
- const cap = this.rules.block.table.exec(src);
- if (!cap) {
- return;
- }
- if (!/[:|]/.test(cap[2])) {
- return;
- }
- const headers = splitCells(cap[1]);
- const aligns = cap[2].replace(/^\||\| *$/g, "").split("|");
- const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, "").split("\n") : [];
- const item = {
- type: "table",
- raw: cap[0],
- header: [],
- align: [],
- rows: []
- };
- if (headers.length !== aligns.length) {
- return;
- }
- for (const align of aligns) {
- if (/^ *-+: *$/.test(align)) {
- item.align.push("right");
- } else if (/^ *:-+: *$/.test(align)) {
- item.align.push("center");
- } else if (/^ *:-+ *$/.test(align)) {
- item.align.push("left");
+ }
+ if (hasPendingContent) {
+ captureSegment(state4, captureStart, captureEnd, false);
+ writeFoldedLines(state4, state4.line - _line);
+ captureStart = captureEnd = state4.position;
+ hasPendingContent = false;
+ }
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state4.position + 1;
+ }
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ captureSegment(state4, captureStart, captureEnd, false);
+ if (state4.result) {
+ return true;
+ }
+ state4.kind = _kind;
+ state4.result = _result;
+ return false;
+ }
+ function readSingleQuotedScalar(state4, nodeIndent) {
+ var ch, captureStart, captureEnd;
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch !== 39) {
+ return false;
+ }
+ state4.kind = "scalar";
+ state4.result = "";
+ state4.position++;
+ captureStart = captureEnd = state4.position;
+ while ((ch = state4.input.charCodeAt(state4.position)) !== 0) {
+ if (ch === 39) {
+ captureSegment(state4, captureStart, state4.position, true);
+ ch = state4.input.charCodeAt(++state4.position);
+ if (ch === 39) {
+ captureStart = state4.position;
+ state4.position++;
+ captureEnd = state4.position;
+ } else {
+ return true;
+ }
+ } else if (is_EOL(ch)) {
+ captureSegment(state4, captureStart, captureEnd, true);
+ writeFoldedLines(state4, skipSeparationSpace(state4, false, nodeIndent));
+ captureStart = captureEnd = state4.position;
+ } else if (state4.position === state4.lineStart && testDocumentSeparator(state4)) {
+ throwError(state4, "unexpected end of the document within a single quoted scalar");
+ } else {
+ state4.position++;
+ captureEnd = state4.position;
+ }
+ }
+ throwError(state4, "unexpected end of the stream within a single quoted scalar");
+ }
+ function readDoubleQuotedScalar(state4, nodeIndent) {
+ var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch !== 34) {
+ return false;
+ }
+ state4.kind = "scalar";
+ state4.result = "";
+ state4.position++;
+ captureStart = captureEnd = state4.position;
+ while ((ch = state4.input.charCodeAt(state4.position)) !== 0) {
+ if (ch === 34) {
+ captureSegment(state4, captureStart, state4.position, true);
+ state4.position++;
+ return true;
+ } else if (ch === 92) {
+ captureSegment(state4, captureStart, state4.position, true);
+ ch = state4.input.charCodeAt(++state4.position);
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state4, false, nodeIndent);
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state4.result += simpleEscapeMap[ch];
+ state4.position++;
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+ for (; hexLength > 0; hexLength--) {
+ ch = state4.input.charCodeAt(++state4.position);
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
} else {
- item.align.push(null);
+ throwError(state4, "expected hexadecimal character");
}
}
- for (let i2 = 0; i2 < headers.length; i2++) {
- item.header.push({
- text: headers[i2],
- tokens: this.lexer.inline(headers[i2]),
- header: true,
- align: item.align[i2]
- });
- }
- for (const row of rows) {
- item.rows.push(splitCells(row, item.header.length).map((cell, i2) => {
- return {
- text: cell,
- tokens: this.lexer.inline(cell),
- header: false,
- align: item.align[i2]
- };
- }));
- }
- return item;
+ state4.result += charFromCodepoint(hexResult);
+ state4.position++;
+ } else {
+ throwError(state4, "unknown escape sequence");
}
- lheading(src) {
- const cap = this.rules.block.lheading.exec(src);
- if (cap) {
- return {
- type: "heading",
- raw: cap[0],
- depth: cap[2].charAt(0) === "=" ? 1 : 2,
- text: cap[1],
- tokens: this.lexer.inline(cap[1])
- };
- }
+ captureStart = captureEnd = state4.position;
+ } else if (is_EOL(ch)) {
+ captureSegment(state4, captureStart, captureEnd, true);
+ writeFoldedLines(state4, skipSeparationSpace(state4, false, nodeIndent));
+ captureStart = captureEnd = state4.position;
+ } else if (state4.position === state4.lineStart && testDocumentSeparator(state4)) {
+ throwError(state4, "unexpected end of the document within a double quoted scalar");
+ } else {
+ state4.position++;
+ captureEnd = state4.position;
+ }
+ }
+ throwError(state4, "unexpected end of the stream within a double quoted scalar");
+ }
+ function readFlowCollection(state4, nodeIndent) {
+ var readNext = true, _line, _lineStart, _pos, _tag2 = state4.tag, _result, _anchor = state4.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch === 91) {
+ terminator = 93;
+ isMapping = false;
+ _result = [];
+ } else if (ch === 123) {
+ terminator = 125;
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+ if (state4.anchor !== null) {
+ state4.anchorMap[state4.anchor] = _result;
+ }
+ ch = state4.input.charCodeAt(++state4.position);
+ while (ch !== 0) {
+ skipSeparationSpace(state4, true, nodeIndent);
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch === terminator) {
+ state4.position++;
+ state4.tag = _tag2;
+ state4.anchor = _anchor;
+ state4.kind = isMapping ? "mapping" : "sequence";
+ state4.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state4, "missed comma between flow collection entries");
+ } else if (ch === 44) {
+ throwError(state4, "expected the node content, but found ','");
+ }
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+ if (ch === 63) {
+ following = state4.input.charCodeAt(state4.position + 1);
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state4.position++;
+ skipSeparationSpace(state4, true, nodeIndent);
+ }
+ }
+ _line = state4.line;
+ _lineStart = state4.lineStart;
+ _pos = state4.position;
+ composeNode(state4, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state4.tag;
+ keyNode = state4.result;
+ skipSeparationSpace(state4, true, nodeIndent);
+ ch = state4.input.charCodeAt(state4.position);
+ if ((isExplicitPair || state4.line === _line) && ch === 58) {
+ isPair = true;
+ ch = state4.input.charCodeAt(++state4.position);
+ skipSeparationSpace(state4, true, nodeIndent);
+ composeNode(state4, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state4.result;
+ }
+ if (isMapping) {
+ storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state4, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
+ } else {
+ _result.push(keyNode);
+ }
+ skipSeparationSpace(state4, true, nodeIndent);
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch === 44) {
+ readNext = true;
+ ch = state4.input.charCodeAt(++state4.position);
+ } else {
+ readNext = false;
+ }
+ }
+ throwError(state4, "unexpected end of the stream within a flow collection");
+ }
+ function readBlockScalar(state4, nodeIndent) {
+ var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch === 124) {
+ folding = false;
+ } else if (ch === 62) {
+ folding = true;
+ } else {
+ return false;
+ }
+ state4.kind = "scalar";
+ state4.result = "";
+ while (ch !== 0) {
+ ch = state4.input.charCodeAt(++state4.position);
+ if (ch === 43 || ch === 45) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state4, "repeat of a chomping mode identifier");
}
- paragraph(src) {
- const cap = this.rules.block.paragraph.exec(src);
- if (cap) {
- const text2 = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
- return {
- type: "paragraph",
- raw: cap[0],
- text: text2,
- tokens: this.lexer.inline(text2)
- };
- }
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state4, "bad explicit indentation width of a block scalar; it cannot be less than one");
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state4, "repeat of an indentation width identifier");
}
- text(src) {
- const cap = this.rules.block.text.exec(src);
- if (cap) {
- return {
- type: "text",
- raw: cap[0],
- text: cap[0],
- tokens: this.lexer.inline(cap[0])
- };
+ } else {
+ break;
+ }
+ }
+ if (is_WHITE_SPACE(ch)) {
+ do {
+ ch = state4.input.charCodeAt(++state4.position);
+ } while (is_WHITE_SPACE(ch));
+ if (ch === 35) {
+ do {
+ ch = state4.input.charCodeAt(++state4.position);
+ } while (!is_EOL(ch) && ch !== 0);
+ }
+ }
+ while (ch !== 0) {
+ readLineBreak(state4);
+ state4.lineIndent = 0;
+ ch = state4.input.charCodeAt(state4.position);
+ while ((!detectedIndent || state4.lineIndent < textIndent) && ch === 32) {
+ state4.lineIndent++;
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ if (!detectedIndent && state4.lineIndent > textIndent) {
+ textIndent = state4.lineIndent;
+ }
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+ if (state4.lineIndent < textIndent) {
+ if (chomping === CHOMPING_KEEP) {
+ state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (didReadContent) {
+ state4.result += "\n";
}
}
- escape(src) {
- const cap = this.rules.inline.escape.exec(src);
- if (cap) {
- return {
- type: "escape",
- raw: cap[0],
- text: escape$1(cap[1])
- };
+ break;
+ }
+ if (folding) {
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state4.result += common.repeat("\n", emptyLines + 1);
+ } else if (emptyLines === 0) {
+ if (didReadContent) {
+ state4.result += " ";
}
+ } else {
+ state4.result += common.repeat("\n", emptyLines);
}
- tag(src) {
- const cap = this.rules.inline.tag.exec(src);
- if (cap) {
- if (!this.lexer.state.inLink && /^/i.test(cap[0])) {
- this.lexer.state.inLink = false;
- }
- if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
- this.lexer.state.inRawBlock = true;
- } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
- this.lexer.state.inRawBlock = false;
- }
- return {
- type: "html",
- raw: cap[0],
- inLink: this.lexer.state.inLink,
- inRawBlock: this.lexer.state.inRawBlock,
- block: false,
- text: cap[0]
- };
+ } else {
+ state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
+ }
+ didReadContent = true;
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state4.position;
+ while (!is_EOL(ch) && ch !== 0) {
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ captureSegment(state4, captureStart, state4.position, false);
+ }
+ return true;
+ }
+ function readBlockSequence(state4, nodeIndent) {
+ var _line, _tag2 = state4.tag, _anchor = state4.anchor, _result = [], following, detected = false, ch;
+ if (state4.firstTabInLine !== -1) return false;
+ if (state4.anchor !== null) {
+ state4.anchorMap[state4.anchor] = _result;
+ }
+ ch = state4.input.charCodeAt(state4.position);
+ while (ch !== 0) {
+ if (state4.firstTabInLine !== -1) {
+ state4.position = state4.firstTabInLine;
+ throwError(state4, "tab characters must not be used in indentation");
+ }
+ if (ch !== 45) {
+ break;
+ }
+ following = state4.input.charCodeAt(state4.position + 1);
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+ detected = true;
+ state4.position++;
+ if (skipSeparationSpace(state4, true, -1)) {
+ if (state4.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state4.input.charCodeAt(state4.position);
+ continue;
+ }
+ }
+ _line = state4.line;
+ composeNode(state4, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state4.result);
+ skipSeparationSpace(state4, true, -1);
+ ch = state4.input.charCodeAt(state4.position);
+ if ((state4.line === _line || state4.lineIndent > nodeIndent) && ch !== 0) {
+ throwError(state4, "bad indentation of a sequence entry");
+ } else if (state4.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+ if (detected) {
+ state4.tag = _tag2;
+ state4.anchor = _anchor;
+ state4.kind = "sequence";
+ state4.result = _result;
+ return true;
+ }
+ return false;
+ }
+ function readBlockMapping(state4, nodeIndent, flowIndent) {
+ var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag2 = state4.tag, _anchor = state4.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
+ if (state4.firstTabInLine !== -1) return false;
+ if (state4.anchor !== null) {
+ state4.anchorMap[state4.anchor] = _result;
+ }
+ ch = state4.input.charCodeAt(state4.position);
+ while (ch !== 0) {
+ if (!atExplicitKey && state4.firstTabInLine !== -1) {
+ state4.position = state4.firstTabInLine;
+ throwError(state4, "tab characters must not be used in indentation");
+ }
+ following = state4.input.charCodeAt(state4.position + 1);
+ _line = state4.line;
+ if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
+ if (ch === 63) {
+ if (atExplicitKey) {
+ storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
}
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+ } else if (atExplicitKey) {
+ atExplicitKey = false;
+ allowCompact = true;
+ } else {
+ throwError(state4, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
}
- link(src) {
- const cap = this.rules.inline.link.exec(src);
- if (cap) {
- const trimmedUrl = cap[2].trim();
- if (!this.options.pedantic && /^$/.test(trimmedUrl)) {
- return;
- }
- const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
- if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
- return;
- }
- } else {
- const lastParenIndex = findClosingBracket(cap[2], "()");
- if (lastParenIndex > -1) {
- const start3 = cap[0].indexOf("!") === 0 ? 5 : 4;
- const linkLen = start3 + cap[1].length + lastParenIndex;
- cap[2] = cap[2].substring(0, lastParenIndex);
- cap[0] = cap[0].substring(0, linkLen).trim();
- cap[3] = "";
- }
- }
- let href = cap[2];
- let title2 = "";
- if (this.options.pedantic) {
- const link3 = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
- if (link3) {
- href = link3[1];
- title2 = link3[3];
- }
- } else {
- title2 = cap[3] ? cap[3].slice(1, -1) : "";
+ state4.position += 1;
+ ch = following;
+ } else {
+ _keyLine = state4.line;
+ _keyLineStart = state4.lineStart;
+ _keyPos = state4.position;
+ if (!composeNode(state4, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+ break;
+ }
+ if (state4.line === _line) {
+ ch = state4.input.charCodeAt(state4.position);
+ while (is_WHITE_SPACE(ch)) {
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ if (ch === 58) {
+ ch = state4.input.charCodeAt(++state4.position);
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state4, "a whitespace character is expected after the key-value separator within a block mapping");
}
- href = href.trim();
- if (/^$/.test(trimmedUrl)) {
- href = href.slice(1);
- } else {
- href = href.slice(1, -1);
- }
+ if (atExplicitKey) {
+ storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
}
- return outputLink(cap, {
- href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
- title: title2 ? title2.replace(this.rules.inline.anyPunctuation, "$1") : title2
- }, cap[0], this.lexer);
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state4.tag;
+ keyNode = state4.result;
+ } else if (detected) {
+ throwError(state4, "can not read an implicit mapping pair; a colon is missed");
+ } else {
+ state4.tag = _tag2;
+ state4.anchor = _anchor;
+ return true;
}
+ } else if (detected) {
+ throwError(state4, "can not read a block mapping entry; a multiline key may not be an implicit key");
+ } else {
+ state4.tag = _tag2;
+ state4.anchor = _anchor;
+ return true;
}
- reflink(src, links3) {
- let cap;
- if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
- const linkString = (cap[2] || cap[1]).replace(/\s+/g, " ");
- const link3 = links3[linkString.toLowerCase()];
- if (!link3) {
- const text2 = cap[0].charAt(0);
- return {
- type: "text",
- raw: text2,
- text: text2
- };
- }
- return outputLink(cap, link3, cap[0], this.lexer);
- }
+ }
+ if (state4.line === _line || state4.lineIndent > nodeIndent) {
+ if (atExplicitKey) {
+ _keyLine = state4.line;
+ _keyLineStart = state4.lineStart;
+ _keyPos = state4.position;
}
- emStrong(src, maskedSrc, prevChar = "") {
- let match2 = this.rules.inline.emStrongLDelim.exec(src);
- if (!match2)
- return;
- if (match2[3] && prevChar.match(/[\p{L}\p{N}]/u))
- return;
- const nextChar = match2[1] || match2[2] || "";
- if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
- const lLength = [...match2[0]].length - 1;
- let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
- const endReg = match2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
- endReg.lastIndex = 0;
- maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
- while ((match2 = endReg.exec(maskedSrc)) != null) {
- rDelim = match2[1] || match2[2] || match2[3] || match2[4] || match2[5] || match2[6];
- if (!rDelim)
- continue;
- rLength = [...rDelim].length;
- if (match2[3] || match2[4]) {
- delimTotal += rLength;
- continue;
- } else if (match2[5] || match2[6]) {
- if (lLength % 3 && !((lLength + rLength) % 3)) {
- midDelimTotal += rLength;
- continue;
- }
- }
- delimTotal -= rLength;
- if (delimTotal > 0)
- continue;
- rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
- const lastCharLength = [...match2[0]][0].length;
- const raw = src.slice(0, lLength + match2.index + lastCharLength + rLength);
- if (Math.min(lLength, rLength) % 2) {
- const text3 = raw.slice(1, -1);
- return {
- type: "em",
- raw,
- text: text3,
- tokens: this.lexer.inlineTokens(text3)
- };
- }
- const text2 = raw.slice(2, -2);
- return {
- type: "strong",
- raw,
- text: text2,
- tokens: this.lexer.inlineTokens(text2)
- };
- }
+ if (composeNode(state4, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state4.result;
+ } else {
+ valueNode = state4.result;
}
}
- codespan(src) {
- const cap = this.rules.inline.code.exec(src);
- if (cap) {
- let text2 = cap[2].replace(/\n/g, " ");
- const hasNonSpaceChars = /[^ ]/.test(text2);
- const hasSpaceCharsOnBothEnds = /^ /.test(text2) && / $/.test(text2);
- if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
- text2 = text2.substring(1, text2.length - 1);
+ if (!atExplicitKey) {
+ storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+ skipSeparationSpace(state4, true, -1);
+ ch = state4.input.charCodeAt(state4.position);
+ }
+ if ((state4.line === _line || state4.lineIndent > nodeIndent) && ch !== 0) {
+ throwError(state4, "bad indentation of a mapping entry");
+ } else if (state4.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+ if (atExplicitKey) {
+ storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ }
+ if (detected) {
+ state4.tag = _tag2;
+ state4.anchor = _anchor;
+ state4.kind = "mapping";
+ state4.result = _result;
+ }
+ return detected;
+ }
+ function readTagProperty(state4) {
+ var _position, isVerbatim = false, isNamed2 = false, tagHandle, tagName, ch;
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch !== 33) return false;
+ if (state4.tag !== null) {
+ throwError(state4, "duplication of a tag property");
+ }
+ ch = state4.input.charCodeAt(++state4.position);
+ if (ch === 60) {
+ isVerbatim = true;
+ ch = state4.input.charCodeAt(++state4.position);
+ } else if (ch === 33) {
+ isNamed2 = true;
+ tagHandle = "!!";
+ ch = state4.input.charCodeAt(++state4.position);
+ } else {
+ tagHandle = "!";
+ }
+ _position = state4.position;
+ if (isVerbatim) {
+ do {
+ ch = state4.input.charCodeAt(++state4.position);
+ } while (ch !== 0 && ch !== 62);
+ if (state4.position < state4.length) {
+ tagName = state4.input.slice(_position, state4.position);
+ ch = state4.input.charCodeAt(++state4.position);
+ } else {
+ throwError(state4, "unexpected end of the stream within a verbatim tag");
+ }
+ } else {
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ if (ch === 33) {
+ if (!isNamed2) {
+ tagHandle = state4.input.slice(_position - 1, state4.position + 1);
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state4, "named tag handle cannot contain such characters");
}
- text2 = escape$1(text2, true);
- return {
- type: "codespan",
- raw: cap[0],
- text: text2
- };
+ isNamed2 = true;
+ _position = state4.position + 1;
+ } else {
+ throwError(state4, "tag suffix cannot contain exclamation marks");
}
}
- br(src) {
- const cap = this.rules.inline.br.exec(src);
- if (cap) {
- return {
- type: "br",
- raw: cap[0]
- };
- }
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ tagName = state4.input.slice(_position, state4.position);
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state4, "tag suffix cannot contain flow indicator characters");
+ }
+ }
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state4, "tag name cannot contain such characters: " + tagName);
+ }
+ try {
+ tagName = decodeURIComponent(tagName);
+ } catch (err) {
+ throwError(state4, "tag name is malformed: " + tagName);
+ }
+ if (isVerbatim) {
+ state4.tag = tagName;
+ } else if (_hasOwnProperty$1.call(state4.tagMap, tagHandle)) {
+ state4.tag = state4.tagMap[tagHandle] + tagName;
+ } else if (tagHandle === "!") {
+ state4.tag = "!" + tagName;
+ } else if (tagHandle === "!!") {
+ state4.tag = "tag:yaml.org,2002:" + tagName;
+ } else {
+ throwError(state4, 'undeclared tag handle "' + tagHandle + '"');
+ }
+ return true;
+ }
+ function readAnchorProperty(state4) {
+ var _position, ch;
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch !== 38) return false;
+ if (state4.anchor !== null) {
+ throwError(state4, "duplication of an anchor property");
+ }
+ ch = state4.input.charCodeAt(++state4.position);
+ _position = state4.position;
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ if (state4.position === _position) {
+ throwError(state4, "name of an anchor node must contain at least one character");
+ }
+ state4.anchor = state4.input.slice(_position, state4.position);
+ return true;
+ }
+ function readAlias(state4) {
+ var _position, alias, ch;
+ ch = state4.input.charCodeAt(state4.position);
+ if (ch !== 42) return false;
+ ch = state4.input.charCodeAt(++state4.position);
+ _position = state4.position;
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ if (state4.position === _position) {
+ throwError(state4, "name of an alias node must contain at least one character");
+ }
+ alias = state4.input.slice(_position, state4.position);
+ if (!_hasOwnProperty$1.call(state4.anchorMap, alias)) {
+ throwError(state4, 'unidentified alias "' + alias + '"');
+ }
+ state4.result = state4.anchorMap[alias];
+ skipSeparationSpace(state4, true, -1);
+ return true;
+ }
+ function composeNode(state4, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type3, flowIndent, blockIndent;
+ if (state4.listener !== null) {
+ state4.listener("open", state4);
+ }
+ state4.tag = null;
+ state4.anchor = null;
+ state4.kind = null;
+ state4.result = null;
+ allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
+ if (allowToSeek) {
+ if (skipSeparationSpace(state4, true, -1)) {
+ atNewLine = true;
+ if (state4.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state4.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state4.lineIndent < parentIndent) {
+ indentStatus = -1;
}
- del(src) {
- const cap = this.rules.inline.del.exec(src);
- if (cap) {
- return {
- type: "del",
- raw: cap[0],
- text: cap[2],
- tokens: this.lexer.inlineTokens(cap[2])
- };
+ }
+ }
+ if (indentStatus === 1) {
+ while (readTagProperty(state4) || readAnchorProperty(state4)) {
+ if (skipSeparationSpace(state4, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+ if (state4.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state4.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state4.lineIndent < parentIndent) {
+ indentStatus = -1;
}
+ } else {
+ allowBlockCollections = false;
}
- autolink(src) {
- const cap = this.rules.inline.autolink.exec(src);
- if (cap) {
- let text2, href;
- if (cap[2] === "@") {
- text2 = escape$1(cap[1]);
- href = "mailto:" + text2;
- } else {
- text2 = escape$1(cap[1]);
- href = text2;
+ }
+ }
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+ blockIndent = state4.position - state4.lineStart;
+ if (indentStatus === 1) {
+ if (allowBlockCollections && (readBlockSequence(state4, blockIndent) || readBlockMapping(state4, blockIndent, flowIndent)) || readFlowCollection(state4, flowIndent)) {
+ hasContent = true;
+ } else {
+ if (allowBlockScalars && readBlockScalar(state4, flowIndent) || readSingleQuotedScalar(state4, flowIndent) || readDoubleQuotedScalar(state4, flowIndent)) {
+ hasContent = true;
+ } else if (readAlias(state4)) {
+ hasContent = true;
+ if (state4.tag !== null || state4.anchor !== null) {
+ throwError(state4, "alias node should not have any properties");
+ }
+ } else if (readPlainScalar(state4, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+ if (state4.tag === null) {
+ state4.tag = "?";
}
- return {
- type: "link",
- raw: cap[0],
- text: text2,
- href,
- tokens: [
- {
- type: "text",
- raw: text2,
- text: text2
- }
- ]
- };
+ }
+ if (state4.anchor !== null) {
+ state4.anchorMap[state4.anchor] = state4.result;
}
}
- url(src) {
- let cap;
- if (cap = this.rules.inline.url.exec(src)) {
- let text2, href;
- if (cap[2] === "@") {
- text2 = escape$1(cap[0]);
- href = "mailto:" + text2;
- } else {
- let prevCapZero;
- do {
- prevCapZero = cap[0];
- cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
- } while (prevCapZero !== cap[0]);
- text2 = escape$1(cap[0]);
- if (cap[1] === "www.") {
- href = "http://" + cap[0];
- } else {
- href = cap[0];
- }
- }
- return {
- type: "link",
- raw: cap[0],
- text: text2,
- href,
- tokens: [
- {
- type: "text",
- raw: text2,
- text: text2
- }
- ]
- };
+ } else if (indentStatus === 0) {
+ hasContent = allowBlockCollections && readBlockSequence(state4, blockIndent);
+ }
+ }
+ if (state4.tag === null) {
+ if (state4.anchor !== null) {
+ state4.anchorMap[state4.anchor] = state4.result;
+ }
+ } else if (state4.tag === "?") {
+ if (state4.result !== null && state4.kind !== "scalar") {
+ throwError(state4, 'unacceptable node kind for !> tag; it should be "scalar", not "' + state4.kind + '"');
+ }
+ for (typeIndex = 0, typeQuantity = state4.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
+ type3 = state4.implicitTypes[typeIndex];
+ if (type3.resolve(state4.result)) {
+ state4.result = type3.construct(state4.result);
+ state4.tag = type3.tag;
+ if (state4.anchor !== null) {
+ state4.anchorMap[state4.anchor] = state4.result;
}
+ break;
}
- inlineText(src) {
- const cap = this.rules.inline.text.exec(src);
- if (cap) {
- let text2;
- if (this.lexer.state.inRawBlock) {
- text2 = cap[0];
- } else {
- text2 = escape$1(cap[0]);
- }
- return {
- type: "text",
- raw: cap[0],
- text: text2
- };
+ }
+ } else if (state4.tag !== "!") {
+ if (_hasOwnProperty$1.call(state4.typeMap[state4.kind || "fallback"], state4.tag)) {
+ type3 = state4.typeMap[state4.kind || "fallback"][state4.tag];
+ } else {
+ type3 = null;
+ typeList = state4.typeMap.multi[state4.kind || "fallback"];
+ for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
+ if (state4.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
+ type3 = typeList[typeIndex];
+ break;
}
}
- };
- newline = /^(?: *(?:\n|$))+/;
- blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/;
- fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
- hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
- heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
- bullet = /(?:[*+-]|\d{1,9}[.)])/;
- lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex();
- _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
- blockText = /^[^\n]+/;
- _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
- def = edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
- list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex();
- _tag = "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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
- _comment = /|$))/;
- html = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
- paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
- blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex();
- blockNormal = {
- blockquote,
- code: blockCode,
- def,
- fences,
- heading,
- hr,
- html,
- lheading,
- list,
- newline,
- paragraph,
- table: noopTest,
- text: blockText
- };
- gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
- blockGfm = {
- ...blockNormal,
- table: gfmTable,
- paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex()
- };
- blockPedantic = {
- ...blockNormal,
- html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| \\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
- def: /^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
- fences: noopTest,
- // fences not supported
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
- paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
- };
- escape3 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
- inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
- br = /^( {2,}|\\)\n(?!\s*$)/;
- inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g;
- emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, _punctuation).getRegex();
- emStrongRDelimAst = edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, _punctuation).getRegex();
- emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, _punctuation).getRegex();
- anyPunctuation = edit(/\\([punct])/, "gu").replace(/punct/g, _punctuation).getRegex();
- autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
+ }
+ if (!type3) {
+ throwError(state4, "unknown tag !<" + state4.tag + ">");
+ }
+ if (state4.result !== null && type3.kind !== state4.kind) {
+ throwError(state4, "unacceptable node kind for !<" + state4.tag + '> tag; it should be "' + type3.kind + '", not "' + state4.kind + '"');
+ }
+ if (!type3.resolve(state4.result, state4.tag)) {
+ throwError(state4, "cannot resolve a node with !<" + state4.tag + "> explicit tag");
+ } else {
+ state4.result = type3.construct(state4.result, state4.tag);
+ if (state4.anchor !== null) {
+ state4.anchorMap[state4.anchor] = state4.result;
+ }
+ }
+ }
+ if (state4.listener !== null) {
+ state4.listener("close", state4);
+ }
+ return state4.tag !== null || state4.anchor !== null || hasContent;
+ }
+ function readDocument(state4) {
+ var documentStart = state4.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
+ state4.version = null;
+ state4.checkLineBreaks = state4.legacy;
+ state4.tagMap = /* @__PURE__ */ Object.create(null);
+ state4.anchorMap = /* @__PURE__ */ Object.create(null);
+ while ((ch = state4.input.charCodeAt(state4.position)) !== 0) {
+ skipSeparationSpace(state4, true, -1);
+ ch = state4.input.charCodeAt(state4.position);
+ if (state4.lineIndent > 0 || ch !== 37) {
+ break;
+ }
+ hasDirectives = true;
+ ch = state4.input.charCodeAt(++state4.position);
+ _position = state4.position;
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ directiveName = state4.input.slice(_position, state4.position);
+ directiveArgs = [];
+ if (directiveName.length < 1) {
+ throwError(state4, "directive name must not be less than one character in length");
+ }
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ if (ch === 35) {
+ do {
+ ch = state4.input.charCodeAt(++state4.position);
+ } while (ch !== 0 && !is_EOL(ch));
+ break;
+ }
+ if (is_EOL(ch)) break;
+ _position = state4.position;
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state4.input.charCodeAt(++state4.position);
+ }
+ directiveArgs.push(state4.input.slice(_position, state4.position));
+ }
+ if (ch !== 0) readLineBreak(state4);
+ if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state4, directiveName, directiveArgs);
+ } else {
+ throwWarning(state4, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+ skipSeparationSpace(state4, true, -1);
+ if (state4.lineIndent === 0 && state4.input.charCodeAt(state4.position) === 45 && state4.input.charCodeAt(state4.position + 1) === 45 && state4.input.charCodeAt(state4.position + 2) === 45) {
+ state4.position += 3;
+ skipSeparationSpace(state4, true, -1);
+ } else if (hasDirectives) {
+ throwError(state4, "directives end mark is expected");
+ }
+ composeNode(state4, state4.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state4, true, -1);
+ if (state4.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state4.input.slice(documentStart, state4.position))) {
+ throwWarning(state4, "non-ASCII line breaks are interpreted as content");
+ }
+ state4.documents.push(state4.result);
+ if (state4.position === state4.lineStart && testDocumentSeparator(state4)) {
+ if (state4.input.charCodeAt(state4.position) === 46) {
+ state4.position += 3;
+ skipSeparationSpace(state4, true, -1);
+ }
+ return;
+ }
+ if (state4.position < state4.length - 1) {
+ throwError(state4, "end of the stream or a document separator is expected");
+ } else {
+ return;
+ }
+ }
+ function loadDocuments(input, options3) {
+ input = String(input);
+ options3 = options3 || {};
+ if (input.length !== 0) {
+ if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
+ input += "\n";
+ }
+ if (input.charCodeAt(0) === 65279) {
+ input = input.slice(1);
+ }
+ }
+ var state4 = new State$1(input, options3);
+ var nullpos = input.indexOf("\0");
+ if (nullpos !== -1) {
+ state4.position = nullpos;
+ throwError(state4, "null byte is not allowed in input");
+ }
+ state4.input += "\0";
+ while (state4.input.charCodeAt(state4.position) === 32) {
+ state4.lineIndent += 1;
+ state4.position += 1;
+ }
+ while (state4.position < state4.length - 1) {
+ readDocument(state4);
+ }
+ return state4.documents;
+ }
+ function loadAll$1(input, iterator, options3) {
+ if (iterator !== null && typeof iterator === "object" && typeof options3 === "undefined") {
+ options3 = iterator;
+ iterator = null;
+ }
+ var documents = loadDocuments(input, options3);
+ if (typeof iterator !== "function") {
+ return documents;
+ }
+ for (var index = 0, length2 = documents.length; index < length2; index += 1) {
+ iterator(documents[index]);
+ }
+ }
+ function load$1(input, options3) {
+ var documents = loadDocuments(input, options3);
+ if (documents.length === 0) {
+ return void 0;
+ } else if (documents.length === 1) {
+ return documents[0];
+ }
+ throw new exception("expected a single document in the stream, but found more");
+ }
+ function compileStyleMap(schema2, map5) {
+ var result, keys3, index, length2, tag2, style3, type3;
+ if (map5 === null) return {};
+ result = {};
+ keys3 = Object.keys(map5);
+ for (index = 0, length2 = keys3.length; index < length2; index += 1) {
+ tag2 = keys3[index];
+ style3 = String(map5[tag2]);
+ if (tag2.slice(0, 2) === "!!") {
+ tag2 = "tag:yaml.org,2002:" + tag2.slice(2);
+ }
+ type3 = schema2.compiledTypeMap["fallback"][tag2];
+ if (type3 && _hasOwnProperty.call(type3.styleAliases, style3)) {
+ style3 = type3.styleAliases[style3];
+ }
+ result[tag2] = style3;
+ }
+ return result;
+ }
+ function encodeHex(character2) {
+ var string3, handle, length2;
+ string3 = character2.toString(16).toUpperCase();
+ if (character2 <= 255) {
+ handle = "x";
+ length2 = 2;
+ } else if (character2 <= 65535) {
+ handle = "u";
+ length2 = 4;
+ } else if (character2 <= 4294967295) {
+ handle = "U";
+ length2 = 8;
+ } else {
+ throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
+ }
+ return "\\" + handle + common.repeat("0", length2 - string3.length) + string3;
+ }
+ function State(options3) {
+ this.schema = options3["schema"] || _default;
+ this.indent = Math.max(1, options3["indent"] || 2);
+ this.noArrayIndent = options3["noArrayIndent"] || false;
+ this.skipInvalid = options3["skipInvalid"] || false;
+ this.flowLevel = common.isNothing(options3["flowLevel"]) ? -1 : options3["flowLevel"];
+ this.styleMap = compileStyleMap(this.schema, options3["styles"] || null);
+ this.sortKeys = options3["sortKeys"] || false;
+ this.lineWidth = options3["lineWidth"] || 80;
+ this.noRefs = options3["noRefs"] || false;
+ this.noCompatMode = options3["noCompatMode"] || false;
+ this.condenseFlow = options3["condenseFlow"] || false;
+ this.quotingType = options3["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
+ this.forceQuotes = options3["forceQuotes"] || false;
+ this.replacer = typeof options3["replacer"] === "function" ? options3["replacer"] : null;
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+ this.tag = null;
+ this.result = "";
+ this.duplicates = [];
+ this.usedDuplicates = null;
+ }
+ function indentString(string3, spaces) {
+ var ind = common.repeat(" ", spaces), position5 = 0, next3 = -1, result = "", line2, length2 = string3.length;
+ while (position5 < length2) {
+ next3 = string3.indexOf("\n", position5);
+ if (next3 === -1) {
+ line2 = string3.slice(position5);
+ position5 = length2;
+ } else {
+ line2 = string3.slice(position5, next3 + 1);
+ position5 = next3 + 1;
+ }
+ if (line2.length && line2 !== "\n") result += ind;
+ result += line2;
+ }
+ return result;
+ }
+ function generateNextLine(state4, level) {
+ return "\n" + common.repeat(" ", state4.indent * level);
+ }
+ function testImplicitResolving(state4, str2) {
+ var index, length2, type3;
+ for (index = 0, length2 = state4.implicitTypes.length; index < length2; index += 1) {
+ type3 = state4.implicitTypes[index];
+ if (type3.resolve(str2)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ function isWhitespace(c3) {
+ return c3 === CHAR_SPACE || c3 === CHAR_TAB;
+ }
+ function isPrintable(c3) {
+ return 32 <= c3 && c3 <= 126 || 161 <= c3 && c3 <= 55295 && c3 !== 8232 && c3 !== 8233 || 57344 <= c3 && c3 <= 65533 && c3 !== CHAR_BOM || 65536 <= c3 && c3 <= 1114111;
+ }
+ function isNsCharOrWhitespace(c3) {
+ return isPrintable(c3) && c3 !== CHAR_BOM && c3 !== CHAR_CARRIAGE_RETURN && c3 !== CHAR_LINE_FEED;
+ }
+ function isPlainSafe(c3, prev2, inblock) {
+ var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c3);
+ var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c3);
+ return (
+ // ns-plain-safe
+ (inblock ? (
+ // c = flow-in
+ cIsNsCharOrWhitespace
+ ) : cIsNsCharOrWhitespace && c3 !== CHAR_COMMA && c3 !== CHAR_LEFT_SQUARE_BRACKET && c3 !== CHAR_RIGHT_SQUARE_BRACKET && c3 !== CHAR_LEFT_CURLY_BRACKET && c3 !== CHAR_RIGHT_CURLY_BRACKET) && c3 !== CHAR_SHARP && !(prev2 === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev2) && !isWhitespace(prev2) && c3 === CHAR_SHARP || prev2 === CHAR_COLON && cIsNsChar
+ );
+ }
+ function isPlainSafeFirst(c3) {
+ return isPrintable(c3) && c3 !== CHAR_BOM && !isWhitespace(c3) && c3 !== CHAR_MINUS && c3 !== CHAR_QUESTION && c3 !== CHAR_COLON && c3 !== CHAR_COMMA && c3 !== CHAR_LEFT_SQUARE_BRACKET && c3 !== CHAR_RIGHT_SQUARE_BRACKET && c3 !== CHAR_LEFT_CURLY_BRACKET && c3 !== CHAR_RIGHT_CURLY_BRACKET && c3 !== CHAR_SHARP && c3 !== CHAR_AMPERSAND && c3 !== CHAR_ASTERISK && c3 !== CHAR_EXCLAMATION && c3 !== CHAR_VERTICAL_LINE && c3 !== CHAR_EQUALS && c3 !== CHAR_GREATER_THAN && c3 !== CHAR_SINGLE_QUOTE && c3 !== CHAR_DOUBLE_QUOTE && c3 !== CHAR_PERCENT && c3 !== CHAR_COMMERCIAL_AT && c3 !== CHAR_GRAVE_ACCENT;
+ }
+ function isPlainSafeLast(c3) {
+ return !isWhitespace(c3) && c3 !== CHAR_COLON;
+ }
+ function codePointAt(string3, pos) {
+ var first3 = string3.charCodeAt(pos), second2;
+ if (first3 >= 55296 && first3 <= 56319 && pos + 1 < string3.length) {
+ second2 = string3.charCodeAt(pos + 1);
+ if (second2 >= 56320 && second2 <= 57343) {
+ return (first3 - 55296) * 1024 + second2 - 56320 + 65536;
+ }
+ }
+ return first3;
+ }
+ function needIndentIndicator(string3) {
+ var leadingSpaceRe = /^\n* /;
+ return leadingSpaceRe.test(string3);
+ }
+ function chooseScalarStyle(string3, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
+ var i2;
+ var char2 = 0;
+ var prevChar = null;
+ var hasLineBreak = false;
+ var hasFoldableLine = false;
+ var shouldTrackWidth = lineWidth !== -1;
+ var previousLineBreak = -1;
+ var plain = isPlainSafeFirst(codePointAt(string3, 0)) && isPlainSafeLast(codePointAt(string3, string3.length - 1));
+ if (singleLineOnly || forceQuotes) {
+ for (i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) {
+ char2 = codePointAt(string3, i2);
+ if (!isPrintable(char2)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char2, prevChar, inblock);
+ prevChar = char2;
+ }
+ } else {
+ for (i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) {
+ char2 = codePointAt(string3, i2);
+ if (char2 === CHAR_LINE_FEED) {
+ hasLineBreak = true;
+ if (shouldTrackWidth) {
+ hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
+ i2 - previousLineBreak - 1 > lineWidth && string3[previousLineBreak + 1] !== " ";
+ previousLineBreak = i2;
+ }
+ } else if (!isPrintable(char2)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char2, prevChar, inblock);
+ prevChar = char2;
+ }
+ hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i2 - previousLineBreak - 1 > lineWidth && string3[previousLineBreak + 1] !== " ");
+ }
+ if (!hasLineBreak && !hasFoldableLine) {
+ if (plain && !forceQuotes && !testAmbiguousType(string3)) {
+ return STYLE_PLAIN;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ }
+ if (indentPerLevel > 9 && needIndentIndicator(string3)) {
+ return STYLE_DOUBLE;
+ }
+ if (!forceQuotes) {
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ }
+ function writeScalar(state4, string3, level, iskey, inblock) {
+ state4.dump = function() {
+ if (string3.length === 0) {
+ return state4.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
+ }
+ if (!state4.noCompatMode) {
+ if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string3) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string3)) {
+ return state4.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string3 + '"' : "'" + string3 + "'";
+ }
+ }
+ var indent = state4.indent * Math.max(1, level);
+ var lineWidth = state4.lineWidth === -1 ? -1 : Math.max(Math.min(state4.lineWidth, 40), state4.lineWidth - indent);
+ var singleLineOnly = iskey || state4.flowLevel > -1 && level >= state4.flowLevel;
+ function testAmbiguity(string4) {
+ return testImplicitResolving(state4, string4);
+ }
+ __name(testAmbiguity, "testAmbiguity");
+ switch (chooseScalarStyle(
+ string3,
+ singleLineOnly,
+ state4.indent,
+ lineWidth,
+ testAmbiguity,
+ state4.quotingType,
+ state4.forceQuotes && !iskey,
+ inblock
+ )) {
+ case STYLE_PLAIN:
+ return string3;
+ case STYLE_SINGLE:
+ return "'" + string3.replace(/'/g, "''") + "'";
+ case STYLE_LITERAL:
+ return "|" + blockHeader(string3, state4.indent) + dropEndingNewline(indentString(string3, indent));
+ case STYLE_FOLDED:
+ return ">" + blockHeader(string3, state4.indent) + dropEndingNewline(indentString(foldString(string3, lineWidth), indent));
+ case STYLE_DOUBLE:
+ return '"' + escapeString(string3) + '"';
+ default:
+ throw new exception("impossible error: invalid scalar style");
+ }
+ }();
+ }
+ function blockHeader(string3, indentPerLevel) {
+ var indentIndicator = needIndentIndicator(string3) ? String(indentPerLevel) : "";
+ var clip = string3[string3.length - 1] === "\n";
+ var keep = clip && (string3[string3.length - 2] === "\n" || string3 === "\n");
+ var chomp = keep ? "+" : clip ? "" : "-";
+ return indentIndicator + chomp + "\n";
+ }
+ function dropEndingNewline(string3) {
+ return string3[string3.length - 1] === "\n" ? string3.slice(0, -1) : string3;
+ }
+ function foldString(string3, width3) {
+ var lineRe = /(\n+)([^\n]*)/g;
+ var result = function() {
+ var nextLF = string3.indexOf("\n");
+ nextLF = nextLF !== -1 ? nextLF : string3.length;
+ lineRe.lastIndex = nextLF;
+ return foldLine(string3.slice(0, nextLF), width3);
+ }();
+ var prevMoreIndented = string3[0] === "\n" || string3[0] === " ";
+ var moreIndented;
+ var match2;
+ while (match2 = lineRe.exec(string3)) {
+ var prefix = match2[1], line2 = match2[2];
+ moreIndented = line2[0] === " ";
+ result += prefix + (!prevMoreIndented && !moreIndented && line2 !== "" ? "\n" : "") + foldLine(line2, width3);
+ prevMoreIndented = moreIndented;
+ }
+ return result;
+ }
+ function foldLine(line2, width3) {
+ if (line2 === "" || line2[0] === " ") return line2;
+ var breakRe = / [^ ]/g;
+ var match2;
+ var start3 = 0, end2, curr = 0, next3 = 0;
+ var result = "";
+ while (match2 = breakRe.exec(line2)) {
+ next3 = match2.index;
+ if (next3 - start3 > width3) {
+ end2 = curr > start3 ? curr : next3;
+ result += "\n" + line2.slice(start3, end2);
+ start3 = end2 + 1;
+ }
+ curr = next3;
+ }
+ result += "\n";
+ if (line2.length - start3 > width3 && curr > start3) {
+ result += line2.slice(start3, curr) + "\n" + line2.slice(curr + 1);
+ } else {
+ result += line2.slice(start3);
+ }
+ return result.slice(1);
+ }
+ function escapeString(string3) {
+ var result = "";
+ var char2 = 0;
+ var escapeSeq;
+ for (var i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) {
+ char2 = codePointAt(string3, i2);
+ escapeSeq = ESCAPE_SEQUENCES[char2];
+ if (!escapeSeq && isPrintable(char2)) {
+ result += string3[i2];
+ if (char2 >= 65536) result += string3[i2 + 1];
+ } else {
+ result += escapeSeq || encodeHex(char2);
+ }
+ }
+ return result;
+ }
+ function writeFlowSequence(state4, level, object3) {
+ var _result = "", _tag2 = state4.tag, index, length2, value2;
+ for (index = 0, length2 = object3.length; index < length2; index += 1) {
+ value2 = object3[index];
+ if (state4.replacer) {
+ value2 = state4.replacer.call(object3, String(index), value2);
+ }
+ if (writeNode(state4, level, value2, false, false) || typeof value2 === "undefined" && writeNode(state4, level, null, false, false)) {
+ if (_result !== "") _result += "," + (!state4.condenseFlow ? " " : "");
+ _result += state4.dump;
+ }
+ }
+ state4.tag = _tag2;
+ state4.dump = "[" + _result + "]";
+ }
+ function writeBlockSequence(state4, level, object3, compact2) {
+ var _result = "", _tag2 = state4.tag, index, length2, value2;
+ for (index = 0, length2 = object3.length; index < length2; index += 1) {
+ value2 = object3[index];
+ if (state4.replacer) {
+ value2 = state4.replacer.call(object3, String(index), value2);
+ }
+ if (writeNode(state4, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode(state4, level + 1, null, true, true, false, true)) {
+ if (!compact2 || _result !== "") {
+ _result += generateNextLine(state4, level);
+ }
+ if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) {
+ _result += "-";
+ } else {
+ _result += "- ";
+ }
+ _result += state4.dump;
+ }
+ }
+ state4.tag = _tag2;
+ state4.dump = _result || "[]";
+ }
+ function writeFlowMapping(state4, level, object3) {
+ var _result = "", _tag2 = state4.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, pairBuffer;
+ for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) {
+ pairBuffer = "";
+ if (_result !== "") pairBuffer += ", ";
+ if (state4.condenseFlow) pairBuffer += '"';
+ objectKey = objectKeyList[index];
+ objectValue = object3[objectKey];
+ if (state4.replacer) {
+ objectValue = state4.replacer.call(object3, objectKey, objectValue);
+ }
+ if (!writeNode(state4, level, objectKey, false, false)) {
+ continue;
+ }
+ if (state4.dump.length > 1024) pairBuffer += "? ";
+ pairBuffer += state4.dump + (state4.condenseFlow ? '"' : "") + ":" + (state4.condenseFlow ? "" : " ");
+ if (!writeNode(state4, level, objectValue, false, false)) {
+ continue;
+ }
+ pairBuffer += state4.dump;
+ _result += pairBuffer;
+ }
+ state4.tag = _tag2;
+ state4.dump = "{" + _result + "}";
+ }
+ function writeBlockMapping(state4, level, object3, compact2) {
+ var _result = "", _tag2 = state4.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, explicitPair, pairBuffer;
+ if (state4.sortKeys === true) {
+ objectKeyList.sort();
+ } else if (typeof state4.sortKeys === "function") {
+ objectKeyList.sort(state4.sortKeys);
+ } else if (state4.sortKeys) {
+ throw new exception("sortKeys must be a boolean or a function");
+ }
+ for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) {
+ pairBuffer = "";
+ if (!compact2 || _result !== "") {
+ pairBuffer += generateNextLine(state4, level);
+ }
+ objectKey = objectKeyList[index];
+ objectValue = object3[objectKey];
+ if (state4.replacer) {
+ objectValue = state4.replacer.call(object3, objectKey, objectValue);
+ }
+ if (!writeNode(state4, level + 1, objectKey, true, true, true)) {
+ continue;
+ }
+ explicitPair = state4.tag !== null && state4.tag !== "?" || state4.dump && state4.dump.length > 1024;
+ if (explicitPair) {
+ if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) {
+ pairBuffer += "?";
+ } else {
+ pairBuffer += "? ";
+ }
+ }
+ pairBuffer += state4.dump;
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state4, level);
+ }
+ if (!writeNode(state4, level + 1, objectValue, true, explicitPair)) {
+ continue;
+ }
+ if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) {
+ pairBuffer += ":";
+ } else {
+ pairBuffer += ": ";
+ }
+ pairBuffer += state4.dump;
+ _result += pairBuffer;
+ }
+ state4.tag = _tag2;
+ state4.dump = _result || "{}";
+ }
+ function detectType2(state4, object3, explicit) {
+ var _result, typeList, index, length2, type3, style3;
+ typeList = explicit ? state4.explicitTypes : state4.implicitTypes;
+ for (index = 0, length2 = typeList.length; index < length2; index += 1) {
+ type3 = typeList[index];
+ if ((type3.instanceOf || type3.predicate) && (!type3.instanceOf || typeof object3 === "object" && object3 instanceof type3.instanceOf) && (!type3.predicate || type3.predicate(object3))) {
+ if (explicit) {
+ if (type3.multi && type3.representName) {
+ state4.tag = type3.representName(object3);
+ } else {
+ state4.tag = type3.tag;
+ }
+ } else {
+ state4.tag = "?";
+ }
+ if (type3.represent) {
+ style3 = state4.styleMap[type3.tag] || type3.defaultStyle;
+ if (_toString.call(type3.represent) === "[object Function]") {
+ _result = type3.represent(object3, style3);
+ } else if (_hasOwnProperty.call(type3.represent, style3)) {
+ _result = type3.represent[style3](object3, style3);
+ } else {
+ throw new exception("!<" + type3.tag + '> tag resolver accepts not "' + style3 + '" style');
+ }
+ state4.dump = _result;
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+ function writeNode(state4, level, object3, block3, compact2, iskey, isblockseq) {
+ state4.tag = null;
+ state4.dump = object3;
+ if (!detectType2(state4, object3, false)) {
+ detectType2(state4, object3, true);
+ }
+ var type3 = _toString.call(state4.dump);
+ var inblock = block3;
+ var tagStr;
+ if (block3) {
+ block3 = state4.flowLevel < 0 || state4.flowLevel > level;
+ }
+ var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate;
+ if (objectOrArray) {
+ duplicateIndex = state4.duplicates.indexOf(object3);
+ duplicate = duplicateIndex !== -1;
+ }
+ if (state4.tag !== null && state4.tag !== "?" || duplicate || state4.indent !== 2 && level > 0) {
+ compact2 = false;
+ }
+ if (duplicate && state4.usedDuplicates[duplicateIndex]) {
+ state4.dump = "*ref_" + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state4.usedDuplicates[duplicateIndex]) {
+ state4.usedDuplicates[duplicateIndex] = true;
+ }
+ if (type3 === "[object Object]") {
+ if (block3 && Object.keys(state4.dump).length !== 0) {
+ writeBlockMapping(state4, level, state4.dump, compact2);
+ if (duplicate) {
+ state4.dump = "&ref_" + duplicateIndex + state4.dump;
+ }
+ } else {
+ writeFlowMapping(state4, level, state4.dump);
+ if (duplicate) {
+ state4.dump = "&ref_" + duplicateIndex + " " + state4.dump;
+ }
+ }
+ } else if (type3 === "[object Array]") {
+ if (block3 && state4.dump.length !== 0) {
+ if (state4.noArrayIndent && !isblockseq && level > 0) {
+ writeBlockSequence(state4, level - 1, state4.dump, compact2);
+ } else {
+ writeBlockSequence(state4, level, state4.dump, compact2);
+ }
+ if (duplicate) {
+ state4.dump = "&ref_" + duplicateIndex + state4.dump;
+ }
+ } else {
+ writeFlowSequence(state4, level, state4.dump);
+ if (duplicate) {
+ state4.dump = "&ref_" + duplicateIndex + " " + state4.dump;
+ }
+ }
+ } else if (type3 === "[object String]") {
+ if (state4.tag !== "?") {
+ writeScalar(state4, state4.dump, level, iskey, inblock);
+ }
+ } else if (type3 === "[object Undefined]") {
+ return false;
+ } else {
+ if (state4.skipInvalid) return false;
+ throw new exception("unacceptable kind of an object to dump " + type3);
+ }
+ if (state4.tag !== null && state4.tag !== "?") {
+ tagStr = encodeURI(
+ state4.tag[0] === "!" ? state4.tag.slice(1) : state4.tag
+ ).replace(/!/g, "%21");
+ if (state4.tag[0] === "!") {
+ tagStr = "!" + tagStr;
+ } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
+ tagStr = "!!" + tagStr.slice(18);
+ } else {
+ tagStr = "!<" + tagStr + ">";
+ }
+ state4.dump = tagStr + " " + state4.dump;
+ }
+ }
+ return true;
+ }
+ function getDuplicateReferences(object3, state4) {
+ var objects = [], duplicatesIndexes = [], index, length2;
+ inspectNode(object3, objects, duplicatesIndexes);
+ for (index = 0, length2 = duplicatesIndexes.length; index < length2; index += 1) {
+ state4.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state4.usedDuplicates = new Array(length2);
+ }
+ function inspectNode(object3, objects, duplicatesIndexes) {
+ var objectKeyList, index, length2;
+ if (object3 !== null && typeof object3 === "object") {
+ index = objects.indexOf(object3);
+ if (index !== -1) {
+ if (duplicatesIndexes.indexOf(index) === -1) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object3);
+ if (Array.isArray(object3)) {
+ for (index = 0, length2 = object3.length; index < length2; index += 1) {
+ inspectNode(object3[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object3);
+ for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) {
+ inspectNode(object3[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+ }
+ function dump$1(input, options3) {
+ options3 = options3 || {};
+ var state4 = new State(options3);
+ if (!state4.noRefs) getDuplicateReferences(input, state4);
+ var value2 = input;
+ if (state4.replacer) {
+ value2 = state4.replacer.call({ "": value2 }, "", value2);
+ }
+ if (writeNode(state4, 0, value2, true, true)) return state4.dump + "\n";
+ return "";
+ }
+ function renamed(from2, to) {
+ return function() {
+ throw new Error("Function yaml." + from2 + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
+ };
+ }
+ var isNothing_1, isObject_1, toArray_1, repeat_1, isNegativeZero_1, extend_1, common, exception, snippet, TYPE_CONSTRUCTOR_OPTIONS, YAML_NODE_KINDS, type2, schema, str, seq, map2, failsafe, _null, bool, int, YAML_FLOAT_PATTERN, SCIENTIFIC_WITHOUT_DOT, float, json, core, YAML_DATE_REGEXP, YAML_TIMESTAMP_REGEXP, timestamp, merge2, BASE64_MAP, binary, _hasOwnProperty$3, _toString$2, omap, _toString$1, pairs, _hasOwnProperty$2, set3, _default, _hasOwnProperty$1, CONTEXT_FLOW_IN, CONTEXT_FLOW_OUT, CONTEXT_BLOCK_IN, CONTEXT_BLOCK_OUT, CHOMPING_CLIP, CHOMPING_STRIP, CHOMPING_KEEP, PATTERN_NON_PRINTABLE, PATTERN_NON_ASCII_LINE_BREAKS, PATTERN_FLOW_INDICATORS, PATTERN_TAG_HANDLE, PATTERN_TAG_URI, simpleEscapeCheck, simpleEscapeMap, i2, directiveHandlers, loadAll_1, load_1, loader2, _toString, _hasOwnProperty, CHAR_BOM, CHAR_TAB, CHAR_LINE_FEED, CHAR_CARRIAGE_RETURN, CHAR_SPACE, CHAR_EXCLAMATION, CHAR_DOUBLE_QUOTE, CHAR_SHARP, CHAR_PERCENT, CHAR_AMPERSAND, CHAR_SINGLE_QUOTE, CHAR_ASTERISK, CHAR_COMMA, CHAR_MINUS, CHAR_COLON, CHAR_EQUALS, CHAR_GREATER_THAN, CHAR_QUESTION, CHAR_COMMERCIAL_AT, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_GRAVE_ACCENT, CHAR_LEFT_CURLY_BRACKET, CHAR_VERTICAL_LINE, CHAR_RIGHT_CURLY_BRACKET, ESCAPE_SEQUENCES, DEPRECATED_BOOLEANS_SYNTAX, DEPRECATED_BASE60_SYNTAX, QUOTING_TYPE_SINGLE, QUOTING_TYPE_DOUBLE, STYLE_PLAIN, STYLE_SINGLE, STYLE_LITERAL, STYLE_FOLDED, STYLE_DOUBLE, dump_1, dumper, JSON_SCHEMA, load, loadAll, dump, safeLoad, safeLoadAll, safeDump;
+ var init_js_yaml = __esm({
+ "../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs"() {
+ "use strict";
+ __name(isNothing, "isNothing");
+ __name(isObject2, "isObject");
+ __name(toArray, "toArray");
+ __name(extend2, "extend");
+ __name(repeat, "repeat");
+ __name(isNegativeZero, "isNegativeZero");
+ isNothing_1 = isNothing;
+ isObject_1 = isObject2;
+ toArray_1 = toArray;
+ repeat_1 = repeat;
+ isNegativeZero_1 = isNegativeZero;
+ extend_1 = extend2;
+ common = {
+ isNothing: isNothing_1,
+ isObject: isObject_1,
+ toArray: toArray_1,
+ repeat: repeat_1,
+ isNegativeZero: isNegativeZero_1,
+ extend: extend_1
+ };
+ __name(formatError, "formatError");
+ __name(YAMLException$1, "YAMLException$1");
+ YAMLException$1.prototype = Object.create(Error.prototype);
+ YAMLException$1.prototype.constructor = YAMLException$1;
+ YAMLException$1.prototype.toString = /* @__PURE__ */ __name(function toString(compact2) {
+ return this.name + ": " + formatError(this, compact2);
+ }, "toString");
+ exception = YAMLException$1;
+ __name(getLine, "getLine");
+ __name(padStart, "padStart");
+ __name(makeSnippet, "makeSnippet");
+ snippet = makeSnippet;
+ TYPE_CONSTRUCTOR_OPTIONS = [
+ "kind",
+ "multi",
+ "resolve",
+ "construct",
+ "instanceOf",
+ "predicate",
+ "represent",
+ "representName",
+ "defaultStyle",
+ "styleAliases"
+ ];
+ YAML_NODE_KINDS = [
+ "scalar",
+ "sequence",
+ "mapping"
+ ];
+ __name(compileStyleAliases, "compileStyleAliases");
+ __name(Type$1, "Type$1");
+ type2 = Type$1;
+ __name(compileList, "compileList");
+ __name(compileMap, "compileMap");
+ __name(Schema$1, "Schema$1");
+ Schema$1.prototype.extend = /* @__PURE__ */ __name(function extend3(definition) {
+ var implicit2 = [];
+ var explicit = [];
+ if (definition instanceof type2) {
+ explicit.push(definition);
+ } else if (Array.isArray(definition)) {
+ explicit = explicit.concat(definition);
+ } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
+ if (definition.implicit) implicit2 = implicit2.concat(definition.implicit);
+ if (definition.explicit) explicit = explicit.concat(definition.explicit);
+ } else {
+ throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
+ }
+ implicit2.forEach(function(type$1) {
+ if (!(type$1 instanceof type2)) {
+ throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
+ }
+ if (type$1.loadKind && type$1.loadKind !== "scalar") {
+ throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
+ }
+ if (type$1.multi) {
+ throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
+ }
+ });
+ explicit.forEach(function(type$1) {
+ if (!(type$1 instanceof type2)) {
+ throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
+ }
+ });
+ var result = Object.create(Schema$1.prototype);
+ result.implicit = (this.implicit || []).concat(implicit2);
+ result.explicit = (this.explicit || []).concat(explicit);
+ result.compiledImplicit = compileList(result, "implicit");
+ result.compiledExplicit = compileList(result, "explicit");
+ result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
+ return result;
+ }, "extend");
+ schema = Schema$1;
+ str = new type2("tag:yaml.org,2002:str", {
+ kind: "scalar",
+ construct: /* @__PURE__ */ __name(function(data6) {
+ return data6 !== null ? data6 : "";
+ }, "construct")
+ });
+ seq = new type2("tag:yaml.org,2002:seq", {
+ kind: "sequence",
+ construct: /* @__PURE__ */ __name(function(data6) {
+ return data6 !== null ? data6 : [];
+ }, "construct")
+ });
+ map2 = new type2("tag:yaml.org,2002:map", {
+ kind: "mapping",
+ construct: /* @__PURE__ */ __name(function(data6) {
+ return data6 !== null ? data6 : {};
+ }, "construct")
+ });
+ failsafe = new schema({
+ explicit: [
+ str,
+ seq,
+ map2
+ ]
+ });
+ __name(resolveYamlNull, "resolveYamlNull");
+ __name(constructYamlNull, "constructYamlNull");
+ __name(isNull, "isNull");
+ _null = new type2("tag:yaml.org,2002:null", {
+ kind: "scalar",
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: /* @__PURE__ */ __name(function() {
+ return "~";
+ }, "canonical"),
+ lowercase: /* @__PURE__ */ __name(function() {
+ return "null";
+ }, "lowercase"),
+ uppercase: /* @__PURE__ */ __name(function() {
+ return "NULL";
+ }, "uppercase"),
+ camelcase: /* @__PURE__ */ __name(function() {
+ return "Null";
+ }, "camelcase"),
+ empty: /* @__PURE__ */ __name(function() {
+ return "";
+ }, "empty")
+ },
+ defaultStyle: "lowercase"
+ });
+ __name(resolveYamlBoolean, "resolveYamlBoolean");
+ __name(constructYamlBoolean, "constructYamlBoolean");
+ __name(isBoolean, "isBoolean");
+ bool = new type2("tag:yaml.org,2002:bool", {
+ kind: "scalar",
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: /* @__PURE__ */ __name(function(object3) {
+ return object3 ? "true" : "false";
+ }, "lowercase"),
+ uppercase: /* @__PURE__ */ __name(function(object3) {
+ return object3 ? "TRUE" : "FALSE";
+ }, "uppercase"),
+ camelcase: /* @__PURE__ */ __name(function(object3) {
+ return object3 ? "True" : "False";
+ }, "camelcase")
+ },
+ defaultStyle: "lowercase"
+ });
+ __name(isHexCode, "isHexCode");
+ __name(isOctCode, "isOctCode");
+ __name(isDecCode, "isDecCode");
+ __name(resolveYamlInteger, "resolveYamlInteger");
+ __name(constructYamlInteger, "constructYamlInteger");
+ __name(isInteger, "isInteger");
+ int = new type2("tag:yaml.org,2002:int", {
+ kind: "scalar",
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: /* @__PURE__ */ __name(function(obj) {
+ return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
+ }, "binary"),
+ octal: /* @__PURE__ */ __name(function(obj) {
+ return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
+ }, "octal"),
+ decimal: /* @__PURE__ */ __name(function(obj) {
+ return obj.toString(10);
+ }, "decimal"),
+ /* eslint-disable max-len */
+ hexadecimal: /* @__PURE__ */ __name(function(obj) {
+ return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
+ }, "hexadecimal")
+ },
+ defaultStyle: "decimal",
+ styleAliases: {
+ binary: [2, "bin"],
+ octal: [8, "oct"],
+ decimal: [10, "dec"],
+ hexadecimal: [16, "hex"]
+ }
+ });
+ YAML_FLOAT_PATTERN = new RegExp(
+ // 2.5e4, 2.5 and integers
+ "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
+ );
+ __name(resolveYamlFloat, "resolveYamlFloat");
+ __name(constructYamlFloat, "constructYamlFloat");
+ SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
+ __name(representYamlFloat, "representYamlFloat");
+ __name(isFloat, "isFloat");
+ float = new type2("tag:yaml.org,2002:float", {
+ kind: "scalar",
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: "lowercase"
+ });
+ json = failsafe.extend({
+ implicit: [
+ _null,
+ bool,
+ int,
+ float
+ ]
+ });
+ core = json;
+ YAML_DATE_REGEXP = new RegExp(
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
+ );
+ YAML_TIMESTAMP_REGEXP = new RegExp(
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
+ );
+ __name(resolveYamlTimestamp, "resolveYamlTimestamp");
+ __name(constructYamlTimestamp, "constructYamlTimestamp");
+ __name(representYamlTimestamp, "representYamlTimestamp");
+ timestamp = new type2("tag:yaml.org,2002:timestamp", {
+ kind: "scalar",
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+ });
+ __name(resolveYamlMerge, "resolveYamlMerge");
+ merge2 = new type2("tag:yaml.org,2002:merge", {
+ kind: "scalar",
+ resolve: resolveYamlMerge
+ });
+ BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
+ __name(resolveYamlBinary, "resolveYamlBinary");
+ __name(constructYamlBinary, "constructYamlBinary");
+ __name(representYamlBinary, "representYamlBinary");
+ __name(isBinary, "isBinary");
+ binary = new type2("tag:yaml.org,2002:binary", {
+ kind: "scalar",
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+ });
+ _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
+ _toString$2 = Object.prototype.toString;
+ __name(resolveYamlOmap, "resolveYamlOmap");
+ __name(constructYamlOmap, "constructYamlOmap");
+ omap = new type2("tag:yaml.org,2002:omap", {
+ kind: "sequence",
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+ });
+ _toString$1 = Object.prototype.toString;
+ __name(resolveYamlPairs, "resolveYamlPairs");
+ __name(constructYamlPairs, "constructYamlPairs");
+ pairs = new type2("tag:yaml.org,2002:pairs", {
+ kind: "sequence",
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+ });
+ _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
+ __name(resolveYamlSet, "resolveYamlSet");
+ __name(constructYamlSet, "constructYamlSet");
+ set3 = new type2("tag:yaml.org,2002:set", {
+ kind: "mapping",
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+ });
+ _default = core.extend({
+ implicit: [
+ timestamp,
+ merge2
+ ],
+ explicit: [
+ binary,
+ omap,
+ pairs,
+ set3
+ ]
+ });
+ _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
+ CONTEXT_FLOW_IN = 1;
+ CONTEXT_FLOW_OUT = 2;
+ CONTEXT_BLOCK_IN = 3;
+ CONTEXT_BLOCK_OUT = 4;
+ CHOMPING_CLIP = 1;
+ CHOMPING_STRIP = 2;
+ CHOMPING_KEEP = 3;
+ PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+ PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+ PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+ PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+ PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+ __name(_class, "_class");
+ __name(is_EOL, "is_EOL");
+ __name(is_WHITE_SPACE, "is_WHITE_SPACE");
+ __name(is_WS_OR_EOL, "is_WS_OR_EOL");
+ __name(is_FLOW_INDICATOR, "is_FLOW_INDICATOR");
+ __name(fromHexCode, "fromHexCode");
+ __name(escapedHexLen, "escapedHexLen");
+ __name(fromDecimalCode, "fromDecimalCode");
+ __name(simpleEscapeSequence, "simpleEscapeSequence");
+ __name(charFromCodepoint, "charFromCodepoint");
+ simpleEscapeCheck = new Array(256);
+ simpleEscapeMap = new Array(256);
+ for (i2 = 0; i2 < 256; i2++) {
+ simpleEscapeCheck[i2] = simpleEscapeSequence(i2) ? 1 : 0;
+ simpleEscapeMap[i2] = simpleEscapeSequence(i2);
+ }
+ __name(State$1, "State$1");
+ __name(generateError, "generateError");
+ __name(throwError, "throwError");
+ __name(throwWarning, "throwWarning");
+ directiveHandlers = {
+ YAML: /* @__PURE__ */ __name(function handleYamlDirective(state4, name, args) {
+ var match2, major, minor;
+ if (state4.version !== null) {
+ throwError(state4, "duplication of %YAML directive");
+ }
+ if (args.length !== 1) {
+ throwError(state4, "YAML directive accepts exactly one argument");
+ }
+ match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+ if (match2 === null) {
+ throwError(state4, "ill-formed argument of the YAML directive");
+ }
+ major = parseInt(match2[1], 10);
+ minor = parseInt(match2[2], 10);
+ if (major !== 1) {
+ throwError(state4, "unacceptable YAML version of the document");
+ }
+ state4.version = args[0];
+ state4.checkLineBreaks = minor < 2;
+ if (minor !== 1 && minor !== 2) {
+ throwWarning(state4, "unsupported YAML version of the document");
+ }
+ }, "handleYamlDirective"),
+ TAG: /* @__PURE__ */ __name(function handleTagDirective(state4, name, args) {
+ var handle, prefix;
+ if (args.length !== 2) {
+ throwError(state4, "TAG directive accepts exactly two arguments");
+ }
+ handle = args[0];
+ prefix = args[1];
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state4, "ill-formed tag handle (first argument) of the TAG directive");
+ }
+ if (_hasOwnProperty$1.call(state4.tagMap, handle)) {
+ throwError(state4, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state4, "ill-formed tag prefix (second argument) of the TAG directive");
+ }
+ try {
+ prefix = decodeURIComponent(prefix);
+ } catch (err) {
+ throwError(state4, "tag prefix is malformed: " + prefix);
+ }
+ state4.tagMap[handle] = prefix;
+ }, "handleTagDirective")
+ };
+ __name(captureSegment, "captureSegment");
+ __name(mergeMappings, "mergeMappings");
+ __name(storeMappingPair, "storeMappingPair");
+ __name(readLineBreak, "readLineBreak");
+ __name(skipSeparationSpace, "skipSeparationSpace");
+ __name(testDocumentSeparator, "testDocumentSeparator");
+ __name(writeFoldedLines, "writeFoldedLines");
+ __name(readPlainScalar, "readPlainScalar");
+ __name(readSingleQuotedScalar, "readSingleQuotedScalar");
+ __name(readDoubleQuotedScalar, "readDoubleQuotedScalar");
+ __name(readFlowCollection, "readFlowCollection");
+ __name(readBlockScalar, "readBlockScalar");
+ __name(readBlockSequence, "readBlockSequence");
+ __name(readBlockMapping, "readBlockMapping");
+ __name(readTagProperty, "readTagProperty");
+ __name(readAnchorProperty, "readAnchorProperty");
+ __name(readAlias, "readAlias");
+ __name(composeNode, "composeNode");
+ __name(readDocument, "readDocument");
+ __name(loadDocuments, "loadDocuments");
+ __name(loadAll$1, "loadAll$1");
+ __name(load$1, "load$1");
+ loadAll_1 = loadAll$1;
+ load_1 = load$1;
+ loader2 = {
+ loadAll: loadAll_1,
+ load: load_1
+ };
+ _toString = Object.prototype.toString;
+ _hasOwnProperty = Object.prototype.hasOwnProperty;
+ CHAR_BOM = 65279;
+ CHAR_TAB = 9;
+ CHAR_LINE_FEED = 10;
+ CHAR_CARRIAGE_RETURN = 13;
+ CHAR_SPACE = 32;
+ CHAR_EXCLAMATION = 33;
+ CHAR_DOUBLE_QUOTE = 34;
+ CHAR_SHARP = 35;
+ CHAR_PERCENT = 37;
+ CHAR_AMPERSAND = 38;
+ CHAR_SINGLE_QUOTE = 39;
+ CHAR_ASTERISK = 42;
+ CHAR_COMMA = 44;
+ CHAR_MINUS = 45;
+ CHAR_COLON = 58;
+ CHAR_EQUALS = 61;
+ CHAR_GREATER_THAN = 62;
+ CHAR_QUESTION = 63;
+ CHAR_COMMERCIAL_AT = 64;
+ CHAR_LEFT_SQUARE_BRACKET = 91;
+ CHAR_RIGHT_SQUARE_BRACKET = 93;
+ CHAR_GRAVE_ACCENT = 96;
+ CHAR_LEFT_CURLY_BRACKET = 123;
+ CHAR_VERTICAL_LINE = 124;
+ CHAR_RIGHT_CURLY_BRACKET = 125;
+ ESCAPE_SEQUENCES = {};
+ ESCAPE_SEQUENCES[0] = "\\0";
+ ESCAPE_SEQUENCES[7] = "\\a";
+ ESCAPE_SEQUENCES[8] = "\\b";
+ ESCAPE_SEQUENCES[9] = "\\t";
+ ESCAPE_SEQUENCES[10] = "\\n";
+ ESCAPE_SEQUENCES[11] = "\\v";
+ ESCAPE_SEQUENCES[12] = "\\f";
+ ESCAPE_SEQUENCES[13] = "\\r";
+ ESCAPE_SEQUENCES[27] = "\\e";
+ ESCAPE_SEQUENCES[34] = '\\"';
+ ESCAPE_SEQUENCES[92] = "\\\\";
+ ESCAPE_SEQUENCES[133] = "\\N";
+ ESCAPE_SEQUENCES[160] = "\\_";
+ ESCAPE_SEQUENCES[8232] = "\\L";
+ ESCAPE_SEQUENCES[8233] = "\\P";
+ DEPRECATED_BOOLEANS_SYNTAX = [
+ "y",
+ "Y",
+ "yes",
+ "Yes",
+ "YES",
+ "on",
+ "On",
+ "ON",
+ "n",
+ "N",
+ "no",
+ "No",
+ "NO",
+ "off",
+ "Off",
+ "OFF"
+ ];
+ DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
+ __name(compileStyleMap, "compileStyleMap");
+ __name(encodeHex, "encodeHex");
+ QUOTING_TYPE_SINGLE = 1;
+ QUOTING_TYPE_DOUBLE = 2;
+ __name(State, "State");
+ __name(indentString, "indentString");
+ __name(generateNextLine, "generateNextLine");
+ __name(testImplicitResolving, "testImplicitResolving");
+ __name(isWhitespace, "isWhitespace");
+ __name(isPrintable, "isPrintable");
+ __name(isNsCharOrWhitespace, "isNsCharOrWhitespace");
+ __name(isPlainSafe, "isPlainSafe");
+ __name(isPlainSafeFirst, "isPlainSafeFirst");
+ __name(isPlainSafeLast, "isPlainSafeLast");
+ __name(codePointAt, "codePointAt");
+ __name(needIndentIndicator, "needIndentIndicator");
+ STYLE_PLAIN = 1;
+ STYLE_SINGLE = 2;
+ STYLE_LITERAL = 3;
+ STYLE_FOLDED = 4;
+ STYLE_DOUBLE = 5;
+ __name(chooseScalarStyle, "chooseScalarStyle");
+ __name(writeScalar, "writeScalar");
+ __name(blockHeader, "blockHeader");
+ __name(dropEndingNewline, "dropEndingNewline");
+ __name(foldString, "foldString");
+ __name(foldLine, "foldLine");
+ __name(escapeString, "escapeString");
+ __name(writeFlowSequence, "writeFlowSequence");
+ __name(writeBlockSequence, "writeBlockSequence");
+ __name(writeFlowMapping, "writeFlowMapping");
+ __name(writeBlockMapping, "writeBlockMapping");
+ __name(detectType2, "detectType");
+ __name(writeNode, "writeNode");
+ __name(getDuplicateReferences, "getDuplicateReferences");
+ __name(inspectNode, "inspectNode");
+ __name(dump$1, "dump$1");
+ dump_1 = dump$1;
+ dumper = {
+ dump: dump_1
+ };
+ __name(renamed, "renamed");
+ JSON_SCHEMA = json;
+ load = loader2.load;
+ loadAll = loader2.loadAll;
+ dump = dumper.dump;
+ safeLoad = renamed("safeLoad", "load");
+ safeLoadAll = renamed("safeLoadAll", "loadAll");
+ safeDump = renamed("safeDump", "dump");
+ }
+ });
+
+ // ../../node_modules/.pnpm/marked@15.0.7/node_modules/marked/lib/marked.esm.js
+ function _getDefaults() {
+ return {
+ async: false,
+ breaks: false,
+ extensions: null,
+ gfm: true,
+ hooks: null,
+ pedantic: false,
+ renderer: null,
+ silent: false,
+ tokenizer: null,
+ walkTokens: null
+ };
+ }
+ function changeDefaults(newDefaults) {
+ _defaults = newDefaults;
+ }
+ function edit(regex2, opt = "") {
+ let source = typeof regex2 === "string" ? regex2 : regex2.source;
+ const obj = {
+ replace: /* @__PURE__ */ __name((name, val) => {
+ let valSource = typeof val === "string" ? val : val.source;
+ valSource = valSource.replace(other.caret, "$1");
+ source = source.replace(name, valSource);
+ return obj;
+ }, "replace"),
+ getRegex: /* @__PURE__ */ __name(() => {
+ return new RegExp(source, opt);
+ }, "getRegex")
+ };
+ return obj;
+ }
+ function escape3(html3, encode) {
+ if (encode) {
+ if (other.escapeTest.test(html3)) {
+ return html3.replace(other.escapeReplace, getEscapeReplacement);
+ }
+ } else {
+ if (other.escapeTestNoEncode.test(html3)) {
+ return html3.replace(other.escapeReplaceNoEncode, getEscapeReplacement);
+ }
+ }
+ return html3;
+ }
+ function cleanUrl(href) {
+ try {
+ href = encodeURI(href).replace(other.percentDecode, "%");
+ } catch {
+ return null;
+ }
+ return href;
+ }
+ function splitCells(tableRow, count) {
+ const row = tableRow.replace(other.findPipe, (match2, offset, str2) => {
+ let escaped = false;
+ let curr = offset;
+ while (--curr >= 0 && str2[curr] === "\\")
+ escaped = !escaped;
+ if (escaped) {
+ return "|";
+ } else {
+ return " |";
+ }
+ }), cells = row.split(other.splitPipe);
+ let i2 = 0;
+ if (!cells[0].trim()) {
+ cells.shift();
+ }
+ if (cells.length > 0 && !cells.at(-1)?.trim()) {
+ cells.pop();
+ }
+ if (count) {
+ if (cells.length > count) {
+ cells.splice(count);
+ } else {
+ while (cells.length < count)
+ cells.push("");
+ }
+ }
+ for (; i2 < cells.length; i2++) {
+ cells[i2] = cells[i2].trim().replace(other.slashPipe, "|");
+ }
+ return cells;
+ }
+ function rtrim(str2, c3, invert2) {
+ const l2 = str2.length;
+ if (l2 === 0) {
+ return "";
+ }
+ let suffLen = 0;
+ while (suffLen < l2) {
+ const currChar = str2.charAt(l2 - suffLen - 1);
+ if (currChar === c3 && true) {
+ suffLen++;
+ } else {
+ break;
+ }
+ }
+ return str2.slice(0, l2 - suffLen);
+ }
+ function findClosingBracket(str2, b2) {
+ if (str2.indexOf(b2[1]) === -1) {
+ return -1;
+ }
+ let level = 0;
+ for (let i2 = 0; i2 < str2.length; i2++) {
+ if (str2[i2] === "\\") {
+ i2++;
+ } else if (str2[i2] === b2[0]) {
+ level++;
+ } else if (str2[i2] === b2[1]) {
+ level--;
+ if (level < 0) {
+ return i2;
+ }
+ }
+ }
+ return -1;
+ }
+ function outputLink(cap, link3, raw, lexer2, rules) {
+ const href = link3.href;
+ const title2 = link3.title || null;
+ const text4 = cap[1].replace(rules.other.outputLinkReplace, "$1");
+ if (cap[0].charAt(0) !== "!") {
+ lexer2.state.inLink = true;
+ const token2 = {
+ type: "link",
+ raw,
+ href,
+ title: title2,
+ text: text4,
+ tokens: lexer2.inlineTokens(text4)
+ };
+ lexer2.state.inLink = false;
+ return token2;
+ }
+ return {
+ type: "image",
+ raw,
+ href,
+ title: title2,
+ text: text4
+ };
+ }
+ function indentCodeCompensation(raw, text4, rules) {
+ const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);
+ if (matchIndentToCode === null) {
+ return text4;
+ }
+ const indentToCode = matchIndentToCode[1];
+ return text4.split("\n").map((node2) => {
+ const matchIndentInNode = node2.match(rules.other.beginningSpace);
+ if (matchIndentInNode === null) {
+ return node2;
+ }
+ const [indentInNode] = matchIndentInNode;
+ if (indentInNode.length >= indentToCode.length) {
+ return node2.slice(indentToCode.length);
+ }
+ return node2;
+ }).join("\n");
+ }
+ function marked(src, opt) {
+ return markedInstance.parse(src, opt);
+ }
+ var _defaults, noopTest, other, newline, blockCode, fences, hr, heading, bullet, lheadingCore, lheading, lheadingGfm, _paragraph, blockText, _blockLabel, def, list, _tag, _comment, html2, paragraph, blockquote, blockNormal, gfmTable, blockGfm, blockPedantic, escape$1, inlineCode, br, inlineText, _punctuation, _punctuationOrSpace, _notPunctuationOrSpace, punctuation, _punctuationGfmStrongEm, _punctuationOrSpaceGfmStrongEm, _notPunctuationOrSpaceGfmStrongEm, blockSkip, emStrongLDelimCore, emStrongLDelim, emStrongLDelimGfm, emStrongRDelimAstCore, emStrongRDelimAst, emStrongRDelimAstGfm, emStrongRDelimUnd, anyPunctuation, autolink, _inlineComment, tag, _inlineLabel, link, reflink, nolink, reflinkSearch, inlineNormal, inlinePedantic, inlineGfm, inlineBreaks, block, inline, escapeReplacements, getEscapeReplacement, _Tokenizer, _Lexer, _Renderer, _TextRenderer, _Parser, _Hooks, Marked, markedInstance, options, setOptions, use, walkTokens, parseInline, parser2, lexer;
+ var init_marked_esm = __esm({
+ "../../node_modules/.pnpm/marked@15.0.7/node_modules/marked/lib/marked.esm.js"() {
+ "use strict";
+ __name(_getDefaults, "_getDefaults");
+ _defaults = _getDefaults();
+ __name(changeDefaults, "changeDefaults");
+ noopTest = { exec: /* @__PURE__ */ __name(() => null, "exec") };
+ __name(edit, "edit");
+ other = {
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
+ outputLinkReplace: /\\([\[\]])/g,
+ indentCodeCompensation: /^(\s+)(?:```)/,
+ beginningSpace: /^\s+/,
+ endingHash: /#$/,
+ startingSpaceChar: /^ /,
+ endingSpaceChar: / $/,
+ nonSpaceChar: /[^ ]/,
+ newLineCharGlobal: /\n/g,
+ tabCharGlobal: /\t/g,
+ multipleSpaceGlobal: /\s+/g,
+ blankLine: /^[ \t]*$/,
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
+ blockquoteStart: /^ {0,3}>/,
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
+ listReplaceTabs: /^\t+/,
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
+ listIsTask: /^\[[ xX]\] /,
+ listReplaceTask: /^\[[ xX]\] +/,
+ anyLine: /\n.*\n/,
+ hrefBrackets: /^<(.*)>$/,
+ tableDelimiter: /[:|]/,
+ tableAlignChars: /^\||\| *$/g,
+ tableRowBlankLine: /\n[ \t]*$/,
+ tableAlignRight: /^ *-+: *$/,
+ tableAlignCenter: /^ *:-+: *$/,
+ tableAlignLeft: /^ *:-+ *$/,
+ startATag: /^ /i,
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
+ startAngleBracket: /^,
+ endAngleBracket: />$/,
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
+ escapeTest: /[&<>"']/,
+ escapeReplace: /[&<>"']/g,
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,
+ caret: /(^|[^\[])\^/g,
+ percentDecode: /%25/g,
+ findPipe: /\|/g,
+ splitPipe: / \|/,
+ slashPipe: /\\\|/g,
+ carriageReturn: /\r\n|\r/g,
+ spaceLine: /^ +$/gm,
+ notSpaceStart: /^\S*/,
+ endingNewline: /\n$/,
+ listItemRegex: /* @__PURE__ */ __name((bull) => new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"),
+ nextBulletRegex: /* @__PURE__ */ __name((indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"),
+ hrRegex: /* @__PURE__ */ __name((indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"),
+ fencesBeginRegex: /* @__PURE__ */ __name((indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"),
+ headingBeginRegex: /* @__PURE__ */ __name((indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`), "headingBeginRegex"),
+ htmlBeginRegex: /* @__PURE__ */ __name((indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex")
+ };
+ newline = /^(?:[ \t]*(?:\n|$))+/;
+ blockCode = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
+ fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
+ hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
+ heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
+ bullet = /(?:[*+-]|\d{1,9}[.)])/;
+ lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
+ lheading = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
+ lheadingGfm = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
+ _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
+ blockText = /^[^\n]+/;
+ _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
+ def = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
+ list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex();
+ _tag = "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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
+ _comment = /|$))/;
+ html2 = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
+ paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
+ blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex();
+ blockNormal = {
+ blockquote,
+ code: blockCode,
+ def,
+ fences,
+ heading,
+ hr,
+ html: html2,
+ lheading,
+ list,
+ newline,
+ paragraph,
+ table: noopTest,
+ text: blockText
+ };
+ gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
+ blockGfm = {
+ ...blockNormal,
+ lheading: lheadingGfm,
+ table: gfmTable,
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex()
+ };
+ blockPedantic = {
+ ...blockNormal,
+ html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| \\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
+ def: /^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
+ fences: noopTest,
+ // fences not supported
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
+ };
+ escape$1 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
+ inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
+ br = /^( {2,}|\\)\n(?!\s*$)/;
+ inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g;
+ emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
+ emStrongLDelim = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuation).getRegex();
+ emStrongLDelimGfm = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuationGfmStrongEm).getRegex();
+ emStrongRDelimAstCore = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
+ emStrongRDelimAst = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
+ emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm).replace(/punct/g, _punctuationGfmStrongEm).getRegex();
+ emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
+ anyPunctuation = edit(/\\(punct)/, "gu").replace(/punct/g, _punctuation).getRegex();
+ autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
_inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex();
tag = edit("^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
_inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
@@ -35832,7 +37107,7 @@ ${currentText}` : currentText;
emStrongLDelim,
emStrongRDelimAst,
emStrongRDelimUnd,
- escape: escape3,
+ escape: escape$1,
link,
nolink,
punctuation,
@@ -35849,10 +37124,11 @@ ${currentText}` : currentText;
};
inlineGfm = {
...inlineNormal,
- escape: edit(escape3).replace("])", "~|])").getRegex(),
+ emStrongRDelimAst: emStrongRDelimAstGfm,
+ emStrongLDelim: emStrongLDelimGfm,
url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
- del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
+ del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\": ">",
+ '"': """,
+ "'": "'"
+ };
+ getEscapeReplacement = /* @__PURE__ */ __name((ch) => escapeReplacements[ch], "getEscapeReplacement");
+ __name(escape3, "escape");
+ __name(cleanUrl, "cleanUrl");
+ __name(splitCells, "splitCells");
+ __name(rtrim, "rtrim");
+ __name(findClosingBracket, "findClosingBracket");
+ __name(outputLink, "outputLink");
+ __name(indentCodeCompensation, "indentCodeCompensation");
+ _Tokenizer = class {
static {
- __name(this, "_Lexer");
+ __name(this, "_Tokenizer");
}
- tokens;
options;
- state;
- tokenizer;
- inlineQueue;
+ rules;
+ // set by the lexer
+ lexer;
+ // set by the lexer
constructor(options3) {
- this.tokens = [];
- this.tokens.links = /* @__PURE__ */ Object.create(null);
this.options = options3 || _defaults;
- this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
- this.tokenizer = this.options.tokenizer;
- this.tokenizer.options = this.options;
- this.tokenizer.lexer = this;
- this.inlineQueue = [];
- this.state = {
- inLink: false,
- inRawBlock: false,
- top: true
- };
- const rules = {
- block: block.normal,
- inline: inline.normal
- };
- if (this.options.pedantic) {
- rules.block = block.pedantic;
- rules.inline = inline.pedantic;
- } else if (this.options.gfm) {
- rules.block = block.gfm;
- if (this.options.breaks) {
- rules.inline = inline.breaks;
- } else {
- rules.inline = inline.gfm;
- }
- }
- this.tokenizer.rules = rules;
}
- /**
- * Expose Rules
- */
- static get rules() {
- return {
- block,
- inline
- };
+ space(src) {
+ const cap = this.rules.block.newline.exec(src);
+ if (cap && cap[0].length > 0) {
+ return {
+ type: "space",
+ raw: cap[0]
+ };
+ }
}
- /**
- * Static Lex Method
- */
- static lex(src, options3) {
- const lexer2 = new __Lexer(options3);
- return lexer2.lex(src);
+ code(src) {
+ const cap = this.rules.block.code.exec(src);
+ if (cap) {
+ const text4 = cap[0].replace(this.rules.other.codeRemoveIndent, "");
+ return {
+ type: "code",
+ raw: cap[0],
+ codeBlockStyle: "indented",
+ text: !this.options.pedantic ? rtrim(text4, "\n") : text4
+ };
+ }
}
- /**
- * Static Lex Inline Method
- */
- static lexInline(src, options3) {
- const lexer2 = new __Lexer(options3);
- return lexer2.inlineTokens(src);
+ fences(src) {
+ const cap = this.rules.block.fences.exec(src);
+ if (cap) {
+ const raw = cap[0];
+ const text4 = indentCodeCompensation(raw, cap[3] || "", this.rules);
+ return {
+ type: "code",
+ raw,
+ lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2],
+ text: text4
+ };
+ }
}
- /**
- * Preprocessing
- */
- lex(src) {
- src = src.replace(/\r\n|\r/g, "\n");
- this.blockTokens(src, this.tokens);
- for (let i2 = 0; i2 < this.inlineQueue.length; i2++) {
- const next3 = this.inlineQueue[i2];
- this.inlineTokens(next3.src, next3.tokens);
+ heading(src) {
+ const cap = this.rules.block.heading.exec(src);
+ if (cap) {
+ let text4 = cap[2].trim();
+ if (this.rules.other.endingHash.test(text4)) {
+ const trimmed = rtrim(text4, "#");
+ if (this.options.pedantic) {
+ text4 = trimmed.trim();
+ } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) {
+ text4 = trimmed.trim();
+ }
+ }
+ return {
+ type: "heading",
+ raw: cap[0],
+ depth: cap[1].length,
+ text: text4,
+ tokens: this.lexer.inline(text4)
+ };
}
- this.inlineQueue = [];
- return this.tokens;
}
- blockTokens(src, tokens2 = [], lastParagraphClipped = false) {
- if (this.options.pedantic) {
- src = src.replace(/\t/g, " ").replace(/^ +$/gm, "");
- } else {
- src = src.replace(/^( *)(\t+)/gm, (_2, leading, tabs) => {
- return leading + " ".repeat(tabs.length);
- });
+ hr(src) {
+ const cap = this.rules.block.hr.exec(src);
+ if (cap) {
+ return {
+ type: "hr",
+ raw: rtrim(cap[0], "\n")
+ };
}
- let token2;
- let lastToken;
- let cutSrc;
- while (src) {
- if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((extTokenizer) => {
- if (token2 = extTokenizer.call({ lexer: this }, src, tokens2)) {
- src = src.substring(token2.raw.length);
- tokens2.push(token2);
- return true;
+ }
+ blockquote(src) {
+ const cap = this.rules.block.blockquote.exec(src);
+ if (cap) {
+ let lines = rtrim(cap[0], "\n").split("\n");
+ let raw = "";
+ let text4 = "";
+ const tokens2 = [];
+ while (lines.length > 0) {
+ let inBlockquote = false;
+ const currentLines = [];
+ let i2;
+ for (i2 = 0; i2 < lines.length; i2++) {
+ if (this.rules.other.blockquoteStart.test(lines[i2])) {
+ currentLines.push(lines[i2]);
+ inBlockquote = true;
+ } else if (!inBlockquote) {
+ currentLines.push(lines[i2]);
+ } else {
+ break;
+ }
}
- return false;
- })) {
- continue;
- }
- if (token2 = this.tokenizer.space(src)) {
- src = src.substring(token2.raw.length);
- if (token2.raw.length === 1 && tokens2.length > 0) {
- tokens2[tokens2.length - 1].raw += "\n";
- } else {
- tokens2.push(token2);
+ lines = lines.slice(i2);
+ const currentRaw = currentLines.join("\n");
+ const currentText = currentRaw.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
+ raw = raw ? `${raw}
+${currentRaw}` : currentRaw;
+ text4 = text4 ? `${text4}
+${currentText}` : currentText;
+ const top2 = this.lexer.state.top;
+ this.lexer.state.top = true;
+ this.lexer.blockTokens(currentText, tokens2, true);
+ this.lexer.state.top = top2;
+ if (lines.length === 0) {
+ break;
}
- continue;
- }
- if (token2 = this.tokenizer.code(src)) {
- src = src.substring(token2.raw.length);
- lastToken = tokens2[tokens2.length - 1];
- if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
- lastToken.raw += "\n" + token2.raw;
- lastToken.text += "\n" + token2.text;
- this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
- } else {
- tokens2.push(token2);
+ const lastToken = tokens2.at(-1);
+ if (lastToken?.type === "code") {
+ break;
+ } else if (lastToken?.type === "blockquote") {
+ const oldToken = lastToken;
+ const newText = oldToken.raw + "\n" + lines.join("\n");
+ const newToken = this.blockquote(newText);
+ tokens2[tokens2.length - 1] = newToken;
+ raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;
+ text4 = text4.substring(0, text4.length - oldToken.text.length) + newToken.text;
+ break;
+ } else if (lastToken?.type === "list") {
+ const oldToken = lastToken;
+ const newText = oldToken.raw + "\n" + lines.join("\n");
+ const newToken = this.list(newText);
+ tokens2[tokens2.length - 1] = newToken;
+ raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;
+ text4 = text4.substring(0, text4.length - oldToken.raw.length) + newToken.raw;
+ lines = newText.substring(tokens2.at(-1).raw.length).split("\n");
+ continue;
}
- continue;
- }
- if (token2 = this.tokenizer.fences(src)) {
- src = src.substring(token2.raw.length);
- tokens2.push(token2);
- continue;
- }
- if (token2 = this.tokenizer.heading(src)) {
- src = src.substring(token2.raw.length);
- tokens2.push(token2);
- continue;
- }
- if (token2 = this.tokenizer.hr(src)) {
- src = src.substring(token2.raw.length);
- tokens2.push(token2);
- continue;
- }
- if (token2 = this.tokenizer.blockquote(src)) {
- src = src.substring(token2.raw.length);
- tokens2.push(token2);
- continue;
- }
- if (token2 = this.tokenizer.list(src)) {
- src = src.substring(token2.raw.length);
- tokens2.push(token2);
- continue;
- }
- if (token2 = this.tokenizer.html(src)) {
- src = src.substring(token2.raw.length);
- tokens2.push(token2);
- continue;
}
- if (token2 = this.tokenizer.def(src)) {
- src = src.substring(token2.raw.length);
- lastToken = tokens2[tokens2.length - 1];
- if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
- lastToken.raw += "\n" + token2.raw;
- lastToken.text += "\n" + token2.raw;
- this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
- } else if (!this.tokens.links[token2.tag]) {
- this.tokens.links[token2.tag] = {
- href: token2.href,
- title: token2.title
- };
- }
- continue;
+ return {
+ type: "blockquote",
+ raw,
+ tokens: tokens2,
+ text: text4
+ };
+ }
+ }
+ list(src) {
+ let cap = this.rules.block.list.exec(src);
+ if (cap) {
+ let bull = cap[1].trim();
+ const isordered = bull.length > 1;
+ const list2 = {
+ type: "list",
+ raw: "",
+ ordered: isordered,
+ start: isordered ? +bull.slice(0, -1) : "",
+ loose: false,
+ items: []
+ };
+ bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
+ if (this.options.pedantic) {
+ bull = isordered ? bull : "[*+-]";
}
- if (token2 = this.tokenizer.table(src)) {
- src = src.substring(token2.raw.length);
- tokens2.push(token2);
+ const itemRegex = this.rules.other.listItemRegex(bull);
+ let endsWithBlankLine = false;
+ while (src) {
+ let endEarly = false;
+ let raw = "";
+ let itemContents = "";
+ if (!(cap = itemRegex.exec(src))) {
+ break;
+ }
+ if (this.rules.block.hr.test(src)) {
+ break;
+ }
+ raw = cap[0];
+ src = src.substring(raw.length);
+ let line2 = cap[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (t4) => " ".repeat(3 * t4.length));
+ let nextLine = src.split("\n", 1)[0];
+ let blankLine = !line2.trim();
+ let indent = 0;
+ if (this.options.pedantic) {
+ indent = 2;
+ itemContents = line2.trimStart();
+ } else if (blankLine) {
+ indent = cap[1].length + 1;
+ } else {
+ indent = cap[2].search(this.rules.other.nonSpaceChar);
+ indent = indent > 4 ? 1 : indent;
+ itemContents = line2.slice(indent);
+ indent += cap[1].length;
+ }
+ if (blankLine && this.rules.other.blankLine.test(nextLine)) {
+ raw += nextLine + "\n";
+ src = src.substring(nextLine.length + 1);
+ endEarly = true;
+ }
+ if (!endEarly) {
+ const nextBulletRegex = this.rules.other.nextBulletRegex(indent);
+ const hrRegex = this.rules.other.hrRegex(indent);
+ const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);
+ const headingBeginRegex = this.rules.other.headingBeginRegex(indent);
+ const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);
+ while (src) {
+ const rawLine = src.split("\n", 1)[0];
+ let nextLineWithoutTabs;
+ nextLine = rawLine;
+ if (this.options.pedantic) {
+ nextLine = nextLine.replace(this.rules.other.listReplaceNesting, " ");
+ nextLineWithoutTabs = nextLine;
+ } else {
+ nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, " ");
+ }
+ if (fencesBeginRegex.test(nextLine)) {
+ break;
+ }
+ if (headingBeginRegex.test(nextLine)) {
+ break;
+ }
+ if (htmlBeginRegex.test(nextLine)) {
+ break;
+ }
+ if (nextBulletRegex.test(nextLine)) {
+ break;
+ }
+ if (hrRegex.test(nextLine)) {
+ break;
+ }
+ if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) {
+ itemContents += "\n" + nextLineWithoutTabs.slice(indent);
+ } else {
+ if (blankLine) {
+ break;
+ }
+ if (line2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4) {
+ break;
+ }
+ if (fencesBeginRegex.test(line2)) {
+ break;
+ }
+ if (headingBeginRegex.test(line2)) {
+ break;
+ }
+ if (hrRegex.test(line2)) {
+ break;
+ }
+ itemContents += "\n" + nextLine;
+ }
+ if (!blankLine && !nextLine.trim()) {
+ blankLine = true;
+ }
+ raw += rawLine + "\n";
+ src = src.substring(rawLine.length + 1);
+ line2 = nextLineWithoutTabs.slice(indent);
+ }
+ }
+ if (!list2.loose) {
+ if (endsWithBlankLine) {
+ list2.loose = true;
+ } else if (this.rules.other.doubleBlankLine.test(raw)) {
+ endsWithBlankLine = true;
+ }
+ }
+ let istask = null;
+ let ischecked;
+ if (this.options.gfm) {
+ istask = this.rules.other.listIsTask.exec(itemContents);
+ if (istask) {
+ ischecked = istask[0] !== "[ ] ";
+ itemContents = itemContents.replace(this.rules.other.listReplaceTask, "");
+ }
+ }
+ list2.items.push({
+ type: "list_item",
+ raw,
+ task: !!istask,
+ checked: ischecked,
+ loose: false,
+ text: itemContents,
+ tokens: []
+ });
+ list2.raw += raw;
+ }
+ const lastItem = list2.items.at(-1);
+ if (lastItem) {
+ lastItem.raw = lastItem.raw.trimEnd();
+ lastItem.text = lastItem.text.trimEnd();
+ } else {
+ return;
+ }
+ list2.raw = list2.raw.trimEnd();
+ for (let i2 = 0; i2 < list2.items.length; i2++) {
+ this.lexer.state.top = false;
+ list2.items[i2].tokens = this.lexer.blockTokens(list2.items[i2].text, []);
+ if (!list2.loose) {
+ const spacers = list2.items[i2].tokens.filter((t4) => t4.type === "space");
+ const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t4) => this.rules.other.anyLine.test(t4.raw));
+ list2.loose = hasMultipleLineBreaks;
+ }
+ }
+ if (list2.loose) {
+ for (let i2 = 0; i2 < list2.items.length; i2++) {
+ list2.items[i2].loose = true;
+ }
+ }
+ return list2;
+ }
+ }
+ html(src) {
+ const cap = this.rules.block.html.exec(src);
+ if (cap) {
+ const token2 = {
+ type: "html",
+ block: true,
+ raw: cap[0],
+ pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style",
+ text: cap[0]
+ };
+ return token2;
+ }
+ }
+ def(src) {
+ const cap = this.rules.block.def.exec(src);
+ if (cap) {
+ const tag2 = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " ");
+ const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "";
+ const title2 = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : cap[3];
+ return {
+ type: "def",
+ tag: tag2,
+ raw: cap[0],
+ href,
+ title: title2
+ };
+ }
+ }
+ table(src) {
+ const cap = this.rules.block.table.exec(src);
+ if (!cap) {
+ return;
+ }
+ if (!this.rules.other.tableDelimiter.test(cap[2])) {
+ return;
+ }
+ const headers = splitCells(cap[1]);
+ const aligns = cap[2].replace(this.rules.other.tableAlignChars, "").split("|");
+ const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [];
+ const item = {
+ type: "table",
+ raw: cap[0],
+ header: [],
+ align: [],
+ rows: []
+ };
+ if (headers.length !== aligns.length) {
+ return;
+ }
+ for (const align of aligns) {
+ if (this.rules.other.tableAlignRight.test(align)) {
+ item.align.push("right");
+ } else if (this.rules.other.tableAlignCenter.test(align)) {
+ item.align.push("center");
+ } else if (this.rules.other.tableAlignLeft.test(align)) {
+ item.align.push("left");
+ } else {
+ item.align.push(null);
+ }
+ }
+ for (let i2 = 0; i2 < headers.length; i2++) {
+ item.header.push({
+ text: headers[i2],
+ tokens: this.lexer.inline(headers[i2]),
+ header: true,
+ align: item.align[i2]
+ });
+ }
+ for (const row of rows) {
+ item.rows.push(splitCells(row, item.header.length).map((cell, i2) => {
+ return {
+ text: cell,
+ tokens: this.lexer.inline(cell),
+ header: false,
+ align: item.align[i2]
+ };
+ }));
+ }
+ return item;
+ }
+ lheading(src) {
+ const cap = this.rules.block.lheading.exec(src);
+ if (cap) {
+ return {
+ type: "heading",
+ raw: cap[0],
+ depth: cap[2].charAt(0) === "=" ? 1 : 2,
+ text: cap[1],
+ tokens: this.lexer.inline(cap[1])
+ };
+ }
+ }
+ paragraph(src) {
+ const cap = this.rules.block.paragraph.exec(src);
+ if (cap) {
+ const text4 = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
+ return {
+ type: "paragraph",
+ raw: cap[0],
+ text: text4,
+ tokens: this.lexer.inline(text4)
+ };
+ }
+ }
+ text(src) {
+ const cap = this.rules.block.text.exec(src);
+ if (cap) {
+ return {
+ type: "text",
+ raw: cap[0],
+ text: cap[0],
+ tokens: this.lexer.inline(cap[0])
+ };
+ }
+ }
+ escape(src) {
+ const cap = this.rules.inline.escape.exec(src);
+ if (cap) {
+ return {
+ type: "escape",
+ raw: cap[0],
+ text: cap[1]
+ };
+ }
+ }
+ tag(src) {
+ const cap = this.rules.inline.tag.exec(src);
+ if (cap) {
+ if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
+ this.lexer.state.inLink = true;
+ } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
+ this.lexer.state.inLink = false;
+ }
+ if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
+ this.lexer.state.inRawBlock = true;
+ } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
+ this.lexer.state.inRawBlock = false;
+ }
+ return {
+ type: "html",
+ raw: cap[0],
+ inLink: this.lexer.state.inLink,
+ inRawBlock: this.lexer.state.inRawBlock,
+ block: false,
+ text: cap[0]
+ };
+ }
+ }
+ link(src) {
+ const cap = this.rules.inline.link.exec(src);
+ if (cap) {
+ const trimmedUrl = cap[2].trim();
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
+ if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
+ return;
+ }
+ const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
+ if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
+ return;
+ }
+ } else {
+ const lastParenIndex = findClosingBracket(cap[2], "()");
+ if (lastParenIndex > -1) {
+ const start3 = cap[0].indexOf("!") === 0 ? 5 : 4;
+ const linkLen = start3 + cap[1].length + lastParenIndex;
+ cap[2] = cap[2].substring(0, lastParenIndex);
+ cap[0] = cap[0].substring(0, linkLen).trim();
+ cap[3] = "";
+ }
+ }
+ let href = cap[2];
+ let title2 = "";
+ if (this.options.pedantic) {
+ const link3 = this.rules.other.pedanticHrefTitle.exec(href);
+ if (link3) {
+ href = link3[1];
+ title2 = link3[3];
+ }
+ } else {
+ title2 = cap[3] ? cap[3].slice(1, -1) : "";
+ }
+ href = href.trim();
+ if (this.rules.other.startAngleBracket.test(href)) {
+ if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
+ href = href.slice(1);
+ } else {
+ href = href.slice(1, -1);
+ }
+ }
+ return outputLink(cap, {
+ href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
+ title: title2 ? title2.replace(this.rules.inline.anyPunctuation, "$1") : title2
+ }, cap[0], this.lexer, this.rules);
+ }
+ }
+ reflink(src, links3) {
+ let cap;
+ if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
+ const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
+ const link3 = links3[linkString.toLowerCase()];
+ if (!link3) {
+ const text4 = cap[0].charAt(0);
+ return {
+ type: "text",
+ raw: text4,
+ text: text4
+ };
+ }
+ return outputLink(cap, link3, cap[0], this.lexer, this.rules);
+ }
+ }
+ emStrong(src, maskedSrc, prevChar = "") {
+ let match2 = this.rules.inline.emStrongLDelim.exec(src);
+ if (!match2)
+ return;
+ if (match2[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric))
+ return;
+ const nextChar = match2[1] || match2[2] || "";
+ if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
+ const lLength = [...match2[0]].length - 1;
+ let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
+ const endReg = match2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
+ endReg.lastIndex = 0;
+ maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
+ while ((match2 = endReg.exec(maskedSrc)) != null) {
+ rDelim = match2[1] || match2[2] || match2[3] || match2[4] || match2[5] || match2[6];
+ if (!rDelim)
+ continue;
+ rLength = [...rDelim].length;
+ if (match2[3] || match2[4]) {
+ delimTotal += rLength;
+ continue;
+ } else if (match2[5] || match2[6]) {
+ if (lLength % 3 && !((lLength + rLength) % 3)) {
+ midDelimTotal += rLength;
+ continue;
+ }
+ }
+ delimTotal -= rLength;
+ if (delimTotal > 0)
+ continue;
+ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
+ const lastCharLength = [...match2[0]][0].length;
+ const raw = src.slice(0, lLength + match2.index + lastCharLength + rLength);
+ if (Math.min(lLength, rLength) % 2) {
+ const text5 = raw.slice(1, -1);
+ return {
+ type: "em",
+ raw,
+ text: text5,
+ tokens: this.lexer.inlineTokens(text5)
+ };
+ }
+ const text4 = raw.slice(2, -2);
+ return {
+ type: "strong",
+ raw,
+ text: text4,
+ tokens: this.lexer.inlineTokens(text4)
+ };
+ }
+ }
+ }
+ codespan(src) {
+ const cap = this.rules.inline.code.exec(src);
+ if (cap) {
+ let text4 = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
+ const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text4);
+ const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text4) && this.rules.other.endingSpaceChar.test(text4);
+ if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
+ text4 = text4.substring(1, text4.length - 1);
+ }
+ return {
+ type: "codespan",
+ raw: cap[0],
+ text: text4
+ };
+ }
+ }
+ br(src) {
+ const cap = this.rules.inline.br.exec(src);
+ if (cap) {
+ return {
+ type: "br",
+ raw: cap[0]
+ };
+ }
+ }
+ del(src) {
+ const cap = this.rules.inline.del.exec(src);
+ if (cap) {
+ return {
+ type: "del",
+ raw: cap[0],
+ text: cap[2],
+ tokens: this.lexer.inlineTokens(cap[2])
+ };
+ }
+ }
+ autolink(src) {
+ const cap = this.rules.inline.autolink.exec(src);
+ if (cap) {
+ let text4, href;
+ if (cap[2] === "@") {
+ text4 = cap[1];
+ href = "mailto:" + text4;
+ } else {
+ text4 = cap[1];
+ href = text4;
+ }
+ return {
+ type: "link",
+ raw: cap[0],
+ text: text4,
+ href,
+ tokens: [
+ {
+ type: "text",
+ raw: text4,
+ text: text4
+ }
+ ]
+ };
+ }
+ }
+ url(src) {
+ let cap;
+ if (cap = this.rules.inline.url.exec(src)) {
+ let text4, href;
+ if (cap[2] === "@") {
+ text4 = cap[0];
+ href = "mailto:" + text4;
+ } else {
+ let prevCapZero;
+ do {
+ prevCapZero = cap[0];
+ cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
+ } while (prevCapZero !== cap[0]);
+ text4 = cap[0];
+ if (cap[1] === "www.") {
+ href = "http://" + cap[0];
+ } else {
+ href = cap[0];
+ }
+ }
+ return {
+ type: "link",
+ raw: cap[0],
+ text: text4,
+ href,
+ tokens: [
+ {
+ type: "text",
+ raw: text4,
+ text: text4
+ }
+ ]
+ };
+ }
+ }
+ inlineText(src) {
+ const cap = this.rules.inline.text.exec(src);
+ if (cap) {
+ const escaped = this.lexer.state.inRawBlock;
+ return {
+ type: "text",
+ raw: cap[0],
+ text: cap[0],
+ escaped
+ };
+ }
+ }
+ };
+ _Lexer = class __Lexer {
+ static {
+ __name(this, "_Lexer");
+ }
+ tokens;
+ options;
+ state;
+ tokenizer;
+ inlineQueue;
+ constructor(options3) {
+ this.tokens = [];
+ this.tokens.links = /* @__PURE__ */ Object.create(null);
+ this.options = options3 || _defaults;
+ this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
+ this.tokenizer = this.options.tokenizer;
+ this.tokenizer.options = this.options;
+ this.tokenizer.lexer = this;
+ this.inlineQueue = [];
+ this.state = {
+ inLink: false,
+ inRawBlock: false,
+ top: true
+ };
+ const rules = {
+ other,
+ block: block.normal,
+ inline: inline.normal
+ };
+ if (this.options.pedantic) {
+ rules.block = block.pedantic;
+ rules.inline = inline.pedantic;
+ } else if (this.options.gfm) {
+ rules.block = block.gfm;
+ if (this.options.breaks) {
+ rules.inline = inline.breaks;
+ } else {
+ rules.inline = inline.gfm;
+ }
+ }
+ this.tokenizer.rules = rules;
+ }
+ /**
+ * Expose Rules
+ */
+ static get rules() {
+ return {
+ block,
+ inline
+ };
+ }
+ /**
+ * Static Lex Method
+ */
+ static lex(src, options3) {
+ const lexer2 = new __Lexer(options3);
+ return lexer2.lex(src);
+ }
+ /**
+ * Static Lex Inline Method
+ */
+ static lexInline(src, options3) {
+ const lexer2 = new __Lexer(options3);
+ return lexer2.inlineTokens(src);
+ }
+ /**
+ * Preprocessing
+ */
+ lex(src) {
+ src = src.replace(other.carriageReturn, "\n");
+ this.blockTokens(src, this.tokens);
+ for (let i2 = 0; i2 < this.inlineQueue.length; i2++) {
+ const next3 = this.inlineQueue[i2];
+ this.inlineTokens(next3.src, next3.tokens);
+ }
+ this.inlineQueue = [];
+ return this.tokens;
+ }
+ blockTokens(src, tokens2 = [], lastParagraphClipped = false) {
+ if (this.options.pedantic) {
+ src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
+ }
+ while (src) {
+ let token2;
+ if (this.options.extensions?.block?.some((extTokenizer) => {
+ if (token2 = extTokenizer.call({ lexer: this }, src, tokens2)) {
+ src = src.substring(token2.raw.length);
+ tokens2.push(token2);
+ return true;
+ }
+ return false;
+ })) {
+ continue;
+ }
+ if (token2 = this.tokenizer.space(src)) {
+ src = src.substring(token2.raw.length);
+ const lastToken = tokens2.at(-1);
+ if (token2.raw.length === 1 && lastToken !== void 0) {
+ lastToken.raw += "\n";
+ } else {
+ tokens2.push(token2);
+ }
+ continue;
+ }
+ if (token2 = this.tokenizer.code(src)) {
+ src = src.substring(token2.raw.length);
+ const lastToken = tokens2.at(-1);
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
+ lastToken.raw += "\n" + token2.raw;
+ lastToken.text += "\n" + token2.text;
+ this.inlineQueue.at(-1).src = lastToken.text;
+ } else {
+ tokens2.push(token2);
+ }
+ continue;
+ }
+ if (token2 = this.tokenizer.fences(src)) {
+ src = src.substring(token2.raw.length);
+ tokens2.push(token2);
+ continue;
+ }
+ if (token2 = this.tokenizer.heading(src)) {
+ src = src.substring(token2.raw.length);
+ tokens2.push(token2);
+ continue;
+ }
+ if (token2 = this.tokenizer.hr(src)) {
+ src = src.substring(token2.raw.length);
+ tokens2.push(token2);
+ continue;
+ }
+ if (token2 = this.tokenizer.blockquote(src)) {
+ src = src.substring(token2.raw.length);
+ tokens2.push(token2);
+ continue;
+ }
+ if (token2 = this.tokenizer.list(src)) {
+ src = src.substring(token2.raw.length);
+ tokens2.push(token2);
+ continue;
+ }
+ if (token2 = this.tokenizer.html(src)) {
+ src = src.substring(token2.raw.length);
+ tokens2.push(token2);
+ continue;
+ }
+ if (token2 = this.tokenizer.def(src)) {
+ src = src.substring(token2.raw.length);
+ const lastToken = tokens2.at(-1);
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
+ lastToken.raw += "\n" + token2.raw;
+ lastToken.text += "\n" + token2.raw;
+ this.inlineQueue.at(-1).src = lastToken.text;
+ } else if (!this.tokens.links[token2.tag]) {
+ this.tokens.links[token2.tag] = {
+ href: token2.href,
+ title: token2.title
+ };
+ }
+ continue;
+ }
+ if (token2 = this.tokenizer.table(src)) {
+ src = src.substring(token2.raw.length);
+ tokens2.push(token2);
continue;
}
if (token2 = this.tokenizer.lheading(src)) {
@@ -36045,8 +38008,8 @@ ${currentText}` : currentText;
tokens2.push(token2);
continue;
}
- cutSrc = src;
- if (this.options.extensions && this.options.extensions.startBlock) {
+ let cutSrc = src;
+ if (this.options.extensions?.startBlock) {
let startIndex = Infinity;
const tempSrc = src.slice(1);
let tempStart;
@@ -36061,12 +38024,12 @@ ${currentText}` : currentText;
}
}
if (this.state.top && (token2 = this.tokenizer.paragraph(cutSrc))) {
- lastToken = tokens2[tokens2.length - 1];
+ const lastToken = tokens2.at(-1);
if (lastParagraphClipped && lastToken?.type === "paragraph") {
lastToken.raw += "\n" + token2.raw;
lastToken.text += "\n" + token2.text;
this.inlineQueue.pop();
- this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
+ this.inlineQueue.at(-1).src = lastToken.text;
} else {
tokens2.push(token2);
}
@@ -36076,12 +38039,12 @@ ${currentText}` : currentText;
}
if (token2 = this.tokenizer.text(src)) {
src = src.substring(token2.raw.length);
- lastToken = tokens2[tokens2.length - 1];
- if (lastToken && lastToken.type === "text") {
+ const lastToken = tokens2.at(-1);
+ if (lastToken?.type === "text") {
lastToken.raw += "\n" + token2.raw;
lastToken.text += "\n" + token2.text;
this.inlineQueue.pop();
- this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
+ this.inlineQueue.at(-1).src = lastToken.text;
} else {
tokens2.push(token2);
}
@@ -36108,10 +38071,8 @@ ${currentText}` : currentText;
* Lexing/Compiling
*/
inlineTokens(src, tokens2 = []) {
- let token2, lastToken, cutSrc;
let maskedSrc = src;
- let match2;
- let keepPrevChar, prevChar;
+ let match2 = null;
if (this.tokens.links) {
const links3 = Object.keys(this.tokens.links);
if (links3.length > 0) {
@@ -36128,12 +38089,15 @@ ${currentText}` : currentText;
while ((match2 = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
maskedSrc = maskedSrc.slice(0, match2.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
}
+ let keepPrevChar = false;
+ let prevChar = "";
while (src) {
if (!keepPrevChar) {
prevChar = "";
}
keepPrevChar = false;
- if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((extTokenizer) => {
+ let token2;
+ if (this.options.extensions?.inline?.some((extTokenizer) => {
if (token2 = extTokenizer.call({ lexer: this }, src, tokens2)) {
src = src.substring(token2.raw.length);
tokens2.push(token2);
@@ -36150,13 +38114,7 @@ ${currentText}` : currentText;
}
if (token2 = this.tokenizer.tag(src)) {
src = src.substring(token2.raw.length);
- lastToken = tokens2[tokens2.length - 1];
- if (lastToken && token2.type === "text" && lastToken.type === "text") {
- lastToken.raw += token2.raw;
- lastToken.text += token2.text;
- } else {
- tokens2.push(token2);
- }
+ tokens2.push(token2);
continue;
}
if (token2 = this.tokenizer.link(src)) {
@@ -36166,8 +38124,8 @@ ${currentText}` : currentText;
}
if (token2 = this.tokenizer.reflink(src, this.tokens.links)) {
src = src.substring(token2.raw.length);
- lastToken = tokens2[tokens2.length - 1];
- if (lastToken && token2.type === "text" && lastToken.type === "text") {
+ const lastToken = tokens2.at(-1);
+ if (token2.type === "text" && lastToken?.type === "text") {
lastToken.raw += token2.raw;
lastToken.text += token2.text;
} else {
@@ -36205,8 +38163,8 @@ ${currentText}` : currentText;
tokens2.push(token2);
continue;
}
- cutSrc = src;
- if (this.options.extensions && this.options.extensions.startInline) {
+ let cutSrc = src;
+ if (this.options.extensions?.startInline) {
let startIndex = Infinity;
const tempSrc = src.slice(1);
let tempStart;
@@ -36226,8 +38184,8 @@ ${currentText}` : currentText;
prevChar = token2.raw.slice(-1);
}
keepPrevChar = true;
- lastToken = tokens2[tokens2.length - 1];
- if (lastToken && lastToken.type === "text") {
+ const lastToken = tokens2.at(-1);
+ if (lastToken?.type === "text") {
lastToken.raw += token2.raw;
lastToken.text += token2.text;
} else {
@@ -36261,13 +38219,13 @@ ${currentText}` : currentText;
space(token2) {
return "";
}
- code({ text: text2, lang, escaped }) {
- const langString = (lang || "").match(/^\S*/)?.[0];
- const code = text2.replace(/\n$/, "") + "\n";
+ code({ text: text4, lang, escaped }) {
+ const langString = (lang || "").match(other.notSpaceStart)?.[0];
+ const code = text4.replace(other.endingNewline, "") + "\n";
if (!langString) {
- return "" + (escaped ? code : escape$1(code, true)) + "
\n";
+ return "" + (escaped ? code : escape3(code, true)) + "
\n";
}
- return '' + (escaped ? code : escape$1(code, true)) + "
\n";
+ return '' + (escaped ? code : escape3(code, true)) + "
\n";
}
blockquote({ tokens: tokens2 }) {
const body = this.parser.parse(tokens2);
@@ -36275,8 +38233,8 @@ ${currentText}` : currentText;
${body}
`;
}
- html({ text: text2 }) {
- return text2;
+ html({ text: text4 }) {
+ return text4;
}
heading({ tokens: tokens2, depth }) {
return `${this.parser.parseInline(tokens2)}
@@ -36302,16 +38260,18 @@ ${body}
if (item.task) {
const checkbox = this.checkbox({ checked: !!item.checked });
if (item.loose) {
- if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") {
+ if (item.tokens[0]?.type === "paragraph") {
item.tokens[0].text = checkbox + " " + item.tokens[0].text;
if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
- item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text;
+ item.tokens[0].tokens[0].text = checkbox + " " + escape3(item.tokens[0].tokens[0].text);
+ item.tokens[0].tokens[0].escaped = true;
}
} else {
item.tokens.unshift({
type: "text",
raw: checkbox + " ",
- text: checkbox + " "
+ text: checkbox + " ",
+ escaped: true
});
}
} else {
@@ -36349,9 +38309,9 @@ ${body}
body = `${body} `;
return " \n\n" + header + " \n" + body + "
\n";
}
- tablerow({ text: text2 }) {
+ tablerow({ text: text4 }) {
return `
-${text2}
+${text4}
`;
}
tablecell(token2) {
@@ -36370,8 +38330,8 @@ ${text2}
em({ tokens: tokens2 }) {
return `${this.parser.parseInline(tokens2)} `;
}
- codespan({ text: text2 }) {
- return `${text2}
`;
+ codespan({ text: text4 }) {
+ return `${escape3(text4, true)}
`;
}
br(token2) {
return " ";
@@ -36380,34 +38340,34 @@ ${text2}
return `${this.parser.parseInline(tokens2)}`;
}
link({ href, title: title2, tokens: tokens2 }) {
- const text2 = this.parser.parseInline(tokens2);
+ const text4 = this.parser.parseInline(tokens2);
const cleanHref = cleanUrl(href);
if (cleanHref === null) {
- return text2;
+ return text4;
}
href = cleanHref;
let out = '" + text2 + " ";
+ out += ">" + text4 + "";
return out;
}
- image({ href, title: title2, text: text2 }) {
+ image({ href, title: title2, text: text4 }) {
const cleanHref = cleanUrl(href);
if (cleanHref === null) {
- return text2;
+ return escape3(text4);
}
href = cleanHref;
- let out = ` ";
return out;
}
text(token2) {
- return "tokens" in token2 && token2.tokens ? this.parser.parseInline(token2.tokens) : token2.text;
+ return "tokens" in token2 && token2.tokens ? this.parser.parseInline(token2.tokens) : "escaped" in token2 && token2.escaped ? token2.text : escape3(token2.text);
}
};
_TextRenderer = class {
@@ -36415,29 +38375,29 @@ ${text2}
__name(this, "_TextRenderer");
}
// no need for block level renderers
- strong({ text: text2 }) {
- return text2;
+ strong({ text: text4 }) {
+ return text4;
}
- em({ text: text2 }) {
- return text2;
+ em({ text: text4 }) {
+ return text4;
}
- codespan({ text: text2 }) {
- return text2;
+ codespan({ text: text4 }) {
+ return text4;
}
- del({ text: text2 }) {
- return text2;
+ del({ text: text4 }) {
+ return text4;
}
- html({ text: text2 }) {
- return text2;
+ html({ text: text4 }) {
+ return text4;
}
- text({ text: text2 }) {
- return text2;
+ text({ text: text4 }) {
+ return text4;
}
- link({ text: text2 }) {
- return "" + text2;
+ link({ text: text4 }) {
+ return "" + text4;
}
- image({ text: text2 }) {
- return "" + text2;
+ image({ text: text4 }) {
+ return "" + text4;
}
br() {
return "";
@@ -36462,15 +38422,15 @@ ${text2}
* Static Parse Method
*/
static parse(tokens2, options3) {
- const parser22 = new __Parser(options3);
- return parser22.parse(tokens2);
+ const parser24 = new __Parser(options3);
+ return parser24.parse(tokens2);
}
/**
* Static Parse Inline Method
*/
static parseInline(tokens2, options3) {
- const parser22 = new __Parser(options3);
- return parser22.parseInline(tokens2);
+ const parser24 = new __Parser(options3);
+ return parser24.parseInline(tokens2);
}
/**
* Parse Loop
@@ -36479,7 +38439,7 @@ ${text2}
let out = "";
for (let i2 = 0; i2 < tokens2.length; i2++) {
const anyToken = tokens2[i2];
- if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[anyToken.type]) {
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
const genericToken = anyToken;
const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
@@ -36537,7 +38497,7 @@ ${text2}
type: "paragraph",
raw: body,
text: body,
- tokens: [{ type: "text", raw: body, text: body }]
+ tokens: [{ type: "text", raw: body, text: body, escaped: true }]
});
} else {
out += body;
@@ -36560,12 +38520,11 @@ ${text2}
/**
* Parse Inline Tokens
*/
- parseInline(tokens2, renderer8) {
- renderer8 = renderer8 || this.renderer;
+ parseInline(tokens2, renderer9 = this.renderer) {
let out = "";
for (let i2 = 0; i2 < tokens2.length; i2++) {
const anyToken = tokens2[i2];
- if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[anyToken.type]) {
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
out += ret || "";
@@ -36575,43 +38534,43 @@ ${text2}
const token2 = anyToken;
switch (token2.type) {
case "escape": {
- out += renderer8.text(token2);
+ out += renderer9.text(token2);
break;
}
case "html": {
- out += renderer8.html(token2);
+ out += renderer9.html(token2);
break;
}
case "link": {
- out += renderer8.link(token2);
+ out += renderer9.link(token2);
break;
}
case "image": {
- out += renderer8.image(token2);
+ out += renderer9.image(token2);
break;
}
case "strong": {
- out += renderer8.strong(token2);
+ out += renderer9.strong(token2);
break;
}
case "em": {
- out += renderer8.em(token2);
+ out += renderer9.em(token2);
break;
}
case "codespan": {
- out += renderer8.codespan(token2);
+ out += renderer9.codespan(token2);
break;
}
case "br": {
- out += renderer8.br(token2);
+ out += renderer9.br(token2);
break;
}
case "del": {
- out += renderer8.del(token2);
+ out += renderer9.del(token2);
break;
}
case "text": {
- out += renderer8.text(token2);
+ out += renderer9.text(token2);
break;
}
default: {
@@ -36633,6 +38592,7 @@ ${text2}
__name(this, "_Hooks");
}
options;
+ block;
constructor(options3) {
this.options = options3 || _defaults;
}
@@ -36650,8 +38610,8 @@ ${text2}
/**
* Process HTML after marked is finished
*/
- postprocess(html2) {
- return html2;
+ postprocess(html3) {
+ return html3;
}
/**
* Process all tokens before walk tokens
@@ -36659,6 +38619,18 @@ ${text2}
processAllTokens(tokens2) {
return tokens2;
}
+ /**
+ * Provide function to tokenize markdown
+ */
+ provideLexer() {
+ return this.block ? _Lexer.lex : _Lexer.lexInline;
+ }
+ /**
+ * Provide function to parse tokens
+ */
+ provideParser() {
+ return this.block ? _Parser.parse : _Parser.parseInline;
+ }
};
Marked = class {
static {
@@ -36666,8 +38638,8 @@ ${text2}
}
defaults = _getDefaults();
options = this.setOptions;
- parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);
- parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);
+ parse = this.parseMarkdown(true);
+ parseInline = this.parseMarkdown(false);
Parser = _Parser;
Renderer = _Renderer;
TextRenderer = _TextRenderer;
@@ -36774,29 +38746,26 @@ ${text2}
opts.extensions = extensions2;
}
if (pack.renderer) {
- const renderer8 = this.defaults.renderer || new _Renderer(this.defaults);
+ const renderer9 = this.defaults.renderer || new _Renderer(this.defaults);
for (const prop in pack.renderer) {
- if (!(prop in renderer8)) {
+ if (!(prop in renderer9)) {
throw new Error(`renderer '${prop}' does not exist`);
}
if (["options", "parser"].includes(prop)) {
continue;
}
const rendererProp = prop;
- let rendererFunc = pack.renderer[rendererProp];
- if (!pack.useNewRenderer) {
- rendererFunc = this.#convertRendererFunction(rendererFunc, rendererProp, renderer8);
- }
- const prevRenderer = renderer8[rendererProp];
- renderer8[rendererProp] = (...args2) => {
- let ret = rendererFunc.apply(renderer8, args2);
+ const rendererFunc = pack.renderer[rendererProp];
+ const prevRenderer = renderer9[rendererProp];
+ renderer9[rendererProp] = (...args2) => {
+ let ret = rendererFunc.apply(renderer9, args2);
if (ret === false) {
- ret = prevRenderer.apply(renderer8, args2);
+ ret = prevRenderer.apply(renderer9, args2);
}
return ret || "";
};
}
- opts.renderer = renderer8;
+ opts.renderer = renderer9;
}
if (pack.tokenizer) {
const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
@@ -36826,7 +38795,7 @@ ${text2}
if (!(prop in hooks)) {
throw new Error(`hook '${prop}' does not exist`);
}
- if (prop === "options") {
+ if (["options", "block"].includes(prop)) {
continue;
}
const hooksProp = prop;
@@ -36870,181 +38839,6 @@ ${text2}
});
return this;
}
- // TODO: Remove this in next major release
- #convertRendererFunction(func, prop, renderer8) {
- switch (prop) {
- case "heading":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, renderer8.parser.parseInline(token2.tokens), token2.depth, unescape2(renderer8.parser.parseInline(token2.tokens, renderer8.parser.textRenderer)));
- };
- case "code":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, token2.text, token2.lang, !!token2.escaped);
- };
- case "table":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- let header = "";
- let cell = "";
- for (let j2 = 0; j2 < token2.header.length; j2++) {
- cell += this.tablecell({
- text: token2.header[j2].text,
- tokens: token2.header[j2].tokens,
- header: true,
- align: token2.align[j2]
- });
- }
- header += this.tablerow({ text: cell });
- let body = "";
- for (let j2 = 0; j2 < token2.rows.length; j2++) {
- const row = token2.rows[j2];
- cell = "";
- for (let k2 = 0; k2 < row.length; k2++) {
- cell += this.tablecell({
- text: row[k2].text,
- tokens: row[k2].tokens,
- header: false,
- align: token2.align[k2]
- });
- }
- body += this.tablerow({ text: cell });
- }
- return func.call(this, header, body);
- };
- case "blockquote":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- const body = this.parser.parse(token2.tokens);
- return func.call(this, body);
- };
- case "list":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- const ordered = token2.ordered;
- const start3 = token2.start;
- const loose = token2.loose;
- let body = "";
- for (let j2 = 0; j2 < token2.items.length; j2++) {
- const item = token2.items[j2];
- const checked = item.checked;
- const task = item.task;
- let itemBody = "";
- if (item.task) {
- const checkbox = this.checkbox({ checked: !!checked });
- if (loose) {
- if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") {
- item.tokens[0].text = checkbox + " " + item.tokens[0].text;
- if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
- item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text;
- }
- } else {
- item.tokens.unshift({
- type: "text",
- text: checkbox + " "
- });
- }
- } else {
- itemBody += checkbox + " ";
- }
- }
- itemBody += this.parser.parse(item.tokens, loose);
- body += this.listitem({
- type: "list_item",
- raw: itemBody,
- text: itemBody,
- task,
- checked: !!checked,
- loose,
- tokens: item.tokens
- });
- }
- return func.call(this, body, ordered, start3);
- };
- case "html":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, token2.text, token2.block);
- };
- case "paragraph":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, this.parser.parseInline(token2.tokens));
- };
- case "escape":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, token2.text);
- };
- case "link":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, token2.href, token2.title, this.parser.parseInline(token2.tokens));
- };
- case "image":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, token2.href, token2.title, token2.text);
- };
- case "strong":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, this.parser.parseInline(token2.tokens));
- };
- case "em":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, this.parser.parseInline(token2.tokens));
- };
- case "codespan":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, token2.text);
- };
- case "del":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, this.parser.parseInline(token2.tokens));
- };
- case "text":
- return function(token2) {
- if (!token2.type || token2.type !== prop) {
- return func.apply(this, arguments);
- }
- return func.call(this, token2.text);
- };
- }
- return func;
- }
setOptions(opt) {
this.defaults = { ...this.defaults, ...opt };
return this;
@@ -37055,17 +38849,14 @@ ${text2}
parser(tokens2, options3) {
return _Parser.parse(tokens2, options3 ?? this.defaults);
}
- #parseMarkdown(lexer2, parser22) {
- return (src, options3) => {
+ parseMarkdown(blockType) {
+ const parse7 = /* @__PURE__ */ __name((src, options3) => {
const origOpt = { ...options3 };
const opt = { ...this.defaults, ...origOpt };
+ const throwError2 = this.onError(!!opt.silent, !!opt.async);
if (this.defaults.async === true && origOpt.async === false) {
- if (!opt.silent) {
- console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.");
- }
- opt.async = true;
+ return throwError2(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
}
- const throwError2 = this.#onError(!!opt.silent, !!opt.async);
if (typeof src === "undefined" || src === null) {
return throwError2(new Error("marked(): input parameter is undefined or null"));
}
@@ -37074,9 +38865,12 @@ ${text2}
}
if (opt.hooks) {
opt.hooks.options = opt;
+ opt.hooks.block = blockType;
}
+ const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
+ const parser24 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
if (opt.async) {
- return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens2) => opt.hooks ? opt.hooks.processAllTokens(tokens2) : tokens2).then((tokens2) => opt.walkTokens ? Promise.all(this.walkTokens(tokens2, opt.walkTokens)).then(() => tokens2) : tokens2).then((tokens2) => parser22(tokens2, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError2);
+ return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens2) => opt.hooks ? opt.hooks.processAllTokens(tokens2) : tokens2).then((tokens2) => opt.walkTokens ? Promise.all(this.walkTokens(tokens2, opt.walkTokens)).then(() => tokens2) : tokens2).then((tokens2) => parser24(tokens2, opt)).then((html3) => opt.hooks ? opt.hooks.postprocess(html3) : html3).catch(throwError2);
}
try {
if (opt.hooks) {
@@ -37089,21 +38883,22 @@ ${text2}
if (opt.walkTokens) {
this.walkTokens(tokens2, opt.walkTokens);
}
- let html2 = parser22(tokens2, opt);
+ let html3 = parser24(tokens2, opt);
if (opt.hooks) {
- html2 = opt.hooks.postprocess(html2);
+ html3 = opt.hooks.postprocess(html3);
}
- return html2;
+ return html3;
} catch (e3) {
return throwError2(e3);
}
- };
+ }, "parse");
+ return parse7;
}
- #onError(silent, async) {
+ onError(silent, async) {
return (e3) => {
e3.message += "\nPlease report this to https://github.com/markedjs/marked.";
if (silent) {
- const msg = "An error occurred:
" + escape$1(e3.message + "", true) + " ";
+ const msg = "An error occurred:
" + escape3(e3.message + "", true) + " ";
if (async) {
return Promise.resolve(msg);
}
@@ -37165,8 +38960,8 @@ ${text2}
}
return withoutExtraSpaces;
}
- function markdownToLines(markdown, config6 = {}) {
- const preprocessedMarkdown = preprocessMarkdown(markdown, config6);
+ function markdownToLines(markdown, config5 = {}) {
+ const preprocessedMarkdown = preprocessMarkdown(markdown, config5);
const nodes6 = marked.lexer(preprocessedMarkdown);
const lines = [[]];
let currentLine = 0;
@@ -37179,6 +38974,7 @@ ${text2}
lines.push([]);
}
textLine.split(" ").forEach((word) => {
+ word = word.replace(/'/g, `'`);
if (word) {
lines[currentLine].push({ content: word, type: parentType });
}
@@ -37222,6 +39018,8 @@ ${text2}
return "";
} else if (node2.type === "html") {
return `${node2.text}`;
+ } else if (node2.type === "escape") {
+ return node2.text;
}
return `Unsupported markdown: ${node2.type}`;
}
@@ -37240,11 +39038,11 @@ ${text2}
});
// src/rendering-util/splitText.ts
- function splitTextToChars(text2) {
+ function splitTextToChars(text4) {
if (Intl.Segmenter) {
- return [...new Intl.Segmenter().segment(text2)].map((s2) => s2.segment);
+ return [...new Intl.Segmenter().segment(text4)].map((s2) => s2.segment);
}
- return [...text2];
+ return [...text4];
}
function splitWordToFitWidth(checkFit, word) {
const characters2 = splitTextToChars(word.content);
@@ -37327,8 +39125,10 @@ ${text2}
dom.attr("style", styleFn);
}
}
- async function addHtmlSpan(element3, node2, width3, classes6, addBackground = false) {
+ async function addHtmlSpan(element3, node2, width3, classes3, addBackground = false) {
const fo = element3.append("foreignObject");
+ fo.attr("width", `${10 * width3}px`);
+ fo.attr("height", `${10 * width3}px`);
const div = fo.append("xhtml:div");
let label = node2.label;
if (node2.label && hasKatex(node2.label)) {
@@ -37338,7 +39138,7 @@ ${text2}
const span = div.append("span");
span.html(label);
applyStyle(span, node2.labelStyle);
- span.attr("class", `${labelClass} ${classes6}`);
+ span.attr("class", `${labelClass} ${classes3}`);
applyStyle(div, node2.labelStyle);
div.style("display", "table-cell");
div.style("white-space", "nowrap");
@@ -37369,10 +39169,10 @@ ${text2}
testElement.remove();
return textLength;
}
- function computeDimensionOfText(parentNode, lineHeight, text2) {
+ function computeDimensionOfText(parentNode, lineHeight, text4) {
const testElement = parentNode.append("text");
const testSpan = createTspan(testElement, 1, lineHeight);
- updateTextContentAndStyles(testSpan, [{ content: text2, type: "normal" }]);
+ updateTextContentAndStyles(testSpan, [{ content: text4, type: "normal" }]);
const textDimension = testSpan.node()?.getBoundingClientRect();
if (textDimension) {
testElement.remove();
@@ -37396,8 +39196,8 @@ ${text2}
}
if (addBackground) {
const bbox = textElement.node().getBBox();
- const padding3 = 2;
- bkg.attr("x", -padding3).attr("y", -padding3).attr("width", bbox.width + 2 * padding3).attr("height", bbox.height + 2 * padding3);
+ const padding2 = 2;
+ bkg.attr("x", bbox.x - padding2).attr("y", bbox.y - padding2).attr("width", bbox.width + 2 * padding2).attr("height", bbox.height + 2 * padding2);
return labelGroup.node();
} else {
return textElement.node();
@@ -37414,8 +39214,8 @@ ${text2}
}
});
}
- function replaceIconSubstring(text2) {
- return text2.replace(
+ function replaceIconSubstring(text4) {
+ return text4.replace(
/fa[bklrs]?:fa-[\w-]+/g,
// cspell: disable-line
(s2) => ` `
@@ -37440,45 +39240,45 @@ ${text2}
__name(createFormattedText, "createFormattedText");
__name(updateTextContentAndStyles, "updateTextContentAndStyles");
__name(replaceIconSubstring, "replaceIconSubstring");
- createText = /* @__PURE__ */ __name(async (el, text2 = "", {
+ createText = /* @__PURE__ */ __name(async (el, text4 = "", {
style: style3 = "",
isTitle = false,
- classes: classes6 = "",
+ classes: classes3 = "",
useHtmlLabels = true,
isNode: isNode2 = true,
width: width3 = 200,
addSvgBackground = false
- } = {}, config6) => {
- log.info(
+ } = {}, config5) => {
+ log.debug(
"XYZ createText",
- text2,
+ text4,
style3,
isTitle,
- classes6,
+ classes3,
useHtmlLabels,
isNode2,
"addSvgBackground: ",
addSvgBackground
);
if (useHtmlLabels) {
- const htmlText = markdownToHTML(text2, config6);
+ const htmlText = markdownToHTML(text4, config5);
const decodedReplacedText = replaceIconSubstring(decodeEntities(htmlText));
- const inputForKatex = text2.replace(/\\\\/g, "\\");
+ const inputForKatex = text4.replace(/\\\\/g, "\\");
const node2 = {
isNode: isNode2,
- label: hasKatex(text2) ? inputForKatex : decodedReplacedText,
+ label: hasKatex(text4) ? inputForKatex : decodedReplacedText,
labelStyle: style3.replace("fill:", "color:")
};
- const vertexNode = await addHtmlSpan(el, node2, width3, classes6, addSvgBackground);
+ const vertexNode = await addHtmlSpan(el, node2, width3, classes3, addSvgBackground);
return vertexNode;
} else {
- const sanitizeBR = text2.replace(/ /g, " ");
- const structuredText = markdownToLines(sanitizeBR.replace(" ", " "), config6);
+ const sanitizeBR = text4.replace(/ /g, " ");
+ const structuredText = markdownToLines(sanitizeBR.replace(" ", " "), config5);
const svgLabel = createFormattedText(
width3,
el,
structuredText,
- text2 ? addSvgBackground : false
+ text4 ? addSvgBackground : false
);
if (isNode2) {
if (/stroke:/.exec(style3)) {
@@ -37498,99 +39298,184 @@ ${text2}
}
});
- // src/dagre-wrapper/createLabel.js
- function applyStyle2(dom, styleFn) {
- if (styleFn) {
- dom.attr("style", styleFn);
- }
- }
- function addHtmlLabel(node2) {
- const fo = select_default2(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"));
- const div = fo.append("xhtml:div");
- const label = node2.label;
- const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel";
- const span = div.append("span");
- span.html(label);
- applyStyle2(span, node2.labelStyle);
- span.attr("class", labelClass);
- applyStyle2(div, node2.labelStyle);
- div.style("display", "inline-block");
- div.style("white-space", "nowrap");
- div.attr("xmlns", "http://www.w3.org/1999/xhtml");
- return fo.node();
+ // src/rendering-util/rendering-elements/shapes/util.ts
+ function createPathFromPoints(points) {
+ const pointStrings = points.map((p3, i2) => `${i2 === 0 ? "M" : "L"}${p3.x},${p3.y}`);
+ pointStrings.push("Z");
+ return pointStrings.join(" ");
}
- var createLabel, createLabel_default;
- var init_createLabel = __esm({
- "src/dagre-wrapper/createLabel.js"() {
+ function generateFullSineWavePoints(x1, y1, x22, y22, amplitude, numCycles) {
+ const points = [];
+ const steps = 50;
+ const deltaX = x22 - x1;
+ const deltaY = y22 - y1;
+ const cycleLength = deltaX / numCycles;
+ const frequency = 2 * Math.PI / cycleLength;
+ const midY = y1 + deltaY / 2;
+ for (let i2 = 0; i2 <= steps; i2++) {
+ const t4 = i2 / steps;
+ const x5 = x1 + t4 * deltaX;
+ const y5 = midY + amplitude * Math.sin(frequency * (x5 - x1));
+ points.push({ x: x5, y: y5 });
+ }
+ return points;
+ }
+ function generateCirclePoints(centerX, centerY, radius2, numPoints, startAngle, endAngle) {
+ const points = [];
+ const startAngleRad = startAngle * Math.PI / 180;
+ const endAngleRad = endAngle * Math.PI / 180;
+ const angleRange = endAngleRad - startAngleRad;
+ const angleStep = angleRange / (numPoints - 1);
+ for (let i2 = 0; i2 < numPoints; i2++) {
+ const angle2 = startAngleRad + i2 * angleStep;
+ const x5 = centerX + radius2 * Math.cos(angle2);
+ const y5 = centerY + radius2 * Math.sin(angle2);
+ points.push({ x: -x5, y: -y5 });
+ }
+ return points;
+ }
+ var labelHelper, insertLabel, updateNodeBounds, getNodeClasses;
+ var init_util = __esm({
+ "src/rendering-util/rendering-elements/shapes/util.ts"() {
"use strict";
- init_src32();
- init_logger();
+ init_createText();
init_diagramAPI();
+ init_src32();
+ init_defaultConfig();
init_common();
init_utils2();
- init_createText();
- __name(applyStyle2, "applyStyle");
- __name(addHtmlLabel, "addHtmlLabel");
- createLabel = /* @__PURE__ */ __name((_vertexText, style3, isTitle, isNode2) => {
- let vertexText = _vertexText || "";
- if (typeof vertexText === "object") {
- vertexText = vertexText[0];
+ labelHelper = /* @__PURE__ */ __name(async (parent4, node2, _classes) => {
+ let cssClasses;
+ const useHtmlLabels = node2.useHtmlLabels || evaluate(getConfig2()?.htmlLabels);
+ if (!_classes) {
+ cssClasses = "node default";
+ } else {
+ cssClasses = _classes;
}
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- vertexText = vertexText.replace(/\\n|\n/g, " ");
- log.debug("vertexText" + vertexText);
- const node2 = {
- isNode: isNode2,
- label: replaceIconSubstring(decodeEntities(vertexText)),
- labelStyle: style3.replace("fill:", "color:")
- };
- let vertexNode = addHtmlLabel(node2);
- return vertexNode;
+ const shapeSvg = parent4.insert("g").attr("class", cssClasses).attr("id", node2.domId || node2.id);
+ const labelEl = shapeSvg.insert("g").attr("class", "label").attr("style", handleUndefinedAttr(node2.labelStyle));
+ let label;
+ if (node2.label === void 0) {
+ label = "";
} else {
- const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
- svgLabel.setAttribute("style", style3.replace("color:", "fill:"));
- let rows = [];
- if (typeof vertexText === "string") {
- rows = vertexText.split(/\\n|\n| /gi);
- } else if (Array.isArray(vertexText)) {
- rows = vertexText;
- } else {
- rows = [];
- }
- for (const row of rows) {
- const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
- tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
- tspan.setAttribute("dy", "1em");
- tspan.setAttribute("x", "0");
- if (isTitle) {
- tspan.setAttribute("class", "title-row");
- } else {
- tspan.setAttribute("class", "row");
- }
- tspan.textContent = row.trim();
- svgLabel.appendChild(tspan);
+ label = typeof node2.label === "string" ? node2.label : node2.label[0];
+ }
+ const text4 = await createText(labelEl, sanitizeText(decodeEntities(label), getConfig2()), {
+ useHtmlLabels,
+ width: node2.width || getConfig2().flowchart?.wrappingWidth,
+ // @ts-expect-error -- This is currently not used. Should this be `classes` instead?
+ cssClasses: "markdown-node-label",
+ style: node2.labelStyle,
+ addSvgBackground: !!node2.icon || !!node2.img
+ });
+ let bbox = text4.getBBox();
+ const halfPadding = (node2?.padding ?? 0) / 2;
+ if (useHtmlLabels) {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ const images = div.getElementsByTagName("img");
+ if (images) {
+ const noImgText = label.replace(/ ]*>/g, "").trim() === "";
+ await Promise.all(
+ [...images].map(
+ (img) => new Promise((res) => {
+ function setupImage() {
+ img.style.display = "flex";
+ img.style.flexDirection = "column";
+ if (noImgText) {
+ const bodyFontSize = getConfig2().fontSize ? getConfig2().fontSize : window.getComputedStyle(document.body).fontSize;
+ const enlargingFactor = 5;
+ const [parsedBodyFontSize = defaultConfig_default.fontSize] = parseFontSize(bodyFontSize);
+ const width3 = parsedBodyFontSize * enlargingFactor + "px";
+ img.style.minWidth = width3;
+ img.style.maxWidth = width3;
+ } else {
+ img.style.width = "100%";
+ }
+ res(img);
+ }
+ __name(setupImage, "setupImage");
+ setTimeout(() => {
+ if (img.complete) {
+ setupImage();
+ }
+ });
+ img.addEventListener("error", setupImage);
+ img.addEventListener("load", setupImage);
+ })
+ )
+ );
}
- return svgLabel;
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
}
- }, "createLabel");
- createLabel_default = createLabel;
+ if (useHtmlLabels) {
+ labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
+ } else {
+ labelEl.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
+ }
+ if (node2.centerLabel) {
+ labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
+ }
+ labelEl.insert("rect", ":first-child");
+ return { shapeSvg, bbox, halfPadding, label: labelEl };
+ }, "labelHelper");
+ insertLabel = /* @__PURE__ */ __name(async (parent4, label, options3) => {
+ const useHtmlLabels = options3.useHtmlLabels || evaluate(getConfig2()?.flowchart?.htmlLabels);
+ const labelEl = parent4.insert("g").attr("class", "label").attr("style", options3.labelStyle || "");
+ const text4 = await createText(labelEl, sanitizeText(decodeEntities(label), getConfig2()), {
+ useHtmlLabels,
+ width: options3.width || getConfig2()?.flowchart?.wrappingWidth,
+ style: options3.labelStyle,
+ addSvgBackground: !!options3.icon || !!options3.img
+ });
+ let bbox = text4.getBBox();
+ const halfPadding = options3.padding / 2;
+ if (evaluate(getConfig2()?.flowchart?.htmlLabels)) {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ if (useHtmlLabels) {
+ labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
+ } else {
+ labelEl.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
+ }
+ if (options3.centerLabel) {
+ labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
+ }
+ labelEl.insert("rect", ":first-child");
+ return { shapeSvg: parent4, bbox, halfPadding, label: labelEl };
+ }, "insertLabel");
+ updateNodeBounds = /* @__PURE__ */ __name((node2, element3) => {
+ const bbox = element3.node().getBBox();
+ node2.width = bbox.width;
+ node2.height = bbox.height;
+ }, "updateNodeBounds");
+ getNodeClasses = /* @__PURE__ */ __name((node2, extra) => (node2.look === "handDrawn" ? "rough-node" : "node") + " " + node2.cssClasses + " " + (extra || ""), "getNodeClasses");
+ __name(createPathFromPoints, "createPathFromPoints");
+ __name(generateFullSineWavePoints, "generateFullSineWavePoints");
+ __name(generateCirclePoints, "generateCirclePoints");
}
});
- // src/dagre-wrapper/intersect/intersect-node.js
+ // src/rendering-util/rendering-elements/intersect/intersect-node.js
function intersectNode(node2, point8) {
return node2.intersect(point8);
}
var intersect_node_default;
var init_intersect_node = __esm({
- "src/dagre-wrapper/intersect/intersect-node.js"() {
+ "src/rendering-util/rendering-elements/intersect/intersect-node.js"() {
"use strict";
__name(intersectNode, "intersectNode");
intersect_node_default = intersectNode;
}
});
- // src/dagre-wrapper/intersect/intersect-ellipse.js
+ // src/rendering-util/rendering-elements/intersect/intersect-ellipse.js
function intersectEllipse(node2, rx, ry, point8) {
var cx = node2.x;
var cy = node2.y;
@@ -37609,20 +39494,20 @@ ${text2}
}
var intersect_ellipse_default;
var init_intersect_ellipse = __esm({
- "src/dagre-wrapper/intersect/intersect-ellipse.js"() {
+ "src/rendering-util/rendering-elements/intersect/intersect-ellipse.js"() {
"use strict";
__name(intersectEllipse, "intersectEllipse");
intersect_ellipse_default = intersectEllipse;
}
});
- // src/dagre-wrapper/intersect/intersect-circle.js
+ // src/rendering-util/rendering-elements/intersect/intersect-circle.js
function intersectCircle(node2, rx, point8) {
return intersect_ellipse_default(node2, rx, rx, point8);
}
var intersect_circle_default;
var init_intersect_circle = __esm({
- "src/dagre-wrapper/intersect/intersect-circle.js"() {
+ "src/rendering-util/rendering-elements/intersect/intersect-circle.js"() {
"use strict";
init_intersect_ellipse();
__name(intersectCircle, "intersectCircle");
@@ -37630,7 +39515,7 @@ ${text2}
}
});
- // src/dagre-wrapper/intersect/intersect-line.js
+ // src/rendering-util/rendering-elements/intersect/intersect-line.js
function intersectLine(p1, p22, q1, q2) {
var a1, a2, b1, b2, c1, c22;
var r1, r2, r3, r4;
@@ -37668,7 +39553,7 @@ ${text2}
}
var intersect_line_default;
var init_intersect_line = __esm({
- "src/dagre-wrapper/intersect/intersect-line.js"() {
+ "src/rendering-util/rendering-elements/intersect/intersect-line.js"() {
"use strict";
__name(intersectLine, "intersectLine");
__name(sameSign, "sameSign");
@@ -37676,13 +39561,13 @@ ${text2}
}
});
- // src/dagre-wrapper/intersect/intersect-polygon.js
+ // src/rendering-util/rendering-elements/intersect/intersect-polygon.js
function intersectPolygon(node2, polyPoints, point8) {
- var x1 = node2.x;
- var y1 = node2.y;
- var intersections = [];
- var minX = Number.POSITIVE_INFINITY;
- var minY = Number.POSITIVE_INFINITY;
+ let x1 = node2.x;
+ let y1 = node2.y;
+ let intersections = [];
+ let minX = Number.POSITIVE_INFINITY;
+ let minY = Number.POSITIVE_INFINITY;
if (typeof polyPoints.forEach === "function") {
polyPoints.forEach(function(entry) {
minX = Math.min(minX, entry.x);
@@ -37692,12 +39577,12 @@ ${text2}
minX = Math.min(minX, polyPoints.x);
minY = Math.min(minY, polyPoints.y);
}
- var left3 = x1 - node2.width / 2 - minX;
- var top2 = y1 - node2.height / 2 - minY;
- for (var i2 = 0; i2 < polyPoints.length; i2++) {
- var p1 = polyPoints[i2];
- var p22 = polyPoints[i2 < polyPoints.length - 1 ? i2 + 1 : 0];
- var intersect3 = intersect_line_default(
+ let left3 = x1 - node2.width / 2 - minX;
+ let top2 = y1 - node2.height / 2 - minY;
+ for (let i2 = 0; i2 < polyPoints.length; i2++) {
+ let p1 = polyPoints[i2];
+ let p22 = polyPoints[i2 < polyPoints.length - 1 ? i2 + 1 : 0];
+ let intersect3 = intersect_line_default(
node2,
point8,
{ x: left3 + p1.x, y: top2 + p1.y },
@@ -37712,12 +39597,12 @@ ${text2}
}
if (intersections.length > 1) {
intersections.sort(function(p3, q2) {
- var pdx = p3.x - point8.x;
- var pdy = p3.y - point8.y;
- var distp = Math.sqrt(pdx * pdx + pdy * pdy);
- var qdx = q2.x - point8.x;
- var qdy = q2.y - point8.y;
- var distq = Math.sqrt(qdx * qdx + qdy * qdy);
+ let pdx = p3.x - point8.x;
+ let pdy = p3.y - point8.y;
+ let distp = Math.sqrt(pdx * pdx + pdy * pdy);
+ let qdx = q2.x - point8.x;
+ let qdy = q2.y - point8.y;
+ let distq = Math.sqrt(qdx * qdx + qdy * qdy);
return distp < distq ? -1 : distp === distq ? 0 : 1;
});
}
@@ -37725,18 +39610,18 @@ ${text2}
}
var intersect_polygon_default;
var init_intersect_polygon = __esm({
- "src/dagre-wrapper/intersect/intersect-polygon.js"() {
+ "src/rendering-util/rendering-elements/intersect/intersect-polygon.js"() {
"use strict";
init_intersect_line();
- intersect_polygon_default = intersectPolygon;
__name(intersectPolygon, "intersectPolygon");
+ intersect_polygon_default = intersectPolygon;
}
});
- // src/dagre-wrapper/intersect/intersect-rect.js
+ // src/rendering-util/rendering-elements/intersect/intersect-rect.js
var intersectRect, intersect_rect_default;
var init_intersect_rect = __esm({
- "src/dagre-wrapper/intersect/intersect-rect.js"() {
+ "src/rendering-util/rendering-elements/intersect/intersect-rect.js"() {
"use strict";
intersectRect = /* @__PURE__ */ __name((node2, point8) => {
var x5 = node2.x;
@@ -37765,10 +39650,10 @@ ${text2}
}
});
- // src/dagre-wrapper/intersect/index.js
+ // src/rendering-util/rendering-elements/intersect/index.js
var intersect_default;
var init_intersect = __esm({
- "src/dagre-wrapper/intersect/index.js"() {
+ "src/rendering-util/rendering-elements/intersect/index.js"() {
"use strict";
init_intersect_node();
init_intersect_circle();
@@ -37785,1026 +39670,93 @@ ${text2}
}
});
- // src/dagre-wrapper/shapes/util.js
- function insertPolygonShape(parent4, w3, h2, points) {
- return parent4.insert("polygon", ":first-child").attr(
- "points",
- points.map(function(d2) {
- return d2.x + "," + d2.y;
- }).join(" ")
- ).attr("class", "label-container").attr("transform", "translate(" + -w3 / 2 + "," + h2 / 2 + ")");
- }
- var labelHelper, updateNodeBounds;
- var init_util = __esm({
- "src/dagre-wrapper/shapes/util.js"() {
+ // src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts
+ var solidStateFill, compileStyles, styles2Map, isLabelStyle, styles2String, userNodeOverrides;
+ var init_handDrawnShapeStyles = __esm({
+ "src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts"() {
"use strict";
- init_createLabel();
- init_createText();
init_diagramAPI();
- init_src32();
- init_common();
- init_utils2();
- labelHelper = /* @__PURE__ */ __name(async (parent4, node2, _classes, isNode2) => {
- const config6 = getConfig2();
- let classes6;
- const useHtmlLabels = node2.useHtmlLabels || evaluate(config6.flowchart.htmlLabels);
- if (!_classes) {
- classes6 = "node default";
- } else {
- classes6 = _classes;
- }
- const shapeSvg = parent4.insert("g").attr("class", classes6).attr("id", node2.domId || node2.id);
- const label = shapeSvg.insert("g").attr("class", "label").attr("style", node2.labelStyle);
- let labelText;
- if (node2.labelText === void 0) {
- labelText = "";
- } else {
- labelText = typeof node2.labelText === "string" ? node2.labelText : node2.labelText[0];
- }
- const textNode = label.node();
- let text2;
- if (node2.labelType === "markdown") {
- text2 = createText(
- label,
- sanitizeText(decodeEntities(labelText), config6),
- {
- useHtmlLabels,
- width: node2.width || config6.flowchart.wrappingWidth,
- classes: "markdown-node-label"
- },
- config6
- );
- } else {
- text2 = textNode.appendChild(
- createLabel_default(sanitizeText(decodeEntities(labelText), config6), node2.labelStyle, false, isNode2)
- );
- }
- let bbox = text2.getBBox();
- const halfPadding = node2.padding / 2;
- if (evaluate(config6.flowchart.htmlLabels)) {
- const div = text2.children[0];
- const dv = select_default2(text2);
- const images = div.getElementsByTagName("img");
- if (images) {
- const noImgText = labelText.replace(/ ]*>/g, "").trim() === "";
- await Promise.all(
- [...images].map(
- (img) => new Promise((res) => {
- function setupImage() {
- img.style.display = "flex";
- img.style.flexDirection = "column";
- if (noImgText) {
- const bodyFontSize = config6.fontSize ? config6.fontSize : window.getComputedStyle(document.body).fontSize;
- const enlargingFactor = 5;
- const width3 = parseInt(bodyFontSize, 10) * enlargingFactor + "px";
- img.style.minWidth = width3;
- img.style.maxWidth = width3;
- } else {
- img.style.width = "100%";
- }
- res(img);
- }
- __name(setupImage, "setupImage");
- setTimeout(() => {
- if (img.complete) {
- setupImage();
- }
- });
- img.addEventListener("error", setupImage);
- img.addEventListener("load", setupImage);
- })
- )
- );
+ solidStateFill = /* @__PURE__ */ __name((color2) => {
+ const { handDrawnSeed } = getConfig2();
+ return {
+ fill: color2,
+ hachureAngle: 120,
+ // angle of hachure,
+ hachureGap: 4,
+ fillWeight: 2,
+ roughness: 0.7,
+ stroke: color2,
+ seed: handDrawnSeed
+ };
+ }, "solidStateFill");
+ compileStyles = /* @__PURE__ */ __name((node2) => {
+ const stylesMap = styles2Map([...node2.cssCompiledStyles || [], ...node2.cssStyles || []]);
+ return { stylesMap, stylesArray: [...stylesMap] };
+ }, "compileStyles");
+ styles2Map = /* @__PURE__ */ __name((styles4) => {
+ const styleMap2 = /* @__PURE__ */ new Map();
+ styles4.forEach((style3) => {
+ const [key, value2] = style3.split(":");
+ styleMap2.set(key.trim(), value2?.trim());
+ });
+ return styleMap2;
+ }, "styles2Map");
+ isLabelStyle = /* @__PURE__ */ __name((key) => {
+ return key === "color" || key === "font-size" || key === "font-family" || key === "font-weight" || key === "font-style" || key === "text-decoration" || key === "text-align" || key === "text-transform" || key === "line-height" || key === "letter-spacing" || key === "word-spacing" || key === "text-shadow" || key === "text-overflow" || key === "white-space" || key === "word-wrap" || key === "word-break" || key === "overflow-wrap" || key === "hyphens";
+ }, "isLabelStyle");
+ styles2String = /* @__PURE__ */ __name((node2) => {
+ const { stylesArray } = compileStyles(node2);
+ const labelStyles = [];
+ const nodeStyles = [];
+ const borderStyles = [];
+ const backgroundStyles = [];
+ stylesArray.forEach((style3) => {
+ const key = style3[0];
+ if (isLabelStyle(key)) {
+ labelStyles.push(style3.join(":") + " !important");
+ } else {
+ nodeStyles.push(style3.join(":") + " !important");
+ if (key.includes("stroke")) {
+ borderStyles.push(style3.join(":") + " !important");
+ }
+ if (key === "fill") {
+ backgroundStyles.push(style3.join(":") + " !important");
+ }
}
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- if (useHtmlLabels) {
- label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
- } else {
- label.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
- }
- if (node2.centerLabel) {
- label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
- }
- label.insert("rect", ":first-child");
- return { shapeSvg, bbox, halfPadding, label };
- }, "labelHelper");
- updateNodeBounds = /* @__PURE__ */ __name((node2, element3) => {
- const bbox = element3.node().getBBox();
- node2.width = bbox.width;
- node2.height = bbox.height;
- }, "updateNodeBounds");
- __name(insertPolygonShape, "insertPolygonShape");
+ });
+ return {
+ labelStyles: labelStyles.join(";"),
+ nodeStyles: nodeStyles.join(";"),
+ stylesArray,
+ borderStyles,
+ backgroundStyles
+ };
+ }, "styles2String");
+ userNodeOverrides = /* @__PURE__ */ __name((node2, options3) => {
+ const { themeVariables, handDrawnSeed } = getConfig2();
+ const { nodeBorder, mainBkg } = themeVariables;
+ const { stylesMap } = compileStyles(node2);
+ const result = Object.assign(
+ {
+ roughness: 0.7,
+ fill: stylesMap.get("fill") || mainBkg,
+ fillStyle: "hachure",
+ // solid fill
+ fillWeight: 4,
+ hachureGap: 5.2,
+ stroke: stylesMap.get("stroke") || nodeBorder,
+ seed: handDrawnSeed,
+ strokeWidth: stylesMap.get("stroke-width")?.replace("px", "") || 1.3,
+ fillLineDash: [0, 0]
+ },
+ options3
+ );
+ return result;
+ }, "userNodeOverrides");
}
});
- // src/dagre-wrapper/shapes/note.js
- var note, note_default;
- var init_note = __esm({
- "src/dagre-wrapper/shapes/note.js"() {
- "use strict";
- init_util();
- init_logger();
- init_diagramAPI();
- init_intersect();
- note = /* @__PURE__ */ __name(async (parent4, node2) => {
- const useHtmlLabels = node2.useHtmlLabels || getConfig2().flowchart.htmlLabels;
- if (!useHtmlLabels) {
- node2.centerLabel = true;
- }
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
- parent4,
- node2,
- "node " + node2.classes,
- true
- );
- log.info("Classes = ", node2.classes);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- rect4.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding);
- updateNodeBounds(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default.rect(node2, point8);
- };
- return shapeSvg;
- }, "note");
- note_default = note;
- }
- });
-
- // src/dagre-wrapper/nodes.js
- function applyNodePropertyBorders(rect4, borders, totalWidth, totalHeight) {
- const strokeDashArray = [];
- const addBorder = /* @__PURE__ */ __name((length2) => {
- strokeDashArray.push(length2, 0);
- }, "addBorder");
- const skipBorder = /* @__PURE__ */ __name((length2) => {
- strokeDashArray.push(0, length2);
- }, "skipBorder");
- if (borders.includes("t")) {
- log.debug("add top border");
- addBorder(totalWidth);
- } else {
- skipBorder(totalWidth);
- }
- if (borders.includes("r")) {
- log.debug("add right border");
- addBorder(totalHeight);
- } else {
- skipBorder(totalHeight);
- }
- if (borders.includes("b")) {
- log.debug("add bottom border");
- addBorder(totalWidth);
- } else {
- skipBorder(totalWidth);
- }
- if (borders.includes("l")) {
- log.debug("add left border");
- addBorder(totalHeight);
- } else {
- skipBorder(totalHeight);
- }
- rect4.attr("stroke-dasharray", strokeDashArray.join(" "));
- }
- var formatClass, getClassesFromNode, question, choice, hexagon, block_arrow, rect_left_inv_arrow, lean_right, lean_left, trapezoid, inv_trapezoid, rect_right_inv_arrow, cylinder, rect, composite, labelRect, rectWithTitle, stadium, circle, doublecircle, subroutine, start2, forkJoin, end, class_box, shapes, nodeElems, insertNode, setNodeElem, clear4, positionNode;
- var init_nodes2 = __esm({
- "src/dagre-wrapper/nodes.js"() {
- "use strict";
- init_src32();
- init_diagramAPI();
- init_common();
- init_logger();
- init_blockArrowHelper();
- init_createLabel();
- init_intersect();
- init_note();
- init_util();
- formatClass = /* @__PURE__ */ __name((str2) => {
- if (str2) {
- return " " + str2;
- }
- return "";
- }, "formatClass");
- getClassesFromNode = /* @__PURE__ */ __name((node2, otherClasses) => {
- return `${otherClasses ? otherClasses : "node default"}${formatClass(node2.classes)} ${formatClass(
- node2.class
- )}`;
- }, "getClassesFromNode");
- question = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const s2 = w3 + h2;
- const points = [
- { x: s2 / 2, y: 0 },
- { x: s2, y: -s2 / 2 },
- { x: s2 / 2, y: -s2 },
- { x: 0, y: -s2 / 2 }
- ];
- log.info("Question main (Circle)");
- const questionElem = insertPolygonShape(shapeSvg, s2, s2, points);
- questionElem.attr("style", node2.style);
- updateNodeBounds(node2, questionElem);
- node2.intersect = function(point8) {
- log.warn("Intersect called");
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "question");
- choice = /* @__PURE__ */ __name((parent4, node2) => {
- const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
- const s2 = 28;
- const points = [
- { x: 0, y: s2 / 2 },
- { x: s2 / 2, y: 0 },
- { x: 0, y: -s2 / 2 },
- { x: -s2 / 2, y: 0 }
- ];
- const choice3 = shapeSvg.insert("polygon", ":first-child").attr(
- "points",
- points.map(function(d2) {
- return d2.x + "," + d2.y;
- }).join(" ")
- );
- choice3.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28);
- node2.width = 28;
- node2.height = 28;
- node2.intersect = function(point8) {
- return intersect_default.circle(node2, 14, point8);
- };
- return shapeSvg;
- }, "choice");
- hexagon = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const f3 = 4;
- const h2 = bbox.height + node2.padding;
- const m2 = h2 / f3;
- const w3 = bbox.width + 2 * m2 + node2.padding;
- const points = [
- { x: m2, y: 0 },
- { x: w3 - m2, y: 0 },
- { x: w3, y: -h2 / 2 },
- { x: w3 - m2, y: -h2 },
- { x: m2, y: -h2 },
- { x: 0, y: -h2 / 2 }
- ];
- const hex2 = insertPolygonShape(shapeSvg, w3, h2, points);
- hex2.attr("style", node2.style);
- updateNodeBounds(node2, hex2);
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "hexagon");
- block_arrow = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(parent4, node2, void 0, true);
- const f3 = 2;
- const h2 = bbox.height + 2 * node2.padding;
- const m2 = h2 / f3;
- const w3 = bbox.width + 2 * m2 + node2.padding;
- const points = getArrowPoints(node2.directions, bbox, node2);
- const blockArrow = insertPolygonShape(shapeSvg, w3, h2, points);
- blockArrow.attr("style", node2.style);
- updateNodeBounds(node2, blockArrow);
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "block_arrow");
- rect_left_inv_arrow = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: -h2 / 2, y: 0 },
- { x: w3, y: 0 },
- { x: w3, y: -h2 },
- { x: -h2 / 2, y: -h2 },
- { x: 0, y: -h2 / 2 }
- ];
- const el = insertPolygonShape(shapeSvg, w3, h2, points);
- el.attr("style", node2.style);
- node2.width = w3 + h2;
- node2.height = h2;
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "rect_left_inv_arrow");
- lean_right = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(parent4, node2, getClassesFromNode(node2), true);
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: -2 * h2 / 6, y: 0 },
- { x: w3 - h2 / 6, y: 0 },
- { x: w3 + 2 * h2 / 6, y: -h2 },
- { x: h2 / 6, y: -h2 }
- ];
- const el = insertPolygonShape(shapeSvg, w3, h2, points);
- el.attr("style", node2.style);
- updateNodeBounds(node2, el);
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "lean_right");
- lean_left = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: 2 * h2 / 6, y: 0 },
- { x: w3 + h2 / 6, y: 0 },
- { x: w3 - 2 * h2 / 6, y: -h2 },
- { x: -h2 / 6, y: -h2 }
- ];
- const el = insertPolygonShape(shapeSvg, w3, h2, points);
- el.attr("style", node2.style);
- updateNodeBounds(node2, el);
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "lean_left");
- trapezoid = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: -2 * h2 / 6, y: 0 },
- { x: w3 + 2 * h2 / 6, y: 0 },
- { x: w3 - h2 / 6, y: -h2 },
- { x: h2 / 6, y: -h2 }
- ];
- const el = insertPolygonShape(shapeSvg, w3, h2, points);
- el.attr("style", node2.style);
- updateNodeBounds(node2, el);
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "trapezoid");
- inv_trapezoid = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: h2 / 6, y: 0 },
- { x: w3 - h2 / 6, y: 0 },
- { x: w3 + 2 * h2 / 6, y: -h2 },
- { x: -2 * h2 / 6, y: -h2 }
- ];
- const el = insertPolygonShape(shapeSvg, w3, h2, points);
- el.attr("style", node2.style);
- updateNodeBounds(node2, el);
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "inv_trapezoid");
- rect_right_inv_arrow = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: 0, y: 0 },
- { x: w3 + h2 / 2, y: 0 },
- { x: w3, y: -h2 / 2 },
- { x: w3 + h2 / 2, y: -h2 },
- { x: 0, y: -h2 }
- ];
- const el = insertPolygonShape(shapeSvg, w3, h2, points);
- el.attr("style", node2.style);
- updateNodeBounds(node2, el);
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "rect_right_inv_arrow");
- cylinder = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const w3 = bbox.width + node2.padding;
- const rx = w3 / 2;
- const ry = rx / (2.5 + w3 / 50);
- const h2 = bbox.height + ry + node2.padding;
- const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w3 + " 0 a " + rx + "," + ry + " 0,0,0 " + -w3 + " 0 l 0," + h2 + " a " + rx + "," + ry + " 0,0,0 " + w3 + " 0 l 0," + -h2;
- const el = shapeSvg.attr("label-offset-y", ry).insert("path", ":first-child").attr("style", node2.style).attr("d", shape).attr("transform", "translate(" + -w3 / 2 + "," + -(h2 / 2 + ry) + ")");
- updateNodeBounds(node2, el);
- node2.intersect = function(point8) {
- const pos = intersect_default.rect(node2, point8);
- const x5 = pos.x - node2.x;
- if (rx != 0 && (Math.abs(x5) < node2.width / 2 || Math.abs(x5) == node2.width / 2 && Math.abs(pos.y - node2.y) > node2.height / 2 - ry)) {
- let y5 = ry * ry * (1 - x5 * x5 / (rx * rx));
- if (y5 != 0) {
- y5 = Math.sqrt(y5);
- }
- y5 = ry - y5;
- if (point8.y - node2.y > 0) {
- y5 = -y5;
- }
- pos.y += y5;
- }
- return pos;
- };
- return shapeSvg;
- }, "cylinder");
- rect = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
- parent4,
- node2,
- "node " + node2.classes + " " + node2.class,
- true
- );
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const totalWidth = node2.positioned ? node2.width : bbox.width + node2.padding;
- const totalHeight = node2.positioned ? node2.height : bbox.height + node2.padding;
- const x5 = node2.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
- const y5 = node2.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
- rect4.attr("class", "basic label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
- if (node2.props) {
- const propKeys = new Set(Object.keys(node2.props));
- if (node2.props.borders) {
- applyNodePropertyBorders(rect4, node2.props.borders, totalWidth, totalHeight);
- propKeys.delete("borders");
- }
- propKeys.forEach((propKey) => {
- log.warn(`Unknown node property ${propKey}`);
- });
- }
- updateNodeBounds(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default.rect(node2, point8);
- };
- return shapeSvg;
- }, "rect");
- composite = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
- parent4,
- node2,
- "node " + node2.classes,
- true
- );
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const totalWidth = node2.positioned ? node2.width : bbox.width + node2.padding;
- const totalHeight = node2.positioned ? node2.height : bbox.height + node2.padding;
- const x5 = node2.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
- const y5 = node2.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
- rect4.attr("class", "basic cluster composite label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
- if (node2.props) {
- const propKeys = new Set(Object.keys(node2.props));
- if (node2.props.borders) {
- applyNodePropertyBorders(rect4, node2.props.borders, totalWidth, totalHeight);
- propKeys.delete("borders");
- }
- propKeys.forEach((propKey) => {
- log.warn(`Unknown node property ${propKey}`);
- });
- }
- updateNodeBounds(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default.rect(node2, point8);
- };
- return shapeSvg;
- }, "composite");
- labelRect = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg } = await labelHelper(parent4, node2, "label", true);
- log.trace("Classes = ", node2.class);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const totalWidth = 0;
- const totalHeight = 0;
- rect4.attr("width", totalWidth).attr("height", totalHeight);
- shapeSvg.attr("class", "label edgeLabel");
- if (node2.props) {
- const propKeys = new Set(Object.keys(node2.props));
- if (node2.props.borders) {
- applyNodePropertyBorders(rect4, node2.props.borders, totalWidth, totalHeight);
- propKeys.delete("borders");
- }
- propKeys.forEach((propKey) => {
- log.warn(`Unknown node property ${propKey}`);
- });
- }
- updateNodeBounds(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default.rect(node2, point8);
- };
- return shapeSvg;
- }, "labelRect");
- __name(applyNodePropertyBorders, "applyNodePropertyBorders");
- rectWithTitle = /* @__PURE__ */ __name((parent4, node2) => {
- let classes6;
- if (!node2.classes) {
- classes6 = "node default";
- } else {
- classes6 = "node " + node2.classes;
- }
- const shapeSvg = parent4.insert("g").attr("class", classes6).attr("id", node2.domId || node2.id);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const innerLine = shapeSvg.insert("line");
- const label = shapeSvg.insert("g").attr("class", "label");
- const text2 = node2.labelText.flat ? node2.labelText.flat() : node2.labelText;
- let title2 = "";
- if (typeof text2 === "object") {
- title2 = text2[0];
- } else {
- title2 = text2;
- }
- log.info("Label text abc79", title2, text2, typeof text2 === "object");
- const text3 = label.node().appendChild(createLabel_default(title2, node2.labelStyle, true, true));
- let bbox = { width: 0, height: 0 };
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- const div = text3.children[0];
- const dv = select_default2(text3);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- log.info("Text 2", text2);
- const textRows = text2.slice(1, text2.length);
- let titleBox = text3.getBBox();
- const descr = label.node().appendChild(
- createLabel_default(textRows.join ? textRows.join(" ") : textRows, node2.labelStyle, true, true)
- );
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- const div = descr.children[0];
- const dv = select_default2(descr);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- const halfPadding = node2.padding / 2;
- select_default2(descr).attr(
- "transform",
- "translate( " + // (titleBox.width - bbox.width) / 2 +
- (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")"
- );
- select_default2(text3).attr(
- "transform",
- "translate( " + // (titleBox.width - bbox.width) / 2 +
- (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)"
- );
- bbox = label.node().getBBox();
- label.attr(
- "transform",
- "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")"
- );
- rect4.attr("class", "outer title-state").attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding);
- innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);
- updateNodeBounds(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default.rect(node2, point8);
- };
- return shapeSvg;
- }, "rectWithTitle");
- stadium = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const h2 = bbox.height + node2.padding;
- const w3 = bbox.width + h2 / 4 + node2.padding;
- const rect4 = shapeSvg.insert("rect", ":first-child").attr("style", node2.style).attr("rx", h2 / 2).attr("ry", h2 / 2).attr("x", -w3 / 2).attr("y", -h2 / 2).attr("width", w3).attr("height", h2);
- updateNodeBounds(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default.rect(node2, point8);
- };
- return shapeSvg;
- }, "stadium");
- circle = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const circle6 = shapeSvg.insert("circle", ":first-child");
- circle6.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding);
- log.info("Circle main");
- updateNodeBounds(node2, circle6);
- node2.intersect = function(point8) {
- log.info("Circle intersect", node2, bbox.width / 2 + halfPadding, point8);
- return intersect_default.circle(node2, bbox.width / 2 + halfPadding, point8);
- };
- return shapeSvg;
- }, "circle");
- doublecircle = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const gap = 5;
- const circleGroup = shapeSvg.insert("g", ":first-child");
- const outerCircle = circleGroup.insert("circle");
- const innerCircle = circleGroup.insert("circle");
- circleGroup.attr("class", node2.class);
- outerCircle.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding + gap).attr("width", bbox.width + node2.padding + gap * 2).attr("height", bbox.height + node2.padding + gap * 2);
- innerCircle.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding);
- log.info("DoubleCircle main");
- updateNodeBounds(node2, outerCircle);
- node2.intersect = function(point8) {
- log.info("DoubleCircle intersect", node2, bbox.width / 2 + halfPadding + gap, point8);
- return intersect_default.circle(node2, bbox.width / 2 + halfPadding + gap, point8);
- };
- return shapeSvg;
- }, "doublecircle");
- subroutine = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg, bbox } = await labelHelper(
- parent4,
- node2,
- getClassesFromNode(node2, void 0),
- true
- );
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: 0, y: 0 },
- { x: w3, y: 0 },
- { x: w3, y: -h2 },
- { x: 0, y: -h2 },
- { x: 0, y: 0 },
- { x: -8, y: 0 },
- { x: w3 + 8, y: 0 },
- { x: w3 + 8, y: -h2 },
- { x: -8, y: -h2 },
- { x: -8, y: 0 }
- ];
- const el = insertPolygonShape(shapeSvg, w3, h2, points);
- el.attr("style", node2.style);
- updateNodeBounds(node2, el);
- node2.intersect = function(point8) {
- return intersect_default.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "subroutine");
- start2 = /* @__PURE__ */ __name((parent4, node2) => {
- const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
- const circle6 = shapeSvg.insert("circle", ":first-child");
- circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
- updateNodeBounds(node2, circle6);
- node2.intersect = function(point8) {
- return intersect_default.circle(node2, 7, point8);
- };
- return shapeSvg;
- }, "start");
- forkJoin = /* @__PURE__ */ __name((parent4, node2, dir2) => {
- const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
- let width3 = 70;
- let height2 = 10;
- if (dir2 === "LR") {
- width3 = 10;
- height2 = 70;
- }
- const shape = shapeSvg.append("rect").attr("x", -1 * width3 / 2).attr("y", -1 * height2 / 2).attr("width", width3).attr("height", height2).attr("class", "fork-join");
- updateNodeBounds(node2, shape);
- node2.height = node2.height + node2.padding / 2;
- node2.width = node2.width + node2.padding / 2;
- node2.intersect = function(point8) {
- return intersect_default.rect(node2, point8);
- };
- return shapeSvg;
- }, "forkJoin");
- end = /* @__PURE__ */ __name((parent4, node2) => {
- const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
- const innerCircle = shapeSvg.insert("circle", ":first-child");
- const circle6 = shapeSvg.insert("circle", ":first-child");
- circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
- innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10);
- updateNodeBounds(node2, circle6);
- node2.intersect = function(point8) {
- return intersect_default.circle(node2, 7, point8);
- };
- return shapeSvg;
- }, "end");
- class_box = /* @__PURE__ */ __name((parent4, node2) => {
- const halfPadding = node2.padding / 2;
- const rowPadding = 4;
- const lineHeight = 8;
- let classes6;
- if (!node2.classes) {
- classes6 = "node default";
- } else {
- classes6 = "node " + node2.classes;
- }
- const shapeSvg = parent4.insert("g").attr("class", classes6).attr("id", node2.domId || node2.id);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const topLine = shapeSvg.insert("line");
- const bottomLine = shapeSvg.insert("line");
- let maxWidth = 0;
- let maxHeight = rowPadding;
- const labelContainer = shapeSvg.insert("g").attr("class", "label");
- let verticalPos = 0;
- const hasInterface = node2.classData.annotations?.[0];
- const interfaceLabelText = node2.classData.annotations[0] ? "\xAB" + node2.classData.annotations[0] + "\xBB" : "";
- const interfaceLabel = labelContainer.node().appendChild(createLabel_default(interfaceLabelText, node2.labelStyle, true, true));
- let interfaceBBox = interfaceLabel.getBBox();
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- const div = interfaceLabel.children[0];
- const dv = select_default2(interfaceLabel);
- interfaceBBox = div.getBoundingClientRect();
- dv.attr("width", interfaceBBox.width);
- dv.attr("height", interfaceBBox.height);
- }
- if (node2.classData.annotations[0]) {
- maxHeight += interfaceBBox.height + rowPadding;
- maxWidth += interfaceBBox.width;
- }
- let classTitleString = node2.classData.label;
- if (node2.classData.type !== void 0 && node2.classData.type !== "") {
- if (getConfig2().flowchart.htmlLabels) {
- classTitleString += "<" + node2.classData.type + ">";
- } else {
- classTitleString += "<" + node2.classData.type + ">";
- }
- }
- const classTitleLabel = labelContainer.node().appendChild(createLabel_default(classTitleString, node2.labelStyle, true, true));
- select_default2(classTitleLabel).attr("class", "classTitle");
- let classTitleBBox = classTitleLabel.getBBox();
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- const div = classTitleLabel.children[0];
- const dv = select_default2(classTitleLabel);
- classTitleBBox = div.getBoundingClientRect();
- dv.attr("width", classTitleBBox.width);
- dv.attr("height", classTitleBBox.height);
- }
- maxHeight += classTitleBBox.height + rowPadding;
- if (classTitleBBox.width > maxWidth) {
- maxWidth = classTitleBBox.width;
- }
- const classAttributes = [];
- node2.classData.members.forEach((member) => {
- const parsedInfo = member.getDisplayDetails();
- let parsedText = parsedInfo.displayText;
- if (getConfig2().flowchart.htmlLabels) {
- parsedText = parsedText.replace(//g, ">");
- }
- const lbl = labelContainer.node().appendChild(
- createLabel_default(
- parsedText,
- parsedInfo.cssStyle ? parsedInfo.cssStyle : node2.labelStyle,
- true,
- true
- )
- );
- let bbox = lbl.getBBox();
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- const div = lbl.children[0];
- const dv = select_default2(lbl);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- if (bbox.width > maxWidth) {
- maxWidth = bbox.width;
- }
- maxHeight += bbox.height + rowPadding;
- classAttributes.push(lbl);
- });
- maxHeight += lineHeight;
- const classMethods = [];
- node2.classData.methods.forEach((member) => {
- const parsedInfo = member.getDisplayDetails();
- let displayText = parsedInfo.displayText;
- if (getConfig2().flowchart.htmlLabels) {
- displayText = displayText.replace(//g, ">");
- }
- const lbl = labelContainer.node().appendChild(
- createLabel_default(
- displayText,
- parsedInfo.cssStyle ? parsedInfo.cssStyle : node2.labelStyle,
- true,
- true
- )
- );
- let bbox = lbl.getBBox();
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- const div = lbl.children[0];
- const dv = select_default2(lbl);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- if (bbox.width > maxWidth) {
- maxWidth = bbox.width;
- }
- maxHeight += bbox.height + rowPadding;
- classMethods.push(lbl);
- });
- maxHeight += lineHeight;
- if (hasInterface) {
- let diffX2 = (maxWidth - interfaceBBox.width) / 2;
- select_default2(interfaceLabel).attr(
- "transform",
- "translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")"
- );
- verticalPos = interfaceBBox.height + rowPadding;
- }
- let diffX = (maxWidth - classTitleBBox.width) / 2;
- select_default2(classTitleLabel).attr(
- "transform",
- "translate( " + (-1 * maxWidth / 2 + diffX) + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
- );
- verticalPos += classTitleBBox.height + rowPadding;
- topLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos);
- verticalPos += lineHeight;
- classAttributes.forEach((lbl) => {
- select_default2(lbl).attr(
- "transform",
- "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")"
- );
- const memberBBox = lbl?.getBBox();
- verticalPos += (memberBBox?.height ?? 0) + rowPadding;
- });
- verticalPos += lineHeight;
- bottomLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos);
- verticalPos += lineHeight;
- classMethods.forEach((lbl) => {
- select_default2(lbl).attr(
- "transform",
- "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
- );
- const memberBBox = lbl?.getBBox();
- verticalPos += (memberBBox?.height ?? 0) + rowPadding;
- });
- rect4.attr("style", node2.style).attr("class", "outer title-state").attr("x", -maxWidth / 2 - halfPadding).attr("y", -(maxHeight / 2) - halfPadding).attr("width", maxWidth + node2.padding).attr("height", maxHeight + node2.padding);
- updateNodeBounds(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default.rect(node2, point8);
- };
- return shapeSvg;
- }, "class_box");
- shapes = {
- rhombus: question,
- composite,
- question,
- rect,
- labelRect,
- rectWithTitle,
- choice,
- circle,
- doublecircle,
- stadium,
- hexagon,
- block_arrow,
- rect_left_inv_arrow,
- lean_right,
- lean_left,
- trapezoid,
- inv_trapezoid,
- rect_right_inv_arrow,
- cylinder,
- start: start2,
- end,
- note: note_default,
- subroutine,
- fork: forkJoin,
- join: forkJoin,
- class_box
- };
- nodeElems = {};
- insertNode = /* @__PURE__ */ __name(async (elem, node2, dir2) => {
- let newEl;
- let el;
- if (node2.link) {
- let target;
- if (getConfig2().securityLevel === "sandbox") {
- target = "_top";
- } else if (node2.linkTarget) {
- target = node2.linkTarget || "_blank";
- }
- newEl = elem.insert("svg:a").attr("xlink:href", node2.link).attr("target", target);
- el = await shapes[node2.shape](newEl, node2, dir2);
- } else {
- el = await shapes[node2.shape](elem, node2, dir2);
- newEl = el;
- }
- if (node2.tooltip) {
- el.attr("title", node2.tooltip);
- }
- if (node2.class) {
- el.attr("class", "node default " + node2.class);
- }
- nodeElems[node2.id] = newEl;
- if (node2.haveCallback) {
- nodeElems[node2.id].attr("class", nodeElems[node2.id].attr("class") + " clickable");
- }
- return newEl;
- }, "insertNode");
- setNodeElem = /* @__PURE__ */ __name((elem, node2) => {
- nodeElems[node2.id] = elem;
- }, "setNodeElem");
- clear4 = /* @__PURE__ */ __name(() => {
- nodeElems = {};
- }, "clear");
- positionNode = /* @__PURE__ */ __name((node2) => {
- const el = nodeElems[node2.id];
- log.trace(
- "Transforming node",
- node2.diff,
- node2,
- "translate(" + (node2.x - node2.width / 2 - 5) + ", " + node2.width / 2 + ")"
- );
- const padding3 = 8;
- const diff2 = node2.diff || 0;
- if (node2.clusterNode) {
- el.attr(
- "transform",
- "translate(" + (node2.x + diff2 - node2.width / 2) + ", " + (node2.y - node2.height / 2 - padding3) + ")"
- );
- } else {
- el.attr("transform", "translate(" + node2.x + ", " + node2.y + ")");
- }
- return diff2;
- }, "positionNode");
- }
- });
-
- // src/rendering-util/insertElementsForSize.js
- var getDiagramElement;
- var init_insertElementsForSize = __esm({
- "src/rendering-util/insertElementsForSize.js"() {
- "use strict";
- init_src32();
- init_nodes2();
- getDiagramElement = /* @__PURE__ */ __name((id27, securityLevel) => {
- let sandboxElement;
- if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
- }
- const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const svg = root4.select(`[id="${id27}"]`);
- return svg;
- }, "getDiagramElement");
- }
- });
-
- // src/utils/subGraphTitleMargins.ts
- var getSubGraphTitleMargins;
- var init_subGraphTitleMargins = __esm({
- "src/utils/subGraphTitleMargins.ts"() {
- "use strict";
- getSubGraphTitleMargins = /* @__PURE__ */ __name(({
- flowchart
- }) => {
- const subGraphTitleTopMargin = flowchart?.subGraphTitleMargin?.top ?? 0;
- const subGraphTitleBottomMargin = flowchart?.subGraphTitleMargin?.bottom ?? 0;
- const subGraphTitleTotalMargin = subGraphTitleTopMargin + subGraphTitleBottomMargin;
- return {
- subGraphTitleTopMargin,
- subGraphTitleBottomMargin,
- subGraphTitleTotalMargin
- };
- }, "getSubGraphTitleMargins");
- }
- });
-
- // ../../node_modules/.pnpm/roughjs@4.6.6/node_modules/roughjs/bundled/rough.esm.js
+ // ../../node_modules/.pnpm/roughjs@4.6.6_patch_hash=3543d47108cb41b68ec6a671c0e1f9d0cfe2ce524fea5b0992511ae84c3c6b64/node_modules/roughjs/bundled/rough.esm.js
function t(t4, e3, s2) {
if (t4 && t4.length) {
const [n2, o2] = e3, a2 = Math.PI / 180 * s2, h2 = Math.cos(a2), r2 = Math.sin(a2);
@@ -39014,13 +39966,13 @@ ${text2}
const [t5, a3] = l2;
let h3 = 0, c4 = 0;
"Q" === s2 || "T" === s2 ? (h3 = n2 + (n2 - r2), c4 = o2 + (o2 - i2)) : (h3 = n2, c4 = o2);
- const u2 = n2 + 2 * (h3 - n2) / 3, p3 = o2 + 2 * (c4 - o2) / 3, f3 = t5 + 2 * (h3 - t5) / 3, d2 = a3 + 2 * (c4 - a3) / 3;
- e3.push({ key: "C", data: [u2, p3, f3, d2, t5, a3] }), r2 = h3, i2 = c4, n2 = t5, o2 = a3;
+ const u2 = n2 + 2 * (h3 - n2) / 3, p3 = o2 + 2 * (c4 - o2) / 3, f2 = t5 + 2 * (h3 - t5) / 3, d2 = a3 + 2 * (c4 - a3) / 3;
+ e3.push({ key: "C", data: [u2, p3, f2, d2, t5, a3] }), r2 = h3, i2 = c4, n2 = t5, o2 = a3;
break;
}
case "Q": {
- const [t5, s3, a3, h3] = l2, c4 = n2 + 2 * (t5 - n2) / 3, u2 = o2 + 2 * (s3 - o2) / 3, p3 = a3 + 2 * (t5 - a3) / 3, f3 = h3 + 2 * (s3 - h3) / 3;
- e3.push({ key: "C", data: [c4, u2, p3, f3, a3, h3] }), r2 = t5, i2 = s3, n2 = a3, o2 = h3;
+ const [t5, s3, a3, h3] = l2, c4 = n2 + 2 * (t5 - n2) / 3, u2 = o2 + 2 * (s3 - o2) / 3, p3 = a3 + 2 * (t5 - a3) / 3, f2 = h3 + 2 * (s3 - h3) / 3;
+ e3.push({ key: "C", data: [c4, u2, p3, f2, a3, h3] }), r2 = t5, i2 = s3, n2 = a3, o2 = h3;
break;
}
case "A": {
@@ -39046,23 +39998,23 @@ ${text2}
function x2(t4, e3, s2, n2, o2, a2, h2, r2, i2, c3) {
const l2 = (u2 = h2, Math.PI * u2 / 180);
var u2;
- let p3 = [], f3 = 0, d2 = 0, g2 = 0, M2 = 0;
- if (c3) [f3, d2, g2, M2] = c3;
+ let p3 = [], f2 = 0, d2 = 0, g2 = 0, M2 = 0;
+ if (c3) [f2, d2, g2, M2] = c3;
else {
[t4, e3] = w(t4, e3, -l2), [s2, n2] = w(s2, n2, -l2);
const h3 = (t4 - s2) / 2, c4 = (e3 - n2) / 2;
let u3 = h3 * h3 / (o2 * o2) + c4 * c4 / (a2 * a2);
u3 > 1 && (u3 = Math.sqrt(u3), o2 *= u3, a2 *= u3);
const p4 = o2 * o2, k3 = a2 * a2, b3 = p4 * k3 - p4 * c4 * c4 - k3 * h3 * h3, y6 = p4 * c4 * c4 + k3 * h3 * h3, m3 = (r2 === i2 ? -1 : 1) * Math.sqrt(Math.abs(b3 / y6));
- g2 = m3 * o2 * c4 / a2 + (t4 + s2) / 2, M2 = m3 * -a2 * h3 / o2 + (e3 + n2) / 2, f3 = Math.asin(parseFloat(((e3 - M2) / a2).toFixed(9))), d2 = Math.asin(parseFloat(((n2 - M2) / a2).toFixed(9))), t4 < g2 && (f3 = Math.PI - f3), s2 < g2 && (d2 = Math.PI - d2), f3 < 0 && (f3 = 2 * Math.PI + f3), d2 < 0 && (d2 = 2 * Math.PI + d2), i2 && f3 > d2 && (f3 -= 2 * Math.PI), !i2 && d2 > f3 && (d2 -= 2 * Math.PI);
+ g2 = m3 * o2 * c4 / a2 + (t4 + s2) / 2, M2 = m3 * -a2 * h3 / o2 + (e3 + n2) / 2, f2 = Math.asin(parseFloat(((e3 - M2) / a2).toFixed(9))), d2 = Math.asin(parseFloat(((n2 - M2) / a2).toFixed(9))), t4 < g2 && (f2 = Math.PI - f2), s2 < g2 && (d2 = Math.PI - d2), f2 < 0 && (f2 = 2 * Math.PI + f2), d2 < 0 && (d2 = 2 * Math.PI + d2), i2 && f2 > d2 && (f2 -= 2 * Math.PI), !i2 && d2 > f2 && (d2 -= 2 * Math.PI);
}
- let k2 = d2 - f3;
+ let k2 = d2 - f2;
if (Math.abs(k2) > 120 * Math.PI / 180) {
const t5 = d2, e4 = s2, r3 = n2;
- d2 = i2 && d2 > f3 ? f3 + 120 * Math.PI / 180 * 1 : f3 + 120 * Math.PI / 180 * -1, p3 = x2(s2 = g2 + o2 * Math.cos(d2), n2 = M2 + a2 * Math.sin(d2), e4, r3, o2, a2, h2, 0, i2, [d2, t5, g2, M2]);
+ d2 = i2 && d2 > f2 ? f2 + 120 * Math.PI / 180 * 1 : f2 + 120 * Math.PI / 180 * -1, p3 = x2(s2 = g2 + o2 * Math.cos(d2), n2 = M2 + a2 * Math.sin(d2), e4, r3, o2, a2, h2, 0, i2, [d2, t5, g2, M2]);
}
- k2 = d2 - f3;
- const b2 = Math.cos(f3), y5 = Math.sin(f3), m2 = Math.cos(d2), P2 = Math.sin(d2), v3 = Math.tan(k2 / 4), S3 = 4 / 3 * o2 * v3, O2 = 4 / 3 * a2 * v3, L2 = [t4, e3], T3 = [t4 + S3 * y5, e3 - O2 * b2], D3 = [s2 + S3 * P2, n2 - O2 * m2], A2 = [s2, n2];
+ k2 = d2 - f2;
+ const b2 = Math.cos(f2), y5 = Math.sin(f2), m2 = Math.cos(d2), P2 = Math.sin(d2), v3 = Math.tan(k2 / 4), S3 = 4 / 3 * o2 * v3, O2 = 4 / 3 * a2 * v3, L2 = [t4, e3], T3 = [t4 + S3 * y5, e3 - O2 * b2], D3 = [s2 + S3 * P2, n2 - O2 * m2], A2 = [s2, n2];
if (T3[0] = 2 * L2[0] - T3[0], T3[1] = 2 * L2[1] - T3[1], c3) return [T3, D3, A2].concat(p3);
{
p3 = [T3, D3, A2].concat(p3);
@@ -39125,15 +40077,15 @@ ${text2}
const c3 = t4, l2 = e3;
let u2 = Math.abs(s2 / 2), p3 = Math.abs(n2 / 2);
u2 += G(0.01 * u2, i2), p3 += G(0.01 * p3, i2);
- let f3 = o2, d2 = a2;
- for (; f3 < 0; ) f3 += 2 * Math.PI, d2 += 2 * Math.PI;
- d2 - f3 > 2 * Math.PI && (f3 = 0, d2 = 2 * Math.PI);
- const g2 = 2 * Math.PI / i2.curveStepCount, M2 = Math.min(g2 / 2, (d2 - f3) / 2), k2 = V(M2, c3, l2, u2, p3, f3, d2, 1, i2);
+ let f2 = o2, d2 = a2;
+ for (; f2 < 0; ) f2 += 2 * Math.PI, d2 += 2 * Math.PI;
+ d2 - f2 > 2 * Math.PI && (f2 = 0, d2 = 2 * Math.PI);
+ const g2 = 2 * Math.PI / i2.curveStepCount, M2 = Math.min(g2 / 2, (d2 - f2) / 2), k2 = V(M2, c3, l2, u2, p3, f2, d2, 1, i2);
if (!i2.disableMultiStroke) {
- const t5 = V(M2, c3, l2, u2, p3, f3, d2, 1.5, i2);
+ const t5 = V(M2, c3, l2, u2, p3, f2, d2, 1.5, i2);
k2.push(...t5);
}
- return h2 && (r2 ? k2.push(...$(c3, l2, c3 + u2 * Math.cos(f3), l2 + p3 * Math.sin(f3), i2), ...$(c3, l2, c3 + u2 * Math.cos(d2), l2 + p3 * Math.sin(d2), i2)) : k2.push({ op: "lineTo", data: [c3, l2] }, { op: "lineTo", data: [c3 + u2 * Math.cos(f3), l2 + p3 * Math.sin(f3)] })), { type: "path", ops: k2 };
+ return h2 && (r2 ? k2.push(...$(c3, l2, c3 + u2 * Math.cos(f2), l2 + p3 * Math.sin(f2), i2), ...$(c3, l2, c3 + u2 * Math.cos(d2), l2 + p3 * Math.sin(d2), i2)) : k2.push({ op: "lineTo", data: [c3, l2] }, { op: "lineTo", data: [c3 + u2 * Math.cos(f2), l2 + p3 * Math.sin(f2)] })), { type: "path", ops: k2 };
}
function _(t4, e3) {
const s2 = m(y2(b(t4))), n2 = [];
@@ -39217,10 +40169,10 @@ ${text2}
let l2 = o2.maxRandomnessOffset || 0;
l2 * l2 * 100 > r2 && (l2 = i2 / 10);
const u2 = l2 / 2, p3 = 0.2 + 0.2 * W(o2);
- let f3 = o2.bowing * o2.maxRandomnessOffset * (n2 - e3) / 200, d2 = o2.bowing * o2.maxRandomnessOffset * (t4 - s2) / 200;
- f3 = G(f3, o2, c3), d2 = G(d2, o2, c3);
+ let f2 = o2.bowing * o2.maxRandomnessOffset * (n2 - e3) / 200, d2 = o2.bowing * o2.maxRandomnessOffset * (t4 - s2) / 200;
+ f2 = G(f2, o2, c3), d2 = G(d2, o2, c3);
const g2 = [], M2 = /* @__PURE__ */ __name(() => G(u2, o2, c3), "M"), k2 = /* @__PURE__ */ __name(() => G(l2, o2, c3), "k"), b2 = o2.preserveVertices;
- return a2 && (h2 ? g2.push({ op: "move", data: [t4 + (b2 ? 0 : M2()), e3 + (b2 ? 0 : M2())] }) : g2.push({ op: "move", data: [t4 + (b2 ? 0 : G(l2, o2, c3)), e3 + (b2 ? 0 : G(l2, o2, c3))] })), h2 ? g2.push({ op: "bcurveTo", data: [f3 + t4 + (s2 - t4) * p3 + M2(), d2 + e3 + (n2 - e3) * p3 + M2(), f3 + t4 + 2 * (s2 - t4) * p3 + M2(), d2 + e3 + 2 * (n2 - e3) * p3 + M2(), s2 + (b2 ? 0 : M2()), n2 + (b2 ? 0 : M2())] }) : g2.push({ op: "bcurveTo", data: [f3 + t4 + (s2 - t4) * p3 + k2(), d2 + e3 + (n2 - e3) * p3 + k2(), f3 + t4 + 2 * (s2 - t4) * p3 + k2(), d2 + e3 + 2 * (n2 - e3) * p3 + k2(), s2 + (b2 ? 0 : k2()), n2 + (b2 ? 0 : k2())] }), g2;
+ return a2 && (h2 ? g2.push({ op: "move", data: [t4 + (b2 ? 0 : M2()), e3 + (b2 ? 0 : M2())] }) : g2.push({ op: "move", data: [t4 + (b2 ? 0 : G(l2, o2, c3)), e3 + (b2 ? 0 : G(l2, o2, c3))] })), h2 ? g2.push({ op: "bcurveTo", data: [f2 + t4 + (s2 - t4) * p3 + M2(), d2 + e3 + (n2 - e3) * p3 + M2(), f2 + t4 + 2 * (s2 - t4) * p3 + M2(), d2 + e3 + 2 * (n2 - e3) * p3 + M2(), s2 + (b2 ? 0 : M2()), n2 + (b2 ? 0 : M2())] }) : g2.push({ op: "bcurveTo", data: [f2 + t4 + (s2 - t4) * p3 + k2(), d2 + e3 + (n2 - e3) * p3 + k2(), f2 + t4 + 2 * (s2 - t4) * p3 + k2(), d2 + e3 + 2 * (n2 - e3) * p3 + k2(), s2 + (b2 ? 0 : k2()), n2 + (b2 ? 0 : k2())] }), g2;
}
function j(t4, e3, s2) {
if (!t4.length) return [];
@@ -39276,7 +40228,7 @@ ${text2}
const i2 = [], c3 = [r2.maxRandomnessOffset || 1, (r2.maxRandomnessOffset || 1) + 0.3];
let l2 = [0, 0];
const u2 = r2.disableMultiStroke ? 1 : 2, p3 = r2.preserveVertices;
- for (let f3 = 0; f3 < u2; f3++) 0 === f3 ? i2.push({ op: "move", data: [h2[0], h2[1]] }) : i2.push({ op: "move", data: [h2[0] + (p3 ? 0 : G(c3[0], r2)), h2[1] + (p3 ? 0 : G(c3[0], r2))] }), l2 = p3 ? [o2, a2] : [o2 + G(c3[f3], r2), a2 + G(c3[f3], r2)], i2.push({ op: "bcurveTo", data: [t4 + G(c3[f3], r2), e3 + G(c3[f3], r2), s2 + G(c3[f3], r2), n2 + G(c3[f3], r2), l2[0], l2[1]] });
+ for (let f2 = 0; f2 < u2; f2++) 0 === f2 ? i2.push({ op: "move", data: [h2[0], h2[1]] }) : i2.push({ op: "move", data: [h2[0] + (p3 ? 0 : G(c3[0], r2)), h2[1] + (p3 ? 0 : G(c3[0], r2))] }), l2 = p3 ? [o2, a2] : [o2 + G(c3[f2], r2), a2 + G(c3[f2], r2)], i2.push({ op: "bcurveTo", data: [t4 + G(c3[f2], r2), e3 + G(c3[f2], r2), s2 + G(c3[f2], r2), n2 + G(c3[f2], r2), l2[0], l2[1]] });
return i2;
}
function Q(t4) {
@@ -39331,8 +40283,8 @@ ${text2}
} else o2.push(s3);
o2.push(t4[e3 + 3]);
} else {
- const n3 = 0.5, a3 = t4[e3 + 0], h3 = t4[e3 + 1], r2 = t4[e3 + 2], i2 = t4[e3 + 3], c3 = J(a3, h3, n3), l2 = J(h3, r2, n3), u2 = J(r2, i2, n3), p3 = J(c3, l2, n3), f3 = J(l2, u2, n3), d2 = J(p3, f3, n3);
- K2([a3, c3, p3, d2], 0, s2, o2), K2([d2, f3, u2, i2], 0, s2, o2);
+ const n3 = 0.5, a3 = t4[e3 + 0], h3 = t4[e3 + 1], r2 = t4[e3 + 2], i2 = t4[e3 + 3], c3 = J(a3, h3, n3), l2 = J(h3, r2, n3), u2 = J(r2, i2, n3), p3 = J(c3, l2, n3), f2 = J(l2, u2, n3), d2 = J(p3, f2, n3);
+ K2([a3, c3, p3, d2], 0, s2, o2), K2([d2, f2, u2, i2], 0, s2, o2);
}
var a2, h2;
return o2;
@@ -39358,7 +40310,7 @@ ${text2}
}
var o, h, r, i, c2, l, u, p, f, d, g, M, P, tt, et, st, nt, ot, at;
var init_rough_esm = __esm({
- "../../node_modules/.pnpm/roughjs@4.6.6/node_modules/roughjs/bundled/rough.esm.js"() {
+ "../../node_modules/.pnpm/roughjs@4.6.6_patch_hash=3543d47108cb41b68ec6a671c0e1f9d0cfe2ce524fea5b0992511ae84c3c6b64/node_modules/roughjs/bundled/rough.esm.js"() {
"use strict";
__name(t, "t");
__name(e, "e");
@@ -39605,8 +40557,8 @@ ${text2}
let u2 = o3, p3 = a3;
for (; u2 < 0; ) u2 += 2 * Math.PI, p3 += 2 * Math.PI;
p3 - u2 > 2 * Math.PI && (u2 = 0, p3 = 2 * Math.PI);
- const f3 = (p3 - u2) / h3.curveStepCount, d2 = [];
- for (let t6 = u2; t6 <= p3; t6 += f3) d2.push([r3 + c4 * Math.cos(t6), i3 + l3 * Math.sin(t6)]);
+ const f2 = (p3 - u2) / h3.curveStepCount, d2 = [];
+ for (let t6 = u2; t6 <= p3; t6 += f2) d2.push([r3 + c4 * Math.cos(t6), i3 + l3 * Math.sin(t6)]);
return d2.push([r3 + c4 * Math.cos(p3), i3 + l3 * Math.sin(p3)]), d2.push([r3, i3]), C([d2], h3);
}(t4, e3, s2, n2, o2, a2, i2));
return i2.stroke !== tt && c3.push(l2), this._d("arc", c3, i2);
@@ -39888,2237 +40840,2514 @@ ${text2}
}
});
- // src/rendering-util/rendering-elements/intersect/intersect-rect.js
- var intersectRect2, intersect_rect_default2;
- var init_intersect_rect2 = __esm({
- "src/rendering-util/rendering-elements/intersect/intersect-rect.js"() {
+ // src/rendering-util/rendering-elements/shapes/anchor.ts
+ function anchor(parent4, node2) {
+ const { labelStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const classes3 = getNodeClasses(node2);
+ let cssClasses = classes3;
+ if (!classes3) {
+ cssClasses = "anchor";
+ }
+ const shapeSvg = parent4.insert("g").attr("class", cssClasses).attr("id", node2.domId || node2.id);
+ const radius2 = 1;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, { fill: "black", stroke: "none", fillStyle: "solid" });
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ }
+ const roughNode = rc.circle(0, 0, radius2 * 2, options3);
+ const circleElem = shapeSvg.insert(() => roughNode, ":first-child");
+ circleElem.attr("class", "anchor").attr("style", handleUndefinedAttr(cssStyles));
+ updateNodeBounds(node2, circleElem);
+ node2.intersect = function(point8) {
+ log.info("Circle intersect", node2, radius2, point8);
+ return intersect_default.circle(node2, radius2, point8);
+ };
+ return shapeSvg;
+ }
+ var init_anchor = __esm({
+ "src/rendering-util/rendering-elements/shapes/anchor.ts"() {
"use strict";
- intersectRect2 = /* @__PURE__ */ __name((node2, point8) => {
- var x5 = node2.x;
- var y5 = node2.y;
- var dx = point8.x - x5;
- var dy = point8.y - y5;
- var w3 = node2.width / 2;
- var h2 = node2.height / 2;
- var sx, sy;
- if (Math.abs(dy) * w3 > Math.abs(dx) * h2) {
- if (dy < 0) {
- h2 = -h2;
- }
- sx = dy === 0 ? 0 : h2 * dx / dy;
- sy = h2;
- } else {
- if (dx < 0) {
- w3 = -w3;
- }
- sx = w3;
- sy = dx === 0 ? 0 : w3 * dy / dx;
- }
- return { x: x5 + sx, y: y5 + sy };
- }, "intersectRect");
- intersect_rect_default2 = intersectRect2;
+ init_logger();
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_utils2();
+ __name(anchor, "anchor");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/bowTieRect.ts
+ function generateArcPoints(x1, y1, x22, y22, rx, ry, clockwise) {
+ const numPoints = 20;
+ const midX = (x1 + x22) / 2;
+ const midY = (y1 + y22) / 2;
+ const angle2 = Math.atan2(y22 - y1, x22 - x1);
+ const dx = (x22 - x1) / 2;
+ const dy = (y22 - y1) / 2;
+ const transformedX = dx / rx;
+ const transformedY = dy / ry;
+ const distance2 = Math.sqrt(transformedX ** 2 + transformedY ** 2);
+ if (distance2 > 1) {
+ throw new Error("The given radii are too small to create an arc between the points.");
+ }
+ const scaledCenterDistance = Math.sqrt(1 - distance2 ** 2);
+ const centerX = midX + scaledCenterDistance * ry * Math.sin(angle2) * (clockwise ? -1 : 1);
+ const centerY = midY - scaledCenterDistance * rx * Math.cos(angle2) * (clockwise ? -1 : 1);
+ const startAngle = Math.atan2((y1 - centerY) / ry, (x1 - centerX) / rx);
+ const endAngle = Math.atan2((y22 - centerY) / ry, (x22 - centerX) / rx);
+ let angleRange = endAngle - startAngle;
+ if (clockwise && angleRange < 0) {
+ angleRange += 2 * Math.PI;
+ }
+ if (!clockwise && angleRange > 0) {
+ angleRange -= 2 * Math.PI;
+ }
+ const points = [];
+ for (let i2 = 0; i2 < numPoints; i2++) {
+ const t4 = i2 / (numPoints - 1);
+ const angle3 = startAngle + t4 * angleRange;
+ const x5 = centerX + rx * Math.cos(angle3);
+ const y5 = centerY + ry * Math.sin(angle3);
+ points.push({ x: x5, y: y5 });
+ }
+ return points;
+ }
+ async function bowTieRect(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = bbox.width + node2.padding + 20;
+ const h2 = bbox.height + node2.padding;
+ const ry = h2 / 2;
+ const rx = ry / (2.5 + h2 / 50);
+ const { cssStyles } = node2;
+ const points = [
+ { x: w3 / 2, y: -h2 / 2 },
+ { x: -w3 / 2, y: -h2 / 2 },
+ ...generateArcPoints(-w3 / 2, -h2 / 2, -w3 / 2, h2 / 2, rx, ry, false),
+ { x: w3 / 2, y: h2 / 2 },
+ ...generateArcPoints(w3 / 2, h2 / 2, w3 / 2, -h2 / 2, rx, ry, true)
+ ];
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const bowTieRectPath = createPathFromPoints(points);
+ const bowTieRectShapePath = rc.path(bowTieRectPath, options3);
+ const bowTieRectShape = shapeSvg.insert(() => bowTieRectShapePath, ":first-child");
+ bowTieRectShape.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ bowTieRectShape.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ bowTieRectShape.selectAll("path").attr("style", nodeStyles);
+ }
+ bowTieRectShape.attr("transform", `translate(${rx / 2}, 0)`);
+ updateNodeBounds(node2, bowTieRectShape);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_bowTieRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/bowTieRect.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(generateArcPoints, "generateArcPoints");
+ __name(bowTieRect, "bowTieRect");
}
});
- // src/rendering-util/rendering-elements/createLabel.js
- function applyStyle3(dom, styleFn) {
- if (styleFn) {
- dom.attr("style", styleFn);
- }
- }
- async function addHtmlLabel2(node2) {
- const fo = select_default2(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"));
- const div = fo.append("xhtml:div");
- let label = node2.label;
- if (node2.label && hasKatex(node2.label)) {
- label = await renderKatex(node2.label.replace(common_default.lineBreakRegex, "\n"), getConfig2());
- }
- const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel";
- div.html(
- '" + label + " "
- );
- applyStyle3(div, node2.labelStyle);
- div.style("display", "inline-block");
- div.style("padding-right", "1px");
- div.style("white-space", "nowrap");
- div.attr("xmlns", "http://www.w3.org/1999/xhtml");
- return fo.node();
+ // src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts
+ function insertPolygonShape(parent4, w3, h2, points) {
+ return parent4.insert("polygon", ":first-child").attr(
+ "points",
+ points.map(function(d2) {
+ return d2.x + "," + d2.y;
+ }).join(" ")
+ ).attr("class", "label-container").attr("transform", "translate(" + -w3 / 2 + "," + h2 / 2 + ")");
}
- var createLabel2, createLabel_default2;
- var init_createLabel2 = __esm({
- "src/rendering-util/rendering-elements/createLabel.js"() {
+ var init_insertPolygonShape = __esm({
+ "src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts"() {
"use strict";
- init_src32();
- init_logger();
- init_diagramAPI();
- init_common();
- init_utils2();
- __name(applyStyle3, "applyStyle");
- __name(addHtmlLabel2, "addHtmlLabel");
- createLabel2 = /* @__PURE__ */ __name(async (_vertexText, style3, isTitle, isNode2) => {
- let vertexText = _vertexText || "";
- if (typeof vertexText === "object") {
- vertexText = vertexText[0];
- }
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- vertexText = vertexText.replace(/\\n|\n/g, " ");
- log.info("vertexText" + vertexText);
- const node2 = {
- isNode: isNode2,
- label: decodeEntities(vertexText).replace(
- /fa[blrs]?:fa-[\w-]+/g,
- (s2) => ` `
- ),
- labelStyle: style3 ? style3.replace("fill:", "color:") : style3
- };
- let vertexNode = await addHtmlLabel2(node2);
- return vertexNode;
- } else {
- const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
- svgLabel.setAttribute("style", style3.replace("color:", "fill:"));
- let rows = [];
- if (typeof vertexText === "string") {
- rows = vertexText.split(/\\n|\n| /gi);
- } else if (Array.isArray(vertexText)) {
- rows = vertexText;
- } else {
- rows = [];
- }
- for (const row of rows) {
- const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
- tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
- tspan.setAttribute("dy", "1em");
- tspan.setAttribute("x", "0");
- if (isTitle) {
- tspan.setAttribute("class", "title-row");
- } else {
- tspan.setAttribute("class", "row");
- }
- tspan.textContent = row.trim();
- svgLabel.appendChild(tspan);
- }
- return svgLabel;
- }
- }, "createLabel");
- createLabel_default2 = createLabel2;
+ __name(insertPolygonShape, "insertPolygonShape");
}
});
- // src/rendering-util/rendering-elements/shapes/roundedRectPath.ts
- var createRoundedRectPathD;
- var init_roundedRectPath = __esm({
- "src/rendering-util/rendering-elements/shapes/roundedRectPath.ts"() {
+ // src/rendering-util/rendering-elements/shapes/card.ts
+ async function card(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const h2 = bbox.height + node2.padding;
+ const padding2 = 12;
+ const w3 = bbox.width + node2.padding + padding2;
+ const left3 = 0;
+ const right3 = w3;
+ const top2 = -h2;
+ const bottom2 = 0;
+ const points = [
+ { x: left3 + padding2, y: top2 },
+ { x: right3, y: top2 },
+ { x: right3, y: bottom2 },
+ { x: left3, y: bottom2 },
+ { x: left3, y: top2 + padding2 },
+ { x: left3 + padding2, y: top2 }
+ ];
+ let polygon2;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const pathData = createPathFromPoints(points);
+ const roughNode = rc.path(pathData, options3);
+ polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
+ if (cssStyles) {
+ polygon2.attr("style", cssStyles);
+ }
+ } else {
+ polygon2 = insertPolygonShape(shapeSvg, w3, h2, points);
+ }
+ if (nodeStyles) {
+ polygon2.attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }
+ var init_card = __esm({
+ "src/rendering-util/rendering-elements/shapes/card.ts"() {
"use strict";
- createRoundedRectPathD = /* @__PURE__ */ __name((x5, y5, totalWidth, totalHeight, radius2) => [
- "M",
- x5 + radius2,
- y5,
- // Move to the first point
- "H",
- x5 + totalWidth - radius2,
- // Draw horizontal line to the beginning of the right corner
- "A",
- radius2,
- radius2,
- 0,
- 0,
- 1,
- x5 + totalWidth,
- y5 + radius2,
- // Draw arc to the right top corner
- "V",
- y5 + totalHeight - radius2,
- // Draw vertical line down to the beginning of the right bottom corner
- "A",
- radius2,
- radius2,
- 0,
- 0,
- 1,
- x5 + totalWidth - radius2,
- y5 + totalHeight,
- // Draw arc to the right bottom corner
- "H",
- x5 + radius2,
- // Draw horizontal line to the beginning of the left bottom corner
- "A",
- radius2,
- radius2,
- 0,
- 0,
- 1,
- x5,
- y5 + totalHeight - radius2,
- // Draw arc to the left bottom corner
- "V",
- y5 + radius2,
- // Draw vertical line up to the beginning of the left top corner
- "A",
- radius2,
- radius2,
- 0,
- 0,
- 1,
- x5 + radius2,
- y5,
- // Draw arc to the left top corner
- "Z"
- // Close the path
- ].join(" "), "createRoundedRectPathD");
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_insertPolygonShape();
+ init_util();
+ __name(card, "card");
}
});
- // src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts
- var solidStateFill, compileStyles, styles2Map, styles2String, userNodeOverrides;
- var init_handDrawnShapeStyles = __esm({
- "src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts"() {
+ // src/rendering-util/rendering-elements/shapes/choice.ts
+ function choice(parent4, node2) {
+ const { nodeStyles } = styles2String(node2);
+ node2.label = "";
+ const shapeSvg = parent4.insert("g").attr("class", getNodeClasses(node2)).attr("id", node2.domId ?? node2.id);
+ const { cssStyles } = node2;
+ const s2 = Math.max(28, node2.width ?? 0);
+ const points = [
+ { x: 0, y: s2 / 2 },
+ { x: s2 / 2, y: 0 },
+ { x: 0, y: -s2 / 2 },
+ { x: -s2 / 2, y: 0 }
+ ];
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const choicePath = createPathFromPoints(points);
+ const roughNode = rc.path(choicePath, options3);
+ const choiceShape = shapeSvg.insert(() => roughNode, ":first-child");
+ if (cssStyles && node2.look !== "handDrawn") {
+ choiceShape.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ choiceShape.selectAll("path").attr("style", nodeStyles);
+ }
+ node2.width = 28;
+ node2.height = 28;
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }
+ var init_choice = __esm({
+ "src/rendering-util/rendering-elements/shapes/choice.ts"() {
"use strict";
- init_diagramAPI();
- solidStateFill = /* @__PURE__ */ __name((color2) => {
- const { handDrawnSeed } = getConfig2();
- return {
- fill: color2,
- hachureAngle: 120,
- // angle of hachure,
- hachureGap: 4,
- fillWeight: 2,
- roughness: 0.7,
- stroke: color2,
- seed: handDrawnSeed
- };
- }, "solidStateFill");
- compileStyles = /* @__PURE__ */ __name((node2) => {
- const stylesMap = styles2Map([...node2.cssCompiledStyles || [], ...node2.cssStyles || []]);
- return { stylesMap, stylesArray: [...stylesMap] };
- }, "compileStyles");
- styles2Map = /* @__PURE__ */ __name((styles3) => {
- const styleMap2 = /* @__PURE__ */ new Map();
- styles3.forEach((style3) => {
- const [key, value2] = style3.split(":");
- styleMap2.set(key.trim(), value2?.trim());
- });
- return styleMap2;
- }, "styles2Map");
- styles2String = /* @__PURE__ */ __name((node2) => {
- const { stylesArray } = compileStyles(node2);
- const labelStyles = [];
- const nodeStyles = [];
- const borderStyles = [];
- const backgroundStyles = [];
- stylesArray.forEach((style3) => {
- const key = style3[0];
- if (key === "color" || key === "font-size" || key === "font-family" || key === "font-weight" || key === "font-style" || key === "text-decoration" || key === "text-align" || key === "text-transform" || key === "line-height" || key === "letter-spacing" || key === "word-spacing" || key === "text-shadow" || key === "text-overflow" || key === "white-space" || key === "word-wrap" || key === "word-break" || key === "overflow-wrap" || key === "hyphens") {
- labelStyles.push(style3.join(":") + " !important");
- } else {
- nodeStyles.push(style3.join(":") + " !important");
- if (key.includes("stroke")) {
- borderStyles.push(style3.join(":") + " !important");
- }
- if (key === "fill") {
- backgroundStyles.push(style3.join(":") + " !important");
- }
- }
- });
- return {
- labelStyles: labelStyles.join(";"),
- nodeStyles: nodeStyles.join(";"),
- stylesArray,
- borderStyles,
- backgroundStyles
- };
- }, "styles2String");
- userNodeOverrides = /* @__PURE__ */ __name((node2, options3) => {
- const { themeVariables, handDrawnSeed } = getConfig2();
- const { nodeBorder, mainBkg } = themeVariables;
- const { stylesMap } = compileStyles(node2);
- const result = Object.assign(
- {
- roughness: 0.7,
- fill: stylesMap.get("fill") || mainBkg,
- fillStyle: "hachure",
- // solid fill
- fillWeight: 4,
- stroke: stylesMap.get("stroke") || nodeBorder,
- seed: handDrawnSeed,
- strokeWidth: 1.3
- },
- options3
- );
- return result;
- }, "userNodeOverrides");
+ init_intersect();
+ init_rough_esm();
+ init_handDrawnShapeStyles();
+ init_util();
+ __name(choice, "choice");
}
});
- // src/rendering-util/rendering-elements/clusters.js
- var rect2, noteGroup, roundedWithTitle, divider, squareRect, shapes2, clusterElems, insertCluster, clear5;
- var init_clusters = __esm({
- "src/rendering-util/rendering-elements/clusters.js"() {
+ // src/rendering-util/rendering-elements/shapes/circle.ts
+ async function circle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, halfPadding } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const radius2 = bbox.width / 2 + halfPadding;
+ let circleElem;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const roughNode = rc.circle(0, 0, radius2 * 2, options3);
+ circleElem = shapeSvg.insert(() => roughNode, ":first-child");
+ circleElem.attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles));
+ } else {
+ circleElem = shapeSvg.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", nodeStyles).attr("r", radius2).attr("cx", 0).attr("cy", 0);
+ }
+ updateNodeBounds(node2, circleElem);
+ node2.intersect = function(point8) {
+ log.info("Circle intersect", node2, radius2, point8);
+ return intersect_default.circle(node2, radius2, point8);
+ };
+ return shapeSvg;
+ }
+ var init_circle = __esm({
+ "src/rendering-util/rendering-elements/shapes/circle.ts"() {
"use strict";
- init_diagramAPI();
- init_common();
init_logger();
- init_subGraphTitleMargins();
- init_src32();
- init_rough_esm();
- init_createText();
- init_intersect_rect2();
- init_createLabel2();
- init_roundedRectPath();
+ init_util();
+ init_intersect();
init_handDrawnShapeStyles();
- rect2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- log.info("Creating subgraph rect for ", node2.id, node2);
- const siteConfig2 = getConfig2();
- const { themeVariables, handDrawnSeed } = siteConfig2;
- const { clusterBkg, clusterBorder } = themeVariables;
- const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node2);
- const shapeSvg = parent4.insert("g").attr("class", "cluster " + node2.cssClasses).attr("id", node2.id).attr("data-look", node2.look);
- const useHtmlLabels = evaluate(siteConfig2.flowchart.htmlLabels);
- const labelEl = shapeSvg.insert("g").attr("class", "cluster-label ");
- const text2 = await createText(labelEl, node2.label, {
- style: node2.labelStyle,
- useHtmlLabels,
- isNode: true
- });
- let bbox = text2.getBBox();
- if (evaluate(siteConfig2.flowchart.htmlLabels)) {
- const div = text2.children[0];
- const dv = select_default2(text2);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- const width3 = node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width;
- if (node2.width <= bbox.width + node2.padding) {
- node2.diff = (width3 - node2.width) / 2 - node2.padding;
- } else {
- node2.diff = -node2.padding;
- }
- const height2 = node2.height;
- const x5 = node2.x - width3 / 2;
- const y5 = node2.y - height2 / 2;
- log.trace("Data ", node2, JSON.stringify(node2));
- let rect4;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {
- roughness: 0.7,
- fill: clusterBkg,
- // fill: 'red',
- stroke: clusterBorder,
- fillWeight: 3,
- seed: handDrawnSeed
- });
- const roughNode = rc.path(createRoundedRectPathD(x5, y5, width3, height2, 0), options3);
- rect4 = shapeSvg.insert(() => {
- log.debug("Rough node insert CXC", roughNode);
- return roughNode;
- }, ":first-child");
- rect4.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
- rect4.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
- } else {
- rect4 = shapeSvg.insert("rect", ":first-child");
- rect4.attr("style", nodeStyles).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
- }
- const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2);
- labelEl.attr(
- "transform",
- // This puts the label on top of the box instead of inside it
- `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})`
- );
- if (labelStyles) {
- const span = labelEl.select("span");
- if (span) {
- span.attr("style", labelStyles);
- }
- }
- const rectBox = rect4.node().getBBox();
- node2.offsetX = 0;
- node2.width = rectBox.width;
- node2.height = rectBox.height;
- node2.offsetY = bbox.height - node2.padding / 2;
- node2.intersect = function(point8) {
- return intersect_rect_default2(node2, point8);
- };
- return { cluster: shapeSvg, labelBBox: bbox };
- }, "rect");
- noteGroup = /* @__PURE__ */ __name((parent4, node2) => {
- const shapeSvg = parent4.insert("g").attr("class", "note-cluster").attr("id", node2.id);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const padding3 = 0 * node2.padding;
- const halfPadding = padding3 / 2;
- rect4.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", node2.width + padding3).attr("height", node2.height + padding3).attr("fill", "none");
- const rectBox = rect4.node().getBBox();
- node2.width = rectBox.width;
- node2.height = rectBox.height;
- node2.intersect = function(point8) {
- return intersect_rect_default2(node2, point8);
- };
- return { cluster: shapeSvg, labelBBox: { width: 0, height: 0 } };
- }, "noteGroup");
- roundedWithTitle = /* @__PURE__ */ __name(async (parent4, node2) => {
- const siteConfig2 = getConfig2();
- const { themeVariables, handDrawnSeed } = siteConfig2;
- const { altBackground, compositeBackground, compositeTitleBackground, nodeBorder } = themeVariables;
- const shapeSvg = parent4.insert("g").attr("class", node2.cssClasses).attr("id", node2.id).attr("data-id", node2.id).attr("data-look", node2.look);
- const outerRectG = shapeSvg.insert("g", ":first-child");
- const label = shapeSvg.insert("g").attr("class", "cluster-label");
- let innerRect = shapeSvg.append("rect");
- const text2 = label.node().appendChild(await createLabel_default2(node2.label, node2.labelStyle, void 0, true));
- let bbox = text2.getBBox();
- if (evaluate(siteConfig2.flowchart.htmlLabels)) {
- const div = text2.children[0];
- const dv = select_default2(text2);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- const padding3 = 0 * node2.padding;
- const halfPadding = padding3 / 2;
- const width3 = (node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width) + padding3;
- if (node2.width <= bbox.width + node2.padding) {
- node2.diff = (width3 - node2.width) / 2 - node2.padding;
- } else {
- node2.diff = -node2.padding;
- }
- const height2 = node2.height + padding3;
- const innerHeight = node2.height + padding3 - bbox.height - 6;
- const x5 = node2.x - width3 / 2;
- const y5 = node2.y - height2 / 2;
- node2.width = width3;
- const innerY = node2.y - node2.height / 2 - halfPadding + bbox.height + 2;
- let rect4;
- if (node2.look === "handDrawn") {
- const isAlt = node2.cssClasses.includes("statediagram-cluster-alt");
- const rc = at.svg(shapeSvg);
- const roughOuterNode = node2.rx || node2.ry ? rc.path(createRoundedRectPathD(x5, y5, width3, height2, 10), {
- roughness: 0.7,
- fill: compositeTitleBackground,
- fillStyle: "solid",
- stroke: nodeBorder,
- seed: handDrawnSeed
- }) : rc.rectangle(x5, y5, width3, height2, { seed: handDrawnSeed });
- rect4 = shapeSvg.insert(() => roughOuterNode, ":first-child");
- const roughInnerNode = rc.rectangle(x5, innerY, width3, innerHeight, {
- fill: isAlt ? altBackground : compositeBackground,
- fillStyle: isAlt ? "hachure" : "solid",
- stroke: nodeBorder,
- seed: handDrawnSeed
- });
- rect4 = shapeSvg.insert(() => roughOuterNode, ":first-child");
- innerRect = shapeSvg.insert(() => roughInnerNode);
- } else {
- rect4 = outerRectG.insert("rect", ":first-child");
- const outerRectClass = "outer";
- rect4.attr("class", outerRectClass).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("data-look", node2.look);
- innerRect.attr("class", "inner").attr("x", x5).attr("y", innerY).attr("width", width3).attr("height", innerHeight);
- }
- label.attr(
- "transform",
- `translate(${node2.x - bbox.width / 2}, ${y5 + 1 - (evaluate(siteConfig2.flowchart.htmlLabels) ? 0 : 3)})`
- );
- const rectBox = rect4.node().getBBox();
- node2.height = rectBox.height;
- node2.offsetX = 0;
- node2.offsetY = bbox.height - node2.padding / 2;
- node2.labelBBox = bbox;
- node2.intersect = function(point8) {
- return intersect_rect_default2(node2, point8);
- };
- return { cluster: shapeSvg, labelBBox: bbox };
- }, "roundedWithTitle");
- divider = /* @__PURE__ */ __name((parent4, node2) => {
- const siteConfig2 = getConfig2();
- const { themeVariables, handDrawnSeed } = siteConfig2;
- const { nodeBorder } = themeVariables;
- const shapeSvg = parent4.insert("g").attr("class", node2.cssClasses).attr("id", node2.id).attr("data-look", node2.look);
- const outerRectG = shapeSvg.insert("g", ":first-child");
- const padding3 = 0 * node2.padding;
- const width3 = node2.width + padding3;
- node2.diff = -node2.padding;
- const height2 = node2.height + padding3;
- const x5 = node2.x - width3 / 2;
- const y5 = node2.y - height2 / 2;
- node2.width = width3;
- let rect4;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const roughOuterNode = rc.rectangle(x5, y5, width3, height2, {
- fill: "lightgrey",
- roughness: 0.5,
- strokeLineDash: [5],
- stroke: nodeBorder,
- seed: handDrawnSeed
- });
- rect4 = shapeSvg.insert(() => roughOuterNode, ":first-child");
- } else {
- rect4 = outerRectG.insert("rect", ":first-child");
- const outerRectClass = "divider";
- rect4.attr("class", outerRectClass).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("data-look", node2.look);
- }
- const rectBox = rect4.node().getBBox();
- node2.height = rectBox.height;
- node2.offsetX = 0;
- node2.offsetY = 0;
- node2.intersect = function(point8) {
- return intersect_rect_default2(node2, point8);
- };
- return { cluster: shapeSvg, labelBBox: {} };
- }, "divider");
- squareRect = rect2;
- shapes2 = {
- rect: rect2,
- squareRect,
- roundedWithTitle,
- noteGroup,
- divider
- };
- clusterElems = /* @__PURE__ */ new Map();
- insertCluster = /* @__PURE__ */ __name(async (elem, node2) => {
- const shape = node2.shape || "rect";
- const cluster = await shapes2[shape](elem, node2);
- clusterElems.set(node2.id, cluster);
- return cluster;
- }, "insertCluster");
- clear5 = /* @__PURE__ */ __name(() => {
- clusterElems = /* @__PURE__ */ new Map();
- }, "clear");
- }
- });
-
- // src/utils/lineWithOffset.ts
- function calculateDeltaAndAngle(point1, point22) {
- if (point1 === void 0 || point22 === void 0) {
- return { angle: 0, deltaX: 0, deltaY: 0 };
- }
- point1 = pointTransformer(point1);
- point22 = pointTransformer(point22);
- const [x1, y1] = [point1.x, point1.y];
- const [x22, y22] = [point22.x, point22.y];
- const deltaX = x22 - x1;
- const deltaY = y22 - y1;
- return { angle: Math.atan(deltaY / deltaX), deltaX, deltaY };
+ init_rough_esm();
+ init_utils2();
+ __name(circle, "circle");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/crossedCircle.ts
+ function createLine(r2) {
+ const xAxis45 = Math.cos(Math.PI / 4);
+ const yAxis45 = Math.sin(Math.PI / 4);
+ const lineLength = r2 * 2;
+ const pointQ1 = { x: lineLength / 2 * xAxis45, y: lineLength / 2 * yAxis45 };
+ const pointQ2 = { x: -(lineLength / 2) * xAxis45, y: lineLength / 2 * yAxis45 };
+ const pointQ3 = { x: -(lineLength / 2) * xAxis45, y: -(lineLength / 2) * yAxis45 };
+ const pointQ4 = { x: lineLength / 2 * xAxis45, y: -(lineLength / 2) * yAxis45 };
+ return `M ${pointQ2.x},${pointQ2.y} L ${pointQ4.x},${pointQ4.y}
+ M ${pointQ1.x},${pointQ1.y} L ${pointQ3.x},${pointQ3.y}`;
+ }
+ function crossedCircle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ node2.label = "";
+ const shapeSvg = parent4.insert("g").attr("class", getNodeClasses(node2)).attr("id", node2.domId ?? node2.id);
+ const radius2 = Math.max(30, node2?.width ?? 0);
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const circleNode = rc.circle(0, 0, radius2 * 2, options3);
+ const linePath = createLine(radius2);
+ const lineNode = rc.path(linePath, options3);
+ const crossedCircle2 = shapeSvg.insert(() => circleNode, ":first-child");
+ crossedCircle2.insert(() => lineNode);
+ if (cssStyles && node2.look !== "handDrawn") {
+ crossedCircle2.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ crossedCircle2.selectAll("path").attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, crossedCircle2);
+ node2.intersect = function(point8) {
+ log.info("crossedCircle intersect", node2, { radius: radius2, point: point8 });
+ const pos = intersect_default.circle(node2, radius2, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var markerOffsets, pointTransformer, getLineFunctionsWithOffset;
- var init_lineWithOffset = __esm({
- "src/utils/lineWithOffset.ts"() {
+ var init_crossedCircle = __esm({
+ "src/rendering-util/rendering-elements/shapes/crossedCircle.ts"() {
"use strict";
- markerOffsets = {
- aggregation: 18,
- extension: 18,
- composition: 18,
- dependency: 6,
- lollipop: 13.5,
- arrow_point: 4
- };
- __name(calculateDeltaAndAngle, "calculateDeltaAndAngle");
- pointTransformer = /* @__PURE__ */ __name((data5) => {
- if (Array.isArray(data5)) {
- return { x: data5[0], y: data5[1] };
- }
- return data5;
- }, "pointTransformer");
- getLineFunctionsWithOffset = /* @__PURE__ */ __name((edge) => {
- return {
- x: /* @__PURE__ */ __name(function(d2, i2, data5) {
- let offset = 0;
- if (i2 === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
- const { angle: angle2, deltaX } = calculateDeltaAndAngle(data5[0], data5[1]);
- offset = markerOffsets[edge.arrowTypeStart] * Math.cos(angle2) * (deltaX >= 0 ? 1 : -1);
- } else if (i2 === data5.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
- const { angle: angle2, deltaX } = calculateDeltaAndAngle(
- data5[data5.length - 1],
- data5[data5.length - 2]
- );
- offset = markerOffsets[edge.arrowTypeEnd] * Math.cos(angle2) * (deltaX >= 0 ? 1 : -1);
- }
- return pointTransformer(d2).x + offset;
- }, "x"),
- y: /* @__PURE__ */ __name(function(d2, i2, data5) {
- let offset = 0;
- if (i2 === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
- const { angle: angle2, deltaY } = calculateDeltaAndAngle(data5[0], data5[1]);
- offset = markerOffsets[edge.arrowTypeStart] * Math.abs(Math.sin(angle2)) * (deltaY >= 0 ? 1 : -1);
- } else if (i2 === data5.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
- const { angle: angle2, deltaY } = calculateDeltaAndAngle(
- data5[data5.length - 1],
- data5[data5.length - 2]
- );
- offset = markerOffsets[edge.arrowTypeEnd] * Math.abs(Math.sin(angle2)) * (deltaY >= 0 ? 1 : -1);
- }
- return pointTransformer(d2).y + offset;
- }, "y")
- };
- }, "getLineFunctionsWithOffset");
- if (void 0) {
- const { it, expect, describe } = void 0;
- describe("calculateDeltaAndAngle", () => {
- it("should calculate the angle and deltas between two points", () => {
- expect(calculateDeltaAndAngle([0, 0], [0, 1])).toStrictEqual({
- angle: 1.5707963267948966,
- deltaX: 0,
- deltaY: 1
- });
- expect(calculateDeltaAndAngle([1, 0], [0, -1])).toStrictEqual({
- angle: 0.7853981633974483,
- deltaX: -1,
- deltaY: -1
- });
- expect(calculateDeltaAndAngle({ x: 1, y: 0 }, [0, -1])).toStrictEqual({
- angle: 0.7853981633974483,
- deltaX: -1,
- deltaY: -1
- });
- expect(calculateDeltaAndAngle({ x: 1, y: 0 }, { x: 1, y: 0 })).toStrictEqual({
- angle: NaN,
- deltaX: 0,
- deltaY: 0
- });
- });
- it("should calculate the angle and deltas if one point in undefined", () => {
- expect(calculateDeltaAndAngle(void 0, [0, 1])).toStrictEqual({
- angle: 0,
- deltaX: 0,
- deltaY: 0
- });
- expect(calculateDeltaAndAngle([0, 1], void 0)).toStrictEqual({
- angle: 0,
- deltaX: 0,
- deltaY: 0
- });
- });
- });
- }
+ init_logger();
+ init_util();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_intersect();
+ __name(createLine, "createLine");
+ __name(crossedCircle, "crossedCircle");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/curlyBraceLeft.ts
+ function generateCirclePoints2(centerX, centerY, radius2, numPoints = 100, startAngle = 0, endAngle = 180) {
+ const points = [];
+ const startAngleRad = startAngle * Math.PI / 180;
+ const endAngleRad = endAngle * Math.PI / 180;
+ const angleRange = endAngleRad - startAngleRad;
+ const angleStep = angleRange / (numPoints - 1);
+ for (let i2 = 0; i2 < numPoints; i2++) {
+ const angle2 = startAngleRad + i2 * angleStep;
+ const x5 = centerX + radius2 * Math.cos(angle2);
+ const y5 = centerY + radius2 * Math.sin(angle2);
+ points.push({ x: -x5, y: -y5 });
+ }
+ return points;
+ }
+ async function curlyBraceLeft(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = bbox.width + (node2.padding ?? 0);
+ const h2 = bbox.height + (node2.padding ?? 0);
+ const radius2 = Math.max(5, h2 * 0.1);
+ const { cssStyles } = node2;
+ const points = [
+ ...generateCirclePoints2(w3 / 2, -h2 / 2, radius2, 30, -90, 0),
+ { x: -w3 / 2 - radius2, y: radius2 },
+ ...generateCirclePoints2(w3 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
+ ...generateCirclePoints2(w3 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
+ { x: -w3 / 2 - radius2, y: -h2 / 2 },
+ ...generateCirclePoints2(w3 / 2, h2 / 2, radius2, 20, 0, 90)
+ ];
+ const rectPoints = [
+ { x: w3 / 2, y: -h2 / 2 - radius2 },
+ { x: -w3 / 2, y: -h2 / 2 - radius2 },
+ ...generateCirclePoints2(w3 / 2, -h2 / 2, radius2, 20, -90, 0),
+ { x: -w3 / 2 - radius2, y: -radius2 },
+ ...generateCirclePoints2(w3 / 2 + w3 * 0.1, -radius2, radius2, 20, -180, -270),
+ ...generateCirclePoints2(w3 / 2 + w3 * 0.1, radius2, radius2, 20, -90, -180),
+ { x: -w3 / 2 - radius2, y: h2 / 2 },
+ ...generateCirclePoints2(w3 / 2, h2 / 2, radius2, 20, 0, 90),
+ { x: -w3 / 2, y: h2 / 2 + radius2 },
+ { x: w3 / 2, y: h2 / 2 + radius2 }
+ ];
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, { fill: "none" });
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const curlyBraceLeftPath = createPathFromPoints(points);
+ const newCurlyBracePath = curlyBraceLeftPath.replace("Z", "");
+ const curlyBraceLeftNode = rc.path(newCurlyBracePath, options3);
+ const rectPath = createPathFromPoints(rectPoints);
+ const rectShape = rc.path(rectPath, { ...options3 });
+ const curlyBraceLeftShape = shapeSvg.insert("g", ":first-child");
+ curlyBraceLeftShape.insert(() => rectShape, ":first-child").attr("stroke-opacity", 0);
+ curlyBraceLeftShape.insert(() => curlyBraceLeftNode, ":first-child");
+ curlyBraceLeftShape.attr("class", "text");
+ if (cssStyles && node2.look !== "handDrawn") {
+ curlyBraceLeftShape.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ curlyBraceLeftShape.selectAll("path").attr("style", nodeStyles);
+ }
+ curlyBraceLeftShape.attr("transform", `translate(${radius2}, 0)`);
+ label.attr(
+ "transform",
+ `translate(${-w3 / 2 + radius2 - (bbox.x - (bbox.left ?? 0))},${-h2 / 2 + (node2.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, curlyBraceLeftShape);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, rectPoints, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_curlyBraceLeft = __esm({
+ "src/rendering-util/rendering-elements/shapes/curlyBraceLeft.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(generateCirclePoints2, "generateCirclePoints");
+ __name(curlyBraceLeft, "curlyBraceLeft");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/curlyBraceRight.ts
+ function generateCirclePoints3(centerX, centerY, radius2, numPoints = 100, startAngle = 0, endAngle = 180) {
+ const points = [];
+ const startAngleRad = startAngle * Math.PI / 180;
+ const endAngleRad = endAngle * Math.PI / 180;
+ const angleRange = endAngleRad - startAngleRad;
+ const angleStep = angleRange / (numPoints - 1);
+ for (let i2 = 0; i2 < numPoints; i2++) {
+ const angle2 = startAngleRad + i2 * angleStep;
+ const x5 = centerX + radius2 * Math.cos(angle2);
+ const y5 = centerY + radius2 * Math.sin(angle2);
+ points.push({ x: x5, y: y5 });
+ }
+ return points;
+ }
+ async function curlyBraceRight(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = bbox.width + (node2.padding ?? 0);
+ const h2 = bbox.height + (node2.padding ?? 0);
+ const radius2 = Math.max(5, h2 * 0.1);
+ const { cssStyles } = node2;
+ const points = [
+ ...generateCirclePoints3(w3 / 2, -h2 / 2, radius2, 20, -90, 0),
+ { x: w3 / 2 + radius2, y: -radius2 },
+ ...generateCirclePoints3(w3 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
+ ...generateCirclePoints3(w3 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
+ { x: w3 / 2 + radius2, y: h2 / 2 },
+ ...generateCirclePoints3(w3 / 2, h2 / 2, radius2, 20, 0, 90)
+ ];
+ const rectPoints = [
+ { x: -w3 / 2, y: -h2 / 2 - radius2 },
+ { x: w3 / 2, y: -h2 / 2 - radius2 },
+ ...generateCirclePoints3(w3 / 2, -h2 / 2, radius2, 20, -90, 0),
+ { x: w3 / 2 + radius2, y: -radius2 },
+ ...generateCirclePoints3(w3 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
+ ...generateCirclePoints3(w3 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
+ { x: w3 / 2 + radius2, y: h2 / 2 },
+ ...generateCirclePoints3(w3 / 2, h2 / 2, radius2, 20, 0, 90),
+ { x: w3 / 2, y: h2 / 2 + radius2 },
+ { x: -w3 / 2, y: h2 / 2 + radius2 }
+ ];
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, { fill: "none" });
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const curlyBraceRightPath = createPathFromPoints(points);
+ const newCurlyBracePath = curlyBraceRightPath.replace("Z", "");
+ const curlyBraceRightNode = rc.path(newCurlyBracePath, options3);
+ const rectPath = createPathFromPoints(rectPoints);
+ const rectShape = rc.path(rectPath, { ...options3 });
+ const curlyBraceRightShape = shapeSvg.insert("g", ":first-child");
+ curlyBraceRightShape.insert(() => rectShape, ":first-child").attr("stroke-opacity", 0);
+ curlyBraceRightShape.insert(() => curlyBraceRightNode, ":first-child");
+ curlyBraceRightShape.attr("class", "text");
+ if (cssStyles && node2.look !== "handDrawn") {
+ curlyBraceRightShape.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ curlyBraceRightShape.selectAll("path").attr("style", nodeStyles);
+ }
+ curlyBraceRightShape.attr("transform", `translate(${-radius2}, 0)`);
+ label.attr(
+ "transform",
+ `translate(${-w3 / 2 + (node2.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h2 / 2 + (node2.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, curlyBraceRightShape);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, rectPoints, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_curlyBraceRight = __esm({
+ "src/rendering-util/rendering-elements/shapes/curlyBraceRight.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(generateCirclePoints3, "generateCirclePoints");
+ __name(curlyBraceRight, "curlyBraceRight");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/curlyBraces.ts
+ function generateCirclePoints4(centerX, centerY, radius2, numPoints = 100, startAngle = 0, endAngle = 180) {
+ const points = [];
+ const startAngleRad = startAngle * Math.PI / 180;
+ const endAngleRad = endAngle * Math.PI / 180;
+ const angleRange = endAngleRad - startAngleRad;
+ const angleStep = angleRange / (numPoints - 1);
+ for (let i2 = 0; i2 < numPoints; i2++) {
+ const angle2 = startAngleRad + i2 * angleStep;
+ const x5 = centerX + radius2 * Math.cos(angle2);
+ const y5 = centerY + radius2 * Math.sin(angle2);
+ points.push({ x: -x5, y: -y5 });
+ }
+ return points;
+ }
+ async function curlyBraces(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = bbox.width + (node2.padding ?? 0);
+ const h2 = bbox.height + (node2.padding ?? 0);
+ const radius2 = Math.max(5, h2 * 0.1);
+ const { cssStyles } = node2;
+ const leftCurlyBracePoints = [
+ ...generateCirclePoints4(w3 / 2, -h2 / 2, radius2, 30, -90, 0),
+ { x: -w3 / 2 - radius2, y: radius2 },
+ ...generateCirclePoints4(w3 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
+ ...generateCirclePoints4(w3 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
+ { x: -w3 / 2 - radius2, y: -h2 / 2 },
+ ...generateCirclePoints4(w3 / 2, h2 / 2, radius2, 20, 0, 90)
+ ];
+ const rightCurlyBracePoints = [
+ ...generateCirclePoints4(-w3 / 2 + radius2 + radius2 / 2, -h2 / 2, radius2, 20, -90, -180),
+ { x: w3 / 2 - radius2 / 2, y: radius2 },
+ ...generateCirclePoints4(-w3 / 2 - radius2 / 2, -radius2, radius2, 20, 0, 90),
+ ...generateCirclePoints4(-w3 / 2 - radius2 / 2, radius2, radius2, 20, -90, 0),
+ { x: w3 / 2 - radius2 / 2, y: -radius2 },
+ ...generateCirclePoints4(-w3 / 2 + radius2 + radius2 / 2, h2 / 2, radius2, 30, -180, -270)
+ ];
+ const rectPoints = [
+ { x: w3 / 2, y: -h2 / 2 - radius2 },
+ { x: -w3 / 2, y: -h2 / 2 - radius2 },
+ ...generateCirclePoints4(w3 / 2, -h2 / 2, radius2, 20, -90, 0),
+ { x: -w3 / 2 - radius2, y: -radius2 },
+ ...generateCirclePoints4(w3 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
+ ...generateCirclePoints4(w3 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
+ { x: -w3 / 2 - radius2, y: h2 / 2 },
+ ...generateCirclePoints4(w3 / 2, h2 / 2, radius2, 20, 0, 90),
+ { x: -w3 / 2, y: h2 / 2 + radius2 },
+ { x: w3 / 2 - radius2 - radius2 / 2, y: h2 / 2 + radius2 },
+ ...generateCirclePoints4(-w3 / 2 + radius2 + radius2 / 2, -h2 / 2, radius2, 20, -90, -180),
+ { x: w3 / 2 - radius2 / 2, y: radius2 },
+ ...generateCirclePoints4(-w3 / 2 - radius2 / 2, -radius2, radius2, 20, 0, 90),
+ ...generateCirclePoints4(-w3 / 2 - radius2 / 2, radius2, radius2, 20, -90, 0),
+ { x: w3 / 2 - radius2 / 2, y: -radius2 },
+ ...generateCirclePoints4(-w3 / 2 + radius2 + radius2 / 2, h2 / 2, radius2, 30, -180, -270)
+ ];
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, { fill: "none" });
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const leftCurlyBracePath = createPathFromPoints(leftCurlyBracePoints);
+ const newLeftCurlyBracePath = leftCurlyBracePath.replace("Z", "");
+ const leftCurlyBraceNode = rc.path(newLeftCurlyBracePath, options3);
+ const rightCurlyBracePath = createPathFromPoints(rightCurlyBracePoints);
+ const newRightCurlyBracePath = rightCurlyBracePath.replace("Z", "");
+ const rightCurlyBraceNode = rc.path(newRightCurlyBracePath, options3);
+ const rectPath = createPathFromPoints(rectPoints);
+ const rectShape = rc.path(rectPath, { ...options3 });
+ const curlyBracesShape = shapeSvg.insert("g", ":first-child");
+ curlyBracesShape.insert(() => rectShape, ":first-child").attr("stroke-opacity", 0);
+ curlyBracesShape.insert(() => leftCurlyBraceNode, ":first-child");
+ curlyBracesShape.insert(() => rightCurlyBraceNode, ":first-child");
+ curlyBracesShape.attr("class", "text");
+ if (cssStyles && node2.look !== "handDrawn") {
+ curlyBracesShape.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ curlyBracesShape.selectAll("path").attr("style", nodeStyles);
+ }
+ curlyBracesShape.attr("transform", `translate(${radius2 - radius2 / 4}, 0)`);
+ label.attr(
+ "transform",
+ `translate(${-w3 / 2 + (node2.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h2 / 2 + (node2.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, curlyBracesShape);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, rectPoints, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_curlyBraces = __esm({
+ "src/rendering-util/rendering-elements/shapes/curlyBraces.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(generateCirclePoints4, "generateCirclePoints");
+ __name(curlyBraces, "curlyBraces");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/curvedTrapezoid.ts
+ async function curvedTrapezoid(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const minWidth = 80, minHeight = 20;
+ const w3 = Math.max(minWidth, (bbox.width + (node2.padding ?? 0) * 2) * 1.25, node2?.width ?? 0);
+ const h2 = Math.max(minHeight, bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const radius2 = h2 / 2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const totalWidth = w3, totalHeight = h2;
+ const rw = totalWidth - radius2;
+ const tw = totalHeight / 4;
+ const points = [
+ { x: rw, y: 0 },
+ { x: tw, y: 0 },
+ { x: 0, y: totalHeight / 2 },
+ { x: tw, y: totalHeight },
+ { x: rw, y: totalHeight },
+ ...generateCirclePoints(-rw, -totalHeight / 2, radius2, 50, 270, 90)
+ ];
+ const pathData = createPathFromPoints(points);
+ const shapeNode = rc.path(pathData, options3);
+ const polygon2 = shapeSvg.insert(() => shapeNode, ":first-child");
+ polygon2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", nodeStyles);
+ }
+ polygon2.attr("transform", `translate(${-w3 / 2}, ${-h2 / 2})`);
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_curvedTrapezoid = __esm({
+ "src/rendering-util/rendering-elements/shapes/curvedTrapezoid.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(curvedTrapezoid, "curvedTrapezoid");
}
});
- // src/rendering-util/rendering-elements/edgeMarker.ts
- var addEdgeMarkers, arrowTypesMap, addEdgeMarker;
- var init_edgeMarker = __esm({
- "src/rendering-util/rendering-elements/edgeMarker.ts"() {
- "use strict";
- init_logger();
- addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id27, diagramType) => {
- if (edge.arrowTypeStart) {
- addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id27, diagramType);
- }
- if (edge.arrowTypeEnd) {
- addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id27, diagramType);
+ // src/rendering-util/rendering-elements/shapes/cylinder.ts
+ async function cylinder(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + node2.padding, node2.width ?? 0);
+ const rx = w3 / 2;
+ const ry = rx / (2.5 + w3 / 50);
+ const h2 = Math.max(bbox.height + ry + node2.padding, node2.height ?? 0);
+ let cylinder3;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const outerPathData = createOuterCylinderPathD(0, 0, w3, h2, rx, ry);
+ const innerPathData = createInnerCylinderPathD(0, ry, w3, h2, rx, ry);
+ const outerNode = rc.path(outerPathData, userNodeOverrides(node2, {}));
+ const innerLine = rc.path(innerPathData, userNodeOverrides(node2, { fill: "none" }));
+ cylinder3 = shapeSvg.insert(() => innerLine, ":first-child");
+ cylinder3 = shapeSvg.insert(() => outerNode, ":first-child");
+ cylinder3.attr("class", "basic label-container");
+ if (cssStyles) {
+ cylinder3.attr("style", cssStyles);
+ }
+ } else {
+ const pathData = createCylinderPathD(0, 0, w3, h2, rx, ry);
+ cylinder3 = shapeSvg.insert("path", ":first-child").attr("d", pathData).attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles)).attr("style", nodeStyles);
+ }
+ cylinder3.attr("label-offset-y", ry);
+ cylinder3.attr("transform", `translate(${-w3 / 2}, ${-(h2 / 2 + ry)})`);
+ updateNodeBounds(node2, cylinder3);
+ label.attr(
+ "transform",
+ `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + (node2.padding ?? 0) / 1.5 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ node2.intersect = function(point8) {
+ const pos = intersect_default.rect(node2, point8);
+ const x5 = pos.x - (node2.x ?? 0);
+ if (rx != 0 && (Math.abs(x5) < (node2.width ?? 0) / 2 || Math.abs(x5) == (node2.width ?? 0) / 2 && Math.abs(pos.y - (node2.y ?? 0)) > (node2.height ?? 0) / 2 - ry)) {
+ let y5 = ry * ry * (1 - x5 * x5 / (rx * rx));
+ if (y5 > 0) {
+ y5 = Math.sqrt(y5);
}
- }, "addEdgeMarkers");
- arrowTypesMap = {
- arrow_cross: "cross",
- arrow_point: "point",
- arrow_barb: "barb",
- arrow_circle: "circle",
- aggregation: "aggregation",
- extension: "extension",
- composition: "composition",
- dependency: "dependency",
- lollipop: "lollipop"
- };
- addEdgeMarker = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id27, diagramType) => {
- const endMarkerType = arrowTypesMap[arrowType];
- if (!endMarkerType) {
- log.warn(`Unknown arrow type: ${arrowType}`);
- return;
+ y5 = ry - y5;
+ if (point8.y - (node2.y ?? 0) > 0) {
+ y5 = -y5;
}
- const suffix = position5 === "start" ? "Start" : "End";
- svgPath.attr(`marker-${position5}`, `url(${url}#${id27}_${diagramType}-${endMarkerType}${suffix})`);
- }, "addEdgeMarker");
+ pos.y += y5;
+ }
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var createCylinderPathD, createOuterCylinderPathD, createInnerCylinderPathD;
+ var init_cylinder = __esm({
+ "src/rendering-util/rendering-elements/shapes/cylinder.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_utils2();
+ createCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ return [
+ `M${x5},${y5 + ry}`,
+ `a${rx},${ry} 0,0,0 ${width3},0`,
+ `a${rx},${ry} 0,0,0 ${-width3},0`,
+ `l0,${height2}`,
+ `a${rx},${ry} 0,0,0 ${width3},0`,
+ `l0,${-height2}`
+ ].join(" ");
+ }, "createCylinderPathD");
+ createOuterCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ return [
+ `M${x5},${y5 + ry}`,
+ `M${x5 + width3},${y5 + ry}`,
+ `a${rx},${ry} 0,0,0 ${-width3},0`,
+ `l0,${height2}`,
+ `a${rx},${ry} 0,0,0 ${width3},0`,
+ `l0,${-height2}`
+ ].join(" ");
+ }, "createOuterCylinderPathD");
+ createInnerCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ return [`M${x5 - width3 / 2},${-height2 / 2}`, `a${rx},${ry} 0,0,0 ${width3},0`].join(" ");
+ }, "createInnerCylinderPathD");
+ __name(cylinder, "cylinder");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/dividedRect.ts
+ async function dividedRectangle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const rectOffset = h2 * 0.2;
+ const x5 = -w3 / 2;
+ const y5 = -h2 / 2 - rectOffset / 2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const pts2 = [
+ { x: x5, y: y5 + rectOffset },
+ { x: -x5, y: y5 + rectOffset },
+ { x: -x5, y: -y5 },
+ { x: x5, y: -y5 },
+ { x: x5, y: y5 },
+ { x: -x5, y: y5 },
+ { x: -x5, y: y5 + rectOffset }
+ ];
+ const poly = rc.polygon(
+ pts2.map((p3) => [p3.x, p3.y]),
+ options3
+ );
+ const polygon2 = shapeSvg.insert(() => poly, ":first-child");
+ polygon2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ polygon2.selectAll("path").attr("style", cssStyles);
}
- });
-
- // src/rendering-util/rendering-elements/edges.js
- function setTerminalWidth(fo, value2) {
- if (getConfig2().flowchart.htmlLabels && fo) {
- fo.style.width = value2.length * 9 + "px";
- fo.style.height = "12px";
+ if (nodeStyles && node2.look !== "handDrawn") {
+ polygon2.selectAll("path").attr("style", nodeStyles);
}
+ label.attr(
+ "transform",
+ `translate(${x5 + (node2.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))}, ${y5 + rectOffset + (node2.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.rect(node2, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- function extractCornerPoints(points) {
- const cornerPoints = [];
- const cornerPointPositions = [];
- for (let i2 = 1; i2 < points.length - 1; i2++) {
- const prev2 = points[i2 - 1];
- const curr = points[i2];
- const next3 = points[i2 + 1];
- if (prev2.x === curr.x && curr.y === next3.y && Math.abs(curr.x - next3.x) > 5 && Math.abs(curr.y - prev2.y) > 5) {
- cornerPoints.push(curr);
- cornerPointPositions.push(i2);
- } else if (prev2.y === curr.y && curr.x === next3.x && Math.abs(curr.x - prev2.x) > 5 && Math.abs(curr.y - next3.y) > 5) {
- cornerPoints.push(curr);
- cornerPointPositions.push(i2);
- }
+ var init_dividedRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/dividedRect.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(dividedRectangle, "dividedRectangle");
}
- return { cornerPoints, cornerPointPositions };
+ });
+
+ // src/rendering-util/rendering-elements/shapes/doubleCircle.ts
+ async function doublecircle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, halfPadding } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const gap = 5;
+ const outerRadius = bbox.width / 2 + halfPadding + gap;
+ const innerRadius = bbox.width / 2 + halfPadding;
+ let circleGroup;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const outerOptions = userNodeOverrides(node2, { roughness: 0.2, strokeWidth: 2.5 });
+ const innerOptions = userNodeOverrides(node2, { roughness: 0.2, strokeWidth: 1.5 });
+ const outerRoughNode = rc.circle(0, 0, outerRadius * 2, outerOptions);
+ const innerRoughNode = rc.circle(0, 0, innerRadius * 2, innerOptions);
+ circleGroup = shapeSvg.insert("g", ":first-child");
+ circleGroup.attr("class", handleUndefinedAttr(node2.cssClasses)).attr("style", handleUndefinedAttr(cssStyles));
+ circleGroup.node()?.appendChild(outerRoughNode);
+ circleGroup.node()?.appendChild(innerRoughNode);
+ } else {
+ circleGroup = shapeSvg.insert("g", ":first-child");
+ const outerCircle = circleGroup.insert("circle", ":first-child");
+ const innerCircle = circleGroup.insert("circle");
+ circleGroup.attr("class", "basic label-container").attr("style", nodeStyles);
+ outerCircle.attr("class", "outer-circle").attr("style", nodeStyles).attr("r", outerRadius).attr("cx", 0).attr("cy", 0);
+ innerCircle.attr("class", "inner-circle").attr("style", nodeStyles).attr("r", innerRadius).attr("cx", 0).attr("cy", 0);
+ }
+ updateNodeBounds(node2, circleGroup);
+ node2.intersect = function(point8) {
+ log.info("DoubleCircle intersect", node2, outerRadius, point8);
+ return intersect_default.circle(node2, outerRadius, point8);
+ };
+ return shapeSvg;
}
- var edgeLabels, terminalLabels, clear6, getLabelStyles, insertEdgeLabel, positionEdgeLabel, outsideNode, intersection, cutPathAtIntersect, findAdjacentPoint, fixCorners, insertEdge;
- var init_edges = __esm({
- "src/rendering-util/rendering-elements/edges.js"() {
+ var init_doubleCircle = __esm({
+ "src/rendering-util/rendering-elements/shapes/doubleCircle.ts"() {
"use strict";
- init_diagramAPI();
- init_common();
init_logger();
- init_createText();
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
init_utils2();
- init_lineWithOffset();
- init_subGraphTitleMargins();
- init_src32();
+ __name(doublecircle, "doublecircle");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/filledCircle.ts
+ function filledCircle(parent4, node2, { config: { themeVariables } }) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.label = "";
+ node2.labelStyle = labelStyles;
+ const shapeSvg = parent4.insert("g").attr("class", getNodeClasses(node2)).attr("id", node2.domId ?? node2.id);
+ const radius2 = 7;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const { nodeBorder } = themeVariables;
+ const options3 = userNodeOverrides(node2, { fillStyle: "solid" });
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ }
+ const circleNode = rc.circle(0, 0, radius2 * 2, options3);
+ const filledCircle2 = shapeSvg.insert(() => circleNode, ":first-child");
+ filledCircle2.selectAll("path").attr("style", `fill: ${nodeBorder} !important;`);
+ if (cssStyles && cssStyles.length > 0 && node2.look !== "handDrawn") {
+ filledCircle2.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ filledCircle2.selectAll("path").attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, filledCircle2);
+ node2.intersect = function(point8) {
+ log.info("filledCircle intersect", node2, { radius: radius2, point: point8 });
+ const pos = intersect_default.circle(node2, radius2, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_filledCircle = __esm({
+ "src/rendering-util/rendering-elements/shapes/filledCircle.ts"() {
+ "use strict";
init_rough_esm();
- init_createLabel2();
- init_edgeMarker();
- edgeLabels = /* @__PURE__ */ new Map();
- terminalLabels = /* @__PURE__ */ new Map();
- clear6 = /* @__PURE__ */ __name(() => {
- edgeLabels.clear();
- terminalLabels.clear();
- }, "clear");
- getLabelStyles = /* @__PURE__ */ __name((styleArray) => {
- let styles3 = styleArray ? styleArray.reduce((acc, style3) => acc + ";" + style3, "") : "";
- return styles3;
- }, "getLabelStyles");
- insertEdgeLabel = /* @__PURE__ */ __name(async (elem, edge) => {
- let useHtmlLabels = evaluate(getConfig2().flowchart.htmlLabels);
- const labelElement = await createText(elem, edge.label, {
- style: getLabelStyles(edge.labelStyle),
- useHtmlLabels,
- addSvgBackground: true,
- isNode: false
- });
- log.info("abc82", edge, edge.labelType);
- const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
- const label = edgeLabel.insert("g").attr("class", "label");
- label.node().appendChild(labelElement);
- let bbox = labelElement.getBBox();
- if (useHtmlLabels) {
- const div = labelElement.children[0];
- const dv = select_default2(labelElement);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
- edgeLabels.set(edge.id, edgeLabel);
- edge.width = bbox.width;
- edge.height = bbox.height;
- let fo;
- if (edge.startLabelLeft) {
- const startLabelElement = await createLabel_default2(
- edge.startLabelLeft,
- getLabelStyles(edge.labelStyle)
- );
- const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
- const inner2 = startEdgeLabelLeft.insert("g").attr("class", "inner");
- fo = inner2.node().appendChild(startLabelElement);
- const slBox = startLabelElement.getBBox();
- inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
- if (!terminalLabels.get(edge.id)) {
- terminalLabels.set(edge.id, {});
- }
- terminalLabels.get(edge.id).startLeft = startEdgeLabelLeft;
- setTerminalWidth(fo, edge.startLabelLeft);
- }
- if (edge.startLabelRight) {
- const startLabelElement = await createLabel_default2(
- edge.startLabelRight,
- getLabelStyles(edge.labelStyle)
- );
- const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
- const inner2 = startEdgeLabelRight.insert("g").attr("class", "inner");
- fo = startEdgeLabelRight.node().appendChild(startLabelElement);
- inner2.node().appendChild(startLabelElement);
- const slBox = startLabelElement.getBBox();
- inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
- if (!terminalLabels.get(edge.id)) {
- terminalLabels.set(edge.id, {});
- }
- terminalLabels.get(edge.id).startRight = startEdgeLabelRight;
- setTerminalWidth(fo, edge.startLabelRight);
- }
- if (edge.endLabelLeft) {
- const endLabelElement = await createLabel_default2(edge.endLabelLeft, getLabelStyles(edge.labelStyle));
- const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
- const inner2 = endEdgeLabelLeft.insert("g").attr("class", "inner");
- fo = inner2.node().appendChild(endLabelElement);
- const slBox = endLabelElement.getBBox();
- inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
- endEdgeLabelLeft.node().appendChild(endLabelElement);
- if (!terminalLabels.get(edge.id)) {
- terminalLabels.set(edge.id, {});
- }
- terminalLabels.get(edge.id).endLeft = endEdgeLabelLeft;
- setTerminalWidth(fo, edge.endLabelLeft);
- }
- if (edge.endLabelRight) {
- const endLabelElement = await createLabel_default2(edge.endLabelRight, getLabelStyles(edge.labelStyle));
- const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
- const inner2 = endEdgeLabelRight.insert("g").attr("class", "inner");
- fo = inner2.node().appendChild(endLabelElement);
- const slBox = endLabelElement.getBBox();
- inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
- endEdgeLabelRight.node().appendChild(endLabelElement);
- if (!terminalLabels.get(edge.id)) {
- terminalLabels.set(edge.id, {});
- }
- terminalLabels.get(edge.id).endRight = endEdgeLabelRight;
- setTerminalWidth(fo, edge.endLabelRight);
- }
- return labelElement;
- }, "insertEdgeLabel");
- __name(setTerminalWidth, "setTerminalWidth");
- positionEdgeLabel = /* @__PURE__ */ __name((edge, paths) => {
- log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels.get(edge.id), paths);
- let path4 = paths.updatedPath ? paths.updatedPath : paths.originalPath;
- const siteConfig2 = getConfig2();
- const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2);
- if (edge.label) {
- const el = edgeLabels.get(edge.id);
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcLabelPosition(path4);
- log.debug(
- "Moving label " + edge.label + " from (",
- x5,
- ",",
- y5,
- ") to (",
- pos.x,
- ",",
- pos.y,
- ") abc88"
- );
- if (paths.updatedPath) {
- x5 = pos.x;
- y5 = pos.y;
- }
- }
- el.attr("transform", `translate(${x5}, ${y5 + subGraphTitleTotalMargin / 2})`);
- }
- if (edge.startLabelLeft) {
- const el = terminalLabels.get(edge.id).startLeft;
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path4);
- x5 = pos.x;
- y5 = pos.y;
- }
- el.attr("transform", `translate(${x5}, ${y5})`);
- }
- if (edge.startLabelRight) {
- const el = terminalLabels.get(edge.id).startRight;
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcTerminalLabelPosition(
- edge.arrowTypeStart ? 10 : 0,
- "start_right",
- path4
- );
- x5 = pos.x;
- y5 = pos.y;
- }
- el.attr("transform", `translate(${x5}, ${y5})`);
- }
- if (edge.endLabelLeft) {
- const el = terminalLabels.get(edge.id).endLeft;
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path4);
- x5 = pos.x;
- y5 = pos.y;
- }
- el.attr("transform", `translate(${x5}, ${y5})`);
- }
- if (edge.endLabelRight) {
- const el = terminalLabels.get(edge.id).endRight;
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path4);
- x5 = pos.x;
- y5 = pos.y;
- }
- el.attr("transform", `translate(${x5}, ${y5})`);
- }
- }, "positionEdgeLabel");
- outsideNode = /* @__PURE__ */ __name((node2, point8) => {
- const x5 = node2.x;
- const y5 = node2.y;
- const dx = Math.abs(point8.x - x5);
- const dy = Math.abs(point8.y - y5);
- const w3 = node2.width / 2;
- const h2 = node2.height / 2;
- return dx >= w3 || dy >= h2;
- }, "outsideNode");
- intersection = /* @__PURE__ */ __name((node2, outsidePoint, insidePoint) => {
- log.debug(`intersection calc abc89:
- outsidePoint: ${JSON.stringify(outsidePoint)}
- insidePoint : ${JSON.stringify(insidePoint)}
- node : x:${node2.x} y:${node2.y} w:${node2.width} h:${node2.height}`);
- const x5 = node2.x;
- const y5 = node2.y;
- const dx = Math.abs(x5 - insidePoint.x);
- const w3 = node2.width / 2;
- let r2 = insidePoint.x < outsidePoint.x ? w3 - dx : w3 + dx;
- const h2 = node2.height / 2;
- const Q2 = Math.abs(outsidePoint.y - insidePoint.y);
- const R2 = Math.abs(outsidePoint.x - insidePoint.x);
- if (Math.abs(y5 - outsidePoint.y) * w3 > Math.abs(x5 - outsidePoint.x) * h2) {
- let q2 = insidePoint.y < outsidePoint.y ? outsidePoint.y - h2 - y5 : y5 - h2 - outsidePoint.y;
- r2 = R2 * q2 / Q2;
- const res = {
- x: insidePoint.x < outsidePoint.x ? insidePoint.x + r2 : insidePoint.x - R2 + r2,
- y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q2 - q2 : insidePoint.y - Q2 + q2
- };
- if (r2 === 0) {
- res.x = outsidePoint.x;
- res.y = outsidePoint.y;
- }
- if (R2 === 0) {
- res.x = outsidePoint.x;
- }
- if (Q2 === 0) {
- res.y = outsidePoint.y;
- }
- log.debug(`abc89 top/bottom calc, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, res);
- return res;
- } else {
- if (insidePoint.x < outsidePoint.x) {
- r2 = outsidePoint.x - w3 - x5;
- } else {
- r2 = x5 - w3 - outsidePoint.x;
- }
- let q2 = Q2 * r2 / R2;
- let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R2 - r2 : insidePoint.x - R2 + r2;
- let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q2 : insidePoint.y - q2;
- log.debug(`sides calc abc89, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, { _x, _y });
- if (r2 === 0) {
- _x = outsidePoint.x;
- _y = outsidePoint.y;
- }
- if (R2 === 0) {
- _x = outsidePoint.x;
- }
- if (Q2 === 0) {
- _y = outsidePoint.y;
- }
- return { x: _x, y: _y };
- }
- }, "intersection");
- cutPathAtIntersect = /* @__PURE__ */ __name((_points, boundaryNode) => {
- log.warn("abc88 cutPathAtIntersect", _points, boundaryNode);
- let points = [];
- let lastPointOutside = _points[0];
- let isInside = false;
- _points.forEach((point8) => {
- log.info("abc88 checking point", point8, boundaryNode);
- if (!outsideNode(boundaryNode, point8) && !isInside) {
- const inter = intersection(boundaryNode, lastPointOutside, point8);
- log.debug("abc88 inside", point8, lastPointOutside, inter);
- log.debug("abc88 intersection", inter, boundaryNode);
- let pointPresent = false;
- points.forEach((p3) => {
- pointPresent = pointPresent || p3.x === inter.x && p3.y === inter.y;
- });
- if (!points.some((e3) => e3.x === inter.x && e3.y === inter.y)) {
- points.push(inter);
- } else {
- log.warn("abc88 no intersect", inter, points);
- }
- isInside = true;
- } else {
- log.warn("abc88 outside", point8, lastPointOutside);
- lastPointOutside = point8;
- if (!isInside) {
- points.push(point8);
- }
- }
- });
- log.debug("returning points", points);
- return points;
- }, "cutPathAtIntersect");
- __name(extractCornerPoints, "extractCornerPoints");
- findAdjacentPoint = /* @__PURE__ */ __name(function(pointA, pointB, distance2) {
- const xDiff = pointB.x - pointA.x;
- const yDiff = pointB.y - pointA.y;
- const length2 = Math.sqrt(xDiff * xDiff + yDiff * yDiff);
- const ratio = distance2 / length2;
- return { x: pointB.x - ratio * xDiff, y: pointB.y - ratio * yDiff };
- }, "findAdjacentPoint");
- fixCorners = /* @__PURE__ */ __name(function(lineData) {
- const { cornerPointPositions } = extractCornerPoints(lineData);
- const newLineData = [];
- for (let i2 = 0; i2 < lineData.length; i2++) {
- if (cornerPointPositions.includes(i2)) {
- const prevPoint = lineData[i2 - 1];
- const nextPoint = lineData[i2 + 1];
- const cornerPoint = lineData[i2];
- const newPrevPoint = findAdjacentPoint(prevPoint, cornerPoint, 5);
- const newNextPoint = findAdjacentPoint(nextPoint, cornerPoint, 5);
- const xDiff = newNextPoint.x - newPrevPoint.x;
- const yDiff = newNextPoint.y - newPrevPoint.y;
- newLineData.push(newPrevPoint);
- const a2 = Math.sqrt(2) * 2;
- let newCornerPoint = { x: cornerPoint.x, y: cornerPoint.y };
- if (Math.abs(nextPoint.x - prevPoint.x) > 10 && Math.abs(nextPoint.y - prevPoint.y) >= 10) {
- log.debug(
- "Corner point fixing",
- Math.abs(nextPoint.x - prevPoint.x),
- Math.abs(nextPoint.y - prevPoint.y)
- );
- const r2 = 5;
- if (cornerPoint.x === newPrevPoint.x) {
- newCornerPoint = {
- x: xDiff < 0 ? newPrevPoint.x - r2 + a2 : newPrevPoint.x + r2 - a2,
- y: yDiff < 0 ? newPrevPoint.y - a2 : newPrevPoint.y + a2
- };
- } else {
- newCornerPoint = {
- x: xDiff < 0 ? newPrevPoint.x - a2 : newPrevPoint.x + a2,
- y: yDiff < 0 ? newPrevPoint.y - r2 + a2 : newPrevPoint.y + r2 - a2
- };
- }
- } else {
- log.debug(
- "Corner point skipping fixing",
- Math.abs(nextPoint.x - prevPoint.x),
- Math.abs(nextPoint.y - prevPoint.y)
- );
- }
- newLineData.push(newCornerPoint, newNextPoint);
- } else {
- newLineData.push(lineData[i2]);
- }
- }
- return newLineData;
- }, "fixCorners");
- insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb3, diagramType, startNode, endNode, id27) {
- const { handDrawnSeed } = getConfig2();
- let points = edge.points;
- let pointsHasChanged = false;
- const tail = startNode;
- var head2 = endNode;
- if (head2.intersect && tail.intersect) {
- points = points.slice(1, edge.points.length - 1);
- points.unshift(tail.intersect(points[0]));
- log.debug(
- "Last point APA12",
- edge.start,
- "-->",
- edge.end,
- points[points.length - 1],
- head2,
- head2.intersect(points[points.length - 1])
- );
- points.push(head2.intersect(points[points.length - 1]));
- }
- if (edge.toCluster) {
- log.info("to cluster abc88", clusterDb3.get(edge.toCluster));
- points = cutPathAtIntersect(edge.points, clusterDb3.get(edge.toCluster).node);
- pointsHasChanged = true;
- }
- if (edge.fromCluster) {
- log.debug(
- "from cluster abc88",
- clusterDb3.get(edge.fromCluster),
- JSON.stringify(points, null, 2)
- );
- points = cutPathAtIntersect(points.reverse(), clusterDb3.get(edge.fromCluster).node).reverse();
- pointsHasChanged = true;
- }
- let lineData = points.filter((p3) => !Number.isNaN(p3.y));
- lineData = fixCorners(lineData);
- let lastPoint2 = lineData[lineData.length - 1];
- if (lineData.length > 1) {
- lastPoint2 = lineData[lineData.length - 1];
- const secondLastPoint = lineData[lineData.length - 2];
- const diffX = (lastPoint2.x - secondLastPoint.x) / 2;
- const diffY = (lastPoint2.y - secondLastPoint.y) / 2;
- const midPoint = { x: secondLastPoint.x + diffX, y: secondLastPoint.y + diffY };
- lineData.splice(-1, 0, midPoint);
- }
- let curve = basis_default2;
- if (edge.curve) {
- curve = edge.curve;
- }
- const { x: x5, y: y5 } = getLineFunctionsWithOffset(edge);
- const lineFunction = line_default().x(x5).y(y5).curve(curve);
- let strokeClasses;
- switch (edge.thickness) {
- case "normal":
- strokeClasses = "edge-thickness-normal";
- break;
- case "thick":
- strokeClasses = "edge-thickness-thick";
- break;
- case "invisible":
- strokeClasses = "edge-thickness-invisible";
- break;
- default:
- strokeClasses = "edge-thickness-normal";
- }
- switch (edge.pattern) {
- case "solid":
- strokeClasses += " edge-pattern-solid";
- break;
- case "dotted":
- strokeClasses += " edge-pattern-dotted";
- break;
- case "dashed":
- strokeClasses += " edge-pattern-dashed";
- break;
- default:
- strokeClasses += " edge-pattern-solid";
- }
- let svgPath;
- let linePath = lineFunction(lineData);
- const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
- if (edge.look === "handDrawn") {
- const rc = at.svg(elem);
- Object.assign([], lineData);
- const svgPathNode = rc.path(linePath, {
- roughness: 0.3,
- seed: handDrawnSeed
- });
- strokeClasses += " transition";
- svgPath = select_default2(svgPathNode).select("path").attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style3) => acc + ";" + style3, "") : "");
- let d2 = svgPath.attr("d");
- svgPath.attr("d", d2);
- elem.node().appendChild(svgPath.node());
- } else {
- svgPath = elem.append("path").attr("d", linePath).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style3) => acc + ";" + style3, "") : "");
- }
- let url = "";
- if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) {
- url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
- url = url.replace(/\(/g, "\\(").replace(/\)/g, "\\)");
- }
- log.info("arrowTypeStart", edge.arrowTypeStart);
- log.info("arrowTypeEnd", edge.arrowTypeEnd);
- addEdgeMarkers(svgPath, edge, url, id27, diagramType);
- let paths = {};
- if (pointsHasChanged) {
- paths.updatedPath = points;
- }
- paths.originalPath = edge.points;
- return paths;
- }, "insertEdge");
- }
- });
-
- // src/rendering-util/rendering-elements/markers.js
- var insertMarkers, extension, composition, aggregation, dependency, lollipop, point6, circle2, cross, barb, markers, markers_default;
- var init_markers = __esm({
- "src/rendering-util/rendering-elements/markers.js"() {
+ init_logger();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_util();
+ __name(filledCircle, "filledCircle");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/flippedTriangle.ts
+ async function flippedTriangle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = bbox.width + (node2.padding ?? 0);
+ const h2 = w3 + bbox.height;
+ const tw = w3 + bbox.height;
+ const points = [
+ { x: 0, y: -h2 },
+ { x: tw, y: -h2 },
+ { x: tw / 2, y: 0 }
+ ];
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const pathData = createPathFromPoints(points);
+ const roughNode = rc.path(pathData, options3);
+ const flippedTriangle2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-h2 / 2}, ${h2 / 2})`);
+ if (cssStyles && node2.look !== "handDrawn") {
+ flippedTriangle2.selectChildren("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ flippedTriangle2.selectChildren("path").attr("style", nodeStyles);
+ }
+ node2.width = w3;
+ node2.height = h2;
+ updateNodeBounds(node2, flippedTriangle2);
+ label.attr(
+ "transform",
+ `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-h2 / 2 + (node2.padding ?? 0) / 2 + (bbox.y - (bbox.top ?? 0))})`
+ );
+ node2.intersect = function(point8) {
+ log.info("Triangle intersect", node2, points, point8);
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }
+ var init_flippedTriangle = __esm({
+ "src/rendering-util/rendering-elements/shapes/flippedTriangle.ts"() {
"use strict";
init_logger();
- insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type3, id27) => {
- markerArray.forEach((markerName) => {
- markers[markerName](elem, type3, id27);
- });
- }, "insertMarkers");
- extension = /* @__PURE__ */ __name((elem, type3, id27) => {
- log.trace("Making markers for ", id27);
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).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", id27 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).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");
- }, "extension");
- composition = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).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", id27 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).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");
- }, "composition");
- aggregation = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).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", id27 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).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");
- }, "aggregation");
- dependency = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).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", id27 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).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");
- }, "dependency");
- lollipop = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).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", id27 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).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);
- }, "lollipop");
- point6 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("marker").attr("id", id27 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).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", id27 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).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");
- }, "point");
- circle2 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("marker").attr("id", id27 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).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", id27 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).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");
- }, "circle");
- cross = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("marker").attr("id", id27 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).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", id27 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).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");
- }, "cross");
- barb = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
- }, "barb");
- markers = {
- extension,
- composition,
- aggregation,
- dependency,
- lollipop,
- point: point6,
- circle: circle2,
- cross,
- barb
- };
- markers_default = insertMarkers;
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_util();
+ __name(flippedTriangle, "flippedTriangle");
}
});
- // src/rendering-util/rendering-elements/shapes/util.js
- var labelHelper2, updateNodeBounds2, getNodeClasses;
- var init_util2 = __esm({
- "src/rendering-util/rendering-elements/shapes/util.js"() {
+ // src/rendering-util/rendering-elements/shapes/forkJoin.ts
+ function forkJoin(parent4, node2, { dir: dir2, config: { state: state4, themeVariables } }) {
+ const { nodeStyles } = styles2String(node2);
+ node2.label = "";
+ const shapeSvg = parent4.insert("g").attr("class", getNodeClasses(node2)).attr("id", node2.domId ?? node2.id);
+ const { cssStyles } = node2;
+ let width3 = Math.max(70, node2?.width ?? 0);
+ let height2 = Math.max(10, node2?.height ?? 0);
+ if (dir2 === "LR") {
+ width3 = Math.max(10, node2?.width ?? 0);
+ height2 = Math.max(70, node2?.height ?? 0);
+ }
+ const x5 = -1 * width3 / 2;
+ const y5 = -1 * height2 / 2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {
+ stroke: themeVariables.lineColor,
+ fill: themeVariables.lineColor
+ });
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const roughNode = rc.rectangle(x5, y5, width3, height2, options3);
+ const shape = shapeSvg.insert(() => roughNode, ":first-child");
+ if (cssStyles && node2.look !== "handDrawn") {
+ shape.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ shape.selectAll("path").attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, shape);
+ const padding2 = state4?.padding ?? 0;
+ if (node2.width && node2.height) {
+ node2.width += padding2 / 2 || 0;
+ node2.height += padding2 / 2 || 0;
+ }
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
+ }
+ var init_forkJoin = __esm({
+ "src/rendering-util/rendering-elements/shapes/forkJoin.ts"() {
"use strict";
- init_createText();
- init_diagramAPI();
- init_src32();
- init_common();
- init_utils2();
- labelHelper2 = /* @__PURE__ */ __name(async (parent4, node2, _classes) => {
- let cssClasses;
- const useHtmlLabels = node2.useHtmlLabels || evaluate(getConfig2().flowchart.htmlLabels);
- if (!_classes) {
- cssClasses = "node default";
- } else {
- cssClasses = _classes;
- }
- const shapeSvg = parent4.insert("g").attr("class", cssClasses).attr("id", node2.domId || node2.id);
- const labelEl = shapeSvg.insert("g").attr("class", "label").attr("style", node2.labelStyle);
- let label;
- if (node2.label === void 0) {
- label = "";
- } else {
- label = typeof node2.label === "string" ? node2.label : node2.label[0];
- }
- let text2;
- text2 = await createText(labelEl, sanitizeText(decodeEntities(label), getConfig2()), {
- useHtmlLabels,
- width: node2.width || getConfig2().flowchart.wrappingWidth,
- cssClasses: "markdown-node-label",
- style: node2.labelStyle
- });
- let bbox = text2.getBBox();
- const halfPadding = node2.padding / 2;
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
- const div = text2.children[0];
- const dv = select_default2(text2);
- const images = div.getElementsByTagName("img");
- if (images) {
- const noImgText = label.replace(/ ]*>/g, "").trim() === "";
- await Promise.all(
- [...images].map(
- (img) => new Promise((res) => {
- function setupImage() {
- img.style.display = "flex";
- img.style.flexDirection = "column";
- if (noImgText) {
- const bodyFontSize = getConfig2().fontSize ? getConfig2().fontSize : window.getComputedStyle(document.body).fontSize;
- const enlargingFactor = 5;
- const width3 = parseInt(bodyFontSize, 10) * enlargingFactor + "px";
- img.style.minWidth = width3;
- img.style.maxWidth = width3;
- } else {
- img.style.width = "100%";
- }
- res(img);
- }
- __name(setupImage, "setupImage");
- setTimeout(() => {
- if (img.complete) {
- setupImage();
- }
- });
- img.addEventListener("error", setupImage);
- img.addEventListener("load", setupImage);
- })
- )
- );
- }
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- if (useHtmlLabels) {
- labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
- } else {
- labelEl.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
- }
- if (node2.centerLabel) {
- labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
- }
- labelEl.insert("rect", ":first-child");
- return { shapeSvg, bbox, halfPadding, label: labelEl };
- }, "labelHelper");
- updateNodeBounds2 = /* @__PURE__ */ __name((node2, element3) => {
- const bbox = element3.node().getBBox();
- node2.width = bbox.width;
- node2.height = bbox.height;
- }, "updateNodeBounds");
- getNodeClasses = /* @__PURE__ */ __name((node2, extra) => (node2.look === "handDrawn" ? "rough-node" : "node") + " " + node2.cssClasses + " " + (extra || ""), "getNodeClasses");
- }
- });
-
- // src/rendering-util/rendering-elements/intersect/intersect-node.js
- function intersectNode2(node2, point8) {
- return node2.intersect(point8);
+ init_rough_esm();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_util();
+ __name(forkJoin, "forkJoin");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/halfRoundedRectangle.ts
+ async function halfRoundedRectangle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const minWidth = 80, minHeight = 50;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(minWidth, bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(minHeight, bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const radius2 = h2 / 2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: -w3 / 2, y: -h2 / 2 },
+ { x: w3 / 2 - radius2, y: -h2 / 2 },
+ ...generateCirclePoints(-w3 / 2 + radius2, 0, radius2, 50, 90, 270),
+ { x: w3 / 2 - radius2, y: h2 / 2 },
+ { x: -w3 / 2, y: h2 / 2 }
+ ];
+ const pathData = createPathFromPoints(points);
+ const shapeNode = rc.path(pathData, options3);
+ const polygon2 = shapeSvg.insert(() => shapeNode, ":first-child");
+ polygon2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ log.info("Pill intersect", node2, { radius: radius2, point: point8 });
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var intersect_node_default2;
- var init_intersect_node2 = __esm({
- "src/rendering-util/rendering-elements/intersect/intersect-node.js"() {
+ var init_halfRoundedRectangle = __esm({
+ "src/rendering-util/rendering-elements/shapes/halfRoundedRectangle.ts"() {
"use strict";
- __name(intersectNode2, "intersectNode");
- intersect_node_default2 = intersectNode2;
+ init_logger();
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(halfRoundedRectangle, "halfRoundedRectangle");
}
});
- // src/rendering-util/rendering-elements/intersect/intersect-ellipse.js
- function intersectEllipse2(node2, rx, ry, point8) {
- var cx = node2.x;
- var cy = node2.y;
- var px = cx - point8.x;
- var py = cy - point8.y;
- var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);
- var dx = Math.abs(rx * ry * px / det);
- if (point8.x < cx) {
- dx = -dx;
- }
- var dy = Math.abs(rx * ry * py / det);
- if (point8.y < cy) {
- dy = -dy;
+ // src/rendering-util/rendering-elements/shapes/hexagon.ts
+ async function hexagon(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const f2 = 4;
+ const h2 = bbox.height + node2.padding;
+ const m2 = h2 / f2;
+ const w3 = bbox.width + 2 * m2 + node2.padding;
+ const points = [
+ { x: m2, y: 0 },
+ { x: w3 - m2, y: 0 },
+ { x: w3, y: -h2 / 2 },
+ { x: w3 - m2, y: -h2 },
+ { x: m2, y: -h2 },
+ { x: 0, y: -h2 / 2 }
+ ];
+ let polygon2;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const pathData = createHexagonPathD(0, 0, w3, h2, m2);
+ const roughNode = rc.path(pathData, options3);
+ polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
+ if (cssStyles) {
+ polygon2.attr("style", cssStyles);
+ }
+ } else {
+ polygon2 = insertPolygonShape(shapeSvg, w3, h2, points);
}
- return { x: cx + dx, y: cy + dy };
- }
- var intersect_ellipse_default2;
- var init_intersect_ellipse2 = __esm({
- "src/rendering-util/rendering-elements/intersect/intersect-ellipse.js"() {
- "use strict";
- __name(intersectEllipse2, "intersectEllipse");
- intersect_ellipse_default2 = intersectEllipse2;
+ if (nodeStyles) {
+ polygon2.attr("style", nodeStyles);
}
- });
-
- // src/rendering-util/rendering-elements/intersect/intersect-circle.js
- function intersectCircle2(node2, rx, point8) {
- return intersect_ellipse_default2(node2, rx, rx, point8);
+ node2.width = w3;
+ node2.height = h2;
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
}
- var intersect_circle_default2;
- var init_intersect_circle2 = __esm({
- "src/rendering-util/rendering-elements/intersect/intersect-circle.js"() {
+ var createHexagonPathD;
+ var init_hexagon = __esm({
+ "src/rendering-util/rendering-elements/shapes/hexagon.ts"() {
"use strict";
- init_intersect_ellipse2();
- __name(intersectCircle2, "intersectCircle");
- intersect_circle_default2 = intersectCircle2;
- }
- });
-
- // src/rendering-util/rendering-elements/intersect/intersect-line.js
- function intersectLine2(p1, p22, q1, q2) {
- var a1, a2, b1, b2, c1, c22;
- var r1, r2, r3, r4;
- var denom, offset, num;
- var x5, y5;
- a1 = p22.y - p1.y;
- b1 = p1.x - p22.x;
- c1 = p22.x * p1.y - p1.x * p22.y;
- r3 = a1 * q1.x + b1 * q1.y + c1;
- r4 = a1 * q2.x + b1 * q2.y + c1;
- if (r3 !== 0 && r4 !== 0 && sameSign2(r3, r4)) {
- return;
- }
- a2 = q2.y - q1.y;
- b2 = q1.x - q2.x;
- c22 = q2.x * q1.y - q1.x * q2.y;
- r1 = a2 * p1.x + b2 * p1.y + c22;
- r2 = a2 * p22.x + b2 * p22.y + c22;
- if (r1 !== 0 && r2 !== 0 && sameSign2(r1, r2)) {
- return;
- }
- denom = a1 * b2 - a2 * b1;
- if (denom === 0) {
- return;
- }
- offset = Math.abs(denom / 2);
- num = b1 * c22 - b2 * c1;
- x5 = num < 0 ? (num - offset) / denom : (num + offset) / denom;
- num = a2 * c1 - a1 * c22;
- y5 = num < 0 ? (num - offset) / denom : (num + offset) / denom;
- return { x: x5, y: y5 };
- }
- function sameSign2(r1, r2) {
- return r1 * r2 > 0;
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_insertPolygonShape();
+ createHexagonPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, m2) => {
+ return [
+ `M${x5 + m2},${y5}`,
+ `L${x5 + width3 - m2},${y5}`,
+ `L${x5 + width3},${y5 - height2 / 2}`,
+ `L${x5 + width3 - m2},${y5 - height2}`,
+ `L${x5 + m2},${y5 - height2}`,
+ `L${x5},${y5 - height2 / 2}`,
+ "Z"
+ ].join(" ");
+ }, "createHexagonPathD");
+ __name(hexagon, "hexagon");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/hourglass.ts
+ async function hourglass(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.label = "";
+ node2.labelStyle = labelStyles;
+ const { shapeSvg } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(30, node2?.width ?? 0);
+ const h2 = Math.max(30, node2?.height ?? 0);
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: 0, y: 0 },
+ { x: w3, y: 0 },
+ { x: 0, y: h2 },
+ { x: w3, y: h2 }
+ ];
+ const pathData = createPathFromPoints(points);
+ const shapeNode = rc.path(pathData, options3);
+ const polygon2 = shapeSvg.insert(() => shapeNode, ":first-child");
+ polygon2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", nodeStyles);
+ }
+ polygon2.attr("transform", `translate(${-w3 / 2}, ${-h2 / 2})`);
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ log.info("Pill intersect", node2, { points });
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var intersect_line_default2;
- var init_intersect_line2 = __esm({
- "src/rendering-util/rendering-elements/intersect/intersect-line.js"() {
+ var init_hourglass = __esm({
+ "src/rendering-util/rendering-elements/shapes/hourglass.ts"() {
"use strict";
- __name(intersectLine2, "intersectLine");
- __name(sameSign2, "sameSign");
- intersect_line_default2 = intersectLine2;
- }
- });
-
- // src/rendering-util/rendering-elements/intersect/intersect-polygon.js
- function intersectPolygon2(node2, polyPoints, point8) {
- let x1 = node2.x;
- let y1 = node2.y;
- let intersections = [];
- let minX = Number.POSITIVE_INFINITY;
- let minY = Number.POSITIVE_INFINITY;
- if (typeof polyPoints.forEach === "function") {
- polyPoints.forEach(function(entry) {
- minX = Math.min(minX, entry.x);
- minY = Math.min(minY, entry.y);
- });
- } else {
- minX = Math.min(minX, polyPoints.x);
- minY = Math.min(minY, polyPoints.y);
- }
- let left3 = x1 - node2.width / 2 - minX;
- let top2 = y1 - node2.height / 2 - minY;
- for (let i2 = 0; i2 < polyPoints.length; i2++) {
- let p1 = polyPoints[i2];
- let p22 = polyPoints[i2 < polyPoints.length - 1 ? i2 + 1 : 0];
- let intersect3 = intersect_line_default2(
- node2,
- point8,
- { x: left3 + p1.x, y: top2 + p1.y },
- { x: left3 + p22.x, y: top2 + p22.y }
+ init_logger();
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(hourglass, "hourglass");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/icon.ts
+ async function icon(parent4, node2, { config: { themeVariables, flowchart } }) {
+ const { labelStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const assetHeight = node2.assetHeight ?? 48;
+ const assetWidth = node2.assetWidth ?? 48;
+ const iconSize = Math.max(assetHeight, assetWidth);
+ const defaultWidth = flowchart?.wrappingWidth;
+ node2.width = Math.max(iconSize, defaultWidth ?? 0);
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, "icon-shape default");
+ const topLabel = node2.pos === "t";
+ const height2 = iconSize;
+ const width3 = iconSize;
+ const { nodeBorder } = themeVariables;
+ const { stylesMap } = compileStyles(node2);
+ const x5 = -width3 / 2;
+ const y5 = -height2 / 2;
+ const labelPadding = node2.label ? 8 : 0;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, { stroke: "none", fill: "none" });
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const iconNode = rc.rectangle(x5, y5, width3, height2, options3);
+ const outerWidth = Math.max(width3, bbox.width);
+ const outerHeight = height2 + bbox.height + labelPadding;
+ const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
+ ...options3,
+ fill: "transparent",
+ stroke: "none"
+ });
+ const iconShape = shapeSvg.insert(() => iconNode, ":first-child");
+ const outerShape = shapeSvg.insert(() => outerNode);
+ if (node2.icon) {
+ const iconElem = shapeSvg.append("g");
+ iconElem.html(
+ `${await getIconSVG(node2.icon, {
+ height: iconSize,
+ width: iconSize,
+ fallbackPrefix: ""
+ })} `
);
- if (intersect3) {
- intersections.push(intersect3);
- }
- }
- if (!intersections.length) {
- return node2;
- }
- if (intersections.length > 1) {
- intersections.sort(function(p3, q2) {
- let pdx = p3.x - point8.x;
- let pdy = p3.y - point8.y;
- let distp = Math.sqrt(pdx * pdx + pdy * pdy);
- let qdx = q2.x - point8.x;
- let qdy = q2.y - point8.y;
- let distq = Math.sqrt(qdx * qdx + qdy * qdy);
- return distp < distq ? -1 : distp === distq ? 0 : 1;
- });
+ const iconBBox = iconElem.node().getBBox();
+ const iconWidth = iconBBox.width;
+ const iconHeight = iconBBox.height;
+ const iconX = iconBBox.x;
+ const iconY = iconBBox.y;
+ iconElem.attr(
+ "transform",
+ `translate(${-iconWidth / 2 - iconX},${topLabel ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY})`
+ );
+ iconElem.attr("style", `color: ${stylesMap.get("stroke") ?? nodeBorder};`);
}
- return intersections[0];
+ label.attr(
+ "transform",
+ `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height})`
+ );
+ iconShape.attr(
+ "transform",
+ `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
+ );
+ updateNodeBounds(node2, outerShape);
+ node2.intersect = function(point8) {
+ log.info("iconSquare intersect", node2, point8);
+ if (!node2.label) {
+ return intersect_default.rect(node2, point8);
+ }
+ const dx = node2.x ?? 0;
+ const dy = node2.y ?? 0;
+ const nodeHeight = node2.height ?? 0;
+ let points = [];
+ if (topLabel) {
+ points = [
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx + width3 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - width3 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding }
+ ];
+ } else {
+ points = [
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 + height2 }
+ ];
+ }
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var intersect_polygon_default2;
- var init_intersect_polygon2 = __esm({
- "src/rendering-util/rendering-elements/intersect/intersect-polygon.js"() {
- "use strict";
- init_intersect_line2();
- __name(intersectPolygon2, "intersectPolygon");
- intersect_polygon_default2 = intersectPolygon2;
- }
- });
-
- // src/rendering-util/rendering-elements/intersect/index.js
- var intersect_default2;
- var init_intersect2 = __esm({
- "src/rendering-util/rendering-elements/intersect/index.js"() {
- "use strict";
- init_intersect_node2();
- init_intersect_circle2();
- init_intersect_ellipse2();
- init_intersect_polygon2();
- init_intersect_rect2();
- intersect_default2 = {
- node: intersect_node_default2,
- circle: intersect_circle_default2,
- ellipse: intersect_ellipse_default2,
- polygon: intersect_polygon_default2,
- rect: intersect_rect_default2
- };
- }
- });
-
- // src/rendering-util/rendering-elements/shapes/drawRect.ts
- var drawRect3;
- var init_drawRect = __esm({
- "src/rendering-util/rendering-elements/shapes/drawRect.ts"() {
+ var init_icon = __esm({
+ "src/rendering-util/rendering-elements/shapes/icon.ts"() {
"use strict";
- init_util2();
- init_intersect2();
- init_roundedRectPath();
- init_handDrawnShapeStyles();
init_rough_esm();
- drawRect3 = /* @__PURE__ */ __name(async (parent4, node2, options3) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const totalWidth = Math.max(bbox.width + options3.labelPaddingX * 2, node2?.width || 0);
- const totalHeight = Math.max(bbox.height + options3.labelPaddingY * 2, node2?.height || 0);
- const x5 = -totalWidth / 2;
- const y5 = -totalHeight / 2;
- let rect4;
- let { rx, ry } = node2;
- const { cssStyles } = node2;
- if (options3?.rx && options3.ry) {
- rx = options3.rx;
- ry = options3.ry;
- }
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options4 = userNodeOverrides(node2, {});
- const roughNode = rx || ry ? rc.path(createRoundedRectPathD(x5, y5, totalWidth, totalHeight, rx || 0), options4) : rc.rectangle(x5, y5, totalWidth, totalHeight, options4);
- rect4 = shapeSvg.insert(() => roughNode, ":first-child");
- rect4.attr("class", "basic label-container").attr("style", cssStyles);
- } else {
- rect4 = shapeSvg.insert("rect", ":first-child");
- rect4.attr("class", "basic label-container").attr("style", nodeStyles).attr("rx", rx).attr("data-id", "abc").attr("data-et", "node").attr("ry", ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
- }
- updateNodeBounds2(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default2.rect(node2, point8);
- };
- return shapeSvg;
- }, "drawRect");
+ init_logger();
+ init_icons();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_util();
+ __name(icon, "icon");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/iconCircle.ts
+ async function iconCircle(parent4, node2, { config: { themeVariables, flowchart } }) {
+ const { labelStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const assetHeight = node2.assetHeight ?? 48;
+ const assetWidth = node2.assetWidth ?? 48;
+ const iconSize = Math.max(assetHeight, assetWidth);
+ const defaultWidth = flowchart?.wrappingWidth;
+ node2.width = Math.max(iconSize, defaultWidth ?? 0);
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, "icon-shape default");
+ const padding2 = 20;
+ const labelPadding = node2.label ? 8 : 0;
+ const topLabel = node2.pos === "t";
+ const { nodeBorder, mainBkg } = themeVariables;
+ const { stylesMap } = compileStyles(node2);
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const fill = stylesMap.get("fill");
+ options3.stroke = fill ?? mainBkg;
+ const iconElem = shapeSvg.append("g");
+ if (node2.icon) {
+ iconElem.html(
+ `${await getIconSVG(node2.icon, {
+ height: iconSize,
+ width: iconSize,
+ fallbackPrefix: ""
+ })} `
+ );
}
- });
-
- // src/rendering-util/rendering-elements/shapes/state.ts
- var state;
- var init_state = __esm({
- "src/rendering-util/rendering-elements/shapes/state.ts"() {
+ const iconBBox = iconElem.node().getBBox();
+ const iconWidth = iconBBox.width;
+ const iconHeight = iconBBox.height;
+ const iconX = iconBBox.x;
+ const iconY = iconBBox.y;
+ const diameter = Math.max(iconWidth, iconHeight) * Math.SQRT2 + padding2 * 2;
+ const iconNode = rc.circle(0, 0, diameter, options3);
+ const outerWidth = Math.max(diameter, bbox.width);
+ const outerHeight = diameter + bbox.height + labelPadding;
+ const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
+ ...options3,
+ fill: "transparent",
+ stroke: "none"
+ });
+ const iconShape = shapeSvg.insert(() => iconNode, ":first-child");
+ const outerShape = shapeSvg.insert(() => outerNode);
+ iconElem.attr(
+ "transform",
+ `translate(${-iconWidth / 2 - iconX},${topLabel ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY})`
+ );
+ iconElem.attr("style", `color: ${stylesMap.get("stroke") ?? nodeBorder};`);
+ label.attr(
+ "transform",
+ `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height})`
+ );
+ iconShape.attr(
+ "transform",
+ `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
+ );
+ updateNodeBounds(node2, outerShape);
+ node2.intersect = function(point8) {
+ log.info("iconSquare intersect", node2, point8);
+ const pos = intersect_default.rect(node2, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_iconCircle = __esm({
+ "src/rendering-util/rendering-elements/shapes/iconCircle.ts"() {
"use strict";
- init_drawRect();
- state = /* @__PURE__ */ __name(async (parent4, node2) => {
- const options3 = {
- rx: 5,
- ry: 5,
- classes: "flowchart-node"
- };
- return drawRect3(parent4, node2, options3);
- }, "state");
+ init_rough_esm();
+ init_logger();
+ init_icons();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_util();
+ __name(iconCircle, "iconCircle");
}
});
- // src/rendering-util/rendering-elements/shapes/roundedRect.ts
- var roundedRect;
- var init_roundedRect = __esm({
- "src/rendering-util/rendering-elements/shapes/roundedRect.ts"() {
+ // src/rendering-util/rendering-elements/shapes/roundedRectPath.ts
+ var createRoundedRectPathD;
+ var init_roundedRectPath = __esm({
+ "src/rendering-util/rendering-elements/shapes/roundedRectPath.ts"() {
"use strict";
- init_drawRect();
- roundedRect = /* @__PURE__ */ __name(async (parent4, node2) => {
- const options3 = {
- rx: 5,
- ry: 5,
- classes: "",
- labelPaddingX: (node2?.padding || 0) * 1,
- labelPaddingY: (node2?.padding || 0) * 1
- };
- return drawRect3(parent4, node2, options3);
- }, "roundedRect");
+ createRoundedRectPathD = /* @__PURE__ */ __name((x5, y5, totalWidth, totalHeight, radius2) => [
+ "M",
+ x5 + radius2,
+ y5,
+ // Move to the first point
+ "H",
+ x5 + totalWidth - radius2,
+ // Draw horizontal line to the beginning of the right corner
+ "A",
+ radius2,
+ radius2,
+ 0,
+ 0,
+ 1,
+ x5 + totalWidth,
+ y5 + radius2,
+ // Draw arc to the right top corner
+ "V",
+ y5 + totalHeight - radius2,
+ // Draw vertical line down to the beginning of the right bottom corner
+ "A",
+ radius2,
+ radius2,
+ 0,
+ 0,
+ 1,
+ x5 + totalWidth - radius2,
+ y5 + totalHeight,
+ // Draw arc to the right bottom corner
+ "H",
+ x5 + radius2,
+ // Draw horizontal line to the beginning of the left bottom corner
+ "A",
+ radius2,
+ radius2,
+ 0,
+ 0,
+ 1,
+ x5,
+ y5 + totalHeight - radius2,
+ // Draw arc to the left bottom corner
+ "V",
+ y5 + radius2,
+ // Draw vertical line up to the beginning of the left top corner
+ "A",
+ radius2,
+ radius2,
+ 0,
+ 0,
+ 1,
+ x5 + radius2,
+ y5,
+ // Draw arc to the left top corner
+ "Z"
+ // Close the path
+ ].join(" "), "createRoundedRectPathD");
}
});
- // src/rendering-util/rendering-elements/shapes/squareRect.ts
- var squareRect2;
- var init_squareRect = __esm({
- "src/rendering-util/rendering-elements/shapes/squareRect.ts"() {
- "use strict";
- init_drawRect();
- squareRect2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const options3 = {
- rx: 0,
- ry: 0,
- classes: "",
- labelPaddingX: (node2?.padding || 0) * 2,
- labelPaddingY: (node2?.padding || 0) * 1
- };
- return drawRect3(parent4, node2, options3);
- }, "squareRect");
+ // src/rendering-util/rendering-elements/shapes/iconRounded.ts
+ async function iconRounded(parent4, node2, { config: { themeVariables, flowchart } }) {
+ const { labelStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const assetHeight = node2.assetHeight ?? 48;
+ const assetWidth = node2.assetWidth ?? 48;
+ const iconSize = Math.max(assetHeight, assetWidth);
+ const defaultWidth = flowchart?.wrappingWidth;
+ node2.width = Math.max(iconSize, defaultWidth ?? 0);
+ const { shapeSvg, bbox, halfPadding, label } = await labelHelper(
+ parent4,
+ node2,
+ "icon-shape default"
+ );
+ const topLabel = node2.pos === "t";
+ const height2 = iconSize + halfPadding * 2;
+ const width3 = iconSize + halfPadding * 2;
+ const { nodeBorder, mainBkg } = themeVariables;
+ const { stylesMap } = compileStyles(node2);
+ const x5 = -width3 / 2;
+ const y5 = -height2 / 2;
+ const labelPadding = node2.label ? 8 : 0;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const fill = stylesMap.get("fill");
+ options3.stroke = fill ?? mainBkg;
+ const iconNode = rc.path(createRoundedRectPathD(x5, y5, width3, height2, 5), options3);
+ const outerWidth = Math.max(width3, bbox.width);
+ const outerHeight = height2 + bbox.height + labelPadding;
+ const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
+ ...options3,
+ fill: "transparent",
+ stroke: "none"
+ });
+ const iconShape = shapeSvg.insert(() => iconNode, ":first-child").attr("class", "icon-shape2");
+ const outerShape = shapeSvg.insert(() => outerNode);
+ if (node2.icon) {
+ const iconElem = shapeSvg.append("g");
+ iconElem.html(
+ `${await getIconSVG(node2.icon, {
+ height: iconSize,
+ width: iconSize,
+ fallbackPrefix: ""
+ })} `
+ );
+ const iconBBox = iconElem.node().getBBox();
+ const iconWidth = iconBBox.width;
+ const iconHeight = iconBBox.height;
+ const iconX = iconBBox.x;
+ const iconY = iconBBox.y;
+ iconElem.attr(
+ "transform",
+ `translate(${-iconWidth / 2 - iconX},${topLabel ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY})`
+ );
+ iconElem.attr("style", `color: ${stylesMap.get("stroke") ?? nodeBorder};`);
}
- });
-
- // src/rendering-util/rendering-elements/shapes/stateStart.ts
- var stateStart;
- var init_stateStart = __esm({
- "src/rendering-util/rendering-elements/shapes/stateStart.ts"() {
+ label.attr(
+ "transform",
+ `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height})`
+ );
+ iconShape.attr(
+ "transform",
+ `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
+ );
+ updateNodeBounds(node2, outerShape);
+ node2.intersect = function(point8) {
+ log.info("iconSquare intersect", node2, point8);
+ if (!node2.label) {
+ return intersect_default.rect(node2, point8);
+ }
+ const dx = node2.x ?? 0;
+ const dy = node2.y ?? 0;
+ const nodeHeight = node2.height ?? 0;
+ let points = [];
+ if (topLabel) {
+ points = [
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx + width3 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - width3 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding }
+ ];
+ } else {
+ points = [
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 + height2 }
+ ];
+ }
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_iconRounded = __esm({
+ "src/rendering-util/rendering-elements/shapes/iconRounded.ts"() {
"use strict";
- init_util2();
- init_intersect2();
init_rough_esm();
+ init_logger();
+ init_icons();
+ init_intersect();
init_handDrawnShapeStyles();
- init_diagramAPI();
- stateStart = /* @__PURE__ */ __name((parent4, node2) => {
- const { themeVariables } = getConfig2();
- const { lineColor } = themeVariables;
- const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
- let circle6;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const roughNode = rc.circle(0, 0, 14, solidStateFill(lineColor));
- circle6 = shapeSvg.insert(() => roughNode);
- } else {
- circle6 = shapeSvg.insert("circle", ":first-child");
- }
- circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
- updateNodeBounds2(node2, circle6);
- node2.intersect = function(point8) {
- return intersect_default2.circle(node2, 7, point8);
- };
- return shapeSvg;
- }, "stateStart");
+ init_roundedRectPath();
+ init_util();
+ __name(iconRounded, "iconRounded");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/iconSquare.ts
+ async function iconSquare(parent4, node2, { config: { themeVariables, flowchart } }) {
+ const { labelStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const assetHeight = node2.assetHeight ?? 48;
+ const assetWidth = node2.assetWidth ?? 48;
+ const iconSize = Math.max(assetHeight, assetWidth);
+ const defaultWidth = flowchart?.wrappingWidth;
+ node2.width = Math.max(iconSize, defaultWidth ?? 0);
+ const { shapeSvg, bbox, halfPadding, label } = await labelHelper(
+ parent4,
+ node2,
+ "icon-shape default"
+ );
+ const topLabel = node2.pos === "t";
+ const height2 = iconSize + halfPadding * 2;
+ const width3 = iconSize + halfPadding * 2;
+ const { nodeBorder, mainBkg } = themeVariables;
+ const { stylesMap } = compileStyles(node2);
+ const x5 = -width3 / 2;
+ const y5 = -height2 / 2;
+ const labelPadding = node2.label ? 8 : 0;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const fill = stylesMap.get("fill");
+ options3.stroke = fill ?? mainBkg;
+ const iconNode = rc.path(createRoundedRectPathD(x5, y5, width3, height2, 0.1), options3);
+ const outerWidth = Math.max(width3, bbox.width);
+ const outerHeight = height2 + bbox.height + labelPadding;
+ const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
+ ...options3,
+ fill: "transparent",
+ stroke: "none"
+ });
+ const iconShape = shapeSvg.insert(() => iconNode, ":first-child");
+ const outerShape = shapeSvg.insert(() => outerNode);
+ if (node2.icon) {
+ const iconElem = shapeSvg.append("g");
+ iconElem.html(
+ `${await getIconSVG(node2.icon, {
+ height: iconSize,
+ width: iconSize,
+ fallbackPrefix: ""
+ })} `
+ );
+ const iconBBox = iconElem.node().getBBox();
+ const iconWidth = iconBBox.width;
+ const iconHeight = iconBBox.height;
+ const iconX = iconBBox.x;
+ const iconY = iconBBox.y;
+ iconElem.attr(
+ "transform",
+ `translate(${-iconWidth / 2 - iconX},${topLabel ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY})`
+ );
+ iconElem.attr("style", `color: ${stylesMap.get("stroke") ?? nodeBorder};`);
}
- });
-
- // src/rendering-util/rendering-elements/shapes/stateEnd.ts
- var stateEnd;
- var init_stateEnd = __esm({
- "src/rendering-util/rendering-elements/shapes/stateEnd.ts"() {
+ label.attr(
+ "transform",
+ `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height})`
+ );
+ iconShape.attr(
+ "transform",
+ `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
+ );
+ updateNodeBounds(node2, outerShape);
+ node2.intersect = function(point8) {
+ log.info("iconSquare intersect", node2, point8);
+ if (!node2.label) {
+ return intersect_default.rect(node2, point8);
+ }
+ const dx = node2.x ?? 0;
+ const dy = node2.y ?? 0;
+ const nodeHeight = node2.height ?? 0;
+ let points = [];
+ if (topLabel) {
+ points = [
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx + width3 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - width3 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding }
+ ];
+ } else {
+ points = [
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 },
+ { x: dx + width3 / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height2 },
+ { x: dx - width3 / 2, y: dy - nodeHeight / 2 + height2 }
+ ];
+ }
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_iconSquare = __esm({
+ "src/rendering-util/rendering-elements/shapes/iconSquare.ts"() {
"use strict";
- init_util2();
- init_intersect2();
init_rough_esm();
+ init_logger();
+ init_icons();
+ init_intersect();
+ init_roundedRectPath();
init_handDrawnShapeStyles();
- init_diagramAPI();
- stateEnd = /* @__PURE__ */ __name((parent4, node2) => {
- const { themeVariables } = getConfig2();
- const { lineColor } = themeVariables;
- const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
- let circle6;
- let innerCircle;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const roughNode = rc.circle(0, 0, 14, { ...solidStateFill(lineColor), roughness: 0.5 });
- const roughInnerNode = rc.circle(0, 0, 5, { ...solidStateFill(lineColor), fillStyle: "solid" });
- circle6 = shapeSvg.insert(() => roughNode);
- innerCircle = shapeSvg.insert(() => roughInnerNode);
- } else {
- innerCircle = shapeSvg.insert("circle", ":first-child");
- circle6 = shapeSvg.insert("circle", ":first-child");
- circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
- innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10);
- }
- updateNodeBounds2(node2, circle6);
- node2.intersect = function(point8) {
- return intersect_default2.circle(node2, 7, point8);
- };
- return shapeSvg;
- }, "stateEnd");
+ init_util();
+ __name(iconSquare, "iconSquare");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/imageSquare.ts
+ async function imageSquare(parent4, node2, { config: { flowchart } }) {
+ const img = new Image();
+ img.src = node2?.img ?? "";
+ await img.decode();
+ const imageNaturalWidth = Number(img.naturalWidth.toString().replace("px", ""));
+ const imageNaturalHeight = Number(img.naturalHeight.toString().replace("px", ""));
+ node2.imageAspectRatio = imageNaturalWidth / imageNaturalHeight;
+ const { labelStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const defaultWidth = flowchart?.wrappingWidth;
+ node2.defaultWidth = flowchart?.wrappingWidth;
+ const imageRawWidth = Math.max(
+ node2.label ? defaultWidth ?? 0 : 0,
+ node2?.assetWidth ?? imageNaturalWidth
+ );
+ const imageWidth = node2.constraint === "on" ? node2?.assetHeight ? node2.assetHeight * node2.imageAspectRatio : imageRawWidth : imageRawWidth;
+ const imageHeight = node2.constraint === "on" ? imageWidth / node2.imageAspectRatio : node2?.assetHeight ?? imageNaturalHeight;
+ node2.width = Math.max(imageWidth, defaultWidth ?? 0);
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, "image-shape default");
+ const topLabel = node2.pos === "t";
+ const x5 = -imageWidth / 2;
+ const y5 = -imageHeight / 2;
+ const labelPadding = node2.label ? 8 : 0;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const imageNode = rc.rectangle(x5, y5, imageWidth, imageHeight, options3);
+ const outerWidth = Math.max(imageWidth, bbox.width);
+ const outerHeight = imageHeight + bbox.height + labelPadding;
+ const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
+ ...options3,
+ fill: "none",
+ stroke: "none"
+ });
+ const iconShape = shapeSvg.insert(() => imageNode, ":first-child");
+ const outerShape = shapeSvg.insert(() => outerNode);
+ if (node2.img) {
+ const image = shapeSvg.append("image");
+ image.attr("href", node2.img);
+ image.attr("width", imageWidth);
+ image.attr("height", imageHeight);
+ image.attr("preserveAspectRatio", "none");
+ image.attr(
+ "transform",
+ `translate(${-imageWidth / 2},${topLabel ? outerHeight / 2 - imageHeight : -outerHeight / 2})`
+ );
}
- });
-
- // src/rendering-util/rendering-elements/shapes/forkJoin.ts
- var forkJoin2;
- var init_forkJoin = __esm({
- "src/rendering-util/rendering-elements/shapes/forkJoin.ts"() {
+ label.attr(
+ "transform",
+ `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -imageHeight / 2 - bbox.height / 2 - labelPadding / 2 : imageHeight / 2 - bbox.height / 2 + labelPadding / 2})`
+ );
+ iconShape.attr(
+ "transform",
+ `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
+ );
+ updateNodeBounds(node2, outerShape);
+ node2.intersect = function(point8) {
+ log.info("iconSquare intersect", node2, point8);
+ if (!node2.label) {
+ return intersect_default.rect(node2, point8);
+ }
+ const dx = node2.x ?? 0;
+ const dy = node2.y ?? 0;
+ const nodeHeight = node2.height ?? 0;
+ let points = [];
+ if (topLabel) {
+ points = [
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx + imageWidth / 2, y: dy + nodeHeight / 2 },
+ { x: dx - imageWidth / 2, y: dy + nodeHeight / 2 },
+ { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding }
+ ];
+ } else {
+ points = [
+ { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 },
+ { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 },
+ { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 + imageHeight },
+ { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + imageHeight },
+ { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },
+ { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },
+ { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + imageHeight },
+ { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 + imageHeight }
+ ];
+ }
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_imageSquare = __esm({
+ "src/rendering-util/rendering-elements/shapes/imageSquare.ts"() {
"use strict";
- init_util2();
- init_intersect2();
init_rough_esm();
+ init_logger();
+ init_intersect();
init_handDrawnShapeStyles();
- init_diagramAPI();
- forkJoin2 = /* @__PURE__ */ __name((parent4, node2, dir2) => {
- const { themeVariables } = getConfig2();
- const { lineColor } = themeVariables;
- const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
- let width3 = 70;
- let height2 = 10;
- if (dir2 === "LR") {
- width3 = 10;
- height2 = 70;
- }
- const x5 = -1 * width3 / 2;
- const y5 = -1 * height2 / 2;
- let shape;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const roughNode = rc.rectangle(x5, y5, width3, height2, solidStateFill(lineColor));
- shape = shapeSvg.insert(() => roughNode);
- } else {
- shape = shapeSvg.append("rect").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("class", "fork-join");
- }
- updateNodeBounds2(node2, shape);
- let nodeHeight = 0;
- let nodeWidth = 0;
- let nodePadding = 10;
- if (node2.height) {
- nodeHeight = node2.height;
- }
- if (node2.width) {
- nodeWidth = node2.width;
- }
- if (node2.padding) {
- nodePadding = node2.padding;
- }
- node2.height = nodeHeight + nodePadding / 2;
- node2.width = nodeWidth + nodePadding / 2;
- node2.intersect = function(point8) {
- return intersect_default2.rect(node2, point8);
- };
- return shapeSvg;
- }, "forkJoin");
+ init_util();
+ __name(imageSquare, "imageSquare");
}
});
- // src/rendering-util/rendering-elements/shapes/choice.ts
- var choice2;
- var init_choice = __esm({
- "src/rendering-util/rendering-elements/shapes/choice.ts"() {
- "use strict";
- init_intersect2();
- init_rough_esm();
- init_handDrawnShapeStyles();
- init_diagramAPI();
- choice2 = /* @__PURE__ */ __name((parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { themeVariables } = getConfig2();
- const { lineColor } = themeVariables;
- const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
- const s2 = 28;
- const points = [
- { x: 0, y: s2 / 2 },
- { x: s2 / 2, y: 0 },
- { x: 0, y: -s2 / 2 },
- { x: -s2 / 2, y: 0 }
- ];
- let choice3;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const pointArr = points.map(function(d2) {
- return [d2.x, d2.y];
- });
- const roughNode = rc.polygon(pointArr, solidStateFill(lineColor));
- choice3 = shapeSvg.insert(() => roughNode);
- } else {
- choice3 = shapeSvg.insert("polygon", ":first-child").attr(
- "points",
- points.map(function(d2) {
- return d2.x + "," + d2.y;
- }).join(" ")
- );
- }
- choice3.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28).attr("style", nodeStyles);
- node2.width = 28;
- node2.height = 28;
- node2.intersect = function(point8) {
- return intersect_default2.circle(node2, 14, point8);
- };
- return shapeSvg;
- }, "choice");
+ // src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts
+ async function inv_trapezoid(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const points = [
+ { x: 0, y: 0 },
+ { x: w3, y: 0 },
+ { x: w3 + 3 * h2 / 6, y: -h2 },
+ { x: -3 * h2 / 6, y: -h2 }
+ ];
+ let polygon2;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const pathData = createPathFromPoints(points);
+ const roughNode = rc.path(pathData, options3);
+ polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
+ if (cssStyles) {
+ polygon2.attr("style", cssStyles);
+ }
+ } else {
+ polygon2 = insertPolygonShape(shapeSvg, w3, h2, points);
}
- });
-
- // src/rendering-util/rendering-elements/shapes/note.ts
- var note2;
- var init_note2 = __esm({
- "src/rendering-util/rendering-elements/shapes/note.ts"() {
- "use strict";
- init_logger();
- init_util2();
- init_intersect2();
- init_diagramAPI();
- init_rough_esm();
- note2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { themeVariables, handDrawnSeed } = getConfig2();
- const { noteBorderColor, noteBkgColor } = themeVariables;
- const useHtmlLabels = node2.useHtmlLabels;
- if (!useHtmlLabels) {
- node2.centerLabel = true;
- }
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, "node " + node2.cssClasses);
- log.info("Classes = ", node2.cssClasses);
- const { cssStyles } = node2;
- let rect4;
- const totalWidth = bbox.width + node2.padding;
- const totalHeight = bbox.height + node2.padding;
- const x5 = -totalWidth / 2;
- const y5 = -totalHeight / 2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const roughNode = rc.rectangle(x5, y5, totalWidth, totalHeight, {
- roughness: 0.7,
- fill: noteBkgColor,
- fillWeight: 3,
- seed: handDrawnSeed,
- // fillStyle: 'solid', // solid fill'
- stroke: noteBorderColor
- });
- rect4 = shapeSvg.insert(() => roughNode, ":first-child");
- rect4.attr("class", "basic label-container").attr("style", cssStyles);
- } else {
- rect4 = shapeSvg.insert("rect", ":first-child");
- rect4.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
- }
- updateNodeBounds2(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default2.rect(node2, point8);
- };
- return shapeSvg;
- }, "note");
+ if (nodeStyles) {
+ polygon2.attr("style", nodeStyles);
}
- });
-
- // src/rendering-util/rendering-elements/shapes/stadium.ts
- var stadium2;
- var init_stadium = __esm({
- "src/rendering-util/rendering-elements/shapes/stadium.ts"() {
+ node2.width = w3;
+ node2.height = h2;
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }
+ var init_invertedTrapezoid = __esm({
+ "src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts"() {
"use strict";
- init_util2();
- init_intersect2();
+ init_util();
+ init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
- init_roundedRectPath();
- stadium2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const h2 = bbox.height + node2.padding;
- const w3 = bbox.width + h2 / 4 + node2.padding;
- let rect4;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const pathData = createRoundedRectPathD(-w3 / 2, -h2 / 2, w3, h2, h2 / 2);
- const roughNode = rc.path(pathData, options3);
- rect4 = shapeSvg.insert(() => roughNode, ":first-child");
- rect4.attr("class", "basic label-container").attr("style", cssStyles);
- } else {
- rect4 = shapeSvg.insert("rect", ":first-child");
- rect4.attr("class", "basic label-container").attr("style", nodeStyles).attr("rx", h2 / 2).attr("ry", h2 / 2).attr("x", -w3 / 2).attr("y", -h2 / 2).attr("width", w3).attr("height", h2);
- }
- updateNodeBounds2(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default2.rect(node2, point8);
- };
- return shapeSvg;
- }, "stadium");
+ init_insertPolygonShape();
+ __name(inv_trapezoid, "inv_trapezoid");
}
});
- // src/rendering-util/rendering-elements/shapes/rectWithTitle.ts
- var rectWithTitle2;
- var init_rectWithTitle = __esm({
- "src/rendering-util/rendering-elements/shapes/rectWithTitle.ts"() {
+ // src/rendering-util/rendering-elements/shapes/drawRect.ts
+ async function drawRect3(parent4, node2, options3) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const totalWidth = Math.max(bbox.width + options3.labelPaddingX * 2, node2?.width || 0);
+ const totalHeight = Math.max(bbox.height + options3.labelPaddingY * 2, node2?.height || 0);
+ const x5 = -totalWidth / 2;
+ const y5 = -totalHeight / 2;
+ let rect3;
+ let { rx, ry } = node2;
+ const { cssStyles } = node2;
+ if (options3?.rx && options3.ry) {
+ rx = options3.rx;
+ ry = options3.ry;
+ }
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options4 = userNodeOverrides(node2, {});
+ const roughNode = rx || ry ? rc.path(createRoundedRectPathD(x5, y5, totalWidth, totalHeight, rx || 0), options4) : rc.rectangle(x5, y5, totalWidth, totalHeight, options4);
+ rect3 = shapeSvg.insert(() => roughNode, ":first-child");
+ rect3.attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles));
+ } else {
+ rect3 = shapeSvg.insert("rect", ":first-child");
+ rect3.attr("class", "basic label-container").attr("style", nodeStyles).attr("rx", handleUndefinedAttr(rx)).attr("ry", handleUndefinedAttr(ry)).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
+ }
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
+ }
+ var init_drawRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/drawRect.ts"() {
"use strict";
- init_src32();
- init_common();
- init_util2();
- init_createLabel2();
- init_intersect2();
+ init_util();
+ init_intersect();
+ init_roundedRectPath();
init_handDrawnShapeStyles();
init_rough_esm();
- init_diagramAPI();
- init_roundedRectPath();
- init_logger();
- rectWithTitle2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- let classes6;
- if (!node2.cssClasses) {
- classes6 = "node default";
- } else {
- classes6 = "node " + node2.cssClasses;
- }
- const shapeSvg = parent4.insert("g").attr("class", classes6).attr("id", node2.domId || node2.id);
- const g2 = shapeSvg.insert("g");
- const label = shapeSvg.insert("g").attr("class", "label").attr("style", nodeStyles);
- const description = node2.description;
- const title2 = node2.label;
- const text2 = label.node().appendChild(await createLabel_default2(title2, node2.labelStyle, true, true));
- let bbox = { width: 0, height: 0 };
- if (evaluate(getConfig2()?.flowchart?.htmlLabels)) {
- const div2 = text2.children[0];
- const dv2 = select_default2(text2);
- bbox = div2.getBoundingClientRect();
- dv2.attr("width", bbox.width);
- dv2.attr("height", bbox.height);
- }
- log.info("Text 2", description);
- const textRows = description || [];
- const titleBox = text2.getBBox();
- const descr = label.node().appendChild(
- await createLabel_default2(
- textRows.join ? textRows.join(" ") : textRows,
- node2.labelStyle,
- true,
- true
- )
- );
- const div = descr.children[0];
- const dv = select_default2(descr);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- const halfPadding = (node2.padding || 0) / 2;
- select_default2(descr).attr(
- "transform",
- "translate( " + (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")"
- );
- select_default2(text2).attr(
- "transform",
- "translate( " + (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)"
- );
- bbox = label.node().getBBox();
- label.attr(
- "transform",
- "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")"
- );
- const totalWidth = bbox.width + (node2.padding || 0);
- const totalHeight = bbox.height + (node2.padding || 0);
- const x5 = -bbox.width / 2 - halfPadding;
- const y5 = -bbox.height / 2 - halfPadding;
- let rect4;
- let innerLine;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const roughNode = rc.path(
- createRoundedRectPathD(x5, y5, totalWidth, totalHeight, node2.rx || 0),
- options3
- );
- const roughLine = rc.line(
- -bbox.width / 2 - halfPadding,
- -bbox.height / 2 - halfPadding + titleBox.height + halfPadding,
- bbox.width / 2 + halfPadding,
- -bbox.height / 2 - halfPadding + titleBox.height + halfPadding,
- options3
- );
- innerLine = shapeSvg.insert(() => {
- log.debug("Rough node insert CXC", roughNode);
- return roughLine;
- }, ":first-child");
- rect4 = shapeSvg.insert(() => {
- log.debug("Rough node insert CXC", roughNode);
- return roughNode;
- }, ":first-child");
- } else {
- rect4 = g2.insert("rect", ":first-child");
- innerLine = g2.insert("line");
- rect4.attr("class", "outer title-state").attr("style", nodeStyles).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + (node2.padding || 0)).attr("height", bbox.height + (node2.padding || 0));
- innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);
- }
- updateNodeBounds2(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default2.rect(node2, point8);
- };
- return shapeSvg;
- }, "rectWithTitle");
+ init_utils2();
+ __name(drawRect3, "drawRect");
}
});
- // src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts
- function insertPolygonShape2(parent4, w3, h2, points) {
- return parent4.insert("polygon", ":first-child").attr(
- "points",
- points.map(function(d2) {
- return d2.x + "," + d2.y;
- }).join(" ")
- ).attr("class", "label-container").attr("transform", "translate(" + -w3 / 2 + "," + h2 / 2 + ")");
+ // src/rendering-util/rendering-elements/shapes/labelRect.ts
+ async function labelRect(parent4, node2) {
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, "label");
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ const totalWidth = 0.1;
+ const totalHeight = 0.1;
+ rect3.attr("width", totalWidth).attr("height", totalHeight);
+ shapeSvg.attr("class", "label edgeLabel");
+ label.attr(
+ "transform",
+ `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
}
- var init_insertPolygonShape = __esm({
- "src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts"() {
+ var init_labelRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/labelRect.ts"() {
"use strict";
- __name(insertPolygonShape2, "insertPolygonShape");
+ init_drawRect();
+ init_util();
+ init_intersect();
+ __name(labelRect, "labelRect");
}
});
- // src/rendering-util/rendering-elements/shapes/subroutine.ts
- var subroutine2;
- var init_subroutine = __esm({
- "src/rendering-util/rendering-elements/shapes/subroutine.ts"() {
+ // src/rendering-util/rendering-elements/shapes/leanLeft.ts
+ async function lean_left(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0), node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0), node2?.height ?? 0);
+ const points = [
+ { x: 0, y: 0 },
+ { x: w3 + 3 * h2 / 6, y: 0 },
+ { x: w3, y: -h2 },
+ { x: -(3 * h2) / 6, y: -h2 }
+ ];
+ let polygon2;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const pathData = createPathFromPoints(points);
+ const roughNode = rc.path(pathData, options3);
+ polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
+ if (cssStyles) {
+ polygon2.attr("style", cssStyles);
+ }
+ } else {
+ polygon2 = insertPolygonShape(shapeSvg, w3, h2, points);
+ }
+ if (nodeStyles) {
+ polygon2.attr("style", nodeStyles);
+ }
+ node2.width = w3;
+ node2.height = h2;
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }
+ var init_leanLeft = __esm({
+ "src/rendering-util/rendering-elements/shapes/leanLeft.ts"() {
"use strict";
- init_util2();
- init_intersect2();
+ init_util();
+ init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_insertPolygonShape();
- subroutine2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const halfPadding = (node2?.padding || 0) / 2;
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const x5 = -bbox.width / 2 - halfPadding;
- const y5 = -bbox.height / 2 - halfPadding;
- const points = [
- { x: 0, y: 0 },
- { x: w3, y: 0 },
- { x: w3, y: -h2 },
- { x: 0, y: -h2 },
- { x: 0, y: 0 },
- { x: -8, y: 0 },
- { x: w3 + 8, y: 0 },
- { x: w3 + 8, y: -h2 },
- { x: -8, y: -h2 },
- { x: -8, y: 0 }
- ];
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const roughNode = rc.rectangle(x5 - 8, y5, w3 + 16, h2, options3);
- const l1 = rc.line(x5, y5, x5, y5 + h2, options3);
- const l2 = rc.line(x5 + w3, y5, x5 + w3, y5 + h2, options3);
- shapeSvg.insert(() => l1, ":first-child");
- shapeSvg.insert(() => l2, ":first-child");
- const rect4 = shapeSvg.insert(() => roughNode, ":first-child");
- const { cssStyles } = node2;
- rect4.attr("class", "basic label-container").attr("style", cssStyles);
- updateNodeBounds2(node2, rect4);
- } else {
- const el = insertPolygonShape2(shapeSvg, w3, h2, points);
- if (nodeStyles) {
- el.attr("style", nodeStyles);
- }
- updateNodeBounds2(node2, el);
- }
- node2.intersect = function(point8) {
- return intersect_default2.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "subroutine");
+ __name(lean_left, "lean_left");
}
});
- // src/rendering-util/rendering-elements/shapes/cylinder.ts
- var createCylinderPathD, createOuterCylinderPathD, createInnerCylinderPathD, cylinder2;
- var init_cylinder = __esm({
- "src/rendering-util/rendering-elements/shapes/cylinder.ts"() {
+ // src/rendering-util/rendering-elements/shapes/leanRight.ts
+ async function lean_right(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0), node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0), node2?.height ?? 0);
+ const points = [
+ { x: -3 * h2 / 6, y: 0 },
+ { x: w3, y: 0 },
+ { x: w3 + 3 * h2 / 6, y: -h2 },
+ { x: 0, y: -h2 }
+ ];
+ let polygon2;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const pathData = createPathFromPoints(points);
+ const roughNode = rc.path(pathData, options3);
+ polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
+ if (cssStyles) {
+ polygon2.attr("style", cssStyles);
+ }
+ } else {
+ polygon2 = insertPolygonShape(shapeSvg, w3, h2, points);
+ }
+ if (nodeStyles) {
+ polygon2.attr("style", nodeStyles);
+ }
+ node2.width = w3;
+ node2.height = h2;
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }
+ var init_leanRight = __esm({
+ "src/rendering-util/rendering-elements/shapes/leanRight.ts"() {
"use strict";
- init_util2();
- init_intersect2();
+ init_util();
+ init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
- createCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ init_insertPolygonShape();
+ __name(lean_right, "lean_right");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/lightningBolt.ts
+ function lightningBolt(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.label = "";
+ node2.labelStyle = labelStyles;
+ const shapeSvg = parent4.insert("g").attr("class", getNodeClasses(node2)).attr("id", node2.domId ?? node2.id);
+ const { cssStyles } = node2;
+ const width3 = Math.max(35, node2?.width ?? 0);
+ const height2 = Math.max(35, node2?.height ?? 0);
+ const gap = 7;
+ const points = [
+ { x: width3, y: 0 },
+ { x: 0, y: height2 + gap / 2 },
+ { x: width3 - 2 * gap, y: height2 + gap / 2 },
+ { x: 0, y: 2 * height2 },
+ { x: width3, y: height2 - gap / 2 },
+ { x: 2 * gap, y: height2 - gap / 2 }
+ ];
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const linePath = createPathFromPoints(points);
+ const lineNode = rc.path(linePath, options3);
+ const lightningBolt2 = shapeSvg.insert(() => lineNode, ":first-child");
+ if (cssStyles && node2.look !== "handDrawn") {
+ lightningBolt2.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ lightningBolt2.selectAll("path").attr("style", nodeStyles);
+ }
+ lightningBolt2.attr("transform", `translate(-${width3 / 2},${-height2})`);
+ updateNodeBounds(node2, lightningBolt2);
+ node2.intersect = function(point8) {
+ log.info("lightningBolt intersect", node2, point8);
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_lightningBolt = __esm({
+ "src/rendering-util/rendering-elements/shapes/lightningBolt.ts"() {
+ "use strict";
+ init_logger();
+ init_util();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_intersect();
+ init_util();
+ __name(lightningBolt, "lightningBolt");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/linedCylinder.ts
+ async function linedCylinder(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0), node2.width ?? 0);
+ const rx = w3 / 2;
+ const ry = rx / (2.5 + w3 / 50);
+ const h2 = Math.max(bbox.height + ry + (node2.padding ?? 0), node2.height ?? 0);
+ const outerOffset = h2 * 0.1;
+ let cylinder3;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const outerPathData = createOuterCylinderPathD2(0, 0, w3, h2, rx, ry, outerOffset);
+ const innerPathData = createInnerCylinderPathD2(0, ry, w3, h2, rx, ry);
+ const options3 = userNodeOverrides(node2, {});
+ const outerNode = rc.path(outerPathData, options3);
+ const innerLine = rc.path(innerPathData, options3);
+ const innerLineEl = shapeSvg.insert(() => innerLine, ":first-child");
+ innerLineEl.attr("class", "line");
+ cylinder3 = shapeSvg.insert(() => outerNode, ":first-child");
+ cylinder3.attr("class", "basic label-container");
+ if (cssStyles) {
+ cylinder3.attr("style", cssStyles);
+ }
+ } else {
+ const pathData = createCylinderPathD2(0, 0, w3, h2, rx, ry, outerOffset);
+ cylinder3 = shapeSvg.insert("path", ":first-child").attr("d", pathData).attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles)).attr("style", nodeStyles);
+ }
+ cylinder3.attr("label-offset-y", ry);
+ cylinder3.attr("transform", `translate(${-w3 / 2}, ${-(h2 / 2 + ry)})`);
+ updateNodeBounds(node2, cylinder3);
+ label.attr(
+ "transform",
+ `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + ry - (bbox.y - (bbox.top ?? 0))})`
+ );
+ node2.intersect = function(point8) {
+ const pos = intersect_default.rect(node2, point8);
+ const x5 = pos.x - (node2.x ?? 0);
+ if (rx != 0 && (Math.abs(x5) < (node2.width ?? 0) / 2 || Math.abs(x5) == (node2.width ?? 0) / 2 && Math.abs(pos.y - (node2.y ?? 0)) > (node2.height ?? 0) / 2 - ry)) {
+ let y5 = ry * ry * (1 - x5 * x5 / (rx * rx));
+ if (y5 > 0) {
+ y5 = Math.sqrt(y5);
+ }
+ y5 = ry - y5;
+ if (point8.y - (node2.y ?? 0) > 0) {
+ y5 = -y5;
+ }
+ pos.y += y5;
+ }
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var createCylinderPathD2, createOuterCylinderPathD2, createInnerCylinderPathD2;
+ var init_linedCylinder = __esm({
+ "src/rendering-util/rendering-elements/shapes/linedCylinder.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_utils2();
+ createCylinderPathD2 = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry, outerOffset) => {
return [
`M${x5},${y5 + ry}`,
`a${rx},${ry} 0,0,0 ${width3},0`,
`a${rx},${ry} 0,0,0 ${-width3},0`,
`l0,${height2}`,
`a${rx},${ry} 0,0,0 ${width3},0`,
- `l0,${-height2}`
+ `l0,${-height2}`,
+ `M${x5},${y5 + ry + outerOffset}`,
+ `a${rx},${ry} 0,0,0 ${width3},0`
].join(" ");
}, "createCylinderPathD");
- createOuterCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ createOuterCylinderPathD2 = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry, outerOffset) => {
return [
`M${x5},${y5 + ry}`,
`M${x5 + width3},${y5 + ry}`,
`a${rx},${ry} 0,0,0 ${-width3},0`,
`l0,${height2}`,
`a${rx},${ry} 0,0,0 ${width3},0`,
- `l0,${-height2}`
+ `l0,${-height2}`,
+ `M${x5},${y5 + ry + outerOffset}`,
+ `a${rx},${ry} 0,0,0 ${width3},0`
].join(" ");
}, "createOuterCylinderPathD");
- createInnerCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ createInnerCylinderPathD2 = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
return [`M${x5 - width3 / 2},${-height2 / 2}`, `a${rx},${ry} 0,0,0 ${width3},0`].join(" ");
}, "createInnerCylinderPathD");
- cylinder2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const w3 = bbox.width + node2.padding;
- const rx = w3 / 2;
- const ry = rx / (2.5 + w3 / 50);
- const h2 = bbox.height + ry + node2.padding;
- let cylinder3;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const outerPathData = createOuterCylinderPathD(0, 0, w3, h2, rx, ry);
- const innerPathData = createInnerCylinderPathD(0, ry, w3, h2, rx, ry);
- const outerNode = rc.path(outerPathData, userNodeOverrides(node2, {}));
- const innerLine = rc.path(innerPathData, userNodeOverrides(node2, { fill: "none" }));
- cylinder3 = shapeSvg.insert(() => innerLine, ":first-child");
- cylinder3 = shapeSvg.insert(() => outerNode, ":first-child");
- cylinder3.attr("class", "basic label-container");
- if (cssStyles) {
- cylinder3.attr("style", cssStyles);
- }
- } else {
- const pathData = createCylinderPathD(0, 0, w3, h2, rx, ry);
- cylinder3 = shapeSvg.insert("path", ":first-child").attr("d", pathData).attr("class", "basic label-container").attr("style", cssStyles).attr("style", nodeStyles);
- }
- cylinder3.attr("label-offset-y", ry);
- cylinder3.attr("transform", `translate(${-w3 / 2}, ${-(h2 / 2 + ry)})`);
- updateNodeBounds2(node2, cylinder3);
- node2.intersect = function(point8) {
- const pos = intersect_default2.rect(node2, point8);
- const x5 = pos.x - (node2.x ?? 0);
- if (rx != 0 && (Math.abs(x5) < (node2.width ?? 0) / 2 || Math.abs(x5) == (node2.width ?? 0) / 2 && Math.abs(pos.y - (node2.y ?? 0)) > (node2.height ?? 0) / 2 - ry)) {
- let y5 = ry * ry * (1 - x5 * x5 / (rx * rx));
- if (y5 > 0) {
- y5 = Math.sqrt(y5);
- }
- y5 = ry - y5;
- if (point8.y - (node2.y ?? 0) > 0) {
- y5 = -y5;
- }
- pos.y += y5;
- }
- return pos;
- };
- return shapeSvg;
- }, "cylinder");
- }
- });
-
- // src/rendering-util/rendering-elements/shapes/circle.ts
- var circle3;
- var init_circle = __esm({
- "src/rendering-util/rendering-elements/shapes/circle.ts"() {
+ __name(linedCylinder, "linedCylinder");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/linedWaveEdgedRect.ts
+ async function linedWaveEdgedRect(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const waveAmplitude = h2 / 4;
+ const finalH = h2 + waveAmplitude;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: -w3 / 2 - w3 / 2 * 0.1, y: -finalH / 2 },
+ { x: -w3 / 2 - w3 / 2 * 0.1, y: finalH / 2 },
+ ...generateFullSineWavePoints(
+ -w3 / 2 - w3 / 2 * 0.1,
+ finalH / 2,
+ w3 / 2 + w3 / 2 * 0.1,
+ finalH / 2,
+ waveAmplitude,
+ 0.8
+ ),
+ { x: w3 / 2 + w3 / 2 * 0.1, y: -finalH / 2 },
+ { x: -w3 / 2 - w3 / 2 * 0.1, y: -finalH / 2 },
+ { x: -w3 / 2, y: -finalH / 2 },
+ { x: -w3 / 2, y: finalH / 2 * 1.1 },
+ { x: -w3 / 2, y: -finalH / 2 }
+ ];
+ const poly = rc.polygon(
+ points.map((p3) => [p3.x, p3.y]),
+ options3
+ );
+ const waveEdgeRect = shapeSvg.insert(() => poly, ":first-child");
+ waveEdgeRect.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ waveEdgeRect.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ waveEdgeRect.selectAll("path").attr("style", nodeStyles);
+ }
+ waveEdgeRect.attr("transform", `translate(0,${-waveAmplitude / 2})`);
+ label.attr(
+ "transform",
+ `translate(${-w3 / 2 + (node2.padding ?? 0) + w3 / 2 * 0.1 / 2 - (bbox.x - (bbox.left ?? 0))},${-h2 / 2 + (node2.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, waveEdgeRect);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_linedWaveEdgedRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/linedWaveEdgedRect.ts"() {
"use strict";
- init_logger();
- init_util2();
- init_intersect2();
- init_handDrawnShapeStyles();
+ init_util();
+ init_intersect();
init_rough_esm();
- circle3 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox, halfPadding } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const radius2 = bbox.width / 2 + halfPadding;
- let circleElem;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const roughNode = rc.circle(0, 0, radius2 * 2, options3);
- circleElem = shapeSvg.insert(() => roughNode, ":first-child");
- circleElem.attr("class", "basic label-container").attr("style", cssStyles);
- } else {
- circleElem = shapeSvg.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", nodeStyles).attr("r", radius2).attr("cx", 0).attr("cy", 0);
- }
- updateNodeBounds2(node2, circleElem);
- node2.intersect = function(point8) {
- log.info("Circle intersect", node2, radius2, point8);
- return intersect_default2.circle(node2, radius2, point8);
- };
- return shapeSvg;
- }, "circle");
- }
- });
-
- // src/rendering-util/rendering-elements/shapes/doubleCircle.ts
- var doublecircle2;
- var init_doubleCircle = __esm({
- "src/rendering-util/rendering-elements/shapes/doubleCircle.ts"() {
+ init_handDrawnShapeStyles();
+ __name(linedWaveEdgedRect, "linedWaveEdgedRect");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/multiRect.ts
+ async function multiRect(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const rectOffset = 5;
+ const x5 = -w3 / 2;
+ const y5 = -h2 / 2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const outerPathPoints = [
+ { x: x5 - rectOffset, y: y5 + rectOffset },
+ { x: x5 - rectOffset, y: y5 + h2 + rectOffset },
+ { x: x5 + w3 - rectOffset, y: y5 + h2 + rectOffset },
+ { x: x5 + w3 - rectOffset, y: y5 + h2 },
+ { x: x5 + w3, y: y5 + h2 },
+ { x: x5 + w3, y: y5 + h2 - rectOffset },
+ { x: x5 + w3 + rectOffset, y: y5 + h2 - rectOffset },
+ { x: x5 + w3 + rectOffset, y: y5 - rectOffset },
+ { x: x5 + rectOffset, y: y5 - rectOffset },
+ { x: x5 + rectOffset, y: y5 },
+ { x: x5, y: y5 },
+ { x: x5, y: y5 + rectOffset }
+ ];
+ const innerPathPoints = [
+ { x: x5, y: y5 + rectOffset },
+ { x: x5 + w3 - rectOffset, y: y5 + rectOffset },
+ { x: x5 + w3 - rectOffset, y: y5 + h2 },
+ { x: x5 + w3, y: y5 + h2 },
+ { x: x5 + w3, y: y5 },
+ { x: x5, y: y5 }
+ ];
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const outerPath = createPathFromPoints(outerPathPoints);
+ const outerNode = rc.path(outerPath, options3);
+ const innerPath3 = createPathFromPoints(innerPathPoints);
+ const innerNode = rc.path(innerPath3, { ...options3, fill: "none" });
+ const multiRect2 = shapeSvg.insert(() => innerNode, ":first-child");
+ multiRect2.insert(() => outerNode, ":first-child");
+ multiRect2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ multiRect2.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ multiRect2.selectAll("path").attr("style", nodeStyles);
+ }
+ label.attr(
+ "transform",
+ `translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, multiRect2);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, outerPathPoints, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_multiRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/multiRect.ts"() {
"use strict";
- init_logger();
- init_util2();
- init_intersect2();
+ init_util();
init_handDrawnShapeStyles();
init_rough_esm();
- doublecircle2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox, halfPadding } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const gap = 5;
- const outerRadius = bbox.width / 2 + halfPadding + gap;
- const innerRadius = bbox.width / 2 + halfPadding;
- let circleGroup;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const outerOptions = userNodeOverrides(node2, { roughness: 0.2, strokeWidth: 2.5 });
- const innerOptions = userNodeOverrides(node2, { roughness: 0.2, strokeWidth: 1.5 });
- const outerRoughNode = rc.circle(0, 0, outerRadius * 2, outerOptions);
- const innerRoughNode = rc.circle(0, 0, innerRadius * 2, innerOptions);
- circleGroup = shapeSvg.insert("g", ":first-child");
- circleGroup.attr("class", node2.cssClasses).attr("style", cssStyles);
- circleGroup.node()?.appendChild(outerRoughNode);
- circleGroup.node()?.appendChild(innerRoughNode);
- } else {
- circleGroup = shapeSvg.insert("g", ":first-child");
- const outerCircle = circleGroup.insert("circle", ":first-child");
- const innerCircle = circleGroup.insert("circle");
- circleGroup.attr("class", "basic label-container").attr("style", nodeStyles);
- outerCircle.attr("class", "outer-circle").attr("style", nodeStyles).attr("r", outerRadius).attr("cx", 0).attr("cy", 0);
- innerCircle.attr("class", "inner-circle").attr("style", nodeStyles).attr("r", innerRadius).attr("cx", 0).attr("cy", 0);
- }
- updateNodeBounds2(node2, circleGroup);
- node2.intersect = function(point8) {
- log.info("DoubleCircle intersect", node2, outerRadius, point8);
- return intersect_default2.circle(node2, outerRadius, point8);
- };
- return shapeSvg;
- }, "doublecircle");
+ init_intersect();
+ __name(multiRect, "multiRect");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/multiWaveEdgedRectangle.ts
+ async function multiWaveEdgedRectangle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const waveAmplitude = h2 / 4;
+ const finalH = h2 + waveAmplitude;
+ const x5 = -w3 / 2;
+ const y5 = -finalH / 2;
+ const rectOffset = 5;
+ const { cssStyles } = node2;
+ const wavePoints = generateFullSineWavePoints(
+ x5 - rectOffset,
+ y5 + finalH + rectOffset,
+ x5 + w3 - rectOffset,
+ y5 + finalH + rectOffset,
+ waveAmplitude,
+ 0.8
+ );
+ const lastWavePoint = wavePoints?.[wavePoints.length - 1];
+ const outerPathPoints = [
+ { x: x5 - rectOffset, y: y5 + rectOffset },
+ { x: x5 - rectOffset, y: y5 + finalH + rectOffset },
+ ...wavePoints,
+ { x: x5 + w3 - rectOffset, y: lastWavePoint.y - rectOffset },
+ { x: x5 + w3, y: lastWavePoint.y - rectOffset },
+ { x: x5 + w3, y: lastWavePoint.y - 2 * rectOffset },
+ { x: x5 + w3 + rectOffset, y: lastWavePoint.y - 2 * rectOffset },
+ { x: x5 + w3 + rectOffset, y: y5 - rectOffset },
+ { x: x5 + rectOffset, y: y5 - rectOffset },
+ { x: x5 + rectOffset, y: y5 },
+ { x: x5, y: y5 },
+ { x: x5, y: y5 + rectOffset }
+ ];
+ const innerPathPoints = [
+ { x: x5, y: y5 + rectOffset },
+ { x: x5 + w3 - rectOffset, y: y5 + rectOffset },
+ { x: x5 + w3 - rectOffset, y: lastWavePoint.y - rectOffset },
+ { x: x5 + w3, y: lastWavePoint.y - rectOffset },
+ { x: x5 + w3, y: y5 },
+ { x: x5, y: y5 }
+ ];
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const outerPath = createPathFromPoints(outerPathPoints);
+ const outerNode = rc.path(outerPath, options3);
+ const innerPath3 = createPathFromPoints(innerPathPoints);
+ const innerNode = rc.path(innerPath3, options3);
+ const shape = shapeSvg.insert(() => outerNode, ":first-child");
+ shape.insert(() => innerNode);
+ shape.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ shape.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ shape.selectAll("path").attr("style", nodeStyles);
+ }
+ shape.attr("transform", `translate(0,${-waveAmplitude / 2})`);
+ label.attr(
+ "transform",
+ `translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, shape);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, outerPathPoints, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_multiWaveEdgedRectangle = __esm({
+ "src/rendering-util/rendering-elements/shapes/multiWaveEdgedRectangle.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
+ init_rough_esm();
+ init_handDrawnShapeStyles();
+ __name(multiWaveEdgedRectangle, "multiWaveEdgedRectangle");
}
});
- // src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts
- var createPolygonPathD, rect_left_inv_arrow2;
- var init_rectLeftInvArrow = __esm({
- "src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts"() {
+ // src/rendering-util/rendering-elements/shapes/note.ts
+ async function note(parent4, node2, { config: { themeVariables } }) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const useHtmlLabels = node2.useHtmlLabels || getConfig().flowchart?.htmlLabels !== false;
+ if (!useHtmlLabels) {
+ node2.centerLabel = true;
+ }
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const totalWidth = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const totalHeight = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const x5 = -totalWidth / 2;
+ const y5 = -totalHeight / 2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {
+ fill: themeVariables.noteBkgColor,
+ stroke: themeVariables.noteBorderColor
+ });
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const noteShapeNode = rc.rectangle(x5, y5, totalWidth, totalHeight, options3);
+ const rect3 = shapeSvg.insert(() => noteShapeNode, ":first-child");
+ rect3.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ rect3.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ rect3.selectAll("path").attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
+ }
+ var init_note = __esm({
+ "src/rendering-util/rendering-elements/shapes/note.ts"() {
"use strict";
- init_util2();
- init_intersect2();
- init_handDrawnShapeStyles();
init_rough_esm();
- init_insertPolygonShape();
- createPolygonPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => {
- return [
- `M${x5 - height2 / 2},${y5}`,
- `L${x5 + width3},${y5}`,
- `L${x5 + width3},${y5 - height2}`,
- `L${x5 - height2 / 2},${y5 - height2}`,
- `L${x5},${y5 - height2 / 2}`,
- "Z"
- ].join(" ");
- }, "createPolygonPathD");
- rect_left_inv_arrow2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: -h2 / 2, y: 0 },
- { x: w3, y: 0 },
- { x: w3, y: -h2 },
- { x: -h2 / 2, y: -h2 },
- { x: 0, y: -h2 / 2 }
- ];
- let polygon2;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const pathData = createPolygonPathD(0, 0, w3, h2);
- const roughNode = rc.path(pathData, options3);
- polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
- if (cssStyles) {
- polygon2.attr("style", cssStyles);
- }
- } else {
- polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points);
- }
- if (nodeStyles) {
- polygon2.attr("style", nodeStyles);
- }
- node2.width = w3 + h2;
- node2.height = h2;
- updateNodeBounds2(node2, polygon2);
- node2.intersect = function(point8) {
- return intersect_default2.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "rect_left_inv_arrow");
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_util();
+ init_config();
+ __name(note, "note");
}
});
// src/rendering-util/rendering-elements/shapes/question.ts
- var createDecisionBoxPathD, question2;
+ async function question(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const s2 = w3 + h2;
+ const points = [
+ { x: s2 / 2, y: 0 },
+ { x: s2, y: -s2 / 2 },
+ { x: s2 / 2, y: -s2 },
+ { x: 0, y: -s2 / 2 }
+ ];
+ let polygon2;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const pathData = createDecisionBoxPathD(0, 0, s2);
+ const roughNode = rc.path(pathData, options3);
+ polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-s2 / 2}, ${s2 / 2})`);
+ if (cssStyles) {
+ polygon2.attr("style", cssStyles);
+ }
+ } else {
+ polygon2 = insertPolygonShape(shapeSvg, s2, s2, points);
+ }
+ if (nodeStyles) {
+ polygon2.attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ log.debug(
+ "APA12 Intersect called SPLIT\npoint:",
+ point8,
+ "\nnode:\n",
+ node2,
+ "\nres:",
+ intersect_default.polygon(node2, points, point8)
+ );
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }
+ var createDecisionBoxPathD;
var init_question = __esm({
"src/rendering-util/rendering-elements/shapes/question.ts"() {
"use strict";
init_logger();
- init_util2();
- init_intersect2();
+ init_util();
+ init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_insertPolygonShape();
@@ -42131,1764 +43360,6090 @@ ${text2}
"Z"
].join(" ");
}, "createDecisionBoxPathD");
- question2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const s2 = w3 + h2;
- const points = [
- { x: s2 / 2, y: 0 },
- { x: s2, y: -s2 / 2 },
- { x: s2 / 2, y: -s2 },
- { x: 0, y: -s2 / 2 }
- ];
- let polygon2;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const pathData = createDecisionBoxPathD(0, 0, s2);
- const roughNode = rc.path(pathData, options3);
- polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-s2 / 2}, ${s2 / 2})`);
- if (cssStyles) {
- polygon2.attr("style", cssStyles);
- }
- } else {
- polygon2 = insertPolygonShape2(shapeSvg, s2, s2, points);
- }
- if (nodeStyles) {
- polygon2.attr("style", nodeStyles);
- }
- updateNodeBounds2(node2, polygon2);
- node2.intersect = function(point8) {
- log.debug(
- "APA12 Intersect called SPLIT\npoint:",
- point8,
- "\nnode:\n",
- node2,
- "\nres:",
- intersect_default2.polygon(node2, points, point8)
- );
- return intersect_default2.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "question");
+ __name(question, "question");
}
});
- // src/rendering-util/rendering-elements/shapes/hexagon.ts
- var createHexagonPathD, hexagon2;
- var init_hexagon = __esm({
- "src/rendering-util/rendering-elements/shapes/hexagon.ts"() {
+ // src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts
+ async function rect_left_inv_arrow(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0), node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0), node2?.height ?? 0);
+ const x5 = -w3 / 2;
+ const y5 = -h2 / 2;
+ const notch = y5 / 2;
+ const points = [
+ { x: x5 + notch, y: y5 },
+ { x: x5, y: 0 },
+ { x: x5 + notch, y: -y5 },
+ { x: -x5, y: -y5 },
+ { x: -x5, y: y5 }
+ ];
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const pathData = createPathFromPoints(points);
+ const roughNode = rc.path(pathData, options3);
+ const polygon2 = shapeSvg.insert(() => roughNode, ":first-child");
+ polygon2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ polygon2.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ polygon2.selectAll("path").attr("style", nodeStyles);
+ }
+ polygon2.attr("transform", `translate(${-notch / 2},0)`);
+ label.attr(
+ "transform",
+ `translate(${-notch / 2 - bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }
+ var init_rectLeftInvArrow = __esm({
+ "src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts"() {
"use strict";
- init_util2();
- init_intersect2();
+ init_util();
+ init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
- init_insertPolygonShape();
- createHexagonPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, m2) => {
- return [
- `M${x5 + m2},${y5}`,
- `L${x5 + width3 - m2},${y5}`,
- `L${x5 + width3},${y5 - height2 / 2}`,
- `L${x5 + width3 - m2},${y5 - height2}`,
- `L${x5 + m2},${y5 - height2}`,
- `L${x5},${y5 - height2 / 2}`,
- "Z"
- ].join(" ");
- }, "createHexagonPathD");
- hexagon2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const f3 = 4;
- const h2 = bbox.height + node2.padding;
- const m2 = h2 / f3;
- const w3 = bbox.width + 2 * m2 + node2.padding;
- const points = [
- { x: m2, y: 0 },
- { x: w3 - m2, y: 0 },
- { x: w3, y: -h2 / 2 },
- { x: w3 - m2, y: -h2 },
- { x: m2, y: -h2 },
- { x: 0, y: -h2 / 2 }
- ];
- let polygon2;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const pathData = createHexagonPathD(0, 0, w3, h2, m2);
- const roughNode = rc.path(pathData, options3);
- polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
- if (cssStyles) {
- polygon2.attr("style", cssStyles);
- }
- } else {
- polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points);
- }
- if (nodeStyles) {
- polygon2.attr("style", nodeStyles);
- }
- node2.width = w3;
- node2.height = h2;
- updateNodeBounds2(node2, polygon2);
- node2.intersect = function(point8) {
- return intersect_default2.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "hexagon");
+ __name(rect_left_inv_arrow, "rect_left_inv_arrow");
}
});
- // src/rendering-util/rendering-elements/shapes/leanRight.ts
- var createLeanRightPathD, lean_right2;
- var init_leanRight = __esm({
- "src/rendering-util/rendering-elements/shapes/leanRight.ts"() {
+ // src/rendering-util/rendering-elements/createLabel.js
+ function applyStyle2(dom, styleFn) {
+ if (styleFn) {
+ dom.attr("style", styleFn);
+ }
+ }
+ async function addHtmlLabel(node2) {
+ const fo = select_default2(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"));
+ const div = fo.append("xhtml:div");
+ let label = node2.label;
+ if (node2.label && hasKatex(node2.label)) {
+ label = await renderKatex(node2.label.replace(common_default.lineBreakRegex, "\n"), getConfig2());
+ }
+ const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel";
+ div.html(
+ '" + label + " "
+ );
+ applyStyle2(div, node2.labelStyle);
+ div.style("display", "inline-block");
+ div.style("padding-right", "1px");
+ div.style("white-space", "nowrap");
+ div.attr("xmlns", "http://www.w3.org/1999/xhtml");
+ return fo.node();
+ }
+ var createLabel, createLabel_default;
+ var init_createLabel = __esm({
+ "src/rendering-util/rendering-elements/createLabel.js"() {
"use strict";
- init_util2();
- init_intersect2();
- init_handDrawnShapeStyles();
- init_rough_esm();
- init_insertPolygonShape();
- createLeanRightPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => {
- return [
- `M${x5 - 2 * height2 / 6},${y5}`,
- `L${x5 + width3 - height2 / 6},${y5}`,
- `L${x5 + width3 + 2 * height2 / 6},${y5 - height2}`,
- `L${x5 + height2 / 6},${y5 - height2}`,
- "Z"
- ].join(" ");
- }, "createLeanRightPathD");
- lean_right2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: -2 * h2 / 6, y: 0 },
- { x: w3 - h2 / 6, y: 0 },
- { x: w3 + 2 * h2 / 6, y: -h2 },
- { x: h2 / 6, y: -h2 }
- ];
- let polygon2;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const pathData = createLeanRightPathD(0, 0, w3, h2);
- const roughNode = rc.path(pathData, options3);
- polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
- if (cssStyles) {
- polygon2.attr("style", cssStyles);
- }
- } else {
- polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points);
+ init_src32();
+ init_logger();
+ init_diagramAPI();
+ init_common();
+ init_utils2();
+ __name(applyStyle2, "applyStyle");
+ __name(addHtmlLabel, "addHtmlLabel");
+ createLabel = /* @__PURE__ */ __name(async (_vertexText, style3, isTitle, isNode2) => {
+ let vertexText = _vertexText || "";
+ if (typeof vertexText === "object") {
+ vertexText = vertexText[0];
}
- if (nodeStyles) {
- polygon2.attr("style", nodeStyles);
+ if (evaluate(getConfig2().flowchart.htmlLabels)) {
+ vertexText = vertexText.replace(/\\n|\n/g, " ");
+ log.info("vertexText" + vertexText);
+ const node2 = {
+ isNode: isNode2,
+ label: decodeEntities(vertexText).replace(
+ /fa[blrs]?:fa-[\w-]+/g,
+ (s2) => ` `
+ ),
+ labelStyle: style3 ? style3.replace("fill:", "color:") : style3
+ };
+ let vertexNode = await addHtmlLabel(node2);
+ return vertexNode;
+ } else {
+ const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
+ svgLabel.setAttribute("style", style3.replace("color:", "fill:"));
+ let rows = [];
+ if (typeof vertexText === "string") {
+ rows = vertexText.split(/\\n|\n| /gi);
+ } else if (Array.isArray(vertexText)) {
+ rows = vertexText;
+ } else {
+ rows = [];
+ }
+ for (const row of rows) {
+ const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
+ tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
+ tspan.setAttribute("dy", "1em");
+ tspan.setAttribute("x", "0");
+ if (isTitle) {
+ tspan.setAttribute("class", "title-row");
+ } else {
+ tspan.setAttribute("class", "row");
+ }
+ tspan.textContent = row.trim();
+ svgLabel.appendChild(tspan);
+ }
+ return svgLabel;
}
- node2.width = w3;
- node2.height = h2;
- updateNodeBounds2(node2, polygon2);
- node2.intersect = function(point8) {
- return intersect_default2.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "lean_right");
+ }, "createLabel");
+ createLabel_default = createLabel;
}
});
- // src/rendering-util/rendering-elements/shapes/leanLeft.ts
- var createLeanLeftPathD, lean_left2;
- var init_leanLeft = __esm({
- "src/rendering-util/rendering-elements/shapes/leanLeft.ts"() {
+ // src/rendering-util/rendering-elements/shapes/rectWithTitle.ts
+ async function rectWithTitle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ let classes3;
+ if (!node2.cssClasses) {
+ classes3 = "node default";
+ } else {
+ classes3 = "node " + node2.cssClasses;
+ }
+ const shapeSvg = parent4.insert("g").attr("class", classes3).attr("id", node2.domId || node2.id);
+ const g2 = shapeSvg.insert("g");
+ const label = shapeSvg.insert("g").attr("class", "label").attr("style", nodeStyles);
+ const description = node2.description;
+ const title2 = node2.label;
+ const text4 = label.node().appendChild(await createLabel_default(title2, node2.labelStyle, true, true));
+ let bbox = { width: 0, height: 0 };
+ if (evaluate(getConfig2()?.flowchart?.htmlLabels)) {
+ const div2 = text4.children[0];
+ const dv2 = select_default2(text4);
+ bbox = div2.getBoundingClientRect();
+ dv2.attr("width", bbox.width);
+ dv2.attr("height", bbox.height);
+ }
+ log.info("Text 2", description);
+ const textRows = description || [];
+ const titleBox = text4.getBBox();
+ const descr = label.node().appendChild(
+ await createLabel_default(
+ textRows.join ? textRows.join(" ") : textRows,
+ node2.labelStyle,
+ true,
+ true
+ )
+ );
+ const div = descr.children[0];
+ const dv = select_default2(descr);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ const halfPadding = (node2.padding || 0) / 2;
+ select_default2(descr).attr(
+ "transform",
+ "translate( " + (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")"
+ );
+ select_default2(text4).attr(
+ "transform",
+ "translate( " + (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)"
+ );
+ bbox = label.node().getBBox();
+ label.attr(
+ "transform",
+ "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")"
+ );
+ const totalWidth = bbox.width + (node2.padding || 0);
+ const totalHeight = bbox.height + (node2.padding || 0);
+ const x5 = -bbox.width / 2 - halfPadding;
+ const y5 = -bbox.height / 2 - halfPadding;
+ let rect3;
+ let innerLine;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const roughNode = rc.path(
+ createRoundedRectPathD(x5, y5, totalWidth, totalHeight, node2.rx || 0),
+ options3
+ );
+ const roughLine = rc.line(
+ -bbox.width / 2 - halfPadding,
+ -bbox.height / 2 - halfPadding + titleBox.height + halfPadding,
+ bbox.width / 2 + halfPadding,
+ -bbox.height / 2 - halfPadding + titleBox.height + halfPadding,
+ options3
+ );
+ innerLine = shapeSvg.insert(() => {
+ log.debug("Rough node insert CXC", roughNode);
+ return roughLine;
+ }, ":first-child");
+ rect3 = shapeSvg.insert(() => {
+ log.debug("Rough node insert CXC", roughNode);
+ return roughNode;
+ }, ":first-child");
+ } else {
+ rect3 = g2.insert("rect", ":first-child");
+ innerLine = g2.insert("line");
+ rect3.attr("class", "outer title-state").attr("style", nodeStyles).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + (node2.padding || 0)).attr("height", bbox.height + (node2.padding || 0));
+ innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);
+ }
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
+ }
+ var init_rectWithTitle = __esm({
+ "src/rendering-util/rendering-elements/shapes/rectWithTitle.ts"() {
"use strict";
- init_util2();
- init_intersect2();
+ init_src32();
+ init_common();
+ init_util();
+ init_createLabel();
+ init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
- init_insertPolygonShape();
- createLeanLeftPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => {
- return [
- `M${x5 + 2 * height2 / 6},${y5}`,
- `L${x5 + width3 + height2 / 6},${y5}`,
- `L${x5 + width3 - 2 * height2 / 6},${y5 - height2}`,
- `L${x5 - height2 / 6},${y5 - height2}`,
- "Z"
- ].join(" ");
- }, "createLeanLeftPathD");
- lean_left2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: 2 * h2 / 6, y: 0 },
- { x: w3 + h2 / 6, y: 0 },
- { x: w3 - 2 * h2 / 6, y: -h2 },
- { x: -h2 / 6, y: -h2 }
- ];
- let polygon2;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const pathData = createLeanLeftPathD(0, 0, w3, h2);
- const roughNode = rc.path(pathData, options3);
- polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
- if (cssStyles) {
- polygon2.attr("style", cssStyles);
- }
- } else {
- polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points);
- }
- if (nodeStyles) {
- polygon2.attr("style", nodeStyles);
- }
- node2.width = w3;
- node2.height = h2;
- updateNodeBounds2(node2, polygon2);
- node2.intersect = function(point8) {
- return intersect_default2.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "lean_left");
+ init_diagramAPI();
+ init_roundedRectPath();
+ init_logger();
+ __name(rectWithTitle, "rectWithTitle");
}
});
- // src/rendering-util/rendering-elements/shapes/trapezoid.ts
- var createTrapezoidPathD, trapezoid2;
- var init_trapezoid = __esm({
- "src/rendering-util/rendering-elements/shapes/trapezoid.ts"() {
+ // src/rendering-util/rendering-elements/shapes/roundedRect.ts
+ async function roundedRect(parent4, node2) {
+ const options3 = {
+ rx: 5,
+ ry: 5,
+ classes: "",
+ labelPaddingX: (node2?.padding || 0) * 1,
+ labelPaddingY: (node2?.padding || 0) * 1
+ };
+ return drawRect3(parent4, node2, options3);
+ }
+ var init_roundedRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/roundedRect.ts"() {
"use strict";
- init_util2();
- init_intersect2();
+ init_drawRect();
+ __name(roundedRect, "roundedRect");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/shadedProcess.ts
+ async function shadedProcess(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const halfPadding = node2?.padding ?? 0;
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const x5 = -bbox.width / 2 - halfPadding;
+ const y5 = -bbox.height / 2 - halfPadding;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: x5, y: y5 },
+ { x: x5 + w3 + 8, y: y5 },
+ { x: x5 + w3 + 8, y: y5 + h2 },
+ { x: x5 - 8, y: y5 + h2 },
+ { x: x5 - 8, y: y5 },
+ { x: x5, y: y5 },
+ { x: x5, y: y5 + h2 }
+ ];
+ const roughNode = rc.polygon(
+ points.map((p3) => [p3.x, p3.y]),
+ options3
+ );
+ const rect3 = shapeSvg.insert(() => roughNode, ":first-child");
+ rect3.attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles));
+ if (nodeStyles && node2.look !== "handDrawn") {
+ rect3.selectAll("path").attr("style", nodeStyles);
+ }
+ if (cssStyles && node2.look !== "handDrawn") {
+ rect3.selectAll("path").attr("style", nodeStyles);
+ }
+ label.attr(
+ "transform",
+ `translate(${-w3 / 2 + 4 + (node2.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h2 / 2 + (node2.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
+ }
+ var init_shadedProcess = __esm({
+ "src/rendering-util/rendering-elements/shapes/shadedProcess.ts"() {
+ "use strict";
+ init_util();
+ init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
- init_insertPolygonShape();
- createTrapezoidPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => {
- return [
- `M${x5 - 2 * height2 / 6},${y5}`,
- `L${x5 + width3 + 2 * height2 / 6},${y5}`,
- `L${x5 + width3 - height2 / 6},${y5 - height2}`,
- `L${x5 + height2 / 6},${y5 - height2}`,
- "Z"
- ].join(" ");
- }, "createTrapezoidPathD");
- trapezoid2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: -2 * h2 / 6, y: 0 },
- { x: w3 + 2 * h2 / 6, y: 0 },
- { x: w3 - h2 / 6, y: -h2 },
- { x: h2 / 6, y: -h2 }
- ];
- let polygon2;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const pathData = createTrapezoidPathD(0, 0, w3, h2);
- const roughNode = rc.path(pathData, options3);
- polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
- if (cssStyles) {
- polygon2.attr("style", cssStyles);
- }
- } else {
- polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points);
- }
- if (nodeStyles) {
- polygon2.attr("style", nodeStyles);
- }
- node2.width = w3;
- node2.height = h2;
- updateNodeBounds2(node2, polygon2);
- node2.intersect = function(point8) {
- return intersect_default2.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "trapezoid");
- }
- });
-
- // src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts
- var createInvertedTrapezoidPathD, inv_trapezoid2;
- var init_invertedTrapezoid = __esm({
- "src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts"() {
+ init_utils2();
+ __name(shadedProcess, "shadedProcess");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/slopedRect.ts
+ async function slopedRect(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const x5 = -w3 / 2;
+ const y5 = -h2 / 2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: x5, y: y5 },
+ { x: x5, y: y5 + h2 },
+ { x: x5 + w3, y: y5 + h2 },
+ { x: x5 + w3, y: y5 - h2 / 2 }
+ ];
+ const pathData = createPathFromPoints(points);
+ const shapeNode = rc.path(pathData, options3);
+ const polygon2 = shapeSvg.insert(() => shapeNode, ":first-child");
+ polygon2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", nodeStyles);
+ }
+ polygon2.attr("transform", `translate(0, ${h2 / 4})`);
+ label.attr(
+ "transform",
+ `translate(${-w3 / 2 + (node2.padding ?? 0) - (bbox.x - (bbox.left ?? 0))}, ${-h2 / 4 + (node2.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
+ }
+ var init_slopedRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/slopedRect.ts"() {
"use strict";
- init_util2();
- init_intersect2();
+ init_util();
+ init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
- init_insertPolygonShape();
- createInvertedTrapezoidPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => {
- return [
- `M${x5 + height2 / 6},${y5}`,
- `L${x5 + width3 - height2 / 6},${y5}`,
- `L${x5 + width3 + 2 * height2 / 6},${y5 - height2}`,
- `L${x5 - 2 * height2 / 6},${y5 - height2}`,
- "Z"
- ].join(" ");
- }, "createInvertedTrapezoidPathD");
- inv_trapezoid2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { labelStyles, nodeStyles } = styles2String(node2);
- node2.labelStyle = labelStyles;
- const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2));
- const w3 = bbox.width + node2.padding;
- const h2 = bbox.height + node2.padding;
- const points = [
- { x: h2 / 6, y: 0 },
- { x: w3 - h2 / 6, y: 0 },
- { x: w3 + 2 * h2 / 6, y: -h2 },
- { x: -2 * h2 / 6, y: -h2 }
- ];
- let polygon2;
- const { cssStyles } = node2;
- if (node2.look === "handDrawn") {
- const rc = at.svg(shapeSvg);
- const options3 = userNodeOverrides(node2, {});
- const pathData = createInvertedTrapezoidPathD(0, 0, w3, h2);
- const roughNode = rc.path(pathData, options3);
- polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
- if (cssStyles) {
- polygon2.attr("style", cssStyles);
- }
- } else {
- polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points);
- }
- if (nodeStyles) {
- polygon2.attr("style", nodeStyles);
- }
- node2.width = w3;
- node2.height = h2;
- updateNodeBounds2(node2, polygon2);
- node2.intersect = function(point8) {
- return intersect_default2.polygon(node2, points, point8);
- };
- return shapeSvg;
- }, "inv_trapezoid");
+ __name(slopedRect, "slopedRect");
}
});
- // src/rendering-util/rendering-elements/shapes/labelRect.ts
- var labelRect2;
- var init_labelRect = __esm({
- "src/rendering-util/rendering-elements/shapes/labelRect.ts"() {
+ // src/rendering-util/rendering-elements/shapes/squareRect.ts
+ async function squareRect(parent4, node2) {
+ const options3 = {
+ rx: 0,
+ ry: 0,
+ classes: "",
+ labelPaddingX: (node2?.padding || 0) * 2,
+ labelPaddingY: (node2?.padding || 0) * 1
+ };
+ return drawRect3(parent4, node2, options3);
+ }
+ var init_squareRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/squareRect.ts"() {
"use strict";
init_drawRect();
- init_util2();
- init_intersect2();
- labelRect2 = /* @__PURE__ */ __name(async (parent4, node2) => {
- const { shapeSvg } = await labelHelper2(parent4, node2, "label");
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const totalWidth = 0.1;
- const totalHeight = 0.1;
- rect4.attr("width", totalWidth).attr("height", totalHeight);
- shapeSvg.attr("class", "label edgeLabel");
- updateNodeBounds2(node2, rect4);
- node2.intersect = function(point8) {
- return intersect_default2.rect(node2, point8);
- };
- return shapeSvg;
- }, "labelRect");
- }
- });
-
- // src/rendering-util/rendering-elements/nodes.js
- var shapes3, nodeElems2, insertNode2, setNodeElem2, clear7, positionNode2;
- var init_nodes3 = __esm({
- "src/rendering-util/rendering-elements/nodes.js"() {
- "use strict";
- init_logger();
- init_state();
- init_roundedRect();
- init_squareRect();
- init_stateStart();
- init_stateEnd();
- init_forkJoin();
- init_choice();
- init_note2();
- init_stadium();
- init_rectWithTitle();
- init_diagramAPI();
- init_subroutine();
- init_cylinder();
- init_circle();
- init_doubleCircle();
- init_rectLeftInvArrow();
- init_question();
- init_hexagon();
- init_leanRight();
- init_leanLeft();
- init_trapezoid();
- init_invertedTrapezoid();
- init_labelRect();
- shapes3 = {
- state,
- stateStart,
- stateEnd,
- fork: forkJoin2,
- join: forkJoin2,
- choice: choice2,
- note: note2,
- roundedRect,
- rectWithTitle: rectWithTitle2,
- squareRect: squareRect2,
- stadium: stadium2,
- subroutine: subroutine2,
- cylinder: cylinder2,
- circle: circle3,
- doublecircle: doublecircle2,
- odd: rect_left_inv_arrow2,
- diamond: question2,
- hexagon: hexagon2,
- lean_right: lean_right2,
- lean_left: lean_left2,
- trapezoid: trapezoid2,
- inv_trapezoid: inv_trapezoid2,
- labelRect: labelRect2
- };
- nodeElems2 = /* @__PURE__ */ new Map();
- insertNode2 = /* @__PURE__ */ __name(async (elem, node2, dir2) => {
- let newEl;
- let el;
- if (node2.shape === "rect") {
- if (node2.rx && node2.ry) {
- node2.shape = "roundedRect";
- } else {
- node2.shape = "squareRect";
- }
- }
- if (node2.link) {
- let target;
- if (getConfig2().securityLevel === "sandbox") {
- target = "_top";
- } else if (node2.linkTarget) {
- target = node2.linkTarget || "_blank";
- }
- newEl = elem.insert("svg:a").attr("xlink:href", node2.link).attr("target", target);
- el = await shapes3[node2.shape](newEl, node2, dir2);
- } else {
- el = await shapes3[node2.shape](elem, node2, dir2);
- newEl = el;
- }
- if (node2.tooltip) {
- el.attr("title", node2.tooltip);
- }
- nodeElems2.set(node2.id, newEl);
- if (node2.haveCallback) {
- nodeElems2.get(node2.id).attr("class", nodeElems2.get(node2.id).attr("class") + " clickable");
- }
- return newEl;
- }, "insertNode");
- setNodeElem2 = /* @__PURE__ */ __name((elem, node2) => {
- nodeElems2.set(node2.id, elem);
- }, "setNodeElem");
- clear7 = /* @__PURE__ */ __name(() => {
- nodeElems2.clear();
- }, "clear");
- positionNode2 = /* @__PURE__ */ __name((node2) => {
- const el = nodeElems2.get(node2.id);
- log.trace(
- "Transforming node",
- node2.diff,
- node2,
- "translate(" + (node2.x - node2.width / 2 - 5) + ", " + node2.width / 2 + ")"
- );
- const padding3 = 8;
- const diff2 = node2.diff || 0;
- if (node2.clusterNode) {
- el.attr(
- "transform",
- "translate(" + (node2.x + diff2 - node2.width / 2) + ", " + (node2.y - node2.height / 2 - padding3) + ")"
- );
- } else {
- el.attr("transform", "translate(" + node2.x + ", " + node2.y + ")");
- }
- return diff2;
- }, "positionNode");
+ __name(squareRect, "squareRect");
}
});
- // src/internals.ts
- var internalHelpers;
- var init_internals = __esm({
- "src/internals.ts"() {
- "use strict";
- init_config();
- init_common();
- init_logger();
- init_clusters();
- init_edges();
- init_markers();
- init_nodes3();
- init_util2();
- init_utils2();
- internalHelpers = {
- common: common_default,
- getConfig,
- insertCluster,
- insertEdge,
- insertEdgeLabel,
- insertMarkers: markers_default,
- insertNode: insertNode2,
- interpolateToCurve,
- labelHelper: labelHelper2,
- log,
- positionEdgeLabel
- };
+ // src/rendering-util/rendering-elements/shapes/stadium.ts
+ async function stadium(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const h2 = bbox.height + node2.padding;
+ const w3 = bbox.width + h2 / 4 + node2.padding;
+ let rect3;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const pathData = createRoundedRectPathD(-w3 / 2, -h2 / 2, w3, h2, h2 / 2);
+ const roughNode = rc.path(pathData, options3);
+ rect3 = shapeSvg.insert(() => roughNode, ":first-child");
+ rect3.attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles));
+ } else {
+ rect3 = shapeSvg.insert("rect", ":first-child");
+ rect3.attr("class", "basic label-container").attr("style", nodeStyles).attr("rx", h2 / 2).attr("ry", h2 / 2).attr("x", -w3 / 2).attr("y", -h2 / 2).attr("width", w3).attr("height", h2);
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js
- function isSymbol(value2) {
- return typeof value2 == "symbol" || isObjectLike_default(value2) && baseGetTag_default(value2) == symbolTag;
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
}
- var symbolTag, isSymbol_default;
- var init_isSymbol = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js"() {
+ var init_stadium = __esm({
+ "src/rendering-util/rendering-elements/shapes/stadium.ts"() {
"use strict";
- init_baseGetTag();
- init_isObjectLike();
- symbolTag = "[object Symbol]";
- __name(isSymbol, "isSymbol");
- isSymbol_default = isSymbol;
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_roundedRectPath();
+ init_utils2();
+ __name(stadium, "stadium");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js
- function arrayMap(array4, iteratee) {
- var index = -1, length2 = array4 == null ? 0 : array4.length, result = Array(length2);
- while (++index < length2) {
- result[index] = iteratee(array4[index], index, array4);
- }
- return result;
+ // src/rendering-util/rendering-elements/shapes/state.ts
+ async function state(parent4, node2) {
+ const options3 = {
+ rx: 5,
+ ry: 5,
+ classes: "flowchart-node"
+ };
+ return drawRect3(parent4, node2, options3);
}
- var arrayMap_default;
- var init_arrayMap = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js"() {
+ var init_state = __esm({
+ "src/rendering-util/rendering-elements/shapes/state.ts"() {
"use strict";
- __name(arrayMap, "arrayMap");
- arrayMap_default = arrayMap;
+ init_drawRect();
+ __name(state, "state");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js
- function baseToString(value2) {
- if (typeof value2 == "string") {
- return value2;
- }
- if (isArray_default(value2)) {
- return arrayMap_default(value2, baseToString) + "";
+ // src/rendering-util/rendering-elements/shapes/stateEnd.ts
+ function stateEnd(parent4, node2, { config: { themeVariables } }) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { cssStyles } = node2;
+ const { lineColor, stateBorder, nodeBorder } = themeVariables;
+ const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const roughNode = rc.circle(0, 0, 14, {
+ ...options3,
+ stroke: lineColor,
+ strokeWidth: 2
+ });
+ const innerFill = stateBorder ?? nodeBorder;
+ const roughInnerNode = rc.circle(0, 0, 5, {
+ ...options3,
+ fill: innerFill,
+ stroke: innerFill,
+ strokeWidth: 2,
+ fillStyle: "solid"
+ });
+ const circle6 = shapeSvg.insert(() => roughNode, ":first-child");
+ circle6.insert(() => roughInnerNode);
+ if (cssStyles) {
+ circle6.selectAll("path").attr("style", cssStyles);
}
- if (isSymbol_default(value2)) {
- return symbolToString ? symbolToString.call(value2) : "";
+ if (nodeStyles) {
+ circle6.selectAll("path").attr("style", nodeStyles);
}
- var result = value2 + "";
- return result == "0" && 1 / value2 == -INFINITY ? "-0" : result;
+ updateNodeBounds(node2, circle6);
+ node2.intersect = function(point8) {
+ return intersect_default.circle(node2, 7, point8);
+ };
+ return shapeSvg;
}
- var INFINITY, symbolProto, symbolToString, baseToString_default;
- var init_baseToString = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js"() {
+ var init_stateEnd = __esm({
+ "src/rendering-util/rendering-elements/shapes/stateEnd.ts"() {
"use strict";
- init_Symbol();
- init_arrayMap();
- init_isArray();
- init_isSymbol();
- INFINITY = 1 / 0;
- symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
- symbolToString = symbolProto ? symbolProto.toString : void 0;
- __name(baseToString, "baseToString");
- baseToString_default = baseToString;
+ init_rough_esm();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_util();
+ __name(stateEnd, "stateEnd");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js
- function trimmedEndIndex(string3) {
- var index = string3.length;
- while (index-- && reWhitespace.test(string3.charAt(index))) {
- }
- return index;
- }
- var reWhitespace, trimmedEndIndex_default;
- var init_trimmedEndIndex = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js"() {
- "use strict";
- reWhitespace = /\s/;
- __name(trimmedEndIndex, "trimmedEndIndex");
- trimmedEndIndex_default = trimmedEndIndex;
+ // src/rendering-util/rendering-elements/shapes/stateStart.ts
+ function stateStart(parent4, node2, { config: { themeVariables } }) {
+ const { lineColor } = themeVariables;
+ const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
+ let circle6;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const roughNode = rc.circle(0, 0, 14, solidStateFill(lineColor));
+ circle6 = shapeSvg.insert(() => roughNode);
+ circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
+ } else {
+ circle6 = shapeSvg.insert("circle", ":first-child");
+ circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js
- function baseTrim(string3) {
- return string3 ? string3.slice(0, trimmedEndIndex_default(string3) + 1).replace(reTrimStart, "") : string3;
+ updateNodeBounds(node2, circle6);
+ node2.intersect = function(point8) {
+ return intersect_default.circle(node2, 7, point8);
+ };
+ return shapeSvg;
}
- var reTrimStart, baseTrim_default;
- var init_baseTrim = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js"() {
+ var init_stateStart = __esm({
+ "src/rendering-util/rendering-elements/shapes/stateStart.ts"() {
"use strict";
- init_trimmedEndIndex();
- reTrimStart = /^\s+/;
- __name(baseTrim, "baseTrim");
- baseTrim_default = baseTrim;
+ init_rough_esm();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_util();
+ __name(stateStart, "stateStart");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js
- function toNumber(value2) {
- if (typeof value2 == "number") {
- return value2;
- }
- if (isSymbol_default(value2)) {
- return NAN;
- }
- if (isObject_default(value2)) {
- var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2;
- value2 = isObject_default(other) ? other + "" : other;
- }
- if (typeof value2 != "string") {
- return value2 === 0 ? value2 : +value2;
+ // src/rendering-util/rendering-elements/shapes/subroutine.ts
+ async function subroutine(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const halfPadding = (node2?.padding || 0) / 2;
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const x5 = -bbox.width / 2 - halfPadding;
+ const y5 = -bbox.height / 2 - halfPadding;
+ const points = [
+ { x: 0, y: 0 },
+ { x: w3, y: 0 },
+ { x: w3, y: -h2 },
+ { x: 0, y: -h2 },
+ { x: 0, y: 0 },
+ { x: -8, y: 0 },
+ { x: w3 + 8, y: 0 },
+ { x: w3 + 8, y: -h2 },
+ { x: -8, y: -h2 },
+ { x: -8, y: 0 }
+ ];
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const roughNode = rc.rectangle(x5 - 8, y5, w3 + 16, h2, options3);
+ const l1 = rc.line(x5, y5, x5, y5 + h2, options3);
+ const l2 = rc.line(x5 + w3, y5, x5 + w3, y5 + h2, options3);
+ shapeSvg.insert(() => l1, ":first-child");
+ shapeSvg.insert(() => l2, ":first-child");
+ const rect3 = shapeSvg.insert(() => roughNode, ":first-child");
+ const { cssStyles } = node2;
+ rect3.attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles));
+ updateNodeBounds(node2, rect3);
+ } else {
+ const el = insertPolygonShape(shapeSvg, w3, h2, points);
+ if (nodeStyles) {
+ el.attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, el);
}
- value2 = baseTrim_default(value2);
- var isBinary2 = reIsBinary.test(value2);
- return isBinary2 || reIsOctal.test(value2) ? freeParseInt(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex.test(value2) ? NAN : +value2;
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
}
- var NAN, reIsBadHex, reIsBinary, reIsOctal, freeParseInt, toNumber_default;
- var init_toNumber = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js"() {
+ var init_subroutine = __esm({
+ "src/rendering-util/rendering-elements/shapes/subroutine.ts"() {
"use strict";
- init_baseTrim();
- init_isObject();
- init_isSymbol();
- NAN = 0 / 0;
- reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- reIsBinary = /^0b[01]+$/i;
- reIsOctal = /^0o[0-7]+$/i;
- freeParseInt = parseInt;
- __name(toNumber, "toNumber");
- toNumber_default = toNumber;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toFinite.js
- function toFinite(value2) {
- if (!value2) {
- return value2 === 0 ? value2 : 0;
- }
- value2 = toNumber_default(value2);
- if (value2 === INFINITY2 || value2 === -INFINITY2) {
- var sign2 = value2 < 0 ? -1 : 1;
- return sign2 * MAX_INTEGER;
- }
- return value2 === value2 ? value2 : 0;
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_insertPolygonShape();
+ init_utils2();
+ __name(subroutine, "subroutine");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/taggedRect.ts
+ async function taggedRect(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const x5 = -w3 / 2;
+ const y5 = -h2 / 2;
+ const tagWidth = 0.2 * h2;
+ const tagHeight = 0.2 * h2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const rectPoints = [
+ { x: x5 - tagWidth / 2, y: y5 },
+ { x: x5 + w3 + tagWidth / 2, y: y5 },
+ { x: x5 + w3 + tagWidth / 2, y: y5 + h2 },
+ { x: x5 - tagWidth / 2, y: y5 + h2 }
+ ];
+ const tagPoints = [
+ { x: x5 + w3 - tagWidth / 2, y: y5 + h2 },
+ { x: x5 + w3 + tagWidth / 2, y: y5 + h2 },
+ { x: x5 + w3 + tagWidth / 2, y: y5 + h2 - tagHeight }
+ ];
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const rectPath = createPathFromPoints(rectPoints);
+ const rectNode = rc.path(rectPath, options3);
+ const tagPath = createPathFromPoints(tagPoints);
+ const tagNode = rc.path(tagPath, { ...options3, fillStyle: "solid" });
+ const taggedRect2 = shapeSvg.insert(() => tagNode, ":first-child");
+ taggedRect2.insert(() => rectNode, ":first-child");
+ taggedRect2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ taggedRect2.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ taggedRect2.selectAll("path").attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, taggedRect2);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, rectPoints, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var INFINITY2, MAX_INTEGER, toFinite_default;
- var init_toFinite = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toFinite.js"() {
+ var init_taggedRect = __esm({
+ "src/rendering-util/rendering-elements/shapes/taggedRect.ts"() {
"use strict";
- init_toNumber();
- INFINITY2 = 1 / 0;
- MAX_INTEGER = 17976931348623157e292;
- __name(toFinite, "toFinite");
- toFinite_default = toFinite;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toInteger.js
- function toInteger(value2) {
- var result = toFinite_default(value2), remainder = result % 1;
- return result === result ? remainder ? result - remainder : result : 0;
+ init_util();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_intersect();
+ __name(taggedRect, "taggedRect");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/taggedWaveEdgedRectangle.ts
+ async function taggedWaveEdgedRectangle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const waveAmplitude = h2 / 4;
+ const tagWidth = 0.2 * w3;
+ const tagHeight = 0.2 * h2;
+ const finalH = h2 + waveAmplitude;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: -w3 / 2 - w3 / 2 * 0.1, y: finalH / 2 },
+ ...generateFullSineWavePoints(
+ -w3 / 2 - w3 / 2 * 0.1,
+ finalH / 2,
+ w3 / 2 + w3 / 2 * 0.1,
+ finalH / 2,
+ waveAmplitude,
+ 0.8
+ ),
+ { x: w3 / 2 + w3 / 2 * 0.1, y: -finalH / 2 },
+ { x: -w3 / 2 - w3 / 2 * 0.1, y: -finalH / 2 }
+ ];
+ const x5 = -w3 / 2 + w3 / 2 * 0.1;
+ const y5 = -finalH / 2 - tagHeight * 0.4;
+ const tagPoints = [
+ { x: x5 + w3 - tagWidth, y: (y5 + h2) * 1.4 },
+ { x: x5 + w3, y: y5 + h2 - tagHeight },
+ { x: x5 + w3, y: (y5 + h2) * 0.9 },
+ ...generateFullSineWavePoints(
+ x5 + w3,
+ (y5 + h2) * 1.3,
+ x5 + w3 - tagWidth,
+ (y5 + h2) * 1.5,
+ -h2 * 0.03,
+ 0.5
+ )
+ ];
+ const waveEdgeRectPath = createPathFromPoints(points);
+ const waveEdgeRectNode = rc.path(waveEdgeRectPath, options3);
+ const taggedWaveEdgeRectPath = createPathFromPoints(tagPoints);
+ const taggedWaveEdgeRectNode = rc.path(taggedWaveEdgeRectPath, {
+ ...options3,
+ fillStyle: "solid"
+ });
+ const waveEdgeRect = shapeSvg.insert(() => taggedWaveEdgeRectNode, ":first-child");
+ waveEdgeRect.insert(() => waveEdgeRectNode, ":first-child");
+ waveEdgeRect.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ waveEdgeRect.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ waveEdgeRect.selectAll("path").attr("style", nodeStyles);
+ }
+ waveEdgeRect.attr("transform", `translate(0,${-waveAmplitude / 2})`);
+ label.attr(
+ "transform",
+ `translate(${-w3 / 2 + (node2.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h2 / 2 + (node2.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, waveEdgeRect);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var toInteger_default;
- var init_toInteger = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toInteger.js"() {
- "use strict";
- init_toFinite();
- __name(toInteger, "toInteger");
- toInteger_default = toInteger;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js
- var WeakMap, WeakMap_default;
- var init_WeakMap = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js"() {
+ var init_taggedWaveEdgedRectangle = __esm({
+ "src/rendering-util/rendering-elements/shapes/taggedWaveEdgedRectangle.ts"() {
"use strict";
- init_getNative();
- init_root();
- WeakMap = getNative_default(root_default, "WeakMap");
- WeakMap_default = WeakMap;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js
- function noop2() {
+ init_util();
+ init_intersect();
+ init_rough_esm();
+ init_handDrawnShapeStyles();
+ __name(taggedWaveEdgedRectangle, "taggedWaveEdgedRectangle");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/text.ts
+ async function text3(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const totalWidth = Math.max(bbox.width + node2.padding, node2?.width || 0);
+ const totalHeight = Math.max(bbox.height + node2.padding, node2?.height || 0);
+ const x5 = -totalWidth / 2;
+ const y5 = -totalHeight / 2;
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ rect3.attr("class", "text").attr("style", nodeStyles).attr("rx", 0).attr("ry", 0).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
}
- var noop_default2;
- var init_noop2 = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js"() {
+ var init_text3 = __esm({
+ "src/rendering-util/rendering-elements/shapes/text.ts"() {
"use strict";
- __name(noop2, "noop");
- noop_default2 = noop2;
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ __name(text3, "text");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js
- function arrayEach(array4, iteratee) {
- var index = -1, length2 = array4 == null ? 0 : array4.length;
- while (++index < length2) {
- if (iteratee(array4[index], index, array4) === false) {
- break;
+ // src/rendering-util/rendering-elements/shapes/tiltedCylinder.ts
+ async function tiltedCylinder(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label, halfPadding } = await labelHelper(
+ parent4,
+ node2,
+ getNodeClasses(node2)
+ );
+ const labelPadding = node2.look === "neo" ? halfPadding * 2 : halfPadding;
+ const h2 = bbox.height + labelPadding;
+ const ry = h2 / 2;
+ const rx = ry / (2.5 + h2 / 50);
+ const w3 = bbox.width + rx + labelPadding;
+ const { cssStyles } = node2;
+ let cylinder3;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const outerPathData = createOuterCylinderPathD3(0, 0, w3, h2, rx, ry);
+ const innerPathData = createInnerCylinderPathD3(0, 0, w3, h2, rx, ry);
+ const outerNode = rc.path(outerPathData, userNodeOverrides(node2, {}));
+ const innerLine = rc.path(innerPathData, userNodeOverrides(node2, { fill: "none" }));
+ cylinder3 = shapeSvg.insert(() => innerLine, ":first-child");
+ cylinder3 = shapeSvg.insert(() => outerNode, ":first-child");
+ cylinder3.attr("class", "basic label-container");
+ if (cssStyles) {
+ cylinder3.attr("style", cssStyles);
+ }
+ } else {
+ const pathData = createCylinderPathD3(0, 0, w3, h2, rx, ry);
+ cylinder3 = shapeSvg.insert("path", ":first-child").attr("d", pathData).attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles)).attr("style", nodeStyles);
+ cylinder3.attr("class", "basic label-container");
+ if (cssStyles) {
+ cylinder3.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles) {
+ cylinder3.selectAll("path").attr("style", nodeStyles);
}
}
- return array4;
+ cylinder3.attr("label-offset-x", rx);
+ cylinder3.attr("transform", `translate(${-w3 / 2}, ${h2 / 2} )`);
+ label.attr(
+ "transform",
+ `translate(${-(bbox.width / 2) - rx - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, cylinder3);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.rect(node2, point8);
+ const y5 = pos.y - (node2.y ?? 0);
+ if (ry != 0 && (Math.abs(y5) < (node2.height ?? 0) / 2 || Math.abs(y5) == (node2.height ?? 0) / 2 && Math.abs(pos.x - (node2.x ?? 0)) > (node2.width ?? 0) / 2 - rx)) {
+ let x5 = rx * rx * (1 - y5 * y5 / (ry * ry));
+ if (x5 != 0) {
+ x5 = Math.sqrt(Math.abs(x5));
+ }
+ x5 = rx - x5;
+ if (point8.x - (node2.x ?? 0) > 0) {
+ x5 = -x5;
+ }
+ pos.x += x5;
+ }
+ return pos;
+ };
+ return shapeSvg;
}
- var arrayEach_default;
- var init_arrayEach = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js"() {
+ var createCylinderPathD3, createOuterCylinderPathD3, createInnerCylinderPathD3;
+ var init_tiltedCylinder = __esm({
+ "src/rendering-util/rendering-elements/shapes/tiltedCylinder.ts"() {
"use strict";
- __name(arrayEach, "arrayEach");
- arrayEach_default = arrayEach;
+ init_util();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_intersect();
+ init_utils2();
+ createCylinderPathD3 = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ return `M${x5},${y5}
+ a${rx},${ry} 0,0,1 ${0},${-height2}
+ l${width3},${0}
+ a${rx},${ry} 0,0,1 ${0},${height2}
+ M${width3},${-height2}
+ a${rx},${ry} 0,0,0 ${0},${height2}
+ l${-width3},${0}`;
+ }, "createCylinderPathD");
+ createOuterCylinderPathD3 = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ return [
+ `M${x5},${y5}`,
+ `M${x5 + width3},${y5}`,
+ `a${rx},${ry} 0,0,0 ${0},${-height2}`,
+ `l${-width3},0`,
+ `a${rx},${ry} 0,0,0 ${0},${height2}`,
+ `l${width3},0`
+ ].join(" ");
+ }, "createOuterCylinderPathD");
+ createInnerCylinderPathD3 = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => {
+ return [`M${x5 + width3 / 2},${-height2 / 2}`, `a${rx},${ry} 0,0,0 0,${height2}`].join(" ");
+ }, "createInnerCylinderPathD");
+ __name(tiltedCylinder, "tiltedCylinder");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js
- function baseFindIndex(array4, predicate, fromIndex, fromRight) {
- var length2 = array4.length, index = fromIndex + (fromRight ? 1 : -1);
- while (fromRight ? index-- : ++index < length2) {
- if (predicate(array4[index], index, array4)) {
- return index;
+ // src/rendering-util/rendering-elements/shapes/trapezoid.ts
+ async function trapezoid(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const points = [
+ { x: -3 * h2 / 6, y: 0 },
+ { x: w3 + 3 * h2 / 6, y: 0 },
+ { x: w3, y: -h2 },
+ { x: 0, y: -h2 }
+ ];
+ let polygon2;
+ const { cssStyles } = node2;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const pathData = createPathFromPoints(points);
+ const roughNode = rc.path(pathData, options3);
+ polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`);
+ if (cssStyles) {
+ polygon2.attr("style", cssStyles);
}
+ } else {
+ polygon2 = insertPolygonShape(shapeSvg, w3, h2, points);
}
- return -1;
- }
- var baseFindIndex_default;
- var init_baseFindIndex = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js"() {
- "use strict";
- __name(baseFindIndex, "baseFindIndex");
- baseFindIndex_default = baseFindIndex;
+ if (nodeStyles) {
+ polygon2.attr("style", nodeStyles);
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js
- function baseIsNaN(value2) {
- return value2 !== value2;
+ node2.width = w3;
+ node2.height = h2;
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
}
- var baseIsNaN_default;
- var init_baseIsNaN = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js"() {
+ var init_trapezoid = __esm({
+ "src/rendering-util/rendering-elements/shapes/trapezoid.ts"() {
"use strict";
- __name(baseIsNaN, "baseIsNaN");
- baseIsNaN_default = baseIsNaN;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js
- function strictIndexOf(array4, value2, fromIndex) {
- var index = fromIndex - 1, length2 = array4.length;
- while (++index < length2) {
- if (array4[index] === value2) {
- return index;
- }
- }
- return -1;
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_insertPolygonShape();
+ __name(trapezoid, "trapezoid");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/trapezoidalPentagon.ts
+ async function trapezoidalPentagon(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const minWidth = 60, minHeight = 20;
+ const w3 = Math.max(minWidth, bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(minHeight, bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: -w3 / 2 * 0.8, y: -h2 / 2 },
+ { x: w3 / 2 * 0.8, y: -h2 / 2 },
+ { x: w3 / 2, y: -h2 / 2 * 0.6 },
+ { x: w3 / 2, y: h2 / 2 },
+ { x: -w3 / 2, y: h2 / 2 },
+ { x: -w3 / 2, y: -h2 / 2 * 0.6 }
+ ];
+ const pathData = createPathFromPoints(points);
+ const shapeNode = rc.path(pathData, options3);
+ const polygon2 = shapeSvg.insert(() => shapeNode, ":first-child");
+ polygon2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, polygon2);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var strictIndexOf_default;
- var init_strictIndexOf = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js"() {
+ var init_trapezoidalPentagon = __esm({
+ "src/rendering-util/rendering-elements/shapes/trapezoidalPentagon.ts"() {
"use strict";
- __name(strictIndexOf, "strictIndexOf");
- strictIndexOf_default = strictIndexOf;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js
- function baseIndexOf(array4, value2, fromIndex) {
- return value2 === value2 ? strictIndexOf_default(array4, value2, fromIndex) : baseFindIndex_default(array4, baseIsNaN_default, fromIndex);
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(trapezoidalPentagon, "trapezoidalPentagon");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/triangle.ts
+ async function triangle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const useHtmlLabels = evaluate(getConfig2().flowchart?.htmlLabels);
+ const w3 = bbox.width + (node2.padding ?? 0);
+ const h2 = w3 + bbox.height;
+ const tw = w3 + bbox.height;
+ const points = [
+ { x: 0, y: 0 },
+ { x: tw, y: 0 },
+ { x: tw / 2, y: -h2 }
+ ];
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const pathData = createPathFromPoints(points);
+ const roughNode = rc.path(pathData, options3);
+ const polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-h2 / 2}, ${h2 / 2})`);
+ if (cssStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ polygon2.selectChildren("path").attr("style", nodeStyles);
+ }
+ node2.width = w3;
+ node2.height = h2;
+ updateNodeBounds(node2, polygon2);
+ label.attr(
+ "transform",
+ `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${h2 / 2 - (bbox.height + (node2.padding ?? 0) / (useHtmlLabels ? 2 : 1) - (bbox.y - (bbox.top ?? 0)))})`
+ );
+ node2.intersect = function(point8) {
+ log.info("Triangle intersect", node2, points, point8);
+ return intersect_default.polygon(node2, points, point8);
+ };
+ return shapeSvg;
}
- var baseIndexOf_default;
- var init_baseIndexOf = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js"() {
+ var init_triangle = __esm({
+ "src/rendering-util/rendering-elements/shapes/triangle.ts"() {
"use strict";
- init_baseFindIndex();
- init_baseIsNaN();
- init_strictIndexOf();
- __name(baseIndexOf, "baseIndexOf");
- baseIndexOf_default = baseIndexOf;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js
- function arrayIncludes(array4, value2) {
- var length2 = array4 == null ? 0 : array4.length;
- return !!length2 && baseIndexOf_default(array4, value2, 0) > -1;
+ init_logger();
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_util();
+ init_common();
+ init_diagramAPI();
+ __name(triangle, "triangle");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/waveEdgedRectangle.ts
+ async function waveEdgedRectangle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const waveAmplitude = h2 / 8;
+ const finalH = h2 + waveAmplitude;
+ const { cssStyles } = node2;
+ const minWidth = 70;
+ const widthDif = minWidth - w3;
+ const extraW = widthDif > 0 ? widthDif / 2 : 0;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: -w3 / 2 - extraW, y: finalH / 2 },
+ ...generateFullSineWavePoints(
+ -w3 / 2 - extraW,
+ finalH / 2,
+ w3 / 2 + extraW,
+ finalH / 2,
+ waveAmplitude,
+ 0.8
+ ),
+ { x: w3 / 2 + extraW, y: -finalH / 2 },
+ { x: -w3 / 2 - extraW, y: -finalH / 2 }
+ ];
+ const waveEdgeRectPath = createPathFromPoints(points);
+ const waveEdgeRectNode = rc.path(waveEdgeRectPath, options3);
+ const waveEdgeRect = shapeSvg.insert(() => waveEdgeRectNode, ":first-child");
+ waveEdgeRect.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ waveEdgeRect.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ waveEdgeRect.selectAll("path").attr("style", nodeStyles);
+ }
+ waveEdgeRect.attr("transform", `translate(0,${-waveAmplitude / 2})`);
+ label.attr(
+ "transform",
+ `translate(${-w3 / 2 + (node2.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h2 / 2 + (node2.padding ?? 0) - waveAmplitude - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, waveEdgeRect);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var arrayIncludes_default;
- var init_arrayIncludes = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js"() {
- "use strict";
- init_baseIndexOf();
- __name(arrayIncludes, "arrayIncludes");
- arrayIncludes_default = arrayIncludes;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js
- var nativeKeys, nativeKeys_default;
- var init_nativeKeys = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js"() {
+ var init_waveEdgedRectangle = __esm({
+ "src/rendering-util/rendering-elements/shapes/waveEdgedRectangle.ts"() {
"use strict";
- init_overArg();
- nativeKeys = overArg_default(Object.keys, Object);
- nativeKeys_default = nativeKeys;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js
- function baseKeys(object3) {
- if (!isPrototype_default(object3)) {
- return nativeKeys_default(object3);
- }
- var result = [];
- for (var key in Object(object3)) {
- if (hasOwnProperty10.call(object3, key) && key != "constructor") {
- result.push(key);
- }
- }
- return result;
+ init_util();
+ init_intersect();
+ init_rough_esm();
+ init_handDrawnShapeStyles();
+ __name(waveEdgedRectangle, "waveEdgedRectangle");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/waveRectangle.ts
+ async function waveRectangle(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const minWidth = 100;
+ const minHeight = 50;
+ const baseWidth = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const baseHeight = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const aspectRatio = baseWidth / baseHeight;
+ let w3 = baseWidth;
+ let h2 = baseHeight;
+ if (w3 > h2 * aspectRatio) {
+ h2 = w3 / aspectRatio;
+ } else {
+ w3 = h2 * aspectRatio;
+ }
+ w3 = Math.max(w3, minWidth);
+ h2 = Math.max(h2, minHeight);
+ const waveAmplitude = Math.min(h2 * 0.2, h2 / 4);
+ const finalH = h2 + waveAmplitude * 2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const points = [
+ { x: -w3 / 2, y: finalH / 2 },
+ ...generateFullSineWavePoints(-w3 / 2, finalH / 2, w3 / 2, finalH / 2, waveAmplitude, 1),
+ { x: w3 / 2, y: -finalH / 2 },
+ ...generateFullSineWavePoints(w3 / 2, -finalH / 2, -w3 / 2, -finalH / 2, waveAmplitude, -1)
+ ];
+ const waveRectPath = createPathFromPoints(points);
+ const waveRectNode = rc.path(waveRectPath, options3);
+ const waveRect = shapeSvg.insert(() => waveRectNode, ":first-child");
+ waveRect.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ waveRect.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ waveRect.selectAll("path").attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, waveRect);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, points, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var objectProto12, hasOwnProperty10, baseKeys_default;
- var init_baseKeys = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js"() {
+ var init_waveRectangle = __esm({
+ "src/rendering-util/rendering-elements/shapes/waveRectangle.ts"() {
"use strict";
- init_isPrototype();
- init_nativeKeys();
- objectProto12 = Object.prototype;
- hasOwnProperty10 = objectProto12.hasOwnProperty;
- __name(baseKeys, "baseKeys");
- baseKeys_default = baseKeys;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js
- function keys(object3) {
- return isArrayLike_default(object3) ? arrayLikeKeys_default(object3) : baseKeys_default(object3);
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ __name(waveRectangle, "waveRectangle");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/windowPane.ts
+ async function windowPane(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const { shapeSvg, bbox, label } = await labelHelper(parent4, node2, getNodeClasses(node2));
+ const w3 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
+ const h2 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
+ const rectOffset = 5;
+ const x5 = -w3 / 2;
+ const y5 = -h2 / 2;
+ const { cssStyles } = node2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ const outerPathPoints = [
+ { x: x5 - rectOffset, y: y5 - rectOffset },
+ { x: x5 - rectOffset, y: y5 + h2 },
+ { x: x5 + w3, y: y5 + h2 },
+ { x: x5 + w3, y: y5 - rectOffset }
+ ];
+ const path4 = `M${x5 - rectOffset},${y5 - rectOffset} L${x5 + w3},${y5 - rectOffset} L${x5 + w3},${y5 + h2} L${x5 - rectOffset},${y5 + h2} L${x5 - rectOffset},${y5 - rectOffset}
+ M${x5 - rectOffset},${y5} L${x5 + w3},${y5}
+ M${x5},${y5 - rectOffset} L${x5},${y5 + h2}`;
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const no = rc.path(path4, options3);
+ const windowPane2 = shapeSvg.insert(() => no, ":first-child");
+ windowPane2.attr("transform", `translate(${rectOffset / 2}, ${rectOffset / 2})`);
+ windowPane2.attr("class", "basic label-container");
+ if (cssStyles && node2.look !== "handDrawn") {
+ windowPane2.selectAll("path").attr("style", cssStyles);
+ }
+ if (nodeStyles && node2.look !== "handDrawn") {
+ windowPane2.selectAll("path").attr("style", nodeStyles);
+ }
+ label.attr(
+ "transform",
+ `translate(${-(bbox.width / 2) + rectOffset / 2 - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset / 2 - (bbox.y - (bbox.top ?? 0))})`
+ );
+ updateNodeBounds(node2, windowPane2);
+ node2.intersect = function(point8) {
+ const pos = intersect_default.polygon(node2, outerPathPoints, point8);
+ return pos;
+ };
+ return shapeSvg;
}
- var keys_default;
- var init_keys = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js"() {
- "use strict";
- init_arrayLikeKeys();
- init_baseKeys();
- init_isArrayLike();
- __name(keys, "keys");
- keys_default = keys;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/assign.js
- var objectProto13, hasOwnProperty11, assign, assign_default;
- var init_assign = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/assign.js"() {
+ var init_windowPane = __esm({
+ "src/rendering-util/rendering-elements/shapes/windowPane.ts"() {
"use strict";
- init_assignValue();
- init_copyObject();
- init_createAssigner();
- init_isArrayLike();
- init_isPrototype();
- init_keys();
- objectProto13 = Object.prototype;
- hasOwnProperty11 = objectProto13.hasOwnProperty;
- assign = createAssigner_default(function(object3, source) {
- if (isPrototype_default(source) || isArrayLike_default(source)) {
- copyObject_default(source, keys_default(source), object3);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty11.call(source, key)) {
- assignValue_default(object3, key, source[key]);
- }
- }
+ init_util();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_intersect();
+ __name(windowPane, "windowPane");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/erBox.ts
+ async function erBox(parent4, node2) {
+ const entityNode = node2;
+ if (entityNode.alias) {
+ node2.label = entityNode.alias;
+ }
+ if (node2.look === "handDrawn") {
+ const { themeVariables: themeVariables2 } = getConfig();
+ const { background } = themeVariables2;
+ const backgroundNode = {
+ ...node2,
+ id: node2.id + "-background",
+ look: "default",
+ cssStyles: ["stroke: none", `fill: ${background}`]
+ };
+ await erBox(parent4, backgroundNode);
+ }
+ const config5 = getConfig();
+ node2.useHtmlLabels = config5.htmlLabels;
+ let PADDING = config5.er?.diagramPadding ?? 10;
+ let TEXT_PADDING = config5.er?.entityPadding ?? 6;
+ const { cssStyles } = node2;
+ const { labelStyles } = styles2String(node2);
+ if (entityNode.attributes.length === 0 && node2.label) {
+ const options4 = {
+ rx: 0,
+ ry: 0,
+ labelPaddingX: PADDING,
+ labelPaddingY: PADDING * 1.5,
+ classes: ""
+ };
+ if (calculateTextWidth(node2.label, config5) + options4.labelPaddingX * 2 < config5.er.minEntityWidth) {
+ node2.width = config5.er.minEntityWidth;
+ }
+ const shapeSvg2 = await drawRect3(parent4, node2, options4);
+ if (!evaluate(config5.htmlLabels)) {
+ const textElement = shapeSvg2.select("text");
+ const bbox = textElement.node()?.getBBox();
+ textElement.attr("transform", `translate(${-bbox.width / 2}, 0)`);
+ }
+ return shapeSvg2;
+ }
+ if (!config5.htmlLabels) {
+ PADDING *= 1.25;
+ TEXT_PADDING *= 1.25;
+ }
+ let cssClasses = getNodeClasses(node2);
+ if (!cssClasses) {
+ cssClasses = "node default";
+ }
+ const shapeSvg = parent4.insert("g").attr("class", cssClasses).attr("id", node2.domId || node2.id);
+ const nameBBox = await addText(shapeSvg, node2.label ?? "", config5, 0, 0, ["name"], labelStyles);
+ nameBBox.height += TEXT_PADDING;
+ let yOffset = 0;
+ const yOffsets = [];
+ let maxTypeWidth = 0;
+ let maxNameWidth = 0;
+ let maxKeysWidth = 0;
+ let maxCommentWidth = 0;
+ let keysPresent = true;
+ let commentPresent = true;
+ for (const attribute of entityNode.attributes) {
+ const typeBBox = await addText(
+ shapeSvg,
+ attribute.type,
+ config5,
+ 0,
+ yOffset,
+ ["attribute-type"],
+ labelStyles
+ );
+ maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width + PADDING);
+ const nameBBox2 = await addText(
+ shapeSvg,
+ attribute.name,
+ config5,
+ 0,
+ yOffset,
+ ["attribute-name"],
+ labelStyles
+ );
+ maxNameWidth = Math.max(maxNameWidth, nameBBox2.width + PADDING);
+ const keysBBox = await addText(
+ shapeSvg,
+ attribute.keys.join(),
+ config5,
+ 0,
+ yOffset,
+ ["attribute-keys"],
+ labelStyles
+ );
+ maxKeysWidth = Math.max(maxKeysWidth, keysBBox.width + PADDING);
+ const commentBBox = await addText(
+ shapeSvg,
+ attribute.comment,
+ config5,
+ 0,
+ yOffset,
+ ["attribute-comment"],
+ labelStyles
+ );
+ maxCommentWidth = Math.max(maxCommentWidth, commentBBox.width + PADDING);
+ yOffset += Math.max(typeBBox.height, nameBBox2.height, keysBBox.height, commentBBox.height) + TEXT_PADDING;
+ yOffsets.push(yOffset);
+ }
+ yOffsets.pop();
+ let totalWidthSections = 4;
+ if (maxKeysWidth <= PADDING) {
+ keysPresent = false;
+ maxKeysWidth = 0;
+ totalWidthSections--;
+ }
+ if (maxCommentWidth <= PADDING) {
+ commentPresent = false;
+ maxCommentWidth = 0;
+ totalWidthSections--;
+ }
+ const shapeBBox = shapeSvg.node().getBBox();
+ if (nameBBox.width + PADDING * 2 - (maxTypeWidth + maxNameWidth + maxKeysWidth + maxCommentWidth) > 0) {
+ const difference2 = nameBBox.width + PADDING * 2 - (maxTypeWidth + maxNameWidth + maxKeysWidth + maxCommentWidth);
+ maxTypeWidth += difference2 / totalWidthSections;
+ maxNameWidth += difference2 / totalWidthSections;
+ if (maxKeysWidth > 0) {
+ maxKeysWidth += difference2 / totalWidthSections;
+ }
+ if (maxCommentWidth > 0) {
+ maxCommentWidth += difference2 / totalWidthSections;
+ }
+ }
+ const maxWidth = maxTypeWidth + maxNameWidth + maxKeysWidth + maxCommentWidth;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const w3 = Math.max(shapeBBox.width + PADDING * 2, node2?.width || 0, maxWidth);
+ const h2 = Math.max(shapeBBox.height + (yOffsets[0] || yOffset) + TEXT_PADDING, node2?.height || 0);
+ const x5 = -w3 / 2;
+ const y5 = -h2 / 2;
+ shapeSvg.selectAll("g:not(:first-child)").each((_2, i2, nodes6) => {
+ const text4 = select_default2(nodes6[i2]);
+ const transform8 = text4.attr("transform");
+ let translateX2 = 0;
+ let translateY2 = 0;
+ if (transform8) {
+ const regex2 = RegExp(/translate\(([^,]+),([^)]+)\)/);
+ const translate2 = regex2.exec(transform8);
+ if (translate2) {
+ translateX2 = parseFloat(translate2[1]);
+ translateY2 = parseFloat(translate2[2]);
+ if (text4.attr("class").includes("attribute-name")) {
+ translateX2 += maxTypeWidth;
+ } else if (text4.attr("class").includes("attribute-keys")) {
+ translateX2 += maxTypeWidth + maxNameWidth;
+ } else if (text4.attr("class").includes("attribute-comment")) {
+ translateX2 += maxTypeWidth + maxNameWidth + maxKeysWidth;
+ }
+ }
+ }
+ text4.attr(
+ "transform",
+ `translate(${x5 + PADDING / 2 + translateX2}, ${translateY2 + y5 + nameBBox.height + TEXT_PADDING / 2})`
+ );
+ });
+ shapeSvg.select(".name").attr("transform", "translate(" + -nameBBox.width / 2 + ", " + (y5 + TEXT_PADDING / 2) + ")");
+ const roughRect = rc.rectangle(x5, y5, w3, h2, options3);
+ const rect3 = shapeSvg.insert(() => roughRect, ":first-child").attr("style", cssStyles.join(""));
+ const { themeVariables } = getConfig();
+ const { rowEven, rowOdd, nodeBorder } = themeVariables;
+ yOffsets.push(0);
+ for (const [i2, yOffset2] of yOffsets.entries()) {
+ if (i2 === 0 && yOffsets.length > 1) {
+ continue;
+ }
+ const isEven = i2 % 2 === 0 && yOffset2 !== 0;
+ const roughRect2 = rc.rectangle(x5, nameBBox.height + y5 + yOffset2, w3, nameBBox.height, {
+ ...options3,
+ fill: isEven ? rowEven : rowOdd,
+ stroke: nodeBorder
});
- assign_default = assign;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js
- function isKey(value2, object3) {
- if (isArray_default(value2)) {
- return false;
- }
- var type3 = typeof value2;
- if (type3 == "number" || type3 == "symbol" || type3 == "boolean" || value2 == null || isSymbol_default(value2)) {
- return true;
+ shapeSvg.insert(() => roughRect2, "g.label").attr("style", cssStyles.join("")).attr("class", `row-rect-${i2 % 2 === 0 ? "even" : "odd"}`);
+ }
+ let roughLine = rc.line(x5, nameBBox.height + y5, w3 + x5, nameBBox.height + y5, options3);
+ shapeSvg.insert(() => roughLine).attr("class", "divider");
+ roughLine = rc.line(maxTypeWidth + x5, nameBBox.height + y5, maxTypeWidth + x5, h2 + y5, options3);
+ shapeSvg.insert(() => roughLine).attr("class", "divider");
+ if (keysPresent) {
+ roughLine = rc.line(
+ maxTypeWidth + maxNameWidth + x5,
+ nameBBox.height + y5,
+ maxTypeWidth + maxNameWidth + x5,
+ h2 + y5,
+ options3
+ );
+ shapeSvg.insert(() => roughLine).attr("class", "divider");
+ }
+ if (commentPresent) {
+ roughLine = rc.line(
+ maxTypeWidth + maxNameWidth + maxKeysWidth + x5,
+ nameBBox.height + y5,
+ maxTypeWidth + maxNameWidth + maxKeysWidth + x5,
+ h2 + y5,
+ options3
+ );
+ shapeSvg.insert(() => roughLine).attr("class", "divider");
}
- return reIsPlainProp.test(value2) || !reIsDeepProp.test(value2) || object3 != null && value2 in Object(object3);
- }
- var reIsDeepProp, reIsPlainProp, isKey_default;
- var init_isKey = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js"() {
- "use strict";
- init_isArray();
- init_isSymbol();
- reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
- reIsPlainProp = /^\w*$/;
- __name(isKey, "isKey");
- isKey_default = isKey;
+ for (const yOffset2 of yOffsets) {
+ roughLine = rc.line(
+ x5,
+ nameBBox.height + y5 + yOffset2,
+ w3 + x5,
+ nameBBox.height + y5 + yOffset2,
+ options3
+ );
+ shapeSvg.insert(() => roughLine).attr("class", "divider");
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js
- function memoizeCapped(func) {
- var result = memoize_default(func, function(key) {
- if (cache3.size === MAX_MEMOIZE_SIZE) {
- cache3.clear();
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
+ }
+ async function addText(shapeSvg, labelText, config5, translateX2 = 0, translateY2 = 0, classes3 = [], style3 = "") {
+ const label = shapeSvg.insert("g").attr("class", `label ${classes3.join(" ")}`).attr("transform", `translate(${translateX2}, ${translateY2})`).attr("style", style3);
+ if (labelText !== parseGenericTypes(labelText)) {
+ labelText = parseGenericTypes(labelText);
+ labelText = labelText.replaceAll("<", "<").replaceAll(">", ">");
+ }
+ const text4 = label.node().appendChild(
+ await createText(
+ label,
+ labelText,
+ {
+ width: calculateTextWidth(labelText, config5) + 100,
+ style: style3,
+ useHtmlLabels: config5.htmlLabels
+ },
+ config5
+ )
+ );
+ if (labelText.includes("<") || labelText.includes(">")) {
+ let child = text4.children[0];
+ child.textContent = child.textContent.replaceAll("<", "<").replaceAll(">", ">");
+ while (child.childNodes[0]) {
+ child = child.childNodes[0];
+ child.textContent = child.textContent.replaceAll("<", "<").replaceAll(">", ">");
}
- return key;
- });
- var cache3 = result.cache;
- return result;
- }
- var MAX_MEMOIZE_SIZE, memoizeCapped_default;
- var init_memoizeCapped = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js"() {
- "use strict";
- init_memoize();
- MAX_MEMOIZE_SIZE = 500;
- __name(memoizeCapped, "memoizeCapped");
- memoizeCapped_default = memoizeCapped;
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js
- var rePropName, reEscapeChar, stringToPath, stringToPath_default;
- var init_stringToPath = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js"() {
- "use strict";
- init_memoizeCapped();
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
- reEscapeChar = /\\(\\)?/g;
- stringToPath = memoizeCapped_default(function(string3) {
- var result = [];
- if (string3.charCodeAt(0) === 46) {
- result.push("");
- }
- string3.replace(rePropName, function(match2, number7, quote, subString) {
- result.push(quote ? subString.replace(reEscapeChar, "$1") : number7 || match2);
- });
- return result;
- });
- stringToPath_default = stringToPath;
+ let bbox = text4.getBBox();
+ if (evaluate(config5.htmlLabels)) {
+ const div = text4.children[0];
+ div.style.textAlign = "start";
+ const dv = select_default2(text4);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js
- function toString(value2) {
- return value2 == null ? "" : baseToString_default(value2);
+ return bbox;
}
- var toString_default;
- var init_toString = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js"() {
+ var init_erBox = __esm({
+ "src/rendering-util/rendering-elements/shapes/erBox.ts"() {
"use strict";
- init_baseToString();
- __name(toString, "toString");
- toString_default = toString;
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_drawRect();
+ init_config();
+ init_createText();
+ init_common();
+ init_src32();
+ init_utils2();
+ __name(erBox, "erBox");
+ __name(addText, "addText");
+ }
+ });
+
+ // src/diagrams/class/shapeUtil.ts
+ async function textHelper(parent4, node2, config5, useHtmlLabels, GAP = config5.class.padding ?? 12) {
+ const TEXT_PADDING = !useHtmlLabels ? 3 : 0;
+ const shapeSvg = parent4.insert("g").attr("class", getNodeClasses(node2)).attr("id", node2.domId || node2.id);
+ let annotationGroup = null;
+ let labelGroup = null;
+ let membersGroup = null;
+ let methodsGroup = null;
+ let annotationGroupHeight = 0;
+ let labelGroupHeight = 0;
+ let membersGroupHeight = 0;
+ annotationGroup = shapeSvg.insert("g").attr("class", "annotation-group text");
+ if (node2.annotations.length > 0) {
+ const annotation = node2.annotations[0];
+ await addText2(annotationGroup, { text: `\xAB${annotation}\xBB` }, 0);
+ const annotationGroupBBox = annotationGroup.node().getBBox();
+ annotationGroupHeight = annotationGroupBBox.height;
+ }
+ labelGroup = shapeSvg.insert("g").attr("class", "label-group text");
+ await addText2(labelGroup, node2, 0, ["font-weight: bolder"]);
+ const labelGroupBBox = labelGroup.node().getBBox();
+ labelGroupHeight = labelGroupBBox.height;
+ membersGroup = shapeSvg.insert("g").attr("class", "members-group text");
+ let yOffset = 0;
+ for (const member of node2.members) {
+ const height2 = await addText2(membersGroup, member, yOffset, [member.parseClassifier()]);
+ yOffset += height2 + TEXT_PADDING;
+ }
+ membersGroupHeight = membersGroup.node().getBBox().height;
+ if (membersGroupHeight <= 0) {
+ membersGroupHeight = GAP / 2;
+ }
+ methodsGroup = shapeSvg.insert("g").attr("class", "methods-group text");
+ let methodsYOffset = 0;
+ for (const method of node2.methods) {
+ const height2 = await addText2(methodsGroup, method, methodsYOffset, [method.parseClassifier()]);
+ methodsYOffset += height2 + TEXT_PADDING;
+ }
+ let bbox = shapeSvg.node().getBBox();
+ if (annotationGroup !== null) {
+ const annotationGroupBBox = annotationGroup.node().getBBox();
+ annotationGroup.attr("transform", `translate(${-annotationGroupBBox.width / 2})`);
+ }
+ labelGroup.attr("transform", `translate(${-labelGroupBBox.width / 2}, ${annotationGroupHeight})`);
+ bbox = shapeSvg.node().getBBox();
+ membersGroup.attr(
+ "transform",
+ `translate(${0}, ${annotationGroupHeight + labelGroupHeight + GAP * 2})`
+ );
+ bbox = shapeSvg.node().getBBox();
+ methodsGroup.attr(
+ "transform",
+ `translate(${0}, ${annotationGroupHeight + labelGroupHeight + (membersGroupHeight ? membersGroupHeight + GAP * 4 : GAP * 2)})`
+ );
+ bbox = shapeSvg.node().getBBox();
+ return { shapeSvg, bbox };
+ }
+ async function addText2(parentGroup, node2, yOffset, styles4 = []) {
+ const textEl = parentGroup.insert("g").attr("class", "label").attr("style", styles4.join("; "));
+ const config5 = getConfig();
+ let useHtmlLabels = "useHtmlLabels" in node2 ? node2.useHtmlLabels : evaluate(config5.htmlLabels) ?? true;
+ let textContent = "";
+ if ("text" in node2) {
+ textContent = node2.text;
+ } else {
+ textContent = node2.label;
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js
- function castPath(value2, object3) {
- if (isArray_default(value2)) {
- return value2;
+ if (!useHtmlLabels && textContent.startsWith("\\")) {
+ textContent = textContent.substring(1);
}
- return isKey_default(value2, object3) ? [value2] : stringToPath_default(toString_default(value2));
- }
- var castPath_default;
- var init_castPath = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js"() {
- "use strict";
- init_isArray();
- init_isKey();
- init_stringToPath();
- init_toString();
- __name(castPath, "castPath");
- castPath_default = castPath;
+ if (hasKatex(textContent)) {
+ useHtmlLabels = true;
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js
- function toKey(value2) {
- if (typeof value2 == "string" || isSymbol_default(value2)) {
- return value2;
+ const text4 = await createText(
+ textEl,
+ sanitizeText3(decodeEntities(textContent)),
+ {
+ width: calculateTextWidth(textContent, config5) + 50,
+ // Add room for error when splitting text into multiple lines
+ classes: "markdown-node-label",
+ useHtmlLabels
+ },
+ config5
+ );
+ let bbox;
+ let numberOfLines = 1;
+ if (!useHtmlLabels) {
+ if (styles4.includes("font-weight: bolder")) {
+ select_default2(text4).selectAll("tspan").attr("font-weight", "");
+ }
+ numberOfLines = text4.children.length;
+ const textChild = text4.children[0];
+ if (text4.textContent === "" || text4.textContent.includes(">")) {
+ textChild.textContent = textContent[0] + textContent.substring(1).replaceAll(">", ">").replaceAll("<", "<").trim();
+ const preserveSpace = textContent[1] === " ";
+ if (preserveSpace) {
+ textChild.textContent = textChild.textContent[0] + " " + textChild.textContent.substring(1);
+ }
+ }
+ if (textChild.textContent === "undefined") {
+ textChild.textContent = "";
+ }
+ bbox = text4.getBBox();
+ } else {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ numberOfLines = div.innerHTML.split(" ").length;
+ if (div.innerHTML.includes("")) {
+ numberOfLines += div.innerHTML.split("").length - 1;
+ }
+ const images = div.getElementsByTagName("img");
+ if (images) {
+ const noImgText = textContent.replace(/ ]*>/g, "").trim() === "";
+ await Promise.all(
+ [...images].map(
+ (img) => new Promise((res) => {
+ function setupImage() {
+ img.style.display = "flex";
+ img.style.flexDirection = "column";
+ if (noImgText) {
+ const bodyFontSize = config5.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize;
+ const enlargingFactor = 5;
+ const width3 = parseInt(bodyFontSize, 10) * enlargingFactor + "px";
+ img.style.minWidth = width3;
+ img.style.maxWidth = width3;
+ } else {
+ img.style.width = "100%";
+ }
+ res(img);
+ }
+ __name(setupImage, "setupImage");
+ setTimeout(() => {
+ if (img.complete) {
+ setupImage();
+ }
+ });
+ img.addEventListener("error", setupImage);
+ img.addEventListener("load", setupImage);
+ })
+ )
+ );
+ }
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
}
- var result = value2 + "";
- return result == "0" && 1 / value2 == -INFINITY3 ? "-0" : result;
+ textEl.attr("transform", "translate(0," + (-bbox.height / (2 * numberOfLines) + yOffset) + ")");
+ return bbox.height;
}
- var INFINITY3, toKey_default;
- var init_toKey = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js"() {
+ var init_shapeUtil = __esm({
+ "src/diagrams/class/shapeUtil.ts"() {
"use strict";
- init_isSymbol();
- INFINITY3 = 1 / 0;
- __name(toKey, "toKey");
- toKey_default = toKey;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js
- function baseGet(object3, path4) {
- path4 = castPath_default(path4, object3);
- var index = 0, length2 = path4.length;
- while (object3 != null && index < length2) {
- object3 = object3[toKey_default(path4[index++])];
+ init_src32();
+ init_config();
+ init_util();
+ init_utils2();
+ init_diagramAPI();
+ init_createText();
+ init_common();
+ __name(textHelper, "textHelper");
+ __name(addText2, "addText");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/classBox.ts
+ async function classBox(parent4, node2) {
+ const config5 = getConfig2();
+ const PADDING = config5.class.padding ?? 12;
+ const GAP = PADDING;
+ const useHtmlLabels = node2.useHtmlLabels ?? evaluate(config5.htmlLabels) ?? true;
+ const classNode = node2;
+ classNode.annotations = classNode.annotations ?? [];
+ classNode.members = classNode.members ?? [];
+ classNode.methods = classNode.methods ?? [];
+ const { shapeSvg, bbox } = await textHelper(parent4, node2, config5, useHtmlLabels, GAP);
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ node2.cssStyles = classNode.styles || "";
+ const styles4 = classNode.styles?.join(";") || nodeStyles || "";
+ if (!node2.cssStyles) {
+ node2.cssStyles = styles4.replaceAll("!important", "").split(";");
+ }
+ const renderExtraBox = classNode.members.length === 0 && classNode.methods.length === 0 && !config5.class?.hideEmptyMembersBox;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const w3 = bbox.width;
+ let h2 = bbox.height;
+ if (classNode.members.length === 0 && classNode.methods.length === 0) {
+ h2 += GAP;
+ } else if (classNode.members.length > 0 && classNode.methods.length === 0) {
+ h2 += GAP * 2;
+ }
+ const x5 = -w3 / 2;
+ const y5 = -h2 / 2;
+ const roughRect = rc.rectangle(
+ x5 - PADDING,
+ y5 - PADDING - (renderExtraBox ? PADDING : classNode.members.length === 0 && classNode.methods.length === 0 ? -PADDING / 2 : 0),
+ w3 + 2 * PADDING,
+ h2 + 2 * PADDING + (renderExtraBox ? PADDING * 2 : classNode.members.length === 0 && classNode.methods.length === 0 ? -PADDING : 0),
+ options3
+ );
+ const rect3 = shapeSvg.insert(() => roughRect, ":first-child");
+ rect3.attr("class", "basic label-container");
+ const rectBBox = rect3.node().getBBox();
+ shapeSvg.selectAll(".text").each((_2, i2, nodes6) => {
+ const text4 = select_default2(nodes6[i2]);
+ const transform8 = text4.attr("transform");
+ let translateY2 = 0;
+ if (transform8) {
+ const regex2 = RegExp(/translate\(([^,]+),([^)]+)\)/);
+ const translate2 = regex2.exec(transform8);
+ if (translate2) {
+ translateY2 = parseFloat(translate2[2]);
+ }
+ }
+ let newTranslateY = translateY2 + y5 + PADDING - (renderExtraBox ? PADDING : classNode.members.length === 0 && classNode.methods.length === 0 ? -PADDING / 2 : 0);
+ if (!useHtmlLabels) {
+ newTranslateY -= 4;
+ }
+ let newTranslateX = x5;
+ if (text4.attr("class").includes("label-group") || text4.attr("class").includes("annotation-group")) {
+ newTranslateX = -text4.node()?.getBBox().width / 2 || 0;
+ shapeSvg.selectAll("text").each(function(_3, i3, nodes7) {
+ if (window.getComputedStyle(nodes7[i3]).textAnchor === "middle") {
+ newTranslateX = 0;
+ }
+ });
+ }
+ text4.attr("transform", `translate(${newTranslateX}, ${newTranslateY})`);
+ });
+ const annotationGroupHeight = shapeSvg.select(".annotation-group").node().getBBox().height - (renderExtraBox ? PADDING / 2 : 0) || 0;
+ const labelGroupHeight = shapeSvg.select(".label-group").node().getBBox().height - (renderExtraBox ? PADDING / 2 : 0) || 0;
+ const membersGroupHeight = shapeSvg.select(".members-group").node().getBBox().height - (renderExtraBox ? PADDING / 2 : 0) || 0;
+ if (classNode.members.length > 0 || classNode.methods.length > 0 || renderExtraBox) {
+ const roughLine = rc.line(
+ rectBBox.x,
+ annotationGroupHeight + labelGroupHeight + y5 + PADDING,
+ rectBBox.x + rectBBox.width,
+ annotationGroupHeight + labelGroupHeight + y5 + PADDING,
+ options3
+ );
+ const line2 = shapeSvg.insert(() => roughLine);
+ line2.attr("class", "divider").attr("style", styles4);
+ }
+ if (renderExtraBox || classNode.members.length > 0 || classNode.methods.length > 0) {
+ const roughLine = rc.line(
+ rectBBox.x,
+ annotationGroupHeight + labelGroupHeight + membersGroupHeight + y5 + GAP * 2 + PADDING,
+ rectBBox.x + rectBBox.width,
+ annotationGroupHeight + labelGroupHeight + membersGroupHeight + y5 + PADDING + GAP * 2,
+ options3
+ );
+ const line2 = shapeSvg.insert(() => roughLine);
+ line2.attr("class", "divider").attr("style", styles4);
}
- return index && index == length2 ? object3 : void 0;
- }
- var baseGet_default;
- var init_baseGet = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js"() {
- "use strict";
- init_castPath();
- init_toKey();
- __name(baseGet, "baseGet");
- baseGet_default = baseGet;
+ if (classNode.look !== "handDrawn") {
+ shapeSvg.selectAll("path").attr("style", styles4);
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js
- function get3(object3, path4, defaultValue) {
- var result = object3 == null ? void 0 : baseGet_default(object3, path4);
- return result === void 0 ? defaultValue : result;
- }
- var get_default;
- var init_get = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js"() {
- "use strict";
- init_baseGet();
- __name(get3, "get");
- get_default = get3;
+ rect3.select(":nth-child(2)").attr("style", styles4);
+ shapeSvg.selectAll(".divider").select("path").attr("style", styles4);
+ if (node2.labelStyle) {
+ shapeSvg.selectAll("span").attr("style", node2.labelStyle);
+ } else {
+ shapeSvg.selectAll("span").attr("style", styles4);
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js
- function arrayPush(array4, values2) {
- var index = -1, length2 = values2.length, offset = array4.length;
- while (++index < length2) {
- array4[offset + index] = values2[index];
+ if (!useHtmlLabels) {
+ const colorRegex = RegExp(/color\s*:\s*([^;]*)/);
+ const match2 = colorRegex.exec(styles4);
+ if (match2) {
+ const colorStyle = match2[0].replace("color", "fill");
+ shapeSvg.selectAll("tspan").attr("style", colorStyle);
+ } else if (labelStyles) {
+ const match3 = colorRegex.exec(labelStyles);
+ if (match3) {
+ const colorStyle = match3[0].replace("color", "fill");
+ shapeSvg.selectAll("tspan").attr("style", colorStyle);
+ }
+ }
}
- return array4;
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
}
- var arrayPush_default;
- var init_arrayPush = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js"() {
+ var init_classBox = __esm({
+ "src/rendering-util/rendering-elements/shapes/classBox.ts"() {
"use strict";
- __name(arrayPush, "arrayPush");
- arrayPush_default = arrayPush;
+ init_util();
+ init_diagramAPI();
+ init_src32();
+ init_rough_esm();
+ init_handDrawnShapeStyles();
+ init_intersect();
+ init_shapeUtil();
+ init_common();
+ __name(classBox, "classBox");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/requirementBox.ts
+ async function requirementBox(parent4, node2) {
+ const { labelStyles, nodeStyles } = styles2String(node2);
+ node2.labelStyle = labelStyles;
+ const requirementNode = node2;
+ const elementNode = node2;
+ const padding2 = 20;
+ const gap = 20;
+ const isRequirementNode = "verifyMethod" in node2;
+ const classes3 = getNodeClasses(node2);
+ const shapeSvg = parent4.insert("g").attr("class", classes3).attr("id", node2.domId ?? node2.id);
+ let typeHeight;
+ if (isRequirementNode) {
+ typeHeight = await addText3(
+ shapeSvg,
+ `<<${requirementNode.type}>>`,
+ 0,
+ node2.labelStyle
+ );
+ } else {
+ typeHeight = await addText3(shapeSvg, "<<Element>>", 0, node2.labelStyle);
+ }
+ let accumulativeHeight = typeHeight;
+ const nameHeight = await addText3(
+ shapeSvg,
+ requirementNode.name,
+ accumulativeHeight,
+ node2.labelStyle + "; font-weight: bold;"
+ );
+ accumulativeHeight += nameHeight + gap;
+ if (isRequirementNode) {
+ const idHeight = await addText3(
+ shapeSvg,
+ `${requirementNode.requirementId ? `Id: ${requirementNode.requirementId}` : ""}`,
+ accumulativeHeight,
+ node2.labelStyle
+ );
+ accumulativeHeight += idHeight;
+ const textHeight = await addText3(
+ shapeSvg,
+ `${requirementNode.text ? `Text: ${requirementNode.text}` : ""}`,
+ accumulativeHeight,
+ node2.labelStyle
+ );
+ accumulativeHeight += textHeight;
+ const riskHeight = await addText3(
+ shapeSvg,
+ `${requirementNode.risk ? `Risk: ${requirementNode.risk}` : ""}`,
+ accumulativeHeight,
+ node2.labelStyle
+ );
+ accumulativeHeight += riskHeight;
+ await addText3(
+ shapeSvg,
+ `${requirementNode.verifyMethod ? `Verification: ${requirementNode.verifyMethod}` : ""}`,
+ accumulativeHeight,
+ node2.labelStyle
+ );
+ } else {
+ const typeHeight2 = await addText3(
+ shapeSvg,
+ `${elementNode.type ? `Type: ${elementNode.type}` : ""}`,
+ accumulativeHeight,
+ node2.labelStyle
+ );
+ accumulativeHeight += typeHeight2;
+ await addText3(
+ shapeSvg,
+ `${elementNode.docRef ? `Doc Ref: ${elementNode.docRef}` : ""}`,
+ accumulativeHeight,
+ node2.labelStyle
+ );
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js
- function isFlattenable(value2) {
- return isArray_default(value2) || isArguments_default(value2) || !!(spreadableSymbol && value2 && value2[spreadableSymbol]);
+ const totalWidth = (shapeSvg.node()?.getBBox().width ?? 200) + padding2;
+ const totalHeight = (shapeSvg.node()?.getBBox().height ?? 200) + padding2;
+ const x5 = -totalWidth / 2;
+ const y5 = -totalHeight / 2;
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {});
+ if (node2.look !== "handDrawn") {
+ options3.roughness = 0;
+ options3.fillStyle = "solid";
+ }
+ const roughRect = rc.rectangle(x5, y5, totalWidth, totalHeight, options3);
+ const rect3 = shapeSvg.insert(() => roughRect, ":first-child");
+ rect3.attr("class", "basic label-container").attr("style", nodeStyles);
+ shapeSvg.selectAll(".label").each((_2, i2, nodes6) => {
+ const text4 = select_default2(nodes6[i2]);
+ const transform8 = text4.attr("transform");
+ let translateX2 = 0;
+ let translateY2 = 0;
+ if (transform8) {
+ const regex2 = RegExp(/translate\(([^,]+),([^)]+)\)/);
+ const translate2 = regex2.exec(transform8);
+ if (translate2) {
+ translateX2 = parseFloat(translate2[1]);
+ translateY2 = parseFloat(translate2[2]);
+ }
+ }
+ const newTranslateY = translateY2 - totalHeight / 2;
+ let newTranslateX = x5 + padding2 / 2;
+ if (i2 === 0 || i2 === 1) {
+ newTranslateX = translateX2;
+ }
+ text4.attr("transform", `translate(${newTranslateX}, ${newTranslateY + padding2})`);
+ });
+ if (accumulativeHeight > typeHeight + nameHeight + gap) {
+ const roughLine = rc.line(
+ x5,
+ y5 + typeHeight + nameHeight + gap,
+ x5 + totalWidth,
+ y5 + typeHeight + nameHeight + gap,
+ options3
+ );
+ const dividerLine = shapeSvg.insert(() => roughLine);
+ dividerLine.attr("style", nodeStyles);
+ }
+ updateNodeBounds(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default.rect(node2, point8);
+ };
+ return shapeSvg;
}
- var spreadableSymbol, isFlattenable_default;
- var init_isFlattenable = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js"() {
- "use strict";
- init_Symbol();
- init_isArguments();
- init_isArray();
- spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0;
- __name(isFlattenable, "isFlattenable");
- isFlattenable_default = isFlattenable;
+ async function addText3(parentGroup, inputText, yOffset, style3 = "") {
+ if (inputText === "") {
+ return 0;
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js
- function baseFlatten(array4, depth, predicate, isStrict, result) {
- var index = -1, length2 = array4.length;
- predicate || (predicate = isFlattenable_default);
- result || (result = []);
- while (++index < length2) {
- var value2 = array4[index];
- if (depth > 0 && predicate(value2)) {
- if (depth > 1) {
- baseFlatten(value2, depth - 1, predicate, isStrict, result);
- } else {
- arrayPush_default(result, value2);
+ const textEl = parentGroup.insert("g").attr("class", "label").attr("style", style3);
+ const config5 = getConfig2();
+ const useHtmlLabels = config5.htmlLabels ?? true;
+ const text4 = await createText(
+ textEl,
+ sanitizeText3(decodeEntities(inputText)),
+ {
+ width: calculateTextWidth(inputText, config5) + 50,
+ // Add room for error when splitting text into multiple lines
+ classes: "markdown-node-label",
+ useHtmlLabels,
+ style: style3
+ },
+ config5
+ );
+ let bbox;
+ if (!useHtmlLabels) {
+ const textChild = text4.children[0];
+ for (const child of textChild.children) {
+ child.textContent = child.textContent.replaceAll(">", ">").replaceAll("<", "<");
+ if (style3) {
+ child.setAttribute("style", style3);
}
- } else if (!isStrict) {
- result[result.length] = value2;
}
+ bbox = text4.getBBox();
+ bbox.height += 6;
+ } else {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
}
- return result;
- }
- var baseFlatten_default;
- var init_baseFlatten = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js"() {
- "use strict";
- init_arrayPush();
- init_isFlattenable();
- __name(baseFlatten, "baseFlatten");
- baseFlatten_default = baseFlatten;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js
- function flatten(array4) {
- var length2 = array4 == null ? 0 : array4.length;
- return length2 ? baseFlatten_default(array4, 1) : [];
+ textEl.attr("transform", `translate(${-bbox.width / 2},${-bbox.height / 2 + yOffset})`);
+ return bbox.height;
}
- var flatten_default;
- var init_flatten = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js"() {
+ var init_requirementBox = __esm({
+ "src/rendering-util/rendering-elements/shapes/requirementBox.ts"() {
"use strict";
- init_baseFlatten();
- __name(flatten, "flatten");
- flatten_default = flatten;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_flatRest.js
- function flatRest(func) {
- return setToString_default(overRest_default(func, void 0, flatten_default), func + "");
+ init_util();
+ init_intersect();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ init_utils2();
+ init_diagramAPI();
+ init_createText();
+ init_src32();
+ __name(requirementBox, "requirementBox");
+ __name(addText3, "addText");
+ }
+ });
+
+ // src/rendering-util/rendering-elements/shapes/kanbanItem.ts
+ async function kanbanItem(parent4, kanbanNode, { config: config5 }) {
+ const { labelStyles, nodeStyles } = styles2String(kanbanNode);
+ kanbanNode.labelStyle = labelStyles || "";
+ const labelPaddingX = 10;
+ const orgWidth = kanbanNode.width;
+ kanbanNode.width = (kanbanNode.width ?? 200) - 10;
+ const {
+ shapeSvg,
+ bbox,
+ label: labelElTitle
+ } = await labelHelper(parent4, kanbanNode, getNodeClasses(kanbanNode));
+ const padding2 = kanbanNode.padding || 10;
+ let ticketUrl = "";
+ let link3;
+ if ("ticket" in kanbanNode && kanbanNode.ticket && config5?.kanban?.ticketBaseUrl) {
+ ticketUrl = config5?.kanban?.ticketBaseUrl.replace("#TICKET#", kanbanNode.ticket);
+ link3 = shapeSvg.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", ticketUrl).attr("target", "_blank");
+ }
+ const options3 = {
+ useHtmlLabels: kanbanNode.useHtmlLabels,
+ labelStyle: kanbanNode.labelStyle || "",
+ width: kanbanNode.width,
+ img: kanbanNode.img,
+ padding: kanbanNode.padding || 8,
+ centerLabel: false
+ };
+ let labelEl, bbox2;
+ if (link3) {
+ ({ label: labelEl, bbox: bbox2 } = await insertLabel(
+ link3,
+ "ticket" in kanbanNode && kanbanNode.ticket || "",
+ options3
+ ));
+ } else {
+ ({ label: labelEl, bbox: bbox2 } = await insertLabel(
+ shapeSvg,
+ "ticket" in kanbanNode && kanbanNode.ticket || "",
+ options3
+ ));
+ }
+ const { label: labelElAssigned, bbox: bboxAssigned } = await insertLabel(
+ shapeSvg,
+ "assigned" in kanbanNode && kanbanNode.assigned || "",
+ options3
+ );
+ kanbanNode.width = orgWidth;
+ const labelPaddingY = 10;
+ const totalWidth = kanbanNode?.width || 0;
+ const heightAdj = Math.max(bbox2.height, bboxAssigned.height) / 2;
+ const totalHeight = Math.max(bbox.height + labelPaddingY * 2, kanbanNode?.height || 0) + heightAdj;
+ const x5 = -totalWidth / 2;
+ const y5 = -totalHeight / 2;
+ labelElTitle.attr(
+ "transform",
+ "translate(" + (padding2 - totalWidth / 2) + ", " + (-heightAdj - bbox.height / 2) + ")"
+ );
+ labelEl.attr(
+ "transform",
+ "translate(" + (padding2 - totalWidth / 2) + ", " + (-heightAdj + bbox.height / 2) + ")"
+ );
+ labelElAssigned.attr(
+ "transform",
+ "translate(" + (padding2 + totalWidth / 2 - bboxAssigned.width - 2 * labelPaddingX) + ", " + (-heightAdj + bbox.height / 2) + ")"
+ );
+ let rect3;
+ const { rx, ry } = kanbanNode;
+ const { cssStyles } = kanbanNode;
+ if (kanbanNode.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options4 = userNodeOverrides(kanbanNode, {});
+ const roughNode = rx || ry ? rc.path(createRoundedRectPathD(x5, y5, totalWidth, totalHeight, rx || 0), options4) : rc.rectangle(x5, y5, totalWidth, totalHeight, options4);
+ rect3 = shapeSvg.insert(() => roughNode, ":first-child");
+ rect3.attr("class", "basic label-container").attr("style", cssStyles ? cssStyles : null);
+ } else {
+ rect3 = shapeSvg.insert("rect", ":first-child");
+ rect3.attr("class", "basic label-container __APA__").attr("style", nodeStyles).attr("rx", rx ?? 5).attr("ry", ry ?? 5).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
+ const priority3 = "priority" in kanbanNode && kanbanNode.priority;
+ if (priority3) {
+ const line2 = shapeSvg.append("line");
+ const lineX = x5 + 2;
+ const y1 = y5 + Math.floor((rx ?? 0) / 2);
+ const y22 = y5 + totalHeight - Math.floor((rx ?? 0) / 2);
+ line2.attr("x1", lineX).attr("y1", y1).attr("x2", lineX).attr("y2", y22).attr("stroke-width", "4").attr("stroke", colorFromPriority(priority3));
+ }
+ }
+ updateNodeBounds(kanbanNode, rect3);
+ kanbanNode.height = totalHeight;
+ kanbanNode.intersect = function(point8) {
+ return intersect_default.rect(kanbanNode, point8);
+ };
+ return shapeSvg;
}
- var flatRest_default;
- var init_flatRest = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_flatRest.js"() {
+ var colorFromPriority;
+ var init_kanbanItem = __esm({
+ "src/rendering-util/rendering-elements/shapes/kanbanItem.ts"() {
"use strict";
- init_flatten();
- init_overRest();
- init_setToString();
- __name(flatRest, "flatRest");
- flatRest_default = flatRest;
+ init_util();
+ init_intersect();
+ init_roundedRectPath();
+ init_handDrawnShapeStyles();
+ init_rough_esm();
+ colorFromPriority = /* @__PURE__ */ __name((priority3) => {
+ switch (priority3) {
+ case "Very High":
+ return "red";
+ case "High":
+ return "orange";
+ case "Medium":
+ return null;
+ // no stroke
+ case "Low":
+ return "blue";
+ case "Very Low":
+ return "lightblue";
+ }
+ }, "colorFromPriority");
+ __name(kanbanItem, "kanbanItem");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js
- function baseSlice(array4, start3, end2) {
- var index = -1, length2 = array4.length;
- if (start3 < 0) {
- start3 = -start3 > length2 ? 0 : length2 + start3;
- }
- end2 = end2 > length2 ? length2 : end2;
- if (end2 < 0) {
- end2 += length2;
- }
- length2 = start3 > end2 ? 0 : end2 - start3 >>> 0;
- start3 >>>= 0;
- var result = Array(length2);
- while (++index < length2) {
- result[index] = array4[index + start3];
- }
- return result;
+ // src/rendering-util/rendering-elements/shapes.ts
+ function isValidShape(shape) {
+ return shape in shapes;
}
- var baseSlice_default;
- var init_baseSlice = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js"() {
+ var shapesDefs, generateShapeMap, shapes;
+ var init_shapes = __esm({
+ "src/rendering-util/rendering-elements/shapes.ts"() {
"use strict";
- __name(baseSlice, "baseSlice");
- baseSlice_default = baseSlice;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js
- function hasUnicode(string3) {
- return reHasUnicode.test(string3);
- }
- var rsAstralRange, rsComboMarksRange, reComboHalfMarksRange, rsComboSymbolsRange, rsComboRange, rsVarRange, rsZWJ, reHasUnicode, hasUnicode_default;
- var init_hasUnicode = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js"() {
- "use strict";
- rsAstralRange = "\\ud800-\\udfff";
- rsComboMarksRange = "\\u0300-\\u036f";
- reComboHalfMarksRange = "\\ufe20-\\ufe2f";
- rsComboSymbolsRange = "\\u20d0-\\u20ff";
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
- rsVarRange = "\\ufe0e\\ufe0f";
- rsZWJ = "\\u200d";
- reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
- __name(hasUnicode, "hasUnicode");
- hasUnicode_default = hasUnicode;
- }
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js
- function arrayReduce(array4, iteratee, accumulator, initAccum) {
- var index = -1, length2 = array4 == null ? 0 : array4.length;
- if (initAccum && length2) {
- accumulator = array4[++index];
- }
- while (++index < length2) {
- accumulator = iteratee(accumulator, array4[index], index, array4);
- }
- return accumulator;
- }
- var arrayReduce_default;
- var init_arrayReduce = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js"() {
- "use strict";
- __name(arrayReduce, "arrayReduce");
- arrayReduce_default = arrayReduce;
+ init_anchor();
+ init_bowTieRect();
+ init_card();
+ init_choice();
+ init_circle();
+ init_crossedCircle();
+ init_curlyBraceLeft();
+ init_curlyBraceRight();
+ init_curlyBraces();
+ init_curvedTrapezoid();
+ init_cylinder();
+ init_dividedRect();
+ init_doubleCircle();
+ init_filledCircle();
+ init_flippedTriangle();
+ init_forkJoin();
+ init_halfRoundedRectangle();
+ init_hexagon();
+ init_hourglass();
+ init_icon();
+ init_iconCircle();
+ init_iconRounded();
+ init_iconSquare();
+ init_imageSquare();
+ init_invertedTrapezoid();
+ init_labelRect();
+ init_leanLeft();
+ init_leanRight();
+ init_lightningBolt();
+ init_linedCylinder();
+ init_linedWaveEdgedRect();
+ init_multiRect();
+ init_multiWaveEdgedRectangle();
+ init_note();
+ init_question();
+ init_rectLeftInvArrow();
+ init_rectWithTitle();
+ init_roundedRect();
+ init_shadedProcess();
+ init_slopedRect();
+ init_squareRect();
+ init_stadium();
+ init_state();
+ init_stateEnd();
+ init_stateStart();
+ init_subroutine();
+ init_taggedRect();
+ init_taggedWaveEdgedRectangle();
+ init_text3();
+ init_tiltedCylinder();
+ init_trapezoid();
+ init_trapezoidalPentagon();
+ init_triangle();
+ init_waveEdgedRectangle();
+ init_waveRectangle();
+ init_windowPane();
+ init_erBox();
+ init_classBox();
+ init_requirementBox();
+ init_kanbanItem();
+ shapesDefs = [
+ {
+ semanticName: "Process",
+ name: "Rectangle",
+ shortName: "rect",
+ description: "Standard process shape",
+ aliases: ["proc", "process", "rectangle"],
+ internalAliases: ["squareRect"],
+ handler: squareRect
+ },
+ {
+ semanticName: "Event",
+ name: "Rounded Rectangle",
+ shortName: "rounded",
+ description: "Represents an event",
+ aliases: ["event"],
+ internalAliases: ["roundedRect"],
+ handler: roundedRect
+ },
+ {
+ semanticName: "Terminal Point",
+ name: "Stadium",
+ shortName: "stadium",
+ description: "Terminal point",
+ aliases: ["terminal", "pill"],
+ handler: stadium
+ },
+ {
+ semanticName: "Subprocess",
+ name: "Framed Rectangle",
+ shortName: "fr-rect",
+ description: "Subprocess",
+ aliases: ["subprocess", "subproc", "framed-rectangle", "subroutine"],
+ handler: subroutine
+ },
+ {
+ semanticName: "Database",
+ name: "Cylinder",
+ shortName: "cyl",
+ description: "Database storage",
+ aliases: ["db", "database", "cylinder"],
+ handler: cylinder
+ },
+ {
+ semanticName: "Start",
+ name: "Circle",
+ shortName: "circle",
+ description: "Starting point",
+ aliases: ["circ"],
+ handler: circle
+ },
+ {
+ semanticName: "Decision",
+ name: "Diamond",
+ shortName: "diam",
+ description: "Decision-making step",
+ aliases: ["decision", "diamond", "question"],
+ handler: question
+ },
+ {
+ semanticName: "Prepare Conditional",
+ name: "Hexagon",
+ shortName: "hex",
+ description: "Preparation or condition step",
+ aliases: ["hexagon", "prepare"],
+ handler: hexagon
+ },
+ {
+ semanticName: "Data Input/Output",
+ name: "Lean Right",
+ shortName: "lean-r",
+ description: "Represents input or output",
+ aliases: ["lean-right", "in-out"],
+ internalAliases: ["lean_right"],
+ handler: lean_right
+ },
+ {
+ semanticName: "Data Input/Output",
+ name: "Lean Left",
+ shortName: "lean-l",
+ description: "Represents output or input",
+ aliases: ["lean-left", "out-in"],
+ internalAliases: ["lean_left"],
+ handler: lean_left
+ },
+ {
+ semanticName: "Priority Action",
+ name: "Trapezoid Base Bottom",
+ shortName: "trap-b",
+ description: "Priority action",
+ aliases: ["priority", "trapezoid-bottom", "trapezoid"],
+ handler: trapezoid
+ },
+ {
+ semanticName: "Manual Operation",
+ name: "Trapezoid Base Top",
+ shortName: "trap-t",
+ description: "Represents a manual task",
+ aliases: ["manual", "trapezoid-top", "inv-trapezoid"],
+ internalAliases: ["inv_trapezoid"],
+ handler: inv_trapezoid
+ },
+ {
+ semanticName: "Stop",
+ name: "Double Circle",
+ shortName: "dbl-circ",
+ description: "Represents a stop point",
+ aliases: ["double-circle"],
+ internalAliases: ["doublecircle"],
+ handler: doublecircle
+ },
+ {
+ semanticName: "Text Block",
+ name: "Text Block",
+ shortName: "text",
+ description: "Text block",
+ handler: text3
+ },
+ {
+ semanticName: "Card",
+ name: "Notched Rectangle",
+ shortName: "notch-rect",
+ description: "Represents a card",
+ aliases: ["card", "notched-rectangle"],
+ handler: card
+ },
+ {
+ semanticName: "Lined/Shaded Process",
+ name: "Lined Rectangle",
+ shortName: "lin-rect",
+ description: "Lined process shape",
+ aliases: ["lined-rectangle", "lined-process", "lin-proc", "shaded-process"],
+ handler: shadedProcess
+ },
+ {
+ semanticName: "Start",
+ name: "Small Circle",
+ shortName: "sm-circ",
+ description: "Small starting point",
+ aliases: ["start", "small-circle"],
+ internalAliases: ["stateStart"],
+ handler: stateStart
+ },
+ {
+ semanticName: "Stop",
+ name: "Framed Circle",
+ shortName: "fr-circ",
+ description: "Stop point",
+ aliases: ["stop", "framed-circle"],
+ internalAliases: ["stateEnd"],
+ handler: stateEnd
+ },
+ {
+ semanticName: "Fork/Join",
+ name: "Filled Rectangle",
+ shortName: "fork",
+ description: "Fork or join in process flow",
+ aliases: ["join"],
+ internalAliases: ["forkJoin"],
+ handler: forkJoin
+ },
+ {
+ semanticName: "Collate",
+ name: "Hourglass",
+ shortName: "hourglass",
+ description: "Represents a collate operation",
+ aliases: ["hourglass", "collate"],
+ handler: hourglass
+ },
+ {
+ semanticName: "Comment",
+ name: "Curly Brace",
+ shortName: "brace",
+ description: "Adds a comment",
+ aliases: ["comment", "brace-l"],
+ handler: curlyBraceLeft
+ },
+ {
+ semanticName: "Comment Right",
+ name: "Curly Brace",
+ shortName: "brace-r",
+ description: "Adds a comment",
+ handler: curlyBraceRight
+ },
+ {
+ semanticName: "Comment with braces on both sides",
+ name: "Curly Braces",
+ shortName: "braces",
+ description: "Adds a comment",
+ handler: curlyBraces
+ },
+ {
+ semanticName: "Com Link",
+ name: "Lightning Bolt",
+ shortName: "bolt",
+ description: "Communication link",
+ aliases: ["com-link", "lightning-bolt"],
+ handler: lightningBolt
+ },
+ {
+ semanticName: "Document",
+ name: "Document",
+ shortName: "doc",
+ description: "Represents a document",
+ aliases: ["doc", "document"],
+ handler: waveEdgedRectangle
+ },
+ {
+ semanticName: "Delay",
+ name: "Half-Rounded Rectangle",
+ shortName: "delay",
+ description: "Represents a delay",
+ aliases: ["half-rounded-rectangle"],
+ handler: halfRoundedRectangle
+ },
+ {
+ semanticName: "Direct Access Storage",
+ name: "Horizontal Cylinder",
+ shortName: "h-cyl",
+ description: "Direct access storage",
+ aliases: ["das", "horizontal-cylinder"],
+ handler: tiltedCylinder
+ },
+ {
+ semanticName: "Disk Storage",
+ name: "Lined Cylinder",
+ shortName: "lin-cyl",
+ description: "Disk storage",
+ aliases: ["disk", "lined-cylinder"],
+ handler: linedCylinder
+ },
+ {
+ semanticName: "Display",
+ name: "Curved Trapezoid",
+ shortName: "curv-trap",
+ description: "Represents a display",
+ aliases: ["curved-trapezoid", "display"],
+ handler: curvedTrapezoid
+ },
+ {
+ semanticName: "Divided Process",
+ name: "Divided Rectangle",
+ shortName: "div-rect",
+ description: "Divided process shape",
+ aliases: ["div-proc", "divided-rectangle", "divided-process"],
+ handler: dividedRectangle
+ },
+ {
+ semanticName: "Extract",
+ name: "Triangle",
+ shortName: "tri",
+ description: "Extraction process",
+ aliases: ["extract", "triangle"],
+ handler: triangle
+ },
+ {
+ semanticName: "Internal Storage",
+ name: "Window Pane",
+ shortName: "win-pane",
+ description: "Internal storage",
+ aliases: ["internal-storage", "window-pane"],
+ handler: windowPane
+ },
+ {
+ semanticName: "Junction",
+ name: "Filled Circle",
+ shortName: "f-circ",
+ description: "Junction point",
+ aliases: ["junction", "filled-circle"],
+ handler: filledCircle
+ },
+ {
+ semanticName: "Loop Limit",
+ name: "Trapezoidal Pentagon",
+ shortName: "notch-pent",
+ description: "Loop limit step",
+ aliases: ["loop-limit", "notched-pentagon"],
+ handler: trapezoidalPentagon
+ },
+ {
+ semanticName: "Manual File",
+ name: "Flipped Triangle",
+ shortName: "flip-tri",
+ description: "Manual file operation",
+ aliases: ["manual-file", "flipped-triangle"],
+ handler: flippedTriangle
+ },
+ {
+ semanticName: "Manual Input",
+ name: "Sloped Rectangle",
+ shortName: "sl-rect",
+ description: "Manual input step",
+ aliases: ["manual-input", "sloped-rectangle"],
+ handler: slopedRect
+ },
+ {
+ semanticName: "Multi-Document",
+ name: "Stacked Document",
+ shortName: "docs",
+ description: "Multiple documents",
+ aliases: ["documents", "st-doc", "stacked-document"],
+ handler: multiWaveEdgedRectangle
+ },
+ {
+ semanticName: "Multi-Process",
+ name: "Stacked Rectangle",
+ shortName: "st-rect",
+ description: "Multiple processes",
+ aliases: ["procs", "processes", "stacked-rectangle"],
+ handler: multiRect
+ },
+ {
+ semanticName: "Stored Data",
+ name: "Bow Tie Rectangle",
+ shortName: "bow-rect",
+ description: "Stored data",
+ aliases: ["stored-data", "bow-tie-rectangle"],
+ handler: bowTieRect
+ },
+ {
+ semanticName: "Summary",
+ name: "Crossed Circle",
+ shortName: "cross-circ",
+ description: "Summary",
+ aliases: ["summary", "crossed-circle"],
+ handler: crossedCircle
+ },
+ {
+ semanticName: "Tagged Document",
+ name: "Tagged Document",
+ shortName: "tag-doc",
+ description: "Tagged document",
+ aliases: ["tag-doc", "tagged-document"],
+ handler: taggedWaveEdgedRectangle
+ },
+ {
+ semanticName: "Tagged Process",
+ name: "Tagged Rectangle",
+ shortName: "tag-rect",
+ description: "Tagged process",
+ aliases: ["tagged-rectangle", "tag-proc", "tagged-process"],
+ handler: taggedRect
+ },
+ {
+ semanticName: "Paper Tape",
+ name: "Flag",
+ shortName: "flag",
+ description: "Paper tape",
+ aliases: ["paper-tape"],
+ handler: waveRectangle
+ },
+ {
+ semanticName: "Odd",
+ name: "Odd",
+ shortName: "odd",
+ description: "Odd shape",
+ internalAliases: ["rect_left_inv_arrow"],
+ handler: rect_left_inv_arrow
+ },
+ {
+ semanticName: "Lined Document",
+ name: "Lined Document",
+ shortName: "lin-doc",
+ description: "Lined document",
+ aliases: ["lined-document"],
+ handler: linedWaveEdgedRect
+ }
+ ];
+ generateShapeMap = /* @__PURE__ */ __name(() => {
+ const undocumentedShapes = {
+ // States
+ state,
+ choice,
+ note,
+ // Rectangles
+ rectWithTitle,
+ labelRect,
+ // Icons
+ iconSquare,
+ iconCircle,
+ icon,
+ iconRounded,
+ imageSquare,
+ anchor,
+ // Kanban diagram
+ kanbanItem,
+ // class diagram
+ classBox,
+ // er diagram
+ erBox,
+ // Requirement diagram
+ requirementBox
+ };
+ const entries2 = [
+ ...Object.entries(undocumentedShapes),
+ ...shapesDefs.flatMap((shape) => {
+ const aliases = [
+ shape.shortName,
+ ..."aliases" in shape ? shape.aliases : [],
+ ..."internalAliases" in shape ? shape.internalAliases : []
+ ];
+ return aliases.map((alias) => [alias, shape.handler]);
+ })
+ ];
+ return Object.fromEntries(entries2);
+ }, "generateShapeMap");
+ shapes = generateShapeMap();
+ __name(isValidShape, "isValidShape");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js
- function baseAssign(object3, source) {
- return object3 && copyObject_default(source, keys_default(source), object3);
- }
- var baseAssign_default;
- var init_baseAssign = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js"() {
+ // src/diagrams/flowchart/flowDb.ts
+ var MERMAID_DOM_ID_PREFIX, FlowDB;
+ var init_flowDb = __esm({
+ "src/diagrams/flowchart/flowDb.ts"() {
"use strict";
- init_copyObject();
- init_keys();
- __name(baseAssign, "baseAssign");
- baseAssign_default = baseAssign;
- }
- });
+ init_src32();
+ init_js_yaml();
+ init_diagramAPI();
+ init_logger();
+ init_shapes();
+ init_utils2();
+ init_common();
+ init_commonDb();
+ MERMAID_DOM_ID_PREFIX = "flowchart-";
+ FlowDB = class {
+ // cspell:ignore funs
+ constructor() {
+ this.vertexCounter = 0;
+ this.config = getConfig2();
+ this.vertices = /* @__PURE__ */ new Map();
+ this.edges = [];
+ this.classes = /* @__PURE__ */ new Map();
+ this.subGraphs = [];
+ this.subGraphLookup = /* @__PURE__ */ new Map();
+ this.tooltips = /* @__PURE__ */ new Map();
+ this.subCount = 0;
+ this.firstGraphFlag = true;
+ // As in graph
+ this.secCount = -1;
+ this.posCrossRef = [];
+ // Functions to be run after graph rendering
+ this.funs = [];
+ this.setAccTitle = setAccTitle;
+ this.setAccDescription = setAccDescription;
+ this.setDiagramTitle = setDiagramTitle;
+ this.getAccTitle = getAccTitle;
+ this.getAccDescription = getAccDescription;
+ this.getDiagramTitle = getDiagramTitle;
+ this.funs.push(this.setupToolTips.bind(this));
+ this.addVertex = this.addVertex.bind(this);
+ this.firstGraph = this.firstGraph.bind(this);
+ this.setDirection = this.setDirection.bind(this);
+ this.addSubGraph = this.addSubGraph.bind(this);
+ this.addLink = this.addLink.bind(this);
+ this.setLink = this.setLink.bind(this);
+ this.updateLink = this.updateLink.bind(this);
+ this.addClass = this.addClass.bind(this);
+ this.setClass = this.setClass.bind(this);
+ this.destructLink = this.destructLink.bind(this);
+ this.setClickEvent = this.setClickEvent.bind(this);
+ this.setTooltip = this.setTooltip.bind(this);
+ this.updateLinkInterpolate = this.updateLinkInterpolate.bind(this);
+ this.setClickFun = this.setClickFun.bind(this);
+ this.bindFunctions = this.bindFunctions.bind(this);
+ this.lex = {
+ firstGraph: this.firstGraph.bind(this)
+ };
+ this.clear();
+ this.setGen("gen-2");
+ }
+ static {
+ __name(this, "FlowDB");
+ }
+ sanitizeText(txt) {
+ return common_default.sanitizeText(txt, this.config);
+ }
+ /**
+ * Function to lookup domId from id in the graph definition.
+ *
+ * @param id - id of the node
+ */
+ lookUpDomId(id29) {
+ for (const vertex of this.vertices.values()) {
+ if (vertex.id === id29) {
+ return vertex.domId;
+ }
+ }
+ return id29;
+ }
+ /**
+ * Function called by parser when a node definition has been found
+ */
+ addVertex(id29, textObj, type3, style3, classes3, dir2, props = {}, metadata) {
+ if (!id29 || id29.trim().length === 0) {
+ return;
+ }
+ let doc;
+ if (metadata !== void 0) {
+ let yamlData;
+ if (!metadata.includes("\n")) {
+ yamlData = "{\n" + metadata + "\n}";
+ } else {
+ yamlData = metadata + "\n";
+ }
+ doc = load(yamlData, { schema: JSON_SCHEMA });
+ }
+ const edge = this.edges.find((e3) => e3.id === id29);
+ if (edge) {
+ const edgeDoc = doc;
+ if (edgeDoc?.animate !== void 0) {
+ edge.animate = edgeDoc.animate;
+ }
+ if (edgeDoc?.animation !== void 0) {
+ edge.animation = edgeDoc.animation;
+ }
+ return;
+ }
+ let txt;
+ let vertex = this.vertices.get(id29);
+ if (vertex === void 0) {
+ vertex = {
+ id: id29,
+ labelType: "text",
+ domId: MERMAID_DOM_ID_PREFIX + id29 + "-" + this.vertexCounter,
+ styles: [],
+ classes: []
+ };
+ this.vertices.set(id29, vertex);
+ }
+ this.vertexCounter++;
+ if (textObj !== void 0) {
+ this.config = getConfig2();
+ txt = this.sanitizeText(textObj.text.trim());
+ vertex.labelType = textObj.type;
+ if (txt.startsWith('"') && txt.endsWith('"')) {
+ txt = txt.substring(1, txt.length - 1);
+ }
+ vertex.text = txt;
+ } else {
+ if (vertex.text === void 0) {
+ vertex.text = id29;
+ }
+ }
+ if (type3 !== void 0) {
+ vertex.type = type3;
+ }
+ if (style3 !== void 0 && style3 !== null) {
+ style3.forEach((s2) => {
+ vertex.styles.push(s2);
+ });
+ }
+ if (classes3 !== void 0 && classes3 !== null) {
+ classes3.forEach((s2) => {
+ vertex.classes.push(s2);
+ });
+ }
+ if (dir2 !== void 0) {
+ vertex.dir = dir2;
+ }
+ if (vertex.props === void 0) {
+ vertex.props = props;
+ } else if (props !== void 0) {
+ Object.assign(vertex.props, props);
+ }
+ if (doc !== void 0) {
+ if (doc.shape) {
+ if (doc.shape !== doc.shape.toLowerCase() || doc.shape.includes("_")) {
+ throw new Error(`No such shape: ${doc.shape}. Shape names should be lowercase.`);
+ } else if (!isValidShape(doc.shape)) {
+ throw new Error(`No such shape: ${doc.shape}.`);
+ }
+ vertex.type = doc?.shape;
+ }
+ if (doc?.label) {
+ vertex.text = doc?.label;
+ }
+ if (doc?.icon) {
+ vertex.icon = doc?.icon;
+ if (!doc.label?.trim() && vertex.text === id29) {
+ vertex.text = "";
+ }
+ }
+ if (doc?.form) {
+ vertex.form = doc?.form;
+ }
+ if (doc?.pos) {
+ vertex.pos = doc?.pos;
+ }
+ if (doc?.img) {
+ vertex.img = doc?.img;
+ if (!doc.label?.trim() && vertex.text === id29) {
+ vertex.text = "";
+ }
+ }
+ if (doc?.constraint) {
+ vertex.constraint = doc.constraint;
+ }
+ if (doc.w) {
+ vertex.assetWidth = Number(doc.w);
+ }
+ if (doc.h) {
+ vertex.assetHeight = Number(doc.h);
+ }
+ }
+ }
+ /**
+ * Function called by parser when a link/edge definition has been found
+ *
+ */
+ addSingleLink(_start, _end, type3, id29) {
+ const start3 = _start;
+ const end2 = _end;
+ const edge = {
+ start: start3,
+ end: end2,
+ type: void 0,
+ text: "",
+ labelType: "text",
+ classes: [],
+ isUserDefinedId: false,
+ interpolate: this.edges.defaultInterpolate
+ };
+ log.info("abc78 Got edge...", edge);
+ const linkTextObj = type3.text;
+ if (linkTextObj !== void 0) {
+ edge.text = this.sanitizeText(linkTextObj.text.trim());
+ if (edge.text.startsWith('"') && edge.text.endsWith('"')) {
+ edge.text = edge.text.substring(1, edge.text.length - 1);
+ }
+ edge.labelType = linkTextObj.type;
+ }
+ if (type3 !== void 0) {
+ edge.type = type3.type;
+ edge.stroke = type3.stroke;
+ edge.length = type3.length > 10 ? 10 : type3.length;
+ }
+ if (id29 && !this.edges.some((e3) => e3.id === id29)) {
+ edge.id = id29;
+ edge.isUserDefinedId = true;
+ } else {
+ const existingLinks = this.edges.filter((e3) => e3.start === edge.start && e3.end === edge.end);
+ if (existingLinks.length === 0) {
+ edge.id = getEdgeId(edge.start, edge.end, { counter: 0, prefix: "L" });
+ } else {
+ edge.id = getEdgeId(edge.start, edge.end, {
+ counter: existingLinks.length + 1,
+ prefix: "L"
+ });
+ }
+ }
+ if (this.edges.length < (this.config.maxEdges ?? 500)) {
+ log.info("Pushing edge...");
+ this.edges.push(edge);
+ } else {
+ throw new Error(
+ `Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js
- function baseAssignIn(object3, source) {
- return object3 && copyObject_default(source, keysIn_default(source), object3);
- }
- var baseAssignIn_default;
- var init_baseAssignIn = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js"() {
- "use strict";
- init_copyObject();
- init_keysIn();
- __name(baseAssignIn, "baseAssignIn");
- baseAssignIn_default = baseAssignIn;
+Initialize mermaid with maxEdges set to a higher number to allow more edges.
+You cannot set this config via configuration inside the diagram as it is a secure config.
+You have to call mermaid.initialize.`
+ );
+ }
+ }
+ isLinkData(value2) {
+ return value2 !== null && typeof value2 === "object" && "id" in value2 && typeof value2.id === "string";
+ }
+ addLink(_start, _end, linkData) {
+ const id29 = this.isLinkData(linkData) ? linkData.id.replace("@", "") : void 0;
+ log.info("addLink", _start, _end, id29);
+ for (const start3 of _start) {
+ for (const end2 of _end) {
+ const isLastStart = start3 === _start[_start.length - 1];
+ const isFirstEnd = end2 === _end[0];
+ if (isLastStart && isFirstEnd) {
+ this.addSingleLink(start3, end2, linkData, id29);
+ } else {
+ this.addSingleLink(start3, end2, linkData, void 0);
+ }
+ }
+ }
+ }
+ /**
+ * Updates a link's line interpolation algorithm
+ */
+ updateLinkInterpolate(positions2, interpolate) {
+ positions2.forEach((pos) => {
+ if (pos === "default") {
+ this.edges.defaultInterpolate = interpolate;
+ } else {
+ this.edges[pos].interpolate = interpolate;
+ }
+ });
+ }
+ /**
+ * Updates a link with a style
+ *
+ */
+ updateLink(positions2, style3) {
+ positions2.forEach((pos) => {
+ if (typeof pos === "number" && pos >= this.edges.length) {
+ throw new Error(
+ `The index ${pos} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)`
+ );
+ }
+ if (pos === "default") {
+ this.edges.defaultStyle = style3;
+ } else {
+ this.edges[pos].style = style3;
+ if ((this.edges[pos]?.style?.length ?? 0) > 0 && !this.edges[pos]?.style?.some((s2) => s2?.startsWith("fill"))) {
+ this.edges[pos]?.style?.push("fill:none");
+ }
+ }
+ });
+ }
+ addClass(ids, _style) {
+ const style3 = _style.join().replace(/\\,/g, "\xA7\xA7\xA7").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
+ ids.split(",").forEach((id29) => {
+ let classNode = this.classes.get(id29);
+ if (classNode === void 0) {
+ classNode = { id: id29, styles: [], textStyles: [] };
+ this.classes.set(id29, classNode);
+ }
+ if (style3 !== void 0 && style3 !== null) {
+ style3.forEach((s2) => {
+ if (/color/.exec(s2)) {
+ const newStyle = s2.replace("fill", "bgFill");
+ classNode.textStyles.push(newStyle);
+ }
+ classNode.styles.push(s2);
+ });
+ }
+ });
+ }
+ /**
+ * Called by parser when a graph definition is found, stores the direction of the chart.
+ *
+ */
+ setDirection(dir2) {
+ this.direction = dir2;
+ if (/.*/.exec(this.direction)) {
+ this.direction = "LR";
+ }
+ if (/.*v/.exec(this.direction)) {
+ this.direction = "TB";
+ }
+ if (this.direction === "TD") {
+ this.direction = "TB";
+ }
+ }
+ /**
+ * Called by parser when a special node is found, e.g. a clickable element.
+ *
+ * @param ids - Comma separated list of ids
+ * @param className - Class to add
+ */
+ setClass(ids, className) {
+ for (const id29 of ids.split(",")) {
+ const vertex = this.vertices.get(id29);
+ if (vertex) {
+ vertex.classes.push(className);
+ }
+ const edge = this.edges.find((e3) => e3.id === id29);
+ if (edge) {
+ edge.classes.push(className);
+ }
+ const subGraph = this.subGraphLookup.get(id29);
+ if (subGraph) {
+ subGraph.classes.push(className);
+ }
+ }
+ }
+ setTooltip(ids, tooltip) {
+ if (tooltip === void 0) {
+ return;
+ }
+ tooltip = this.sanitizeText(tooltip);
+ for (const id29 of ids.split(",")) {
+ this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(id29) : id29, tooltip);
+ }
+ }
+ setClickFun(id29, functionName, functionArgs) {
+ const domId = this.lookUpDomId(id29);
+ if (getConfig2().securityLevel !== "loose") {
+ return;
+ }
+ if (functionName === void 0) {
+ return;
+ }
+ let argList = [];
+ if (typeof functionArgs === "string") {
+ argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
+ for (let i2 = 0; i2 < argList.length; i2++) {
+ let item = argList[i2].trim();
+ if (item.startsWith('"') && item.endsWith('"')) {
+ item = item.substr(1, item.length - 2);
+ }
+ argList[i2] = item;
+ }
+ }
+ if (argList.length === 0) {
+ argList.push(id29);
+ }
+ const vertex = this.vertices.get(id29);
+ if (vertex) {
+ vertex.haveCallback = true;
+ this.funs.push(() => {
+ const elem = document.querySelector(`[id="${domId}"]`);
+ if (elem !== null) {
+ elem.addEventListener(
+ "click",
+ () => {
+ utils_default2.runFunc(functionName, ...argList);
+ },
+ false
+ );
+ }
+ });
+ }
+ }
+ /**
+ * Called by parser when a link is found. Adds the URL to the vertex data.
+ *
+ * @param ids - Comma separated list of ids
+ * @param linkStr - URL to create a link for
+ * @param target - Target attribute for the link
+ */
+ setLink(ids, linkStr, target) {
+ ids.split(",").forEach((id29) => {
+ const vertex = this.vertices.get(id29);
+ if (vertex !== void 0) {
+ vertex.link = utils_default2.formatUrl(linkStr, this.config);
+ vertex.linkTarget = target;
+ }
+ });
+ this.setClass(ids, "clickable");
+ }
+ getTooltip(id29) {
+ return this.tooltips.get(id29);
+ }
+ /**
+ * Called by parser when a click definition is found. Registers an event handler.
+ *
+ * @param ids - Comma separated list of ids
+ * @param functionName - Function to be called on click
+ * @param functionArgs - Arguments to be passed to the function
+ */
+ setClickEvent(ids, functionName, functionArgs) {
+ ids.split(",").forEach((id29) => {
+ this.setClickFun(id29, functionName, functionArgs);
+ });
+ this.setClass(ids, "clickable");
+ }
+ bindFunctions(element3) {
+ this.funs.forEach((fun) => {
+ fun(element3);
+ });
+ }
+ getDirection() {
+ return this.direction?.trim();
+ }
+ /**
+ * Retrieval function for fetching the found nodes after parsing has completed.
+ *
+ */
+ getVertices() {
+ return this.vertices;
+ }
+ /**
+ * Retrieval function for fetching the found links after parsing has completed.
+ *
+ */
+ getEdges() {
+ return this.edges;
+ }
+ /**
+ * Retrieval function for fetching the found class definitions after parsing has completed.
+ *
+ */
+ getClasses() {
+ return this.classes;
+ }
+ setupToolTips(element3) {
+ let tooltipElem = select_default2(".mermaidTooltip");
+ if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
+ tooltipElem = select_default2("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0);
+ }
+ const svg2 = select_default2(element3).select("svg");
+ const nodes6 = svg2.selectAll("g.node");
+ nodes6.on("mouseover", (e3) => {
+ const el = select_default2(e3.currentTarget);
+ const title2 = el.attr("title");
+ if (title2 === null) {
+ return;
+ }
+ const rect3 = e3.currentTarget?.getBoundingClientRect();
+ tooltipElem.transition().duration(200).style("opacity", ".9");
+ tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect3.left + (rect3.right - rect3.left) / 2 + "px").style("top", window.scrollY + rect3.bottom + "px");
+ tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, " "));
+ el.classed("hover", true);
+ }).on("mouseout", (e3) => {
+ tooltipElem.transition().duration(500).style("opacity", 0);
+ const el = select_default2(e3.currentTarget);
+ el.classed("hover", false);
+ });
+ }
+ /**
+ * Clears the internal graph db so that a new graph can be parsed.
+ *
+ */
+ clear(ver = "gen-2") {
+ this.vertices = /* @__PURE__ */ new Map();
+ this.classes = /* @__PURE__ */ new Map();
+ this.edges = [];
+ this.funs = [this.setupToolTips.bind(this)];
+ this.subGraphs = [];
+ this.subGraphLookup = /* @__PURE__ */ new Map();
+ this.subCount = 0;
+ this.tooltips = /* @__PURE__ */ new Map();
+ this.firstGraphFlag = true;
+ this.version = ver;
+ this.config = getConfig2();
+ clear();
+ }
+ setGen(ver) {
+ this.version = ver || "gen-2";
+ }
+ defaultStyle() {
+ return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
+ }
+ addSubGraph(_id, list2, _title) {
+ let id29 = _id.text.trim();
+ let title2 = _title.text;
+ if (_id === _title && /\s/.exec(_title.text)) {
+ id29 = void 0;
+ }
+ const uniq2 = /* @__PURE__ */ __name((a2) => {
+ const prims = { boolean: {}, number: {}, string: {} };
+ const objs = [];
+ let dir3;
+ const nodeList2 = a2.filter(function(item) {
+ const type3 = typeof item;
+ if (item.stmt && item.stmt === "dir") {
+ dir3 = item.value;
+ return false;
+ }
+ if (item.trim() === "") {
+ return false;
+ }
+ if (type3 in prims) {
+ return prims[type3].hasOwnProperty(item) ? false : prims[type3][item] = true;
+ } else {
+ return objs.includes(item) ? false : objs.push(item);
+ }
+ });
+ return { nodeList: nodeList2, dir: dir3 };
+ }, "uniq");
+ const { nodeList, dir: dir2 } = uniq2(list2.flat());
+ if (this.version === "gen-1") {
+ for (let i2 = 0; i2 < nodeList.length; i2++) {
+ nodeList[i2] = this.lookUpDomId(nodeList[i2]);
+ }
+ }
+ id29 = id29 ?? "subGraph" + this.subCount;
+ title2 = title2 || "";
+ title2 = this.sanitizeText(title2);
+ this.subCount = this.subCount + 1;
+ const subGraph = {
+ id: id29,
+ nodes: nodeList,
+ title: title2.trim(),
+ classes: [],
+ dir: dir2,
+ labelType: _title.type
+ };
+ log.info("Adding", subGraph.id, subGraph.nodes, subGraph.dir);
+ subGraph.nodes = this.makeUniq(subGraph, this.subGraphs).nodes;
+ this.subGraphs.push(subGraph);
+ this.subGraphLookup.set(id29, subGraph);
+ return id29;
+ }
+ getPosForId(id29) {
+ for (const [i2, subGraph] of this.subGraphs.entries()) {
+ if (subGraph.id === id29) {
+ return i2;
+ }
+ }
+ return -1;
+ }
+ indexNodes2(id29, pos) {
+ const nodes6 = this.subGraphs[pos].nodes;
+ this.secCount = this.secCount + 1;
+ if (this.secCount > 2e3) {
+ return {
+ result: false,
+ count: 0
+ };
+ }
+ this.posCrossRef[this.secCount] = pos;
+ if (this.subGraphs[pos].id === id29) {
+ return {
+ result: true,
+ count: 0
+ };
+ }
+ let count = 0;
+ let posCount = 1;
+ while (count < nodes6.length) {
+ const childPos = this.getPosForId(nodes6[count]);
+ if (childPos >= 0) {
+ const res = this.indexNodes2(id29, childPos);
+ if (res.result) {
+ return {
+ result: true,
+ count: posCount + res.count
+ };
+ } else {
+ posCount = posCount + res.count;
+ }
+ }
+ count = count + 1;
+ }
+ return {
+ result: false,
+ count: posCount
+ };
+ }
+ getDepthFirstPos(pos) {
+ return this.posCrossRef[pos];
+ }
+ indexNodes() {
+ this.secCount = -1;
+ if (this.subGraphs.length > 0) {
+ this.indexNodes2("none", this.subGraphs.length - 1);
+ }
+ }
+ getSubGraphs() {
+ return this.subGraphs;
+ }
+ firstGraph() {
+ if (this.firstGraphFlag) {
+ this.firstGraphFlag = false;
+ return true;
+ }
+ return false;
+ }
+ destructStartLink(_str) {
+ let str2 = _str.trim();
+ let type3 = "arrow_open";
+ switch (str2[0]) {
+ case "<":
+ type3 = "arrow_point";
+ str2 = str2.slice(1);
+ break;
+ case "x":
+ type3 = "arrow_cross";
+ str2 = str2.slice(1);
+ break;
+ case "o":
+ type3 = "arrow_circle";
+ str2 = str2.slice(1);
+ break;
+ }
+ let stroke = "normal";
+ if (str2.includes("=")) {
+ stroke = "thick";
+ }
+ if (str2.includes(".")) {
+ stroke = "dotted";
+ }
+ return { type: type3, stroke };
+ }
+ countChar(char2, str2) {
+ const length2 = str2.length;
+ let count = 0;
+ for (let i2 = 0; i2 < length2; ++i2) {
+ if (str2[i2] === char2) {
+ ++count;
+ }
+ }
+ return count;
+ }
+ destructEndLink(_str) {
+ const str2 = _str.trim();
+ let line2 = str2.slice(0, -1);
+ let type3 = "arrow_open";
+ switch (str2.slice(-1)) {
+ case "x":
+ type3 = "arrow_cross";
+ if (str2.startsWith("x")) {
+ type3 = "double_" + type3;
+ line2 = line2.slice(1);
+ }
+ break;
+ case ">":
+ type3 = "arrow_point";
+ if (str2.startsWith("<")) {
+ type3 = "double_" + type3;
+ line2 = line2.slice(1);
+ }
+ break;
+ case "o":
+ type3 = "arrow_circle";
+ if (str2.startsWith("o")) {
+ type3 = "double_" + type3;
+ line2 = line2.slice(1);
+ }
+ break;
+ }
+ let stroke = "normal";
+ let length2 = line2.length - 1;
+ if (line2.startsWith("=")) {
+ stroke = "thick";
+ }
+ if (line2.startsWith("~")) {
+ stroke = "invisible";
+ }
+ const dots = this.countChar(".", line2);
+ if (dots) {
+ stroke = "dotted";
+ length2 = dots;
+ }
+ return { type: type3, stroke, length: length2 };
+ }
+ destructLink(_str, _startStr) {
+ const info2 = this.destructEndLink(_str);
+ let startInfo;
+ if (_startStr) {
+ startInfo = this.destructStartLink(_startStr);
+ if (startInfo.stroke !== info2.stroke) {
+ return { type: "INVALID", stroke: "INVALID" };
+ }
+ if (startInfo.type === "arrow_open") {
+ startInfo.type = info2.type;
+ } else {
+ if (startInfo.type !== info2.type) {
+ return { type: "INVALID", stroke: "INVALID" };
+ }
+ startInfo.type = "double_" + startInfo.type;
+ }
+ if (startInfo.type === "double_arrow") {
+ startInfo.type = "double_arrow_point";
+ }
+ startInfo.length = info2.length;
+ return startInfo;
+ }
+ return info2;
+ }
+ // Todo optimizer this by caching existing nodes
+ exists(allSgs, _id) {
+ for (const sg of allSgs) {
+ if (sg.nodes.includes(_id)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ /**
+ * Deletes an id from all subgraphs
+ *
+ */
+ makeUniq(sg, allSubgraphs) {
+ const res = [];
+ sg.nodes.forEach((_id, pos) => {
+ if (!this.exists(allSubgraphs, _id)) {
+ res.push(sg.nodes[pos]);
+ }
+ });
+ return { nodes: res };
+ }
+ getTypeFromVertex(vertex) {
+ if (vertex.img) {
+ return "imageSquare";
+ }
+ if (vertex.icon) {
+ if (vertex.form === "circle") {
+ return "iconCircle";
+ }
+ if (vertex.form === "square") {
+ return "iconSquare";
+ }
+ if (vertex.form === "rounded") {
+ return "iconRounded";
+ }
+ return "icon";
+ }
+ switch (vertex.type) {
+ case "square":
+ case void 0:
+ return "squareRect";
+ case "round":
+ return "roundedRect";
+ case "ellipse":
+ return "ellipse";
+ default:
+ return vertex.type;
+ }
+ }
+ findNode(nodes6, id29) {
+ return nodes6.find((node2) => node2.id === id29);
+ }
+ destructEdgeType(type3) {
+ let arrowTypeStart = "none";
+ let arrowTypeEnd = "arrow_point";
+ switch (type3) {
+ case "arrow_point":
+ case "arrow_circle":
+ case "arrow_cross":
+ arrowTypeEnd = type3;
+ break;
+ case "double_arrow_point":
+ case "double_arrow_circle":
+ case "double_arrow_cross":
+ arrowTypeStart = type3.replace("double_", "");
+ arrowTypeEnd = arrowTypeStart;
+ break;
+ }
+ return { arrowTypeStart, arrowTypeEnd };
+ }
+ addNodeFromVertex(vertex, nodes6, parentDB, subGraphDB, config5, look) {
+ const parentId = parentDB.get(vertex.id);
+ const isGroup2 = subGraphDB.get(vertex.id) ?? false;
+ const node2 = this.findNode(nodes6, vertex.id);
+ if (node2) {
+ node2.cssStyles = vertex.styles;
+ node2.cssCompiledStyles = this.getCompiledStyles(vertex.classes);
+ node2.cssClasses = vertex.classes.join(" ");
+ } else {
+ const baseNode = {
+ id: vertex.id,
+ label: vertex.text,
+ labelStyle: "",
+ parentId,
+ padding: config5.flowchart?.padding || 8,
+ cssStyles: vertex.styles,
+ cssCompiledStyles: this.getCompiledStyles(["default", "node", ...vertex.classes]),
+ cssClasses: "default " + vertex.classes.join(" "),
+ dir: vertex.dir,
+ domId: vertex.domId,
+ look,
+ link: vertex.link,
+ linkTarget: vertex.linkTarget,
+ tooltip: this.getTooltip(vertex.id),
+ icon: vertex.icon,
+ pos: vertex.pos,
+ img: vertex.img,
+ assetWidth: vertex.assetWidth,
+ assetHeight: vertex.assetHeight,
+ constraint: vertex.constraint
+ };
+ if (isGroup2) {
+ nodes6.push({
+ ...baseNode,
+ isGroup: true,
+ shape: "rect"
+ });
+ } else {
+ nodes6.push({
+ ...baseNode,
+ isGroup: false,
+ shape: this.getTypeFromVertex(vertex)
+ });
+ }
+ }
+ }
+ getCompiledStyles(classDefs) {
+ let compiledStyles = [];
+ for (const customClass of classDefs) {
+ const cssClass = this.classes.get(customClass);
+ if (cssClass?.styles) {
+ compiledStyles = [...compiledStyles, ...cssClass.styles ?? []].map((s2) => s2.trim());
+ }
+ if (cssClass?.textStyles) {
+ compiledStyles = [...compiledStyles, ...cssClass.textStyles ?? []].map((s2) => s2.trim());
+ }
+ }
+ return compiledStyles;
+ }
+ getData() {
+ const config5 = getConfig2();
+ const nodes6 = [];
+ const edges3 = [];
+ const subGraphs = this.getSubGraphs();
+ const parentDB = /* @__PURE__ */ new Map();
+ const subGraphDB = /* @__PURE__ */ new Map();
+ for (let i2 = subGraphs.length - 1; i2 >= 0; i2--) {
+ const subGraph = subGraphs[i2];
+ if (subGraph.nodes.length > 0) {
+ subGraphDB.set(subGraph.id, true);
+ }
+ for (const id29 of subGraph.nodes) {
+ parentDB.set(id29, subGraph.id);
+ }
+ }
+ for (let i2 = subGraphs.length - 1; i2 >= 0; i2--) {
+ const subGraph = subGraphs[i2];
+ nodes6.push({
+ id: subGraph.id,
+ label: subGraph.title,
+ labelStyle: "",
+ parentId: parentDB.get(subGraph.id),
+ padding: 8,
+ cssCompiledStyles: this.getCompiledStyles(subGraph.classes),
+ cssClasses: subGraph.classes.join(" "),
+ shape: "rect",
+ dir: subGraph.dir,
+ isGroup: true,
+ look: config5.look
+ });
+ }
+ const n2 = this.getVertices();
+ n2.forEach((vertex) => {
+ this.addNodeFromVertex(vertex, nodes6, parentDB, subGraphDB, config5, config5.look || "classic");
+ });
+ const e3 = this.getEdges();
+ e3.forEach((rawEdge, index) => {
+ const { arrowTypeStart, arrowTypeEnd } = this.destructEdgeType(rawEdge.type);
+ const styles4 = [...e3.defaultStyle ?? []];
+ if (rawEdge.style) {
+ styles4.push(...rawEdge.style);
+ }
+ const edge = {
+ id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: "L" }, rawEdge.id),
+ isUserDefinedId: rawEdge.isUserDefinedId,
+ start: rawEdge.start,
+ end: rawEdge.end,
+ type: rawEdge.type ?? "normal",
+ label: rawEdge.text,
+ labelpos: "c",
+ thickness: rawEdge.stroke,
+ minlen: rawEdge.length,
+ classes: rawEdge?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
+ arrowTypeStart: rawEdge?.stroke === "invisible" || rawEdge?.type === "arrow_open" ? "none" : arrowTypeStart,
+ arrowTypeEnd: rawEdge?.stroke === "invisible" || rawEdge?.type === "arrow_open" ? "none" : arrowTypeEnd,
+ arrowheadStyle: "fill: #333",
+ cssCompiledStyles: this.getCompiledStyles(rawEdge.classes),
+ labelStyle: styles4,
+ style: styles4,
+ pattern: rawEdge.stroke,
+ look: config5.look,
+ animate: rawEdge.animate,
+ animation: rawEdge.animation,
+ curve: rawEdge.interpolate || this.edges.defaultInterpolate || config5.flowchart?.curve
+ };
+ edges3.push(edge);
+ });
+ return { nodes: nodes6, edges: edges3, other: {}, config: config5 };
+ }
+ defaultConfig() {
+ return defaultConfig2.flowchart;
+ }
+ };
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js
- function arrayFilter(array4, predicate) {
- var index = -1, length2 = array4 == null ? 0 : array4.length, resIndex = 0, result = [];
- while (++index < length2) {
- var value2 = array4[index];
- if (predicate(value2, index, array4)) {
- result[resIndex++] = value2;
- }
- }
- return result;
- }
- var arrayFilter_default;
- var init_arrayFilter = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js"() {
+ // src/rendering-util/insertElementsForSize.js
+ var getDiagramElement;
+ var init_insertElementsForSize = __esm({
+ "src/rendering-util/insertElementsForSize.js"() {
"use strict";
- __name(arrayFilter, "arrayFilter");
- arrayFilter_default = arrayFilter;
+ init_src32();
+ getDiagramElement = /* @__PURE__ */ __name((id29, securityLevel) => {
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = select_default2("#i" + id29);
+ }
+ const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
+ const svg2 = root4.select(`[id="${id29}"]`);
+ return svg2;
+ }, "getDiagramElement");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js
- function stubArray() {
- return [];
- }
- var stubArray_default;
- var init_stubArray = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js"() {
+ // src/utils/subGraphTitleMargins.ts
+ var getSubGraphTitleMargins;
+ var init_subGraphTitleMargins = __esm({
+ "src/utils/subGraphTitleMargins.ts"() {
"use strict";
- __name(stubArray, "stubArray");
- stubArray_default = stubArray;
+ getSubGraphTitleMargins = /* @__PURE__ */ __name(({
+ flowchart
+ }) => {
+ const subGraphTitleTopMargin = flowchart?.subGraphTitleMargin?.top ?? 0;
+ const subGraphTitleBottomMargin = flowchart?.subGraphTitleMargin?.bottom ?? 0;
+ const subGraphTitleTotalMargin = subGraphTitleTopMargin + subGraphTitleBottomMargin;
+ return {
+ subGraphTitleTopMargin,
+ subGraphTitleBottomMargin,
+ subGraphTitleTotalMargin
+ };
+ }, "getSubGraphTitleMargins");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js
- var objectProto14, propertyIsEnumerable2, nativeGetSymbols, getSymbols, getSymbols_default;
- var init_getSymbols = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js"() {
+ // src/rendering-util/rendering-elements/clusters.js
+ var rect, noteGroup, roundedWithTitle, kanbanSection, divider, squareRect2, shapes2, clusterElems, insertCluster, clear3;
+ var init_clusters = __esm({
+ "src/rendering-util/rendering-elements/clusters.js"() {
"use strict";
- init_arrayFilter();
- init_stubArray();
- objectProto14 = Object.prototype;
- propertyIsEnumerable2 = objectProto14.propertyIsEnumerable;
- nativeGetSymbols = Object.getOwnPropertySymbols;
- getSymbols = !nativeGetSymbols ? stubArray_default : function(object3) {
- if (object3 == null) {
- return [];
+ init_diagramAPI();
+ init_common();
+ init_logger();
+ init_subGraphTitleMargins();
+ init_src32();
+ init_rough_esm();
+ init_createText();
+ init_intersect_rect();
+ init_createLabel();
+ init_roundedRectPath();
+ init_handDrawnShapeStyles();
+ rect = /* @__PURE__ */ __name(async (parent4, node2) => {
+ log.info("Creating subgraph rect for ", node2.id, node2);
+ const siteConfig2 = getConfig2();
+ const { themeVariables, handDrawnSeed } = siteConfig2;
+ const { clusterBkg, clusterBorder } = themeVariables;
+ const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node2);
+ const shapeSvg = parent4.insert("g").attr("class", "cluster " + node2.cssClasses).attr("id", node2.id).attr("data-look", node2.look);
+ const useHtmlLabels = evaluate(siteConfig2.flowchart.htmlLabels);
+ const labelEl = shapeSvg.insert("g").attr("class", "cluster-label ");
+ const text4 = await createText(labelEl, node2.label, {
+ style: node2.labelStyle,
+ useHtmlLabels,
+ isNode: true
+ });
+ let bbox = text4.getBBox();
+ if (evaluate(siteConfig2.flowchart.htmlLabels)) {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
}
- object3 = Object(object3);
- return arrayFilter_default(nativeGetSymbols(object3), function(symbol) {
- return propertyIsEnumerable2.call(object3, symbol);
+ const width3 = node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width;
+ if (node2.width <= bbox.width + node2.padding) {
+ node2.diff = (width3 - node2.width) / 2 - node2.padding;
+ } else {
+ node2.diff = -node2.padding;
+ }
+ const height2 = node2.height;
+ const x5 = node2.x - width3 / 2;
+ const y5 = node2.y - height2 / 2;
+ log.trace("Data ", node2, JSON.stringify(node2));
+ let rect3;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {
+ roughness: 0.7,
+ fill: clusterBkg,
+ // fill: 'red',
+ stroke: clusterBorder,
+ fillWeight: 3,
+ seed: handDrawnSeed
+ });
+ const roughNode = rc.path(createRoundedRectPathD(x5, y5, width3, height2, 0), options3);
+ rect3 = shapeSvg.insert(() => {
+ log.debug("Rough node insert CXC", roughNode);
+ return roughNode;
+ }, ":first-child");
+ rect3.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
+ rect3.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
+ } else {
+ rect3 = shapeSvg.insert("rect", ":first-child");
+ rect3.attr("style", nodeStyles).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
+ }
+ const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2);
+ labelEl.attr(
+ "transform",
+ // This puts the label on top of the box instead of inside it
+ `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})`
+ );
+ if (labelStyles) {
+ const span = labelEl.select("span");
+ if (span) {
+ span.attr("style", labelStyles);
+ }
+ }
+ const rectBox = rect3.node().getBBox();
+ node2.offsetX = 0;
+ node2.width = rectBox.width;
+ node2.height = rectBox.height;
+ node2.offsetY = bbox.height - node2.padding / 2;
+ node2.intersect = function(point8) {
+ return intersect_rect_default(node2, point8);
+ };
+ return { cluster: shapeSvg, labelBBox: bbox };
+ }, "rect");
+ noteGroup = /* @__PURE__ */ __name((parent4, node2) => {
+ const shapeSvg = parent4.insert("g").attr("class", "note-cluster").attr("id", node2.id);
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ const padding2 = 0 * node2.padding;
+ const halfPadding = padding2 / 2;
+ rect3.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", node2.width + padding2).attr("height", node2.height + padding2).attr("fill", "none");
+ const rectBox = rect3.node().getBBox();
+ node2.width = rectBox.width;
+ node2.height = rectBox.height;
+ node2.intersect = function(point8) {
+ return intersect_rect_default(node2, point8);
+ };
+ return { cluster: shapeSvg, labelBBox: { width: 0, height: 0 } };
+ }, "noteGroup");
+ roundedWithTitle = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const siteConfig2 = getConfig2();
+ const { themeVariables, handDrawnSeed } = siteConfig2;
+ const { altBackground, compositeBackground, compositeTitleBackground, nodeBorder } = themeVariables;
+ const shapeSvg = parent4.insert("g").attr("class", node2.cssClasses).attr("id", node2.id).attr("data-id", node2.id).attr("data-look", node2.look);
+ const outerRectG = shapeSvg.insert("g", ":first-child");
+ const label = shapeSvg.insert("g").attr("class", "cluster-label");
+ let innerRect = shapeSvg.append("rect");
+ const text4 = label.node().appendChild(await createLabel_default(node2.label, node2.labelStyle, void 0, true));
+ let bbox = text4.getBBox();
+ if (evaluate(siteConfig2.flowchart.htmlLabels)) {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ const padding2 = 0 * node2.padding;
+ const halfPadding = padding2 / 2;
+ const width3 = (node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width) + padding2;
+ if (node2.width <= bbox.width + node2.padding) {
+ node2.diff = (width3 - node2.width) / 2 - node2.padding;
+ } else {
+ node2.diff = -node2.padding;
+ }
+ const height2 = node2.height + padding2;
+ const innerHeight = node2.height + padding2 - bbox.height - 6;
+ const x5 = node2.x - width3 / 2;
+ const y5 = node2.y - height2 / 2;
+ node2.width = width3;
+ const innerY = node2.y - node2.height / 2 - halfPadding + bbox.height + 2;
+ let rect3;
+ if (node2.look === "handDrawn") {
+ const isAlt = node2.cssClasses.includes("statediagram-cluster-alt");
+ const rc = at.svg(shapeSvg);
+ const roughOuterNode = node2.rx || node2.ry ? rc.path(createRoundedRectPathD(x5, y5, width3, height2, 10), {
+ roughness: 0.7,
+ fill: compositeTitleBackground,
+ fillStyle: "solid",
+ stroke: nodeBorder,
+ seed: handDrawnSeed
+ }) : rc.rectangle(x5, y5, width3, height2, { seed: handDrawnSeed });
+ rect3 = shapeSvg.insert(() => roughOuterNode, ":first-child");
+ const roughInnerNode = rc.rectangle(x5, innerY, width3, innerHeight, {
+ fill: isAlt ? altBackground : compositeBackground,
+ fillStyle: isAlt ? "hachure" : "solid",
+ stroke: nodeBorder,
+ seed: handDrawnSeed
+ });
+ rect3 = shapeSvg.insert(() => roughOuterNode, ":first-child");
+ innerRect = shapeSvg.insert(() => roughInnerNode);
+ } else {
+ rect3 = outerRectG.insert("rect", ":first-child");
+ const outerRectClass = "outer";
+ rect3.attr("class", outerRectClass).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("data-look", node2.look);
+ innerRect.attr("class", "inner").attr("x", x5).attr("y", innerY).attr("width", width3).attr("height", innerHeight);
+ }
+ label.attr(
+ "transform",
+ `translate(${node2.x - bbox.width / 2}, ${y5 + 1 - (evaluate(siteConfig2.flowchart.htmlLabels) ? 0 : 3)})`
+ );
+ const rectBox = rect3.node().getBBox();
+ node2.height = rectBox.height;
+ node2.offsetX = 0;
+ node2.offsetY = bbox.height - node2.padding / 2;
+ node2.labelBBox = bbox;
+ node2.intersect = function(point8) {
+ return intersect_rect_default(node2, point8);
+ };
+ return { cluster: shapeSvg, labelBBox: bbox };
+ }, "roundedWithTitle");
+ kanbanSection = /* @__PURE__ */ __name(async (parent4, node2) => {
+ log.info("Creating subgraph rect for ", node2.id, node2);
+ const siteConfig2 = getConfig2();
+ const { themeVariables, handDrawnSeed } = siteConfig2;
+ const { clusterBkg, clusterBorder } = themeVariables;
+ const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node2);
+ const shapeSvg = parent4.insert("g").attr("class", "cluster " + node2.cssClasses).attr("id", node2.id).attr("data-look", node2.look);
+ const useHtmlLabels = evaluate(siteConfig2.flowchart.htmlLabels);
+ const labelEl = shapeSvg.insert("g").attr("class", "cluster-label ");
+ const text4 = await createText(labelEl, node2.label, {
+ style: node2.labelStyle,
+ useHtmlLabels,
+ isNode: true,
+ width: node2.width
});
+ let bbox = text4.getBBox();
+ if (evaluate(siteConfig2.flowchart.htmlLabels)) {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ const width3 = node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width;
+ if (node2.width <= bbox.width + node2.padding) {
+ node2.diff = (width3 - node2.width) / 2 - node2.padding;
+ } else {
+ node2.diff = -node2.padding;
+ }
+ const height2 = node2.height;
+ const x5 = node2.x - width3 / 2;
+ const y5 = node2.y - height2 / 2;
+ log.trace("Data ", node2, JSON.stringify(node2));
+ let rect3;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const options3 = userNodeOverrides(node2, {
+ roughness: 0.7,
+ fill: clusterBkg,
+ // fill: 'red',
+ stroke: clusterBorder,
+ fillWeight: 4,
+ seed: handDrawnSeed
+ });
+ const roughNode = rc.path(createRoundedRectPathD(x5, y5, width3, height2, node2.rx), options3);
+ rect3 = shapeSvg.insert(() => {
+ log.debug("Rough node insert CXC", roughNode);
+ return roughNode;
+ }, ":first-child");
+ rect3.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
+ rect3.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
+ } else {
+ rect3 = shapeSvg.insert("rect", ":first-child");
+ rect3.attr("style", nodeStyles).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
+ }
+ const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2);
+ labelEl.attr(
+ "transform",
+ // This puts the label on top of the box instead of inside it
+ `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})`
+ );
+ if (labelStyles) {
+ const span = labelEl.select("span");
+ if (span) {
+ span.attr("style", labelStyles);
+ }
+ }
+ const rectBox = rect3.node().getBBox();
+ node2.offsetX = 0;
+ node2.width = rectBox.width;
+ node2.height = rectBox.height;
+ node2.offsetY = bbox.height - node2.padding / 2;
+ node2.intersect = function(point8) {
+ return intersect_rect_default(node2, point8);
+ };
+ return { cluster: shapeSvg, labelBBox: bbox };
+ }, "kanbanSection");
+ divider = /* @__PURE__ */ __name((parent4, node2) => {
+ const siteConfig2 = getConfig2();
+ const { themeVariables, handDrawnSeed } = siteConfig2;
+ const { nodeBorder } = themeVariables;
+ const shapeSvg = parent4.insert("g").attr("class", node2.cssClasses).attr("id", node2.id).attr("data-look", node2.look);
+ const outerRectG = shapeSvg.insert("g", ":first-child");
+ const padding2 = 0 * node2.padding;
+ const width3 = node2.width + padding2;
+ node2.diff = -node2.padding;
+ const height2 = node2.height + padding2;
+ const x5 = node2.x - width3 / 2;
+ const y5 = node2.y - height2 / 2;
+ node2.width = width3;
+ let rect3;
+ if (node2.look === "handDrawn") {
+ const rc = at.svg(shapeSvg);
+ const roughOuterNode = rc.rectangle(x5, y5, width3, height2, {
+ fill: "lightgrey",
+ roughness: 0.5,
+ strokeLineDash: [5],
+ stroke: nodeBorder,
+ seed: handDrawnSeed
+ });
+ rect3 = shapeSvg.insert(() => roughOuterNode, ":first-child");
+ } else {
+ rect3 = outerRectG.insert("rect", ":first-child");
+ const outerRectClass = "divider";
+ rect3.attr("class", outerRectClass).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("data-look", node2.look);
+ }
+ const rectBox = rect3.node().getBBox();
+ node2.height = rectBox.height;
+ node2.offsetX = 0;
+ node2.offsetY = 0;
+ node2.intersect = function(point8) {
+ return intersect_rect_default(node2, point8);
+ };
+ return { cluster: shapeSvg, labelBBox: {} };
+ }, "divider");
+ squareRect2 = rect;
+ shapes2 = {
+ rect,
+ squareRect: squareRect2,
+ roundedWithTitle,
+ noteGroup,
+ divider,
+ kanbanSection
};
- getSymbols_default = getSymbols;
+ clusterElems = /* @__PURE__ */ new Map();
+ insertCluster = /* @__PURE__ */ __name(async (elem, node2) => {
+ const shape = node2.shape || "rect";
+ const cluster = await shapes2[shape](elem, node2);
+ clusterElems.set(node2.id, cluster);
+ return cluster;
+ }, "insertCluster");
+ clear3 = /* @__PURE__ */ __name(() => {
+ clusterElems = /* @__PURE__ */ new Map();
+ }, "clear");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js
- function copySymbols(source, object3) {
- return copyObject_default(source, getSymbols_default(source), object3);
- }
- var copySymbols_default;
- var init_copySymbols = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js"() {
- "use strict";
- init_copyObject();
- init_getSymbols();
- __name(copySymbols, "copySymbols");
- copySymbols_default = copySymbols;
+ // src/utils/lineWithOffset.ts
+ function calculateDeltaAndAngle(point1, point22) {
+ if (point1 === void 0 || point22 === void 0) {
+ return { angle: 0, deltaX: 0, deltaY: 0 };
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js
- var nativeGetSymbols2, getSymbolsIn, getSymbolsIn_default;
- var init_getSymbolsIn = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js"() {
+ point1 = pointTransformer(point1);
+ point22 = pointTransformer(point22);
+ const [x1, y1] = [point1.x, point1.y];
+ const [x22, y22] = [point22.x, point22.y];
+ const deltaX = x22 - x1;
+ const deltaY = y22 - y1;
+ return { angle: Math.atan(deltaY / deltaX), deltaX, deltaY };
+ }
+ var markerOffsets, pointTransformer, getLineFunctionsWithOffset;
+ var init_lineWithOffset = __esm({
+ "src/utils/lineWithOffset.ts"() {
"use strict";
- init_arrayPush();
- init_getPrototype();
- init_getSymbols();
- init_stubArray();
- nativeGetSymbols2 = Object.getOwnPropertySymbols;
- getSymbolsIn = !nativeGetSymbols2 ? stubArray_default : function(object3) {
- var result = [];
- while (object3) {
- arrayPush_default(result, getSymbols_default(object3));
- object3 = getPrototype_default(object3);
- }
- return result;
+ markerOffsets = {
+ aggregation: 18,
+ extension: 18,
+ composition: 18,
+ dependency: 6,
+ lollipop: 13.5,
+ arrow_point: 4
};
- getSymbolsIn_default = getSymbolsIn;
+ __name(calculateDeltaAndAngle, "calculateDeltaAndAngle");
+ pointTransformer = /* @__PURE__ */ __name((data6) => {
+ if (Array.isArray(data6)) {
+ return { x: data6[0], y: data6[1] };
+ }
+ return data6;
+ }, "pointTransformer");
+ getLineFunctionsWithOffset = /* @__PURE__ */ __name((edge) => {
+ return {
+ x: /* @__PURE__ */ __name(function(d2, i2, data6) {
+ let offset = 0;
+ const DIRECTION = pointTransformer(data6[0]).x < pointTransformer(data6[data6.length - 1]).x ? "left" : "right";
+ if (i2 === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
+ const { angle: angle2, deltaX } = calculateDeltaAndAngle(data6[0], data6[1]);
+ offset = markerOffsets[edge.arrowTypeStart] * Math.cos(angle2) * (deltaX >= 0 ? 1 : -1);
+ } else if (i2 === data6.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
+ const { angle: angle2, deltaX } = calculateDeltaAndAngle(
+ data6[data6.length - 1],
+ data6[data6.length - 2]
+ );
+ offset = markerOffsets[edge.arrowTypeEnd] * Math.cos(angle2) * (deltaX >= 0 ? 1 : -1);
+ }
+ const differenceToEnd = Math.abs(
+ pointTransformer(d2).x - pointTransformer(data6[data6.length - 1]).x
+ );
+ const differenceInYEnd = Math.abs(
+ pointTransformer(d2).y - pointTransformer(data6[data6.length - 1]).y
+ );
+ const differenceToStart = Math.abs(pointTransformer(d2).x - pointTransformer(data6[0]).x);
+ const differenceInYStart = Math.abs(pointTransformer(d2).y - pointTransformer(data6[0]).y);
+ const startMarkerHeight = markerOffsets[edge.arrowTypeStart];
+ const endMarkerHeight = markerOffsets[edge.arrowTypeEnd];
+ const extraRoom = 1;
+ if (differenceToEnd < endMarkerHeight && differenceToEnd > 0 && differenceInYEnd < endMarkerHeight) {
+ let adjustment = endMarkerHeight + extraRoom - differenceToEnd;
+ adjustment *= DIRECTION === "right" ? -1 : 1;
+ offset -= adjustment;
+ }
+ if (differenceToStart < startMarkerHeight && differenceToStart > 0 && differenceInYStart < startMarkerHeight) {
+ let adjustment = startMarkerHeight + extraRoom - differenceToStart;
+ adjustment *= DIRECTION === "right" ? -1 : 1;
+ offset += adjustment;
+ }
+ return pointTransformer(d2).x + offset;
+ }, "x"),
+ y: /* @__PURE__ */ __name(function(d2, i2, data6) {
+ let offset = 0;
+ const DIRECTION = pointTransformer(data6[0]).y < pointTransformer(data6[data6.length - 1]).y ? "down" : "up";
+ if (i2 === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
+ const { angle: angle2, deltaY } = calculateDeltaAndAngle(data6[0], data6[1]);
+ offset = markerOffsets[edge.arrowTypeStart] * Math.abs(Math.sin(angle2)) * (deltaY >= 0 ? 1 : -1);
+ } else if (i2 === data6.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
+ const { angle: angle2, deltaY } = calculateDeltaAndAngle(
+ data6[data6.length - 1],
+ data6[data6.length - 2]
+ );
+ offset = markerOffsets[edge.arrowTypeEnd] * Math.abs(Math.sin(angle2)) * (deltaY >= 0 ? 1 : -1);
+ }
+ const differenceToEnd = Math.abs(
+ pointTransformer(d2).y - pointTransformer(data6[data6.length - 1]).y
+ );
+ const differenceInXEnd = Math.abs(
+ pointTransformer(d2).x - pointTransformer(data6[data6.length - 1]).x
+ );
+ const differenceToStart = Math.abs(pointTransformer(d2).y - pointTransformer(data6[0]).y);
+ const differenceInXStart = Math.abs(pointTransformer(d2).x - pointTransformer(data6[0]).x);
+ const startMarkerHeight = markerOffsets[edge.arrowTypeStart];
+ const endMarkerHeight = markerOffsets[edge.arrowTypeEnd];
+ const extraRoom = 1;
+ if (differenceToEnd < endMarkerHeight && differenceToEnd > 0 && differenceInXEnd < endMarkerHeight) {
+ let adjustment = endMarkerHeight + extraRoom - differenceToEnd;
+ adjustment *= DIRECTION === "up" ? -1 : 1;
+ offset -= adjustment;
+ }
+ if (differenceToStart < startMarkerHeight && differenceToStart > 0 && differenceInXStart < startMarkerHeight) {
+ let adjustment = startMarkerHeight + extraRoom - differenceToStart;
+ adjustment *= DIRECTION === "up" ? -1 : 1;
+ offset += adjustment;
+ }
+ return pointTransformer(d2).y + offset;
+ }, "y")
+ };
+ }, "getLineFunctionsWithOffset");
+ if (void 0) {
+ const { it, expect, describe } = void 0;
+ describe("calculateDeltaAndAngle", () => {
+ it("should calculate the angle and deltas between two points", () => {
+ expect(calculateDeltaAndAngle([0, 0], [0, 1])).toStrictEqual({
+ angle: 1.5707963267948966,
+ deltaX: 0,
+ deltaY: 1
+ });
+ expect(calculateDeltaAndAngle([1, 0], [0, -1])).toStrictEqual({
+ angle: 0.7853981633974483,
+ deltaX: -1,
+ deltaY: -1
+ });
+ expect(calculateDeltaAndAngle({ x: 1, y: 0 }, [0, -1])).toStrictEqual({
+ angle: 0.7853981633974483,
+ deltaX: -1,
+ deltaY: -1
+ });
+ expect(calculateDeltaAndAngle({ x: 1, y: 0 }, { x: 1, y: 0 })).toStrictEqual({
+ angle: NaN,
+ deltaX: 0,
+ deltaY: 0
+ });
+ });
+ it("should calculate the angle and deltas if one point in undefined", () => {
+ expect(calculateDeltaAndAngle(void 0, [0, 1])).toStrictEqual({
+ angle: 0,
+ deltaX: 0,
+ deltaY: 0
+ });
+ expect(calculateDeltaAndAngle([0, 1], void 0)).toStrictEqual({
+ angle: 0,
+ deltaX: 0,
+ deltaY: 0
+ });
+ });
+ });
+ }
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js
- function copySymbolsIn(source, object3) {
- return copyObject_default(source, getSymbolsIn_default(source), object3);
- }
- var copySymbolsIn_default;
- var init_copySymbolsIn = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js"() {
+ // src/rendering-util/rendering-elements/edgeMarker.ts
+ var addEdgeMarkers, arrowTypesMap, addEdgeMarker;
+ var init_edgeMarker = __esm({
+ "src/rendering-util/rendering-elements/edgeMarker.ts"() {
"use strict";
- init_copyObject();
- init_getSymbolsIn();
- __name(copySymbolsIn, "copySymbolsIn");
- copySymbolsIn_default = copySymbolsIn;
+ init_logger();
+ addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id29, diagramType, strokeColor) => {
+ if (edge.arrowTypeStart) {
+ addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id29, diagramType, strokeColor);
+ }
+ if (edge.arrowTypeEnd) {
+ addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id29, diagramType, strokeColor);
+ }
+ }, "addEdgeMarkers");
+ arrowTypesMap = {
+ arrow_cross: { type: "cross", fill: false },
+ arrow_point: { type: "point", fill: true },
+ arrow_barb: { type: "barb", fill: true },
+ arrow_circle: { type: "circle", fill: false },
+ aggregation: { type: "aggregation", fill: false },
+ extension: { type: "extension", fill: false },
+ composition: { type: "composition", fill: true },
+ dependency: { type: "dependency", fill: true },
+ lollipop: { type: "lollipop", fill: false },
+ only_one: { type: "onlyOne", fill: false },
+ zero_or_one: { type: "zeroOrOne", fill: false },
+ one_or_more: { type: "oneOrMore", fill: false },
+ zero_or_more: { type: "zeroOrMore", fill: false },
+ requirement_arrow: { type: "requirement_arrow", fill: false },
+ requirement_contains: { type: "requirement_contains", fill: false }
+ };
+ addEdgeMarker = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id29, diagramType, strokeColor) => {
+ const arrowTypeInfo = arrowTypesMap[arrowType];
+ if (!arrowTypeInfo) {
+ log.warn(`Unknown arrow type: ${arrowType}`);
+ return;
+ }
+ const endMarkerType = arrowTypeInfo.type;
+ const suffix = position5 === "start" ? "Start" : "End";
+ const originalMarkerId = `${id29}_${diagramType}-${endMarkerType}${suffix}`;
+ if (strokeColor && strokeColor.trim() !== "") {
+ const colorId = strokeColor.replace(/[^\dA-Za-z]/g, "_");
+ const coloredMarkerId = `${originalMarkerId}_${colorId}`;
+ if (!document.getElementById(coloredMarkerId)) {
+ const originalMarker = document.getElementById(originalMarkerId);
+ if (originalMarker) {
+ const coloredMarker = originalMarker.cloneNode(true);
+ coloredMarker.id = coloredMarkerId;
+ const paths = coloredMarker.querySelectorAll("path, circle, line");
+ paths.forEach((path4) => {
+ path4.setAttribute("stroke", strokeColor);
+ if (arrowTypeInfo.fill) {
+ path4.setAttribute("fill", strokeColor);
+ }
+ });
+ originalMarker.parentNode?.appendChild(coloredMarker);
+ }
+ }
+ svgPath.attr(`marker-${position5}`, `url(${url}#${coloredMarkerId})`);
+ } else {
+ svgPath.attr(`marker-${position5}`, `url(${url}#${originalMarkerId})`);
+ }
+ }, "addEdgeMarker");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js
- function baseGetAllKeys(object3, keysFunc, symbolsFunc) {
- var result = keysFunc(object3);
- return isArray_default(object3) ? result : arrayPush_default(result, symbolsFunc(object3));
- }
- var baseGetAllKeys_default;
- var init_baseGetAllKeys = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js"() {
- "use strict";
- init_arrayPush();
- init_isArray();
- __name(baseGetAllKeys, "baseGetAllKeys");
- baseGetAllKeys_default = baseGetAllKeys;
+ // src/rendering-util/rendering-elements/edges.js
+ function setTerminalWidth(fo, value2) {
+ if (getConfig2().flowchart.htmlLabels && fo) {
+ fo.style.width = value2.length * 9 + "px";
+ fo.style.height = "12px";
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js
- function getAllKeys(object3) {
- return baseGetAllKeys_default(object3, keys_default, getSymbols_default);
}
- var getAllKeys_default;
- var init_getAllKeys = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js"() {
- "use strict";
- init_baseGetAllKeys();
- init_getSymbols();
- init_keys();
- __name(getAllKeys, "getAllKeys");
- getAllKeys_default = getAllKeys;
+ function extractCornerPoints(points) {
+ const cornerPoints = [];
+ const cornerPointPositions = [];
+ for (let i2 = 1; i2 < points.length - 1; i2++) {
+ const prev2 = points[i2 - 1];
+ const curr = points[i2];
+ const next3 = points[i2 + 1];
+ if (prev2.x === curr.x && curr.y === next3.y && Math.abs(curr.x - next3.x) > 5 && Math.abs(curr.y - prev2.y) > 5) {
+ cornerPoints.push(curr);
+ cornerPointPositions.push(i2);
+ } else if (prev2.y === curr.y && curr.x === next3.x && Math.abs(curr.x - prev2.x) > 5 && Math.abs(curr.y - next3.y) > 5) {
+ cornerPoints.push(curr);
+ cornerPointPositions.push(i2);
+ }
}
- });
-
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js
- function getAllKeysIn(object3) {
- return baseGetAllKeys_default(object3, keysIn_default, getSymbolsIn_default);
+ return { cornerPoints, cornerPointPositions };
}
- var getAllKeysIn_default;
- var init_getAllKeysIn = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js"() {
+ var edgeLabels, terminalLabels, clear4, getLabelStyles, insertEdgeLabel, positionEdgeLabel, outsideNode, intersection, cutPathAtIntersect, findAdjacentPoint, fixCorners, insertEdge;
+ var init_edges = __esm({
+ "src/rendering-util/rendering-elements/edges.js"() {
"use strict";
- init_baseGetAllKeys();
- init_getSymbolsIn();
- init_keysIn();
- __name(getAllKeysIn, "getAllKeysIn");
- getAllKeysIn_default = getAllKeysIn;
+ init_diagramAPI();
+ init_common();
+ init_logger();
+ init_createText();
+ init_utils2();
+ init_lineWithOffset();
+ init_subGraphTitleMargins();
+ init_src32();
+ init_rough_esm();
+ init_createLabel();
+ init_edgeMarker();
+ init_handDrawnShapeStyles();
+ edgeLabels = /* @__PURE__ */ new Map();
+ terminalLabels = /* @__PURE__ */ new Map();
+ clear4 = /* @__PURE__ */ __name(() => {
+ edgeLabels.clear();
+ terminalLabels.clear();
+ }, "clear");
+ getLabelStyles = /* @__PURE__ */ __name((styleArray) => {
+ let styles4 = styleArray ? styleArray.reduce((acc, style3) => acc + ";" + style3, "") : "";
+ return styles4;
+ }, "getLabelStyles");
+ insertEdgeLabel = /* @__PURE__ */ __name(async (elem, edge) => {
+ let useHtmlLabels = evaluate(getConfig2().flowchart.htmlLabels);
+ const labelElement = await createText(elem, edge.label, {
+ style: getLabelStyles(edge.labelStyle),
+ useHtmlLabels,
+ addSvgBackground: true,
+ isNode: false
+ });
+ log.info("abc82", edge, edge.labelType);
+ const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
+ const label = edgeLabel.insert("g").attr("class", "label");
+ label.node().appendChild(labelElement);
+ let bbox = labelElement.getBBox();
+ if (useHtmlLabels) {
+ const div = labelElement.children[0];
+ const dv = select_default2(labelElement);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
+ edgeLabels.set(edge.id, edgeLabel);
+ edge.width = bbox.width;
+ edge.height = bbox.height;
+ let fo;
+ if (edge.startLabelLeft) {
+ const startLabelElement = await createLabel_default(
+ edge.startLabelLeft,
+ getLabelStyles(edge.labelStyle)
+ );
+ const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
+ const inner2 = startEdgeLabelLeft.insert("g").attr("class", "inner");
+ fo = inner2.node().appendChild(startLabelElement);
+ const slBox = startLabelElement.getBBox();
+ inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
+ if (!terminalLabels.get(edge.id)) {
+ terminalLabels.set(edge.id, {});
+ }
+ terminalLabels.get(edge.id).startLeft = startEdgeLabelLeft;
+ setTerminalWidth(fo, edge.startLabelLeft);
+ }
+ if (edge.startLabelRight) {
+ const startLabelElement = await createLabel_default(
+ edge.startLabelRight,
+ getLabelStyles(edge.labelStyle)
+ );
+ const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
+ const inner2 = startEdgeLabelRight.insert("g").attr("class", "inner");
+ fo = startEdgeLabelRight.node().appendChild(startLabelElement);
+ inner2.node().appendChild(startLabelElement);
+ const slBox = startLabelElement.getBBox();
+ inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
+ if (!terminalLabels.get(edge.id)) {
+ terminalLabels.set(edge.id, {});
+ }
+ terminalLabels.get(edge.id).startRight = startEdgeLabelRight;
+ setTerminalWidth(fo, edge.startLabelRight);
+ }
+ if (edge.endLabelLeft) {
+ const endLabelElement = await createLabel_default(edge.endLabelLeft, getLabelStyles(edge.labelStyle));
+ const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
+ const inner2 = endEdgeLabelLeft.insert("g").attr("class", "inner");
+ fo = inner2.node().appendChild(endLabelElement);
+ const slBox = endLabelElement.getBBox();
+ inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
+ endEdgeLabelLeft.node().appendChild(endLabelElement);
+ if (!terminalLabels.get(edge.id)) {
+ terminalLabels.set(edge.id, {});
+ }
+ terminalLabels.get(edge.id).endLeft = endEdgeLabelLeft;
+ setTerminalWidth(fo, edge.endLabelLeft);
+ }
+ if (edge.endLabelRight) {
+ const endLabelElement = await createLabel_default(edge.endLabelRight, getLabelStyles(edge.labelStyle));
+ const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
+ const inner2 = endEdgeLabelRight.insert("g").attr("class", "inner");
+ fo = inner2.node().appendChild(endLabelElement);
+ const slBox = endLabelElement.getBBox();
+ inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
+ endEdgeLabelRight.node().appendChild(endLabelElement);
+ if (!terminalLabels.get(edge.id)) {
+ terminalLabels.set(edge.id, {});
+ }
+ terminalLabels.get(edge.id).endRight = endEdgeLabelRight;
+ setTerminalWidth(fo, edge.endLabelRight);
+ }
+ return labelElement;
+ }, "insertEdgeLabel");
+ __name(setTerminalWidth, "setTerminalWidth");
+ positionEdgeLabel = /* @__PURE__ */ __name((edge, paths) => {
+ log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels.get(edge.id), paths);
+ let path4 = paths.updatedPath ? paths.updatedPath : paths.originalPath;
+ const siteConfig2 = getConfig2();
+ const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2);
+ if (edge.label) {
+ const el = edgeLabels.get(edge.id);
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcLabelPosition(path4);
+ log.debug(
+ "Moving label " + edge.label + " from (",
+ x5,
+ ",",
+ y5,
+ ") to (",
+ pos.x,
+ ",",
+ pos.y,
+ ") abc88"
+ );
+ if (paths.updatedPath) {
+ x5 = pos.x;
+ y5 = pos.y;
+ }
+ }
+ el.attr("transform", `translate(${x5}, ${y5 + subGraphTitleTotalMargin / 2})`);
+ }
+ if (edge.startLabelLeft) {
+ const el = terminalLabels.get(edge.id).startLeft;
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path4);
+ x5 = pos.x;
+ y5 = pos.y;
+ }
+ el.attr("transform", `translate(${x5}, ${y5})`);
+ }
+ if (edge.startLabelRight) {
+ const el = terminalLabels.get(edge.id).startRight;
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcTerminalLabelPosition(
+ edge.arrowTypeStart ? 10 : 0,
+ "start_right",
+ path4
+ );
+ x5 = pos.x;
+ y5 = pos.y;
+ }
+ el.attr("transform", `translate(${x5}, ${y5})`);
+ }
+ if (edge.endLabelLeft) {
+ const el = terminalLabels.get(edge.id).endLeft;
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path4);
+ x5 = pos.x;
+ y5 = pos.y;
+ }
+ el.attr("transform", `translate(${x5}, ${y5})`);
+ }
+ if (edge.endLabelRight) {
+ const el = terminalLabels.get(edge.id).endRight;
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path4);
+ x5 = pos.x;
+ y5 = pos.y;
+ }
+ el.attr("transform", `translate(${x5}, ${y5})`);
+ }
+ }, "positionEdgeLabel");
+ outsideNode = /* @__PURE__ */ __name((node2, point8) => {
+ const x5 = node2.x;
+ const y5 = node2.y;
+ const dx = Math.abs(point8.x - x5);
+ const dy = Math.abs(point8.y - y5);
+ const w3 = node2.width / 2;
+ const h2 = node2.height / 2;
+ return dx >= w3 || dy >= h2;
+ }, "outsideNode");
+ intersection = /* @__PURE__ */ __name((node2, outsidePoint, insidePoint) => {
+ log.debug(`intersection calc abc89:
+ outsidePoint: ${JSON.stringify(outsidePoint)}
+ insidePoint : ${JSON.stringify(insidePoint)}
+ node : x:${node2.x} y:${node2.y} w:${node2.width} h:${node2.height}`);
+ const x5 = node2.x;
+ const y5 = node2.y;
+ const dx = Math.abs(x5 - insidePoint.x);
+ const w3 = node2.width / 2;
+ let r2 = insidePoint.x < outsidePoint.x ? w3 - dx : w3 + dx;
+ const h2 = node2.height / 2;
+ const Q2 = Math.abs(outsidePoint.y - insidePoint.y);
+ const R2 = Math.abs(outsidePoint.x - insidePoint.x);
+ if (Math.abs(y5 - outsidePoint.y) * w3 > Math.abs(x5 - outsidePoint.x) * h2) {
+ let q2 = insidePoint.y < outsidePoint.y ? outsidePoint.y - h2 - y5 : y5 - h2 - outsidePoint.y;
+ r2 = R2 * q2 / Q2;
+ const res = {
+ x: insidePoint.x < outsidePoint.x ? insidePoint.x + r2 : insidePoint.x - R2 + r2,
+ y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q2 - q2 : insidePoint.y - Q2 + q2
+ };
+ if (r2 === 0) {
+ res.x = outsidePoint.x;
+ res.y = outsidePoint.y;
+ }
+ if (R2 === 0) {
+ res.x = outsidePoint.x;
+ }
+ if (Q2 === 0) {
+ res.y = outsidePoint.y;
+ }
+ log.debug(`abc89 top/bottom calc, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, res);
+ return res;
+ } else {
+ if (insidePoint.x < outsidePoint.x) {
+ r2 = outsidePoint.x - w3 - x5;
+ } else {
+ r2 = x5 - w3 - outsidePoint.x;
+ }
+ let q2 = Q2 * r2 / R2;
+ let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R2 - r2 : insidePoint.x - R2 + r2;
+ let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q2 : insidePoint.y - q2;
+ log.debug(`sides calc abc89, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, { _x, _y });
+ if (r2 === 0) {
+ _x = outsidePoint.x;
+ _y = outsidePoint.y;
+ }
+ if (R2 === 0) {
+ _x = outsidePoint.x;
+ }
+ if (Q2 === 0) {
+ _y = outsidePoint.y;
+ }
+ return { x: _x, y: _y };
+ }
+ }, "intersection");
+ cutPathAtIntersect = /* @__PURE__ */ __name((_points, boundaryNode) => {
+ log.warn("abc88 cutPathAtIntersect", _points, boundaryNode);
+ let points = [];
+ let lastPointOutside = _points[0];
+ let isInside = false;
+ _points.forEach((point8) => {
+ log.info("abc88 checking point", point8, boundaryNode);
+ if (!outsideNode(boundaryNode, point8) && !isInside) {
+ const inter = intersection(boundaryNode, lastPointOutside, point8);
+ log.debug("abc88 inside", point8, lastPointOutside, inter);
+ log.debug("abc88 intersection", inter, boundaryNode);
+ let pointPresent = false;
+ points.forEach((p3) => {
+ pointPresent = pointPresent || p3.x === inter.x && p3.y === inter.y;
+ });
+ if (!points.some((e3) => e3.x === inter.x && e3.y === inter.y)) {
+ points.push(inter);
+ } else {
+ log.warn("abc88 no intersect", inter, points);
+ }
+ isInside = true;
+ } else {
+ log.warn("abc88 outside", point8, lastPointOutside);
+ lastPointOutside = point8;
+ if (!isInside) {
+ points.push(point8);
+ }
+ }
+ });
+ log.debug("returning points", points);
+ return points;
+ }, "cutPathAtIntersect");
+ __name(extractCornerPoints, "extractCornerPoints");
+ findAdjacentPoint = /* @__PURE__ */ __name(function(pointA, pointB, distance2) {
+ const xDiff = pointB.x - pointA.x;
+ const yDiff = pointB.y - pointA.y;
+ const length2 = Math.sqrt(xDiff * xDiff + yDiff * yDiff);
+ const ratio = distance2 / length2;
+ return { x: pointB.x - ratio * xDiff, y: pointB.y - ratio * yDiff };
+ }, "findAdjacentPoint");
+ fixCorners = /* @__PURE__ */ __name(function(lineData) {
+ const { cornerPointPositions } = extractCornerPoints(lineData);
+ const newLineData = [];
+ for (let i2 = 0; i2 < lineData.length; i2++) {
+ if (cornerPointPositions.includes(i2)) {
+ const prevPoint = lineData[i2 - 1];
+ const nextPoint = lineData[i2 + 1];
+ const cornerPoint = lineData[i2];
+ const newPrevPoint = findAdjacentPoint(prevPoint, cornerPoint, 5);
+ const newNextPoint = findAdjacentPoint(nextPoint, cornerPoint, 5);
+ const xDiff = newNextPoint.x - newPrevPoint.x;
+ const yDiff = newNextPoint.y - newPrevPoint.y;
+ newLineData.push(newPrevPoint);
+ const a2 = Math.sqrt(2) * 2;
+ let newCornerPoint = { x: cornerPoint.x, y: cornerPoint.y };
+ if (Math.abs(nextPoint.x - prevPoint.x) > 10 && Math.abs(nextPoint.y - prevPoint.y) >= 10) {
+ log.debug(
+ "Corner point fixing",
+ Math.abs(nextPoint.x - prevPoint.x),
+ Math.abs(nextPoint.y - prevPoint.y)
+ );
+ const r2 = 5;
+ if (cornerPoint.x === newPrevPoint.x) {
+ newCornerPoint = {
+ x: xDiff < 0 ? newPrevPoint.x - r2 + a2 : newPrevPoint.x + r2 - a2,
+ y: yDiff < 0 ? newPrevPoint.y - a2 : newPrevPoint.y + a2
+ };
+ } else {
+ newCornerPoint = {
+ x: xDiff < 0 ? newPrevPoint.x - a2 : newPrevPoint.x + a2,
+ y: yDiff < 0 ? newPrevPoint.y - r2 + a2 : newPrevPoint.y + r2 - a2
+ };
+ }
+ } else {
+ log.debug(
+ "Corner point skipping fixing",
+ Math.abs(nextPoint.x - prevPoint.x),
+ Math.abs(nextPoint.y - prevPoint.y)
+ );
+ }
+ newLineData.push(newCornerPoint, newNextPoint);
+ } else {
+ newLineData.push(lineData[i2]);
+ }
+ }
+ return newLineData;
+ }, "fixCorners");
+ insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb2, diagramType, startNode, endNode, id29) {
+ const { handDrawnSeed } = getConfig2();
+ let points = edge.points;
+ let pointsHasChanged = false;
+ const tail = startNode;
+ var head2 = endNode;
+ const edgeClassStyles = [];
+ for (const key in edge.cssCompiledStyles) {
+ if (isLabelStyle(key)) {
+ continue;
+ }
+ edgeClassStyles.push(edge.cssCompiledStyles[key]);
+ }
+ if (head2.intersect && tail.intersect) {
+ points = points.slice(1, edge.points.length - 1);
+ points.unshift(tail.intersect(points[0]));
+ log.debug(
+ "Last point APA12",
+ edge.start,
+ "-->",
+ edge.end,
+ points[points.length - 1],
+ head2,
+ head2.intersect(points[points.length - 1])
+ );
+ points.push(head2.intersect(points[points.length - 1]));
+ }
+ if (edge.toCluster) {
+ log.info("to cluster abc88", clusterDb2.get(edge.toCluster));
+ points = cutPathAtIntersect(edge.points, clusterDb2.get(edge.toCluster).node);
+ pointsHasChanged = true;
+ }
+ if (edge.fromCluster) {
+ log.debug(
+ "from cluster abc88",
+ clusterDb2.get(edge.fromCluster),
+ JSON.stringify(points, null, 2)
+ );
+ points = cutPathAtIntersect(points.reverse(), clusterDb2.get(edge.fromCluster).node).reverse();
+ pointsHasChanged = true;
+ }
+ let lineData = points.filter((p3) => !Number.isNaN(p3.y));
+ lineData = fixCorners(lineData);
+ let curve = basis_default2;
+ curve = linear_default;
+ switch (edge.curve) {
+ case "linear":
+ curve = linear_default;
+ break;
+ case "basis":
+ curve = basis_default2;
+ break;
+ case "cardinal":
+ curve = cardinal_default;
+ break;
+ case "bumpX":
+ curve = bumpX;
+ break;
+ case "bumpY":
+ curve = bumpY;
+ break;
+ case "catmullRom":
+ curve = catmullRom_default;
+ break;
+ case "monotoneX":
+ curve = monotoneX;
+ break;
+ case "monotoneY":
+ curve = monotoneY;
+ break;
+ case "natural":
+ curve = natural_default;
+ break;
+ case "step":
+ curve = step_default;
+ break;
+ case "stepAfter":
+ curve = stepAfter;
+ break;
+ case "stepBefore":
+ curve = stepBefore;
+ break;
+ default:
+ curve = basis_default2;
+ }
+ const { x: x5, y: y5 } = getLineFunctionsWithOffset(edge);
+ const lineFunction = line_default().x(x5).y(y5).curve(curve);
+ let strokeClasses;
+ switch (edge.thickness) {
+ case "normal":
+ strokeClasses = "edge-thickness-normal";
+ break;
+ case "thick":
+ strokeClasses = "edge-thickness-thick";
+ break;
+ case "invisible":
+ strokeClasses = "edge-thickness-invisible";
+ break;
+ default:
+ strokeClasses = "edge-thickness-normal";
+ }
+ switch (edge.pattern) {
+ case "solid":
+ strokeClasses += " edge-pattern-solid";
+ break;
+ case "dotted":
+ strokeClasses += " edge-pattern-dotted";
+ break;
+ case "dashed":
+ strokeClasses += " edge-pattern-dashed";
+ break;
+ default:
+ strokeClasses += " edge-pattern-solid";
+ }
+ let svgPath;
+ let linePath = lineFunction(lineData);
+ const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
+ let strokeColor = edgeStyles.find((style3) => style3?.startsWith("stroke:"));
+ if (edge.look === "handDrawn") {
+ const rc = at.svg(elem);
+ Object.assign([], lineData);
+ const svgPathNode = rc.path(linePath, {
+ roughness: 0.3,
+ seed: handDrawnSeed
+ });
+ strokeClasses += " transition";
+ svgPath = select_default2(svgPathNode).select("path").attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style3) => acc + ";" + style3, "") : "");
+ let d2 = svgPath.attr("d");
+ svgPath.attr("d", d2);
+ elem.node().appendChild(svgPath.node());
+ } else {
+ const stylesFromClasses = edgeClassStyles.join(";");
+ const styles4 = edgeStyles ? edgeStyles.reduce((acc, style3) => acc + style3 + ";", "") : "";
+ let animationClass = "";
+ if (edge.animate) {
+ animationClass = " edge-animation-fast";
+ }
+ if (edge.animation) {
+ animationClass = " edge-animation-" + edge.animation;
+ }
+ const pathStyle = stylesFromClasses ? stylesFromClasses + ";" + styles4 + ";" : styles4;
+ svgPath = elem.append("path").attr("d", linePath).attr("id", edge.id).attr(
+ "class",
+ " " + strokeClasses + (edge.classes ? " " + edge.classes : "") + (animationClass ?? "")
+ ).attr("style", pathStyle);
+ strokeColor = pathStyle.match(/stroke:([^;]+)/)?.[1];
+ }
+ let url = "";
+ if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) {
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
+ url = url.replace(/\(/g, "\\(").replace(/\)/g, "\\)");
+ }
+ log.info("arrowTypeStart", edge.arrowTypeStart);
+ log.info("arrowTypeEnd", edge.arrowTypeEnd);
+ addEdgeMarkers(svgPath, edge, url, id29, diagramType, strokeColor);
+ let paths = {};
+ if (pointsHasChanged) {
+ paths.updatedPath = points;
+ }
+ paths.originalPath = edge.points;
+ return paths;
+ }, "insertEdge");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js
- var DataView2, DataView_default;
- var init_DataView = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js"() {
+ // src/rendering-util/rendering-elements/markers.js
+ var insertMarkers, extension, composition, aggregation, dependency, lollipop, point6, circle2, cross, barb, only_one, zero_or_one, one_or_more, zero_or_more, requirement_arrow, requirement_contains, markers, markers_default;
+ var init_markers = __esm({
+ "src/rendering-util/rendering-elements/markers.js"() {
"use strict";
- init_getNative();
- init_root();
- DataView2 = getNative_default(root_default, "DataView");
- DataView_default = DataView2;
+ init_logger();
+ insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type3, id29) => {
+ markerArray.forEach((markerName) => {
+ markers[markerName](elem, type3, id29);
+ });
+ }, "insertMarkers");
+ extension = /* @__PURE__ */ __name((elem, type3, id29) => {
+ log.trace("Making markers for ", id29);
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).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", id29 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).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");
+ }, "extension");
+ composition = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).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", id29 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).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");
+ }, "composition");
+ aggregation = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).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", id29 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).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");
+ }, "aggregation");
+ dependency = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).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", id29 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).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");
+ }, "dependency");
+ lollipop = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).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", id29 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).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);
+ }, "lollipop");
+ point6 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("marker").attr("id", id29 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).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", id29 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).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");
+ }, "point");
+ circle2 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("marker").attr("id", id29 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).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", id29 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).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");
+ }, "circle");
+ cross = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("marker").attr("id", id29 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).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", id29 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).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");
+ }, "cross");
+ barb = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
+ }, "barb");
+ only_one = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-onlyOneStart").attr("class", "marker onlyOne " + type3).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18");
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-onlyOneEnd").attr("class", "marker onlyOne " + type3).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
+ }, "only_one");
+ zero_or_one = /* @__PURE__ */ __name((elem, type3, id29) => {
+ const startMarker = elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + type3).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
+ startMarker.append("circle").attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
+ startMarker.append("path").attr("d", "M9,0 L9,18");
+ const endMarker = elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + type3).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
+ endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
+ endMarker.append("path").attr("d", "M21,0 L21,18");
+ }, "zero_or_one");
+ one_or_more = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-oneOrMoreStart").attr("class", "marker oneOrMore " + type3).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + type3).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
+ }, "one_or_more");
+ zero_or_more = /* @__PURE__ */ __name((elem, type3, id29) => {
+ const startMarker = elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + type3).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
+ startMarker.append("circle").attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
+ startMarker.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
+ const endMarker = elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + type3).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
+ endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
+ endMarker.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
+ }, "zero_or_more");
+ requirement_arrow = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("path").attr(
+ "d",
+ `M0,0
+ L20,10
+ M20,10
+ L0,20`
+ );
+ }, "requirement_arrow");
+ requirement_contains = /* @__PURE__ */ __name((elem, type3, id29) => {
+ const containsNode = elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
+ containsNode.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none");
+ containsNode.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10);
+ containsNode.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
+ }, "requirement_contains");
+ markers = {
+ extension,
+ composition,
+ aggregation,
+ dependency,
+ lollipop,
+ point: point6,
+ circle: circle2,
+ cross,
+ barb,
+ only_one,
+ zero_or_one,
+ one_or_more,
+ zero_or_more,
+ requirement_arrow,
+ requirement_contains
+ };
+ markers_default = insertMarkers;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js
- var Promise2, Promise_default;
- var init_Promise = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js"() {
+ // src/rendering-util/rendering-elements/nodes.ts
+ async function insertNode(elem, node2, renderOptions) {
+ let newEl;
+ let el;
+ if (node2.shape === "rect") {
+ if (node2.rx && node2.ry) {
+ node2.shape = "roundedRect";
+ } else {
+ node2.shape = "squareRect";
+ }
+ }
+ const shapeHandler = node2.shape ? shapes[node2.shape] : void 0;
+ if (!shapeHandler) {
+ throw new Error(`No such shape: ${node2.shape}. Please check your syntax.`);
+ }
+ if (node2.link) {
+ let target;
+ if (renderOptions.config.securityLevel === "sandbox") {
+ target = "_top";
+ } else if (node2.linkTarget) {
+ target = node2.linkTarget || "_blank";
+ }
+ newEl = elem.insert("svg:a").attr("xlink:href", node2.link).attr("target", target ?? null);
+ el = await shapeHandler(newEl, node2, renderOptions);
+ } else {
+ el = await shapeHandler(elem, node2, renderOptions);
+ newEl = el;
+ }
+ if (node2.tooltip) {
+ el.attr("title", node2.tooltip);
+ }
+ nodeElems.set(node2.id, newEl);
+ if (node2.haveCallback) {
+ newEl.attr("class", newEl.attr("class") + " clickable");
+ }
+ return newEl;
+ }
+ var nodeElems, setNodeElem, clear5, positionNode;
+ var init_nodes2 = __esm({
+ "src/rendering-util/rendering-elements/nodes.ts"() {
"use strict";
- init_getNative();
- init_root();
- Promise2 = getNative_default(root_default, "Promise");
- Promise_default = Promise2;
+ init_logger();
+ init_shapes();
+ nodeElems = /* @__PURE__ */ new Map();
+ __name(insertNode, "insertNode");
+ setNodeElem = /* @__PURE__ */ __name((elem, node2) => {
+ nodeElems.set(node2.id, elem);
+ }, "setNodeElem");
+ clear5 = /* @__PURE__ */ __name(() => {
+ nodeElems.clear();
+ }, "clear");
+ positionNode = /* @__PURE__ */ __name((node2) => {
+ const el = nodeElems.get(node2.id);
+ log.trace(
+ "Transforming node",
+ node2.diff,
+ node2,
+ "translate(" + (node2.x - node2.width / 2 - 5) + ", " + node2.width / 2 + ")"
+ );
+ const padding2 = 8;
+ const diff2 = node2.diff || 0;
+ if (node2.clusterNode) {
+ el.attr(
+ "transform",
+ "translate(" + (node2.x + diff2 - node2.width / 2) + ", " + (node2.y - node2.height / 2 - padding2) + ")"
+ );
+ } else {
+ el.attr("transform", "translate(" + node2.x + ", " + node2.y + ")");
+ }
+ return diff2;
+ }, "positionNode");
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js
- var Set2, Set_default;
- var init_Set = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js"() {
+ // src/internals.ts
+ var internalHelpers;
+ var init_internals = __esm({
+ "src/internals.ts"() {
"use strict";
- init_getNative();
- init_root();
- Set2 = getNative_default(root_default, "Set");
- Set_default = Set2;
+ init_config();
+ init_common();
+ init_logger();
+ init_clusters();
+ init_edges();
+ init_markers();
+ init_nodes2();
+ init_util();
+ init_utils2();
+ internalHelpers = {
+ common: common_default,
+ getConfig,
+ insertCluster,
+ insertEdge,
+ insertEdgeLabel,
+ insertMarkers: markers_default,
+ insertNode,
+ interpolateToCurve,
+ labelHelper,
+ log,
+ positionEdgeLabel
+ };
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js
- var mapTag2, objectTag3, promiseTag, setTag2, weakMapTag2, dataViewTag2, dataViewCtorString, mapCtorString, promiseCtorString, setCtorString, weakMapCtorString, getTag, getTag_default;
- var init_getTag = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js"() {
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js
+ function isSymbol(value2) {
+ return typeof value2 == "symbol" || isObjectLike_default(value2) && baseGetTag_default(value2) == symbolTag;
+ }
+ var symbolTag, isSymbol_default;
+ var init_isSymbol = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js"() {
"use strict";
- init_DataView();
- init_Map();
- init_Promise();
- init_Set();
- init_WeakMap();
init_baseGetTag();
- init_toSource();
- mapTag2 = "[object Map]";
- objectTag3 = "[object Object]";
- promiseTag = "[object Promise]";
- setTag2 = "[object Set]";
- weakMapTag2 = "[object WeakMap]";
- dataViewTag2 = "[object DataView]";
- dataViewCtorString = toSource_default(DataView_default);
- mapCtorString = toSource_default(Map_default);
- promiseCtorString = toSource_default(Promise_default);
- setCtorString = toSource_default(Set_default);
- weakMapCtorString = toSource_default(WeakMap_default);
- getTag = baseGetTag_default;
- if (DataView_default && getTag(new DataView_default(new ArrayBuffer(1))) != dataViewTag2 || Map_default && getTag(new Map_default()) != mapTag2 || Promise_default && getTag(Promise_default.resolve()) != promiseTag || Set_default && getTag(new Set_default()) != setTag2 || WeakMap_default && getTag(new WeakMap_default()) != weakMapTag2) {
- getTag = /* @__PURE__ */ __name(function(value2) {
- var result = baseGetTag_default(value2), Ctor = result == objectTag3 ? value2.constructor : void 0, ctorString = Ctor ? toSource_default(Ctor) : "";
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag2;
- case mapCtorString:
- return mapTag2;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag2;
- case weakMapCtorString:
- return weakMapTag2;
- }
- }
- return result;
- }, "getTag");
- }
- getTag_default = getTag;
+ init_isObjectLike();
+ symbolTag = "[object Symbol]";
+ __name(isSymbol, "isSymbol");
+ isSymbol_default = isSymbol;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js
- function initCloneArray(array4) {
- var length2 = array4.length, result = new array4.constructor(length2);
- if (length2 && typeof array4[0] == "string" && hasOwnProperty12.call(array4, "index")) {
- result.index = array4.index;
- result.input = array4.input;
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js
+ function arrayMap(array4, iteratee) {
+ var index = -1, length2 = array4 == null ? 0 : array4.length, result = Array(length2);
+ while (++index < length2) {
+ result[index] = iteratee(array4[index], index, array4);
}
return result;
}
- var objectProto15, hasOwnProperty12, initCloneArray_default;
- var init_initCloneArray = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js"() {
+ var arrayMap_default;
+ var init_arrayMap = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js"() {
"use strict";
- objectProto15 = Object.prototype;
- hasOwnProperty12 = objectProto15.hasOwnProperty;
- __name(initCloneArray, "initCloneArray");
- initCloneArray_default = initCloneArray;
+ __name(arrayMap, "arrayMap");
+ arrayMap_default = arrayMap;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer_default(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js
+ function baseToString(value2) {
+ if (typeof value2 == "string") {
+ return value2;
+ }
+ if (isArray_default(value2)) {
+ return arrayMap_default(value2, baseToString) + "";
+ }
+ if (isSymbol_default(value2)) {
+ return symbolToString ? symbolToString.call(value2) : "";
+ }
+ var result = value2 + "";
+ return result == "0" && 1 / value2 == -INFINITY ? "-0" : result;
}
- var cloneDataView_default;
- var init_cloneDataView = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js"() {
+ var INFINITY, symbolProto, symbolToString, baseToString_default;
+ var init_baseToString = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js"() {
"use strict";
- init_cloneArrayBuffer();
- __name(cloneDataView, "cloneDataView");
- cloneDataView_default = cloneDataView;
+ init_Symbol();
+ init_arrayMap();
+ init_isArray();
+ init_isSymbol();
+ INFINITY = 1 / 0;
+ symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
+ symbolToString = symbolProto ? symbolProto.toString : void 0;
+ __name(baseToString, "baseToString");
+ baseToString_default = baseToString;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js
- function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js
+ function trimmedEndIndex(string3) {
+ var index = string3.length;
+ while (index-- && reWhitespace.test(string3.charAt(index))) {
+ }
+ return index;
}
- var reFlags, cloneRegExp_default;
- var init_cloneRegExp = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js"() {
+ var reWhitespace, trimmedEndIndex_default;
+ var init_trimmedEndIndex = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js"() {
"use strict";
- reFlags = /\w*$/;
- __name(cloneRegExp, "cloneRegExp");
- cloneRegExp_default = cloneRegExp;
+ reWhitespace = /\s/;
+ __name(trimmedEndIndex, "trimmedEndIndex");
+ trimmedEndIndex_default = trimmedEndIndex;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js
+ function baseTrim(string3) {
+ return string3 ? string3.slice(0, trimmedEndIndex_default(string3) + 1).replace(reTrimStart, "") : string3;
}
- var symbolProto2, symbolValueOf, cloneSymbol_default;
- var init_cloneSymbol = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js"() {
+ var reTrimStart, baseTrim_default;
+ var init_baseTrim = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js"() {
"use strict";
- init_Symbol();
- symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0;
- symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0;
- __name(cloneSymbol, "cloneSymbol");
- cloneSymbol_default = cloneSymbol;
+ init_trimmedEndIndex();
+ reTrimStart = /^\s+/;
+ __name(baseTrim, "baseTrim");
+ baseTrim_default = baseTrim;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js
- function initCloneByTag(object3, tag2, isDeep) {
- var Ctor = object3.constructor;
- switch (tag2) {
- case arrayBufferTag2:
- return cloneArrayBuffer_default(object3);
- case boolTag2:
- case dateTag2:
- return new Ctor(+object3);
- case dataViewTag3:
- return cloneDataView_default(object3, isDeep);
- case float32Tag2:
- case float64Tag2:
- case int8Tag2:
- case int16Tag2:
- case int32Tag2:
- case uint8Tag2:
- case uint8ClampedTag2:
- case uint16Tag2:
- case uint32Tag2:
- return cloneTypedArray_default(object3, isDeep);
- case mapTag3:
- return new Ctor();
- case numberTag2:
- case stringTag2:
- return new Ctor(object3);
- case regexpTag2:
- return cloneRegExp_default(object3);
- case setTag3:
- return new Ctor();
- case symbolTag2:
- return cloneSymbol_default(object3);
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js
+ function toNumber(value2) {
+ if (typeof value2 == "number") {
+ return value2;
+ }
+ if (isSymbol_default(value2)) {
+ return NAN;
+ }
+ if (isObject_default(value2)) {
+ var other2 = typeof value2.valueOf == "function" ? value2.valueOf() : value2;
+ value2 = isObject_default(other2) ? other2 + "" : other2;
+ }
+ if (typeof value2 != "string") {
+ return value2 === 0 ? value2 : +value2;
}
+ value2 = baseTrim_default(value2);
+ var isBinary2 = reIsBinary.test(value2);
+ return isBinary2 || reIsOctal.test(value2) ? freeParseInt(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex.test(value2) ? NAN : +value2;
}
- var boolTag2, dateTag2, mapTag3, numberTag2, regexpTag2, setTag3, stringTag2, symbolTag2, arrayBufferTag2, dataViewTag3, float32Tag2, float64Tag2, int8Tag2, int16Tag2, int32Tag2, uint8Tag2, uint8ClampedTag2, uint16Tag2, uint32Tag2, initCloneByTag_default;
- var init_initCloneByTag = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js"() {
+ var NAN, reIsBadHex, reIsBinary, reIsOctal, freeParseInt, toNumber_default;
+ var init_toNumber = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js"() {
"use strict";
- init_cloneArrayBuffer();
- init_cloneDataView();
- init_cloneRegExp();
- init_cloneSymbol();
- init_cloneTypedArray();
- boolTag2 = "[object Boolean]";
- dateTag2 = "[object Date]";
- mapTag3 = "[object Map]";
- numberTag2 = "[object Number]";
- regexpTag2 = "[object RegExp]";
- setTag3 = "[object Set]";
- stringTag2 = "[object String]";
- symbolTag2 = "[object Symbol]";
- arrayBufferTag2 = "[object ArrayBuffer]";
- dataViewTag3 = "[object DataView]";
- float32Tag2 = "[object Float32Array]";
- float64Tag2 = "[object Float64Array]";
- int8Tag2 = "[object Int8Array]";
- int16Tag2 = "[object Int16Array]";
- int32Tag2 = "[object Int32Array]";
- uint8Tag2 = "[object Uint8Array]";
- uint8ClampedTag2 = "[object Uint8ClampedArray]";
- uint16Tag2 = "[object Uint16Array]";
- uint32Tag2 = "[object Uint32Array]";
- __name(initCloneByTag, "initCloneByTag");
- initCloneByTag_default = initCloneByTag;
+ init_baseTrim();
+ init_isObject();
+ init_isSymbol();
+ NAN = 0 / 0;
+ reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+ reIsBinary = /^0b[01]+$/i;
+ reIsOctal = /^0o[0-7]+$/i;
+ freeParseInt = parseInt;
+ __name(toNumber, "toNumber");
+ toNumber_default = toNumber;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js
- function baseIsMap(value2) {
- return isObjectLike_default(value2) && getTag_default(value2) == mapTag4;
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toFinite.js
+ function toFinite(value2) {
+ if (!value2) {
+ return value2 === 0 ? value2 : 0;
+ }
+ value2 = toNumber_default(value2);
+ if (value2 === INFINITY2 || value2 === -INFINITY2) {
+ var sign2 = value2 < 0 ? -1 : 1;
+ return sign2 * MAX_INTEGER;
+ }
+ return value2 === value2 ? value2 : 0;
}
- var mapTag4, baseIsMap_default;
- var init_baseIsMap = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js"() {
+ var INFINITY2, MAX_INTEGER, toFinite_default;
+ var init_toFinite = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toFinite.js"() {
"use strict";
- init_getTag();
- init_isObjectLike();
- mapTag4 = "[object Map]";
- __name(baseIsMap, "baseIsMap");
- baseIsMap_default = baseIsMap;
+ init_toNumber();
+ INFINITY2 = 1 / 0;
+ MAX_INTEGER = 17976931348623157e292;
+ __name(toFinite, "toFinite");
+ toFinite_default = toFinite;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js
- var nodeIsMap, isMap, isMap_default;
- var init_isMap = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js"() {
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toInteger.js
+ function toInteger(value2) {
+ var result = toFinite_default(value2), remainder = result % 1;
+ return result === result ? remainder ? result - remainder : result : 0;
+ }
+ var toInteger_default;
+ var init_toInteger = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toInteger.js"() {
"use strict";
- init_baseIsMap();
- init_baseUnary();
- init_nodeUtil();
- nodeIsMap = nodeUtil_default && nodeUtil_default.isMap;
- isMap = nodeIsMap ? baseUnary_default(nodeIsMap) : baseIsMap_default;
- isMap_default = isMap;
+ init_toFinite();
+ __name(toInteger, "toInteger");
+ toInteger_default = toInteger;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js
- function baseIsSet(value2) {
- return isObjectLike_default(value2) && getTag_default(value2) == setTag4;
- }
- var setTag4, baseIsSet_default;
- var init_baseIsSet = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js"() {
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js
+ var WeakMap, WeakMap_default;
+ var init_WeakMap = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js"() {
"use strict";
- init_getTag();
- init_isObjectLike();
- setTag4 = "[object Set]";
- __name(baseIsSet, "baseIsSet");
- baseIsSet_default = baseIsSet;
+ init_getNative();
+ init_root();
+ WeakMap = getNative_default(root_default, "WeakMap");
+ WeakMap_default = WeakMap;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js
- var nodeIsSet, isSet, isSet_default;
- var init_isSet = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js"() {
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js
+ function noop2() {
+ }
+ var noop_default2;
+ var init_noop2 = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js"() {
"use strict";
- init_baseIsSet();
- init_baseUnary();
- init_nodeUtil();
- nodeIsSet = nodeUtil_default && nodeUtil_default.isSet;
- isSet = nodeIsSet ? baseUnary_default(nodeIsSet) : baseIsSet_default;
- isSet_default = isSet;
+ __name(noop2, "noop");
+ noop_default2 = noop2;
}
});
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js
- function baseClone(value2, bitmask, customizer, key, object3, stack) {
- var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
- if (customizer) {
- result = object3 ? customizer(value2, key, object3, stack) : customizer(value2);
- }
- if (result !== void 0) {
- return result;
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js
+ function arrayEach(array4, iteratee) {
+ var index = -1, length2 = array4 == null ? 0 : array4.length;
+ while (++index < length2) {
+ if (iteratee(array4[index], index, array4) === false) {
+ break;
+ }
}
- if (!isObject_default(value2)) {
- return value2;
+ return array4;
+ }
+ var arrayEach_default;
+ var init_arrayEach = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js"() {
+ "use strict";
+ __name(arrayEach, "arrayEach");
+ arrayEach_default = arrayEach;
}
- var isArr = isArray_default(value2);
- if (isArr) {
- result = initCloneArray_default(value2);
- if (!isDeep) {
- return copyArray_default(value2, result);
- }
- } else {
- var tag2 = getTag_default(value2), isFunc = tag2 == funcTag3 || tag2 == genTag2;
- if (isBuffer_default(value2)) {
- return cloneBuffer_default(value2, isDeep);
- }
- if (tag2 == objectTag4 || tag2 == argsTag3 || isFunc && !object3) {
- result = isFlat || isFunc ? {} : initCloneObject_default(value2);
- if (!isDeep) {
- return isFlat ? copySymbolsIn_default(value2, baseAssignIn_default(result, value2)) : copySymbols_default(value2, baseAssign_default(result, value2));
- }
- } else {
- if (!cloneableTags[tag2]) {
- return object3 ? value2 : {};
- }
- result = initCloneByTag_default(value2, tag2, isDeep);
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js
+ function baseFindIndex(array4, predicate, fromIndex, fromRight) {
+ var length2 = array4.length, index = fromIndex + (fromRight ? 1 : -1);
+ while (fromRight ? index-- : ++index < length2) {
+ if (predicate(array4[index], index, array4)) {
+ return index;
}
}
- stack || (stack = new Stack_default());
- var stacked = stack.get(value2);
- if (stacked) {
- return stacked;
+ return -1;
+ }
+ var baseFindIndex_default;
+ var init_baseFindIndex = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js"() {
+ "use strict";
+ __name(baseFindIndex, "baseFindIndex");
+ baseFindIndex_default = baseFindIndex;
}
- stack.set(value2, result);
- if (isSet_default(value2)) {
- value2.forEach(function(subValue) {
- result.add(baseClone(subValue, bitmask, customizer, subValue, value2, stack));
- });
- } else if (isMap_default(value2)) {
- value2.forEach(function(subValue, key2) {
- result.set(key2, baseClone(subValue, bitmask, customizer, key2, value2, stack));
- });
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js
+ function baseIsNaN(value2) {
+ return value2 !== value2;
+ }
+ var baseIsNaN_default;
+ var init_baseIsNaN = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js"() {
+ "use strict";
+ __name(baseIsNaN, "baseIsNaN");
+ baseIsNaN_default = baseIsNaN;
}
- var keysFunc = isFull ? isFlat ? getAllKeysIn_default : getAllKeys_default : isFlat ? keysIn_default : keys_default;
- var props = isArr ? void 0 : keysFunc(value2);
- arrayEach_default(props || value2, function(subValue, key2) {
- if (props) {
- key2 = subValue;
- subValue = value2[key2];
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js
+ function strictIndexOf(array4, value2, fromIndex) {
+ var index = fromIndex - 1, length2 = array4.length;
+ while (++index < length2) {
+ if (array4[index] === value2) {
+ return index;
}
- assignValue_default(result, key2, baseClone(subValue, bitmask, customizer, key2, value2, stack));
- });
- return result;
+ }
+ return -1;
}
- var CLONE_DEEP_FLAG, CLONE_FLAT_FLAG, CLONE_SYMBOLS_FLAG, argsTag3, arrayTag2, boolTag3, dateTag3, errorTag2, funcTag3, genTag2, mapTag5, numberTag3, objectTag4, regexpTag3, setTag5, stringTag3, symbolTag3, weakMapTag3, arrayBufferTag3, dataViewTag4, float32Tag3, float64Tag3, int8Tag3, int16Tag3, int32Tag3, uint8Tag3, uint8ClampedTag3, uint16Tag3, uint32Tag3, cloneableTags, baseClone_default;
- var init_baseClone = __esm({
- "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js"() {
+ var strictIndexOf_default;
+ var init_strictIndexOf = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js"() {
"use strict";
- init_Stack();
- init_arrayEach();
- init_assignValue();
- init_baseAssign();
- init_baseAssignIn();
- init_cloneBuffer();
- init_copyArray();
- init_copySymbols();
- init_copySymbolsIn();
- init_getAllKeys();
- init_getAllKeysIn();
- init_getTag();
- init_initCloneArray();
- init_initCloneByTag();
- init_initCloneObject();
- init_isArray();
+ __name(strictIndexOf, "strictIndexOf");
+ strictIndexOf_default = strictIndexOf;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js
+ function baseIndexOf(array4, value2, fromIndex) {
+ return value2 === value2 ? strictIndexOf_default(array4, value2, fromIndex) : baseFindIndex_default(array4, baseIsNaN_default, fromIndex);
+ }
+ var baseIndexOf_default;
+ var init_baseIndexOf = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js"() {
+ "use strict";
+ init_baseFindIndex();
+ init_baseIsNaN();
+ init_strictIndexOf();
+ __name(baseIndexOf, "baseIndexOf");
+ baseIndexOf_default = baseIndexOf;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js
+ function arrayIncludes(array4, value2) {
+ var length2 = array4 == null ? 0 : array4.length;
+ return !!length2 && baseIndexOf_default(array4, value2, 0) > -1;
+ }
+ var arrayIncludes_default;
+ var init_arrayIncludes = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js"() {
+ "use strict";
+ init_baseIndexOf();
+ __name(arrayIncludes, "arrayIncludes");
+ arrayIncludes_default = arrayIncludes;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js
+ var nativeKeys, nativeKeys_default;
+ var init_nativeKeys = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js"() {
+ "use strict";
+ init_overArg();
+ nativeKeys = overArg_default(Object.keys, Object);
+ nativeKeys_default = nativeKeys;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js
+ function baseKeys(object3) {
+ if (!isPrototype_default(object3)) {
+ return nativeKeys_default(object3);
+ }
+ var result = [];
+ for (var key in Object(object3)) {
+ if (hasOwnProperty10.call(object3, key) && key != "constructor") {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+ var objectProto12, hasOwnProperty10, baseKeys_default;
+ var init_baseKeys = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js"() {
+ "use strict";
+ init_isPrototype();
+ init_nativeKeys();
+ objectProto12 = Object.prototype;
+ hasOwnProperty10 = objectProto12.hasOwnProperty;
+ __name(baseKeys, "baseKeys");
+ baseKeys_default = baseKeys;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js
+ function keys(object3) {
+ return isArrayLike_default(object3) ? arrayLikeKeys_default(object3) : baseKeys_default(object3);
+ }
+ var keys_default;
+ var init_keys = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js"() {
+ "use strict";
+ init_arrayLikeKeys();
+ init_baseKeys();
+ init_isArrayLike();
+ __name(keys, "keys");
+ keys_default = keys;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/assign.js
+ var objectProto13, hasOwnProperty11, assign, assign_default;
+ var init_assign = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/assign.js"() {
+ "use strict";
+ init_assignValue();
+ init_copyObject();
+ init_createAssigner();
+ init_isArrayLike();
+ init_isPrototype();
+ init_keys();
+ objectProto13 = Object.prototype;
+ hasOwnProperty11 = objectProto13.hasOwnProperty;
+ assign = createAssigner_default(function(object3, source) {
+ if (isPrototype_default(source) || isArrayLike_default(source)) {
+ copyObject_default(source, keys_default(source), object3);
+ return;
+ }
+ for (var key in source) {
+ if (hasOwnProperty11.call(source, key)) {
+ assignValue_default(object3, key, source[key]);
+ }
+ }
+ });
+ assign_default = assign;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js
+ function isKey(value2, object3) {
+ if (isArray_default(value2)) {
+ return false;
+ }
+ var type3 = typeof value2;
+ if (type3 == "number" || type3 == "symbol" || type3 == "boolean" || value2 == null || isSymbol_default(value2)) {
+ return true;
+ }
+ return reIsPlainProp.test(value2) || !reIsDeepProp.test(value2) || object3 != null && value2 in Object(object3);
+ }
+ var reIsDeepProp, reIsPlainProp, isKey_default;
+ var init_isKey = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js"() {
+ "use strict";
+ init_isArray();
+ init_isSymbol();
+ reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
+ reIsPlainProp = /^\w*$/;
+ __name(isKey, "isKey");
+ isKey_default = isKey;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js
+ function memoizeCapped(func) {
+ var result = memoize_default(func, function(key) {
+ if (cache3.size === MAX_MEMOIZE_SIZE) {
+ cache3.clear();
+ }
+ return key;
+ });
+ var cache3 = result.cache;
+ return result;
+ }
+ var MAX_MEMOIZE_SIZE, memoizeCapped_default;
+ var init_memoizeCapped = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js"() {
+ "use strict";
+ init_memoize();
+ MAX_MEMOIZE_SIZE = 500;
+ __name(memoizeCapped, "memoizeCapped");
+ memoizeCapped_default = memoizeCapped;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js
+ var rePropName, reEscapeChar, stringToPath, stringToPath_default;
+ var init_stringToPath = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js"() {
+ "use strict";
+ init_memoizeCapped();
+ rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
+ reEscapeChar = /\\(\\)?/g;
+ stringToPath = memoizeCapped_default(function(string3) {
+ var result = [];
+ if (string3.charCodeAt(0) === 46) {
+ result.push("");
+ }
+ string3.replace(rePropName, function(match2, number7, quote, subString) {
+ result.push(quote ? subString.replace(reEscapeChar, "$1") : number7 || match2);
+ });
+ return result;
+ });
+ stringToPath_default = stringToPath;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js
+ function toString2(value2) {
+ return value2 == null ? "" : baseToString_default(value2);
+ }
+ var toString_default;
+ var init_toString = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js"() {
+ "use strict";
+ init_baseToString();
+ __name(toString2, "toString");
+ toString_default = toString2;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js
+ function castPath(value2, object3) {
+ if (isArray_default(value2)) {
+ return value2;
+ }
+ return isKey_default(value2, object3) ? [value2] : stringToPath_default(toString_default(value2));
+ }
+ var castPath_default;
+ var init_castPath = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js"() {
+ "use strict";
+ init_isArray();
+ init_isKey();
+ init_stringToPath();
+ init_toString();
+ __name(castPath, "castPath");
+ castPath_default = castPath;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js
+ function toKey(value2) {
+ if (typeof value2 == "string" || isSymbol_default(value2)) {
+ return value2;
+ }
+ var result = value2 + "";
+ return result == "0" && 1 / value2 == -INFINITY3 ? "-0" : result;
+ }
+ var INFINITY3, toKey_default;
+ var init_toKey = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js"() {
+ "use strict";
+ init_isSymbol();
+ INFINITY3 = 1 / 0;
+ __name(toKey, "toKey");
+ toKey_default = toKey;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js
+ function baseGet(object3, path4) {
+ path4 = castPath_default(path4, object3);
+ var index = 0, length2 = path4.length;
+ while (object3 != null && index < length2) {
+ object3 = object3[toKey_default(path4[index++])];
+ }
+ return index && index == length2 ? object3 : void 0;
+ }
+ var baseGet_default;
+ var init_baseGet = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js"() {
+ "use strict";
+ init_castPath();
+ init_toKey();
+ __name(baseGet, "baseGet");
+ baseGet_default = baseGet;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js
+ function get3(object3, path4, defaultValue) {
+ var result = object3 == null ? void 0 : baseGet_default(object3, path4);
+ return result === void 0 ? defaultValue : result;
+ }
+ var get_default;
+ var init_get = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js"() {
+ "use strict";
+ init_baseGet();
+ __name(get3, "get");
+ get_default = get3;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js
+ function arrayPush2(array4, values2) {
+ var index = -1, length2 = values2.length, offset = array4.length;
+ while (++index < length2) {
+ array4[offset + index] = values2[index];
+ }
+ return array4;
+ }
+ var arrayPush_default;
+ var init_arrayPush = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js"() {
+ "use strict";
+ __name(arrayPush2, "arrayPush");
+ arrayPush_default = arrayPush2;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js
+ function isFlattenable(value2) {
+ return isArray_default(value2) || isArguments_default(value2) || !!(spreadableSymbol && value2 && value2[spreadableSymbol]);
+ }
+ var spreadableSymbol, isFlattenable_default;
+ var init_isFlattenable = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js"() {
+ "use strict";
+ init_Symbol();
+ init_isArguments();
+ init_isArray();
+ spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0;
+ __name(isFlattenable, "isFlattenable");
+ isFlattenable_default = isFlattenable;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js
+ function baseFlatten(array4, depth, predicate, isStrict, result) {
+ var index = -1, length2 = array4.length;
+ predicate || (predicate = isFlattenable_default);
+ result || (result = []);
+ while (++index < length2) {
+ var value2 = array4[index];
+ if (depth > 0 && predicate(value2)) {
+ if (depth > 1) {
+ baseFlatten(value2, depth - 1, predicate, isStrict, result);
+ } else {
+ arrayPush_default(result, value2);
+ }
+ } else if (!isStrict) {
+ result[result.length] = value2;
+ }
+ }
+ return result;
+ }
+ var baseFlatten_default;
+ var init_baseFlatten = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js"() {
+ "use strict";
+ init_arrayPush();
+ init_isFlattenable();
+ __name(baseFlatten, "baseFlatten");
+ baseFlatten_default = baseFlatten;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js
+ function flatten(array4) {
+ var length2 = array4 == null ? 0 : array4.length;
+ return length2 ? baseFlatten_default(array4, 1) : [];
+ }
+ var flatten_default;
+ var init_flatten = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js"() {
+ "use strict";
+ init_baseFlatten();
+ __name(flatten, "flatten");
+ flatten_default = flatten;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_flatRest.js
+ function flatRest(func) {
+ return setToString_default(overRest_default(func, void 0, flatten_default), func + "");
+ }
+ var flatRest_default;
+ var init_flatRest = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_flatRest.js"() {
+ "use strict";
+ init_flatten();
+ init_overRest();
+ init_setToString();
+ __name(flatRest, "flatRest");
+ flatRest_default = flatRest;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js
+ function baseSlice(array4, start3, end2) {
+ var index = -1, length2 = array4.length;
+ if (start3 < 0) {
+ start3 = -start3 > length2 ? 0 : length2 + start3;
+ }
+ end2 = end2 > length2 ? length2 : end2;
+ if (end2 < 0) {
+ end2 += length2;
+ }
+ length2 = start3 > end2 ? 0 : end2 - start3 >>> 0;
+ start3 >>>= 0;
+ var result = Array(length2);
+ while (++index < length2) {
+ result[index] = array4[index + start3];
+ }
+ return result;
+ }
+ var baseSlice_default;
+ var init_baseSlice = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js"() {
+ "use strict";
+ __name(baseSlice, "baseSlice");
+ baseSlice_default = baseSlice;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js
+ function hasUnicode(string3) {
+ return reHasUnicode.test(string3);
+ }
+ var rsAstralRange, rsComboMarksRange, reComboHalfMarksRange, rsComboSymbolsRange, rsComboRange, rsVarRange, rsZWJ, reHasUnicode, hasUnicode_default;
+ var init_hasUnicode = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js"() {
+ "use strict";
+ rsAstralRange = "\\ud800-\\udfff";
+ rsComboMarksRange = "\\u0300-\\u036f";
+ reComboHalfMarksRange = "\\ufe20-\\ufe2f";
+ rsComboSymbolsRange = "\\u20d0-\\u20ff";
+ rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
+ rsVarRange = "\\ufe0e\\ufe0f";
+ rsZWJ = "\\u200d";
+ reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
+ __name(hasUnicode, "hasUnicode");
+ hasUnicode_default = hasUnicode;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js
+ function arrayReduce(array4, iteratee, accumulator, initAccum) {
+ var index = -1, length2 = array4 == null ? 0 : array4.length;
+ if (initAccum && length2) {
+ accumulator = array4[++index];
+ }
+ while (++index < length2) {
+ accumulator = iteratee(accumulator, array4[index], index, array4);
+ }
+ return accumulator;
+ }
+ var arrayReduce_default;
+ var init_arrayReduce = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js"() {
+ "use strict";
+ __name(arrayReduce, "arrayReduce");
+ arrayReduce_default = arrayReduce;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js
+ function baseAssign(object3, source) {
+ return object3 && copyObject_default(source, keys_default(source), object3);
+ }
+ var baseAssign_default;
+ var init_baseAssign = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js"() {
+ "use strict";
+ init_copyObject();
+ init_keys();
+ __name(baseAssign, "baseAssign");
+ baseAssign_default = baseAssign;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js
+ function baseAssignIn(object3, source) {
+ return object3 && copyObject_default(source, keysIn_default(source), object3);
+ }
+ var baseAssignIn_default;
+ var init_baseAssignIn = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js"() {
+ "use strict";
+ init_copyObject();
+ init_keysIn();
+ __name(baseAssignIn, "baseAssignIn");
+ baseAssignIn_default = baseAssignIn;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js
+ function arrayFilter(array4, predicate) {
+ var index = -1, length2 = array4 == null ? 0 : array4.length, resIndex = 0, result = [];
+ while (++index < length2) {
+ var value2 = array4[index];
+ if (predicate(value2, index, array4)) {
+ result[resIndex++] = value2;
+ }
+ }
+ return result;
+ }
+ var arrayFilter_default;
+ var init_arrayFilter = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js"() {
+ "use strict";
+ __name(arrayFilter, "arrayFilter");
+ arrayFilter_default = arrayFilter;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js
+ function stubArray() {
+ return [];
+ }
+ var stubArray_default;
+ var init_stubArray = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js"() {
+ "use strict";
+ __name(stubArray, "stubArray");
+ stubArray_default = stubArray;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js
+ var objectProto14, propertyIsEnumerable2, nativeGetSymbols, getSymbols, getSymbols_default;
+ var init_getSymbols = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js"() {
+ "use strict";
+ init_arrayFilter();
+ init_stubArray();
+ objectProto14 = Object.prototype;
+ propertyIsEnumerable2 = objectProto14.propertyIsEnumerable;
+ nativeGetSymbols = Object.getOwnPropertySymbols;
+ getSymbols = !nativeGetSymbols ? stubArray_default : function(object3) {
+ if (object3 == null) {
+ return [];
+ }
+ object3 = Object(object3);
+ return arrayFilter_default(nativeGetSymbols(object3), function(symbol) {
+ return propertyIsEnumerable2.call(object3, symbol);
+ });
+ };
+ getSymbols_default = getSymbols;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js
+ function copySymbols(source, object3) {
+ return copyObject_default(source, getSymbols_default(source), object3);
+ }
+ var copySymbols_default;
+ var init_copySymbols = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js"() {
+ "use strict";
+ init_copyObject();
+ init_getSymbols();
+ __name(copySymbols, "copySymbols");
+ copySymbols_default = copySymbols;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js
+ var nativeGetSymbols2, getSymbolsIn, getSymbolsIn_default;
+ var init_getSymbolsIn = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js"() {
+ "use strict";
+ init_arrayPush();
+ init_getPrototype();
+ init_getSymbols();
+ init_stubArray();
+ nativeGetSymbols2 = Object.getOwnPropertySymbols;
+ getSymbolsIn = !nativeGetSymbols2 ? stubArray_default : function(object3) {
+ var result = [];
+ while (object3) {
+ arrayPush_default(result, getSymbols_default(object3));
+ object3 = getPrototype_default(object3);
+ }
+ return result;
+ };
+ getSymbolsIn_default = getSymbolsIn;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js
+ function copySymbolsIn(source, object3) {
+ return copyObject_default(source, getSymbolsIn_default(source), object3);
+ }
+ var copySymbolsIn_default;
+ var init_copySymbolsIn = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js"() {
+ "use strict";
+ init_copyObject();
+ init_getSymbolsIn();
+ __name(copySymbolsIn, "copySymbolsIn");
+ copySymbolsIn_default = copySymbolsIn;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js
+ function baseGetAllKeys(object3, keysFunc, symbolsFunc) {
+ var result = keysFunc(object3);
+ return isArray_default(object3) ? result : arrayPush_default(result, symbolsFunc(object3));
+ }
+ var baseGetAllKeys_default;
+ var init_baseGetAllKeys = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js"() {
+ "use strict";
+ init_arrayPush();
+ init_isArray();
+ __name(baseGetAllKeys, "baseGetAllKeys");
+ baseGetAllKeys_default = baseGetAllKeys;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js
+ function getAllKeys(object3) {
+ return baseGetAllKeys_default(object3, keys_default, getSymbols_default);
+ }
+ var getAllKeys_default;
+ var init_getAllKeys = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js"() {
+ "use strict";
+ init_baseGetAllKeys();
+ init_getSymbols();
+ init_keys();
+ __name(getAllKeys, "getAllKeys");
+ getAllKeys_default = getAllKeys;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js
+ function getAllKeysIn(object3) {
+ return baseGetAllKeys_default(object3, keysIn_default, getSymbolsIn_default);
+ }
+ var getAllKeysIn_default;
+ var init_getAllKeysIn = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js"() {
+ "use strict";
+ init_baseGetAllKeys();
+ init_getSymbolsIn();
+ init_keysIn();
+ __name(getAllKeysIn, "getAllKeysIn");
+ getAllKeysIn_default = getAllKeysIn;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js
+ var DataView2, DataView_default;
+ var init_DataView = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js"() {
+ "use strict";
+ init_getNative();
+ init_root();
+ DataView2 = getNative_default(root_default, "DataView");
+ DataView_default = DataView2;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js
+ var Promise2, Promise_default;
+ var init_Promise = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js"() {
+ "use strict";
+ init_getNative();
+ init_root();
+ Promise2 = getNative_default(root_default, "Promise");
+ Promise_default = Promise2;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js
+ var Set2, Set_default;
+ var init_Set = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js"() {
+ "use strict";
+ init_getNative();
+ init_root();
+ Set2 = getNative_default(root_default, "Set");
+ Set_default = Set2;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js
+ var mapTag2, objectTag3, promiseTag, setTag2, weakMapTag2, dataViewTag2, dataViewCtorString, mapCtorString, promiseCtorString, setCtorString, weakMapCtorString, getTag, getTag_default;
+ var init_getTag = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js"() {
+ "use strict";
+ init_DataView();
+ init_Map();
+ init_Promise();
+ init_Set();
+ init_WeakMap();
+ init_baseGetTag();
+ init_toSource();
+ mapTag2 = "[object Map]";
+ objectTag3 = "[object Object]";
+ promiseTag = "[object Promise]";
+ setTag2 = "[object Set]";
+ weakMapTag2 = "[object WeakMap]";
+ dataViewTag2 = "[object DataView]";
+ dataViewCtorString = toSource_default(DataView_default);
+ mapCtorString = toSource_default(Map_default);
+ promiseCtorString = toSource_default(Promise_default);
+ setCtorString = toSource_default(Set_default);
+ weakMapCtorString = toSource_default(WeakMap_default);
+ getTag = baseGetTag_default;
+ if (DataView_default && getTag(new DataView_default(new ArrayBuffer(1))) != dataViewTag2 || Map_default && getTag(new Map_default()) != mapTag2 || Promise_default && getTag(Promise_default.resolve()) != promiseTag || Set_default && getTag(new Set_default()) != setTag2 || WeakMap_default && getTag(new WeakMap_default()) != weakMapTag2) {
+ getTag = /* @__PURE__ */ __name(function(value2) {
+ var result = baseGetTag_default(value2), Ctor = result == objectTag3 ? value2.constructor : void 0, ctorString = Ctor ? toSource_default(Ctor) : "";
+ if (ctorString) {
+ switch (ctorString) {
+ case dataViewCtorString:
+ return dataViewTag2;
+ case mapCtorString:
+ return mapTag2;
+ case promiseCtorString:
+ return promiseTag;
+ case setCtorString:
+ return setTag2;
+ case weakMapCtorString:
+ return weakMapTag2;
+ }
+ }
+ return result;
+ }, "getTag");
+ }
+ getTag_default = getTag;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js
+ function initCloneArray(array4) {
+ var length2 = array4.length, result = new array4.constructor(length2);
+ if (length2 && typeof array4[0] == "string" && hasOwnProperty12.call(array4, "index")) {
+ result.index = array4.index;
+ result.input = array4.input;
+ }
+ return result;
+ }
+ var objectProto15, hasOwnProperty12, initCloneArray_default;
+ var init_initCloneArray = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js"() {
+ "use strict";
+ objectProto15 = Object.prototype;
+ hasOwnProperty12 = objectProto15.hasOwnProperty;
+ __name(initCloneArray, "initCloneArray");
+ initCloneArray_default = initCloneArray;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js
+ function cloneDataView(dataView, isDeep) {
+ var buffer = isDeep ? cloneArrayBuffer_default(dataView.buffer) : dataView.buffer;
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
+ }
+ var cloneDataView_default;
+ var init_cloneDataView = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js"() {
+ "use strict";
+ init_cloneArrayBuffer();
+ __name(cloneDataView, "cloneDataView");
+ cloneDataView_default = cloneDataView;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js
+ function cloneRegExp(regexp) {
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
+ result.lastIndex = regexp.lastIndex;
+ return result;
+ }
+ var reFlags, cloneRegExp_default;
+ var init_cloneRegExp = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js"() {
+ "use strict";
+ reFlags = /\w*$/;
+ __name(cloneRegExp, "cloneRegExp");
+ cloneRegExp_default = cloneRegExp;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js
+ function cloneSymbol(symbol) {
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
+ }
+ var symbolProto2, symbolValueOf, cloneSymbol_default;
+ var init_cloneSymbol = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js"() {
+ "use strict";
+ init_Symbol();
+ symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0;
+ symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0;
+ __name(cloneSymbol, "cloneSymbol");
+ cloneSymbol_default = cloneSymbol;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js
+ function initCloneByTag(object3, tag2, isDeep) {
+ var Ctor = object3.constructor;
+ switch (tag2) {
+ case arrayBufferTag2:
+ return cloneArrayBuffer_default(object3);
+ case boolTag2:
+ case dateTag2:
+ return new Ctor(+object3);
+ case dataViewTag3:
+ return cloneDataView_default(object3, isDeep);
+ case float32Tag2:
+ case float64Tag2:
+ case int8Tag2:
+ case int16Tag2:
+ case int32Tag2:
+ case uint8Tag2:
+ case uint8ClampedTag2:
+ case uint16Tag2:
+ case uint32Tag2:
+ return cloneTypedArray_default(object3, isDeep);
+ case mapTag3:
+ return new Ctor();
+ case numberTag2:
+ case stringTag2:
+ return new Ctor(object3);
+ case regexpTag2:
+ return cloneRegExp_default(object3);
+ case setTag3:
+ return new Ctor();
+ case symbolTag2:
+ return cloneSymbol_default(object3);
+ }
+ }
+ var boolTag2, dateTag2, mapTag3, numberTag2, regexpTag2, setTag3, stringTag2, symbolTag2, arrayBufferTag2, dataViewTag3, float32Tag2, float64Tag2, int8Tag2, int16Tag2, int32Tag2, uint8Tag2, uint8ClampedTag2, uint16Tag2, uint32Tag2, initCloneByTag_default;
+ var init_initCloneByTag = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js"() {
+ "use strict";
+ init_cloneArrayBuffer();
+ init_cloneDataView();
+ init_cloneRegExp();
+ init_cloneSymbol();
+ init_cloneTypedArray();
+ boolTag2 = "[object Boolean]";
+ dateTag2 = "[object Date]";
+ mapTag3 = "[object Map]";
+ numberTag2 = "[object Number]";
+ regexpTag2 = "[object RegExp]";
+ setTag3 = "[object Set]";
+ stringTag2 = "[object String]";
+ symbolTag2 = "[object Symbol]";
+ arrayBufferTag2 = "[object ArrayBuffer]";
+ dataViewTag3 = "[object DataView]";
+ float32Tag2 = "[object Float32Array]";
+ float64Tag2 = "[object Float64Array]";
+ int8Tag2 = "[object Int8Array]";
+ int16Tag2 = "[object Int16Array]";
+ int32Tag2 = "[object Int32Array]";
+ uint8Tag2 = "[object Uint8Array]";
+ uint8ClampedTag2 = "[object Uint8ClampedArray]";
+ uint16Tag2 = "[object Uint16Array]";
+ uint32Tag2 = "[object Uint32Array]";
+ __name(initCloneByTag, "initCloneByTag");
+ initCloneByTag_default = initCloneByTag;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js
+ function baseIsMap(value2) {
+ return isObjectLike_default(value2) && getTag_default(value2) == mapTag4;
+ }
+ var mapTag4, baseIsMap_default;
+ var init_baseIsMap = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js"() {
+ "use strict";
+ init_getTag();
+ init_isObjectLike();
+ mapTag4 = "[object Map]";
+ __name(baseIsMap, "baseIsMap");
+ baseIsMap_default = baseIsMap;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js
+ var nodeIsMap, isMap, isMap_default;
+ var init_isMap = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js"() {
+ "use strict";
+ init_baseIsMap();
+ init_baseUnary();
+ init_nodeUtil();
+ nodeIsMap = nodeUtil_default && nodeUtil_default.isMap;
+ isMap = nodeIsMap ? baseUnary_default(nodeIsMap) : baseIsMap_default;
+ isMap_default = isMap;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js
+ function baseIsSet(value2) {
+ return isObjectLike_default(value2) && getTag_default(value2) == setTag4;
+ }
+ var setTag4, baseIsSet_default;
+ var init_baseIsSet = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js"() {
+ "use strict";
+ init_getTag();
+ init_isObjectLike();
+ setTag4 = "[object Set]";
+ __name(baseIsSet, "baseIsSet");
+ baseIsSet_default = baseIsSet;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js
+ var nodeIsSet, isSet, isSet_default;
+ var init_isSet = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js"() {
+ "use strict";
+ init_baseIsSet();
+ init_baseUnary();
+ init_nodeUtil();
+ nodeIsSet = nodeUtil_default && nodeUtil_default.isSet;
+ isSet = nodeIsSet ? baseUnary_default(nodeIsSet) : baseIsSet_default;
+ isSet_default = isSet;
+ }
+ });
+
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js
+ function baseClone(value2, bitmask, customizer, key, object3, stack) {
+ var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
+ if (customizer) {
+ result = object3 ? customizer(value2, key, object3, stack) : customizer(value2);
+ }
+ if (result !== void 0) {
+ return result;
+ }
+ if (!isObject_default(value2)) {
+ return value2;
+ }
+ var isArr = isArray_default(value2);
+ if (isArr) {
+ result = initCloneArray_default(value2);
+ if (!isDeep) {
+ return copyArray_default(value2, result);
+ }
+ } else {
+ var tag2 = getTag_default(value2), isFunc = tag2 == funcTag3 || tag2 == genTag2;
+ if (isBuffer_default(value2)) {
+ return cloneBuffer_default(value2, isDeep);
+ }
+ if (tag2 == objectTag4 || tag2 == argsTag3 || isFunc && !object3) {
+ result = isFlat || isFunc ? {} : initCloneObject_default(value2);
+ if (!isDeep) {
+ return isFlat ? copySymbolsIn_default(value2, baseAssignIn_default(result, value2)) : copySymbols_default(value2, baseAssign_default(result, value2));
+ }
+ } else {
+ if (!cloneableTags[tag2]) {
+ return object3 ? value2 : {};
+ }
+ result = initCloneByTag_default(value2, tag2, isDeep);
+ }
+ }
+ stack || (stack = new Stack_default());
+ var stacked = stack.get(value2);
+ if (stacked) {
+ return stacked;
+ }
+ stack.set(value2, result);
+ if (isSet_default(value2)) {
+ value2.forEach(function(subValue) {
+ result.add(baseClone(subValue, bitmask, customizer, subValue, value2, stack));
+ });
+ } else if (isMap_default(value2)) {
+ value2.forEach(function(subValue, key2) {
+ result.set(key2, baseClone(subValue, bitmask, customizer, key2, value2, stack));
+ });
+ }
+ var keysFunc = isFull ? isFlat ? getAllKeysIn_default : getAllKeys_default : isFlat ? keysIn_default : keys_default;
+ var props = isArr ? void 0 : keysFunc(value2);
+ arrayEach_default(props || value2, function(subValue, key2) {
+ if (props) {
+ key2 = subValue;
+ subValue = value2[key2];
+ }
+ assignValue_default(result, key2, baseClone(subValue, bitmask, customizer, key2, value2, stack));
+ });
+ return result;
+ }
+ var CLONE_DEEP_FLAG, CLONE_FLAT_FLAG, CLONE_SYMBOLS_FLAG, argsTag3, arrayTag2, boolTag3, dateTag3, errorTag2, funcTag3, genTag2, mapTag5, numberTag3, objectTag4, regexpTag3, setTag5, stringTag3, symbolTag3, weakMapTag3, arrayBufferTag3, dataViewTag4, float32Tag3, float64Tag3, int8Tag3, int16Tag3, int32Tag3, uint8Tag3, uint8ClampedTag3, uint16Tag3, uint32Tag3, cloneableTags, baseClone_default;
+ var init_baseClone = __esm({
+ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js"() {
+ "use strict";
+ init_Stack();
+ init_arrayEach();
+ init_assignValue();
+ init_baseAssign();
+ init_baseAssignIn();
+ init_cloneBuffer();
+ init_copyArray();
+ init_copySymbols();
+ init_copySymbolsIn();
+ init_getAllKeys();
+ init_getAllKeysIn();
+ init_getTag();
+ init_initCloneArray();
+ init_initCloneByTag();
+ init_initCloneObject();
+ init_isArray();
init_isBuffer();
init_isMap();
init_isObject();
@@ -43933,7 +49488,7 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/clone.js
- function clone(value2) {
+ function clone2(value2) {
return baseClone_default(value2, CLONE_SYMBOLS_FLAG2);
}
var CLONE_SYMBOLS_FLAG2, clone_default2;
@@ -43942,8 +49497,8 @@ ${text2}
"use strict";
init_baseClone();
CLONE_SYMBOLS_FLAG2 = 4;
- __name(clone, "clone");
- clone_default2 = clone;
+ __name(clone2, "clone");
+ clone_default2 = clone2;
}
});
@@ -44066,23 +49621,23 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js
- function equalArrays(array4, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array4.length, othLength = other.length;
+ function equalArrays(array4, other2, bitmask, customizer, equalFunc, stack) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array4.length, othLength = other2.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
var arrStacked = stack.get(array4);
- var othStacked = stack.get(other);
+ var othStacked = stack.get(other2);
if (arrStacked && othStacked) {
- return arrStacked == other && othStacked == array4;
+ return arrStacked == other2 && othStacked == array4;
}
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache_default() : void 0;
- stack.set(array4, other);
- stack.set(other, array4);
+ stack.set(array4, other2);
+ stack.set(other2, array4);
while (++index < arrLength) {
- var arrValue = array4[index], othValue = other[index];
+ var arrValue = array4[index], othValue = other2[index];
if (customizer) {
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array4, stack) : customizer(arrValue, othValue, index, array4, other, stack);
+ var compared = isPartial ? customizer(othValue, arrValue, index, other2, array4, stack) : customizer(arrValue, othValue, index, array4, other2, stack);
}
if (compared !== void 0) {
if (compared) {
@@ -44092,7 +49647,7 @@ ${text2}
break;
}
if (seen) {
- if (!arraySome_default(other, function(othValue2, othIndex) {
+ if (!arraySome_default(other2, function(othValue2, othIndex) {
if (!cacheHas_default(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
@@ -44106,7 +49661,7 @@ ${text2}
}
}
stack["delete"](array4);
- stack["delete"](other);
+ stack["delete"](other2);
return result;
}
var COMPARE_PARTIAL_FLAG, COMPARE_UNORDERED_FLAG, equalArrays_default;
@@ -44158,48 +49713,48 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js
- function equalByTag(object3, other, tag2, bitmask, customizer, equalFunc, stack) {
+ function equalByTag(object3, other2, tag2, bitmask, customizer, equalFunc, stack) {
switch (tag2) {
case dataViewTag5:
- if (object3.byteLength != other.byteLength || object3.byteOffset != other.byteOffset) {
+ if (object3.byteLength != other2.byteLength || object3.byteOffset != other2.byteOffset) {
return false;
}
object3 = object3.buffer;
- other = other.buffer;
+ other2 = other2.buffer;
case arrayBufferTag4:
- if (object3.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object3), new Uint8Array_default(other))) {
+ if (object3.byteLength != other2.byteLength || !equalFunc(new Uint8Array_default(object3), new Uint8Array_default(other2))) {
return false;
}
return true;
case boolTag4:
case dateTag4:
case numberTag4:
- return eq_default(+object3, +other);
+ return eq_default(+object3, +other2);
case errorTag3:
- return object3.name == other.name && object3.message == other.message;
+ return object3.name == other2.name && object3.message == other2.message;
case regexpTag4:
case stringTag4:
- return object3 == other + "";
+ return object3 == other2 + "";
case mapTag6:
var convert = mapToArray_default;
case setTag6:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG2;
convert || (convert = setToArray_default);
- if (object3.size != other.size && !isPartial) {
+ if (object3.size != other2.size && !isPartial) {
return false;
}
var stacked = stack.get(object3);
if (stacked) {
- return stacked == other;
+ return stacked == other2;
}
bitmask |= COMPARE_UNORDERED_FLAG2;
- stack.set(object3, other);
- var result = equalArrays_default(convert(object3), convert(other), bitmask, customizer, equalFunc, stack);
+ stack.set(object3, other2);
+ var result = equalArrays_default(convert(object3), convert(other2), bitmask, customizer, equalFunc, stack);
stack["delete"](object3);
return result;
case symbolTag4:
if (symbolValueOf2) {
- return symbolValueOf2.call(object3) == symbolValueOf2.call(other);
+ return symbolValueOf2.call(object3) == symbolValueOf2.call(other2);
}
}
return false;
@@ -44235,32 +49790,32 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js
- function equalObjects(object3, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG3, objProps = getAllKeys_default(object3), objLength = objProps.length, othProps = getAllKeys_default(other), othLength = othProps.length;
+ function equalObjects(object3, other2, bitmask, customizer, equalFunc, stack) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG3, objProps = getAllKeys_default(object3), objLength = objProps.length, othProps = getAllKeys_default(other2), othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty13.call(other, key))) {
+ if (!(isPartial ? key in other2 : hasOwnProperty13.call(other2, key))) {
return false;
}
}
var objStacked = stack.get(object3);
- var othStacked = stack.get(other);
+ var othStacked = stack.get(other2);
if (objStacked && othStacked) {
- return objStacked == other && othStacked == object3;
+ return objStacked == other2 && othStacked == object3;
}
var result = true;
- stack.set(object3, other);
- stack.set(other, object3);
+ stack.set(object3, other2);
+ stack.set(other2, object3);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
- var objValue = object3[key], othValue = other[key];
+ var objValue = object3[key], othValue = other2[key];
if (customizer) {
- var compared = isPartial ? customizer(othValue, objValue, key, other, object3, stack) : customizer(objValue, othValue, key, object3, other, stack);
+ var compared = isPartial ? customizer(othValue, objValue, key, other2, object3, stack) : customizer(objValue, othValue, key, object3, other2, stack);
}
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
result = false;
@@ -44269,13 +49824,13 @@ ${text2}
skipCtor || (skipCtor = key == "constructor");
}
if (result && !skipCtor) {
- var objCtor = object3.constructor, othCtor = other.constructor;
- if (objCtor != othCtor && ("constructor" in object3 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
+ var objCtor = object3.constructor, othCtor = other2.constructor;
+ if (objCtor != othCtor && ("constructor" in object3 && "constructor" in other2) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
result = false;
}
}
stack["delete"](object3);
- stack["delete"](other);
+ stack["delete"](other2);
return result;
}
var COMPARE_PARTIAL_FLAG3, objectProto16, hasOwnProperty13, equalObjects_default;
@@ -44292,13 +49847,13 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js
- function baseIsEqualDeep(object3, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray_default(object3), othIsArr = isArray_default(other), objTag = objIsArr ? arrayTag3 : getTag_default(object3), othTag = othIsArr ? arrayTag3 : getTag_default(other);
+ function baseIsEqualDeep(object3, other2, bitmask, customizer, equalFunc, stack) {
+ var objIsArr = isArray_default(object3), othIsArr = isArray_default(other2), objTag = objIsArr ? arrayTag3 : getTag_default(object3), othTag = othIsArr ? arrayTag3 : getTag_default(other2);
objTag = objTag == argsTag4 ? objectTag5 : objTag;
othTag = othTag == argsTag4 ? objectTag5 : othTag;
var objIsObj = objTag == objectTag5, othIsObj = othTag == objectTag5, isSameTag = objTag == othTag;
if (isSameTag && isBuffer_default(object3)) {
- if (!isBuffer_default(other)) {
+ if (!isBuffer_default(other2)) {
return false;
}
objIsArr = true;
@@ -44306,12 +49861,12 @@ ${text2}
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack_default());
- return objIsArr || isTypedArray_default(object3) ? equalArrays_default(object3, other, bitmask, customizer, equalFunc, stack) : equalByTag_default(object3, other, objTag, bitmask, customizer, equalFunc, stack);
+ return objIsArr || isTypedArray_default(object3) ? equalArrays_default(object3, other2, bitmask, customizer, equalFunc, stack) : equalByTag_default(object3, other2, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG4)) {
- var objIsWrapped = objIsObj && hasOwnProperty14.call(object3, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty14.call(other, "__wrapped__");
+ var objIsWrapped = objIsObj && hasOwnProperty14.call(object3, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty14.call(other2, "__wrapped__");
if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object3.value() : object3, othUnwrapped = othIsWrapped ? other.value() : other;
+ var objUnwrapped = objIsWrapped ? object3.value() : object3, othUnwrapped = othIsWrapped ? other2.value() : other2;
stack || (stack = new Stack_default());
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
@@ -44320,7 +49875,7 @@ ${text2}
return false;
}
stack || (stack = new Stack_default());
- return equalObjects_default(object3, other, bitmask, customizer, equalFunc, stack);
+ return equalObjects_default(object3, other2, bitmask, customizer, equalFunc, stack);
}
var COMPARE_PARTIAL_FLAG4, argsTag4, arrayTag3, objectTag5, objectProto17, hasOwnProperty14, baseIsEqualDeep_default;
var init_baseIsEqualDeep = __esm({
@@ -44346,14 +49901,14 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js
- function baseIsEqual(value2, other, bitmask, customizer, stack) {
- if (value2 === other) {
+ function baseIsEqual(value2, other2, bitmask, customizer, stack) {
+ if (value2 === other2) {
return true;
}
- if (value2 == null || other == null || !isObjectLike_default(value2) && !isObjectLike_default(other)) {
- return value2 !== value2 && other !== other;
+ if (value2 == null || other2 == null || !isObjectLike_default(value2) && !isObjectLike_default(other2)) {
+ return value2 !== value2 && other2 !== other2;
}
- return baseIsEqualDeep_default(value2, other, bitmask, customizer, baseIsEqual, stack);
+ return baseIsEqualDeep_default(value2, other2, bitmask, customizer, baseIsEqual, stack);
}
var baseIsEqual_default;
var init_baseIsEqual = __esm({
@@ -44374,15 +49929,15 @@ ${text2}
}
object3 = Object(object3);
while (index--) {
- var data5 = matchData[index];
- if (noCustomizer && data5[2] ? data5[1] !== object3[data5[0]] : !(data5[0] in object3)) {
+ var data6 = matchData[index];
+ if (noCustomizer && data6[2] ? data6[1] !== object3[data6[0]] : !(data6[0] in object3)) {
return false;
}
}
while (++index < length2) {
- data5 = matchData[index];
- var key = data5[0], objValue = object3[key], srcValue = data5[1];
- if (noCustomizer && data5[2]) {
+ data6 = matchData[index];
+ var key = data6[0], objValue = object3[key], srcValue = data6[1];
+ if (noCustomizer && data6[2]) {
if (objValue === void 0 && !(key in object3)) {
return false;
}
@@ -45193,7 +50748,7 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/map.js
- function map2(collection4, iteratee) {
+ function map3(collection4, iteratee) {
var func = isArray_default(collection4) ? arrayMap_default : baseMap_default;
return func(collection4, baseIteratee_default(iteratee, 3));
}
@@ -45205,8 +50760,8 @@ ${text2}
init_baseIteratee();
init_baseMap();
init_isArray();
- __name(map2, "map");
- map_default = map2;
+ __name(map3, "map");
+ map_default = map3;
}
});
@@ -45277,8 +50832,8 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGt.js
- function baseGt(value2, other) {
- return value2 > other;
+ function baseGt(value2, other2) {
+ return value2 > other2;
}
var baseGt_default;
var init_baseGt = __esm({
@@ -45503,8 +51058,8 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseLt.js
- function baseLt(value2, other) {
- return value2 < other;
+ function baseLt(value2, other2) {
+ return value2 < other2;
}
var baseLt_default;
var init_baseLt = __esm({
@@ -45741,14 +51296,14 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareAscending.js
- function compareAscending(value2, other) {
- if (value2 !== other) {
+ function compareAscending(value2, other2) {
+ if (value2 !== other2) {
var valIsDefined = value2 !== void 0, valIsNull = value2 === null, valIsReflexive = value2 === value2, valIsSymbol = isSymbol_default(value2);
- var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol_default(other);
- if (!othIsNull && !othIsSymbol && !valIsSymbol && value2 > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
+ var othIsDefined = other2 !== void 0, othIsNull = other2 === null, othIsReflexive = other2 === other2, othIsSymbol = isSymbol_default(other2);
+ if (!othIsNull && !othIsSymbol && !valIsSymbol && value2 > other2 || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
return 1;
}
- if (!valIsNull && !valIsSymbol && !othIsSymbol && value2 < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
+ if (!valIsNull && !valIsSymbol && !othIsSymbol && value2 < other2 || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
return -1;
}
}
@@ -45765,8 +51320,8 @@ ${text2}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareMultiple.js
- function compareMultiple(object3, other, orders) {
- var index = -1, objCriteria = object3.criteria, othCriteria = other.criteria, length2 = objCriteria.length, ordersLength = orders.length;
+ function compareMultiple(object3, other2, orders) {
+ var index = -1, objCriteria = object3.criteria, othCriteria = other2.criteria, length2 = objCriteria.length, ordersLength = orders.length;
while (++index < length2) {
var result = compareAscending_default(objCriteria[index], othCriteria[index]);
if (result) {
@@ -45777,7 +51332,7 @@ ${text2}
return result * (order2 == "desc" ? -1 : 1);
}
}
- return object3.index - other.index;
+ return object3.index - other2.index;
}
var compareMultiple_default;
var init_compareMultiple = __esm({
@@ -45811,8 +51366,8 @@ ${text2}
});
return { "criteria": criteria, "index": ++index, "value": value2 };
});
- return baseSortBy_default(result, function(object3, other) {
- return compareMultiple_default(object3, other, orders);
+ return baseSortBy_default(result, function(object3, other2) {
+ return compareMultiple_default(object3, other2, orders);
});
}
var baseOrderBy_default;
@@ -46258,8 +51813,8 @@ ${text2}
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqueId.js
function uniqueId(prefix) {
- var id27 = ++idCounter;
- return toString_default(prefix) + id27;
+ var id29 = ++idCounter;
+ return toString_default(prefix) + id29;
}
var idCounter, uniqueId_default;
var init_uniqueId = __esm({
@@ -46366,7 +51921,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/graph.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/graph.js
function incrementOrInitEntry(map5, k2) {
if (map5[k2]) {
map5[k2]++;
@@ -46408,7 +51963,7 @@ ${text2}
}
var DEFAULT_EDGE_NAME, GRAPH_NODE, EDGE_KEY_DELIM, Graph;
var init_graph = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/graph.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/graph.js"() {
"use strict";
init_lodash();
DEFAULT_EDGE_NAME = "\0";
@@ -46419,9 +51974,9 @@ ${text2}
__name(this, "Graph");
}
constructor(opts = {}) {
- this._isDirected = has_default(opts, "directed") ? opts.directed : true;
- this._isMultigraph = has_default(opts, "multigraph") ? opts.multigraph : false;
- this._isCompound = has_default(opts, "compound") ? opts.compound : false;
+ this._isDirected = Object.prototype.hasOwnProperty.call(opts, "directed") ? opts.directed : true;
+ this._isMultigraph = Object.prototype.hasOwnProperty.call(opts, "multigraph") ? opts.multigraph : false;
+ this._isCompound = Object.prototype.hasOwnProperty.call(opts, "compound") ? opts.compound : false;
this._label = void 0;
this._defaultNodeLabelFn = constant_default6(void 0);
this._defaultEdgeLabelFn = constant_default6(void 0);
@@ -46494,7 +52049,7 @@ ${text2}
return this;
}
setNode(v3, value2) {
- if (has_default(this._nodes, v3)) {
+ if (Object.prototype.hasOwnProperty.call(this._nodes, v3)) {
if (arguments.length > 1) {
this._nodes[v3] = value2;
}
@@ -46517,20 +52072,17 @@ ${text2}
return this._nodes[v3];
}
hasNode(v3) {
- return has_default(this._nodes, v3);
+ return Object.prototype.hasOwnProperty.call(this._nodes, v3);
}
removeNode(v3) {
- var self2 = this;
- if (has_default(this._nodes, v3)) {
- var removeEdge = /* @__PURE__ */ __name(function(e3) {
- self2.removeEdge(self2._edgeObjs[e3]);
- }, "removeEdge");
+ if (Object.prototype.hasOwnProperty.call(this._nodes, v3)) {
+ var removeEdge = /* @__PURE__ */ __name((e3) => this.removeEdge(this._edgeObjs[e3]), "removeEdge");
delete this._nodes[v3];
if (this._isCompound) {
this._removeFromParentsChildList(v3);
delete this._parent[v3];
- forEach_default(this.children(v3), function(child) {
- self2.setParent(child);
+ forEach_default(this.children(v3), (child) => {
+ this.setParent(child);
});
delete this._children[v3];
}
@@ -46619,42 +52171,42 @@ ${text2}
return neighbors.length === 0;
}
filterNodes(filter6) {
- var copy6 = new this.constructor({
+ var copy5 = new this.constructor({
directed: this._isDirected,
multigraph: this._isMultigraph,
compound: this._isCompound
});
- copy6.setGraph(this.graph());
+ copy5.setGraph(this.graph());
var self2 = this;
forEach_default(this._nodes, function(value2, v3) {
if (filter6(v3)) {
- copy6.setNode(v3, value2);
+ copy5.setNode(v3, value2);
}
});
forEach_default(this._edgeObjs, function(e3) {
- if (copy6.hasNode(e3.v) && copy6.hasNode(e3.w)) {
- copy6.setEdge(e3, self2.edge(e3));
+ if (copy5.hasNode(e3.v) && copy5.hasNode(e3.w)) {
+ copy5.setEdge(e3, self2.edge(e3));
}
});
- var parents4 = {};
+ var parents3 = {};
function findParent(v3) {
var parent4 = self2.parent(v3);
- if (parent4 === void 0 || copy6.hasNode(parent4)) {
- parents4[v3] = parent4;
+ if (parent4 === void 0 || copy5.hasNode(parent4)) {
+ parents3[v3] = parent4;
return parent4;
- } else if (parent4 in parents4) {
- return parents4[parent4];
+ } else if (parent4 in parents3) {
+ return parents3[parent4];
} else {
return findParent(parent4);
}
}
__name(findParent, "findParent");
if (this._isCompound) {
- forEach_default(copy6.nodes(), function(v3) {
- copy6.setParent(v3, findParent(v3));
+ forEach_default(copy5.nodes(), function(v3) {
+ copy5.setParent(v3, findParent(v3));
});
}
- return copy6;
+ return copy5;
}
/* === Edge functions ========== */
setDefaultEdgeLabel(newDefault) {
@@ -46714,7 +52266,7 @@ ${text2}
name = "" + name;
}
var e3 = edgeArgsToId(this._isDirected, v3, w3, name);
- if (has_default(this._edgeLabels, e3)) {
+ if (Object.prototype.hasOwnProperty.call(this._edgeLabels, e3)) {
if (valueSpecified) {
this._edgeLabels[e3] = value2;
}
@@ -46744,7 +52296,7 @@ ${text2}
}
hasEdge(v3, w3, name) {
var e3 = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v3, w3, name);
- return has_default(this._edgeLabels, e3);
+ return Object.prototype.hasOwnProperty.call(this._edgeLabels, e3);
}
removeEdge(v3, w3, name) {
var e3 = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v3, w3, name);
@@ -46765,11 +52317,11 @@ ${text2}
inEdges(v3, u2) {
var inV = this._in[v3];
if (inV) {
- var edges5 = values_default(inV);
+ var edges3 = values_default(inV);
if (!u2) {
- return edges5;
+ return edges3;
}
- return filter_default3(edges5, function(edge) {
+ return filter_default3(edges3, function(edge) {
return edge.v === u2;
});
}
@@ -46777,11 +52329,11 @@ ${text2}
outEdges(v3, w3) {
var outV = this._out[v3];
if (outV) {
- var edges5 = values_default(outV);
+ var edges3 = values_default(outV);
if (!w3) {
- return edges5;
+ return edges3;
}
- return filter_default3(edges5, function(edge) {
+ return filter_default3(edges3, function(edge) {
return edge.w === w3;
});
}
@@ -46803,15 +52355,15 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/index.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/index.js
var init_graphlib = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/index.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/index.js"() {
"use strict";
init_graph();
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/data/list.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/data/list.js
function unlink(entry) {
entry._prev._next = entry._next;
entry._next._prev = entry._prev;
@@ -46825,7 +52377,7 @@ ${text2}
}
var List;
var init_list = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/data/list.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/data/list.js"() {
"use strict";
List = class {
static {
@@ -46870,13 +52422,13 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/greedy-fas.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/greedy-fas.js
function greedyFAS(g2, weightFn) {
if (g2.nodeCount() <= 1) {
return [];
}
- var state5 = buildState(g2, weightFn || DEFAULT_WEIGHT_FN);
- var results = doGreedyFAS(state5.graph, state5.buckets, state5.zeroIdx);
+ var state4 = buildState(g2, weightFn || DEFAULT_WEIGHT_FN);
+ var results = doGreedyFAS(state4.graph, state4.buckets, state4.zeroIdx);
return flatten_default(
map_default(results, function(e3) {
return g2.outEdges(e3.v, e3.w);
@@ -46963,7 +52515,7 @@ ${text2}
}
var DEFAULT_WEIGHT_FN;
var init_greedy_fas = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/greedy-fas.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/greedy-fas.js"() {
"use strict";
init_lodash();
init_graphlib();
@@ -46977,7 +52529,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/acyclic.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/acyclic.js
function run(g2) {
var fas = g2.graph().acyclicer === "greedy" ? greedyFAS(g2, weightFn(g2)) : dfsFAS(g2);
forEach_default(fas, function(e3) {
@@ -46999,13 +52551,13 @@ ${text2}
var stack = {};
var visited = {};
function dfs3(v3) {
- if (has_default(visited, v3)) {
+ if (Object.prototype.hasOwnProperty.call(visited, v3)) {
return;
}
visited[v3] = true;
stack[v3] = true;
forEach_default(g2.outEdges(v3), function(e3) {
- if (has_default(stack, e3.w)) {
+ if (Object.prototype.hasOwnProperty.call(stack, e3.w)) {
fas.push(e3);
} else {
dfs3(e3.w);
@@ -47030,7 +52582,7 @@ ${text2}
});
}
var init_acyclic = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/acyclic.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/acyclic.js"() {
"use strict";
init_lodash();
init_greedy_fas();
@@ -47040,7 +52592,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/util.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/util.js
function addDummyNode(g2, type3, attrs, name) {
var v3;
do {
@@ -47077,13 +52629,13 @@ ${text2}
});
return simplified;
}
- function intersectRect3(rect4, point8) {
- var x5 = rect4.x;
- var y5 = rect4.y;
+ function intersectRect2(rect3, point8) {
+ var x5 = rect3.x;
+ var y5 = rect3.y;
var dx = point8.x - x5;
var dy = point8.y - y5;
- var w3 = rect4.width / 2;
- var h2 = rect4.height / 2;
+ var w3 = rect3.width / 2;
+ var h2 = rect3.height / 2;
if (!dx && !dy) {
throw new Error("Not possible to find intersection inside of the rectangle");
}
@@ -47198,15 +52750,15 @@ ${text2}
function notime(name, fn3) {
return fn3();
}
- var init_util3 = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/util.js"() {
+ var init_util2 = __esm({
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/util.js"() {
"use strict";
init_lodash();
init_graphlib();
__name(addDummyNode, "addDummyNode");
__name(simplify, "simplify");
__name(asNonCompoundGraph, "asNonCompoundGraph");
- __name(intersectRect3, "intersectRect");
+ __name(intersectRect2, "intersectRect");
__name(buildLayerMatrix, "buildLayerMatrix");
__name(normalizeRanks, "normalizeRanks");
__name(removeEmptyRanks, "removeEmptyRanks");
@@ -47218,7 +52770,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/add-border-segments.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/add-border-segments.js
function addBorderSegments(g2) {
function dfs3(v3) {
var children2 = g2.children(v3);
@@ -47226,7 +52778,7 @@ ${text2}
if (children2.length) {
forEach_default(children2, dfs3);
}
- if (has_default(node2, "minRank")) {
+ if (Object.prototype.hasOwnProperty.call(node2, "minRank")) {
node2.borderLeft = [];
node2.borderRight = [];
for (var rank2 = node2.minRank, maxRank2 = node2.maxRank + 1; rank2 < maxRank2; ++rank2) {
@@ -47249,16 +52801,16 @@ ${text2}
}
}
var init_add_border_segments = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/add-border-segments.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/add-border-segments.js"() {
"use strict";
init_lodash();
- init_util3();
+ init_util2();
__name(addBorderSegments, "addBorderSegments");
__name(addBorderNode2, "addBorderNode");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/coordinate-system.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/coordinate-system.js
function adjust2(g2) {
var rankDir = g2.graph().rankdir.toLowerCase();
if (rankDir === "lr" || rankDir === "rl") {
@@ -47295,7 +52847,7 @@ ${text2}
forEach_default(g2.edges(), function(e3) {
var edge = g2.edge(e3);
forEach_default(edge.points, reverseYOne);
- if (has_default(edge, "y")) {
+ if (Object.prototype.hasOwnProperty.call(edge, "y")) {
reverseYOne(edge);
}
});
@@ -47310,7 +52862,7 @@ ${text2}
forEach_default(g2.edges(), function(e3) {
var edge = g2.edge(e3);
forEach_default(edge.points, swapXYOne);
- if (has_default(edge, "x")) {
+ if (Object.prototype.hasOwnProperty.call(edge, "x")) {
swapXYOne(edge);
}
});
@@ -47321,7 +52873,7 @@ ${text2}
attrs.y = x5;
}
var init_coordinate_system = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/coordinate-system.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/coordinate-system.js"() {
"use strict";
init_lodash();
__name(adjust2, "adjust");
@@ -47335,7 +52887,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/normalize.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/normalize.js
function run2(g2) {
g2.graph().dummyChains = [];
forEach_default(g2.edges(), function(edge) {
@@ -47352,7 +52904,8 @@ ${text2}
var labelRank = edgeLabel.labelRank;
if (wRank === vRank + 1) return;
g2.removeEdge(e3);
- var dummy, attrs, i2;
+ var attrs = void 0;
+ var dummy, i2;
for (i2 = 0, ++vRank; vRank < wRank; ++i2, ++vRank) {
edgeLabel.points = [];
attrs = {
@@ -47399,22 +52952,22 @@ ${text2}
});
}
var init_normalize = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/normalize.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/normalize.js"() {
"use strict";
init_lodash();
- init_util3();
+ init_util2();
__name(run2, "run");
__name(normalizeEdge, "normalizeEdge");
__name(undo3, "undo");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/util.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/rank/util.js
function longestPath(g2) {
var visited = {};
function dfs3(v3) {
var label = g2.node(v3);
- if (has_default(visited, v3)) {
+ if (Object.prototype.hasOwnProperty.call(visited, v3)) {
return label.rank;
}
visited[v3] = true;
@@ -47436,8 +52989,8 @@ ${text2}
function slack(g2, e3) {
return g2.node(e3.w).rank - g2.node(e3.v).rank - g2.edge(e3).minlen;
}
- var init_util4 = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/util.js"() {
+ var init_util3 = __esm({
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/rank/util.js"() {
"use strict";
init_lodash();
__name(longestPath, "longestPath");
@@ -47445,7 +52998,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js
function feasibleTree(g2) {
var t4 = new Graph({ directed: false });
var start3 = g2.nodes()[0];
@@ -47487,11 +53040,11 @@ ${text2}
});
}
var init_feasible_tree = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js"() {
"use strict";
init_lodash();
init_graphlib();
- init_util4();
+ init_util3();
__name(feasibleTree, "feasibleTree");
__name(tightTree, "tightTree");
__name(findMinSlackEdge, "findMinSlackEdge");
@@ -47499,24 +53052,24 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/components.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/components.js
var init_components = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/components.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/components.js"() {
"use strict";
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js
var init_priority_queue = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js"() {
"use strict";
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js
var DEFAULT_WEIGHT_FUNC;
var init_dijkstra = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js"() {
"use strict";
init_lodash();
init_priority_queue();
@@ -47524,49 +53077,49 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra-all.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra-all.js
var init_dijkstra_all = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra-all.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra-all.js"() {
"use strict";
init_dijkstra();
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js
var init_tarjan = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js"() {
"use strict";
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/find-cycles.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/find-cycles.js
var init_find_cycles = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/find-cycles.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/find-cycles.js"() {
"use strict";
init_tarjan();
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/floyd-warshall.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/floyd-warshall.js
var DEFAULT_WEIGHT_FUNC2;
var init_floyd_warshall = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/floyd-warshall.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/floyd-warshall.js"() {
"use strict";
init_lodash();
DEFAULT_WEIGHT_FUNC2 = constant_default6(1);
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js
function topsort(g2) {
var visited = {};
var stack = {};
var results = [];
function visit(node2) {
- if (has_default(stack, node2)) {
+ if (Object.prototype.hasOwnProperty.call(stack, node2)) {
throw new CycleException();
}
- if (!has_default(visited, node2)) {
+ if (!Object.prototype.hasOwnProperty.call(visited, node2)) {
stack[node2] = true;
visited[node2] = true;
forEach_default(g2.predecessors(node2), visit);
@@ -47584,7 +53137,7 @@ ${text2}
function CycleException() {
}
var init_topsort = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js"() {
"use strict";
init_lodash();
topsort.CycleException = CycleException;
@@ -47594,15 +53147,15 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/is-acyclic.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/is-acyclic.js
var init_is_acyclic = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/is-acyclic.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/is-acyclic.js"() {
"use strict";
init_topsort();
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js
function dfs(g2, vs, order2) {
if (!isArray_default(vs)) {
vs = [vs];
@@ -47619,7 +53172,7 @@ ${text2}
return acc;
}
function doDfs(g2, v3, postorder3, visited, navigation, acc) {
- if (!has_default(visited, v3)) {
+ if (!Object.prototype.hasOwnProperty.call(visited, v3)) {
visited[v3] = true;
if (!postorder3) {
acc.push(v3);
@@ -47633,7 +53186,7 @@ ${text2}
}
}
var init_dfs = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js"() {
"use strict";
init_lodash();
__name(dfs, "dfs");
@@ -47641,42 +53194,42 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js
function postorder(g2, vs) {
return dfs(g2, vs, "post");
}
var init_postorder = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js"() {
"use strict";
init_dfs();
__name(postorder, "postorder");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js
function preorder(g2, vs) {
return dfs(g2, vs, "pre");
}
var init_preorder = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js"() {
"use strict";
init_dfs();
__name(preorder, "preorder");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/prim.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/prim.js
var init_prim = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/prim.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/prim.js"() {
"use strict";
init_priority_queue();
init_graph();
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/index.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/index.js
var init_alg = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/index.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/alg/index.js"() {
"use strict";
init_components();
init_dijkstra();
@@ -47692,17 +53245,17 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js
function networkSimplex(g2) {
g2 = simplify(g2);
longestPath(g2);
var t4 = feasibleTree(g2);
initLowLimValues(t4);
initCutValues(t4, g2);
- var e3, f3;
+ var e3, f2;
while (e3 = leaveEdge(t4)) {
- f3 = enterEdge(t4, g2, e3);
- exchangeEdges(t4, g2, e3, f3);
+ f2 = enterEdge(t4, g2, e3);
+ exchangeEdges(t4, g2, e3, f2);
}
}
function initCutValues(t4, g2) {
@@ -47729,12 +53282,12 @@ ${text2}
}
cutValue = graphEdge.weight;
forEach_default(g2.nodeEdges(child), function(e3) {
- var isOutEdge = e3.v === child, other = isOutEdge ? e3.w : e3.v;
- if (other !== parent4) {
+ var isOutEdge = e3.v === child, other2 = isOutEdge ? e3.w : e3.v;
+ if (other2 !== parent4) {
var pointsToHead = isOutEdge === childIsTail, otherWeight = g2.edge(e3).weight;
cutValue += pointsToHead ? otherWeight : -otherWeight;
- if (isTreeEdge(t4, child, other)) {
- var otherCutValue = t4.edge(child, other).cutvalue;
+ if (isTreeEdge(t4, child, other2)) {
+ var otherCutValue = t4.edge(child, other2).cutvalue;
cutValue += pointsToHead ? -otherCutValue : otherCutValue;
}
}
@@ -47752,7 +53305,7 @@ ${text2}
var label = tree.node(v3);
visited[v3] = true;
forEach_default(tree.neighbors(v3), function(w3) {
- if (!has_default(visited, w3)) {
+ if (!Object.prototype.hasOwnProperty.call(visited, w3)) {
nextLim = dfsAssignLowLim(tree, visited, nextLim, w3, v3);
}
});
@@ -47792,11 +53345,11 @@ ${text2}
return slack(g2, edge2);
});
}
- function exchangeEdges(t4, g2, e3, f3) {
+ function exchangeEdges(t4, g2, e3, f2) {
var v3 = e3.v;
var w3 = e3.w;
t4.removeEdge(v3, w3);
- t4.setEdge(f3.v, f3.w, {});
+ t4.setEdge(f2.v, f2.w, {});
initLowLimValues(t4);
initCutValues(t4, g2);
updateRanks(t4, g2);
@@ -47823,13 +53376,13 @@ ${text2}
return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;
}
var init_network_simplex = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js"() {
"use strict";
init_lodash();
init_alg();
- init_util3();
+ init_util2();
init_feasible_tree();
- init_util4();
+ init_util3();
networkSimplex.initLowLimValues = initLowLimValues;
networkSimplex.initCutValues = initCutValues;
networkSimplex.calcCutValue = calcCutValue;
@@ -47851,7 +53404,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/index.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/rank/index.js
function rank(g2) {
switch (g2.graph().ranker) {
case "network-simplex":
@@ -47876,11 +53429,11 @@ ${text2}
}
var longestPathRanker;
var init_rank = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/index.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/rank/index.js"() {
"use strict";
init_feasible_tree();
init_network_simplex();
- init_util4();
+ init_util3();
__name(rank, "rank");
longestPathRanker = longestPath;
__name(tightTreeRanker, "tightTreeRanker");
@@ -47888,7 +53441,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/nesting-graph.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/nesting-graph.js
function run3(g2) {
var root4 = addDummyNode(g2, "root", {}, "_root");
var depths = treeDepths(g2);
@@ -47979,10 +53532,10 @@ ${text2}
});
}
var init_nesting_graph = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/nesting-graph.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/nesting-graph.js"() {
"use strict";
init_lodash();
- init_util3();
+ init_util2();
__name(run3, "run");
__name(dfs2, "dfs");
__name(treeDepths, "treeDepths");
@@ -47991,7 +53544,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js
function addSubgraphConstraints(g2, cg, vs) {
var prev2 = {}, rootPrev;
forEach_default(vs, function(v3) {
@@ -48014,14 +53567,14 @@ ${text2}
});
}
var init_add_subgraph_constraints = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js"() {
"use strict";
init_lodash();
__name(addSubgraphConstraints, "addSubgraphConstraints");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js
function buildLayerGraph(g2, rank2, relationship) {
var root4 = createRootNode(g2), result = new Graph({ compound: true }).setGraph({ root: root4 }).setDefaultNodeLabel(function(v3) {
return g2.node(v3);
@@ -48035,7 +53588,7 @@ ${text2}
var u2 = e3.v === v3 ? e3.w : e3.v, edge = result.edge(u2, v3), weight8 = !isUndefined_default(edge) ? edge.weight : 0;
result.setEdge(u2, v3, { weight: g2.edge(e3).weight + weight8 });
});
- if (has_default(node2, "minRank")) {
+ if (Object.prototype.hasOwnProperty.call(node2, "minRank")) {
result.setNode(v3, {
borderLeft: node2.borderLeft[rank2],
borderRight: node2.borderRight[rank2]
@@ -48051,7 +53604,7 @@ ${text2}
return v3;
}
var init_build_layer_graph = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js"() {
"use strict";
init_lodash();
init_graphlib();
@@ -48060,7 +53613,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/cross-count.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/cross-count.js
function crossCount(g2, layering) {
var cc2 = 0;
for (var i2 = 1; i2 < layering.length; ++i2) {
@@ -48112,7 +53665,7 @@ ${text2}
return cc2;
}
var init_cross_count = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/cross-count.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/cross-count.js"() {
"use strict";
init_lodash();
__name(crossCount, "crossCount");
@@ -48120,7 +53673,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/init-order.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/init-order.js
function initOrder(g2) {
var visited = {};
var simpleNodes = filter_default3(g2.nodes(), function(v3) {
@@ -48149,14 +53702,14 @@ ${text2}
return layers;
}
var init_init_order = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/init-order.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/init-order.js"() {
"use strict";
init_lodash();
__name(initOrder, "initOrder");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/barycenter.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/barycenter.js
function barycenter(g2, movable) {
return map_default(movable, function(v3) {
var inV = g2.inEdges(v3);
@@ -48183,17 +53736,17 @@ ${text2}
});
}
var init_barycenter = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/barycenter.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/barycenter.js"() {
"use strict";
init_lodash();
__name(barycenter, "barycenter");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js
- function resolveConflicts(entries, cg) {
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js
+ function resolveConflicts(entries2, cg) {
var mappedEntries = {};
- forEach_default(entries, function(entry, i2) {
+ forEach_default(entries2, function(entry, i2) {
var tmp = mappedEntries[entry.v] = {
indegree: 0,
in: [],
@@ -48220,7 +53773,7 @@ ${text2}
return doResolveConflicts(sourceSet);
}
function doResolveConflicts(sourceSet) {
- var entries = [];
+ var entries2 = [];
function handleIn(vEntry) {
return function(uEntry) {
if (uEntry.merged) {
@@ -48243,12 +53796,12 @@ ${text2}
__name(handleOut, "handleOut");
while (sourceSet.length) {
var entry = sourceSet.pop();
- entries.push(entry);
+ entries2.push(entry);
forEach_default(entry["in"].reverse(), handleIn(entry));
forEach_default(entry.out, handleOut(entry));
}
return map_default(
- filter_default3(entries, function(entry2) {
+ filter_default3(entries2, function(entry2) {
return !entry2.merged;
}),
function(entry2) {
@@ -48274,7 +53827,7 @@ ${text2}
source.merged = true;
}
var init_resolve_conflicts = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js"() {
"use strict";
init_lodash();
__name(resolveConflicts, "resolveConflicts");
@@ -48283,10 +53836,10 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/sort.js
- function sort(entries, biasRight) {
- var parts = partition(entries, function(entry) {
- return has_default(entry, "barycenter");
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/sort.js
+ function sort(entries2, biasRight) {
+ var parts = partition(entries2, function(entry) {
+ return Object.prototype.hasOwnProperty.call(entry, "barycenter");
});
var sortable = parts.lhs, unsortable = sortBy_default(parts.rhs, function(entry) {
return -entry.i;
@@ -48327,17 +53880,17 @@ ${text2}
};
}
var init_sort2 = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/sort.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/sort.js"() {
"use strict";
init_lodash();
- init_util3();
+ init_util2();
__name(sort, "sort");
__name(consumeUnsortable, "consumeUnsortable");
__name(compareWithBias, "compareWithBias");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js
function sortSubgraph(g2, v3, cg, biasRight) {
var movable = g2.children(v3);
var node2 = g2.node(v3);
@@ -48354,19 +53907,19 @@ ${text2}
if (g2.children(entry.v).length) {
var subgraphResult = sortSubgraph(g2, entry.v, cg, biasRight);
subgraphs[entry.v] = subgraphResult;
- if (has_default(subgraphResult, "barycenter")) {
+ if (Object.prototype.hasOwnProperty.call(subgraphResult, "barycenter")) {
mergeBarycenters(entry, subgraphResult);
}
}
});
- var entries = resolveConflicts(barycenters, cg);
- expandSubgraphs(entries, subgraphs);
- var result = sort(entries, biasRight);
+ var entries2 = resolveConflicts(barycenters, cg);
+ expandSubgraphs(entries2, subgraphs);
+ var result = sort(entries2, biasRight);
if (bl) {
result.vs = flatten_default([bl, result.vs, br2]);
if (g2.predecessors(bl).length) {
var blPred = g2.node(g2.predecessors(bl)[0]), brPred = g2.node(g2.predecessors(br2)[0]);
- if (!has_default(result, "barycenter")) {
+ if (!Object.prototype.hasOwnProperty.call(result, "barycenter")) {
result.barycenter = 0;
result.weight = 0;
}
@@ -48376,8 +53929,8 @@ ${text2}
}
return result;
}
- function expandSubgraphs(entries, subgraphs) {
- forEach_default(entries, function(entry) {
+ function expandSubgraphs(entries2, subgraphs) {
+ forEach_default(entries2, function(entry) {
entry.vs = flatten_default(
entry.vs.map(function(v3) {
if (subgraphs[v3]) {
@@ -48388,17 +53941,17 @@ ${text2}
);
});
}
- function mergeBarycenters(target, other) {
+ function mergeBarycenters(target, other2) {
if (!isUndefined_default(target.barycenter)) {
- target.barycenter = (target.barycenter * target.weight + other.barycenter * other.weight) / (target.weight + other.weight);
- target.weight += other.weight;
+ target.barycenter = (target.barycenter * target.weight + other2.barycenter * other2.weight) / (target.weight + other2.weight);
+ target.weight += other2.weight;
} else {
- target.barycenter = other.barycenter;
- target.weight = other.weight;
+ target.barycenter = other2.barycenter;
+ target.weight = other2.weight;
}
}
var init_sort_subgraph = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js"() {
"use strict";
init_lodash();
init_barycenter();
@@ -48410,7 +53963,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/index.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/index.js
function order(g2) {
var maxRank2 = maxRank(g2), downLayerGraphs = buildLayerGraphs(g2, range_default(1, maxRank2 + 1), "inEdges"), upLayerGraphs = buildLayerGraphs(g2, range_default(maxRank2 - 1, -1, -1), "outEdges");
var layering = initOrder(g2);
@@ -48452,11 +54005,11 @@ ${text2}
});
}
var init_order2 = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/index.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/order/index.js"() {
"use strict";
init_lodash();
init_graphlib();
- init_util3();
+ init_util2();
init_add_subgraph_constraints();
init_build_layer_graph();
init_cross_count();
@@ -48469,7 +54022,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js
function parentDummyChains(g2) {
var postorderNums = postorder2(g2);
forEach_default(g2.graph().dummyChains, function(v3) {
@@ -48534,7 +54087,7 @@ ${text2}
return result;
}
var init_parent_dummy_chains = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js"() {
"use strict";
init_lodash();
__name(parentDummyChains, "parentDummyChains");
@@ -48543,7 +54096,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/position/bk.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/position/bk.js
function findType1Conflicts(g2, layering) {
var conflicts = {};
function visitLayer(prevLayer, layer) {
@@ -48631,7 +54184,7 @@ ${text2}
v3 = w3;
w3 = tmp;
}
- return has_default(conflicts[v3], w3);
+ return !!conflicts[v3] && Object.prototype.hasOwnProperty.call(conflicts[v3], w3);
}
function verticalAlignment(g2, layering, conflicts, neighborFn) {
var root4 = {}, align = {}, pos = {};
@@ -48794,7 +54347,7 @@ ${text2}
var sum2 = 0;
var delta;
sum2 += vLabel.width / 2;
- if (has_default(vLabel, "labelpos")) {
+ if (Object.prototype.hasOwnProperty.call(vLabel, "labelpos")) {
switch (vLabel.labelpos.toLowerCase()) {
case "l":
delta = -vLabel.width / 2;
@@ -48811,7 +54364,7 @@ ${text2}
sum2 += (vLabel.dummy ? edgeSep : nodeSep) / 2;
sum2 += (wLabel.dummy ? edgeSep : nodeSep) / 2;
sum2 += wLabel.width / 2;
- if (has_default(wLabel, "labelpos")) {
+ if (Object.prototype.hasOwnProperty.call(wLabel, "labelpos")) {
switch (wLabel.labelpos.toLowerCase()) {
case "l":
delta = wLabel.width / 2;
@@ -48832,11 +54385,11 @@ ${text2}
return g2.node(v3).width;
}
var init_bk = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/position/bk.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/position/bk.js"() {
"use strict";
init_lodash();
init_graphlib();
- init_util3();
+ init_util2();
__name(findType1Conflicts, "findType1Conflicts");
__name(findType2Conflicts, "findType2Conflicts");
__name(findOtherInnerSegmentNode, "findOtherInnerSegmentNode");
@@ -48854,7 +54407,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/position/index.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/position/index.js
function position(g2) {
g2 = asNonCompoundGraph(g2);
positionY(g2);
@@ -48879,113 +54432,53 @@ ${text2}
});
}
var init_position = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/position/index.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/position/index.js"() {
"use strict";
init_lodash();
- init_util3();
+ init_util2();
init_bk();
__name(position, "position");
__name(positionY, "positionY");
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/layout.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/layout.js
function layout(g2, opts) {
var time4 = opts && opts.debugTiming ? time2 : notime;
- time4("layout", function() {
- var layoutGraph = time4(" buildLayoutGraph", function() {
- return buildLayoutGraph(g2);
- });
- time4(" runLayout", function() {
- runLayout(layoutGraph, time4);
- });
- time4(" updateInputGraph", function() {
- updateInputGraph(g2, layoutGraph);
- });
+ time4("layout", () => {
+ var layoutGraph = time4(" buildLayoutGraph", () => buildLayoutGraph(g2));
+ time4(" runLayout", () => runLayout(layoutGraph, time4));
+ time4(" updateInputGraph", () => updateInputGraph(g2, layoutGraph));
});
}
function runLayout(g2, time4) {
- time4(" makeSpaceForEdgeLabels", function() {
- makeSpaceForEdgeLabels(g2);
- });
- time4(" removeSelfEdges", function() {
- removeSelfEdges(g2);
- });
- time4(" acyclic", function() {
- run(g2);
- });
- time4(" nestingGraph.run", function() {
- run3(g2);
- });
- time4(" rank", function() {
- rank(asNonCompoundGraph(g2));
- });
- time4(" injectEdgeLabelProxies", function() {
- injectEdgeLabelProxies(g2);
- });
- time4(" removeEmptyRanks", function() {
- removeEmptyRanks(g2);
- });
- time4(" nestingGraph.cleanup", function() {
- cleanup(g2);
- });
- time4(" normalizeRanks", function() {
- normalizeRanks(g2);
- });
- time4(" assignRankMinMax", function() {
- assignRankMinMax(g2);
- });
- time4(" removeEdgeLabelProxies", function() {
- removeEdgeLabelProxies(g2);
- });
- time4(" normalize.run", function() {
- run2(g2);
- });
- time4(" parentDummyChains", function() {
- parentDummyChains(g2);
- });
- time4(" addBorderSegments", function() {
- addBorderSegments(g2);
- });
- time4(" order", function() {
- order(g2);
- });
- time4(" insertSelfEdges", function() {
- insertSelfEdges(g2);
- });
- time4(" adjustCoordinateSystem", function() {
- adjust2(g2);
- });
- time4(" position", function() {
- position(g2);
- });
- time4(" positionSelfEdges", function() {
- positionSelfEdges(g2);
- });
- time4(" removeBorderNodes", function() {
- removeBorderNodes(g2);
- });
- time4(" normalize.undo", function() {
- undo3(g2);
- });
- time4(" fixupEdgeLabelCoords", function() {
- fixupEdgeLabelCoords(g2);
- });
- time4(" undoCoordinateSystem", function() {
- undo2(g2);
- });
- time4(" translateGraph", function() {
- translateGraph(g2);
- });
- time4(" assignNodeIntersects", function() {
- assignNodeIntersects(g2);
- });
- time4(" reversePoints", function() {
- reversePointsForReversedEdges(g2);
- });
- time4(" acyclic.undo", function() {
- undo(g2);
- });
+ time4(" makeSpaceForEdgeLabels", () => makeSpaceForEdgeLabels(g2));
+ time4(" removeSelfEdges", () => removeSelfEdges(g2));
+ time4(" acyclic", () => run(g2));
+ time4(" nestingGraph.run", () => run3(g2));
+ time4(" rank", () => rank(asNonCompoundGraph(g2)));
+ time4(" injectEdgeLabelProxies", () => injectEdgeLabelProxies(g2));
+ time4(" removeEmptyRanks", () => removeEmptyRanks(g2));
+ time4(" nestingGraph.cleanup", () => cleanup(g2));
+ time4(" normalizeRanks", () => normalizeRanks(g2));
+ time4(" assignRankMinMax", () => assignRankMinMax(g2));
+ time4(" removeEdgeLabelProxies", () => removeEdgeLabelProxies(g2));
+ time4(" normalize.run", () => run2(g2));
+ time4(" parentDummyChains", () => parentDummyChains(g2));
+ time4(" addBorderSegments", () => addBorderSegments(g2));
+ time4(" order", () => order(g2));
+ time4(" insertSelfEdges", () => insertSelfEdges(g2));
+ time4(" adjustCoordinateSystem", () => adjust2(g2));
+ time4(" position", () => position(g2));
+ time4(" positionSelfEdges", () => positionSelfEdges(g2));
+ time4(" removeBorderNodes", () => removeBorderNodes(g2));
+ time4(" normalize.undo", () => undo3(g2));
+ time4(" fixupEdgeLabelCoords", () => fixupEdgeLabelCoords(g2));
+ time4(" undoCoordinateSystem", () => undo2(g2));
+ time4(" translateGraph", () => translateGraph(g2));
+ time4(" assignNodeIntersects", () => assignNodeIntersects(g2));
+ time4(" reversePoints", () => reversePointsForReversedEdges(g2));
+ time4(" acyclic.undo", () => undo(g2));
}
function updateInputGraph(inputGraph, layoutGraph) {
forEach_default(inputGraph.nodes(), function(v3) {
@@ -49004,7 +54497,7 @@ ${text2}
var inputLabel = inputGraph.edge(e3);
var layoutLabel = layoutGraph.edge(e3);
inputLabel.points = layoutLabel.points;
- if (has_default(layoutLabel, "x")) {
+ if (Object.prototype.hasOwnProperty.call(layoutLabel, "x")) {
inputLabel.x = layoutLabel.x;
inputLabel.y = layoutLabel.y;
}
@@ -49103,7 +54596,7 @@ ${text2}
});
forEach_default(g2.edges(), function(e3) {
var edge = g2.edge(e3);
- if (has_default(edge, "x")) {
+ if (Object.prototype.hasOwnProperty.call(edge, "x")) {
getExtremes(edge);
}
});
@@ -49120,10 +54613,10 @@ ${text2}
p3.x -= minX;
p3.y -= minY;
});
- if (has_default(edge, "x")) {
+ if (Object.prototype.hasOwnProperty.call(edge, "x")) {
edge.x -= minX;
}
- if (has_default(edge, "y")) {
+ if (Object.prototype.hasOwnProperty.call(edge, "y")) {
edge.y -= minY;
}
});
@@ -49144,14 +54637,14 @@ ${text2}
p1 = edge.points[0];
p22 = edge.points[edge.points.length - 1];
}
- edge.points.unshift(intersectRect3(nodeV, p1));
- edge.points.push(intersectRect3(nodeW, p22));
+ edge.points.unshift(intersectRect2(nodeV, p1));
+ edge.points.push(intersectRect2(nodeW, p22));
});
}
function fixupEdgeLabelCoords(g2) {
forEach_default(g2.edges(), function(e3) {
var edge = g2.edge(e3);
- if (has_default(edge, "x")) {
+ if (Object.prototype.hasOwnProperty.call(edge, "x")) {
if (edge.labelpos === "l" || edge.labelpos === "r") {
edge.width -= edge.labeloffset;
}
@@ -49267,7 +54760,7 @@ ${text2}
}
var graphNumAttrs, graphDefaults, graphAttrs, nodeNumAttrs, nodeDefaults, edgeNumAttrs, edgeDefaults, edgeAttrs;
var init_layout = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/layout.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/layout.js"() {
"use strict";
init_lodash();
init_graphlib();
@@ -49280,7 +54773,7 @@ ${text2}
init_order2();
init_parent_dummy_chains();
init_position();
- init_util3();
+ init_util2();
__name(layout, "layout");
__name(runLayout, "runLayout");
__name(updateInputGraph, "updateInputGraph");
@@ -49317,9 +54810,9 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/index.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/index.js
var init_dagre = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/index.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/dagre/index.js"() {
"use strict";
init_acyclic();
init_layout();
@@ -49328,7 +54821,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/json.js
+ // ../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/json.js
function write(g2) {
var json3 = {
options: {
@@ -49372,7 +54865,7 @@ ${text2}
});
}
var init_json = __esm({
- "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/json.js"() {
+ "../../node_modules/.pnpm/dagre-d3-es@7.0.11/node_modules/dagre-d3-es/src/graphlib/json.js"() {
"use strict";
init_lodash();
init_graph();
@@ -49383,7 +54876,7 @@ ${text2}
});
// src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js
- var clusterDb, descendants, parents, clear8, isDescendant2, edgeInCluster, copy2, extractDescendants, findCommonEdges, findNonClusterChild, getAnchorId, adjustClustersAndEdges, extractor, sorter, sortNodesByHierarchy;
+ var clusterDb, descendants, parents, clear6, isDescendant2, edgeInCluster, copy2, extractDescendants, findCommonEdges, findNonClusterChild, getAnchorId, adjustClustersAndEdges, extractor, sorter, sortNodesByHierarchy;
var init_mermaid_graphlib = __esm({
"src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js"() {
"use strict";
@@ -49393,15 +54886,15 @@ ${text2}
clusterDb = /* @__PURE__ */ new Map();
descendants = /* @__PURE__ */ new Map();
parents = /* @__PURE__ */ new Map();
- clear8 = /* @__PURE__ */ __name(() => {
+ clear6 = /* @__PURE__ */ __name(() => {
descendants.clear();
parents.clear();
clusterDb.clear();
}, "clear");
- isDescendant2 = /* @__PURE__ */ __name((id27, ancestorId) => {
+ isDescendant2 = /* @__PURE__ */ __name((id29, ancestorId) => {
const ancestorDescendants = descendants.get(ancestorId) || [];
- log.trace("In isDescendant", ancestorId, " ", id27, " = ", ancestorDescendants.includes(id27));
- return ancestorDescendants.includes(id27);
+ log.trace("In isDescendant", ancestorId, " ", id29, " = ", ancestorDescendants.includes(id29));
+ return ancestorDescendants.includes(id29);
}, "isDescendant");
edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => {
const clusterDescendants = descendants.get(clusterId) || [];
@@ -49435,9 +54928,9 @@ ${text2}
if (graph.children(node2).length > 0) {
copy2(node2, graph, newGraph, rootId);
} else {
- const data5 = graph.node(node2);
+ const data6 = graph.node(node2);
log.info("cp ", node2, " to ", rootId, " with parent ", clusterId);
- newGraph.setNode(node2, data5);
+ newGraph.setNode(node2, data6);
if (rootId !== graph.parent(node2)) {
log.warn("Setting parent", node2, graph.parent(node2));
newGraph.setParent(node2, graph.parent(node2));
@@ -49456,16 +54949,16 @@ ${text2}
node2 !== clusterId
);
}
- const edges5 = graph.edges(node2);
- log.debug("Copying Edges", edges5);
- edges5.forEach((edge) => {
+ const edges3 = graph.edges(node2);
+ log.debug("Copying Edges", edges3);
+ edges3.forEach((edge) => {
log.info("Edge", edge);
- const data6 = graph.edge(edge.v, edge.w, edge.name);
- log.info("Edge data", data6, rootId);
+ const data7 = graph.edge(edge.v, edge.w, edge.name);
+ log.info("Edge data", data7, rootId);
try {
if (edgeInCluster(edge, rootId)) {
- log.info("Copying as ", edge.v, edge.w, data6, edge.name);
- newGraph.setEdge(edge.v, edge.w, data6, edge.name);
+ log.info("Copying as ", edge.v, edge.w, data7, edge.name);
+ newGraph.setEdge(edge.v, edge.w, data7, edge.name);
log.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));
} else {
log.info(
@@ -49488,20 +54981,20 @@ ${text2}
graph.removeNode(node2);
});
}, "copy");
- extractDescendants = /* @__PURE__ */ __name((id27, graph) => {
- const children2 = graph.children(id27);
+ extractDescendants = /* @__PURE__ */ __name((id29, graph) => {
+ const children2 = graph.children(id29);
let res = [...children2];
for (const child of children2) {
- parents.set(child, id27);
+ parents.set(child, id29);
res = [...res, ...extractDescendants(child, graph)];
}
return res;
}, "extractDescendants");
- findCommonEdges = /* @__PURE__ */ __name((graph, id1, id27) => {
+ findCommonEdges = /* @__PURE__ */ __name((graph, id1, id29) => {
const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1);
- const edges22 = graph.edges().filter((edge) => edge.v === id27 || edge.w === id27);
+ const edges22 = graph.edges().filter((edge) => edge.v === id29 || edge.w === id29);
const edges1Prim = edges1.map((edge) => {
- return { v: edge.v === id1 ? id27 : edge.v, w: edge.w === id1 ? id1 : edge.w };
+ return { v: edge.v === id1 ? id29 : edge.v, w: edge.w === id1 ? id1 : edge.w };
});
const edges2Prim = edges22.map((edge) => {
return { v: edge.v, w: edge.w };
@@ -49511,11 +55004,11 @@ ${text2}
});
return result;
}, "findCommonEdges");
- findNonClusterChild = /* @__PURE__ */ __name((id27, graph, clusterId) => {
- const children2 = graph.children(id27);
- log.trace("Searching children of id ", id27, children2);
+ findNonClusterChild = /* @__PURE__ */ __name((id29, graph, clusterId) => {
+ const children2 = graph.children(id29);
+ log.trace("Searching children of id ", id29, children2);
if (children2.length < 1) {
- return id27;
+ return id29;
}
let reserve;
for (const child of children2) {
@@ -49531,17 +55024,17 @@ ${text2}
}
return reserve;
}, "findNonClusterChild");
- getAnchorId = /* @__PURE__ */ __name((id27) => {
- if (!clusterDb.has(id27)) {
- return id27;
+ getAnchorId = /* @__PURE__ */ __name((id29) => {
+ if (!clusterDb.has(id29)) {
+ return id29;
}
- if (!clusterDb.get(id27).externalConnections) {
- return id27;
+ if (!clusterDb.get(id29).externalConnections) {
+ return id29;
}
- if (clusterDb.has(id27)) {
- return clusterDb.get(id27).id;
+ if (clusterDb.has(id29)) {
+ return clusterDb.get(id29).id;
}
- return id27;
+ return id29;
}, "getAnchorId");
adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {
if (!graph || depth > 10) {
@@ -49550,42 +55043,42 @@ ${text2}
} else {
log.debug("Opting in, graph ");
}
- graph.nodes().forEach(function(id27) {
- const children2 = graph.children(id27);
+ graph.nodes().forEach(function(id29) {
+ const children2 = graph.children(id29);
if (children2.length > 0) {
log.warn(
"Cluster identified",
- id27,
+ id29,
" Replacement id in edges: ",
- findNonClusterChild(id27, graph, id27)
+ findNonClusterChild(id29, graph, id29)
);
- descendants.set(id27, extractDescendants(id27, graph));
- clusterDb.set(id27, { id: findNonClusterChild(id27, graph, id27), clusterData: graph.node(id27) });
+ descendants.set(id29, extractDescendants(id29, graph));
+ clusterDb.set(id29, { id: findNonClusterChild(id29, graph, id29), clusterData: graph.node(id29) });
}
});
- graph.nodes().forEach(function(id27) {
- const children2 = graph.children(id27);
- const edges5 = graph.edges();
+ graph.nodes().forEach(function(id29) {
+ const children2 = graph.children(id29);
+ const edges3 = graph.edges();
if (children2.length > 0) {
- log.debug("Cluster identified", id27, descendants);
- edges5.forEach((edge) => {
- const d1 = isDescendant2(edge.v, id27);
- const d2 = isDescendant2(edge.w, id27);
+ log.debug("Cluster identified", id29, descendants);
+ edges3.forEach((edge) => {
+ const d1 = isDescendant2(edge.v, id29);
+ const d2 = isDescendant2(edge.w, id29);
if (d1 ^ d2) {
- log.warn("Edge: ", edge, " leaves cluster ", id27);
- log.warn("Descendants of XXX ", id27, ": ", descendants.get(id27));
- clusterDb.get(id27).externalConnections = true;
+ log.warn("Edge: ", edge, " leaves cluster ", id29);
+ log.warn("Descendants of XXX ", id29, ": ", descendants.get(id29));
+ clusterDb.get(id29).externalConnections = true;
}
});
} else {
- log.debug("Not a cluster ", id27, descendants);
+ log.debug("Not a cluster ", id29, descendants);
}
});
- for (let id27 of clusterDb.keys()) {
- const nonClusterChild = clusterDb.get(id27).id;
+ for (let id29 of clusterDb.keys()) {
+ const nonClusterChild = clusterDb.get(id29).id;
const parent4 = graph.parent(nonClusterChild);
- if (parent4 !== id27 && clusterDb.has(parent4) && !clusterDb.get(parent4).externalConnections) {
- clusterDb.get(id27).id = parent4;
+ if (parent4 !== id29 && clusterDb.has(parent4) && !clusterDb.get(parent4).externalConnections) {
+ clusterDb.get(id29).id = parent4;
}
}
graph.edges().forEach(function(e3) {
@@ -49713,10 +55206,10 @@ ${text2}
nodes6 = graph.nodes();
log.warn("New list of nodes", nodes6);
for (const node2 of nodes6) {
- const data5 = graph.node(node2);
- log.warn(" Now next level", node2, data5);
- if (data5?.clusterNode) {
- extractor(data5.graph, depth + 1);
+ const data6 = graph.node(node2);
+ log.warn(" Now next level", node2, data6);
+ if (data6?.clusterNode) {
+ extractor(data6.graph, depth + 1);
}
}
}, "extractor");
@@ -49749,15 +55242,15 @@ ${text2}
init_json();
init_graphlib();
init_markers();
- init_util2();
+ init_util();
init_mermaid_graphlib();
- init_nodes3();
+ init_nodes2();
init_clusters();
init_edges();
init_logger();
init_subGraphTitleMargins();
init_diagramAPI();
- recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id27, parentCluster, siteConfig2) => {
+ recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id29, parentCluster, siteConfig2) => {
log.warn("Graph in recursive render:XAX", write(graph), parentCluster);
const dir2 = graph.graph().rankdir;
log.trace("Dir in recursive render - dir:", dir2);
@@ -49778,19 +55271,19 @@ ${text2}
graph.nodes().map(async function(v3) {
const node2 = graph.node(v3);
if (parentCluster !== void 0) {
- const data5 = JSON.parse(JSON.stringify(parentCluster.clusterData));
+ const data6 = JSON.parse(JSON.stringify(parentCluster.clusterData));
log.trace(
"Setting data for parent cluster XXX\n Node.id = ",
v3,
"\n data=",
- data5.height,
+ data6.height,
"\nParent cluster",
parentCluster.height
);
- graph.setNode(parentCluster.id, data5);
+ graph.setNode(parentCluster.id, data6);
if (!graph.parent(v3)) {
log.trace("Setting parent", v3, parentCluster.id);
- graph.setParent(v3, parentCluster.id, data5);
+ graph.setParent(v3, parentCluster.id, data6);
}
}
log.info("(Insert) Node XXX" + v3 + ": " + JSON.stringify(graph.node(v3)));
@@ -49806,12 +55299,12 @@ ${text2}
nodes6,
node2.graph,
diagramType,
- id27,
+ id29,
graph.node(v3),
siteConfig2
);
const newEl = o2.elem;
- updateNodeBounds2(node2, newEl);
+ updateNodeBounds(node2, newEl);
node2.diff = o2.diff || 0;
log.info(
"New compound node after recursive render XAX",
@@ -49824,7 +55317,7 @@ ${text2}
// node.x,
// node.y
);
- setNodeElem2(newEl, node2);
+ setNodeElem(newEl, node2);
} else {
if (graph.children(v3).length > 0) {
log.trace(
@@ -49840,7 +55333,7 @@ ${text2}
clusterDb.set(node2.id, { id: findNonClusterChild(node2.id, graph), node: node2 });
} else {
log.trace("Node - the non recursive path XAX", v3, nodes6, graph.node(v3), dir2);
- await insertNode2(nodes6, graph.node(v3), dir2);
+ await insertNode(nodes6, graph.node(v3), { config: siteConfig2, dir: dir2 });
}
}
})
@@ -49897,7 +55390,7 @@ ${text2}
graph.parent(v3)
);
clusterDb.get(node2.id).node = node2;
- positionNode2(node2);
+ positionNode(node2);
} else {
if (graph.children(v3).length > 0) {
log.info(
@@ -49937,7 +55430,7 @@ ${text2}
parent4?.offsetY,
node2
);
- positionNode2(node2);
+ positionNode(node2);
}
}
})
@@ -49948,7 +55441,7 @@ ${text2}
edge.points.forEach((point8) => point8.y += subGraphTitleTotalMargin / 2);
const startNode = graph.node(e3.v);
var endNode = graph.node(e3.w);
- const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id27);
+ const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id29);
positionEdgeLabel(edge, paths);
});
graph.nodes().forEach(function(v3) {
@@ -49961,7 +55454,7 @@ ${text2}
log.warn("Returning from recursive render XAX", elem, diff2);
return { elem, diff: diff2 };
}, "recursiveRender");
- render3 = /* @__PURE__ */ __name(async (data4Layout, svg) => {
+ render3 = /* @__PURE__ */ __name(async (data4Layout, svg2) => {
const graph = new Graph({
multigraph: true,
compound: true
@@ -49974,12 +55467,12 @@ ${text2}
}).setDefaultEdgeLabel(function() {
return {};
});
- const element3 = svg.select("g");
+ const element3 = svg2.select("g");
markers_default(element3, data4Layout.markers, data4Layout.type, data4Layout.diagramId);
- clear7();
- clear6();
clear5();
- clear8();
+ clear4();
+ clear3();
+ clear6();
data4Layout.nodes.forEach((node2) => {
graph.setNode(node2.id, { ...node2 });
if (node2.parentId) {
@@ -50027,6 +55520,7 @@ ${text2}
edge1.label = "";
edge1.arrowTypeEnd = "none";
edge1.id = nodeId + "-cyclic-special-1";
+ edgeMid.arrowTypeStart = "none";
edgeMid.arrowTypeEnd = "none";
edgeMid.id = nodeId + "-cyclic-special-mid";
edge2.label = "";
@@ -50035,6 +55529,7 @@ ${text2}
edge2.toCluster = nodeId;
}
edge2.id = nodeId + "-cyclic-special-2";
+ edge2.arrowTypeStart = "none";
graph.setEdge(nodeId, specialId1, edge1, nodeId + "-cyclic-special-0");
graph.setEdge(specialId1, specialId2, edgeMid, nodeId + "-cyclic-special-1");
graph.setEdge(specialId2, nodeId, edge2, nodeId + "-cyc
init_logger();
layoutAlgorithms = {};
registerLayoutLoaders = /* @__PURE__ */ __name((loaders) => {
- for (const loader26 of loaders) {
- layoutAlgorithms[loader26.name] = loader26;
+ for (const loader28 of loaders) {
+ layoutAlgorithms[loader28.name] = loader28;
}
}, "registerLayoutLoaders");
registerDefaultLayoutLoaders = /* @__PURE__ */ __name(() => {
@@ -50080,13 +55575,13 @@ ${text2}
]);
}, "registerDefaultLayoutLoaders");
registerDefaultLayoutLoaders();
- render4 = /* @__PURE__ */ __name(async (data4Layout, svg) => {
+ render4 = /* @__PURE__ */ __name(async (data4Layout, svg2) => {
if (!(data4Layout.layoutAlgorithm in layoutAlgorithms)) {
throw new Error(`Unknown layout algorithm: ${data4Layout.layoutAlgorithm}`);
}
const layoutDefinition = layoutAlgorithms[data4Layout.layoutAlgorithm];
const layoutRenderer = await layoutDefinition.loader();
- return layoutRenderer.render(data4Layout, svg, internalHelpers, {
+ return layoutRenderer.render(data4Layout, svg2, internalHelpers, {
algorithm: layoutDefinition.algorithm
});
}, "render");
@@ -50110,31 +55605,31 @@ ${text2}
"use strict";
init_setupGraphViewbox();
init_logger();
- setupViewPortForSVG = /* @__PURE__ */ __name((svg, padding3, cssDiagram, useMaxWidth) => {
- svg.attr("class", cssDiagram);
- const { width: width3, height: height2, x: x5, y: y5 } = calculateDimensionsWithPadding(svg, padding3);
- configureSvgSize(svg, height2, width3, useMaxWidth);
- const viewBox = createViewBox(x5, y5, width3, height2, padding3);
- svg.attr("viewBox", viewBox);
- log.debug(`viewBox configured: ${viewBox} with padding: ${padding3}`);
+ setupViewPortForSVG = /* @__PURE__ */ __name((svg2, padding2, cssDiagram, useMaxWidth) => {
+ svg2.attr("class", cssDiagram);
+ const { width: width3, height: height2, x: x5, y: y5 } = calculateDimensionsWithPadding(svg2, padding2);
+ configureSvgSize(svg2, height2, width3, useMaxWidth);
+ const viewBox = createViewBox(x5, y5, width3, height2, padding2);
+ svg2.attr("viewBox", viewBox);
+ log.debug(`viewBox configured: ${viewBox} with padding: ${padding2}`);
}, "setupViewPortForSVG");
- calculateDimensionsWithPadding = /* @__PURE__ */ __name((svg, padding3) => {
- const bounds4 = svg.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 };
+ calculateDimensionsWithPadding = /* @__PURE__ */ __name((svg2, padding2) => {
+ const bounds4 = svg2.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 };
return {
- width: bounds4.width + padding3 * 2,
- height: bounds4.height + padding3 * 2,
+ width: bounds4.width + padding2 * 2,
+ height: bounds4.height + padding2 * 2,
x: bounds4.x,
y: bounds4.y
};
}, "calculateDimensionsWithPadding");
- createViewBox = /* @__PURE__ */ __name((x5, y5, width3, height2, padding3) => {
- return `${x5 - padding3} ${y5 - padding3} ${width3} ${height2}`;
+ createViewBox = /* @__PURE__ */ __name((x5, y5, width3, height2, padding2) => {
+ return `${x5 - padding2} ${y5 - padding2} ${width3} ${height2}`;
}, "createViewBox");
}
});
// src/diagrams/flowchart/flowRenderer-v3-unified.ts
- var getClasses2, draw2, flowRenderer_v3_unified_default;
+ var getClasses, draw2, flowRenderer_v3_unified_default;
var init_flowRenderer_v3_unified = __esm({
"src/diagrams/flowchart/flowRenderer-v3-unified.ts"() {
"use strict";
@@ -50145,24 +55640,23 @@ ${text2}
init_render();
init_setupViewPortForSVG();
init_utils2();
- init_flowDb();
- getClasses2 = /* @__PURE__ */ __name(function(text2, diagramObj) {
+ getClasses = /* @__PURE__ */ __name(function(text4, diagramObj) {
return diagramObj.db.getClasses();
}, "getClasses");
- draw2 = /* @__PURE__ */ __name(async function(text2, id27, _version, diag) {
+ draw2 = /* @__PURE__ */ __name(async function(text4, id29, _version, diag) {
log.info("REF0:");
- log.info("Drawing state diagram (v2)", id27);
- const { securityLevel, flowchart: conf8, layout: layout6 } = getConfig2();
+ log.info("Drawing state diagram (v2)", id29);
+ const { securityLevel, flowchart: conf5, layout: layout6 } = getConfig2();
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
log.debug("Before getData: ");
const data4Layout = diag.db.getData();
log.debug("Data: ", data4Layout);
- const svg = getDiagramElement(id27, securityLevel);
- const direction4 = getDirection();
+ const svg2 = getDiagramElement(id29, securityLevel);
+ const direction = diag.db.getDirection();
data4Layout.type = diag.type;
data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout6);
if (data4Layout.layoutAlgorithm === "dagre" && layout6 === "elk") {
@@ -50170,23 +55664,23 @@ ${text2}
"flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."
);
}
- data4Layout.direction = direction4;
- data4Layout.nodeSpacing = conf8?.nodeSpacing || 50;
- data4Layout.rankSpacing = conf8?.rankSpacing || 50;
+ data4Layout.direction = direction;
+ data4Layout.nodeSpacing = conf5?.nodeSpacing || 50;
+ data4Layout.rankSpacing = conf5?.rankSpacing || 50;
data4Layout.markers = ["point", "circle", "cross"];
- data4Layout.diagramId = id27;
+ data4Layout.diagramId = id29;
log.debug("REF1:", data4Layout);
- await render4(data4Layout, svg);
- const padding3 = data4Layout.config.flowchart?.diagramPadding ?? 8;
+ await render4(data4Layout, svg2);
+ const padding2 = data4Layout.config.flowchart?.diagramPadding ?? 8;
utils_default2.insertTitle(
- svg,
+ svg2,
"flowchartTitleText",
- conf8?.titleTopMargin || 0,
+ conf5?.titleTopMargin || 0,
diag.db.getDiagramTitle()
);
- setupViewPortForSVG(svg, padding3, "flowchart", conf8?.useMaxWidth || false);
+ setupViewPortForSVG(svg2, padding2, "flowchart", conf5?.useMaxWidth || false);
for (const vertex of data4Layout.nodes) {
- const node2 = select_default2(`#${id27} [id="${vertex.id}"]`);
+ const node2 = select_default2(`#${id29} [id="${vertex.id}"]`);
if (!node2 || !vertex.link) {
continue;
}
@@ -50216,7 +55710,7 @@ ${text2}
}
}, "draw");
flowRenderer_v3_unified_default = {
- getClasses: getClasses2,
+ getClasses,
draw: draw2
};
}
@@ -50231,14 +55725,14 @@ ${text2}
var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
- }, "o"), $V0 = [1, 4], $V1 = [1, 3], $V2 = [1, 5], $V3 = [1, 8, 9, 10, 11, 27, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $V4 = [2, 2], $V5 = [1, 13], $V6 = [1, 14], $V7 = [1, 15], $V8 = [1, 16], $V9 = [1, 23], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 49], $Ve = [1, 48], $Vf = [1, 29], $Vg = [1, 30], $Vh = [1, 31], $Vi = [1, 32], $Vj = [1, 33], $Vk = [1, 44], $Vl = [1, 46], $Vm = [1, 42], $Vn = [1, 47], $Vo = [1, 43], $Vp = [1, 50], $Vq = [1, 45], $Vr = [1, 51], $Vs = [1, 52], $Vt = [1, 34], $Vu = [1, 35], $Vv = [1, 36], $Vw = [1, 37], $Vx = [1, 57], $Vy = [1, 8, 9, 10, 11, 27, 32, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $Vz = [1, 61], $VA = [1, 60], $VB = [1, 62], $VC = [8, 9, 11, 73, 75], $VD = [1, 88], $VE = [1, 93], $VF = [1, 92], $VG = [1, 89], $VH = [1, 85], $VI = [1, 91], $VJ = [1, 87], $VK = [1, 94], $VL = [1, 90], $VM = [1, 95], $VN = [1, 86], $VO = [8, 9, 10, 11, 73, 75], $VP = [8, 9, 10, 11, 44, 73, 75], $VQ = [8, 9, 10, 11, 29, 42, 44, 46, 48, 50, 52, 54, 56, 58, 61, 63, 65, 66, 68, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VR = [8, 9, 11, 42, 58, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VS = [42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VT = [1, 121], $VU = [1, 120], $VV = [1, 128], $VW = [1, 142], $VX = [1, 143], $VY = [1, 144], $VZ = [1, 145], $V_ = [1, 130], $V$ = [1, 132], $V01 = [1, 136], $V11 = [1, 137], $V21 = [1, 138], $V31 = [1, 139], $V41 = [1, 140], $V51 = [1, 141], $V61 = [1, 146], $V71 = [1, 147], $V81 = [1, 126], $V91 = [1, 127], $Va1 = [1, 134], $Vb1 = [1, 129], $Vc1 = [1, 133], $Vd1 = [1, 131], $Ve1 = [8, 9, 10, 11, 27, 32, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $Vf1 = [1, 149], $Vg1 = [8, 9, 11], $Vh1 = [8, 9, 10, 11, 14, 42, 58, 86, 102, 103, 106, 108, 111, 112, 113], $Vi1 = [1, 169], $Vj1 = [1, 165], $Vk1 = [1, 166], $Vl1 = [1, 170], $Vm1 = [1, 167], $Vn1 = [1, 168], $Vo1 = [75, 113, 116], $Vp1 = [8, 9, 10, 11, 12, 14, 27, 29, 32, 42, 58, 73, 81, 82, 83, 84, 85, 86, 87, 102, 106, 108, 111, 112, 113], $Vq1 = [10, 103], $Vr1 = [31, 47, 49, 51, 53, 55, 60, 62, 64, 65, 67, 69, 113, 114, 115], $Vs1 = [1, 235], $Vt1 = [1, 233], $Vu1 = [1, 237], $Vv1 = [1, 231], $Vw1 = [1, 232], $Vx1 = [1, 234], $Vy1 = [1, 236], $Vz1 = [1, 238], $VA1 = [1, 255], $VB1 = [8, 9, 11, 103], $VC1 = [8, 9, 10, 11, 58, 81, 102, 103, 106, 107, 108, 109];
- var parser22 = {
+ }, "o"), $V0 = [1, 4], $V1 = [1, 3], $V2 = [1, 5], $V3 = [1, 8, 9, 10, 11, 27, 34, 36, 38, 44, 60, 84, 85, 86, 87, 88, 89, 102, 105, 106, 109, 111, 114, 115, 116, 121, 122, 123, 124], $V4 = [2, 2], $V5 = [1, 13], $V6 = [1, 14], $V7 = [1, 15], $V8 = [1, 16], $V9 = [1, 23], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 49], $Ve = [1, 48], $Vf = [1, 29], $Vg = [1, 30], $Vh = [1, 31], $Vi = [1, 32], $Vj = [1, 33], $Vk = [1, 44], $Vl = [1, 46], $Vm = [1, 42], $Vn = [1, 47], $Vo = [1, 43], $Vp = [1, 50], $Vq = [1, 45], $Vr = [1, 51], $Vs = [1, 52], $Vt = [1, 34], $Vu = [1, 35], $Vv = [1, 36], $Vw = [1, 37], $Vx = [1, 57], $Vy = [1, 8, 9, 10, 11, 27, 32, 34, 36, 38, 44, 60, 84, 85, 86, 87, 88, 89, 102, 105, 106, 109, 111, 114, 115, 116, 121, 122, 123, 124], $Vz = [1, 61], $VA = [1, 60], $VB = [1, 62], $VC = [8, 9, 11, 75, 77, 78], $VD = [1, 78], $VE = [1, 91], $VF = [1, 96], $VG = [1, 95], $VH = [1, 92], $VI = [1, 88], $VJ = [1, 94], $VK = [1, 90], $VL = [1, 97], $VM = [1, 93], $VN = [1, 98], $VO = [1, 89], $VP = [8, 9, 10, 11, 40, 75, 77, 78], $VQ = [8, 9, 10, 11, 40, 46, 75, 77, 78], $VR = [8, 9, 10, 11, 29, 40, 44, 46, 48, 50, 52, 54, 56, 58, 60, 63, 65, 67, 68, 70, 75, 77, 78, 89, 102, 105, 106, 109, 111, 114, 115, 116], $VS = [8, 9, 11, 44, 60, 75, 77, 78, 89, 102, 105, 106, 109, 111, 114, 115, 116], $VT = [44, 60, 89, 102, 105, 106, 109, 111, 114, 115, 116], $VU = [1, 121], $VV = [1, 122], $VW = [1, 124], $VX = [1, 123], $VY = [44, 60, 62, 74, 89, 102, 105, 106, 109, 111, 114, 115, 116], $VZ = [1, 133], $V_ = [1, 147], $V$ = [1, 148], $V01 = [1, 149], $V11 = [1, 150], $V21 = [1, 135], $V31 = [1, 137], $V41 = [1, 141], $V51 = [1, 142], $V61 = [1, 143], $V71 = [1, 144], $V81 = [1, 145], $V91 = [1, 146], $Va1 = [1, 151], $Vb1 = [1, 152], $Vc1 = [1, 131], $Vd1 = [1, 132], $Ve1 = [1, 139], $Vf1 = [1, 134], $Vg1 = [1, 138], $Vh1 = [1, 136], $Vi1 = [8, 9, 10, 11, 27, 32, 34, 36, 38, 44, 60, 84, 85, 86, 87, 88, 89, 102, 105, 106, 109, 111, 114, 115, 116, 121, 122, 123, 124], $Vj1 = [1, 154], $Vk1 = [1, 156], $Vl1 = [8, 9, 11], $Vm1 = [8, 9, 10, 11, 14, 44, 60, 89, 105, 106, 109, 111, 114, 115, 116], $Vn1 = [1, 176], $Vo1 = [1, 172], $Vp1 = [1, 173], $Vq1 = [1, 177], $Vr1 = [1, 174], $Vs1 = [1, 175], $Vt1 = [77, 116, 119], $Vu1 = [8, 9, 10, 11, 12, 14, 27, 29, 32, 44, 60, 75, 84, 85, 86, 87, 88, 89, 90, 105, 109, 111, 114, 115, 116], $Vv1 = [10, 106], $Vw1 = [31, 49, 51, 53, 55, 57, 62, 64, 66, 67, 69, 71, 116, 117, 118], $Vx1 = [1, 247], $Vy1 = [1, 245], $Vz1 = [1, 249], $VA1 = [1, 243], $VB1 = [1, 244], $VC1 = [1, 246], $VD1 = [1, 248], $VE1 = [1, 250], $VF1 = [1, 268], $VG1 = [8, 9, 11, 106], $VH1 = [8, 9, 10, 11, 60, 84, 105, 106, 109, 110, 111, 112];
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
- symbols_: { "error": 2, "start": 3, "graphConfig": 4, "document": 5, "line": 6, "statement": 7, "SEMI": 8, "NEWLINE": 9, "SPACE": 10, "EOF": 11, "GRAPH": 12, "NODIR": 13, "DIR": 14, "FirstStmtSeparator": 15, "ending": 16, "endToken": 17, "spaceList": 18, "spaceListNewline": 19, "vertexStatement": 20, "separator": 21, "styleStatement": 22, "linkStyleStatement": 23, "classDefStatement": 24, "classStatement": 25, "clickStatement": 26, "subgraph": 27, "textNoTags": 28, "SQS": 29, "text": 30, "SQE": 31, "end": 32, "direction": 33, "acc_title": 34, "acc_title_value": 35, "acc_descr": 36, "acc_descr_value": 37, "acc_descr_multiline_value": 38, "link": 39, "node": 40, "styledVertex": 41, "AMP": 42, "vertex": 43, "STYLE_SEPARATOR": 44, "idString": 45, "DOUBLECIRCLESTART": 46, "DOUBLECIRCLEEND": 47, "PS": 48, "PE": 49, "(-": 50, "-)": 51, "STADIUMSTART": 52, "STADIUMEND": 53, "SUBROUTINESTART": 54, "SUBROUTINEEND": 55, "VERTEX_WITH_PROPS_START": 56, "NODE_STRING[field]": 57, "COLON": 58, "NODE_STRING[value]": 59, "PIPE": 60, "CYLINDERSTART": 61, "CYLINDEREND": 62, "DIAMOND_START": 63, "DIAMOND_STOP": 64, "TAGEND": 65, "TRAPSTART": 66, "TRAPEND": 67, "INVTRAPSTART": 68, "INVTRAPEND": 69, "linkStatement": 70, "arrowText": 71, "TESTSTR": 72, "START_LINK": 73, "edgeText": 74, "LINK": 75, "edgeTextToken": 76, "STR": 77, "MD_STR": 78, "textToken": 79, "keywords": 80, "STYLE": 81, "LINKSTYLE": 82, "CLASSDEF": 83, "CLASS": 84, "CLICK": 85, "DOWN": 86, "UP": 87, "textNoTagsToken": 88, "stylesOpt": 89, "idString[vertex]": 90, "idString[class]": 91, "CALLBACKNAME": 92, "CALLBACKARGS": 93, "HREF": 94, "LINK_TARGET": 95, "STR[link]": 96, "STR[tooltip]": 97, "alphaNum": 98, "DEFAULT": 99, "numList": 100, "INTERPOLATE": 101, "NUM": 102, "COMMA": 103, "style": 104, "styleComponent": 105, "NODE_STRING": 106, "UNIT": 107, "BRKT": 108, "PCT": 109, "idStringToken": 110, "MINUS": 111, "MULT": 112, "UNICODE_TEXT": 113, "TEXT": 114, "TAGSTART": 115, "EDGE_TEXT": 116, "alphaNumToken": 117, "direction_tb": 118, "direction_bt": 119, "direction_rl": 120, "direction_lr": 121, "$accept": 0, "$end": 1 },
- terminals_: { 2: "error", 8: "SEMI", 9: "NEWLINE", 10: "SPACE", 11: "EOF", 12: "GRAPH", 13: "NODIR", 14: "DIR", 27: "subgraph", 29: "SQS", 31: "SQE", 32: "end", 34: "acc_title", 35: "acc_title_value", 36: "acc_descr", 37: "acc_descr_value", 38: "acc_descr_multiline_value", 42: "AMP", 44: "STYLE_SEPARATOR", 46: "DOUBLECIRCLESTART", 47: "DOUBLECIRCLEEND", 48: "PS", 49: "PE", 50: "(-", 51: "-)", 52: "STADIUMSTART", 53: "STADIUMEND", 54: "SUBROUTINESTART", 55: "SUBROUTINEEND", 56: "VERTEX_WITH_PROPS_START", 57: "NODE_STRING[field]", 58: "COLON", 59: "NODE_STRING[value]", 60: "PIPE", 61: "CYLINDERSTART", 62: "CYLINDEREND", 63: "DIAMOND_START", 64: "DIAMOND_STOP", 65: "TAGEND", 66: "TRAPSTART", 67: "TRAPEND", 68: "INVTRAPSTART", 69: "INVTRAPEND", 72: "TESTSTR", 73: "START_LINK", 75: "LINK", 77: "STR", 78: "MD_STR", 81: "STYLE", 82: "LINKSTYLE", 83: "CLASSDEF", 84: "CLASS", 85: "CLICK", 86: "DOWN", 87: "UP", 90: "idString[vertex]", 91: "idString[class]", 92: "CALLBACKNAME", 93: "CALLBACKARGS", 94: "HREF", 95: "LINK_TARGET", 96: "STR[link]", 97: "STR[tooltip]", 99: "DEFAULT", 101: "INTERPOLATE", 102: "NUM", 103: "COMMA", 106: "NODE_STRING", 107: "UNIT", 108: "BRKT", 109: "PCT", 111: "MINUS", 112: "MULT", 113: "UNICODE_TEXT", 114: "TEXT", 115: "TAGSTART", 116: "EDGE_TEXT", 118: "direction_tb", 119: "direction_bt", 120: "direction_rl", 121: "direction_lr" },
- productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 2], [4, 3], [16, 2], [16, 1], [17, 1], [17, 1], [17, 1], [15, 1], [15, 1], [15, 2], [19, 2], [19, 2], [19, 1], [19, 1], [18, 2], [18, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 9], [7, 6], [7, 4], [7, 1], [7, 2], [7, 2], [7, 1], [21, 1], [21, 1], [21, 1], [20, 3], [20, 4], [20, 2], [20, 1], [40, 1], [40, 5], [41, 1], [41, 3], [43, 4], [43, 4], [43, 6], [43, 4], [43, 4], [43, 4], [43, 8], [43, 4], [43, 4], [43, 4], [43, 6], [43, 4], [43, 4], [43, 4], [43, 4], [43, 4], [43, 1], [39, 2], [39, 3], [39, 3], [39, 1], [39, 3], [74, 1], [74, 2], [74, 1], [74, 1], [70, 1], [71, 3], [30, 1], [30, 2], [30, 1], [30, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [28, 1], [28, 2], [28, 1], [28, 1], [24, 5], [25, 5], [26, 2], [26, 4], [26, 3], [26, 5], [26, 3], [26, 5], [26, 5], [26, 7], [26, 2], [26, 4], [26, 2], [26, 4], [26, 4], [26, 6], [22, 5], [23, 5], [23, 5], [23, 9], [23, 9], [23, 7], [23, 7], [100, 1], [100, 3], [89, 1], [89, 3], [104, 1], [104, 2], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [79, 1], [79, 1], [79, 1], [79, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [76, 1], [76, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [45, 1], [45, 2], [98, 1], [98, 2], [33, 1], [33, 1], [33, 1], [33, 1]],
+ symbols_: { "error": 2, "start": 3, "graphConfig": 4, "document": 5, "line": 6, "statement": 7, "SEMI": 8, "NEWLINE": 9, "SPACE": 10, "EOF": 11, "GRAPH": 12, "NODIR": 13, "DIR": 14, "FirstStmtSeparator": 15, "ending": 16, "endToken": 17, "spaceList": 18, "spaceListNewline": 19, "vertexStatement": 20, "separator": 21, "styleStatement": 22, "linkStyleStatement": 23, "classDefStatement": 24, "classStatement": 25, "clickStatement": 26, "subgraph": 27, "textNoTags": 28, "SQS": 29, "text": 30, "SQE": 31, "end": 32, "direction": 33, "acc_title": 34, "acc_title_value": 35, "acc_descr": 36, "acc_descr_value": 37, "acc_descr_multiline_value": 38, "shapeData": 39, "SHAPE_DATA": 40, "link": 41, "node": 42, "styledVertex": 43, "AMP": 44, "vertex": 45, "STYLE_SEPARATOR": 46, "idString": 47, "DOUBLECIRCLESTART": 48, "DOUBLECIRCLEEND": 49, "PS": 50, "PE": 51, "(-": 52, "-)": 53, "STADIUMSTART": 54, "STADIUMEND": 55, "SUBROUTINESTART": 56, "SUBROUTINEEND": 57, "VERTEX_WITH_PROPS_START": 58, "NODE_STRING[field]": 59, "COLON": 60, "NODE_STRING[value]": 61, "PIPE": 62, "CYLINDERSTART": 63, "CYLINDEREND": 64, "DIAMOND_START": 65, "DIAMOND_STOP": 66, "TAGEND": 67, "TRAPSTART": 68, "TRAPEND": 69, "INVTRAPSTART": 70, "INVTRAPEND": 71, "linkStatement": 72, "arrowText": 73, "TESTSTR": 74, "START_LINK": 75, "edgeText": 76, "LINK": 77, "LINK_ID": 78, "edgeTextToken": 79, "STR": 80, "MD_STR": 81, "textToken": 82, "keywords": 83, "STYLE": 84, "LINKSTYLE": 85, "CLASSDEF": 86, "CLASS": 87, "CLICK": 88, "DOWN": 89, "UP": 90, "textNoTagsToken": 91, "stylesOpt": 92, "idString[vertex]": 93, "idString[class]": 94, "CALLBACKNAME": 95, "CALLBACKARGS": 96, "HREF": 97, "LINK_TARGET": 98, "STR[link]": 99, "STR[tooltip]": 100, "alphaNum": 101, "DEFAULT": 102, "numList": 103, "INTERPOLATE": 104, "NUM": 105, "COMMA": 106, "style": 107, "styleComponent": 108, "NODE_STRING": 109, "UNIT": 110, "BRKT": 111, "PCT": 112, "idStringToken": 113, "MINUS": 114, "MULT": 115, "UNICODE_TEXT": 116, "TEXT": 117, "TAGSTART": 118, "EDGE_TEXT": 119, "alphaNumToken": 120, "direction_tb": 121, "direction_bt": 122, "direction_rl": 123, "direction_lr": 124, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 8: "SEMI", 9: "NEWLINE", 10: "SPACE", 11: "EOF", 12: "GRAPH", 13: "NODIR", 14: "DIR", 27: "subgraph", 29: "SQS", 31: "SQE", 32: "end", 34: "acc_title", 35: "acc_title_value", 36: "acc_descr", 37: "acc_descr_value", 38: "acc_descr_multiline_value", 40: "SHAPE_DATA", 44: "AMP", 46: "STYLE_SEPARATOR", 48: "DOUBLECIRCLESTART", 49: "DOUBLECIRCLEEND", 50: "PS", 51: "PE", 52: "(-", 53: "-)", 54: "STADIUMSTART", 55: "STADIUMEND", 56: "SUBROUTINESTART", 57: "SUBROUTINEEND", 58: "VERTEX_WITH_PROPS_START", 59: "NODE_STRING[field]", 60: "COLON", 61: "NODE_STRING[value]", 62: "PIPE", 63: "CYLINDERSTART", 64: "CYLINDEREND", 65: "DIAMOND_START", 66: "DIAMOND_STOP", 67: "TAGEND", 68: "TRAPSTART", 69: "TRAPEND", 70: "INVTRAPSTART", 71: "INVTRAPEND", 74: "TESTSTR", 75: "START_LINK", 77: "LINK", 78: "LINK_ID", 80: "STR", 81: "MD_STR", 84: "STYLE", 85: "LINKSTYLE", 86: "CLASSDEF", 87: "CLASS", 88: "CLICK", 89: "DOWN", 90: "UP", 93: "idString[vertex]", 94: "idString[class]", 95: "CALLBACKNAME", 96: "CALLBACKARGS", 97: "HREF", 98: "LINK_TARGET", 99: "STR[link]", 100: "STR[tooltip]", 102: "DEFAULT", 104: "INTERPOLATE", 105: "NUM", 106: "COMMA", 109: "NODE_STRING", 110: "UNIT", 111: "BRKT", 112: "PCT", 114: "MINUS", 115: "MULT", 116: "UNICODE_TEXT", 117: "TEXT", 118: "TAGSTART", 119: "EDGE_TEXT", 121: "direction_tb", 122: "direction_bt", 123: "direction_rl", 124: "direction_lr" },
+ productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 2], [4, 3], [16, 2], [16, 1], [17, 1], [17, 1], [17, 1], [15, 1], [15, 1], [15, 2], [19, 2], [19, 2], [19, 1], [19, 1], [18, 2], [18, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 9], [7, 6], [7, 4], [7, 1], [7, 2], [7, 2], [7, 1], [21, 1], [21, 1], [21, 1], [39, 2], [39, 1], [20, 4], [20, 3], [20, 4], [20, 2], [20, 2], [20, 1], [42, 1], [42, 6], [42, 5], [43, 1], [43, 3], [45, 4], [45, 4], [45, 6], [45, 4], [45, 4], [45, 4], [45, 8], [45, 4], [45, 4], [45, 4], [45, 6], [45, 4], [45, 4], [45, 4], [45, 4], [45, 4], [45, 1], [41, 2], [41, 3], [41, 3], [41, 1], [41, 3], [41, 4], [76, 1], [76, 2], [76, 1], [76, 1], [72, 1], [72, 2], [73, 3], [30, 1], [30, 2], [30, 1], [30, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [28, 1], [28, 2], [28, 1], [28, 1], [24, 5], [25, 5], [26, 2], [26, 4], [26, 3], [26, 5], [26, 3], [26, 5], [26, 5], [26, 7], [26, 2], [26, 4], [26, 2], [26, 4], [26, 4], [26, 6], [22, 5], [23, 5], [23, 5], [23, 9], [23, 9], [23, 7], [23, 7], [103, 1], [103, 3], [92, 1], [92, 3], [107, 1], [107, 2], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [82, 1], [82, 1], [82, 1], [82, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [79, 1], [79, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [47, 1], [47, 2], [101, 1], [101, 2], [33, 1], [33, 1], [33, 1], [33, 1]],
performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
var $0 = $$.length - 1;
switch (yystate) {
@@ -50252,7 +55746,7 @@ ${text2}
this.$ = $$[$0 - 1];
break;
case 4:
- case 176:
+ case 183:
this.$ = $$[$0];
break;
case 11:
@@ -50292,287 +55786,314 @@ ${text2}
yy.setAccDescription(this.$);
break;
case 43:
+ this.$ = $$[$0 - 1] + $$[$0];
+ break;
+ case 44:
+ this.$ = $$[$0];
+ break;
+ case 45:
+ yy.addVertex($$[$0 - 1][$$[$0 - 1].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, $$[$0]);
+ yy.addLink($$[$0 - 3].stmt, $$[$0 - 1], $$[$0 - 2]);
+ this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1].concat($$[$0 - 3].nodes) };
+ break;
+ case 46:
yy.addLink($$[$0 - 2].stmt, $$[$0], $$[$0 - 1]);
this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0 - 2].nodes) };
break;
- case 44:
+ case 47:
yy.addLink($$[$0 - 3].stmt, $$[$0 - 1], $$[$0 - 2]);
this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1].concat($$[$0 - 3].nodes) };
break;
- case 45:
+ case 48:
this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1] };
break;
- case 46:
+ case 49:
+ yy.addVertex($$[$0 - 1][$$[$0 - 1].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, $$[$0]);
+ this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1], shapeData: $$[$0] };
+ break;
+ case 50:
this.$ = { stmt: $$[$0], nodes: $$[$0] };
break;
- case 47:
+ case 51:
this.$ = [$$[$0]];
break;
- case 48:
+ case 52:
+ yy.addVertex($$[$0 - 5][$$[$0 - 5].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, $$[$0 - 4]);
+ this.$ = $$[$0 - 5].concat($$[$0]);
+ break;
+ case 53:
this.$ = $$[$0 - 4].concat($$[$0]);
break;
- case 49:
+ case 54:
this.$ = $$[$0];
break;
- case 50:
+ case 55:
this.$ = $$[$0 - 2];
yy.setClass($$[$0 - 2], $$[$0]);
break;
- case 51:
+ case 56:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "square");
break;
- case 52:
+ case 57:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "doublecircle");
break;
- case 53:
+ case 58:
this.$ = $$[$0 - 5];
yy.addVertex($$[$0 - 5], $$[$0 - 2], "circle");
break;
- case 54:
+ case 59:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "ellipse");
break;
- case 55:
+ case 60:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "stadium");
break;
- case 56:
+ case 61:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "subroutine");
break;
- case 57:
+ case 62:
this.$ = $$[$0 - 7];
yy.addVertex($$[$0 - 7], $$[$0 - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[$$[$0 - 5], $$[$0 - 3]]]));
break;
- case 58:
+ case 63:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "cylinder");
break;
- case 59:
+ case 64:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "round");
break;
- case 60:
+ case 65:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "diamond");
break;
- case 61:
+ case 66:
this.$ = $$[$0 - 5];
yy.addVertex($$[$0 - 5], $$[$0 - 2], "hexagon");
break;
- case 62:
+ case 67:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "odd");
break;
- case 63:
+ case 68:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "trapezoid");
break;
- case 64:
+ case 69:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "inv_trapezoid");
break;
- case 65:
+ case 70:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_right");
break;
- case 66:
+ case 71:
this.$ = $$[$0 - 3];
yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_left");
break;
- case 67:
+ case 72:
this.$ = $$[$0];
yy.addVertex($$[$0]);
break;
- case 68:
+ case 73:
$$[$0 - 1].text = $$[$0];
this.$ = $$[$0 - 1];
break;
- case 69:
- case 70:
+ case 74:
+ case 75:
$$[$0 - 2].text = $$[$0 - 1];
this.$ = $$[$0 - 2];
break;
- case 71:
+ case 76:
this.$ = $$[$0];
break;
- case 72:
+ case 77:
var inf = yy.destructLink($$[$0], $$[$0 - 2]);
this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length, "text": $$[$0 - 1] };
break;
- case 73:
+ case 78:
+ var inf = yy.destructLink($$[$0], $$[$0 - 2]);
+ this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length, "text": $$[$0 - 1], "id": $$[$0 - 3] };
+ break;
+ case 79:
this.$ = { text: $$[$0], type: "text" };
break;
- case 74:
+ case 80:
this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type };
break;
- case 75:
+ case 81:
this.$ = { text: $$[$0], type: "string" };
break;
- case 76:
+ case 82:
this.$ = { text: $$[$0], type: "markdown" };
break;
- case 77:
+ case 83:
var inf = yy.destructLink($$[$0]);
this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length };
break;
- case 78:
+ case 84:
+ var inf = yy.destructLink($$[$0]);
+ this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length, "id": $$[$0 - 1] };
+ break;
+ case 85:
this.$ = $$[$0 - 1];
break;
- case 79:
+ case 86:
this.$ = { text: $$[$0], type: "text" };
break;
- case 80:
+ case 87:
this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type };
break;
- case 81:
+ case 88:
this.$ = { text: $$[$0], type: "string" };
break;
- case 82:
- case 97:
+ case 89:
+ case 104:
this.$ = { text: $$[$0], type: "markdown" };
break;
- case 94:
+ case 101:
this.$ = { text: $$[$0], type: "text" };
break;
- case 95:
+ case 102:
this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type };
break;
- case 96:
+ case 103:
this.$ = { text: $$[$0], type: "text" };
break;
- case 98:
+ case 105:
this.$ = $$[$0 - 4];
yy.addClass($$[$0 - 2], $$[$0]);
break;
- case 99:
+ case 106:
this.$ = $$[$0 - 4];
yy.setClass($$[$0 - 2], $$[$0]);
break;
- case 100:
- case 108:
+ case 107:
+ case 115:
this.$ = $$[$0 - 1];
yy.setClickEvent($$[$0 - 1], $$[$0]);
break;
- case 101:
- case 109:
+ case 108:
+ case 116:
this.$ = $$[$0 - 3];
yy.setClickEvent($$[$0 - 3], $$[$0 - 2]);
yy.setTooltip($$[$0 - 3], $$[$0]);
break;
- case 102:
+ case 109:
this.$ = $$[$0 - 2];
yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]);
break;
- case 103:
+ case 110:
this.$ = $$[$0 - 4];
yy.setClickEvent($$[$0 - 4], $$[$0 - 3], $$[$0 - 2]);
yy.setTooltip($$[$0 - 4], $$[$0]);
break;
- case 104:
+ case 111:
this.$ = $$[$0 - 2];
yy.setLink($$[$0 - 2], $$[$0]);
break;
- case 105:
+ case 112:
this.$ = $$[$0 - 4];
yy.setLink($$[$0 - 4], $$[$0 - 2]);
yy.setTooltip($$[$0 - 4], $$[$0]);
break;
- case 106:
+ case 113:
this.$ = $$[$0 - 4];
yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]);
break;
- case 107:
+ case 114:
this.$ = $$[$0 - 6];
yy.setLink($$[$0 - 6], $$[$0 - 4], $$[$0]);
yy.setTooltip($$[$0 - 6], $$[$0 - 2]);
break;
- case 110:
+ case 117:
this.$ = $$[$0 - 1];
yy.setLink($$[$0 - 1], $$[$0]);
break;
- case 111:
+ case 118:
this.$ = $$[$0 - 3];
yy.setLink($$[$0 - 3], $$[$0 - 2]);
yy.setTooltip($$[$0 - 3], $$[$0]);
break;
- case 112:
+ case 119:
this.$ = $$[$0 - 3];
yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]);
break;
- case 113:
+ case 120:
this.$ = $$[$0 - 5];
yy.setLink($$[$0 - 5], $$[$0 - 4], $$[$0]);
yy.setTooltip($$[$0 - 5], $$[$0 - 2]);
break;
- case 114:
+ case 121:
this.$ = $$[$0 - 4];
yy.addVertex($$[$0 - 2], void 0, void 0, $$[$0]);
break;
- case 115:
+ case 122:
this.$ = $$[$0 - 4];
yy.updateLink([$$[$0 - 2]], $$[$0]);
break;
- case 116:
+ case 123:
this.$ = $$[$0 - 4];
yy.updateLink($$[$0 - 2], $$[$0]);
break;
- case 117:
+ case 124:
this.$ = $$[$0 - 8];
yy.updateLinkInterpolate([$$[$0 - 6]], $$[$0 - 2]);
yy.updateLink([$$[$0 - 6]], $$[$0]);
break;
- case 118:
+ case 125:
this.$ = $$[$0 - 8];
yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]);
yy.updateLink($$[$0 - 6], $$[$0]);
break;
- case 119:
+ case 126:
this.$ = $$[$0 - 6];
yy.updateLinkInterpolate([$$[$0 - 4]], $$[$0]);
break;
- case 120:
+ case 127:
this.$ = $$[$0 - 6];
yy.updateLinkInterpolate($$[$0 - 4], $$[$0]);
break;
- case 121:
- case 123:
+ case 128:
+ case 130:
this.$ = [$$[$0]];
break;
- case 122:
- case 124:
+ case 129:
+ case 131:
$$[$0 - 2].push($$[$0]);
this.$ = $$[$0 - 2];
break;
- case 126:
+ case 133:
this.$ = $$[$0 - 1] + $$[$0];
break;
- case 174:
+ case 181:
this.$ = $$[$0];
break;
- case 175:
+ case 182:
this.$ = $$[$0 - 1] + "" + $$[$0];
break;
- case 177:
+ case 184:
this.$ = $$[$0 - 1] + "" + $$[$0];
break;
- case 178:
+ case 185:
this.$ = { stmt: "dir", value: "TB" };
break;
- case 179:
+ case 186:
this.$ = { stmt: "dir", value: "BT" };
break;
- case 180:
+ case 187:
this.$ = { stmt: "dir", value: "RL" };
break;
- case 181:
+ case 188:
this.$ = { stmt: "dir", value: "LR" };
break;
}
}, "anonymous"),
- table: [{ 3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2 }, { 1: [3] }, o2($V3, $V4, { 5: 6 }), { 4: 7, 9: $V0, 10: $V1, 12: $V2 }, { 4: 8, 9: $V0, 10: $V1, 12: $V2 }, { 13: [1, 9], 14: [1, 10] }, { 1: [2, 1], 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, o2($V3, [2, 9]), o2($V3, [2, 10]), o2($V3, [2, 11]), { 8: [1, 54], 9: [1, 55], 10: $Vx, 15: 53, 18: 56 }, o2($Vy, [2, 3]), o2($Vy, [2, 4]), o2($Vy, [2, 5]), o2($Vy, [2, 6]), o2($Vy, [2, 7]), o2($Vy, [2, 8]), { 8: $Vz, 9: $VA, 11: $VB, 21: 58, 39: 59, 70: 63, 73: [1, 64], 75: [1, 65] }, { 8: $Vz, 9: $VA, 11: $VB, 21: 66 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 67 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 68 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 69 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 70 }, { 8: $Vz, 9: $VA, 10: [1, 71], 11: $VB, 21: 72 }, o2($Vy, [2, 36]), { 35: [1, 73] }, { 37: [1, 74] }, o2($Vy, [2, 39]), o2($VC, [2, 46], { 18: 75, 10: $Vx }), { 10: [1, 76] }, { 10: [1, 77] }, { 10: [1, 78] }, { 10: [1, 79] }, { 14: $VD, 42: $VE, 58: $VF, 77: [1, 83], 86: $VG, 92: [1, 80], 94: [1, 81], 98: 82, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, o2($Vy, [2, 178]), o2($Vy, [2, 179]), o2($Vy, [2, 180]), o2($Vy, [2, 181]), o2($VO, [2, 47]), o2($VO, [2, 49], { 44: [1, 96] }), o2($VP, [2, 67], { 110: 109, 29: [1, 97], 42: $Vd, 46: [1, 98], 48: [1, 99], 50: [1, 100], 52: [1, 101], 54: [1, 102], 56: [1, 103], 58: $Ve, 61: [1, 104], 63: [1, 105], 65: [1, 106], 66: [1, 107], 68: [1, 108], 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), o2($VQ, [2, 174]), o2($VQ, [2, 135]), o2($VQ, [2, 136]), o2($VQ, [2, 137]), o2($VQ, [2, 138]), o2($VQ, [2, 139]), o2($VQ, [2, 140]), o2($VQ, [2, 141]), o2($VQ, [2, 142]), o2($VQ, [2, 143]), o2($VQ, [2, 144]), o2($VQ, [2, 145]), o2($V3, [2, 12]), o2($V3, [2, 18]), o2($V3, [2, 19]), { 9: [1, 110] }, o2($VR, [2, 26], { 18: 111, 10: $Vx }), o2($Vy, [2, 27]), { 40: 112, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o2($Vy, [2, 40]), o2($Vy, [2, 41]), o2($Vy, [2, 42]), o2($VS, [2, 71], { 71: 113, 60: [1, 115], 72: [1, 114] }), { 74: 116, 76: 117, 77: [1, 118], 78: [1, 119], 113: $VT, 116: $VU }, o2([42, 58, 60, 72, 86, 99, 102, 103, 106, 108, 111, 112, 113], [2, 77]), o2($Vy, [2, 28]), o2($Vy, [2, 29]), o2($Vy, [2, 30]), o2($Vy, [2, 31]), o2($Vy, [2, 32]), { 10: $VV, 12: $VW, 14: $VX, 27: $VY, 28: 122, 32: $VZ, 42: $V_, 58: $V$, 73: $V01, 77: [1, 124], 78: [1, 125], 80: 135, 81: $V11, 82: $V21, 83: $V31, 84: $V41, 85: $V51, 86: $V61, 87: $V71, 88: 123, 102: $V81, 106: $V91, 108: $Va1, 111: $Vb1, 112: $Vc1, 113: $Vd1 }, o2($Ve1, $V4, { 5: 148 }), o2($Vy, [2, 37]), o2($Vy, [2, 38]), o2($VC, [2, 45], { 42: $Vf1 }), { 42: $Vd, 45: 150, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 99: [1, 151], 100: 152, 102: [1, 153] }, { 42: $Vd, 45: 154, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 42: $Vd, 45: 155, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o2($Vg1, [2, 100], { 10: [1, 156], 93: [1, 157] }), { 77: [1, 158] }, o2($Vg1, [2, 108], { 117: 160, 10: [1, 159], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o2($Vg1, [2, 110], { 10: [1, 161] }), o2($Vh1, [2, 176]), o2($Vh1, [2, 163]), o2($Vh1, [2, 164]), o2($Vh1, [2, 165]), o2($Vh1, [2, 166]), o2($Vh1, [2, 167]), o2($Vh1, [2, 168]), o2($Vh1, [2, 169]), o2($Vh1, [2, 170]), o2($Vh1, [2, 171]), o2($Vh1, [2, 172]), o2($Vh1, [2, 173]), { 42: $Vd, 45: 162, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 30: 163, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 171, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 173, 48: [1, 172], 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 174, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 175, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 176, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 106: [1, 177] }, { 30: 178, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 179, 63: [1, 180], 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 181, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 182, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 183, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VQ, [2, 175]), o2($V3, [2, 20]), o2($VR, [2, 25]), o2($VC, [2, 43], { 18: 184, 10: $Vx }), o2($VS, [2, 68], { 10: [1, 185] }), { 10: [1, 186] }, { 30: 187, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 75: [1, 188], 76: 189, 113: $VT, 116: $VU }, o2($Vo1, [2, 73]), o2($Vo1, [2, 75]), o2($Vo1, [2, 76]), o2($Vo1, [2, 161]), o2($Vo1, [2, 162]), { 8: $Vz, 9: $VA, 10: $VV, 11: $VB, 12: $VW, 14: $VX, 21: 191, 27: $VY, 29: [1, 190], 32: $VZ, 42: $V_, 58: $V$, 73: $V01, 80: 135, 81: $V11, 82: $V21, 83: $V31, 84: $V41, 85: $V51, 86: $V61, 87: $V71, 88: 192, 102: $V81, 106: $V91, 108: $Va1, 111: $Vb1, 112: $Vc1, 113: $Vd1 }, o2($Vp1, [2, 94]), o2($Vp1, [2, 96]), o2($Vp1, [2, 97]), o2($Vp1, [2, 150]), o2($Vp1, [2, 151]), o2($Vp1, [2, 152]), o2($Vp1, [2, 153]), o2($Vp1, [2, 154]), o2($Vp1, [2, 155]), o2($Vp1, [2, 156]), o2($Vp1, [2, 157]), o2($Vp1, [2, 158]), o2($Vp1, [2, 159]), o2($Vp1, [2, 160]), o2($Vp1, [2, 83]), o2($Vp1, [2, 84]), o2($Vp1, [2, 85]), o2($Vp1, [2, 86]), o2($Vp1, [2, 87]), o2($Vp1, [2, 88]), o2($Vp1, [2, 89]), o2($Vp1, [2, 90]), o2($Vp1, [2, 91]), o2($Vp1, [2, 92]), o2($Vp1, [2, 93]), { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 193], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, { 10: $Vx, 18: 194 }, { 10: [1, 195], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: [1, 196] }, { 10: [1, 197], 103: [1, 198] }, o2($Vq1, [2, 121]), { 10: [1, 199], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: [1, 200], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 77: [1, 201] }, o2($Vg1, [2, 102], { 10: [1, 202] }), o2($Vg1, [2, 104], { 10: [1, 203] }), { 77: [1, 204] }, o2($Vh1, [2, 177]), { 77: [1, 205], 95: [1, 206] }, o2($VO, [2, 50], { 110: 109, 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), { 31: [1, 207], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($Vr1, [2, 79]), o2($Vr1, [2, 81]), o2($Vr1, [2, 82]), o2($Vr1, [2, 146]), o2($Vr1, [2, 147]), o2($Vr1, [2, 148]), o2($Vr1, [2, 149]), { 47: [1, 209], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 210, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 49: [1, 211], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 51: [1, 212], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 53: [1, 213], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 55: [1, 214], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 58: [1, 215] }, { 62: [1, 216], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 64: [1, 217], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 218, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 31: [1, 219], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 65: $Vi1, 67: [1, 220], 69: [1, 221], 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 65: $Vi1, 67: [1, 223], 69: [1, 222], 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VC, [2, 44], { 42: $Vf1 }), o2($VS, [2, 70]), o2($VS, [2, 69]), { 60: [1, 224], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VS, [2, 72]), o2($Vo1, [2, 74]), { 30: 225, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($Ve1, $V4, { 5: 226 }), o2($Vp1, [2, 95]), o2($Vy, [2, 35]), { 41: 227, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 228, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 239, 101: [1, 240], 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 241, 101: [1, 242], 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 102: [1, 243] }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 244, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 42: $Vd, 45: 245, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o2($Vg1, [2, 101]), { 77: [1, 246] }, { 77: [1, 247], 95: [1, 248] }, o2($Vg1, [2, 109]), o2($Vg1, [2, 111], { 10: [1, 249] }), o2($Vg1, [2, 112]), o2($VP, [2, 51]), o2($Vr1, [2, 80]), o2($VP, [2, 52]), { 49: [1, 250], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VP, [2, 59]), o2($VP, [2, 54]), o2($VP, [2, 55]), o2($VP, [2, 56]), { 106: [1, 251] }, o2($VP, [2, 58]), o2($VP, [2, 60]), { 64: [1, 252], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VP, [2, 62]), o2($VP, [2, 63]), o2($VP, [2, 65]), o2($VP, [2, 64]), o2($VP, [2, 66]), o2([10, 42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], [2, 78]), { 31: [1, 253], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 254], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, o2($VO, [2, 48]), o2($Vg1, [2, 114], { 103: $VA1 }), o2($VB1, [2, 123], { 105: 256, 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }), o2($VC1, [2, 125]), o2($VC1, [2, 127]), o2($VC1, [2, 128]), o2($VC1, [2, 129]), o2($VC1, [2, 130]), o2($VC1, [2, 131]), o2($VC1, [2, 132]), o2($VC1, [2, 133]), o2($VC1, [2, 134]), o2($Vg1, [2, 115], { 103: $VA1 }), { 10: [1, 257] }, o2($Vg1, [2, 116], { 103: $VA1 }), { 10: [1, 258] }, o2($Vq1, [2, 122]), o2($Vg1, [2, 98], { 103: $VA1 }), o2($Vg1, [2, 99], { 110: 109, 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), o2($Vg1, [2, 103]), o2($Vg1, [2, 105], { 10: [1, 259] }), o2($Vg1, [2, 106]), { 95: [1, 260] }, { 49: [1, 261] }, { 60: [1, 262] }, { 64: [1, 263] }, { 8: $Vz, 9: $VA, 11: $VB, 21: 264 }, o2($Vy, [2, 34]), { 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 104: 265, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, o2($VC1, [2, 126]), { 14: $VD, 42: $VE, 58: $VF, 86: $VG, 98: 266, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, { 14: $VD, 42: $VE, 58: $VF, 86: $VG, 98: 267, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, { 95: [1, 268] }, o2($Vg1, [2, 113]), o2($VP, [2, 53]), { 30: 269, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VP, [2, 61]), o2($Ve1, $V4, { 5: 270 }), o2($VB1, [2, 124], { 105: 256, 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }), o2($Vg1, [2, 119], { 117: 160, 10: [1, 271], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o2($Vg1, [2, 120], { 117: 160, 10: [1, 272], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o2($Vg1, [2, 107]), { 31: [1, 273], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 274], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 275, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 276, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, o2($VP, [2, 57]), o2($Vy, [2, 33]), o2($Vg1, [2, 117], { 103: $VA1 }), o2($Vg1, [2, 118], { 103: $VA1 })],
+ table: [{ 3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2 }, { 1: [3] }, o2($V3, $V4, { 5: 6 }), { 4: 7, 9: $V0, 10: $V1, 12: $V2 }, { 4: 8, 9: $V0, 10: $V1, 12: $V2 }, { 13: [1, 9], 14: [1, 10] }, { 1: [2, 1], 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 42: 28, 43: 38, 44: $Vd, 45: 39, 47: 40, 60: $Ve, 84: $Vf, 85: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs, 121: $Vt, 122: $Vu, 123: $Vv, 124: $Vw }, o2($V3, [2, 9]), o2($V3, [2, 10]), o2($V3, [2, 11]), { 8: [1, 54], 9: [1, 55], 10: $Vx, 15: 53, 18: 56 }, o2($Vy, [2, 3]), o2($Vy, [2, 4]), o2($Vy, [2, 5]), o2($Vy, [2, 6]), o2($Vy, [2, 7]), o2($Vy, [2, 8]), { 8: $Vz, 9: $VA, 11: $VB, 21: 58, 41: 59, 72: 63, 75: [1, 64], 77: [1, 66], 78: [1, 65] }, { 8: $Vz, 9: $VA, 11: $VB, 21: 67 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 68 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 69 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 70 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 71 }, { 8: $Vz, 9: $VA, 10: [1, 72], 11: $VB, 21: 73 }, o2($Vy, [2, 36]), { 35: [1, 74] }, { 37: [1, 75] }, o2($Vy, [2, 39]), o2($VC, [2, 50], { 18: 76, 39: 77, 10: $Vx, 40: $VD }), { 10: [1, 79] }, { 10: [1, 80] }, { 10: [1, 81] }, { 10: [1, 82] }, { 14: $VE, 44: $VF, 60: $VG, 80: [1, 86], 89: $VH, 95: [1, 83], 97: [1, 84], 101: 85, 105: $VI, 106: $VJ, 109: $VK, 111: $VL, 114: $VM, 115: $VN, 116: $VO, 120: 87 }, o2($Vy, [2, 185]), o2($Vy, [2, 186]), o2($Vy, [2, 187]), o2($Vy, [2, 188]), o2($VP, [2, 51]), o2($VP, [2, 54], { 46: [1, 99] }), o2($VQ, [2, 72], { 113: 112, 29: [1, 100], 44: $Vd, 48: [1, 101], 50: [1, 102], 52: [1, 103], 54: [1, 104], 56: [1, 105], 58: [1, 106], 60: $Ve, 63: [1, 107], 65: [1, 108], 67: [1, 109], 68: [1, 110], 70: [1, 111], 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 114: $Vq, 115: $Vr, 116: $Vs }), o2($VR, [2, 181]), o2($VR, [2, 142]), o2($VR, [2, 143]), o2($VR, [2, 144]), o2($VR, [2, 145]), o2($VR, [2, 146]), o2($VR, [2, 147]), o2($VR, [2, 148]), o2($VR, [2, 149]), o2($VR, [2, 150]), o2($VR, [2, 151]), o2($VR, [2, 152]), o2($V3, [2, 12]), o2($V3, [2, 18]), o2($V3, [2, 19]), { 9: [1, 113] }, o2($VS, [2, 26], { 18: 114, 10: $Vx }), o2($Vy, [2, 27]), { 42: 115, 43: 38, 44: $Vd, 45: 39, 47: 40, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs }, o2($Vy, [2, 40]), o2($Vy, [2, 41]), o2($Vy, [2, 42]), o2($VT, [2, 76], { 73: 116, 62: [1, 118], 74: [1, 117] }), { 76: 119, 79: 120, 80: $VU, 81: $VV, 116: $VW, 119: $VX }, { 75: [1, 125], 77: [1, 126] }, o2($VY, [2, 83]), o2($Vy, [2, 28]), o2($Vy, [2, 29]), o2($Vy, [2, 30]), o2($Vy, [2, 31]), o2($Vy, [2, 32]), { 10: $VZ, 12: $V_, 14: $V$, 27: $V01, 28: 127, 32: $V11, 44: $V21, 60: $V31, 75: $V41, 80: [1, 129], 81: [1, 130], 83: 140, 84: $V51, 85: $V61, 86: $V71, 87: $V81, 88: $V91, 89: $Va1, 90: $Vb1, 91: 128, 105: $Vc1, 109: $Vd1, 111: $Ve1, 114: $Vf1, 115: $Vg1, 116: $Vh1 }, o2($Vi1, $V4, { 5: 153 }), o2($Vy, [2, 37]), o2($Vy, [2, 38]), o2($VC, [2, 48], { 44: $Vj1 }), o2($VC, [2, 49], { 18: 155, 10: $Vx, 40: $Vk1 }), o2($VP, [2, 44]), { 44: $Vd, 47: 157, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs }, { 102: [1, 158], 103: 159, 105: [1, 160] }, { 44: $Vd, 47: 161, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs }, { 44: $Vd, 47: 162, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs }, o2($Vl1, [2, 107], { 10: [1, 163], 96: [1, 164] }), { 80: [1, 165] }, o2($Vl1, [2, 115], { 120: 167, 10: [1, 166], 14: $VE, 44: $VF, 60: $VG, 89: $VH, 105: $VI, 106: $VJ, 109: $VK, 111: $VL, 114: $VM, 115: $VN, 116: $VO }), o2($Vl1, [2, 117], { 10: [1, 168] }), o2($Vm1, [2, 183]), o2($Vm1, [2, 170]), o2($Vm1, [2, 171]), o2($Vm1, [2, 172]), o2($Vm1, [2, 173]), o2($Vm1, [2, 174]), o2($Vm1, [2, 175]), o2($Vm1, [2, 176]), o2($Vm1, [2, 177]), o2($Vm1, [2, 178]), o2($Vm1, [2, 179]), o2($Vm1, [2, 180]), { 44: $Vd, 47: 169, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs }, { 30: 170, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 178, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 180, 50: [1, 179], 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 181, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 182, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 183, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 109: [1, 184] }, { 30: 185, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 186, 65: [1, 187], 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 188, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 189, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 190, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, o2($VR, [2, 182]), o2($V3, [2, 20]), o2($VS, [2, 25]), o2($VC, [2, 46], { 39: 191, 18: 192, 10: $Vx, 40: $VD }), o2($VT, [2, 73], { 10: [1, 193] }), { 10: [1, 194] }, { 30: 195, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 77: [1, 196], 79: 197, 116: $VW, 119: $VX }, o2($Vt1, [2, 79]), o2($Vt1, [2, 81]), o2($Vt1, [2, 82]), o2($Vt1, [2, 168]), o2($Vt1, [2, 169]), { 76: 198, 79: 120, 80: $VU, 81: $VV, 116: $VW, 119: $VX }, o2($VY, [2, 84]), { 8: $Vz, 9: $VA, 10: $VZ, 11: $VB, 12: $V_, 14: $V$, 21: 200, 27: $V01, 29: [1, 199], 32: $V11, 44: $V21, 60: $V31, 75: $V41, 83: 140, 84: $V51, 85: $V61, 86: $V71, 87: $V81, 88: $V91, 89: $Va1, 90: $Vb1, 91: 201, 105: $Vc1, 109: $Vd1, 111: $Ve1, 114: $Vf1, 115: $Vg1, 116: $Vh1 }, o2($Vu1, [2, 101]), o2($Vu1, [2, 103]), o2($Vu1, [2, 104]), o2($Vu1, [2, 157]), o2($Vu1, [2, 158]), o2($Vu1, [2, 159]), o2($Vu1, [2, 160]), o2($Vu1, [2, 161]), o2($Vu1, [2, 162]), o2($Vu1, [2, 163]), o2($Vu1, [2, 164]), o2($Vu1, [2, 165]), o2($Vu1, [2, 166]), o2($Vu1, [2, 167]), o2($Vu1, [2, 90]), o2($Vu1, [2, 91]), o2($Vu1, [2, 92]), o2($Vu1, [2, 93]), o2($Vu1, [2, 94]), o2($Vu1, [2, 95]), o2($Vu1, [2, 96]), o2($Vu1, [2, 97]), o2($Vu1, [2, 98]), o2($Vu1, [2, 99]), o2($Vu1, [2, 100]), { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 202], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 42: 28, 43: 38, 44: $Vd, 45: 39, 47: 40, 60: $Ve, 84: $Vf, 85: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs, 121: $Vt, 122: $Vu, 123: $Vv, 124: $Vw }, { 10: $Vx, 18: 203 }, { 44: [1, 204] }, o2($VP, [2, 43]), { 10: [1, 205], 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 112, 114: $Vq, 115: $Vr, 116: $Vs }, { 10: [1, 206] }, { 10: [1, 207], 106: [1, 208] }, o2($Vv1, [2, 128]), { 10: [1, 209], 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 112, 114: $Vq, 115: $Vr, 116: $Vs }, { 10: [1, 210], 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 112, 114: $Vq, 115: $Vr, 116: $Vs }, { 80: [1, 211] }, o2($Vl1, [2, 109], { 10: [1, 212] }), o2($Vl1, [2, 111], { 10: [1, 213] }), { 80: [1, 214] }, o2($Vm1, [2, 184]), { 80: [1, 215], 98: [1, 216] }, o2($VP, [2, 55], { 113: 112, 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 114: $Vq, 115: $Vr, 116: $Vs }), { 31: [1, 217], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, o2($Vw1, [2, 86]), o2($Vw1, [2, 88]), o2($Vw1, [2, 89]), o2($Vw1, [2, 153]), o2($Vw1, [2, 154]), o2($Vw1, [2, 155]), o2($Vw1, [2, 156]), { 49: [1, 219], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 220, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 51: [1, 221], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 53: [1, 222], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 55: [1, 223], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 57: [1, 224], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 60: [1, 225] }, { 64: [1, 226], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 66: [1, 227], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 30: 228, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 31: [1, 229], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 67: $Vn1, 69: [1, 230], 71: [1, 231], 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 67: $Vn1, 69: [1, 233], 71: [1, 232], 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, o2($VC, [2, 45], { 18: 155, 10: $Vx, 40: $Vk1 }), o2($VC, [2, 47], { 44: $Vj1 }), o2($VT, [2, 75]), o2($VT, [2, 74]), { 62: [1, 234], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, o2($VT, [2, 77]), o2($Vt1, [2, 80]), { 77: [1, 235], 79: 197, 116: $VW, 119: $VX }, { 30: 236, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, o2($Vi1, $V4, { 5: 237 }), o2($Vu1, [2, 102]), o2($Vy, [2, 35]), { 43: 238, 44: $Vd, 45: 39, 47: 40, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs }, { 10: $Vx, 18: 239 }, { 10: $Vx1, 60: $Vy1, 84: $Vz1, 92: 240, 105: $VA1, 107: 241, 108: 242, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }, { 10: $Vx1, 60: $Vy1, 84: $Vz1, 92: 251, 104: [1, 252], 105: $VA1, 107: 241, 108: 242, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }, { 10: $Vx1, 60: $Vy1, 84: $Vz1, 92: 253, 104: [1, 254], 105: $VA1, 107: 241, 108: 242, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }, { 105: [1, 255] }, { 10: $Vx1, 60: $Vy1, 84: $Vz1, 92: 256, 105: $VA1, 107: 241, 108: 242, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }, { 44: $Vd, 47: 257, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs }, o2($Vl1, [2, 108]), { 80: [1, 258] }, { 80: [1, 259], 98: [1, 260] }, o2($Vl1, [2, 116]), o2($Vl1, [2, 118], { 10: [1, 261] }), o2($Vl1, [2, 119]), o2($VQ, [2, 56]), o2($Vw1, [2, 87]), o2($VQ, [2, 57]), { 51: [1, 262], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, o2($VQ, [2, 64]), o2($VQ, [2, 59]), o2($VQ, [2, 60]), o2($VQ, [2, 61]), { 109: [1, 263] }, o2($VQ, [2, 63]), o2($VQ, [2, 65]), { 66: [1, 264], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, o2($VQ, [2, 67]), o2($VQ, [2, 68]), o2($VQ, [2, 70]), o2($VQ, [2, 69]), o2($VQ, [2, 71]), o2([10, 44, 60, 89, 102, 105, 106, 109, 111, 114, 115, 116], [2, 85]), o2($VT, [2, 78]), { 31: [1, 265], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 266], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 42: 28, 43: 38, 44: $Vd, 45: 39, 47: 40, 60: $Ve, 84: $Vf, 85: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs, 121: $Vt, 122: $Vu, 123: $Vv, 124: $Vw }, o2($VP, [2, 53]), { 43: 267, 44: $Vd, 45: 39, 47: 40, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs }, o2($Vl1, [2, 121], { 106: $VF1 }), o2($VG1, [2, 130], { 108: 269, 10: $Vx1, 60: $Vy1, 84: $Vz1, 105: $VA1, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }), o2($VH1, [2, 132]), o2($VH1, [2, 134]), o2($VH1, [2, 135]), o2($VH1, [2, 136]), o2($VH1, [2, 137]), o2($VH1, [2, 138]), o2($VH1, [2, 139]), o2($VH1, [2, 140]), o2($VH1, [2, 141]), o2($Vl1, [2, 122], { 106: $VF1 }), { 10: [1, 270] }, o2($Vl1, [2, 123], { 106: $VF1 }), { 10: [1, 271] }, o2($Vv1, [2, 129]), o2($Vl1, [2, 105], { 106: $VF1 }), o2($Vl1, [2, 106], { 113: 112, 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 114: $Vq, 115: $Vr, 116: $Vs }), o2($Vl1, [2, 110]), o2($Vl1, [2, 112], { 10: [1, 272] }), o2($Vl1, [2, 113]), { 98: [1, 273] }, { 51: [1, 274] }, { 62: [1, 275] }, { 66: [1, 276] }, { 8: $Vz, 9: $VA, 11: $VB, 21: 277 }, o2($Vy, [2, 34]), o2($VP, [2, 52]), { 10: $Vx1, 60: $Vy1, 84: $Vz1, 105: $VA1, 107: 278, 108: 242, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }, o2($VH1, [2, 133]), { 14: $VE, 44: $VF, 60: $VG, 89: $VH, 101: 279, 105: $VI, 106: $VJ, 109: $VK, 111: $VL, 114: $VM, 115: $VN, 116: $VO, 120: 87 }, { 14: $VE, 44: $VF, 60: $VG, 89: $VH, 101: 280, 105: $VI, 106: $VJ, 109: $VK, 111: $VL, 114: $VM, 115: $VN, 116: $VO, 120: 87 }, { 98: [1, 281] }, o2($Vl1, [2, 120]), o2($VQ, [2, 58]), { 30: 282, 67: $Vn1, 80: $Vo1, 81: $Vp1, 82: 171, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, o2($VQ, [2, 66]), o2($Vi1, $V4, { 5: 283 }), o2($VG1, [2, 131], { 108: 269, 10: $Vx1, 60: $Vy1, 84: $Vz1, 105: $VA1, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }), o2($Vl1, [2, 126], { 120: 167, 10: [1, 284], 14: $VE, 44: $VF, 60: $VG, 89: $VH, 105: $VI, 106: $VJ, 109: $VK, 111: $VL, 114: $VM, 115: $VN, 116: $VO }), o2($Vl1, [2, 127], { 120: 167, 10: [1, 285], 14: $VE, 44: $VF, 60: $VG, 89: $VH, 105: $VI, 106: $VJ, 109: $VK, 111: $VL, 114: $VM, 115: $VN, 116: $VO }), o2($Vl1, [2, 114]), { 31: [1, 286], 67: $Vn1, 82: 218, 116: $Vq1, 117: $Vr1, 118: $Vs1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 287], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 42: 28, 43: 38, 44: $Vd, 45: 39, 47: 40, 60: $Ve, 84: $Vf, 85: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 41, 114: $Vq, 115: $Vr, 116: $Vs, 121: $Vt, 122: $Vu, 123: $Vv, 124: $Vw }, { 10: $Vx1, 60: $Vy1, 84: $Vz1, 92: 288, 105: $VA1, 107: 241, 108: 242, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }, { 10: $Vx1, 60: $Vy1, 84: $Vz1, 92: 289, 105: $VA1, 107: 241, 108: 242, 109: $VB1, 110: $VC1, 111: $VD1, 112: $VE1 }, o2($VQ, [2, 62]), o2($Vy, [2, 33]), o2($Vl1, [2, 124], { 106: $VF1 }), o2($Vl1, [2, 125], { 106: $VF1 })],
defaultActions: {},
parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
if (hash.recoverable) {
@@ -50583,7 +56104,7 @@ ${text2}
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -50613,7 +56134,7 @@ ${text2}
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -50625,22 +56146,22 @@ ${text2}
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -50659,7 +56180,7 @@ ${text2}
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -50959,7 +56480,7 @@ ${text2}
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -51035,135 +56556,135 @@ ${text2}
return "acc_descr_multiline_value";
break;
case 7:
- this.begin("callbackname");
+ this.pushState("shapeData");
+ yy_.yytext = "";
+ return 40;
break;
case 8:
- this.popState();
+ this.pushState("shapeDataStr");
+ return 40;
break;
case 9:
this.popState();
- this.begin("callbackargs");
+ return 40;
break;
case 10:
- return 92;
+ const re2 = /\n\s*/g;
+ yy_.yytext = yy_.yytext.replace(re2, " ");
+ return 40;
break;
case 11:
- this.popState();
+ return 40;
break;
case 12:
- return 93;
+ this.popState();
break;
case 13:
- return "MD_STR";
+ this.begin("callbackname");
break;
case 14:
this.popState();
break;
case 15:
- this.begin("md_string");
+ this.popState();
+ this.begin("callbackargs");
break;
case 16:
- return "STR";
+ return 95;
break;
case 17:
this.popState();
break;
case 18:
- this.pushState("string");
+ return 96;
break;
case 19:
- return 81;
+ return "MD_STR";
break;
case 20:
- return 99;
+ this.popState();
break;
case 21:
- return 82;
+ this.begin("md_string");
break;
case 22:
- return 101;
+ return "STR";
break;
case 23:
- return 83;
+ this.popState();
break;
case 24:
- return 84;
+ this.pushState("string");
break;
case 25:
- return 94;
+ return 84;
break;
case 26:
- this.begin("click");
+ return 102;
break;
case 27:
- this.popState();
+ return 85;
break;
case 28:
- return 85;
+ return 104;
break;
case 29:
- if (yy.lex.firstGraph()) {
- this.begin("dir");
- }
- return 12;
+ return 86;
break;
case 30:
- if (yy.lex.firstGraph()) {
- this.begin("dir");
- }
- return 12;
+ return 87;
break;
case 31:
- if (yy.lex.firstGraph()) {
- this.begin("dir");
- }
- return 12;
+ return 97;
break;
case 32:
- return 27;
+ this.begin("click");
break;
case 33:
- return 32;
+ this.popState();
break;
case 34:
- return 95;
+ return 88;
break;
case 35:
- return 95;
+ if (yy.lex.firstGraph()) {
+ this.begin("dir");
+ }
+ return 12;
break;
case 36:
- return 95;
+ if (yy.lex.firstGraph()) {
+ this.begin("dir");
+ }
+ return 12;
break;
case 37:
- return 95;
+ if (yy.lex.firstGraph()) {
+ this.begin("dir");
+ }
+ return 12;
break;
case 38:
- this.popState();
- return 13;
+ return 27;
break;
case 39:
- this.popState();
- return 14;
+ return 32;
break;
case 40:
- this.popState();
- return 14;
+ return 98;
break;
case 41:
- this.popState();
- return 14;
+ return 98;
break;
case 42:
- this.popState();
- return 14;
+ return 98;
break;
case 43:
- this.popState();
- return 14;
+ return 98;
break;
case 44:
this.popState();
- return 14;
+ return 13;
break;
case 45:
this.popState();
@@ -51182,240 +56703,267 @@ ${text2}
return 14;
break;
case 49:
- return 118;
+ this.popState();
+ return 14;
break;
case 50:
- return 119;
+ this.popState();
+ return 14;
break;
case 51:
- return 120;
+ this.popState();
+ return 14;
break;
case 52:
- return 121;
+ this.popState();
+ return 14;
break;
case 53:
- return 102;
+ this.popState();
+ return 14;
break;
case 54:
- return 108;
+ this.popState();
+ return 14;
break;
case 55:
- return 44;
+ return 121;
break;
case 56:
- return 58;
+ return 122;
break;
case 57:
- return 42;
+ return 123;
break;
case 58:
- return 8;
+ return 124;
break;
case 59:
- return 103;
+ return 78;
break;
case 60:
- return 112;
+ return 105;
break;
case 61:
- this.popState();
- return 75;
+ return 111;
break;
case 62:
- this.pushState("edgeText");
- return 73;
+ return 46;
break;
case 63:
- return 116;
+ return 60;
break;
case 64:
- this.popState();
- return 75;
+ return 44;
break;
case 65:
- this.pushState("thickEdgeText");
- return 73;
+ return 8;
break;
case 66:
- return 116;
+ return 106;
break;
case 67:
- this.popState();
- return 75;
+ return 115;
break;
case 68:
- this.pushState("dottedEdgeText");
- return 73;
+ this.popState();
+ return 77;
break;
case 69:
- return 116;
+ this.pushState("edgeText");
+ return 75;
break;
case 70:
- return 75;
+ return 119;
break;
case 71:
this.popState();
- return 51;
+ return 77;
break;
case 72:
- return "TEXT";
+ this.pushState("thickEdgeText");
+ return 75;
break;
case 73:
- this.pushState("ellipseText");
- return 50;
+ return 119;
break;
case 74:
this.popState();
- return 53;
+ return 77;
break;
case 75:
- this.pushState("text");
- return 52;
+ this.pushState("dottedEdgeText");
+ return 75;
break;
case 76:
- this.popState();
- return 55;
+ return 119;
break;
case 77:
- this.pushState("text");
- return 54;
+ return 77;
break;
case 78:
- return 56;
+ this.popState();
+ return 53;
break;
case 79:
- this.pushState("text");
- return 65;
+ return "TEXT";
break;
case 80:
- this.popState();
- return 62;
+ this.pushState("ellipseText");
+ return 52;
break;
case 81:
- this.pushState("text");
- return 61;
+ this.popState();
+ return 55;
break;
case 82:
- this.popState();
- return 47;
+ this.pushState("text");
+ return 54;
break;
case 83:
- this.pushState("text");
- return 46;
+ this.popState();
+ return 57;
break;
case 84:
- this.popState();
- return 67;
+ this.pushState("text");
+ return 56;
break;
case 85:
- this.popState();
- return 69;
+ return 58;
break;
case 86:
- return 114;
+ this.pushState("text");
+ return 67;
break;
case 87:
- this.pushState("trapText");
- return 66;
+ this.popState();
+ return 64;
break;
case 88:
- this.pushState("trapText");
- return 68;
+ this.pushState("text");
+ return 63;
break;
case 89:
- return 115;
+ this.popState();
+ return 49;
break;
case 90:
- return 65;
+ this.pushState("text");
+ return 48;
break;
case 91:
- return 87;
+ this.popState();
+ return 69;
break;
case 92:
- return "SEP";
+ this.popState();
+ return 71;
break;
case 93:
- return 86;
+ return 117;
break;
case 94:
- return 112;
+ this.pushState("trapText");
+ return 68;
break;
case 95:
- return 108;
+ this.pushState("trapText");
+ return 70;
break;
case 96:
- return 42;
+ return 118;
break;
case 97:
- return 106;
+ return 67;
break;
case 98:
- return 111;
+ return 90;
break;
case 99:
- return 113;
+ return "SEP";
break;
case 100:
- this.popState();
- return 60;
+ return 89;
break;
case 101:
- this.pushState("text");
- return 60;
+ return 115;
break;
case 102:
- this.popState();
- return 49;
+ return 111;
break;
case 103:
- this.pushState("text");
- return 48;
+ return 44;
break;
case 104:
+ return 109;
+ break;
+ case 105:
+ return 114;
+ break;
+ case 106:
+ return 116;
+ break;
+ case 107:
+ this.popState();
+ return 62;
+ break;
+ case 108:
+ this.pushState("text");
+ return 62;
+ break;
+ case 109:
+ this.popState();
+ return 51;
+ break;
+ case 110:
+ this.pushState("text");
+ return 50;
+ break;
+ case 111:
this.popState();
return 31;
break;
- case 105:
+ case 112:
this.pushState("text");
return 29;
break;
- case 106:
+ case 113:
this.popState();
- return 64;
+ return 66;
break;
- case 107:
+ case 114:
this.pushState("text");
- return 63;
+ return 65;
break;
- case 108:
+ case 115:
return "TEXT";
break;
- case 109:
+ case 116:
return "QUOTE";
break;
- case 110:
+ case 117:
return 9;
break;
- case 111:
+ case 118:
return 10;
break;
- case 112:
+ case 119:
return 11;
break;
}
}, "anonymous"),
- rules: [/^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["][`])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:["])/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s])/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:flowchart-elk\b)/, /^(?:graph\b)/, /^(?:flowchart\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:[^-]|-(?!-)+)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:[^=]|=(?!))/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:[^\.]|\.(?!))/, /^(?:\s*~~[\~]+\s*)/, /^(?:[-/\)][\)])/, /^(?:[^\(\)\[\]\{\}]|!\)+)/, /^(?:\(-)/, /^(?:\]\))/, /^(?:\(\[)/, /^(?:\]\])/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:>)/, /^(?:\)\])/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\(\(\()/, /^(?:[\\(?=\])][\]])/, /^(?:\/(?=\])\])/, /^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:\*)/, /^(?:#)/, /^(?:&)/, /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, /^(?:-)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\|)/, /^(?:\))/, /^(?:\()/, /^(?:\])/, /^(?:\[)/, /^(?:(\}))/, /^(?:\{)/, /^(?:[^\[\]\(\)\{\}\|\"]+)/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/],
- conditions: { "callbackargs": { "rules": [11, 12, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "callbackname": { "rules": [8, 9, 10, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "href": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "click": { "rules": [15, 18, 27, 28, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "dottedEdgeText": { "rules": [15, 18, 67, 69, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "thickEdgeText": { "rules": [15, 18, 64, 66, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "edgeText": { "rules": [15, 18, 61, 63, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "trapText": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 84, 85, 86, 87, 88, 101, 103, 105, 107], "inclusive": false }, "ellipseText": { "rules": [15, 18, 70, 71, 72, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "text": { "rules": [15, 18, 70, 73, 74, 75, 76, 77, 80, 81, 82, 83, 87, 88, 100, 101, 102, 103, 104, 105, 106, 107, 108], "inclusive": false }, "vertex": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "dir": { "rules": [15, 18, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_descr_multiline": { "rules": [5, 6, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_descr": { "rules": [3, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_title": { "rules": [1, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "md_string": { "rules": [13, 14, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "string": { "rules": [15, 16, 17, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 67, 68, 70, 73, 75, 77, 78, 79, 81, 83, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 103, 105, 107, 109, 110, 111, 112], "inclusive": true } }
+ rules: [/^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:@\{)/, /^(?:["])/, /^(?:["])/, /^(?:[^\"]+)/, /^(?:[^}^"]+)/, /^(?:\})/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["][`])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:["])/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s])/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:flowchart-elk\b)/, /^(?:graph\b)/, /^(?:flowchart\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:[^\s\"]+@(?=[^\{\"]))/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:[^-]|-(?!-)+)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:[^=]|=(?!))/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:[^\.]|\.(?!))/, /^(?:\s*~~[\~]+\s*)/, /^(?:[-/\)][\)])/, /^(?:[^\(\)\[\]\{\}]|!\)+)/, /^(?:\(-)/, /^(?:\]\))/, /^(?:\(\[)/, /^(?:\]\])/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:>)/, /^(?:\)\])/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\(\(\()/, /^(?:[\\(?=\])][\]])/, /^(?:\/(?=\])\])/, /^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:\*)/, /^(?:#)/, /^(?:&)/, /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, /^(?:-)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\|)/, /^(?:\))/, /^(?:\()/, /^(?:\])/, /^(?:\[)/, /^(?:(\}))/, /^(?:\{)/, /^(?:[^\[\]\(\)\{\}\|\"]+)/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/],
+ conditions: { "shapeDataEndBracket": { "rules": [21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "shapeDataStr": { "rules": [9, 10, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "shapeData": { "rules": [8, 11, 12, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "callbackargs": { "rules": [17, 18, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "callbackname": { "rules": [14, 15, 16, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "href": { "rules": [21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "click": { "rules": [21, 24, 33, 34, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "dottedEdgeText": { "rules": [21, 24, 74, 76, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "thickEdgeText": { "rules": [21, 24, 71, 73, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "edgeText": { "rules": [21, 24, 68, 70, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "trapText": { "rules": [21, 24, 77, 80, 82, 84, 88, 90, 91, 92, 93, 94, 95, 108, 110, 112, 114], "inclusive": false }, "ellipseText": { "rules": [21, 24, 77, 78, 79, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "text": { "rules": [21, 24, 77, 80, 81, 82, 83, 84, 87, 88, 89, 90, 94, 95, 107, 108, 109, 110, 111, 112, 113, 114, 115], "inclusive": false }, "vertex": { "rules": [21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "dir": { "rules": [21, 24, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "acc_descr_multiline": { "rules": [5, 6, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "acc_descr": { "rules": [3, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "acc_title": { "rules": [1, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "md_string": { "rules": [19, 20, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "string": { "rules": [21, 22, 23, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 13, 21, 24, 25, 26, 27, 28, 29, 30, 31, 32, 35, 36, 37, 38, 39, 40, 41, 42, 43, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 74, 75, 77, 80, 82, 84, 85, 86, 88, 90, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 108, 110, 112, 114, 116, 117, 118, 119], "inclusive": true } }
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser3.parser = parser3;
@@ -51423,6 +56971,21 @@ ${text2}
}
});
+ // src/diagrams/flowchart/parser/flowParser.ts
+ var newParser, flowParser_default;
+ var init_flowParser = __esm({
+ "src/diagrams/flowchart/parser/flowParser.ts"() {
+ "use strict";
+ init_flow();
+ newParser = Object.assign({}, flow_default);
+ newParser.parse = (src) => {
+ const newSrc = src.replace(/}\s*\n/g, "}\n");
+ return flow_default.parse(newSrc);
+ };
+ flowParser_default = newParser;
+ }
+ });
+
// src/diagrams/flowchart/styles.ts
var fade, getStyles3, styles_default3;
var init_styles3 = __esm({
@@ -51464,7 +57027,7 @@ ${text2}
stroke: ${options3.nodeBorder};
stroke-width: 1px;
}
- .rough-node .label text , .node .label text {
+ .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
text-anchor: middle;
}
// .flowchart-label .text-outer-tspan {
@@ -51480,13 +57043,20 @@ ${text2}
stroke-width: 1px;
}
- .node .label {
+ .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
+
+ .root .anchor path {
+ fill: ${options3.lineColor} !important;
+ stroke-width: 0;
+ stroke: ${options3.lineColor};
+ }
+
.arrowheadPath {
fill: ${options3.arrowheadColor};
}
@@ -51556,6 +57126,25 @@ ${text2}
font-size: 18px;
fill: ${options3.textColor};
}
+
+ rect.text {
+ fill: none;
+ stroke-width: 0;
+ }
+
+ .icon-shape, .image-shape {
+ background-color: ${options3.edgeLabelBackground};
+ p {
+ background-color: ${options3.edgeLabelBackground};
+ padding: 2px;
+ }
+ rect {
+ opacity: 0.5;
+ background-color: ${options3.edgeLabelBackground};
+ fill: ${options3.edgeLabelBackground};
+ }
+ text-align: center;
+ }
`, "getStyles");
styles_default3 = getStyles3;
}
@@ -51573,11 +57162,13 @@ ${text2}
init_diagramAPI();
init_flowDb();
init_flowRenderer_v3_unified();
- init_flow();
+ init_flowParser();
init_styles3();
diagram2 = {
- parser: flow_default,
- db: flowDb_default,
+ parser: flowParser_default,
+ get db() {
+ return new FlowDB();
+ },
renderer: flowRenderer_v3_unified_default,
styles: styles_default3,
init: /* @__PURE__ */ __name((cnf) => {
@@ -51589,8 +57180,6 @@ ${text2}
}
cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
setConfig2({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } });
- flowDb_default.clear();
- flowDb_default.setGen("gen-2");
}, "init")
};
}
@@ -51605,14 +57194,14 @@ ${text2}
var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
- }, "o"), $V0 = [6, 8, 10, 20, 22, 24, 26, 27, 28], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 14], $V6 = [1, 15], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 24], $Vb = [1, 25], $Vc = [6, 8, 10, 13, 15, 18, 19, 20, 22, 24, 26, 27, 28, 41, 42, 43, 44, 45], $Vd = [1, 34], $Ve = [27, 28, 46, 47], $Vf = [41, 42, 43, 44, 45], $Vg = [17, 34], $Vh = [1, 54], $Vi = [1, 53], $Vj = [17, 34, 36, 38];
- var parser22 = {
+ }, "o"), $V0 = [6, 8, 10, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 43, 44, 50], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 20], $V6 = [1, 21], $V7 = [1, 22], $V8 = [1, 23], $V9 = [1, 24], $Va = [1, 19], $Vb = [1, 25], $Vc = [1, 26], $Vd = [1, 18], $Ve = [1, 33], $Vf = [1, 34], $Vg = [1, 35], $Vh = [1, 36], $Vi = [1, 37], $Vj = [6, 8, 10, 13, 15, 17, 20, 21, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 43, 44, 50, 63, 64, 65, 66, 67], $Vk = [1, 42], $Vl = [1, 43], $Vm = [1, 52], $Vn = [40, 50, 68, 69], $Vo = [1, 63], $Vp = [1, 61], $Vq = [1, 58], $Vr = [1, 62], $Vs = [1, 64], $Vt = [6, 8, 10, 13, 17, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 48, 49, 50, 63, 64, 65, 66, 67], $Vu = [63, 64, 65, 66, 67], $Vv = [1, 81], $Vw = [1, 80], $Vx = [1, 78], $Vy = [1, 79], $Vz = [6, 10, 42, 47], $VA = [6, 10, 13, 41, 42, 47, 48, 49], $VB = [1, 89], $VC = [1, 88], $VD = [1, 87], $VE = [19, 56], $VF = [1, 98], $VG = [1, 97], $VH = [19, 56, 58, 60];
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
- symbols_: { "error": 2, "start": 3, "ER_DIAGRAM": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "entityName": 11, "relSpec": 12, ":": 13, "role": 14, "BLOCK_START": 15, "attributes": 16, "BLOCK_STOP": 17, "SQS": 18, "SQE": 19, "title": 20, "title_value": 21, "acc_title": 22, "acc_title_value": 23, "acc_descr": 24, "acc_descr_value": 25, "acc_descr_multiline_value": 26, "ALPHANUM": 27, "ENTITY_NAME": 28, "attribute": 29, "attributeType": 30, "attributeName": 31, "attributeKeyTypeList": 32, "attributeComment": 33, "ATTRIBUTE_WORD": 34, "attributeKeyType": 35, "COMMA": 36, "ATTRIBUTE_KEY": 37, "COMMENT": 38, "cardinality": 39, "relType": 40, "ZERO_OR_ONE": 41, "ZERO_OR_MORE": 42, "ONE_OR_MORE": 43, "ONLY_ONE": 44, "MD_PARENT": 45, "NON_IDENTIFYING": 46, "IDENTIFYING": 47, "WORD": 48, "$accept": 0, "$end": 1 },
- terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: ":", 15: "BLOCK_START", 17: "BLOCK_STOP", 18: "SQS", 19: "SQE", 20: "title", 21: "title_value", 22: "acc_title", 23: "acc_title_value", 24: "acc_descr", 25: "acc_descr_value", 26: "acc_descr_multiline_value", 27: "ALPHANUM", 28: "ENTITY_NAME", 34: "ATTRIBUTE_WORD", 36: "COMMA", 37: "ATTRIBUTE_KEY", 38: "COMMENT", 41: "ZERO_OR_ONE", 42: "ZERO_OR_MORE", 43: "ONE_OR_MORE", 44: "ONLY_ONE", 45: "MD_PARENT", 46: "NON_IDENTIFYING", 47: "IDENTIFYING", 48: "WORD" },
- productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 4], [9, 3], [9, 1], [9, 7], [9, 6], [9, 4], [9, 2], [9, 2], [9, 2], [9, 1], [11, 1], [11, 1], [16, 1], [16, 2], [29, 2], [29, 3], [29, 3], [29, 4], [30, 1], [31, 1], [32, 1], [32, 3], [35, 1], [33, 1], [12, 3], [39, 1], [39, 1], [39, 1], [39, 1], [39, 1], [40, 1], [40, 1], [14, 1], [14, 1], [14, 1]],
+ symbols_: { "error": 2, "start": 3, "ER_DIAGRAM": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "entityName": 11, "relSpec": 12, "COLON": 13, "role": 14, "STYLE_SEPARATOR": 15, "idList": 16, "BLOCK_START": 17, "attributes": 18, "BLOCK_STOP": 19, "SQS": 20, "SQE": 21, "title": 22, "title_value": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "direction": 29, "classDefStatement": 30, "classStatement": 31, "styleStatement": 32, "direction_tb": 33, "direction_bt": 34, "direction_rl": 35, "direction_lr": 36, "CLASSDEF": 37, "stylesOpt": 38, "separator": 39, "UNICODE_TEXT": 40, "STYLE_TEXT": 41, "COMMA": 42, "CLASS": 43, "STYLE": 44, "style": 45, "styleComponent": 46, "SEMI": 47, "NUM": 48, "BRKT": 49, "ENTITY_NAME": 50, "attribute": 51, "attributeType": 52, "attributeName": 53, "attributeKeyTypeList": 54, "attributeComment": 55, "ATTRIBUTE_WORD": 56, "attributeKeyType": 57, ",": 58, "ATTRIBUTE_KEY": 59, "COMMENT": 60, "cardinality": 61, "relType": 62, "ZERO_OR_ONE": 63, "ZERO_OR_MORE": 64, "ONE_OR_MORE": 65, "ONLY_ONE": 66, "MD_PARENT": 67, "NON_IDENTIFYING": 68, "IDENTIFYING": 69, "WORD": 70, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: "COLON", 15: "STYLE_SEPARATOR", 17: "BLOCK_START", 19: "BLOCK_STOP", 20: "SQS", 21: "SQE", 22: "title", 23: "title_value", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "direction_tb", 34: "direction_bt", 35: "direction_rl", 36: "direction_lr", 37: "CLASSDEF", 40: "UNICODE_TEXT", 41: "STYLE_TEXT", 42: "COMMA", 43: "CLASS", 44: "STYLE", 47: "SEMI", 48: "NUM", 49: "BRKT", 50: "ENTITY_NAME", 56: "ATTRIBUTE_WORD", 58: ",", 59: "ATTRIBUTE_KEY", 60: "COMMENT", 63: "ZERO_OR_ONE", 64: "ZERO_OR_MORE", 65: "ONE_OR_MORE", 66: "ONLY_ONE", 67: "MD_PARENT", 68: "NON_IDENTIFYING", 69: "IDENTIFYING", 70: "WORD" },
+ productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 9], [9, 7], [9, 7], [9, 4], [9, 6], [9, 3], [9, 5], [9, 1], [9, 3], [9, 7], [9, 9], [9, 6], [9, 8], [9, 4], [9, 6], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [29, 1], [29, 1], [29, 1], [29, 1], [30, 4], [16, 1], [16, 1], [16, 3], [16, 3], [31, 3], [32, 4], [38, 1], [38, 3], [45, 1], [45, 2], [39, 1], [39, 1], [39, 1], [46, 1], [46, 1], [46, 1], [46, 1], [11, 1], [11, 1], [18, 1], [18, 2], [51, 2], [51, 3], [51, 3], [51, 4], [52, 1], [53, 1], [54, 1], [54, 3], [57, 1], [55, 1], [12, 3], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [62, 1], [62, 1], [14, 1], [14, 1], [14, 1]],
performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
var $0 = $$.length - 1;
switch (yystate) {
@@ -51639,104 +57228,190 @@ ${text2}
yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]);
break;
case 9:
- yy.addEntity($$[$0 - 3]);
- yy.addAttributes($$[$0 - 3], $$[$0 - 1]);
+ yy.addEntity($$[$0 - 8]);
+ yy.addEntity($$[$0 - 4]);
+ yy.addRelationship($$[$0 - 8], $$[$0], $$[$0 - 4], $$[$0 - 5]);
+ yy.setClass([$$[$0 - 8]], $$[$0 - 6]);
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
break;
case 10:
+ yy.addEntity($$[$0 - 6]);
yy.addEntity($$[$0 - 2]);
+ yy.addRelationship($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 3]);
+ yy.setClass([$$[$0 - 6]], $$[$0 - 4]);
break;
case 11:
- yy.addEntity($$[$0]);
+ yy.addEntity($$[$0 - 6]);
+ yy.addEntity($$[$0 - 4]);
+ yy.addRelationship($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 5]);
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
break;
case 12:
- yy.addEntity($$[$0 - 6], $$[$0 - 4]);
- yy.addAttributes($$[$0 - 6], $$[$0 - 1]);
+ yy.addEntity($$[$0 - 3]);
+ yy.addAttributes($$[$0 - 3], $$[$0 - 1]);
break;
case 13:
- yy.addEntity($$[$0 - 5], $$[$0 - 3]);
+ yy.addEntity($$[$0 - 5]);
+ yy.addAttributes($$[$0 - 5], $$[$0 - 1]);
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
break;
case 14:
- yy.addEntity($$[$0 - 3], $$[$0 - 1]);
+ yy.addEntity($$[$0 - 2]);
break;
case 15:
+ yy.addEntity($$[$0 - 4]);
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
+ break;
case 16:
- this.$ = $$[$0].trim();
- yy.setAccTitle(this.$);
+ yy.addEntity($$[$0]);
break;
case 17:
+ yy.addEntity($$[$0 - 2]);
+ yy.setClass([$$[$0 - 2]], $$[$0]);
+ break;
case 18:
- this.$ = $$[$0].trim();
- yy.setAccDescription(this.$);
+ yy.addEntity($$[$0 - 6], $$[$0 - 4]);
+ yy.addAttributes($$[$0 - 6], $$[$0 - 1]);
break;
case 19:
- case 43:
- this.$ = $$[$0];
+ yy.addEntity($$[$0 - 8], $$[$0 - 6]);
+ yy.addAttributes($$[$0 - 8], $$[$0 - 1]);
+ yy.setClass([$$[$0 - 8]], $$[$0 - 3]);
break;
case 20:
- case 41:
- case 42:
- this.$ = $$[$0].replace(/"/g, "");
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
break;
case 21:
- case 29:
- this.$ = [$$[$0]];
+ yy.addEntity($$[$0 - 7], $$[$0 - 5]);
+ yy.setClass([$$[$0 - 7]], $$[$0 - 2]);
break;
case 22:
- $$[$0].push($$[$0 - 1]);
- this.$ = $$[$0];
+ yy.addEntity($$[$0 - 3], $$[$0 - 1]);
break;
case 23:
- this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] };
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
+ yy.setClass([$$[$0 - 5]], $$[$0]);
break;
case 24:
- this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] };
- break;
case 25:
- this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] };
+ this.$ = $$[$0].trim();
+ yy.setAccTitle(this.$);
break;
case 26:
- this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] };
- break;
case 27:
- case 28:
- case 31:
+ this.$ = $$[$0].trim();
+ yy.setAccDescription(this.$);
+ break;
+ case 32:
+ yy.setDirection("TB");
+ break;
+ case 33:
+ yy.setDirection("BT");
+ break;
+ case 34:
+ yy.setDirection("RL");
+ break;
+ case 35:
+ yy.setDirection("LR");
+ break;
+ case 36:
+ this.$ = $$[$0 - 3];
+ yy.addClass($$[$0 - 2], $$[$0 - 1]);
+ break;
+ case 37:
+ case 38:
+ case 56:
+ case 64:
+ this.$ = [$$[$0]];
+ break;
+ case 39:
+ case 40:
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
+ break;
+ case 41:
+ this.$ = $$[$0 - 2];
+ yy.setClass($$[$0 - 1], $$[$0]);
+ break;
+ case 42:
+ ;
+ this.$ = $$[$0 - 3];
+ yy.addCssStyles($$[$0 - 2], $$[$0 - 1]);
+ break;
+ case 43:
+ this.$ = [$$[$0]];
+ break;
+ case 44:
+ $$[$0 - 2].push($$[$0]);
+ this.$ = $$[$0 - 2];
+ break;
+ case 46:
+ this.$ = $$[$0 - 1] + $$[$0];
+ break;
+ case 54:
+ case 76:
+ case 77:
+ this.$ = $$[$0].replace(/"/g, "");
+ break;
+ case 55:
+ case 78:
this.$ = $$[$0];
break;
- case 30:
+ case 57:
+ $$[$0].push($$[$0 - 1]);
+ this.$ = $$[$0];
+ break;
+ case 58:
+ this.$ = { type: $$[$0 - 1], name: $$[$0] };
+ break;
+ case 59:
+ this.$ = { type: $$[$0 - 2], name: $$[$0 - 1], keys: $$[$0] };
+ break;
+ case 60:
+ this.$ = { type: $$[$0 - 2], name: $$[$0 - 1], comment: $$[$0] };
+ break;
+ case 61:
+ this.$ = { type: $$[$0 - 3], name: $$[$0 - 2], keys: $$[$0 - 1], comment: $$[$0] };
+ break;
+ case 62:
+ case 63:
+ case 66:
+ this.$ = $$[$0];
+ break;
+ case 65:
$$[$0 - 2].push($$[$0]);
this.$ = $$[$0 - 2];
break;
- case 32:
+ case 67:
this.$ = $$[$0].replace(/"/g, "");
break;
- case 33:
+ case 68:
this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] };
break;
- case 34:
+ case 69:
this.$ = yy.Cardinality.ZERO_OR_ONE;
break;
- case 35:
+ case 70:
this.$ = yy.Cardinality.ZERO_OR_MORE;
break;
- case 36:
+ case 71:
this.$ = yy.Cardinality.ONE_OR_MORE;
break;
- case 37:
+ case 72:
this.$ = yy.Cardinality.ONLY_ONE;
break;
- case 38:
+ case 73:
this.$ = yy.Cardinality.MD_PARENT;
break;
- case 39:
+ case 74:
this.$ = yy.Identification.NON_IDENTIFYING;
break;
- case 40:
+ case 75:
this.$ = yy.Identification.IDENTIFYING;
break;
}
}, "anonymous"),
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o2($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o2($V0, [2, 7], { 1: [2, 1] }), o2($V0, [2, 3]), { 9: 16, 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o2($V0, [2, 5]), o2($V0, [2, 6]), o2($V0, [2, 11], { 12: 17, 39: 20, 15: [1, 18], 18: [1, 19], 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }), { 21: [1, 26] }, { 23: [1, 27] }, { 25: [1, 28] }, o2($V0, [2, 18]), o2($Vc, [2, 19]), o2($Vc, [2, 20]), o2($V0, [2, 4]), { 11: 29, 27: $V5, 28: $V6 }, { 16: 30, 17: [1, 31], 29: 32, 30: 33, 34: $Vd }, { 11: 35, 27: $V5, 28: $V6 }, { 40: 36, 46: [1, 37], 47: [1, 38] }, o2($Ve, [2, 34]), o2($Ve, [2, 35]), o2($Ve, [2, 36]), o2($Ve, [2, 37]), o2($Ve, [2, 38]), o2($V0, [2, 15]), o2($V0, [2, 16]), o2($V0, [2, 17]), { 13: [1, 39] }, { 17: [1, 40] }, o2($V0, [2, 10]), { 16: 41, 17: [2, 21], 29: 32, 30: 33, 34: $Vd }, { 31: 42, 34: [1, 43] }, { 34: [2, 27] }, { 19: [1, 44] }, { 39: 45, 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }, o2($Vf, [2, 39]), o2($Vf, [2, 40]), { 14: 46, 27: [1, 49], 28: [1, 48], 48: [1, 47] }, o2($V0, [2, 9]), { 17: [2, 22] }, o2($Vg, [2, 23], { 32: 50, 33: 51, 35: 52, 37: $Vh, 38: $Vi }), o2([17, 34, 37, 38], [2, 28]), o2($V0, [2, 14], { 15: [1, 55] }), o2([27, 28], [2, 33]), o2($V0, [2, 8]), o2($V0, [2, 41]), o2($V0, [2, 42]), o2($V0, [2, 43]), o2($Vg, [2, 24], { 33: 56, 36: [1, 57], 38: $Vi }), o2($Vg, [2, 25]), o2($Vj, [2, 29]), o2($Vg, [2, 32]), o2($Vj, [2, 31]), { 16: 58, 17: [1, 59], 29: 32, 30: 33, 34: $Vd }, o2($Vg, [2, 26]), { 35: 60, 37: $Vh }, { 17: [1, 61] }, o2($V0, [2, 13]), o2($Vj, [2, 30]), o2($V0, [2, 12])],
- defaultActions: { 34: [2, 27], 41: [2, 22] },
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o2($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 22: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V5, 34: $V6, 35: $V7, 36: $V8, 37: $V9, 40: $Va, 43: $Vb, 44: $Vc, 50: $Vd }, o2($V0, [2, 7], { 1: [2, 1] }), o2($V0, [2, 3]), { 9: 27, 11: 9, 22: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V5, 34: $V6, 35: $V7, 36: $V8, 37: $V9, 40: $Va, 43: $Vb, 44: $Vc, 50: $Vd }, o2($V0, [2, 5]), o2($V0, [2, 6]), o2($V0, [2, 16], { 12: 28, 61: 32, 15: [1, 29], 17: [1, 30], 20: [1, 31], 63: $Ve, 64: $Vf, 65: $Vg, 66: $Vh, 67: $Vi }), { 23: [1, 38] }, { 25: [1, 39] }, { 27: [1, 40] }, o2($V0, [2, 27]), o2($V0, [2, 28]), o2($V0, [2, 29]), o2($V0, [2, 30]), o2($V0, [2, 31]), o2($Vj, [2, 54]), o2($Vj, [2, 55]), o2($V0, [2, 32]), o2($V0, [2, 33]), o2($V0, [2, 34]), o2($V0, [2, 35]), { 16: 41, 40: $Vk, 41: $Vl }, { 16: 44, 40: $Vk, 41: $Vl }, { 16: 45, 40: $Vk, 41: $Vl }, o2($V0, [2, 4]), { 11: 46, 40: $Va, 50: $Vd }, { 16: 47, 40: $Vk, 41: $Vl }, { 18: 48, 19: [1, 49], 51: 50, 52: 51, 56: $Vm }, { 11: 53, 40: $Va, 50: $Vd }, { 62: 54, 68: [1, 55], 69: [1, 56] }, o2($Vn, [2, 69]), o2($Vn, [2, 70]), o2($Vn, [2, 71]), o2($Vn, [2, 72]), o2($Vn, [2, 73]), o2($V0, [2, 24]), o2($V0, [2, 25]), o2($V0, [2, 26]), { 13: $Vo, 38: 57, 41: $Vp, 42: $Vq, 45: 59, 46: 60, 48: $Vr, 49: $Vs }, o2($Vt, [2, 37]), o2($Vt, [2, 38]), { 16: 65, 40: $Vk, 41: $Vl, 42: $Vq }, { 13: $Vo, 38: 66, 41: $Vp, 42: $Vq, 45: 59, 46: 60, 48: $Vr, 49: $Vs }, { 13: [1, 67], 15: [1, 68] }, o2($V0, [2, 17], { 61: 32, 12: 69, 17: [1, 70], 42: $Vq, 63: $Ve, 64: $Vf, 65: $Vg, 66: $Vh, 67: $Vi }), { 19: [1, 71] }, o2($V0, [2, 14]), { 18: 72, 19: [2, 56], 51: 50, 52: 51, 56: $Vm }, { 53: 73, 56: [1, 74] }, { 56: [2, 62] }, { 21: [1, 75] }, { 61: 76, 63: $Ve, 64: $Vf, 65: $Vg, 66: $Vh, 67: $Vi }, o2($Vu, [2, 74]), o2($Vu, [2, 75]), { 6: $Vv, 10: $Vw, 39: 77, 42: $Vx, 47: $Vy }, { 40: [1, 82], 41: [1, 83] }, o2($Vz, [2, 43], { 46: 84, 13: $Vo, 41: $Vp, 48: $Vr, 49: $Vs }), o2($VA, [2, 45]), o2($VA, [2, 50]), o2($VA, [2, 51]), o2($VA, [2, 52]), o2($VA, [2, 53]), o2($V0, [2, 41], { 42: $Vq }), { 6: $Vv, 10: $Vw, 39: 85, 42: $Vx, 47: $Vy }, { 14: 86, 40: $VB, 50: $VC, 70: $VD }, { 16: 90, 40: $Vk, 41: $Vl }, { 11: 91, 40: $Va, 50: $Vd }, { 18: 92, 19: [1, 93], 51: 50, 52: 51, 56: $Vm }, o2($V0, [2, 12]), { 19: [2, 57] }, o2($VE, [2, 58], { 54: 94, 55: 95, 57: 96, 59: $VF, 60: $VG }), o2([19, 56, 59, 60], [2, 63]), o2($V0, [2, 22], { 15: [1, 100], 17: [1, 99] }), o2([40, 50], [2, 68]), o2($V0, [2, 36]), { 13: $Vo, 41: $Vp, 45: 101, 46: 60, 48: $Vr, 49: $Vs }, o2($V0, [2, 47]), o2($V0, [2, 48]), o2($V0, [2, 49]), o2($Vt, [2, 39]), o2($Vt, [2, 40]), o2($VA, [2, 46]), o2($V0, [2, 42]), o2($V0, [2, 8]), o2($V0, [2, 76]), o2($V0, [2, 77]), o2($V0, [2, 78]), { 13: [1, 102], 42: $Vq }, { 13: [1, 104], 15: [1, 103] }, { 19: [1, 105] }, o2($V0, [2, 15]), o2($VE, [2, 59], { 55: 106, 58: [1, 107], 60: $VG }), o2($VE, [2, 60]), o2($VH, [2, 64]), o2($VE, [2, 67]), o2($VH, [2, 66]), { 18: 108, 19: [1, 109], 51: 50, 52: 51, 56: $Vm }, { 16: 110, 40: $Vk, 41: $Vl }, o2($Vz, [2, 44], { 46: 84, 13: $Vo, 41: $Vp, 48: $Vr, 49: $Vs }), { 14: 111, 40: $VB, 50: $VC, 70: $VD }, { 16: 112, 40: $Vk, 41: $Vl }, { 14: 113, 40: $VB, 50: $VC, 70: $VD }, o2($V0, [2, 13]), o2($VE, [2, 61]), { 57: 114, 59: $VF }, { 19: [1, 115] }, o2($V0, [2, 20]), o2($V0, [2, 23], { 17: [1, 116], 42: $Vq }), o2($V0, [2, 11]), { 13: [1, 117], 42: $Vq }, o2($V0, [2, 10]), o2($VH, [2, 65]), o2($V0, [2, 18]), { 18: 118, 19: [1, 119], 51: 50, 52: 51, 56: $Vm }, { 14: 120, 40: $VB, 50: $VC, 70: $VD }, { 19: [1, 121] }, o2($V0, [2, 21]), o2($V0, [2, 9]), o2($V0, [2, 19])],
+ defaultActions: { 52: [2, 62], 72: [2, 57] },
parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
if (hash.recoverable) {
this.trace(str2);
@@ -51746,7 +57421,7 @@ ${text2}
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -51776,7 +57451,7 @@ ${text2}
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -51788,22 +57463,22 @@ ${text2}
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -51822,7 +57497,7 @@ ${text2}
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -52122,7 +57797,7 @@ ${text2}
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -52174,7 +57849,7 @@ ${text2}
switch ($avoiding_name_collisions) {
case 0:
this.begin("acc_title");
- return 22;
+ return 24;
break;
case 1:
this.popState();
@@ -52182,7 +57857,7 @@ ${text2}
break;
case 2:
this.begin("acc_descr");
- return 24;
+ return 26;
break;
case 3:
this.popState();
@@ -52198,165 +57873,224 @@ ${text2}
return "acc_descr_multiline_value";
break;
case 7:
- return 10;
+ return 33;
break;
case 8:
+ return 34;
break;
case 9:
- return 8;
+ return 35;
break;
case 10:
- return 28;
+ return 36;
break;
case 11:
- return 48;
+ return 10;
break;
case 12:
- return 4;
break;
case 13:
- this.begin("block");
- return 15;
+ return 8;
break;
case 14:
- return 36;
+ return 50;
break;
case 15:
+ return 70;
break;
case 16:
- return 37;
+ return 4;
break;
case 17:
- return 34;
+ this.begin("block");
+ return 17;
break;
case 18:
- return 34;
+ return 49;
break;
case 19:
- return 38;
+ return 49;
break;
case 20:
+ return 42;
break;
case 21:
- this.popState();
- return 17;
+ return 15;
break;
case 22:
- return yy_.yytext[0];
+ return 13;
break;
case 23:
- return 18;
break;
case 24:
- return 19;
+ return 59;
break;
case 25:
- return 41;
+ return 56;
break;
case 26:
- return 43;
+ return 56;
break;
case 27:
- return 43;
+ return 60;
break;
case 28:
- return 43;
break;
case 29:
- return 41;
+ this.popState();
+ return 19;
break;
case 30:
- return 41;
+ return yy_.yytext[0];
break;
case 31:
- return 42;
+ return 20;
break;
case 32:
- return 42;
+ return 21;
break;
case 33:
- return 42;
+ this.begin("style");
+ return 44;
break;
case 34:
- return 42;
+ this.popState();
+ return 10;
break;
case 35:
- return 42;
break;
case 36:
- return 43;
+ return 13;
break;
case 37:
return 42;
break;
case 38:
- return 43;
+ return 49;
break;
case 39:
- return 44;
+ this.begin("style");
+ return 37;
break;
case 40:
- return 44;
+ return 43;
break;
case 41:
- return 44;
+ return 63;
break;
case 42:
- return 44;
+ return 65;
break;
case 43:
- return 41;
+ return 65;
break;
case 44:
- return 42;
+ return 65;
break;
case 45:
- return 43;
+ return 63;
break;
case 46:
- return 45;
+ return 63;
break;
case 47:
- return 46;
+ return 64;
break;
case 48:
- return 47;
+ return 64;
break;
case 49:
- return 47;
+ return 64;
break;
case 50:
- return 46;
+ return 64;
break;
case 51:
- return 46;
+ return 64;
break;
case 52:
- return 46;
+ return 65;
break;
case 53:
- return 27;
+ return 64;
break;
case 54:
- return yy_.yytext[0];
+ return 65;
break;
case 55:
+ return 66;
+ break;
+ case 56:
+ return 66;
+ break;
+ case 57:
+ return 66;
+ break;
+ case 58:
+ return 66;
+ break;
+ case 59:
+ return 63;
+ break;
+ case 60:
+ return 64;
+ break;
+ case 61:
+ return 65;
+ break;
+ case 62:
+ return 67;
+ break;
+ case 63:
+ return 68;
+ break;
+ case 64:
+ return 69;
+ break;
+ case 65:
+ return 69;
+ break;
+ case 66:
+ return 68;
+ break;
+ case 67:
+ return 68;
+ break;
+ case 68:
+ return 68;
+ break;
+ case 69:
+ return 41;
+ break;
+ case 70:
+ return 47;
+ break;
+ case 71:
+ return 40;
+ break;
+ case 72:
+ return 48;
+ break;
+ case 73:
+ return yy_.yytext[0];
+ break;
+ case 74:
return 6;
break;
}
}, "anonymous"),
- rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:,)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:(.*?)[~](.*?)*[~])/i, /^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i, /^(?:.)/i, /^(?:$)/i],
- conditions: { "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "block": { "rules": [14, 15, 16, 17, 18, 19, 20, 21, 22], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 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], "inclusive": true } }
+ rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:#)/i, /^(?:#)/i, /^(?:,)/i, /^(?::::)/i, /^(?::)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:([^\s]*)[~].*[~]([^\s]*))/i, /^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:style\b)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?::)/i, /^(?:,)/i, /^(?:#)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:([^\x00-\x7F]|\w|-|\*)+)/i, /^(?:;)/i, /^(?:([^\x00-\x7F]|\w|-|\*)+)/i, /^(?:[0-9])/i, /^(?:.)/i, /^(?:$)/i],
+ conditions: { "style": { "rules": [34, 35, 36, 37, 38, 69, 70], "inclusive": false }, "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "block": { "rules": [23, 24, 25, 26, 27, 28, 29, 30], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 31, 32, 33, 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, 65, 66, 67, 68, 71, 72, 73, 74], "inclusive": true } }
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser4.parser = parser4;
@@ -52364,721 +58098,306 @@ ${text2}
}
});
- // src/diagrams/er/erDb.js
- var entities, relationships, Cardinality, Identification, addEntity, getEntities, addAttributes, addRelationship, getRelationships, clear9, erDb_default;
+ // src/diagrams/er/erDb.ts
+ var ErDB;
var init_erDb = __esm({
- "src/diagrams/er/erDb.js"() {
+ "src/diagrams/er/erDb.ts"() {
"use strict";
init_logger();
init_diagramAPI();
init_commonDb();
- entities = /* @__PURE__ */ new Map();
- relationships = [];
- Cardinality = {
- ZERO_OR_ONE: "ZERO_OR_ONE",
- ZERO_OR_MORE: "ZERO_OR_MORE",
- ONE_OR_MORE: "ONE_OR_MORE",
- ONLY_ONE: "ONLY_ONE",
- MD_PARENT: "MD_PARENT"
- };
- Identification = {
- NON_IDENTIFYING: "NON_IDENTIFYING",
- IDENTIFYING: "IDENTIFYING"
- };
- addEntity = /* @__PURE__ */ __name(function(name, alias = void 0) {
- if (!entities.has(name)) {
- entities.set(name, { attributes: [], alias });
- log.info("Added new entity :", name);
- } else if (!entities.get(name).alias && alias) {
- entities.get(name).alias = alias;
- log.info(`Add alias '${alias}' to entity '${name}'`);
- }
- return entities.get(name);
- }, "addEntity");
- getEntities = /* @__PURE__ */ __name(() => entities, "getEntities");
- addAttributes = /* @__PURE__ */ __name(function(entityName, attribs) {
- let entity = addEntity(entityName);
- let i2;
- for (i2 = attribs.length - 1; i2 >= 0; i2--) {
- entity.attributes.push(attribs[i2]);
- log.debug("Added attribute ", attribs[i2].attributeName);
- }
- }, "addAttributes");
- addRelationship = /* @__PURE__ */ __name(function(entA, rolA, entB, rSpec) {
- let rel2 = {
- entityA: entA,
- roleA: rolA,
- entityB: entB,
- relSpec: rSpec
- };
- relationships.push(rel2);
- log.debug("Added new relationship :", rel2);
- }, "addRelationship");
- getRelationships = /* @__PURE__ */ __name(() => relationships, "getRelationships");
- clear9 = /* @__PURE__ */ __name(function() {
- entities = /* @__PURE__ */ new Map();
- relationships = [];
- clear();
- }, "clear");
- erDb_default = {
- Cardinality,
- Identification,
- getConfig: /* @__PURE__ */ __name(() => getConfig2().er, "getConfig"),
- addEntity,
- addAttributes,
- getEntities,
- addRelationship,
- getRelationships,
- clear: clear9,
- setAccTitle,
- getAccTitle,
- setAccDescription,
- getAccDescription,
- setDiagramTitle,
- getDiagramTitle
- };
- }
- });
-
- // src/diagrams/er/erMarkers.js
- var ERMarkers, insertMarkers2, erMarkers_default;
- var init_erMarkers = __esm({
- "src/diagrams/er/erMarkers.js"() {
- "use strict";
- ERMarkers = {
- ONLY_ONE_START: "ONLY_ONE_START",
- ONLY_ONE_END: "ONLY_ONE_END",
- ZERO_OR_ONE_START: "ZERO_OR_ONE_START",
- ZERO_OR_ONE_END: "ZERO_OR_ONE_END",
- ONE_OR_MORE_START: "ONE_OR_MORE_START",
- ONE_OR_MORE_END: "ONE_OR_MORE_END",
- ZERO_OR_MORE_START: "ZERO_OR_MORE_START",
- ZERO_OR_MORE_END: "ZERO_OR_MORE_END",
- MD_PARENT_END: "MD_PARENT_END",
- MD_PARENT_START: "MD_PARENT_START"
- };
- insertMarkers2 = /* @__PURE__ */ __name(function(elem, conf8) {
- let marker;
- elem.append("defs").append("marker").attr("id", ERMarkers.MD_PARENT_START).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", ERMarkers.MD_PARENT_END).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", ERMarkers.ONLY_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M9,0 L9,18 M15,0 L15,18");
- elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_END).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M3,0 L3,18 M9,0 L9,18");
- marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
- marker.append("circle").attr("stroke", conf8.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
- marker.append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M9,0 L9,18");
- marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_END).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
- marker.append("circle").attr("stroke", conf8.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
- marker.append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M21,0 L21,18");
- elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");
- elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_END).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
- marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
- marker.append("circle").attr("stroke", conf8.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
- marker.append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
- marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_END).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
- marker.append("circle").attr("stroke", conf8.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
- marker.append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
- return;
- }, "insertMarkers");
- erMarkers_default = {
- ERMarkers,
- insertMarkers: insertMarkers2
- };
- }
- });
-
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js
- var regex_default;
- var init_regex = __esm({
- "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js"() {
- "use strict";
- regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
- }
- });
-
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js
- function validate(uuid3) {
- return typeof uuid3 === "string" && regex_default.test(uuid3);
- }
- var validate_default;
- var init_validate = __esm({
- "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js"() {
- "use strict";
- init_regex();
- __name(validate, "validate");
- validate_default = validate;
- }
- });
-
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js
- function unsafeStringify(arr, offset = 0) {
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
- }
- var byteToHex;
- var init_stringify = __esm({
- "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js"() {
- "use strict";
- byteToHex = [];
- for (let i2 = 0; i2 < 256; ++i2) {
- byteToHex.push((i2 + 256).toString(16).slice(1));
- }
- __name(unsafeStringify, "unsafeStringify");
- }
- });
-
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/parse.js
- function parse(uuid3) {
- if (!validate_default(uuid3)) {
- throw TypeError("Invalid UUID");
- }
- let v3;
- const arr = new Uint8Array(16);
- arr[0] = (v3 = parseInt(uuid3.slice(0, 8), 16)) >>> 24;
- arr[1] = v3 >>> 16 & 255;
- arr[2] = v3 >>> 8 & 255;
- arr[3] = v3 & 255;
- arr[4] = (v3 = parseInt(uuid3.slice(9, 13), 16)) >>> 8;
- arr[5] = v3 & 255;
- arr[6] = (v3 = parseInt(uuid3.slice(14, 18), 16)) >>> 8;
- arr[7] = v3 & 255;
- arr[8] = (v3 = parseInt(uuid3.slice(19, 23), 16)) >>> 8;
- arr[9] = v3 & 255;
- arr[10] = (v3 = parseInt(uuid3.slice(24, 36), 16)) / 1099511627776 & 255;
- arr[11] = v3 / 4294967296 & 255;
- arr[12] = v3 >>> 24 & 255;
- arr[13] = v3 >>> 16 & 255;
- arr[14] = v3 >>> 8 & 255;
- arr[15] = v3 & 255;
- return arr;
- }
- var parse_default;
- var init_parse2 = __esm({
- "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/parse.js"() {
- "use strict";
- init_validate();
- __name(parse, "parse");
- parse_default = parse;
- }
- });
-
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v35.js
- function stringToBytes(str2) {
- str2 = unescape(encodeURIComponent(str2));
- const bytes = [];
- for (let i2 = 0; i2 < str2.length; ++i2) {
- bytes.push(str2.charCodeAt(i2));
- }
- return bytes;
- }
- function v35(name, version4, hashfunc) {
- function generateUUID(value2, namespace, buf, offset) {
- var _namespace;
- if (typeof value2 === "string") {
- value2 = stringToBytes(value2);
- }
- if (typeof namespace === "string") {
- namespace = parse_default(namespace);
- }
- if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
- throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
- }
- let bytes = new Uint8Array(16 + value2.length);
- bytes.set(namespace);
- bytes.set(value2, namespace.length);
- bytes = hashfunc(bytes);
- bytes[6] = bytes[6] & 15 | version4;
- bytes[8] = bytes[8] & 63 | 128;
- if (buf) {
- offset = offset || 0;
- for (let i2 = 0; i2 < 16; ++i2) {
- buf[offset + i2] = bytes[i2];
- }
- return buf;
- }
- return unsafeStringify(bytes);
- }
- __name(generateUUID, "generateUUID");
- try {
- generateUUID.name = name;
- } catch (err) {
- }
- generateUUID.DNS = DNS;
- generateUUID.URL = URL2;
- return generateUUID;
- }
- var DNS, URL2;
- var init_v35 = __esm({
- "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v35.js"() {
- "use strict";
- init_stringify();
- init_parse2();
- __name(stringToBytes, "stringToBytes");
- DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
- URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
- __name(v35, "v35");
- }
- });
-
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/sha1.js
- function f2(s2, x5, y5, z2) {
- switch (s2) {
- case 0:
- return x5 & y5 ^ ~x5 & z2;
- case 1:
- return x5 ^ y5 ^ z2;
- case 2:
- return x5 & y5 ^ x5 & z2 ^ y5 & z2;
- case 3:
- return x5 ^ y5 ^ z2;
- }
- }
- function ROTL(x5, n2) {
- return x5 << n2 | x5 >>> 32 - n2;
- }
- function sha1(bytes) {
- const K4 = [1518500249, 1859775393, 2400959708, 3395469782];
- const H2 = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
- if (typeof bytes === "string") {
- const msg = unescape(encodeURIComponent(bytes));
- bytes = [];
- for (let i2 = 0; i2 < msg.length; ++i2) {
- bytes.push(msg.charCodeAt(i2));
- }
- } else if (!Array.isArray(bytes)) {
- bytes = Array.prototype.slice.call(bytes);
- }
- bytes.push(128);
- const l2 = bytes.length / 4 + 2;
- const N2 = Math.ceil(l2 / 16);
- const M2 = new Array(N2);
- for (let i2 = 0; i2 < N2; ++i2) {
- const arr = new Uint32Array(16);
- for (let j2 = 0; j2 < 16; ++j2) {
- arr[j2] = bytes[i2 * 64 + j2 * 4] << 24 | bytes[i2 * 64 + j2 * 4 + 1] << 16 | bytes[i2 * 64 + j2 * 4 + 2] << 8 | bytes[i2 * 64 + j2 * 4 + 3];
- }
- M2[i2] = arr;
- }
- M2[N2 - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
- M2[N2 - 1][14] = Math.floor(M2[N2 - 1][14]);
- M2[N2 - 1][15] = (bytes.length - 1) * 8 & 4294967295;
- for (let i2 = 0; i2 < N2; ++i2) {
- const W2 = new Uint32Array(80);
- for (let t4 = 0; t4 < 16; ++t4) {
- W2[t4] = M2[i2][t4];
- }
- for (let t4 = 16; t4 < 80; ++t4) {
- W2[t4] = ROTL(W2[t4 - 3] ^ W2[t4 - 8] ^ W2[t4 - 14] ^ W2[t4 - 16], 1);
- }
- let a2 = H2[0];
- let b2 = H2[1];
- let c3 = H2[2];
- let d2 = H2[3];
- let e3 = H2[4];
- for (let t4 = 0; t4 < 80; ++t4) {
- const s2 = Math.floor(t4 / 20);
- const T3 = ROTL(a2, 5) + f2(s2, b2, c3, d2) + e3 + K4[s2] + W2[t4] >>> 0;
- e3 = d2;
- d2 = c3;
- c3 = ROTL(b2, 30) >>> 0;
- b2 = a2;
- a2 = T3;
- }
- H2[0] = H2[0] + a2 >>> 0;
- H2[1] = H2[1] + b2 >>> 0;
- H2[2] = H2[2] + c3 >>> 0;
- H2[3] = H2[3] + d2 >>> 0;
- H2[4] = H2[4] + e3 >>> 0;
- }
- return [H2[0] >> 24 & 255, H2[0] >> 16 & 255, H2[0] >> 8 & 255, H2[0] & 255, H2[1] >> 24 & 255, H2[1] >> 16 & 255, H2[1] >> 8 & 255, H2[1] & 255, H2[2] >> 24 & 255, H2[2] >> 16 & 255, H2[2] >> 8 & 255, H2[2] & 255, H2[3] >> 24 & 255, H2[3] >> 16 & 255, H2[3] >> 8 & 255, H2[3] & 255, H2[4] >> 24 & 255, H2[4] >> 16 & 255, H2[4] >> 8 & 255, H2[4] & 255];
- }
- var sha1_default;
- var init_sha1 = __esm({
- "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/sha1.js"() {
- "use strict";
- __name(f2, "f");
- __name(ROTL, "ROTL");
- __name(sha1, "sha1");
- sha1_default = sha1;
- }
- });
-
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v5.js
- var v5, v5_default;
- var init_v5 = __esm({
- "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v5.js"() {
- "use strict";
- init_v35();
- init_sha1();
- v5 = v35("v5", 80, sha1_default);
- v5_default = v5;
- }
- });
-
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/index.js
- var init_esm_browser = __esm({
- "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/index.js"() {
- "use strict";
- init_v5();
- }
- });
-
- // src/diagrams/er/erRenderer.js
- function generateId2(str2 = "", prefix = "") {
- const simplifiedStr = str2.replace(BAD_ID_CHARS_REGEXP, "");
- return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${v5_default(
- str2,
- MERMAID_ERDIAGRAM_UUID
- )}`;
- }
- function strWithHyphen(str2 = "") {
- return str2.length > 0 ? `${str2}-` : "";
- }
- var BAD_ID_CHARS_REGEXP, conf2, entityNameIds, setConf2, drawAttributes, drawEntities, adjustEntities, getEdgeName, addRelationships, relCnt, drawRelationshipFromLayout, draw3, MERMAID_ERDIAGRAM_UUID, erRenderer_default;
- var init_erRenderer = __esm({
- "src/diagrams/er/erRenderer.js"() {
- "use strict";
- init_graphlib();
- init_src32();
- init_dagre();
- init_diagramAPI();
- init_logger();
init_utils2();
- init_erMarkers();
- init_setupGraphViewbox();
- init_common();
- init_esm_browser();
- BAD_ID_CHARS_REGEXP = /[^\dA-Za-z](\W)*/g;
- conf2 = {};
- entityNameIds = /* @__PURE__ */ new Map();
- setConf2 = /* @__PURE__ */ __name(function(cnf) {
- const keys3 = Object.keys(cnf);
- for (const key of keys3) {
- conf2[key] = cnf[key];
+ ErDB = class {
+ constructor() {
+ this.entities = /* @__PURE__ */ new Map();
+ this.relationships = [];
+ this.classes = /* @__PURE__ */ new Map();
+ this.direction = "TB";
+ this.Cardinality = {
+ ZERO_OR_ONE: "ZERO_OR_ONE",
+ ZERO_OR_MORE: "ZERO_OR_MORE",
+ ONE_OR_MORE: "ONE_OR_MORE",
+ ONLY_ONE: "ONLY_ONE",
+ MD_PARENT: "MD_PARENT"
+ };
+ this.Identification = {
+ NON_IDENTIFYING: "NON_IDENTIFYING",
+ IDENTIFYING: "IDENTIFYING"
+ };
+ this.setAccTitle = setAccTitle;
+ this.getAccTitle = getAccTitle;
+ this.setAccDescription = setAccDescription;
+ this.getAccDescription = getAccDescription;
+ this.setDiagramTitle = setDiagramTitle;
+ this.getDiagramTitle = getDiagramTitle;
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().er, "getConfig");
+ this.clear();
+ this.addEntity = this.addEntity.bind(this);
+ this.addAttributes = this.addAttributes.bind(this);
+ this.addRelationship = this.addRelationship.bind(this);
+ this.setDirection = this.setDirection.bind(this);
+ this.addCssStyles = this.addCssStyles.bind(this);
+ this.addClass = this.addClass.bind(this);
+ this.setClass = this.setClass.bind(this);
+ this.setAccTitle = this.setAccTitle.bind(this);
+ this.setAccDescription = this.setAccDescription.bind(this);
}
- }, "setConf");
- drawAttributes = /* @__PURE__ */ __name((groupNode, entityTextNode, attributes) => {
- const heightPadding = conf2.entityPadding / 3;
- const widthPadding = conf2.entityPadding / 3;
- const attrFontSize = conf2.fontSize * 0.85;
- const labelBBox = entityTextNode.node().getBBox();
- const attributeNodes = [];
- let hasKeyType = false;
- let hasComment = false;
- let maxTypeWidth = 0;
- let maxNameWidth = 0;
- let maxKeyWidth = 0;
- let maxCommentWidth = 0;
- let cumulativeHeight = labelBBox.height + heightPadding * 2;
- let attrNum = 1;
- attributes.forEach((item) => {
- if (item.attributeKeyTypeList !== void 0 && item.attributeKeyTypeList.length > 0) {
- hasKeyType = true;
- }
- if (item.attributeComment !== void 0) {
- hasComment = true;
+ static {
+ __name(this, "ErDB");
+ }
+ /**
+ * Add entity
+ * @param name - The name of the entity
+ * @param alias - The alias of the entity
+ */
+ addEntity(name, alias = "") {
+ if (!this.entities.has(name)) {
+ this.entities.set(name, {
+ id: `entity-${name}-${this.entities.size}`,
+ label: name,
+ attributes: [],
+ alias,
+ shape: "erBox",
+ look: getConfig2().look ?? "default",
+ cssClasses: "default",
+ cssStyles: []
+ });
+ log.info("Added new entity :", name);
+ } else if (!this.entities.get(name)?.alias && alias) {
+ this.entities.get(name).alias = alias;
+ log.info(`Add alias '${alias}' to entity '${name}'`);
}
- });
- attributes.forEach((item) => {
- const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`;
- let nodeHeight = 0;
- const attributeType = parseGenericTypes(item.attributeType);
- const typeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-type`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig2().fontFamily).style("font-size", attrFontSize + "px").text(attributeType);
- const nameNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-name`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig2().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeName);
- const attributeNode = {};
- attributeNode.tn = typeNode;
- attributeNode.nn = nameNode;
- const typeBBox = typeNode.node().getBBox();
- const nameBBox = nameNode.node().getBBox();
- maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width);
- maxNameWidth = Math.max(maxNameWidth, nameBBox.width);
- nodeHeight = Math.max(typeBBox.height, nameBBox.height);
- if (hasKeyType) {
- const keyTypeNodeText = item.attributeKeyTypeList !== void 0 ? item.attributeKeyTypeList.join(",") : "";
- const keyTypeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-key`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig2().fontFamily).style("font-size", attrFontSize + "px").text(keyTypeNodeText);
- attributeNode.kn = keyTypeNode;
- const keyTypeBBox = keyTypeNode.node().getBBox();
- maxKeyWidth = Math.max(maxKeyWidth, keyTypeBBox.width);
- nodeHeight = Math.max(nodeHeight, keyTypeBBox.height);
- }
- if (hasComment) {
- const commentNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-comment`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig2().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeComment || "");
- attributeNode.cn = commentNode;
- const commentNodeBBox = commentNode.node().getBBox();
- maxCommentWidth = Math.max(maxCommentWidth, commentNodeBBox.width);
- nodeHeight = Math.max(nodeHeight, commentNodeBBox.height);
- }
- attributeNode.height = nodeHeight;
- attributeNodes.push(attributeNode);
- cumulativeHeight += nodeHeight + heightPadding * 2;
- attrNum += 1;
- });
- let widthPaddingFactor = 4;
- if (hasKeyType) {
- widthPaddingFactor += 2;
- }
- if (hasComment) {
- widthPaddingFactor += 2;
- }
- const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth;
- const bBox = {
- width: Math.max(
- conf2.minEntityWidth,
- Math.max(
- labelBBox.width + conf2.entityPadding * 2,
- maxWidth + widthPadding * widthPaddingFactor
- )
- ),
- height: attributes.length > 0 ? cumulativeHeight : Math.max(conf2.minEntityHeight, labelBBox.height + conf2.entityPadding * 2)
- };
- if (attributes.length > 0) {
- const spareColumnWidth = Math.max(
- 0,
- (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2)
- );
- entityTextNode.attr(
- "transform",
- "translate(" + bBox.width / 2 + "," + (heightPadding + labelBBox.height / 2) + ")"
- );
- let heightOffset = labelBBox.height + heightPadding * 2;
- let attribStyle = "attributeBoxOdd";
- attributeNodes.forEach((attributeNode) => {
- const alignY = heightOffset + heightPadding + attributeNode.height / 2;
- attributeNode.tn.attr("transform", "translate(" + widthPadding + "," + alignY + ")");
- const typeRect = groupNode.insert("rect", "#" + attributeNode.tn.node().id).classed(`er ${attribStyle}`, true).attr("x", 0).attr("y", heightOffset).attr("width", maxTypeWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
- const nameXOffset = parseFloat(typeRect.attr("x")) + parseFloat(typeRect.attr("width"));
- attributeNode.nn.attr(
- "transform",
- "translate(" + (nameXOffset + widthPadding) + "," + alignY + ")"
- );
- const nameRect = groupNode.insert("rect", "#" + attributeNode.nn.node().id).classed(`er ${attribStyle}`, true).attr("x", nameXOffset).attr("y", heightOffset).attr("width", maxNameWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
- let keyTypeAndCommentXOffset = parseFloat(nameRect.attr("x")) + parseFloat(nameRect.attr("width"));
- if (hasKeyType) {
- attributeNode.kn.attr(
- "transform",
- "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")"
- );
- const keyTypeRect = groupNode.insert("rect", "#" + attributeNode.kn.node().id).classed(`er ${attribStyle}`, true).attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxKeyWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
- keyTypeAndCommentXOffset = parseFloat(keyTypeRect.attr("x")) + parseFloat(keyTypeRect.attr("width"));
+ return this.entities.get(name);
+ }
+ getEntity(name) {
+ return this.entities.get(name);
+ }
+ getEntities() {
+ return this.entities;
+ }
+ getClasses() {
+ return this.classes;
+ }
+ addAttributes(entityName, attribs) {
+ const entity = this.addEntity(entityName);
+ let i2;
+ for (i2 = attribs.length - 1; i2 >= 0; i2--) {
+ if (!attribs[i2].keys) {
+ attribs[i2].keys = [];
}
- if (hasComment) {
- attributeNode.cn.attr(
- "transform",
- "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")"
- );
- groupNode.insert("rect", "#" + attributeNode.cn.node().id).classed(`er ${attribStyle}`, "true").attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxCommentWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
+ if (!attribs[i2].comment) {
+ attribs[i2].comment = "";
}
- heightOffset += attributeNode.height + heightPadding * 2;
- attribStyle = attribStyle === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd";
- });
- } else {
- bBox.height = Math.max(conf2.minEntityHeight, cumulativeHeight);
- entityTextNode.attr("transform", "translate(" + bBox.width / 2 + "," + bBox.height / 2 + ")");
- }
- return bBox;
- }, "drawAttributes");
- drawEntities = /* @__PURE__ */ __name(function(svgNode2, entities2, graph) {
- const keys3 = [...entities2.keys()];
- let firstOne;
- keys3.forEach(function(entityName) {
- const entityId = generateId2(entityName, "entity");
- entityNameIds.set(entityName, entityId);
- const groupNode = svgNode2.append("g").attr("id", entityId);
- firstOne = firstOne === void 0 ? entityId : firstOne;
- const textId = "text-" + entityId;
- const textNode = groupNode.append("text").classed("er entityLabel", true).attr("id", textId).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "middle").style("font-family", getConfig2().fontFamily).style("font-size", conf2.fontSize + "px").text(entities2.get(entityName).alias ?? entityName);
- const { width: entityWidth, height: entityHeight } = drawAttributes(
- groupNode,
- textNode,
- entities2.get(entityName).attributes
- );
- const rectNode = groupNode.insert("rect", "#" + textId).classed("er entityBox", true).attr("x", 0).attr("y", 0).attr("width", entityWidth).attr("height", entityHeight);
- const rectBBox = rectNode.node().getBBox();
- graph.setNode(entityId, {
- width: rectBBox.width,
- height: rectBBox.height,
- shape: "rect",
- id: entityId
- });
- });
- return firstOne;
- }, "drawEntities");
- adjustEntities = /* @__PURE__ */ __name(function(svgNode2, graph) {
- graph.nodes().forEach(function(v3) {
- if (v3 !== void 0 && graph.node(v3) !== void 0) {
- svgNode2.select("#" + v3).attr(
- "transform",
- "translate(" + (graph.node(v3).x - graph.node(v3).width / 2) + "," + (graph.node(v3).y - graph.node(v3).height / 2) + " )"
- );
+ entity.attributes.push(attribs[i2]);
+ log.debug("Added attribute ", attribs[i2].name);
}
- });
- }, "adjustEntities");
- getEdgeName = /* @__PURE__ */ __name(function(rel2) {
- return (rel2.entityA + rel2.roleA + rel2.entityB).replace(/\s/g, "");
- }, "getEdgeName");
- addRelationships = /* @__PURE__ */ __name(function(relationships2, g2) {
- relationships2.forEach(function(r2) {
- g2.setEdge(
- entityNameIds.get(r2.entityA),
- entityNameIds.get(r2.entityB),
- { relationship: r2 },
- getEdgeName(r2)
- );
- });
- return relationships2;
- }, "addRelationships");
- relCnt = 0;
- drawRelationshipFromLayout = /* @__PURE__ */ __name(function(svg, rel2, g2, insert, diagObj) {
- relCnt++;
- const edge = g2.edge(
- entityNameIds.get(rel2.entityA),
- entityNameIds.get(rel2.entityB),
- getEdgeName(rel2)
- );
- const lineFunction = line_default().x(function(d2) {
- return d2.x;
- }).y(function(d2) {
- return d2.y;
- }).curve(basis_default2);
- const svgPath = svg.insert("path", "#" + insert).classed("er relationshipLine", true).attr("d", lineFunction(edge.points)).style("stroke", conf2.stroke).style("fill", "none");
- if (rel2.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) {
- svgPath.attr("stroke-dasharray", "8,8");
}
- let url = "";
- if (conf2.arrowMarkerAbsolute) {
- url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
- url = url.replace(/\(/g, "\\(");
- url = url.replace(/\)/g, "\\)");
+ /**
+ * Add a relationship
+ *
+ * @param entA - The first entity in the relationship
+ * @param rolA - The role played by the first entity in relation to the second
+ * @param entB - The second entity in the relationship
+ * @param rSpec - The details of the relationship between the two entities
+ */
+ addRelationship(entA, rolA, entB, rSpec) {
+ const entityA = this.entities.get(entA);
+ const entityB = this.entities.get(entB);
+ if (!entityA || !entityB) {
+ return;
+ }
+ const rel2 = {
+ entityA: entityA.id,
+ roleA: rolA,
+ entityB: entityB.id,
+ relSpec: rSpec
+ };
+ this.relationships.push(rel2);
+ log.debug("Added new relationship :", rel2);
}
- switch (rel2.relSpec.cardA) {
- case diagObj.db.Cardinality.ZERO_OR_ONE:
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_ONE_END + ")");
- break;
- case diagObj.db.Cardinality.ZERO_OR_MORE:
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_MORE_END + ")");
- break;
- case diagObj.db.Cardinality.ONE_OR_MORE:
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ONE_OR_MORE_END + ")");
- break;
- case diagObj.db.Cardinality.ONLY_ONE:
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ONLY_ONE_END + ")");
- break;
- case diagObj.db.Cardinality.MD_PARENT:
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.MD_PARENT_END + ")");
- break;
+ getRelationships() {
+ return this.relationships;
}
- switch (rel2.relSpec.cardB) {
- case diagObj.db.Cardinality.ZERO_OR_ONE:
- svgPath.attr(
- "marker-start",
- "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_ONE_START + ")"
- );
- break;
- case diagObj.db.Cardinality.ZERO_OR_MORE:
- svgPath.attr(
- "marker-start",
- "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_MORE_START + ")"
- );
- break;
- case diagObj.db.Cardinality.ONE_OR_MORE:
- svgPath.attr(
- "marker-start",
- "url(" + url + "#" + erMarkers_default.ERMarkers.ONE_OR_MORE_START + ")"
- );
- break;
- case diagObj.db.Cardinality.ONLY_ONE:
- svgPath.attr("marker-start", "url(" + url + "#" + erMarkers_default.ERMarkers.ONLY_ONE_START + ")");
- break;
- case diagObj.db.Cardinality.MD_PARENT:
- svgPath.attr("marker-start", "url(" + url + "#" + erMarkers_default.ERMarkers.MD_PARENT_START + ")");
- break;
+ getDirection() {
+ return this.direction;
}
- const len = svgPath.node().getTotalLength();
- const labelPoint = svgPath.node().getPointAtLength(len * 0.5);
- const labelId = "rel" + relCnt;
- const labelText = rel2.roleA.split(/ /g);
- const labelNode = svg.append("text").classed("er relationshipLabel", true).attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", getConfig2().fontFamily).style("font-size", conf2.fontSize + "px");
- if (labelText.length == 1) {
- labelNode.text(rel2.roleA);
- } else {
- const firstShift = -(labelText.length - 1) * 0.5;
- labelText.forEach((txt, i2) => {
- labelNode.append("tspan").attr("x", labelPoint.x).attr("dy", `${i2 === 0 ? firstShift : 1}em`).text(txt);
+ setDirection(dir2) {
+ this.direction = dir2;
+ }
+ getCompiledStyles(classDefs) {
+ let compiledStyles = [];
+ for (const customClass of classDefs) {
+ const cssClass = this.classes.get(customClass);
+ if (cssClass?.styles) {
+ compiledStyles = [...compiledStyles, ...cssClass.styles ?? []].map((s2) => s2.trim());
+ }
+ if (cssClass?.textStyles) {
+ compiledStyles = [...compiledStyles, ...cssClass.textStyles ?? []].map((s2) => s2.trim());
+ }
+ }
+ return compiledStyles;
+ }
+ addCssStyles(ids, styles4) {
+ for (const id29 of ids) {
+ const entity = this.entities.get(id29);
+ if (!styles4 || !entity) {
+ return;
+ }
+ for (const style3 of styles4) {
+ entity.cssStyles.push(style3);
+ }
+ }
+ }
+ addClass(ids, style3) {
+ ids.forEach((id29) => {
+ let classNode = this.classes.get(id29);
+ if (classNode === void 0) {
+ classNode = { id: id29, styles: [], textStyles: [] };
+ this.classes.set(id29, classNode);
+ }
+ if (style3) {
+ style3.forEach(function(s2) {
+ if (/color/.exec(s2)) {
+ const newStyle = s2.replace("fill", "bgFill");
+ classNode.textStyles.push(newStyle);
+ }
+ classNode.styles.push(s2);
+ });
+ }
});
}
- const labelBBox = labelNode.node().getBBox();
- svg.insert("rect", "#" + labelId).classed("er relationshipLabelBox", true).attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height);
- }, "drawRelationshipFromLayout");
- draw3 = /* @__PURE__ */ __name(function(text2, id27, _version, diagObj) {
- conf2 = getConfig2().er;
- log.info("Drawing ER diagram");
- const securityLevel = getConfig2().securityLevel;
- let sandboxElement;
- if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ setClass(ids, classNames) {
+ for (const id29 of ids) {
+ const entity = this.entities.get(id29);
+ if (entity) {
+ for (const className of classNames) {
+ entity.cssClasses += " " + className;
+ }
+ }
+ }
+ }
+ clear() {
+ this.entities = /* @__PURE__ */ new Map();
+ this.classes = /* @__PURE__ */ new Map();
+ this.relationships = [];
+ clear();
+ }
+ getData() {
+ const nodes6 = [];
+ const edges3 = [];
+ const config5 = getConfig2();
+ for (const entityKey of this.entities.keys()) {
+ const entityNode = this.entities.get(entityKey);
+ if (entityNode) {
+ entityNode.cssCompiledStyles = this.getCompiledStyles(entityNode.cssClasses.split(" "));
+ nodes6.push(entityNode);
+ }
+ }
+ let count = 0;
+ for (const relationship of this.relationships) {
+ const edge = {
+ id: getEdgeId(relationship.entityA, relationship.entityB, {
+ prefix: "id",
+ counter: count++
+ }),
+ type: "normal",
+ curve: "basis",
+ start: relationship.entityA,
+ end: relationship.entityB,
+ label: relationship.roleA,
+ labelpos: "c",
+ thickness: "normal",
+ classes: "relationshipLine",
+ arrowTypeStart: relationship.relSpec.cardB.toLowerCase(),
+ arrowTypeEnd: relationship.relSpec.cardA.toLowerCase(),
+ pattern: relationship.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed",
+ look: config5.look
+ };
+ edges3.push(edge);
+ }
+ return { nodes: nodes6, edges: edges3, other: {}, config: config5, direction: "TB" };
}
- const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const svg = root4.select(`[id='${id27}']`);
- erMarkers_default.insertMarkers(svg, conf2);
- let g2;
- g2 = new Graph({
- multigraph: true,
- directed: true,
- compound: false
- }).setGraph({
- rankdir: conf2.layoutDirection,
- marginx: 20,
- marginy: 20,
- nodesep: 100,
- edgesep: 100,
- ranksep: 100
- }).setDefaultEdgeLabel(function() {
- return {};
- });
- const firstEntity = drawEntities(svg, diagObj.db.getEntities(), g2);
- const relationships2 = addRelationships(diagObj.db.getRelationships(), g2);
- layout(g2);
- adjustEntities(svg, g2);
- relationships2.forEach(function(rel2) {
- drawRelationshipFromLayout(svg, rel2, g2, firstEntity, diagObj);
- });
- const padding3 = conf2.diagramPadding;
- utils_default2.insertTitle(svg, "entityTitleText", conf2.titleTopMargin, diagObj.db.getDiagramTitle());
- const svgBounds = svg.node().getBBox();
- const width3 = svgBounds.width + padding3 * 2;
- const height2 = svgBounds.height + padding3 * 2;
- configureSvgSize(svg, height2, width3, conf2.useMaxWidth);
- svg.attr("viewBox", `${svgBounds.x - padding3} ${svgBounds.y - padding3} ${width3} ${height2}`);
- }, "draw");
- MERMAID_ERDIAGRAM_UUID = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c";
- __name(generateId2, "generateId");
- __name(strWithHyphen, "strWithHyphen");
- erRenderer_default = {
- setConf: setConf2,
- draw: draw3
};
}
});
- // src/diagrams/er/styles.js
- var getStyles4, styles_default4;
+ // src/diagrams/er/erRenderer-unified.ts
+ var erRenderer_unified_exports = {};
+ __export(erRenderer_unified_exports, {
+ draw: () => draw3
+ });
+ var draw3;
+ var init_erRenderer_unified = __esm({
+ "src/diagrams/er/erRenderer-unified.ts"() {
+ "use strict";
+ init_diagramAPI();
+ init_logger();
+ init_insertElementsForSize();
+ init_render();
+ init_setupViewPortForSVG();
+ init_utils2();
+ init_src32();
+ draw3 = /* @__PURE__ */ __name(async function(text4, id29, _version, diag) {
+ log.info("REF0:");
+ log.info("Drawing er diagram (unified)", id29);
+ const { securityLevel, er: conf5, layout: layout6 } = getConfig2();
+ const data4Layout = diag.db.getData();
+ const svg2 = getDiagramElement(id29, securityLevel);
+ data4Layout.type = diag.type;
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout6);
+ data4Layout.config.flowchart.nodeSpacing = conf5?.nodeSpacing || 140;
+ data4Layout.config.flowchart.rankSpacing = conf5?.rankSpacing || 80;
+ data4Layout.direction = diag.db.getDirection();
+ data4Layout.markers = ["only_one", "zero_or_one", "one_or_more", "zero_or_more"];
+ data4Layout.diagramId = id29;
+ await render4(data4Layout, svg2);
+ if (data4Layout.layoutAlgorithm === "elk") {
+ svg2.select(".edges").lower();
+ }
+ const backgroundNodes = svg2.selectAll('[id*="-background"]');
+ if (Array.from(backgroundNodes).length > 0) {
+ backgroundNodes.each(function() {
+ const backgroundNode = select_default2(this);
+ const backgroundId = backgroundNode.attr("id");
+ const nonBackgroundId = backgroundId.replace("-background", "");
+ const nonBackgroundNode = svg2.select(`#${CSS.escape(nonBackgroundId)}`);
+ if (!nonBackgroundNode.empty()) {
+ const transform8 = nonBackgroundNode.attr("transform");
+ backgroundNode.attr("transform", transform8);
+ }
+ });
+ }
+ const padding2 = 8;
+ utils_default2.insertTitle(
+ svg2,
+ "erDiagramTitleText",
+ conf5?.titleTopMargin ?? 25,
+ diag.db.getDiagramTitle()
+ );
+ setupViewPortForSVG(svg2, padding2, "erDiagram", conf5?.useMaxWidth ?? true);
+ }, "draw");
+ }
+ });
+
+ // src/diagrams/er/styles.ts
+ var fade2, getStyles4, styles_default4;
var init_styles4 = __esm({
- "src/diagrams/er/styles.js"() {
+ "src/diagrams/er/styles.ts"() {
"use strict";
+ init_dist();
+ fade2 = /* @__PURE__ */ __name((color2, opacity) => {
+ const channel2 = channel_default2;
+ const r2 = channel2(color2, "r");
+ const g2 = channel2(color2, "g");
+ const b2 = channel2(color2, "b");
+ return rgba_default(r2, g2, b2, opacity);
+ }, "fade");
getStyles4 = /* @__PURE__ */ __name((options3) => `
.entityBox {
fill: ${options3.mainBkg};
stroke: ${options3.nodeBorder};
}
- .attributeBoxOdd {
- fill: ${options3.attributeBackgroundColorOdd};
- stroke: ${options3.nodeBorder};
- }
-
- .attributeBoxEven {
- fill: ${options3.attributeBackgroundColorEven};
- stroke: ${options3.nodeBorder};
- }
-
.relationshipLabelBox {
fill: ${options3.tertiaryColor};
opacity: 0.7;
@@ -53088,26 +58407,45 @@ ${text2}
}
}
- .relationshipLine {
- stroke: ${options3.lineColor};
- }
+ .labelBkg {
+ background-color: ${fade2(options3.tertiaryColor, 0.5)};
+ }
- .entityTitleText {
- text-anchor: middle;
- font-size: 18px;
- fill: ${options3.textColor};
- }
- #MD_PARENT_START {
- fill: #f5f5f5 !important;
- stroke: ${options3.lineColor} !important;
+ .edgeLabel .label {
+ fill: ${options3.nodeBorder};
+ font-size: 14px;
+ }
+
+ .label {
+ font-family: ${options3.fontFamily};
+ color: ${options3.nodeTextColor || options3.textColor};
+ }
+
+ .edge-pattern-dashed {
+ stroke-dasharray: 8,8;
+ }
+
+ .node rect,
+ .node circle,
+ .node ellipse,
+ .node polygon
+ {
+ fill: ${options3.mainBkg};
+ stroke: ${options3.nodeBorder};
+ stroke-width: 1px;
+ }
+
+ .relationshipLine {
+ stroke: ${options3.lineColor};
stroke-width: 1;
+ fill: none;
}
- #MD_PARENT_END {
- fill: #f5f5f5 !important;
+
+ .marker {
+ fill: none !important;
stroke: ${options3.lineColor} !important;
stroke-width: 1;
}
-
`, "getStyles");
styles_default4 = getStyles4;
}
@@ -53124,18 +58462,20 @@ ${text2}
"use strict";
init_erDiagram();
init_erDb();
- init_erRenderer();
+ init_erRenderer_unified();
init_styles4();
diagram3 = {
parser: erDiagram_default,
- db: erDb_default,
- renderer: erRenderer_default,
+ get db() {
+ return new ErDB();
+ },
+ renderer: erRenderer_unified_exports,
styles: styles_default4
};
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/syntax-tree.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/syntax-tree.js
function isAstNode(obj) {
return typeof obj === "object" && obj !== null && typeof obj.$type === "string";
}
@@ -53159,7 +58499,7 @@ ${text2}
}
var AbstractAstReflection;
var init_syntax_tree = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/syntax-tree.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/syntax-tree.js"() {
"use strict";
__name(isAstNode, "isAstNode");
__name(isReference, "isReference");
@@ -53216,8 +58556,8 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/stream.js
- function toString2(item) {
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/stream.js
+ function toString3(item) {
if (typeof item === "string") {
return item;
}
@@ -53242,9 +58582,9 @@ ${text2}
return new StreamImpl(() => collection4[Symbol.iterator](), (iterator) => iterator.next());
}
if (typeof collection4.length === "number") {
- return new StreamImpl(() => ({ index: 0 }), (state5) => {
- if (state5.index < collection4.length) {
- return { done: false, value: collection4[state5.index++] };
+ return new StreamImpl(() => ({ index: 0 }), (state4) => {
+ if (state4.index < collection4.length) {
+ return { done: false, value: collection4[state4.index++] };
} else {
return DONE_RESULT;
}
@@ -53252,31 +58592,31 @@ ${text2}
}
}
if (collections.length > 1) {
- return new StreamImpl(() => ({ collIndex: 0, arrIndex: 0 }), (state5) => {
+ return new StreamImpl(() => ({ collIndex: 0, arrIndex: 0 }), (state4) => {
do {
- if (state5.iterator) {
- const next3 = state5.iterator.next();
+ if (state4.iterator) {
+ const next3 = state4.iterator.next();
if (!next3.done) {
return next3;
}
- state5.iterator = void 0;
+ state4.iterator = void 0;
}
- if (state5.array) {
- if (state5.arrIndex < state5.array.length) {
- return { done: false, value: state5.array[state5.arrIndex++] };
+ if (state4.array) {
+ if (state4.arrIndex < state4.array.length) {
+ return { done: false, value: state4.array[state4.arrIndex++] };
}
- state5.array = void 0;
- state5.arrIndex = 0;
+ state4.array = void 0;
+ state4.arrIndex = 0;
}
- if (state5.collIndex < collections.length) {
- const collection4 = collections[state5.collIndex++];
+ if (state4.collIndex < collections.length) {
+ const collection4 = collections[state4.collIndex++];
if (isIterable(collection4)) {
- state5.iterator = collection4[Symbol.iterator]();
+ state4.iterator = collection4[Symbol.iterator]();
} else if (collection4 && typeof collection4.length === "number") {
- state5.array = collection4;
+ state4.array = collection4;
}
}
- } while (state5.iterator || state5.array || state5.collIndex < collections.length);
+ } while (state4.iterator || state4.array || state4.collIndex < collections.length);
return DONE_RESULT;
});
}
@@ -53284,7 +58624,7 @@ ${text2}
}
var StreamImpl, EMPTY_STREAM, DONE_RESULT, TreeStreamImpl, Reduction;
var init_stream = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/stream.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/stream.js"() {
"use strict";
StreamImpl = class _StreamImpl {
static {
@@ -53344,21 +58684,20 @@ ${text2}
toString() {
return this.join();
}
- concat(other) {
- const iterator = other[Symbol.iterator]();
- return new _StreamImpl(() => ({ first: this.startFn(), firstDone: false }), (state5) => {
+ concat(other2) {
+ return new _StreamImpl(() => ({ first: this.startFn(), firstDone: false, iterator: other2[Symbol.iterator]() }), (state4) => {
let result;
- if (!state5.firstDone) {
+ if (!state4.firstDone) {
do {
- result = this.nextFn(state5.first);
+ result = this.nextFn(state4.first);
if (!result.done) {
return result;
}
} while (!result.done);
- state5.firstDone = true;
+ state4.firstDone = true;
}
do {
- result = iterator.next();
+ result = state4.iterator.next();
if (!result.done) {
return result;
}
@@ -53377,7 +58716,7 @@ ${text2}
if (addSeparator) {
value2 += separator;
}
- value2 += toString2(result.value);
+ value2 += toString3(result.value);
}
addSeparator = true;
} while (!result.done);
@@ -53429,8 +58768,8 @@ ${text2}
}
}
map(callbackfn) {
- return new _StreamImpl(this.startFn, (state5) => {
- const { done, value: value2 } = this.nextFn(state5);
+ return new _StreamImpl(this.startFn, (state4) => {
+ const { done, value: value2 } = this.nextFn(state4);
if (done) {
return DONE_RESULT;
} else {
@@ -53439,10 +58778,10 @@ ${text2}
});
}
filter(predicate) {
- return new _StreamImpl(this.startFn, (state5) => {
+ return new _StreamImpl(this.startFn, (state4) => {
let result;
do {
- result = this.nextFn(state5);
+ result = this.nextFn(state4);
if (!result.done && predicate(result.value)) {
return result;
}
@@ -53517,26 +58856,26 @@ ${text2}
return false;
}
flatMap(callbackfn) {
- return new _StreamImpl(() => ({ this: this.startFn() }), (state5) => {
+ return new _StreamImpl(() => ({ this: this.startFn() }), (state4) => {
do {
- if (state5.iterator) {
- const next3 = state5.iterator.next();
+ if (state4.iterator) {
+ const next3 = state4.iterator.next();
if (next3.done) {
- state5.iterator = void 0;
+ state4.iterator = void 0;
} else {
return next3;
}
}
- const { done, value: value2 } = this.nextFn(state5.this);
+ const { done, value: value2 } = this.nextFn(state4.this);
if (!done) {
const mapped = callbackfn(value2);
if (isIterable(mapped)) {
- state5.iterator = mapped[Symbol.iterator]();
+ state4.iterator = mapped[Symbol.iterator]();
} else {
return { done: false, value: mapped };
}
}
- } while (state5.iterator);
+ } while (state4.iterator);
return DONE_RESULT;
});
}
@@ -53548,25 +58887,25 @@ ${text2}
return this;
}
const stream2 = depth > 1 ? this.flat(depth - 1) : this;
- return new _StreamImpl(() => ({ this: stream2.startFn() }), (state5) => {
+ return new _StreamImpl(() => ({ this: stream2.startFn() }), (state4) => {
do {
- if (state5.iterator) {
- const next3 = state5.iterator.next();
+ if (state4.iterator) {
+ const next3 = state4.iterator.next();
if (next3.done) {
- state5.iterator = void 0;
+ state4.iterator = void 0;
} else {
return next3;
}
}
- const { done, value: value2 } = stream2.nextFn(state5.this);
+ const { done, value: value2 } = stream2.nextFn(state4.this);
if (!done) {
if (isIterable(value2)) {
- state5.iterator = value2[Symbol.iterator]();
+ state4.iterator = value2[Symbol.iterator]();
} else {
return { done: false, value: value2 };
}
}
- } while (state5.iterator);
+ } while (state4.iterator);
return DONE_RESULT;
});
}
@@ -53580,40 +58919,44 @@ ${text2}
}
tail(skipCount = 1) {
return new _StreamImpl(() => {
- const state5 = this.startFn();
+ const state4 = this.startFn();
for (let i2 = 0; i2 < skipCount; i2++) {
- const next3 = this.nextFn(state5);
+ const next3 = this.nextFn(state4);
if (next3.done) {
- return state5;
+ return state4;
}
}
- return state5;
+ return state4;
}, this.nextFn);
}
limit(maxSize) {
- return new _StreamImpl(() => ({ size: 0, state: this.startFn() }), (state5) => {
- state5.size++;
- if (state5.size > maxSize) {
+ return new _StreamImpl(() => ({ size: 0, state: this.startFn() }), (state4) => {
+ state4.size++;
+ if (state4.size > maxSize) {
return DONE_RESULT;
}
- return this.nextFn(state5.state);
+ return this.nextFn(state4.state);
});
}
distinct(by) {
- const set6 = /* @__PURE__ */ new Set();
- return this.filter((e3) => {
- const value2 = by ? by(e3) : e3;
- if (set6.has(value2)) {
- return false;
- } else {
- set6.add(value2);
- return true;
- }
+ return new _StreamImpl(() => ({ set: /* @__PURE__ */ new Set(), internalState: this.startFn() }), (state4) => {
+ let result;
+ do {
+ result = this.nextFn(state4.internalState);
+ if (!result.done) {
+ const value2 = by ? by(result.value) : result.value;
+ if (!state4.set.has(value2)) {
+ state4.set.add(value2);
+ return result;
+ }
+ }
+ } while (!result.done);
+ return DONE_RESULT;
});
}
- exclude(other, key) {
+ exclude(other2, key) {
const otherKeySet = /* @__PURE__ */ new Set();
- for (const item of other) {
+ for (const item of other2) {
const value2 = key ? key(item) : item;
otherKeySet.add(value2);
}
@@ -53623,7 +58966,7 @@ ${text2}
});
}
};
- __name(toString2, "toString");
+ __name(toString3, "toString");
__name(isIterable, "isIterable");
EMPTY_STREAM = new StreamImpl(() => void 0, () => DONE_RESULT);
DONE_RESULT = Object.freeze({ done: true, value: void 0 });
@@ -53636,18 +58979,18 @@ ${text2}
super(() => ({
iterators: (options3 === null || options3 === void 0 ? void 0 : options3.includeRoot) ? [[root4][Symbol.iterator]()] : [children2(root4)[Symbol.iterator]()],
pruned: false
- }), (state5) => {
- if (state5.pruned) {
- state5.iterators.pop();
- state5.pruned = false;
+ }), (state4) => {
+ if (state4.pruned) {
+ state4.iterators.pop();
+ state4.pruned = false;
}
- while (state5.iterators.length > 0) {
- const iterator = state5.iterators[state5.iterators.length - 1];
+ while (state4.iterators.length > 0) {
+ const iterator = state4.iterators[state4.iterators.length - 1];
const next3 = iterator.next();
if (next3.done) {
- state5.iterators.pop();
+ state4.iterators.pop();
} else {
- state5.iterators.push(children2(next3.value)[Symbol.iterator]());
+ state4.iterators.push(children2(next3.value)[Symbol.iterator]());
return next3;
}
}
@@ -53691,7 +59034,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/cst-utils.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/cst-utils.js
var cst_utils_exports = {};
__export(cst_utils_exports, {
DefaultNameRegexp: () => DefaultNameRegexp,
@@ -53742,6 +59085,7 @@ ${text2}
},
end: {
character: token2.endColumn,
+ // endColumn uses the correct index
line: token2.endLine - 1
}
};
@@ -53759,9 +59103,9 @@ ${text2}
};
}
function compareRange(range3, to) {
- if (range3.end.line < to.start.line || range3.end.line === to.start.line && range3.end.character < range3.start.character) {
+ if (range3.end.line < to.start.line || range3.end.line === to.start.line && range3.end.character <= to.start.character) {
return RangeComparison.Before;
- } else if (range3.start.line > to.end.line || range3.start.line === to.end.line && range3.start.character > to.end.character) {
+ } else if (range3.start.line > to.end.line || range3.start.line === to.end.line && range3.start.character >= to.end.character) {
return RangeComparison.After;
}
const startInside = range3.start.line > to.start.line || range3.start.line === to.start.line && range3.start.character >= to.start.character;
@@ -53770,8 +59114,10 @@ ${text2}
return RangeComparison.Inside;
} else if (startInside) {
return RangeComparison.OverlapBack;
- } else {
+ } else if (endInside) {
return RangeComparison.OverlapFront;
+ } else {
+ return RangeComparison.Outside;
}
}
function inRange(range3, to) {
@@ -53949,7 +59295,7 @@ ${text2}
}
var RangeComparison, DefaultNameRegexp;
var init_cst_utils = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/cst-utils.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/cst-utils.js"() {
"use strict";
init_syntax_tree();
init_stream();
@@ -53964,6 +59310,7 @@ ${text2}
RangeComparison2[RangeComparison2["OverlapFront"] = 2] = "OverlapFront";
RangeComparison2[RangeComparison2["OverlapBack"] = 3] = "OverlapBack";
RangeComparison2[RangeComparison2["Inside"] = 4] = "Inside";
+ RangeComparison2[RangeComparison2["Outside"] = 5] = "Outside";
})(RangeComparison || (RangeComparison = {}));
__name(compareRange, "compareRange");
__name(inRange, "inRange");
@@ -53983,13 +59330,13 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/errors.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/errors.js
function assertUnreachable(_2) {
throw new Error("Error! The input value was not handled.");
}
var ErrorWithLocation;
var init_errors2 = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/errors.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/errors.js"() {
"use strict";
ErrorWithLocation = class extends Error {
static {
@@ -54003,7 +59350,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/generated/ast.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/languages/generated/ast.js
var ast_exports = {};
__export(ast_exports, {
AbstractElement: () => AbstractElement,
@@ -54250,7 +59597,7 @@ ${text2}
}
var LangiumGrammarTerminals, AbstractRule, AbstractType, Condition, TypeDefinition, ValueLiteral, AbstractElement, ArrayLiteral, ArrayType, BooleanLiteral, Conjunction, Disjunction, Grammar, GrammarImport, InferredType, Interface, NamedArgument, Negation, NumberLiteral, Parameter, ParameterReference, ParserRule, ReferenceType, ReturnType, SimpleType, StringLiteral, TerminalRule, Type2, TypeAttribute, UnionType, Action, Alternatives, Assignment, CharacterRange, CrossReference, EndOfFile, Group, Keyword2, NegatedToken, RegexToken, RuleCall, TerminalAlternatives, TerminalGroup, TerminalRuleCall, UnorderedGroup, UntilToken, Wildcard, LangiumGrammarAstReflection, reflection;
var init_ast = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/generated/ast.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/languages/generated/ast.js"() {
"use strict";
init_syntax_tree();
LangiumGrammarTerminals = {
@@ -54361,7 +59708,7 @@ ${text2}
__name(this, "LangiumGrammarAstReflection");
}
getAllTypes() {
- return ["AbstractElement", "AbstractRule", "AbstractType", "Action", "Alternatives", "ArrayLiteral", "ArrayType", "Assignment", "BooleanLiteral", "CharacterRange", "Condition", "Conjunction", "CrossReference", "Disjunction", "EndOfFile", "Grammar", "GrammarImport", "Group", "InferredType", "Interface", "Keyword", "NamedArgument", "NegatedToken", "Negation", "NumberLiteral", "Parameter", "ParameterReference", "ParserRule", "ReferenceType", "RegexToken", "ReturnType", "RuleCall", "SimpleType", "StringLiteral", "TerminalAlternatives", "TerminalGroup", "TerminalRule", "TerminalRuleCall", "Type", "TypeAttribute", "TypeDefinition", "UnionType", "UnorderedGroup", "UntilToken", "ValueLiteral", "Wildcard"];
+ return [AbstractElement, AbstractRule, AbstractType, Action, Alternatives, ArrayLiteral, ArrayType, Assignment, BooleanLiteral, CharacterRange, Condition, Conjunction, CrossReference, Disjunction, EndOfFile, Grammar, GrammarImport, Group, InferredType, Interface, Keyword2, NamedArgument, NegatedToken, Negation, NumberLiteral, Parameter, ParameterReference, ParserRule, ReferenceType, RegexToken, ReturnType, RuleCall, SimpleType, StringLiteral, TerminalAlternatives, TerminalGroup, TerminalRule, TerminalRuleCall, Type2, TypeAttribute, TypeDefinition, UnionType, UnorderedGroup, UntilToken, ValueLiteral, Wildcard];
}
computeIsSubtype(subtype, supertype) {
switch (subtype) {
@@ -54452,60 +59799,60 @@ ${text2}
}
getTypeMetaData(type3) {
switch (type3) {
- case "AbstractElement": {
+ case AbstractElement: {
return {
- name: "AbstractElement",
+ name: AbstractElement,
properties: [
{ name: "cardinality" },
{ name: "lookahead" }
]
};
}
- case "ArrayLiteral": {
+ case ArrayLiteral: {
return {
- name: "ArrayLiteral",
+ name: ArrayLiteral,
properties: [
{ name: "elements", defaultValue: [] }
]
};
}
- case "ArrayType": {
+ case ArrayType: {
return {
- name: "ArrayType",
+ name: ArrayType,
properties: [
{ name: "elementType" }
]
};
}
- case "BooleanLiteral": {
+ case BooleanLiteral: {
return {
- name: "BooleanLiteral",
+ name: BooleanLiteral,
properties: [
{ name: "true", defaultValue: false }
]
};
}
- case "Conjunction": {
+ case Conjunction: {
return {
- name: "Conjunction",
+ name: Conjunction,
properties: [
{ name: "left" },
{ name: "right" }
]
};
}
- case "Disjunction": {
+ case Disjunction: {
return {
- name: "Disjunction",
+ name: Disjunction,
properties: [
{ name: "left" },
{ name: "right" }
]
};
}
- case "Grammar": {
+ case Grammar: {
return {
- name: "Grammar",
+ name: Grammar,
properties: [
{ name: "definesHiddenTokens", defaultValue: false },
{ name: "hiddenTokens", defaultValue: [] },
@@ -54519,25 +59866,25 @@ ${text2}
]
};
}
- case "GrammarImport": {
+ case GrammarImport: {
return {
- name: "GrammarImport",
+ name: GrammarImport,
properties: [
{ name: "path" }
]
};
}
- case "InferredType": {
+ case InferredType: {
return {
- name: "InferredType",
+ name: InferredType,
properties: [
{ name: "name" }
]
};
}
- case "Interface": {
+ case Interface: {
return {
- name: "Interface",
+ name: Interface,
properties: [
{ name: "attributes", defaultValue: [] },
{ name: "name" },
@@ -54545,9 +59892,9 @@ ${text2}
]
};
}
- case "NamedArgument": {
+ case NamedArgument: {
return {
- name: "NamedArgument",
+ name: NamedArgument,
properties: [
{ name: "calledByName", defaultValue: false },
{ name: "parameter" },
@@ -54555,41 +59902,41 @@ ${text2}
]
};
}
- case "Negation": {
+ case Negation: {
return {
- name: "Negation",
+ name: Negation,
properties: [
{ name: "value" }
]
};
}
- case "NumberLiteral": {
+ case NumberLiteral: {
return {
- name: "NumberLiteral",
+ name: NumberLiteral,
properties: [
{ name: "value" }
]
};
}
- case "Parameter": {
+ case Parameter: {
return {
- name: "Parameter",
+ name: Parameter,
properties: [
{ name: "name" }
]
};
}
- case "ParameterReference": {
+ case ParameterReference: {
return {
- name: "ParameterReference",
+ name: ParameterReference,
properties: [
{ name: "parameter" }
]
};
}
- case "ParserRule": {
+ case ParserRule: {
return {
- name: "ParserRule",
+ name: ParserRule,
properties: [
{ name: "dataType" },
{ name: "definesHiddenTokens", defaultValue: false },
@@ -54605,25 +59952,25 @@ ${text2}
]
};
}
- case "ReferenceType": {
+ case ReferenceType: {
return {
- name: "ReferenceType",
+ name: ReferenceType,
properties: [
{ name: "referenceType" }
]
};
}
- case "ReturnType": {
+ case ReturnType: {
return {
- name: "ReturnType",
+ name: ReturnType,
properties: [
{ name: "name" }
]
};
}
- case "SimpleType": {
+ case SimpleType: {
return {
- name: "SimpleType",
+ name: SimpleType,
properties: [
{ name: "primitiveType" },
{ name: "stringType" },
@@ -54631,17 +59978,17 @@ ${text2}
]
};
}
- case "StringLiteral": {
+ case StringLiteral: {
return {
- name: "StringLiteral",
+ name: StringLiteral,
properties: [
{ name: "value" }
]
};
}
- case "TerminalRule": {
+ case TerminalRule: {
return {
- name: "TerminalRule",
+ name: TerminalRule,
properties: [
{ name: "definition" },
{ name: "fragment", defaultValue: false },
@@ -54651,18 +59998,18 @@ ${text2}
]
};
}
- case "Type": {
+ case Type2: {
return {
- name: "Type",
+ name: Type2,
properties: [
{ name: "name" },
{ name: "type" }
]
};
}
- case "TypeAttribute": {
+ case TypeAttribute: {
return {
- name: "TypeAttribute",
+ name: TypeAttribute,
properties: [
{ name: "defaultValue" },
{ name: "isOptional", defaultValue: false },
@@ -54671,17 +60018,17 @@ ${text2}
]
};
}
- case "UnionType": {
+ case UnionType: {
return {
- name: "UnionType",
+ name: UnionType,
properties: [
{ name: "types", defaultValue: [] }
]
};
}
- case "Action": {
+ case Action: {
return {
- name: "Action",
+ name: Action,
properties: [
{ name: "cardinality" },
{ name: "feature" },
@@ -54692,9 +60039,9 @@ ${text2}
]
};
}
- case "Alternatives": {
+ case Alternatives: {
return {
- name: "Alternatives",
+ name: Alternatives,
properties: [
{ name: "cardinality" },
{ name: "elements", defaultValue: [] },
@@ -54702,9 +60049,9 @@ ${text2}
]
};
}
- case "Assignment": {
+ case Assignment: {
return {
- name: "Assignment",
+ name: Assignment,
properties: [
{ name: "cardinality" },
{ name: "feature" },
@@ -54714,9 +60061,9 @@ ${text2}
]
};
}
- case "CharacterRange": {
+ case CharacterRange: {
return {
- name: "CharacterRange",
+ name: CharacterRange,
properties: [
{ name: "cardinality" },
{ name: "left" },
@@ -54725,9 +60072,9 @@ ${text2}
]
};
}
- case "CrossReference": {
+ case CrossReference: {
return {
- name: "CrossReference",
+ name: CrossReference,
properties: [
{ name: "cardinality" },
{ name: "deprecatedSyntax", defaultValue: false },
@@ -54737,18 +60084,18 @@ ${text2}
]
};
}
- case "EndOfFile": {
+ case EndOfFile: {
return {
- name: "EndOfFile",
+ name: EndOfFile,
properties: [
{ name: "cardinality" },
{ name: "lookahead" }
]
};
}
- case "Group": {
+ case Group: {
return {
- name: "Group",
+ name: Group,
properties: [
{ name: "cardinality" },
{ name: "elements", defaultValue: [] },
@@ -54757,9 +60104,9 @@ ${text2}
]
};
}
- case "Keyword": {
+ case Keyword2: {
return {
- name: "Keyword",
+ name: Keyword2,
properties: [
{ name: "cardinality" },
{ name: "lookahead" },
@@ -54767,9 +60114,9 @@ ${text2}
]
};
}
- case "NegatedToken": {
+ case NegatedToken: {
return {
- name: "NegatedToken",
+ name: NegatedToken,
properties: [
{ name: "cardinality" },
{ name: "lookahead" },
@@ -54777,9 +60124,9 @@ ${text2}
]
};
}
- case "RegexToken": {
+ case RegexToken: {
return {
- name: "RegexToken",
+ name: RegexToken,
properties: [
{ name: "cardinality" },
{ name: "lookahead" },
@@ -54787,9 +60134,9 @@ ${text2}
]
};
}
- case "RuleCall": {
+ case RuleCall: {
return {
- name: "RuleCall",
+ name: RuleCall,
properties: [
{ name: "arguments", defaultValue: [] },
{ name: "cardinality" },
@@ -54798,9 +60145,9 @@ ${text2}
]
};
}
- case "TerminalAlternatives": {
+ case TerminalAlternatives: {
return {
- name: "TerminalAlternatives",
+ name: TerminalAlternatives,
properties: [
{ name: "cardinality" },
{ name: "elements", defaultValue: [] },
@@ -54808,9 +60155,9 @@ ${text2}
]
};
}
- case "TerminalGroup": {
+ case TerminalGroup: {
return {
- name: "TerminalGroup",
+ name: TerminalGroup,
properties: [
{ name: "cardinality" },
{ name: "elements", defaultValue: [] },
@@ -54818,9 +60165,9 @@ ${text2}
]
};
}
- case "TerminalRuleCall": {
+ case TerminalRuleCall: {
return {
- name: "TerminalRuleCall",
+ name: TerminalRuleCall,
properties: [
{ name: "cardinality" },
{ name: "lookahead" },
@@ -54828,9 +60175,9 @@ ${text2}
]
};
}
- case "UnorderedGroup": {
+ case UnorderedGroup: {
return {
- name: "UnorderedGroup",
+ name: UnorderedGroup,
properties: [
{ name: "cardinality" },
{ name: "elements", defaultValue: [] },
@@ -54838,9 +60185,9 @@ ${text2}
]
};
}
- case "UntilToken": {
+ case UntilToken: {
return {
- name: "UntilToken",
+ name: UntilToken,
properties: [
{ name: "cardinality" },
{ name: "lookahead" },
@@ -54848,9 +60195,9 @@ ${text2}
]
};
}
- case "Wildcard": {
+ case Wildcard: {
return {
- name: "Wildcard",
+ name: Wildcard,
properties: [
{ name: "cardinality" },
{ name: "lookahead" }
@@ -54870,7 +60217,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/ast-utils.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/ast-utils.js
var ast_utils_exports = {};
__export(ast_utils_exports, {
assignMandatoryProperties: () => assignMandatoryProperties,
@@ -54947,28 +60294,28 @@ ${text2}
keys: Object.keys(node2),
keyIndex: 0,
arrayIndex: 0
- }), (state5) => {
- while (state5.keyIndex < state5.keys.length) {
- const property2 = state5.keys[state5.keyIndex];
+ }), (state4) => {
+ while (state4.keyIndex < state4.keys.length) {
+ const property2 = state4.keys[state4.keyIndex];
if (!property2.startsWith("$")) {
const value2 = node2[property2];
if (isAstNode(value2)) {
- state5.keyIndex++;
+ state4.keyIndex++;
if (isAstNodeInRange(value2, range3)) {
return { done: false, value: value2 };
}
} else if (Array.isArray(value2)) {
- while (state5.arrayIndex < value2.length) {
- const index = state5.arrayIndex++;
+ while (state4.arrayIndex < value2.length) {
+ const index = state4.arrayIndex++;
const element3 = value2[index];
if (isAstNode(element3) && isAstNodeInRange(element3, range3)) {
return { done: false, value: element3 };
}
}
- state5.arrayIndex = 0;
+ state4.arrayIndex = 0;
}
}
- state5.keyIndex++;
+ state4.keyIndex++;
}
return DONE_RESULT;
});
@@ -55003,26 +60350,26 @@ ${text2}
keys: Object.keys(node2),
keyIndex: 0,
arrayIndex: 0
- }), (state5) => {
- while (state5.keyIndex < state5.keys.length) {
- const property2 = state5.keys[state5.keyIndex];
+ }), (state4) => {
+ while (state4.keyIndex < state4.keys.length) {
+ const property2 = state4.keys[state4.keyIndex];
if (!property2.startsWith("$")) {
const value2 = node2[property2];
if (isReference(value2)) {
- state5.keyIndex++;
+ state4.keyIndex++;
return { done: false, value: { reference: value2, container: node2, property: property2 } };
} else if (Array.isArray(value2)) {
- while (state5.arrayIndex < value2.length) {
- const index = state5.arrayIndex++;
+ while (state4.arrayIndex < value2.length) {
+ const index = state4.arrayIndex++;
const element3 = value2[index];
if (isReference(element3)) {
return { done: false, value: { reference: element3, container: node2, property: property2, index } };
}
}
- state5.arrayIndex = 0;
+ state4.arrayIndex = 0;
}
}
- state5.keyIndex++;
+ state4.keyIndex++;
}
return DONE_RESULT;
});
@@ -55055,35 +60402,35 @@ ${text2}
}
}
function copyAstNode(node2, buildReference) {
- const copy6 = { $type: node2.$type };
+ const copy5 = { $type: node2.$type };
for (const [name, value2] of Object.entries(node2)) {
if (!name.startsWith("$")) {
if (isAstNode(value2)) {
- copy6[name] = copyAstNode(value2, buildReference);
+ copy5[name] = copyAstNode(value2, buildReference);
} else if (isReference(value2)) {
- copy6[name] = buildReference(copy6, name, value2.$refNode, value2.$refText);
+ copy5[name] = buildReference(copy5, name, value2.$refNode, value2.$refText);
} else if (Array.isArray(value2)) {
const copiedArray = [];
for (const element3 of value2) {
if (isAstNode(element3)) {
copiedArray.push(copyAstNode(element3, buildReference));
} else if (isReference(element3)) {
- copiedArray.push(buildReference(copy6, name, element3.$refNode, element3.$refText));
+ copiedArray.push(buildReference(copy5, name, element3.$refNode, element3.$refText));
} else {
copiedArray.push(element3);
}
}
- copy6[name] = copiedArray;
+ copy5[name] = copiedArray;
} else {
- copy6[name] = value2;
+ copy5[name] = value2;
}
}
}
- linkContentToContainer(copy6);
- return copy6;
+ linkContentToContainer(copy5);
+ return copy5;
}
var init_ast_utils = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/ast-utils.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/ast-utils.js"() {
"use strict";
init_syntax_tree();
init_stream();
@@ -55308,6 +60655,7 @@ ${text2}
};
case "$":
return { type: "EndAnchor", loc: this.loc(begin) };
+ // '\b' or '\B'
case "\\":
switch (this.popChar()) {
case "b":
@@ -55322,6 +60670,7 @@ ${text2}
};
}
throw Error("Invalid Assertion Escape");
+ // '(?=' or '(?!'
case "(":
this.consumeChar("?");
let type3;
@@ -55574,11 +60923,17 @@ ${text2}
}
classPatternCharacterAtom() {
switch (this.peekChar()) {
+ // istanbul ignore next
case "\n":
+ // istanbul ignore next
case "\r":
+ // istanbul ignore next
case "\u2028":
+ // istanbul ignore next
case "\u2029":
+ // istanbul ignore next
case "\\":
+ // istanbul ignore next
case "]":
throw Error("TBD");
default:
@@ -55620,10 +60975,15 @@ ${text2}
}
classAtom() {
switch (this.peekChar()) {
+ // istanbul ignore next
case "]":
+ // istanbul ignore next
case "\n":
+ // istanbul ignore next
case "\r":
+ // istanbul ignore next
case "\u2028":
+ // istanbul ignore next
case "\u2029":
throw Error("TBD");
case "\\":
@@ -55635,6 +60995,8 @@ ${text2}
classEscape() {
this.consumeChar("\\");
switch (this.peekChar()) {
+ // Matches a backspace.
+ // (Not to be confused with \b word boundary outside characterClass)
case "b":
this.consumeChar("b");
return { type: "Character", value: cc("\b") };
@@ -55711,20 +61073,35 @@ ${text2}
patternCharacter() {
const nextChar = this.popChar();
switch (nextChar) {
+ // istanbul ignore next
case "\n":
+ // istanbul ignore next
case "\r":
+ // istanbul ignore next
case "\u2028":
+ // istanbul ignore next
case "\u2029":
+ // istanbul ignore next
case "^":
+ // istanbul ignore next
case "$":
+ // istanbul ignore next
case "\\":
+ // istanbul ignore next
case ".":
+ // istanbul ignore next
case "*":
+ // istanbul ignore next
case "+":
+ // istanbul ignore next
case "?":
+ // istanbul ignore next
case "(":
+ // istanbul ignore next
case ")":
+ // istanbul ignore next
case "[":
+ // istanbul ignore next
case "|":
throw Error("TBD");
default:
@@ -55771,7 +61148,10 @@ ${text2}
switch (this.peekChar(0)) {
case ".":
case "\\":
+ // atomEscape
case "[":
+ // characterClass
+ // TODO: isAtom must be called before isAssertion - disambiguate
case "(":
return true;
default:
@@ -55783,6 +61163,7 @@ ${text2}
case "^":
case "$":
return true;
+ // '\b' or '\B'
case "\\":
switch (this.peekChar(1)) {
case "b":
@@ -55791,6 +61172,7 @@ ${text2}
default:
return false;
}
+ // '(?=' or '(?!'
case "(":
return this.peekChar(1) === "?" && (this.peekChar(2) === "=" || this.peekChar(2) === "!");
default:
@@ -55984,7 +61366,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/regexp-utils.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/regexp-utils.js
var regexp_utils_exports = {};
__export(regexp_utils_exports, {
NEWLINE_REGEXP: () => NEWLINE_REGEXP,
@@ -55992,9 +61374,10 @@ ${text2}
getCaseInsensitivePattern: () => getCaseInsensitivePattern,
getTerminalParts: () => getTerminalParts,
isMultilineComment: () => isMultilineComment,
- isWhitespace: () => isWhitespace,
+ isWhitespace: () => isWhitespace2,
partialMatches: () => partialMatches,
- partialRegExp: () => partialRegExp
+ partialRegExp: () => partialRegExp,
+ whitespaceCharacters: () => whitespaceCharacters
});
function getTerminalParts(regexp) {
try {
@@ -56030,9 +61413,9 @@ ${text2}
return false;
}
}
- function isWhitespace(value2) {
+ function isWhitespace2(value2) {
const regexp = typeof value2 === "string" ? new RegExp(value2) : value2;
- return regexp.test(" ");
+ return whitespaceCharacters.some((ws) => regexp.test(ws));
}
function escapeRegExp(value2) {
return value2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -56177,9 +61560,9 @@ ${text2}
__name(process2, "process");
return new RegExp(process2(), regex2.flags);
}
- var NEWLINE_REGEXP, regexpParser, TerminalRegExpVisitor, visitor;
+ var NEWLINE_REGEXP, regexpParser, TerminalRegExpVisitor, visitor, whitespaceCharacters;
var init_regexp_utils = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/regexp-utils.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/regexp-utils.js"() {
"use strict";
init_api();
NEWLINE_REGEXP = /\r?\n/gm;
@@ -56256,7 +61639,8 @@ ${text2}
visitor = new TerminalRegExpVisitor();
__name(getTerminalParts, "getTerminalParts");
__name(isMultilineComment, "isMultilineComment");
- __name(isWhitespace, "isWhitespace");
+ whitespaceCharacters = "\f\n\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF".split("");
+ __name(isWhitespace2, "isWhitespace");
__name(escapeRegExp, "escapeRegExp");
__name(getCaseInsensitivePattern, "getCaseInsensitivePattern");
__name(partialMatches, "partialMatches");
@@ -56264,7 +61648,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/grammar-utils.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/grammar-utils.js
var grammar_utils_exports = {};
__export(grammar_utils_exports, {
findAssignment: () => findAssignment,
@@ -56282,6 +61666,7 @@ ${text2}
getExplicitRuleType: () => getExplicitRuleType,
getHiddenRules: () => getHiddenRules,
getRuleType: () => getRuleType,
+ getRuleTypeName: () => getRuleTypeName,
getTypeName: () => getTypeName,
isArrayCardinality: () => isArrayCardinality,
isArrayOperator: () => isArrayOperator,
@@ -56336,7 +61721,7 @@ ${text2}
return void 0;
}
function isCommentTerminal(terminalRule) {
- return terminalRule.hidden && !terminalRegex(terminalRule).test(" ");
+ return terminalRule.hidden && !isWhitespace2(terminalRegex(terminalRule));
}
function findNodesForProperty(node2, property2) {
if (!node2 || !property2) {
@@ -56603,7 +61988,7 @@ ${text2}
}
return void 0;
}
- function getRuleType(rule) {
+ function getRuleTypeName(rule) {
var _a, _b, _c;
if (isTerminalRule(rule)) {
return (_b = (_a = rule.type) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "string";
@@ -56611,6 +61996,14 @@ ${text2}
return isDataTypeRule(rule) ? rule.name : (_c = getExplicitRuleType(rule)) !== null && _c !== void 0 ? _c : rule.name;
}
}
+ function getRuleType(rule) {
+ var _a, _b, _c;
+ if (isTerminalRule(rule)) {
+ return (_b = (_a = rule.type) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "string";
+ } else {
+ return (_c = getExplicitRuleType(rule)) !== null && _c !== void 0 ? _c : rule.name;
+ }
+ }
function terminalRegex(terminalRule) {
const flags = {
s: false,
@@ -56717,7 +62110,7 @@ ${text2}
}
var WILDCARD;
var init_grammar_utils = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/grammar-utils.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/grammar-utils.js"() {
"use strict";
init_errors2();
init_ast();
@@ -56751,6 +62144,7 @@ ${text2}
__name(getExplicitRuleType, "getExplicitRuleType");
__name(getTypeName, "getTypeName");
__name(getActionType, "getActionType");
+ __name(getRuleTypeName, "getRuleTypeName");
__name(getRuleType, "getRuleType");
__name(terminalRegex, "terminalRegex");
WILDCARD = /[\s\S]/.source;
@@ -56765,7 +62159,7 @@ ${text2}
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/grammar-config.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/languages/grammar-config.js
function createGrammarConfig(services) {
const rules = [];
const grammar = services.Grammar;
@@ -56780,7 +62174,7 @@ ${text2}
};
}
var init_grammar_config = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/grammar-config.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/languages/grammar-config.js"() {
"use strict";
init_cst_utils();
init_grammar_utils();
@@ -57149,6 +62543,7 @@ ${text2}
return this.visitTerminal(nodeAny);
case Rule:
return this.visitRule(nodeAny);
+ /* c8 ignore next 2 */
default:
throw Error("non exhaustive match");
}
@@ -57526,7 +62921,11 @@ ${text2}
const term = terms[i2];
switch (term.type) {
case "EndAnchor":
+ // A group back reference cannot affect potential starting char.
+ // because if a back reference is the first production than automatically
+ // the group being referenced has had to come BEFORE so its codes have already been added
case "GroupBackReference":
+ // assertions do not affect potential starting codes
case "Lookahead":
case "NegativeLookahead":
case "StartAnchor":
@@ -57572,6 +62971,7 @@ ${text2}
case "Group":
firstCharOptimizedIndices(atom2.value, result, ignoreCase);
break;
+ /* istanbul ignore next */
default:
throw Error("Non Exhaustive Match");
}
@@ -57586,6 +62986,7 @@ ${text2}
}
}
break;
+ /* istanbul ignore next */
default:
throw Error("non exhaustive match!");
}
@@ -58407,15 +63808,15 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
__name(isShortPattern, "isShortPattern");
LineTerminatorOptimizedTester = {
// implements /\n|\r\n?/g.test
- test: /* @__PURE__ */ __name(function(text2) {
- const len = text2.length;
+ test: /* @__PURE__ */ __name(function(text4) {
+ const len = text4.length;
for (let i2 = this.lastIndex; i2 < len; i2++) {
- const c3 = text2.charCodeAt(i2);
+ const c3 = text4.charCodeAt(i2);
if (c3 === 10) {
this.lastIndex = i2 + 1;
return true;
} else if (c3 === 13) {
- if (text2.charCodeAt(i2 + 1) === 10) {
+ if (text4.charCodeAt(i2 + 1) === 10) {
this.lastIndex = i2 + 2;
} else {
this.lastIndex = i2 + 1;
@@ -58621,7 +64022,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
static {
__name(this, "Lexer");
}
- constructor(lexerDefinition, config6 = DEFAULT_LEXER_CONFIG) {
+ constructor(lexerDefinition, config5 = DEFAULT_LEXER_CONFIG) {
this.lexerDefinition = lexerDefinition;
this.lexerDefinitionErrors = [];
this.lexerDefinitionWarning = [];
@@ -58651,10 +64052,10 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
return phaseImpl();
}
};
- if (typeof config6 === "boolean") {
+ if (typeof config5 === "boolean") {
throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");
}
- this.config = assign_default({}, DEFAULT_LEXER_CONFIG, config6);
+ this.config = assign_default({}, DEFAULT_LEXER_CONFIG, config5);
const traceInitVal = this.config.traceInitPerf;
if (traceInitVal === true) {
this.traceInitMaxIdent = Infinity;
@@ -58675,7 +64076,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
throw Error("Error: Missing property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");
}
}
- if (config6.safeMode && config6.ensureOptimizations) {
+ if (config5.safeMode && config5.ensureOptimizations) {
throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');
}
this.trackStartLines = /full|onlyStart/i.test(this.config.positionTracking);
@@ -58717,9 +64118,9 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
this.TRACE_INIT(`analyzeTokenTypes`, () => {
currAnalyzeResult = analyzeTokenTypes(currModDef, {
lineTerminatorCharacters: this.config.lineTerminatorCharacters,
- positionTracking: config6.positionTracking,
- ensureOptimizations: config6.ensureOptimizations,
- safeMode: config6.safeMode,
+ positionTracking: config5.positionTracking,
+ ensureOptimizations: config5.ensureOptimizations,
+ safeMode: config5.safeMode,
tracer: this.TRACE_INIT
});
});
@@ -58783,7 +64184,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
}
return cannotBeOptimized;
}, []);
- if (config6.ensureOptimizations && !isEmpty_default(unOptimizedModes)) {
+ if (config5.ensureOptimizations && !isEmpty_default(unOptimizedModes)) {
throw Error(`Lexer Modes: < ${unOptimizedModes.join(", ")} > cannot be optimized.
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
Or inspect the console log for details on how to resolve these issues.`);
@@ -58797,7 +64198,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
});
});
}
- tokenize(text2, initialMode = this.defaultMode) {
+ tokenize(text4, initialMode = this.defaultMode) {
if (!isEmpty_default(this.lexerDefinitionErrors)) {
const allErrMessages = map_default(this.lexerDefinitionErrors, (error3) => {
return error3.message;
@@ -58805,19 +64206,19 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
const allErrMessagesString = allErrMessages.join("-----------------------\n");
throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n" + allErrMessagesString);
}
- return this.tokenizeInternal(text2, initialMode);
+ return this.tokenizeInternal(text4, initialMode);
}
// There is quite a bit of duplication between this and "tokenizeInternalLazy"
// This is intentional due to performance considerations.
// this method also used quite a bit of `!` none null assertions because it is too optimized
// for `tsc` to always understand it is "safe"
- tokenizeInternal(text2, initialMode) {
+ tokenizeInternal(text4, initialMode) {
let i2, j2, k2, matchAltImage, longerAlt, matchedImage, payload, altPayload, imageLength, group2, tokType, newToken, errLength, droppedChar, msg, match2;
- const orgText = text2;
+ const orgText = text4;
const orgLength = orgText.length;
let offset = 0;
let matchedTokensIndex = 0;
- const guessedNumberOfTokens = this.hasCustom ? 0 : Math.floor(text2.length / 10);
+ const guessedNumberOfTokens = this.hasCustom ? 0 : Math.floor(text4.length / 10);
const matchedTokens = new Array(guessedNumberOfTokens);
const errors = [];
let line2 = this.trackStartLines ? 1 : void 0;
@@ -58915,7 +64316,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
}
} else {
this.updateLastIndex(currPattern, offset);
- matchedImage = this.match(currPattern, text2, offset);
+ matchedImage = this.match(currPattern, text4, offset);
}
if (matchedImage !== null) {
longerAlt = currConfig.longerAlt;
@@ -58937,7 +64338,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
}
} else {
this.updateLastIndex(longerAltPattern, offset);
- matchAltImage = this.match(longerAltPattern, text2, offset);
+ matchAltImage = this.match(longerAltPattern, text4, offset);
}
if (matchAltImage && matchAltImage.length > matchedImage.length) {
matchedImage = matchAltImage;
@@ -58963,7 +64364,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
groups[group2].push(newToken);
}
}
- text2 = this.chopInput(text2, imageLength);
+ text4 = this.chopInput(text4, imageLength);
offset = offset + imageLength;
column2 = this.computeNewColumn(column2, imageLength);
if (trackLines === true && currConfig.canLineTerminator === true) {
@@ -58991,7 +64392,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
const errorColumn = column2;
let foundResyncPoint = recoveryEnabled === false;
while (foundResyncPoint === false && offset < orgLength) {
- text2 = this.chopInput(text2, 1);
+ text4 = this.chopInput(text4, 1);
offset++;
for (j2 = 0; j2 < currModePatternsLength; j2++) {
const currConfig2 = patternIdxToConfig[j2];
@@ -59005,7 +64406,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
foundResyncPoint = currPattern.exec(orgText, offset, matchedTokens, groups) !== null;
} else {
this.updateLastIndex(currPattern, offset);
- foundResyncPoint = currPattern.exec(text2) !== null;
+ foundResyncPoint = currPattern.exec(text4) !== null;
}
if (foundResyncPoint === true) {
break;
@@ -59036,19 +64437,19 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
errors
};
}
- handleModes(config6, pop_mode, push_mode, newToken) {
- if (config6.pop === true) {
- const pushMode = config6.push;
+ handleModes(config5, pop_mode, push_mode, newToken) {
+ if (config5.pop === true) {
+ const pushMode = config5.push;
pop_mode(newToken);
if (pushMode !== void 0) {
push_mode.call(this, pushMode);
}
- } else if (config6.push !== void 0) {
- push_mode.call(this, config6.push);
+ } else if (config5.push !== void 0) {
+ push_mode.call(this, config5.push);
}
}
- chopInput(text2, length2) {
- return text2.substring(length2);
+ chopInput(text4, length2) {
+ return text4.substring(length2);
}
updateLastIndex(regExp, newLastIndex) {
regExp.lastIndex = newLastIndex;
@@ -59115,15 +64516,15 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
token2.payload = payload;
}
}
- matchWithTest(pattern, text2, offset) {
- const found = pattern.test(text2);
+ matchWithTest(pattern, text4, offset) {
+ const found = pattern.test(text4);
if (found === true) {
- return text2.substring(offset, pattern.lastIndex);
+ return text4.substring(offset, pattern.lastIndex);
}
return null;
}
- matchWithExec(pattern, text2) {
- const regExpArray = pattern.exec(text2);
+ matchWithExec(pattern, text4) {
+ const regExpArray = pattern.exec(text4);
return regExpArray !== null ? regExpArray[0] : null;
}
};
@@ -59143,43 +64544,43 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
function hasTokenLabel2(obj) {
return isString_default(obj.LABEL) && obj.LABEL !== "";
}
- function createToken(config6) {
- return createTokenInternal(config6);
+ function createToken(config5) {
+ return createTokenInternal(config5);
}
- function createTokenInternal(config6) {
- const pattern = config6.pattern;
+ function createTokenInternal(config5) {
+ const pattern = config5.pattern;
const tokenType = {};
- tokenType.name = config6.name;
+ tokenType.name = config5.name;
if (!isUndefined_default(pattern)) {
tokenType.PATTERN = pattern;
}
- if (has_default(config6, PARENT)) {
+ if (has_default(config5, PARENT)) {
throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";
}
- if (has_default(config6, CATEGORIES)) {
- tokenType.CATEGORIES = config6[CATEGORIES];
+ if (has_default(config5, CATEGORIES)) {
+ tokenType.CATEGORIES = config5[CATEGORIES];
}
augmentTokenTypes([tokenType]);
- if (has_default(config6, LABEL)) {
- tokenType.LABEL = config6[LABEL];
+ if (has_default(config5, LABEL)) {
+ tokenType.LABEL = config5[LABEL];
}
- if (has_default(config6, GROUP)) {
- tokenType.GROUP = config6[GROUP];
+ if (has_default(config5, GROUP)) {
+ tokenType.GROUP = config5[GROUP];
}
- if (has_default(config6, POP_MODE)) {
- tokenType.POP_MODE = config6[POP_MODE];
+ if (has_default(config5, POP_MODE)) {
+ tokenType.POP_MODE = config5[POP_MODE];
}
- if (has_default(config6, PUSH_MODE)) {
- tokenType.PUSH_MODE = config6[PUSH_MODE];
+ if (has_default(config5, PUSH_MODE)) {
+ tokenType.PUSH_MODE = config5[PUSH_MODE];
}
- if (has_default(config6, LONGER_ALT)) {
- tokenType.LONGER_ALT = config6[LONGER_ALT];
+ if (has_default(config5, LONGER_ALT)) {
+ tokenType.LONGER_ALT = config5[LONGER_ALT];
}
- if (has_default(config6, LINE_BREAKS)) {
- tokenType.LINE_BREAKS = config6[LINE_BREAKS];
+ if (has_default(config5, LINE_BREAKS)) {
+ tokenType.LINE_BREAKS = config5[LINE_BREAKS];
}
- if (has_default(config6, START_CHARS_HINT)) {
- tokenType.START_CHARS_HINT = config6[START_CHARS_HINT];
+ if (has_default(config5, START_CHARS_HINT)) {
+ tokenType.START_CHARS_HINT = config5[START_CHARS_HINT];
}
return tokenType;
}
@@ -60158,9 +65559,9 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
}
return false;
}
- function isStrictPrefixOfPath(prefix, other) {
- return prefix.length < other.length && every_default(prefix, (tokType, idx) => {
- const otherTokType = other[idx];
+ function isStrictPrefixOfPath(prefix, other2) {
+ return prefix.length < other2.length && every_default(prefix, (tokType, idx) => {
+ const otherTokType = other2[idx];
return tokType === otherTokType || otherTokType.categoryMatchesMap[tokType.tokenTypeIdx];
});
}
@@ -60870,10 +66271,10 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
static {
__name(this, "Recoverable");
}
- initRecoverable(config6) {
+ initRecoverable(config5) {
this.firstAfterRepMap = {};
this.resyncFollows = {};
- this.recoveryEnabled = has_default(config6, "recoveryEnabled") ? config6.recoveryEnabled : DEFAULT_PARSER_CONFIG.recoveryEnabled;
+ this.recoveryEnabled = has_default(config5, "recoveryEnabled") ? config5.recoveryEnabled : DEFAULT_PARSER_CONFIG.recoveryEnabled;
if (this.recoveryEnabled) {
this.attemptInRepetitionRecovery = attemptInRepetitionRecovery;
}
@@ -61179,10 +66580,10 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
static {
__name(this, "LooksAhead");
}
- initLooksAhead(config6) {
- this.dynamicTokensEnabled = has_default(config6, "dynamicTokensEnabled") ? config6.dynamicTokensEnabled : DEFAULT_PARSER_CONFIG.dynamicTokensEnabled;
- this.maxLookahead = has_default(config6, "maxLookahead") ? config6.maxLookahead : DEFAULT_PARSER_CONFIG.maxLookahead;
- this.lookaheadStrategy = has_default(config6, "lookaheadStrategy") ? config6.lookaheadStrategy : new LLkLookaheadStrategy({ maxLookahead: this.maxLookahead });
+ initLooksAhead(config5) {
+ this.dynamicTokensEnabled = has_default(config5, "dynamicTokensEnabled") ? config5.dynamicTokensEnabled : DEFAULT_PARSER_CONFIG.dynamicTokensEnabled;
+ this.maxLookahead = has_default(config5, "maxLookahead") ? config5.maxLookahead : DEFAULT_PARSER_CONFIG.maxLookahead;
+ this.lookaheadStrategy = has_default(config5, "lookaheadStrategy") ? config5.lookaheadStrategy : new LLkLookaheadStrategy({ maxLookahead: this.maxLookahead });
this.lookAheadFuncsCache = /* @__PURE__ */ new Map();
}
preComputeLookaheadFunctions(rules) {
@@ -61465,10 +66866,10 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
static {
__name(this, "TreeBuilder");
}
- initTreeBuilder(config6) {
+ initTreeBuilder(config5) {
this.CST_STACK = [];
- this.outputCst = config6.outputCst;
- this.nodeLocationTracking = has_default(config6, "nodeLocationTracking") ? config6.nodeLocationTracking : DEFAULT_PARSER_CONFIG.nodeLocationTracking;
+ this.outputCst = config5.outputCst;
+ this.nodeLocationTracking = has_default(config5, "nodeLocationTracking") ? config5.nodeLocationTracking : DEFAULT_PARSER_CONFIG.nodeLocationTracking;
if (!this.outputCst) {
this.cstInvocationStateUpdate = noop_default2;
this.cstFinallyStateUpdate = noop_default2;
@@ -61506,7 +66907,7 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
this.cstPostRule = noop_default2;
this.setInitialNodeLocation = noop_default2;
} else {
- throw Error(`Invalid config option: "${config6.nodeLocationTracking}"`);
+ throw Error(`Invalid config option: "${config5.nodeLocationTracking}"`);
}
}
}
@@ -61970,7 +67371,7 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
AT_LEAST_ONE_SEP9(options3) {
this.atLeastOneSepFirstInternal(9, options3);
}
- RULE(name, implementation, config6 = DEFAULT_RULE_CONFIG) {
+ RULE(name, implementation, config5 = DEFAULT_RULE_CONFIG) {
if (includes_default(this.definedRulesNames, name)) {
const errMsg = defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({
topLevelRule: name,
@@ -61984,14 +67385,14 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
this.definitionErrors.push(error3);
}
this.definedRulesNames.push(name);
- const ruleImplementation = this.defineRule(name, implementation, config6);
+ const ruleImplementation = this.defineRule(name, implementation, config5);
this[name] = ruleImplementation;
return ruleImplementation;
}
- OVERRIDE_RULE(name, impl2, config6 = DEFAULT_RULE_CONFIG) {
+ OVERRIDE_RULE(name, impl2, config5 = DEFAULT_RULE_CONFIG) {
const ruleErrors = validateRuleIsOverridden(name, this.definedRulesNames, this.className);
this.definitionErrors = this.definitionErrors.concat(ruleErrors);
- const ruleImplementation = this.defineRule(name, impl2, config6);
+ const ruleImplementation = this.defineRule(name, impl2, config5);
this[name] = ruleImplementation;
return ruleImplementation;
}
@@ -62043,7 +67444,7 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
static {
__name(this, "RecognizerEngine");
}
- initRecognizerEngine(tokenVocabulary, config6) {
+ initRecognizerEngine(tokenVocabulary, config5) {
this.className = this.constructor.name;
this.shortRuleNameToFull = {};
this.fullRuleNameToShort = {};
@@ -62056,7 +67457,7 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
this.RULE_STACK = [];
this.RULE_OCCURRENCE_STACK = [];
this.gastProductionsCache = {};
- if (has_default(config6, "serializedGrammar")) {
+ if (has_default(config5, "serializedGrammar")) {
throw Error("The Parser's configuration can no longer contain a property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");
}
if (isArray_default(tokenVocabulary)) {
@@ -62090,13 +67491,13 @@ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
this.tokenMatcher = noTokenCategoriesUsed ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher;
augmentTokenTypes(values_default(this.tokensMap));
}
- defineRule(ruleName, impl2, config6) {
+ defineRule(ruleName, impl2, config5) {
if (this.selfAnalysisDone) {
throw Error(`Grammar rule <${ruleName}> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);
}
- const resyncEnabled = has_default(config6, "resyncEnabled") ? config6.resyncEnabled : DEFAULT_RULE_CONFIG.resyncEnabled;
- const recoveryValueFunc = has_default(config6, "recoveryValueFunc") ? config6.recoveryValueFunc : DEFAULT_RULE_CONFIG.recoveryValueFunc;
+ const resyncEnabled = has_default(config5, "resyncEnabled") ? config5.resyncEnabled : DEFAULT_RULE_CONFIG.resyncEnabled;
+ const recoveryValueFunc = has_default(config5, "recoveryValueFunc") ? config5.recoveryValueFunc : DEFAULT_RULE_CONFIG.recoveryValueFunc;
const shortName = this.ruleShortNameIdx << BITS_FOR_METHOD_TYPE + BITS_FOR_OCCURRENCE_IDX;
this.ruleShortNameIdx++;
this.shortRuleNameToFull[shortName] = ruleName;
@@ -62480,9 +67881,9 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
static {
__name(this, "ErrorHandler");
}
- initErrorHandler(config6) {
+ initErrorHandler(config5) {
this._errors = [];
- this.errorMessageProvider = has_default(config6, "errorMessageProvider") ? config6.errorMessageProvider : DEFAULT_PARSER_CONFIG.errorMessageProvider;
+ this.errorMessageProvider = has_default(config5, "errorMessageProvider") ? config5.errorMessageProvider : DEFAULT_PARSER_CONFIG.errorMessageProvider;
}
SAVE_ERROR(error3) {
if (isRecognitionException(error3)) {
@@ -62679,7 +68080,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
static {
__name(this, "GastRecorder");
}
- initGastRecorder(config6) {
+ initGastRecorder(config5) {
this.recordingProdStack = [];
this.RECORDING_PHASE = false;
}
@@ -62871,9 +68272,9 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
static {
__name(this, "PerformanceTracer");
}
- initPerformanceTracer(config6) {
- if (has_default(config6, "traceInitPerf")) {
- const userTraceInitPerf = config6.traceInitPerf;
+ initPerformanceTracer(config5) {
+ if (has_default(config5, "traceInitPerf")) {
+ const userTraceInitPerf = config5.traceInitPerf;
const traceIsNumber = typeof userTraceInitPerf === "number";
this.traceInitMaxIdent = traceIsNumber ? userTraceInitPerf : Infinity;
this.traceInitPerf = traceIsNumber ? userTraceInitPerf > 0 : userTraceInitPerf;
@@ -63070,23 +68471,23 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
}
});
}
- constructor(tokenVocabulary, config6) {
+ constructor(tokenVocabulary, config5) {
this.definitionErrors = [];
this.selfAnalysisDone = false;
const that = this;
- that.initErrorHandler(config6);
+ that.initErrorHandler(config5);
that.initLexerAdapter();
- that.initLooksAhead(config6);
- that.initRecognizerEngine(tokenVocabulary, config6);
- that.initRecoverable(config6);
- that.initTreeBuilder(config6);
+ that.initLooksAhead(config5);
+ that.initRecognizerEngine(tokenVocabulary, config5);
+ that.initRecoverable(config5);
+ that.initTreeBuilder(config5);
that.initContentAssist();
- that.initGastRecorder(config6);
- that.initPerformanceTracer(config6);
- if (has_default(config6, "ignoredIssues")) {
+ that.initGastRecorder(config5);
+ that.initPerformanceTracer(config5);
+ if (has_default(config5, "ignoredIssues")) {
throw new Error("The IParserConfig property has been deprecated.\n Please use the flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.");
}
- this.skipValidations = has_default(config6, "skipValidations") ? config6.skipValidations : DEFAULT_PARSER_CONFIG.skipValidations;
+ this.skipValidations = has_default(config5, "skipValidations") ? config5.skipValidations : DEFAULT_PARSER_CONFIG.skipValidations;
}
};
Parser2.DEFER_DEFINITION_ERRORS_HANDLING = false;
@@ -63106,8 +68507,8 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
static {
__name(this, "EmbeddedActionsParser");
}
- constructor(tokenVocabulary, config6 = DEFAULT_PARSER_CONFIG) {
- const configClone = clone_default2(config6);
+ constructor(tokenVocabulary, config5 = DEFAULT_PARSER_CONFIG) {
+ const configClone = clone_default2(config5);
configClone.outputCst = false;
super(tokenVocabulary, configClone);
}
@@ -63353,10 +68754,10 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
atn.decisionMap[buildATNKey(rule, "Option", optional2.idx)] = start3;
return handle;
}
- function defineDecisionState(atn, state5) {
- atn.decisionStates.push(state5);
- state5.decision = atn.decisionStates.length - 1;
- return state5.decision;
+ function defineDecisionState(atn, state4) {
+ atn.decisionStates.push(state4);
+ state4.decision = atn.decisionStates.length - 1;
+ return state4.decision;
}
function makeAlts(atn, rule, start3, production, ...alts) {
const end2 = newState(atn, rule, production, {
@@ -63482,14 +68883,14 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
atn.states.push(t4);
return t4;
}
- function addTransition(state5, transition2) {
- if (state5.transitions.length === 0) {
- state5.epsilonOnlyTransitions = transition2.isEpsilon();
+ function addTransition(state4, transition2) {
+ if (state4.transitions.length === 0) {
+ state4.epsilonOnlyTransitions = transition2.isEpsilon();
}
- state5.transitions.push(transition2);
+ state4.transitions.push(transition2);
}
- function removeState(atn, state5) {
- atn.states.splice(atn.states.indexOf(state5), 1);
+ function removeState(atn, state4) {
+ atn.states.splice(atn.states.indexOf(state4), 1);
}
var ATN_BASIC, ATN_RULE_START, ATN_PLUS_BLOCK_START, ATN_STAR_BLOCK_START, ATN_RULE_STOP, ATN_BLOCK_END, ATN_STAR_LOOP_BACK, ATN_STAR_LOOP_ENTRY, ATN_PLUS_LOOP_BACK, ATN_LOOP_END, AbstractTransition, AtomTransition, EpsilonTransition, RuleTransition;
var init_atn = __esm({
@@ -63581,8 +68982,8 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
});
// ../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/dfa.js
- function getATNConfigKey(config6, alt = true) {
- return `${alt ? `a${config6.alt}` : ""}s${config6.state.stateNumber}:${config6.stack.map((e3) => e3.stateNumber.toString()).join("_")}`;
+ function getATNConfigKey(config5, alt = true) {
+ return `${alt ? `a${config5.alt}` : ""}s${config5.state.stateNumber}:${config5.stack.map((e3) => e3.stateNumber.toString()).join("_")}`;
}
var DFA_ERROR, ATNConfigSet;
var init_dfa = __esm({
@@ -63604,11 +69005,11 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
finalize() {
this.map = {};
}
- add(config6) {
- const key = getATNConfigKey(config6);
+ add(config5) {
+ const key = getATNConfigKey(config5);
if (!(key in this.map)) {
this.map[key] = this.configs.length;
- this.configs.push(config6);
+ this.configs.push(config5);
}
}
get elements() {
@@ -63793,8 +69194,8 @@ For Further details.`;
tokenPath: path4
};
}
- function getExistingTargetState(state5, token2) {
- return state5.edges[token2.tokenTypeIdx];
+ function getExistingTargetState(state4, token2) {
+ return state4.edges[token2.tokenTypeIdx];
}
function computeReachSet(configs, token2, predicateSet) {
const intermediate = new ATNConfigSet();
@@ -63869,74 +69270,74 @@ For Further details.`;
from2.edges[token2.tokenTypeIdx] = to;
return to;
}
- function addDFAState(dfa, state5) {
- if (state5 === DFA_ERROR) {
- return state5;
+ function addDFAState(dfa, state4) {
+ if (state4 === DFA_ERROR) {
+ return state4;
}
- const mapKey = state5.configs.key;
+ const mapKey = state4.configs.key;
const existing = dfa.states[mapKey];
if (existing !== void 0) {
return existing;
}
- state5.configs.finalize();
- dfa.states[mapKey] = state5;
- return state5;
+ state4.configs.finalize();
+ dfa.states[mapKey] = state4;
+ return state4;
}
function computeStartState(atnState) {
const configs = new ATNConfigSet();
const numberOfTransitions = atnState.transitions.length;
for (let i2 = 0; i2 < numberOfTransitions; i2++) {
const target = atnState.transitions[i2].target;
- const config6 = {
+ const config5 = {
state: target,
alt: i2,
stack: []
};
- closure(config6, configs);
+ closure(config5, configs);
}
return configs;
}
- function closure(config6, configs) {
- const p3 = config6.state;
+ function closure(config5, configs) {
+ const p3 = config5.state;
if (p3.type === ATN_RULE_STOP) {
- if (config6.stack.length > 0) {
- const atnStack = [...config6.stack];
+ if (config5.stack.length > 0) {
+ const atnStack = [...config5.stack];
const followState = atnStack.pop();
const followConfig = {
state: followState,
- alt: config6.alt,
+ alt: config5.alt,
stack: atnStack
};
closure(followConfig, configs);
} else {
- configs.add(config6);
+ configs.add(config5);
}
return;
}
if (!p3.epsilonOnlyTransitions) {
- configs.add(config6);
+ configs.add(config5);
}
const transitionLength = p3.transitions.length;
for (let i2 = 0; i2 < transitionLength; i2++) {
const transition2 = p3.transitions[i2];
- const c3 = getEpsilonTarget(config6, transition2);
+ const c3 = getEpsilonTarget(config5, transition2);
if (c3 !== void 0) {
closure(c3, configs);
}
}
}
- function getEpsilonTarget(config6, transition2) {
+ function getEpsilonTarget(config5, transition2) {
if (transition2 instanceof EpsilonTransition) {
return {
state: transition2.target,
- alt: config6.alt,
- stack: config6.stack
+ alt: config5.alt,
+ stack: config5.stack
};
} else if (transition2 instanceof RuleTransition) {
- const stack = [...config6.stack, transition2.followState];
+ const stack = [...config5.stack, transition2.followState];
return {
state: transition2.target,
- alt: config6.alt,
+ alt: config5.alt,
stack
};
}
@@ -64235,7 +69636,7 @@ For Further details.`;
uinteger2.is = is2;
})(uinteger || (uinteger = {}));
(function(Position2) {
- function create2(line2, character2) {
+ function create4(line2, character2) {
if (line2 === Number.MAX_VALUE) {
line2 = uinteger.MAX_VALUE;
}
@@ -64244,8 +69645,8 @@ For Further details.`;
}
return { line: line2, character: character2 };
}
- __name(create2, "create");
- Position2.create = create2;
+ __name(create4, "create");
+ Position2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
@@ -64254,7 +69655,7 @@ For Further details.`;
Position2.is = is2;
})(Position || (Position = {}));
(function(Range2) {
- function create2(one4, two, three, four) {
+ function create4(one4, two, three, four) {
if (Is.uinteger(one4) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
return { start: Position.create(one4, two), end: Position.create(three, four) };
} else if (Position.is(one4) && Position.is(two)) {
@@ -64263,8 +69664,8 @@ For Further details.`;
throw new Error(`Range#create called with invalid arguments[${one4}, ${two}, ${three}, ${four}]`);
}
}
- __name(create2, "create");
- Range2.create = create2;
+ __name(create4, "create");
+ Range2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
@@ -64273,11 +69674,11 @@ For Further details.`;
Range2.is = is2;
})(Range || (Range = {}));
(function(Location2) {
- function create2(uri, range3) {
+ function create4(uri, range3) {
return { uri, range: range3 };
}
- __name(create2, "create");
- Location2.create = create2;
+ __name(create4, "create");
+ Location2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
@@ -64286,11 +69687,11 @@ For Further details.`;
Location2.is = is2;
})(Location || (Location = {}));
(function(LocationLink2) {
- function create2(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
+ function create4(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
}
- __name(create2, "create");
- LocationLink2.create = create2;
+ __name(create4, "create");
+ LocationLink2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
@@ -64299,7 +69700,7 @@ For Further details.`;
LocationLink2.is = is2;
})(LocationLink || (LocationLink = {}));
(function(Color4) {
- function create2(red, green, blue, alpha) {
+ function create4(red, green, blue, alpha) {
return {
red,
green,
@@ -64307,8 +69708,8 @@ For Further details.`;
alpha
};
}
- __name(create2, "create");
- Color4.create = create2;
+ __name(create4, "create");
+ Color4.create = create4;
function is2(value2) {
const candidate = value2;
return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
@@ -64317,14 +69718,14 @@ For Further details.`;
Color4.is = is2;
})(Color3 || (Color3 = {}));
(function(ColorInformation2) {
- function create2(range3, color2) {
+ function create4(range3, color2) {
return {
range: range3,
color: color2
};
}
- __name(create2, "create");
- ColorInformation2.create = create2;
+ __name(create4, "create");
+ ColorInformation2.create = create4;
function is2(value2) {
const candidate = value2;
return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color3.is(candidate.color);
@@ -64333,15 +69734,15 @@ For Further details.`;
ColorInformation2.is = is2;
})(ColorInformation || (ColorInformation = {}));
(function(ColorPresentation2) {
- function create2(label, textEdit, additionalTextEdits) {
+ function create4(label, textEdit, additionalTextEdits) {
return {
label,
textEdit,
additionalTextEdits
};
}
- __name(create2, "create");
- ColorPresentation2.create = create2;
+ __name(create4, "create");
+ ColorPresentation2.create = create4;
function is2(value2) {
const candidate = value2;
return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
@@ -64355,7 +69756,7 @@ For Further details.`;
FoldingRangeKind2.Region = "region";
})(FoldingRangeKind || (FoldingRangeKind = {}));
(function(FoldingRange2) {
- function create2(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
+ function create4(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
const result = {
startLine,
endLine
@@ -64374,8 +69775,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- FoldingRange2.create = create2;
+ __name(create4, "create");
+ FoldingRange2.create = create4;
function is2(value2) {
const candidate = value2;
return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
@@ -64384,14 +69785,14 @@ For Further details.`;
FoldingRange2.is = is2;
})(FoldingRange || (FoldingRange = {}));
(function(DiagnosticRelatedInformation2) {
- function create2(location, message) {
+ function create4(location, message) {
return {
location,
message
};
}
- __name(create2, "create");
- DiagnosticRelatedInformation2.create = create2;
+ __name(create4, "create");
+ DiagnosticRelatedInformation2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
@@ -64418,7 +69819,7 @@ For Further details.`;
CodeDescription2.is = is2;
})(CodeDescription || (CodeDescription = {}));
(function(Diagnostic2) {
- function create2(range3, message, severity, code, source, relatedInformation) {
+ function create4(range3, message, severity, code, source, relatedInformation) {
let result = { range: range3, message };
if (Is.defined(severity)) {
result.severity = severity;
@@ -64434,8 +69835,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- Diagnostic2.create = create2;
+ __name(create4, "create");
+ Diagnostic2.create = create4;
function is2(value2) {
var _a;
let candidate = value2;
@@ -64445,15 +69846,15 @@ For Further details.`;
Diagnostic2.is = is2;
})(Diagnostic || (Diagnostic = {}));
(function(Command2) {
- function create2(title2, command, ...args) {
+ function create4(title2, command, ...args) {
let result = { title: title2, command };
if (Is.defined(args) && args.length > 0) {
result.arguments = args;
}
return result;
}
- __name(create2, "create");
- Command2.create = create2;
+ __name(create4, "create");
+ Command2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
@@ -64485,7 +69886,7 @@ For Further details.`;
TextEdit2.is = is2;
})(TextEdit || (TextEdit = {}));
(function(ChangeAnnotation2) {
- function create2(label, needsConfirmation, description) {
+ function create4(label, needsConfirmation, description) {
const result = { label };
if (needsConfirmation !== void 0) {
result.needsConfirmation = needsConfirmation;
@@ -64495,8 +69896,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- ChangeAnnotation2.create = create2;
+ __name(create4, "create");
+ ChangeAnnotation2.create = create4;
function is2(value2) {
const candidate = value2;
return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
@@ -64536,11 +69937,11 @@ For Further details.`;
AnnotatedTextEdit2.is = is2;
})(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
(function(TextDocumentEdit2) {
- function create2(textDocument, edits) {
+ function create4(textDocument, edits) {
return { textDocument, edits };
}
- __name(create2, "create");
- TextDocumentEdit2.create = create2;
+ __name(create4, "create");
+ TextDocumentEdit2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
@@ -64549,7 +69950,7 @@ For Further details.`;
TextDocumentEdit2.is = is2;
})(TextDocumentEdit || (TextDocumentEdit = {}));
(function(CreateFile2) {
- function create2(uri, options3, annotation) {
+ function create4(uri, options3, annotation) {
let result = {
kind: "create",
uri
@@ -64562,8 +69963,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- CreateFile2.create = create2;
+ __name(create4, "create");
+ CreateFile2.create = create4;
function is2(value2) {
let candidate = value2;
return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
@@ -64572,7 +69973,7 @@ For Further details.`;
CreateFile2.is = is2;
})(CreateFile || (CreateFile = {}));
(function(RenameFile2) {
- function create2(oldUri, newUri, options3, annotation) {
+ function create4(oldUri, newUri, options3, annotation) {
let result = {
kind: "rename",
oldUri,
@@ -64586,8 +69987,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- RenameFile2.create = create2;
+ __name(create4, "create");
+ RenameFile2.create = create4;
function is2(value2) {
let candidate = value2;
return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
@@ -64596,7 +69997,7 @@ For Further details.`;
RenameFile2.is = is2;
})(RenameFile || (RenameFile = {}));
(function(DeleteFile2) {
- function create2(uri, options3, annotation) {
+ function create4(uri, options3, annotation) {
let result = {
kind: "delete",
uri
@@ -64609,8 +70010,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- DeleteFile2.create = create2;
+ __name(create4, "create");
+ DeleteFile2.create = create4;
function is2(value2) {
let candidate = value2;
return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
@@ -64633,11 +70034,11 @@ For Further details.`;
WorkspaceEdit2.is = is2;
})(WorkspaceEdit || (WorkspaceEdit = {}));
(function(TextDocumentIdentifier2) {
- function create2(uri) {
+ function create4(uri) {
return { uri };
}
- __name(create2, "create");
- TextDocumentIdentifier2.create = create2;
+ __name(create4, "create");
+ TextDocumentIdentifier2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Is.string(candidate.uri);
@@ -64646,11 +70047,11 @@ For Further details.`;
TextDocumentIdentifier2.is = is2;
})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
(function(VersionedTextDocumentIdentifier2) {
- function create2(uri, version4) {
- return { uri, version: version4 };
+ function create4(uri, version2) {
+ return { uri, version: version2 };
}
- __name(create2, "create");
- VersionedTextDocumentIdentifier2.create = create2;
+ __name(create4, "create");
+ VersionedTextDocumentIdentifier2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
@@ -64659,11 +70060,11 @@ For Further details.`;
VersionedTextDocumentIdentifier2.is = is2;
})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
(function(OptionalVersionedTextDocumentIdentifier2) {
- function create2(uri, version4) {
- return { uri, version: version4 };
+ function create4(uri, version2) {
+ return { uri, version: version2 };
}
- __name(create2, "create");
- OptionalVersionedTextDocumentIdentifier2.create = create2;
+ __name(create4, "create");
+ OptionalVersionedTextDocumentIdentifier2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
@@ -64672,11 +70073,11 @@ For Further details.`;
OptionalVersionedTextDocumentIdentifier2.is = is2;
})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
(function(TextDocumentItem2) {
- function create2(uri, languageId, version4, text2) {
- return { uri, languageId, version: version4, text: text2 };
+ function create4(uri, languageId, version2, text4) {
+ return { uri, languageId, version: version2, text: text4 };
}
- __name(create2, "create");
- TextDocumentItem2.create = create2;
+ __name(create4, "create");
+ TextDocumentItem2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
@@ -64737,11 +70138,11 @@ For Further details.`;
CompletionItemTag2.Deprecated = 1;
})(CompletionItemTag || (CompletionItemTag = {}));
(function(InsertReplaceEdit2) {
- function create2(newText, insert, replace2) {
+ function create4(newText, insert, replace2) {
return { newText, insert, replace: replace2 };
}
- __name(create2, "create");
- InsertReplaceEdit2.create = create2;
+ __name(create4, "create");
+ InsertReplaceEdit2.create = create4;
function is2(value2) {
const candidate = value2;
return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
@@ -64762,18 +70163,18 @@ For Further details.`;
CompletionItemLabelDetails2.is = is2;
})(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
(function(CompletionItem2) {
- function create2(label) {
+ function create4(label) {
return { label };
}
- __name(create2, "create");
- CompletionItem2.create = create2;
+ __name(create4, "create");
+ CompletionItem2.create = create4;
})(CompletionItem || (CompletionItem = {}));
(function(CompletionList2) {
- function create2(items, isIncomplete) {
+ function create4(items, isIncomplete) {
return { items: items ? items : [], isIncomplete: !!isIncomplete };
}
- __name(create2, "create");
- CompletionList2.create = create2;
+ __name(create4, "create");
+ CompletionList2.create = create4;
})(CompletionList || (CompletionList = {}));
(function(MarkedString2) {
function fromPlainText(plainText) {
@@ -64797,14 +70198,14 @@ For Further details.`;
Hover2.is = is2;
})(Hover || (Hover = {}));
(function(ParameterInformation2) {
- function create2(label, documentation) {
+ function create4(label, documentation) {
return documentation ? { label, documentation } : { label };
}
- __name(create2, "create");
- ParameterInformation2.create = create2;
+ __name(create4, "create");
+ ParameterInformation2.create = create4;
})(ParameterInformation || (ParameterInformation = {}));
(function(SignatureInformation2) {
- function create2(label, documentation, ...parameters) {
+ function create4(label, documentation, ...parameters) {
let result = { label };
if (Is.defined(documentation)) {
result.documentation = documentation;
@@ -64816,8 +70217,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- SignatureInformation2.create = create2;
+ __name(create4, "create");
+ SignatureInformation2.create = create4;
})(SignatureInformation || (SignatureInformation = {}));
(function(DocumentHighlightKind2) {
DocumentHighlightKind2.Text = 1;
@@ -64825,15 +70226,15 @@ For Further details.`;
DocumentHighlightKind2.Write = 3;
})(DocumentHighlightKind || (DocumentHighlightKind = {}));
(function(DocumentHighlight2) {
- function create2(range3, kind) {
+ function create4(range3, kind) {
let result = { range: range3 };
if (Is.number(kind)) {
result.kind = kind;
}
return result;
}
- __name(create2, "create");
- DocumentHighlight2.create = create2;
+ __name(create4, "create");
+ DocumentHighlight2.create = create4;
})(DocumentHighlight || (DocumentHighlight = {}));
(function(SymbolKind2) {
SymbolKind2.File = 1;
@@ -64867,7 +70268,7 @@ For Further details.`;
SymbolTag2.Deprecated = 1;
})(SymbolTag || (SymbolTag = {}));
(function(SymbolInformation2) {
- function create2(name, kind, range3, uri, containerName) {
+ function create4(name, kind, range3, uri, containerName) {
let result = {
name,
kind,
@@ -64878,18 +70279,18 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- SymbolInformation2.create = create2;
+ __name(create4, "create");
+ SymbolInformation2.create = create4;
})(SymbolInformation || (SymbolInformation = {}));
(function(WorkspaceSymbol2) {
- function create2(name, kind, uri, range3) {
+ function create4(name, kind, uri, range3) {
return range3 !== void 0 ? { name, kind, location: { uri, range: range3 } } : { name, kind, location: { uri } };
}
- __name(create2, "create");
- WorkspaceSymbol2.create = create2;
+ __name(create4, "create");
+ WorkspaceSymbol2.create = create4;
})(WorkspaceSymbol || (WorkspaceSymbol = {}));
(function(DocumentSymbol2) {
- function create2(name, detail, kind, range3, selectionRange, children2) {
+ function create4(name, detail, kind, range3, selectionRange, children2) {
let result = {
name,
detail,
@@ -64902,8 +70303,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- DocumentSymbol2.create = create2;
+ __name(create4, "create");
+ DocumentSymbol2.create = create4;
function is2(value2) {
let candidate = value2;
return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
@@ -64927,7 +70328,7 @@ For Further details.`;
CodeActionTriggerKind2.Automatic = 2;
})(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
(function(CodeActionContext2) {
- function create2(diagnostics, only, triggerKind) {
+ function create4(diagnostics, only, triggerKind) {
let result = { diagnostics };
if (only !== void 0 && only !== null) {
result.only = only;
@@ -64937,8 +70338,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- CodeActionContext2.create = create2;
+ __name(create4, "create");
+ CodeActionContext2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
@@ -64947,7 +70348,7 @@ For Further details.`;
CodeActionContext2.is = is2;
})(CodeActionContext || (CodeActionContext = {}));
(function(CodeAction2) {
- function create2(title2, kindOrCommandOrEdit, kind) {
+ function create4(title2, kindOrCommandOrEdit, kind) {
let result = { title: title2 };
let checkKind = true;
if (typeof kindOrCommandOrEdit === "string") {
@@ -64963,8 +70364,8 @@ For Further details.`;
}
return result;
}
- __name(create2, "create");
- CodeAction2.create = create2;
+ __name(create4, "create");
+ CodeAction2.create = create4;
function is2(value2) {
let candidate = value2;
return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
@@ -64973,15 +70374,15 @@ For Further details.`;
CodeAction2.is = is2;
})(CodeAction || (CodeAction = {}));
(function(CodeLens2) {
- function create2(range3, data5) {
+ function create4(range3, data6) {
let result = { range: range3 };
- if (Is.defined(data5)) {
- result.data = data5;
+ if (Is.defined(data6)) {
+ result.data = data6;
}
return result;
}
- __name(create2, "create");
- CodeLens2.create = create2;
+ __name(create4, "create");
+ CodeLens2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
@@ -64990,11 +70391,11 @@ For Further details.`;
CodeLens2.is = is2;
})(CodeLens || (CodeLens = {}));
(function(FormattingOptions2) {
- function create2(tabSize, insertSpaces) {
+ function create4(tabSize, insertSpaces) {
return { tabSize, insertSpaces };
}
- __name(create2, "create");
- FormattingOptions2.create = create2;
+ __name(create4, "create");
+ FormattingOptions2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
@@ -65003,11 +70404,11 @@ For Further details.`;
FormattingOptions2.is = is2;
})(FormattingOptions || (FormattingOptions = {}));
(function(DocumentLink2) {
- function create2(range3, target, data5) {
- return { range: range3, target, data: data5 };
+ function create4(range3, target, data6) {
+ return { range: range3, target, data: data6 };
}
- __name(create2, "create");
- DocumentLink2.create = create2;
+ __name(create4, "create");
+ DocumentLink2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
@@ -65016,11 +70417,11 @@ For Further details.`;
DocumentLink2.is = is2;
})(DocumentLink || (DocumentLink = {}));
(function(SelectionRange2) {
- function create2(range3, parent4) {
+ function create4(range3, parent4) {
return { range: range3, parent: parent4 };
}
- __name(create2, "create");
- SelectionRange2.create = create2;
+ __name(create4, "create");
+ SelectionRange2.create = create4;
function is2(value2) {
let candidate = value2;
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
@@ -65074,11 +70475,11 @@ For Further details.`;
SemanticTokens2.is = is2;
})(SemanticTokens || (SemanticTokens = {}));
(function(InlineValueText2) {
- function create2(range3, text2) {
- return { range: range3, text: text2 };
+ function create4(range3, text4) {
+ return { range: range3, text: text4 };
}
- __name(create2, "create");
- InlineValueText2.create = create2;
+ __name(create4, "create");
+ InlineValueText2.create = create4;
function is2(value2) {
const candidate = value2;
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
@@ -65087,11 +70488,11 @@ For Further details.`;
InlineValueText2.is = is2;
})(InlineValueText || (InlineValueText = {}));
(function(InlineValueVariableLookup2) {
- function create2(range3, variableName, caseSensitiveLookup) {
+ function create4(range3, variableName, caseSensitiveLookup) {
return { range: range3, variableName, caseSensitiveLookup };
}
- __name(create2, "create");
- InlineValueVariableLookup2.create = create2;
+ __name(create4, "create");
+ InlineValueVariableLookup2.create = create4;
function is2(value2) {
const candidate = value2;
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
@@ -65100,11 +70501,11 @@ For Further details.`;
InlineValueVariableLookup2.is = is2;
})(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
(function(InlineValueEvaluatableExpression2) {
- function create2(range3, expression) {
+ function create4(range3, expression) {
return { range: range3, expression };
}
- __name(create2, "create");
- InlineValueEvaluatableExpression2.create = create2;
+ __name(create4, "create");
+ InlineValueEvaluatableExpression2.create = create4;
function is2(value2) {
const candidate = value2;
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
@@ -65113,11 +70514,11 @@ For Further details.`;
InlineValueEvaluatableExpression2.is = is2;
})(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
(function(InlineValueContext2) {
- function create2(frameId, stoppedLocation) {
+ function create4(frameId, stoppedLocation) {
return { frameId, stoppedLocation };
}
- __name(create2, "create");
- InlineValueContext2.create = create2;
+ __name(create4, "create");
+ InlineValueContext2.create = create4;
function is2(value2) {
const candidate = value2;
return Is.defined(candidate) && Range.is(value2.stoppedLocation);
@@ -65135,11 +70536,11 @@ For Further details.`;
InlayHintKind2.is = is2;
})(InlayHintKind || (InlayHintKind = {}));
(function(InlayHintLabelPart2) {
- function create2(value2) {
+ function create4(value2) {
return { value: value2 };
}
- __name(create2, "create");
- InlayHintLabelPart2.create = create2;
+ __name(create4, "create");
+ InlayHintLabelPart2.create = create4;
function is2(value2) {
const candidate = value2;
return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command));
@@ -65148,15 +70549,15 @@ For Further details.`;
InlayHintLabelPart2.is = is2;
})(InlayHintLabelPart || (InlayHintLabelPart = {}));
(function(InlayHint2) {
- function create2(position5, label, kind) {
+ function create4(position5, label, kind) {
const result = { position: position5, label };
if (kind !== void 0) {
result.kind = kind;
}
return result;
}
- __name(create2, "create");
- InlayHint2.create = create2;
+ __name(create4, "create");
+ InlayHint2.create = create4;
function is2(value2) {
const candidate = value2;
return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight));
@@ -65172,36 +70573,36 @@ For Further details.`;
StringValue2.createSnippet = createSnippet;
})(StringValue || (StringValue = {}));
(function(InlineCompletionItem2) {
- function create2(insertText, filterText, range3, command) {
+ function create4(insertText, filterText, range3, command) {
return { insertText, filterText, range: range3, command };
}
- __name(create2, "create");
- InlineCompletionItem2.create = create2;
+ __name(create4, "create");
+ InlineCompletionItem2.create = create4;
})(InlineCompletionItem || (InlineCompletionItem = {}));
(function(InlineCompletionList2) {
- function create2(items) {
+ function create4(items) {
return { items };
}
- __name(create2, "create");
- InlineCompletionList2.create = create2;
+ __name(create4, "create");
+ InlineCompletionList2.create = create4;
})(InlineCompletionList || (InlineCompletionList = {}));
(function(InlineCompletionTriggerKind2) {
InlineCompletionTriggerKind2.Invoked = 0;
InlineCompletionTriggerKind2.Automatic = 1;
})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
(function(SelectedCompletionInfo2) {
- function create2(range3, text2) {
- return { range: range3, text: text2 };
+ function create4(range3, text4) {
+ return { range: range3, text: text4 };
}
- __name(create2, "create");
- SelectedCompletionInfo2.create = create2;
+ __name(create4, "create");
+ SelectedCompletionInfo2.create = create4;
})(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
(function(InlineCompletionContext2) {
- function create2(triggerKind, selectedCompletionInfo) {
+ function create4(triggerKind, selectedCompletionInfo) {
return { triggerKind, selectedCompletionInfo };
}
- __name(create2, "create");
- InlineCompletionContext2.create = create2;
+ __name(create4, "create");
+ InlineCompletionContext2.create = create4;
})(InlineCompletionContext || (InlineCompletionContext = {}));
(function(WorkspaceFolder2) {
function is2(value2) {
@@ -65212,11 +70613,11 @@ For Further details.`;
WorkspaceFolder2.is = is2;
})(WorkspaceFolder || (WorkspaceFolder = {}));
(function(TextDocument3) {
- function create2(uri, languageId, version4, content) {
- return new FullTextDocument(uri, languageId, version4, content);
+ function create4(uri, languageId, version2, content) {
+ return new FullTextDocument(uri, languageId, version2, content);
}
- __name(create2, "create");
- TextDocument3.create = create2;
+ __name(create4, "create");
+ TextDocument3.create = create4;
function is2(value2) {
let candidate = value2;
return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
@@ -65224,7 +70625,7 @@ For Further details.`;
__name(is2, "is");
TextDocument3.is = is2;
function applyEdits(document2, edits) {
- let text2 = document2.getText();
+ let text4 = document2.getText();
let sortedEdits = mergeSort2(edits, (a2, b2) => {
let diff2 = a2.range.start.line - b2.range.start.line;
if (diff2 === 0) {
@@ -65232,29 +70633,29 @@ For Further details.`;
}
return diff2;
});
- let lastModifiedOffset = text2.length;
+ let lastModifiedOffset = text4.length;
for (let i2 = sortedEdits.length - 1; i2 >= 0; i2--) {
let e3 = sortedEdits[i2];
let startOffset = document2.offsetAt(e3.range.start);
let endOffset = document2.offsetAt(e3.range.end);
if (endOffset <= lastModifiedOffset) {
- text2 = text2.substring(0, startOffset) + e3.newText + text2.substring(endOffset, text2.length);
+ text4 = text4.substring(0, startOffset) + e3.newText + text4.substring(endOffset, text4.length);
} else {
throw new Error("Overlapping edit");
}
lastModifiedOffset = startOffset;
}
- return text2;
+ return text4;
}
__name(applyEdits, "applyEdits");
TextDocument3.applyEdits = applyEdits;
- function mergeSort2(data5, compare) {
- if (data5.length <= 1) {
- return data5;
+ function mergeSort2(data6, compare) {
+ if (data6.length <= 1) {
+ return data6;
}
- const p3 = data5.length / 2 | 0;
- const left3 = data5.slice(0, p3);
- const right3 = data5.slice(p3);
+ const p3 = data6.length / 2 | 0;
+ const left3 = data6.slice(0, p3);
+ const right3 = data6.slice(p3);
mergeSort2(left3, compare);
mergeSort2(right3, compare);
let leftIdx = 0;
@@ -65263,18 +70664,18 @@ For Further details.`;
while (leftIdx < left3.length && rightIdx < right3.length) {
let ret = compare(left3[leftIdx], right3[rightIdx]);
if (ret <= 0) {
- data5[i2++] = left3[leftIdx++];
+ data6[i2++] = left3[leftIdx++];
} else {
- data5[i2++] = right3[rightIdx++];
+ data6[i2++] = right3[rightIdx++];
}
}
while (leftIdx < left3.length) {
- data5[i2++] = left3[leftIdx++];
+ data6[i2++] = left3[leftIdx++];
}
while (rightIdx < right3.length) {
- data5[i2++] = right3[rightIdx++];
+ data6[i2++] = right3[rightIdx++];
}
- return data5;
+ return data6;
}
__name(mergeSort2, "mergeSort");
})(TextDocument || (TextDocument = {}));
@@ -65282,10 +70683,10 @@ For Further details.`;
static {
__name(this, "FullTextDocument");
}
- constructor(uri, languageId, version4, content) {
+ constructor(uri, languageId, version2, content) {
this._uri = uri;
this._languageId = languageId;
- this._version = version4;
+ this._version = version2;
this._content = content;
this._lineOffsets = void 0;
}
@@ -65306,29 +70707,29 @@ For Further details.`;
}
return this._content;
}
- update(event3, version4) {
+ update(event3, version2) {
this._content = event3.text;
- this._version = version4;
+ this._version = version2;
this._lineOffsets = void 0;
}
getLineOffsets() {
if (this._lineOffsets === void 0) {
let lineOffsets = [];
- let text2 = this._content;
+ let text4 = this._content;
let isLineStart = true;
- for (let i2 = 0; i2 < text2.length; i2++) {
+ for (let i2 = 0; i2 < text4.length; i2++) {
if (isLineStart) {
lineOffsets.push(i2);
isLineStart = false;
}
- let ch = text2.charAt(i2);
+ let ch = text4.charAt(i2);
isLineStart = ch === "\r" || ch === "\n";
- if (ch === "\r" && i2 + 1 < text2.length && text2.charAt(i2 + 1) === "\n") {
+ if (ch === "\r" && i2 + 1 < text4.length && text4.charAt(i2 + 1) === "\n") {
i2++;
}
}
- if (isLineStart && text2.length > 0) {
- lineOffsets.push(text2.length);
+ if (isLineStart && text4.length > 0) {
+ lineOffsets.push(text4.length);
}
this._lineOffsets = lineOffsets;
}
@@ -65428,13 +70829,12 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/cst-node-builder.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/cst-node-builder.js
var CstNodeBuilder, AbstractCstNode, LeafCstNodeImpl, CompositeCstNodeImpl, CstNodeContainer, RootCstNodeImpl;
var init_cst_node_builder = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/cst-node-builder.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/cst-node-builder.js"() {
"use strict";
init_main();
- init_syntax_tree();
init_cst_utils();
CstNodeBuilder = class {
static {
@@ -65444,7 +70844,8 @@ For Further details.`;
this.nodeStack = [];
}
get current() {
- return this.nodeStack[this.nodeStack.length - 1];
+ var _a;
+ return (_a = this.nodeStack[this.nodeStack.length - 1]) !== null && _a !== void 0 ? _a : this.rootNode;
}
buildRootNode(input) {
this.rootNode = new RootCstNodeImpl(input);
@@ -65461,7 +70862,7 @@ For Further details.`;
return compositeNode;
}
buildLeafNode(token2, feature) {
- const leafNode = new LeafCstNodeImpl(token2.startOffset, token2.image.length, tokenToRange(token2), token2.tokenType, false);
+ const leafNode = new LeafCstNodeImpl(token2.startOffset, token2.image.length, tokenToRange(token2), token2.tokenType, !feature);
leafNode.grammarSource = feature;
leafNode.root = this.rootNode;
this.current.content.push(leafNode);
@@ -65476,6 +70877,32 @@ For Further details.`;
}
}
}
+ addHiddenNodes(tokens2) {
+ const nodes6 = [];
+ for (const token2 of tokens2) {
+ const leafNode = new LeafCstNodeImpl(token2.startOffset, token2.image.length, tokenToRange(token2), token2.tokenType, true);
+ leafNode.root = this.rootNode;
+ nodes6.push(leafNode);
+ }
+ let current = this.current;
+ let added = false;
+ if (current.content.length > 0) {
+ current.content.push(...nodes6);
+ return;
+ }
+ while (current.container) {
+ const index = current.container.content.indexOf(current);
+ if (index > 0) {
+ current.container.content.splice(index, 0, ...nodes6);
+ added = true;
+ break;
+ }
+ current = current.container;
+ }
+ if (!added) {
+ this.rootNode.content.unshift(...nodes6);
+ }
+ }
construct(item) {
const current = this.current;
if (typeof item.$type === "string") {
@@ -65487,28 +70914,6 @@ For Further details.`;
this.removeNode(node2);
}
}
- addHiddenTokens(hiddenTokens) {
- for (const token2 of hiddenTokens) {
- const hiddenNode = new LeafCstNodeImpl(token2.startOffset, token2.image.length, tokenToRange(token2), token2.tokenType, true);
- hiddenNode.root = this.rootNode;
- this.addHiddenToken(this.rootNode, hiddenNode);
- }
- }
- addHiddenToken(node2, token2) {
- const { offset: tokenStart, end: tokenEnd } = token2;
- for (let i2 = 0; i2 < node2.content.length; i2++) {
- const child = node2.content[i2];
- const { offset: childStart, end: childEnd } = child;
- if (isCompositeCstNode(child) && tokenStart > childStart && tokenEnd < childEnd) {
- this.addHiddenToken(child, token2);
- return;
- } else if (tokenEnd <= childStart) {
- node2.content.splice(i2, 0, token2);
- return;
- }
- }
- node2.content.push(token2);
- }
};
AbstractCstNode = class {
static {
@@ -65676,13 +71081,13 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/langium-parser.js
function isDataTypeNode(node2) {
return node2.$type === DatatypeSymbol;
}
var DatatypeSymbol, ruleSuffix, withRuleSuffix, AbstractLangiumParser, LangiumParser, AbstractParserErrorMessageProvider, LangiumParserErrorMessageProvider, LangiumCompletionParser, defaultConfig3, ChevrotainWrapper;
var init_langium_parser = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/langium-parser.js"() {
"use strict";
init_api5();
init_lib2();
@@ -65700,9 +71105,11 @@ For Further details.`;
}
constructor(services) {
this._unorderedGroups = /* @__PURE__ */ new Map();
+ this.allRules = /* @__PURE__ */ new Map();
this.lexer = services.parser.Lexer;
const tokens2 = this.lexer.definition;
- this.wrapper = new ChevrotainWrapper(tokens2, Object.assign(Object.assign({}, services.parser.ParserConfig), { errorMessageProvider: services.parser.ParserErrorMessageProvider }));
+ const production = services.LanguageMetaData.mode === "production";
+ this.wrapper = new ChevrotainWrapper(tokens2, Object.assign(Object.assign({}, services.parser.ParserConfig), { skipValidations: production, errorMessageProvider: services.parser.ParserErrorMessageProvider }));
}
alternatives(idx, choices) {
this.wrapper.wrapOr(idx, choices);
@@ -65716,6 +71123,9 @@ For Further details.`;
atLeastOne(idx, callback) {
this.wrapper.wrapAtLeastOne(idx, callback);
}
+ getRule(name) {
+ return this.allRules.get(name);
+ }
isRecording() {
return this.wrapper.IS_RECORDING;
}
@@ -65746,29 +71156,47 @@ For Further details.`;
this.astReflection = services.shared.AstReflection;
}
rule(rule, impl2) {
- const type3 = rule.fragment ? void 0 : isDataTypeRule(rule) ? DatatypeSymbol : getTypeName(rule);
+ const type3 = this.computeRuleType(rule);
const ruleMethod = this.wrapper.DEFINE_RULE(withRuleSuffix(rule.name), this.startImplementation(type3, impl2).bind(this));
+ this.allRules.set(rule.name, ruleMethod);
if (rule.entry) {
this.mainRule = ruleMethod;
}
return ruleMethod;
}
- parse(input) {
+ computeRuleType(rule) {
+ if (rule.fragment) {
+ return void 0;
+ } else if (isDataTypeRule(rule)) {
+ return DatatypeSymbol;
+ } else {
+ const explicit = getExplicitRuleType(rule);
+ return explicit !== null && explicit !== void 0 ? explicit : rule.name;
+ }
+ }
+ parse(input, options3 = {}) {
this.nodeBuilder.buildRootNode(input);
- const lexerResult = this.lexer.tokenize(input);
+ const lexerResult = this.lexerResult = this.lexer.tokenize(input);
this.wrapper.input = lexerResult.tokens;
- const result = this.mainRule.call(this.wrapper, {});
- this.nodeBuilder.addHiddenTokens(lexerResult.hidden);
+ const ruleMethod = options3.rule ? this.allRules.get(options3.rule) : this.mainRule;
+ if (!ruleMethod) {
+ throw new Error(options3.rule ? `No rule found with name '${options3.rule}'` : "No main rule available.");
+ }
+ const result = ruleMethod.call(this.wrapper, {});
+ this.nodeBuilder.addHiddenNodes(lexerResult.hidden);
this.unorderedGroups.clear();
+ this.lexerResult = void 0;
return {
value: result,
lexerErrors: lexerResult.errors,
+ lexerReport: lexerResult.report,
parserErrors: this.wrapper.errors
};
}
startImplementation($type, implementation) {
return (args) => {
- if (!this.isRecording()) {
+ const createNode = !this.isRecording() && $type !== void 0;
+ if (createNode) {
const node2 = { $type };
this.stack.push(node2);
if ($type === DatatypeSymbol) {
@@ -65781,15 +71209,31 @@ For Further details.`;
} catch (err) {
result = void 0;
}
- if (!this.isRecording() && result === void 0) {
+ if (result === void 0 && createNode) {
result = this.construct();
}
return result;
};
}
+ extractHiddenTokens(token2) {
+ const hiddenTokens = this.lexerResult.hidden;
+ if (!hiddenTokens.length) {
+ return [];
+ }
+ const offset = token2.startOffset;
+ for (let i2 = 0; i2 < hiddenTokens.length; i2++) {
+ const token3 = hiddenTokens[i2];
+ if (token3.startOffset > offset) {
+ return hiddenTokens.splice(0, i2);
+ }
+ }
+ return hiddenTokens.splice(0, hiddenTokens.length);
+ }
consume(idx, tokenType, feature) {
const token2 = this.wrapper.wrapConsume(idx, tokenType);
if (!this.isRecording() && this.isValidToken(token2)) {
+ const hiddenTokens = this.extractHiddenTokens(token2);
+ this.nodeBuilder.addHiddenNodes(hiddenTokens);
const leafNode = this.nodeBuilder.buildLeafNode(token2, feature);
const { assignment, isCrossRef } = this.getAssignment(feature);
const current = this.current;
@@ -65797,11 +71241,11 @@ For Further details.`;
const convertedValue = isKeyword(feature) ? token2.image : this.converter.convert(token2.image, leafNode);
this.assign(assignment.operator, assignment.feature, convertedValue, leafNode, isCrossRef);
} else if (isDataTypeNode(current)) {
- let text2 = token2.image;
+ let text4 = token2.image;
if (!isKeyword(feature)) {
- text2 = this.converter.convert(text2, leafNode).toString();
+ text4 = this.converter.convert(text4, leafNode).toString();
}
- current.value += text2;
+ current.value += text4;
}
}
}
@@ -65814,9 +71258,9 @@ For Further details.`;
isValidToken(token2) {
return !token2.isInsertedInRecovery && !isNaN(token2.startOffset) && typeof token2.endOffset === "number" && !isNaN(token2.endOffset);
}
- subrule(idx, rule, feature, args) {
+ subrule(idx, rule, fragment, feature, args) {
let cstNode;
- if (!this.isRecording()) {
+ if (!this.isRecording() && !fragment) {
cstNode = this.nodeBuilder.buildCompositeNode(feature);
}
const subruleResult = this.wrapper.wrapSubrule(idx, rule, args);
@@ -65833,11 +71277,7 @@ For Further details.`;
if (isDataTypeNode(current)) {
current.value += result.toString();
} else if (typeof result === "object" && result) {
- const resultKind = result.$type;
const object3 = this.assignWithoutOverride(result, current);
- if (resultKind) {
- object3.$type = resultKind;
- }
const newItem = object3;
this.stack.pop();
this.stack.push(newItem);
@@ -65847,29 +71287,27 @@ For Further details.`;
action($type, action) {
if (!this.isRecording()) {
let last3 = this.current;
- if (!last3.$cstNode && action.feature && action.operator) {
- last3 = this.construct(false);
- const feature = last3.$cstNode.feature;
- this.nodeBuilder.buildCompositeNode(feature);
- }
- const newItem = { $type };
- this.stack.pop();
- this.stack.push(newItem);
if (action.feature && action.operator) {
+ last3 = this.construct();
+ this.nodeBuilder.removeNode(last3.$cstNode);
+ const node2 = this.nodeBuilder.buildCompositeNode(action);
+ node2.content.push(last3.$cstNode);
+ const newItem = { $type };
+ this.stack.push(newItem);
this.assign(action.operator, action.feature, last3, last3.$cstNode, false);
+ } else {
+ last3.$type = $type;
}
}
}
- construct(pop = true) {
+ construct() {
if (this.isRecording()) {
return void 0;
}
const obj = this.current;
linkContentToContainer(obj);
this.nodeBuilder.construct(obj);
- if (pop) {
- this.stack.pop();
- }
+ this.stack.pop();
if (isDataTypeNode(obj)) {
return this.converter.convert(obj.value, obj.$cstNode);
} else {
@@ -65922,6 +71360,11 @@ For Further details.`;
target[name] = existingValue;
}
}
+ const targetCstNode = target.$cstNode;
+ if (targetCstNode) {
+ targetCstNode.astNode = void 0;
+ target.$cstNode = void 0;
+ }
return target;
}
get definitionErrors() {
@@ -65976,7 +71419,7 @@ For Further details.`;
}
parse(input) {
this.resetState();
- const tokens2 = this.lexer.tokenize(input);
+ const tokens2 = this.lexer.tokenize(input, { mode: "partial" });
this.tokens = tokens2.tokens;
this.wrapper.input = [...this.tokens];
this.mainRule.call(this.wrapper, {});
@@ -65989,6 +71432,7 @@ For Further details.`;
}
rule(rule, impl2) {
const ruleMethod = this.wrapper.DEFINE_RULE(withRuleSuffix(rule.name), this.startImplementation(impl2).bind(this));
+ this.allRules.set(rule.name, ruleMethod);
if (rule.entry) {
this.mainRule = ruleMethod;
}
@@ -66029,7 +71473,7 @@ For Further details.`;
this.nextTokenIndex = this.currIdx + 1;
}
}
- subrule(idx, rule, feature, args) {
+ subrule(idx, rule, fragment, feature, args) {
this.before(feature);
this.wrapper.wrapSubrule(idx, rule, args);
this.after(feature);
@@ -66061,9 +71505,13 @@ For Further details.`;
static {
__name(this, "ChevrotainWrapper");
}
- constructor(tokens2, config6) {
- const useDefaultLookahead = config6 && "maxLookahead" in config6;
- super(tokens2, Object.assign(Object.assign(Object.assign({}, defaultConfig3), { lookaheadStrategy: useDefaultLookahead ? new LLkLookaheadStrategy({ maxLookahead: config6.maxLookahead }) : new LLStarLookaheadStrategy() }), config6));
+ constructor(tokens2, config5) {
+ const useDefaultLookahead = config5 && "maxLookahead" in config5;
+ super(tokens2, Object.assign(Object.assign(Object.assign({}, defaultConfig3), { lookaheadStrategy: useDefaultLookahead ? new LLkLookaheadStrategy({ maxLookahead: config5.maxLookahead }) : new LLStarLookaheadStrategy({
+ // If validations are skipped, don't log the lookahead warnings
+ logging: config5.skipValidations ? () => {
+ } : void 0
+ }) }), config5));
}
get IS_RECORDING() {
return this.RECORDING_PHASE;
@@ -66098,24 +71546,22 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-builder-base.js
- function createParser(grammar, parser22, tokens2) {
- const rules = /* @__PURE__ */ new Map();
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/parser-builder-base.js
+ function createParser(grammar, parser24, tokens2) {
const parserContext = {
- parser: parser22,
+ parser: parser24,
tokens: tokens2,
- rules,
ruleNames: /* @__PURE__ */ new Map()
};
buildRules(parserContext, grammar);
- return parser22;
+ return parser24;
}
function buildRules(parserContext, grammar) {
const reachable = getAllReachableRules(grammar, false);
const parserRules = stream(grammar.rules).filter(isParserRule).filter((rule) => reachable.has(rule));
for (const rule of parserRules) {
const ctx = Object.assign(Object.assign({}, parserContext), { consume: 1, optional: 1, subrule: 1, many: 1, or: 1 });
- ctx.rules.set(rule.name, parserContext.parser.rule(rule, buildElement(ctx, rule.definition)));
+ parserContext.parser.rule(rule, buildElement(ctx, rule.definition));
}
}
function buildElement(ctx, element3, ignoreGuard = false) {
@@ -66152,14 +71598,15 @@ For Further details.`;
const rule = ruleCall.rule.ref;
if (isParserRule(rule)) {
const idx = ctx.subrule++;
+ const fragment = rule.fragment;
const predicate = ruleCall.arguments.length > 0 ? buildRuleCallPredicate(rule, ruleCall.arguments) : () => ({});
- return (args) => ctx.parser.subrule(idx, getRule(ctx, rule), ruleCall, predicate(args));
+ return (args) => ctx.parser.subrule(idx, getRule(ctx, rule), fragment, ruleCall, predicate(args));
} else if (isTerminalRule(rule)) {
const idx = ctx.consume++;
const method = getToken(ctx, rule.name);
return () => ctx.parser.consume(idx, method, ruleCall);
} else if (!rule) {
- throw new ErrorWithLocation(ruleCall.$cstNode, `Undefined rule type: ${ruleCall.$type}`);
+ throw new ErrorWithLocation(ruleCall.$cstNode, `Undefined rule: ${ruleCall.rule.$refText}`);
} else {
assertUnreachable(rule);
}
@@ -66251,15 +71698,15 @@ For Further details.`;
}, "idFunc");
const alternatives = /* @__PURE__ */ __name((args) => ctx.parser.alternatives(orIdx, methods.map((method, idx) => {
const alt = { ALT: /* @__PURE__ */ __name(() => true, "ALT") };
- const parser22 = ctx.parser;
+ const parser24 = ctx.parser;
alt.ALT = () => {
method.ALT(args);
- if (!parser22.isRecording()) {
- const key = idFunc(orIdx, parser22);
- if (!parser22.unorderedGroups.get(key)) {
- parser22.unorderedGroups.set(key, []);
+ if (!parser24.isRecording()) {
+ const key = idFunc(orIdx, parser24);
+ if (!parser24.unorderedGroups.get(key)) {
+ parser24.unorderedGroups.set(key, []);
}
- const groupState = parser22.unorderedGroups.get(key);
+ const groupState = parser24.unorderedGroups.get(key);
if (typeof (groupState === null || groupState === void 0 ? void 0 : groupState[idx]) === "undefined") {
groupState[idx] = true;
}
@@ -66270,7 +71717,7 @@ For Further details.`;
alt.GATE = () => gate(args);
} else {
alt.GATE = () => {
- const trackedAlternatives = parser22.unorderedGroups.get(idFunc(orIdx, parser22));
+ const trackedAlternatives = parser24.unorderedGroups.get(idFunc(orIdx, parser24));
const allow = !(trackedAlternatives === null || trackedAlternatives === void 0 ? void 0 : trackedAlternatives[idx]);
return allow;
};
@@ -66307,8 +71754,9 @@ For Further details.`;
}
return buildCrossReference(ctx, crossRef, assignTerminal);
} else if (isRuleCall(terminal) && isParserRule(terminal.rule.ref)) {
+ const rule = terminal.rule.ref;
const idx = ctx.subrule++;
- return (args) => ctx.parser.subrule(idx, getRule(ctx, terminal.rule.ref), crossRef, args);
+ return (args) => ctx.parser.subrule(idx, getRule(ctx, rule), false, crossRef, args);
} else if (isRuleCall(terminal) && isTerminalRule(terminal.rule.ref)) {
const idx = ctx.consume++;
const terminalRule = getToken(ctx, terminal.rule.ref.name);
@@ -66387,7 +71835,7 @@ For Further details.`;
}
function getRule(ctx, element3) {
const name = getRuleName(ctx, element3);
- const rule = ctx.rules.get(name);
+ const rule = ctx.parser.getRule(name);
if (!rule)
throw new Error(`Rule "${name}" not found."`);
return rule;
@@ -66422,7 +71870,7 @@ For Further details.`;
return token2;
}
var init_parser_builder_base = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-builder-base.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/parser-builder-base.js"() {
"use strict";
init_api5();
init_ast();
@@ -66449,17 +71897,17 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/completion-parser-builder.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/completion-parser-builder.js
function createCompletionParser(services) {
const grammar = services.Grammar;
const lexer2 = services.parser.Lexer;
- const parser22 = new LangiumCompletionParser(services);
- createParser(grammar, parser22, lexer2.definition);
- parser22.finalize();
- return parser22;
+ const parser24 = new LangiumCompletionParser(services);
+ createParser(grammar, parser24, lexer2.definition);
+ parser24.finalize();
+ return parser24;
}
var init_completion_parser_builder = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/completion-parser-builder.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/completion-parser-builder.js"() {
"use strict";
init_langium_parser();
init_parser_builder_base();
@@ -66467,20 +71915,20 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser-builder.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/langium-parser-builder.js
function createLangiumParser(services) {
- const parser22 = prepareLangiumParser(services);
- parser22.finalize();
- return parser22;
+ const parser24 = prepareLangiumParser(services);
+ parser24.finalize();
+ return parser24;
}
function prepareLangiumParser(services) {
const grammar = services.Grammar;
const lexer2 = services.parser.Lexer;
- const parser22 = new LangiumParser(services);
- return createParser(grammar, parser22, lexer2.definition);
+ const parser24 = new LangiumParser(services);
+ return createParser(grammar, parser24, lexer2.definition);
}
var init_langium_parser_builder = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser-builder.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/langium-parser-builder.js"() {
"use strict";
init_langium_parser();
init_parser_builder_base();
@@ -66489,10 +71937,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/token-builder.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/token-builder.js
var DefaultTokenBuilder;
var init_token_builder = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/token-builder.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/token-builder.js"() {
"use strict";
init_api5();
init_ast();
@@ -66504,13 +71952,16 @@ For Further details.`;
static {
__name(this, "DefaultTokenBuilder");
}
+ constructor() {
+ this.diagnostics = [];
+ }
buildTokens(grammar, options3) {
const reachableRules = stream(getAllReachableRules(grammar, false));
const terminalTokens = this.buildTerminalTokens(reachableRules);
const tokens2 = this.buildKeywordTokens(reachableRules, terminalTokens, options3);
terminalTokens.forEach((terminalToken) => {
const pattern = terminalToken.PATTERN;
- if (typeof pattern === "object" && pattern && "test" in pattern && isWhitespace(pattern)) {
+ if (typeof pattern === "object" && pattern && "test" in pattern && isWhitespace2(pattern)) {
tokens2.unshift(terminalToken);
} else {
tokens2.push(terminalToken);
@@ -66518,6 +71969,15 @@ For Further details.`;
});
return tokens2;
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ flushLexingReport(text4) {
+ return { diagnostics: this.popDiagnostics() };
+ }
+ popDiagnostics() {
+ const diagnostics = [...this.diagnostics];
+ this.diagnostics = [];
+ return diagnostics;
+ }
buildTerminalTokens(rules) {
return rules.filter(isTerminalRule).filter((e3) => !e3.fragment).map((terminal) => this.buildTerminalToken(terminal)).toArray();
}
@@ -66526,16 +71986,18 @@ For Further details.`;
const pattern = this.requiresCustomPattern(regex2) ? this.regexPatternFunction(regex2) : regex2;
const tokenType = {
name: terminal.name,
- PATTERN: pattern,
- LINE_BREAKS: true
+ PATTERN: pattern
};
+ if (typeof pattern === "function") {
+ tokenType.LINE_BREAKS = true;
+ }
if (terminal.hidden) {
- tokenType.GROUP = isWhitespace(regex2) ? Lexer2.SKIPPED : "hidden";
+ tokenType.GROUP = isWhitespace2(regex2) ? Lexer2.SKIPPED : "hidden";
}
return tokenType;
}
requiresCustomPattern(regex2) {
- if (regex2.flags.includes("u")) {
+ if (regex2.flags.includes("u") || regex2.flags.includes("s")) {
return true;
} else if (regex2.source.includes("?<=") || regex2.source.includes("? {
+ return (text4, offset) => {
stickyRegex.lastIndex = offset;
- const execResult = stickyRegex.exec(text2);
+ const execResult = stickyRegex.exec(text4);
return execResult;
};
}
@@ -66555,11 +72017,16 @@ For Further details.`;
return rules.filter(isParserRule).flatMap((rule) => streamAllContents(rule).filter(isKeyword)).distinct((e3) => e3.value).toArray().sort((a2, b2) => b2.value.length - a2.value.length).map((keyword) => this.buildKeywordToken(keyword, terminalTokens, Boolean(options3 === null || options3 === void 0 ? void 0 : options3.caseInsensitive)));
}
buildKeywordToken(keyword, terminalTokens, caseInsensitive) {
- return {
+ const keywordPattern = this.buildKeywordPattern(keyword, caseInsensitive);
+ const tokenType = {
name: keyword.value,
- PATTERN: this.buildKeywordPattern(keyword, caseInsensitive),
+ PATTERN: keywordPattern,
LONGER_ALT: this.findLongerAlt(keyword, terminalTokens)
};
+ if (typeof keywordPattern === "function") {
+ tokenType.LINE_BREAKS = true;
+ }
+ return tokenType;
}
buildKeywordPattern(keyword, caseInsensitive) {
return caseInsensitive ? new RegExp(getCaseInsensitivePattern(keyword.value)) : keyword.value;
@@ -66577,10 +72044,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/value-converter.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/value-converter.js
var DefaultValueConverter, ValueConverter;
var init_value_converter = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/value-converter.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/value-converter.js"() {
"use strict";
init_ast();
init_grammar_utils();
@@ -66845,7 +72312,7 @@ For Further details.`;
this._contexts = void 0;
}
};
- var Emitter3 = class _Emitter {
+ var Emitter4 = class _Emitter {
static {
__name(this, "Emitter");
}
@@ -66902,8 +72369,8 @@ For Further details.`;
}
}
};
- exports2.Emitter = Emitter3;
- Emitter3._noop = function() {
+ exports2.Emitter = Emitter4;
+ Emitter4._noop = function() {
};
}
});
@@ -67004,16 +72471,16 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/cancellation.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/cancellation.js
var cancellation_exports = {};
var init_cancellation = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/cancellation.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/cancellation.js"() {
"use strict";
__reExport(cancellation_exports, __toESM(require_cancellation(), 1));
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/promise-utils.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/promise-utils.js
function delayNextTick() {
return new Promise((resolve3) => {
if (typeof setImmediate === "undefined") {
@@ -67024,7 +72491,7 @@ For Further details.`;
});
}
function startCancelableOperation() {
- lastTick = Date.now();
+ lastTick = performance.now();
return new cancellation_exports.CancellationTokenSource();
}
function setInterruptionPeriod(period) {
@@ -67037,10 +72504,11 @@ For Further details.`;
if (token2 === cancellation_exports.CancellationToken.None) {
return;
}
- const current = Date.now();
+ const current = performance.now();
if (current - lastTick >= globalInterruptionPeriod) {
lastTick = current;
await delayNextTick();
+ lastTick = performance.now();
}
if (token2.isCancellationRequested) {
throw OperationCancelled;
@@ -67048,7 +72516,7 @@ For Further details.`;
}
var lastTick, globalInterruptionPeriod, OperationCancelled, Deferred;
var init_promise_utils = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/promise-utils.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/promise-utils.js"() {
"use strict";
init_cancellation();
__name(delayNextTick, "delayNextTick");
@@ -67080,13 +72548,13 @@ For Further details.`;
});
// ../../node_modules/.pnpm/vscode-languageserver-textdocument@1.0.12/node_modules/vscode-languageserver-textdocument/lib/esm/main.js
- function mergeSort(data5, compare) {
- if (data5.length <= 1) {
- return data5;
+ function mergeSort(data6, compare) {
+ if (data6.length <= 1) {
+ return data6;
}
- const p3 = data5.length / 2 | 0;
- const left3 = data5.slice(0, p3);
- const right3 = data5.slice(p3);
+ const p3 = data6.length / 2 | 0;
+ const left3 = data6.slice(0, p3);
+ const right3 = data6.slice(p3);
mergeSort(left3, compare);
mergeSort(right3, compare);
let leftIdx = 0;
@@ -67095,25 +72563,25 @@ For Further details.`;
while (leftIdx < left3.length && rightIdx < right3.length) {
const ret = compare(left3[leftIdx], right3[rightIdx]);
if (ret <= 0) {
- data5[i2++] = left3[leftIdx++];
+ data6[i2++] = left3[leftIdx++];
} else {
- data5[i2++] = right3[rightIdx++];
+ data6[i2++] = right3[rightIdx++];
}
}
while (leftIdx < left3.length) {
- data5[i2++] = left3[leftIdx++];
+ data6[i2++] = left3[leftIdx++];
}
while (rightIdx < right3.length) {
- data5[i2++] = right3[rightIdx++];
+ data6[i2++] = right3[rightIdx++];
}
- return data5;
+ return data6;
}
- function computeLineOffsets(text2, isAtLineStart, textOffset = 0) {
+ function computeLineOffsets(text4, isAtLineStart, textOffset = 0) {
const result = isAtLineStart ? [textOffset] : [];
- for (let i2 = 0; i2 < text2.length; i2++) {
- const ch = text2.charCodeAt(i2);
+ for (let i2 = 0; i2 < text4.length; i2++) {
+ const ch = text4.charCodeAt(i2);
if (isEOL(ch)) {
- if (ch === 13 && i2 + 1 < text2.length && text2.charCodeAt(i2 + 1) === 10) {
+ if (ch === 13 && i2 + 1 < text4.length && text4.charCodeAt(i2 + 1) === 10) {
i2++;
}
result.push(textOffset + i2 + 1);
@@ -67147,10 +72615,10 @@ For Further details.`;
static {
__name(this, "FullTextDocument");
}
- constructor(uri, languageId, version4, content) {
+ constructor(uri, languageId, version2, content) {
this._uri = uri;
this._languageId = languageId;
- this._version = version4;
+ this._version = version2;
this._content = content;
this._lineOffsets = void 0;
}
@@ -67171,7 +72639,7 @@ For Further details.`;
}
return this._content;
}
- update(changes, version4) {
+ update(changes, version2) {
for (const change2 of changes) {
if (_FullTextDocument.isIncremental(change2)) {
const range3 = getWellformedRange(change2.range);
@@ -67206,7 +72674,7 @@ For Further details.`;
throw new Error("Unknown change event received");
}
}
- this._version = version4;
+ this._version = version2;
}
getLineOffsets() {
if (this._lineOffsets === void 0) {
@@ -67267,14 +72735,14 @@ For Further details.`;
}
};
(function(TextDocument3) {
- function create2(uri, languageId, version4, content) {
- return new FullTextDocument2(uri, languageId, version4, content);
+ function create4(uri, languageId, version2, content) {
+ return new FullTextDocument2(uri, languageId, version2, content);
}
- __name(create2, "create");
- TextDocument3.create = create2;
- function update2(document2, changes, version4) {
+ __name(create4, "create");
+ TextDocument3.create = create4;
+ function update2(document2, changes, version2) {
if (document2 instanceof FullTextDocument2) {
- document2.update(changes, version4);
+ document2.update(changes, version2);
return document2;
} else {
throw new Error("TextDocument.update: document must be created by TextDocument.create");
@@ -67283,7 +72751,7 @@ For Further details.`;
__name(update2, "update");
TextDocument3.update = update2;
function applyEdits(document2, edits) {
- const text2 = document2.getText();
+ const text4 = document2.getText();
const sortedEdits = mergeSort(edits.map(getWellformedEdit), (a2, b2) => {
const diff2 = a2.range.start.line - b2.range.start.line;
if (diff2 === 0) {
@@ -67298,14 +72766,14 @@ For Further details.`;
if (startOffset < lastModifiedOffset) {
throw new Error("Overlapping edit");
} else if (startOffset > lastModifiedOffset) {
- spans.push(text2.substring(lastModifiedOffset, startOffset));
+ spans.push(text4.substring(lastModifiedOffset, startOffset));
}
if (e3.newText.length) {
spans.push(e3.newText);
}
lastModifiedOffset = document2.offsetAt(e3.range.end);
}
- spans.push(text2.substr(lastModifiedOffset));
+ spans.push(text4.substr(lastModifiedOffset));
return spans.join("");
}
__name(applyEdits, "applyEdits");
@@ -67385,21 +72853,21 @@ For Further details.`;
if ((t6 = n3.resolve(t6)) === (r4 = n3.resolve(r4))) return "";
for (var i2 = 1; i2 < t6.length && 47 === t6.charCodeAt(i2); ++i2) ;
for (var o2 = t6.length, s2 = o2 - i2, h2 = 1; h2 < r4.length && 47 === r4.charCodeAt(h2); ++h2) ;
- for (var a2 = r4.length - h2, c3 = s2 < a2 ? s2 : a2, f3 = -1, u2 = 0; u2 <= c3; ++u2) {
+ for (var a2 = r4.length - h2, c3 = s2 < a2 ? s2 : a2, f2 = -1, u2 = 0; u2 <= c3; ++u2) {
if (u2 === c3) {
if (a2 > c3) {
if (47 === r4.charCodeAt(h2 + u2)) return r4.slice(h2 + u2 + 1);
if (0 === u2) return r4.slice(h2 + u2);
- } else s2 > c3 && (47 === t6.charCodeAt(i2 + u2) ? f3 = u2 : 0 === u2 && (f3 = 0));
+ } else s2 > c3 && (47 === t6.charCodeAt(i2 + u2) ? f2 = u2 : 0 === u2 && (f2 = 0));
break;
}
var l2 = t6.charCodeAt(i2 + u2);
if (l2 !== r4.charCodeAt(h2 + u2)) break;
- 47 === l2 && (f3 = u2);
+ 47 === l2 && (f2 = u2);
}
var g2 = "";
- for (u2 = i2 + f3 + 1; u2 <= o2; ++u2) u2 !== o2 && 47 !== t6.charCodeAt(u2) || (0 === g2.length ? g2 += ".." : g2 += "/..");
- return g2.length > 0 ? g2 + r4.slice(h2 + f3) : (h2 += f3, 47 === r4.charCodeAt(h2) && ++h2, r4.slice(h2));
+ for (u2 = i2 + f2 + 1; u2 <= o2; ++u2) u2 !== o2 && 47 !== t6.charCodeAt(u2) || (0 === g2.length ? g2 += ".." : g2 += "/..");
+ return g2.length > 0 ? g2 + r4.slice(h2 + f2) : (h2 += f2, 47 === r4.charCodeAt(h2) && ++h2, r4.slice(h2));
}, "relative"), _makeLong: /* @__PURE__ */ __name(function(t6) {
return t6;
}, "_makeLong"), dirname: /* @__PURE__ */ __name(function(t6) {
@@ -67459,9 +72927,9 @@ For Further details.`;
if (0 === t6.length) return r4;
var n4, i2 = t6.charCodeAt(0), o2 = 47 === i2;
o2 ? (r4.root = "/", n4 = 1) : n4 = 0;
- for (var s2 = -1, h2 = 0, a2 = -1, c3 = true, f3 = t6.length - 1, u2 = 0; f3 >= n4; --f3) if (47 !== (i2 = t6.charCodeAt(f3))) -1 === a2 && (c3 = false, a2 = f3 + 1), 46 === i2 ? -1 === s2 ? s2 = f3 : 1 !== u2 && (u2 = 1) : -1 !== s2 && (u2 = -1);
+ for (var s2 = -1, h2 = 0, a2 = -1, c3 = true, f2 = t6.length - 1, u2 = 0; f2 >= n4; --f2) if (47 !== (i2 = t6.charCodeAt(f2))) -1 === a2 && (c3 = false, a2 = f2 + 1), 46 === i2 ? -1 === s2 ? s2 = f2 : 1 !== u2 && (u2 = 1) : -1 !== s2 && (u2 = -1);
else if (!c3) {
- h2 = f3 + 1;
+ h2 = f2 + 1;
break;
}
return -1 === s2 || -1 === a2 || 0 === u2 || 1 === u2 && s2 === a2 - 1 && s2 === h2 + 1 ? -1 !== a2 && (r4.base = r4.name = 0 === h2 && o2 ? t6.slice(1, a2) : t6.slice(h2, a2)) : (0 === h2 && o2 ? (r4.name = t6.slice(1, s2), r4.base = t6.slice(1, a2)) : (r4.name = t6.slice(h2, s2), r4.base = t6.slice(h2, a2)), r4.ext = t6.slice(s2, a2)), h2 > 0 ? r4.dir = t6.slice(0, h2 - 1) : o2 && (r4.dir = "/"), r4;
@@ -67483,7 +72951,7 @@ For Further details.`;
var n2 = {};
(() => {
let t5;
- if (r2.r(n2), r2.d(n2, { URI: /* @__PURE__ */ __name(() => f3, "URI"), Utils: /* @__PURE__ */ __name(() => P2, "Utils") }), "object" == typeof process) t5 = "win32" === process.platform;
+ if (r2.r(n2), r2.d(n2, { URI: /* @__PURE__ */ __name(() => f2, "URI"), Utils: /* @__PURE__ */ __name(() => P2, "Utils") }), "object" == typeof process) t5 = "win32" === process.platform;
else if ("object" == typeof navigator) {
let e6 = navigator.userAgent;
t5 = e6.indexOf("Windows") >= 0;
@@ -67500,12 +72968,12 @@ For Further details.`;
}
__name(s2, "s");
const h2 = "", a2 = "/", c3 = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
- class f3 {
+ class f2 {
static {
__name(this, "f");
}
static isUri(t6) {
- return t6 instanceof f3 || !!t6 && "string" == typeof t6.authority && "string" == typeof t6.fragment && "string" == typeof t6.path && "string" == typeof t6.query && "string" == typeof t6.scheme && "string" == typeof t6.fsPath && "function" == typeof t6.with && "function" == typeof t6.toString;
+ return t6 instanceof f2 || !!t6 && "string" == typeof t6.authority && "string" == typeof t6.fragment && "string" == typeof t6.path && "string" == typeof t6.query && "string" == typeof t6.scheme && "string" == typeof t6.fsPath && "function" == typeof t6.with && "function" == typeof t6.toString;
}
scheme;
authority;
@@ -67557,7 +73025,7 @@ For Further details.`;
}
static revive(t6) {
if (t6) {
- if (t6 instanceof f3) return t6;
+ if (t6 instanceof f2) return t6;
{
const e6 = new l2(t6);
return e6._formatted = t6.external, e6._fsPath = t6._sep === u2 ? t6.fsPath : null, e6;
@@ -67567,7 +73035,7 @@ For Further details.`;
}
}
const u2 = t5 ? 1 : void 0;
- class l2 extends f3 {
+ class l2 extends f2 {
static {
__name(this, "l");
}
@@ -67677,10 +73145,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/uri-utils.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/uri-utils.js
var UriUtils;
var init_uri_utils = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/uri-utils.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/uri-utils.js"() {
"use strict";
init_esm2();
(function(UriUtils2) {
@@ -67711,14 +73179,19 @@ For Further details.`;
}
__name(relative, "relative");
UriUtils2.relative = relative;
+ function normalize4(uri) {
+ return URI2.parse(uri.toString()).toString();
+ }
+ __name(normalize4, "normalize");
+ UriUtils2.normalize = normalize4;
})(UriUtils || (UriUtils = {}));
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/documents.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/documents.js
var DocumentState, DefaultLangiumDocumentFactory, DefaultLangiumDocuments;
var init_documents = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/documents.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/documents.js"() {
"use strict";
init_main2();
init_documents();
@@ -67747,33 +73220,33 @@ For Further details.`;
const content = await this.fileSystemProvider.readFile(uri);
return this.createAsync(uri, content, cancellationToken);
}
- fromTextDocument(textDocument, uri, cancellationToken) {
+ fromTextDocument(textDocument, uri, token2) {
uri = uri !== null && uri !== void 0 ? uri : URI2.parse(textDocument.uri);
- if (cancellationToken) {
- return this.createAsync(uri, textDocument, cancellationToken);
+ if (cancellation_exports.CancellationToken.is(token2)) {
+ return this.createAsync(uri, textDocument, token2);
} else {
- return this.create(uri, textDocument);
+ return this.create(uri, textDocument, token2);
}
}
- fromString(text2, uri, cancellationToken) {
- if (cancellationToken) {
- return this.createAsync(uri, text2, cancellationToken);
+ fromString(text4, uri, token2) {
+ if (cancellation_exports.CancellationToken.is(token2)) {
+ return this.createAsync(uri, text4, token2);
} else {
- return this.create(uri, text2);
+ return this.create(uri, text4, token2);
}
}
fromModel(model, uri) {
return this.create(uri, { $model: model });
}
- create(uri, content) {
+ create(uri, content, options3) {
if (typeof content === "string") {
- const parseResult = this.parse(uri, content);
+ const parseResult = this.parse(uri, content, options3);
return this.createLangiumDocument(parseResult, uri, void 0, content);
} else if ("$model" in content) {
const parseResult = { value: content.$model, parserErrors: [], lexerErrors: [] };
return this.createLangiumDocument(parseResult, uri);
} else {
- const parseResult = this.parse(uri, content.getText());
+ const parseResult = this.parse(uri, content.getText(), options3);
return this.createLangiumDocument(parseResult, uri, content);
}
}
@@ -67797,7 +73270,7 @@ For Further details.`;
* during workspace initialization and on addition/recognition of new files, while changes in
* existing documents are processed via {@link update}.
*/
- createLangiumDocument(parseResult, uri, textDocument, text2) {
+ createLangiumDocument(parseResult, uri, textDocument, text4) {
let document2;
if (textDocument) {
document2 = {
@@ -67808,7 +73281,7 @@ For Further details.`;
textDocument
};
} else {
- const textDocumentGetter = this.createTextDocumentGetter(uri, text2);
+ const textDocumentGetter = this.createTextDocumentGetter(uri, text4);
document2 = {
parseResult,
uri,
@@ -67826,37 +73299,37 @@ For Further details.`;
var _a, _b;
const oldText = (_a = document2.parseResult.value.$cstNode) === null || _a === void 0 ? void 0 : _a.root.fullText;
const textDocument = (_b = this.textDocuments) === null || _b === void 0 ? void 0 : _b.get(document2.uri.toString());
- const text2 = textDocument ? textDocument.getText() : await this.fileSystemProvider.readFile(document2.uri);
+ const text4 = textDocument ? textDocument.getText() : await this.fileSystemProvider.readFile(document2.uri);
if (textDocument) {
Object.defineProperty(document2, "textDocument", {
value: textDocument
});
} else {
- const textDocumentGetter = this.createTextDocumentGetter(document2.uri, text2);
+ const textDocumentGetter = this.createTextDocumentGetter(document2.uri, text4);
Object.defineProperty(document2, "textDocument", {
get: textDocumentGetter
});
}
- if (oldText !== text2) {
- document2.parseResult = await this.parseAsync(document2.uri, text2, cancellationToken);
+ if (oldText !== text4) {
+ document2.parseResult = await this.parseAsync(document2.uri, text4, cancellationToken);
document2.parseResult.value.$document = document2;
}
document2.state = DocumentState.Parsed;
return document2;
}
- parse(uri, text2) {
+ parse(uri, text4, options3) {
const services = this.serviceRegistry.getServices(uri);
- return services.parser.LangiumParser.parse(text2);
+ return services.parser.LangiumParser.parse(text4, options3);
}
- parseAsync(uri, text2, cancellationToken) {
+ parseAsync(uri, text4, cancellationToken) {
const services = this.serviceRegistry.getServices(uri);
- return services.parser.AsyncParser.parse(text2, cancellationToken);
+ return services.parser.AsyncParser.parse(text4, cancellationToken);
}
- createTextDocumentGetter(uri, text2) {
+ createTextDocumentGetter(uri, text4) {
const serviceRegistry = this.serviceRegistry;
let textDoc = void 0;
return () => {
- return textDoc !== null && textDoc !== void 0 ? textDoc : textDoc = TextDocument2.create(uri.toString(), serviceRegistry.getServices(uri).LanguageMetaData.languageId, 0, text2 !== null && text2 !== void 0 ? text2 : "");
+ return textDoc !== null && textDoc !== void 0 ? textDoc : textDoc = TextDocument2.create(uri.toString(), serviceRegistry.getServices(uri).LanguageMetaData.languageId, 0, text4 !== null && text4 !== void 0 ? text4 : "");
};
}
};
@@ -67867,6 +73340,7 @@ For Further details.`;
constructor(services) {
this.documentMap = /* @__PURE__ */ new Map();
this.langiumDocumentFactory = services.workspace.LangiumDocumentFactory;
+ this.serviceRegistry = services.ServiceRegistry;
}
get all() {
return stream(this.documentMap.values());
@@ -67891,14 +73365,14 @@ For Further details.`;
this.addDocument(document2);
return document2;
}
- createDocument(uri, text2, cancellationToken) {
+ createDocument(uri, text4, cancellationToken) {
if (cancellationToken) {
- return this.langiumDocumentFactory.fromString(text2, uri, cancellationToken).then((document2) => {
+ return this.langiumDocumentFactory.fromString(text4, uri, cancellationToken).then((document2) => {
this.addDocument(document2);
return document2;
});
} else {
- const document2 = this.langiumDocumentFactory.fromString(text2, uri);
+ const document2 = this.langiumDocumentFactory.fromString(text4, uri);
this.addDocument(document2);
return document2;
}
@@ -67910,9 +73384,10 @@ For Further details.`;
const uriString = uri.toString();
const langiumDoc = this.documentMap.get(uriString);
if (langiumDoc) {
+ const linker = this.serviceRegistry.getServices(uri).references.Linker;
+ linker.unlink(langiumDoc);
langiumDoc.state = DocumentState.Changed;
langiumDoc.precomputedScopes = void 0;
- langiumDoc.references = [];
langiumDoc.diagnostics = void 0;
}
return langiumDoc;
@@ -67930,16 +73405,17 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/linker.js
- var DefaultLinker;
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/linker.js
+ var ref_resolving, DefaultLinker;
var init_linker = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/linker.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/linker.js"() {
"use strict";
init_cancellation();
init_syntax_tree();
init_ast_utils();
init_promise_utils();
init_documents();
+ ref_resolving = Symbol("ref_resolving");
DefaultLinker = class {
static {
__name(this, "DefaultLinker");
@@ -67957,8 +73433,10 @@ For Further details.`;
}
}
doLink(refInfo, document2) {
+ var _a;
const ref = refInfo.reference;
if (ref._ref === void 0) {
+ ref._ref = ref_resolving;
try {
const description = this.getCandidate(refInfo);
if (isLinkingError(description)) {
@@ -67968,13 +73446,17 @@ For Further details.`;
if (this.langiumDocuments().hasDocument(description.documentUri)) {
const linkedNode = this.loadAstNode(description);
ref._ref = linkedNode !== null && linkedNode !== void 0 ? linkedNode : this.createLinkingError(refInfo, description);
+ } else {
+ ref._ref = void 0;
}
}
} catch (err) {
- ref._ref = Object.assign(Object.assign({}, refInfo), { message: `An error occurred while resolving reference to '${ref.$refText}': ${err}` });
+ console.error(`An error occurred while resolving reference to '${ref.$refText}':`, err);
+ const errorMessage = (_a = err.message) !== null && _a !== void 0 ? _a : String(err);
+ ref._ref = Object.assign(Object.assign({}, refInfo), { message: `An error occurred while resolving reference to '${ref.$refText}': ${errorMessage}` });
}
+ document2.references.push(ref);
}
- document2.references.push(ref);
}
unlink(document2) {
for (const ref of document2.references) {
@@ -68001,12 +73483,17 @@ For Further details.`;
const linkedNode = linker.loadAstNode(this._nodeDescription);
this._ref = linkedNode !== null && linkedNode !== void 0 ? linkedNode : linker.createLinkingError({ reference, container: node2, property: property2 }, this._nodeDescription);
} else if (this._ref === void 0) {
+ this._ref = ref_resolving;
+ const document2 = findRootNode(node2).$document;
const refData = linker.getLinkedNode({ reference, container: node2, property: property2 });
- if (refData.error && getDocument(node2).state < DocumentState.ComputedScopes) {
- return void 0;
+ if (refData.error && document2 && document2.state < DocumentState.ComputedScopes) {
+ return this._ref = void 0;
}
this._ref = (_a = refData.node) !== null && _a !== void 0 ? _a : refData.error;
this._nodeDescription = refData.descr;
+ document2 === null || document2 === void 0 ? void 0 : document2.references.push(this);
+ } else if (this._ref === ref_resolving) {
+ throw new Error(`Cyclic reference resolution detected: ${linker.astNodeLocator.getAstNodePath(node2)}/${property2} (symbol '${refText}')`);
}
return isAstNode(this._ref) ? this._ref : void 0;
},
@@ -68020,6 +73507,7 @@ For Further details.`;
return reference;
}
getLinkedNode(refInfo) {
+ var _a;
try {
const description = this.getCandidate(refInfo);
if (isLinkingError(description)) {
@@ -68035,8 +73523,10 @@ For Further details.`;
};
}
} catch (err) {
+ console.error(`An error occurred while resolving reference to '${refInfo.reference.$refText}':`, err);
+ const errorMessage = (_a = err.message) !== null && _a !== void 0 ? _a : String(err);
return {
- error: Object.assign(Object.assign({}, refInfo), { message: `An error occurred while resolving reference to '${refInfo.reference.$refText}': ${err}` })
+ error: Object.assign(Object.assign({}, refInfo), { message: `An error occurred while resolving reference to '${refInfo.reference.$refText}': ${errorMessage}` })
};
}
}
@@ -68051,8 +73541,8 @@ For Further details.`;
return this.astNodeLocator.getAstNode(doc.parseResult.value, nodeDescription.path);
}
createLinkingError(refInfo, targetDescription) {
- const document2 = getDocument(refInfo.container);
- if (document2.state < DocumentState.ComputedScopes) {
+ const document2 = findRootNode(refInfo.container).$document;
+ if (document2 && document2.state < DocumentState.ComputedScopes) {
console.warn(`Attempted reference resolution before document reached ComputedScopes state (${document2.uri}).`);
}
const referenceType = this.reflection.getReferenceType(refInfo);
@@ -68062,13 +73552,13 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/name-provider.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/name-provider.js
function isNamed(node2) {
return typeof node2.name === "string";
}
var DefaultNameProvider;
var init_name_provider = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/name-provider.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/name-provider.js"() {
"use strict";
init_grammar_utils();
__name(isNamed, "isNamed");
@@ -68089,10 +73579,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/references.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/references.js
var DefaultReferences;
var init_references = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/references.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/references.js"() {
"use strict";
init_grammar_utils();
init_syntax_tree();
@@ -68177,10 +73667,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/collections.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/collections.js
var MultiMap, BiMap;
var init_collections = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/collections.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/collections.js"() {
"use strict";
init_stream();
MultiMap = class {
@@ -68364,10 +73854,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope-computation.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/scope-computation.js
var DefaultScopeComputation;
var init_scope_computation = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope-computation.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/scope-computation.js"() {
"use strict";
init_cancellation();
init_ast_utils();
@@ -68393,7 +73883,7 @@ For Further details.`;
* @param document The document containing the AST node to be exported.
* @param children A function called with {@link parentNode} as single argument and returning an {@link Iterable} supplying the children to be visited, which must be directly or transitively contained in {@link parentNode}.
* @param cancelToken Indicates when to cancel the current operation.
- * @throws `OperationCanceled` if a user action occurs during execution.
+ * @throws `OperationCancelled` if a user action occurs during execution.
* @returns A list of {@link AstNodeDescription AstNodeDescriptions} to be published to index.
*/
async computeExportsForNode(parentNode, document2, children2 = streamContents, cancelToken = cancellation_exports.CancellationToken.None) {
@@ -68442,10 +73932,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/scope.js
var StreamScope, MapScope, EMPTY_SCOPE;
var init_scope = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/scope.js"() {
"use strict";
init_stream();
StreamScope = class {
@@ -68520,10 +74010,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/caching.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/caching.js
var DisposableCache, SimpleCache, ContextCache, DocumentCache, WorkspaceCache;
var init_caching = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/caching.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/caching.js"() {
"use strict";
DisposableCache = class {
static {
@@ -68642,34 +74132,76 @@ For Further details.`;
static {
__name(this, "DocumentCache");
}
- constructor(sharedServices) {
+ /**
+ * Creates a new document cache.
+ *
+ * @param sharedServices Service container instance to hook into document lifecycle events.
+ * @param state Optional document state on which the cache should evict.
+ * If not provided, the cache will evict on `DocumentBuilder#onUpdate`.
+ * *Deleted* documents are considered in both cases.
+ *
+ * Providing a state here will use `DocumentBuilder#onDocumentPhase` instead,
+ * which triggers on all documents that have been affected by this change, assuming that the
+ * state is `DocumentState.Linked` or a later state.
+ */
+ constructor(sharedServices, state4) {
super((uri) => uri.toString());
- this.onDispose(sharedServices.workspace.DocumentBuilder.onUpdate((changed, deleted) => {
- const allUris = changed.concat(deleted);
- for (const uri of allUris) {
- this.clear(uri);
- }
- }));
+ if (state4) {
+ this.toDispose.push(sharedServices.workspace.DocumentBuilder.onDocumentPhase(state4, (document2) => {
+ this.clear(document2.uri.toString());
+ }));
+ this.toDispose.push(sharedServices.workspace.DocumentBuilder.onUpdate((_changed, deleted) => {
+ for (const uri of deleted) {
+ this.clear(uri);
+ }
+ }));
+ } else {
+ this.toDispose.push(sharedServices.workspace.DocumentBuilder.onUpdate((changed, deleted) => {
+ const allUris = changed.concat(deleted);
+ for (const uri of allUris) {
+ this.clear(uri);
+ }
+ }));
+ }
}
};
WorkspaceCache = class extends SimpleCache {
static {
__name(this, "WorkspaceCache");
}
- constructor(sharedServices) {
+ /**
+ * Creates a new workspace cache.
+ *
+ * @param sharedServices Service container instance to hook into document lifecycle events.
+ * @param state Optional document state on which the cache should evict.
+ * If not provided, the cache will evict on `DocumentBuilder#onUpdate`.
+ * *Deleted* documents are considered in both cases.
+ */
+ constructor(sharedServices, state4) {
super();
- this.onDispose(sharedServices.workspace.DocumentBuilder.onUpdate(() => {
- this.clear();
- }));
+ if (state4) {
+ this.toDispose.push(sharedServices.workspace.DocumentBuilder.onBuildPhase(state4, () => {
+ this.clear();
+ }));
+ this.toDispose.push(sharedServices.workspace.DocumentBuilder.onUpdate((_changed, deleted) => {
+ if (deleted.length > 0) {
+ this.clear();
+ }
+ }));
+ } else {
+ this.toDispose.push(sharedServices.workspace.DocumentBuilder.onUpdate(() => {
+ this.clear();
+ }));
+ }
}
};
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope-provider.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/scope-provider.js
var DefaultScopeProvider;
var init_scope_provider = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope-provider.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/scope-provider.js"() {
"use strict";
init_scope();
init_ast_utils();
@@ -68736,7 +74268,7 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/json-serializer.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/serializer/json-serializer.js
function isAstNodeWithComment(node2) {
return typeof node2.$comment === "string";
}
@@ -68745,7 +74277,7 @@ For Further details.`;
}
var DefaultJsonSerializer;
var init_json_serializer = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/json-serializer.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/serializer/json-serializer.js"() {
"use strict";
init_esm2();
init_syntax_tree();
@@ -68764,9 +74296,10 @@ For Further details.`;
this.nameProvider = services.references.NameProvider;
this.commentProvider = services.documentation.CommentProvider;
}
- serialize(node2, options3 = {}) {
+ serialize(node2, options3) {
+ const serializeOptions = options3 !== null && options3 !== void 0 ? options3 : {};
const specificReplacer = options3 === null || options3 === void 0 ? void 0 : options3.replacer;
- const defaultReplacer = /* @__PURE__ */ __name((key, value2) => this.replacer(key, value2, options3), "defaultReplacer");
+ const defaultReplacer = /* @__PURE__ */ __name((key, value2) => this.replacer(key, value2, serializeOptions), "defaultReplacer");
const replacer = specificReplacer ? (key, value2) => specificReplacer(key, value2, defaultReplacer) : defaultReplacer;
try {
this.currentDocument = getDocument(node2);
@@ -68775,9 +74308,10 @@ For Further details.`;
this.currentDocument = void 0;
}
}
- deserialize(content, options3 = {}) {
+ deserialize(content, options3) {
+ const deserializeOptions = options3 !== null && options3 !== void 0 ? options3 : {};
const root4 = JSON.parse(content);
- this.linkNode(root4, root4, options3);
+ this.linkNode(root4, root4, deserializeOptions);
return root4;
}
replacer(key, value2, { refText, sourceText, textRegions, comments, uriConverter }) {
@@ -68945,72 +74479,92 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/service-registry.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/service-registry.js
var DefaultServiceRegistry;
var init_service_registry = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/service-registry.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/service-registry.js"() {
"use strict";
init_uri_utils();
DefaultServiceRegistry = class {
static {
__name(this, "DefaultServiceRegistry");
}
+ /**
+ * @deprecated Use the new `fileExtensionMap` (or `languageIdMap`) property instead.
+ */
+ get map() {
+ return this.fileExtensionMap;
+ }
+ constructor(services) {
+ this.languageIdMap = /* @__PURE__ */ new Map();
+ this.fileExtensionMap = /* @__PURE__ */ new Map();
+ this.textDocuments = services === null || services === void 0 ? void 0 : services.workspace.TextDocuments;
+ }
register(language) {
- if (!this.singleton && !this.map) {
- this.singleton = language;
- return;
- }
- if (!this.map) {
- this.map = {};
- if (this.singleton) {
- for (const ext of this.singleton.LanguageMetaData.fileExtensions) {
- this.map[ext] = this.singleton;
- }
- this.singleton = void 0;
+ const data6 = language.LanguageMetaData;
+ for (const ext of data6.fileExtensions) {
+ if (this.fileExtensionMap.has(ext)) {
+ console.warn(`The file extension ${ext} is used by multiple languages. It is now assigned to '${data6.languageId}'.`);
}
+ this.fileExtensionMap.set(ext, language);
}
- for (const ext of language.LanguageMetaData.fileExtensions) {
- if (this.map[ext] !== void 0 && this.map[ext] !== language) {
- console.warn(`The file extension ${ext} is used by multiple languages. It is now assigned to '${language.LanguageMetaData.languageId}'.`);
- }
- this.map[ext] = language;
+ this.languageIdMap.set(data6.languageId, language);
+ if (this.languageIdMap.size === 1) {
+ this.singleton = language;
+ } else {
+ this.singleton = void 0;
}
}
getServices(uri) {
+ var _a, _b;
if (this.singleton !== void 0) {
return this.singleton;
}
- if (this.map === void 0) {
+ if (this.languageIdMap.size === 0) {
throw new Error("The service registry is empty. Use `register` to register the services of a language.");
}
+ const languageId = (_b = (_a = this.textDocuments) === null || _a === void 0 ? void 0 : _a.get(uri)) === null || _b === void 0 ? void 0 : _b.languageId;
+ if (languageId !== void 0) {
+ const services2 = this.languageIdMap.get(languageId);
+ if (services2) {
+ return services2;
+ }
+ }
const ext = UriUtils.extname(uri);
- const services = this.map[ext];
+ const services = this.fileExtensionMap.get(ext);
if (!services) {
- throw new Error(`The service registry contains no services for the extension '${ext}'.`);
+ if (languageId) {
+ throw new Error(`The service registry contains no services for the extension '${ext}' for language '${languageId}'.`);
+ } else {
+ throw new Error(`The service registry contains no services for the extension '${ext}'.`);
+ }
}
return services;
}
- get all() {
- if (this.singleton !== void 0) {
- return [this.singleton];
- }
- if (this.map !== void 0) {
- return Object.values(this.map);
+ hasServices(uri) {
+ try {
+ this.getServices(uri);
+ return true;
+ } catch (_a) {
+ return false;
}
- return [];
+ }
+ get all() {
+ return Array.from(this.languageIdMap.values());
}
};
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/validation-registry.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/validation/validation-registry.js
function diagnosticData(code) {
return { code };
}
var ValidationCategory, ValidationRegistry;
var init_validation_registry = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/validation-registry.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/validation/validation-registry.js"() {
"use strict";
+ init_lib3();
init_collections();
init_promise_utils();
init_stream();
@@ -69024,6 +74578,8 @@ For Further details.`;
}
constructor(services) {
this.entries = new MultiMap();
+ this.entriesBefore = [];
+ this.entriesAfter = [];
this.reflection = services.shared.AstReflection;
}
/**
@@ -69054,26 +74610,31 @@ For Further details.`;
category
};
this.addEntry(type3, entry);
+ } else {
+ assertUnreachable(callbacks);
}
}
}
wrapValidationException(check, thisObj) {
return async (node2, accept, cancelToken) => {
- try {
- await check.call(thisObj, node2, accept, cancelToken);
- } catch (err) {
- if (isOperationCancelled(err)) {
- throw err;
- }
- console.error("An error occurred during validation:", err);
- const message = err instanceof Error ? err.message : String(err);
- if (err instanceof Error && err.stack) {
- console.error(err.stack);
- }
- accept("error", "An error occurred during validation: " + message, { node: node2 });
- }
+ await this.handleException(() => check.call(thisObj, node2, accept, cancelToken), "An error occurred during validation", accept, node2);
};
}
+ async handleException(functionality, messageContext, accept, node2) {
+ try {
+ await functionality();
+ } catch (err) {
+ if (isOperationCancelled(err)) {
+ throw err;
+ }
+ console.error(`${messageContext}:`, err);
+ if (err instanceof Error && err.stack) {
+ console.error(err.stack);
+ }
+ const messageDetails = err instanceof Error ? err.message : String(err);
+ accept("error", `${messageContext}: ${messageDetails}`, { node: node2 });
+ }
+ }
addEntry(type3, entry) {
if (type3 === "AstNode") {
this.entries.add("AstNode", entry);
@@ -69090,11 +74651,60 @@ For Further details.`;
}
return checks.map((entry) => entry.check);
}
+ /**
+ * Register logic which will be executed once before validating all the nodes of an AST/Langium document.
+ * This helps to prepare or initialize some information which are required or reusable for the following checks on the AstNodes.
+ *
+ * As an example, for validating unique fully-qualified names of nodes in the AST,
+ * here the map for mapping names to nodes could be established.
+ * During the usual checks on the nodes, they are put into this map with their name.
+ *
+ * Note that this approach makes validations stateful, which is relevant e.g. when cancelling the validation.
+ * Therefore it is recommended to clear stored information
+ * _before_ validating an AST to validate each AST unaffected from other ASTs
+ * AND _after_ validating the AST to free memory by information which are no longer used.
+ *
+ * @param checkBefore a set-up function which will be called once before actually validating an AST
+ * @param thisObj Optional object to be used as `this` when calling the validation check functions.
+ */
+ registerBeforeDocument(checkBefore, thisObj = this) {
+ this.entriesBefore.push(this.wrapPreparationException(checkBefore, "An error occurred during set-up of the validation", thisObj));
+ }
+ /**
+ * Register logic which will be executed once after validating all the nodes of an AST/Langium document.
+ * This helps to finally evaluate information which are collected during the checks on the AstNodes.
+ *
+ * As an example, for validating unique fully-qualified names of nodes in the AST,
+ * here the map with all the collected nodes and their names is checked
+ * and validation hints are created for all nodes with the same name.
+ *
+ * Note that this approach makes validations stateful, which is relevant e.g. when cancelling the validation.
+ * Therefore it is recommended to clear stored information
+ * _before_ validating an AST to validate each AST unaffected from other ASTs
+ * AND _after_ validating the AST to free memory by information which are no longer used.
+ *
+ * @param checkBefore a set-up function which will be called once before actually validating an AST
+ * @param thisObj Optional object to be used as `this` when calling the validation check functions.
+ */
+ registerAfterDocument(checkAfter, thisObj = this) {
+ this.entriesAfter.push(this.wrapPreparationException(checkAfter, "An error occurred during tear-down of the validation", thisObj));
+ }
+ wrapPreparationException(check, messageContext, thisObj) {
+ return async (rootNode, accept, categories, cancelToken) => {
+ await this.handleException(() => check.call(thisObj, rootNode, accept, categories, cancelToken), messageContext, accept, rootNode);
+ };
+ }
+ get checksBefore() {
+ return this.entriesBefore;
+ }
+ get checksAfter() {
+ return this.entriesAfter;
+ }
};
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/document-validator.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/validation/document-validator.js
function getDiagnosticRange(info2) {
if (info2.range) {
return info2.range;
@@ -69128,9 +74738,23 @@ For Further details.`;
throw new Error("Invalid diagnostic severity: " + severity);
}
}
+ function toDiagnosticData(severity) {
+ switch (severity) {
+ case "error":
+ return diagnosticData(DocumentValidator.LexingError);
+ case "warning":
+ return diagnosticData(DocumentValidator.LexingWarning);
+ case "info":
+ return diagnosticData(DocumentValidator.LexingInfo);
+ case "hint":
+ return diagnosticData(DocumentValidator.LexingHint);
+ default:
+ throw new Error("Invalid diagnostic severity: " + severity);
+ }
+ }
var DefaultDocumentValidator, DocumentValidator;
var init_document_validator = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/document-validator.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/validation/document-validator.js"() {
"use strict";
init_cancellation();
init_grammar_utils();
@@ -69185,21 +74809,24 @@ For Further details.`;
return diagnostics;
}
processLexingErrors(parseResult, diagnostics, _options) {
- for (const lexerError of parseResult.lexerErrors) {
+ var _a, _b, _c;
+ const lexerDiagnostics = [...parseResult.lexerErrors, ...(_b = (_a = parseResult.lexerReport) === null || _a === void 0 ? void 0 : _a.diagnostics) !== null && _b !== void 0 ? _b : []];
+ for (const lexerDiagnostic of lexerDiagnostics) {
+ const severity = (_c = lexerDiagnostic.severity) !== null && _c !== void 0 ? _c : "error";
const diagnostic = {
- severity: toDiagnosticSeverity("error"),
+ severity: toDiagnosticSeverity(severity),
range: {
start: {
- line: lexerError.line - 1,
- character: lexerError.column - 1
+ line: lexerDiagnostic.line - 1,
+ character: lexerDiagnostic.column - 1
},
end: {
- line: lexerError.line - 1,
- character: lexerError.column + lexerError.length - 1
+ line: lexerDiagnostic.line - 1,
+ character: lexerDiagnostic.column + lexerDiagnostic.length - 1
}
},
- message: lexerError.message,
- data: diagnosticData(DocumentValidator.LexingError),
+ message: lexerDiagnostic.message,
+ data: toDiagnosticData(severity),
source: this.getSource()
};
diagnostics.push(diagnostic);
@@ -69258,6 +74885,20 @@ For Further details.`;
const acceptor = /* @__PURE__ */ __name((severity, message, info2) => {
validationItems.push(this.toDiagnostic(severity, message, info2));
}, "acceptor");
+ await this.validateAstBefore(rootNode, options3, acceptor, cancelToken);
+ await this.validateAstNodes(rootNode, options3, acceptor, cancelToken);
+ await this.validateAstAfter(rootNode, options3, acceptor, cancelToken);
+ return validationItems;
+ }
+ async validateAstBefore(rootNode, options3, acceptor, cancelToken = cancellation_exports.CancellationToken.None) {
+ var _a;
+ const checksBefore = this.validationRegistry.checksBefore;
+ for (const checkBefore of checksBefore) {
+ await interruptAndCheck(cancelToken);
+ await checkBefore(rootNode, acceptor, (_a = options3.categories) !== null && _a !== void 0 ? _a : [], cancelToken);
+ }
+ }
+ async validateAstNodes(rootNode, options3, acceptor, cancelToken = cancellation_exports.CancellationToken.None) {
await Promise.all(streamAst(rootNode).map(async (node2) => {
await interruptAndCheck(cancelToken);
const checks = this.validationRegistry.getChecks(node2.$type, options3.categories);
@@ -69265,7 +74906,14 @@ For Further details.`;
await check(node2, acceptor, cancelToken);
}
}));
- return validationItems;
+ }
+ async validateAstAfter(rootNode, options3, acceptor, cancelToken = cancellation_exports.CancellationToken.None) {
+ var _a;
+ const checksAfter = this.validationRegistry.checksAfter;
+ for (const checkAfter of checksAfter) {
+ await interruptAndCheck(cancelToken);
+ await checkAfter(rootNode, acceptor, (_a = options3.categories) !== null && _a !== void 0 ? _a : [], cancelToken);
+ }
}
toDiagnostic(severity, message, info2) {
return {
@@ -69286,18 +74934,22 @@ For Further details.`;
};
__name(getDiagnosticRange, "getDiagnosticRange");
__name(toDiagnosticSeverity, "toDiagnosticSeverity");
+ __name(toDiagnosticData, "toDiagnosticData");
(function(DocumentValidator2) {
DocumentValidator2.LexingError = "lexing-error";
+ DocumentValidator2.LexingWarning = "lexing-warning";
+ DocumentValidator2.LexingInfo = "lexing-info";
+ DocumentValidator2.LexingHint = "lexing-hint";
DocumentValidator2.ParsingError = "parsing-error";
DocumentValidator2.LinkingError = "linking-error";
})(DocumentValidator || (DocumentValidator = {}));
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/ast-descriptions.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/ast-descriptions.js
var DefaultAstNodeDescriptionProvider, DefaultReferenceDescriptionProvider;
var init_ast_descriptions = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/ast-descriptions.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/ast-descriptions.js"() {
"use strict";
init_cancellation();
init_syntax_tree();
@@ -69313,7 +74965,8 @@ For Further details.`;
this.astNodeLocator = services.workspace.AstNodeLocator;
this.nameProvider = services.references.NameProvider;
}
- createDescription(node2, name, document2 = getDocument(node2)) {
+ createDescription(node2, name, document2) {
+ const doc = document2 !== null && document2 !== void 0 ? document2 : getDocument(node2);
name !== null && name !== void 0 ? name : name = this.nameProvider.getName(node2);
const path4 = this.astNodeLocator.getAstNodePath(node2);
if (!name) {
@@ -69332,7 +74985,7 @@ For Further details.`;
},
selectionSegment: toDocumentSegment(node2.$cstNode),
type: node2.$type,
- documentUri: document2.uri,
+ documentUri: doc.uri,
path: path4
};
}
@@ -69378,10 +75031,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/ast-node-locator.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/ast-node-locator.js
var DefaultAstNodeLocator;
var init_ast_node_locator = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/ast-node-locator.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/ast-node-locator.js"() {
"use strict";
DefaultAstNodeLocator = class {
static {
@@ -69429,11 +75082,21 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/configuration.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/event.js
+ var event_exports = {};
+ var init_event3 = __esm({
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/event.js"() {
+ "use strict";
+ __reExport(event_exports, __toESM(require_events(), 1));
+ }
+ });
+
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/configuration.js
var DefaultConfigurationProvider;
var init_configuration = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/configuration.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/configuration.js"() {
"use strict";
+ init_event3();
init_promise_utils();
DefaultConfigurationProvider = class {
static {
@@ -69443,6 +75106,7 @@ For Further details.`;
this._ready = new Deferred();
this.settings = {};
this.workspaceConfig = false;
+ this.onConfigurationSectionUpdateEmitter = new event_exports.Emitter();
this.serviceRegistry = services.ServiceRegistry;
}
get ready() {
@@ -69467,8 +75131,8 @@ For Further details.`;
section: this.toSectionName(lang.LanguageMetaData.languageId)
}));
const configs = await params.fetchConfiguration(configToUpdate);
- configToUpdate.forEach((conf8, idx) => {
- this.updateSectionConfiguration(conf8.section, configs[idx]);
+ configToUpdate.forEach((conf5, idx) => {
+ this.updateSectionConfiguration(conf5.section, configs[idx]);
});
}
}
@@ -69485,7 +75149,9 @@ For Further details.`;
return;
}
Object.keys(change2.settings).forEach((section) => {
- this.updateSectionConfiguration(section, change2.settings[section]);
+ const configuration = change2.settings[section];
+ this.updateSectionConfiguration(section, configuration);
+ this.onConfigurationSectionUpdateEmitter.fire({ section, configuration });
});
}
updateSectionConfiguration(section, configuration) {
@@ -69507,31 +75173,34 @@ For Further details.`;
toSectionName(languageId) {
return `${languageId}`;
}
+ get onConfigurationSectionUpdate() {
+ return this.onConfigurationSectionUpdateEmitter.event;
+ }
};
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/disposable.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/disposable.js
var Disposable;
var init_disposable = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/disposable.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/disposable.js"() {
"use strict";
(function(Disposable2) {
- function create2(callback) {
+ function create4(callback) {
return {
dispose: /* @__PURE__ */ __name(async () => await callback(), "dispose")
};
}
- __name(create2, "create");
- Disposable2.create = create2;
+ __name(create4, "create");
+ Disposable2.create = create4;
})(Disposable || (Disposable = {}));
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/document-builder.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/document-builder.js
var DefaultDocumentBuilder;
var init_document_builder = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/document-builder.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/document-builder.js"() {
"use strict";
init_cancellation();
init_disposable();
@@ -69553,17 +75222,19 @@ For Further details.`;
};
this.updateListeners = [];
this.buildPhaseListeners = new MultiMap();
+ this.documentPhaseListeners = new MultiMap();
this.buildState = /* @__PURE__ */ new Map();
this.documentBuildWaiters = /* @__PURE__ */ new Map();
this.currentState = DocumentState.Changed;
this.langiumDocuments = services.workspace.LangiumDocuments;
this.langiumDocumentFactory = services.workspace.LangiumDocumentFactory;
+ this.textDocuments = services.workspace.TextDocuments;
this.indexManager = services.workspace.IndexManager;
this.serviceRegistry = services.ServiceRegistry;
}
- async build(documents2, options3 = {}, cancelToken = cancellation_exports.CancellationToken.None) {
+ async build(documents, options3 = {}, cancelToken = cancellation_exports.CancellationToken.None) {
var _a, _b;
- for (const document2 of documents2) {
+ for (const document2 of documents) {
const key = document2.uri.toString();
if (document2.state === DocumentState.Validated) {
if (typeof options3.validation === "boolean" && options3.validation) {
@@ -69593,8 +75264,8 @@ For Further details.`;
}
}
this.currentState = DocumentState.Changed;
- await this.emitUpdate(documents2.map((e3) => e3.uri), []);
- await this.buildDocuments(documents2, options3, cancelToken);
+ await this.emitUpdate(documents.map((e3) => e3.uri), []);
+ await this.buildDocuments(documents, options3, cancelToken);
}
async update(changed, deleted, cancelToken = cancellation_exports.CancellationToken.None) {
this.currentState = DocumentState.Changed;
@@ -69621,15 +75292,42 @@ For Further details.`;
});
await this.emitUpdate(changed, deleted);
await interruptAndCheck(cancelToken);
- const rebuildDocuments = this.langiumDocuments.all.filter((doc) => {
+ const rebuildDocuments = this.sortDocuments(this.langiumDocuments.all.filter((doc) => {
var _a;
return doc.state < DocumentState.Linked || !((_a = this.buildState.get(doc.uri.toString())) === null || _a === void 0 ? void 0 : _a.completed);
- }).toArray();
+ }).toArray());
await this.buildDocuments(rebuildDocuments, this.updateBuildOptions, cancelToken);
}
async emitUpdate(changed, deleted) {
await Promise.all(this.updateListeners.map((listener) => listener(changed, deleted)));
}
+ /**
+ * Sort the given documents by priority. By default, documents with an open text document are prioritized.
+ * This is useful to ensure that visible documents show their diagnostics before all other documents.
+ *
+ * This improves the responsiveness in large workspaces as users usually don't care about diagnostics
+ * in files that are currently not opened in the editor.
+ */
+ sortDocuments(documents) {
+ let left3 = 0;
+ let right3 = documents.length - 1;
+ while (left3 < right3) {
+ while (left3 < documents.length && this.hasTextDocument(documents[left3])) {
+ left3++;
+ }
+ while (right3 >= 0 && !this.hasTextDocument(documents[right3])) {
+ right3--;
+ }
+ if (left3 < right3) {
+ [documents[left3], documents[right3]] = [documents[right3], documents[left3]];
+ }
+ }
+ return documents;
+ }
+ hasTextDocument(doc) {
+ var _a;
+ return Boolean((_a = this.textDocuments) === null || _a === void 0 ? void 0 : _a.get(doc.uri));
+ }
/**
* Check whether the given document should be relinked after changes were found in the given URIs.
*/
@@ -69651,50 +75349,73 @@ For Further details.`;
/**
* Build the given documents by stepping through all build phases. If a document's state indicates
* that a certain build phase is already done, the phase is skipped for that document.
+ *
+ * @param documents The documents to build.
+ * @param options the {@link BuildOptions} to use.
+ * @param cancelToken A cancellation token that can be used to cancel the build.
+ * @returns A promise that resolves when the build is done.
*/
- async buildDocuments(documents2, options3, cancelToken) {
- this.prepareBuild(documents2, options3);
- await this.runCancelable(documents2, DocumentState.Parsed, cancelToken, (doc) => this.langiumDocumentFactory.update(doc, cancelToken));
- await this.runCancelable(documents2, DocumentState.IndexedContent, cancelToken, (doc) => this.indexManager.updateContent(doc, cancelToken));
- await this.runCancelable(documents2, DocumentState.ComputedScopes, cancelToken, async (doc) => {
+ async buildDocuments(documents, options3, cancelToken) {
+ this.prepareBuild(documents, options3);
+ await this.runCancelable(documents, DocumentState.Parsed, cancelToken, (doc) => this.langiumDocumentFactory.update(doc, cancelToken));
+ await this.runCancelable(documents, DocumentState.IndexedContent, cancelToken, (doc) => this.indexManager.updateContent(doc, cancelToken));
+ await this.runCancelable(documents, DocumentState.ComputedScopes, cancelToken, async (doc) => {
const scopeComputation = this.serviceRegistry.getServices(doc.uri).references.ScopeComputation;
doc.precomputedScopes = await scopeComputation.computeLocalScopes(doc, cancelToken);
});
- await this.runCancelable(documents2, DocumentState.Linked, cancelToken, (doc) => {
+ await this.runCancelable(documents, DocumentState.Linked, cancelToken, (doc) => {
const linker = this.serviceRegistry.getServices(doc.uri).references.Linker;
return linker.link(doc, cancelToken);
});
- await this.runCancelable(documents2, DocumentState.IndexedReferences, cancelToken, (doc) => this.indexManager.updateReferences(doc, cancelToken));
- const toBeValidated = documents2.filter((doc) => this.shouldValidate(doc));
+ await this.runCancelable(documents, DocumentState.IndexedReferences, cancelToken, (doc) => this.indexManager.updateReferences(doc, cancelToken));
+ const toBeValidated = documents.filter((doc) => this.shouldValidate(doc));
await this.runCancelable(toBeValidated, DocumentState.Validated, cancelToken, (doc) => this.validate(doc, cancelToken));
- for (const doc of documents2) {
- const state5 = this.buildState.get(doc.uri.toString());
- if (state5) {
- state5.completed = true;
+ for (const doc of documents) {
+ const state4 = this.buildState.get(doc.uri.toString());
+ if (state4) {
+ state4.completed = true;
}
}
}
- prepareBuild(documents2, options3) {
- for (const doc of documents2) {
+ /**
+ * Runs prior to beginning the build process to update the {@link DocumentBuildState} for each document
+ *
+ * @param documents collection of documents to be built
+ * @param options the {@link BuildOptions} to use
+ */
+ prepareBuild(documents, options3) {
+ for (const doc of documents) {
const key = doc.uri.toString();
- const state5 = this.buildState.get(key);
- if (!state5 || state5.completed) {
+ const state4 = this.buildState.get(key);
+ if (!state4 || state4.completed) {
this.buildState.set(key, {
completed: false,
options: options3,
- result: state5 === null || state5 === void 0 ? void 0 : state5.result
+ result: state4 === null || state4 === void 0 ? void 0 : state4.result
});
}
}
}
- async runCancelable(documents2, targetState, cancelToken, callback) {
- const filtered = documents2.filter((e3) => e3.state < targetState);
+ /**
+ * Runs a cancelable operation on a set of documents to bring them to a specified {@link DocumentState}.
+ *
+ * @param documents The array of documents to process.
+ * @param targetState The target {@link DocumentState} to bring the documents to.
+ * @param cancelToken A token that can be used to cancel the operation.
+ * @param callback A function to be called for each document.
+ * @returns A promise that resolves when all documents have been processed or the operation is canceled.
+ * @throws Will throw `OperationCancelled` if the operation is canceled via a `CancellationToken`.
+ */
+ async runCancelable(documents, targetState, cancelToken, callback) {
+ const filtered = documents.filter((doc) => doc.state < targetState);
for (const document2 of filtered) {
await interruptAndCheck(cancelToken);
await callback(document2);
document2.state = targetState;
+ await this.notifyDocumentPhase(document2, targetState, cancelToken);
}
- await this.notifyBuildPhase(filtered, targetState, cancelToken);
+ const targetStateDocs = documents.filter((doc) => doc.state === targetState);
+ await this.notifyBuildPhase(targetStateDocs, targetState, cancelToken);
this.currentState = targetState;
}
onBuildPhase(targetState, callback) {
@@ -69703,7 +75424,13 @@ For Further details.`;
this.buildPhaseListeners.delete(targetState, callback);
});
}
- waitUntil(state5, uriOrToken, cancelToken) {
+ onDocumentPhase(targetState, callback) {
+ this.documentPhaseListeners.add(targetState, callback);
+ return Disposable.create(() => {
+ this.documentPhaseListeners.delete(targetState, callback);
+ });
+ }
+ waitUntil(state4, uriOrToken, cancelToken) {
let uri = void 0;
if (uriOrToken && "path" in uriOrToken) {
uri = uriOrToken;
@@ -69713,17 +75440,17 @@ For Further details.`;
cancelToken !== null && cancelToken !== void 0 ? cancelToken : cancelToken = cancellation_exports.CancellationToken.None;
if (uri) {
const document2 = this.langiumDocuments.getDocument(uri);
- if (document2 && document2.state > state5) {
+ if (document2 && document2.state > state4) {
return Promise.resolve(uri);
}
}
- if (this.currentState >= state5) {
+ if (this.currentState >= state4) {
return Promise.resolve(void 0);
} else if (cancelToken.isCancellationRequested) {
return Promise.reject(OperationCancelled);
}
return new Promise((resolve3, reject3) => {
- const buildDisposable = this.onBuildPhase(state5, () => {
+ const buildDisposable = this.onBuildPhase(state4, () => {
buildDisposable.dispose();
cancelDisposable.dispose();
if (uri) {
@@ -69740,14 +75467,28 @@ For Further details.`;
});
});
}
- async notifyBuildPhase(documents2, state5, cancelToken) {
- if (documents2.length === 0) {
+ async notifyDocumentPhase(document2, state4, cancelToken) {
+ const listeners = this.documentPhaseListeners.get(state4);
+ const listenersCopy = listeners.slice();
+ for (const listener of listenersCopy) {
+ try {
+ await listener(document2, cancelToken);
+ } catch (err) {
+ if (!isOperationCancelled(err)) {
+ throw err;
+ }
+ }
+ }
+ }
+ async notifyBuildPhase(documents, state4, cancelToken) {
+ if (documents.length === 0) {
return;
}
- const listeners = this.buildPhaseListeners.get(state5);
- for (const listener of listeners) {
+ const listeners = this.buildPhaseListeners.get(state4);
+ const listenersCopy = listeners.slice();
+ for (const listener of listenersCopy) {
await interruptAndCheck(cancelToken);
- await listener(documents2, cancelToken);
+ await listener(documents, cancelToken);
}
}
/**
@@ -69773,14 +75514,14 @@ For Further details.`;
} else {
document2.diagnostics = diagnostics;
}
- const state5 = this.buildState.get(document2.uri.toString());
- if (state5) {
- (_a = state5.result) !== null && _a !== void 0 ? _a : state5.result = {};
+ const state4 = this.buildState.get(document2.uri.toString());
+ if (state4) {
+ (_a = state4.result) !== null && _a !== void 0 ? _a : state4.result = {};
const newCategories = (_b = options3 === null || options3 === void 0 ? void 0 : options3.categories) !== null && _b !== void 0 ? _b : ValidationCategory.all;
- if (state5.result.validationChecks) {
- state5.result.validationChecks.push(...newCategories);
+ if (state4.result.validationChecks) {
+ state4.result.validationChecks.push(...newCategories);
} else {
- state5.result.validationChecks = [...newCategories];
+ state4.result.validationChecks = [...newCategories];
}
}
}
@@ -69792,10 +75533,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/index-manager.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/index-manager.js
var DefaultIndexManager;
var init_index_manager = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/index-manager.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/index-manager.js"() {
"use strict";
init_ast_utils();
init_caching();
@@ -69826,22 +75567,22 @@ For Further details.`;
});
return stream(result);
}
- allElements(nodeType2, uris) {
+ allElements(nodeType3, uris) {
let documentUris = stream(this.symbolIndex.keys());
if (uris) {
documentUris = documentUris.filter((uri) => !uris || uris.has(uri));
}
- return documentUris.map((uri) => this.getFileDescriptions(uri, nodeType2)).flat();
+ return documentUris.map((uri) => this.getFileDescriptions(uri, nodeType3)).flat();
}
- getFileDescriptions(uri, nodeType2) {
+ getFileDescriptions(uri, nodeType3) {
var _a;
- if (!nodeType2) {
+ if (!nodeType3) {
return (_a = this.symbolIndex.get(uri)) !== null && _a !== void 0 ? _a : [];
}
- const descriptions = this.symbolByTypeIndex.get(uri, nodeType2, () => {
+ const descriptions = this.symbolByTypeIndex.get(uri, nodeType3, () => {
var _a2;
const allFileDescriptions = (_a2 = this.symbolIndex.get(uri)) !== null && _a2 !== void 0 ? _a2 : [];
- return allFileDescriptions.filter((e3) => this.astReflection.isSubtype(e3.type, nodeType2));
+ return allFileDescriptions.filter((e3) => this.astReflection.isSubtype(e3.type, nodeType3));
});
return descriptions;
}
@@ -69874,10 +75615,10 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/workspace-manager.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/workspace-manager.js
var DefaultWorkspaceManager;
var init_workspace_manager = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/workspace-manager.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/workspace-manager.js"() {
"use strict";
init_cancellation();
init_promise_utils();
@@ -69898,6 +75639,9 @@ For Further details.`;
get ready() {
return this._ready.promise;
}
+ get workspaceFolders() {
+ return this.folders;
+ }
initialize(params) {
var _a;
this.folders = (_a = params.workspaceFolders) !== null && _a !== void 0 ? _a : void 0;
@@ -69909,9 +75653,9 @@ For Further details.`;
});
}
async initializeWorkspace(folders, cancelToken = cancellation_exports.CancellationToken.None) {
- const documents2 = await this.performStartup(folders);
+ const documents = await this.performStartup(folders);
await interruptAndCheck(cancelToken);
- await this.documentBuilder.build(documents2, this.initialBuildOptions, cancelToken);
+ await this.documentBuilder.build(documents, this.initialBuildOptions, cancelToken);
}
/**
* Performs the uninterruptable startup sequence of the workspace manager.
@@ -69919,9 +75663,9 @@ For Further details.`;
*/
async performStartup(folders) {
const fileExtensions = this.serviceRegistry.all.flatMap((e3) => e3.LanguageMetaData.fileExtensions);
- const documents2 = [];
+ const documents = [];
const collector = /* @__PURE__ */ __name((document2) => {
- documents2.push(document2);
+ documents.push(document2);
if (!this.langiumDocuments.hasDocument(document2.uri)) {
this.langiumDocuments.addDocument(document2);
}
@@ -69929,7 +75673,7 @@ For Further details.`;
await this.loadAdditionalDocuments(folders, collector);
await Promise.all(folders.map((wf) => [wf, this.getRootFolder(wf)]).map(async (entry) => this.traverseFolder(...entry, fileExtensions, collector)));
this._ready.resolve();
- return documents2;
+ return documents;
}
/**
* Load all additional documents that shall be visible in the context of the given workspace
@@ -69984,7 +75728,7 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/lexer.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/lexer.js
function isTokenTypeArray(tokenVocabulary) {
return Array.isArray(tokenVocabulary) && (tokenVocabulary.length === 0 || "name" in tokenVocabulary[0]);
}
@@ -69994,35 +75738,53 @@ For Further details.`;
function isTokenTypeDictionary(tokenVocabulary) {
return !isTokenTypeArray(tokenVocabulary) && !isIMultiModeLexerDefinition(tokenVocabulary);
}
- var DefaultLexer;
+ var DefaultLexerErrorMessageProvider, DEFAULT_TOKENIZE_OPTIONS, DefaultLexer;
var init_lexer2 = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/lexer.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/lexer.js"() {
"use strict";
init_api5();
+ DefaultLexerErrorMessageProvider = class {
+ static {
+ __name(this, "DefaultLexerErrorMessageProvider");
+ }
+ buildUnexpectedCharactersMessage(fullText, startOffset, length2, line2, column2) {
+ return defaultLexerErrorProvider.buildUnexpectedCharactersMessage(fullText, startOffset, length2, line2, column2);
+ }
+ buildUnableToPopLexerModeMessage(token2) {
+ return defaultLexerErrorProvider.buildUnableToPopLexerModeMessage(token2);
+ }
+ };
+ DEFAULT_TOKENIZE_OPTIONS = { mode: "full" };
DefaultLexer = class {
static {
__name(this, "DefaultLexer");
}
constructor(services) {
- const tokens2 = services.parser.TokenBuilder.buildTokens(services.Grammar, {
+ this.errorMessageProvider = services.parser.LexerErrorMessageProvider;
+ this.tokenBuilder = services.parser.TokenBuilder;
+ const tokens2 = this.tokenBuilder.buildTokens(services.Grammar, {
caseInsensitive: services.LanguageMetaData.caseInsensitive
});
this.tokenTypes = this.toTokenTypeDictionary(tokens2);
const lexerTokens = isTokenTypeDictionary(tokens2) ? Object.values(tokens2) : tokens2;
+ const production = services.LanguageMetaData.mode === "production";
this.chevrotainLexer = new Lexer2(lexerTokens, {
- positionTracking: "full"
+ positionTracking: "full",
+ skipValidations: production,
+ errorMessageProvider: this.errorMessageProvider
});
}
get definition() {
return this.tokenTypes;
}
- tokenize(text2) {
- var _a;
- const chevrotainResult = this.chevrotainLexer.tokenize(text2);
+ tokenize(text4, _options = DEFAULT_TOKENIZE_OPTIONS) {
+ var _a, _b, _c;
+ const chevrotainResult = this.chevrotainLexer.tokenize(text4);
return {
tokens: chevrotainResult.tokens,
errors: chevrotainResult.errors,
- hidden: (_a = chevrotainResult.groups.hidden) !== null && _a !== void 0 ? _a : []
+ hidden: (_a = chevrotainResult.groups.hidden) !== null && _a !== void 0 ? _a : [],
+ report: (_c = (_b = this.tokenBuilder).flushLexingReport) === null || _c === void 0 ? void 0 : _c.call(_b, text4)
};
}
toTokenTypeDictionary(buildTokens) {
@@ -70040,7 +75802,7 @@ For Further details.`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/jsdoc.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/documentation/jsdoc.js
function parseJSDoc(node2, start3, options3) {
let opts;
let position5;
@@ -70363,8 +76125,8 @@ For Further details.`;
return content;
}
}
- function fillNewlines(text2) {
- if (text2.endsWith("\n")) {
+ function fillNewlines(text4) {
+ if (text4.endsWith("\n")) {
return "\n";
} else {
return "\n\n";
@@ -70372,7 +76134,7 @@ For Further details.`;
}
var tagRegex, inlineTagRegex, nonWhitespaceRegex, whitespaceEndRegex, JSDocCommentImpl, JSDocTagImpl, JSDocTextImpl, JSDocLineImpl;
var init_jsdoc = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/jsdoc.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/documentation/jsdoc.js"() {
"use strict";
init_main();
init_regexp_utils();
@@ -70420,8 +76182,8 @@ For Further details.`;
if (value2.length === 0) {
value2 = element3.toString();
} else {
- const text2 = element3.toString();
- value2 += fillNewlines(value2) + text2;
+ const text4 = element3.toString();
+ value2 += fillNewlines(value2) + text4;
}
}
return value2.trim();
@@ -70432,8 +76194,8 @@ For Further details.`;
if (value2.length === 0) {
value2 = element3.toMarkdown(options3);
} else {
- const text2 = element3.toMarkdown(options3);
- value2 += fillNewlines(value2) + text2;
+ const text4 = element3.toMarkdown(options3);
+ value2 += fillNewlines(value2) + text4;
}
}
return value2.trim();
@@ -70450,18 +76212,18 @@ For Further details.`;
this.range = range3;
}
toString() {
- let text2 = `@${this.name}`;
+ let text4 = `@${this.name}`;
const content = this.content.toString();
if (this.content.inlines.length === 1) {
- text2 = `${text2} ${content}`;
+ text4 = `${text4} ${content}`;
} else if (this.content.inlines.length > 1) {
- text2 = `${text2}
+ text4 = `${text4}
${content}`;
}
if (this.inline) {
- return `{${text2}}`;
+ return `{${text4}}`;
} else {
- return text2;
+ return text4;
}
}
toMarkdown(options3) {
@@ -70484,17 +76246,17 @@ ${content}`;
} else if ((options3 === null || options3 === void 0 ? void 0 : options3.tag) === "bold-italic") {
marker = "***";
}
- let text2 = `${marker}@${this.name}${marker}`;
+ let text4 = `${marker}@${this.name}${marker}`;
if (this.content.inlines.length === 1) {
- text2 = `${text2} \u2014 ${content}`;
+ text4 = `${text4} \u2014 ${content}`;
} else if (this.content.inlines.length > 1) {
- text2 = `${text2}
+ text4 = `${text4}
${content}`;
}
if (this.inline) {
- return `{${text2}}`;
+ return `{${text4}}`;
} else {
- return text2;
+ return text4;
}
}
};
@@ -70509,36 +76271,36 @@ ${content}`;
this.range = range3;
}
toString() {
- let text2 = "";
+ let text4 = "";
for (let i2 = 0; i2 < this.inlines.length; i2++) {
const inline2 = this.inlines[i2];
const next3 = this.inlines[i2 + 1];
- text2 += inline2.toString();
+ text4 += inline2.toString();
if (next3 && next3.range.start.line > inline2.range.start.line) {
- text2 += "\n";
+ text4 += "\n";
}
}
- return text2;
+ return text4;
}
toMarkdown(options3) {
- let text2 = "";
+ let text4 = "";
for (let i2 = 0; i2 < this.inlines.length; i2++) {
const inline2 = this.inlines[i2];
const next3 = this.inlines[i2 + 1];
- text2 += inline2.toMarkdown(options3);
+ text4 += inline2.toMarkdown(options3);
if (next3 && next3.range.start.line > inline2.range.start.line) {
- text2 += "\n";
+ text4 += "\n";
}
}
- return text2;
+ return text4;
}
};
JSDocLineImpl = class {
static {
__name(this, "JSDocLineImpl");
}
- constructor(text2, range3) {
- this.text = text2;
+ constructor(text4, range3) {
+ this.text = text4;
this.range = range3;
}
toString() {
@@ -70552,10 +76314,10 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/documentation-provider.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/documentation/documentation-provider.js
var JSDocDocumentationProvider;
var init_documentation_provider = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/documentation-provider.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/documentation/documentation-provider.js"() {
"use strict";
init_ast_utils();
init_jsdoc();
@@ -70622,10 +76384,10 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/comment-provider.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/documentation/comment-provider.js
var DefaultCommentProvider;
var init_comment_provider = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/comment-provider.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/documentation/comment-provider.js"() {
"use strict";
init_json_serializer();
init_cst_utils();
@@ -70647,19 +76409,10 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/event.js
- var event_exports = {};
- var init_event3 = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/event.js"() {
- "use strict";
- __reExport(event_exports, __toESM(require_events(), 1));
- }
- });
-
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/async-parser.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/async-parser.js
var DefaultAsyncParser, AbstractThreadedAsyncParser, ParserWorker;
var init_async_parser = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/async-parser.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/async-parser.js"() {
"use strict";
init_promise_utils();
init_event3();
@@ -70670,8 +76423,8 @@ ${content}`;
constructor(services) {
this.syncParser = services.parser.LangiumParser;
}
- parse(text2) {
- return Promise.resolve(this.syncParser.parse(text2));
+ parse(text4, _cancelToken) {
+ return Promise.resolve(this.syncParser.parse(text4));
}
};
AbstractThreadedAsyncParser = class {
@@ -70700,7 +76453,7 @@ ${content}`;
this.workerPool.push(worker);
}
}
- async parse(text2, cancelToken) {
+ async parse(text4, cancelToken) {
const worker = await this.acquireParserWorker(cancelToken);
const deferred = new Deferred();
let timeout2;
@@ -70709,7 +76462,7 @@ ${content}`;
this.terminateWorker(worker);
}, this.terminationDelay);
});
- worker.parse(text2).then((result) => {
+ worker.parse(text4).then((result) => {
const hydrated = this.hydrator.hydrate(result);
deferred.resolve(hydrated);
}).catch((err) => {
@@ -70786,23 +76539,23 @@ ${content}`;
this._ready = true;
this.onReadyEmitter.fire();
}
- parse(text2) {
+ parse(text4) {
if (this._parsing) {
throw new Error("Parser worker is busy");
}
this._parsing = true;
this.deferred = new Deferred();
- this.sendMessage(text2);
+ this.sendMessage(text4);
return this.deferred.promise;
}
};
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/workspace-lock.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/workspace-lock.js
var DefaultWorkspaceLock;
var init_workspace_lock = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/workspace-lock.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/workspace-lock.js"() {
"use strict";
init_cancellation();
init_promise_utils();
@@ -70818,19 +76571,19 @@ ${content}`;
}
write(action) {
this.cancelWrite();
- const tokenSource = new cancellation_exports.CancellationTokenSource();
+ const tokenSource = startCancelableOperation();
this.previousTokenSource = tokenSource;
return this.enqueue(this.writeQueue, action, tokenSource.token);
}
read(action) {
return this.enqueue(this.readQueue, action);
}
- enqueue(queue, action, cancellationToken) {
+ enqueue(queue, action, cancellationToken = cancellation_exports.CancellationToken.None) {
const deferred = new Deferred();
const entry = {
action,
deferred,
- cancellationToken: cancellationToken !== null && cancellationToken !== void 0 ? cancellationToken : cancellation_exports.CancellationToken.None
+ cancellationToken
};
queue.push(entry);
this.performNextOperation();
@@ -70840,16 +76593,16 @@ ${content}`;
if (!this.done) {
return;
}
- const entries = [];
+ const entries2 = [];
if (this.writeQueue.length > 0) {
- entries.push(this.writeQueue.shift());
+ entries2.push(this.writeQueue.shift());
} else if (this.readQueue.length > 0) {
- entries.push(...this.readQueue.splice(0, this.readQueue.length));
+ entries2.push(...this.readQueue.splice(0, this.readQueue.length));
} else {
return;
}
this.done = false;
- await Promise.all(entries.map(async ({ action, deferred, cancellationToken }) => {
+ await Promise.all(entries2.map(async ({ action, deferred, cancellationToken }) => {
try {
const result = await Promise.resolve().then(() => action(cancellationToken));
deferred.resolve(result);
@@ -70871,10 +76624,10 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/hydrator.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/serializer/hydrator.js
var DefaultHydrator;
var init_hydrator = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/hydrator.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/serializer/hydrator.js"() {
"use strict";
init_cst_node_builder();
init_ast();
@@ -70895,13 +76648,17 @@ ${content}`;
}
dehydrate(result) {
return {
+ lexerErrors: result.lexerErrors,
+ lexerReport: result.lexerReport ? this.dehydrateLexerReport(result.lexerReport) : void 0,
// We need to create shallow copies of the errors
// The original errors inherit from the `Error` class, which is not transferable across worker threads
- lexerErrors: result.lexerErrors.map((e3) => Object.assign({}, e3)),
- parserErrors: result.parserErrors.map((e3) => Object.assign({}, e3)),
+ parserErrors: result.parserErrors.map((e3) => Object.assign(Object.assign({}, e3), { message: e3.message })),
value: this.dehydrateAstNode(result.value, this.createDehyrationContext(result.value))
};
}
+ dehydrateLexerReport(lexerReport) {
+ return lexerReport;
+ }
createDehyrationContext(node2) {
const astNodes = /* @__PURE__ */ new Map();
const cstNodes = /* @__PURE__ */ new Map();
@@ -70990,6 +76747,7 @@ ${content}`;
}
return {
lexerErrors: result.lexerErrors,
+ lexerReport: result.lexerReport,
parserErrors: result.parserErrors,
value: this.hydrateAstNode(node2, context)
};
@@ -71103,27 +76861,26 @@ ${content}`;
return this.lexer.definition[name];
}
getGrammarElementId(node2) {
+ if (!node2) {
+ return void 0;
+ }
if (this.grammarElementIdMap.size === 0) {
this.createGrammarElementIdMap();
}
return this.grammarElementIdMap.get(node2);
}
- getGrammarElement(id27) {
+ getGrammarElement(id29) {
if (this.grammarElementIdMap.size === 0) {
this.createGrammarElementIdMap();
}
- const element3 = this.grammarElementIdMap.getKey(id27);
- if (element3) {
- return element3;
- } else {
- throw new Error("Invalid grammar element id: " + id27);
- }
+ const element3 = this.grammarElementIdMap.getKey(id29);
+ return element3;
}
createGrammarElementIdMap() {
- let id27 = 0;
+ let id29 = 0;
for (const element3 of streamAst(this.grammar)) {
if (isAbstractElement(element3)) {
- this.grammarElementIdMap.set(element3, id27++);
+ this.grammarElementIdMap.set(element3, id29++);
}
}
}
@@ -71131,7 +76888,7 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/default-module.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/default-module.js
function createDefaultCoreModule(context) {
return {
documentation: {
@@ -71146,7 +76903,8 @@ ${content}`;
ValueConverter: /* @__PURE__ */ __name(() => new DefaultValueConverter(), "ValueConverter"),
TokenBuilder: /* @__PURE__ */ __name(() => new DefaultTokenBuilder(), "TokenBuilder"),
Lexer: /* @__PURE__ */ __name((services) => new DefaultLexer(services), "Lexer"),
- ParserErrorMessageProvider: /* @__PURE__ */ __name(() => new LangiumParserErrorMessageProvider(), "ParserErrorMessageProvider")
+ ParserErrorMessageProvider: /* @__PURE__ */ __name(() => new LangiumParserErrorMessageProvider(), "ParserErrorMessageProvider"),
+ LexerErrorMessageProvider: /* @__PURE__ */ __name(() => new DefaultLexerErrorMessageProvider(), "LexerErrorMessageProvider")
},
workspace: {
AstNodeLocator: /* @__PURE__ */ __name(() => new DefaultAstNodeLocator(), "AstNodeLocator"),
@@ -71173,7 +76931,7 @@ ${content}`;
}
function createDefaultSharedCoreModule(context) {
return {
- ServiceRegistry: /* @__PURE__ */ __name(() => new DefaultServiceRegistry(), "ServiceRegistry"),
+ ServiceRegistry: /* @__PURE__ */ __name((services) => new DefaultServiceRegistry(services), "ServiceRegistry"),
workspace: {
LangiumDocuments: /* @__PURE__ */ __name((services) => new DefaultLangiumDocuments(services), "LangiumDocuments"),
LangiumDocumentFactory: /* @__PURE__ */ __name((services) => new DefaultLangiumDocumentFactory(services), "LangiumDocumentFactory"),
@@ -71187,7 +76945,7 @@ ${content}`;
};
}
var init_default_module = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/default-module.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/default-module.js"() {
"use strict";
init_grammar_config();
init_completion_parser_builder();
@@ -71222,7 +76980,7 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/dependency-injection.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/dependency-injection.js
function inject(module1, module2, module3, module4, module5, module6, module7, module8, module9) {
const module10 = [module1, module2, module3, module4, module5, module6, module7, module8, module9].reduce(_merge, {});
return _inject(module10);
@@ -71238,13 +76996,23 @@ ${content}`;
function _inject(module2, injector) {
const proxy = new Proxy({}, {
deleteProperty: /* @__PURE__ */ __name(() => false, "deleteProperty"),
- get: /* @__PURE__ */ __name((obj, prop) => _resolve(obj, prop, module2, injector || proxy), "get"),
+ set: /* @__PURE__ */ __name(() => {
+ throw new Error("Cannot set property on injected service container");
+ }, "set"),
+ get: /* @__PURE__ */ __name((obj, prop) => {
+ if (prop === isProxy) {
+ return true;
+ } else {
+ return _resolve(obj, prop, module2, injector || proxy);
+ }
+ }, "get"),
getOwnPropertyDescriptor: /* @__PURE__ */ __name((obj, prop) => (_resolve(obj, prop, module2, injector || proxy), Object.getOwnPropertyDescriptor(obj, prop)), "getOwnPropertyDescriptor"),
+ // used by for..in
has: /* @__PURE__ */ __name((_2, prop) => prop in module2, "has"),
- ownKeys: /* @__PURE__ */ __name(() => [...Reflect.ownKeys(module2), isProxy], "ownKeys")
+ // used by ..in..
+ ownKeys: /* @__PURE__ */ __name(() => [...Object.getOwnPropertyNames(module2)], "ownKeys")
// used by for..in
});
- proxy[isProxy] = true;
return proxy;
}
function _resolve(obj, prop, module2, injector) {
@@ -71253,7 +77021,7 @@ ${content}`;
throw new Error("Construction failure. Please make sure that your dependencies are constructable.", { cause: obj[prop] });
}
if (obj[prop] === __requested__) {
- throw new Error('Cycle detected. Please make "' + String(prop) + '" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');
+ throw new Error('Cycle detected. Please make "' + String(prop) + '" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');
}
return obj[prop];
} else if (prop in module2) {
@@ -71287,7 +77055,7 @@ ${content}`;
}
var Module, isProxy, __requested__;
var init_dependency_injection = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/dependency-injection.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/dependency-injection.js"() {
"use strict";
(function(Module2) {
Module2.merge = (m1, m2) => _merge(_merge({}, m1), m2);
@@ -71302,16 +77070,16 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/services.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/services.js
var init_services = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/services.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/services.js"() {
"use strict";
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/documentation/index.js
var init_documentation = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/documentation/index.js"() {
"use strict";
init_comment_provider();
init_documentation_provider();
@@ -71319,48 +77087,327 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/language-meta-data.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/languages/language-meta-data.js
var init_language_meta_data = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/language-meta-data.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/languages/language-meta-data.js"() {
"use strict";
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/languages/index.js
var init_languages = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/languages/index.js"() {
"use strict";
init_grammar_config();
init_language_meta_data();
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-config.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/indentation-aware.js
+ var indentationBuilderDefaultOptions, LexingMode, IndentationAwareTokenBuilder, IndentationAwareLexer;
+ var init_indentation_aware = __esm({
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/indentation-aware.js"() {
+ "use strict";
+ init_api5();
+ init_token_builder();
+ init_lexer2();
+ indentationBuilderDefaultOptions = {
+ indentTokenName: "INDENT",
+ dedentTokenName: "DEDENT",
+ whitespaceTokenName: "WS",
+ ignoreIndentationDelimiters: []
+ };
+ (function(LexingMode2) {
+ LexingMode2["REGULAR"] = "indentation-sensitive";
+ LexingMode2["IGNORE_INDENTATION"] = "ignore-indentation";
+ })(LexingMode || (LexingMode = {}));
+ IndentationAwareTokenBuilder = class extends DefaultTokenBuilder {
+ static {
+ __name(this, "IndentationAwareTokenBuilder");
+ }
+ constructor(options3 = indentationBuilderDefaultOptions) {
+ super();
+ this.indentationStack = [0];
+ this.whitespaceRegExp = /[ \t]+/y;
+ this.options = Object.assign(Object.assign({}, indentationBuilderDefaultOptions), options3);
+ this.indentTokenType = createToken({
+ name: this.options.indentTokenName,
+ pattern: this.indentMatcher.bind(this),
+ line_breaks: false
+ });
+ this.dedentTokenType = createToken({
+ name: this.options.dedentTokenName,
+ pattern: this.dedentMatcher.bind(this),
+ line_breaks: false
+ });
+ }
+ buildTokens(grammar, options3) {
+ const tokenTypes = super.buildTokens(grammar, options3);
+ if (!isTokenTypeArray(tokenTypes)) {
+ throw new Error("Invalid tokens built by default builder");
+ }
+ const { indentTokenName, dedentTokenName, whitespaceTokenName, ignoreIndentationDelimiters } = this.options;
+ let dedent2;
+ let indent;
+ let ws;
+ const otherTokens = [];
+ for (const tokenType of tokenTypes) {
+ for (const [begin, end2] of ignoreIndentationDelimiters) {
+ if (tokenType.name === begin) {
+ tokenType.PUSH_MODE = LexingMode.IGNORE_INDENTATION;
+ } else if (tokenType.name === end2) {
+ tokenType.POP_MODE = true;
+ }
+ }
+ if (tokenType.name === dedentTokenName) {
+ dedent2 = tokenType;
+ } else if (tokenType.name === indentTokenName) {
+ indent = tokenType;
+ } else if (tokenType.name === whitespaceTokenName) {
+ ws = tokenType;
+ } else {
+ otherTokens.push(tokenType);
+ }
+ }
+ if (!dedent2 || !indent || !ws) {
+ throw new Error("Some indentation/whitespace tokens not found!");
+ }
+ if (ignoreIndentationDelimiters.length > 0) {
+ const multiModeLexerDef = {
+ modes: {
+ [LexingMode.REGULAR]: [dedent2, indent, ...otherTokens, ws],
+ [LexingMode.IGNORE_INDENTATION]: [...otherTokens, ws]
+ },
+ defaultMode: LexingMode.REGULAR
+ };
+ return multiModeLexerDef;
+ } else {
+ return [dedent2, indent, ws, ...otherTokens];
+ }
+ }
+ flushLexingReport(text4) {
+ const result = super.flushLexingReport(text4);
+ return Object.assign(Object.assign({}, result), { remainingDedents: this.flushRemainingDedents(text4) });
+ }
+ /**
+ * Helper function to check if the current position is the start of a new line.
+ *
+ * @param text The full input string.
+ * @param offset The current position at which to check
+ * @returns Whether the current position is the start of a new line
+ */
+ isStartOfLine(text4, offset) {
+ return offset === 0 || "\r\n".includes(text4[offset - 1]);
+ }
+ /**
+ * A helper function used in matching both indents and dedents.
+ *
+ * @param text The full input string.
+ * @param offset The current position at which to attempt a match
+ * @param tokens Previously scanned tokens
+ * @param groups Token Groups
+ * @returns The current and previous indentation levels and the matched whitespace
+ */
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ matchWhitespace(text4, offset, tokens2, groups) {
+ var _a;
+ this.whitespaceRegExp.lastIndex = offset;
+ const match2 = this.whitespaceRegExp.exec(text4);
+ return {
+ currIndentLevel: (_a = match2 === null || match2 === void 0 ? void 0 : match2[0].length) !== null && _a !== void 0 ? _a : 0,
+ prevIndentLevel: this.indentationStack.at(-1),
+ match: match2
+ };
+ }
+ /**
+ * Helper function to create an instance of an indentation token.
+ *
+ * @param tokenType Indent or dedent token type
+ * @param text Full input string, used to calculate the line number
+ * @param image The original image of the token (tabs or spaces)
+ * @param offset Current position in the input string
+ * @returns The indentation token instance
+ */
+ createIndentationTokenInstance(tokenType, text4, image, offset) {
+ const lineNumber = this.getLineNumber(text4, offset);
+ return createTokenInstance(tokenType, image, offset, offset + image.length, lineNumber, lineNumber, 1, image.length);
+ }
+ /**
+ * Helper function to get the line number at a given offset.
+ *
+ * @param text Full input string, used to calculate the line number
+ * @param offset Current position in the input string
+ * @returns The line number at the given offset
+ */
+ getLineNumber(text4, offset) {
+ return text4.substring(0, offset).split(/\r\n|\r|\n/).length;
+ }
+ /**
+ * A custom pattern for matching indents
+ *
+ * @param text The full input string.
+ * @param offset The offset at which to attempt a match
+ * @param tokens Previously scanned tokens
+ * @param groups Token Groups
+ */
+ indentMatcher(text4, offset, tokens2, groups) {
+ if (!this.isStartOfLine(text4, offset)) {
+ return null;
+ }
+ const { currIndentLevel, prevIndentLevel, match: match2 } = this.matchWhitespace(text4, offset, tokens2, groups);
+ if (currIndentLevel <= prevIndentLevel) {
+ return null;
+ }
+ this.indentationStack.push(currIndentLevel);
+ return match2;
+ }
+ /**
+ * A custom pattern for matching dedents
+ *
+ * @param text The full input string.
+ * @param offset The offset at which to attempt a match
+ * @param tokens Previously scanned tokens
+ * @param groups Token Groups
+ */
+ dedentMatcher(text4, offset, tokens2, groups) {
+ var _a, _b, _c, _d;
+ if (!this.isStartOfLine(text4, offset)) {
+ return null;
+ }
+ const { currIndentLevel, prevIndentLevel, match: match2 } = this.matchWhitespace(text4, offset, tokens2, groups);
+ if (currIndentLevel >= prevIndentLevel) {
+ return null;
+ }
+ const matchIndentIndex = this.indentationStack.lastIndexOf(currIndentLevel);
+ if (matchIndentIndex === -1) {
+ this.diagnostics.push({
+ severity: "error",
+ message: `Invalid dedent level ${currIndentLevel} at offset: ${offset}. Current indentation stack: ${this.indentationStack}`,
+ offset,
+ length: (_b = (_a = match2 === null || match2 === void 0 ? void 0 : match2[0]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0,
+ line: this.getLineNumber(text4, offset),
+ column: 1
+ });
+ return null;
+ }
+ const numberOfDedents = this.indentationStack.length - matchIndentIndex - 1;
+ const newlinesBeforeDedent = (_d = (_c = text4.substring(0, offset).match(/[\r\n]+$/)) === null || _c === void 0 ? void 0 : _c[0].length) !== null && _d !== void 0 ? _d : 1;
+ for (let i2 = 0; i2 < numberOfDedents; i2++) {
+ const token2 = this.createIndentationTokenInstance(
+ this.dedentTokenType,
+ text4,
+ "",
+ // Dedents are 0-width tokens
+ offset - (newlinesBeforeDedent - 1)
+ );
+ tokens2.push(token2);
+ this.indentationStack.pop();
+ }
+ return null;
+ }
+ buildTerminalToken(terminal) {
+ const tokenType = super.buildTerminalToken(terminal);
+ const { indentTokenName, dedentTokenName, whitespaceTokenName } = this.options;
+ if (tokenType.name === indentTokenName) {
+ return this.indentTokenType;
+ } else if (tokenType.name === dedentTokenName) {
+ return this.dedentTokenType;
+ } else if (tokenType.name === whitespaceTokenName) {
+ return createToken({
+ name: whitespaceTokenName,
+ pattern: this.whitespaceRegExp,
+ group: Lexer2.SKIPPED
+ });
+ }
+ return tokenType;
+ }
+ /**
+ * Resets the indentation stack between different runs of the lexer
+ *
+ * @param text Full text that was tokenized
+ * @returns Remaining dedent tokens to match all previous indents at the end of the file
+ */
+ flushRemainingDedents(text4) {
+ const remainingDedents = [];
+ while (this.indentationStack.length > 1) {
+ remainingDedents.push(this.createIndentationTokenInstance(this.dedentTokenType, text4, "", text4.length));
+ this.indentationStack.pop();
+ }
+ this.indentationStack = [0];
+ return remainingDedents;
+ }
+ };
+ IndentationAwareLexer = class extends DefaultLexer {
+ static {
+ __name(this, "IndentationAwareLexer");
+ }
+ constructor(services) {
+ super(services);
+ if (services.parser.TokenBuilder instanceof IndentationAwareTokenBuilder) {
+ this.indentationTokenBuilder = services.parser.TokenBuilder;
+ } else {
+ throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder");
+ }
+ }
+ tokenize(text4, options3 = DEFAULT_TOKENIZE_OPTIONS) {
+ const result = super.tokenize(text4);
+ const report = result.report;
+ if ((options3 === null || options3 === void 0 ? void 0 : options3.mode) === "full") {
+ result.tokens.push(...report.remainingDedents);
+ }
+ report.remainingDedents = [];
+ const { indentTokenType, dedentTokenType } = this.indentationTokenBuilder;
+ const indentTokenIdx = indentTokenType.tokenTypeIdx;
+ const dedentTokenIdx = dedentTokenType.tokenTypeIdx;
+ const cleanTokens = [];
+ const length2 = result.tokens.length - 1;
+ for (let i2 = 0; i2 < length2; i2++) {
+ const token2 = result.tokens[i2];
+ const nextToken = result.tokens[i2 + 1];
+ if (token2.tokenTypeIdx === indentTokenIdx && nextToken.tokenTypeIdx === dedentTokenIdx) {
+ i2++;
+ continue;
+ }
+ cleanTokens.push(token2);
+ }
+ if (length2 >= 0) {
+ cleanTokens.push(result.tokens[length2]);
+ }
+ result.tokens = cleanTokens;
+ return result;
+ }
+ };
+ }
+ });
+
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/parser-config.js
var init_parser_config = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-config.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/parser-config.js"() {
"use strict";
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/index.js
var init_parser2 = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/parser/index.js"() {
"use strict";
init_async_parser();
init_completion_parser_builder();
init_cst_node_builder();
+ init_indentation_aware();
init_langium_parser_builder();
init_langium_parser();
init_lexer2();
+ init_parser_builder_base();
init_parser_config();
init_token_builder();
init_value_converter();
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/index.js
var init_references2 = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/references/index.js"() {
"use strict";
init_linker();
init_name_provider();
@@ -71371,19 +77418,19 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/serializer/index.js
var init_serializer = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/serializer/index.js"() {
"use strict";
init_hydrator();
init_json_serializer();
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/file-system-provider.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/file-system-provider.js
var EmptyFileSystemProvider, EmptyFileSystem;
var init_file_system_provider = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/file-system-provider.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/file-system-provider.js"() {
"use strict";
EmptyFileSystemProvider = class {
static {
@@ -71402,7 +77449,7 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/grammar-loader.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/grammar-loader.js
function createMinimalGrammarServices() {
const shared = inject(createDefaultSharedCoreModule(EmptyFileSystem), minimalSharedGrammarModule);
const grammar = inject(createDefaultCoreModule({ shared }), minimalGrammarModule);
@@ -71418,7 +77465,7 @@ ${content}`;
}
var minimalGrammarModule, minimalSharedGrammarModule;
var init_grammar_loader = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/grammar-loader.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/grammar-loader.js"() {
"use strict";
init_default_module();
init_dependency_injection();
@@ -71441,7 +77488,7 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/index.js
var utils_exports = {};
__export(utils_exports, {
AstUtils: () => ast_utils_exports,
@@ -71477,7 +77524,7 @@ ${content}`;
stream: () => stream
});
var init_utils4 = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/utils/index.js"() {
"use strict";
init_caching();
init_event3();
@@ -71497,18 +77544,18 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/validation/index.js
var init_validation = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/validation/index.js"() {
"use strict";
init_document_validator();
init_validation_registry();
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/index.js
var init_workspace = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/workspace/index.js"() {
"use strict";
init_ast_descriptions();
init_ast_node_locator();
@@ -71522,7 +77569,7 @@ ${content}`;
}
});
- // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/index.js
+ // ../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/index.js
var lib_exports = {};
__export(lib_exports, {
AbstractAstReflection: () => AbstractAstReflection,
@@ -71537,6 +77584,7 @@ ${content}`;
ContextCache: () => ContextCache,
CstNodeBuilder: () => CstNodeBuilder,
CstUtils: () => cst_utils_exports,
+ DEFAULT_TOKENIZE_OPTIONS: () => DEFAULT_TOKENIZE_OPTIONS,
DONE_RESULT: () => DONE_RESULT,
DatatypeSymbol: () => DatatypeSymbol,
DefaultAstNodeDescriptionProvider: () => DefaultAstNodeDescriptionProvider,
@@ -71552,6 +77600,7 @@ ${content}`;
DefaultLangiumDocumentFactory: () => DefaultLangiumDocumentFactory,
DefaultLangiumDocuments: () => DefaultLangiumDocuments,
DefaultLexer: () => DefaultLexer,
+ DefaultLexerErrorMessageProvider: () => DefaultLexerErrorMessageProvider,
DefaultLinker: () => DefaultLinker,
DefaultNameProvider: () => DefaultNameProvider,
DefaultReferenceDescriptionProvider: () => DefaultReferenceDescriptionProvider,
@@ -71576,11 +77625,14 @@ ${content}`;
ErrorWithLocation: () => ErrorWithLocation,
GrammarAST: () => ast_exports,
GrammarUtils: () => grammar_utils_exports,
+ IndentationAwareLexer: () => IndentationAwareLexer,
+ IndentationAwareTokenBuilder: () => IndentationAwareTokenBuilder,
JSDocDocumentationProvider: () => JSDocDocumentationProvider,
LangiumCompletionParser: () => LangiumCompletionParser,
LangiumParser: () => LangiumParser,
LangiumParserErrorMessageProvider: () => LangiumParserErrorMessageProvider,
LeafCstNodeImpl: () => LeafCstNodeImpl,
+ LexingMode: () => LexingMode,
MapScope: () => MapScope,
Module: () => Module,
MultiMap: () => MultiMap,
@@ -71606,10 +77658,12 @@ ${content}`;
createDefaultSharedCoreModule: () => createDefaultSharedCoreModule,
createGrammarConfig: () => createGrammarConfig,
createLangiumParser: () => createLangiumParser,
+ createParser: () => createParser,
delayNextTick: () => delayNextTick,
diagnosticData: () => diagnosticData,
eagerLoad: () => eagerLoad,
getDiagnosticRange: () => getDiagnosticRange,
+ indentationBuilderDefaultOptions: () => indentationBuilderDefaultOptions,
inject: () => inject,
interruptAndCheck: () => interruptAndCheck,
isAstNode: () => isAstNode,
@@ -71632,10 +77686,11 @@ ${content}`;
setInterruptionPeriod: () => setInterruptionPeriod,
startCancelableOperation: () => startCancelableOperation,
stream: () => stream,
+ toDiagnosticData: () => toDiagnosticData,
toDiagnosticSeverity: () => toDiagnosticSeverity
});
var init_lib3 = __esm({
- "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/index.js"() {
+ "../../node_modules/.pnpm/langium@3.3.1/node_modules/langium/lib/index.js"() {
"use strict";
init_default_module();
init_dependency_injection();
@@ -71655,7 +77710,7 @@ ${content}`;
}
});
- // ../parser/dist/chunks/mermaid-parser.core/chunk-Y27MQZ3U.mjs
+ // ../parser/dist/chunks/mermaid-parser.core/chunk-7PKI6E2E.mjs
function isArchitecture(item) {
return reflection2.isInstance(item, Architecture);
}
@@ -71689,9 +77744,9 @@ ${content}`;
function isPieSection(item) {
return reflection2.isInstance(item, PieSection);
}
- var __defProp2, __name2, Statement, Architecture, Branch, Checkout, CherryPicking, Commit, Common, GitGraph, Info, Merge, Packet, PacketBlock, Pie, PieSection, Direction, MermaidAstReflection, reflection2, loadedInfoGrammar, InfoGrammar, loadedPacketGrammar, PacketGrammar, loadedPieGrammar, PieGrammar, loadedArchitectureGrammar, ArchitectureGrammar, loadedGitGraphGrammar, GitGraphGrammar, InfoLanguageMetaData, PacketLanguageMetaData, PieLanguageMetaData, ArchitectureLanguageMetaData, GitGraphLanguageMetaData, MermaidGeneratedSharedModule, InfoGeneratedModule, PacketGeneratedModule, PieGeneratedModule, ArchitectureGeneratedModule, GitGraphGeneratedModule, accessibilityDescrRegex, accessibilityTitleRegex, titleRegex, rulesRegexes, AbstractMermaidValueConverter, CommonValueConverter, AbstractMermaidTokenBuilder, CommonTokenBuilder;
- var init_chunk_Y27MQZ3U = __esm({
- "../parser/dist/chunks/mermaid-parser.core/chunk-Y27MQZ3U.mjs"() {
+ var __defProp2, __name2, Statement, Architecture, Axis, Branch, Checkout, CherryPicking, Commit, Common, Curve, Edge, Entry, GitGraph, Group2, Info, Junction, Merge, Option3, Packet, PacketBlock, Pie, PieSection, Radar, Service, Direction, MermaidAstReflection, reflection2, loadedInfoGrammar, InfoGrammar, loadedPacketGrammar, PacketGrammar, loadedPieGrammar, PieGrammar, loadedArchitectureGrammar, ArchitectureGrammar, loadedGitGraphGrammar, GitGraphGrammar, loadedRadarGrammar, RadarGrammar, InfoLanguageMetaData, PacketLanguageMetaData, PieLanguageMetaData, ArchitectureLanguageMetaData, GitGraphLanguageMetaData, RadarLanguageMetaData, MermaidGeneratedSharedModule, InfoGeneratedModule, PacketGeneratedModule, PieGeneratedModule, ArchitectureGeneratedModule, GitGraphGeneratedModule, RadarGeneratedModule, accessibilityDescrRegex, accessibilityTitleRegex, titleRegex, rulesRegexes, AbstractMermaidValueConverter, CommonValueConverter, AbstractMermaidTokenBuilder, CommonTokenBuilder;
+ var init_chunk_7PKI6E2E = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/chunk-7PKI6E2E.mjs"() {
"use strict";
init_lib3();
init_lib3();
@@ -71703,6 +77758,7 @@ ${content}`;
Architecture = "Architecture";
__name(isArchitecture, "isArchitecture");
__name2(isArchitecture, "isArchitecture");
+ Axis = "Axis";
Branch = "Branch";
__name(isBranch, "isBranch");
__name2(isBranch, "isBranch");
@@ -71714,15 +77770,21 @@ ${content}`;
Common = "Common";
__name(isCommon, "isCommon");
__name2(isCommon, "isCommon");
+ Curve = "Curve";
+ Edge = "Edge";
+ Entry = "Entry";
GitGraph = "GitGraph";
__name(isGitGraph, "isGitGraph");
__name2(isGitGraph, "isGitGraph");
+ Group2 = "Group";
Info = "Info";
__name(isInfo, "isInfo");
__name2(isInfo, "isInfo");
+ Junction = "Junction";
Merge = "Merge";
__name(isMerge, "isMerge");
__name2(isMerge, "isMerge");
+ Option3 = "Option";
Packet = "Packet";
__name(isPacket, "isPacket");
__name2(isPacket, "isPacket");
@@ -71735,6 +77797,8 @@ ${content}`;
PieSection = "PieSection";
__name(isPieSection, "isPieSection");
__name2(isPieSection, "isPieSection");
+ Radar = "Radar";
+ Service = "Service";
Direction = "Direction";
MermaidAstReflection = class extends AbstractAstReflection {
static {
@@ -71744,7 +77808,7 @@ ${content}`;
__name2(this, "MermaidAstReflection");
}
getAllTypes() {
- return ["Architecture", "Branch", "Checkout", "CherryPicking", "Commit", "Common", "Direction", "Edge", "GitGraph", "Group", "Info", "Junction", "Merge", "Packet", "PacketBlock", "Pie", "PieSection", "Service", "Statement"];
+ return [Architecture, Axis, Branch, Checkout, CherryPicking, Commit, Common, Curve, Direction, Edge, Entry, GitGraph, Group2, Info, Junction, Merge, Option3, Packet, PacketBlock, Pie, PieSection, Radar, Service, Statement];
}
computeIsSubtype(subtype, supertype) {
switch (subtype) {
@@ -71766,6 +77830,9 @@ ${content}`;
getReferenceType(refInfo) {
const referenceId = `${refInfo.container.$type}:${refInfo.property}`;
switch (referenceId) {
+ case "Entry:axis": {
+ return Axis;
+ }
default: {
throw new Error(`${referenceId} is not a valid reference id.`);
}
@@ -71773,9 +77840,9 @@ ${content}`;
}
getTypeMetaData(type3) {
switch (type3) {
- case "Architecture": {
+ case Architecture: {
return {
- name: "Architecture",
+ name: Architecture,
properties: [
{ name: "accDescr" },
{ name: "accTitle" },
@@ -71787,26 +77854,35 @@ ${content}`;
]
};
}
- case "Branch": {
+ case Axis: {
+ return {
+ name: Axis,
+ properties: [
+ { name: "label" },
+ { name: "name" }
+ ]
+ };
+ }
+ case Branch: {
return {
- name: "Branch",
+ name: Branch,
properties: [
{ name: "name" },
{ name: "order" }
]
};
}
- case "Checkout": {
+ case Checkout: {
return {
- name: "Checkout",
+ name: Checkout,
properties: [
{ name: "branch" }
]
};
}
- case "CherryPicking": {
+ case CherryPicking: {
return {
- name: "CherryPicking",
+ name: CherryPicking,
properties: [
{ name: "id" },
{ name: "parent" },
@@ -71814,9 +77890,9 @@ ${content}`;
]
};
}
- case "Commit": {
+ case Commit: {
return {
- name: "Commit",
+ name: Commit,
properties: [
{ name: "id" },
{ name: "message" },
@@ -71825,9 +77901,9 @@ ${content}`;
]
};
}
- case "Common": {
+ case Common: {
return {
- name: "Common",
+ name: Common,
properties: [
{ name: "accDescr" },
{ name: "accTitle" },
@@ -71835,9 +77911,19 @@ ${content}`;
]
};
}
- case "Edge": {
+ case Curve: {
return {
- name: "Edge",
+ name: Curve,
+ properties: [
+ { name: "entries", defaultValue: [] },
+ { name: "label" },
+ { name: "name" }
+ ]
+ };
+ }
+ case Edge: {
+ return {
+ name: Edge,
properties: [
{ name: "lhsDir" },
{ name: "lhsGroup", defaultValue: false },
@@ -71851,9 +77937,18 @@ ${content}`;
]
};
}
- case "GitGraph": {
+ case Entry: {
return {
- name: "GitGraph",
+ name: Entry,
+ properties: [
+ { name: "axis" },
+ { name: "value" }
+ ]
+ };
+ }
+ case GitGraph: {
+ return {
+ name: GitGraph,
properties: [
{ name: "accDescr" },
{ name: "accTitle" },
@@ -71862,9 +77957,9 @@ ${content}`;
]
};
}
- case "Group": {
+ case Group2: {
return {
- name: "Group",
+ name: Group2,
properties: [
{ name: "icon" },
{ name: "id" },
@@ -71873,9 +77968,9 @@ ${content}`;
]
};
}
- case "Info": {
+ case Info: {
return {
- name: "Info",
+ name: Info,
properties: [
{ name: "accDescr" },
{ name: "accTitle" },
@@ -71883,18 +77978,18 @@ ${content}`;
]
};
}
- case "Junction": {
+ case Junction: {
return {
- name: "Junction",
+ name: Junction,
properties: [
{ name: "id" },
{ name: "in" }
]
};
}
- case "Merge": {
+ case Merge: {
return {
- name: "Merge",
+ name: Merge,
properties: [
{ name: "branch" },
{ name: "id" },
@@ -71903,9 +77998,18 @@ ${content}`;
]
};
}
- case "Packet": {
+ case Option3: {
return {
- name: "Packet",
+ name: Option3,
+ properties: [
+ { name: "name" },
+ { name: "value", defaultValue: false }
+ ]
+ };
+ }
+ case Packet: {
+ return {
+ name: Packet,
properties: [
{ name: "accDescr" },
{ name: "accTitle" },
@@ -71914,9 +78018,9 @@ ${content}`;
]
};
}
- case "PacketBlock": {
+ case PacketBlock: {
return {
- name: "PacketBlock",
+ name: PacketBlock,
properties: [
{ name: "end" },
{ name: "label" },
@@ -71924,9 +78028,9 @@ ${content}`;
]
};
}
- case "Pie": {
+ case Pie: {
return {
- name: "Pie",
+ name: Pie,
properties: [
{ name: "accDescr" },
{ name: "accTitle" },
@@ -71936,18 +78040,31 @@ ${content}`;
]
};
}
- case "PieSection": {
+ case PieSection: {
return {
- name: "PieSection",
+ name: PieSection,
properties: [
{ name: "label" },
{ name: "value" }
]
};
}
- case "Service": {
+ case Radar: {
+ return {
+ name: Radar,
+ properties: [
+ { name: "accDescr" },
+ { name: "accTitle" },
+ { name: "axes", defaultValue: [] },
+ { name: "curves", defaultValue: [] },
+ { name: "options", defaultValue: [] },
+ { name: "title" }
+ ]
+ };
+ }
+ case Service: {
return {
- name: "Service",
+ name: Service,
properties: [
{ name: "icon" },
{ name: "iconText" },
@@ -71957,9 +78074,9 @@ ${content}`;
]
};
}
- case "Direction": {
+ case Direction: {
return {
- name: "Direction",
+ name: Direction,
properties: [
{ name: "accDescr" },
{ name: "accTitle" },
@@ -71979,35 +78096,47 @@ ${content}`;
}
};
reflection2 = new MermaidAstReflection();
- InfoGrammar = /* @__PURE__ */ __name2(() => loadedInfoGrammar ?? (loadedInfoGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","name":"Info","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "InfoGrammar");
- PacketGrammar = /* @__PURE__ */ __name2(() => loadedPacketGrammar ?? (loadedPacketGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","name":"Packet","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}`)), "PacketGrammar");
- PieGrammar = /* @__PURE__ */ __name2(() => loadedPieGrammar ?? (loadedPieGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","name":"Pie","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "PieGrammar");
- ArchitectureGrammar = /* @__PURE__ */ __name2(() => loadedArchitectureGrammar ?? (loadedArchitectureGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","name":"Architecture","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LeftPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RightPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Arrow","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "ArchitectureGrammar");
- GitGraphGrammar = /* @__PURE__ */ __name2(() => loadedGitGraphGrammar ?? (loadedGitGraphGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","name":"GitGraph","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)), "GitGraphGrammar");
+ InfoGrammar = /* @__PURE__ */ __name2(() => loadedInfoGrammar ?? (loadedInfoGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "InfoGrammar");
+ PacketGrammar = /* @__PURE__ */ __name2(() => loadedPacketGrammar ?? (loadedPacketGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}`)), "PacketGrammar");
+ PieGrammar = /* @__PURE__ */ __name2(() => loadedPieGrammar ?? (loadedPieGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "PieGrammar");
+ ArchitectureGrammar = /* @__PURE__ */ __name2(() => loadedArchitectureGrammar ?? (loadedArchitectureGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "ArchitectureGrammar");
+ GitGraphGrammar = /* @__PURE__ */ __name2(() => loadedGitGraphGrammar ?? (loadedGitGraphGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)), "GitGraphGrammar");
+ RadarGrammar = /* @__PURE__ */ __name2(() => loadedRadarGrammar ?? (loadedRadarGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"Radar","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@12"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@12"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9\\\\-_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)), "RadarGrammar");
InfoLanguageMetaData = {
languageId: "info",
fileExtensions: [".mmd", ".mermaid"],
- caseInsensitive: false
+ caseInsensitive: false,
+ mode: "production"
};
PacketLanguageMetaData = {
languageId: "packet",
fileExtensions: [".mmd", ".mermaid"],
- caseInsensitive: false
+ caseInsensitive: false,
+ mode: "production"
};
PieLanguageMetaData = {
languageId: "pie",
fileExtensions: [".mmd", ".mermaid"],
- caseInsensitive: false
+ caseInsensitive: false,
+ mode: "production"
};
ArchitectureLanguageMetaData = {
languageId: "architecture",
fileExtensions: [".mmd", ".mermaid"],
- caseInsensitive: false
+ caseInsensitive: false,
+ mode: "production"
};
GitGraphLanguageMetaData = {
languageId: "gitGraph",
fileExtensions: [".mmd", ".mermaid"],
- caseInsensitive: false
+ caseInsensitive: false,
+ mode: "production"
+ };
+ RadarLanguageMetaData = {
+ languageId: "radar",
+ fileExtensions: [".mmd", ".mermaid"],
+ caseInsensitive: false,
+ mode: "production"
};
MermaidGeneratedSharedModule = {
AstReflection: /* @__PURE__ */ __name2(() => new MermaidAstReflection(), "AstReflection")
@@ -72037,6 +78166,11 @@ ${content}`;
LanguageMetaData: /* @__PURE__ */ __name2(() => GitGraphLanguageMetaData, "LanguageMetaData"),
parser: {}
};
+ RadarGeneratedModule = {
+ Grammar: /* @__PURE__ */ __name2(() => RadarGrammar(), "Grammar"),
+ LanguageMetaData: /* @__PURE__ */ __name2(() => RadarLanguageMetaData, "LanguageMetaData"),
+ parser: {}
+ };
accessibilityDescrRegex = /accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/;
accessibilityTitleRegex = /accTitle[\t ]*:([^\n\r]*)/;
titleRegex = /title([\t ][^\n\r]*|)/;
@@ -72123,7 +78257,7 @@ ${content}`;
}
});
- // ../parser/dist/chunks/mermaid-parser.core/chunk-NCMFTTUW.mjs
+ // ../parser/dist/chunks/mermaid-parser.core/chunk-2NYFTIL2.mjs
function createGitGraphServices(context = EmptyFileSystem) {
const shared = inject(
createDefaultSharedCoreModule(context),
@@ -72138,10 +78272,10 @@ ${content}`;
return { shared, GitGraph: GitGraph2 };
}
var GitGraphTokenBuilder, GitGraphModule;
- var init_chunk_NCMFTTUW = __esm({
- "../parser/dist/chunks/mermaid-parser.core/chunk-NCMFTTUW.mjs"() {
+ var init_chunk_2NYFTIL2 = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/chunk-2NYFTIL2.mjs"() {
"use strict";
- init_chunk_Y27MQZ3U();
+ init_chunk_7PKI6E2E();
init_lib3();
GitGraphTokenBuilder = class extends AbstractMermaidTokenBuilder {
static {
@@ -72165,7 +78299,7 @@ ${content}`;
}
});
- // ../parser/dist/chunks/mermaid-parser.core/chunk-4YFB5VUC.mjs
+ // ../parser/dist/chunks/mermaid-parser.core/chunk-EXZZNE6F.mjs
function createInfoServices(context = EmptyFileSystem) {
const shared = inject(
createDefaultSharedCoreModule(context),
@@ -72180,10 +78314,10 @@ ${content}`;
return { shared, Info: Info2 };
}
var InfoTokenBuilder, InfoModule;
- var init_chunk_4YFB5VUC = __esm({
- "../parser/dist/chunks/mermaid-parser.core/chunk-4YFB5VUC.mjs"() {
+ var init_chunk_EXZZNE6F = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/chunk-EXZZNE6F.mjs"() {
"use strict";
- init_chunk_Y27MQZ3U();
+ init_chunk_7PKI6E2E();
init_lib3();
InfoTokenBuilder = class extends AbstractMermaidTokenBuilder {
static {
@@ -72207,7 +78341,7 @@ ${content}`;
}
});
- // ../parser/dist/chunks/mermaid-parser.core/chunk-EQFLFMNE.mjs
+ // ../parser/dist/chunks/mermaid-parser.core/chunk-V4Q32G6S.mjs
function createPacketServices(context = EmptyFileSystem) {
const shared = inject(
createDefaultSharedCoreModule(context),
@@ -72222,10 +78356,10 @@ ${content}`;
return { shared, Packet: Packet2 };
}
var PacketTokenBuilder, PacketModule;
- var init_chunk_EQFLFMNE = __esm({
- "../parser/dist/chunks/mermaid-parser.core/chunk-EQFLFMNE.mjs"() {
+ var init_chunk_V4Q32G6S = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/chunk-V4Q32G6S.mjs"() {
"use strict";
- init_chunk_Y27MQZ3U();
+ init_chunk_7PKI6E2E();
init_lib3();
PacketTokenBuilder = class extends AbstractMermaidTokenBuilder {
static {
@@ -72249,7 +78383,7 @@ ${content}`;
}
});
- // ../parser/dist/chunks/mermaid-parser.core/chunk-BI6EQKOQ.mjs
+ // ../parser/dist/chunks/mermaid-parser.core/chunk-ROXG7S4E.mjs
function createPieServices(context = EmptyFileSystem) {
const shared = inject(
createDefaultSharedCoreModule(context),
@@ -72264,10 +78398,10 @@ ${content}`;
return { shared, Pie: Pie2 };
}
var PieTokenBuilder, PieValueConverter, PieModule;
- var init_chunk_BI6EQKOQ = __esm({
- "../parser/dist/chunks/mermaid-parser.core/chunk-BI6EQKOQ.mjs"() {
+ var init_chunk_ROXG7S4E = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/chunk-ROXG7S4E.mjs"() {
"use strict";
- init_chunk_Y27MQZ3U();
+ init_chunk_7PKI6E2E();
init_lib3();
PieTokenBuilder = class extends AbstractMermaidTokenBuilder {
static {
@@ -72305,7 +78439,7 @@ ${content}`;
}
});
- // ../parser/dist/chunks/mermaid-parser.core/chunk-FF7BQXOH.mjs
+ // ../parser/dist/chunks/mermaid-parser.core/chunk-C4OEIS7N.mjs
function createArchitectureServices(context = EmptyFileSystem) {
const shared = inject(
createDefaultSharedCoreModule(context),
@@ -72320,10 +78454,10 @@ ${content}`;
return { shared, Architecture: Architecture2 };
}
var ArchitectureTokenBuilder, ArchitectureValueConverter, ArchitectureModule;
- var init_chunk_FF7BQXOH = __esm({
- "../parser/dist/chunks/mermaid-parser.core/chunk-FF7BQXOH.mjs"() {
+ var init_chunk_C4OEIS7N = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/chunk-C4OEIS7N.mjs"() {
"use strict";
- init_chunk_Y27MQZ3U();
+ init_chunk_7PKI6E2E();
init_lib3();
ArchitectureTokenBuilder = class extends AbstractMermaidTokenBuilder {
static {
@@ -72365,78 +78499,134 @@ ${content}`;
}
});
- // ../parser/dist/chunks/mermaid-parser.core/info-46DW6VJ7.mjs
- var info_46DW6VJ7_exports = {};
- __export(info_46DW6VJ7_exports, {
+ // ../parser/dist/chunks/mermaid-parser.core/chunk-2O5ZK7RR.mjs
+ function createRadarServices(context = EmptyFileSystem) {
+ const shared = inject(
+ createDefaultSharedCoreModule(context),
+ MermaidGeneratedSharedModule
+ );
+ const Radar2 = inject(
+ createDefaultCoreModule({ shared }),
+ RadarGeneratedModule,
+ RadarModule
+ );
+ shared.ServiceRegistry.register(Radar2);
+ return { shared, Radar: Radar2 };
+ }
+ var RadarTokenBuilder, RadarModule;
+ var init_chunk_2O5ZK7RR = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/chunk-2O5ZK7RR.mjs"() {
+ "use strict";
+ init_chunk_7PKI6E2E();
+ init_lib3();
+ RadarTokenBuilder = class extends AbstractMermaidTokenBuilder {
+ static {
+ __name(this, "RadarTokenBuilder");
+ }
+ static {
+ __name2(this, "RadarTokenBuilder");
+ }
+ constructor() {
+ super(["radar-beta"]);
+ }
+ };
+ RadarModule = {
+ parser: {
+ TokenBuilder: /* @__PURE__ */ __name2(() => new RadarTokenBuilder(), "TokenBuilder"),
+ ValueConverter: /* @__PURE__ */ __name2(() => new CommonValueConverter(), "ValueConverter")
+ }
+ };
+ __name(createRadarServices, "createRadarServices");
+ __name2(createRadarServices, "createRadarServices");
+ }
+ });
+
+ // ../parser/dist/chunks/mermaid-parser.core/info-4N47QTOZ.mjs
+ var info_4N47QTOZ_exports = {};
+ __export(info_4N47QTOZ_exports, {
InfoModule: () => InfoModule,
createInfoServices: () => createInfoServices
});
- var init_info_46DW6VJ7 = __esm({
- "../parser/dist/chunks/mermaid-parser.core/info-46DW6VJ7.mjs"() {
+ var init_info_4N47QTOZ = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/info-4N47QTOZ.mjs"() {
"use strict";
- init_chunk_4YFB5VUC();
- init_chunk_Y27MQZ3U();
+ init_chunk_EXZZNE6F();
+ init_chunk_7PKI6E2E();
}
});
- // ../parser/dist/chunks/mermaid-parser.core/packet-W2GHVCYJ.mjs
- var packet_W2GHVCYJ_exports = {};
- __export(packet_W2GHVCYJ_exports, {
+ // ../parser/dist/chunks/mermaid-parser.core/packet-KVYON367.mjs
+ var packet_KVYON367_exports = {};
+ __export(packet_KVYON367_exports, {
PacketModule: () => PacketModule,
createPacketServices: () => createPacketServices
});
- var init_packet_W2GHVCYJ = __esm({
- "../parser/dist/chunks/mermaid-parser.core/packet-W2GHVCYJ.mjs"() {
+ var init_packet_KVYON367 = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/packet-KVYON367.mjs"() {
"use strict";
- init_chunk_EQFLFMNE();
- init_chunk_Y27MQZ3U();
+ init_chunk_V4Q32G6S();
+ init_chunk_7PKI6E2E();
}
});
- // ../parser/dist/chunks/mermaid-parser.core/pie-BEWT4RHE.mjs
- var pie_BEWT4RHE_exports = {};
- __export(pie_BEWT4RHE_exports, {
+ // ../parser/dist/chunks/mermaid-parser.core/pie-R6RNRRYF.mjs
+ var pie_R6RNRRYF_exports = {};
+ __export(pie_R6RNRRYF_exports, {
PieModule: () => PieModule,
createPieServices: () => createPieServices
});
- var init_pie_BEWT4RHE = __esm({
- "../parser/dist/chunks/mermaid-parser.core/pie-BEWT4RHE.mjs"() {
+ var init_pie_R6RNRRYF = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/pie-R6RNRRYF.mjs"() {
"use strict";
- init_chunk_BI6EQKOQ();
- init_chunk_Y27MQZ3U();
+ init_chunk_ROXG7S4E();
+ init_chunk_7PKI6E2E();
}
});
- // ../parser/dist/chunks/mermaid-parser.core/architecture-I3QFYML2.mjs
- var architecture_I3QFYML2_exports = {};
- __export(architecture_I3QFYML2_exports, {
+ // ../parser/dist/chunks/mermaid-parser.core/architecture-4AB2E3PP.mjs
+ var architecture_4AB2E3PP_exports = {};
+ __export(architecture_4AB2E3PP_exports, {
ArchitectureModule: () => ArchitectureModule,
createArchitectureServices: () => createArchitectureServices
});
- var init_architecture_I3QFYML2 = __esm({
- "../parser/dist/chunks/mermaid-parser.core/architecture-I3QFYML2.mjs"() {
+ var init_architecture_4AB2E3PP = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/architecture-4AB2E3PP.mjs"() {
"use strict";
- init_chunk_FF7BQXOH();
- init_chunk_Y27MQZ3U();
+ init_chunk_C4OEIS7N();
+ init_chunk_7PKI6E2E();
}
});
- // ../parser/dist/chunks/mermaid-parser.core/gitGraph-YCYPL57B.mjs
- var gitGraph_YCYPL57B_exports = {};
- __export(gitGraph_YCYPL57B_exports, {
+ // ../parser/dist/chunks/mermaid-parser.core/gitGraph-O2Q2CXLX.mjs
+ var gitGraph_O2Q2CXLX_exports = {};
+ __export(gitGraph_O2Q2CXLX_exports, {
GitGraphModule: () => GitGraphModule,
createGitGraphServices: () => createGitGraphServices
});
- var init_gitGraph_YCYPL57B = __esm({
- "../parser/dist/chunks/mermaid-parser.core/gitGraph-YCYPL57B.mjs"() {
+ var init_gitGraph_O2Q2CXLX = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/gitGraph-O2Q2CXLX.mjs"() {
"use strict";
- init_chunk_NCMFTTUW();
- init_chunk_Y27MQZ3U();
+ init_chunk_2NYFTIL2();
+ init_chunk_7PKI6E2E();
+ }
+ });
+
+ // ../parser/dist/chunks/mermaid-parser.core/radar-MK3ICKWK.mjs
+ var radar_MK3ICKWK_exports = {};
+ __export(radar_MK3ICKWK_exports, {
+ RadarModule: () => RadarModule,
+ createRadarServices: () => createRadarServices
+ });
+ var init_radar_MK3ICKWK = __esm({
+ "../parser/dist/chunks/mermaid-parser.core/radar-MK3ICKWK.mjs"() {
+ "use strict";
+ init_chunk_2O5ZK7RR();
+ init_chunk_7PKI6E2E();
}
});
// ../parser/dist/mermaid-parser.core.mjs
- async function parse2(diagramType, text2) {
+ async function parse(diagramType, text4) {
const initializer = initializers[diagramType];
if (!initializer) {
throw new Error(`Unknown diagram type: ${diagramType}`);
@@ -72444,8 +78634,8 @@ ${content}`;
if (!parsers[diagramType]) {
await initializer();
}
- const parser22 = parsers[diagramType];
- const result = parser22.parse(text2);
+ const parser24 = parsers[diagramType];
+ const result = parser24.parse(text4);
if (result.lexerErrors.length > 0 || result.parserErrors.length > 0) {
throw new MermaidParseError(result);
}
@@ -72455,42 +78645,48 @@ ${content}`;
var init_mermaid_parser_core = __esm({
"../parser/dist/mermaid-parser.core.mjs"() {
"use strict";
- init_chunk_NCMFTTUW();
- init_chunk_4YFB5VUC();
- init_chunk_EQFLFMNE();
- init_chunk_BI6EQKOQ();
- init_chunk_FF7BQXOH();
- init_chunk_Y27MQZ3U();
+ init_chunk_2NYFTIL2();
+ init_chunk_EXZZNE6F();
+ init_chunk_V4Q32G6S();
+ init_chunk_ROXG7S4E();
+ init_chunk_C4OEIS7N();
+ init_chunk_2O5ZK7RR();
+ init_chunk_7PKI6E2E();
parsers = {};
initializers = {
info: /* @__PURE__ */ __name2(async () => {
- const { createInfoServices: createInfoServices2 } = await Promise.resolve().then(() => (init_info_46DW6VJ7(), info_46DW6VJ7_exports));
- const parser22 = createInfoServices2().Info.parser.LangiumParser;
- parsers.info = parser22;
+ const { createInfoServices: createInfoServices2 } = await Promise.resolve().then(() => (init_info_4N47QTOZ(), info_4N47QTOZ_exports));
+ const parser24 = createInfoServices2().Info.parser.LangiumParser;
+ parsers.info = parser24;
}, "info"),
packet: /* @__PURE__ */ __name2(async () => {
- const { createPacketServices: createPacketServices2 } = await Promise.resolve().then(() => (init_packet_W2GHVCYJ(), packet_W2GHVCYJ_exports));
- const parser22 = createPacketServices2().Packet.parser.LangiumParser;
- parsers.packet = parser22;
+ const { createPacketServices: createPacketServices2 } = await Promise.resolve().then(() => (init_packet_KVYON367(), packet_KVYON367_exports));
+ const parser24 = createPacketServices2().Packet.parser.LangiumParser;
+ parsers.packet = parser24;
}, "packet"),
pie: /* @__PURE__ */ __name2(async () => {
- const { createPieServices: createPieServices2 } = await Promise.resolve().then(() => (init_pie_BEWT4RHE(), pie_BEWT4RHE_exports));
- const parser22 = createPieServices2().Pie.parser.LangiumParser;
- parsers.pie = parser22;
+ const { createPieServices: createPieServices2 } = await Promise.resolve().then(() => (init_pie_R6RNRRYF(), pie_R6RNRRYF_exports));
+ const parser24 = createPieServices2().Pie.parser.LangiumParser;
+ parsers.pie = parser24;
}, "pie"),
architecture: /* @__PURE__ */ __name2(async () => {
- const { createArchitectureServices: createArchitectureServices2 } = await Promise.resolve().then(() => (init_architecture_I3QFYML2(), architecture_I3QFYML2_exports));
- const parser22 = createArchitectureServices2().Architecture.parser.LangiumParser;
- parsers.architecture = parser22;
+ const { createArchitectureServices: createArchitectureServices2 } = await Promise.resolve().then(() => (init_architecture_4AB2E3PP(), architecture_4AB2E3PP_exports));
+ const parser24 = createArchitectureServices2().Architecture.parser.LangiumParser;
+ parsers.architecture = parser24;
}, "architecture"),
gitGraph: /* @__PURE__ */ __name2(async () => {
- const { createGitGraphServices: createGitGraphServices2 } = await Promise.resolve().then(() => (init_gitGraph_YCYPL57B(), gitGraph_YCYPL57B_exports));
- const parser22 = createGitGraphServices2().GitGraph.parser.LangiumParser;
- parsers.gitGraph = parser22;
- }, "gitGraph")
+ const { createGitGraphServices: createGitGraphServices2 } = await Promise.resolve().then(() => (init_gitGraph_O2Q2CXLX(), gitGraph_O2Q2CXLX_exports));
+ const parser24 = createGitGraphServices2().GitGraph.parser.LangiumParser;
+ parsers.gitGraph = parser24;
+ }, "gitGraph"),
+ radar: /* @__PURE__ */ __name2(async () => {
+ const { createRadarServices: createRadarServices2 } = await Promise.resolve().then(() => (init_radar_MK3ICKWK(), radar_MK3ICKWK_exports));
+ const parser24 = createRadarServices2().Radar.parser.LangiumParser;
+ parsers.radar = parser24;
+ }, "radar")
};
- __name(parse2, "parse");
- __name2(parse2, "parse");
+ __name(parse, "parse");
+ __name2(parse, "parse");
MermaidParseError = class extends Error {
static {
__name(this, "MermaidParseError");
@@ -72509,15 +78705,15 @@ ${content}`;
});
// src/diagrams/common/populateCommonDb.ts
- function populateCommonDb(ast, db8) {
+ function populateCommonDb(ast, db10) {
if (ast.accDescr) {
- db8.setAccDescription?.(ast.accDescr);
+ db10.setAccDescription?.(ast.accDescr);
}
if (ast.accTitle) {
- db8.setAccTitle?.(ast.accTitle);
+ db10.setAccTitle?.(ast.accTitle);
}
if (ast.title) {
- db8.setDiagramTitle?.(ast.title);
+ db10.setDiagramTitle?.(ast.title);
}
}
var init_populateCommonDb = __esm({
@@ -72627,7 +78823,7 @@ ${content}`;
commitArr = uniqBy2(commitArr, (c3) => c3.id);
prettyPrintCommitHistory(commitArr);
}
- var DEFAULT_GITGRAPH_CONFIG, getConfig3, state2, setDirection2, setOptions2, getOptions, commit, branch, merge2, cherryPick, checkout, prettyPrint, clear10, getBranchesAsObjArray, getBranches, getCommits, getCommitsArray, getCurrentBranch, getDirection2, getHead, db;
+ var DEFAULT_GITGRAPH_CONFIG, getConfig3, state2, setDirection, setOptions2, getOptions, commit, branch, merge3, cherryPick, checkout, prettyPrint, clear7, getBranchesAsObjArray, getBranches, getCommits, getCommitsArray, getCurrentBranch, getDirection, getHead, db;
var init_gitGraphAst = __esm({
"src/diagrams/git/gitGraphAst.ts"() {
"use strict";
@@ -72641,16 +78837,16 @@ ${content}`;
init_defaultConfig();
DEFAULT_GITGRAPH_CONFIG = defaultConfig_default.gitGraph;
getConfig3 = /* @__PURE__ */ __name(() => {
- const config6 = cleanAndMerge({
+ const config5 = cleanAndMerge({
...DEFAULT_GITGRAPH_CONFIG,
...getConfig().gitGraph
});
- return config6;
+ return config5;
}, "getConfig");
state2 = new ImperativeState(() => {
- const config6 = getConfig3();
- const mainBranchName = config6.mainBranchName;
- const mainBranchOrder = config6.mainBranchOrder;
+ const config5 = getConfig3();
+ const mainBranchName = config5.mainBranchName;
+ const mainBranchOrder = config5.mainBranchOrder;
return {
mainBranchName,
commits: /* @__PURE__ */ new Map(),
@@ -72665,7 +78861,7 @@ ${content}`;
});
__name(getID, "getID");
__name(uniqBy2, "uniqBy");
- setDirection2 = /* @__PURE__ */ __name(function(dir2) {
+ setDirection = /* @__PURE__ */ __name(function(dir2) {
state2.records.direction = dir2;
}, "setDirection");
setOptions2 = /* @__PURE__ */ __name(function(rawOptString) {
@@ -72683,17 +78879,17 @@ ${content}`;
}, "getOptions");
commit = /* @__PURE__ */ __name(function(commitDB) {
let msg = commitDB.msg;
- let id27 = commitDB.id;
+ let id29 = commitDB.id;
const type3 = commitDB.type;
let tags2 = commitDB.tags;
- log.info("commit", msg, id27, type3, tags2);
- log.debug("Entering commit:", msg, id27, type3, tags2);
- const config6 = getConfig3();
- id27 = common_default.sanitizeText(id27, config6);
- msg = common_default.sanitizeText(msg, config6);
- tags2 = tags2?.map((tag2) => common_default.sanitizeText(tag2, config6));
+ log.info("commit", msg, id29, type3, tags2);
+ log.debug("Entering commit:", msg, id29, type3, tags2);
+ const config5 = getConfig3();
+ id29 = common_default.sanitizeText(id29, config5);
+ msg = common_default.sanitizeText(msg, config5);
+ tags2 = tags2?.map((tag2) => common_default.sanitizeText(tag2, config5));
const newCommit = {
- id: id27 ? id27 : state2.records.seq + "-" + getID(),
+ id: id29 ? id29 : state2.records.seq + "-" + getID(),
message: msg,
seq: state2.records.seq++,
type: type3 ?? commitType.NORMAL,
@@ -72702,7 +78898,7 @@ ${content}`;
branch: state2.records.currBranch
};
state2.records.head = newCommit;
- log.info("main branch", config6.mainBranchName);
+ log.info("main branch", config5.mainBranchName);
state2.records.commits.set(newCommit.id, newCommit);
state2.records.branches.set(state2.records.currBranch, newCommit.id);
log.debug("in pushCommit " + newCommit.id);
@@ -72721,15 +78917,15 @@ ${content}`;
checkout(name);
log.debug("in createBranch");
}, "branch");
- merge2 = /* @__PURE__ */ __name((mergeDB) => {
+ merge3 = /* @__PURE__ */ __name((mergeDB) => {
let otherBranch = mergeDB.branch;
let customId = mergeDB.id;
const overrideType = mergeDB.type;
const customTags = mergeDB.tags;
- const config6 = getConfig3();
- otherBranch = common_default.sanitizeText(otherBranch, config6);
+ const config5 = getConfig3();
+ otherBranch = common_default.sanitizeText(otherBranch, config5);
if (customId) {
- customId = common_default.sanitizeText(customId, config6);
+ customId = common_default.sanitizeText(customId, config5);
}
const currentBranchCheck = state2.records.branches.get(state2.records.currBranch);
const otherBranchCheck = state2.records.branches.get(otherBranch);
@@ -72826,11 +79022,11 @@ ${content}`;
let tags2 = cherryPickDB.tags;
let parentCommitId = cherryPickDB.parent;
log.debug("Entering cherryPick:", sourceId, targetId, tags2);
- const config6 = getConfig3();
- sourceId = common_default.sanitizeText(sourceId, config6);
- targetId = common_default.sanitizeText(targetId, config6);
- tags2 = tags2?.map((tag2) => common_default.sanitizeText(tag2, config6));
- parentCommitId = common_default.sanitizeText(parentCommitId, config6);
+ const config5 = getConfig3();
+ sourceId = common_default.sanitizeText(sourceId, config5);
+ targetId = common_default.sanitizeText(targetId, config5);
+ tags2 = tags2?.map((tag2) => common_default.sanitizeText(tag2, config5));
+ parentCommitId = common_default.sanitizeText(parentCommitId, config5);
if (!sourceId || !state2.records.commits.has(sourceId)) {
const error3 = new Error(
'Incorrect usage of "cherryPick". Source commit id should exist and provided'
@@ -72927,11 +79123,11 @@ ${content}`;
throw error3;
} else {
state2.records.currBranch = branch2;
- const id27 = state2.records.branches.get(state2.records.currBranch);
- if (id27 === void 0 || !id27) {
+ const id29 = state2.records.branches.get(state2.records.currBranch);
+ if (id29 === void 0 || !id29) {
state2.records.head = null;
} else {
- state2.records.head = state2.records.commits.get(id27) ?? null;
+ state2.records.head = state2.records.commits.get(id29) ?? null;
}
}
}, "checkout");
@@ -72942,7 +79138,7 @@ ${content}`;
const node2 = getCommitsArray()[0];
prettyPrintCommitHistory([node2]);
}, "prettyPrint");
- clear10 = /* @__PURE__ */ __name(function() {
+ clear7 = /* @__PURE__ */ __name(function() {
state2.reset();
clear();
}, "clear");
@@ -72975,7 +79171,7 @@ ${content}`;
getCurrentBranch = /* @__PURE__ */ __name(function() {
return state2.records.currBranch;
}, "getCurrentBranch");
- getDirection2 = /* @__PURE__ */ __name(function() {
+ getDirection = /* @__PURE__ */ __name(function() {
return state2.records.direction;
}, "getDirection");
getHead = /* @__PURE__ */ __name(function() {
@@ -72984,23 +79180,23 @@ ${content}`;
db = {
commitType,
getConfig: getConfig3,
- setDirection: setDirection2,
+ setDirection,
setOptions: setOptions2,
getOptions,
commit,
branch,
- merge: merge2,
+ merge: merge3,
cherryPick,
checkout,
//reset,
prettyPrint,
- clear: clear10,
+ clear: clear7,
getBranchesAsObjArray,
getBranches,
getCommits,
getCommitsArray,
getCurrentBranch,
- getDirection: getDirection2,
+ getDirection,
getHead,
setAccTitle,
getAccTitle,
@@ -73022,26 +79218,26 @@ ${content}`;
init_populateCommonDb();
init_gitGraphAst();
init_gitGraphTypes();
- populate = /* @__PURE__ */ __name((ast, db8) => {
- populateCommonDb(ast, db8);
+ populate = /* @__PURE__ */ __name((ast, db10) => {
+ populateCommonDb(ast, db10);
if (ast.dir) {
- db8.setDirection(ast.dir);
+ db10.setDirection(ast.dir);
}
for (const statement of ast.statements) {
- parseStatement(statement, db8);
+ parseStatement(statement, db10);
}
}, "populate");
- parseStatement = /* @__PURE__ */ __name((statement, db8) => {
+ parseStatement = /* @__PURE__ */ __name((statement, db10) => {
const parsers2 = {
- Commit: /* @__PURE__ */ __name((stmt) => db8.commit(parseCommit(stmt)), "Commit"),
- Branch: /* @__PURE__ */ __name((stmt) => db8.branch(parseBranch(stmt)), "Branch"),
- Merge: /* @__PURE__ */ __name((stmt) => db8.merge(parseMerge(stmt)), "Merge"),
- Checkout: /* @__PURE__ */ __name((stmt) => db8.checkout(parseCheckout(stmt)), "Checkout"),
- CherryPicking: /* @__PURE__ */ __name((stmt) => db8.cherryPick(parseCherryPicking(stmt)), "CherryPicking")
+ Commit: /* @__PURE__ */ __name((stmt) => db10.commit(parseCommit(stmt)), "Commit"),
+ Branch: /* @__PURE__ */ __name((stmt) => db10.branch(parseBranch(stmt)), "Branch"),
+ Merge: /* @__PURE__ */ __name((stmt) => db10.merge(parseMerge(stmt)), "Merge"),
+ Checkout: /* @__PURE__ */ __name((stmt) => db10.checkout(parseCheckout(stmt)), "Checkout"),
+ CherryPicking: /* @__PURE__ */ __name((stmt) => db10.cherryPick(parseCherryPicking(stmt)), "CherryPicking")
};
- const parser22 = parsers2[statement.$type];
- if (parser22) {
- parser22(statement);
+ const parser24 = parsers2[statement.$type];
+ if (parser24) {
+ parser24(statement);
} else {
log.error(`Unknown statement type: ${statement.$type}`);
}
@@ -73086,7 +79282,7 @@ ${content}`;
}, "parseCherryPicking");
parser5 = {
parse: /* @__PURE__ */ __name(async (input) => {
- const ast = await parse2("gitGraph", input);
+ const ast = await parse("gitGraph", input);
log.debug(ast);
populate(ast, db);
}, "parse")
@@ -73233,7 +79429,7 @@ ${content}`;
});
// src/diagrams/git/gitGraphRenderer.ts
- var DEFAULT_CONFIG, DEFAULT_GITGRAPH_CONFIG2, LAYOUT_OFFSET, COMMIT_STEP, PX, PY, THEME_COLOR_LIMIT, branchPos, commitPos, defaultPos, allCommitsDict, lanes, maxPos, dir, clear11, drawText2, findClosestParent, findClosestParentBT, setParallelBTPos, findClosestParentPos, calculateCommitPosition, setCommitPosition, setRootPosition, drawCommitBullet, drawCommitLabel, drawCommitTags, getCommitClassType, calculatePosition, getCommitPosition, drawCommits, shouldRerouteArrow, findLane, drawArrow, drawArrows, drawBranches, setBranchPosition, draw4, gitGraphRenderer_default;
+ var DEFAULT_CONFIG, DEFAULT_GITGRAPH_CONFIG2, LAYOUT_OFFSET, COMMIT_STEP, PX, PY, THEME_COLOR_LIMIT, branchPos, commitPos, defaultPos, allCommitsDict, lanes, maxPos, dir, clear8, drawText2, findClosestParent, findClosestParentBT, setParallelBTPos, findClosestParentPos, calculateCommitPosition, setCommitPosition, setRootPosition, drawCommitBullet, drawCommitLabel, drawCommitTags, getCommitClassType, calculatePosition, getCommitPosition, drawCommits, shouldRerouteArrow, findLane, drawArrow, drawArrows, drawBranches, setBranchPosition, draw4, gitGraphRenderer_default;
var init_gitGraphRenderer = __esm({
"src/diagrams/git/gitGraphRenderer.ts"() {
"use strict";
@@ -73256,7 +79452,7 @@ ${content}`;
lanes = [];
maxPos = 0;
dir = "LR";
- clear11 = /* @__PURE__ */ __name(() => {
+ clear8 = /* @__PURE__ */ __name(() => {
branchPos.clear();
commitPos.clear();
allCommitsDict.clear();
@@ -73278,7 +79474,7 @@ ${content}`;
});
return svgLabel;
}, "drawText");
- findClosestParent = /* @__PURE__ */ __name((parents4) => {
+ findClosestParent = /* @__PURE__ */ __name((parents3) => {
let closestParent;
let comparisonFunc;
let targetPosition;
@@ -73289,7 +79485,7 @@ ${content}`;
comparisonFunc = /* @__PURE__ */ __name((a2, b2) => a2 >= b2, "comparisonFunc");
targetPosition = 0;
}
- parents4.forEach((parent4) => {
+ parents3.forEach((parent4) => {
const parentPosition = dir === "TB" || dir == "BT" ? commitPos.get(parent4)?.y : commitPos.get(parent4)?.x;
if (parentPosition !== void 0 && comparisonFunc(parentPosition, targetPosition)) {
closestParent = parent4;
@@ -73298,10 +79494,10 @@ ${content}`;
});
return closestParent;
}, "findClosestParent");
- findClosestParentBT = /* @__PURE__ */ __name((parents4) => {
+ findClosestParentBT = /* @__PURE__ */ __name((parents3) => {
let closestParent = "";
let maxPosition = Infinity;
- parents4.forEach((parent4) => {
+ parents3.forEach((parent4) => {
const parentPosition = commitPos.get(parent4).y;
if (parentPosition <= maxPosition) {
closestParent = parent4;
@@ -73424,19 +79620,19 @@ ${content}`;
if (commit2.type !== commitType.CHERRY_PICK && (commit2.customId && commit2.type === commitType.MERGE || commit2.type !== commitType.MERGE) && DEFAULT_GITGRAPH_CONFIG2?.showCommitLabel) {
const wrapper = gLabels.append("g");
const labelBkg = wrapper.insert("rect").attr("class", "commit-label-bkg");
- const text2 = wrapper.append("text").attr("x", pos).attr("y", commitPosition.y + 25).attr("class", "commit-label").text(commit2.id);
- const bbox = text2.node()?.getBBox();
+ const text4 = wrapper.append("text").attr("x", pos).attr("y", commitPosition.y + 25).attr("class", "commit-label").text(commit2.id);
+ const bbox = text4.node()?.getBBox();
if (bbox) {
labelBkg.attr("x", commitPosition.posWithOffset - bbox.width / 2 - PY).attr("y", commitPosition.y + 13.5).attr("width", bbox.width + 2 * PY).attr("height", bbox.height + 2 * PY);
if (dir === "TB" || dir === "BT") {
labelBkg.attr("x", commitPosition.x - (bbox.width + 4 * PX + 5)).attr("y", commitPosition.y - 12);
- text2.attr("x", commitPosition.x - (bbox.width + 4 * PX)).attr("y", commitPosition.y + bbox.height - 12);
+ text4.attr("x", commitPosition.x - (bbox.width + 4 * PX)).attr("y", commitPosition.y + bbox.height - 12);
} else {
- text2.attr("x", commitPosition.posWithOffset - bbox.width / 2);
+ text4.attr("x", commitPosition.posWithOffset - bbox.width / 2);
}
if (DEFAULT_GITGRAPH_CONFIG2.rotateCommitLabel) {
if (dir === "TB" || dir === "BT") {
- text2.attr(
+ text4.attr(
"transform",
"rotate(-45, " + commitPosition.x + ", " + commitPosition.y + ")"
);
@@ -73463,7 +79659,7 @@ ${content}`;
let maxTagBboxHeight = 0;
const tagElements = [];
for (const tagValue of commit2.tags.reverse()) {
- const rect4 = gLabels.insert("polygon");
+ const rect3 = gLabels.insert("polygon");
const hole = gLabels.append("circle");
const tag2 = gLabels.append("text").attr("y", commitPosition.y - 16 - yOffset).attr("class", "tag-label").text(tagValue);
const tagBbox = tag2.node()?.getBBox();
@@ -73476,15 +79672,15 @@ ${content}`;
tagElements.push({
tag: tag2,
hole,
- rect: rect4,
+ rect: rect3,
yOffset
});
yOffset += 20;
}
- for (const { tag: tag2, hole, rect: rect4, yOffset: yOffset2 } of tagElements) {
+ for (const { tag: tag2, hole, rect: rect3, yOffset: yOffset2 } of tagElements) {
const h2 = maxTagBboxHeight / 2;
const ly = commitPosition.y - 19.2 - yOffset2;
- rect4.attr("class", "tag-label-bkg").attr(
+ rect3.attr("class", "tag-label-bkg").attr(
"points",
`
${pos - maxTagBboxWidth / 2 - PX / 2},${ly + PY}
@@ -73497,7 +79693,7 @@ ${content}`;
hole.attr("cy", ly).attr("cx", pos - maxTagBboxWidth / 2 + PX / 2).attr("r", 1.5).attr("class", "tag-hole");
if (dir === "TB" || dir === "BT") {
const yOrigin = pos + yOffset2;
- rect4.attr("class", "tag-label-bkg").attr(
+ rect3.attr("class", "tag-label-bkg").attr(
"points",
`
${commitPosition.x},${yOrigin + 2}
@@ -73566,12 +79762,12 @@ ${content}`;
}
return { x: x5, y: y5, posWithOffset };
}, "getCommitPosition");
- drawCommits = /* @__PURE__ */ __name((svg, commits, modifyGraph) => {
+ drawCommits = /* @__PURE__ */ __name((svg2, commits, modifyGraph) => {
if (!DEFAULT_GITGRAPH_CONFIG2) {
throw new Error("GitGraph config not found");
}
- const gBullets = svg.append("g").attr("class", "commit-bullets");
- const gLabels = svg.append("g").attr("class", "commit-labels");
+ const gBullets = svg2.append("g").attr("class", "commit-bullets");
+ const gLabels = svg2.append("g").attr("class", "commit-labels");
let pos = dir === "TB" || dir === "BT" ? defaultPos : 0;
const keys3 = [...commits.keys()];
const isParallelCommits = DEFAULT_GITGRAPH_CONFIG2?.parallelCommits ?? false;
@@ -73637,7 +79833,7 @@ ${content}`;
const diff2 = Math.abs(y1 - y22);
return findLane(y1, y22 - diff2 / 5, depth + 1);
}, "findLane");
- drawArrow = /* @__PURE__ */ __name((svg, commitA, commitB, allCommits) => {
+ drawArrow = /* @__PURE__ */ __name((svg2, commitA, commitB, allCommits) => {
const p1 = commitPos.get(commitA.id);
const p22 = commitPos.get(commitB.id);
if (p1 === void 0 || p22 === void 0) {
@@ -73754,10 +79950,10 @@ ${content}`;
if (lineDef === void 0) {
throw new Error("Line definition not found");
}
- svg.append("path").attr("d", lineDef).attr("class", "arrow arrow" + colorClassNum % THEME_COLOR_LIMIT);
+ svg2.append("path").attr("d", lineDef).attr("class", "arrow arrow" + colorClassNum % THEME_COLOR_LIMIT);
}, "drawArrow");
- drawArrows = /* @__PURE__ */ __name((svg, commits) => {
- const gArrows = svg.append("g").attr("class", "commit-arrows");
+ drawArrows = /* @__PURE__ */ __name((svg2, commits) => {
+ const gArrows = svg2.append("g").attr("class", "commit-arrows");
[...commits.keys()].forEach((key) => {
const commit2 = commits.get(key);
if (commit2.parents && commit2.parents.length > 0) {
@@ -73767,8 +79963,8 @@ ${content}`;
}
});
}, "drawArrows");
- drawBranches = /* @__PURE__ */ __name((svg, branches) => {
- const g2 = svg.append("g");
+ drawBranches = /* @__PURE__ */ __name((svg2, branches) => {
+ const g2 = svg2.append("g");
branches.forEach((branch2, index) => {
const adjustIndexForTheme = index % THEME_COLOR_LIMIT;
const pos = branchPos.get(branch2.name)?.pos;
@@ -73821,22 +80017,22 @@ ${content}`;
pos += 50 + (rotateCommitLabel ? 40 : 0) + (dir === "TB" || dir === "BT" ? bbox.width / 2 : 0);
return pos;
}, "setBranchPosition");
- draw4 = /* @__PURE__ */ __name(function(txt, id27, ver, diagObj) {
- clear11();
- log.debug("in gitgraph renderer", txt + "\n", "id:", id27, ver);
+ draw4 = /* @__PURE__ */ __name(function(txt, id29, ver, diagObj) {
+ clear8();
+ log.debug("in gitgraph renderer", txt + "\n", "id:", id29, ver);
if (!DEFAULT_GITGRAPH_CONFIG2) {
throw new Error("GitGraph config not found");
}
const rotateCommitLabel = DEFAULT_GITGRAPH_CONFIG2.rotateCommitLabel ?? false;
- const db8 = diagObj.db;
- allCommitsDict = db8.getCommits();
- const branches = db8.getBranchesAsObjArray();
- dir = db8.getDirection();
- const diagram24 = select_default2(`[id="${id27}"]`);
+ const db10 = diagObj.db;
+ allCommitsDict = db10.getCommits();
+ const branches = db10.getBranchesAsObjArray();
+ dir = db10.getDirection();
+ const diagram26 = select_default2(`[id="${id29}"]`);
let pos = 0;
branches.forEach((branch2, index) => {
const labelElement = drawText2(branch2.name);
- const g2 = diagram24.append("g");
+ const g2 = diagram26.append("g");
const branchLabel = g2.insert("g").attr("class", "branchLabel");
const label = branchLabel.insert("g").attr("class", "label branch-label");
label.node()?.appendChild(labelElement);
@@ -73846,21 +80042,21 @@ ${content}`;
branchLabel.remove();
g2.remove();
});
- drawCommits(diagram24, allCommitsDict, false);
+ drawCommits(diagram26, allCommitsDict, false);
if (DEFAULT_GITGRAPH_CONFIG2.showBranches) {
- drawBranches(diagram24, branches);
+ drawBranches(diagram26, branches);
}
- drawArrows(diagram24, allCommitsDict);
- drawCommits(diagram24, allCommitsDict, true);
+ drawArrows(diagram26, allCommitsDict);
+ drawCommits(diagram26, allCommitsDict, true);
utils_default2.insertTitle(
- diagram24,
+ diagram26,
"gitTitleText",
DEFAULT_GITGRAPH_CONFIG2.titleTopMargin ?? 0,
- db8.getDiagramTitle()
+ db10.getDiagramTitle()
);
setupGraphViewbox2(
void 0,
- diagram24,
+ diagram26,
DEFAULT_GITGRAPH_CONFIG2.diagramPadding,
DEFAULT_GITGRAPH_CONFIG2.useMaxWidth
);
@@ -74246,8 +80442,8 @@ ${content}`;
commitPos.set("parent2", { x: 2, y: 2 });
commitPos.set("parent3", { x: 3, y: 3 });
dir = "LR";
- const parents4 = ["parent1", "parent2", "parent3"];
- const closestParent = findClosestParent(parents4);
+ const parents3 = ["parent1", "parent2", "parent3"];
+ const closestParent = findClosestParent(parents3);
expect(closestParent).toBe("parent3");
commitPos.clear();
});
@@ -74349,7 +80545,7 @@ ${content}`;
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $V0 = [6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 38, 40], $V1 = [1, 26], $V2 = [1, 27], $V3 = [1, 28], $V4 = [1, 29], $V5 = [1, 30], $V6 = [1, 31], $V7 = [1, 32], $V8 = [1, 33], $V9 = [1, 34], $Va = [1, 9], $Vb = [1, 10], $Vc = [1, 11], $Vd = [1, 12], $Ve = [1, 13], $Vf = [1, 14], $Vg = [1, 15], $Vh = [1, 16], $Vi = [1, 19], $Vj = [1, 20], $Vk = [1, 21], $Vl = [1, 22], $Vm = [1, 23], $Vn = [1, 25], $Vo = [1, 35];
- var parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -74515,7 +80711,7 @@ ${content}`;
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -74545,7 +80741,7 @@ ${content}`;
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -74557,22 +80753,22 @@ ${content}`;
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -74591,7 +80787,7 @@ ${content}`;
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -74891,7 +81087,7 @@ ${content}`;
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -75108,13 +81304,13 @@ ${content}`;
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser6.parser = parser6;
@@ -75165,7 +81361,7 @@ ${content}`;
var e3 = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t4 = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n2 = /\d/, r2 = /\d\d/, i2 = /\d\d?/, o2 = /\d*[^-_:/,()\s\d]+/, s2 = {}, a2 = /* @__PURE__ */ __name(function(e4) {
return (e4 = +e4) + (e4 > 68 ? 1900 : 2e3);
}, "a");
- var f3 = /* @__PURE__ */ __name(function(e4) {
+ var f2 = /* @__PURE__ */ __name(function(e4) {
return function(t5) {
this[e4] = +t5;
};
@@ -75200,10 +81396,10 @@ ${content}`;
this.milliseconds = 10 * +e4;
}], SSS: [/\d{3}/, function(e4) {
this.milliseconds = +e4;
- }], s: [i2, f3("seconds")], ss: [i2, f3("seconds")], m: [i2, f3("minutes")], mm: [i2, f3("minutes")], H: [i2, f3("hours")], h: [i2, f3("hours")], HH: [i2, f3("hours")], hh: [i2, f3("hours")], D: [i2, f3("day")], DD: [r2, f3("day")], Do: [o2, function(e4) {
+ }], s: [i2, f2("seconds")], ss: [i2, f2("seconds")], m: [i2, f2("minutes")], mm: [i2, f2("minutes")], H: [i2, f2("hours")], h: [i2, f2("hours")], HH: [i2, f2("hours")], hh: [i2, f2("hours")], D: [i2, f2("day")], DD: [r2, f2("day")], Do: [o2, function(e4) {
var t5 = s2.ordinal, n3 = e4.match(/\d+/);
if (this.day = n3[0], t5) for (var r3 = 1; r3 <= 31; r3 += 1) t5(r3).replace(/\[|\]/g, "") === e4 && (this.day = r3);
- }], w: [i2, f3("week")], ww: [r2, f3("week")], M: [i2, f3("month")], MM: [r2, f3("month")], MMM: [o2, function(e4) {
+ }], w: [i2, f2("week")], ww: [r2, f2("week")], M: [i2, f2("month")], MM: [r2, f2("month")], MMM: [o2, function(e4) {
var t5 = u2("months"), n3 = (u2("monthsShort") || t5.map(function(e6) {
return e6.slice(0, 3);
})).indexOf(e4) + 1;
@@ -75213,9 +81409,9 @@ ${content}`;
var t5 = u2("months").indexOf(e4) + 1;
if (t5 < 1) throw new Error();
this.month = t5 % 12 || t5;
- }], Y: [/[+-]?\d+/, f3("year")], YY: [r2, function(e4) {
+ }], Y: [/[+-]?\d+/, f2("year")], YY: [r2, function(e4) {
this.year = a2(e4);
- }], YYYY: [/\d{4}/, f3("year")], Z: h2, ZZ: h2 };
+ }], YYYY: [/\d{4}/, f2("year")], Z: h2, ZZ: h2 };
function l2(n3) {
var r3, i3;
r3 = n3, i3 = s2 && s2.formats;
@@ -75224,17 +81420,17 @@ ${content}`;
return n4 || i3[r4] || e3[r4] || i3[o4].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e4, t6, n5) {
return t6 || n5.slice(1);
});
- })).match(t4), a3 = o3.length, f4 = 0; f4 < a3; f4 += 1) {
- var h3 = o3[f4], u3 = c3[h3], d3 = u3 && u3[0], l3 = u3 && u3[1];
- o3[f4] = l3 ? { regex: d3, parser: l3 } : h3.replace(/^\[|\]$/g, "");
+ })).match(t4), a3 = o3.length, f3 = 0; f3 < a3; f3 += 1) {
+ var h3 = o3[f3], u3 = c3[h3], d3 = u3 && u3[0], l3 = u3 && u3[1];
+ o3[f3] = l3 ? { regex: d3, parser: l3 } : h3.replace(/^\[|\]$/g, "");
}
return function(e4) {
for (var t5 = {}, n4 = 0, r4 = 0; n4 < a3; n4 += 1) {
var i4 = o3[n4];
if ("string" == typeof i4) r4 += i4.length;
else {
- var s3 = i4.regex, f5 = i4.parser, h4 = e4.slice(r4), u4 = s3.exec(h4)[0];
- f5.call(t5, u4), e4 = e4.replace(u4, "");
+ var s3 = i4.regex, f4 = i4.parser, h4 = e4.slice(r4), u4 = s3.exec(h4)[0];
+ f4.call(t5, u4), e4 = e4.replace(u4, "");
}
}
return function(e6) {
@@ -75255,13 +81451,13 @@ ${content}`;
this.$u = r4;
var a3 = o3[1];
if ("string" == typeof a3) {
- var f4 = true === o3[2], h3 = true === o3[3], u3 = f4 || h3, d3 = o3[2];
- h3 && (d3 = o3[2]), s2 = this.$locale(), !f4 && d3 && (s2 = n3.Ls[d3]), this.$d = function(e7, t7, n4, r5) {
+ var f3 = true === o3[2], h3 = true === o3[3], u3 = f3 || h3, d3 = o3[2];
+ h3 && (d3 = o3[2]), s2 = this.$locale(), !f3 && d3 && (s2 = n3.Ls[d3]), this.$d = function(e7, t7, n4, r5) {
try {
if (["x", "X"].indexOf(t7) > -1) return new Date(("X" === t7 ? 1e3 : 1) * e7);
- var i4 = l2(t7)(e7), o4 = i4.year, s3 = i4.month, a4 = i4.day, f5 = i4.hours, h4 = i4.minutes, u4 = i4.seconds, d4 = i4.milliseconds, c5 = i4.zone, m3 = i4.week, M3 = /* @__PURE__ */ new Date(), Y3 = a4 || (o4 || s3 ? 1 : M3.getDate()), p3 = o4 || M3.getFullYear(), v3 = 0;
+ var i4 = l2(t7)(e7), o4 = i4.year, s3 = i4.month, a4 = i4.day, f4 = i4.hours, h4 = i4.minutes, u4 = i4.seconds, d4 = i4.milliseconds, c5 = i4.zone, m3 = i4.week, M3 = /* @__PURE__ */ new Date(), Y3 = a4 || (o4 || s3 ? 1 : M3.getDate()), p3 = o4 || M3.getFullYear(), v3 = 0;
o4 && !s3 || (v3 = s3 > 0 ? s3 - 1 : M3.getMonth());
- var D3, w3 = f5 || 0, g2 = h4 || 0, y5 = u4 || 0, L2 = d4 || 0;
+ var D3, w3 = f4 || 0, g2 = h4 || 0, y5 = u4 || 0, L2 = d4 || 0;
return c5 ? new Date(Date.UTC(p3, v3, Y3, w3, g2, y5, L2 + 60 * c5.offset * 1e3)) : n4 ? new Date(Date.UTC(p3, v3, Y3, w3, g2, y5, L2)) : (D3 = new Date(p3, v3, Y3, w3, g2, y5, L2), m3 && (D3 = r5(D3).week(m3).toDate()), D3);
} catch (e8) {
return /* @__PURE__ */ new Date("");
@@ -75337,22 +81533,22 @@ ${content}`;
});
// src/diagrams/gantt/ganttDb.js
- function getTaskTags(data5, task, tags2) {
+ function getTaskTags(data6, task, tags2) {
let matchFound = true;
while (matchFound) {
matchFound = false;
tags2.forEach(function(t4) {
const pattern = "^\\s*" + t4 + "\\s*$";
const regex2 = new RegExp(pattern);
- if (data5[0].match(regex2)) {
+ if (data6[0].match(regex2)) {
task[t4] = true;
- data5.shift(1);
+ data6.shift(1);
matchFound = true;
}
});
}
}
- var import_sanitize_url4, import_dayjs2, import_isoWeek, import_customParseFormat, import_advancedFormat, WEEKEND_START_DAY, dateFormat, axisFormat, tickInterval, todayMarker, includes2, excludes, links, sections, tasks, currentSection, displayMode, tags, funs2, inclusiveEndDates, topAxis, weekday, weekend, lastOrder, clear12, setAxisFormat, getAxisFormat, setTickInterval, getTickInterval, setTodayMarker, getTodayMarker, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, enableTopAxis, topAxisEnabled, setDisplayMode, getDisplayMode, getDateFormat, setIncludes, getIncludes, setExcludes, getExcludes, getLinks, addSection, getSections, getTasks, isInvalidDate, setWeekday, getWeekday, setWeekend, checkTaskDates, fixTaskDates, getStartDate, parseDuration, getEndDate, taskCnt, parseId, compileData, parseData, lastTask, lastTaskID, rawTasks, taskDb, addTask, findTaskById, addTaskOrg, compileTasks, setLink2, setClass2, setClickFun2, pushFun, setClickEvent2, bindFunctions2, ganttDb_default;
+ var import_sanitize_url4, import_dayjs2, import_isoWeek, import_customParseFormat, import_advancedFormat, WEEKEND_START_DAY, dateFormat, axisFormat, tickInterval, todayMarker, includes2, excludes, links, sections, tasks, currentSection, displayMode, tags, funs, inclusiveEndDates, topAxis, weekday, weekend, lastOrder, clear9, setAxisFormat, getAxisFormat, setTickInterval, getTickInterval, setTodayMarker, getTodayMarker, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, enableTopAxis, topAxisEnabled, setDisplayMode, getDisplayMode, getDateFormat, setIncludes, getIncludes, setExcludes, getExcludes, getLinks, addSection, getSections, getTasks, isInvalidDate, setWeekday, getWeekday, setWeekend, checkTaskDates, fixTaskDates, getStartDate, parseDuration, getEndDate, taskCnt, parseId, compileData, parseData, lastTask, lastTaskID, rawTasks, taskDb, addTask, findTaskById, addTaskOrg, compileTasks, setLink, setClass, setClickFun, pushFun, setClickEvent, bindFunctions, ganttDb_default;
var init_ganttDb = __esm({
"src/diagrams/gantt/ganttDb.js"() {
"use strict";
@@ -75381,17 +81577,17 @@ ${content}`;
currentSection = "";
displayMode = "";
tags = ["active", "done", "crit", "milestone"];
- funs2 = [];
+ funs = [];
inclusiveEndDates = false;
topAxis = false;
weekday = "sunday";
weekend = "saturday";
lastOrder = 0;
- clear12 = /* @__PURE__ */ __name(function() {
+ clear9 = /* @__PURE__ */ __name(function() {
sections = [];
tasks = [];
currentSection = "";
- funs2 = [];
+ funs = [];
taskCnt = 0;
lastTask = void 0;
lastTaskID = void 0;
@@ -75555,8 +81751,8 @@ ${content}`;
const afterStatement = afterRePattern.exec(str2);
if (afterStatement !== null) {
let latestTask = null;
- for (const id27 of afterStatement.groups.ids.split(" ")) {
- let task = findTaskById(id27);
+ for (const id29 of afterStatement.groups.ids.split(" ")) {
+ let task = findTaskById(id29);
if (task !== void 0 && (!latestTask || task.endTime > latestTask.endTime)) {
latestTask = task;
}
@@ -75599,8 +81795,8 @@ ${content}`;
const untilStatement = untilRePattern.exec(str2);
if (untilStatement !== null) {
let earliestTask = null;
- for (const id27 of untilStatement.groups.ids.split(" ")) {
- let task = findTaskById(id27);
+ for (const id29 of untilStatement.groups.ids.split(" ")) {
+ let task = findTaskById(id29);
if (task !== void 0 && (!earliestTask || task.startTime < earliestTask.startTime)) {
earliestTask = task;
}
@@ -75644,28 +81840,28 @@ ${content}`;
} else {
ds = dataStr;
}
- const data5 = ds.split(",");
+ const data6 = ds.split(",");
const task = {};
- getTaskTags(data5, task, tags);
- for (let i2 = 0; i2 < data5.length; i2++) {
- data5[i2] = data5[i2].trim();
+ getTaskTags(data6, task, tags);
+ for (let i2 = 0; i2 < data6.length; i2++) {
+ data6[i2] = data6[i2].trim();
}
let endTimeData = "";
- switch (data5.length) {
+ switch (data6.length) {
case 1:
task.id = parseId();
task.startTime = prevTask.endTime;
- endTimeData = data5[0];
+ endTimeData = data6[0];
break;
case 2:
task.id = parseId();
- task.startTime = getStartDate(void 0, dateFormat, data5[0]);
- endTimeData = data5[1];
+ task.startTime = getStartDate(void 0, dateFormat, data6[0]);
+ endTimeData = data6[1];
break;
case 3:
- task.id = parseId(data5[0]);
- task.startTime = getStartDate(void 0, dateFormat, data5[1]);
- endTimeData = data5[2];
+ task.id = parseId(data6[0]);
+ task.startTime = getStartDate(void 0, dateFormat, data6[1]);
+ endTimeData = data6[2];
break;
default:
}
@@ -75683,13 +81879,13 @@ ${content}`;
} else {
ds = dataStr;
}
- const data5 = ds.split(",");
+ const data6 = ds.split(",");
const task = {};
- getTaskTags(data5, task, tags);
- for (let i2 = 0; i2 < data5.length; i2++) {
- data5[i2] = data5[i2].trim();
+ getTaskTags(data6, task, tags);
+ for (let i2 = 0; i2 < data6.length; i2++) {
+ data6[i2] = data6[i2].trim();
}
- switch (data5.length) {
+ switch (data6.length) {
case 1:
task.id = parseId();
task.startTime = {
@@ -75697,27 +81893,27 @@ ${content}`;
id: prevTaskId
};
task.endTime = {
- data: data5[0]
+ data: data6[0]
};
break;
case 2:
task.id = parseId();
task.startTime = {
type: "getStartDate",
- startData: data5[0]
+ startData: data6[0]
};
task.endTime = {
- data: data5[1]
+ data: data6[1]
};
break;
case 3:
- task.id = parseId(data5[0]);
+ task.id = parseId(data6[0]);
task.startTime = {
type: "getStartDate",
- startData: data5[1]
+ startData: data6[1]
};
task.endTime = {
- data: data5[2]
+ data: data6[2]
};
break;
default:
@@ -75726,18 +81922,18 @@ ${content}`;
}, "parseData");
rawTasks = [];
taskDb = {};
- addTask = /* @__PURE__ */ __name(function(descr, data5) {
+ addTask = /* @__PURE__ */ __name(function(descr, data6) {
const rawTask = {
section: currentSection,
type: currentSection,
processed: false,
manualEndTime: false,
renderEndTime: null,
- raw: { data: data5 },
+ raw: { data: data6 },
task: descr,
classes: []
};
- const taskInfo = parseData(lastTaskID, data5);
+ const taskInfo = parseData(lastTaskID, data6);
rawTask.raw.startTime = taskInfo.startTime;
rawTask.raw.endTime = taskInfo.endTime;
rawTask.id = taskInfo.id;
@@ -75752,11 +81948,11 @@ ${content}`;
lastTaskID = rawTask.id;
taskDb[rawTask.id] = pos - 1;
}, "addTask");
- findTaskById = /* @__PURE__ */ __name(function(id27) {
- const pos = taskDb[id27];
+ findTaskById = /* @__PURE__ */ __name(function(id29) {
+ const pos = taskDb[id29];
return rawTasks[pos];
}, "findTaskById");
- addTaskOrg = /* @__PURE__ */ __name(function(descr, data5) {
+ addTaskOrg = /* @__PURE__ */ __name(function(descr, data6) {
const newTask = {
section: currentSection,
type: currentSection,
@@ -75764,7 +81960,7 @@ ${content}`;
task: descr,
classes: []
};
- const taskInfo = compileData(lastTask, data5);
+ const taskInfo = compileData(lastTask, data6);
newTask.startTime = taskInfo.startTime;
newTask.endTime = taskInfo.endTime;
newTask.id = taskInfo.id;
@@ -75818,31 +82014,31 @@ ${content}`;
}
return allProcessed;
}, "compileTasks");
- setLink2 = /* @__PURE__ */ __name(function(ids, _linkStr) {
+ setLink = /* @__PURE__ */ __name(function(ids, _linkStr) {
let linkStr = _linkStr;
if (getConfig2().securityLevel !== "loose") {
linkStr = (0, import_sanitize_url4.sanitizeUrl)(_linkStr);
}
- ids.split(",").forEach(function(id27) {
- let rawTask = findTaskById(id27);
+ ids.split(",").forEach(function(id29) {
+ let rawTask = findTaskById(id29);
if (rawTask !== void 0) {
- pushFun(id27, () => {
+ pushFun(id29, () => {
window.open(linkStr, "_self");
});
- links.set(id27, linkStr);
+ links.set(id29, linkStr);
}
});
- setClass2(ids, "clickable");
+ setClass(ids, "clickable");
}, "setLink");
- setClass2 = /* @__PURE__ */ __name(function(ids, className) {
- ids.split(",").forEach(function(id27) {
- let rawTask = findTaskById(id27);
+ setClass = /* @__PURE__ */ __name(function(ids, className) {
+ ids.split(",").forEach(function(id29) {
+ let rawTask = findTaskById(id29);
if (rawTask !== void 0) {
rawTask.classes.push(className);
}
});
}, "setClass");
- setClickFun2 = /* @__PURE__ */ __name(function(id27, functionName, functionArgs) {
+ setClickFun = /* @__PURE__ */ __name(function(id29, functionName, functionArgs) {
if (getConfig2().securityLevel !== "loose") {
return;
}
@@ -75861,19 +82057,19 @@ ${content}`;
}
}
if (argList.length === 0) {
- argList.push(id27);
+ argList.push(id29);
}
- let rawTask = findTaskById(id27);
+ let rawTask = findTaskById(id29);
if (rawTask !== void 0) {
- pushFun(id27, () => {
+ pushFun(id29, () => {
utils_default2.runFunc(functionName, ...argList);
});
}
}, "setClickFun");
- pushFun = /* @__PURE__ */ __name(function(id27, callbackFunction) {
- funs2.push(
+ pushFun = /* @__PURE__ */ __name(function(id29, callbackFunction) {
+ funs.push(
function() {
- const elem = document.querySelector(`[id="${id27}"]`);
+ const elem = document.querySelector(`[id="${id29}"]`);
if (elem !== null) {
elem.addEventListener("click", function() {
callbackFunction();
@@ -75881,7 +82077,7 @@ ${content}`;
}
},
function() {
- const elem = document.querySelector(`[id="${id27}-text"]`);
+ const elem = document.querySelector(`[id="${id29}-text"]`);
if (elem !== null) {
elem.addEventListener("click", function() {
callbackFunction();
@@ -75890,20 +82086,20 @@ ${content}`;
}
);
}, "pushFun");
- setClickEvent2 = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) {
- ids.split(",").forEach(function(id27) {
- setClickFun2(id27, functionName, functionArgs);
+ setClickEvent = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) {
+ ids.split(",").forEach(function(id29) {
+ setClickFun(id29, functionName, functionArgs);
});
- setClass2(ids, "clickable");
+ setClass(ids, "clickable");
}, "setClickEvent");
- bindFunctions2 = /* @__PURE__ */ __name(function(element3) {
- funs2.forEach(function(fun) {
+ bindFunctions = /* @__PURE__ */ __name(function(element3) {
+ funs.forEach(function(fun) {
fun(element3);
});
}, "bindFunctions");
ganttDb_default = {
getConfig: /* @__PURE__ */ __name(() => getConfig2().gantt, "getConfig"),
- clear: clear12,
+ clear: clear9,
setDateFormat,
getDateFormat,
enableInclusiveEndDates,
@@ -75934,10 +82130,10 @@ ${content}`;
getIncludes,
setExcludes,
getExcludes,
- setClickEvent: setClickEvent2,
- setLink: setLink2,
+ setClickEvent,
+ setLink,
getLinks,
- bindFunctions: bindFunctions2,
+ bindFunctions,
parseDuration,
isInvalidDate,
setWeekday,
@@ -75949,7 +82145,7 @@ ${content}`;
});
// src/diagrams/gantt/ganttRenderer.js
- var import_dayjs3, setConf3, mapWeekdayToTimeFunction, getMaxIntersections, w2, draw5, ganttRenderer_default;
+ var import_dayjs3, setConf2, mapWeekdayToTimeFunction, getMaxIntersections, w2, draw5, ganttRenderer_default;
var init_ganttRenderer = __esm({
"src/diagrams/gantt/ganttRenderer.js"() {
"use strict";
@@ -75959,7 +82155,7 @@ ${content}`;
init_common();
init_diagramAPI();
init_setupGraphViewbox();
- setConf3 = /* @__PURE__ */ __name(function() {
+ setConf2 = /* @__PURE__ */ __name(function() {
log.debug("Something is calling, setConf, remove the call");
}, "setConf");
mapWeekdayToTimeFunction = {
@@ -75989,22 +82185,22 @@ ${content}`;
}
return maxIntersections;
}, "getMaxIntersections");
- draw5 = /* @__PURE__ */ __name(function(text2, id27, version4, diagObj) {
- const conf8 = getConfig2().gantt;
+ draw5 = /* @__PURE__ */ __name(function(text4, id29, version2, diagObj) {
+ const conf5 = getConfig2().gantt;
const securityLevel = getConfig2().securityLevel;
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
- const elem = doc.getElementById(id27);
+ const elem = doc.getElementById(id29);
w2 = elem.parentElement.offsetWidth;
if (w2 === void 0) {
w2 = 1200;
}
- if (conf8.useWidth !== void 0) {
- w2 = conf8.useWidth;
+ if (conf5.useWidth !== void 0) {
+ w2 = conf5.useWidth;
}
const taskArray = diagObj.db.getTasks();
let categories = [];
@@ -76013,8 +82209,8 @@ ${content}`;
}
categories = checkUnique(categories);
const categoryHeights = {};
- let h2 = 2 * conf8.topPadding;
- if (diagObj.db.getDisplayMode() === "compact" || conf8.displayMode === "compact") {
+ let h2 = 2 * conf5.topPadding;
+ if (diagObj.db.getDisplayMode() === "compact" || conf5.displayMode === "compact") {
const categoryElements = {};
for (const element3 of taskArray) {
if (categoryElements[element3.section] === void 0) {
@@ -76027,17 +82223,17 @@ ${content}`;
for (const category of Object.keys(categoryElements)) {
const categoryHeight = getMaxIntersections(categoryElements[category], intersections) + 1;
intersections += categoryHeight;
- h2 += categoryHeight * (conf8.barHeight + conf8.barGap);
+ h2 += categoryHeight * (conf5.barHeight + conf5.barGap);
categoryHeights[category] = categoryHeight;
}
} else {
- h2 += taskArray.length * (conf8.barHeight + conf8.barGap);
+ h2 += taskArray.length * (conf5.barHeight + conf5.barGap);
for (const category of categories) {
categoryHeights[category] = taskArray.filter((task) => task.type === category).length;
}
}
elem.setAttribute("viewBox", "0 0 " + w2 + " " + h2);
- const svg = root4.select(`[id="${id27}"]`);
+ const svg2 = root4.select(`[id="${id29}"]`);
const timeScale = time().domain([
min(taskArray, function(d2) {
return d2.startTime;
@@ -76045,7 +82241,7 @@ ${content}`;
max(taskArray, function(d2) {
return d2.endTime;
})
- ]).rangeRound([0, w2 - conf8.leftPadding - conf8.rightPadding]);
+ ]).rangeRound([0, w2 - conf5.leftPadding - conf5.rightPadding]);
function taskCompare(a2, b2) {
const taskA = a2.startTime;
const taskB = b2.startTime;
@@ -76060,13 +82256,13 @@ ${content}`;
__name(taskCompare, "taskCompare");
taskArray.sort(taskCompare);
makeGantt(taskArray, w2, h2);
- configureSvgSize(svg, h2, w2, conf8.useMaxWidth);
- svg.append("text").text(diagObj.db.getDiagramTitle()).attr("x", w2 / 2).attr("y", conf8.titleTopMargin).attr("class", "titleText");
+ configureSvgSize(svg2, h2, w2, conf5.useMaxWidth);
+ svg2.append("text").text(diagObj.db.getDiagramTitle()).attr("x", w2 / 2).attr("y", conf5.titleTopMargin).attr("class", "titleText");
function makeGantt(tasks4, pageWidth, pageHeight) {
- const barHeight = conf8.barHeight;
- const gap = barHeight + conf8.barGap;
- const topPadding = conf8.topPadding;
- const leftPadding = conf8.leftPadding;
+ const barHeight = conf5.barHeight;
+ const gap = barHeight + conf5.barGap;
+ const topPadding = conf5.topPadding;
+ const leftPadding = conf5.leftPadding;
const colorScale = linear2().domain([0, categories.length]).range(["#00B9FA", "#F95002"]).interpolate(hcl_default);
drawExcludeDays(
gap,
@@ -76086,21 +82282,21 @@ ${content}`;
__name(makeGantt, "makeGantt");
function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w3) {
const uniqueTaskOrderIds = [...new Set(theArray.map((item) => item.order))];
- const uniqueTasks = uniqueTaskOrderIds.map((id28) => theArray.find((item) => item.order === id28));
- svg.append("g").selectAll("rect").data(uniqueTasks).enter().append("rect").attr("x", 0).attr("y", function(d2, i2) {
+ const uniqueTasks = uniqueTaskOrderIds.map((id30) => theArray.find((item) => item.order === id30));
+ svg2.append("g").selectAll("rect").data(uniqueTasks).enter().append("rect").attr("x", 0).attr("y", function(d2, i2) {
i2 = d2.order;
return i2 * theGap + theTopPad - 2;
}).attr("width", function() {
- return w3 - conf8.rightPadding / 2;
+ return w3 - conf5.rightPadding / 2;
}).attr("height", theGap).attr("class", function(d2) {
for (const [i2, category] of categories.entries()) {
if (d2.type === category) {
- return "section section" + i2 % conf8.numberSectionStyles;
+ return "section section" + i2 % conf5.numberSectionStyles;
}
}
return "section section0";
});
- const rectangles = svg.append("g").selectAll("rect").data(theArray).enter();
+ const rectangles = svg2.append("g").selectAll("rect").data(theArray).enter();
const links3 = diagObj.db.getLinks();
rectangles.append("rect").attr("id", function(d2) {
return d2.id;
@@ -76129,7 +82325,7 @@ ${content}`;
let secNum = 0;
for (const [i2, category] of categories.entries()) {
if (d2.type === category) {
- secNum = i2 % conf8.numberSectionStyles;
+ secNum = i2 % conf5.numberSectionStyles;
}
}
let taskClass = "";
@@ -76164,7 +82360,7 @@ ${content}`;
return d2.id + "-text";
}).text(function(d2) {
return d2.task;
- }).attr("font-size", conf8.fontSize).attr("x", function(d2) {
+ }).attr("font-size", conf5.fontSize).attr("x", function(d2) {
let startX2 = timeScale(d2.startTime);
let endX = timeScale(d2.renderEndTime || d2.endTime);
if (d2.milestone) {
@@ -76175,7 +82371,7 @@ ${content}`;
}
const textWidth = this.getBBox().width;
if (textWidth > endX - startX2) {
- if (endX + textWidth + 1.5 * conf8.leftPadding > w3) {
+ if (endX + textWidth + 1.5 * conf5.leftPadding > w3) {
return startX2 + theSidePad - 5;
} else {
return endX + theSidePad + 5;
@@ -76185,7 +82381,7 @@ ${content}`;
}
}).attr("y", function(d2, i2) {
i2 = d2.order;
- return i2 * theGap + conf8.barHeight / 2 + (conf8.fontSize / 2 - 2) + theTopPad;
+ return i2 * theGap + conf5.barHeight / 2 + (conf5.fontSize / 2 - 2) + theTopPad;
}).attr("text-height", theBarHeight).attr("class", function(d2) {
const startX2 = timeScale(d2.startTime);
let endX = timeScale(d2.endTime);
@@ -76200,7 +82396,7 @@ ${content}`;
let secNum = 0;
for (const [i2, category] of categories.entries()) {
if (d2.type === category) {
- secNum = i2 % conf8.numberSectionStyles;
+ secNum = i2 % conf5.numberSectionStyles;
}
}
let taskType = "";
@@ -76226,7 +82422,7 @@ ${content}`;
taskType += " milestoneText";
}
if (textWidth > endX - startX2) {
- if (endX + textWidth + 1.5 * conf8.leftPadding > w3) {
+ if (endX + textWidth + 1.5 * conf5.leftPadding > w3) {
return classStr + " taskTextOutsideLeft taskTextOutside" + secNum + " " + taskType;
} else {
return classStr + " taskTextOutsideRight taskTextOutside" + secNum + " " + taskType + " width-" + textWidth;
@@ -76238,7 +82434,7 @@ ${content}`;
const securityLevel2 = getConfig2().securityLevel;
if (securityLevel2 === "sandbox") {
let sandboxElement2;
- sandboxElement2 = select_default2("#i" + id27);
+ sandboxElement2 = select_default2("#i" + id29);
const doc2 = sandboxElement2.nodes()[0].contentDocument;
rectangles.filter(function(d2) {
return links3.has(d2.id);
@@ -76301,29 +82497,29 @@ ${content}`;
}
d2 = d2.add(1, "d");
}
- const rectangles = svg.append("g").selectAll("rect").data(excludeRanges).enter();
+ const rectangles = svg2.append("g").selectAll("rect").data(excludeRanges).enter();
rectangles.append("rect").attr("id", function(d3) {
return "exclude-" + d3.start.format("YYYY-MM-DD");
}).attr("x", function(d3) {
return timeScale(d3.start) + theSidePad;
- }).attr("y", conf8.gridLineStartPadding).attr("width", function(d3) {
+ }).attr("y", conf5.gridLineStartPadding).attr("width", function(d3) {
const renderEnd = d3.end.add(1, "day");
return timeScale(renderEnd) - timeScale(d3.start);
- }).attr("height", h3 - theTopPad - conf8.gridLineStartPadding).attr("transform-origin", function(d3, i2) {
+ }).attr("height", h3 - theTopPad - conf5.gridLineStartPadding).attr("transform-origin", function(d3, i2) {
return (timeScale(d3.start) + theSidePad + 0.5 * (timeScale(d3.end) - timeScale(d3.start))).toString() + "px " + (i2 * theGap + 0.5 * h3).toString() + "px";
}).attr("class", "exclude-range");
}
__name(drawExcludeDays, "drawExcludeDays");
function makeGrid(theSidePad, theTopPad, w3, h3) {
- let bottomXAxis = axisBottom(timeScale).tickSize(-h3 + theTopPad + conf8.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf8.axisFormat || "%Y-%m-%d"));
+ let bottomXAxis = axisBottom(timeScale).tickSize(-h3 + theTopPad + conf5.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf5.axisFormat || "%Y-%m-%d"));
const reTickInterval = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/;
const resultTickInterval = reTickInterval.exec(
- diagObj.db.getTickInterval() || conf8.tickInterval
+ diagObj.db.getTickInterval() || conf5.tickInterval
);
if (resultTickInterval !== null) {
const every3 = resultTickInterval[1];
const interval2 = resultTickInterval[2];
- const weekday2 = diagObj.db.getWeekday() || conf8.weekday;
+ const weekday2 = diagObj.db.getWeekday() || conf5.weekday;
switch (interval2) {
case "millisecond":
bottomXAxis.ticks(millisecond.every(every3));
@@ -76348,13 +82544,13 @@ ${content}`;
break;
}
}
- svg.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + (h3 - 50) + ")").call(bottomXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em");
- if (diagObj.db.topAxisEnabled() || conf8.topAxis) {
- let topXAxis = axisTop(timeScale).tickSize(-h3 + theTopPad + conf8.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf8.axisFormat || "%Y-%m-%d"));
+ svg2.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + (h3 - 50) + ")").call(bottomXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em");
+ if (diagObj.db.topAxisEnabled() || conf5.topAxis) {
+ let topXAxis = axisTop(timeScale).tickSize(-h3 + theTopPad + conf5.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf5.axisFormat || "%Y-%m-%d"));
if (resultTickInterval !== null) {
const every3 = resultTickInterval[1];
const interval2 = resultTickInterval[2];
- const weekday2 = diagObj.db.getWeekday() || conf8.weekday;
+ const weekday2 = diagObj.db.getWeekday() || conf5.weekday;
switch (interval2) {
case "millisecond":
topXAxis.ticks(millisecond.every(every3));
@@ -76379,14 +82575,14 @@ ${content}`;
break;
}
}
- svg.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + theTopPad + ")").call(topXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10);
+ svg2.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + theTopPad + ")").call(topXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10);
}
}
__name(makeGrid, "makeGrid");
function vertLabels(theGap, theTopPad) {
let prevGap = 0;
const numOccurrences = Object.keys(categoryHeights).map((d2) => [d2, categoryHeights[d2]]);
- svg.append("g").selectAll("text").data(numOccurrences).enter().append(function(d2) {
+ svg2.append("g").selectAll("text").data(numOccurrences).enter().append(function(d2) {
const rows = d2[0].split(common_default.lineBreakRegex);
const dy = -(rows.length - 1) / 2;
const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text");
@@ -76411,10 +82607,10 @@ ${content}`;
} else {
return d2[1] * theGap / 2 + theTopPad;
}
- }).attr("font-size", conf8.sectionFontSize).attr("class", function(d2) {
+ }).attr("font-size", conf5.sectionFontSize).attr("class", function(d2) {
for (const [i2, category] of categories.entries()) {
if (d2[0] === category) {
- return "sectionTitle sectionTitle" + i2 % conf8.numberSectionStyles;
+ return "sectionTitle sectionTitle" + i2 % conf5.numberSectionStyles;
}
}
return "sectionTitle";
@@ -76426,10 +82622,10 @@ ${content}`;
if (todayMarker2 === "off") {
return;
}
- const todayG = svg.append("g").attr("class", "today");
+ const todayG = svg2.append("g").attr("class", "today");
const today = /* @__PURE__ */ new Date();
const todayLine = todayG.append("line");
- todayLine.attr("x1", timeScale(today) + theSidePad).attr("x2", timeScale(today) + theSidePad).attr("y1", conf8.titleTopMargin).attr("y2", h3 - conf8.titleTopMargin).attr("class", "today");
+ todayLine.attr("x1", timeScale(today) + theSidePad).attr("x2", timeScale(today) + theSidePad).attr("y1", conf5.titleTopMargin).attr("y2", h3 - conf5.titleTopMargin).attr("class", "today");
if (todayMarker2 !== "") {
todayLine.attr("style", todayMarker2.replace(/,/g, ";"));
}
@@ -76449,7 +82645,7 @@ ${content}`;
__name(checkUnique, "checkUnique");
}, "draw");
ganttRenderer_default = {
- setConf: setConf3,
+ setConf: setConf2,
draw: draw5
};
}
@@ -76462,7 +82658,7 @@ ${content}`;
"use strict";
getStyles6 = /* @__PURE__ */ __name((options3) => `
.mermaid-main-font {
- font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
+ font-family: ${options3.fontFamily};
}
.exclude-range {
@@ -76506,7 +82702,7 @@ ${content}`;
.sectionTitle {
text-anchor: start;
- font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
+ font-family: ${options3.fontFamily};
}
@@ -76547,13 +82743,13 @@ ${content}`;
.taskText {
text-anchor: middle;
- font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
+ font-family: ${options3.fontFamily};
}
.taskTextOutsideRight {
fill: ${options3.taskTextDarkColor};
text-anchor: start;
- font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
+ font-family: ${options3.fontFamily};
}
.taskTextOutsideLeft {
@@ -76709,7 +82905,7 @@ ${content}`;
text-anchor: middle;
font-size: 18px;
fill: ${options3.titleColor || options3.textColor};
- font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
+ font-family: ${options3.fontFamily};
}
`, "getStyles");
styles_default6 = getStyles6;
@@ -76747,7 +82943,7 @@ ${content}`;
init_logger();
parser7 = {
parse: /* @__PURE__ */ __name(async (input) => {
- const ast = await parse2("info", input);
+ const ast = await parse("info", input);
log.debug(ast);
}, "parse")
};
@@ -76755,10 +82951,149 @@ ${content}`;
});
// package.json
- var version2;
+ var package_default;
var init_package = __esm({
"package.json"() {
- version2 = "11.2.0";
+ package_default = {
+ name: "mermaid",
+ version: "11.6.0",
+ description: "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",
+ type: "module",
+ module: "./dist/mermaid.core.mjs",
+ types: "./dist/mermaid.d.ts",
+ exports: {
+ ".": {
+ types: "./dist/mermaid.d.ts",
+ import: "./dist/mermaid.core.mjs",
+ default: "./dist/mermaid.core.mjs"
+ },
+ "./*": "./*"
+ },
+ keywords: [
+ "diagram",
+ "markdown",
+ "flowchart",
+ "sequence diagram",
+ "gantt",
+ "class diagram",
+ "git graph",
+ "mindmap",
+ "packet diagram",
+ "c4 diagram",
+ "er diagram",
+ "pie chart",
+ "pie diagram",
+ "quadrant chart",
+ "requirement diagram",
+ "graph"
+ ],
+ scripts: {
+ clean: "rimraf dist",
+ dev: "pnpm -w dev",
+ "docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup",
+ "docs:build": "rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts",
+ "docs:verify": "pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify",
+ "docs:pre:vitepress": "pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts",
+ "docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing",
+ "docs:dev": 'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',
+ "docs:dev:docker": 'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',
+ "docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
+ "docs:spellcheck": 'cspell "src/docs/**/*.md"',
+ "docs:release-version": "tsx scripts/update-release-version.mts",
+ "docs:verify-version": "tsx scripts/update-release-version.mts --verify",
+ "types:build-config": "tsx scripts/create-types-from-json-schema.mts",
+ "types:verify-config": "tsx scripts/create-types-from-json-schema.mts --verify",
+ checkCircle: "npx madge --circular ./src",
+ prepublishOnly: "pnpm docs:verify-version"
+ },
+ repository: {
+ type: "git",
+ url: "https://github.com/mermaid-js/mermaid"
+ },
+ author: "Knut Sveidqvist",
+ license: "MIT",
+ standard: {
+ ignore: [
+ "**/parser/*.js",
+ "dist/**/*.js",
+ "cypress/**/*.js"
+ ],
+ globals: [
+ "page"
+ ]
+ },
+ dependencies: {
+ "@braintree/sanitize-url": "^7.0.4",
+ "@iconify/utils": "^2.1.33",
+ "@mermaid-js/parser": "workspace:^",
+ "@types/d3": "^7.4.3",
+ cytoscape: "^3.29.3",
+ "cytoscape-cose-bilkent": "^4.1.0",
+ "cytoscape-fcose": "^2.2.0",
+ d3: "^7.9.0",
+ "d3-sankey": "^0.12.3",
+ "dagre-d3-es": "7.0.11",
+ dayjs: "^1.11.13",
+ dompurify: "^3.2.4",
+ katex: "^0.16.9",
+ khroma: "^2.1.0",
+ "lodash-es": "^4.17.21",
+ marked: "^15.0.7",
+ roughjs: "^4.6.6",
+ stylis: "^4.3.6",
+ "ts-dedent": "^2.2.0",
+ uuid: "^11.1.0"
+ },
+ devDependencies: {
+ "@adobe/jsonschema2md": "^8.0.2",
+ "@iconify/types": "^2.0.0",
+ "@types/cytoscape": "^3.21.9",
+ "@types/cytoscape-fcose": "^2.2.4",
+ "@types/d3-sankey": "^0.12.4",
+ "@types/d3-scale": "^4.0.9",
+ "@types/d3-scale-chromatic": "^3.1.0",
+ "@types/d3-selection": "^3.0.11",
+ "@types/d3-shape": "^3.1.7",
+ "@types/jsdom": "^21.1.7",
+ "@types/katex": "^0.16.7",
+ "@types/lodash-es": "^4.17.12",
+ "@types/micromatch": "^4.0.9",
+ "@types/stylis": "^4.2.7",
+ "@types/uuid": "^10.0.0",
+ ajv: "^8.17.1",
+ chokidar: "^4.0.3",
+ concurrently: "^9.1.2",
+ "csstree-validator": "^4.0.1",
+ globby: "^14.0.2",
+ jison: "^0.4.18",
+ "js-base64": "^3.7.7",
+ jsdom: "^26.0.0",
+ "json-schema-to-typescript": "^15.0.4",
+ micromatch: "^4.0.8",
+ "path-browserify": "^1.0.1",
+ prettier: "^3.5.2",
+ remark: "^15.0.1",
+ "remark-frontmatter": "^5.0.0",
+ "remark-gfm": "^4.0.1",
+ rimraf: "^6.0.1",
+ "start-server-and-test": "^2.0.10",
+ "type-fest": "^4.35.0",
+ typedoc: "^0.27.8",
+ "typedoc-plugin-markdown": "^4.4.2",
+ typescript: "~5.7.3",
+ "unist-util-flatmap": "^1.0.0",
+ "unist-util-visit": "^5.0.0",
+ vitepress: "^1.0.2",
+ "vitepress-plugin-search": "1.0.4-alpha.22"
+ },
+ files: [
+ "dist/",
+ "README.md"
+ ],
+ publishConfig: {
+ access: "public"
+ }
+ };
}
});
@@ -76768,7 +83103,7 @@ ${content}`;
"src/diagrams/info/infoDb.ts"() {
"use strict";
init_package();
- DEFAULT_INFO_DB = { version: version2 };
+ DEFAULT_INFO_DB = { version: package_default.version };
getVersion = /* @__PURE__ */ __name(() => DEFAULT_INFO_DB.version, "getVersion");
db2 = {
getVersion
@@ -76783,16 +83118,16 @@ ${content}`;
"use strict";
init_src32();
init_diagramAPI();
- selectSvgElement = /* @__PURE__ */ __name((id27) => {
+ selectSvgElement = /* @__PURE__ */ __name((id29) => {
const { securityLevel } = getConfig2();
let root4 = select_default2("body");
if (securityLevel === "sandbox") {
- const sandboxElement = select_default2(`#i${id27}`);
+ const sandboxElement = select_default2(`#i${id29}`);
const doc = sandboxElement.node()?.contentDocument ?? document;
root4 = select_default2(doc.body);
}
- const svg = root4.select(`#${id27}`);
- return svg;
+ const svg2 = root4.select(`#${id29}`);
+ return svg2;
}, "selectSvgElement");
}
});
@@ -76805,12 +83140,12 @@ ${content}`;
init_logger();
init_selectSvgElement();
init_setupGraphViewbox();
- draw6 = /* @__PURE__ */ __name((text2, id27, version4) => {
- log.debug("rendering info diagram\n" + text2);
- const svg = selectSvgElement(id27);
- configureSvgSize(svg, 100, 400, true);
- const group2 = svg.append("g");
- group2.append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${version4}`);
+ draw6 = /* @__PURE__ */ __name((text4, id29, version2) => {
+ log.debug("rendering info diagram\n" + text4);
+ const svg2 = selectSvgElement(id29);
+ configureSvgSize(svg2, 100, 400, true);
+ const group2 = svg2.append("g");
+ group2.append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${version2}`);
}, "draw");
renderer = { draw: draw6 };
}
@@ -76837,7 +83172,7 @@ ${content}`;
});
// src/diagrams/pie/pieDb.ts
- var DEFAULT_PIE_CONFIG, DEFAULT_PIE_DB, sections2, showData, config3, getConfig4, clear13, addSection2, getSections2, setShowData, getShowData, db3;
+ var DEFAULT_PIE_CONFIG, DEFAULT_PIE_DB, sections2, showData, config2, getConfig4, clear10, addSection2, getSections2, setShowData, getShowData, db3;
var init_pieDb = __esm({
"src/diagrams/pie/pieDb.ts"() {
"use strict";
@@ -76852,9 +83187,9 @@ ${content}`;
};
sections2 = DEFAULT_PIE_DB.sections;
showData = DEFAULT_PIE_DB.showData;
- config3 = structuredClone(DEFAULT_PIE_CONFIG);
- getConfig4 = /* @__PURE__ */ __name(() => structuredClone(config3), "getConfig");
- clear13 = /* @__PURE__ */ __name(() => {
+ config2 = structuredClone(DEFAULT_PIE_CONFIG);
+ getConfig4 = /* @__PURE__ */ __name(() => structuredClone(config2), "getConfig");
+ clear10 = /* @__PURE__ */ __name(() => {
sections2 = /* @__PURE__ */ new Map();
showData = DEFAULT_PIE_DB.showData;
clear();
@@ -76872,7 +83207,7 @@ ${content}`;
getShowData = /* @__PURE__ */ __name(() => showData, "getShowData");
db3 = {
getConfig: getConfig4,
- clear: clear13,
+ clear: clear10,
setDiagramTitle,
getDiagramTitle,
setAccTitle,
@@ -76896,14 +83231,14 @@ ${content}`;
init_logger();
init_populateCommonDb();
init_pieDb();
- populateDb = /* @__PURE__ */ __name((ast, db8) => {
- populateCommonDb(ast, db8);
- db8.setShowData(ast.showData);
- ast.sections.map(db8.addSection);
+ populateDb = /* @__PURE__ */ __name((ast, db10) => {
+ populateCommonDb(ast, db10);
+ db10.setShowData(ast.showData);
+ ast.sections.map(db10.addSection);
}, "populateDb");
parser8 = {
parse: /* @__PURE__ */ __name(async (input) => {
- const ast = await parse2("pie", input);
+ const ast = await parse("pie", input);
log.debug(ast);
populateDb(ast, db3);
}, "parse")
@@ -76960,8 +83295,8 @@ ${content}`;
init_selectSvgElement();
init_setupGraphViewbox();
init_utils2();
- createPieArcs = /* @__PURE__ */ __name((sections5) => {
- const pieData = [...sections5.entries()].map((element3) => {
+ createPieArcs = /* @__PURE__ */ __name((sections6) => {
+ const pieData = [...sections6.entries()].map((element3) => {
return {
label: element3[0],
value: element3[1]
@@ -76974,18 +83309,18 @@ ${content}`;
);
return pie2(pieData);
}, "createPieArcs");
- draw7 = /* @__PURE__ */ __name((text2, id27, _version, diagObj) => {
- log.debug("rendering pie chart\n" + text2);
- const db8 = diagObj.db;
+ draw7 = /* @__PURE__ */ __name((text4, id29, _version, diagObj) => {
+ log.debug("rendering pie chart\n" + text4);
+ const db10 = diagObj.db;
const globalConfig = getConfig2();
- const pieConfig = cleanAndMerge(db8.getConfig(), globalConfig.pie);
+ const pieConfig = cleanAndMerge(db10.getConfig(), globalConfig.pie);
const MARGIN = 40;
const LEGEND_RECT_SIZE = 18;
const LEGEND_SPACING = 4;
const height2 = 450;
const pieWidth = height2;
- const svg = selectSvgElement(id27);
- const group2 = svg.append("g");
+ const svg2 = selectSvgElement(id29);
+ const group2 = svg2.append("g");
group2.attr("transform", "translate(" + pieWidth / 2 + "," + height2 / 2 + ")");
const { themeVariables } = globalConfig;
let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth);
@@ -76995,8 +83330,8 @@ ${content}`;
const arcGenerator = arc_default().innerRadius(0).outerRadius(radius2);
const labelArcGenerator = arc_default().innerRadius(radius2 * textPosition).outerRadius(radius2 * textPosition);
group2.append("circle").attr("cx", 0).attr("cy", 0).attr("r", radius2 + outerStrokeWidth / 2).attr("class", "pieOuterCircle");
- const sections5 = db8.getSections();
- const arcs = createPieArcs(sections5);
+ const sections6 = db10.getSections();
+ const arcs = createPieArcs(sections6);
const myGeneratedColors = [
themeVariables.pie1,
themeVariables.pie2,
@@ -77016,7 +83351,7 @@ ${content}`;
return color2(datum2.data.label);
}).attr("class", "pieCircle");
let sum2 = 0;
- sections5.forEach((section) => {
+ sections6.forEach((section) => {
sum2 += section;
});
group2.selectAll("mySlices").data(arcs).enter().append("text").text((datum2) => {
@@ -77024,7 +83359,7 @@ ${content}`;
}).attr("transform", (datum2) => {
return "translate(" + labelArcGenerator.centroid(datum2) + ")";
}).style("text-anchor", "middle").attr("class", "slice");
- group2.append("text").text(db8.getDiagramTitle()).attr("x", 0).attr("y", -(height2 - 50) / 2).attr("class", "pieTitleText");
+ group2.append("text").text(db10.getDiagramTitle()).attr("x", 0).attr("y", -(height2 - 50) / 2).attr("class", "pieTitleText");
const legend = group2.selectAll(".legend").data(color2.domain()).enter().append("g").attr("class", "legend").attr("transform", (_datum, index) => {
const height3 = LEGEND_RECT_SIZE + LEGEND_SPACING;
const offset = height3 * color2.domain().length / 2;
@@ -77035,7 +83370,7 @@ ${content}`;
legend.append("rect").attr("width", LEGEND_RECT_SIZE).attr("height", LEGEND_RECT_SIZE).style("fill", color2).style("stroke", color2);
legend.data(arcs).append("text").attr("x", LEGEND_RECT_SIZE + LEGEND_SPACING).attr("y", LEGEND_RECT_SIZE - LEGEND_SPACING).text((datum2) => {
const { label, value: value2 } = datum2.data;
- if (db8.getShowData()) {
+ if (db10.getShowData()) {
return `${label} [${value2}]`;
}
return label;
@@ -77044,8 +83379,8 @@ ${content}`;
...legend.selectAll("text").nodes().map((node2) => node2?.getBoundingClientRect().width ?? 0)
);
const totalWidth = pieWidth + MARGIN + LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth;
- svg.attr("viewBox", `0 0 ${totalWidth} ${height2}`);
- configureSvgSize(svg, height2, totalWidth, pieConfig.useMaxWidth);
+ svg2.attr("viewBox", `0 0 ${totalWidth} ${height2}`);
+ configureSvgSize(svg2, height2, totalWidth, pieConfig.useMaxWidth);
}, "draw");
renderer2 = { draw: draw7 };
}
@@ -77083,7 +83418,7 @@ ${content}`;
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [1, 7], $V5 = [1, 4, 5, 10, 12, 13, 14, 18, 25, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], $V6 = [1, 4, 5, 10, 12, 13, 14, 18, 25, 28, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], $V7 = [55, 56, 57], $V8 = [2, 36], $V9 = [1, 37], $Va = [1, 36], $Vb = [1, 38], $Vc = [1, 35], $Vd = [1, 43], $Ve = [1, 41], $Vf = [1, 14], $Vg = [1, 23], $Vh = [1, 18], $Vi = [1, 19], $Vj = [1, 20], $Vk = [1, 21], $Vl = [1, 22], $Vm = [1, 24], $Vn = [1, 25], $Vo = [1, 26], $Vp = [1, 27], $Vq = [1, 28], $Vr = [1, 29], $Vs = [1, 32], $Vt = [1, 33], $Vu = [1, 34], $Vv = [1, 39], $Vw = [1, 40], $Vx = [1, 42], $Vy = [1, 44], $Vz = [1, 62], $VA = [1, 61], $VB = [4, 5, 8, 10, 12, 13, 14, 18, 44, 47, 49, 55, 56, 57, 63, 64, 65, 66, 67], $VC = [1, 65], $VD = [1, 66], $VE = [1, 67], $VF = [1, 68], $VG = [1, 69], $VH = [1, 70], $VI = [1, 71], $VJ = [1, 72], $VK = [1, 73], $VL = [1, 74], $VM = [1, 75], $VN = [1, 76], $VO = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18], $VP = [1, 90], $VQ = [1, 91], $VR = [1, 92], $VS = [1, 99], $VT = [1, 93], $VU = [1, 96], $VV = [1, 94], $VW = [1, 95], $VX = [1, 97], $VY = [1, 98], $VZ = [1, 102], $V_ = [10, 55, 56, 57], $V$ = [4, 5, 6, 8, 10, 11, 13, 17, 18, 19, 20, 55, 56, 57];
- var parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -77210,7 +83545,7 @@ ${content}`;
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -77240,7 +83575,7 @@ ${content}`;
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -77252,22 +83587,22 @@ ${content}`;
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -77286,7 +83621,7 @@ ${content}`;
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -77586,7 +83921,7 @@ ${content}`;
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -77807,13 +84142,13 @@ ${content}`;
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser9.parser = parser9;
@@ -77906,18 +84241,18 @@ ${content}`;
this.classes = /* @__PURE__ */ new Map();
log.info("clear called");
}
- setData(data5) {
- this.data = { ...this.data, ...data5 };
+ setData(data6) {
+ this.data = { ...this.data, ...data6 };
}
addPoints(points) {
this.data.points = [...points, ...this.data.points];
}
- addClass(className, styles3) {
- this.classes.set(className, styles3);
+ addClass(className, styles4) {
+ this.classes.set(className, styles4);
}
- setConfig(config6) {
- log.trace("setConfig called with: ", config6);
- this.config = { ...this.config, ...config6 };
+ setConfig(config5) {
+ log.trace("setConfig called with: ", config5);
+ this.config = { ...this.config, ...config5 };
}
setThemeConfig(themeConfig) {
log.trace("setThemeConfig called with: ", themeConfig);
@@ -78271,8 +84606,8 @@ ${content}`;
});
// src/diagrams/quadrant-chart/quadrantDb.ts
- function textSanitizer(text2) {
- return sanitizeText(text2.trim(), config4);
+ function textSanitizer(text4) {
+ return sanitizeText(text4.trim(), config3);
}
function setQuadrant1Text(textObj) {
quadrantBuilder.setData({ quadrant1Text: textSanitizer(textObj.text) });
@@ -78298,9 +84633,9 @@ ${content}`;
function setYAxisBottomText(textObj) {
quadrantBuilder.setData({ yAxisBottomText: textSanitizer(textObj.text) });
}
- function parseStyles(styles3) {
+ function parseStyles(styles4) {
const stylesObject = {};
- for (const style3 of styles3) {
+ for (const style3 of styles4) {
const [key, value2] = style3.trim().split(/\s*:\s*/);
if (key === "radius") {
if (validateNumber(value2)) {
@@ -78328,8 +84663,8 @@ ${content}`;
}
return stylesObject;
}
- function addPoint(textObj, className, x5, y5, styles3) {
- const stylesObject = parseStyles(styles3);
+ function addPoint(textObj, className, x5, y5, styles4) {
+ const stylesObject = parseStyles(styles4);
quadrantBuilder.addPoints([
{
x: x5,
@@ -78340,8 +84675,8 @@ ${content}`;
}
]);
}
- function addClass2(className, styles3) {
- quadrantBuilder.addClass(className, parseStyles(styles3));
+ function addClass(className, styles4) {
+ quadrantBuilder.addClass(className, parseStyles(styles4));
}
function setWidth(width3) {
quadrantBuilder.setConfig({ chartWidth: width3 });
@@ -78350,8 +84685,8 @@ ${content}`;
quadrantBuilder.setConfig({ chartHeight: height2 });
}
function getQuadrantData() {
- const config6 = getConfig2();
- const { themeVariables, quadrantChart: quadrantChartConfig } = config6;
+ const config5 = getConfig2();
+ const { themeVariables, quadrantChart: quadrantChartConfig } = config5;
if (quadrantChartConfig) {
quadrantBuilder.setConfig(quadrantChartConfig);
}
@@ -78375,7 +84710,7 @@ ${content}`;
quadrantBuilder.setData({ titleText: getDiagramTitle() });
return quadrantBuilder.build();
}
- var config4, quadrantBuilder, clear14, quadrantDb_default;
+ var config3, quadrantBuilder, clear11, quadrantDb_default;
var init_quadrantDb = __esm({
"src/diagrams/quadrant-chart/quadrantDb.ts"() {
"use strict";
@@ -78384,7 +84719,7 @@ ${content}`;
init_commonDb();
init_quadrantBuilder();
init_utils5();
- config4 = getConfig2();
+ config3 = getConfig2();
__name(textSanitizer, "textSanitizer");
quadrantBuilder = new QuadrantBuilder();
__name(setQuadrant1Text, "setQuadrant1Text");
@@ -78397,11 +84732,11 @@ ${content}`;
__name(setYAxisBottomText, "setYAxisBottomText");
__name(parseStyles, "parseStyles");
__name(addPoint, "addPoint");
- __name(addClass2, "addClass");
+ __name(addClass, "addClass");
__name(setWidth, "setWidth");
__name(setHeight, "setHeight");
__name(getQuadrantData, "getQuadrantData");
- clear14 = /* @__PURE__ */ __name(function() {
+ clear11 = /* @__PURE__ */ __name(function() {
quadrantBuilder.clear();
clear();
}, "clear");
@@ -78418,9 +84753,9 @@ ${content}`;
setYAxisBottomText,
parseStyles,
addPoint,
- addClass: addClass2,
+ addClass,
getQuadrantData,
- clear: clear14,
+ clear: clear11,
setAccTitle,
getAccTitle,
setDiagramTitle,
@@ -78440,7 +84775,7 @@ ${content}`;
init_diagramAPI();
init_logger();
init_setupGraphViewbox();
- draw8 = /* @__PURE__ */ __name((txt, id27, _version, diagObj) => {
+ draw8 = /* @__PURE__ */ __name((txt, id29, _version, diagObj) => {
function getDominantBaseLine(horizontalPos) {
return horizontalPos === "top" ? "hanging" : "middle";
}
@@ -78449,24 +84784,24 @@ ${content}`;
return verticalPos === "left" ? "start" : "middle";
}
__name(getTextAnchor, "getTextAnchor");
- function getTransformation(data5) {
- return `translate(${data5.x}, ${data5.y}) rotate(${data5.rotation || 0})`;
+ function getTransformation(data6) {
+ return `translate(${data6.x}, ${data6.y}) rotate(${data6.rotation || 0})`;
}
__name(getTransformation, "getTransformation");
- const conf8 = getConfig2();
+ const conf5 = getConfig2();
log.debug("Rendering quadrant chart\n" + txt);
- const securityLevel = conf8.securityLevel;
+ const securityLevel = conf5.securityLevel;
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const svg = root4.select(`[id="${id27}"]`);
- const group2 = svg.append("g").attr("class", "main");
- const width3 = conf8.quadrantChart?.chartWidth ?? 500;
- const height2 = conf8.quadrantChart?.chartHeight ?? 500;
- configureSvgSize(svg, height2, width3, conf8.quadrantChart?.useMaxWidth ?? true);
- svg.attr("viewBox", "0 0 " + width3 + " " + height2);
+ const svg2 = root4.select(`[id="${id29}"]`);
+ const group2 = svg2.append("g").attr("class", "main");
+ const width3 = conf5.quadrantChart?.chartWidth ?? 500;
+ const height2 = conf5.quadrantChart?.chartHeight ?? 500;
+ configureSvgSize(svg2, height2, width3, conf5.quadrantChart?.useMaxWidth ?? true);
+ svg2.attr("viewBox", "0 0 " + width3 + " " + height2);
diagObj.db.setHeight(height2);
diagObj.db.setWidth(width3);
const quadrantData = diagObj.db.getQuadrantData();
@@ -78479,22 +84814,22 @@ ${content}`;
titleGroup.append("text").attr("x", 0).attr("y", 0).attr("fill", quadrantData.title.fill).attr("font-size", quadrantData.title.fontSize).attr("dominant-baseline", getDominantBaseLine(quadrantData.title.horizontalPos)).attr("text-anchor", getTextAnchor(quadrantData.title.verticalPos)).attr("transform", getTransformation(quadrantData.title)).text(quadrantData.title.text);
}
if (quadrantData.borderLines) {
- borderGroup.selectAll("line").data(quadrantData.borderLines).enter().append("line").attr("x1", (data5) => data5.x1).attr("y1", (data5) => data5.y1).attr("x2", (data5) => data5.x2).attr("y2", (data5) => data5.y2).style("stroke", (data5) => data5.strokeFill).style("stroke-width", (data5) => data5.strokeWidth);
+ borderGroup.selectAll("line").data(quadrantData.borderLines).enter().append("line").attr("x1", (data6) => data6.x1).attr("y1", (data6) => data6.y1).attr("x2", (data6) => data6.x2).attr("y2", (data6) => data6.y2).style("stroke", (data6) => data6.strokeFill).style("stroke-width", (data6) => data6.strokeWidth);
}
const quadrants = quadrantsGroup.selectAll("g.quadrant").data(quadrantData.quadrants).enter().append("g").attr("class", "quadrant");
- quadrants.append("rect").attr("x", (data5) => data5.x).attr("y", (data5) => data5.y).attr("width", (data5) => data5.width).attr("height", (data5) => data5.height).attr("fill", (data5) => data5.fill);
- quadrants.append("text").attr("x", 0).attr("y", 0).attr("fill", (data5) => data5.text.fill).attr("font-size", (data5) => data5.text.fontSize).attr(
+ quadrants.append("rect").attr("x", (data6) => data6.x).attr("y", (data6) => data6.y).attr("width", (data6) => data6.width).attr("height", (data6) => data6.height).attr("fill", (data6) => data6.fill);
+ quadrants.append("text").attr("x", 0).attr("y", 0).attr("fill", (data6) => data6.text.fill).attr("font-size", (data6) => data6.text.fontSize).attr(
"dominant-baseline",
- (data5) => getDominantBaseLine(data5.text.horizontalPos)
- ).attr("text-anchor", (data5) => getTextAnchor(data5.text.verticalPos)).attr("transform", (data5) => getTransformation(data5.text)).text((data5) => data5.text.text);
+ (data6) => getDominantBaseLine(data6.text.horizontalPos)
+ ).attr("text-anchor", (data6) => getTextAnchor(data6.text.verticalPos)).attr("transform", (data6) => getTransformation(data6.text)).text((data6) => data6.text.text);
const labels = labelGroup.selectAll("g.label").data(quadrantData.axisLabels).enter().append("g").attr("class", "label");
- labels.append("text").attr("x", 0).attr("y", 0).text((data5) => data5.text).attr("fill", (data5) => data5.fill).attr("font-size", (data5) => data5.fontSize).attr("dominant-baseline", (data5) => getDominantBaseLine(data5.horizontalPos)).attr("text-anchor", (data5) => getTextAnchor(data5.verticalPos)).attr("transform", (data5) => getTransformation(data5));
+ labels.append("text").attr("x", 0).attr("y", 0).text((data6) => data6.text).attr("fill", (data6) => data6.fill).attr("font-size", (data6) => data6.fontSize).attr("dominant-baseline", (data6) => getDominantBaseLine(data6.horizontalPos)).attr("text-anchor", (data6) => getTextAnchor(data6.verticalPos)).attr("transform", (data6) => getTransformation(data6));
const dataPoints = dataPointGroup.selectAll("g.data-point").data(quadrantData.points).enter().append("g").attr("class", "data-point");
- dataPoints.append("circle").attr("cx", (data5) => data5.x).attr("cy", (data5) => data5.y).attr("r", (data5) => data5.radius).attr("fill", (data5) => data5.fill).attr("stroke", (data5) => data5.strokeColor).attr("stroke-width", (data5) => data5.strokeWidth);
- dataPoints.append("text").attr("x", 0).attr("y", 0).text((data5) => data5.text.text).attr("fill", (data5) => data5.text.fill).attr("font-size", (data5) => data5.text.fontSize).attr(
+ dataPoints.append("circle").attr("cx", (data6) => data6.x).attr("cy", (data6) => data6.y).attr("r", (data6) => data6.radius).attr("fill", (data6) => data6.fill).attr("stroke", (data6) => data6.strokeColor).attr("stroke-width", (data6) => data6.strokeWidth);
+ dataPoints.append("text").attr("x", 0).attr("y", 0).text((data6) => data6.text.text).attr("fill", (data6) => data6.text.fill).attr("font-size", (data6) => data6.text.fontSize).attr(
"dominant-baseline",
- (data5) => getDominantBaseLine(data5.text.horizontalPos)
- ).attr("text-anchor", (data5) => getTextAnchor(data5.text.verticalPos)).attr("transform", (data5) => getTransformation(data5.text));
+ (data6) => getDominantBaseLine(data6.text.horizontalPos)
+ ).attr("text-anchor", (data6) => getTextAnchor(data6.text.verticalPos)).attr("transform", (data6) => getTransformation(data6.text));
}, "draw");
quadrantRenderer_default = {
draw: draw8
@@ -78533,7 +84868,7 @@ ${content}`;
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $V0 = [1, 10, 12, 14, 16, 18, 19, 21, 23], $V1 = [2, 6], $V2 = [1, 3], $V3 = [1, 5], $V4 = [1, 6], $V5 = [1, 7], $V6 = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $V7 = [1, 25], $V8 = [1, 26], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 30], $Vc = [1, 31], $Vd = [1, 32], $Ve = [1, 33], $Vf = [1, 34], $Vg = [1, 35], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 43], $Vk = [1, 42], $Vl = [1, 47], $Vm = [1, 50], $Vn = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $Vo = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], $Vp = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], $Vq = [1, 64];
- var parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -78643,7 +84978,7 @@ ${content}`;
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -78673,7 +85008,7 @@ ${content}`;
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -78685,22 +85020,22 @@ ${content}`;
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -78719,7 +85054,7 @@ ${content}`;
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -79019,7 +85354,7 @@ ${content}`;
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -79223,13 +85558,13 @@ ${content}`;
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser10.parser = parser10;
@@ -79238,14 +85573,14 @@ ${content}`;
});
// src/diagrams/xychart/chartBuilder/interfaces.ts
- function isBarPlot(data5) {
- return data5.type === "bar";
+ function isBarPlot(data6) {
+ return data6.type === "bar";
}
- function isBandAxisData(data5) {
- return data5.type === "band";
+ function isBandAxisData(data6) {
+ return data6.type === "band";
}
- function isLinearAxisData(data5) {
- return data5.type === "linear";
+ function isLinearAxisData(data6) {
+ return data6.type === "linear";
}
var init_interfaces = __esm({
"src/diagrams/xychart/chartBuilder/interfaces.ts"() {
@@ -79725,22 +86060,22 @@ ${content}`;
});
// src/diagrams/xychart/chartBuilder/components/axis/index.ts
- function getAxis(data5, axisConfig, axisThemeConfig, tmpSVGGroup2) {
+ function getAxis(data6, axisConfig, axisThemeConfig, tmpSVGGroup2) {
const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
- if (isBandAxisData(data5)) {
+ if (isBandAxisData(data6)) {
return new BandAxis(
axisConfig,
axisThemeConfig,
- data5.categories,
- data5.title,
+ data6.categories,
+ data6.title,
textDimensionCalculator
);
}
return new LinearAxis(
axisConfig,
axisThemeConfig,
- [data5.min, data5.max],
- data5.title,
+ [data6.min, data6.max],
+ data6.title,
textDimensionCalculator
);
}
@@ -79909,11 +86244,11 @@ ${content}`;
{
groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
type: "rect",
- data: finalData.map((data5) => ({
+ data: finalData.map((data6) => ({
x: this.boundingRect.x,
- y: data5[0] - barWidthHalf,
+ y: data6[0] - barWidthHalf,
height: barWidth,
- width: data5[1] - this.boundingRect.x,
+ width: data6[1] - this.boundingRect.x,
fill: this.barData.fill,
strokeWidth: 0,
strokeFill: this.barData.fill
@@ -79925,11 +86260,11 @@ ${content}`;
{
groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
type: "rect",
- data: finalData.map((data5) => ({
- x: data5[0] - barWidthHalf,
- y: data5[1],
+ data: finalData.map((data6) => ({
+ x: data6[0] - barWidthHalf,
+ y: data6[1],
width: barWidth,
- height: this.boundingRect.y + this.boundingRect.height - data5[1],
+ height: this.boundingRect.y + this.boundingRect.height - data6[1],
fill: this.barData.fill,
strokeWidth: 0,
strokeFill: this.barData.fill
@@ -80208,8 +86543,8 @@ ${content}`;
static {
__name(this, "XYChartBuilder");
}
- static build(config6, chartData, chartThemeConfig, tmpSVGGroup2) {
- const orchestrator = new Orchestrator(config6, chartData, chartThemeConfig, tmpSVGGroup2);
+ static build(config5, chartData, chartThemeConfig, tmpSVGGroup2) {
+ const orchestrator = new Orchestrator(config5, chartData, chartThemeConfig, tmpSVGGroup2);
return orchestrator.getDrawableElement();
}
};
@@ -80219,14 +86554,14 @@ ${content}`;
// src/diagrams/xychart/xychartDb.ts
function getChartDefaultThemeConfig() {
const defaultThemeVariables2 = getThemeVariables3();
- const config6 = getConfig();
- return cleanAndMerge(defaultThemeVariables2.xyChart, config6.themeVariables.xyChart);
+ const config5 = getConfig();
+ return cleanAndMerge(defaultThemeVariables2.xyChart, config5.themeVariables.xyChart);
}
function getChartDefaultConfig() {
- const config6 = getConfig();
+ const config5 = getConfig();
return cleanAndMerge(
defaultConfig_default.xyChart,
- config6.xyChart
+ config5.xyChart
);
}
function getChartDefaultData() {
@@ -80246,9 +86581,9 @@ ${content}`;
plots: []
};
}
- function textSanitizer2(text2) {
- const config6 = getConfig();
- return sanitizeText(text2.trim(), config6);
+ function textSanitizer2(text4) {
+ const config5 = getConfig();
+ return sanitizeText(text4.trim(), config5);
}
function setTmpSVGG(SVGG) {
tmpSVGGroup = SVGG;
@@ -80282,9 +86617,9 @@ ${content}`;
xyChartData.yAxis = { type: "linear", title: xyChartData.yAxis.title, min: min9, max: max10 };
hasSetYAxis = true;
}
- function setYAxisRangeFromPlotData(data5) {
- const minValue = Math.min(...data5);
- const maxValue = Math.max(...data5);
+ function setYAxisRangeFromPlotData(data6) {
+ const minValue = Math.min(...data6);
+ const maxValue = Math.max(...data6);
const prevMinValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.min : Infinity;
const prevMaxValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.max : -Infinity;
xyChartData.yAxis = {
@@ -80294,39 +86629,39 @@ ${content}`;
max: Math.max(prevMaxValue, maxValue)
};
}
- function transformDataWithoutCategory(data5) {
+ function transformDataWithoutCategory(data6) {
let retData = [];
- if (data5.length === 0) {
+ if (data6.length === 0) {
return retData;
}
if (!hasSetXAxis) {
const prevMinValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.min : Infinity;
const prevMaxValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.max : -Infinity;
- setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data5.length));
+ setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data6.length));
}
if (!hasSetYAxis) {
- setYAxisRangeFromPlotData(data5);
+ setYAxisRangeFromPlotData(data6);
}
if (isBandAxisData(xyChartData.xAxis)) {
- retData = xyChartData.xAxis.categories.map((c3, i2) => [c3, data5[i2]]);
+ retData = xyChartData.xAxis.categories.map((c3, i2) => [c3, data6[i2]]);
}
if (isLinearAxisData(xyChartData.xAxis)) {
const min9 = xyChartData.xAxis.min;
const max10 = xyChartData.xAxis.max;
- const step3 = (max10 - min9) / (data5.length - 1);
+ const step3 = (max10 - min9) / (data6.length - 1);
const categories = [];
for (let i2 = min9; i2 <= max10; i2 += step3) {
categories.push(`${i2}`);
}
- retData = categories.map((c3, i2) => [c3, data5[i2]]);
+ retData = categories.map((c3, i2) => [c3, data6[i2]]);
}
return retData;
}
function getPlotColorFromPalette(plotIndex2) {
return plotColorPalette[plotIndex2 === 0 ? 0 : plotIndex2 % plotColorPalette.length];
}
- function setLineData(title2, data5) {
- const plotData = transformDataWithoutCategory(data5);
+ function setLineData(title2, data6) {
+ const plotData = transformDataWithoutCategory(data6);
xyChartData.plots.push({
type: "line",
strokeFill: getPlotColorFromPalette(plotIndex),
@@ -80335,8 +86670,8 @@ ${content}`;
});
plotIndex++;
}
- function setBarData(title2, data5) {
- const plotData = transformDataWithoutCategory(data5);
+ function setBarData(title2, data6) {
+ const plotData = transformDataWithoutCategory(data6);
xyChartData.plots.push({
type: "bar",
fill: getPlotColorFromPalette(plotIndex),
@@ -80357,7 +86692,7 @@ ${content}`;
function getChartConfig() {
return xyChartConfig;
}
- var plotIndex, tmpSVGGroup, xyChartConfig, xyChartThemeConfig, xyChartData, plotColorPalette, hasSetXAxis, hasSetYAxis, clear15, xychartDb_default;
+ var plotIndex, tmpSVGGroup, xyChartConfig, xyChartThemeConfig, xyChartData, plotColorPalette, hasSetXAxis, hasSetYAxis, clear12, xychartDb_default;
var init_xychartDb = __esm({
"src/diagrams/xychart/xychartDb.ts"() {
"use strict";
@@ -80395,7 +86730,7 @@ ${content}`;
__name(getDrawableElem, "getDrawableElem");
__name(getChartThemeConfig, "getChartThemeConfig");
__name(getChartConfig, "getChartConfig");
- clear15 = /* @__PURE__ */ __name(function() {
+ clear12 = /* @__PURE__ */ __name(function() {
clear();
plotIndex = 0;
xyChartConfig = getChartDefaultConfig();
@@ -80407,7 +86742,7 @@ ${content}`;
}, "clear");
xychartDb_default = {
getDrawableElem,
- clear: clear15,
+ clear: clear12,
setAccTitle,
getAccTitle,
setDiagramTitle,
@@ -80437,10 +86772,10 @@ ${content}`;
init_logger();
init_selectSvgElement();
init_setupGraphViewbox();
- draw9 = /* @__PURE__ */ __name((txt, id27, _version, diagObj) => {
- const db8 = diagObj.db;
- const themeConfig = db8.getChartThemeConfig();
- const chartConfig = db8.getChartConfig();
+ draw9 = /* @__PURE__ */ __name((txt, id29, _version, diagObj) => {
+ const db10 = diagObj.db;
+ const themeConfig = db10.getChartThemeConfig();
+ const chartConfig = db10.getChartConfig();
function getDominantBaseLine(horizontalPos) {
return horizontalPos === "top" ? "text-before-edge" : "middle";
}
@@ -80449,19 +86784,19 @@ ${content}`;
return verticalPos === "left" ? "start" : verticalPos === "right" ? "end" : "middle";
}
__name(getTextAnchor, "getTextAnchor");
- function getTextTransformation(data5) {
- return `translate(${data5.x}, ${data5.y}) rotate(${data5.rotation || 0})`;
+ function getTextTransformation(data6) {
+ return `translate(${data6.x}, ${data6.y}) rotate(${data6.rotation || 0})`;
}
__name(getTextTransformation, "getTextTransformation");
log.debug("Rendering xychart chart\n" + txt);
- const svg = selectSvgElement(id27);
- const group2 = svg.append("g").attr("class", "main");
+ const svg2 = selectSvgElement(id29);
+ const group2 = svg2.append("g").attr("class", "main");
const background = group2.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background");
- configureSvgSize(svg, chartConfig.height, chartConfig.width, true);
- svg.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`);
+ configureSvgSize(svg2, chartConfig.height, chartConfig.width, true);
+ svg2.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`);
background.attr("fill", themeConfig.backgroundColor);
- db8.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group"));
- const shapes5 = db8.getDrawableElem();
+ db10.setTmpSVGG(svg2.append("g").attr("class", "mermaid-tmp-group"));
+ const shapes4 = db10.getDrawableElem();
const groups = {};
function getGroup(gList) {
let elem = group2;
@@ -80480,20 +86815,20 @@ ${content}`;
return elem;
}
__name(getGroup, "getGroup");
- for (const shape of shapes5) {
+ for (const shape of shapes4) {
if (shape.data.length === 0) {
continue;
}
const shapeGroup = getGroup(shape.groupTexts);
switch (shape.type) {
case "rect":
- shapeGroup.selectAll("rect").data(shape.data).enter().append("rect").attr("x", (data5) => data5.x).attr("y", (data5) => data5.y).attr("width", (data5) => data5.width).attr("height", (data5) => data5.height).attr("fill", (data5) => data5.fill).attr("stroke", (data5) => data5.strokeFill).attr("stroke-width", (data5) => data5.strokeWidth);
+ shapeGroup.selectAll("rect").data(shape.data).enter().append("rect").attr("x", (data6) => data6.x).attr("y", (data6) => data6.y).attr("width", (data6) => data6.width).attr("height", (data6) => data6.height).attr("fill", (data6) => data6.fill).attr("stroke", (data6) => data6.strokeFill).attr("stroke-width", (data6) => data6.strokeWidth);
break;
case "text":
- shapeGroup.selectAll("text").data(shape.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (data5) => data5.fill).attr("font-size", (data5) => data5.fontSize).attr("dominant-baseline", (data5) => getDominantBaseLine(data5.verticalPos)).attr("text-anchor", (data5) => getTextAnchor(data5.horizontalPos)).attr("transform", (data5) => getTextTransformation(data5)).text((data5) => data5.text);
+ shapeGroup.selectAll("text").data(shape.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (data6) => data6.fill).attr("font-size", (data6) => data6.fontSize).attr("dominant-baseline", (data6) => getDominantBaseLine(data6.verticalPos)).attr("text-anchor", (data6) => getTextAnchor(data6.horizontalPos)).attr("transform", (data6) => getTextTransformation(data6)).text((data6) => data6.text);
break;
case "path":
- shapeGroup.selectAll("path").data(shape.data).enter().append("path").attr("d", (data5) => data5.path).attr("fill", (data5) => data5.fill ? data5.fill : "none").attr("stroke", (data5) => data5.strokeFill).attr("stroke-width", (data5) => data5.strokeWidth);
+ shapeGroup.selectAll("path").data(shape.data).enter().append("path").attr("d", (data6) => data6.path).attr("fill", (data6) => data6.fill ? data6.fill : "none").attr("stroke", (data6) => data6.strokeFill).attr("stroke-width", (data6) => data6.strokeWidth);
break;
}
}
@@ -80533,14 +86868,14 @@ ${content}`;
var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
- }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [5, 6, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63], $V5 = [1, 18], $V6 = [2, 7], $V7 = [1, 22], $V8 = [1, 23], $V9 = [1, 24], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 20], $Ve = [1, 28], $Vf = [1, 29], $Vg = [62, 63], $Vh = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 51, 53, 62, 63], $Vi = [1, 47], $Vj = [1, 48], $Vk = [1, 49], $Vl = [1, 50], $Vm = [1, 51], $Vn = [1, 52], $Vo = [1, 53], $Vp = [53, 54], $Vq = [1, 64], $Vr = [1, 60], $Vs = [1, 61], $Vt = [1, 62], $Vu = [1, 63], $Vv = [1, 65], $Vw = [1, 69], $Vx = [1, 70], $Vy = [1, 67], $Vz = [1, 68], $VA = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63];
- var parser22 = {
+ }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [5, 6, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 77, 89, 90], $V5 = [1, 22], $V6 = [2, 7], $V7 = [1, 26], $V8 = [1, 27], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 33], $Vc = [1, 34], $Vd = [1, 35], $Ve = [1, 36], $Vf = [1, 37], $Vg = [1, 38], $Vh = [1, 24], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 30], $Vl = [1, 39], $Vm = [1, 40], $Vn = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 77, 89, 90], $Vo = [1, 61], $Vp = [89, 90], $Vq = [5, 8, 9, 11, 13, 21, 22, 23, 24, 27, 29, 41, 42, 43, 44, 45, 46, 54, 61, 63, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $Vr = [27, 29], $Vs = [1, 70], $Vt = [1, 71], $Vu = [1, 72], $Vv = [1, 73], $Vw = [1, 74], $Vx = [1, 75], $Vy = [1, 76], $Vz = [1, 83], $VA = [1, 80], $VB = [1, 84], $VC = [1, 85], $VD = [1, 86], $VE = [1, 87], $VF = [1, 88], $VG = [1, 89], $VH = [1, 90], $VI = [1, 91], $VJ = [1, 92], $VK = [5, 8, 9, 11, 13, 21, 22, 23, 24, 27, 41, 42, 43, 44, 45, 46, 54, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $VL = [63, 64], $VM = [1, 101], $VN = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 76, 77, 89, 90], $VO = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $VP = [1, 110], $VQ = [1, 106], $VR = [1, 107], $VS = [1, 108], $VT = [1, 109], $VU = [1, 111], $VV = [1, 116], $VW = [1, 117], $VX = [1, 114], $VY = [1, 115];
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
- symbols_: { "error": 2, "start": 3, "directive": 4, "NEWLINE": 5, "RD": 6, "diagram": 7, "EOF": 8, "acc_title": 9, "acc_title_value": 10, "acc_descr": 11, "acc_descr_value": 12, "acc_descr_multiline_value": 13, "requirementDef": 14, "elementDef": 15, "relationshipDef": 16, "requirementType": 17, "requirementName": 18, "STRUCT_START": 19, "requirementBody": 20, "ID": 21, "COLONSEP": 22, "id": 23, "TEXT": 24, "text": 25, "RISK": 26, "riskLevel": 27, "VERIFYMTHD": 28, "verifyType": 29, "STRUCT_STOP": 30, "REQUIREMENT": 31, "FUNCTIONAL_REQUIREMENT": 32, "INTERFACE_REQUIREMENT": 33, "PERFORMANCE_REQUIREMENT": 34, "PHYSICAL_REQUIREMENT": 35, "DESIGN_CONSTRAINT": 36, "LOW_RISK": 37, "MED_RISK": 38, "HIGH_RISK": 39, "VERIFY_ANALYSIS": 40, "VERIFY_DEMONSTRATION": 41, "VERIFY_INSPECTION": 42, "VERIFY_TEST": 43, "ELEMENT": 44, "elementName": 45, "elementBody": 46, "TYPE": 47, "type": 48, "DOCREF": 49, "ref": 50, "END_ARROW_L": 51, "relationship": 52, "LINE": 53, "END_ARROW_R": 54, "CONTAINS": 55, "COPIES": 56, "DERIVES": 57, "SATISFIES": 58, "VERIFIES": 59, "REFINES": 60, "TRACES": 61, "unqString": 62, "qString": 63, "$accept": 0, "$end": 1 },
- terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 19: "STRUCT_START", 21: "ID", 22: "COLONSEP", 24: "TEXT", 26: "RISK", 28: "VERIFYMTHD", 30: "STRUCT_STOP", 31: "REQUIREMENT", 32: "FUNCTIONAL_REQUIREMENT", 33: "INTERFACE_REQUIREMENT", 34: "PERFORMANCE_REQUIREMENT", 35: "PHYSICAL_REQUIREMENT", 36: "DESIGN_CONSTRAINT", 37: "LOW_RISK", 38: "MED_RISK", 39: "HIGH_RISK", 40: "VERIFY_ANALYSIS", 41: "VERIFY_DEMONSTRATION", 42: "VERIFY_INSPECTION", 43: "VERIFY_TEST", 44: "ELEMENT", 47: "TYPE", 49: "DOCREF", 51: "END_ARROW_L", 53: "LINE", 54: "END_ARROW_R", 55: "CONTAINS", 56: "COPIES", 57: "DERIVES", 58: "SATISFIES", 59: "VERIFIES", 60: "REFINES", 61: "TRACES", 62: "unqString", 63: "qString" },
- productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [14, 5], [20, 5], [20, 5], [20, 5], [20, 5], [20, 2], [20, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [27, 1], [27, 1], [27, 1], [29, 1], [29, 1], [29, 1], [29, 1], [15, 5], [46, 5], [46, 5], [46, 2], [46, 1], [16, 5], [16, 5], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [18, 1], [18, 1], [23, 1], [23, 1], [25, 1], [25, 1], [45, 1], [45, 1], [48, 1], [48, 1], [50, 1], [50, 1]],
+ symbols_: { "error": 2, "start": 3, "directive": 4, "NEWLINE": 5, "RD": 6, "diagram": 7, "EOF": 8, "acc_title": 9, "acc_title_value": 10, "acc_descr": 11, "acc_descr_value": 12, "acc_descr_multiline_value": 13, "requirementDef": 14, "elementDef": 15, "relationshipDef": 16, "direction": 17, "styleStatement": 18, "classDefStatement": 19, "classStatement": 20, "direction_tb": 21, "direction_bt": 22, "direction_rl": 23, "direction_lr": 24, "requirementType": 25, "requirementName": 26, "STRUCT_START": 27, "requirementBody": 28, "STYLE_SEPARATOR": 29, "idList": 30, "ID": 31, "COLONSEP": 32, "id": 33, "TEXT": 34, "text": 35, "RISK": 36, "riskLevel": 37, "VERIFYMTHD": 38, "verifyType": 39, "STRUCT_STOP": 40, "REQUIREMENT": 41, "FUNCTIONAL_REQUIREMENT": 42, "INTERFACE_REQUIREMENT": 43, "PERFORMANCE_REQUIREMENT": 44, "PHYSICAL_REQUIREMENT": 45, "DESIGN_CONSTRAINT": 46, "LOW_RISK": 47, "MED_RISK": 48, "HIGH_RISK": 49, "VERIFY_ANALYSIS": 50, "VERIFY_DEMONSTRATION": 51, "VERIFY_INSPECTION": 52, "VERIFY_TEST": 53, "ELEMENT": 54, "elementName": 55, "elementBody": 56, "TYPE": 57, "type": 58, "DOCREF": 59, "ref": 60, "END_ARROW_L": 61, "relationship": 62, "LINE": 63, "END_ARROW_R": 64, "CONTAINS": 65, "COPIES": 66, "DERIVES": 67, "SATISFIES": 68, "VERIFIES": 69, "REFINES": 70, "TRACES": 71, "CLASSDEF": 72, "stylesOpt": 73, "CLASS": 74, "ALPHA": 75, "COMMA": 76, "STYLE": 77, "style": 78, "styleComponent": 79, "NUM": 80, "COLON": 81, "UNIT": 82, "SPACE": 83, "BRKT": 84, "PCT": 85, "MINUS": 86, "LABEL": 87, "SEMICOLON": 88, "unqString": 89, "qString": 90, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 21: "direction_tb", 22: "direction_bt", 23: "direction_rl", 24: "direction_lr", 27: "STRUCT_START", 29: "STYLE_SEPARATOR", 31: "ID", 32: "COLONSEP", 34: "TEXT", 36: "RISK", 38: "VERIFYMTHD", 40: "STRUCT_STOP", 41: "REQUIREMENT", 42: "FUNCTIONAL_REQUIREMENT", 43: "INTERFACE_REQUIREMENT", 44: "PERFORMANCE_REQUIREMENT", 45: "PHYSICAL_REQUIREMENT", 46: "DESIGN_CONSTRAINT", 47: "LOW_RISK", 48: "MED_RISK", 49: "HIGH_RISK", 50: "VERIFY_ANALYSIS", 51: "VERIFY_DEMONSTRATION", 52: "VERIFY_INSPECTION", 53: "VERIFY_TEST", 54: "ELEMENT", 57: "TYPE", 59: "DOCREF", 61: "END_ARROW_L", 63: "LINE", 64: "END_ARROW_R", 65: "CONTAINS", 66: "COPIES", 67: "DERIVES", 68: "SATISFIES", 69: "VERIFIES", 70: "REFINES", 71: "TRACES", 72: "CLASSDEF", 74: "CLASS", 75: "ALPHA", 76: "COMMA", 77: "STYLE", 80: "NUM", 81: "COLON", 82: "UNIT", 83: "SPACE", 84: "BRKT", 85: "PCT", 86: "MINUS", 87: "LABEL", 88: "SEMICOLON", 89: "unqString", 90: "qString" },
+ productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [17, 1], [17, 1], [17, 1], [17, 1], [14, 5], [14, 7], [28, 5], [28, 5], [28, 5], [28, 5], [28, 2], [28, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [37, 1], [37, 1], [37, 1], [39, 1], [39, 1], [39, 1], [39, 1], [15, 5], [15, 7], [56, 5], [56, 5], [56, 2], [56, 1], [16, 5], [16, 5], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [19, 3], [20, 3], [20, 3], [30, 1], [30, 3], [30, 1], [30, 3], [18, 3], [73, 1], [73, 3], [78, 1], [78, 2], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [26, 1], [26, 1], [33, 1], [33, 1], [35, 1], [35, 1], [55, 1], [55, 1], [58, 1], [58, 1], [60, 1], [60, 1]],
performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
var $0 = $$.length - 1;
switch (yystate) {
@@ -80556,100 +86891,152 @@ ${content}`;
case 7:
this.$ = [];
break;
- case 13:
+ case 17:
+ yy.setDirection("TB");
+ break;
+ case 18:
+ yy.setDirection("BT");
+ break;
+ case 19:
+ yy.setDirection("RL");
+ break;
+ case 20:
+ yy.setDirection("LR");
+ break;
+ case 21:
yy.addRequirement($$[$0 - 3], $$[$0 - 4]);
break;
- case 14:
+ case 22:
+ yy.addRequirement($$[$0 - 5], $$[$0 - 6]);
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
+ break;
+ case 23:
yy.setNewReqId($$[$0 - 2]);
break;
- case 15:
+ case 24:
yy.setNewReqText($$[$0 - 2]);
break;
- case 16:
+ case 25:
yy.setNewReqRisk($$[$0 - 2]);
break;
- case 17:
+ case 26:
yy.setNewReqVerifyMethod($$[$0 - 2]);
break;
- case 20:
+ case 29:
this.$ = yy.RequirementType.REQUIREMENT;
break;
- case 21:
+ case 30:
this.$ = yy.RequirementType.FUNCTIONAL_REQUIREMENT;
break;
- case 22:
+ case 31:
this.$ = yy.RequirementType.INTERFACE_REQUIREMENT;
break;
- case 23:
+ case 32:
this.$ = yy.RequirementType.PERFORMANCE_REQUIREMENT;
break;
- case 24:
+ case 33:
this.$ = yy.RequirementType.PHYSICAL_REQUIREMENT;
break;
- case 25:
+ case 34:
this.$ = yy.RequirementType.DESIGN_CONSTRAINT;
break;
- case 26:
+ case 35:
this.$ = yy.RiskLevel.LOW_RISK;
break;
- case 27:
+ case 36:
this.$ = yy.RiskLevel.MED_RISK;
break;
- case 28:
+ case 37:
this.$ = yy.RiskLevel.HIGH_RISK;
break;
- case 29:
+ case 38:
this.$ = yy.VerifyType.VERIFY_ANALYSIS;
break;
- case 30:
+ case 39:
this.$ = yy.VerifyType.VERIFY_DEMONSTRATION;
break;
- case 31:
+ case 40:
this.$ = yy.VerifyType.VERIFY_INSPECTION;
break;
- case 32:
+ case 41:
this.$ = yy.VerifyType.VERIFY_TEST;
break;
- case 33:
+ case 42:
yy.addElement($$[$0 - 3]);
break;
- case 34:
+ case 43:
+ yy.addElement($$[$0 - 5]);
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
+ break;
+ case 44:
yy.setNewElementType($$[$0 - 2]);
break;
- case 35:
+ case 45:
yy.setNewElementDocRef($$[$0 - 2]);
break;
- case 38:
+ case 48:
yy.addRelationship($$[$0 - 2], $$[$0], $$[$0 - 4]);
break;
- case 39:
+ case 49:
yy.addRelationship($$[$0 - 2], $$[$0 - 4], $$[$0]);
break;
- case 40:
+ case 50:
this.$ = yy.Relationships.CONTAINS;
break;
- case 41:
+ case 51:
this.$ = yy.Relationships.COPIES;
break;
- case 42:
+ case 52:
this.$ = yy.Relationships.DERIVES;
break;
- case 43:
+ case 53:
this.$ = yy.Relationships.SATISFIES;
break;
- case 44:
+ case 54:
this.$ = yy.Relationships.VERIFIES;
break;
- case 45:
+ case 55:
this.$ = yy.Relationships.REFINES;
break;
- case 46:
+ case 56:
this.$ = yy.Relationships.TRACES;
break;
+ case 57:
+ this.$ = $$[$0 - 2];
+ yy.defineClass($$[$0 - 1], $$[$0]);
+ break;
+ case 58:
+ yy.setClass($$[$0 - 1], $$[$0]);
+ break;
+ case 59:
+ yy.setClass([$$[$0 - 2]], $$[$0]);
+ break;
+ case 60:
+ case 62:
+ this.$ = [$$[$0]];
+ break;
+ case 61:
+ case 63:
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
+ break;
+ case 64:
+ this.$ = $$[$0 - 2];
+ yy.setCssStyle($$[$0 - 1], $$[$0]);
+ break;
+ case 65:
+ this.$ = [$$[$0]];
+ break;
+ case 66:
+ $$[$0 - 2].push($$[$0]);
+ this.$ = $$[$0 - 2];
+ break;
+ case 68:
+ this.$ = $$[$0 - 1] + $$[$0];
+ break;
}
}, "anonymous"),
- table: [{ 3: 1, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, o2($V4, [2, 6]), { 3: 12, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [2, 2] }, { 4: 17, 5: $V5, 7: 13, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, o2($V4, [2, 4]), o2($V4, [2, 5]), { 1: [2, 1] }, { 8: [1, 30] }, { 4: 17, 5: $V5, 7: 31, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 32, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 33, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 34, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 35, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 18: 36, 62: [1, 37], 63: [1, 38] }, { 45: 39, 62: [1, 40], 63: [1, 41] }, { 51: [1, 42], 53: [1, 43] }, o2($Vg, [2, 20]), o2($Vg, [2, 21]), o2($Vg, [2, 22]), o2($Vg, [2, 23]), o2($Vg, [2, 24]), o2($Vg, [2, 25]), o2($Vh, [2, 49]), o2($Vh, [2, 50]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 19: [1, 44] }, { 19: [2, 47] }, { 19: [2, 48] }, { 19: [1, 45] }, { 19: [2, 53] }, { 19: [2, 54] }, { 52: 46, 55: $Vi, 56: $Vj, 57: $Vk, 58: $Vl, 59: $Vm, 60: $Vn, 61: $Vo }, { 52: 54, 55: $Vi, 56: $Vj, 57: $Vk, 58: $Vl, 59: $Vm, 60: $Vn, 61: $Vo }, { 5: [1, 55] }, { 5: [1, 56] }, { 53: [1, 57] }, o2($Vp, [2, 40]), o2($Vp, [2, 41]), o2($Vp, [2, 42]), o2($Vp, [2, 43]), o2($Vp, [2, 44]), o2($Vp, [2, 45]), o2($Vp, [2, 46]), { 54: [1, 58] }, { 5: $Vq, 20: 59, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vw, 30: $Vx, 46: 66, 47: $Vy, 49: $Vz }, { 23: 71, 62: $Ve, 63: $Vf }, { 23: 72, 62: $Ve, 63: $Vf }, o2($VA, [2, 13]), { 22: [1, 73] }, { 22: [1, 74] }, { 22: [1, 75] }, { 22: [1, 76] }, { 5: $Vq, 20: 77, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, o2($VA, [2, 19]), o2($VA, [2, 33]), { 22: [1, 78] }, { 22: [1, 79] }, { 5: $Vw, 30: $Vx, 46: 80, 47: $Vy, 49: $Vz }, o2($VA, [2, 37]), o2($VA, [2, 38]), o2($VA, [2, 39]), { 23: 81, 62: $Ve, 63: $Vf }, { 25: 82, 62: [1, 83], 63: [1, 84] }, { 27: 85, 37: [1, 86], 38: [1, 87], 39: [1, 88] }, { 29: 89, 40: [1, 90], 41: [1, 91], 42: [1, 92], 43: [1, 93] }, o2($VA, [2, 18]), { 48: 94, 62: [1, 95], 63: [1, 96] }, { 50: 97, 62: [1, 98], 63: [1, 99] }, o2($VA, [2, 36]), { 5: [1, 100] }, { 5: [1, 101] }, { 5: [2, 51] }, { 5: [2, 52] }, { 5: [1, 102] }, { 5: [2, 26] }, { 5: [2, 27] }, { 5: [2, 28] }, { 5: [1, 103] }, { 5: [2, 29] }, { 5: [2, 30] }, { 5: [2, 31] }, { 5: [2, 32] }, { 5: [1, 104] }, { 5: [2, 55] }, { 5: [2, 56] }, { 5: [1, 105] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: $Vq, 20: 106, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 107, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 108, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 109, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vw, 30: $Vx, 46: 110, 47: $Vy, 49: $Vz }, { 5: $Vw, 30: $Vx, 46: 111, 47: $Vy, 49: $Vz }, o2($VA, [2, 14]), o2($VA, [2, 15]), o2($VA, [2, 16]), o2($VA, [2, 17]), o2($VA, [2, 34]), o2($VA, [2, 35])],
- defaultActions: { 8: [2, 2], 12: [2, 1], 30: [2, 3], 31: [2, 8], 32: [2, 9], 33: [2, 10], 34: [2, 11], 35: [2, 12], 37: [2, 47], 38: [2, 48], 40: [2, 53], 41: [2, 54], 83: [2, 51], 84: [2, 52], 86: [2, 26], 87: [2, 27], 88: [2, 28], 90: [2, 29], 91: [2, 30], 92: [2, 31], 93: [2, 32], 95: [2, 55], 96: [2, 56], 98: [2, 57], 99: [2, 58] },
+ table: [{ 3: 1, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, o2($V4, [2, 6]), { 3: 12, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [2, 2] }, { 4: 17, 5: $V5, 7: 13, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, o2($V4, [2, 4]), o2($V4, [2, 5]), { 1: [2, 1] }, { 8: [1, 41] }, { 4: 17, 5: $V5, 7: 42, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 43, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 44, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 45, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 46, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 47, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 48, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 49, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 50, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 26: 51, 89: [1, 52], 90: [1, 53] }, { 55: 54, 89: [1, 55], 90: [1, 56] }, { 29: [1, 59], 61: [1, 57], 63: [1, 58] }, o2($Vn, [2, 17]), o2($Vn, [2, 18]), o2($Vn, [2, 19]), o2($Vn, [2, 20]), { 30: 60, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 30: 63, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 30: 64, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, o2($Vp, [2, 29]), o2($Vp, [2, 30]), o2($Vp, [2, 31]), o2($Vp, [2, 32]), o2($Vp, [2, 33]), o2($Vp, [2, 34]), o2($Vq, [2, 81]), o2($Vq, [2, 82]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 8: [2, 13] }, { 8: [2, 14] }, { 8: [2, 15] }, { 8: [2, 16] }, { 27: [1, 65], 29: [1, 66] }, o2($Vr, [2, 79]), o2($Vr, [2, 80]), { 27: [1, 67], 29: [1, 68] }, o2($Vr, [2, 85]), o2($Vr, [2, 86]), { 62: 69, 65: $Vs, 66: $Vt, 67: $Vu, 68: $Vv, 69: $Vw, 70: $Vx, 71: $Vy }, { 62: 77, 65: $Vs, 66: $Vt, 67: $Vu, 68: $Vv, 69: $Vw, 70: $Vx, 71: $Vy }, { 30: 78, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 73: 79, 75: $Vz, 76: $VA, 78: 81, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, o2($VK, [2, 60]), o2($VK, [2, 62]), { 73: 93, 75: $Vz, 76: $VA, 78: 81, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, { 30: 94, 33: 62, 75: $Vo, 76: $VA, 89: $Vl, 90: $Vm }, { 5: [1, 95] }, { 30: 96, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 5: [1, 97] }, { 30: 98, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 63: [1, 99] }, o2($VL, [2, 50]), o2($VL, [2, 51]), o2($VL, [2, 52]), o2($VL, [2, 53]), o2($VL, [2, 54]), o2($VL, [2, 55]), o2($VL, [2, 56]), { 64: [1, 100] }, o2($Vn, [2, 59], { 76: $VA }), o2($Vn, [2, 64], { 76: $VM }), { 33: 103, 75: [1, 102], 89: $Vl, 90: $Vm }, o2($VN, [2, 65], { 79: 104, 75: $Vz, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }), o2($VO, [2, 67]), o2($VO, [2, 69]), o2($VO, [2, 70]), o2($VO, [2, 71]), o2($VO, [2, 72]), o2($VO, [2, 73]), o2($VO, [2, 74]), o2($VO, [2, 75]), o2($VO, [2, 76]), o2($VO, [2, 77]), o2($VO, [2, 78]), o2($Vn, [2, 57], { 76: $VM }), o2($Vn, [2, 58], { 76: $VA }), { 5: $VP, 28: 105, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 27: [1, 112], 76: $VA }, { 5: $VV, 40: $VW, 56: 113, 57: $VX, 59: $VY }, { 27: [1, 118], 76: $VA }, { 33: 119, 89: $Vl, 90: $Vm }, { 33: 120, 89: $Vl, 90: $Vm }, { 75: $Vz, 78: 121, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, o2($VK, [2, 61]), o2($VK, [2, 63]), o2($VO, [2, 68]), o2($Vn, [2, 21]), { 32: [1, 122] }, { 32: [1, 123] }, { 32: [1, 124] }, { 32: [1, 125] }, { 5: $VP, 28: 126, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, o2($Vn, [2, 28]), { 5: [1, 127] }, o2($Vn, [2, 42]), { 32: [1, 128] }, { 32: [1, 129] }, { 5: $VV, 40: $VW, 56: 130, 57: $VX, 59: $VY }, o2($Vn, [2, 47]), { 5: [1, 131] }, o2($Vn, [2, 48]), o2($Vn, [2, 49]), o2($VN, [2, 66], { 79: 104, 75: $Vz, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }), { 33: 132, 89: $Vl, 90: $Vm }, { 35: 133, 89: [1, 134], 90: [1, 135] }, { 37: 136, 47: [1, 137], 48: [1, 138], 49: [1, 139] }, { 39: 140, 50: [1, 141], 51: [1, 142], 52: [1, 143], 53: [1, 144] }, o2($Vn, [2, 27]), { 5: $VP, 28: 145, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 58: 146, 89: [1, 147], 90: [1, 148] }, { 60: 149, 89: [1, 150], 90: [1, 151] }, o2($Vn, [2, 46]), { 5: $VV, 40: $VW, 56: 152, 57: $VX, 59: $VY }, { 5: [1, 153] }, { 5: [1, 154] }, { 5: [2, 83] }, { 5: [2, 84] }, { 5: [1, 155] }, { 5: [2, 35] }, { 5: [2, 36] }, { 5: [2, 37] }, { 5: [1, 156] }, { 5: [2, 38] }, { 5: [2, 39] }, { 5: [2, 40] }, { 5: [2, 41] }, o2($Vn, [2, 22]), { 5: [1, 157] }, { 5: [2, 87] }, { 5: [2, 88] }, { 5: [1, 158] }, { 5: [2, 89] }, { 5: [2, 90] }, o2($Vn, [2, 43]), { 5: $VP, 28: 159, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 160, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 161, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 162, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VV, 40: $VW, 56: 163, 57: $VX, 59: $VY }, { 5: $VV, 40: $VW, 56: 164, 57: $VX, 59: $VY }, o2($Vn, [2, 23]), o2($Vn, [2, 24]), o2($Vn, [2, 25]), o2($Vn, [2, 26]), o2($Vn, [2, 44]), o2($Vn, [2, 45])],
+ defaultActions: { 8: [2, 2], 12: [2, 1], 41: [2, 3], 42: [2, 8], 43: [2, 9], 44: [2, 10], 45: [2, 11], 46: [2, 12], 47: [2, 13], 48: [2, 14], 49: [2, 15], 50: [2, 16], 134: [2, 83], 135: [2, 84], 137: [2, 35], 138: [2, 36], 139: [2, 37], 141: [2, 38], 142: [2, 39], 143: [2, 40], 144: [2, 41], 147: [2, 87], 148: [2, 88], 150: [2, 89], 151: [2, 90] },
parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
if (hash.recoverable) {
this.trace(str2);
@@ -80659,7 +87046,7 @@ ${content}`;
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -80689,7 +87076,7 @@ ${content}`;
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -80701,22 +87088,22 @@ ${content}`;
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -80735,7 +87122,7 @@ ${content}`;
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -81035,7 +87422,7 @@ ${content}`;
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -81114,146 +87501,208 @@ ${content}`;
return "acc_descr_multiline_value";
break;
case 8:
- return 5;
+ return 21;
break;
case 9:
+ return 22;
break;
case 10:
+ return 23;
break;
case 11:
+ return 24;
break;
case 12:
- return 8;
+ return 5;
break;
case 13:
- return 6;
break;
case 14:
- return 19;
break;
case 15:
- return 30;
break;
case 16:
- return 22;
+ return 8;
break;
case 17:
- return 21;
+ return 6;
break;
case 18:
- return 24;
+ return 27;
break;
case 19:
- return 26;
+ return 40;
break;
case 20:
- return 28;
+ return 29;
break;
case 21:
- return 31;
+ return 32;
break;
case 22:
- return 32;
+ return 31;
break;
case 23:
- return 33;
+ return 34;
break;
case 24:
- return 34;
+ return 36;
break;
case 25:
- return 35;
+ return 38;
break;
case 26:
- return 36;
+ return 41;
break;
case 27:
- return 37;
+ return 42;
break;
case 28:
- return 38;
+ return 43;
break;
case 29:
- return 39;
+ return 44;
break;
case 30:
- return 40;
+ return 45;
break;
case 31:
- return 41;
+ return 46;
break;
case 32:
- return 42;
+ return 47;
break;
case 33:
- return 43;
+ return 48;
break;
case 34:
- return 44;
+ return 49;
break;
case 35:
- return 55;
+ return 50;
break;
case 36:
- return 56;
+ return 51;
break;
case 37:
- return 57;
+ return 52;
break;
case 38:
- return 58;
+ return 53;
break;
case 39:
- return 59;
+ return 54;
break;
case 40:
- return 60;
+ return 65;
break;
case 41:
- return 61;
+ return 66;
break;
case 42:
- return 47;
+ return 67;
break;
case 43:
- return 49;
+ return 68;
break;
case 44:
- return 51;
+ return 69;
break;
case 45:
- return 54;
+ return 70;
break;
case 46:
- return 53;
+ return 71;
break;
case 47:
- this.begin("string");
+ return 57;
break;
case 48:
- this.popState();
+ return 59;
break;
case 49:
- return "qString";
+ this.begin("style");
+ return 77;
break;
case 50:
+ return 75;
+ break;
+ case 51:
+ return 81;
+ break;
+ case 52:
+ return 88;
+ break;
+ case 53:
+ return "PERCENT";
+ break;
+ case 54:
+ return 86;
+ break;
+ case 55:
+ return 84;
+ break;
+ case 56:
+ break;
+ case 57:
+ this.begin("string");
+ break;
+ case 58:
+ this.popState();
+ break;
+ case 59:
+ this.begin("style");
+ return 72;
+ break;
+ case 60:
+ this.begin("style");
+ return 74;
+ break;
+ case 61:
+ return 61;
+ break;
+ case 62:
+ return 64;
+ break;
+ case 63:
+ return 63;
+ break;
+ case 64:
+ this.begin("string");
+ break;
+ case 65:
+ this.popState();
+ break;
+ case 66:
+ return "qString";
+ break;
+ case 67:
yy_.yytext = yy_.yytext.trim();
- return 62;
+ return 89;
+ break;
+ case 68:
+ return 75;
+ break;
+ case 69:
+ return 80;
+ break;
+ case 70:
+ return 76;
break;
}
}, "anonymous"),
- rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^\r\n\{\<\>\-\=]*)/i],
- conditions: { "acc_descr_multiline": { "rules": [6, 7], "inclusive": false }, "acc_descr": { "rules": [4], "inclusive": false }, "acc_title": { "rules": [2], "inclusive": false }, "unqString": { "rules": [], "inclusive": false }, "token": { "rules": [], "inclusive": false }, "string": { "rules": [48, 49], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 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, 50], "inclusive": true } }
+ rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::{3})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:style\b)/i, /^(?:\w+)/i, /^(?::)/i, /^(?:;)/i, /^(?:%)/i, /^(?:-)/i, /^(?:#)/i, /^(?: )/i, /^(?:["])/i, /^(?:\n)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i, /^(?:\w+)/i, /^(?:[0-9]+)/i, /^(?:,)/i],
+ conditions: { "acc_descr_multiline": { "rules": [6, 7, 68, 69, 70], "inclusive": false }, "acc_descr": { "rules": [4, 68, 69, 70], "inclusive": false }, "acc_title": { "rules": [2, 68, 69, 70], "inclusive": false }, "style": { "rules": [50, 51, 52, 53, 54, 55, 56, 57, 58, 68, 69, 70], "inclusive": false }, "unqString": { "rules": [68, 69, 70], "inclusive": false }, "token": { "rules": [68, 69, 70], "inclusive": false }, "string": { "rules": [65, 66, 68, 69, 70], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 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, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70], "inclusive": true } }
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser11.parser = parser11;
@@ -81261,144 +87710,301 @@ ${content}`;
}
});
- // src/diagrams/requirement/requirementDb.js
- var relations, latestRequirement, requirements, latestElement, elements, RequirementType, RiskLevel, VerifyType, Relationships, addRequirement, getRequirements, setNewReqId, setNewReqText, setNewReqRisk, setNewReqVerifyMethod, addElement, getElements, setNewElementType, setNewElementDocRef, addRelationship2, getRelationships2, clear16, requirementDb_default;
+ // src/diagrams/requirement/requirementDb.ts
+ var RequirementDB;
var init_requirementDb = __esm({
- "src/diagrams/requirement/requirementDb.js"() {
+ "src/diagrams/requirement/requirementDb.ts"() {
"use strict";
init_diagramAPI();
init_logger();
init_commonDb();
- relations = [];
- latestRequirement = {};
- requirements = /* @__PURE__ */ new Map();
- latestElement = {};
- elements = /* @__PURE__ */ new Map();
- RequirementType = {
- REQUIREMENT: "Requirement",
- FUNCTIONAL_REQUIREMENT: "Functional Requirement",
- INTERFACE_REQUIREMENT: "Interface Requirement",
- PERFORMANCE_REQUIREMENT: "Performance Requirement",
- PHYSICAL_REQUIREMENT: "Physical Requirement",
- DESIGN_CONSTRAINT: "Design Constraint"
- };
- RiskLevel = {
- LOW_RISK: "Low",
- MED_RISK: "Medium",
- HIGH_RISK: "High"
- };
- VerifyType = {
- VERIFY_ANALYSIS: "Analysis",
- VERIFY_DEMONSTRATION: "Demonstration",
- VERIFY_INSPECTION: "Inspection",
- VERIFY_TEST: "Test"
- };
- Relationships = {
- CONTAINS: "contains",
- COPIES: "copies",
- DERIVES: "derives",
- SATISFIES: "satisfies",
- VERIFIES: "verifies",
- REFINES: "refines",
- TRACES: "traces"
- };
- addRequirement = /* @__PURE__ */ __name((name, type3) => {
- if (!requirements.has(name)) {
- requirements.set(name, {
- name,
+ RequirementDB = class {
+ constructor() {
+ this.relations = [];
+ this.latestRequirement = this.getInitialRequirement();
+ this.requirements = /* @__PURE__ */ new Map();
+ this.latestElement = this.getInitialElement();
+ this.elements = /* @__PURE__ */ new Map();
+ this.classes = /* @__PURE__ */ new Map();
+ this.direction = "TB";
+ this.RequirementType = {
+ REQUIREMENT: "Requirement",
+ FUNCTIONAL_REQUIREMENT: "Functional Requirement",
+ INTERFACE_REQUIREMENT: "Interface Requirement",
+ PERFORMANCE_REQUIREMENT: "Performance Requirement",
+ PHYSICAL_REQUIREMENT: "Physical Requirement",
+ DESIGN_CONSTRAINT: "Design Constraint"
+ };
+ this.RiskLevel = {
+ LOW_RISK: "Low",
+ MED_RISK: "Medium",
+ HIGH_RISK: "High"
+ };
+ this.VerifyType = {
+ VERIFY_ANALYSIS: "Analysis",
+ VERIFY_DEMONSTRATION: "Demonstration",
+ VERIFY_INSPECTION: "Inspection",
+ VERIFY_TEST: "Test"
+ };
+ this.Relationships = {
+ CONTAINS: "contains",
+ COPIES: "copies",
+ DERIVES: "derives",
+ SATISFIES: "satisfies",
+ VERIFIES: "verifies",
+ REFINES: "refines",
+ TRACES: "traces"
+ };
+ this.setAccTitle = setAccTitle;
+ this.getAccTitle = getAccTitle;
+ this.setAccDescription = setAccDescription;
+ this.getAccDescription = getAccDescription;
+ this.setDiagramTitle = setDiagramTitle;
+ this.getDiagramTitle = getDiagramTitle;
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().requirement, "getConfig");
+ this.clear();
+ this.setDirection = this.setDirection.bind(this);
+ this.addRequirement = this.addRequirement.bind(this);
+ this.setNewReqId = this.setNewReqId.bind(this);
+ this.setNewReqRisk = this.setNewReqRisk.bind(this);
+ this.setNewReqText = this.setNewReqText.bind(this);
+ this.setNewReqVerifyMethod = this.setNewReqVerifyMethod.bind(this);
+ this.addElement = this.addElement.bind(this);
+ this.setNewElementType = this.setNewElementType.bind(this);
+ this.setNewElementDocRef = this.setNewElementDocRef.bind(this);
+ this.addRelationship = this.addRelationship.bind(this);
+ this.setCssStyle = this.setCssStyle.bind(this);
+ this.setClass = this.setClass.bind(this);
+ this.defineClass = this.defineClass.bind(this);
+ this.setAccTitle = this.setAccTitle.bind(this);
+ this.setAccDescription = this.setAccDescription.bind(this);
+ }
+ static {
+ __name(this, "RequirementDB");
+ }
+ getDirection() {
+ return this.direction;
+ }
+ setDirection(dir2) {
+ this.direction = dir2;
+ }
+ resetLatestRequirement() {
+ this.latestRequirement = this.getInitialRequirement();
+ }
+ resetLatestElement() {
+ this.latestElement = this.getInitialElement();
+ }
+ getInitialRequirement() {
+ return {
+ requirementId: "",
+ text: "",
+ risk: "",
+ verifyMethod: "",
+ name: "",
+ type: "",
+ cssStyles: [],
+ classes: ["default"]
+ };
+ }
+ getInitialElement() {
+ return {
+ name: "",
+ type: "",
+ docRef: "",
+ cssStyles: [],
+ classes: ["default"]
+ };
+ }
+ addRequirement(name, type3) {
+ if (!this.requirements.has(name)) {
+ this.requirements.set(name, {
+ name,
+ type: type3,
+ requirementId: this.latestRequirement.requirementId,
+ text: this.latestRequirement.text,
+ risk: this.latestRequirement.risk,
+ verifyMethod: this.latestRequirement.verifyMethod,
+ cssStyles: [],
+ classes: ["default"]
+ });
+ }
+ this.resetLatestRequirement();
+ return this.requirements.get(name);
+ }
+ getRequirements() {
+ return this.requirements;
+ }
+ setNewReqId(id29) {
+ if (this.latestRequirement !== void 0) {
+ this.latestRequirement.requirementId = id29;
+ }
+ }
+ setNewReqText(text4) {
+ if (this.latestRequirement !== void 0) {
+ this.latestRequirement.text = text4;
+ }
+ }
+ setNewReqRisk(risk) {
+ if (this.latestRequirement !== void 0) {
+ this.latestRequirement.risk = risk;
+ }
+ }
+ setNewReqVerifyMethod(verifyMethod) {
+ if (this.latestRequirement !== void 0) {
+ this.latestRequirement.verifyMethod = verifyMethod;
+ }
+ }
+ addElement(name) {
+ if (!this.elements.has(name)) {
+ this.elements.set(name, {
+ name,
+ type: this.latestElement.type,
+ docRef: this.latestElement.docRef,
+ cssStyles: [],
+ classes: ["default"]
+ });
+ log.info("Added new element: ", name);
+ }
+ this.resetLatestElement();
+ return this.elements.get(name);
+ }
+ getElements() {
+ return this.elements;
+ }
+ setNewElementType(type3) {
+ if (this.latestElement !== void 0) {
+ this.latestElement.type = type3;
+ }
+ }
+ setNewElementDocRef(docRef) {
+ if (this.latestElement !== void 0) {
+ this.latestElement.docRef = docRef;
+ }
+ }
+ addRelationship(type3, src, dst) {
+ this.relations.push({
type: type3,
- id: latestRequirement.id,
- text: latestRequirement.text,
- risk: latestRequirement.risk,
- verifyMethod: latestRequirement.verifyMethod
+ src,
+ dst
});
}
- latestRequirement = {};
- return requirements.get(name);
- }, "addRequirement");
- getRequirements = /* @__PURE__ */ __name(() => requirements, "getRequirements");
- setNewReqId = /* @__PURE__ */ __name((id27) => {
- if (latestRequirement !== void 0) {
- latestRequirement.id = id27;
- }
- }, "setNewReqId");
- setNewReqText = /* @__PURE__ */ __name((text2) => {
- if (latestRequirement !== void 0) {
- latestRequirement.text = text2;
- }
- }, "setNewReqText");
- setNewReqRisk = /* @__PURE__ */ __name((risk) => {
- if (latestRequirement !== void 0) {
- latestRequirement.risk = risk;
- }
- }, "setNewReqRisk");
- setNewReqVerifyMethod = /* @__PURE__ */ __name((verifyMethod) => {
- if (latestRequirement !== void 0) {
- latestRequirement.verifyMethod = verifyMethod;
- }
- }, "setNewReqVerifyMethod");
- addElement = /* @__PURE__ */ __name((name) => {
- if (!elements.has(name)) {
- elements.set(name, {
- name,
- type: latestElement.type,
- docRef: latestElement.docRef
- });
- log.info("Added new requirement: ", name);
- }
- latestElement = {};
- return elements.get(name);
- }, "addElement");
- getElements = /* @__PURE__ */ __name(() => elements, "getElements");
- setNewElementType = /* @__PURE__ */ __name((type3) => {
- if (latestElement !== void 0) {
- latestElement.type = type3;
- }
- }, "setNewElementType");
- setNewElementDocRef = /* @__PURE__ */ __name((docRef) => {
- if (latestElement !== void 0) {
- latestElement.docRef = docRef;
- }
- }, "setNewElementDocRef");
- addRelationship2 = /* @__PURE__ */ __name((type3, src, dst) => {
- relations.push({
- type: type3,
- src,
- dst
- });
- }, "addRelationship");
- getRelationships2 = /* @__PURE__ */ __name(() => relations, "getRelationships");
- clear16 = /* @__PURE__ */ __name(() => {
- relations = [];
- latestRequirement = {};
- requirements = /* @__PURE__ */ new Map();
- latestElement = {};
- elements = /* @__PURE__ */ new Map();
- clear();
- }, "clear");
- requirementDb_default = {
- RequirementType,
- RiskLevel,
- VerifyType,
- Relationships,
- getConfig: /* @__PURE__ */ __name(() => getConfig2().req, "getConfig"),
- addRequirement,
- getRequirements,
- setNewReqId,
- setNewReqText,
- setNewReqRisk,
- setNewReqVerifyMethod,
- setAccTitle,
- getAccTitle,
- setAccDescription,
- getAccDescription,
- addElement,
- getElements,
- setNewElementType,
- setNewElementDocRef,
- addRelationship: addRelationship2,
- getRelationships: getRelationships2,
- clear: clear16
+ getRelationships() {
+ return this.relations;
+ }
+ clear() {
+ this.relations = [];
+ this.resetLatestRequirement();
+ this.requirements = /* @__PURE__ */ new Map();
+ this.resetLatestElement();
+ this.elements = /* @__PURE__ */ new Map();
+ this.classes = /* @__PURE__ */ new Map();
+ clear();
+ }
+ setCssStyle(ids, styles4) {
+ for (const id29 of ids) {
+ const node2 = this.requirements.get(id29) ?? this.elements.get(id29);
+ if (!styles4 || !node2) {
+ return;
+ }
+ for (const s2 of styles4) {
+ if (s2.includes(",")) {
+ node2.cssStyles.push(...s2.split(","));
+ } else {
+ node2.cssStyles.push(s2);
+ }
+ }
+ }
+ }
+ setClass(ids, classNames) {
+ for (const id29 of ids) {
+ const node2 = this.requirements.get(id29) ?? this.elements.get(id29);
+ if (node2) {
+ for (const _class2 of classNames) {
+ node2.classes.push(_class2);
+ const styles4 = this.classes.get(_class2)?.styles;
+ if (styles4) {
+ node2.cssStyles.push(...styles4);
+ }
+ }
+ }
+ }
+ }
+ defineClass(ids, style3) {
+ for (const id29 of ids) {
+ let styleClass = this.classes.get(id29);
+ if (styleClass === void 0) {
+ styleClass = { id: id29, styles: [], textStyles: [] };
+ this.classes.set(id29, styleClass);
+ }
+ if (style3) {
+ style3.forEach(function(s2) {
+ if (/color/.exec(s2)) {
+ const newStyle = s2.replace("fill", "bgFill");
+ styleClass.textStyles.push(newStyle);
+ }
+ styleClass.styles.push(s2);
+ });
+ }
+ this.requirements.forEach((value2) => {
+ if (value2.classes.includes(id29)) {
+ value2.cssStyles.push(...style3.flatMap((s2) => s2.split(",")));
+ }
+ });
+ this.elements.forEach((value2) => {
+ if (value2.classes.includes(id29)) {
+ value2.cssStyles.push(...style3.flatMap((s2) => s2.split(",")));
+ }
+ });
+ }
+ }
+ getClasses() {
+ return this.classes;
+ }
+ getData() {
+ const config5 = getConfig2();
+ const nodes6 = [];
+ const edges3 = [];
+ for (const requirement of this.requirements.values()) {
+ const node2 = requirement;
+ node2.id = requirement.name;
+ node2.cssStyles = requirement.cssStyles;
+ node2.cssClasses = requirement.classes.join(" ");
+ node2.shape = "requirementBox";
+ node2.look = config5.look;
+ nodes6.push(node2);
+ }
+ for (const element3 of this.elements.values()) {
+ const node2 = element3;
+ node2.shape = "requirementBox";
+ node2.look = config5.look;
+ node2.id = element3.name;
+ node2.cssStyles = element3.cssStyles;
+ node2.cssClasses = element3.classes.join(" ");
+ nodes6.push(node2);
+ }
+ for (const relation of this.relations) {
+ let counter2 = 0;
+ const isContains = relation.type === this.Relationships.CONTAINS;
+ const edge = {
+ id: `${relation.src}-${relation.dst}-${counter2}`,
+ start: this.requirements.get(relation.src)?.name ?? this.elements.get(relation.src)?.name,
+ end: this.requirements.get(relation.dst)?.name ?? this.elements.get(relation.dst)?.name,
+ label: `<<${relation.type}>>`,
+ classes: "relationshipLine",
+ style: ["fill:none", isContains ? "" : "stroke-dasharray: 10,7"],
+ labelpos: "c",
+ thickness: "normal",
+ type: "normal",
+ pattern: isContains ? "normal" : "dashed",
+ arrowTypeStart: isContains ? "requirement_contains" : "",
+ arrowTypeEnd: isContains ? "" : "requirement_arrow",
+ look: config5.look
+ };
+ edges3.push(edge);
+ counter2++;
+ }
+ return { nodes: nodes6, edges: edges3, other: {}, config: config5, direction: this.getDirection() };
+ }
};
}
});
@@ -81450,266 +88056,64 @@ ${content}`;
.relationshipLabel {
fill: ${options3.relationLabelColor};
}
+ .divider {
+ stroke: ${options3.nodeBorder};
+ stroke-width: 1;
+ }
+ .label {
+ font-family: ${options3.fontFamily};
+ color: ${options3.nodeTextColor || options3.textColor};
+ }
+ .label text,span {
+ fill: ${options3.nodeTextColor || options3.textColor};
+ color: ${options3.nodeTextColor || options3.textColor};
+ }
+ .labelBkg {
+ background-color: ${options3.edgeLabelBackground};
+ }
`, "getStyles");
styles_default7 = getStyles8;
}
});
- // src/diagrams/requirement/requirementMarkers.js
- var ReqMarkers, insertLineEndings, requirementMarkers_default;
- var init_requirementMarkers = __esm({
- "src/diagrams/requirement/requirementMarkers.js"() {
- "use strict";
- ReqMarkers = {
- CONTAINS: "contains",
- ARROW: "arrow"
- };
- insertLineEndings = /* @__PURE__ */ __name((parentNode, conf8) => {
- let containsNode = parentNode.append("defs").append("marker").attr("id", ReqMarkers.CONTAINS + "_line_ending").attr("refX", 0).attr("refY", conf8.line_height / 2).attr("markerWidth", conf8.line_height).attr("markerHeight", conf8.line_height).attr("orient", "auto").append("g");
- containsNode.append("circle").attr("cx", conf8.line_height / 2).attr("cy", conf8.line_height / 2).attr("r", conf8.line_height / 2).attr("fill", "none");
- containsNode.append("line").attr("x1", 0).attr("x2", conf8.line_height).attr("y1", conf8.line_height / 2).attr("y2", conf8.line_height / 2).attr("stroke-width", 1);
- containsNode.append("line").attr("y1", 0).attr("y2", conf8.line_height).attr("x1", conf8.line_height / 2).attr("x2", conf8.line_height / 2).attr("stroke-width", 1);
- parentNode.append("defs").append("marker").attr("id", ReqMarkers.ARROW + "_line_ending").attr("refX", conf8.line_height).attr("refY", 0.5 * conf8.line_height).attr("markerWidth", conf8.line_height).attr("markerHeight", conf8.line_height).attr("orient", "auto").append("path").attr(
- "d",
- `M0,0
- L${conf8.line_height},${conf8.line_height / 2}
- M${conf8.line_height},${conf8.line_height / 2}
- L0,${conf8.line_height}`
- ).attr("stroke-width", 1);
- }, "insertLineEndings");
- requirementMarkers_default = {
- ReqMarkers,
- insertLineEndings
- };
- }
+ // src/diagrams/requirement/requirementRenderer.ts
+ var requirementRenderer_exports = {};
+ __export(requirementRenderer_exports, {
+ draw: () => draw10
});
-
- // src/diagrams/requirement/requirementRenderer.js
- var conf3, relCnt2, newRectNode, newTitleNode, newBodyNode, addEdgeLabel, drawRelationshipFromLayout2, drawReqs, drawElements, addRelationships2, adjustEntities2, elementString, draw10, requirementRenderer_default;
+ var draw10;
var init_requirementRenderer = __esm({
- "src/diagrams/requirement/requirementRenderer.js"() {
+ "src/diagrams/requirement/requirementRenderer.ts"() {
"use strict";
- init_src32();
- init_dagre();
- init_graphlib();
init_diagramAPI();
init_logger();
- init_setupGraphViewbox();
- init_common();
- init_requirementMarkers();
- conf3 = {};
- relCnt2 = 0;
- newRectNode = /* @__PURE__ */ __name((parentNode, id27) => {
- return parentNode.insert("rect", "#" + id27).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", conf3.rect_min_width + "px").attr("height", conf3.rect_min_height + "px");
- }, "newRectNode");
- newTitleNode = /* @__PURE__ */ __name((parentNode, id27, txts) => {
- let x5 = conf3.rect_min_width / 2;
- let title2 = parentNode.append("text").attr("class", "req reqLabel reqTitle").attr("id", id27).attr("x", x5).attr("y", conf3.rect_padding).attr("dominant-baseline", "hanging");
- let i2 = 0;
- txts.forEach((textStr) => {
- if (i2 == 0) {
- title2.append("tspan").attr("text-anchor", "middle").attr("x", conf3.rect_min_width / 2).attr("dy", 0).text(textStr);
- } else {
- title2.append("tspan").attr("text-anchor", "middle").attr("x", conf3.rect_min_width / 2).attr("dy", conf3.line_height * 0.75).text(textStr);
- }
- i2++;
- });
- let yPadding = 1.5 * conf3.rect_padding;
- let linePadding = i2 * conf3.line_height * 0.75;
- let totalY = yPadding + linePadding;
- parentNode.append("line").attr("class", "req-title-line").attr("x1", "0").attr("x2", conf3.rect_min_width).attr("y1", totalY).attr("y2", totalY);
- return {
- titleNode: title2,
- y: totalY
- };
- }, "newTitleNode");
- newBodyNode = /* @__PURE__ */ __name((parentNode, id27, txts, yStart) => {
- let body = parentNode.append("text").attr("class", "req reqLabel").attr("id", id27).attr("x", conf3.rect_padding).attr("y", yStart).attr("dominant-baseline", "hanging");
- let currentRow = 0;
- const charLimit = 30;
- let wrappedTxts = [];
- txts.forEach((textStr) => {
- let currentTextLen = textStr.length;
- while (currentTextLen > charLimit && currentRow < 3) {
- let firstPart = textStr.substring(0, charLimit);
- textStr = textStr.substring(charLimit, textStr.length);
- currentTextLen = textStr.length;
- wrappedTxts[wrappedTxts.length] = firstPart;
- currentRow++;
- }
- if (currentRow == 3) {
- let lastStr = wrappedTxts[wrappedTxts.length - 1];
- wrappedTxts[wrappedTxts.length - 1] = lastStr.substring(0, lastStr.length - 4) + "...";
- } else {
- wrappedTxts[wrappedTxts.length] = textStr;
- }
- currentRow = 0;
- });
- wrappedTxts.forEach((textStr) => {
- body.append("tspan").attr("x", conf3.rect_padding).attr("dy", conf3.line_height).text(textStr);
- });
- return body;
- }, "newBodyNode");
- addEdgeLabel = /* @__PURE__ */ __name((parentNode, svgPath, conf8, txt) => {
- const len = svgPath.node().getTotalLength();
- const labelPoint = svgPath.node().getPointAtLength(len * 0.5);
- const labelId = "rel" + relCnt2;
- relCnt2++;
- const labelNode = parentNode.append("text").attr("class", "req relationshipLabel").attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(txt);
- const labelBBox = labelNode.node().getBBox();
- parentNode.insert("rect", "#" + labelId).attr("class", "req reqLabelBox").attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height).attr("fill", "white").attr("fill-opacity", "85%");
- }, "addEdgeLabel");
- drawRelationshipFromLayout2 = /* @__PURE__ */ __name(function(svg, rel2, g2, insert, diagObj) {
- const edge = g2.edge(elementString(rel2.src), elementString(rel2.dst));
- const lineFunction = line_default().x(function(d2) {
- return d2.x;
- }).y(function(d2) {
- return d2.y;
- });
- const svgPath = svg.insert("path", "#" + insert).attr("class", "er relationshipLine").attr("d", lineFunction(edge.points)).attr("fill", "none");
- if (rel2.type == diagObj.db.Relationships.CONTAINS) {
- svgPath.attr(
- "marker-start",
- "url(" + common_default.getUrl(conf3.arrowMarkerAbsolute) + "#" + rel2.type + "_line_ending)"
- );
- } else {
- svgPath.attr("stroke-dasharray", "10,7");
- svgPath.attr(
- "marker-end",
- "url(" + common_default.getUrl(conf3.arrowMarkerAbsolute) + "#" + requirementMarkers_default.ReqMarkers.ARROW + "_line_ending)"
- );
- }
- addEdgeLabel(svg, svgPath, conf3, `<<${rel2.type}>>`);
- return;
- }, "drawRelationshipFromLayout");
- drawReqs = /* @__PURE__ */ __name((reqs, graph, svgNode2) => {
- reqs.forEach((req, reqName) => {
- reqName = elementString(reqName);
- log.info("Added new requirement: ", reqName);
- const groupNode = svgNode2.append("g").attr("id", reqName);
- const textId = "req-" + reqName;
- const rectNode = newRectNode(groupNode, textId);
- let nodes6 = [];
- let titleNodeInfo = newTitleNode(groupNode, reqName + "_title", [
- `<<${req.type}>>`,
- `${req.name}`
- ]);
- nodes6.push(titleNodeInfo.titleNode);
- let bodyNode = newBodyNode(
- groupNode,
- reqName + "_body",
- [
- `Id: ${req.id}`,
- `Text: ${req.text}`,
- `Risk: ${req.risk}`,
- `Verification: ${req.verifyMethod}`
- ],
- titleNodeInfo.y
- );
- nodes6.push(bodyNode);
- const rectBBox = rectNode.node().getBBox();
- graph.setNode(reqName, {
- width: rectBBox.width,
- height: rectBBox.height,
- shape: "rect",
- id: reqName
- });
- });
- }, "drawReqs");
- drawElements = /* @__PURE__ */ __name((els, graph, svgNode2) => {
- els.forEach((el, elName) => {
- const id27 = elementString(elName);
- const groupNode = svgNode2.append("g").attr("id", id27);
- const textId = "element-" + id27;
- const rectNode = newRectNode(groupNode, textId);
- let nodes6 = [];
- let titleNodeInfo = newTitleNode(groupNode, textId + "_title", [`<>`, `${elName}`]);
- nodes6.push(titleNodeInfo.titleNode);
- let bodyNode = newBodyNode(
- groupNode,
- textId + "_body",
- [`Type: ${el.type || "Not Specified"}`, `Doc Ref: ${el.docRef || "None"}`],
- titleNodeInfo.y
- );
- nodes6.push(bodyNode);
- const rectBBox = rectNode.node().getBBox();
- graph.setNode(id27, {
- width: rectBBox.width,
- height: rectBBox.height,
- shape: "rect",
- id: id27
- });
- });
- }, "drawElements");
- addRelationships2 = /* @__PURE__ */ __name((relationships2, g2) => {
- relationships2.forEach(function(r2) {
- let src = elementString(r2.src);
- let dst = elementString(r2.dst);
- g2.setEdge(src, dst, { relationship: r2 });
- });
- return relationships2;
- }, "addRelationships");
- adjustEntities2 = /* @__PURE__ */ __name(function(svgNode2, graph) {
- graph.nodes().forEach(function(v3) {
- if (v3 !== void 0 && graph.node(v3) !== void 0) {
- svgNode2.select("#" + v3);
- svgNode2.select("#" + v3).attr(
- "transform",
- "translate(" + (graph.node(v3).x - graph.node(v3).width / 2) + "," + (graph.node(v3).y - graph.node(v3).height / 2) + " )"
- );
- }
- });
- return;
- }, "adjustEntities");
- elementString = /* @__PURE__ */ __name((str2) => {
- return str2.replace(/\s/g, "").replace(/\./g, "_");
- }, "elementString");
- draw10 = /* @__PURE__ */ __name((text2, id27, _version, diagObj) => {
- conf3 = getConfig2().requirement;
- const securityLevel = conf3.securityLevel;
- let sandboxElement;
- if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
- }
- const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const svg = root4.select(`[id='${id27}']`);
- requirementMarkers_default.insertLineEndings(svg, conf3);
- const g2 = new Graph({
- multigraph: false,
- compound: false,
- directed: true
- }).setGraph({
- rankdir: conf3.layoutDirection,
- marginx: 20,
- marginy: 20,
- nodesep: 100,
- edgesep: 100,
- ranksep: 100
- }).setDefaultEdgeLabel(function() {
- return {};
- });
- let requirements2 = diagObj.db.getRequirements();
- let elements3 = diagObj.db.getElements();
- let relationships2 = diagObj.db.getRelationships();
- drawReqs(requirements2, g2, svg);
- drawElements(elements3, g2, svg);
- addRelationships2(relationships2, g2);
- layout(g2);
- adjustEntities2(svg, g2);
- relationships2.forEach(function(rel2) {
- drawRelationshipFromLayout2(svg, rel2, g2, id27, diagObj);
- });
- const padding3 = conf3.rect_padding;
- const svgBounds = svg.node().getBBox();
- const width3 = svgBounds.width + padding3 * 2;
- const height2 = svgBounds.height + padding3 * 2;
- configureSvgSize(svg, height2, width3, conf3.useMaxWidth);
- svg.attr("viewBox", `${svgBounds.x - padding3} ${svgBounds.y - padding3} ${width3} ${height2}`);
+ init_insertElementsForSize();
+ init_render();
+ init_setupViewPortForSVG();
+ init_utils2();
+ draw10 = /* @__PURE__ */ __name(async function(text4, id29, _version, diag) {
+ log.info("REF0:");
+ log.info("Drawing requirement diagram (unified)", id29);
+ const { securityLevel, state: conf5, layout: layout6 } = getConfig2();
+ const data4Layout = diag.db.getData();
+ const svg2 = getDiagramElement(id29, securityLevel);
+ data4Layout.type = diag.type;
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout6);
+ data4Layout.nodeSpacing = conf5?.nodeSpacing ?? 50;
+ data4Layout.rankSpacing = conf5?.rankSpacing ?? 50;
+ data4Layout.markers = ["requirement_contains", "requirement_arrow"];
+ data4Layout.diagramId = id29;
+ await render4(data4Layout, svg2);
+ const padding2 = 8;
+ utils_default2.insertTitle(
+ svg2,
+ "requirementDiagramTitleText",
+ conf5?.titleTopMargin ?? 25,
+ diag.db.getDiagramTitle()
+ );
+ setupViewPortForSVG(svg2, padding2, "requirementDiagram", conf5?.useMaxWidth ?? true);
}, "draw");
- requirementRenderer_default = {
- draw: draw10
- };
}
});
@@ -81728,8 +88132,10 @@ ${content}`;
init_requirementRenderer();
diagram10 = {
parser: requirementDiagram_default,
- db: requirementDb_default,
- renderer: requirementRenderer_default,
+ get db() {
+ return new RequirementDB();
+ },
+ renderer: requirementRenderer_exports,
styles: styles_default7
};
}
@@ -81745,7 +88151,7 @@ ${content}`;
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 13], $V7 = [1, 14], $V8 = [1, 16], $V9 = [1, 17], $Va = [1, 18], $Vb = [1, 24], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 30], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 33], $Vl = [1, 34], $Vm = [1, 35], $Vn = [1, 36], $Vo = [1, 37], $Vp = [1, 38], $Vq = [1, 39], $Vr = [1, 41], $Vs = [1, 42], $Vt = [1, 43], $Vu = [1, 44], $Vv = [1, 45], $Vw = [1, 46], $Vx = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], $Vy = [4, 5, 16, 50, 52, 53], $Vz = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VA = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VB = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VC = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VD = [68, 69, 70], $VE = [1, 122];
- var parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -81998,7 +88404,7 @@ ${content}`;
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -82028,7 +88434,7 @@ ${content}`;
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -82040,22 +88446,22 @@ ${content}`;
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -82074,7 +88480,7 @@ ${content}`;
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -82374,7 +88780,7 @@ ${content}`;
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -82660,13 +89066,13 @@ ${content}`;
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser12.parser = parser12;
@@ -82675,28 +89081,7 @@ ${content}`;
});
// src/diagrams/sequence/sequenceDb.ts
- function insertLinks(actor, links3) {
- if (actor.links == null) {
- actor.links = links3;
- } else {
- for (const key in links3) {
- actor.links[key] = links3[key];
- }
- }
- }
- function insertProperties(actor, properties) {
- if (actor.properties == null) {
- actor.properties = properties;
- } else {
- for (const key in properties) {
- actor.properties[key] = properties[key];
- }
- }
- }
- function boxEnd() {
- state3.records.currentBox = void 0;
- }
- var state3, addBox, addActor, activationCount, addMessage, addSignal, hasAtLeastOneBox, hasAtLeastOneBoxWithTitle, getMessages, getBoxes, getActors, getCreatedActors, getDestroyedActors, getActor, getActorKeys, enableSequenceNumbers, disableSequenceNumbers, showSequenceNumbers, setWrap2, extractWrap, autoWrap2, clear17, parseMessage, parseBoxData, LINETYPE2, ARROWTYPE2, PLACEMENT2, addNote, addLinks, addALink, addProperties, addDetails, getActorProperty, apply2, sequenceDb_default;
+ var LINETYPE2, ARROWTYPE2, PLACEMENT2, SequenceDB;
var init_sequenceDb = __esm({
"src/diagrams/sequence/sequenceDb.ts"() {
"use strict";
@@ -82705,213 +89090,6 @@ ${content}`;
init_imperativeState();
init_common();
init_commonDb();
- state3 = new ImperativeState(() => ({
- prevActor: void 0,
- actors: /* @__PURE__ */ new Map(),
- createdActors: /* @__PURE__ */ new Map(),
- destroyedActors: /* @__PURE__ */ new Map(),
- boxes: [],
- messages: [],
- notes: [],
- sequenceNumbersEnabled: false,
- wrapEnabled: void 0,
- currentBox: void 0,
- lastCreated: void 0,
- lastDestroyed: void 0
- }));
- addBox = /* @__PURE__ */ __name(function(data5) {
- state3.records.boxes.push({
- name: data5.text,
- wrap: data5.wrap ?? autoWrap2(),
- fill: data5.color,
- actorKeys: []
- });
- state3.records.currentBox = state3.records.boxes.slice(-1)[0];
- }, "addBox");
- addActor = /* @__PURE__ */ __name(function(id27, name, description, type3) {
- let assignedBox = state3.records.currentBox;
- const old = state3.records.actors.get(id27);
- if (old) {
- if (state3.records.currentBox && old.box && state3.records.currentBox !== old.box) {
- throw new Error(
- `A same participant should only be defined in one Box: ${old.name} can't be in '${old.box.name}' and in '${state3.records.currentBox.name}' at the same time.`
- );
- }
- assignedBox = old.box ? old.box : state3.records.currentBox;
- old.box = assignedBox;
- if (old && name === old.name && description == null) {
- return;
- }
- }
- if (description?.text == null) {
- description = { text: name, type: type3 };
- }
- if (type3 == null || description.text == null) {
- description = { text: name, type: type3 };
- }
- state3.records.actors.set(id27, {
- box: assignedBox,
- name,
- description: description.text,
- wrap: description.wrap ?? autoWrap2(),
- prevActor: state3.records.prevActor,
- links: {},
- properties: {},
- actorCnt: null,
- rectData: null,
- type: type3 ?? "participant"
- });
- if (state3.records.prevActor) {
- const prevActorInRecords = state3.records.actors.get(state3.records.prevActor);
- if (prevActorInRecords) {
- prevActorInRecords.nextActor = id27;
- }
- }
- if (state3.records.currentBox) {
- state3.records.currentBox.actorKeys.push(id27);
- }
- state3.records.prevActor = id27;
- }, "addActor");
- activationCount = /* @__PURE__ */ __name((part) => {
- let i2;
- let count = 0;
- if (!part) {
- return 0;
- }
- for (i2 = 0; i2 < state3.records.messages.length; i2++) {
- if (state3.records.messages[i2].type === LINETYPE2.ACTIVE_START && state3.records.messages[i2].from === part) {
- count++;
- }
- if (state3.records.messages[i2].type === LINETYPE2.ACTIVE_END && state3.records.messages[i2].from === part) {
- count--;
- }
- }
- return count;
- }, "activationCount");
- addMessage = /* @__PURE__ */ __name(function(idFrom, idTo, message, answer) {
- state3.records.messages.push({
- from: idFrom,
- to: idTo,
- message: message.text,
- wrap: message.wrap ?? autoWrap2(),
- answer
- });
- }, "addMessage");
- addSignal = /* @__PURE__ */ __name(function(idFrom, idTo, message, messageType, activate = false) {
- if (messageType === LINETYPE2.ACTIVE_END) {
- const cnt4 = activationCount(idFrom ?? "");
- if (cnt4 < 1) {
- const error3 = new Error("Trying to inactivate an inactive participant (" + idFrom + ")");
- error3.hash = {
- text: "->>-",
- token: "->>-",
- line: "1",
- loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
- expected: ["'ACTIVE_PARTICIPANT'"]
- };
- throw error3;
- }
- }
- state3.records.messages.push({
- from: idFrom,
- to: idTo,
- message: message?.text ?? "",
- wrap: message?.wrap ?? autoWrap2(),
- type: messageType,
- activate
- });
- return true;
- }, "addSignal");
- hasAtLeastOneBox = /* @__PURE__ */ __name(function() {
- return state3.records.boxes.length > 0;
- }, "hasAtLeastOneBox");
- hasAtLeastOneBoxWithTitle = /* @__PURE__ */ __name(function() {
- return state3.records.boxes.some((b2) => b2.name);
- }, "hasAtLeastOneBoxWithTitle");
- getMessages = /* @__PURE__ */ __name(function() {
- return state3.records.messages;
- }, "getMessages");
- getBoxes = /* @__PURE__ */ __name(function() {
- return state3.records.boxes;
- }, "getBoxes");
- getActors = /* @__PURE__ */ __name(function() {
- return state3.records.actors;
- }, "getActors");
- getCreatedActors = /* @__PURE__ */ __name(function() {
- return state3.records.createdActors;
- }, "getCreatedActors");
- getDestroyedActors = /* @__PURE__ */ __name(function() {
- return state3.records.destroyedActors;
- }, "getDestroyedActors");
- getActor = /* @__PURE__ */ __name(function(id27) {
- return state3.records.actors.get(id27);
- }, "getActor");
- getActorKeys = /* @__PURE__ */ __name(function() {
- return [...state3.records.actors.keys()];
- }, "getActorKeys");
- enableSequenceNumbers = /* @__PURE__ */ __name(function() {
- state3.records.sequenceNumbersEnabled = true;
- }, "enableSequenceNumbers");
- disableSequenceNumbers = /* @__PURE__ */ __name(function() {
- state3.records.sequenceNumbersEnabled = false;
- }, "disableSequenceNumbers");
- showSequenceNumbers = /* @__PURE__ */ __name(() => state3.records.sequenceNumbersEnabled, "showSequenceNumbers");
- setWrap2 = /* @__PURE__ */ __name(function(wrapSetting) {
- state3.records.wrapEnabled = wrapSetting;
- }, "setWrap");
- extractWrap = /* @__PURE__ */ __name((text2) => {
- if (text2 === void 0) {
- return {};
- }
- text2 = text2.trim();
- const wrap3 = /^:?wrap:/.exec(text2) !== null ? true : /^:?nowrap:/.exec(text2) !== null ? false : void 0;
- const cleanedText = (wrap3 === void 0 ? text2 : text2.replace(/^:?(?:no)?wrap:/, "")).trim();
- return { cleanedText, wrap: wrap3 };
- }, "extractWrap");
- autoWrap2 = /* @__PURE__ */ __name(() => {
- if (state3.records.wrapEnabled !== void 0) {
- return state3.records.wrapEnabled;
- }
- return getConfig2().sequence?.wrap ?? false;
- }, "autoWrap");
- clear17 = /* @__PURE__ */ __name(function() {
- state3.reset();
- clear();
- }, "clear");
- parseMessage = /* @__PURE__ */ __name(function(str2) {
- const trimmedStr = str2.trim();
- const { wrap: wrap3, cleanedText } = extractWrap(trimmedStr);
- const message = {
- text: cleanedText,
- wrap: wrap3
- };
- log.debug(`parseMessage: ${JSON.stringify(message)}`);
- return message;
- }, "parseMessage");
- parseBoxData = /* @__PURE__ */ __name(function(str2) {
- const match2 = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(str2);
- let color2 = match2?.[1] ? match2[1].trim() : "transparent";
- let title2 = match2?.[2] ? match2[2].trim() : void 0;
- if (window?.CSS) {
- if (!window.CSS.supports("color", color2)) {
- color2 = "transparent";
- title2 = str2.trim();
- }
- } else {
- const style3 = new Option().style;
- style3.color = color2;
- if (style3.color !== color2) {
- color2 = "transparent";
- title2 = str2.trim();
- }
- }
- const { wrap: wrap3, cleanedText } = extractWrap(title2);
- return {
- text: cleanedText ? sanitizeText(cleanedText, getConfig2()) : void 0,
- color: color2,
- wrap: wrap3
- };
- }, "parseBoxData");
LINETYPE2 = {
SOLID: 0,
DOTTED: 1,
@@ -82955,265 +89133,486 @@ ${content}`;
RIGHTOF: 1,
OVER: 2
};
- addNote = /* @__PURE__ */ __name(function(actor, placement, message) {
- const note3 = {
- actor,
- placement,
- message: message.text,
- wrap: message.wrap ?? autoWrap2()
- };
- const actors2 = [].concat(actor, actor);
- state3.records.notes.push(note3);
- state3.records.messages.push({
- from: actors2[0],
- to: actors2[1],
- message: message.text,
- wrap: message.wrap ?? autoWrap2(),
- type: LINETYPE2.NOTE,
- placement
- });
- }, "addNote");
- addLinks = /* @__PURE__ */ __name(function(actorId, text2) {
- const actor = getActor(actorId);
- try {
- let sanitizedText = sanitizeText(text2.text, getConfig2());
- sanitizedText = sanitizedText.replace(/&/g, "&");
- sanitizedText = sanitizedText.replace(/=/g, "=");
- const links3 = JSON.parse(sanitizedText);
- insertLinks(actor, links3);
- } catch (e3) {
- log.error("error while parsing actor link text", e3);
+ SequenceDB = class {
+ constructor() {
+ this.state = new ImperativeState(() => ({
+ prevActor: void 0,
+ actors: /* @__PURE__ */ new Map(),
+ createdActors: /* @__PURE__ */ new Map(),
+ destroyedActors: /* @__PURE__ */ new Map(),
+ boxes: [],
+ messages: [],
+ notes: [],
+ sequenceNumbersEnabled: false,
+ wrapEnabled: void 0,
+ currentBox: void 0,
+ lastCreated: void 0,
+ lastDestroyed: void 0
+ }));
+ this.setAccTitle = setAccTitle;
+ this.setAccDescription = setAccDescription;
+ this.setDiagramTitle = setDiagramTitle;
+ this.getAccTitle = getAccTitle;
+ this.getAccDescription = getAccDescription;
+ this.getDiagramTitle = getDiagramTitle;
+ this.apply = this.apply.bind(this);
+ this.parseBoxData = this.parseBoxData.bind(this);
+ this.parseMessage = this.parseMessage.bind(this);
+ this.clear();
+ this.setWrap(getConfig2().wrap);
+ this.LINETYPE = LINETYPE2;
+ this.ARROWTYPE = ARROWTYPE2;
+ this.PLACEMENT = PLACEMENT2;
}
- }, "addLinks");
- addALink = /* @__PURE__ */ __name(function(actorId, text2) {
- const actor = getActor(actorId);
- try {
- const links3 = {};
- let sanitizedText = sanitizeText(text2.text, getConfig2());
- const sep2 = sanitizedText.indexOf("@");
- sanitizedText = sanitizedText.replace(/&/g, "&");
- sanitizedText = sanitizedText.replace(/=/g, "=");
- const label = sanitizedText.slice(0, sep2 - 1).trim();
- const link3 = sanitizedText.slice(sep2 + 1).trim();
- links3[label] = link3;
- insertLinks(actor, links3);
- } catch (e3) {
- log.error("error while parsing actor link text", e3);
+ static {
+ __name(this, "SequenceDB");
+ }
+ addBox(data6) {
+ this.state.records.boxes.push({
+ name: data6.text,
+ wrap: data6.wrap ?? this.autoWrap(),
+ fill: data6.color,
+ actorKeys: []
+ });
+ this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
}
- }, "addALink");
- __name(insertLinks, "insertLinks");
- addProperties = /* @__PURE__ */ __name(function(actorId, text2) {
- const actor = getActor(actorId);
- try {
- const sanitizedText = sanitizeText(text2.text, getConfig2());
- const properties = JSON.parse(sanitizedText);
- insertProperties(actor, properties);
- } catch (e3) {
- log.error("error while parsing actor properties text", e3);
- }
- }, "addProperties");
- __name(insertProperties, "insertProperties");
- __name(boxEnd, "boxEnd");
- addDetails = /* @__PURE__ */ __name(function(actorId, text2) {
- const actor = getActor(actorId);
- const elem = document.getElementById(text2.text);
- try {
- const text3 = elem.innerHTML;
- const details = JSON.parse(text3);
- if (details.properties) {
- insertProperties(actor, details.properties);
+ addActor(id29, name, description, type3) {
+ let assignedBox = this.state.records.currentBox;
+ const old = this.state.records.actors.get(id29);
+ if (old) {
+ if (this.state.records.currentBox && old.box && this.state.records.currentBox !== old.box) {
+ throw new Error(
+ `A same participant should only be defined in one Box: ${old.name} can't be in '${old.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
+ );
+ }
+ assignedBox = old.box ? old.box : this.state.records.currentBox;
+ old.box = assignedBox;
+ if (old && name === old.name && description == null) {
+ return;
+ }
}
- if (details.links) {
- insertLinks(actor, details.links);
+ if (description?.text == null) {
+ description = { text: name, type: type3 };
}
- } catch (e3) {
- log.error("error while parsing actor details text", e3);
+ if (type3 == null || description.text == null) {
+ description = { text: name, type: type3 };
+ }
+ this.state.records.actors.set(id29, {
+ box: assignedBox,
+ name,
+ description: description.text,
+ wrap: description.wrap ?? this.autoWrap(),
+ prevActor: this.state.records.prevActor,
+ links: {},
+ properties: {},
+ actorCnt: null,
+ rectData: null,
+ type: type3 ?? "participant"
+ });
+ if (this.state.records.prevActor) {
+ const prevActorInRecords = this.state.records.actors.get(this.state.records.prevActor);
+ if (prevActorInRecords) {
+ prevActorInRecords.nextActor = id29;
+ }
+ }
+ if (this.state.records.currentBox) {
+ this.state.records.currentBox.actorKeys.push(id29);
+ }
+ this.state.records.prevActor = id29;
}
- }, "addDetails");
- getActorProperty = /* @__PURE__ */ __name(function(actor, key) {
- if (actor?.properties !== void 0) {
- return actor.properties[key];
+ activationCount(part) {
+ let i2;
+ let count = 0;
+ if (!part) {
+ return 0;
+ }
+ for (i2 = 0; i2 < this.state.records.messages.length; i2++) {
+ if (this.state.records.messages[i2].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[i2].from === part) {
+ count++;
+ }
+ if (this.state.records.messages[i2].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[i2].from === part) {
+ count--;
+ }
+ }
+ return count;
}
- return void 0;
- }, "getActorProperty");
- apply2 = /* @__PURE__ */ __name(function(param) {
- if (Array.isArray(param)) {
- param.forEach(function(item) {
- apply2(item);
+ addMessage(idFrom, idTo, message, answer) {
+ this.state.records.messages.push({
+ id: this.state.records.messages.length.toString(),
+ from: idFrom,
+ to: idTo,
+ message: message.text,
+ wrap: message.wrap ?? this.autoWrap(),
+ answer
});
- } else {
- switch (param.type) {
- case "sequenceIndex":
- state3.records.messages.push({
- from: void 0,
- to: void 0,
- message: {
- start: param.sequenceIndex,
- step: param.sequenceIndexStep,
- visible: param.sequenceVisible
- },
- wrap: false,
- type: param.signalType
- });
- break;
- case "addParticipant":
- addActor(param.actor, param.actor, param.description, param.draw);
- break;
- case "createParticipant":
- if (state3.records.actors.has(param.actor)) {
- throw new Error(
- "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior"
- );
- }
- state3.records.lastCreated = param.actor;
- addActor(param.actor, param.actor, param.description, param.draw);
- state3.records.createdActors.set(param.actor, state3.records.messages.length);
- break;
- case "destroyParticipant":
- state3.records.lastDestroyed = param.actor;
- state3.records.destroyedActors.set(param.actor, state3.records.messages.length);
- break;
- case "activeStart":
- addSignal(param.actor, void 0, void 0, param.signalType);
- break;
- case "activeEnd":
- addSignal(param.actor, void 0, void 0, param.signalType);
- break;
- case "addNote":
- addNote(param.actor, param.placement, param.text);
- break;
- case "addLinks":
- addLinks(param.actor, param.text);
- break;
- case "addALink":
- addALink(param.actor, param.text);
- break;
- case "addProperties":
- addProperties(param.actor, param.text);
- break;
- case "addDetails":
- addDetails(param.actor, param.text);
- break;
- case "addMessage":
- if (state3.records.lastCreated) {
- if (param.to !== state3.records.lastCreated) {
+ }
+ addSignal(idFrom, idTo, message, messageType, activate = false) {
+ if (messageType === this.LINETYPE.ACTIVE_END) {
+ const cnt5 = this.activationCount(idFrom ?? "");
+ if (cnt5 < 1) {
+ const error3 = new Error("Trying to inactivate an inactive participant (" + idFrom + ")");
+ error3.hash = {
+ text: "->>-",
+ token: "->>-",
+ line: "1",
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
+ expected: ["'ACTIVE_PARTICIPANT'"]
+ };
+ throw error3;
+ }
+ }
+ this.state.records.messages.push({
+ id: this.state.records.messages.length.toString(),
+ from: idFrom,
+ to: idTo,
+ message: message?.text ?? "",
+ wrap: message?.wrap ?? this.autoWrap(),
+ type: messageType,
+ activate
+ });
+ return true;
+ }
+ hasAtLeastOneBox() {
+ return this.state.records.boxes.length > 0;
+ }
+ hasAtLeastOneBoxWithTitle() {
+ return this.state.records.boxes.some((b2) => b2.name);
+ }
+ getMessages() {
+ return this.state.records.messages;
+ }
+ getBoxes() {
+ return this.state.records.boxes;
+ }
+ getActors() {
+ return this.state.records.actors;
+ }
+ getCreatedActors() {
+ return this.state.records.createdActors;
+ }
+ getDestroyedActors() {
+ return this.state.records.destroyedActors;
+ }
+ getActor(id29) {
+ return this.state.records.actors.get(id29);
+ }
+ getActorKeys() {
+ return [...this.state.records.actors.keys()];
+ }
+ enableSequenceNumbers() {
+ this.state.records.sequenceNumbersEnabled = true;
+ }
+ disableSequenceNumbers() {
+ this.state.records.sequenceNumbersEnabled = false;
+ }
+ showSequenceNumbers() {
+ return this.state.records.sequenceNumbersEnabled;
+ }
+ setWrap(wrapSetting) {
+ this.state.records.wrapEnabled = wrapSetting;
+ }
+ extractWrap(text4) {
+ if (text4 === void 0) {
+ return {};
+ }
+ text4 = text4.trim();
+ const wrap3 = /^:?wrap:/.exec(text4) !== null ? true : /^:?nowrap:/.exec(text4) !== null ? false : void 0;
+ const cleanedText = (wrap3 === void 0 ? text4 : text4.replace(/^:?(?:no)?wrap:/, "")).trim();
+ return { cleanedText, wrap: wrap3 };
+ }
+ autoWrap() {
+ if (this.state.records.wrapEnabled !== void 0) {
+ return this.state.records.wrapEnabled;
+ }
+ return getConfig2().sequence?.wrap ?? false;
+ }
+ clear() {
+ this.state.reset();
+ clear();
+ }
+ parseMessage(str2) {
+ const trimmedStr = str2.trim();
+ const { wrap: wrap3, cleanedText } = this.extractWrap(trimmedStr);
+ const message = {
+ text: cleanedText,
+ wrap: wrap3
+ };
+ log.debug(`parseMessage: ${JSON.stringify(message)}`);
+ return message;
+ }
+ // We expect the box statement to be color first then description
+ // The color can be rgb,rgba,hsl,hsla, or css code names #hex codes are not supported for now because of the way the char # is handled
+ // We extract first segment as color, the rest of the line is considered as text
+ parseBoxData(str2) {
+ const match2 = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(str2);
+ let color2 = match2?.[1] ? match2[1].trim() : "transparent";
+ let title2 = match2?.[2] ? match2[2].trim() : void 0;
+ if (window?.CSS) {
+ if (!window.CSS.supports("color", color2)) {
+ color2 = "transparent";
+ title2 = str2.trim();
+ }
+ } else {
+ const style3 = new Option().style;
+ style3.color = color2;
+ if (style3.color !== color2) {
+ color2 = "transparent";
+ title2 = str2.trim();
+ }
+ }
+ const { wrap: wrap3, cleanedText } = this.extractWrap(title2);
+ return {
+ text: cleanedText ? sanitizeText(cleanedText, getConfig2()) : void 0,
+ color: color2,
+ wrap: wrap3
+ };
+ }
+ addNote(actor, placement, message) {
+ const note3 = {
+ actor,
+ placement,
+ message: message.text,
+ wrap: message.wrap ?? this.autoWrap()
+ };
+ const actors2 = [].concat(actor, actor);
+ this.state.records.notes.push(note3);
+ this.state.records.messages.push({
+ id: this.state.records.messages.length.toString(),
+ from: actors2[0],
+ to: actors2[1],
+ message: message.text,
+ wrap: message.wrap ?? this.autoWrap(),
+ type: this.LINETYPE.NOTE,
+ placement
+ });
+ }
+ addLinks(actorId, text4) {
+ const actor = this.getActor(actorId);
+ try {
+ let sanitizedText = sanitizeText(text4.text, getConfig2());
+ sanitizedText = sanitizedText.replace(/=/g, "=");
+ sanitizedText = sanitizedText.replace(/&/g, "&");
+ const links3 = JSON.parse(sanitizedText);
+ this.insertLinks(actor, links3);
+ } catch (e3) {
+ log.error("error while parsing actor link text", e3);
+ }
+ }
+ addALink(actorId, text4) {
+ const actor = this.getActor(actorId);
+ try {
+ const links3 = {};
+ let sanitizedText = sanitizeText(text4.text, getConfig2());
+ const sep2 = sanitizedText.indexOf("@");
+ sanitizedText = sanitizedText.replace(/=/g, "=");
+ sanitizedText = sanitizedText.replace(/&/g, "&");
+ const label = sanitizedText.slice(0, sep2 - 1).trim();
+ const link3 = sanitizedText.slice(sep2 + 1).trim();
+ links3[label] = link3;
+ this.insertLinks(actor, links3);
+ } catch (e3) {
+ log.error("error while parsing actor link text", e3);
+ }
+ }
+ insertLinks(actor, links3) {
+ if (actor.links == null) {
+ actor.links = links3;
+ } else {
+ for (const key in links3) {
+ actor.links[key] = links3[key];
+ }
+ }
+ }
+ addProperties(actorId, text4) {
+ const actor = this.getActor(actorId);
+ try {
+ const sanitizedText = sanitizeText(text4.text, getConfig2());
+ const properties = JSON.parse(sanitizedText);
+ this.insertProperties(actor, properties);
+ } catch (e3) {
+ log.error("error while parsing actor properties text", e3);
+ }
+ }
+ insertProperties(actor, properties) {
+ if (actor.properties == null) {
+ actor.properties = properties;
+ } else {
+ for (const key in properties) {
+ actor.properties[key] = properties[key];
+ }
+ }
+ }
+ boxEnd() {
+ this.state.records.currentBox = void 0;
+ }
+ addDetails(actorId, text4) {
+ const actor = this.getActor(actorId);
+ const elem = document.getElementById(text4.text);
+ try {
+ const text5 = elem.innerHTML;
+ const details = JSON.parse(text5);
+ if (details.properties) {
+ this.insertProperties(actor, details.properties);
+ }
+ if (details.links) {
+ this.insertLinks(actor, details.links);
+ }
+ } catch (e3) {
+ log.error("error while parsing actor details text", e3);
+ }
+ }
+ getActorProperty(actor, key) {
+ if (actor?.properties !== void 0) {
+ return actor.properties[key];
+ }
+ return void 0;
+ }
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
+ apply(param) {
+ if (Array.isArray(param)) {
+ param.forEach((item) => {
+ this.apply(item);
+ });
+ } else {
+ switch (param.type) {
+ case "sequenceIndex":
+ this.state.records.messages.push({
+ id: this.state.records.messages.length.toString(),
+ from: void 0,
+ to: void 0,
+ message: {
+ start: param.sequenceIndex,
+ step: param.sequenceIndexStep,
+ visible: param.sequenceVisible
+ },
+ wrap: false,
+ type: param.signalType
+ });
+ break;
+ case "addParticipant":
+ this.addActor(param.actor, param.actor, param.description, param.draw);
+ break;
+ case "createParticipant":
+ if (this.state.records.actors.has(param.actor)) {
throw new Error(
- "The created participant " + state3.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
+ "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior"
);
- } else {
- state3.records.lastCreated = void 0;
}
- } else if (state3.records.lastDestroyed) {
- if (param.to !== state3.records.lastDestroyed && param.from !== state3.records.lastDestroyed) {
- throw new Error(
- "The destroyed participant " + state3.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
- );
- } else {
- state3.records.lastDestroyed = void 0;
+ this.state.records.lastCreated = param.actor;
+ this.addActor(param.actor, param.actor, param.description, param.draw);
+ this.state.records.createdActors.set(param.actor, this.state.records.messages.length);
+ break;
+ case "destroyParticipant":
+ this.state.records.lastDestroyed = param.actor;
+ this.state.records.destroyedActors.set(param.actor, this.state.records.messages.length);
+ break;
+ case "activeStart":
+ this.addSignal(param.actor, void 0, void 0, param.signalType);
+ break;
+ case "activeEnd":
+ this.addSignal(param.actor, void 0, void 0, param.signalType);
+ break;
+ case "addNote":
+ this.addNote(param.actor, param.placement, param.text);
+ break;
+ case "addLinks":
+ this.addLinks(param.actor, param.text);
+ break;
+ case "addALink":
+ this.addALink(param.actor, param.text);
+ break;
+ case "addProperties":
+ this.addProperties(param.actor, param.text);
+ break;
+ case "addDetails":
+ this.addDetails(param.actor, param.text);
+ break;
+ case "addMessage":
+ if (this.state.records.lastCreated) {
+ if (param.to !== this.state.records.lastCreated) {
+ throw new Error(
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
+ );
+ } else {
+ this.state.records.lastCreated = void 0;
+ }
+ } else if (this.state.records.lastDestroyed) {
+ if (param.to !== this.state.records.lastDestroyed && param.from !== this.state.records.lastDestroyed) {
+ throw new Error(
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
+ );
+ } else {
+ this.state.records.lastDestroyed = void 0;
+ }
}
- }
- addSignal(param.from, param.to, param.msg, param.signalType, param.activate);
- break;
- case "boxStart":
- addBox(param.boxData);
- break;
- case "boxEnd":
- boxEnd();
- break;
- case "loopStart":
- addSignal(void 0, void 0, param.loopText, param.signalType);
- break;
- case "loopEnd":
- addSignal(void 0, void 0, void 0, param.signalType);
- break;
- case "rectStart":
- addSignal(void 0, void 0, param.color, param.signalType);
- break;
- case "rectEnd":
- addSignal(void 0, void 0, void 0, param.signalType);
- break;
- case "optStart":
- addSignal(void 0, void 0, param.optText, param.signalType);
- break;
- case "optEnd":
- addSignal(void 0, void 0, void 0, param.signalType);
- break;
- case "altStart":
- addSignal(void 0, void 0, param.altText, param.signalType);
- break;
- case "else":
- addSignal(void 0, void 0, param.altText, param.signalType);
- break;
- case "altEnd":
- addSignal(void 0, void 0, void 0, param.signalType);
- break;
- case "setAccTitle":
- setAccTitle(param.text);
- break;
- case "parStart":
- addSignal(void 0, void 0, param.parText, param.signalType);
- break;
- case "and":
- addSignal(void 0, void 0, param.parText, param.signalType);
- break;
- case "parEnd":
- addSignal(void 0, void 0, void 0, param.signalType);
- break;
- case "criticalStart":
- addSignal(void 0, void 0, param.criticalText, param.signalType);
- break;
- case "option":
- addSignal(void 0, void 0, param.optionText, param.signalType);
- break;
- case "criticalEnd":
- addSignal(void 0, void 0, void 0, param.signalType);
- break;
- case "breakStart":
- addSignal(void 0, void 0, param.breakText, param.signalType);
- break;
- case "breakEnd":
- addSignal(void 0, void 0, void 0, param.signalType);
- break;
+ this.addSignal(param.from, param.to, param.msg, param.signalType, param.activate);
+ break;
+ case "boxStart":
+ this.addBox(param.boxData);
+ break;
+ case "boxEnd":
+ this.boxEnd();
+ break;
+ case "loopStart":
+ this.addSignal(void 0, void 0, param.loopText, param.signalType);
+ break;
+ case "loopEnd":
+ this.addSignal(void 0, void 0, void 0, param.signalType);
+ break;
+ case "rectStart":
+ this.addSignal(void 0, void 0, param.color, param.signalType);
+ break;
+ case "rectEnd":
+ this.addSignal(void 0, void 0, void 0, param.signalType);
+ break;
+ case "optStart":
+ this.addSignal(void 0, void 0, param.optText, param.signalType);
+ break;
+ case "optEnd":
+ this.addSignal(void 0, void 0, void 0, param.signalType);
+ break;
+ case "altStart":
+ this.addSignal(void 0, void 0, param.altText, param.signalType);
+ break;
+ case "else":
+ this.addSignal(void 0, void 0, param.altText, param.signalType);
+ break;
+ case "altEnd":
+ this.addSignal(void 0, void 0, void 0, param.signalType);
+ break;
+ case "setAccTitle":
+ setAccTitle(param.text);
+ break;
+ case "parStart":
+ this.addSignal(void 0, void 0, param.parText, param.signalType);
+ break;
+ case "and":
+ this.addSignal(void 0, void 0, param.parText, param.signalType);
+ break;
+ case "parEnd":
+ this.addSignal(void 0, void 0, void 0, param.signalType);
+ break;
+ case "criticalStart":
+ this.addSignal(void 0, void 0, param.criticalText, param.signalType);
+ break;
+ case "option":
+ this.addSignal(void 0, void 0, param.optionText, param.signalType);
+ break;
+ case "criticalEnd":
+ this.addSignal(void 0, void 0, void 0, param.signalType);
+ break;
+ case "breakStart":
+ this.addSignal(void 0, void 0, param.breakText, param.signalType);
+ break;
+ case "breakEnd":
+ this.addSignal(void 0, void 0, void 0, param.signalType);
+ break;
+ }
}
}
- }, "apply");
- sequenceDb_default = {
- addActor,
- addMessage,
- addSignal,
- addLinks,
- addDetails,
- addProperties,
- autoWrap: autoWrap2,
- setWrap: setWrap2,
- enableSequenceNumbers,
- disableSequenceNumbers,
- showSequenceNumbers,
- getMessages,
- getActors,
- getCreatedActors,
- getDestroyedActors,
- getActor,
- getActorKeys,
- getActorProperty,
- getAccTitle,
- getBoxes,
- getDiagramTitle,
- setDiagramTitle,
- getConfig: /* @__PURE__ */ __name(() => getConfig2().sequence, "getConfig"),
- clear: clear17,
- parseMessage,
- parseBoxData,
- LINETYPE: LINETYPE2,
- ARROWTYPE: ARROWTYPE2,
- PLACEMENT: PLACEMENT2,
- addNote,
- setAccTitle,
- apply: apply2,
- setAccDescription,
- getAccDescription,
- hasAtLeastOneBox,
- hasAtLeastOneBoxWithTitle
+ getConfig() {
+ return getConfig2().sequence;
+ }
};
}
});
@@ -83526,16 +89925,16 @@ ${content}`;
} else if (dy !== 0) {
textElem.attr("dy", dy);
}
- const text2 = line2 || ZERO_WIDTH_SPACE;
+ const text4 = line2 || ZERO_WIDTH_SPACE;
if (textData.tspan) {
const span = textElem.append("tspan");
span.attr("x", textData.x);
if (textData.fill !== void 0) {
span.attr("fill", textData.fill);
}
- span.text(text2);
+ span.text(text4);
} else {
- textElem.text(text2);
+ textElem.text(text4);
}
if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) {
textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
@@ -83558,29 +89957,29 @@ ${content}`;
return polygon2;
}, "drawLabel");
actorCnt = -1;
- fixLifeLineHeights = /* @__PURE__ */ __name((diagram24, actors2, actorKeys, conf8) => {
- if (!diagram24.select) {
+ fixLifeLineHeights = /* @__PURE__ */ __name((diagram26, actors2, actorKeys, conf5) => {
+ if (!diagram26.select) {
return;
}
actorKeys.forEach((actorKey) => {
const actor = actors2.get(actorKey);
- const actorDOM = diagram24.select("#actor" + actor.actorCnt);
- if (!conf8.mirrorActors && actor.stopy) {
+ const actorDOM = diagram26.select("#actor" + actor.actorCnt);
+ if (!conf5.mirrorActors && actor.stopy) {
actorDOM.attr("y2", actor.stopy + actor.height / 2);
- } else if (conf8.mirrorActors) {
+ } else if (conf5.mirrorActors) {
actorDOM.attr("y2", actor.stopy);
}
});
}, "fixLifeLineHeights");
- drawActorTypeParticipant = /* @__PURE__ */ __name(function(elem, actor, conf8, isFooter) {
+ drawActorTypeParticipant = /* @__PURE__ */ __name(function(elem, actor, conf5, isFooter) {
const actorY = isFooter ? actor.stopy : actor.starty;
const center4 = actor.x + actor.width / 2;
- const centerY = actorY + 5;
+ const centerY = actorY + actor.height;
const boxplusLineGroup = elem.append("g").lower();
var g2 = boxplusLineGroup;
if (!isFooter) {
actorCnt++;
- if (Object.keys(actor.links || {}).length && !conf8.forceMenus) {
+ if (Object.keys(actor.links || {}).length && !conf5.forceMenus) {
g2.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer");
}
g2.append("line").attr("id", "actor" + actorCnt).attr("x1", center4).attr("y1", centerY).attr("x2", center4).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", actor.name);
@@ -83590,45 +89989,45 @@ ${content}`;
g2.attr("id", "root-" + actorCnt);
}
}
- const rect4 = getNoteRect();
+ const rect3 = getNoteRect();
var cssclass = "actor";
if (actor.properties?.class) {
cssclass = actor.properties.class;
} else {
- rect4.fill = "#eaeaea";
+ rect3.fill = "#eaeaea";
}
if (isFooter) {
cssclass += ` ${BOTTOM_ACTOR_CLASS}`;
} else {
cssclass += ` ${TOP_ACTOR_CLASS}`;
}
- rect4.x = actor.x;
- rect4.y = actorY;
- rect4.width = actor.width;
- rect4.height = actor.height;
- rect4.class = cssclass;
- rect4.rx = 3;
- rect4.ry = 3;
- rect4.name = actor.name;
- const rectElem = drawRect4(g2, rect4);
- actor.rectData = rect4;
+ rect3.x = actor.x;
+ rect3.y = actorY;
+ rect3.width = actor.width;
+ rect3.height = actor.height;
+ rect3.class = cssclass;
+ rect3.rx = 3;
+ rect3.ry = 3;
+ rect3.name = actor.name;
+ const rectElem = drawRect4(g2, rect3);
+ actor.rectData = rect3;
if (actor.properties?.icon) {
const iconSrc = actor.properties.icon.trim();
if (iconSrc.charAt(0) === "@") {
- drawEmbeddedImage(g2, rect4.x + rect4.width - 20, rect4.y + 10, iconSrc.substr(1));
+ drawEmbeddedImage(g2, rect3.x + rect3.width - 20, rect3.y + 10, iconSrc.substr(1));
} else {
- drawImage(g2, rect4.x + rect4.width - 20, rect4.y + 10, iconSrc);
+ drawImage(g2, rect3.x + rect3.width - 20, rect3.y + 10, iconSrc);
}
}
- _drawTextCandidateFunc2(conf8, hasKatex(actor.description))(
+ _drawTextCandidateFunc2(conf5, hasKatex(actor.description))(
actor.description,
g2,
- rect4.x,
- rect4.y,
- rect4.width,
- rect4.height,
+ rect3.x,
+ rect3.y,
+ rect3.width,
+ rect3.height,
{ class: `actor ${ACTOR_BOX_CLASS}` },
- conf8
+ conf5
);
let height2 = actor.height;
if (rectElem.node) {
@@ -83638,7 +90037,7 @@ ${content}`;
}
return height2;
}, "drawActorTypeParticipant");
- drawActorTypeActor = /* @__PURE__ */ __name(function(elem, actor, conf8, isFooter) {
+ drawActorTypeActor = /* @__PURE__ */ __name(function(elem, actor, conf5, isFooter) {
const actorY = isFooter ? actor.stopy : actor.starty;
const center4 = actor.x + actor.width / 2;
const centerY = actorY + 80;
@@ -83657,15 +90056,15 @@ ${content}`;
}
actElem.attr("class", cssClass);
actElem.attr("name", actor.name);
- const rect4 = getNoteRect();
- rect4.x = actor.x;
- rect4.y = actorY;
- rect4.fill = "#eaeaea";
- rect4.width = actor.width;
- rect4.height = actor.height;
- rect4.class = "actor";
- rect4.rx = 3;
- rect4.ry = 3;
+ const rect3 = getNoteRect();
+ rect3.x = actor.x;
+ rect3.y = actorY;
+ rect3.fill = "#eaeaea";
+ rect3.width = actor.width;
+ rect3.height = actor.height;
+ rect3.class = "actor";
+ rect3.rx = 3;
+ rect3.ry = 3;
actElem.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", center4).attr("y1", actorY + 25).attr("x2", center4).attr("y2", actorY + 45);
actElem.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", center4 - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 33).attr("x2", center4 + ACTOR_TYPE_WIDTH / 2).attr("y2", actorY + 33);
actElem.append("line").attr("x1", center4 - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 60).attr("x2", center4).attr("y2", actorY + 45);
@@ -83678,32 +90077,32 @@ ${content}`;
circle6.attr("height", actor.height);
const bounds4 = actElem.node().getBBox();
actor.height = bounds4.height;
- _drawTextCandidateFunc2(conf8, hasKatex(actor.description))(
+ _drawTextCandidateFunc2(conf5, hasKatex(actor.description))(
actor.description,
actElem,
- rect4.x,
- rect4.y + 35,
- rect4.width,
- rect4.height,
+ rect3.x,
+ rect3.y + 35,
+ rect3.width,
+ rect3.height,
{ class: `actor ${ACTOR_MAN_FIGURE_CLASS}` },
- conf8
+ conf5
);
return actor.height;
}, "drawActorTypeActor");
- drawActor = /* @__PURE__ */ __name(async function(elem, actor, conf8, isFooter) {
+ drawActor = /* @__PURE__ */ __name(async function(elem, actor, conf5, isFooter) {
switch (actor.type) {
case "actor":
- return await drawActorTypeActor(elem, actor, conf8, isFooter);
+ return await drawActorTypeActor(elem, actor, conf5, isFooter);
case "participant":
- return await drawActorTypeParticipant(elem, actor, conf8, isFooter);
+ return await drawActorTypeParticipant(elem, actor, conf5, isFooter);
}
}, "drawActor");
- drawBox = /* @__PURE__ */ __name(function(elem, box, conf8) {
+ drawBox = /* @__PURE__ */ __name(function(elem, box, conf5) {
const boxplusTextGroup = elem.append("g");
const g2 = boxplusTextGroup;
drawBackgroundRect2(g2, box);
if (box.name) {
- _drawTextCandidateFunc2(conf8)(
+ _drawTextCandidateFunc2(conf5)(
box.name,
g2,
box.x,
@@ -83711,7 +90110,7 @@ ${content}`;
box.width,
0,
{ class: "text" },
- conf8
+ conf5
);
}
g2.lower();
@@ -83719,17 +90118,17 @@ ${content}`;
anchorElement = /* @__PURE__ */ __name(function(elem) {
return elem.append("g");
}, "anchorElement");
- drawActivation = /* @__PURE__ */ __name(function(elem, bounds4, verticalPos, conf8, actorActivations2) {
- const rect4 = getNoteRect();
+ drawActivation = /* @__PURE__ */ __name(function(elem, bounds4, verticalPos, conf5, actorActivations2) {
+ const rect3 = getNoteRect();
const g2 = bounds4.anchored;
- rect4.x = bounds4.startx;
- rect4.y = bounds4.starty;
- rect4.class = "activation" + actorActivations2 % 3;
- rect4.width = bounds4.stopx - bounds4.startx;
- rect4.height = verticalPos - bounds4.starty;
- drawRect4(g2, rect4);
+ rect3.x = bounds4.startx;
+ rect3.y = bounds4.starty;
+ rect3.class = "activation" + actorActivations2 % 3;
+ rect3.width = bounds4.stopx - bounds4.startx;
+ rect3.height = verticalPos - bounds4.starty;
+ drawRect4(g2, rect3);
}, "drawActivation");
- drawLoop = /* @__PURE__ */ __name(async function(elem, loopModel, labelText, conf8) {
+ drawLoop = /* @__PURE__ */ __name(async function(elem, loopModel, labelText, conf5) {
const {
boxMargin,
boxTextMargin,
@@ -83738,7 +90137,7 @@ ${content}`;
messageFontFamily: fontFamily,
messageFontSize: fontSize,
messageFontWeight: fontWeight
- } = conf8;
+ } = conf5;
const g2 = elem.append("g");
const drawLoopLine = /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
return g2.append("line").attr("x1", startx).attr("y1", starty).attr("x2", stopx).attr("y2", stopy).attr("class", "loopLine");
@@ -83879,40 +90278,40 @@ ${content}`;
}, "getNoteRect");
_drawTextCandidateFunc2 = /* @__PURE__ */ function() {
function byText(content, g2, x5, y5, width3, height2, textAttrs) {
- const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("text-anchor", "middle").text(content);
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("text-anchor", "middle").text(content);
+ _setTextAttrs(text4, textAttrs);
}
__name(byText, "byText");
- function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
- const { actorFontSize, actorFontFamily, actorFontWeight } = conf8;
+ function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
+ const { actorFontSize, actorFontFamily, actorFontWeight } = conf5;
const [_actorFontSize, _actorFontSizePx] = parseFontSize(actorFontSize);
const lines = content.split(common_default.lineBreakRegex);
for (let i2 = 0; i2 < lines.length; i2++) {
const dy = i2 * _actorFontSize - _actorFontSize * (lines.length - 1) / 2;
- const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).style("text-anchor", "middle").style("font-size", _actorFontSizePx).style("font-weight", actorFontWeight).style("font-family", actorFontFamily);
- text2.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]);
- text2.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).style("text-anchor", "middle").style("font-size", _actorFontSizePx).style("font-weight", actorFontWeight).style("font-family", actorFontFamily);
+ text4.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]);
+ text4.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
+ _setTextAttrs(text4, textAttrs);
}
}
__name(byTspan, "byTspan");
- function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
+ function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
const s2 = g2.append("switch");
- const f3 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
- const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
- text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
- byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf8);
- _setTextAttrs(text2, textAttrs);
+ const f2 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
+ const text4 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
+ text4.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
+ byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf5);
+ _setTextAttrs(text4, textAttrs);
}
__name(byFo, "byFo");
- async function byKatex(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
+ async function byKatex(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
const dim = await calculateMathMLDimensions(content, getConfig());
const s2 = g2.append("switch");
- const f3 = s2.append("foreignObject").attr("x", x5 + width3 / 2 - dim.width / 2).attr("y", y5 + height2 / 2 - dim.height / 2).attr("width", dim.width).attr("height", dim.height);
- const text2 = f3.append("xhtml:div").style("height", "100%").style("width", "100%");
- text2.append("div").style("text-align", "center").style("vertical-align", "middle").html(await renderKatex(content, getConfig()));
- byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf8);
- _setTextAttrs(text2, textAttrs);
+ const f2 = s2.append("foreignObject").attr("x", x5 + width3 / 2 - dim.width / 2).attr("y", y5 + height2 / 2 - dim.height / 2).attr("width", dim.width).attr("height", dim.height);
+ const text4 = f2.append("xhtml:div").style("height", "100%").style("width", "100%");
+ text4.append("div").style("text-align", "center").style("vertical-align", "middle").html(await renderKatex(content, getConfig()));
+ byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf5);
+ _setTextAttrs(text4, textAttrs);
}
__name(byKatex, "byKatex");
function _setTextAttrs(toText, fromTextAttrsDict) {
@@ -83923,38 +90322,38 @@ ${content}`;
}
}
__name(_setTextAttrs, "_setTextAttrs");
- return function(conf8, hasKatex2 = false) {
+ return function(conf5, hasKatex2 = false) {
if (hasKatex2) {
return byKatex;
}
- return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan;
+ return conf5.textPlacement === "fo" ? byFo : conf5.textPlacement === "old" ? byText : byTspan;
};
}();
_drawMenuItemTextCandidateFunc = /* @__PURE__ */ function() {
function byText(content, g2, x5, y5, width3, height2, textAttrs) {
- const text2 = g2.append("text").attr("x", x5).attr("y", y5).style("text-anchor", "start").text(content);
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5).attr("y", y5).style("text-anchor", "start").text(content);
+ _setTextAttrs(text4, textAttrs);
}
__name(byText, "byText");
- function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
- const { actorFontSize, actorFontFamily, actorFontWeight } = conf8;
+ function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
+ const { actorFontSize, actorFontFamily, actorFontWeight } = conf5;
const lines = content.split(common_default.lineBreakRegex);
for (let i2 = 0; i2 < lines.length; i2++) {
const dy = i2 * actorFontSize - actorFontSize * (lines.length - 1) / 2;
- const text2 = g2.append("text").attr("x", x5).attr("y", y5).style("text-anchor", "start").style("font-size", actorFontSize).style("font-weight", actorFontWeight).style("font-family", actorFontFamily);
- text2.append("tspan").attr("x", x5).attr("dy", dy).text(lines[i2]);
- text2.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5).attr("y", y5).style("text-anchor", "start").style("font-size", actorFontSize).style("font-weight", actorFontWeight).style("font-family", actorFontFamily);
+ text4.append("tspan").attr("x", x5).attr("dy", dy).text(lines[i2]);
+ text4.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
+ _setTextAttrs(text4, textAttrs);
}
}
__name(byTspan, "byTspan");
- function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
+ function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
const s2 = g2.append("switch");
- const f3 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
- const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
- text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
- byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf8);
- _setTextAttrs(text2, textAttrs);
+ const f2 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2);
+ const text4 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
+ text4.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
+ byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf5);
+ _setTextAttrs(text4, textAttrs);
}
__name(byFo, "byFo");
function _setTextAttrs(toText, fromTextAttrsDict) {
@@ -83965,8 +90364,8 @@ ${content}`;
}
}
__name(_setTextAttrs, "_setTextAttrs");
- return function(conf8) {
- return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan;
+ return function(conf5) {
+ return conf5.textPlacement === "fo" ? byFo : conf5.textPlacement === "old" ? byText : byTspan;
};
}();
svgDraw_default2 = {
@@ -84001,7 +90400,7 @@ ${content}`;
const { startx, stopx, message } = msgModel;
const lines = common_default.splitBreaks(message).length;
const isKatexMsg = hasKatex(message);
- const textDims = isKatexMsg ? await calculateMathMLDimensions(message, getConfig2()) : utils_default2.calculateTextDimensions(message, messageFont2(conf4));
+ const textDims = isKatexMsg ? await calculateMathMLDimensions(message, getConfig2()) : utils_default2.calculateTextDimensions(message, messageFont2(conf2));
if (!isKatexMsg) {
const lineHeight = textDims.height / lines;
msgModel.height += lineHeight;
@@ -84012,12 +90411,12 @@ ${content}`;
const textWidth = textDims.width;
if (startx === stopx) {
lineStartY = bounds.getVerticalPos() + totalOffset;
- if (!conf4.rightAngles) {
- totalOffset += conf4.boxMargin;
+ if (!conf2.rightAngles) {
+ totalOffset += conf2.boxMargin;
lineStartY = bounds.getVerticalPos() + totalOffset;
}
totalOffset += 30;
- const dx = common_default.getMax(textWidth / 2, conf4.width / 2);
+ const dx = common_default.getMax(textWidth / 2, conf2.width / 2);
bounds.insert(
startx - dx,
bounds.getVerticalPos() - 10 + totalOffset,
@@ -84025,7 +90424,7 @@ ${content}`;
bounds.getVerticalPos() + 30 + totalOffset
);
} else {
- totalOffset += conf4.boxMargin;
+ totalOffset += conf2.boxMargin;
lineStartY = bounds.getVerticalPos() + totalOffset;
bounds.insert(startx, lineStartY - 10, stopx, lineStartY);
}
@@ -84040,12 +90439,12 @@ ${content}`;
let heightAdjust = postMargin;
if (msg.id && msg.message && loopWidths[msg.id]) {
const loopWidth = loopWidths[msg.id].width;
- const textConf = messageFont2(conf4);
- msg.message = utils_default2.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf4.wrapPadding, textConf);
+ const textConf = messageFont2(conf2);
+ msg.message = utils_default2.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf2.wrapPadding, textConf);
msg.width = loopWidth;
msg.wrap = true;
const textDims = utils_default2.calculateTextDimensions(msg.message, textConf);
- const totalOffset = common_default.getMax(textDims.height, conf4.labelBoxHeight);
+ const totalOffset = common_default.getMax(textDims.height, conf2.labelBoxHeight);
heightAdjust = postMargin + totalOffset;
log.debug(`${totalOffset} - ${msg.message}`);
}
@@ -84059,7 +90458,7 @@ ${content}`;
msgModel.stopx - adjustment,
msgModel.starty,
msgModel.startx,
- msgModel.stopy + actor.height / 2 + conf4.noteMargin
+ msgModel.stopy + actor.height / 2 + conf2.noteMargin
);
msgModel.stopx = msgModel.stopx + adjustment;
} else {
@@ -84067,7 +90466,7 @@ ${content}`;
msgModel.startx,
msgModel.starty,
msgModel.stopx + adjustment,
- msgModel.stopy + actor.height / 2 + conf4.noteMargin
+ msgModel.stopy + actor.height / 2 + conf2.noteMargin
);
msgModel.stopx = msgModel.stopx - adjustment;
}
@@ -84079,7 +90478,7 @@ ${content}`;
msgModel.startx - adjustment,
msgModel.starty,
msgModel.stopx,
- msgModel.stopy + actor.height / 2 + conf4.noteMargin
+ msgModel.stopy + actor.height / 2 + conf2.noteMargin
);
msgModel.startx = msgModel.startx + adjustment;
} else {
@@ -84087,7 +90486,7 @@ ${content}`;
msgModel.stopx,
msgModel.starty,
msgModel.startx + adjustment,
- msgModel.stopy + actor.height / 2 + conf4.noteMargin
+ msgModel.stopy + actor.height / 2 + conf2.noteMargin
);
msgModel.startx = msgModel.startx - adjustment;
}
@@ -84101,7 +90500,7 @@ ${content}`;
bounds.bumpVerticalPos(actor.height / 2);
} else if (destroyedActors.get(msg.from) == index) {
const actor = actors2.get(msg.from);
- if (conf4.mirrorActors) {
+ if (conf2.mirrorActors) {
const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 : actor.width / 2;
senderAdjustment(actor, adjustment);
}
@@ -84109,7 +90508,7 @@ ${content}`;
bounds.bumpVerticalPos(actor.height / 2);
} else if (destroyedActors.get(msg.to) == index) {
const actor = actors2.get(msg.to);
- if (conf4.mirrorActors) {
+ if (conf2.mirrorActors) {
const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3;
receiverAdjustment(actor, adjustment);
}
@@ -84130,10 +90529,10 @@ ${content}`;
}
const isNote = msg.placement !== void 0;
const isMessage = !isNote;
- const textFont = isNote ? noteFont(conf4) : messageFont2(conf4);
- const wrappedMessage = msg.wrap ? utils_default2.wrapLabel(msg.message, conf4.width - 2 * conf4.wrapPadding, textFont) : msg.message;
+ const textFont = isNote ? noteFont(conf2) : messageFont2(conf2);
+ const wrappedMessage = msg.wrap ? utils_default2.wrapLabel(msg.message, conf2.width - 2 * conf2.wrapPadding, textFont) : msg.message;
const messageDimensions = hasKatex(wrappedMessage) ? await calculateMathMLDimensions(msg.message, getConfig2()) : utils_default2.calculateTextDimensions(wrappedMessage, textFont);
- const messageWidth = messageDimensions.width + 2 * conf4.wrapPadding;
+ const messageWidth = messageDimensions.width + 2 * conf2.wrapPadding;
if (isMessage && msg.from === actor.nextActor) {
maxMessageWidthPerActor[msg.to] = common_default.getMax(
maxMessageWidthPerActor[msg.to] || 0,
@@ -84189,13 +90588,13 @@ ${content}`;
if (actor.wrap) {
actor.description = utils_default2.wrapLabel(
actor.description,
- conf4.width - 2 * conf4.wrapPadding,
- actorFont(conf4)
+ conf2.width - 2 * conf2.wrapPadding,
+ actorFont(conf2)
);
}
- const actDims = hasKatex(actor.description) ? await calculateMathMLDimensions(actor.description, getConfig2()) : utils_default2.calculateTextDimensions(actor.description, actorFont(conf4));
- actor.width = actor.wrap ? conf4.width : common_default.getMax(conf4.width, actDims.width + 2 * conf4.wrapPadding);
- actor.height = actor.wrap ? common_default.getMax(actDims.height, conf4.height) : conf4.height;
+ const actDims = hasKatex(actor.description) ? await calculateMathMLDimensions(actor.description, getConfig2()) : utils_default2.calculateTextDimensions(actor.description, actorFont(conf2));
+ actor.width = actor.wrap ? conf2.width : common_default.getMax(conf2.width, actDims.width + 2 * conf2.wrapPadding);
+ actor.height = actor.wrap ? common_default.getMax(actDims.height, conf2.height) : conf2.height;
maxHeight = common_default.getMax(maxHeight, actor.height);
}
for (const actorKey in actorToMessageWidth) {
@@ -84206,37 +90605,37 @@ ${content}`;
const nextActor = actors2.get(actor.nextActor);
if (!nextActor) {
const messageWidth2 = actorToMessageWidth[actorKey];
- const actorWidth2 = messageWidth2 + conf4.actorMargin - actor.width / 2;
- actor.margin = common_default.getMax(actorWidth2, conf4.actorMargin);
+ const actorWidth2 = messageWidth2 + conf2.actorMargin - actor.width / 2;
+ actor.margin = common_default.getMax(actorWidth2, conf2.actorMargin);
continue;
}
const messageWidth = actorToMessageWidth[actorKey];
- const actorWidth = messageWidth + conf4.actorMargin - actor.width / 2 - nextActor.width / 2;
- actor.margin = common_default.getMax(actorWidth, conf4.actorMargin);
+ const actorWidth = messageWidth + conf2.actorMargin - actor.width / 2 - nextActor.width / 2;
+ actor.margin = common_default.getMax(actorWidth, conf2.actorMargin);
}
let maxBoxHeight = 0;
boxes.forEach((box) => {
- const textFont = messageFont2(conf4);
+ const textFont = messageFont2(conf2);
let totalWidth = box.actorKeys.reduce((total, aKey) => {
return total += actors2.get(aKey).width + (actors2.get(aKey).margin || 0);
}, 0);
- totalWidth -= 2 * conf4.boxTextMargin;
+ totalWidth -= 2 * conf2.boxTextMargin;
if (box.wrap) {
- box.name = utils_default2.wrapLabel(box.name, totalWidth - 2 * conf4.wrapPadding, textFont);
+ box.name = utils_default2.wrapLabel(box.name, totalWidth - 2 * conf2.wrapPadding, textFont);
}
const boxMsgDimensions = utils_default2.calculateTextDimensions(box.name, textFont);
maxBoxHeight = common_default.getMax(boxMsgDimensions.height, maxBoxHeight);
- const minWidth = common_default.getMax(totalWidth, boxMsgDimensions.width + 2 * conf4.wrapPadding);
- box.margin = conf4.boxTextMargin;
+ const minWidth = common_default.getMax(totalWidth, boxMsgDimensions.width + 2 * conf2.wrapPadding);
+ box.margin = conf2.boxTextMargin;
if (totalWidth < minWidth) {
const missing = (minWidth - totalWidth) / 2;
box.margin += missing;
}
});
boxes.forEach((box) => box.textMaxHeight = maxBoxHeight);
- return common_default.getMax(maxHeight, conf4.height);
+ return common_default.getMax(maxHeight, conf2.height);
}
- var conf4, bounds, drawNote, messageFont2, noteFont, actorFont, drawMessage, addActorRenderingData, drawActors, drawActorsPopup, setConf4, actorActivations, activationBounds, draw11, getRequiredPopupWidth, buildNoteModel, buildMessageModel, calculateLoopBounds, sequenceRenderer_default;
+ var conf2, bounds, drawNote, messageFont2, noteFont, actorFont, drawMessage, addActorRenderingData, drawActors, drawActorsPopup, setConf3, actorActivations, activationBounds, draw11, getRequiredPopupWidth, buildNoteModel, buildMessageModel, calculateLoopBounds, sequenceRenderer_default;
var init_sequenceRenderer = __esm({
"src/diagrams/sequence/sequenceRenderer.ts"() {
"use strict";
@@ -84249,7 +90648,7 @@ ${content}`;
init_assignWithDepth();
init_utils2();
init_setupGraphViewbox();
- conf4 = {};
+ conf2 = {};
bounds = {
data: {
startx: void 0,
@@ -84318,7 +90717,7 @@ ${content}`;
stopy: void 0
};
this.verticalPos = 0;
- setConf4(getConfig2());
+ setConf3(getConfig2());
}, "init"),
updateVal: /* @__PURE__ */ __name(function(obj, key, val, fun) {
if (obj[key] === void 0) {
@@ -84329,20 +90728,20 @@ ${content}`;
}, "updateVal"),
updateBounds: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
const _self = this;
- let cnt4 = 0;
+ let cnt5 = 0;
function updateFn(type3) {
return /* @__PURE__ */ __name(function updateItemBounds(item) {
- cnt4++;
- const n2 = _self.sequenceItems.length - cnt4 + 1;
- _self.updateVal(item, "starty", starty - n2 * conf4.boxMargin, Math.min);
- _self.updateVal(item, "stopy", stopy + n2 * conf4.boxMargin, Math.max);
- _self.updateVal(bounds.data, "startx", startx - n2 * conf4.boxMargin, Math.min);
- _self.updateVal(bounds.data, "stopx", stopx + n2 * conf4.boxMargin, Math.max);
+ cnt5++;
+ const n2 = _self.sequenceItems.length - cnt5 + 1;
+ _self.updateVal(item, "starty", starty - n2 * conf2.boxMargin, Math.min);
+ _self.updateVal(item, "stopy", stopy + n2 * conf2.boxMargin, Math.max);
+ _self.updateVal(bounds.data, "startx", startx - n2 * conf2.boxMargin, Math.min);
+ _self.updateVal(bounds.data, "stopx", stopx + n2 * conf2.boxMargin, Math.max);
if (!(type3 === "activation")) {
- _self.updateVal(item, "startx", startx - n2 * conf4.boxMargin, Math.min);
- _self.updateVal(item, "stopx", stopx + n2 * conf4.boxMargin, Math.max);
- _self.updateVal(bounds.data, "starty", starty - n2 * conf4.boxMargin, Math.min);
- _self.updateVal(bounds.data, "stopy", stopy + n2 * conf4.boxMargin, Math.max);
+ _self.updateVal(item, "startx", startx - n2 * conf2.boxMargin, Math.min);
+ _self.updateVal(item, "stopx", stopx + n2 * conf2.boxMargin, Math.max);
+ _self.updateVal(bounds.data, "starty", starty - n2 * conf2.boxMargin, Math.min);
+ _self.updateVal(bounds.data, "stopy", stopy + n2 * conf2.boxMargin, Math.max);
}
}, "updateItemBounds");
}
@@ -84361,17 +90760,17 @@ ${content}`;
this.updateVal(bounds.data, "stopy", _stopy, Math.max);
this.updateBounds(_startx, _starty, _stopx, _stopy);
}, "insert"),
- newActivation: /* @__PURE__ */ __name(function(message, diagram24, actors2) {
+ newActivation: /* @__PURE__ */ __name(function(message, diagram26, actors2) {
const actorRect = actors2.get(message.from);
const stackedSize = actorActivations(message.from).length || 0;
- const x5 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf4.activationWidth / 2;
+ const x5 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf2.activationWidth / 2;
this.activations.push({
startx: x5,
starty: this.verticalPos + 2,
- stopx: x5 + conf4.activationWidth,
+ stopx: x5 + conf2.activationWidth,
stopy: void 0,
actor: message.from,
- anchored: svgDraw_default2.anchorElement(diagram24)
+ anchored: svgDraw_default2.anchorElement(diagram26)
});
}, "newActivation"),
endActivation: /* @__PURE__ */ __name(function(message) {
@@ -84432,38 +90831,38 @@ ${content}`;
}, "getBounds")
};
drawNote = /* @__PURE__ */ __name(async function(elem, noteModel) {
- bounds.bumpVerticalPos(conf4.boxMargin);
- noteModel.height = conf4.boxMargin;
+ bounds.bumpVerticalPos(conf2.boxMargin);
+ noteModel.height = conf2.boxMargin;
noteModel.starty = bounds.getVerticalPos();
- const rect4 = getNoteRect();
- rect4.x = noteModel.startx;
- rect4.y = noteModel.starty;
- rect4.width = noteModel.width || conf4.width;
- rect4.class = "note";
+ const rect3 = getNoteRect();
+ rect3.x = noteModel.startx;
+ rect3.y = noteModel.starty;
+ rect3.width = noteModel.width || conf2.width;
+ rect3.class = "note";
const g2 = elem.append("g");
- const rectElem = svgDraw_default2.drawRect(g2, rect4);
+ const rectElem = svgDraw_default2.drawRect(g2, rect3);
const textObj = getTextObj();
textObj.x = noteModel.startx;
textObj.y = noteModel.starty;
- textObj.width = rect4.width;
+ textObj.width = rect3.width;
textObj.dy = "1em";
textObj.text = noteModel.message;
textObj.class = "noteText";
- textObj.fontFamily = conf4.noteFontFamily;
- textObj.fontSize = conf4.noteFontSize;
- textObj.fontWeight = conf4.noteFontWeight;
- textObj.anchor = conf4.noteAlign;
- textObj.textMargin = conf4.noteMargin;
+ textObj.fontFamily = conf2.noteFontFamily;
+ textObj.fontSize = conf2.noteFontSize;
+ textObj.fontWeight = conf2.noteFontWeight;
+ textObj.anchor = conf2.noteAlign;
+ textObj.textMargin = conf2.noteMargin;
textObj.valign = "center";
const textElem = hasKatex(textObj.text) ? await drawKatex(g2, textObj) : drawText3(g2, textObj);
const textHeight = Math.round(
textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr)
);
- rectElem.attr("height", textHeight + 2 * conf4.noteMargin);
- noteModel.height += textHeight + 2 * conf4.noteMargin;
- bounds.bumpVerticalPos(textHeight + 2 * conf4.noteMargin);
- noteModel.stopy = noteModel.starty + textHeight + 2 * conf4.noteMargin;
- noteModel.stopx = noteModel.startx + rect4.width;
+ rectElem.attr("height", textHeight + 2 * conf2.noteMargin);
+ noteModel.height += textHeight + 2 * conf2.noteMargin;
+ bounds.bumpVerticalPos(textHeight + 2 * conf2.noteMargin);
+ noteModel.stopy = noteModel.starty + textHeight + 2 * conf2.noteMargin;
+ noteModel.stopx = noteModel.startx + rect3.width;
bounds.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy);
bounds.models.addNote(noteModel);
}, "drawNote");
@@ -84489,9 +90888,9 @@ ${content}`;
};
}, "actorFont");
__name(boundMessage, "boundMessage");
- drawMessage = /* @__PURE__ */ __name(async function(diagram24, msgModel, lineStartY, diagObj) {
+ drawMessage = /* @__PURE__ */ __name(async function(diagram26, msgModel, lineStartY, diagObj) {
const { startx, stopx, starty, message, type: type3, sequenceIndex, sequenceVisible } = msgModel;
- const textDims = utils_default2.calculateTextDimensions(message, messageFont2(conf4));
+ const textDims = utils_default2.calculateTextDimensions(message, messageFont2(conf2));
const textObj = getTextObj();
textObj.x = startx;
textObj.y = starty + 10;
@@ -84499,34 +90898,34 @@ ${content}`;
textObj.class = "messageText";
textObj.dy = "1em";
textObj.text = message;
- textObj.fontFamily = conf4.messageFontFamily;
- textObj.fontSize = conf4.messageFontSize;
- textObj.fontWeight = conf4.messageFontWeight;
- textObj.anchor = conf4.messageAlign;
+ textObj.fontFamily = conf2.messageFontFamily;
+ textObj.fontSize = conf2.messageFontSize;
+ textObj.fontWeight = conf2.messageFontWeight;
+ textObj.anchor = conf2.messageAlign;
textObj.valign = "center";
- textObj.textMargin = conf4.wrapPadding;
+ textObj.textMargin = conf2.wrapPadding;
textObj.tspan = false;
if (hasKatex(textObj.text)) {
- await drawKatex(diagram24, textObj, { startx, stopx, starty: lineStartY });
+ await drawKatex(diagram26, textObj, { startx, stopx, starty: lineStartY });
} else {
- drawText3(diagram24, textObj);
+ drawText3(diagram26, textObj);
}
const textWidth = textDims.width;
let line2;
if (startx === stopx) {
- if (conf4.rightAngles) {
- line2 = diagram24.append("path").attr(
+ if (conf2.rightAngles) {
+ line2 = diagram26.append("path").attr(
"d",
- `M ${startx},${lineStartY} H ${startx + common_default.getMax(conf4.width / 2, textWidth / 2)} V ${lineStartY + 25} H ${startx}`
+ `M ${startx},${lineStartY} H ${startx + common_default.getMax(conf2.width / 2, textWidth / 2)} V ${lineStartY + 25} H ${startx}`
);
} else {
- line2 = diagram24.append("path").attr(
+ line2 = diagram26.append("path").attr(
"d",
"M " + startx + "," + lineStartY + " C " + (startx + 60) + "," + (lineStartY - 10) + " " + (startx + 60) + "," + (lineStartY + 30) + " " + startx + "," + (lineStartY + 20)
);
}
} else {
- line2 = diagram24.append("line");
+ line2 = diagram26.append("line");
line2.attr("x1", startx);
line2.attr("y1", lineStartY);
line2.attr("x2", stopx);
@@ -84539,7 +90938,7 @@ ${content}`;
line2.attr("class", "messageLine0");
}
let url = "";
- if (conf4.arrowMarkerAbsolute) {
+ if (conf2.arrowMarkerAbsolute) {
url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
url = url.replace(/\(/g, "\\(");
url = url.replace(/\)/g, "\\)");
@@ -84560,12 +90959,12 @@ ${content}`;
if (type3 === diagObj.db.LINETYPE.SOLID_CROSS || type3 === diagObj.db.LINETYPE.DOTTED_CROSS) {
line2.attr("marker-end", "url(" + url + "#crosshead)");
}
- if (sequenceVisible || conf4.showSequenceNumbers) {
+ if (sequenceVisible || conf2.showSequenceNumbers) {
line2.attr("marker-start", "url(" + url + "#sequencenumber)");
- diagram24.append("text").attr("x", startx).attr("y", lineStartY + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex);
+ diagram26.append("text").attr("x", startx).attr("y", lineStartY + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex);
}
}, "drawMessage");
- addActorRenderingData = /* @__PURE__ */ __name(function(diagram24, actors2, createdActors, actorKeys, verticalPos, messages, isFooter) {
+ addActorRenderingData = /* @__PURE__ */ __name(function(diagram26, actors2, createdActors, actorKeys, verticalPos, messages, isFooter) {
let prevWidth = 0;
let prevMargin = 0;
let prevBox = void 0;
@@ -84577,7 +90976,7 @@ ${content}`;
if (!isFooter) {
bounds.models.addBox(prevBox);
}
- prevMargin += conf4.boxMargin + prevBox.margin;
+ prevMargin += conf2.boxMargin + prevBox.margin;
}
if (box && box != prevBox) {
if (!isFooter) {
@@ -84586,9 +90985,9 @@ ${content}`;
}
prevMargin += box.margin;
}
- actor.width = actor.width || conf4.width;
- actor.height = common_default.getMax(actor.height || conf4.height, conf4.height);
- actor.margin = actor.margin || conf4.actorMargin;
+ actor.width = actor.width || conf2.width;
+ actor.height = common_default.getMax(actor.height || conf2.height, conf2.height);
+ actor.margin = actor.margin || conf2.actorMargin;
maxHeight = common_default.getMax(maxHeight, actor.height);
if (createdActors.get(actor.name)) {
prevMargin += actor.width / 2;
@@ -84609,38 +91008,38 @@ ${content}`;
}
bounds.bumpVerticalPos(maxHeight);
}, "addActorRenderingData");
- drawActors = /* @__PURE__ */ __name(async function(diagram24, actors2, actorKeys, isFooter) {
+ drawActors = /* @__PURE__ */ __name(async function(diagram26, actors2, actorKeys, isFooter) {
if (!isFooter) {
for (const actorKey of actorKeys) {
const actor = actors2.get(actorKey);
- await svgDraw_default2.drawActor(diagram24, actor, conf4, false);
+ await svgDraw_default2.drawActor(diagram26, actor, conf2, false);
}
} else {
let maxHeight = 0;
- bounds.bumpVerticalPos(conf4.boxMargin * 2);
+ bounds.bumpVerticalPos(conf2.boxMargin * 2);
for (const actorKey of actorKeys) {
const actor = actors2.get(actorKey);
if (!actor.stopy) {
actor.stopy = bounds.getVerticalPos();
}
- const height2 = await svgDraw_default2.drawActor(diagram24, actor, conf4, true);
+ const height2 = await svgDraw_default2.drawActor(diagram26, actor, conf2, true);
maxHeight = common_default.getMax(maxHeight, height2);
}
- bounds.bumpVerticalPos(maxHeight + conf4.boxMargin);
+ bounds.bumpVerticalPos(maxHeight + conf2.boxMargin);
}
}, "drawActors");
- drawActorsPopup = /* @__PURE__ */ __name(function(diagram24, actors2, actorKeys, doc) {
+ drawActorsPopup = /* @__PURE__ */ __name(function(diagram26, actors2, actorKeys, doc) {
let maxHeight = 0;
let maxWidth = 0;
for (const actorKey of actorKeys) {
const actor = actors2.get(actorKey);
const minMenuWidth = getRequiredPopupWidth(actor);
const menuDimensions = svgDraw_default2.drawPopup(
- diagram24,
+ diagram26,
actor,
minMenuWidth,
- conf4,
- conf4.forceMenus,
+ conf2,
+ conf2.forceMenus,
doc
);
if (menuDimensions.height > maxHeight) {
@@ -84652,16 +91051,16 @@ ${content}`;
}
return { maxHeight, maxWidth };
}, "drawActorsPopup");
- setConf4 = /* @__PURE__ */ __name(function(cnf) {
- assignWithDepth_default(conf4, cnf);
+ setConf3 = /* @__PURE__ */ __name(function(cnf) {
+ assignWithDepth_default(conf2, cnf);
if (cnf.fontFamily) {
- conf4.actorFontFamily = conf4.noteFontFamily = conf4.messageFontFamily = cnf.fontFamily;
+ conf2.actorFontFamily = conf2.noteFontFamily = conf2.messageFontFamily = cnf.fontFamily;
}
if (cnf.fontSize) {
- conf4.actorFontSize = conf4.noteFontSize = conf4.messageFontSize = cnf.fontSize;
+ conf2.actorFontSize = conf2.noteFontSize = conf2.messageFontSize = cnf.fontSize;
}
if (cnf.fontWeight) {
- conf4.actorFontWeight = conf4.noteFontWeight = conf4.messageFontWeight = cnf.fontWeight;
+ conf2.actorFontWeight = conf2.noteFontWeight = conf2.messageFontWeight = cnf.fontWeight;
}
}, "setConf");
actorActivations = /* @__PURE__ */ __name(function(actor) {
@@ -84688,18 +91087,18 @@ ${content}`;
}, "activationBounds");
__name(adjustLoopHeightForWrap, "adjustLoopHeightForWrap");
__name(adjustCreatedDestroyedData, "adjustCreatedDestroyedData");
- draw11 = /* @__PURE__ */ __name(async function(_text, id27, _version, diagObj) {
+ draw11 = /* @__PURE__ */ __name(async function(_text, id29, _version, diagObj) {
const { securityLevel, sequence } = getConfig2();
- conf4 = sequence;
+ conf2 = sequence;
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
bounds.init();
log.debug(diagObj.db);
- const diagram24 = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`);
+ const diagram26 = securityLevel === "sandbox" ? root4.select(`[id="${id29}"]`) : select_default2(`[id="${id29}"]`);
const actors2 = diagObj.db.getActors();
const createdActors = diagObj.db.getCreatedActors();
const destroyedActors = diagObj.db.getDestroyedActors();
@@ -84710,17 +91109,17 @@ ${content}`;
const hasBoxes = diagObj.db.hasAtLeastOneBox();
const hasBoxTitles = diagObj.db.hasAtLeastOneBoxWithTitle();
const maxMessageWidthPerActor = await getMaxMessageWidthPerActor(actors2, messages, diagObj);
- conf4.height = await calculateActorMargins(actors2, maxMessageWidthPerActor, boxes);
- svgDraw_default2.insertComputerIcon(diagram24);
- svgDraw_default2.insertDatabaseIcon(diagram24);
- svgDraw_default2.insertClockIcon(diagram24);
+ conf2.height = await calculateActorMargins(actors2, maxMessageWidthPerActor, boxes);
+ svgDraw_default2.insertComputerIcon(diagram26);
+ svgDraw_default2.insertDatabaseIcon(diagram26);
+ svgDraw_default2.insertClockIcon(diagram26);
if (hasBoxes) {
- bounds.bumpVerticalPos(conf4.boxMargin);
+ bounds.bumpVerticalPos(conf2.boxMargin);
if (hasBoxTitles) {
bounds.bumpVerticalPos(boxes[0].textMaxHeight);
}
}
- if (conf4.hideUnusedParticipants === true) {
+ if (conf2.hideUnusedParticipants === true) {
const newActors = /* @__PURE__ */ new Set();
messages.forEach((message) => {
newActors.add(message.from);
@@ -84728,12 +91127,12 @@ ${content}`;
});
actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey));
}
- addActorRenderingData(diagram24, actors2, createdActors, actorKeys, 0, messages, false);
+ addActorRenderingData(diagram26, actors2, createdActors, actorKeys, 0, messages, false);
const loopWidths = await calculateLoopBounds(messages, actors2, maxMessageWidthPerActor, diagObj);
- svgDraw_default2.insertArrowHead(diagram24);
- svgDraw_default2.insertArrowCrossHead(diagram24);
- svgDraw_default2.insertArrowFilledHead(diagram24);
- svgDraw_default2.insertSequenceNumber(diagram24);
+ svgDraw_default2.insertArrowHead(diagram26);
+ svgDraw_default2.insertArrowCrossHead(diagram26);
+ svgDraw_default2.insertArrowFilledHead(diagram26);
+ svgDraw_default2.insertSequenceNumber(diagram26);
function activeEnd(msg, verticalPos) {
const activationData = bounds.endActivation(msg);
if (activationData.starty + 18 > verticalPos) {
@@ -84741,10 +91140,10 @@ ${content}`;
verticalPos += 12;
}
svgDraw_default2.drawActivation(
- diagram24,
+ diagram26,
activationData,
verticalPos,
- conf4,
+ conf2,
actorActivations(msg.from).length
);
bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
@@ -84761,10 +91160,10 @@ ${content}`;
case diagObj.db.LINETYPE.NOTE:
bounds.resetVerticalPos();
noteModel = msg.noteModel;
- await drawNote(diagram24, noteModel);
+ await drawNote(diagram26, noteModel);
break;
case diagObj.db.LINETYPE.ACTIVE_START:
- bounds.newActivation(msg, diagram24, actors2);
+ bounds.newActivation(msg, diagram26, actors2);
break;
case diagObj.db.LINETYPE.ACTIVE_END:
activeEnd(msg, bounds.getVerticalPos());
@@ -84773,14 +91172,14 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin,
- conf4.boxMargin + conf4.boxTextMargin,
+ conf2.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
(message) => bounds.newLoop(message)
);
break;
case diagObj.db.LINETYPE.LOOP_END:
loopModel = bounds.endLoop();
- await svgDraw_default2.drawLoop(diagram24, loopModel, "loop", conf4);
+ await svgDraw_default2.drawLoop(diagram26, loopModel, "loop", conf2);
bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
bounds.models.addLoop(loopModel);
break;
@@ -84788,8 +91187,8 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin,
- conf4.boxMargin,
+ conf2.boxMargin,
+ conf2.boxMargin,
(message) => bounds.newLoop(void 0, message.message)
);
break;
@@ -84803,14 +91202,14 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin,
- conf4.boxMargin + conf4.boxTextMargin,
+ conf2.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
(message) => bounds.newLoop(message)
);
break;
case diagObj.db.LINETYPE.OPT_END:
loopModel = bounds.endLoop();
- await svgDraw_default2.drawLoop(diagram24, loopModel, "opt", conf4);
+ await svgDraw_default2.drawLoop(diagram26, loopModel, "opt", conf2);
bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
bounds.models.addLoop(loopModel);
break;
@@ -84818,8 +91217,8 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin,
- conf4.boxMargin + conf4.boxTextMargin,
+ conf2.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
(message) => bounds.newLoop(message)
);
break;
@@ -84827,14 +91226,14 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin + conf4.boxTextMargin,
- conf4.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
+ conf2.boxMargin,
(message) => bounds.addSectionToLoop(message)
);
break;
case diagObj.db.LINETYPE.ALT_END:
loopModel = bounds.endLoop();
- await svgDraw_default2.drawLoop(diagram24, loopModel, "alt", conf4);
+ await svgDraw_default2.drawLoop(diagram26, loopModel, "alt", conf2);
bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
bounds.models.addLoop(loopModel);
break;
@@ -84843,8 +91242,8 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin,
- conf4.boxMargin + conf4.boxTextMargin,
+ conf2.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
(message) => bounds.newLoop(message)
);
bounds.saveVerticalPos();
@@ -84853,14 +91252,14 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin + conf4.boxTextMargin,
- conf4.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
+ conf2.boxMargin,
(message) => bounds.addSectionToLoop(message)
);
break;
case diagObj.db.LINETYPE.PAR_END:
loopModel = bounds.endLoop();
- await svgDraw_default2.drawLoop(diagram24, loopModel, "par", conf4);
+ await svgDraw_default2.drawLoop(diagram26, loopModel, "par", conf2);
bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
bounds.models.addLoop(loopModel);
break;
@@ -84877,8 +91276,8 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin,
- conf4.boxMargin + conf4.boxTextMargin,
+ conf2.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
(message) => bounds.newLoop(message)
);
break;
@@ -84886,14 +91285,14 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin + conf4.boxTextMargin,
- conf4.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
+ conf2.boxMargin,
(message) => bounds.addSectionToLoop(message)
);
break;
case diagObj.db.LINETYPE.CRITICAL_END:
loopModel = bounds.endLoop();
- await svgDraw_default2.drawLoop(diagram24, loopModel, "critical", conf4);
+ await svgDraw_default2.drawLoop(diagram26, loopModel, "critical", conf2);
bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
bounds.models.addLoop(loopModel);
break;
@@ -84901,14 +91300,14 @@ ${content}`;
adjustLoopHeightForWrap(
loopWidths,
msg,
- conf4.boxMargin,
- conf4.boxMargin + conf4.boxTextMargin,
+ conf2.boxMargin,
+ conf2.boxMargin + conf2.boxTextMargin,
(message) => bounds.newLoop(message)
);
break;
case diagObj.db.LINETYPE.BREAK_END:
loopModel = bounds.endLoop();
- await svgDraw_default2.drawLoop(diagram24, loopModel, "break", conf4);
+ await svgDraw_default2.drawLoop(diagram26, loopModel, "break", conf2);
bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
bounds.models.addLoop(loopModel);
break;
@@ -84918,7 +91317,7 @@ ${content}`;
msgModel.starty = bounds.getVerticalPos();
msgModel.sequenceIndex = sequenceIndex;
msgModel.sequenceVisible = diagObj.db.showSequenceNumbers();
- const lineStartY = await boundMessage(diagram24, msgModel);
+ const lineStartY = await boundMessage(diagram26, msgModel);
adjustCreatedDestroyedData(
msg,
msgModel,
@@ -84952,15 +91351,15 @@ ${content}`;
}
log.debug("createdActors", createdActors);
log.debug("destroyedActors", destroyedActors);
- await drawActors(diagram24, actors2, actorKeys, false);
+ await drawActors(diagram26, actors2, actorKeys, false);
for (const e3 of messagesToDraw) {
- await drawMessage(diagram24, e3.messageModel, e3.lineStartY, diagObj);
+ await drawMessage(diagram26, e3.messageModel, e3.lineStartY, diagObj);
}
- if (conf4.mirrorActors) {
- await drawActors(diagram24, actors2, actorKeys, true);
+ if (conf2.mirrorActors) {
+ await drawActors(diagram26, actors2, actorKeys, true);
}
- backgrounds.forEach((e3) => svgDraw_default2.drawBackgroundRect(diagram24, e3));
- fixLifeLineHeights(diagram24, actors2, actorKeys, conf4);
+ backgrounds.forEach((e3) => svgDraw_default2.drawBackgroundRect(diagram26, e3));
+ fixLifeLineHeights(diagram26, actors2, actorKeys, conf2);
for (const box2 of bounds.models.boxes) {
box2.height = bounds.getVerticalPos() - box2.y;
bounds.insert(box2.x, box2.y, box2.x + box2.width, box2.height);
@@ -84969,12 +91368,12 @@ ${content}`;
box2.stopx = box2.startx + box2.width;
box2.stopy = box2.starty + box2.height;
box2.stroke = "rgb(0,0,0, 0.5)";
- svgDraw_default2.drawBox(diagram24, box2, conf4);
+ svgDraw_default2.drawBox(diagram26, box2, conf2);
}
if (hasBoxes) {
- bounds.bumpVerticalPos(conf4.boxMargin);
+ bounds.bumpVerticalPos(conf2.boxMargin);
}
- const requiredBoxSize = drawActorsPopup(diagram24, actors2, actorKeys, doc);
+ const requiredBoxSize = drawActorsPopup(diagram26, actors2, actorKeys, doc);
const { bounds: box } = bounds.getBounds();
if (box.startx === void 0) {
box.startx = 0;
@@ -84992,33 +91391,33 @@ ${content}`;
if (boxHeight < requiredBoxSize.maxHeight) {
boxHeight = requiredBoxSize.maxHeight;
}
- let height2 = boxHeight + 2 * conf4.diagramMarginY;
- if (conf4.mirrorActors) {
- height2 = height2 - conf4.boxMargin + conf4.bottomMarginAdj;
+ let height2 = boxHeight + 2 * conf2.diagramMarginY;
+ if (conf2.mirrorActors) {
+ height2 = height2 - conf2.boxMargin + conf2.bottomMarginAdj;
}
let boxWidth = box.stopx - box.startx;
if (boxWidth < requiredBoxSize.maxWidth) {
boxWidth = requiredBoxSize.maxWidth;
}
- const width3 = boxWidth + 2 * conf4.diagramMarginX;
+ const width3 = boxWidth + 2 * conf2.diagramMarginX;
if (title2) {
- diagram24.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 2 * conf4.diagramMarginX).attr("y", -25);
+ diagram26.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 2 * conf2.diagramMarginX).attr("y", -25);
}
- configureSvgSize(diagram24, height2, width3, conf4.useMaxWidth);
+ configureSvgSize(diagram26, height2, width3, conf2.useMaxWidth);
const extraVertForTitle = title2 ? 40 : 0;
- diagram24.attr(
+ diagram26.attr(
"viewBox",
- box.startx - conf4.diagramMarginX + " -" + (conf4.diagramMarginY + extraVertForTitle) + " " + width3 + " " + (height2 + extraVertForTitle)
+ box.startx - conf2.diagramMarginX + " -" + (conf2.diagramMarginY + extraVertForTitle) + " " + width3 + " " + (height2 + extraVertForTitle)
);
log.debug(`models:`, bounds.models);
}, "draw");
__name(getMaxMessageWidthPerActor, "getMaxMessageWidthPerActor");
getRequiredPopupWidth = /* @__PURE__ */ __name(function(actor) {
let requiredPopupWidth = 0;
- const textFont = actorFont(conf4);
+ const textFont = actorFont(conf2);
for (const key in actor.links) {
const labelDimensions = utils_default2.calculateTextDimensions(key, textFont);
- const labelWidth = labelDimensions.width + 2 * conf4.wrapPadding + 2 * conf4.boxMargin;
+ const labelWidth = labelDimensions.width + 2 * conf2.wrapPadding + 2 * conf2.boxMargin;
if (requiredPopupWidth < labelWidth) {
requiredPopupWidth = labelWidth;
}
@@ -85033,11 +91432,11 @@ ${content}`;
const stopx = toActor.x;
const shouldWrap = msg.wrap && msg.message;
let textDimensions = hasKatex(msg.message) ? await calculateMathMLDimensions(msg.message, getConfig2()) : utils_default2.calculateTextDimensions(
- shouldWrap ? utils_default2.wrapLabel(msg.message, conf4.width, noteFont(conf4)) : msg.message,
- noteFont(conf4)
+ shouldWrap ? utils_default2.wrapLabel(msg.message, conf2.width, noteFont(conf2)) : msg.message,
+ noteFont(conf2)
);
const noteModel = {
- width: shouldWrap ? conf4.width : common_default.getMax(conf4.width, textDimensions.width + 2 * conf4.noteMargin),
+ width: shouldWrap ? conf2.width : common_default.getMax(conf2.width, textDimensions.width + 2 * conf2.noteMargin),
height: 0,
startx: fromActor.x,
stopx: 0,
@@ -85046,33 +91445,33 @@ ${content}`;
message: msg.message
};
if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) {
- noteModel.width = shouldWrap ? common_default.getMax(conf4.width, textDimensions.width) : common_default.getMax(
+ noteModel.width = shouldWrap ? common_default.getMax(conf2.width, textDimensions.width) : common_default.getMax(
fromActor.width / 2 + toActor.width / 2,
- textDimensions.width + 2 * conf4.noteMargin
+ textDimensions.width + 2 * conf2.noteMargin
);
- noteModel.startx = startx + (fromActor.width + conf4.actorMargin) / 2;
+ noteModel.startx = startx + (fromActor.width + conf2.actorMargin) / 2;
} else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) {
- noteModel.width = shouldWrap ? common_default.getMax(conf4.width, textDimensions.width + 2 * conf4.noteMargin) : common_default.getMax(
+ noteModel.width = shouldWrap ? common_default.getMax(conf2.width, textDimensions.width + 2 * conf2.noteMargin) : common_default.getMax(
fromActor.width / 2 + toActor.width / 2,
- textDimensions.width + 2 * conf4.noteMargin
+ textDimensions.width + 2 * conf2.noteMargin
);
- noteModel.startx = startx - noteModel.width + (fromActor.width - conf4.actorMargin) / 2;
+ noteModel.startx = startx - noteModel.width + (fromActor.width - conf2.actorMargin) / 2;
} else if (msg.to === msg.from) {
textDimensions = utils_default2.calculateTextDimensions(
- shouldWrap ? utils_default2.wrapLabel(msg.message, common_default.getMax(conf4.width, fromActor.width), noteFont(conf4)) : msg.message,
- noteFont(conf4)
+ shouldWrap ? utils_default2.wrapLabel(msg.message, common_default.getMax(conf2.width, fromActor.width), noteFont(conf2)) : msg.message,
+ noteFont(conf2)
);
- noteModel.width = shouldWrap ? common_default.getMax(conf4.width, fromActor.width) : common_default.getMax(fromActor.width, conf4.width, textDimensions.width + 2 * conf4.noteMargin);
+ noteModel.width = shouldWrap ? common_default.getMax(conf2.width, fromActor.width) : common_default.getMax(fromActor.width, conf2.width, textDimensions.width + 2 * conf2.noteMargin);
noteModel.startx = startx + (fromActor.width - noteModel.width) / 2;
} else {
- noteModel.width = Math.abs(startx + fromActor.width / 2 - (stopx + toActor.width / 2)) + conf4.actorMargin;
- noteModel.startx = startx < stopx ? startx + fromActor.width / 2 - conf4.actorMargin / 2 : stopx + toActor.width / 2 - conf4.actorMargin / 2;
+ noteModel.width = Math.abs(startx + fromActor.width / 2 - (stopx + toActor.width / 2)) + conf2.actorMargin;
+ noteModel.startx = startx < stopx ? startx + fromActor.width / 2 - conf2.actorMargin / 2 : stopx + toActor.width / 2 - conf2.actorMargin / 2;
}
if (shouldWrap) {
noteModel.message = utils_default2.wrapLabel(
msg.message,
- noteModel.width - 2 * conf4.wrapPadding,
- noteFont(conf4)
+ noteModel.width - 2 * conf2.wrapPadding,
+ noteFont(conf2)
);
}
log.debug(
@@ -85108,7 +91507,7 @@ ${content}`;
stopx = startx;
} else {
if (msg.activate && !isArrowToActivation) {
- stopx += adjustValue(conf4.activationWidth / 2 - 1);
+ stopx += adjustValue(conf2.activationWidth / 2 - 1);
}
if (![diagObj.db.LINETYPE.SOLID_OPEN, diagObj.db.LINETYPE.DOTTED_OPEN].includes(msg.type)) {
stopx += adjustValue(3);
@@ -85124,16 +91523,16 @@ ${content}`;
if (msg.wrap && msg.message) {
msg.message = utils_default2.wrapLabel(
msg.message,
- common_default.getMax(boundedWidth + 2 * conf4.wrapPadding, conf4.width),
- messageFont2(conf4)
+ common_default.getMax(boundedWidth + 2 * conf2.wrapPadding, conf2.width),
+ messageFont2(conf2)
);
}
- const msgDims = utils_default2.calculateTextDimensions(msg.message, messageFont2(conf4));
+ const msgDims = utils_default2.calculateTextDimensions(msg.message, messageFont2(conf2));
return {
width: common_default.getMax(
- msg.wrap ? 0 : msgDims.width + 2 * conf4.wrapPadding,
- boundedWidth + 2 * conf4.wrapPadding,
- conf4.width
+ msg.wrap ? 0 : msgDims.width + 2 * conf2.wrapPadding,
+ boundedWidth + 2 * conf2.wrapPadding,
+ conf2.width
),
height: 0,
startx,
@@ -85152,7 +91551,6 @@ ${content}`;
const stack = [];
let current, noteModel, msgModel;
for (const msg of messages) {
- msg.id = utils_default2.random({ length: 10 });
switch (msg.type) {
case diagObj.db.LINETYPE.LOOP_START:
case diagObj.db.LINETYPE.ALT_START:
@@ -85192,10 +91590,10 @@ ${content}`;
{
const actorRect = actors2.get(msg.from ? msg.from : msg.to.actor);
const stackedSize = actorActivations(msg.from ? msg.from : msg.to.actor).length;
- const x5 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf4.activationWidth / 2;
+ const x5 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf2.activationWidth / 2;
const toAdd = {
startx: x5,
- stopx: x5 + conf4.activationWidth,
+ stopx: x5 + conf2.activationWidth,
actor: msg.from,
enabled: true
};
@@ -85217,7 +91615,7 @@ ${content}`;
current = stk;
current.from = common_default.getMin(current.from, noteModel.startx);
current.to = common_default.getMax(current.to, noteModel.startx + noteModel.width);
- current.width = common_default.getMax(current.width, Math.abs(current.from - current.to)) - conf4.labelBoxWidth;
+ current.width = common_default.getMax(current.width, Math.abs(current.from - current.to)) - conf2.labelBoxWidth;
});
} else {
msgModel = buildMessageModel(msg, actors2, diagObj);
@@ -85238,11 +91636,11 @@ ${content}`;
to.x + from2.width / 2,
current.to
);
- current.width = common_default.getMax(current.width, Math.abs(current.to - current.from)) - conf4.labelBoxWidth;
+ current.width = common_default.getMax(current.width, Math.abs(current.to - current.from)) - conf2.labelBoxWidth;
} else {
current.from = common_default.getMin(msgModel.startx, current.from);
current.to = common_default.getMax(msgModel.stopx, current.to);
- current.width = common_default.getMax(current.width, msgModel.width) - conf4.labelBoxWidth;
+ current.width = common_default.getMax(current.width, msgModel.width) - conf2.labelBoxWidth;
}
});
}
@@ -85256,7 +91654,7 @@ ${content}`;
bounds,
drawActors,
drawActorsPopup,
- setConf: setConf4,
+ setConf: setConf3,
draw: draw11
};
}
@@ -85274,14 +91672,23 @@ ${content}`;
init_sequenceDiagram();
init_sequenceDb();
init_styles8();
+ init_diagramAPI();
init_sequenceRenderer();
diagram11 = {
parser: sequenceDiagram_default,
- db: sequenceDb_default,
+ get db() {
+ return new SequenceDB();
+ },
renderer: sequenceRenderer_default,
styles: styles_default8,
- init: /* @__PURE__ */ __name(({ wrap: wrap3 }) => {
- sequenceDb_default.setWrap(wrap3);
+ init: /* @__PURE__ */ __name((cnf) => {
+ if (!cnf.sequence) {
+ cnf.sequence = {};
+ }
+ if (cnf.wrap) {
+ cnf.sequence.wrap = cnf.wrap;
+ setConfig2({ sequence: { wrap: cnf.wrap } });
+ }
}, "init")
};
}
@@ -85296,14 +91703,14 @@ ${content}`;
var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
- }, "o"), $V0 = [1, 17], $V1 = [1, 18], $V2 = [1, 19], $V3 = [1, 39], $V4 = [1, 40], $V5 = [1, 25], $V6 = [1, 23], $V7 = [1, 24], $V8 = [1, 31], $V9 = [1, 32], $Va = [1, 33], $Vb = [1, 34], $Vc = [1, 35], $Vd = [1, 36], $Ve = [1, 26], $Vf = [1, 27], $Vg = [1, 28], $Vh = [1, 29], $Vi = [1, 43], $Vj = [1, 30], $Vk = [1, 42], $Vl = [1, 44], $Vm = [1, 41], $Vn = [1, 45], $Vo = [1, 9], $Vp = [1, 8, 9], $Vq = [1, 56], $Vr = [1, 57], $Vs = [1, 58], $Vt = [1, 59], $Vu = [1, 60], $Vv = [1, 61], $Vw = [1, 62], $Vx = [1, 8, 9, 39], $Vy = [1, 74], $Vz = [1, 8, 9, 12, 13, 21, 37, 39, 42, 59, 60, 61, 62, 63, 64, 65, 70, 72], $VA = [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], $VB = [13, 74, 80, 95, 97, 98], $VC = [13, 64, 65, 74, 80, 95, 97, 98], $VD = [13, 59, 60, 61, 62, 63, 74, 80, 95, 97, 98], $VE = [1, 93], $VF = [1, 110], $VG = [1, 108], $VH = [1, 102], $VI = [1, 103], $VJ = [1, 104], $VK = [1, 105], $VL = [1, 106], $VM = [1, 107], $VN = [1, 109], $VO = [1, 8, 9, 37, 39, 42], $VP = [1, 8, 9, 21], $VQ = [1, 8, 9, 78], $VR = [1, 8, 9, 21, 73, 74, 78, 80, 81, 82, 83, 84, 85];
- var parser22 = {
+ }, "o"), $V0 = [1, 18], $V1 = [1, 19], $V2 = [1, 20], $V3 = [1, 41], $V4 = [1, 42], $V5 = [1, 26], $V6 = [1, 24], $V7 = [1, 25], $V8 = [1, 32], $V9 = [1, 33], $Va = [1, 34], $Vb = [1, 45], $Vc = [1, 35], $Vd = [1, 36], $Ve = [1, 37], $Vf = [1, 38], $Vg = [1, 27], $Vh = [1, 28], $Vi = [1, 29], $Vj = [1, 30], $Vk = [1, 31], $Vl = [1, 44], $Vm = [1, 46], $Vn = [1, 43], $Vo = [1, 47], $Vp = [1, 9], $Vq = [1, 8, 9], $Vr = [1, 58], $Vs = [1, 59], $Vt = [1, 60], $Vu = [1, 61], $Vv = [1, 62], $Vw = [1, 63], $Vx = [1, 64], $Vy = [1, 8, 9, 41], $Vz = [1, 76], $VA = [1, 8, 9, 12, 13, 22, 39, 41, 44, 66, 67, 68, 69, 70, 71, 72, 77, 79], $VB = [1, 8, 9, 12, 13, 17, 20, 22, 39, 41, 44, 48, 58, 66, 67, 68, 69, 70, 71, 72, 77, 79, 84, 99, 101, 102], $VC = [13, 58, 84, 99, 101, 102], $VD = [13, 58, 71, 72, 84, 99, 101, 102], $VE = [13, 58, 66, 67, 68, 69, 70, 84, 99, 101, 102], $VF = [1, 98], $VG = [1, 115], $VH = [1, 107], $VI = [1, 113], $VJ = [1, 108], $VK = [1, 109], $VL = [1, 110], $VM = [1, 111], $VN = [1, 112], $VO = [1, 114], $VP = [22, 58, 59, 80, 84, 85, 86, 87, 88, 89], $VQ = [1, 8, 9, 39, 41, 44], $VR = [1, 8, 9, 22], $VS = [1, 143], $VT = [1, 8, 9, 59], $VU = [1, 8, 9, 22, 58, 59, 80, 84, 85, 86, 87, 88, 89];
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
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]],
+ 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, "DOT": 17, "className": 18, "classLiteralName": 19, "GENERICTYPE": 20, "relationStatement": 21, "LABEL": 22, "namespaceStatement": 23, "classStatement": 24, "memberStatement": 25, "annotationStatement": 26, "clickStatement": 27, "styleStatement": 28, "cssClassStatement": 29, "noteStatement": 30, "classDefStatement": 31, "direction": 32, "acc_title": 33, "acc_title_value": 34, "acc_descr": 35, "acc_descr_value": 36, "acc_descr_multiline_value": 37, "namespaceIdentifier": 38, "STRUCT_START": 39, "classStatements": 40, "STRUCT_STOP": 41, "NAMESPACE": 42, "classIdentifier": 43, "STYLE_SEPARATOR": 44, "members": 45, "CLASS": 46, "ANNOTATION_START": 47, "ANNOTATION_END": 48, "MEMBER": 49, "SEPARATOR": 50, "relation": 51, "NOTE_FOR": 52, "noteText": 53, "NOTE": 54, "CLASSDEF": 55, "classList": 56, "stylesOpt": 57, "ALPHA": 58, "COMMA": 59, "direction_tb": 60, "direction_bt": 61, "direction_rl": 62, "direction_lr": 63, "relationType": 64, "lineType": 65, "AGGREGATION": 66, "EXTENSION": 67, "COMPOSITION": 68, "DEPENDENCY": 69, "LOLLIPOP": 70, "LINE": 71, "DOTTED_LINE": 72, "CALLBACK": 73, "LINK": 74, "LINK_TARGET": 75, "CLICK": 76, "CALLBACK_NAME": 77, "CALLBACK_ARGS": 78, "HREF": 79, "STYLE": 80, "CSSCLASS": 81, "style": 82, "styleComponent": 83, "NUM": 84, "COLON": 85, "UNIT": 86, "SPACE": 87, "BRKT": 88, "PCT": 89, "commentToken": 90, "textToken": 91, "graphCodeTokens": 92, "textNoTagsToken": 93, "TAGSTART": 94, "TAGEND": 95, "==": 96, "--": 97, "DEFAULT": 98, "MINUS": 99, "keywords": 100, "UNICODE_TEXT": 101, "BQUOTE_STR": 102, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 7: "CLASS_DIAGRAM", 8: "NEWLINE", 9: "EOF", 12: "SQS", 13: "STR", 14: "SQE", 17: "DOT", 20: "GENERICTYPE", 22: "LABEL", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 39: "STRUCT_START", 41: "STRUCT_STOP", 42: "NAMESPACE", 44: "STYLE_SEPARATOR", 46: "CLASS", 47: "ANNOTATION_START", 48: "ANNOTATION_END", 49: "MEMBER", 50: "SEPARATOR", 52: "NOTE_FOR", 54: "NOTE", 55: "CLASSDEF", 58: "ALPHA", 59: "COMMA", 60: "direction_tb", 61: "direction_bt", 62: "direction_rl", 63: "direction_lr", 66: "AGGREGATION", 67: "EXTENSION", 68: "COMPOSITION", 69: "DEPENDENCY", 70: "LOLLIPOP", 71: "LINE", 72: "DOTTED_LINE", 73: "CALLBACK", 74: "LINK", 75: "LINK_TARGET", 76: "CLICK", 77: "CALLBACK_NAME", 78: "CALLBACK_ARGS", 79: "HREF", 80: "STYLE", 81: "CSSCLASS", 84: "NUM", 85: "COLON", 86: "UNIT", 87: "SPACE", 88: "BRKT", 89: "PCT", 92: "graphCodeTokens", 94: "TAGSTART", 95: "TAGEND", 96: "==", 97: "--", 98: "DEFAULT", 99: "MINUS", 100: "keywords", 101: "UNICODE_TEXT", 102: "BQUOTE_STR" },
+ productions_: [0, [3, 1], [3, 1], [4, 1], [6, 4], [5, 1], [5, 2], [5, 3], [11, 3], [15, 1], [15, 3], [15, 2], [18, 1], [18, 3], [18, 1], [18, 2], [18, 2], [18, 2], [10, 1], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [23, 4], [23, 5], [38, 2], [40, 1], [40, 2], [40, 3], [24, 1], [24, 3], [24, 4], [24, 6], [43, 2], [43, 3], [26, 4], [45, 1], [45, 2], [25, 1], [25, 2], [25, 1], [25, 1], [21, 3], [21, 4], [21, 4], [21, 5], [30, 3], [30, 2], [31, 3], [56, 1], [56, 3], [32, 1], [32, 1], [32, 1], [32, 1], [51, 3], [51, 2], [51, 2], [51, 1], [64, 1], [64, 1], [64, 1], [64, 1], [64, 1], [65, 1], [65, 1], [27, 3], [27, 4], [27, 3], [27, 4], [27, 4], [27, 5], [27, 3], [27, 4], [27, 4], [27, 5], [27, 4], [27, 5], [27, 5], [27, 6], [28, 3], [29, 3], [57, 1], [57, 3], [82, 1], [82, 2], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [90, 1], [90, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [93, 1], [93, 1], [93, 1], [93, 1], [16, 1], [16, 1], [16, 1], [16, 1], [19, 1], [53, 1]],
performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
var $0 = $$.length - 1;
switch (yystate) {
@@ -85311,232 +91718,244 @@ ${content}`;
this.$ = $$[$0 - 1];
break;
case 9:
- case 11:
case 12:
+ case 14:
this.$ = $$[$0];
break;
case 10:
case 13:
- this.$ = $$[$0 - 1] + $$[$0];
+ this.$ = $$[$0 - 2] + "." + $$[$0];
break;
- case 14:
+ case 11:
case 15:
- this.$ = $$[$0 - 1] + "~" + $$[$0] + "~";
+ this.$ = $$[$0 - 1] + $$[$0];
break;
case 16:
+ case 17:
+ this.$ = $$[$0 - 1] + "~" + $$[$0] + "~";
+ break;
+ case 18:
yy.addRelation($$[$0]);
break;
- case 17:
+ case 19:
$$[$0 - 1].title = yy.cleanupLabel($$[$0]);
yy.addRelation($$[$0 - 1]);
break;
- case 27:
+ case 30:
this.$ = $$[$0].trim();
yy.setAccTitle(this.$);
break;
- case 28:
- case 29:
+ case 31:
+ case 32:
this.$ = $$[$0].trim();
yy.setAccDescription(this.$);
break;
- case 30:
+ case 33:
yy.addClassesToNamespace($$[$0 - 3], $$[$0 - 1]);
break;
- case 31:
+ case 34:
yy.addClassesToNamespace($$[$0 - 4], $$[$0 - 1]);
break;
- case 32:
+ case 35:
this.$ = $$[$0];
yy.addNamespace($$[$0]);
break;
- case 33:
+ case 36:
this.$ = [$$[$0]];
break;
- case 34:
+ case 37:
this.$ = [$$[$0 - 1]];
break;
- case 35:
+ case 38:
$$[$0].unshift($$[$0 - 2]);
this.$ = $$[$0];
break;
- case 37:
+ case 40:
yy.setCssClass($$[$0 - 2], $$[$0]);
break;
- case 38:
+ case 41:
yy.addMembers($$[$0 - 3], $$[$0 - 1]);
break;
- case 39:
+ case 42:
yy.setCssClass($$[$0 - 5], $$[$0 - 3]);
yy.addMembers($$[$0 - 5], $$[$0 - 1]);
break;
- case 40:
+ case 43:
this.$ = $$[$0];
yy.addClass($$[$0]);
break;
- case 41:
+ case 44:
this.$ = $$[$0 - 1];
yy.addClass($$[$0 - 1]);
yy.setClassLabel($$[$0 - 1], $$[$0]);
break;
- case 42:
+ case 45:
yy.addAnnotation($$[$0], $$[$0 - 2]);
break;
- case 43:
+ case 46:
+ case 59:
this.$ = [$$[$0]];
break;
- case 44:
+ case 47:
$$[$0].push($$[$0 - 1]);
this.$ = $$[$0];
break;
- case 45:
+ case 48:
break;
- case 46:
+ case 49:
yy.addMember($$[$0 - 1], yy.cleanupLabel($$[$0]));
break;
- case 47:
+ case 50:
break;
- case 48:
+ case 51:
break;
- case 49:
+ case 52:
this.$ = { "id1": $$[$0 - 2], "id2": $$[$0], relation: $$[$0 - 1], relationTitle1: "none", relationTitle2: "none" };
break;
- case 50:
+ case 53:
this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: "none" };
break;
- case 51:
+ case 54:
this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: "none", relationTitle2: $$[$0 - 1] };
break;
- case 52:
+ case 55:
this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] };
break;
- case 53:
+ case 56:
yy.addNote($$[$0], $$[$0 - 1]);
break;
- case 54:
+ case 57:
yy.addNote($$[$0]);
break;
- case 55:
+ case 58:
+ this.$ = $$[$0 - 2];
+ yy.defineClass($$[$0 - 1], $$[$0]);
+ break;
+ case 60:
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
+ break;
+ case 61:
yy.setDirection("TB");
break;
- case 56:
+ case 62:
yy.setDirection("BT");
break;
- case 57:
+ case 63:
yy.setDirection("RL");
break;
- case 58:
+ case 64:
yy.setDirection("LR");
break;
- case 59:
+ case 65:
this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] };
break;
- case 60:
+ case 66:
this.$ = { type1: "none", type2: $$[$0], lineType: $$[$0 - 1] };
break;
- case 61:
+ case 67:
this.$ = { type1: $$[$0 - 1], type2: "none", lineType: $$[$0] };
break;
- case 62:
+ case 68:
this.$ = { type1: "none", type2: "none", lineType: $$[$0] };
break;
- case 63:
+ case 69:
this.$ = yy.relationType.AGGREGATION;
break;
- case 64:
+ case 70:
this.$ = yy.relationType.EXTENSION;
break;
- case 65:
+ case 71:
this.$ = yy.relationType.COMPOSITION;
break;
- case 66:
+ case 72:
this.$ = yy.relationType.DEPENDENCY;
break;
- case 67:
+ case 73:
this.$ = yy.relationType.LOLLIPOP;
break;
- case 68:
+ case 74:
this.$ = yy.lineType.LINE;
break;
- case 69:
+ case 75:
this.$ = yy.lineType.DOTTED_LINE;
break;
- case 70:
case 76:
+ case 82:
this.$ = $$[$0 - 2];
yy.setClickEvent($$[$0 - 1], $$[$0]);
break;
- case 71:
case 77:
+ case 83:
this.$ = $$[$0 - 3];
yy.setClickEvent($$[$0 - 2], $$[$0 - 1]);
yy.setTooltip($$[$0 - 2], $$[$0]);
break;
- case 72:
+ case 78:
this.$ = $$[$0 - 2];
yy.setLink($$[$0 - 1], $$[$0]);
break;
- case 73:
+ case 79:
this.$ = $$[$0 - 3];
yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]);
break;
- case 74:
+ case 80:
this.$ = $$[$0 - 3];
yy.setLink($$[$0 - 2], $$[$0 - 1]);
yy.setTooltip($$[$0 - 2], $$[$0]);
break;
- case 75:
+ case 81:
this.$ = $$[$0 - 4];
yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]);
yy.setTooltip($$[$0 - 3], $$[$0 - 1]);
break;
- case 78:
+ case 84:
this.$ = $$[$0 - 3];
yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]);
break;
- case 79:
+ case 85:
this.$ = $$[$0 - 4];
yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]);
yy.setTooltip($$[$0 - 3], $$[$0]);
break;
- case 80:
+ case 86:
this.$ = $$[$0 - 3];
yy.setLink($$[$0 - 2], $$[$0]);
break;
- case 81:
+ case 87:
this.$ = $$[$0 - 4];
yy.setLink($$[$0 - 3], $$[$0 - 1], $$[$0]);
break;
- case 82:
+ case 88:
this.$ = $$[$0 - 4];
yy.setLink($$[$0 - 3], $$[$0 - 1]);
yy.setTooltip($$[$0 - 3], $$[$0]);
break;
- case 83:
+ case 89:
this.$ = $$[$0 - 5];
yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]);
yy.setTooltip($$[$0 - 4], $$[$0 - 1]);
break;
- case 84:
+ case 90:
this.$ = $$[$0 - 2];
yy.setCssStyle($$[$0 - 1], $$[$0]);
break;
- case 85:
+ case 91:
yy.setCssClass($$[$0 - 1], $$[$0]);
break;
- case 86:
+ case 92:
this.$ = [$$[$0]];
break;
- case 87:
+ case 93:
$$[$0 - 2].push($$[$0]);
this.$ = $$[$0 - 2];
break;
- case 89:
+ case 95:
this.$ = $$[$0 - 1] + $$[$0];
break;
}
}, "anonymous"),
- 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: $V0, 33: $V1, 35: $V2, 36: 21, 40: $V3, 41: 22, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, o2($Vo, [2, 5], { 8: [1, 46] }), { 8: [1, 47] }, o2($Vp, [2, 16], { 21: [1, 48] }), o2($Vp, [2, 18]), o2($Vp, [2, 19]), o2($Vp, [2, 20]), o2($Vp, [2, 21]), o2($Vp, [2, 22]), o2($Vp, [2, 23]), o2($Vp, [2, 24]), o2($Vp, [2, 25]), o2($Vp, [2, 26]), { 32: [1, 49] }, { 34: [1, 50] }, o2($Vp, [2, 29]), o2($Vp, [2, 45], { 49: 51, 57: 54, 58: 55, 13: [1, 52], 21: [1, 53], 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu, 64: $Vv, 65: $Vw }), { 37: [1, 63] }, o2($Vx, [2, 36], { 37: [1, 65], 42: [1, 64] }), o2($Vp, [2, 47]), o2($Vp, [2, 48]), { 16: 66, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 16: 37, 17: 67, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 16: 37, 17: 68, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 16: 37, 17: 69, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 74: [1, 70] }, { 13: [1, 71] }, { 16: 37, 17: 72, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 13: $Vy, 51: 73 }, o2($Vp, [2, 55]), o2($Vp, [2, 56]), o2($Vp, [2, 57]), o2($Vp, [2, 58]), o2($Vz, [2, 11], { 16: 37, 18: 38, 17: 75, 19: [1, 76], 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }), o2($Vz, [2, 12], { 19: [1, 77] }), { 15: 78, 16: 79, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 16: 37, 17: 80, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($VA, [2, 112]), o2($VA, [2, 113]), o2($VA, [2, 114]), o2($VA, [2, 115]), o2([1, 8, 9, 12, 13, 19, 21, 37, 39, 42, 59, 60, 61, 62, 63, 64, 65, 70, 72], [2, 116]), o2($Vo, [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: $V0, 33: $V1, 35: $V2, 40: $V3, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }), { 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: $V0, 33: $V1, 35: $V2, 36: 21, 40: $V3, 41: 22, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($Vp, [2, 17]), o2($Vp, [2, 27]), o2($Vp, [2, 28]), { 13: [1, 84], 16: 37, 17: 83, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 49: 85, 57: 54, 58: 55, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu, 64: $Vv, 65: $Vw }, o2($Vp, [2, 46]), { 58: 86, 64: $Vv, 65: $Vw }, o2($VB, [2, 62], { 57: 87, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu }), o2($VC, [2, 63]), o2($VC, [2, 64]), o2($VC, [2, 65]), o2($VC, [2, 66]), o2($VC, [2, 67]), o2($VD, [2, 68]), o2($VD, [2, 69]), { 8: [1, 89], 23: 90, 38: 88, 41: 22, 44: $V4 }, { 16: 91, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 43: 92, 47: $VE }, { 46: [1, 94] }, { 13: [1, 95] }, { 13: [1, 96] }, { 70: [1, 97], 72: [1, 98] }, { 21: $VF, 73: $VG, 74: $VH, 75: 99, 77: 100, 79: 101, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }, { 74: [1, 111] }, { 13: $Vy, 51: 112 }, o2($Vp, [2, 54]), o2($Vp, [2, 117]), o2($Vz, [2, 13]), o2($Vz, [2, 14]), o2($Vz, [2, 15]), { 37: [2, 32] }, { 15: 113, 16: 79, 37: [2, 9], 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, o2($VO, [2, 40], { 11: 114, 12: [1, 115] }), o2($Vo, [2, 7]), { 9: [1, 116] }, o2($VP, [2, 49]), { 16: 37, 17: 117, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 13: [1, 119], 16: 37, 17: 118, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($VB, [2, 61], { 57: 120, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu }), o2($VB, [2, 60]), { 39: [1, 121] }, { 23: 90, 38: 122, 41: 22, 44: $V4 }, { 8: [1, 123], 39: [2, 33] }, o2($Vx, [2, 37], { 37: [1, 124] }), { 39: [1, 125] }, { 39: [2, 43], 43: 126, 47: $VE }, { 16: 37, 17: 127, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($Vp, [2, 70], { 13: [1, 128] }), o2($Vp, [2, 72], { 13: [1, 130], 68: [1, 129] }), o2($Vp, [2, 76], { 13: [1, 131], 71: [1, 132] }), { 13: [1, 133] }, o2($Vp, [2, 84], { 78: [1, 134] }), o2($VQ, [2, 86], { 79: 135, 21: $VF, 73: $VG, 74: $VH, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }), o2($VR, [2, 88]), o2($VR, [2, 90]), o2($VR, [2, 91]), o2($VR, [2, 92]), o2($VR, [2, 93]), o2($VR, [2, 94]), o2($VR, [2, 95]), o2($VR, [2, 96]), o2($VR, [2, 97]), o2($VR, [2, 98]), o2($Vp, [2, 85]), o2($Vp, [2, 53]), { 37: [2, 10] }, o2($VO, [2, 41]), { 13: [1, 136] }, { 1: [2, 4] }, o2($VP, [2, 51]), o2($VP, [2, 50]), { 16: 37, 17: 137, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($VB, [2, 59]), o2($Vp, [2, 30]), { 39: [1, 138] }, { 23: 90, 38: 139, 39: [2, 34], 41: 22, 44: $V4 }, { 43: 140, 47: $VE }, o2($Vx, [2, 38]), { 39: [2, 44] }, o2($Vp, [2, 42]), o2($Vp, [2, 71]), o2($Vp, [2, 73]), o2($Vp, [2, 74], { 68: [1, 141] }), o2($Vp, [2, 77]), o2($Vp, [2, 78], { 13: [1, 142] }), o2($Vp, [2, 80], { 13: [1, 144], 68: [1, 143] }), { 21: $VF, 73: $VG, 74: $VH, 77: 145, 79: 101, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }, o2($VR, [2, 89]), { 14: [1, 146] }, o2($VP, [2, 52]), o2($Vp, [2, 31]), { 39: [2, 35] }, { 39: [1, 147] }, o2($Vp, [2, 75]), o2($Vp, [2, 79]), o2($Vp, [2, 81]), o2($Vp, [2, 82], { 68: [1, 148] }), o2($VQ, [2, 87], { 79: 135, 21: $VF, 73: $VG, 74: $VH, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }), o2($VO, [2, 8]), o2($Vx, [2, 39]), o2($Vp, [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] },
+ table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: [1, 6], 10: 5, 16: 39, 18: 21, 19: 40, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V0, 35: $V1, 37: $V2, 38: 22, 42: $V3, 43: 23, 46: $V4, 47: $V5, 49: $V6, 50: $V7, 52: $V8, 54: $V9, 55: $Va, 58: $Vb, 60: $Vc, 61: $Vd, 62: $Ve, 63: $Vf, 73: $Vg, 74: $Vh, 76: $Vi, 80: $Vj, 81: $Vk, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, o2($Vp, [2, 5], { 8: [1, 48] }), { 8: [1, 49] }, o2($Vq, [2, 18], { 22: [1, 50] }), o2($Vq, [2, 20]), o2($Vq, [2, 21]), o2($Vq, [2, 22]), o2($Vq, [2, 23]), o2($Vq, [2, 24]), o2($Vq, [2, 25]), o2($Vq, [2, 26]), o2($Vq, [2, 27]), o2($Vq, [2, 28]), o2($Vq, [2, 29]), { 34: [1, 51] }, { 36: [1, 52] }, o2($Vq, [2, 32]), o2($Vq, [2, 48], { 51: 53, 64: 56, 65: 57, 13: [1, 54], 22: [1, 55], 66: $Vr, 67: $Vs, 68: $Vt, 69: $Vu, 70: $Vv, 71: $Vw, 72: $Vx }), { 39: [1, 65] }, o2($Vy, [2, 39], { 39: [1, 67], 44: [1, 66] }), o2($Vq, [2, 50]), o2($Vq, [2, 51]), { 16: 68, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn }, { 16: 39, 18: 69, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, { 16: 39, 18: 70, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, { 16: 39, 18: 71, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, { 58: [1, 72] }, { 13: [1, 73] }, { 16: 39, 18: 74, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, { 13: $Vz, 53: 75 }, { 56: 77, 58: [1, 78] }, o2($Vq, [2, 61]), o2($Vq, [2, 62]), o2($Vq, [2, 63]), o2($Vq, [2, 64]), o2($VA, [2, 12], { 16: 39, 19: 40, 18: 80, 17: [1, 79], 20: [1, 81], 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }), o2($VA, [2, 14], { 20: [1, 82] }), { 15: 83, 16: 84, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn }, { 16: 39, 18: 85, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, o2($VB, [2, 118]), o2($VB, [2, 119]), o2($VB, [2, 120]), o2($VB, [2, 121]), o2([1, 8, 9, 12, 13, 20, 22, 39, 41, 44, 66, 67, 68, 69, 70, 71, 72, 77, 79], [2, 122]), o2($Vp, [2, 6], { 10: 5, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 18: 21, 38: 22, 43: 23, 16: 39, 19: 40, 5: 86, 33: $V0, 35: $V1, 37: $V2, 42: $V3, 46: $V4, 47: $V5, 49: $V6, 50: $V7, 52: $V8, 54: $V9, 55: $Va, 58: $Vb, 60: $Vc, 61: $Vd, 62: $Ve, 63: $Vf, 73: $Vg, 74: $Vh, 76: $Vi, 80: $Vj, 81: $Vk, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }), { 5: 87, 10: 5, 16: 39, 18: 21, 19: 40, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V0, 35: $V1, 37: $V2, 38: 22, 42: $V3, 43: 23, 46: $V4, 47: $V5, 49: $V6, 50: $V7, 52: $V8, 54: $V9, 55: $Va, 58: $Vb, 60: $Vc, 61: $Vd, 62: $Ve, 63: $Vf, 73: $Vg, 74: $Vh, 76: $Vi, 80: $Vj, 81: $Vk, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, o2($Vq, [2, 19]), o2($Vq, [2, 30]), o2($Vq, [2, 31]), { 13: [1, 89], 16: 39, 18: 88, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, { 51: 90, 64: 56, 65: 57, 66: $Vr, 67: $Vs, 68: $Vt, 69: $Vu, 70: $Vv, 71: $Vw, 72: $Vx }, o2($Vq, [2, 49]), { 65: 91, 71: $Vw, 72: $Vx }, o2($VC, [2, 68], { 64: 92, 66: $Vr, 67: $Vs, 68: $Vt, 69: $Vu, 70: $Vv }), o2($VD, [2, 69]), o2($VD, [2, 70]), o2($VD, [2, 71]), o2($VD, [2, 72]), o2($VD, [2, 73]), o2($VE, [2, 74]), o2($VE, [2, 75]), { 8: [1, 94], 24: 95, 40: 93, 43: 23, 46: $V4 }, { 16: 96, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn }, { 45: 97, 49: $VF }, { 48: [1, 99] }, { 13: [1, 100] }, { 13: [1, 101] }, { 77: [1, 102], 79: [1, 103] }, { 22: $VG, 57: 104, 58: $VH, 80: $VI, 82: 105, 83: 106, 84: $VJ, 85: $VK, 86: $VL, 87: $VM, 88: $VN, 89: $VO }, { 58: [1, 116] }, { 13: $Vz, 53: 117 }, o2($Vq, [2, 57]), o2($Vq, [2, 123]), { 22: $VG, 57: 118, 58: $VH, 59: [1, 119], 80: $VI, 82: 105, 83: 106, 84: $VJ, 85: $VK, 86: $VL, 87: $VM, 88: $VN, 89: $VO }, o2($VP, [2, 59]), { 16: 39, 18: 120, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, o2($VA, [2, 15]), o2($VA, [2, 16]), o2($VA, [2, 17]), { 39: [2, 35] }, { 15: 122, 16: 84, 17: [1, 121], 39: [2, 9], 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn }, o2($VQ, [2, 43], { 11: 123, 12: [1, 124] }), o2($Vp, [2, 7]), { 9: [1, 125] }, o2($VR, [2, 52]), { 16: 39, 18: 126, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, { 13: [1, 128], 16: 39, 18: 127, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, o2($VC, [2, 67], { 64: 129, 66: $Vr, 67: $Vs, 68: $Vt, 69: $Vu, 70: $Vv }), o2($VC, [2, 66]), { 41: [1, 130] }, { 24: 95, 40: 131, 43: 23, 46: $V4 }, { 8: [1, 132], 41: [2, 36] }, o2($Vy, [2, 40], { 39: [1, 133] }), { 41: [1, 134] }, { 41: [2, 46], 45: 135, 49: $VF }, { 16: 39, 18: 136, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, o2($Vq, [2, 76], { 13: [1, 137] }), o2($Vq, [2, 78], { 13: [1, 139], 75: [1, 138] }), o2($Vq, [2, 82], { 13: [1, 140], 78: [1, 141] }), { 13: [1, 142] }, o2($Vq, [2, 90], { 59: $VS }), o2($VT, [2, 92], { 83: 144, 22: $VG, 58: $VH, 80: $VI, 84: $VJ, 85: $VK, 86: $VL, 87: $VM, 88: $VN, 89: $VO }), o2($VU, [2, 94]), o2($VU, [2, 96]), o2($VU, [2, 97]), o2($VU, [2, 98]), o2($VU, [2, 99]), o2($VU, [2, 100]), o2($VU, [2, 101]), o2($VU, [2, 102]), o2($VU, [2, 103]), o2($VU, [2, 104]), o2($Vq, [2, 91]), o2($Vq, [2, 56]), o2($Vq, [2, 58], { 59: $VS }), { 58: [1, 145] }, o2($VA, [2, 13]), { 15: 146, 16: 84, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn }, { 39: [2, 11] }, o2($VQ, [2, 44]), { 13: [1, 147] }, { 1: [2, 4] }, o2($VR, [2, 54]), o2($VR, [2, 53]), { 16: 39, 18: 148, 19: 40, 58: $Vb, 84: $Vl, 99: $Vm, 101: $Vn, 102: $Vo }, o2($VC, [2, 65]), o2($Vq, [2, 33]), { 41: [1, 149] }, { 24: 95, 40: 150, 41: [2, 37], 43: 23, 46: $V4 }, { 45: 151, 49: $VF }, o2($Vy, [2, 41]), { 41: [2, 47] }, o2($Vq, [2, 45]), o2($Vq, [2, 77]), o2($Vq, [2, 79]), o2($Vq, [2, 80], { 75: [1, 152] }), o2($Vq, [2, 83]), o2($Vq, [2, 84], { 13: [1, 153] }), o2($Vq, [2, 86], { 13: [1, 155], 75: [1, 154] }), { 22: $VG, 58: $VH, 80: $VI, 82: 156, 83: 106, 84: $VJ, 85: $VK, 86: $VL, 87: $VM, 88: $VN, 89: $VO }, o2($VU, [2, 95]), o2($VP, [2, 60]), { 39: [2, 10] }, { 14: [1, 157] }, o2($VR, [2, 55]), o2($Vq, [2, 34]), { 41: [2, 38] }, { 41: [1, 158] }, o2($Vq, [2, 81]), o2($Vq, [2, 85]), o2($Vq, [2, 87]), o2($Vq, [2, 88], { 75: [1, 159] }), o2($VT, [2, 93], { 83: 144, 22: $VG, 58: $VH, 80: $VI, 84: $VJ, 85: $VK, 86: $VL, 87: $VM, 88: $VN, 89: $VO }), o2($VQ, [2, 8]), o2($Vy, [2, 42]), o2($Vq, [2, 89])],
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 3], 83: [2, 35], 122: [2, 11], 125: [2, 4], 135: [2, 47], 146: [2, 10], 150: [2, 38] },
parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
if (hash.recoverable) {
this.trace(str2);
@@ -85546,7 +91965,7 @@ ${content}`;
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -85576,7 +91995,7 @@ ${content}`;
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -85588,22 +92007,22 @@ ${content}`;
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -85622,7 +92041,7 @@ ${content}`;
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -85922,7 +92341,7 @@ ${content}`;
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -85973,16 +92392,16 @@ ${content}`;
var YYSTATE = YY_START;
switch ($avoiding_name_collisions) {
case 0:
- return 53;
+ return 60;
break;
case 1:
- return 54;
+ return 61;
break;
case 2:
- return 55;
+ return 62;
break;
case 3:
- return 56;
+ return 63;
break;
case 4:
break;
@@ -85990,7 +92409,7 @@ ${content}`;
break;
case 6:
this.begin("acc_title");
- return 31;
+ return 33;
break;
case 7:
this.popState();
@@ -85998,7 +92417,7 @@ ${content}`;
break;
case 8:
this.begin("acc_descr");
- return 33;
+ return 35;
break;
case 9:
this.popState();
@@ -86038,13 +92457,13 @@ ${content}`;
this.begin("callback_args");
break;
case 21:
- return 70;
+ return 77;
break;
case 22:
this.popState();
break;
case 23:
- return 71;
+ return 78;
break;
case 24:
this.popState();
@@ -86056,235 +92475,238 @@ ${content}`;
this.begin("string");
break;
case 27:
- return 73;
+ return 80;
break;
case 28:
- this.begin("namespace");
- return 40;
+ return 55;
break;
case 29:
- this.popState();
- return 8;
+ this.begin("namespace");
+ return 42;
break;
case 30:
+ this.popState();
+ return 8;
break;
case 31:
- this.begin("namespace-body");
- return 37;
break;
case 32:
- this.popState();
+ this.begin("namespace-body");
return 39;
break;
case 33:
- return "EOF_IN_STRUCT";
+ this.popState();
+ return 41;
break;
case 34:
- return 8;
+ return "EOF_IN_STRUCT";
break;
case 35:
+ return 8;
break;
case 36:
- return "EDGE_STATE";
break;
case 37:
- this.begin("class");
- return 44;
+ return "EDGE_STATE";
break;
case 38:
- this.popState();
- return 8;
+ this.begin("class");
+ return 46;
break;
case 39:
+ this.popState();
+ return 8;
break;
case 40:
- this.popState();
- this.popState();
- return 39;
break;
case 41:
- this.begin("class-body");
- return 37;
+ this.popState();
+ this.popState();
+ return 41;
break;
case 42:
- this.popState();
+ this.begin("class-body");
return 39;
break;
case 43:
- return "EOF_IN_STRUCT";
+ this.popState();
+ return 41;
break;
case 44:
- return "EDGE_STATE";
+ return "EOF_IN_STRUCT";
break;
case 45:
- return "OPEN_IN_STRUCT";
+ return "EDGE_STATE";
break;
case 46:
+ return "OPEN_IN_STRUCT";
break;
case 47:
- return "MEMBER";
break;
case 48:
- return 76;
+ return "MEMBER";
break;
case 49:
- return 66;
+ return 81;
break;
case 50:
- return 67;
+ return 73;
break;
case 51:
- return 69;
+ return 74;
break;
case 52:
- return 50;
+ return 76;
break;
case 53:
return 52;
break;
case 54:
- return 45;
+ return 54;
break;
case 55:
- return 46;
+ return 47;
break;
case 56:
- return 72;
+ return 48;
break;
case 57:
- this.popState();
+ return 79;
break;
case 58:
- return "GENERICTYPE";
+ this.popState();
break;
case 59:
- this.begin("generic");
+ return "GENERICTYPE";
break;
case 60:
- this.popState();
+ this.begin("generic");
break;
case 61:
- return "BQUOTE_STR";
+ this.popState();
break;
case 62:
- this.begin("bqstring");
+ return "BQUOTE_STR";
break;
case 63:
- return 68;
+ this.begin("bqstring");
break;
case 64:
- return 68;
+ return 75;
break;
case 65:
- return 68;
+ return 75;
break;
case 66:
- return 68;
+ return 75;
break;
case 67:
- return 60;
+ return 75;
break;
case 68:
- return 60;
+ return 67;
break;
case 69:
- return 62;
+ return 67;
break;
case 70:
- return 62;
+ return 69;
break;
case 71:
- return 61;
+ return 69;
break;
case 72:
- return 59;
+ return 68;
break;
case 73:
- return 63;
+ return 66;
break;
case 74:
- return 64;
+ return 70;
break;
case 75:
- return 65;
+ return 71;
break;
case 76:
- return 21;
+ return 72;
break;
case 77:
- return 42;
+ return 22;
break;
case 78:
- return 95;
+ return 44;
break;
case 79:
- return "DOT";
+ return 99;
break;
case 80:
- return "PLUS";
+ return 17;
break;
case 81:
- return 81;
+ return "PLUS";
break;
case 82:
- return 78;
+ return 85;
break;
case 83:
- return 84;
+ return 59;
break;
case 84:
- return 84;
+ return 88;
break;
case 85:
- return 85;
+ return 88;
break;
case 86:
- return "EQUALS";
+ return 89;
break;
case 87:
return "EQUALS";
break;
case 88:
- return 74;
+ return "EQUALS";
break;
case 89:
- return 12;
+ return 58;
break;
case 90:
- return 14;
+ return 12;
break;
case 91:
- return "PUNCTUATION";
+ return 14;
break;
case 92:
- return 80;
+ return "PUNCTUATION";
break;
case 93:
- return 97;
+ return 84;
break;
case 94:
- return 83;
+ return 101;
break;
case 95:
- return 83;
+ return 87;
break;
case 96:
+ return 87;
+ break;
+ case 97:
return 9;
break;
}
}, "anonymous"),
- rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:classDiagram-v2\b)/, /^(?:classDiagram\b)/, /^(?:\[\*\])/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:["])/, /^(?:[^"]*)/, /^(?:["])/, /^(?:style\b)/, /^(?:namespace\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:\[\*\])/, /^(?:class\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[}])/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\[\*\])/, /^(?:[{])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:note for\b)/, /^(?:note\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:href\b)/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:~)/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:[`])/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:\s*\(\))/, /^(?:--)/, /^(?:\.\.)/, /^(?::{1}[^:\n;]+)/, /^(?::{3})/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?::)/, /^(?:,)/, /^(?:#)/, /^(?:#)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:\w+)/, /^(?:\[)/, /^(?:\])/, /^(?:[!"#$%&'*+,-.`?\\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:\s)/, /^(?:$)/],
- conditions: { "namespace-body": { "rules": [26, 32, 33, 34, 35, 36, 37, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "namespace": { "rules": [26, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "class-body": { "rules": [26, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "class": { "rules": [26, 38, 39, 40, 41, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_descr": { "rules": [9, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_title": { "rules": [7, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "callback_args": { "rules": [22, 23, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "callback_name": { "rules": [19, 20, 21, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "href": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "struct": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "generic": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "bqstring": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "string": { "rules": [24, 25, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 26, 27, 28, 37, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96], "inclusive": true } }
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:classDiagram-v2\b)/, /^(?:classDiagram\b)/, /^(?:\[\*\])/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:["])/, /^(?:[^"]*)/, /^(?:["])/, /^(?:style\b)/, /^(?:classDef\b)/, /^(?:namespace\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:\[\*\])/, /^(?:class\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[}])/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\[\*\])/, /^(?:[{])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:note for\b)/, /^(?:note\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:href\b)/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:~)/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:[`])/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:\s*\(\))/, /^(?:--)/, /^(?:\.\.)/, /^(?::{1}[^:\n;]+)/, /^(?::{3})/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?::)/, /^(?:,)/, /^(?:#)/, /^(?:#)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:\w+)/, /^(?:\[)/, /^(?:\])/, /^(?:[!"#$%&'*+,-.`?\\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:\s)/, /^(?:$)/],
+ conditions: { "namespace-body": { "rules": [26, 33, 34, 35, 36, 37, 38, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "namespace": { "rules": [26, 29, 30, 31, 32, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "class-body": { "rules": [26, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "class": { "rules": [26, 39, 40, 41, 42, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "acc_descr": { "rules": [9, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "acc_title": { "rules": [7, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "callback_args": { "rules": [22, 23, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "callback_name": { "rules": [19, 20, 21, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "href": { "rules": [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "struct": { "rules": [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "generic": { "rules": [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "bqstring": { "rules": [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "string": { "rules": [24, 25, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 26, 27, 28, 29, 38, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97], "inclusive": true } }
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser13.parser = parser13;
@@ -86308,6 +92730,7 @@ ${content}`;
this.memberType = memberType;
this.visibility = "";
this.classifier = "";
+ this.text = "";
const sanitizedInput = sanitizeText(input, getConfig2());
this.parseMember(sanitizedInput);
}
@@ -86336,7 +92759,7 @@ ${content}`;
if (visibilityValues.includes(detectedVisibility)) {
this.visibility = detectedVisibility;
}
- this.id = match2[2].trim();
+ this.id = match2[2];
this.parameters = match2[3] ? match2[3].trim() : "";
potentialClassifier = match2[4] ? match2[4].trim() : "";
this.returnType = match2[5] ? match2[5].trim() : "";
@@ -86364,6 +92787,12 @@ ${content}`;
);
}
this.classifier = potentialClassifier;
+ this.id = this.id.startsWith(" ") ? " " + this.id.trim() : this.id.trim();
+ const combinedText = `${this.visibility ? "\\" + this.visibility : ""}${parseGenericTypes(this.id)}${this.memberType === "method" ? `(${parseGenericTypes(this.parameters)})${this.returnType ? " : " + parseGenericTypes(this.returnType) : ""}` : ""}`;
+ this.text = combinedText.replaceAll("<", "<").replaceAll(">", ">");
+ if (this.text.startsWith("\\<")) {
+ this.text = this.text.replace("\\<", "~");
+ }
}
parseClassifier() {
switch (this.classifier) {
@@ -86380,7 +92809,7 @@ ${content}`;
});
// src/diagrams/class/classDb.ts
- var MERMAID_DOM_ID_PREFIX2, relations2, classes2, notes, classCounter, namespaces, namespaceCounter, functions2, sanitizeText5, splitClassNameAndType, setClassLabel, addClass3, lookUpDomId2, clear18, getClass, getClasses3, getRelations, getNotes, addRelation, addAnnotation, addMember, addMembers, addNote2, cleanupLabel, setCssClass, setTooltip2, getTooltip2, setLink3, setClickEvent3, setClickFunc, bindFunctions3, lineType, relationType, setupToolTips2, direction2, getDirection3, setDirection3, addNamespace, getNamespace, getNamespaces, addClassesToNamespace, setCssStyle, classDb_default;
+ var MERMAID_DOM_ID_PREFIX2, classCounter, sanitizeText4, ClassDB;
var init_classDb = __esm({
"src/diagrams/class/classDb.ts"() {
"use strict";
@@ -86392,349 +92821,612 @@ ${content}`;
init_commonDb();
init_classTypes();
MERMAID_DOM_ID_PREFIX2 = "classId-";
- relations2 = [];
- classes2 = /* @__PURE__ */ new Map();
- notes = [];
classCounter = 0;
- namespaces = /* @__PURE__ */ new Map();
- namespaceCounter = 0;
- functions2 = [];
- sanitizeText5 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText");
- splitClassNameAndType = /* @__PURE__ */ __name(function(_id) {
- const id27 = common_default.sanitizeText(_id, getConfig2());
- let genericType = "";
- let className = id27;
- if (id27.indexOf("~") > 0) {
- const split = id27.split("~");
- className = sanitizeText5(split[0]);
- genericType = sanitizeText5(split[1]);
- }
- return { className, type: genericType };
- }, "splitClassNameAndType");
- setClassLabel = /* @__PURE__ */ __name(function(_id, label) {
- const id27 = common_default.sanitizeText(_id, getConfig2());
- if (label) {
- label = sanitizeText5(label);
- }
- const { className } = splitClassNameAndType(id27);
- classes2.get(className).label = label;
- }, "setClassLabel");
- addClass3 = /* @__PURE__ */ __name(function(_id) {
- const id27 = common_default.sanitizeText(_id, getConfig2());
- const { className, type: type3 } = splitClassNameAndType(id27);
- if (classes2.has(className)) {
- return;
+ sanitizeText4 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText");
+ ClassDB = class {
+ constructor() {
+ this.relations = [];
+ this.classes = /* @__PURE__ */ new Map();
+ this.styleClasses = /* @__PURE__ */ new Map();
+ this.notes = [];
+ this.interfaces = [];
+ // private static classCounter = 0;
+ this.namespaces = /* @__PURE__ */ new Map();
+ this.namespaceCounter = 0;
+ this.functions = [];
+ this.lineType = {
+ LINE: 0,
+ DOTTED_LINE: 1
+ };
+ this.relationType = {
+ AGGREGATION: 0,
+ EXTENSION: 1,
+ COMPOSITION: 2,
+ DEPENDENCY: 3,
+ LOLLIPOP: 4
+ };
+ this.setupToolTips = /* @__PURE__ */ __name((element3) => {
+ let tooltipElem = select_default2(".mermaidTooltip");
+ if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
+ tooltipElem = select_default2("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0);
+ }
+ const svg2 = select_default2(element3).select("svg");
+ const nodes6 = svg2.selectAll("g.node");
+ nodes6.on("mouseover", (event3) => {
+ const el = select_default2(event3.currentTarget);
+ const title2 = el.attr("title");
+ if (title2 === null) {
+ return;
+ }
+ const rect3 = this.getBoundingClientRect();
+ tooltipElem.transition().duration(200).style("opacity", ".9");
+ tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect3.left + (rect3.right - rect3.left) / 2 + "px").style("top", window.scrollY + rect3.top - 14 + document.body.scrollTop + "px");
+ tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, " "));
+ el.classed("hover", true);
+ }).on("mouseout", (event3) => {
+ tooltipElem.transition().duration(500).style("opacity", 0);
+ const el = select_default2(event3.currentTarget);
+ el.classed("hover", false);
+ });
+ }, "setupToolTips");
+ this.direction = "TB";
+ this.setAccTitle = setAccTitle;
+ this.getAccTitle = getAccTitle;
+ this.setAccDescription = setAccDescription;
+ this.getAccDescription = getAccDescription;
+ this.setDiagramTitle = setDiagramTitle;
+ this.getDiagramTitle = getDiagramTitle;
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().class, "getConfig");
+ this.functions.push(this.setupToolTips.bind(this));
+ this.clear();
+ this.addRelation = this.addRelation.bind(this);
+ this.addClassesToNamespace = this.addClassesToNamespace.bind(this);
+ this.addNamespace = this.addNamespace.bind(this);
+ this.setCssClass = this.setCssClass.bind(this);
+ this.addMembers = this.addMembers.bind(this);
+ this.addClass = this.addClass.bind(this);
+ this.setClassLabel = this.setClassLabel.bind(this);
+ this.addAnnotation = this.addAnnotation.bind(this);
+ this.addMember = this.addMember.bind(this);
+ this.cleanupLabel = this.cleanupLabel.bind(this);
+ this.addNote = this.addNote.bind(this);
+ this.defineClass = this.defineClass.bind(this);
+ this.setDirection = this.setDirection.bind(this);
+ this.setLink = this.setLink.bind(this);
+ this.bindFunctions = this.bindFunctions.bind(this);
+ this.clear = this.clear.bind(this);
+ this.setTooltip = this.setTooltip.bind(this);
+ this.setClickEvent = this.setClickEvent.bind(this);
+ this.setCssStyle = this.setCssStyle.bind(this);
}
- const name = common_default.sanitizeText(className, getConfig2());
- classes2.set(name, {
- id: name,
- type: type3,
- label: name,
- cssClasses: [],
- methods: [],
- members: [],
- annotations: [],
- styles: [],
- domId: MERMAID_DOM_ID_PREFIX2 + name + "-" + classCounter
- });
- classCounter++;
- }, "addClass");
- lookUpDomId2 = /* @__PURE__ */ __name(function(_id) {
- const id27 = common_default.sanitizeText(_id, getConfig2());
- if (classes2.has(id27)) {
- return classes2.get(id27).domId;
- }
- throw new Error("Class not found: " + id27);
- }, "lookUpDomId");
- clear18 = /* @__PURE__ */ __name(function() {
- relations2 = [];
- classes2 = /* @__PURE__ */ new Map();
- notes = [];
- functions2 = [];
- functions2.push(setupToolTips2);
- namespaces = /* @__PURE__ */ new Map();
- namespaceCounter = 0;
- direction2 = "TB";
- clear();
- }, "clear");
- getClass = /* @__PURE__ */ __name(function(id27) {
- return classes2.get(id27);
- }, "getClass");
- getClasses3 = /* @__PURE__ */ __name(function() {
- return classes2;
- }, "getClasses");
- getRelations = /* @__PURE__ */ __name(function() {
- return relations2;
- }, "getRelations");
- getNotes = /* @__PURE__ */ __name(function() {
- return notes;
- }, "getNotes");
- addRelation = /* @__PURE__ */ __name(function(relation) {
- log.debug("Adding relation: " + JSON.stringify(relation));
- addClass3(relation.id1);
- addClass3(relation.id2);
- relation.id1 = splitClassNameAndType(relation.id1).className;
- relation.id2 = splitClassNameAndType(relation.id2).className;
- relation.relationTitle1 = common_default.sanitizeText(relation.relationTitle1.trim(), getConfig2());
- relation.relationTitle2 = common_default.sanitizeText(relation.relationTitle2.trim(), getConfig2());
- relations2.push(relation);
- }, "addRelation");
- addAnnotation = /* @__PURE__ */ __name(function(className, annotation) {
- const validatedClassName = splitClassNameAndType(className).className;
- classes2.get(validatedClassName).annotations.push(annotation);
- }, "addAnnotation");
- addMember = /* @__PURE__ */ __name(function(className, member) {
- addClass3(className);
- const validatedClassName = splitClassNameAndType(className).className;
- const theClass = classes2.get(validatedClassName);
- if (typeof member === "string") {
- const memberString = member.trim();
- if (memberString.startsWith("<<") && memberString.endsWith(">>")) {
- theClass.annotations.push(sanitizeText5(memberString.substring(2, memberString.length - 2)));
- } else if (memberString.indexOf(")") > 0) {
- theClass.methods.push(new ClassMember(memberString, "method"));
- } else if (memberString) {
- theClass.members.push(new ClassMember(memberString, "attribute"));
- }
- }
- }, "addMember");
- addMembers = /* @__PURE__ */ __name(function(className, members) {
- if (Array.isArray(members)) {
- members.reverse();
- members.forEach((member) => addMember(className, member));
- }
- }, "addMembers");
- addNote2 = /* @__PURE__ */ __name(function(text2, className) {
- const note3 = {
- id: `note${notes.length}`,
- class: className,
- text: text2
- };
- notes.push(note3);
- }, "addNote");
- cleanupLabel = /* @__PURE__ */ __name(function(label) {
- if (label.startsWith(":")) {
- label = label.substring(1);
- }
- return sanitizeText5(label.trim());
- }, "cleanupLabel");
- setCssClass = /* @__PURE__ */ __name(function(ids, className) {
- ids.split(",").forEach(function(_id) {
- let id27 = _id;
- if (/\d/.exec(_id[0])) {
- id27 = MERMAID_DOM_ID_PREFIX2 + id27;
- }
- const classNode = classes2.get(id27);
- if (classNode) {
- classNode.cssClasses.push(className);
+ static {
+ __name(this, "ClassDB");
+ }
+ splitClassNameAndType(_id) {
+ const id29 = common_default.sanitizeText(_id, getConfig2());
+ let genericType = "";
+ let className = id29;
+ if (id29.indexOf("~") > 0) {
+ const split = id29.split("~");
+ className = sanitizeText4(split[0]);
+ genericType = sanitizeText4(split[1]);
}
- });
- }, "setCssClass");
- setTooltip2 = /* @__PURE__ */ __name(function(ids, tooltip) {
- ids.split(",").forEach(function(id27) {
- if (tooltip !== void 0) {
- classes2.get(id27).tooltip = sanitizeText5(tooltip);
+ return { className, type: genericType };
+ }
+ setClassLabel(_id, label) {
+ const id29 = common_default.sanitizeText(_id, getConfig2());
+ if (label) {
+ label = sanitizeText4(label);
}
- });
- }, "setTooltip");
- getTooltip2 = /* @__PURE__ */ __name(function(id27, namespace) {
- if (namespace && namespaces.has(namespace)) {
- return namespaces.get(namespace).classes.get(id27).tooltip;
- }
- return classes2.get(id27).tooltip;
- }, "getTooltip");
- setLink3 = /* @__PURE__ */ __name(function(ids, linkStr, target) {
- const config6 = getConfig2();
- ids.split(",").forEach(function(_id) {
- let id27 = _id;
- if (/\d/.exec(_id[0])) {
- id27 = MERMAID_DOM_ID_PREFIX2 + id27;
- }
- const theClass = classes2.get(id27);
- if (theClass) {
- theClass.link = utils_default2.formatUrl(linkStr, config6);
- if (config6.securityLevel === "sandbox") {
- theClass.linkTarget = "_top";
- } else if (typeof target === "string") {
- theClass.linkTarget = sanitizeText5(target);
- } else {
- theClass.linkTarget = "_blank";
+ const { className } = this.splitClassNameAndType(id29);
+ this.classes.get(className).label = label;
+ this.classes.get(className).text = `${label}${this.classes.get(className).type ? `<${this.classes.get(className).type}>` : ""}`;
+ }
+ /**
+ * Function called by parser when a node definition has been found.
+ *
+ * @param id - Id of the class to add
+ * @public
+ */
+ addClass(_id) {
+ const id29 = common_default.sanitizeText(_id, getConfig2());
+ const { className, type: type3 } = this.splitClassNameAndType(id29);
+ if (this.classes.has(className)) {
+ return;
+ }
+ const name = common_default.sanitizeText(className, getConfig2());
+ this.classes.set(name, {
+ id: name,
+ type: type3,
+ label: name,
+ text: `${name}${type3 ? `<${type3}>` : ""}`,
+ shape: "classBox",
+ cssClasses: "default",
+ methods: [],
+ members: [],
+ annotations: [],
+ styles: [],
+ domId: MERMAID_DOM_ID_PREFIX2 + name + "-" + classCounter
+ });
+ classCounter++;
+ }
+ addInterface(label, classId) {
+ const classInterface = {
+ id: `interface${this.interfaces.length}`,
+ label,
+ classId
+ };
+ this.interfaces.push(classInterface);
+ }
+ /**
+ * Function to lookup domId from id in the graph definition.
+ *
+ * @param id - class ID to lookup
+ * @public
+ */
+ lookUpDomId(_id) {
+ const id29 = common_default.sanitizeText(_id, getConfig2());
+ if (this.classes.has(id29)) {
+ return this.classes.get(id29).domId;
+ }
+ throw new Error("Class not found: " + id29);
+ }
+ clear() {
+ this.relations = [];
+ this.classes = /* @__PURE__ */ new Map();
+ this.notes = [];
+ this.interfaces = [];
+ this.functions = [];
+ this.functions.push(this.setupToolTips.bind(this));
+ this.namespaces = /* @__PURE__ */ new Map();
+ this.namespaceCounter = 0;
+ this.direction = "TB";
+ clear();
+ }
+ getClass(id29) {
+ return this.classes.get(id29);
+ }
+ getClasses() {
+ return this.classes;
+ }
+ getRelations() {
+ return this.relations;
+ }
+ getNotes() {
+ return this.notes;
+ }
+ addRelation(classRelation) {
+ log.debug("Adding relation: " + JSON.stringify(classRelation));
+ const invalidTypes = [
+ this.relationType.LOLLIPOP,
+ this.relationType.AGGREGATION,
+ this.relationType.COMPOSITION,
+ this.relationType.DEPENDENCY,
+ this.relationType.EXTENSION
+ ];
+ if (classRelation.relation.type1 === this.relationType.LOLLIPOP && !invalidTypes.includes(classRelation.relation.type2)) {
+ this.addClass(classRelation.id2);
+ this.addInterface(classRelation.id1, classRelation.id2);
+ classRelation.id1 = `interface${this.interfaces.length - 1}`;
+ } else if (classRelation.relation.type2 === this.relationType.LOLLIPOP && !invalidTypes.includes(classRelation.relation.type1)) {
+ this.addClass(classRelation.id1);
+ this.addInterface(classRelation.id2, classRelation.id1);
+ classRelation.id2 = `interface${this.interfaces.length - 1}`;
+ } else {
+ this.addClass(classRelation.id1);
+ this.addClass(classRelation.id2);
+ }
+ classRelation.id1 = this.splitClassNameAndType(classRelation.id1).className;
+ classRelation.id2 = this.splitClassNameAndType(classRelation.id2).className;
+ classRelation.relationTitle1 = common_default.sanitizeText(
+ classRelation.relationTitle1.trim(),
+ getConfig2()
+ );
+ classRelation.relationTitle2 = common_default.sanitizeText(
+ classRelation.relationTitle2.trim(),
+ getConfig2()
+ );
+ this.relations.push(classRelation);
+ }
+ /**
+ * Adds an annotation to the specified class Annotations mark special properties of the given type
+ * (like 'interface' or 'service')
+ *
+ * @param className - The class name
+ * @param annotation - The name of the annotation without any brackets
+ * @public
+ */
+ addAnnotation(className, annotation) {
+ const validatedClassName = this.splitClassNameAndType(className).className;
+ this.classes.get(validatedClassName).annotations.push(annotation);
+ }
+ /**
+ * Adds a member to the specified class
+ *
+ * @param className - The class name
+ * @param member - The full name of the member. If the member is enclosed in `<>` it is
+ * treated as an annotation If the member is ending with a closing bracket ) it is treated as a
+ * method Otherwise the member will be treated as a normal property
+ * @public
+ */
+ addMember(className, member) {
+ this.addClass(className);
+ const validatedClassName = this.splitClassNameAndType(className).className;
+ const theClass = this.classes.get(validatedClassName);
+ if (typeof member === "string") {
+ const memberString = member.trim();
+ if (memberString.startsWith("<<") && memberString.endsWith(">>")) {
+ theClass.annotations.push(sanitizeText4(memberString.substring(2, memberString.length - 2)));
+ } else if (memberString.indexOf(")") > 0) {
+ theClass.methods.push(new ClassMember(memberString, "method"));
+ } else if (memberString) {
+ theClass.members.push(new ClassMember(memberString, "attribute"));
+ }
+ }
+ }
+ addMembers(className, members) {
+ if (Array.isArray(members)) {
+ members.reverse();
+ members.forEach((member) => this.addMember(className, member));
+ }
+ }
+ addNote(text4, className) {
+ const note3 = {
+ id: `note${this.notes.length}`,
+ class: className,
+ text: text4
+ };
+ this.notes.push(note3);
+ }
+ cleanupLabel(label) {
+ if (label.startsWith(":")) {
+ label = label.substring(1);
+ }
+ return sanitizeText4(label.trim());
+ }
+ /**
+ * Called by parser when assigning cssClass to a class
+ *
+ * @param ids - Comma separated list of ids
+ * @param className - Class to add
+ */
+ setCssClass(ids, className) {
+ ids.split(",").forEach((_id) => {
+ let id29 = _id;
+ if (/\d/.exec(_id[0])) {
+ id29 = MERMAID_DOM_ID_PREFIX2 + id29;
+ }
+ const classNode = this.classes.get(id29);
+ if (classNode) {
+ classNode.cssClasses += " " + className;
+ }
+ });
+ }
+ defineClass(ids, style3) {
+ for (const id29 of ids) {
+ let styleClass = this.styleClasses.get(id29);
+ if (styleClass === void 0) {
+ styleClass = { id: id29, styles: [], textStyles: [] };
+ this.styleClasses.set(id29, styleClass);
+ }
+ if (style3) {
+ style3.forEach((s2) => {
+ if (/color/.exec(s2)) {
+ const newStyle = s2.replace("fill", "bgFill");
+ styleClass.textStyles.push(newStyle);
+ }
+ styleClass.styles.push(s2);
+ });
}
+ this.classes.forEach((value2) => {
+ if (value2.cssClasses.includes(id29)) {
+ value2.styles.push(...style3.flatMap((s2) => s2.split(",")));
+ }
+ });
}
- });
- setCssClass(ids, "clickable");
- }, "setLink");
- setClickEvent3 = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) {
- ids.split(",").forEach(function(id27) {
- setClickFunc(id27, functionName, functionArgs);
- classes2.get(id27).haveCallback = true;
- });
- setCssClass(ids, "clickable");
- }, "setClickEvent");
- setClickFunc = /* @__PURE__ */ __name(function(_domId, functionName, functionArgs) {
- const domId = common_default.sanitizeText(_domId, getConfig2());
- const config6 = getConfig2();
- if (config6.securityLevel !== "loose") {
- return;
}
- if (functionName === void 0) {
- return;
+ /**
+ * Called by parser when a tooltip is found, e.g. a clickable element.
+ *
+ * @param ids - Comma separated list of ids
+ * @param tooltip - Tooltip to add
+ */
+ setTooltip(ids, tooltip) {
+ ids.split(",").forEach((id29) => {
+ if (tooltip !== void 0) {
+ this.classes.get(id29).tooltip = sanitizeText4(tooltip);
+ }
+ });
}
- const id27 = domId;
- if (classes2.has(id27)) {
- const elemId = lookUpDomId2(id27);
- let argList = [];
- if (typeof functionArgs === "string") {
- argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
- for (let i2 = 0; i2 < argList.length; i2++) {
- let item = argList[i2].trim();
- if (item.startsWith('"') && item.endsWith('"')) {
- item = item.substr(1, item.length - 2);
+ getTooltip(id29, namespace) {
+ if (namespace && this.namespaces.has(namespace)) {
+ return this.namespaces.get(namespace).classes.get(id29).tooltip;
+ }
+ return this.classes.get(id29).tooltip;
+ }
+ /**
+ * Called by parser when a link is found. Adds the URL to the vertex data.
+ *
+ * @param ids - Comma separated list of ids
+ * @param linkStr - URL to create a link for
+ * @param target - Target of the link, _blank by default as originally defined in the svgDraw.js file
+ */
+ setLink(ids, linkStr, target) {
+ const config5 = getConfig2();
+ ids.split(",").forEach((_id) => {
+ let id29 = _id;
+ if (/\d/.exec(_id[0])) {
+ id29 = MERMAID_DOM_ID_PREFIX2 + id29;
+ }
+ const theClass = this.classes.get(id29);
+ if (theClass) {
+ theClass.link = utils_default2.formatUrl(linkStr, config5);
+ if (config5.securityLevel === "sandbox") {
+ theClass.linkTarget = "_top";
+ } else if (typeof target === "string") {
+ theClass.linkTarget = sanitizeText4(target);
+ } else {
+ theClass.linkTarget = "_blank";
}
- argList[i2] = item;
}
+ });
+ this.setCssClass(ids, "clickable");
+ }
+ /**
+ * Called by parser when a click definition is found. Registers an event handler.
+ *
+ * @param ids - Comma separated list of ids
+ * @param functionName - Function to be called on click
+ * @param functionArgs - Function args the function should be called with
+ */
+ setClickEvent(ids, functionName, functionArgs) {
+ ids.split(",").forEach((id29) => {
+ this.setClickFunc(id29, functionName, functionArgs);
+ this.classes.get(id29).haveCallback = true;
+ });
+ this.setCssClass(ids, "clickable");
+ }
+ setClickFunc(_domId, functionName, functionArgs) {
+ const domId = common_default.sanitizeText(_domId, getConfig2());
+ const config5 = getConfig2();
+ if (config5.securityLevel !== "loose") {
+ return;
}
- if (argList.length === 0) {
- argList.push(elemId);
+ if (functionName === void 0) {
+ return;
}
- functions2.push(function() {
- const elem = document.querySelector(`[id="${elemId}"]`);
- if (elem !== null) {
- elem.addEventListener(
- "click",
- function() {
- utils_default2.runFunc(functionName, ...argList);
- },
- false
- );
- }
+ const id29 = domId;
+ if (this.classes.has(id29)) {
+ const elemId = this.lookUpDomId(id29);
+ let argList = [];
+ if (typeof functionArgs === "string") {
+ argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
+ for (let i2 = 0; i2 < argList.length; i2++) {
+ let item = argList[i2].trim();
+ if (item.startsWith('"') && item.endsWith('"')) {
+ item = item.substr(1, item.length - 2);
+ }
+ argList[i2] = item;
+ }
+ }
+ if (argList.length === 0) {
+ argList.push(elemId);
+ }
+ this.functions.push(() => {
+ const elem = document.querySelector(`[id="${elemId}"]`);
+ if (elem !== null) {
+ elem.addEventListener(
+ "click",
+ () => {
+ utils_default2.runFunc(functionName, ...argList);
+ },
+ false
+ );
+ }
+ });
+ }
+ }
+ bindFunctions(element3) {
+ this.functions.forEach((fun) => {
+ fun(element3);
});
}
- }, "setClickFunc");
- bindFunctions3 = /* @__PURE__ */ __name(function(element3) {
- functions2.forEach(function(fun) {
- fun(element3);
- });
- }, "bindFunctions");
- lineType = {
- LINE: 0,
- DOTTED_LINE: 1
- };
- relationType = {
- AGGREGATION: 0,
- EXTENSION: 1,
- COMPOSITION: 2,
- DEPENDENCY: 3,
- LOLLIPOP: 4
- };
- setupToolTips2 = /* @__PURE__ */ __name(function(element3) {
- let tooltipElem = select_default2(".mermaidTooltip");
- if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
- tooltipElem = select_default2("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0);
- }
- const svg = select_default2(element3).select("svg");
- const nodes6 = svg.selectAll("g.node");
- nodes6.on("mouseover", function() {
- const el = select_default2(this);
- const title2 = el.attr("title");
- if (title2 === null) {
+ getDirection() {
+ return this.direction;
+ }
+ setDirection(dir2) {
+ this.direction = dir2;
+ }
+ /**
+ * Function called by parser when a namespace definition has been found.
+ *
+ * @param id - Id of the namespace to add
+ * @public
+ */
+ addNamespace(id29) {
+ if (this.namespaces.has(id29)) {
return;
}
- const rect4 = this.getBoundingClientRect();
- tooltipElem.transition().duration(200).style("opacity", ".9");
- tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect4.left + (rect4.right - rect4.left) / 2 + "px").style("top", window.scrollY + rect4.top - 14 + document.body.scrollTop + "px");
- tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, " "));
- el.classed("hover", true);
- }).on("mouseout", function() {
- tooltipElem.transition().duration(500).style("opacity", 0);
- const el = select_default2(this);
- el.classed("hover", false);
- });
- }, "setupToolTips");
- functions2.push(setupToolTips2);
- direction2 = "TB";
- getDirection3 = /* @__PURE__ */ __name(() => direction2, "getDirection");
- setDirection3 = /* @__PURE__ */ __name((dir2) => {
- direction2 = dir2;
- }, "setDirection");
- addNamespace = /* @__PURE__ */ __name(function(id27) {
- if (namespaces.has(id27)) {
- return;
+ this.namespaces.set(id29, {
+ id: id29,
+ classes: /* @__PURE__ */ new Map(),
+ children: {},
+ domId: MERMAID_DOM_ID_PREFIX2 + id29 + "-" + this.namespaceCounter
+ });
+ this.namespaceCounter++;
}
- namespaces.set(id27, {
- id: id27,
- classes: /* @__PURE__ */ new Map(),
- children: {},
- domId: MERMAID_DOM_ID_PREFIX2 + id27 + "-" + namespaceCounter
- });
- namespaceCounter++;
- }, "addNamespace");
- getNamespace = /* @__PURE__ */ __name(function(name) {
- return namespaces.get(name);
- }, "getNamespace");
- getNamespaces = /* @__PURE__ */ __name(function() {
- return namespaces;
- }, "getNamespaces");
- addClassesToNamespace = /* @__PURE__ */ __name(function(id27, classNames) {
- if (!namespaces.has(id27)) {
- return;
+ getNamespace(name) {
+ return this.namespaces.get(name);
}
- for (const name of classNames) {
- const { className } = splitClassNameAndType(name);
- classes2.get(className).parent = id27;
- namespaces.get(id27).classes.set(className, classes2.get(className));
+ getNamespaces() {
+ return this.namespaces;
}
- }, "addClassesToNamespace");
- setCssStyle = /* @__PURE__ */ __name(function(id27, styles3) {
- const thisClass = classes2.get(id27);
- if (!styles3 || !thisClass) {
- return;
+ /**
+ * Function called by parser when a namespace definition has been found.
+ *
+ * @param id - Id of the namespace to add
+ * @param classNames - Ids of the class to add
+ * @public
+ */
+ addClassesToNamespace(id29, classNames) {
+ if (!this.namespaces.has(id29)) {
+ return;
+ }
+ for (const name of classNames) {
+ const { className } = this.splitClassNameAndType(name);
+ this.classes.get(className).parent = id29;
+ this.namespaces.get(id29).classes.set(className, this.classes.get(className));
+ }
}
- for (const s2 of styles3) {
- if (s2.includes(",")) {
- thisClass.styles.push(...s2.split(","));
- } else {
- thisClass.styles.push(s2);
+ setCssStyle(id29, styles4) {
+ const thisClass = this.classes.get(id29);
+ if (!styles4 || !thisClass) {
+ return;
+ }
+ for (const s2 of styles4) {
+ if (s2.includes(",")) {
+ thisClass.styles.push(...s2.split(","));
+ } else {
+ thisClass.styles.push(s2);
+ }
}
}
- }, "setCssStyle");
- classDb_default = {
- setAccTitle,
- getAccTitle,
- getAccDescription,
- setAccDescription,
- getConfig: /* @__PURE__ */ __name(() => getConfig2().class, "getConfig"),
- addClass: addClass3,
- bindFunctions: bindFunctions3,
- clear: clear18,
- getClass,
- getClasses: getClasses3,
- getNotes,
- addAnnotation,
- addNote: addNote2,
- getRelations,
- addRelation,
- getDirection: getDirection3,
- setDirection: setDirection3,
- addMember,
- addMembers,
- cleanupLabel,
- lineType,
- relationType,
- setClickEvent: setClickEvent3,
- setCssClass,
- setLink: setLink3,
- getTooltip: getTooltip2,
- setTooltip: setTooltip2,
- lookUpDomId: lookUpDomId2,
- setDiagramTitle,
- getDiagramTitle,
- setClassLabel,
- addNamespace,
- addClassesToNamespace,
- getNamespace,
- getNamespaces,
- setCssStyle
+ /**
+ * Gets the arrow marker for a type index
+ *
+ * @param type - The type to look for
+ * @returns The arrow marker
+ */
+ getArrowMarker(type3) {
+ let marker;
+ switch (type3) {
+ 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;
+ }
+ getData() {
+ const nodes6 = [];
+ const edges3 = [];
+ const config5 = getConfig2();
+ for (const namespaceKey of this.namespaces.keys()) {
+ const namespace = this.namespaces.get(namespaceKey);
+ if (namespace) {
+ const node2 = {
+ id: namespace.id,
+ label: namespace.id,
+ isGroup: true,
+ padding: config5.class.padding ?? 16,
+ // parent node must be one of [rect, roundedWithTitle, noteGroup, divider]
+ shape: "rect",
+ cssStyles: ["fill: none", "stroke: black"],
+ look: config5.look
+ };
+ nodes6.push(node2);
+ }
+ }
+ for (const classKey of this.classes.keys()) {
+ const classNode = this.classes.get(classKey);
+ if (classNode) {
+ const node2 = classNode;
+ node2.parentId = classNode.parent;
+ node2.look = config5.look;
+ nodes6.push(node2);
+ }
+ }
+ let cnt5 = 0;
+ for (const note3 of this.notes) {
+ cnt5++;
+ const noteNode = {
+ id: note3.id,
+ label: note3.text,
+ isGroup: false,
+ shape: "note",
+ padding: config5.class.padding ?? 6,
+ cssStyles: [
+ "text-align: left",
+ "white-space: nowrap",
+ `fill: ${config5.themeVariables.noteBkgColor}`,
+ `stroke: ${config5.themeVariables.noteBorderColor}`
+ ],
+ look: config5.look
+ };
+ nodes6.push(noteNode);
+ const noteClassId = this.classes.get(note3.class)?.id ?? "";
+ if (noteClassId) {
+ const edge = {
+ id: `edgeNote${cnt5}`,
+ start: note3.id,
+ end: noteClassId,
+ type: "normal",
+ thickness: "normal",
+ classes: "relation",
+ arrowTypeStart: "none",
+ arrowTypeEnd: "none",
+ arrowheadStyle: "",
+ labelStyle: [""],
+ style: ["fill: none"],
+ pattern: "dotted",
+ look: config5.look
+ };
+ edges3.push(edge);
+ }
+ }
+ for (const _interface of this.interfaces) {
+ const interfaceNode = {
+ id: _interface.id,
+ label: _interface.label,
+ isGroup: false,
+ shape: "rect",
+ cssStyles: ["opacity: 0;"],
+ look: config5.look
+ };
+ nodes6.push(interfaceNode);
+ }
+ cnt5 = 0;
+ for (const classRelation of this.relations) {
+ cnt5++;
+ const edge = {
+ id: getEdgeId(classRelation.id1, classRelation.id2, {
+ prefix: "id",
+ counter: cnt5
+ }),
+ start: classRelation.id1,
+ end: classRelation.id2,
+ type: "normal",
+ label: classRelation.title,
+ labelpos: "c",
+ thickness: "normal",
+ classes: "relation",
+ arrowTypeStart: this.getArrowMarker(classRelation.relation.type1),
+ arrowTypeEnd: this.getArrowMarker(classRelation.relation.type2),
+ startLabelRight: classRelation.relationTitle1 === "none" ? "" : classRelation.relationTitle1,
+ endLabelLeft: classRelation.relationTitle2 === "none" ? "" : classRelation.relationTitle2,
+ arrowheadStyle: "",
+ labelStyle: ["display: inline-block"],
+ style: classRelation.style || "",
+ pattern: classRelation.relation.lineType == 1 ? "dashed" : "solid",
+ look: config5.look
+ };
+ edges3.push(edge);
+ }
+ return { nodes: nodes6, edges: edges3, other: {}, config: config5, direction: this.getDirection() };
+ }
};
}
});
@@ -86765,6 +93457,10 @@ ${content}`;
.label text {
fill: ${options3.classText};
}
+
+.labelBkg {
+ background: ${options3.mainBkg};
+}
.edgeLabel .label span {
background: ${options3.mainBkg};
}
@@ -86903,362 +93599,58 @@ g.classGroup line {
}
});
- // src/diagrams/class/svgDraw.js
- var edgeCount, drawEdge, drawClass, getClassTitleString, drawNote2, addTspan, svgDraw_default3;
- var init_svgDraw3 = __esm({
- "src/diagrams/class/svgDraw.js"() {
+ // src/diagrams/class/classRenderer-v3-unified.ts
+ var getDir, getClasses2, draw12, classRenderer_v3_unified_default;
+ var init_classRenderer_v3_unified = __esm({
+ "src/diagrams/class/classRenderer-v3-unified.ts"() {
"use strict";
- init_src32();
- init_utils2();
+ init_diagramAPI();
init_logger();
- init_common();
- edgeCount = 0;
- drawEdge = /* @__PURE__ */ __name(function(elem, path4, relation, conf8, diagObj) {
- const getRelationType = /* @__PURE__ */ __name(function(type3) {
- switch (type3) {
- 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";
- }
- }, "getRelationType");
- path4.points = path4.points.filter((p3) => !Number.isNaN(p3.y));
- const lineData = path4.points;
- const lineFunction = line_default().x(function(d2) {
- return d2.x;
- }).y(function(d2) {
- return d2.y;
- }).curve(basis_default2);
- const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "relation");
- let url = "";
- if (conf8.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 x5, y5;
- const l2 = path4.points.length;
- let labelPosition = utils_default2.calcLabelPosition(path4.points);
- x5 = labelPosition.x;
- y5 = labelPosition.y;
- let p1_card_x, p1_card_y;
- let p2_card_x, p2_card_y;
- if (l2 % 2 !== 0 && l2 > 1) {
- let cardinality_1_point = utils_default2.calcCardinalityPosition(
- relation.relation.type1 !== "none",
- path4.points,
- path4.points[0]
- );
- let cardinality_2_point = utils_default2.calcCardinalityPosition(
- relation.relation.type2 !== "none",
- path4.points,
- path4.points[l2 - 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 g2 = elem.append("g").attr("class", "classLabel");
- const label = g2.append("text").attr("class", "label").attr("x", x5).attr("y", y5).attr("fill", "red").attr("text-anchor", "middle").text(relation.title);
- window.label = label;
- const bounds4 = label.node().getBBox();
- g2.insert("rect", ":first-child").attr("class", "box").attr("x", bounds4.x - conf8.padding / 2).attr("y", bounds4.y - conf8.padding / 2).attr("width", bounds4.width + conf8.padding).attr("height", bounds4.height + conf8.padding);
- }
- log.info("Rendering relation " + JSON.stringify(relation));
- if (relation.relationTitle1 !== void 0 && relation.relationTitle1 !== "none") {
- const g2 = elem.append("g").attr("class", "cardinality");
- g2.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 g2 = elem.append("g").attr("class", "cardinality");
- g2.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++;
- }, "drawEdge");
- drawClass = /* @__PURE__ */ __name(function(elem, classDef, conf8, diagObj) {
- log.debug("Rendering class ", classDef, conf8);
- const id27 = classDef.id;
- const classInfo = {
- id: id27,
- label: classDef.id,
- width: 0,
- height: 0
- };
- const g2 = elem.append("g").attr("id", diagObj.db.lookUpDomId(id27)).attr("class", "classGroup");
- let title2;
- if (classDef.link) {
- title2 = g2.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf8.textHeight + conf8.padding).attr("x", 0);
- } else {
- title2 = g2.append("text").attr("y", conf8.textHeight + conf8.padding).attr("x", 0);
+ init_insertElementsForSize();
+ init_render();
+ init_setupViewPortForSVG();
+ init_utils2();
+ getDir = /* @__PURE__ */ __name((parsedItem, defaultDir = "TB") => {
+ if (!parsedItem.doc) {
+ return defaultDir;
}
- let isFirst = true;
- classDef.annotations.forEach(function(member) {
- const titleText2 = title2.append("tspan").text("\xAB" + member + "\xBB");
- if (!isFirst) {
- titleText2.attr("dy", conf8.textHeight);
+ let dir2 = defaultDir;
+ for (const parsedItemDoc of parsedItem.doc) {
+ if (parsedItemDoc.stmt === "dir") {
+ dir2 = parsedItemDoc.value;
}
- isFirst = false;
- });
- let classTitleString = getClassTitleString(classDef);
- const classTitle = title2.append("tspan").text(classTitleString).attr("class", "title");
- if (!isFirst) {
- classTitle.attr("dy", conf8.textHeight);
- }
- const titleHeight = title2.node().getBBox().height;
- let membersLine;
- let membersBox;
- let methodsLine;
- if (classDef.members.length > 0) {
- membersLine = g2.append("line").attr("x1", 0).attr("y1", conf8.padding + titleHeight + conf8.dividerMargin / 2).attr("y2", conf8.padding + titleHeight + conf8.dividerMargin / 2);
- const members = g2.append("text").attr("x", conf8.padding).attr("y", titleHeight + conf8.dividerMargin + conf8.textHeight).attr("fill", "white").attr("class", "classText");
- isFirst = true;
- classDef.members.forEach(function(member) {
- addTspan(members, member, isFirst, conf8);
- isFirst = false;
- });
- membersBox = members.node().getBBox();
- }
- if (classDef.methods.length > 0) {
- methodsLine = g2.append("line").attr("x1", 0).attr("y1", conf8.padding + titleHeight + conf8.dividerMargin + membersBox.height).attr("y2", conf8.padding + titleHeight + conf8.dividerMargin + membersBox.height);
- const methods = g2.append("text").attr("x", conf8.padding).attr("y", titleHeight + 2 * conf8.dividerMargin + membersBox.height + conf8.textHeight).attr("fill", "white").attr("class", "classText");
- isFirst = true;
- classDef.methods.forEach(function(method) {
- addTspan(methods, method, isFirst, conf8);
- isFirst = false;
- });
- }
- const classBox = g2.node().getBBox();
- var cssClassStr = " ";
- if (classDef.cssClasses.length > 0) {
- cssClassStr = cssClassStr + classDef.cssClasses.join(" ");
}
- const rect4 = g2.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", classBox.width + 2 * conf8.padding).attr("height", classBox.height + conf8.padding + 0.5 * conf8.dividerMargin).attr("class", cssClassStr);
- const rectWidth = rect4.node().getBBox().width;
- title2.node().childNodes.forEach(function(x5) {
- x5.setAttribute("x", (rectWidth - x5.getBBox().width) / 2);
- });
- if (classDef.tooltip) {
- title2.insert("title").text(classDef.tooltip);
- }
- if (membersLine) {
- membersLine.attr("x2", rectWidth);
- }
- if (methodsLine) {
- methodsLine.attr("x2", rectWidth);
- }
- classInfo.width = rectWidth;
- classInfo.height = classBox.height + conf8.padding + 0.5 * conf8.dividerMargin;
- return classInfo;
- }, "drawClass");
- getClassTitleString = /* @__PURE__ */ __name(function(classDef) {
- let classTitleString = classDef.id;
- if (classDef.type) {
- classTitleString += "<" + parseGenericTypes(classDef.type) + ">";
- }
- return classTitleString;
- }, "getClassTitleString");
- drawNote2 = /* @__PURE__ */ __name(function(elem, note3, conf8, _diagObj) {
- log.debug("Rendering note ", note3, conf8);
- const id27 = note3.id;
- const noteInfo = {
- id: id27,
- text: note3.text,
- width: 0,
- height: 0
- };
- const g2 = elem.append("g").attr("id", id27).attr("class", "classGroup");
- let text2 = g2.append("text").attr("y", conf8.textHeight + conf8.padding).attr("x", 0);
- const lines = JSON.parse(`"${note3.text}"`).split("\n");
- lines.forEach(function(line2) {
- log.debug(`Adding line: ${line2}`);
- text2.append("tspan").text(line2).attr("class", "title").attr("dy", conf8.textHeight);
- });
- const noteBox = g2.node().getBBox();
- const rect4 = g2.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", noteBox.width + 2 * conf8.padding).attr(
- "height",
- noteBox.height + lines.length * conf8.textHeight + conf8.padding + 0.5 * conf8.dividerMargin
+ return dir2;
+ }, "getDir");
+ getClasses2 = /* @__PURE__ */ __name(function(text4, diagramObj) {
+ return diagramObj.db.getClasses();
+ }, "getClasses");
+ draw12 = /* @__PURE__ */ __name(async function(text4, id29, _version, diag) {
+ log.info("REF0:");
+ log.info("Drawing class diagram (v3)", id29);
+ const { securityLevel, state: conf5, layout: layout6 } = getConfig2();
+ const data4Layout = diag.db.getData();
+ const svg2 = getDiagramElement(id29, securityLevel);
+ data4Layout.type = diag.type;
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout6);
+ data4Layout.nodeSpacing = conf5?.nodeSpacing || 50;
+ data4Layout.rankSpacing = conf5?.rankSpacing || 50;
+ data4Layout.markers = ["aggregation", "extension", "composition", "dependency", "lollipop"];
+ data4Layout.diagramId = id29;
+ await render4(data4Layout, svg2);
+ const padding2 = 8;
+ utils_default2.insertTitle(
+ svg2,
+ "classDiagramTitleText",
+ conf5?.titleTopMargin ?? 25,
+ diag.db.getDiagramTitle()
);
- const rectWidth = rect4.node().getBBox().width;
- text2.node().childNodes.forEach(function(x5) {
- x5.setAttribute("x", (rectWidth - x5.getBBox().width) / 2);
- });
- noteInfo.width = rectWidth;
- noteInfo.height = noteBox.height + lines.length * conf8.textHeight + conf8.padding + 0.5 * conf8.dividerMargin;
- return noteInfo;
- }, "drawNote");
- addTspan = /* @__PURE__ */ __name(function(textEl, member, isFirst, conf8) {
- const { displayText, cssStyle } = member.getDisplayDetails();
- const tSpan = textEl.append("tspan").attr("x", conf8.padding).text(displayText);
- if (cssStyle !== "") {
- tSpan.attr("style", member.cssStyle);
- }
- if (!isFirst) {
- tSpan.attr("dy", conf8.textHeight);
- }
- }, "addTspan");
- svgDraw_default3 = {
- getClassTitleString,
- drawClass,
- drawEdge,
- drawNote: drawNote2
- };
- }
- });
-
- // src/diagrams/class/classRenderer.js
- var idCache, padding, getGraphId, insertMarkers3, draw12, classRenderer_default;
- var init_classRenderer = __esm({
- "src/diagrams/class/classRenderer.js"() {
- "use strict";
- init_src32();
- init_dagre();
- init_graphlib();
- init_logger();
- init_svgDraw3();
- init_setupGraphViewbox();
- init_diagramAPI();
- idCache = {};
- padding = 20;
- getGraphId = /* @__PURE__ */ __name(function(label) {
- const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);
- if (foundEntry) {
- return foundEntry[0];
- }
- }, "getGraphId");
- insertMarkers3 = /* @__PURE__ */ __name(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");
- }, "insertMarkers");
- draw12 = /* @__PURE__ */ __name(function(text2, id27, _version, diagObj) {
- const conf8 = getConfig2().class;
- idCache = {};
- log.info("Rendering diagram " + text2);
- const securityLevel = getConfig2().securityLevel;
- let sandboxElement;
- if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
- }
- const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const diagram24 = root4.select(`[id='${id27}']`);
- insertMarkers3(diagram24);
- const g2 = new Graph({
- multigraph: true
- });
- g2.setGraph({
- isMultiGraph: true
- });
- g2.setDefaultEdgeLabel(function() {
- return {};
- });
- const classes6 = diagObj.db.getClasses();
- const keys3 = [...classes6.keys()];
- for (const key of keys3) {
- const classDef = classes6.get(key);
- const node2 = svgDraw_default3.drawClass(diagram24, classDef, conf8, diagObj);
- idCache[node2.id] = node2;
- g2.setNode(node2.id, node2);
- log.info("Org height: " + node2.height);
- }
- const relations3 = diagObj.db.getRelations();
- relations3.forEach(function(relation) {
- log.info(
- // cspell:ignore tjoho
- "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)
- );
- g2.setEdge(
- getGraphId(relation.id1),
- getGraphId(relation.id2),
- {
- relation
- },
- relation.title || "DEFAULT"
- );
- });
- const notes2 = diagObj.db.getNotes();
- notes2.forEach(function(note3) {
- log.debug(`Adding note: ${JSON.stringify(note3)}`);
- const node2 = svgDraw_default3.drawNote(diagram24, note3, conf8, diagObj);
- idCache[node2.id] = node2;
- g2.setNode(node2.id, node2);
- if (note3.class && classes6.has(note3.class)) {
- g2.setEdge(
- note3.id,
- getGraphId(note3.class),
- {
- relation: {
- id1: note3.id,
- id2: note3.class,
- relation: {
- type1: "none",
- type2: "none",
- lineType: 10
- }
- }
- },
- "DEFAULT"
- );
- }
- });
- layout(g2);
- g2.nodes().forEach(function(v3) {
- if (v3 !== void 0 && g2.node(v3) !== void 0) {
- log.debug("Node " + v3 + ": " + JSON.stringify(g2.node(v3)));
- root4.select("#" + (diagObj.db.lookUpDomId(v3) || v3)).attr(
- "transform",
- "translate(" + (g2.node(v3).x - g2.node(v3).width / 2) + "," + (g2.node(v3).y - g2.node(v3).height / 2) + " )"
- );
- }
- });
- g2.edges().forEach(function(e3) {
- if (e3 !== void 0 && g2.edge(e3) !== void 0) {
- log.debug("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(g2.edge(e3)));
- svgDraw_default3.drawEdge(diagram24, g2.edge(e3), g2.edge(e3).relation, conf8, diagObj);
- }
- });
- const svgBounds = diagram24.node().getBBox();
- const width3 = svgBounds.width + padding * 2;
- const height2 = svgBounds.height + padding * 2;
- configureSvgSize(diagram24, height2, width3, conf8.useMaxWidth);
- const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width3} ${height2}`;
- log.debug(`viewBox ${vBox}`);
- diagram24.attr("viewBox", vBox);
+ setupViewPortForSVG(svg2, padding2, "classDiagram", conf5?.useMaxWidth ?? true);
}, "draw");
- classRenderer_default = {
- draw: draw12
+ classRenderer_v3_unified_default = {
+ getClasses: getClasses2,
+ draw: draw12,
+ getDir
};
}
});
@@ -87275,1733 +93667,340 @@ g.classGroup line {
init_classDiagram();
init_classDb();
init_styles9();
- init_classRenderer();
+ init_classRenderer_v3_unified();
diagram12 = {
parser: classDiagram_default,
- db: classDb_default,
- renderer: classRenderer_default,
+ get db() {
+ return new ClassDB();
+ },
+ renderer: classRenderer_v3_unified_default,
styles: styles_default9,
init: /* @__PURE__ */ __name((cnf) => {
if (!cnf.class) {
cnf.class = {};
}
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
- classDb_default.clear();
}, "init")
};
}
});
- // src/dagre-wrapper/markers.js
- var insertMarkers4, extension2, composition2, aggregation2, dependency2, lollipop2, point7, circle4, cross2, barb2, markers2, markers_default2;
- var init_markers2 = __esm({
- "src/dagre-wrapper/markers.js"() {
+ // src/diagrams/class/classDiagram-v2.ts
+ var classDiagram_v2_exports = {};
+ __export(classDiagram_v2_exports, {
+ diagram: () => diagram13
+ });
+ var diagram13;
+ var init_classDiagram_v2 = __esm({
+ "src/diagrams/class/classDiagram-v2.ts"() {
"use strict";
- init_logger();
- insertMarkers4 = /* @__PURE__ */ __name((elem, markerArray, type3, id27) => {
- markerArray.forEach((markerName) => {
- markers2[markerName](elem, type3, id27);
- });
- }, "insertMarkers");
- extension2 = /* @__PURE__ */ __name((elem, type3, id27) => {
- log.trace("Making markers for ", id27);
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).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", id27 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).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");
- }, "extension");
- composition2 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).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", id27 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).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");
- }, "composition");
- aggregation2 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).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", id27 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).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");
- }, "aggregation");
- dependency2 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).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", id27 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).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");
- }, "dependency");
- lollipop2 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).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", id27 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).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);
- }, "lollipop");
- point7 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("marker").attr("id", id27 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).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", id27 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).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");
- }, "point");
- circle4 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("marker").attr("id", id27 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).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", id27 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).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");
- }, "circle");
- cross2 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("marker").attr("id", id27 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).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", id27 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).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");
- }, "cross");
- barb2 = /* @__PURE__ */ __name((elem, type3, id27) => {
- elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-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");
- }, "barb");
- markers2 = {
- extension: extension2,
- composition: composition2,
- aggregation: aggregation2,
- dependency: dependency2,
- lollipop: lollipop2,
- point: point7,
- circle: circle4,
- cross: cross2,
- barb: barb2
+ init_classDiagram();
+ init_classDb();
+ init_styles9();
+ init_classRenderer_v3_unified();
+ diagram13 = {
+ parser: classDiagram_default,
+ get db() {
+ return new ClassDB();
+ },
+ renderer: classRenderer_v3_unified_default,
+ styles: styles_default9,
+ init: /* @__PURE__ */ __name((cnf) => {
+ if (!cnf.class) {
+ cnf.class = {};
+ }
+ cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
+ }, "init")
};
- markers_default2 = insertMarkers4;
}
});
- // src/dagre-wrapper/mermaid-graphlib.js
- var clusterDb2, descendants2, parents2, clear19, isDescendant3, edgeInCluster2, copy3, extractDescendants2, findNonClusterChild2, getAnchorId2, adjustClustersAndEdges2, extractor2, sorter2, sortNodesByHierarchy2;
- var init_mermaid_graphlib2 = __esm({
- "src/dagre-wrapper/mermaid-graphlib.js"() {
+ // src/diagrams/state/parser/stateDiagram.jison
+ var parser14, stateDiagram_default;
+ var init_stateDiagram = __esm({
+ "src/diagrams/state/parser/stateDiagram.jison"() {
"use strict";
- init_logger();
- init_json();
- init_graphlib();
- clusterDb2 = {};
- descendants2 = {};
- parents2 = {};
- clear19 = /* @__PURE__ */ __name(() => {
- descendants2 = {};
- parents2 = {};
- clusterDb2 = {};
- }, "clear");
- isDescendant3 = /* @__PURE__ */ __name((id27, ancestorId) => {
- log.trace("In isDescendant", ancestorId, " ", id27, " = ", descendants2[ancestorId].includes(id27));
- if (descendants2[ancestorId].includes(id27)) {
- return true;
- }
- return false;
- }, "isDescendant");
- edgeInCluster2 = /* @__PURE__ */ __name((edge, clusterId) => {
- log.info("Descendants of ", clusterId, " is ", descendants2[clusterId]);
- log.info("Edge is ", edge);
- if (edge.v === clusterId) {
- return false;
- }
- if (edge.w === clusterId) {
- return false;
- }
- if (!descendants2[clusterId]) {
- log.debug("Tilt, ", clusterId, ",not in descendants");
- return false;
- }
- return descendants2[clusterId].includes(edge.v) || isDescendant3(edge.v, clusterId) || isDescendant3(edge.w, clusterId) || descendants2[clusterId].includes(edge.w);
- }, "edgeInCluster");
- copy3 = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {
- log.warn(
- "Copying children of ",
- clusterId,
- "root",
- rootId,
- "data",
- graph.node(clusterId),
- rootId
- );
- const nodes6 = graph.children(clusterId) || [];
- if (clusterId !== rootId) {
- nodes6.push(clusterId);
- }
- log.warn("Copying (nodes) clusterId", clusterId, "nodes", nodes6);
- nodes6.forEach((node2) => {
- if (graph.children(node2).length > 0) {
- copy3(node2, graph, newGraph, rootId);
- } else {
- const data5 = graph.node(node2);
- log.info("cp ", node2, " to ", rootId, " with parent ", clusterId);
- newGraph.setNode(node2, data5);
- if (rootId !== graph.parent(node2)) {
- log.warn("Setting parent", node2, graph.parent(node2));
- newGraph.setParent(node2, graph.parent(node2));
+ parser14 = function() {
+ var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
+ for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
+ return o3;
+ }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 16], $V7 = [1, 17], $V8 = [1, 18], $V9 = [1, 19], $Va = [1, 32], $Vb = [1, 20], $Vc = [1, 21], $Vd = [1, 22], $Ve = [1, 23], $Vf = [1, 24], $Vg = [1, 26], $Vh = [1, 27], $Vi = [1, 28], $Vj = [1, 29], $Vk = [1, 30], $Vl = [1, 31], $Vm = [1, 34], $Vn = [1, 35], $Vo = [1, 36], $Vp = [1, 37], $Vq = [1, 33], $Vr = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $Vs = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $Vt = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54];
+ var parser24 = {
+ trace: /* @__PURE__ */ __name(function trace() {
+ }, "trace"),
+ yy: {},
+ symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "classDefStatement": 10, "styleStatement": 11, "cssClassStatement": 12, "idStatement": 13, "DESCR": 14, "-->": 15, "HIDE_EMPTY": 16, "scale": 17, "WIDTH": 18, "COMPOSIT_STATE": 19, "STRUCT_START": 20, "STRUCT_STOP": 21, "STATE_DESCR": 22, "AS": 23, "ID": 24, "FORK": 25, "JOIN": 26, "CHOICE": 27, "CONCURRENT": 28, "note": 29, "notePosition": 30, "NOTE_TEXT": 31, "direction": 32, "acc_title": 33, "acc_title_value": 34, "acc_descr": 35, "acc_descr_value": 36, "acc_descr_multiline_value": 37, "classDef": 38, "CLASSDEF_ID": 39, "CLASSDEF_STYLEOPTS": 40, "DEFAULT": 41, "style": 42, "STYLE_IDS": 43, "STYLEDEF_STYLEOPTS": 44, "class": 45, "CLASSENTITY_IDS": 46, "STYLECLASS": 47, "direction_tb": 48, "direction_bt": 49, "direction_rl": 50, "direction_lr": 51, "eol": 52, ";": 53, "EDGE_STATE": 54, "STYLE_SEPARATOR": 55, "left_of": 56, "right_of": 57, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "classDef", 39: "CLASSDEF_ID", 40: "CLASSDEF_STYLEOPTS", 41: "DEFAULT", 42: "style", 43: "STYLE_IDS", 44: "STYLEDEF_STYLEOPTS", 45: "class", 46: "CLASSENTITY_IDS", 47: "STYLECLASS", 48: "direction_tb", 49: "direction_bt", 50: "direction_rl", 51: "direction_lr", 53: ";", 54: "EDGE_STATE", 55: "STYLE_SEPARATOR", 56: "left_of", 57: "right_of" },
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [10, 3], [10, 3], [11, 3], [12, 3], [32, 1], [32, 1], [32, 1], [32, 1], [52, 1], [52, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1]],
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
+ var $0 = $$.length - 1;
+ switch (yystate) {
+ case 3:
+ yy.setRootDoc($$[$0]);
+ return $$[$0];
+ break;
+ case 4:
+ this.$ = [];
+ break;
+ case 5:
+ if ($$[$0] != "nl") {
+ $$[$0 - 1].push($$[$0]);
+ this.$ = $$[$0 - 1];
+ }
+ break;
+ case 6:
+ case 7:
+ this.$ = $$[$0];
+ break;
+ case 8:
+ this.$ = "nl";
+ break;
+ case 12:
+ this.$ = $$[$0];
+ break;
+ case 13:
+ const stateStmt = $$[$0 - 1];
+ stateStmt.description = yy.trimColon($$[$0]);
+ this.$ = stateStmt;
+ break;
+ case 14:
+ this.$ = { stmt: "relation", state1: $$[$0 - 2], state2: $$[$0] };
+ break;
+ case 15:
+ const relDescription = yy.trimColon($$[$0]);
+ this.$ = { stmt: "relation", state1: $$[$0 - 3], state2: $$[$0 - 1], description: relDescription };
+ break;
+ case 19:
+ this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: "", doc: $$[$0 - 1] };
+ break;
+ case 20:
+ var id29 = $$[$0];
+ var description = $$[$0 - 2].trim();
+ if ($$[$0].match(":")) {
+ var parts = $$[$0].split(":");
+ id29 = parts[0];
+ description = [description, parts[1]];
+ }
+ this.$ = { stmt: "state", id: id29, type: "default", description };
+ break;
+ case 21:
+ this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: $$[$0 - 5], doc: $$[$0 - 1] };
+ break;
+ case 22:
+ this.$ = { stmt: "state", id: $$[$0], type: "fork" };
+ break;
+ case 23:
+ this.$ = { stmt: "state", id: $$[$0], type: "join" };
+ break;
+ case 24:
+ this.$ = { stmt: "state", id: $$[$0], type: "choice" };
+ break;
+ case 25:
+ this.$ = { stmt: "state", id: yy.getDividerId(), type: "divider" };
+ break;
+ case 26:
+ this.$ = { stmt: "state", id: $$[$0 - 1].trim(), note: { position: $$[$0 - 2].trim(), text: $$[$0].trim() } };
+ break;
+ case 29:
+ this.$ = $$[$0].trim();
+ yy.setAccTitle(this.$);
+ break;
+ case 30:
+ case 31:
+ this.$ = $$[$0].trim();
+ yy.setAccDescription(this.$);
+ break;
+ case 32:
+ case 33:
+ this.$ = { stmt: "classDef", id: $$[$0 - 1].trim(), classes: $$[$0].trim() };
+ break;
+ case 34:
+ this.$ = { stmt: "style", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
+ break;
+ case 35:
+ this.$ = { stmt: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
+ break;
+ case 36:
+ yy.setDirection("TB");
+ this.$ = { stmt: "dir", value: "TB" };
+ break;
+ case 37:
+ yy.setDirection("BT");
+ this.$ = { stmt: "dir", value: "BT" };
+ break;
+ case 38:
+ yy.setDirection("RL");
+ this.$ = { stmt: "dir", value: "RL" };
+ break;
+ case 39:
+ yy.setDirection("LR");
+ this.$ = { stmt: "dir", value: "LR" };
+ break;
+ case 42:
+ case 43:
+ this.$ = { stmt: "state", id: $$[$0].trim(), type: "default", description: "" };
+ break;
+ case 44:
+ this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" };
+ break;
+ case 45:
+ this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" };
+ break;
}
- if (clusterId !== rootId && node2 !== clusterId) {
- log.debug("Setting parent", node2, clusterId);
- newGraph.setParent(node2, clusterId);
+ }, "anonymous"),
+ table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o2([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 5]), { 9: 38, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 7]), o2($Vr, [2, 8]), o2($Vr, [2, 9]), o2($Vr, [2, 10]), o2($Vr, [2, 11]), o2($Vr, [2, 12], { 14: [1, 39], 15: [1, 40] }), o2($Vr, [2, 16]), { 18: [1, 41] }, o2($Vr, [2, 18], { 20: [1, 42] }), { 23: [1, 43] }, o2($Vr, [2, 22]), o2($Vr, [2, 23]), o2($Vr, [2, 24]), o2($Vr, [2, 25]), { 30: 44, 31: [1, 45], 56: [1, 46], 57: [1, 47] }, o2($Vr, [2, 28]), { 34: [1, 48] }, { 36: [1, 49] }, o2($Vr, [2, 31]), { 39: [1, 50], 41: [1, 51] }, { 43: [1, 52] }, { 46: [1, 53] }, o2($Vs, [2, 42], { 55: [1, 54] }), o2($Vs, [2, 43], { 55: [1, 55] }), o2($Vr, [2, 36]), o2($Vr, [2, 37]), o2($Vr, [2, 38]), o2($Vr, [2, 39]), o2($Vr, [2, 6]), o2($Vr, [2, 13]), { 13: 56, 24: $Va, 54: $Vq }, o2($Vr, [2, 17]), o2($Vt, $V3, { 7: 57 }), { 24: [1, 58] }, { 24: [1, 59] }, { 23: [1, 60] }, { 24: [2, 46] }, { 24: [2, 47] }, o2($Vr, [2, 29]), o2($Vr, [2, 30]), { 40: [1, 61] }, { 40: [1, 62] }, { 44: [1, 63] }, { 47: [1, 64] }, { 24: [1, 65] }, { 24: [1, 66] }, o2($Vr, [2, 14], { 14: [1, 67] }), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 21: [1, 68], 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 20], { 20: [1, 69] }), { 31: [1, 70] }, { 24: [1, 71] }, o2($Vr, [2, 32]), o2($Vr, [2, 33]), o2($Vr, [2, 34]), o2($Vr, [2, 35]), o2($Vs, [2, 44]), o2($Vs, [2, 45]), o2($Vr, [2, 15]), o2($Vr, [2, 19]), o2($Vt, $V3, { 7: 72 }), o2($Vr, [2, 26]), o2($Vr, [2, 27]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 21: [1, 73], 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 21])],
+ defaultActions: { 5: [2, 1], 6: [2, 2], 46: [2, 46], 47: [2, 47] },
+ parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
+ if (hash.recoverable) {
+ this.trace(str2);
} else {
- log.info("In copy ", clusterId, "root", rootId, "data", graph.node(clusterId), rootId);
- log.debug(
- "Not Setting parent for node=",
- node2,
- "cluster!==rootId",
- clusterId !== rootId,
- "node!==clusterId",
- node2 !== clusterId
- );
+ var error3 = new Error(str2);
+ error3.hash = hash;
+ throw error3;
}
- const edges5 = graph.edges(node2);
- log.debug("Copying Edges", edges5);
- edges5.forEach((edge) => {
- log.info("Edge", edge);
- const data6 = graph.edge(edge.v, edge.w, edge.name);
- log.info("Edge data", data6, rootId);
- try {
- if (edgeInCluster2(edge, rootId)) {
- log.info("Copying as ", edge.v, edge.w, data6, edge.name);
- newGraph.setEdge(edge.v, edge.w, data6, edge.name);
- log.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));
- } else {
- log.info(
- "Skipping copy of edge ",
- edge.v,
- "-->",
- edge.w,
- " rootId: ",
- rootId,
- " clusterId:",
- clusterId
- );
- }
- } catch (e3) {
- log.error(e3);
+ }, "parseError"),
+ parse: /* @__PURE__ */ __name(function parse7(input) {
+ var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
+ var args = lstack.slice.call(arguments, 1);
+ var lexer3 = Object.create(this.lexer);
+ var sharedState = { yy: {} };
+ for (var k2 in this.yy) {
+ if (Object.prototype.hasOwnProperty.call(this.yy, k2)) {
+ sharedState.yy[k2] = this.yy[k2];
}
- });
- }
- log.debug("Removing node", node2);
- graph.removeNode(node2);
- });
- }, "copy");
- extractDescendants2 = /* @__PURE__ */ __name((id27, graph) => {
- const children2 = graph.children(id27);
- let res = [...children2];
- for (const child of children2) {
- parents2[child] = id27;
- res = [...res, ...extractDescendants2(child, graph)];
- }
- return res;
- }, "extractDescendants");
- findNonClusterChild2 = /* @__PURE__ */ __name((id27, graph) => {
- log.trace("Searching", id27);
- const children2 = graph.children(id27);
- log.trace("Searching children of id ", id27, children2);
- if (children2.length < 1) {
- log.trace("This is a valid node", id27);
- return id27;
- }
- for (const child of children2) {
- const _id = findNonClusterChild2(child, graph);
- if (_id) {
- log.trace("Found replacement for", id27, " => ", _id);
- return _id;
- }
- }
- }, "findNonClusterChild");
- getAnchorId2 = /* @__PURE__ */ __name((id27) => {
- if (!clusterDb2[id27]) {
- return id27;
- }
- if (!clusterDb2[id27].externalConnections) {
- return id27;
- }
- if (clusterDb2[id27]) {
- return clusterDb2[id27].id;
- }
- return id27;
- }, "getAnchorId");
- adjustClustersAndEdges2 = /* @__PURE__ */ __name((graph, depth) => {
- if (!graph || depth > 10) {
- log.debug("Opting out, no graph ");
- return;
- } else {
- log.debug("Opting in, graph ");
- }
- graph.nodes().forEach(function(id27) {
- const children2 = graph.children(id27);
- if (children2.length > 0) {
- log.warn(
- "Cluster identified",
- id27,
- " Replacement id in edges: ",
- findNonClusterChild2(id27, graph)
- );
- descendants2[id27] = extractDescendants2(id27, graph);
- clusterDb2[id27] = { id: findNonClusterChild2(id27, graph), clusterData: graph.node(id27) };
- }
- });
- graph.nodes().forEach(function(id27) {
- const children2 = graph.children(id27);
- const edges5 = graph.edges();
- if (children2.length > 0) {
- log.debug("Cluster identified", id27, descendants2);
- edges5.forEach((edge) => {
- if (edge.v !== id27 && edge.w !== id27) {
- const d1 = isDescendant3(edge.v, id27);
- const d2 = isDescendant3(edge.w, id27);
- if (d1 ^ d2) {
- log.warn("Edge: ", edge, " leaves cluster ", id27);
- log.warn("Descendants of XXX ", id27, ": ", descendants2[id27]);
- clusterDb2[id27].externalConnections = true;
+ }
+ lexer3.setInput(input, sharedState.yy);
+ sharedState.yy.lexer = lexer3;
+ sharedState.yy.parser = this;
+ if (typeof lexer3.yylloc == "undefined") {
+ lexer3.yylloc = {};
+ }
+ var yyloc = lexer3.yylloc;
+ lstack.push(yyloc);
+ var ranges = lexer3.options && lexer3.options.ranges;
+ if (typeof sharedState.yy.parseError === "function") {
+ this.parseError = sharedState.yy.parseError;
+ } else {
+ this.parseError = Object.getPrototypeOf(this).parseError;
+ }
+ function popStack(n2) {
+ stack.length = stack.length - 2 * n2;
+ vstack.length = vstack.length - n2;
+ lstack.length = lstack.length - n2;
+ }
+ __name(popStack, "popStack");
+ function lex() {
+ var token2;
+ token2 = tstack.pop() || lexer3.lex() || EOF2;
+ if (typeof token2 !== "number") {
+ if (token2 instanceof Array) {
+ tstack = token2;
+ token2 = tstack.pop();
}
+ token2 = self2.symbols_[token2] || token2;
}
- });
- } else {
- log.debug("Not a cluster ", id27, descendants2);
- }
- });
- for (let id27 of Object.keys(clusterDb2)) {
- const nonClusterChild = clusterDb2[id27].id;
- const parent4 = graph.parent(nonClusterChild);
- if (parent4 !== id27 && clusterDb2[parent4] && !clusterDb2[parent4].externalConnections) {
- clusterDb2[id27].id = parent4;
- }
- }
- graph.edges().forEach(function(e3) {
- const edge = graph.edge(e3);
- log.warn("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(e3));
- log.warn("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(graph.edge(e3)));
- let v3 = e3.v;
- let w3 = e3.w;
- log.warn(
- "Fix XXX",
- clusterDb2,
- "ids:",
- e3.v,
- e3.w,
- "Translating: ",
- clusterDb2[e3.v],
- " --- ",
- clusterDb2[e3.w]
- );
- if (clusterDb2[e3.v] && clusterDb2[e3.w] && clusterDb2[e3.v] === clusterDb2[e3.w]) {
- log.warn("Fixing and trixing link to self - removing XXX", e3.v, e3.w, e3.name);
- log.warn("Fixing and trixing - removing XXX", e3.v, e3.w, e3.name);
- v3 = getAnchorId2(e3.v);
- w3 = getAnchorId2(e3.w);
- graph.removeEdge(e3.v, e3.w, e3.name);
- const specialId = e3.w + "---" + e3.v;
- graph.setNode(specialId, {
- domId: specialId,
- id: specialId,
- labelStyle: "",
- labelText: edge.label,
- padding: 0,
- shape: "labelRect",
- style: ""
- });
- const edge1 = structuredClone(edge);
- const edge2 = structuredClone(edge);
- edge1.label = "";
- edge1.arrowTypeEnd = "none";
- edge2.label = "";
- edge1.fromCluster = e3.v;
- edge2.toCluster = e3.v;
- graph.setEdge(v3, specialId, edge1, e3.name + "-cyclic-special");
- graph.setEdge(specialId, w3, edge2, e3.name + "-cyclic-special");
- } else if (clusterDb2[e3.v] || clusterDb2[e3.w]) {
- log.warn("Fixing and trixing - removing XXX", e3.v, e3.w, e3.name);
- v3 = getAnchorId2(e3.v);
- w3 = getAnchorId2(e3.w);
- graph.removeEdge(e3.v, e3.w, e3.name);
- if (v3 !== e3.v) {
- const parent4 = graph.parent(v3);
- clusterDb2[parent4].externalConnections = true;
- edge.fromCluster = e3.v;
- }
- if (w3 !== e3.w) {
- const parent4 = graph.parent(w3);
- clusterDb2[parent4].externalConnections = true;
- edge.toCluster = e3.w;
+ return token2;
}
- log.warn("Fix Replacing with XXX", v3, w3, e3.name);
- graph.setEdge(v3, w3, edge, e3.name);
- }
- });
- log.warn("Adjusted Graph", write(graph));
- extractor2(graph, 0);
- log.trace(clusterDb2);
- }, "adjustClustersAndEdges");
- extractor2 = /* @__PURE__ */ __name((graph, depth) => {
- log.warn("extractor - ", depth, write(graph), graph.children("D"));
- if (depth > 10) {
- log.error("Bailing out");
- return;
- }
- let nodes6 = graph.nodes();
- let hasChildren = false;
- for (const node2 of nodes6) {
- const children2 = graph.children(node2);
- hasChildren = hasChildren || children2.length > 0;
- }
- if (!hasChildren) {
- log.debug("Done, no node has children", graph.nodes());
- return;
- }
- log.debug("Nodes = ", nodes6, depth);
- for (const node2 of nodes6) {
- log.debug(
- "Extracting node",
- node2,
- clusterDb2,
- clusterDb2[node2] && !clusterDb2[node2].externalConnections,
- !graph.parent(node2),
- graph.node(node2),
- graph.children("D"),
- " Depth ",
- depth
- );
- if (!clusterDb2[node2]) {
- log.debug("Not a cluster", node2, depth);
- } else if (!clusterDb2[node2].externalConnections && // !graph.parent(node) &&
- graph.children(node2) && graph.children(node2).length > 0) {
- log.warn(
- "Cluster without external connections, without a parent and with children",
- node2,
- depth
- );
- const graphSettings = graph.graph();
- let dir2 = graphSettings.rankdir === "TB" ? "LR" : "TB";
- if (clusterDb2[node2]?.clusterData?.dir) {
- dir2 = clusterDb2[node2].clusterData.dir;
- log.warn("Fixing dir", clusterDb2[node2].clusterData.dir, dir2);
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ while (true) {
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
+ } else {
+ if (symbol === null || typeof symbol == "undefined") {
+ symbol = lex();
+ }
+ action = table[state4] && table[state4][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ var errStr = "";
+ expected = [];
+ for (p3 in table[state4]) {
+ if (this.terminals_[p3] && p3 > TERROR) {
+ expected.push("'" + this.terminals_[p3] + "'");
+ }
+ }
+ if (lexer3.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {
+ text: lexer3.match,
+ token: this.terminals_[symbol] || symbol,
+ line: lexer3.yylineno,
+ loc: yyloc,
+ expected
+ });
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(lexer3.yytext);
+ lstack.push(lexer3.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ if (!preErrorSymbol) {
+ yyleng = lexer3.yyleng;
+ yytext = lexer3.yytext;
+ yylineno = lexer3.yylineno;
+ yyloc = lexer3.yylloc;
+ if (recovering > 0) {
+ recovering--;
+ }
+ } else {
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ 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]
+ ];
+ }
+ r2 = this.performAction.apply(yyval, [
+ yytext,
+ yyleng,
+ yylineno,
+ sharedState.yy,
+ action[1],
+ vstack,
+ lstack
+ ].concat(args));
+ if (typeof r2 !== "undefined") {
+ return r2;
+ }
+ 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._$);
+ newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState2);
+ break;
+ case 3:
+ return true;
+ }
}
- const clusterGraph = new Graph({
- multigraph: true,
- compound: true
- }).setGraph({
- rankdir: dir2,
- // Todo: set proper spacing
- nodesep: 50,
- ranksep: 50,
- marginx: 8,
- marginy: 8
- }).setDefaultEdgeLabel(function() {
- return {};
- });
- log.warn("Old graph before copy", write(graph));
- copy3(node2, graph, clusterGraph, node2);
- graph.setNode(node2, {
- clusterNode: true,
- id: node2,
- clusterData: clusterDb2[node2].clusterData,
- labelText: clusterDb2[node2].labelText,
- graph: clusterGraph
- });
- log.warn("New graph after copy node: (", node2, ")", write(clusterGraph));
- log.debug("Old graph after copy", write(graph));
- } else {
- log.warn(
- "Cluster ** ",
- node2,
- " **not meeting the criteria !externalConnections:",
- !clusterDb2[node2].externalConnections,
- " no parent: ",
- !graph.parent(node2),
- " children ",
- graph.children(node2) && graph.children(node2).length > 0,
- graph.children("D"),
- depth
- );
- log.debug(clusterDb2);
- }
- }
- nodes6 = graph.nodes();
- log.warn("New list of nodes", nodes6);
- for (const node2 of nodes6) {
- const data5 = graph.node(node2);
- log.warn(" Now next level", node2, data5);
- if (data5.clusterNode) {
- extractor2(data5.graph, depth + 1);
- }
- }
- }, "extractor");
- sorter2 = /* @__PURE__ */ __name((graph, nodes6) => {
- if (nodes6.length === 0) {
- return [];
- }
- let result = Object.assign(nodes6);
- nodes6.forEach((node2) => {
- const children2 = graph.children(node2);
- const sorted = sorter2(graph, children2);
- result = [...result, ...sorted];
- });
- return result;
- }, "sorter");
- sortNodesByHierarchy2 = /* @__PURE__ */ __name((graph) => sorter2(graph, graph.children()), "sortNodesByHierarchy");
- }
- });
-
- // src/dagre-wrapper/clusters.js
- var rect3, noteGroup2, roundedWithTitle2, divider2, shapes4, clusterElems2, insertCluster2, clear20;
- var init_clusters2 = __esm({
- "src/dagre-wrapper/clusters.js"() {
- "use strict";
- init_intersect_rect();
- init_logger();
- init_createLabel();
- init_createText();
- init_src32();
- init_diagramAPI();
- init_common();
- init_subGraphTitleMargins();
- rect3 = /* @__PURE__ */ __name((parent4, node2) => {
- log.info("Creating subgraph rect for ", node2.id, node2);
- const siteConfig2 = getConfig2();
- const shapeSvg = parent4.insert("g").attr("class", "cluster" + (node2.class ? " " + node2.class : "")).attr("id", node2.id);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const useHtmlLabels = evaluate(siteConfig2.flowchart.htmlLabels);
- const label = shapeSvg.insert("g").attr("class", "cluster-label");
- const text2 = node2.labelType === "markdown" ? createText(label, node2.labelText, { style: node2.labelStyle, useHtmlLabels }, siteConfig2) : label.node().appendChild(createLabel_default(node2.labelText, node2.labelStyle, void 0, true));
- let bbox = text2.getBBox();
- if (evaluate(siteConfig2.flowchart.htmlLabels)) {
- const div = text2.children[0];
- const dv = select_default2(text2);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- const padding3 = 0 * node2.padding;
- const halfPadding = padding3 / 2;
- const width3 = node2.width <= bbox.width + padding3 ? bbox.width + padding3 : node2.width;
- if (node2.width <= bbox.width + padding3) {
- node2.diff = (bbox.width - node2.width) / 2 - node2.padding / 2;
- } else {
- node2.diff = -node2.padding / 2;
- }
- log.trace("Data ", node2, JSON.stringify(node2));
- rect4.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - width3 / 2).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", width3).attr("height", node2.height + padding3);
- const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2);
- if (useHtmlLabels) {
- label.attr(
- "transform",
- // This puts the label on top of the box instead of inside it
- `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})`
- );
- } else {
- label.attr(
- "transform",
- // This puts the label on top of the box instead of inside it
- `translate(${node2.x}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})`
- );
- }
- const rectBox = rect4.node().getBBox();
- node2.width = rectBox.width;
- node2.height = rectBox.height;
- node2.intersect = function(point8) {
- return intersect_rect_default(node2, point8);
- };
- return shapeSvg;
- }, "rect");
- noteGroup2 = /* @__PURE__ */ __name((parent4, node2) => {
- const shapeSvg = parent4.insert("g").attr("class", "note-cluster").attr("id", node2.id);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const padding3 = 0 * node2.padding;
- const halfPadding = padding3 / 2;
- rect4.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", node2.width + padding3).attr("height", node2.height + padding3).attr("fill", "none");
- const rectBox = rect4.node().getBBox();
- node2.width = rectBox.width;
- node2.height = rectBox.height;
- node2.intersect = function(point8) {
- return intersect_rect_default(node2, point8);
- };
- return shapeSvg;
- }, "noteGroup");
- roundedWithTitle2 = /* @__PURE__ */ __name((parent4, node2) => {
- const siteConfig2 = getConfig2();
- const shapeSvg = parent4.insert("g").attr("class", node2.classes).attr("id", node2.id);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const label = shapeSvg.insert("g").attr("class", "cluster-label");
- const innerRect = shapeSvg.append("rect");
- const text2 = label.node().appendChild(createLabel_default(node2.labelText, node2.labelStyle, void 0, true));
- let bbox = text2.getBBox();
- if (evaluate(siteConfig2.flowchart.htmlLabels)) {
- const div = text2.children[0];
- const dv = select_default2(text2);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- bbox = text2.getBBox();
- const padding3 = 0 * node2.padding;
- const halfPadding = padding3 / 2;
- const width3 = node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width;
- if (node2.width <= bbox.width + node2.padding) {
- node2.diff = (bbox.width + node2.padding * 0 - node2.width) / 2;
- } else {
- node2.diff = -node2.padding / 2;
- }
- rect4.attr("class", "outer").attr("x", node2.x - width3 / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", width3 + padding3).attr("height", node2.height + padding3);
- innerRect.attr("class", "inner").attr("x", node2.x - width3 / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding + bbox.height - 1).attr("width", width3 + padding3).attr("height", node2.height + padding3 - bbox.height - 3);
- const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2);
- label.attr(
- "transform",
- `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 - node2.padding / 3 + (evaluate(siteConfig2.flowchart.htmlLabels) ? 5 : 3) + subGraphTitleTopMargin})`
- );
- const rectBox = rect4.node().getBBox();
- node2.height = rectBox.height;
- node2.intersect = function(point8) {
- return intersect_rect_default(node2, point8);
- };
- return shapeSvg;
- }, "roundedWithTitle");
- divider2 = /* @__PURE__ */ __name((parent4, node2) => {
- const shapeSvg = parent4.insert("g").attr("class", node2.classes).attr("id", node2.id);
- const rect4 = shapeSvg.insert("rect", ":first-child");
- const padding3 = 0 * node2.padding;
- const halfPadding = padding3 / 2;
- rect4.attr("class", "divider").attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2).attr("width", node2.width + padding3).attr("height", node2.height + padding3);
- const rectBox = rect4.node().getBBox();
- node2.width = rectBox.width;
- node2.height = rectBox.height;
- node2.diff = -node2.padding / 2;
- node2.intersect = function(point8) {
- return intersect_rect_default(node2, point8);
- };
- return shapeSvg;
- }, "divider");
- shapes4 = { rect: rect3, roundedWithTitle: roundedWithTitle2, noteGroup: noteGroup2, divider: divider2 };
- clusterElems2 = {};
- insertCluster2 = /* @__PURE__ */ __name((elem, node2) => {
- log.trace("Inserting cluster");
- const shape = node2.shape || "rect";
- clusterElems2[node2.id] = shapes4[shape](elem, node2);
- }, "insertCluster");
- clear20 = /* @__PURE__ */ __name(() => {
- clusterElems2 = {};
- }, "clear");
- }
- });
-
- // src/dagre-wrapper/edgeMarker.ts
- var addEdgeMarkers2, arrowTypesMap2, addEdgeMarker2;
- var init_edgeMarker2 = __esm({
- "src/dagre-wrapper/edgeMarker.ts"() {
- "use strict";
- init_logger();
- addEdgeMarkers2 = /* @__PURE__ */ __name((svgPath, edge, url, id27, diagramType) => {
- if (edge.arrowTypeStart) {
- addEdgeMarker2(svgPath, "start", edge.arrowTypeStart, url, id27, diagramType);
- }
- if (edge.arrowTypeEnd) {
- addEdgeMarker2(svgPath, "end", edge.arrowTypeEnd, url, id27, diagramType);
- }
- }, "addEdgeMarkers");
- arrowTypesMap2 = {
- arrow_cross: "cross",
- arrow_point: "point",
- arrow_barb: "barb",
- arrow_circle: "circle",
- aggregation: "aggregation",
- extension: "extension",
- composition: "composition",
- dependency: "dependency",
- lollipop: "lollipop"
- };
- addEdgeMarker2 = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id27, diagramType) => {
- const endMarkerType = arrowTypesMap2[arrowType];
- if (!endMarkerType) {
- log.warn(`Unknown arrow type: ${arrowType}`);
- return;
- }
- const suffix = position5 === "start" ? "Start" : "End";
- svgPath.attr(`marker-${position5}`, `url(${url}#${id27}_${diagramType}-${endMarkerType}${suffix})`);
- }, "addEdgeMarker");
- }
- });
-
- // src/dagre-wrapper/edges.js
- function setTerminalWidth2(fo, value2) {
- if (getConfig2().flowchart.htmlLabels && fo) {
- fo.style.width = value2.length * 9 + "px";
- fo.style.height = "12px";
- }
- }
- var edgeLabels2, terminalLabels2, clear21, insertEdgeLabel2, positionEdgeLabel2, outsideNode2, intersection2, cutPathAtIntersect2, insertEdge2;
- var init_edges2 = __esm({
- "src/dagre-wrapper/edges.js"() {
- "use strict";
- init_logger();
- init_createLabel();
- init_createText();
- init_src32();
- init_diagramAPI();
- init_utils2();
- init_common();
- init_lineWithOffset();
- init_subGraphTitleMargins();
- init_edgeMarker2();
- edgeLabels2 = {};
- terminalLabels2 = {};
- clear21 = /* @__PURE__ */ __name(() => {
- edgeLabels2 = {};
- terminalLabels2 = {};
- }, "clear");
- insertEdgeLabel2 = /* @__PURE__ */ __name((elem, edge) => {
- const config6 = getConfig2();
- const useHtmlLabels = evaluate(config6.flowchart.htmlLabels);
- const labelElement = edge.labelType === "markdown" ? createText(
- elem,
- edge.label,
- {
- style: edge.labelStyle,
- useHtmlLabels,
- addSvgBackground: true
- },
- config6
- ) : createLabel_default(edge.label, edge.labelStyle);
- const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
- const label = edgeLabel.insert("g").attr("class", "label");
- label.node().appendChild(labelElement);
- let bbox = labelElement.getBBox();
- if (useHtmlLabels) {
- const div = labelElement.children[0];
- const dv = select_default2(labelElement);
- bbox = div.getBoundingClientRect();
- dv.attr("width", bbox.width);
- dv.attr("height", bbox.height);
- }
- label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
- edgeLabels2[edge.id] = edgeLabel;
- edge.width = bbox.width;
- edge.height = bbox.height;
- let fo;
- if (edge.startLabelLeft) {
- const startLabelElement = createLabel_default(edge.startLabelLeft, edge.labelStyle);
- const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
- const inner2 = startEdgeLabelLeft.insert("g").attr("class", "inner");
- fo = inner2.node().appendChild(startLabelElement);
- const slBox = startLabelElement.getBBox();
- inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
- if (!terminalLabels2[edge.id]) {
- terminalLabels2[edge.id] = {};
- }
- terminalLabels2[edge.id].startLeft = startEdgeLabelLeft;
- setTerminalWidth2(fo, edge.startLabelLeft);
- }
- if (edge.startLabelRight) {
- const startLabelElement = createLabel_default(edge.startLabelRight, edge.labelStyle);
- const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
- const inner2 = startEdgeLabelRight.insert("g").attr("class", "inner");
- fo = startEdgeLabelRight.node().appendChild(startLabelElement);
- inner2.node().appendChild(startLabelElement);
- const slBox = startLabelElement.getBBox();
- inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
- if (!terminalLabels2[edge.id]) {
- terminalLabels2[edge.id] = {};
- }
- terminalLabels2[edge.id].startRight = startEdgeLabelRight;
- setTerminalWidth2(fo, edge.startLabelRight);
- }
- if (edge.endLabelLeft) {
- const endLabelElement = createLabel_default(edge.endLabelLeft, edge.labelStyle);
- const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
- const inner2 = endEdgeLabelLeft.insert("g").attr("class", "inner");
- fo = inner2.node().appendChild(endLabelElement);
- const slBox = endLabelElement.getBBox();
- inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
- endEdgeLabelLeft.node().appendChild(endLabelElement);
- if (!terminalLabels2[edge.id]) {
- terminalLabels2[edge.id] = {};
- }
- terminalLabels2[edge.id].endLeft = endEdgeLabelLeft;
- setTerminalWidth2(fo, edge.endLabelLeft);
- }
- if (edge.endLabelRight) {
- const endLabelElement = createLabel_default(edge.endLabelRight, edge.labelStyle);
- const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
- const inner2 = endEdgeLabelRight.insert("g").attr("class", "inner");
- fo = inner2.node().appendChild(endLabelElement);
- const slBox = endLabelElement.getBBox();
- inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
- endEdgeLabelRight.node().appendChild(endLabelElement);
- if (!terminalLabels2[edge.id]) {
- terminalLabels2[edge.id] = {};
- }
- terminalLabels2[edge.id].endRight = endEdgeLabelRight;
- setTerminalWidth2(fo, edge.endLabelRight);
- }
- return labelElement;
- }, "insertEdgeLabel");
- __name(setTerminalWidth2, "setTerminalWidth");
- positionEdgeLabel2 = /* @__PURE__ */ __name((edge, paths) => {
- log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels2[edge.id], paths);
- let path4 = paths.updatedPath ? paths.updatedPath : paths.originalPath;
- const siteConfig2 = getConfig2();
- const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2);
- if (edge.label) {
- const el = edgeLabels2[edge.id];
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcLabelPosition(path4);
- log.debug(
- "Moving label " + edge.label + " from (",
- x5,
- ",",
- y5,
- ") to (",
- pos.x,
- ",",
- pos.y,
- ") abc88"
- );
- if (paths.updatedPath) {
- x5 = pos.x;
- y5 = pos.y;
- }
- }
- el.attr("transform", `translate(${x5}, ${y5 + subGraphTitleTotalMargin / 2})`);
- }
- if (edge.startLabelLeft) {
- const el = terminalLabels2[edge.id].startLeft;
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path4);
- x5 = pos.x;
- y5 = pos.y;
- }
- el.attr("transform", `translate(${x5}, ${y5})`);
- }
- if (edge.startLabelRight) {
- const el = terminalLabels2[edge.id].startRight;
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcTerminalLabelPosition(
- edge.arrowTypeStart ? 10 : 0,
- "start_right",
- path4
- );
- x5 = pos.x;
- y5 = pos.y;
- }
- el.attr("transform", `translate(${x5}, ${y5})`);
- }
- if (edge.endLabelLeft) {
- const el = terminalLabels2[edge.id].endLeft;
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path4);
- x5 = pos.x;
- y5 = pos.y;
- }
- el.attr("transform", `translate(${x5}, ${y5})`);
- }
- if (edge.endLabelRight) {
- const el = terminalLabels2[edge.id].endRight;
- let x5 = edge.x;
- let y5 = edge.y;
- if (path4) {
- const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path4);
- x5 = pos.x;
- y5 = pos.y;
- }
- el.attr("transform", `translate(${x5}, ${y5})`);
- }
- }, "positionEdgeLabel");
- outsideNode2 = /* @__PURE__ */ __name((node2, point8) => {
- const x5 = node2.x;
- const y5 = node2.y;
- const dx = Math.abs(point8.x - x5);
- const dy = Math.abs(point8.y - y5);
- const w3 = node2.width / 2;
- const h2 = node2.height / 2;
- if (dx >= w3 || dy >= h2) {
- return true;
- }
- return false;
- }, "outsideNode");
- intersection2 = /* @__PURE__ */ __name((node2, outsidePoint, insidePoint) => {
- log.debug(`intersection calc abc89:
- outsidePoint: ${JSON.stringify(outsidePoint)}
- insidePoint : ${JSON.stringify(insidePoint)}
- node : x:${node2.x} y:${node2.y} w:${node2.width} h:${node2.height}`);
- const x5 = node2.x;
- const y5 = node2.y;
- const dx = Math.abs(x5 - insidePoint.x);
- const w3 = node2.width / 2;
- let r2 = insidePoint.x < outsidePoint.x ? w3 - dx : w3 + dx;
- const h2 = node2.height / 2;
- const Q2 = Math.abs(outsidePoint.y - insidePoint.y);
- const R2 = Math.abs(outsidePoint.x - insidePoint.x);
- if (Math.abs(y5 - outsidePoint.y) * w3 > Math.abs(x5 - outsidePoint.x) * h2) {
- let q2 = insidePoint.y < outsidePoint.y ? outsidePoint.y - h2 - y5 : y5 - h2 - outsidePoint.y;
- r2 = R2 * q2 / Q2;
- const res = {
- x: insidePoint.x < outsidePoint.x ? insidePoint.x + r2 : insidePoint.x - R2 + r2,
- y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q2 - q2 : insidePoint.y - Q2 + q2
- };
- if (r2 === 0) {
- res.x = outsidePoint.x;
- res.y = outsidePoint.y;
- }
- if (R2 === 0) {
- res.x = outsidePoint.x;
- }
- if (Q2 === 0) {
- res.y = outsidePoint.y;
- }
- log.debug(`abc89 topp/bott calc, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, res);
- return res;
- } else {
- if (insidePoint.x < outsidePoint.x) {
- r2 = outsidePoint.x - w3 - x5;
- } else {
- r2 = x5 - w3 - outsidePoint.x;
- }
- let q2 = Q2 * r2 / R2;
- let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R2 - r2 : insidePoint.x - R2 + r2;
- let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q2 : insidePoint.y - q2;
- log.debug(`sides calc abc89, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, { _x, _y });
- if (r2 === 0) {
- _x = outsidePoint.x;
- _y = outsidePoint.y;
- }
- if (R2 === 0) {
- _x = outsidePoint.x;
- }
- if (Q2 === 0) {
- _y = outsidePoint.y;
- }
- return { x: _x, y: _y };
- }
- }, "intersection");
- cutPathAtIntersect2 = /* @__PURE__ */ __name((_points, boundaryNode) => {
- log.debug("abc88 cutPathAtIntersect", _points, boundaryNode);
- let points = [];
- let lastPointOutside = _points[0];
- let isInside = false;
- _points.forEach((point8) => {
- if (!outsideNode2(boundaryNode, point8) && !isInside) {
- const inter = intersection2(boundaryNode, lastPointOutside, point8);
- let pointPresent = false;
- points.forEach((p3) => {
- pointPresent = pointPresent || p3.x === inter.x && p3.y === inter.y;
- });
- if (!points.some((e3) => e3.x === inter.x && e3.y === inter.y)) {
- points.push(inter);
- }
- isInside = true;
- } else {
- lastPointOutside = point8;
- if (!isInside) {
- points.push(point8);
- }
- }
- });
- return points;
- }, "cutPathAtIntersect");
- insertEdge2 = /* @__PURE__ */ __name(function(elem, e3, edge, clusterDb3, diagramType, graph, id27) {
- let points = edge.points;
- log.debug("abc88 InsertEdge: edge=", edge, "e=", e3);
- let pointsHasChanged = false;
- const tail = graph.node(e3.v);
- var head2 = graph.node(e3.w);
- if (head2?.intersect && tail?.intersect) {
- points = points.slice(1, edge.points.length - 1);
- points.unshift(tail.intersect(points[0]));
- points.push(head2.intersect(points[points.length - 1]));
- }
- if (edge.toCluster) {
- log.debug("to cluster abc88", clusterDb3[edge.toCluster]);
- points = cutPathAtIntersect2(edge.points, clusterDb3[edge.toCluster].node);
- pointsHasChanged = true;
- }
- if (edge.fromCluster) {
- log.debug("from cluster abc88", clusterDb3[edge.fromCluster]);
- points = cutPathAtIntersect2(points.reverse(), clusterDb3[edge.fromCluster].node).reverse();
- pointsHasChanged = true;
- }
- const lineData = points.filter((p3) => !Number.isNaN(p3.y));
- let curve = basis_default2;
- if (edge.curve && (diagramType === "graph" || diagramType === "flowchart")) {
- curve = edge.curve;
- }
- const { x: x5, y: y5 } = getLineFunctionsWithOffset(edge);
- const lineFunction = line_default().x(x5).y(y5).curve(curve);
- let strokeClasses;
- switch (edge.thickness) {
- case "normal":
- strokeClasses = "edge-thickness-normal";
- break;
- case "thick":
- strokeClasses = "edge-thickness-thick";
- break;
- case "invisible":
- strokeClasses = "edge-thickness-thick";
- break;
- default:
- strokeClasses = "";
- }
- switch (edge.pattern) {
- case "solid":
- strokeClasses += " edge-pattern-solid";
- break;
- case "dotted":
- strokeClasses += " edge-pattern-dotted";
- break;
- case "dashed":
- strokeClasses += " edge-pattern-dashed";
- break;
- }
- const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edge.style);
- let url = "";
- if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) {
- url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
- url = url.replace(/\(/g, "\\(");
- url = url.replace(/\)/g, "\\)");
- }
- addEdgeMarkers2(svgPath, edge, url, id27, diagramType);
- let paths = {};
- if (pointsHasChanged) {
- paths.updatedPath = points;
- }
- paths.originalPath = edge.points;
- return paths;
- }, "insertEdge");
- }
- });
-
- // src/dagre-wrapper/index.js
- var recursiveRender2, render5;
- var init_dagre_wrapper = __esm({
- "src/dagre-wrapper/index.js"() {
- "use strict";
- init_dagre();
- init_json();
- init_markers2();
- init_util();
- init_mermaid_graphlib2();
- init_nodes2();
- init_clusters2();
- init_edges2();
- init_logger();
- init_subGraphTitleMargins();
- init_diagramAPI();
- recursiveRender2 = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id27, parentCluster, siteConfig2) => {
- log.info("Graph in recursive render: XXX", write(graph), parentCluster);
- const dir2 = graph.graph().rankdir;
- log.trace("Dir in recursive render - dir:", dir2);
- const elem = _elem.insert("g").attr("class", "root");
- if (!graph.nodes()) {
- log.info("No nodes found for", graph);
- } else {
- log.info("Recursive render XXX", graph.nodes());
- }
- if (graph.edges().length > 0) {
- log.trace("Recursive edges", graph.edge(graph.edges()[0]));
- }
- const clusters = elem.insert("g").attr("class", "clusters");
- const edgePaths = elem.insert("g").attr("class", "edgePaths");
- const edgeLabels3 = elem.insert("g").attr("class", "edgeLabels");
- const nodes6 = elem.insert("g").attr("class", "nodes");
- await Promise.all(
- graph.nodes().map(async function(v3) {
- const node2 = graph.node(v3);
- if (parentCluster !== void 0) {
- const data5 = JSON.parse(JSON.stringify(parentCluster.clusterData));
- log.info("Setting data for cluster XXX (", v3, ") ", data5, parentCluster);
- graph.setNode(parentCluster.id, data5);
- if (!graph.parent(v3)) {
- log.trace("Setting parent", v3, parentCluster.id);
- graph.setParent(v3, parentCluster.id, data5);
- }
- }
- log.info("(Insert) Node XXX" + v3 + ": " + JSON.stringify(graph.node(v3)));
- if (node2?.clusterNode) {
- log.info("Cluster identified", v3, node2.width, graph.node(v3));
- const { ranksep, nodesep } = graph.graph();
- node2.graph.setGraph({
- ...node2.graph.graph(),
- ranksep,
- nodesep
- });
- const o2 = await recursiveRender2(
- nodes6,
- node2.graph,
- diagramType,
- id27,
- graph.node(v3),
- siteConfig2
- );
- const newEl = o2.elem;
- updateNodeBounds(node2, newEl);
- node2.diff = o2.diff || 0;
- log.info("Node bounds (abc123)", v3, node2, node2.width, node2.x, node2.y);
- setNodeElem(newEl, node2);
- log.warn("Recursive render complete ", newEl, node2);
- } else {
- if (graph.children(v3).length > 0) {
- log.info("Cluster - the non recursive path XXX", v3, node2.id, node2, graph);
- log.info(findNonClusterChild2(node2.id, graph));
- clusterDb2[node2.id] = { id: findNonClusterChild2(node2.id, graph), node: node2 };
- } else {
- log.info("Node - the non recursive path", v3, node2.id, node2);
- await insertNode(nodes6, graph.node(v3), dir2);
- }
- }
- })
- );
- graph.edges().forEach(async function(e3) {
- const edge = graph.edge(e3.v, e3.w, e3.name);
- log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(e3));
- log.info("Edge " + e3.v + " -> " + e3.w + ": ", e3, " ", JSON.stringify(graph.edge(e3)));
- log.info("Fix", clusterDb2, "ids:", e3.v, e3.w, "Translating: ", clusterDb2[e3.v], clusterDb2[e3.w]);
- await insertEdgeLabel2(edgeLabels3, edge);
- });
- graph.edges().forEach(function(e3) {
- log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(e3));
- });
- log.info("Graph before layout:", JSON.stringify(write(graph)));
- log.info("#############################################");
- log.info("### Layout ###");
- log.info("#############################################");
- log.info(graph);
- layout(graph);
- log.info("Graph after layout:", JSON.stringify(write(graph)));
- let diff2 = 0;
- const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2);
- sortNodesByHierarchy2(graph).forEach(function(v3) {
- const node2 = graph.node(v3);
- log.info("Position " + v3 + ": " + JSON.stringify(graph.node(v3)));
- log.info(
- "Position " + v3 + ": (" + node2.x,
- "," + node2.y,
- ") width: ",
- node2.width,
- " height: ",
- node2.height
- );
- if (node2?.clusterNode) {
- node2.y += subGraphTitleTotalMargin;
- positionNode(node2);
- } else {
- if (graph.children(v3).length > 0) {
- node2.height += subGraphTitleTotalMargin;
- insertCluster2(clusters, node2);
- clusterDb2[node2.id].node = node2;
- } else {
- node2.y += subGraphTitleTotalMargin / 2;
- positionNode(node2);
- }
- }
- });
- graph.edges().forEach(function(e3) {
- const edge = graph.edge(e3);
- log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(edge), edge);
- edge.points.forEach((point8) => point8.y += subGraphTitleTotalMargin / 2);
- const paths = insertEdge2(edgePaths, e3, edge, clusterDb2, diagramType, graph, id27);
- positionEdgeLabel2(edge, paths);
- });
- graph.nodes().forEach(function(v3) {
- const n2 = graph.node(v3);
- log.info(v3, n2.type, n2.diff);
- if (n2.type === "group") {
- diff2 = n2.diff;
- }
- });
- return { elem, diff: diff2 };
- }, "recursiveRender");
- render5 = /* @__PURE__ */ __name(async (elem, graph, markers3, diagramType, id27) => {
- markers_default2(elem, markers3, diagramType, id27);
- clear4();
- clear21();
- clear20();
- clear19();
- log.warn("Graph at first:", JSON.stringify(write(graph)));
- adjustClustersAndEdges2(graph);
- log.warn("Graph after:", JSON.stringify(write(graph)));
- const siteConfig2 = getConfig2();
- await recursiveRender2(elem, graph, diagramType, id27, void 0, siteConfig2);
- }, "render");
- }
- });
-
- // src/diagrams/class/classRenderer-v2.ts
- function getArrowMarker(type3) {
- let marker;
- switch (type3) {
- 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;
- }
- var sanitizeText6, conf5, addNamespaces, addClasses, addNotes, addRelations, setConf5, draw13, classRenderer_v2_default;
- var init_classRenderer_v2 = __esm({
- "src/diagrams/class/classRenderer-v2.ts"() {
- "use strict";
- init_src32();
- init_graphlib();
- init_logger();
- init_diagramAPI();
- init_dagre_wrapper();
- init_utils2();
- init_utils2();
- init_setupGraphViewbox();
- init_common();
- sanitizeText6 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText");
- conf5 = {
- dividerMargin: 10,
- padding: 5,
- textHeight: 10,
- curve: void 0
- };
- addNamespaces = /* @__PURE__ */ __name(function(namespaces2, g2, _id, diagObj) {
- log.info("keys:", [...namespaces2.keys()]);
- log.info(namespaces2);
- namespaces2.forEach(function(vertex) {
- const shape = "rect";
- const node2 = {
- shape,
- id: vertex.id,
- domId: vertex.domId,
- labelText: sanitizeText6(vertex.id),
- labelStyle: "",
- style: "fill: none; stroke: black",
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
- padding: getConfig2().flowchart?.padding ?? getConfig2().class?.padding
- };
- g2.setNode(vertex.id, node2);
- addClasses(vertex.classes, g2, _id, diagObj, vertex.id);
- log.info("setNode", node2);
- });
- }, "addNamespaces");
- addClasses = /* @__PURE__ */ __name(function(classes6, g2, _id, diagObj, parent4) {
- log.info("keys:", [...classes6.keys()]);
- log.info(classes6);
- [...classes6.values()].filter((vertex) => vertex.parent === parent4).forEach(function(vertex) {
- const cssClassStr = vertex.cssClasses.join(" ");
- const styles3 = getStylesFromArray(vertex.styles);
- const vertexText = vertex.label ?? vertex.id;
- const radius2 = 0;
- const shape = "class_box";
- const node2 = {
- labelStyle: styles3.labelStyle,
- shape,
- labelText: sanitizeText6(vertexText),
- classData: vertex,
- rx: radius2,
- ry: radius2,
- class: cssClassStr,
- style: styles3.style,
- id: vertex.id,
- domId: vertex.domId,
- tooltip: diagObj.db.getTooltip(vertex.id, parent4) || "",
- 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: getConfig2().flowchart?.padding ?? getConfig2().class?.padding
- };
- g2.setNode(vertex.id, node2);
- if (parent4) {
- g2.setParent(vertex.id, parent4);
- }
- log.info("setNode", node2);
- });
- }, "addClasses");
- addNotes = /* @__PURE__ */ __name(function(notes2, g2, startEdgeId, classes6) {
- log.info(notes2);
- notes2.forEach(function(note3, i2) {
- const vertex = note3;
- const cssNoteStr = "";
- const styles3 = { labelStyle: "", style: "" };
- const vertexText = vertex.text;
- const radius2 = 0;
- const shape = "note";
- const node2 = {
- labelStyle: styles3.labelStyle,
- shape,
- labelText: sanitizeText6(vertexText),
- noteData: vertex,
- rx: radius2,
- ry: radius2,
- class: cssNoteStr,
- style: styles3.style,
- id: vertex.id,
- domId: vertex.id,
- tooltip: "",
- type: "note",
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
- padding: getConfig2().flowchart?.padding ?? getConfig2().class?.padding
- };
- g2.setNode(vertex.id, node2);
- log.info("setNode", node2);
- if (!vertex.class || !classes6.has(vertex.class)) {
- return;
- }
- const edgeId = startEdgeId + i2;
- const edgeData2 = {
- 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(conf5.curve, linear_default)
- };
- g2.setEdge(vertex.id, vertex.class, edgeData2, edgeId);
- });
- }, "addNotes");
- addRelations = /* @__PURE__ */ __name(function(relations3, g2) {
- const conf8 = getConfig2().flowchart;
- let cnt4 = 0;
- relations3.forEach(function(edge) {
- cnt4++;
- const edgeData2 = {
- //Set relationship style and line type
- classes: "relation",
- pattern: edge.relation.lineType == 1 ? "dashed" : "solid",
- id: getEdgeId(edge.id1, edge.id2, {
- prefix: "id",
- counter: cnt4
- }),
- // 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(conf8?.curve, linear_default)
- };
- log.info(edgeData2, edge);
- if (edge.style !== void 0) {
- const styles3 = getStylesFromArray(edge.style);
- edgeData2.style = styles3.style;
- edgeData2.labelStyle = styles3.labelStyle;
- }
- edge.text = edge.title;
- if (edge.text === void 0) {
- if (edge.style !== void 0) {
- edgeData2.arrowheadStyle = "fill: #333";
- }
- } else {
- edgeData2.arrowheadStyle = "fill: #333";
- edgeData2.labelpos = "c";
- if (getConfig2().flowchart?.htmlLabels ?? getConfig2().htmlLabels) {
- edgeData2.labelType = "html";
- edgeData2.label = '' + edge.text + " ";
- } else {
- edgeData2.labelType = "text";
- edgeData2.label = edge.text.replace(common_default.lineBreakRegex, "\n");
- if (edge.style === void 0) {
- edgeData2.style = edgeData2.style || "stroke: #333; stroke-width: 1.5px;fill:none";
- }
- edgeData2.labelStyle = edgeData2.labelStyle.replace("color:", "fill:");
- }
- }
- g2.setEdge(edge.id1, edge.id2, edgeData2, cnt4);
- });
- }, "addRelations");
- setConf5 = /* @__PURE__ */ __name(function(cnf) {
- conf5 = {
- ...conf5,
- ...cnf
- };
- }, "setConf");
- draw13 = /* @__PURE__ */ __name(async function(text2, id27, _version, diagObj) {
- log.info("Drawing class - ", id27);
- const conf8 = getConfig2().flowchart ?? getConfig2().class;
- const securityLevel = getConfig2().securityLevel;
- log.info("config:", conf8);
- const nodeSpacing = conf8?.nodeSpacing ?? 50;
- const rankSpacing = conf8?.rankSpacing ?? 50;
- const g2 = new Graph({
- multigraph: true,
- compound: true
- }).setGraph({
- rankdir: diagObj.db.getDirection(),
- nodesep: nodeSpacing,
- ranksep: rankSpacing,
- marginx: 8,
- marginy: 8
- }).setDefaultEdgeLabel(function() {
- return {};
- });
- const namespaces2 = diagObj.db.getNamespaces();
- const classes6 = diagObj.db.getClasses();
- const relations3 = diagObj.db.getRelations();
- const notes2 = diagObj.db.getNotes();
- log.info(relations3);
- addNamespaces(namespaces2, g2, id27, diagObj);
- addClasses(classes6, g2, id27, diagObj);
- addRelations(relations3, g2);
- addNotes(notes2, g2, relations3.length + 1, classes6);
- let sandboxElement;
- if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
- }
- const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const svg = root4.select(`[id="${id27}"]`);
- const element3 = root4.select("#" + id27 + " g");
- await render5(
- element3,
- g2,
- ["aggregation", "extension", "composition", "dependency", "lollipop"],
- "classDiagram",
- id27
- );
- utils_default2.insertTitle(svg, "classTitleText", conf8?.titleTopMargin ?? 5, diagObj.db.getDiagramTitle());
- setupGraphViewbox(g2, svg, conf8?.diagramPadding, conf8?.useMaxWidth);
- if (!conf8?.htmlLabels) {
- const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
- const labels = doc.querySelectorAll('[id="' + id27 + '"] .edgeLabel .label');
- for (const label of labels) {
- const dim = label.getBBox();
- const rect4 = doc.createElementNS("http://www.w3.org/2000/svg", "rect");
- rect4.setAttribute("rx", 0);
- rect4.setAttribute("ry", 0);
- rect4.setAttribute("width", dim.width);
- rect4.setAttribute("height", dim.height);
- label.insertBefore(rect4, label.firstChild);
- }
- }
- }, "draw");
- __name(getArrowMarker, "getArrowMarker");
- classRenderer_v2_default = {
- setConf: setConf5,
- draw: draw13
- };
- }
- });
-
- // src/diagrams/class/classDiagram-v2.ts
- var classDiagram_v2_exports = {};
- __export(classDiagram_v2_exports, {
- diagram: () => diagram13
- });
- var diagram13;
- var init_classDiagram_v2 = __esm({
- "src/diagrams/class/classDiagram-v2.ts"() {
- "use strict";
- init_classDiagram();
- init_classDb();
- init_styles9();
- init_classRenderer_v2();
- diagram13 = {
- parser: classDiagram_default,
- db: classDb_default,
- renderer: classRenderer_v2_default,
- styles: styles_default9,
- init: /* @__PURE__ */ __name((cnf) => {
- if (!cnf.class) {
- cnf.class = {};
- }
- cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
- classDb_default.clear();
- }, "init")
- };
- }
- });
-
- // src/diagrams/state/parser/stateDiagram.jison
- var parser14, stateDiagram_default;
- var init_stateDiagram = __esm({
- "src/diagrams/state/parser/stateDiagram.jison"() {
- "use strict";
- parser14 = function() {
- var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
- for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
- return o3;
- }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 16], $V7 = [1, 17], $V8 = [1, 18], $V9 = [1, 19], $Va = [1, 32], $Vb = [1, 20], $Vc = [1, 21], $Vd = [1, 22], $Ve = [1, 23], $Vf = [1, 24], $Vg = [1, 26], $Vh = [1, 27], $Vi = [1, 28], $Vj = [1, 29], $Vk = [1, 30], $Vl = [1, 31], $Vm = [1, 34], $Vn = [1, 35], $Vo = [1, 36], $Vp = [1, 37], $Vq = [1, 33], $Vr = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $Vs = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $Vt = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54];
- var parser22 = {
- trace: /* @__PURE__ */ __name(function trace() {
- }, "trace"),
- yy: {},
- symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "classDefStatement": 10, "styleStatement": 11, "cssClassStatement": 12, "idStatement": 13, "DESCR": 14, "-->": 15, "HIDE_EMPTY": 16, "scale": 17, "WIDTH": 18, "COMPOSIT_STATE": 19, "STRUCT_START": 20, "STRUCT_STOP": 21, "STATE_DESCR": 22, "AS": 23, "ID": 24, "FORK": 25, "JOIN": 26, "CHOICE": 27, "CONCURRENT": 28, "note": 29, "notePosition": 30, "NOTE_TEXT": 31, "direction": 32, "acc_title": 33, "acc_title_value": 34, "acc_descr": 35, "acc_descr_value": 36, "acc_descr_multiline_value": 37, "classDef": 38, "CLASSDEF_ID": 39, "CLASSDEF_STYLEOPTS": 40, "DEFAULT": 41, "style": 42, "STYLE_IDS": 43, "STYLEDEF_STYLEOPTS": 44, "class": 45, "CLASSENTITY_IDS": 46, "STYLECLASS": 47, "direction_tb": 48, "direction_bt": 49, "direction_rl": 50, "direction_lr": 51, "eol": 52, ";": 53, "EDGE_STATE": 54, "STYLE_SEPARATOR": 55, "left_of": 56, "right_of": 57, "$accept": 0, "$end": 1 },
- terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "classDef", 39: "CLASSDEF_ID", 40: "CLASSDEF_STYLEOPTS", 41: "DEFAULT", 42: "style", 43: "STYLE_IDS", 44: "STYLEDEF_STYLEOPTS", 45: "class", 46: "CLASSENTITY_IDS", 47: "STYLECLASS", 48: "direction_tb", 49: "direction_bt", 50: "direction_rl", 51: "direction_lr", 53: ";", 54: "EDGE_STATE", 55: "STYLE_SEPARATOR", 56: "left_of", 57: "right_of" },
- productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [10, 3], [10, 3], [11, 3], [12, 3], [32, 1], [32, 1], [32, 1], [32, 1], [52, 1], [52, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1]],
- performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
- var $0 = $$.length - 1;
- switch (yystate) {
- case 3:
- yy.setRootDoc($$[$0]);
- return $$[$0];
- break;
- case 4:
- this.$ = [];
- break;
- case 5:
- if ($$[$0] != "nl") {
- $$[$0 - 1].push($$[$0]);
- this.$ = $$[$0 - 1];
- }
- break;
- case 6:
- case 7:
- this.$ = $$[$0];
- break;
- case 8:
- this.$ = "nl";
- break;
- case 12:
- this.$ = $$[$0];
- break;
- case 13:
- const stateStmt = $$[$0 - 1];
- stateStmt.description = yy.trimColon($$[$0]);
- this.$ = stateStmt;
- break;
- case 14:
- this.$ = { stmt: "relation", state1: $$[$0 - 2], state2: $$[$0] };
- break;
- case 15:
- const relDescription = yy.trimColon($$[$0]);
- this.$ = { stmt: "relation", state1: $$[$0 - 3], state2: $$[$0 - 1], description: relDescription };
- break;
- case 19:
- this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: "", doc: $$[$0 - 1] };
- break;
- case 20:
- var id27 = $$[$0];
- var description = $$[$0 - 2].trim();
- if ($$[$0].match(":")) {
- var parts = $$[$0].split(":");
- id27 = parts[0];
- description = [description, parts[1]];
- }
- this.$ = { stmt: "state", id: id27, type: "default", description };
- break;
- case 21:
- this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: $$[$0 - 5], doc: $$[$0 - 1] };
- break;
- case 22:
- this.$ = { stmt: "state", id: $$[$0], type: "fork" };
- break;
- case 23:
- this.$ = { stmt: "state", id: $$[$0], type: "join" };
- break;
- case 24:
- this.$ = { stmt: "state", id: $$[$0], type: "choice" };
- break;
- case 25:
- this.$ = { stmt: "state", id: yy.getDividerId(), type: "divider" };
- break;
- case 26:
- this.$ = { stmt: "state", id: $$[$0 - 1].trim(), note: { position: $$[$0 - 2].trim(), text: $$[$0].trim() } };
- break;
- case 29:
- this.$ = $$[$0].trim();
- yy.setAccTitle(this.$);
- break;
- case 30:
- case 31:
- this.$ = $$[$0].trim();
- yy.setAccDescription(this.$);
- break;
- case 32:
- case 33:
- this.$ = { stmt: "classDef", id: $$[$0 - 1].trim(), classes: $$[$0].trim() };
- break;
- case 34:
- this.$ = { stmt: "style", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
- break;
- case 35:
- this.$ = { stmt: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
- break;
- case 36:
- yy.setDirection("TB");
- this.$ = { stmt: "dir", value: "TB" };
- break;
- case 37:
- yy.setDirection("BT");
- this.$ = { stmt: "dir", value: "BT" };
- break;
- case 38:
- yy.setDirection("RL");
- this.$ = { stmt: "dir", value: "RL" };
- break;
- case 39:
- yy.setDirection("LR");
- this.$ = { stmt: "dir", value: "LR" };
- break;
- case 42:
- case 43:
- this.$ = { stmt: "state", id: $$[$0].trim(), type: "default", description: "" };
- break;
- case 44:
- this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" };
- break;
- case 45:
- this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" };
- break;
- }
- }, "anonymous"),
- table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o2([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 5]), { 9: 38, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 7]), o2($Vr, [2, 8]), o2($Vr, [2, 9]), o2($Vr, [2, 10]), o2($Vr, [2, 11]), o2($Vr, [2, 12], { 14: [1, 39], 15: [1, 40] }), o2($Vr, [2, 16]), { 18: [1, 41] }, o2($Vr, [2, 18], { 20: [1, 42] }), { 23: [1, 43] }, o2($Vr, [2, 22]), o2($Vr, [2, 23]), o2($Vr, [2, 24]), o2($Vr, [2, 25]), { 30: 44, 31: [1, 45], 56: [1, 46], 57: [1, 47] }, o2($Vr, [2, 28]), { 34: [1, 48] }, { 36: [1, 49] }, o2($Vr, [2, 31]), { 39: [1, 50], 41: [1, 51] }, { 43: [1, 52] }, { 46: [1, 53] }, o2($Vs, [2, 42], { 55: [1, 54] }), o2($Vs, [2, 43], { 55: [1, 55] }), o2($Vr, [2, 36]), o2($Vr, [2, 37]), o2($Vr, [2, 38]), o2($Vr, [2, 39]), o2($Vr, [2, 6]), o2($Vr, [2, 13]), { 13: 56, 24: $Va, 54: $Vq }, o2($Vr, [2, 17]), o2($Vt, $V3, { 7: 57 }), { 24: [1, 58] }, { 24: [1, 59] }, { 23: [1, 60] }, { 24: [2, 46] }, { 24: [2, 47] }, o2($Vr, [2, 29]), o2($Vr, [2, 30]), { 40: [1, 61] }, { 40: [1, 62] }, { 44: [1, 63] }, { 47: [1, 64] }, { 24: [1, 65] }, { 24: [1, 66] }, o2($Vr, [2, 14], { 14: [1, 67] }), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 21: [1, 68], 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 20], { 20: [1, 69] }), { 31: [1, 70] }, { 24: [1, 71] }, o2($Vr, [2, 32]), o2($Vr, [2, 33]), o2($Vr, [2, 34]), o2($Vr, [2, 35]), o2($Vs, [2, 44]), o2($Vs, [2, 45]), o2($Vr, [2, 15]), o2($Vr, [2, 19]), o2($Vt, $V3, { 7: 72 }), o2($Vr, [2, 26]), o2($Vr, [2, 27]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 21: [1, 73], 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 21])],
- defaultActions: { 5: [2, 1], 6: [2, 2], 46: [2, 46], 47: [2, 47] },
- parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
- if (hash.recoverable) {
- this.trace(str2);
- } else {
- var error3 = new Error(str2);
- error3.hash = hash;
- throw error3;
- }
- }, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
- var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
- var args = lstack.slice.call(arguments, 1);
- var lexer3 = Object.create(this.lexer);
- var sharedState = { yy: {} };
- for (var k2 in this.yy) {
- if (Object.prototype.hasOwnProperty.call(this.yy, k2)) {
- sharedState.yy[k2] = this.yy[k2];
- }
- }
- lexer3.setInput(input, sharedState.yy);
- sharedState.yy.lexer = lexer3;
- sharedState.yy.parser = this;
- if (typeof lexer3.yylloc == "undefined") {
- lexer3.yylloc = {};
- }
- var yyloc = lexer3.yylloc;
- lstack.push(yyloc);
- var ranges = lexer3.options && lexer3.options.ranges;
- if (typeof sharedState.yy.parseError === "function") {
- this.parseError = sharedState.yy.parseError;
- } else {
- this.parseError = Object.getPrototypeOf(this).parseError;
- }
- function popStack(n2) {
- stack.length = stack.length - 2 * n2;
- vstack.length = vstack.length - n2;
- lstack.length = lstack.length - n2;
- }
- __name(popStack, "popStack");
- function lex2() {
- var token2;
- token2 = tstack.pop() || lexer3.lex() || EOF2;
- if (typeof token2 !== "number") {
- if (token2 instanceof Array) {
- tstack = token2;
- token2 = tstack.pop();
- }
- token2 = self2.symbols_[token2] || token2;
- }
- return token2;
- }
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
- while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
- } else {
- if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
- }
- action = table[state5] && table[state5][symbol];
- }
- if (typeof action === "undefined" || !action.length || !action[0]) {
- var errStr = "";
- expected = [];
- for (p3 in table[state5]) {
- if (this.terminals_[p3] && p3 > TERROR) {
- expected.push("'" + this.terminals_[p3] + "'");
- }
- }
- if (lexer3.showPosition) {
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
- } else {
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
- }
- this.parseError(errStr, {
- text: lexer3.match,
- token: this.terminals_[symbol] || symbol,
- line: lexer3.yylineno,
- loc: yyloc,
- expected
- });
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol);
- vstack.push(lexer3.yytext);
- lstack.push(lexer3.yylloc);
- stack.push(action[1]);
- symbol = null;
- if (!preErrorSymbol) {
- yyleng = lexer3.yyleng;
- yytext = lexer3.yytext;
- yylineno = lexer3.yylineno;
- yyloc = lexer3.yylloc;
- if (recovering > 0) {
- recovering--;
- }
- } else {
- symbol = preErrorSymbol;
- preErrorSymbol = null;
- }
- 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]
- ];
- }
- r2 = this.performAction.apply(yyval, [
- yytext,
- yyleng,
- yylineno,
- sharedState.yy,
- action[1],
- vstack,
- lstack
- ].concat(args));
- if (typeof r2 !== "undefined") {
- return r2;
- }
- 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._$);
- newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]];
- stack.push(newState2);
- break;
- case 3:
- return true;
- }
- }
- return true;
- }, "parse")
+ return true;
+ }, "parse")
};
var lexer2 = /* @__PURE__ */ function() {
var lexer3 = {
@@ -89236,7 +94235,7 @@ g.classGroup line {
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -89576,13 +94575,13 @@ g.classGroup line {
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser14.parser = parser14;
@@ -89591,12 +94590,13 @@ g.classGroup line {
});
// src/diagrams/state/stateCommon.ts
- var DEFAULT_DIAGRAM_DIRECTION, DEFAULT_NESTED_DOC_DIR, STMT_STATE, STMT_RELATION, STMT_CLASSDEF, STMT_STYLEDEF, STMT_APPLYCLASS, DEFAULT_STATE_TYPE, DIVIDER_TYPE, G_EDGE_STYLE, G_EDGE_ARROWHEADSTYLE, G_EDGE_LABELPOS, G_EDGE_LABELTYPE, G_EDGE_THICKNESS, SHAPE_STATE, SHAPE_STATE_WITH_DESC, SHAPE_START, SHAPE_END, SHAPE_DIVIDER, SHAPE_GROUP, SHAPE_NOTE, SHAPE_NOTEGROUP, CSS_DIAGRAM, CSS_STATE, CSS_DIAGRAM_STATE, CSS_EDGE, CSS_NOTE, CSS_NOTE_EDGE, CSS_EDGE_NOTE_EDGE, CSS_DIAGRAM_NOTE, CSS_CLUSTER, CSS_DIAGRAM_CLUSTER, CSS_CLUSTER_ALT, CSS_DIAGRAM_CLUSTER_ALT, PARENT2, NOTE, DOMID_STATE, DOMID_TYPE_SPACER, NOTE_ID, PARENT_ID;
+ var DEFAULT_DIAGRAM_DIRECTION, DEFAULT_NESTED_DOC_DIR, STMT_DIRECTION, STMT_STATE, STMT_RELATION, STMT_CLASSDEF, STMT_STYLEDEF, STMT_APPLYCLASS, DEFAULT_STATE_TYPE, DIVIDER_TYPE, G_EDGE_STYLE, G_EDGE_ARROWHEADSTYLE, G_EDGE_LABELPOS, G_EDGE_LABELTYPE, G_EDGE_THICKNESS, SHAPE_STATE, SHAPE_STATE_WITH_DESC, SHAPE_START, SHAPE_END, SHAPE_DIVIDER, SHAPE_GROUP, SHAPE_NOTE, SHAPE_NOTEGROUP, CSS_DIAGRAM, CSS_STATE, CSS_DIAGRAM_STATE, CSS_EDGE, CSS_NOTE, CSS_NOTE_EDGE, CSS_EDGE_NOTE_EDGE, CSS_DIAGRAM_NOTE, CSS_CLUSTER, CSS_DIAGRAM_CLUSTER, CSS_CLUSTER_ALT, CSS_DIAGRAM_CLUSTER_ALT, PARENT2, NOTE, DOMID_STATE, DOMID_TYPE_SPACER, NOTE_ID, PARENT_ID;
var init_stateCommon = __esm({
"src/diagrams/state/stateCommon.ts"() {
"use strict";
- DEFAULT_DIAGRAM_DIRECTION = "LR";
+ DEFAULT_DIAGRAM_DIRECTION = "TB";
DEFAULT_NESTED_DOC_DIR = "TB";
+ STMT_DIRECTION = "dir";
STMT_STATE = "state";
STMT_RELATION = "relation";
STMT_CLASSDEF = "classDef";
@@ -89643,7 +94643,7 @@ g.classGroup line {
const typeStr = type3 !== null && type3.length > 0 ? `${typeSpacer}${type3}` : "";
return `${DOMID_STATE}-${itemId}${typeStr}-${counter2}`;
}
- function insertOrUpdateNode(nodes6, nodeData2, classes6) {
+ function insertOrUpdateNode(nodes6, nodeData2, classes3) {
if (!nodeData2.id || nodeData2.id === "" || nodeData2.id === "") {
return;
}
@@ -89652,8 +94652,8 @@ g.classGroup line {
nodeData2.cssCompiledStyles = [];
}
nodeData2.cssClasses.split(" ").forEach((cssClass) => {
- if (classes6.get(cssClass)) {
- const classDef = classes6.get(cssClass);
+ if (classes3.get(cssClass)) {
+ const classDef = classes3.get(cssClass);
nodeData2.cssCompiledStyles = [...nodeData2.cssCompiledStyles, ...classDef.styles];
}
});
@@ -89671,7 +94671,7 @@ g.classGroup line {
function getStylesFromDbInfo(dbInfoItem) {
return dbInfoItem?.styles ?? [];
}
- var nodeDb, graphItemCount, setupDoc, getDir, dataFetcher, reset2;
+ var nodeDb, graphItemCount, setupDoc, getDir2, dataFetcher, reset2;
var init_dataFetcher = __esm({
"src/diagrams/state/dataFetcher.js"() {
"use strict";
@@ -89682,15 +94682,15 @@ g.classGroup line {
nodeDb = /* @__PURE__ */ new Map();
graphItemCount = 0;
__name(stateDomId, "stateDomId");
- setupDoc = /* @__PURE__ */ __name((parentParsedItem, doc, diagramStates, nodes6, edges5, altFlag, look, classes6) => {
+ setupDoc = /* @__PURE__ */ __name((parentParsedItem, doc, diagramStates, nodes6, edges3, altFlag, look, classes3) => {
log.trace("items", doc);
doc.forEach((item) => {
switch (item.stmt) {
case STMT_STATE:
- dataFetcher(parentParsedItem, item, diagramStates, nodes6, edges5, altFlag, look, classes6);
+ dataFetcher(parentParsedItem, item, diagramStates, nodes6, edges3, altFlag, look, classes3);
break;
case DEFAULT_STATE_TYPE:
- dataFetcher(parentParsedItem, item, diagramStates, nodes6, edges5, altFlag, look, classes6);
+ dataFetcher(parentParsedItem, item, diagramStates, nodes6, edges3, altFlag, look, classes3);
break;
case STMT_RELATION:
{
@@ -89699,20 +94699,20 @@ g.classGroup line {
item.state1,
diagramStates,
nodes6,
- edges5,
+ edges3,
altFlag,
look,
- classes6
+ classes3
);
dataFetcher(
parentParsedItem,
item.state2,
diagramStates,
nodes6,
- edges5,
+ edges3,
altFlag,
look,
- classes6
+ classes3
);
const edgeData2 = {
id: "edge" + graphItemCount,
@@ -89730,14 +94730,14 @@ g.classGroup line {
classes: CSS_EDGE,
look
};
- edges5.push(edgeData2);
+ edges3.push(edgeData2);
graphItemCount++;
}
break;
}
});
}, "setupDoc");
- getDir = /* @__PURE__ */ __name((parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
+ getDir2 = /* @__PURE__ */ __name((parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
let dir2 = defaultDir;
if (parsedItem.doc) {
for (const parsedItemDoc of parsedItem.doc) {
@@ -89751,7 +94751,7 @@ g.classGroup line {
__name(insertOrUpdateNode, "insertOrUpdateNode");
__name(getClassesFromDbInfo, "getClassesFromDbInfo");
__name(getStylesFromDbInfo, "getStylesFromDbInfo");
- dataFetcher = /* @__PURE__ */ __name((parent4, parsedItem, diagramStates, nodes6, edges5, altFlag, look, classes6) => {
+ dataFetcher = /* @__PURE__ */ __name((parent4, parsedItem, diagramStates, nodes6, edges3, altFlag, look, classes3) => {
const itemId = parsedItem.id;
const dbState = diagramStates.get(itemId);
const classStr = getClassesFromDbInfo(dbState);
@@ -89804,10 +94804,10 @@ g.classGroup line {
}
}
if (!newNode.type && parsedItem.doc) {
- log.info("Setting cluster for XCX", itemId, getDir(parsedItem));
+ log.info("Setting cluster for XCX", itemId, getDir2(parsedItem));
newNode.type = "group";
newNode.isGroup = true;
- newNode.dir = getDir(parsedItem);
+ newNode.dir = getDir2(parsedItem);
newNode.shape = parsedItem.type === DIVIDER_TYPE ? SHAPE_DIVIDER : SHAPE_GROUP;
newNode.cssClasses = `${newNode.cssClasses} ${CSS_DIAGRAM_CLUSTER} ${altFlag ? CSS_DIAGRAM_CLUSTER_ALT : ""}`;
}
@@ -89872,16 +94872,16 @@ g.classGroup line {
graphItemCount++;
groupData.id = parentNodeId;
noteData.parentId = parentNodeId;
- insertOrUpdateNode(nodes6, groupData, classes6);
- insertOrUpdateNode(nodes6, noteData, classes6);
- insertOrUpdateNode(nodes6, nodeData2, classes6);
+ insertOrUpdateNode(nodes6, groupData, classes3);
+ insertOrUpdateNode(nodes6, noteData, classes3);
+ insertOrUpdateNode(nodes6, nodeData2, classes3);
let from2 = itemId;
let to = noteData.id;
if (parsedItem.note.position === "left of") {
from2 = noteData.id;
to = itemId;
}
- edges5.push({
+ edges3.push({
id: from2 + "-" + to,
start: from2,
end: to,
@@ -89897,12 +94897,12 @@ g.classGroup line {
look
});
} else {
- insertOrUpdateNode(nodes6, nodeData2, classes6);
+ insertOrUpdateNode(nodes6, nodeData2, classes3);
}
}
if (parsedItem.doc) {
log.trace("Adding nodes children ");
- setupDoc(parsedItem, parsedItem.doc, diagramStates, nodes6, edges5, !altFlag, look, classes6);
+ setupDoc(parsedItem, parsedItem.doc, diagramStates, nodes6, edges3, !altFlag, look, classes3);
}
}, "dataFetcher");
reset2 = /* @__PURE__ */ __name(() => {
@@ -89913,7 +94913,7 @@ g.classGroup line {
});
// src/diagrams/state/stateRenderer-v3-unified.ts
- var getDir2, getClasses4, draw14, stateRenderer_v3_unified_default;
+ var getDir3, getClasses3, draw13, stateRenderer_v3_unified_default;
var init_stateRenderer_v3_unified = __esm({
"src/diagrams/state/stateRenderer-v3-unified.ts"() {
"use strict";
@@ -89924,7 +94924,7 @@ g.classGroup line {
init_setupViewPortForSVG();
init_utils2();
init_stateCommon();
- getDir2 = /* @__PURE__ */ __name((parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
+ getDir3 = /* @__PURE__ */ __name((parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
if (!parsedItem.doc) {
return defaultDir;
}
@@ -89936,37 +94936,36 @@ g.classGroup line {
}
return dir2;
}, "getDir");
- getClasses4 = /* @__PURE__ */ __name(function(text2, diagramObj) {
- diagramObj.db.extract(diagramObj.db.getRootDocV2());
+ getClasses3 = /* @__PURE__ */ __name(function(text4, diagramObj) {
return diagramObj.db.getClasses();
}, "getClasses");
- draw14 = /* @__PURE__ */ __name(async function(text2, id27, _version, diag) {
+ draw13 = /* @__PURE__ */ __name(async function(text4, id29, _version, diag) {
log.info("REF0:");
- log.info("Drawing state diagram (v2)", id27);
- const { securityLevel, state: conf8, layout: layout6 } = getConfig2();
+ log.info("Drawing state diagram (v2)", id29);
+ const { securityLevel, state: conf5, layout: layout6 } = getConfig2();
diag.db.extract(diag.db.getRootDocV2());
const data4Layout = diag.db.getData();
- const svg = getDiagramElement(id27, securityLevel);
+ const svg2 = getDiagramElement(id29, securityLevel);
data4Layout.type = diag.type;
data4Layout.layoutAlgorithm = layout6;
- data4Layout.nodeSpacing = conf8?.nodeSpacing || 50;
- data4Layout.rankSpacing = conf8?.rankSpacing || 50;
+ data4Layout.nodeSpacing = conf5?.nodeSpacing || 50;
+ data4Layout.rankSpacing = conf5?.rankSpacing || 50;
data4Layout.markers = ["barb"];
- data4Layout.diagramId = id27;
- await render4(data4Layout, svg);
- const padding3 = 8;
+ data4Layout.diagramId = id29;
+ await render4(data4Layout, svg2);
+ const padding2 = 8;
utils_default2.insertTitle(
- svg,
+ svg2,
"statediagramTitleText",
- conf8?.titleTopMargin ?? 25,
+ conf5?.titleTopMargin ?? 25,
diag.db.getDiagramTitle()
);
- setupViewPortForSVG(svg, padding3, CSS_DIAGRAM, conf8?.useMaxWidth ?? true);
+ setupViewPortForSVG(svg2, padding2, CSS_DIAGRAM, conf5?.useMaxWidth ?? true);
}, "draw");
stateRenderer_v3_unified_default = {
- getClasses: getClasses4,
- draw: draw14,
- getDir: getDir2
+ getClasses: getClasses3,
+ draw: draw13,
+ getDir: getDir3
};
}
});
@@ -89975,67 +94974,14 @@ g.classGroup line {
function newClassesList() {
return /* @__PURE__ */ new Map();
}
- function startIdIfNeeded(id27 = "") {
- let fixedId = id27;
- if (id27 === START_NODE) {
- startEndCount++;
- fixedId = `${START_TYPE}${startEndCount}`;
- }
- return fixedId;
- }
- function startTypeIfNeeded(id27 = "", type3 = DEFAULT_STATE_TYPE) {
- return id27 === START_NODE ? START_TYPE : type3;
- }
- function endIdIfNeeded(id27 = "") {
- let fixedId = id27;
- if (id27 === END_NODE) {
- startEndCount++;
- fixedId = `${END_TYPE}${startEndCount}`;
- }
- return fixedId;
- }
- function endTypeIfNeeded(id27 = "", type3 = DEFAULT_STATE_TYPE) {
- return id27 === END_NODE ? END_TYPE : type3;
- }
- function addRelationObjs(item1, item2, relationTitle) {
- let id1 = startIdIfNeeded(item1.id.trim());
- let type1 = startTypeIfNeeded(item1.id.trim(), item1.type);
- let id27 = startIdIfNeeded(item2.id.trim());
- let type22 = startTypeIfNeeded(item2.id.trim(), item2.type);
- addState(
- id1,
- type1,
- item1.doc,
- item1.description,
- item1.note,
- item1.classes,
- item1.styles,
- item1.textStyles
- );
- addState(
- id27,
- type22,
- item2.doc,
- item2.description,
- item2.note,
- item2.classes,
- item2.styles,
- item2.textStyles
- );
- currentDocument.relations.push({
- id1,
- id2: id27,
- relationTitle: common_default.sanitizeText(relationTitle, getConfig2())
- });
- }
- var START_NODE, START_TYPE, END_NODE, END_TYPE, COLOR_KEYWORD, FILL_KEYWORD, BG_FILL, STYLECLASS_SEP, nodes, edges2, direction3, rootDoc, classes3, newDoc, documents, currentDocument, startEndCount, dividerCnt, lineType2, relationType2, clone2, setRootDoc, getRootDoc, docTranslator, getRootDocV2, extract, addState, clear22, getState, getStates, logDocuments, getRelations2, addRelation2, addDescription, cleanupLabel2, getDividerId, addStyleClass, getClasses5, setCssClass2, setStyle, setTextStyle, getDirection4, setDirection4, trimColon, getData2, stateDb_default;
+ var START_NODE, START_TYPE, END_NODE, END_TYPE, COLOR_KEYWORD, FILL_KEYWORD, BG_FILL, STYLECLASS_SEP, newDoc, clone3, StateDB;
var init_stateDb = __esm({
"src/diagrams/state/stateDb.js"() {
"use strict";
+ init_diagramAPI();
init_logger();
init_utils2();
init_common();
- init_diagramAPI();
init_commonDb();
init_dataFetcher();
init_stateRenderer_v3_unified();
@@ -90049,11 +94995,6 @@ g.classGroup line {
BG_FILL = "bgFill";
STYLECLASS_SEP = ",";
__name(newClassesList, "newClassesList");
- nodes = [];
- edges2 = [];
- direction3 = DEFAULT_DIAGRAM_DIRECTION;
- rootDoc = [];
- classes3 = newClassesList();
newDoc = /* @__PURE__ */ __name(() => {
return {
/** @type {{ id1: string, id2: string, relationTitle: string }[]} */
@@ -90062,339 +95003,573 @@ g.classGroup line {
documents: {}
};
}, "newDoc");
- documents = {
- root: newDoc()
- };
- currentDocument = documents.root;
- startEndCount = 0;
- dividerCnt = 0;
- lineType2 = {
- LINE: 0,
- DOTTED_LINE: 1
- };
- relationType2 = {
- AGGREGATION: 0,
- EXTENSION: 1,
- COMPOSITION: 2,
- DEPENDENCY: 3
- };
- clone2 = /* @__PURE__ */ __name((o2) => JSON.parse(JSON.stringify(o2)), "clone");
- setRootDoc = /* @__PURE__ */ __name((o2) => {
- log.info("Setting root doc", o2);
- rootDoc = o2;
- }, "setRootDoc");
- getRootDoc = /* @__PURE__ */ __name(() => rootDoc, "getRootDoc");
- docTranslator = /* @__PURE__ */ __name((parent4, node2, first3) => {
- if (node2.stmt === STMT_RELATION) {
- docTranslator(parent4, node2.state1, true);
- docTranslator(parent4, node2.state2, false);
- } else {
- if (node2.stmt === STMT_STATE) {
- if (node2.id === "[*]") {
- node2.id = first3 ? parent4.id + "_start" : parent4.id + "_end";
- node2.start = first3;
- } else {
- node2.id = node2.id.trim();
- }
- }
- if (node2.doc) {
- const doc = [];
- let currentDoc = [];
- let i2;
- for (i2 = 0; i2 < node2.doc.length; i2++) {
- if (node2.doc[i2].type === DIVIDER_TYPE) {
- const newNode = clone2(node2.doc[i2]);
- newNode.doc = clone2(currentDoc);
- doc.push(newNode);
- currentDoc = [];
+ clone3 = /* @__PURE__ */ __name((o2) => JSON.parse(JSON.stringify(o2)), "clone");
+ StateDB = class {
+ static {
+ __name(this, "StateDB");
+ }
+ /**
+ * @param {1 | 2} version - v1 renderer or v2 renderer.
+ */
+ constructor(version2) {
+ this.clear();
+ this.version = version2;
+ this.setRootDoc = this.setRootDoc.bind(this);
+ this.getDividerId = this.getDividerId.bind(this);
+ this.setDirection = this.setDirection.bind(this);
+ this.trimColon = this.trimColon.bind(this);
+ }
+ /**
+ * @private
+ * @type {1 | 2}
+ */
+ version;
+ /**
+ * @private
+ * @type {Array}
+ */
+ nodes = [];
+ /**
+ * @private
+ * @type {Array}
+ */
+ edges = [];
+ /**
+ * @private
+ * @type {Array}
+ */
+ rootDoc = [];
+ /**
+ * @private
+ * @type {Map}
+ */
+ classes = newClassesList();
+ // style classes defined by a classDef
+ /**
+ * @private
+ * @type {Object}
+ */
+ documents = {
+ root: newDoc()
+ };
+ /**
+ * @private
+ * @type {Object}
+ */
+ currentDocument = this.documents.root;
+ /**
+ * @private
+ * @type {number}
+ */
+ startEndCount = 0;
+ /**
+ * @private
+ * @type {number}
+ */
+ dividerCnt = 0;
+ static relationType = {
+ AGGREGATION: 0,
+ EXTENSION: 1,
+ COMPOSITION: 2,
+ DEPENDENCY: 3
+ };
+ setRootDoc(o2) {
+ log.info("Setting root doc", o2);
+ this.rootDoc = o2;
+ if (this.version === 1) {
+ this.extract(o2);
+ } else {
+ this.extract(this.getRootDocV2());
+ }
+ }
+ getRootDoc() {
+ return this.rootDoc;
+ }
+ /**
+ * @private
+ * @param {Object} parent
+ * @param {Object} node
+ * @param {boolean} first
+ */
+ docTranslator(parent4, node2, first3) {
+ if (node2.stmt === STMT_RELATION) {
+ this.docTranslator(parent4, node2.state1, true);
+ this.docTranslator(parent4, node2.state2, false);
+ } else {
+ if (node2.stmt === STMT_STATE) {
+ if (node2.id === "[*]") {
+ node2.id = first3 ? parent4.id + "_start" : parent4.id + "_end";
+ node2.start = first3;
} else {
- currentDoc.push(node2.doc[i2]);
+ node2.id = node2.id.trim();
}
}
- if (doc.length > 0 && currentDoc.length > 0) {
- const newNode = {
- stmt: STMT_STATE,
- id: generateId(),
- type: "divider",
- doc: clone2(currentDoc)
- };
- doc.push(clone2(newNode));
- node2.doc = doc;
+ if (node2.doc) {
+ const doc = [];
+ let currentDoc = [];
+ let i2;
+ for (i2 = 0; i2 < node2.doc.length; i2++) {
+ if (node2.doc[i2].type === DIVIDER_TYPE) {
+ const newNode = clone3(node2.doc[i2]);
+ newNode.doc = clone3(currentDoc);
+ doc.push(newNode);
+ currentDoc = [];
+ } else {
+ currentDoc.push(node2.doc[i2]);
+ }
+ }
+ if (doc.length > 0 && currentDoc.length > 0) {
+ const newNode = {
+ stmt: STMT_STATE,
+ id: generateId(),
+ type: "divider",
+ doc: clone3(currentDoc)
+ };
+ doc.push(clone3(newNode));
+ node2.doc = doc;
+ }
+ node2.doc.forEach((docNode) => this.docTranslator(node2, docNode, true));
}
- node2.doc.forEach((docNode) => docTranslator(node2, docNode, true));
}
}
- }, "docTranslator");
- getRootDocV2 = /* @__PURE__ */ __name(() => {
- docTranslator({ id: "root" }, { id: "root", doc: rootDoc }, true);
- return { id: "root", doc: rootDoc };
- }, "getRootDocV2");
- extract = /* @__PURE__ */ __name((_doc) => {
- let doc;
- if (_doc.doc) {
- doc = _doc.doc;
- } else {
- doc = _doc;
+ /**
+ * @private
+ */
+ getRootDocV2() {
+ this.docTranslator({ id: "root" }, { id: "root", doc: this.rootDoc }, true);
+ return { id: "root", doc: this.rootDoc };
}
- log.info(doc);
- clear22(true);
- log.info("Extract initial document:", doc);
- doc.forEach((item) => {
- log.warn("Statement", item.stmt);
- switch (item.stmt) {
- case STMT_STATE:
- addState(
- item.id.trim(),
- item.type,
- item.doc,
- item.description,
- item.note,
- item.classes,
- item.styles,
- item.textStyles
- );
- break;
- case STMT_RELATION:
- addRelation2(item.state1, item.state2, item.description);
- break;
- case STMT_CLASSDEF:
- addStyleClass(item.id.trim(), item.classes);
- break;
- case STMT_STYLEDEF:
- {
- const ids = item.id.trim().split(",");
- const styles3 = item.styleClass.split(",");
- ids.forEach((id27) => {
- let foundState = getState(id27);
- if (foundState === void 0) {
- const trimmedId = id27.trim();
- addState(trimmedId);
- foundState = getState(trimmedId);
- }
- foundState.styles = styles3.map((s2) => s2.replace(/;/g, "")?.trim());
- });
+ /**
+ * Convert all of the statements (stmts) that were parsed into states and relationships.
+ * This is done because a state diagram may have nested sections,
+ * where each section is a 'document' and has its own set of statements.
+ * Ex: the section within a fork has its own statements, and incoming and outgoing statements
+ * refer to the fork as a whole (document).
+ * See the parser grammar: the definition of a document is a document then a 'line', where a line can be a statement.
+ * This will push the statement into the list of statements for the current document.
+ * @private
+ * @param _doc
+ */
+ extract(_doc) {
+ let doc;
+ if (_doc.doc) {
+ doc = _doc.doc;
+ } else {
+ doc = _doc;
+ }
+ log.info(doc);
+ this.clear(true);
+ log.info("Extract initial document:", doc);
+ doc.forEach((item) => {
+ log.warn("Statement", item.stmt);
+ switch (item.stmt) {
+ case STMT_STATE:
+ this.addState(
+ item.id.trim(),
+ item.type,
+ item.doc,
+ item.description,
+ item.note,
+ item.classes,
+ item.styles,
+ item.textStyles
+ );
+ break;
+ case STMT_RELATION:
+ this.addRelation(item.state1, item.state2, item.description);
+ break;
+ case STMT_CLASSDEF:
+ this.addStyleClass(item.id.trim(), item.classes);
+ break;
+ case STMT_STYLEDEF:
+ {
+ const ids = item.id.trim().split(",");
+ const styles4 = item.styleClass.split(",");
+ ids.forEach((id29) => {
+ let foundState = this.getState(id29);
+ if (foundState === void 0) {
+ const trimmedId = id29.trim();
+ this.addState(trimmedId);
+ foundState = this.getState(trimmedId);
+ }
+ foundState.styles = styles4.map((s2) => s2.replace(/;/g, "")?.trim());
+ });
+ }
+ break;
+ case STMT_APPLYCLASS:
+ this.setCssClass(item.id.trim(), item.styleClass);
+ break;
+ }
+ });
+ const diagramStates = this.getStates();
+ const config5 = getConfig2();
+ const look = config5.look;
+ reset2();
+ dataFetcher(
+ void 0,
+ this.getRootDocV2(),
+ diagramStates,
+ this.nodes,
+ this.edges,
+ true,
+ look,
+ this.classes
+ );
+ this.nodes.forEach((node2) => {
+ if (Array.isArray(node2.label)) {
+ node2.description = node2.label.slice(1);
+ if (node2.isGroup && node2.description.length > 0) {
+ throw new Error(
+ "Group nodes can only have label. Remove the additional description for node [" + node2.id + "]"
+ );
}
- break;
- case STMT_APPLYCLASS:
- setCssClass2(item.id.trim(), item.styleClass);
- break;
+ node2.label = node2.label[0];
+ }
+ });
+ }
+ /**
+ * Function called by parser when a node definition has been found.
+ *
+ * @param {null | string} id
+ * @param {null | string} type
+ * @param {null | string} doc
+ * @param {null | string | string[]} descr - description for the state. Can be a string or a list or strings
+ * @param {null | string} note
+ * @param {null | string | string[]} classes - class styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 class, convert it to an array of that 1 class.
+ * @param {null | string | string[]} styles - styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 style, convert it to an array of that 1 style.
+ * @param {null | string | string[]} textStyles - text styles to apply to this state. Can be a string (1 text test) or an array of text styles. If it's just 1 text style, convert it to an array of that 1 text style.
+ */
+ addState(id29, type3 = DEFAULT_STATE_TYPE, doc = null, descr = null, note3 = null, classes3 = null, styles4 = null, textStyles = null) {
+ const trimmedId = id29?.trim();
+ if (!this.currentDocument.states.has(trimmedId)) {
+ log.info("Adding state ", trimmedId, descr);
+ this.currentDocument.states.set(trimmedId, {
+ id: trimmedId,
+ descriptions: [],
+ type: type3,
+ doc,
+ note: note3,
+ classes: [],
+ styles: [],
+ textStyles: []
+ });
+ } else {
+ if (!this.currentDocument.states.get(trimmedId).doc) {
+ this.currentDocument.states.get(trimmedId).doc = doc;
+ }
+ if (!this.currentDocument.states.get(trimmedId).type) {
+ this.currentDocument.states.get(trimmedId).type = type3;
+ }
}
- });
- const diagramStates = getStates();
- const config6 = getConfig2();
- const look = config6.look;
- reset2();
- dataFetcher(void 0, getRootDocV2(), diagramStates, nodes, edges2, true, look, classes3);
- nodes.forEach((node2) => {
- if (Array.isArray(node2.label)) {
- node2.description = node2.label.slice(1);
- if (node2.isGroup && node2.description.length > 0) {
- throw new Error(
- "Group nodes can only have label. Remove the additional description for node [" + node2.id + "]"
- );
+ if (descr) {
+ log.info("Setting state description", trimmedId, descr);
+ if (typeof descr === "string") {
+ this.addDescription(trimmedId, descr.trim());
+ }
+ if (typeof descr === "object") {
+ descr.forEach((des) => this.addDescription(trimmedId, des.trim()));
}
- node2.label = node2.label[0];
}
- });
- }, "extract");
- addState = /* @__PURE__ */ __name(function(id27, type3 = DEFAULT_STATE_TYPE, doc = null, descr = null, note3 = null, classes6 = null, styles3 = null, textStyles = null) {
- const trimmedId = id27?.trim();
- if (!currentDocument.states.has(trimmedId)) {
- log.info("Adding state ", trimmedId, descr);
- currentDocument.states.set(trimmedId, {
- id: trimmedId,
- descriptions: [],
- type: type3,
- doc,
- note: note3,
- classes: [],
- styles: [],
- textStyles: []
- });
- } else {
- if (!currentDocument.states.get(trimmedId).doc) {
- currentDocument.states.get(trimmedId).doc = doc;
+ if (note3) {
+ const doc2 = this.currentDocument.states.get(trimmedId);
+ doc2.note = note3;
+ doc2.note.text = common_default.sanitizeText(doc2.note.text, getConfig2());
}
- if (!currentDocument.states.get(trimmedId).type) {
- currentDocument.states.get(trimmedId).type = type3;
+ if (classes3) {
+ log.info("Setting state classes", trimmedId, classes3);
+ const classesList = typeof classes3 === "string" ? [classes3] : classes3;
+ classesList.forEach((cssClass) => this.setCssClass(trimmedId, cssClass.trim()));
}
- }
- if (descr) {
- log.info("Setting state description", trimmedId, descr);
- if (typeof descr === "string") {
- addDescription(trimmedId, descr.trim());
+ if (styles4) {
+ log.info("Setting state styles", trimmedId, styles4);
+ const stylesList = typeof styles4 === "string" ? [styles4] : styles4;
+ stylesList.forEach((style3) => this.setStyle(trimmedId, style3.trim()));
}
- if (typeof descr === "object") {
- descr.forEach((des) => addDescription(trimmedId, des.trim()));
+ if (textStyles) {
+ log.info("Setting state styles", trimmedId, styles4);
+ const textStylesList = typeof textStyles === "string" ? [textStyles] : textStyles;
+ textStylesList.forEach((textStyle) => this.setTextStyle(trimmedId, textStyle.trim()));
}
}
- if (note3) {
- const doc2 = currentDocument.states.get(trimmedId);
- doc2.note = note3;
- doc2.note.text = common_default.sanitizeText(doc2.note.text, getConfig2());
+ clear(saveCommon) {
+ this.nodes = [];
+ this.edges = [];
+ this.documents = {
+ root: newDoc()
+ };
+ this.currentDocument = this.documents.root;
+ this.startEndCount = 0;
+ this.classes = newClassesList();
+ if (!saveCommon) {
+ clear();
+ }
}
- if (classes6) {
- log.info("Setting state classes", trimmedId, classes6);
- const classesList = typeof classes6 === "string" ? [classes6] : classes6;
- classesList.forEach((cssClass) => setCssClass2(trimmedId, cssClass.trim()));
+ getState(id29) {
+ return this.currentDocument.states.get(id29);
}
- if (styles3) {
- log.info("Setting state styles", trimmedId, styles3);
- const stylesList = typeof styles3 === "string" ? [styles3] : styles3;
- stylesList.forEach((style3) => setStyle(trimmedId, style3.trim()));
+ getStates() {
+ return this.currentDocument.states;
}
- if (textStyles) {
- log.info("Setting state styles", trimmedId, styles3);
- const textStylesList = typeof textStyles === "string" ? [textStyles] : textStyles;
- textStylesList.forEach((textStyle) => setTextStyle(trimmedId, textStyle.trim()));
+ logDocuments() {
+ log.info("Documents = ", this.documents);
}
- }, "addState");
- clear22 = /* @__PURE__ */ __name(function(saveCommon) {
- nodes = [];
- edges2 = [];
- documents = {
- root: newDoc()
- };
- currentDocument = documents.root;
- startEndCount = 0;
- classes3 = newClassesList();
- if (!saveCommon) {
- clear();
+ getRelations() {
+ return this.currentDocument.relations;
}
- }, "clear");
- getState = /* @__PURE__ */ __name(function(id27) {
- return currentDocument.states.get(id27);
- }, "getState");
- getStates = /* @__PURE__ */ __name(function() {
- return currentDocument.states;
- }, "getStates");
- logDocuments = /* @__PURE__ */ __name(function() {
- log.info("Documents = ", documents);
- }, "logDocuments");
- getRelations2 = /* @__PURE__ */ __name(function() {
- return currentDocument.relations;
- }, "getRelations");
- __name(startIdIfNeeded, "startIdIfNeeded");
- __name(startTypeIfNeeded, "startTypeIfNeeded");
- __name(endIdIfNeeded, "endIdIfNeeded");
- __name(endTypeIfNeeded, "endTypeIfNeeded");
- __name(addRelationObjs, "addRelationObjs");
- addRelation2 = /* @__PURE__ */ __name(function(item1, item2, title2) {
- if (typeof item1 === "object") {
- addRelationObjs(item1, item2, title2);
- } else {
- const id1 = startIdIfNeeded(item1.trim());
- const type1 = startTypeIfNeeded(item1);
- const id27 = endIdIfNeeded(item2.trim());
- const type22 = endTypeIfNeeded(item2);
- addState(id1, type1);
- addState(id27, type22);
- currentDocument.relations.push({
+ /**
+ * If the id is a start node ( [*] ), then return a new id constructed from
+ * the start node name and the current start node count.
+ * else return the given id
+ *
+ * @param {string} id
+ * @returns {string} - the id (original or constructed)
+ * @private
+ */
+ startIdIfNeeded(id29 = "") {
+ let fixedId = id29;
+ if (id29 === START_NODE) {
+ this.startEndCount++;
+ fixedId = `${START_TYPE}${this.startEndCount}`;
+ }
+ return fixedId;
+ }
+ /**
+ * If the id is a start node ( [*] ), then return the start type ('start')
+ * else return the given type
+ *
+ * @param {string} id
+ * @param {string} type
+ * @returns {string} - the type that should be used
+ * @private
+ */
+ startTypeIfNeeded(id29 = "", type3 = DEFAULT_STATE_TYPE) {
+ return id29 === START_NODE ? START_TYPE : type3;
+ }
+ /**
+ * If the id is an end node ( [*] ), then return a new id constructed from
+ * the end node name and the current start_end node count.
+ * else return the given id
+ *
+ * @param {string} id
+ * @returns {string} - the id (original or constructed)
+ * @private
+ */
+ endIdIfNeeded(id29 = "") {
+ let fixedId = id29;
+ if (id29 === END_NODE) {
+ this.startEndCount++;
+ fixedId = `${END_TYPE}${this.startEndCount}`;
+ }
+ return fixedId;
+ }
+ /**
+ * If the id is an end node ( [*] ), then return the end type
+ * else return the given type
+ *
+ * @param {string} id
+ * @param {string} type
+ * @returns {string} - the type that should be used
+ * @private
+ */
+ endTypeIfNeeded(id29 = "", type3 = DEFAULT_STATE_TYPE) {
+ return id29 === END_NODE ? END_TYPE : type3;
+ }
+ /**
+ *
+ * @param item1
+ * @param item2
+ * @param relationTitle
+ */
+ addRelationObjs(item1, item2, relationTitle) {
+ let id1 = this.startIdIfNeeded(item1.id.trim());
+ let type1 = this.startTypeIfNeeded(item1.id.trim(), item1.type);
+ let id29 = this.startIdIfNeeded(item2.id.trim());
+ let type22 = this.startTypeIfNeeded(item2.id.trim(), item2.type);
+ this.addState(
+ id1,
+ type1,
+ item1.doc,
+ item1.description,
+ item1.note,
+ item1.classes,
+ item1.styles,
+ item1.textStyles
+ );
+ this.addState(
+ id29,
+ type22,
+ item2.doc,
+ item2.description,
+ item2.note,
+ item2.classes,
+ item2.styles,
+ item2.textStyles
+ );
+ this.currentDocument.relations.push({
id1,
- id2: id27,
- title: common_default.sanitizeText(title2, getConfig2())
+ id2: id29,
+ relationTitle: common_default.sanitizeText(relationTitle, getConfig2())
});
}
- }, "addRelation");
- addDescription = /* @__PURE__ */ __name(function(id27, descr) {
- const theState = currentDocument.states.get(id27);
- const _descr = descr.startsWith(":") ? descr.replace(":", "").trim() : descr;
- theState.descriptions.push(common_default.sanitizeText(_descr, getConfig2()));
- }, "addDescription");
- cleanupLabel2 = /* @__PURE__ */ __name(function(label) {
- if (label.substring(0, 1) === ":") {
- return label.substr(2).trim();
- } else {
- return label.trim();
- }
- }, "cleanupLabel");
- getDividerId = /* @__PURE__ */ __name(() => {
- dividerCnt++;
- return "divider-id-" + dividerCnt;
- }, "getDividerId");
- addStyleClass = /* @__PURE__ */ __name(function(id27, styleAttributes = "") {
- if (!classes3.has(id27)) {
- classes3.set(id27, { id: id27, styles: [], textStyles: [] });
- }
- const foundClass = classes3.get(id27);
- if (styleAttributes !== void 0 && styleAttributes !== null) {
- styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => {
- const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
- if (RegExp(COLOR_KEYWORD).exec(attrib)) {
- const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
- const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
- foundClass.textStyles.push(newStyle2);
- }
- foundClass.styles.push(fixedAttrib);
+ /**
+ * Add a relation between two items. The items may be full objects or just the string id of a state.
+ *
+ * @param {string | object} item1
+ * @param {string | object} item2
+ * @param {string} title
+ */
+ addRelation(item1, item2, title2) {
+ if (typeof item1 === "object") {
+ this.addRelationObjs(item1, item2, title2);
+ } else {
+ const id1 = this.startIdIfNeeded(item1.trim());
+ const type1 = this.startTypeIfNeeded(item1);
+ const id29 = this.endIdIfNeeded(item2.trim());
+ const type22 = this.endTypeIfNeeded(item2);
+ this.addState(id1, type1);
+ this.addState(id29, type22);
+ this.currentDocument.relations.push({
+ id1,
+ id2: id29,
+ title: common_default.sanitizeText(title2, getConfig2())
+ });
+ }
+ }
+ addDescription(id29, descr) {
+ const theState = this.currentDocument.states.get(id29);
+ const _descr = descr.startsWith(":") ? descr.replace(":", "").trim() : descr;
+ theState.descriptions.push(common_default.sanitizeText(_descr, getConfig2()));
+ }
+ cleanupLabel(label) {
+ if (label.substring(0, 1) === ":") {
+ return label.substr(2).trim();
+ } else {
+ return label.trim();
+ }
+ }
+ getDividerId() {
+ this.dividerCnt++;
+ return "divider-id-" + this.dividerCnt;
+ }
+ /**
+ * Called when the parser comes across a (style) class definition
+ * @example classDef my-style fill:#f96;
+ *
+ * @param {string} id - the id of this (style) class
+ * @param {string | null} styleAttributes - the string with 1 or more style attributes (each separated by a comma)
+ */
+ addStyleClass(id29, styleAttributes = "") {
+ if (!this.classes.has(id29)) {
+ this.classes.set(id29, { id: id29, styles: [], textStyles: [] });
+ }
+ const foundClass = this.classes.get(id29);
+ if (styleAttributes !== void 0 && styleAttributes !== null) {
+ styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => {
+ const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
+ if (RegExp(COLOR_KEYWORD).exec(attrib)) {
+ const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
+ const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
+ foundClass.textStyles.push(newStyle2);
+ }
+ foundClass.styles.push(fixedAttrib);
+ });
+ }
+ }
+ /**
+ * Return all of the style classes
+ * @returns {{} | any | classes}
+ */
+ getClasses() {
+ return this.classes;
+ }
+ /**
+ * Add a (style) class or css class to a state with the given id.
+ * If the state isn't already in the list of known states, add it.
+ * Might be called by parser when a style class or CSS class should be applied to a state
+ *
+ * @param {string | string[]} itemIds The id or a list of ids of the item(s) to apply the css class to
+ * @param {string} cssClassName CSS class name
+ */
+ setCssClass(itemIds, cssClassName) {
+ itemIds.split(",").forEach((id29) => {
+ let foundState = this.getState(id29);
+ if (foundState === void 0) {
+ const trimmedId = id29.trim();
+ this.addState(trimmedId);
+ foundState = this.getState(trimmedId);
+ }
+ foundState.classes.push(cssClassName);
});
}
- }, "addStyleClass");
- getClasses5 = /* @__PURE__ */ __name(function() {
- return classes3;
- }, "getClasses");
- setCssClass2 = /* @__PURE__ */ __name(function(itemIds, cssClassName) {
- itemIds.split(",").forEach(function(id27) {
- let foundState = getState(id27);
- if (foundState === void 0) {
- const trimmedId = id27.trim();
- addState(trimmedId);
- foundState = getState(trimmedId);
- }
- foundState.classes.push(cssClassName);
- });
- }, "setCssClass");
- setStyle = /* @__PURE__ */ __name(function(itemId, styleText) {
- const item = getState(itemId);
- if (item !== void 0) {
- item.styles.push(styleText);
- }
- }, "setStyle");
- setTextStyle = /* @__PURE__ */ __name(function(itemId, cssClassName) {
- const item = getState(itemId);
- if (item !== void 0) {
- item.textStyles.push(cssClassName);
- }
- }, "setTextStyle");
- getDirection4 = /* @__PURE__ */ __name(() => direction3, "getDirection");
- setDirection4 = /* @__PURE__ */ __name((dir2) => {
- direction3 = dir2;
- }, "setDirection");
- trimColon = /* @__PURE__ */ __name((str2) => str2 && str2[0] === ":" ? str2.substr(1).trim() : str2.trim(), "trimColon");
- getData2 = /* @__PURE__ */ __name(() => {
- const config6 = getConfig2();
- return { nodes, edges: edges2, other: {}, config: config6, direction: getDir2(getRootDocV2()) };
- }, "getData");
- stateDb_default = {
- getConfig: /* @__PURE__ */ __name(() => getConfig2().state, "getConfig"),
- getData: getData2,
- addState,
- clear: clear22,
- getState,
- getStates,
- getRelations: getRelations2,
- getClasses: getClasses5,
- getDirection: getDirection4,
- addRelation: addRelation2,
- getDividerId,
- setDirection: setDirection4,
- cleanupLabel: cleanupLabel2,
- lineType: lineType2,
- relationType: relationType2,
- logDocuments,
- getRootDoc,
- setRootDoc,
- getRootDocV2,
- extract,
- trimColon,
- getAccTitle,
- setAccTitle,
- getAccDescription,
- setAccDescription,
- addStyleClass,
- setCssClass: setCssClass2,
- addDescription,
- setDiagramTitle,
- getDiagramTitle
+ /**
+ * Add a style to a state with the given id.
+ * @example style stateId fill:#f9f,stroke:#333,stroke-width:4px
+ * where 'style' is the keyword
+ * stateId is the id of a state
+ * the rest of the string is the styleText (all of the attributes to be applied to the state)
+ *
+ * @param itemId The id of item to apply the style to
+ * @param styleText - the text of the attributes for the style
+ */
+ setStyle(itemId, styleText) {
+ const item = this.getState(itemId);
+ if (item !== void 0) {
+ item.styles.push(styleText);
+ }
+ }
+ /**
+ * Add a text style to a state with the given id
+ *
+ * @param itemId The id of item to apply the css class to
+ * @param cssClassName CSS class name
+ */
+ setTextStyle(itemId, cssClassName) {
+ const item = this.getState(itemId);
+ if (item !== void 0) {
+ item.textStyles.push(cssClassName);
+ }
+ }
+ /**
+ * Finds the direction statement in the root document.
+ * @private
+ * @returns {{ value: string } | undefined} - the direction statement if present
+ */
+ getDirectionStatement() {
+ return this.rootDoc.find((doc) => doc.stmt === STMT_DIRECTION);
+ }
+ getDirection() {
+ return this.getDirectionStatement()?.value ?? DEFAULT_DIAGRAM_DIRECTION;
+ }
+ setDirection(dir2) {
+ const doc = this.getDirectionStatement();
+ if (doc) {
+ doc.value = dir2;
+ } else {
+ this.rootDoc.unshift({ stmt: STMT_DIRECTION, value: dir2 });
+ }
+ }
+ trimColon(str2) {
+ return str2 && str2[0] === ":" ? str2.substr(1).trim() : str2.trim();
+ }
+ getData() {
+ const config5 = getConfig2();
+ return {
+ nodes: this.nodes,
+ edges: this.edges,
+ other: {},
+ config: config5,
+ direction: getDir3(this.getRootDocV2())
+ };
+ }
+ getConfig() {
+ return getConfig2().state;
+ }
+ getAccTitle = getAccTitle;
+ setAccTitle = setAccTitle;
+ getAccDescription = getAccDescription;
+ setAccDescription = setAccDescription;
+ setDiagramTitle = setDiagramTitle;
+ getDiagramTitle = getDiagramTitle;
};
}
});
@@ -90624,20 +95799,20 @@ g.stateGroup line {
});
// src/diagrams/state/id-cache.js
- var idCache2, set3, get4, keys2, size2, id_cache_default;
+ var idCache, set4, get4, keys2, size2, id_cache_default;
var init_id_cache = __esm({
"src/diagrams/state/id-cache.js"() {
"use strict";
- idCache2 = {};
- set3 = /* @__PURE__ */ __name((key, val) => {
- idCache2[key] = val;
+ idCache = {};
+ set4 = /* @__PURE__ */ __name((key, val) => {
+ idCache[key] = val;
}, "set");
- get4 = /* @__PURE__ */ __name((k2) => idCache2[k2], "get");
- keys2 = /* @__PURE__ */ __name(() => Object.keys(idCache2), "keys");
+ get4 = /* @__PURE__ */ __name((k2) => idCache[k2], "get");
+ keys2 = /* @__PURE__ */ __name(() => Object.keys(idCache), "keys");
size2 = /* @__PURE__ */ __name(() => keys2().length, "size");
id_cache_default = {
get: get4,
- set: set3,
+ set: set4,
keys: keys2,
size: size2
};
@@ -90645,8 +95820,8 @@ g.stateGroup line {
});
// src/diagrams/state/shapes.js
- var drawStartState, drawDivider, drawSimpleState, drawDescrState, addTitleAndBox, drawEndState, drawForkJoinState, _drawLongText, drawNote3, drawState, edgeCount2, drawEdge2;
- var init_shapes = __esm({
+ var drawStartState, drawDivider, drawSimpleState, drawDescrState, addTitleAndBox, drawEndState, drawForkJoinState, _drawLongText, drawNote2, drawState, edgeCount, drawEdge;
+ var init_shapes2 = __esm({
"src/diagrams/state/shapes.js"() {
"use strict";
init_src32();
@@ -90659,13 +95834,13 @@ g.stateGroup line {
drawStartState = /* @__PURE__ */ __name((g2) => g2.append("circle").attr("class", "start-state").attr("r", getConfig2().state.sizeUnit).attr("cx", getConfig2().state.padding + getConfig2().state.sizeUnit).attr("cy", getConfig2().state.padding + getConfig2().state.sizeUnit), "drawStartState");
drawDivider = /* @__PURE__ */ __name((g2) => g2.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", getConfig2().state.textHeight).attr("class", "divider").attr("x2", getConfig2().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider");
drawSimpleState = /* @__PURE__ */ __name((g2, stateDef) => {
- const state5 = g2.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 2 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.id);
- const classBox = state5.node().getBBox();
- g2.insert("rect", ":first-child").attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding).attr("width", classBox.width + 2 * getConfig2().state.padding).attr("height", classBox.height + 2 * getConfig2().state.padding).attr("rx", getConfig2().state.radius);
- return state5;
+ const state4 = g2.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 2 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.id);
+ const classBox2 = state4.node().getBBox();
+ g2.insert("rect", ":first-child").attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding).attr("width", classBox2.width + 2 * getConfig2().state.padding).attr("height", classBox2.height + 2 * getConfig2().state.padding).attr("rx", getConfig2().state.radius);
+ return state4;
}, "drawSimpleState");
drawDescrState = /* @__PURE__ */ __name((g2, stateDef) => {
- const addTspan2 = /* @__PURE__ */ __name(function(textEl, txt, isFirst2) {
+ const addTspan = /* @__PURE__ */ __name(function(textEl, txt, isFirst2) {
const tSpan = textEl.append("tspan").attr("x", 2 * getConfig2().state.padding).text(txt);
if (!isFirst2) {
tSpan.attr("dy", getConfig2().state.textHeight);
@@ -90682,7 +95857,7 @@ g.stateGroup line {
let isSecond = true;
stateDef.descriptions.forEach(function(descr) {
if (!isFirst) {
- addTspan2(description, descr, isSecond);
+ addTspan(description, descr, isSecond);
isSecond = false;
}
isFirst = false;
@@ -90762,9 +95937,9 @@ g.stateGroup line {
const textElem = g2.append("text");
textElem.style("text-anchor", "start");
textElem.attr("class", "noteText");
- let text2 = _text.replace(/\r\n/g, " ");
- text2 = text2.replace(/\n/g, " ");
- const lines = text2.split(common_default.lineBreakRegex);
+ let text4 = _text.replace(/\r\n/g, " ");
+ text4 = text4.replace(/\n/g, " ");
+ const lines = text4.split(common_default.lineBreakRegex);
let tHeight = 1.25 * getConfig2().state.noteMargin;
for (const line2 of lines) {
const txt = line2.trim();
@@ -90782,24 +95957,24 @@ g.stateGroup line {
}
return { textWidth: textElem.node().getBBox().width, textHeight };
}, "_drawLongText");
- drawNote3 = /* @__PURE__ */ __name((text2, g2) => {
+ drawNote2 = /* @__PURE__ */ __name((text4, g2) => {
g2.attr("class", "state-note");
const note3 = g2.append("rect").attr("x", 0).attr("y", getConfig2().state.padding);
const rectElem = g2.append("g");
- const { textWidth, textHeight } = _drawLongText(text2, 0, 0, rectElem);
+ const { textWidth, textHeight } = _drawLongText(text4, 0, 0, rectElem);
note3.attr("height", textHeight + 2 * getConfig2().state.noteMargin);
note3.attr("width", textWidth + getConfig2().state.noteMargin * 2);
return note3;
}, "drawNote");
drawState = /* @__PURE__ */ __name(function(elem, stateDef) {
- const id27 = stateDef.id;
+ const id29 = stateDef.id;
const stateInfo = {
- id: id27,
+ id: id29,
label: stateDef.id,
width: 0,
height: 0
};
- const g2 = elem.append("g").attr("id", id27).attr("class", "stateGroup");
+ const g2 = elem.append("g").attr("id", id29).attr("class", "stateGroup");
if (stateDef.type === "start") {
drawStartState(g2);
}
@@ -90810,7 +95985,7 @@ g.stateGroup line {
drawForkJoinState(g2, stateDef);
}
if (stateDef.type === "note") {
- drawNote3(stateDef.note.text, g2);
+ drawNote2(stateDef.note.text, g2);
}
if (stateDef.type === "divider") {
drawDivider(g2);
@@ -90824,20 +95999,20 @@ g.stateGroup line {
const stateBox = g2.node().getBBox();
stateInfo.width = stateBox.width + 2 * getConfig2().state.padding;
stateInfo.height = stateBox.height + 2 * getConfig2().state.padding;
- id_cache_default.set(id27, stateInfo);
+ id_cache_default.set(id29, stateInfo);
return stateInfo;
}, "drawState");
- edgeCount2 = 0;
- drawEdge2 = /* @__PURE__ */ __name(function(elem, path4, relation) {
+ edgeCount = 0;
+ drawEdge = /* @__PURE__ */ __name(function(elem, path4, relation) {
const getRelationType = /* @__PURE__ */ __name(function(type3) {
switch (type3) {
- case stateDb_default.relationType.AGGREGATION:
+ case StateDB.relationType.AGGREGATION:
return "aggregation";
- case stateDb_default.relationType.EXTENSION:
+ case StateDB.relationType.EXTENSION:
return "extension";
- case stateDb_default.relationType.COMPOSITION:
+ case StateDB.relationType.COMPOSITION:
return "composition";
- case stateDb_default.relationType.DEPENDENCY:
+ case StateDB.relationType.DEPENDENCY:
return "dependency";
}
}, "getRelationType");
@@ -90848,7 +96023,7 @@ g.stateGroup line {
}).y(function(d2) {
return d2.y;
}).curve(basis_default2);
- const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount2).attr("class", "transition");
+ const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "transition");
let url = "";
if (getConfig2().state.arrowMarkerAbsolute) {
url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
@@ -90857,7 +96032,7 @@ g.stateGroup line {
}
svgPath.attr(
"marker-end",
- "url(" + url + "#" + getRelationType(stateDb_default.relationType.DEPENDENCY) + "End)"
+ "url(" + url + "#" + getRelationType(StateDB.relationType.DEPENDENCY) + "End)"
);
if (relation.title !== void 0) {
const label = elem.append("g").attr("class", "stateLabel");
@@ -90890,13 +96065,13 @@ g.stateGroup line {
label.insert("rect", ":first-child").attr("class", "box").attr("x", x5 - maxWidth / 2 - getConfig2().state.padding / 2).attr("y", y5 - boxHeight / 2 - getConfig2().state.padding / 2 - 3.5).attr("width", maxWidth + getConfig2().state.padding).attr("height", boxHeight + getConfig2().state.padding);
log.info(bounds4);
}
- edgeCount2++;
+ edgeCount++;
}, "drawEdge");
}
});
// src/diagrams/state/stateRenderer.js
- var conf6, transformationLog, setConf6, insertMarkers5, draw15, getLabelWidth, renderDoc, stateRenderer_default;
+ var conf3, transformationLog, setConf4, insertMarkers2, draw14, getLabelWidth, renderDoc, stateRenderer_default;
var init_stateRenderer = __esm({
"src/diagrams/state/stateRenderer.js"() {
"use strict";
@@ -90905,44 +96080,44 @@ g.stateGroup line {
init_graphlib();
init_logger();
init_common();
- init_shapes();
+ init_shapes2();
init_diagramAPI();
init_setupGraphViewbox();
transformationLog = {};
- setConf6 = /* @__PURE__ */ __name(function() {
+ setConf4 = /* @__PURE__ */ __name(function() {
}, "setConf");
- insertMarkers5 = /* @__PURE__ */ __name(function(elem) {
+ insertMarkers2 = /* @__PURE__ */ __name(function(elem) {
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 19,7 L9,13 L14,7 L9,1 Z");
}, "insertMarkers");
- draw15 = /* @__PURE__ */ __name(function(text2, id27, _version, diagObj) {
- conf6 = getConfig2().state;
+ draw14 = /* @__PURE__ */ __name(function(text4, id29, _version, diagObj) {
+ conf3 = getConfig2().state;
const securityLevel = getConfig2().securityLevel;
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
- log.debug("Rendering diagram " + text2);
- const diagram24 = root4.select(`[id='${id27}']`);
- insertMarkers5(diagram24);
- const rootDoc2 = diagObj.db.getRootDoc();
- renderDoc(rootDoc2, diagram24, void 0, false, root4, doc, diagObj);
- const padding3 = conf6.padding;
- const bounds4 = diagram24.node().getBBox();
- const width3 = bounds4.width + padding3 * 2;
- const height2 = bounds4.height + padding3 * 2;
+ log.debug("Rendering diagram " + text4);
+ const diagram26 = root4.select(`[id='${id29}']`);
+ insertMarkers2(diagram26);
+ const rootDoc = diagObj.db.getRootDoc();
+ renderDoc(rootDoc, diagram26, void 0, false, root4, doc, diagObj);
+ const padding2 = conf3.padding;
+ const bounds4 = diagram26.node().getBBox();
+ const width3 = bounds4.width + padding2 * 2;
+ const height2 = bounds4.height + padding2 * 2;
const svgWidth = width3 * 1.75;
- configureSvgSize(diagram24, height2, svgWidth, conf6.useMaxWidth);
- diagram24.attr(
+ configureSvgSize(diagram26, height2, svgWidth, conf3.useMaxWidth);
+ diagram26.attr(
"viewBox",
- `${bounds4.x - conf6.padding} ${bounds4.y - conf6.padding} ` + width3 + " " + height2
+ `${bounds4.x - conf3.padding} ${bounds4.y - conf3.padding} ` + width3 + " " + height2
);
}, "draw");
- getLabelWidth = /* @__PURE__ */ __name((text2) => {
- return text2 ? text2.length * conf6.fontSizeFactor : 1;
+ getLabelWidth = /* @__PURE__ */ __name((text4) => {
+ return text4 ? text4.length * conf3.fontSizeFactor : 1;
}, "getLabelWidth");
- renderDoc = /* @__PURE__ */ __name((doc, diagram24, parentId, altBkg, root4, domDocument, diagObj) => {
+ renderDoc = /* @__PURE__ */ __name((doc, diagram26, parentId, altBkg, root4, domDocument, diagObj) => {
const graph = new Graph({
compound: true,
multigraph: true
@@ -90962,7 +96137,7 @@ g.stateGroup line {
compound: true,
// acyclicer: 'greedy',
ranker: "tight-tree",
- ranksep: edgeFreeDoc ? 1 : conf6.edgeLengthFactor,
+ ranksep: edgeFreeDoc ? 1 : conf3.edgeLengthFactor,
nodeSep: edgeFreeDoc ? 1 : 50,
isMultiGraph: true
// ranksep: 5,
@@ -90976,7 +96151,7 @@ g.stateGroup line {
// isCompound: true,
// acyclicer: 'greedy',
// ranker: 'longest-path'
- ranksep: edgeFreeDoc ? 1 : conf6.edgeLengthFactor,
+ ranksep: edgeFreeDoc ? 1 : conf3.edgeLengthFactor,
nodeSep: edgeFreeDoc ? 1 : 50,
ranker: "tight-tree",
// ranker: 'network-simplex'
@@ -90986,9 +96161,8 @@ g.stateGroup line {
graph.setDefaultEdgeLabel(function() {
return {};
});
- diagObj.db.extract(doc);
const states = diagObj.db.getStates();
- const relations3 = diagObj.db.getRelations();
+ const relations = diagObj.db.getRelations();
const keys3 = Object.keys(states);
let first3 = true;
for (const key of keys3) {
@@ -90998,21 +96172,21 @@ g.stateGroup line {
}
let node2;
if (stateDef.doc) {
- let sub2 = diagram24.append("g").attr("id", stateDef.id).attr("class", "stateGroup");
+ let sub2 = diagram26.append("g").attr("id", stateDef.id).attr("class", "stateGroup");
node2 = renderDoc(stateDef.doc, sub2, stateDef.id, !altBkg, root4, domDocument, diagObj);
if (first3) {
sub2 = addTitleAndBox(sub2, stateDef, altBkg);
let boxBounds = sub2.node().getBBox();
node2.width = boxBounds.width;
- node2.height = boxBounds.height + conf6.padding / 2;
- transformationLog[stateDef.id] = { y: conf6.compositTitleSize };
+ node2.height = boxBounds.height + conf3.padding / 2;
+ transformationLog[stateDef.id] = { y: conf3.compositTitleSize };
} else {
let boxBounds = sub2.node().getBBox();
node2.width = boxBounds.width;
node2.height = boxBounds.height;
}
} else {
- node2 = drawState(diagram24, stateDef, graph);
+ node2 = drawState(diagram26, stateDef, graph);
}
if (stateDef.note) {
const noteDef = {
@@ -91021,7 +96195,7 @@ g.stateGroup line {
note: stateDef.note,
type: "note"
};
- const note3 = drawState(diagram24, noteDef, graph);
+ const note3 = drawState(diagram26, noteDef, graph);
if (stateDef.note.position === "left of") {
graph.setNode(node2.id + "-note", note3);
graph.setNode(node2.id, node2);
@@ -91036,9 +96210,9 @@ g.stateGroup line {
}
}
log.debug("Count=", graph.nodeCount(), graph);
- let cnt4 = 0;
- relations3.forEach(function(relation) {
- cnt4++;
+ let cnt5 = 0;
+ relations.forEach(function(relation) {
+ cnt5++;
log.debug("Setting edge", relation);
graph.setEdge(
relation.id1,
@@ -91046,15 +96220,15 @@ g.stateGroup line {
{
relation,
width: getLabelWidth(relation.title),
- height: conf6.labelHeight * common_default.getRows(relation.title).length,
+ height: conf3.labelHeight * common_default.getRows(relation.title).length,
labelpos: "c"
},
- "id" + cnt4
+ "id" + cnt5
);
});
layout(graph);
log.debug("Graph after layout", graph.nodes());
- const svgElem = diagram24.node();
+ const svgElem = diagram26.node();
graph.nodes().forEach(function(v3) {
if (v3 !== void 0 && graph.node(v3) !== void 0) {
log.warn("Node " + v3 + ": " + JSON.stringify(graph.node(v3)));
@@ -91064,8 +96238,8 @@ g.stateGroup line {
);
root4.select("#" + svgElem.id + " #" + v3).attr("data-x-shift", graph.node(v3).x - graph.node(v3).width / 2);
const dividers = domDocument.querySelectorAll("#" + svgElem.id + " #" + v3 + " .divider");
- dividers.forEach((divider3) => {
- const parent4 = divider3.parentElement;
+ dividers.forEach((divider2) => {
+ const parent4 = divider2.parentElement;
let pWidth = 0;
let pShift = 0;
if (parent4) {
@@ -91077,8 +96251,8 @@ g.stateGroup line {
pShift = 0;
}
}
- divider3.setAttribute("x1", 0 - pShift + 8);
- divider3.setAttribute("x2", pWidth - pShift - 8);
+ divider2.setAttribute("x1", 0 - pShift + 8);
+ divider2.setAttribute("x2", pWidth - pShift - 8);
});
} else {
log.debug("No Node " + v3 + ": " + JSON.stringify(graph.node(v3)));
@@ -91088,7 +96262,7 @@ g.stateGroup line {
graph.edges().forEach(function(e3) {
if (e3 !== void 0 && graph.edge(e3) !== void 0) {
log.debug("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(graph.edge(e3)));
- drawEdge2(diagram24, graph.edge(e3), graph.edge(e3).relation);
+ drawEdge(diagram26, graph.edge(e3), graph.edge(e3).relation);
}
});
stateBox = svgElem.getBBox();
@@ -91098,14 +96272,14 @@ g.stateGroup line {
width: 0,
height: 0
};
- stateInfo.width = stateBox.width + 2 * conf6.padding;
- stateInfo.height = stateBox.height + 2 * conf6.padding;
+ stateInfo.width = stateBox.width + 2 * conf3.padding;
+ stateInfo.height = stateBox.height + 2 * conf3.padding;
log.debug("Doc rendered", stateInfo, graph);
return stateInfo;
}, "renderDoc");
stateRenderer_default = {
- setConf: setConf6,
- draw: draw15
+ setConf: setConf4,
+ draw: draw14
};
}
});
@@ -91125,7 +96299,9 @@ g.stateGroup line {
init_stateRenderer();
diagram14 = {
parser: stateDiagram_default,
- db: stateDb_default,
+ get db() {
+ return new StateDB(1);
+ },
renderer: stateRenderer_default,
styles: styles_default10,
init: /* @__PURE__ */ __name((cnf) => {
@@ -91133,7 +96309,6 @@ g.stateGroup line {
cnf.state = {};
}
cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
- stateDb_default.clear();
}, "init")
};
}
@@ -91154,7 +96329,9 @@ g.stateGroup line {
init_stateRenderer_v3_unified();
diagram15 = {
parser: stateDiagram_default,
- db: stateDb_default,
+ get db() {
+ return new StateDB(2);
+ },
renderer: stateRenderer_v3_unified_default,
styles: styles_default10,
init: /* @__PURE__ */ __name((cnf) => {
@@ -91162,7 +96339,6 @@ g.stateGroup line {
cnf.state = {};
}
cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
- stateDb_default.clear();
}, "init")
};
}
@@ -91178,7 +96354,7 @@ g.stateGroup line {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 18], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 14];
- var parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -91240,7 +96416,7 @@ g.stateGroup line {
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -91270,7 +96446,7 @@ g.stateGroup line {
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -91282,22 +96458,22 @@ g.stateGroup line {
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -91316,7 +96492,7 @@ g.stateGroup line {
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -91616,7 +96792,7 @@ g.stateGroup line {
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -91733,13 +96909,13 @@ g.stateGroup line {
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser15.parser = parser15;
@@ -91748,7 +96924,7 @@ g.stateGroup line {
});
// src/diagrams/user-journey/journeyDb.js
- var currentSection2, sections3, tasks2, rawTasks2, clear23, addSection3, getSections3, getTasks2, updateActors, addTask2, addTaskOrg2, compileTasks2, getActors2, journeyDb_default;
+ var currentSection2, sections3, tasks2, rawTasks2, clear13, addSection3, getSections3, getTasks2, updateActors, addTask2, addTaskOrg2, compileTasks2, getActors, journeyDb_default;
var init_journeyDb = __esm({
"src/diagrams/user-journey/journeyDb.js"() {
"use strict";
@@ -91758,7 +96934,7 @@ g.stateGroup line {
sections3 = [];
tasks2 = [];
rawTasks2 = [];
- clear23 = /* @__PURE__ */ __name(function() {
+ clear13 = /* @__PURE__ */ __name(function() {
sections3.length = 0;
tasks2.length = 0;
currentSection2 = "";
@@ -91835,12 +97011,12 @@ g.stateGroup line {
}
return allProcessed;
}, "compileTasks");
- getActors2 = /* @__PURE__ */ __name(function() {
+ getActors = /* @__PURE__ */ __name(function() {
return updateActors();
}, "getActors");
journeyDb_default = {
getConfig: /* @__PURE__ */ __name(() => getConfig2().journey, "getConfig"),
- clear: clear23,
+ clear: clear13,
setDiagramTitle,
getDiagramTitle,
setAccTitle,
@@ -91852,7 +97028,7 @@ g.stateGroup line {
getTasks: getTasks2,
addTask: addTask2,
addTaskOrg: addTaskOrg2,
- getActors: getActors2
+ getActors
};
}
});
@@ -91863,8 +97039,7 @@ g.stateGroup line {
"src/diagrams/user-journey/styles.js"() {
"use strict";
getStyles12 = /* @__PURE__ */ __name((options3) => `.label {
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
- font-family: var(--mermaid-font-family);
+ font-family: ${options3.fontFamily};
color: ${options3.textColor};
}
.mouth {
@@ -91877,6 +97052,7 @@ g.stateGroup line {
.legend {
fill: ${options3.textColor};
+ font-family: ${options3.fontFamily};
}
.label text {
@@ -91942,8 +97118,7 @@ g.stateGroup line {
text-align: center;
max-width: 200px;
padding: 2px;
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
- font-family: var(--mermaid-font-family);
+ font-family: ${options3.fontFamily};
font-size: 12px;
background: ${options3.tertiaryColor};
border: 1px solid ${options3.border2};
@@ -92001,8 +97176,8 @@ g.stateGroup line {
});
// src/diagrams/user-journey/svgDraw.js
- var drawRect5, drawFace, drawCircle, drawText4, drawLabel2, drawSection, taskCount, drawTask, drawBackgroundRect3, _drawTextCandidateFunc3, initGraphics, svgDraw_default4;
- var init_svgDraw4 = __esm({
+ var drawRect5, drawFace, drawCircle, drawText4, drawLabel2, drawSection, taskCount, drawTask, drawBackgroundRect3, _drawTextCandidateFunc3, initGraphics, svgDraw_default3;
+ var init_svgDraw3 = __esm({
"src/diagrams/user-journey/svgDraw.js"() {
"use strict";
init_src32();
@@ -92070,34 +97245,34 @@ g.stateGroup line {
txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
drawText4(elem, txtObject);
}, "drawLabel");
- drawSection = /* @__PURE__ */ __name(function(elem, section, conf8) {
+ drawSection = /* @__PURE__ */ __name(function(elem, section, conf5) {
const g2 = elem.append("g");
- const rect4 = getNoteRect();
- rect4.x = section.x;
- rect4.y = section.y;
- rect4.fill = section.fill;
- rect4.width = conf8.width * section.taskCount + // width of the tasks
- conf8.diagramMarginX * (section.taskCount - 1);
- rect4.height = conf8.height;
- rect4.class = "journey-section section-type-" + section.num;
- rect4.rx = 3;
- rect4.ry = 3;
- drawRect5(g2, rect4);
- _drawTextCandidateFunc3(conf8)(
+ const rect3 = getNoteRect();
+ rect3.x = section.x;
+ rect3.y = section.y;
+ rect3.fill = section.fill;
+ rect3.width = conf5.width * section.taskCount + // width of the tasks
+ conf5.diagramMarginX * (section.taskCount - 1);
+ rect3.height = conf5.height;
+ rect3.class = "journey-section section-type-" + section.num;
+ rect3.rx = 3;
+ rect3.ry = 3;
+ drawRect5(g2, rect3);
+ _drawTextCandidateFunc3(conf5)(
section.text,
g2,
- rect4.x,
- rect4.y,
- rect4.width,
- rect4.height,
+ rect3.x,
+ rect3.y,
+ rect3.width,
+ rect3.height,
{ class: "journey-section section-type-" + section.num },
- conf8,
+ conf5,
section.colour
);
}, "drawSection");
taskCount = -1;
- drawTask = /* @__PURE__ */ __name(function(elem, task, conf8) {
- const center4 = task.x + conf8.width / 2;
+ drawTask = /* @__PURE__ */ __name(function(elem, task, conf5) {
+ const center4 = task.x + conf5.width / 2;
const g2 = elem.append("g");
taskCount++;
const maxHeight = 300 + 5 * 30;
@@ -92107,16 +97282,16 @@ g.stateGroup line {
cy: 300 + (5 - task.score) * 30,
score: task.score
});
- const rect4 = getNoteRect();
- rect4.x = task.x;
- rect4.y = task.y;
- rect4.fill = task.fill;
- rect4.width = conf8.width;
- rect4.height = conf8.height;
- rect4.class = "task task-type-" + task.num;
- rect4.rx = 3;
- rect4.ry = 3;
- drawRect5(g2, rect4);
+ const rect3 = getNoteRect();
+ rect3.x = task.x;
+ rect3.y = task.y;
+ rect3.fill = task.fill;
+ rect3.width = conf5.width;
+ rect3.height = conf5.height;
+ rect3.class = "task task-type-" + task.num;
+ rect3.rx = 3;
+ rect3.ry = 3;
+ drawRect5(g2, rect3);
let xPos = task.x + 14;
task.people.forEach((person) => {
const colour = task.actors[person].color;
@@ -92132,15 +97307,15 @@ g.stateGroup line {
drawCircle(g2, circle6);
xPos += 10;
});
- _drawTextCandidateFunc3(conf8)(
+ _drawTextCandidateFunc3(conf5)(
task.task,
g2,
- rect4.x,
- rect4.y,
- rect4.width,
- rect4.height,
+ rect3.x,
+ rect3.y,
+ rect3.width,
+ rect3.height,
{ class: "task" },
- conf8,
+ conf5,
task.colour
);
}, "drawTask");
@@ -92149,29 +97324,29 @@ g.stateGroup line {
}, "drawBackgroundRect");
_drawTextCandidateFunc3 = /* @__PURE__ */ function() {
function byText(content, g2, x5, y5, width3, height2, textAttrs, colour) {
- const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
+ _setTextAttrs(text4, textAttrs);
}
__name(byText, "byText");
- function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8, colour) {
- const { taskFontSize, taskFontFamily } = conf8;
+ function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf5, colour) {
+ const { taskFontSize, taskFontFamily } = conf5;
const lines = content.split(/ /gi);
for (let i2 = 0; i2 < lines.length; i2++) {
const dy = i2 * taskFontSize - taskFontSize * (lines.length - 1) / 2;
- const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
- text2.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]);
- text2.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
+ text4.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]);
+ text4.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
+ _setTextAttrs(text4, textAttrs);
}
}
__name(byTspan, "byTspan");
- function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
+ function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
const body = g2.append("switch");
- const f3 = body.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("position", "fixed");
- const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
- text2.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
- byTspan(content, body, x5, y5, width3, height2, textAttrs, conf8);
- _setTextAttrs(text2, textAttrs);
+ const f2 = body.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("position", "fixed");
+ const text4 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
+ text4.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
+ byTspan(content, body, x5, y5, width3, height2, textAttrs, conf5);
+ _setTextAttrs(text4, textAttrs);
}
__name(byFo, "byFo");
function _setTextAttrs(toText, fromTextAttrsDict) {
@@ -92182,14 +97357,14 @@ g.stateGroup line {
}
}
__name(_setTextAttrs, "_setTextAttrs");
- return function(conf8) {
- return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan;
+ return function(conf5) {
+ return conf5.textPlacement === "fo" ? byFo : conf5.textPlacement === "old" ? byText : byTspan;
};
}();
initGraphics = /* @__PURE__ */ __name(function(graphics) {
graphics.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
}, "initGraphics");
- svgDraw_default4 = {
+ svgDraw_default3 = {
drawRect: drawRect5,
drawCircle,
drawSection,
@@ -92203,8 +97378,8 @@ g.stateGroup line {
});
// src/diagrams/user-journey/journeyRenderer.ts
- function drawActorLegend(diagram24) {
- const conf8 = getConfig2().journey;
+ function drawActorLegend(diagram26) {
+ const conf5 = getConfig2().journey;
let yPos = 60;
Object.keys(actors).forEach((person) => {
const colour = actors[person].color;
@@ -92216,47 +97391,47 @@ g.stateGroup line {
stroke: "#000",
pos: actors[person].position
};
- svgDraw_default4.drawCircle(diagram24, circleData);
+ svgDraw_default3.drawCircle(diagram26, circleData);
const labelData = {
x: 40,
y: yPos + 7,
fill: "#666",
text: person,
- textMargin: conf8.boxTextMargin | 5
+ textMargin: conf5.boxTextMargin | 5
};
- svgDraw_default4.drawText(diagram24, labelData);
+ svgDraw_default3.drawText(diagram26, labelData);
yPos += 20;
});
}
- var setConf7, actors, conf7, LEFT_MARGIN, draw16, bounds2, fills, textColours, drawTasks, journeyRenderer_default;
+ var setConf5, actors, conf4, LEFT_MARGIN, draw15, bounds2, fills, textColours, drawTasks, journeyRenderer_default;
var init_journeyRenderer = __esm({
"src/diagrams/user-journey/journeyRenderer.ts"() {
"use strict";
init_src32();
- init_svgDraw4();
+ init_svgDraw3();
init_diagramAPI();
init_setupGraphViewbox();
- setConf7 = /* @__PURE__ */ __name(function(cnf) {
+ setConf5 = /* @__PURE__ */ __name(function(cnf) {
const keys3 = Object.keys(cnf);
keys3.forEach(function(key) {
- conf7[key] = cnf[key];
+ conf4[key] = cnf[key];
});
}, "setConf");
actors = {};
__name(drawActorLegend, "drawActorLegend");
- conf7 = getConfig2().journey;
- LEFT_MARGIN = conf7.leftMargin;
- draw16 = /* @__PURE__ */ __name(function(text2, id27, version4, diagObj) {
- const conf8 = getConfig2().journey;
+ conf4 = getConfig2().journey;
+ LEFT_MARGIN = conf4.leftMargin;
+ draw15 = /* @__PURE__ */ __name(function(text4, id29, version2, diagObj) {
+ const conf5 = getConfig2().journey;
const securityLevel = getConfig2().securityLevel;
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
bounds2.init();
- const diagram24 = root4.select("#" + id27);
- svgDraw_default4.initGraphics(diagram24);
+ const diagram26 = root4.select("#" + id29);
+ svgDraw_default3.initGraphics(diagram26);
const tasks4 = diagObj.db.getTasks();
const title2 = diagObj.db.getDiagramTitle();
const actorNames = diagObj.db.getActors();
@@ -92266,26 +97441,26 @@ g.stateGroup line {
let actorPos = 0;
actorNames.forEach((actorName) => {
actors[actorName] = {
- color: conf8.actorColours[actorPos % conf8.actorColours.length],
+ color: conf5.actorColours[actorPos % conf5.actorColours.length],
position: actorPos
};
actorPos++;
});
- drawActorLegend(diagram24);
+ drawActorLegend(diagram26);
bounds2.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50);
- drawTasks(diagram24, tasks4, 0);
+ drawTasks(diagram26, tasks4, 0);
const box = bounds2.getBounds();
if (title2) {
- diagram24.append("text").text(title2).attr("x", LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25);
+ diagram26.append("text").text(title2).attr("x", LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25);
}
- const height2 = box.stopy - box.starty + 2 * conf8.diagramMarginY;
- const width3 = LEFT_MARGIN + box.stopx + 2 * conf8.diagramMarginX;
- configureSvgSize(diagram24, height2, width3, conf8.useMaxWidth);
- diagram24.append("line").attr("x1", LEFT_MARGIN).attr("y1", conf8.height * 4).attr("x2", width3 - LEFT_MARGIN - 4).attr("y2", conf8.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
+ const height2 = box.stopy - box.starty + 2 * conf5.diagramMarginY;
+ const width3 = LEFT_MARGIN + box.stopx + 2 * conf5.diagramMarginX;
+ configureSvgSize(diagram26, height2, width3, conf5.useMaxWidth);
+ diagram26.append("line").attr("x1", LEFT_MARGIN).attr("y1", conf5.height * 4).attr("x2", width3 - LEFT_MARGIN - 4).attr("y2", conf5.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
const extraVertForTitle = title2 ? 70 : 0;
- diagram24.attr("viewBox", `${box.startx} -25 ${width3} ${height2 + extraVertForTitle}`);
- diagram24.attr("preserveAspectRatio", "xMinYMin meet");
- diagram24.attr("height", height2 + extraVertForTitle + 25);
+ diagram26.attr("viewBox", `${box.startx} -25 ${width3} ${height2 + extraVertForTitle}`);
+ diagram26.attr("preserveAspectRatio", "xMinYMin meet");
+ diagram26.attr("height", height2 + extraVertForTitle + 25);
}, "draw");
bounds2 = {
data: {
@@ -92314,22 +97489,22 @@ g.stateGroup line {
}
}, "updateVal"),
updateBounds: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
- const conf8 = getConfig2().journey;
+ const conf5 = getConfig2().journey;
const _self = this;
- let cnt4 = 0;
+ let cnt5 = 0;
function updateFn(type3) {
return /* @__PURE__ */ __name(function updateItemBounds(item) {
- cnt4++;
- const n2 = _self.sequenceItems.length - cnt4 + 1;
- _self.updateVal(item, "starty", starty - n2 * conf8.boxMargin, Math.min);
- _self.updateVal(item, "stopy", stopy + n2 * conf8.boxMargin, Math.max);
- _self.updateVal(bounds2.data, "startx", startx - n2 * conf8.boxMargin, Math.min);
- _self.updateVal(bounds2.data, "stopx", stopx + n2 * conf8.boxMargin, Math.max);
+ cnt5++;
+ const n2 = _self.sequenceItems.length - cnt5 + 1;
+ _self.updateVal(item, "starty", starty - n2 * conf5.boxMargin, Math.min);
+ _self.updateVal(item, "stopy", stopy + n2 * conf5.boxMargin, Math.max);
+ _self.updateVal(bounds2.data, "startx", startx - n2 * conf5.boxMargin, Math.min);
+ _self.updateVal(bounds2.data, "stopx", stopx + n2 * conf5.boxMargin, Math.max);
if (!(type3 === "activation")) {
- _self.updateVal(item, "startx", startx - n2 * conf8.boxMargin, Math.min);
- _self.updateVal(item, "stopx", stopx + n2 * conf8.boxMargin, Math.max);
- _self.updateVal(bounds2.data, "starty", starty - n2 * conf8.boxMargin, Math.min);
- _self.updateVal(bounds2.data, "stopy", stopy + n2 * conf8.boxMargin, Math.max);
+ _self.updateVal(item, "startx", startx - n2 * conf5.boxMargin, Math.min);
+ _self.updateVal(item, "stopx", stopx + n2 * conf5.boxMargin, Math.max);
+ _self.updateVal(bounds2.data, "starty", starty - n2 * conf5.boxMargin, Math.min);
+ _self.updateVal(bounds2.data, "stopy", stopy + n2 * conf5.boxMargin, Math.max);
}
}, "updateItemBounds");
}
@@ -92358,12 +97533,12 @@ g.stateGroup line {
return this.data;
}, "getBounds")
};
- fills = conf7.sectionFills;
- textColours = conf7.sectionColours;
- drawTasks = /* @__PURE__ */ __name(function(diagram24, tasks4, verticalPos) {
- const conf8 = getConfig2().journey;
+ fills = conf4.sectionFills;
+ textColours = conf4.sectionColours;
+ drawTasks = /* @__PURE__ */ __name(function(diagram26, tasks4, verticalPos) {
+ const conf5 = getConfig2().journey;
let lastSection = "";
- const sectionVHeight = conf8.height * 2 + conf8.diagramMarginY;
+ const sectionVHeight = conf5.height * 2 + conf5.diagramMarginY;
const taskPos = verticalPos + sectionVHeight;
let sectionNumber = 0;
let fill = "#CCC";
@@ -92384,7 +97559,7 @@ g.stateGroup line {
}
}
const section = {
- x: i2 * conf8.taskMargin + i2 * conf8.width + LEFT_MARGIN,
+ x: i2 * conf5.taskMargin + i2 * conf5.width + LEFT_MARGIN,
y: 50,
text: task.section,
fill,
@@ -92392,7 +97567,7 @@ g.stateGroup line {
colour,
taskCount: taskInSectionCount
};
- svgDraw_default4.drawSection(diagram24, section, conf8);
+ svgDraw_default3.drawSection(diagram26, section, conf5);
lastSection = task.section;
sectionNumber++;
}
@@ -92402,21 +97577,21 @@ g.stateGroup line {
}
return acc;
}, {});
- task.x = i2 * conf8.taskMargin + i2 * conf8.width + LEFT_MARGIN;
+ task.x = i2 * conf5.taskMargin + i2 * conf5.width + LEFT_MARGIN;
task.y = taskPos;
- task.width = conf8.diagramMarginX;
- task.height = conf8.diagramMarginY;
+ task.width = conf5.diagramMarginX;
+ task.height = conf5.diagramMarginY;
task.colour = colour;
task.fill = fill;
task.num = num;
task.actors = taskActors;
- svgDraw_default4.drawTask(diagram24, task, conf8);
- bounds2.insert(task.x, task.y, task.x + task.width + conf8.taskMargin, 300 + 5 * 30);
+ svgDraw_default3.drawTask(diagram26, task, conf5);
+ bounds2.insert(task.x, task.y, task.x + task.width + conf5.taskMargin, 300 + 5 * 30);
}
}, "drawTasks");
journeyRenderer_default = {
- setConf: setConf7,
- draw: draw16
+ setConf: setConf5,
+ draw: draw15
};
}
});
@@ -92457,7 +97632,7 @@ g.stateGroup line {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 16], $V7 = [1, 17];
- var parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -92523,7 +97698,7 @@ g.stateGroup line {
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -92553,7 +97728,7 @@ g.stateGroup line {
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -92565,22 +97740,22 @@ g.stateGroup line {
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -92599,7 +97774,7 @@ g.stateGroup line {
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -92899,7 +98074,7 @@ g.stateGroup line {
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -93013,13 +98188,13 @@ g.stateGroup line {
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser16.parser = parser16;
@@ -93034,13 +98209,13 @@ g.stateGroup line {
addSection: () => addSection4,
addTask: () => addTask3,
addTaskOrg: () => addTaskOrg3,
- clear: () => clear24,
+ clear: () => clear14,
default: () => timelineDb_default,
getCommonDb: () => getCommonDb2,
getSections: () => getSections4,
getTasks: () => getTasks3
});
- var currentSection3, currentTaskId, sections4, tasks3, rawTasks3, getCommonDb2, clear24, addSection4, getSections4, getTasks3, addTask3, addEvent, addTaskOrg3, compileTasks3, timelineDb_default;
+ var currentSection3, currentTaskId, sections4, tasks3, rawTasks3, getCommonDb2, clear14, addSection4, getSections4, getTasks3, addTask3, addEvent, addTaskOrg3, compileTasks3, timelineDb_default;
var init_timelineDb = __esm({
"src/diagrams/timeline/timelineDb.js"() {
"use strict";
@@ -93051,7 +98226,7 @@ g.stateGroup line {
tasks3 = [];
rawTasks3 = [];
getCommonDb2 = /* @__PURE__ */ __name(() => commonDb_exports, "getCommonDb");
- clear24 = /* @__PURE__ */ __name(function() {
+ clear14 = /* @__PURE__ */ __name(function() {
sections4.length = 0;
tasks3.length = 0;
currentSection3 = "";
@@ -93114,7 +98289,7 @@ g.stateGroup line {
return allProcessed;
}, "compileTasks");
timelineDb_default = {
- clear: clear24,
+ clear: clear14,
getCommonDb: getCommonDb2,
addSection: addSection4,
getSections: getSections4,
@@ -93127,9 +98302,9 @@ g.stateGroup line {
});
// src/diagrams/timeline/svgDraw.js
- function wrap2(text2, width3) {
- text2.each(function() {
- var text3 = select_default2(this), words = text3.text().split(/(\s+| )/).reverse(), word, line2 = [], lineHeight = 1.1, y5 = text3.attr("y"), dy = parseFloat(text3.attr("dy")), tspan = text3.text(null).append("tspan").attr("x", 0).attr("y", y5).attr("dy", dy + "em");
+ function wrap2(text4, width3) {
+ text4.each(function() {
+ var text5 = select_default2(this), words = text5.text().split(/(\s+| )/).reverse(), word, line2 = [], lineHeight = 1.1, y5 = text5.attr("y"), dy = parseFloat(text5.attr("dy")), tspan = text5.text(null).append("tspan").attr("x", 0).attr("y", y5).attr("dy", dy + "em");
for (let j2 = 0; j2 < words.length; j2++) {
word = words[words.length - 1 - j2];
line2.push(word);
@@ -93142,13 +98317,13 @@ g.stateGroup line {
} else {
line2 = [word];
}
- tspan = text3.append("tspan").attr("x", 0).attr("y", y5).attr("dy", lineHeight + "em").text(word);
+ tspan = text5.append("tspan").attr("x", 0).attr("y", y5).attr("dy", lineHeight + "em").text(word);
}
}
});
}
- var MAX_SECTIONS, drawRect6, drawFace2, drawCircle2, drawText5, drawLabel3, drawSection2, taskCount2, drawTask2, drawBackgroundRect4, getTextObj4, getNoteRect3, _drawTextCandidateFunc4, initGraphics2, drawNode, getVirtualNodeHeight, defaultBkg, svgDraw_default5;
- var init_svgDraw5 = __esm({
+ var MAX_SECTIONS, drawRect6, drawFace2, drawCircle2, drawText5, drawLabel3, drawSection2, taskCount2, drawTask2, drawBackgroundRect4, getTextObj4, getNoteRect3, _drawTextCandidateFunc4, initGraphics2, drawNode, getVirtualNodeHeight, defaultBkg, svgDraw_default4;
+ var init_svgDraw4 = __esm({
"src/diagrams/timeline/svgDraw.js"() {
"use strict";
init_src32();
@@ -93240,33 +98415,33 @@ g.stateGroup line {
txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
drawText5(elem, txtObject);
}, "drawLabel");
- drawSection2 = /* @__PURE__ */ __name(function(elem, section, conf8) {
+ drawSection2 = /* @__PURE__ */ __name(function(elem, section, conf5) {
const g2 = elem.append("g");
- const rect4 = getNoteRect3();
- rect4.x = section.x;
- rect4.y = section.y;
- rect4.fill = section.fill;
- rect4.width = conf8.width;
- rect4.height = conf8.height;
- rect4.class = "journey-section section-type-" + section.num;
- rect4.rx = 3;
- rect4.ry = 3;
- drawRect6(g2, rect4);
- _drawTextCandidateFunc4(conf8)(
+ const rect3 = getNoteRect3();
+ rect3.x = section.x;
+ rect3.y = section.y;
+ rect3.fill = section.fill;
+ rect3.width = conf5.width;
+ rect3.height = conf5.height;
+ rect3.class = "journey-section section-type-" + section.num;
+ rect3.rx = 3;
+ rect3.ry = 3;
+ drawRect6(g2, rect3);
+ _drawTextCandidateFunc4(conf5)(
section.text,
g2,
- rect4.x,
- rect4.y,
- rect4.width,
- rect4.height,
+ rect3.x,
+ rect3.y,
+ rect3.width,
+ rect3.height,
{ class: "journey-section section-type-" + section.num },
- conf8,
+ conf5,
section.colour
);
}, "drawSection");
taskCount2 = -1;
- drawTask2 = /* @__PURE__ */ __name(function(elem, task, conf8) {
- const center4 = task.x + conf8.width / 2;
+ drawTask2 = /* @__PURE__ */ __name(function(elem, task, conf5) {
+ const center4 = task.x + conf5.width / 2;
const g2 = elem.append("g");
taskCount2++;
const maxHeight = 300 + 5 * 30;
@@ -93276,25 +98451,25 @@ g.stateGroup line {
cy: 300 + (5 - task.score) * 30,
score: task.score
});
- const rect4 = getNoteRect3();
- rect4.x = task.x;
- rect4.y = task.y;
- rect4.fill = task.fill;
- rect4.width = conf8.width;
- rect4.height = conf8.height;
- rect4.class = "task task-type-" + task.num;
- rect4.rx = 3;
- rect4.ry = 3;
- drawRect6(g2, rect4);
- _drawTextCandidateFunc4(conf8)(
+ const rect3 = getNoteRect3();
+ rect3.x = task.x;
+ rect3.y = task.y;
+ rect3.fill = task.fill;
+ rect3.width = conf5.width;
+ rect3.height = conf5.height;
+ rect3.class = "task task-type-" + task.num;
+ rect3.rx = 3;
+ rect3.ry = 3;
+ drawRect6(g2, rect3);
+ _drawTextCandidateFunc4(conf5)(
task.task,
g2,
- rect4.x,
- rect4.y,
- rect4.width,
- rect4.height,
+ rect3.x,
+ rect3.y,
+ rect3.width,
+ rect3.height,
{ class: "task" },
- conf8,
+ conf5,
task.colour
);
}, "drawTask");
@@ -93335,29 +98510,29 @@ g.stateGroup line {
}, "getNoteRect");
_drawTextCandidateFunc4 = /* @__PURE__ */ function() {
function byText(content, g2, x5, y5, width3, height2, textAttrs, colour) {
- const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
+ _setTextAttrs(text4, textAttrs);
}
__name(byText, "byText");
- function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8, colour) {
- const { taskFontSize, taskFontFamily } = conf8;
+ function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf5, colour) {
+ const { taskFontSize, taskFontFamily } = conf5;
const lines = content.split(/ /gi);
for (let i2 = 0; i2 < lines.length; i2++) {
const dy = i2 * taskFontSize - taskFontSize * (lines.length - 1) / 2;
- const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
- text2.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]);
- text2.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
- _setTextAttrs(text2, textAttrs);
+ const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
+ text4.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]);
+ text4.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
+ _setTextAttrs(text4, textAttrs);
}
}
__name(byTspan, "byTspan");
- function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) {
+ function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf5) {
const body = g2.append("switch");
- const f3 = body.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("position", "fixed");
- const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
- text2.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
- byTspan(content, body, x5, y5, width3, height2, textAttrs, conf8);
- _setTextAttrs(text2, textAttrs);
+ const f2 = body.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("position", "fixed");
+ const text4 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
+ text4.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
+ byTspan(content, body, x5, y5, width3, height2, textAttrs, conf5);
+ _setTextAttrs(text4, textAttrs);
}
__name(byFo, "byFo");
function _setTextAttrs(toText, fromTextAttrsDict) {
@@ -93368,15 +98543,15 @@ g.stateGroup line {
}
}
__name(_setTextAttrs, "_setTextAttrs");
- return function(conf8) {
- return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan;
+ return function(conf5) {
+ return conf5.textPlacement === "fo" ? byFo : conf5.textPlacement === "old" ? byText : byTspan;
};
}();
initGraphics2 = /* @__PURE__ */ __name(function(graphics) {
graphics.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
}, "initGraphics");
__name(wrap2, "wrap");
- drawNode = /* @__PURE__ */ __name(function(elem, node2, fullSection, conf8) {
+ drawNode = /* @__PURE__ */ __name(function(elem, node2, fullSection, conf5) {
const section = fullSection % MAX_SECTIONS - 1;
const nodeElem = elem.append("g");
node2.section = section;
@@ -93388,19 +98563,19 @@ g.stateGroup line {
const textElem = nodeElem.append("g");
const txt = textElem.append("text").text(node2.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap2, node2.width);
const bbox = txt.node().getBBox();
- const fontSize = conf8.fontSize?.replace ? conf8.fontSize.replace("px", "") : conf8.fontSize;
+ const fontSize = conf5.fontSize?.replace ? conf5.fontSize.replace("px", "") : conf5.fontSize;
node2.height = bbox.height + fontSize * 1.1 * 0.5 + node2.padding;
node2.height = Math.max(node2.height, node2.maxHeight);
node2.width = node2.width + 2 * node2.padding;
textElem.attr("transform", "translate(" + node2.width / 2 + ", " + node2.padding / 2 + ")");
- defaultBkg(bkgElem, node2, section, conf8);
+ defaultBkg(bkgElem, node2, section, conf5);
return node2;
}, "drawNode");
- getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node2, conf8) {
+ getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node2, conf5) {
const textElem = elem.append("g");
const txt = textElem.append("text").text(node2.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap2, node2.width);
const bbox = txt.node().getBBox();
- const fontSize = conf8.fontSize?.replace ? conf8.fontSize.replace("px", "") : conf8.fontSize;
+ const fontSize = conf5.fontSize?.replace ? conf5.fontSize.replace("px", "") : conf5.fontSize;
textElem.remove();
return bbox.height + fontSize * 1.1 * 0.5 + node2.padding;
}, "getVirtualNodeHeight");
@@ -93412,7 +98587,7 @@ g.stateGroup line {
);
elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node2.height).attr("x2", node2.width).attr("y2", node2.height);
}, "defaultBkg");
- svgDraw_default5 = {
+ svgDraw_default4 = {
drawRect: drawRect6,
drawCircle: drawCircle2,
drawSection: drawSection2,
@@ -93430,33 +98605,33 @@ g.stateGroup line {
});
// src/diagrams/timeline/timelineRenderer.ts
- var draw18, drawTasks2, drawEvents, timelineRenderer_default;
+ var draw17, drawTasks2, drawEvents, timelineRenderer_default;
var init_timelineRenderer = __esm({
"src/diagrams/timeline/timelineRenderer.ts"() {
"use strict";
init_src32();
- init_svgDraw5();
+ init_svgDraw4();
init_logger();
init_diagramAPI();
init_setupGraphViewbox();
- draw18 = /* @__PURE__ */ __name(function(text2, id27, version4, diagObj) {
- const conf8 = getConfig2();
- const LEFT_MARGIN2 = conf8.leftMargin ?? 50;
+ draw17 = /* @__PURE__ */ __name(function(text4, id29, version2, diagObj) {
+ const conf5 = getConfig2();
+ const LEFT_MARGIN2 = conf5.leftMargin ?? 50;
log.debug("timeline", diagObj.db);
- const securityLevel = conf8.securityLevel;
+ const securityLevel = conf5.securityLevel;
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const svg = root4.select("#" + id27);
- svg.append("g");
+ const svg2 = root4.select("#" + id29);
+ svg2.append("g");
const tasks4 = diagObj.db.getTasks();
const title2 = diagObj.db.getCommonDb().getDiagramTitle();
log.debug("task", tasks4);
- svgDraw_default5.initGraphics(svg);
- const sections5 = diagObj.db.getSections();
- log.debug("sections", sections5);
+ svgDraw_default4.initGraphics(svg2);
+ const sections6 = diagObj.db.getSections();
+ log.debug("sections", sections6);
let maxSectionHeight = 0;
let maxTaskHeight = 0;
let depthY = 0;
@@ -93466,7 +98641,7 @@ g.stateGroup line {
sectionBeginY = 50;
let sectionNumber = 0;
let hasSections = true;
- sections5.forEach(function(section) {
+ sections6.forEach(function(section) {
const sectionNode = {
number: sectionNumber,
descr: section,
@@ -93475,7 +98650,7 @@ g.stateGroup line {
padding: 20,
maxHeight: maxSectionHeight
};
- const sectionHeight = svgDraw_default5.getVirtualNodeHeight(svg, sectionNode, conf8);
+ const sectionHeight = svgDraw_default4.getVirtualNodeHeight(svg2, sectionNode, conf5);
log.debug("sectionHeight before draw", sectionHeight);
maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20);
});
@@ -93491,7 +98666,7 @@ g.stateGroup line {
padding: 20,
maxHeight: maxTaskHeight
};
- const taskHeight = svgDraw_default5.getVirtualNodeHeight(svg, taskNode, conf8);
+ const taskHeight = svgDraw_default4.getVirtualNodeHeight(svg2, taskNode, conf5);
log.debug("taskHeight before draw", taskHeight);
maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20);
maxEventCount = Math.max(maxEventCount, task.events.length);
@@ -93505,14 +98680,14 @@ g.stateGroup line {
padding: 20,
maxHeight: 50
};
- maxEventLineLengthTemp += svgDraw_default5.getVirtualNodeHeight(svg, eventNode, conf8);
+ maxEventLineLengthTemp += svgDraw_default4.getVirtualNodeHeight(svg2, eventNode, conf5);
}
maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp);
}
log.debug("maxSectionHeight before draw", maxSectionHeight);
log.debug("maxTaskHeight before draw", maxTaskHeight);
- if (sections5 && sections5.length > 0) {
- sections5.forEach((section) => {
+ if (sections6 && sections6.length > 0) {
+ sections6.forEach((section) => {
const tasksForSection = tasks4.filter((task) => task.section === section);
const sectionNode = {
number: sectionNumber,
@@ -93523,20 +98698,20 @@ g.stateGroup line {
maxHeight: maxSectionHeight
};
log.debug("sectionNode", sectionNode);
- const sectionNodeWrapper = svg.append("g");
- const node2 = svgDraw_default5.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf8);
+ const sectionNodeWrapper = svg2.append("g");
+ const node2 = svgDraw_default4.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf5);
log.debug("sectionNode output", node2);
sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`);
masterY += maxSectionHeight + 50;
if (tasksForSection.length > 0) {
drawTasks2(
- svg,
+ svg2,
tasksForSection,
sectionNumber,
masterX,
masterY,
maxTaskHeight,
- conf8,
+ conf5,
maxEventCount,
maxEventLineLength,
maxSectionHeight,
@@ -93550,35 +98725,35 @@ g.stateGroup line {
} else {
hasSections = false;
drawTasks2(
- svg,
+ svg2,
tasks4,
sectionNumber,
masterX,
masterY,
maxTaskHeight,
- conf8,
+ conf5,
maxEventCount,
maxEventLineLength,
maxSectionHeight,
true
);
}
- const box = svg.node().getBBox();
+ const box = svg2.node().getBBox();
log.debug("bounds", box);
if (title2) {
- svg.append("text").text(title2).attr("x", box.width / 2 - LEFT_MARGIN2).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
+ svg2.append("text").text(title2).attr("x", box.width / 2 - LEFT_MARGIN2).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
}
depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100;
- const lineWrapper = svg.append("g").attr("class", "lineWrapper");
+ const lineWrapper = svg2.append("g").attr("class", "lineWrapper");
lineWrapper.append("line").attr("x1", LEFT_MARGIN2).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN2).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
setupGraphViewbox(
void 0,
- svg,
- conf8.timeline?.padding ?? 50,
- conf8.timeline?.useMaxWidth ?? false
+ svg2,
+ conf5.timeline?.padding ?? 50,
+ conf5.timeline?.useMaxWidth ?? false
);
}, "draw");
- drawTasks2 = /* @__PURE__ */ __name(function(diagram24, tasks4, sectionColor, masterX, masterY, maxTaskHeight, conf8, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) {
+ drawTasks2 = /* @__PURE__ */ __name(function(diagram26, tasks4, sectionColor, masterX, masterY, maxTaskHeight, conf5, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) {
for (const task of tasks4) {
const taskNode = {
descr: task.task,
@@ -93589,17 +98764,17 @@ g.stateGroup line {
maxHeight: maxTaskHeight
};
log.debug("taskNode", taskNode);
- const taskWrapper = diagram24.append("g").attr("class", "taskWrapper");
- const node2 = svgDraw_default5.drawNode(taskWrapper, taskNode, sectionColor, conf8);
+ const taskWrapper = diagram26.append("g").attr("class", "taskWrapper");
+ const node2 = svgDraw_default4.drawNode(taskWrapper, taskNode, sectionColor, conf5);
const taskHeight = node2.height;
log.debug("taskHeight after draw", taskHeight);
taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
if (task.events) {
- const lineWrapper = diagram24.append("g").attr("class", "lineWrapper");
+ const lineWrapper = diagram26.append("g").attr("class", "lineWrapper");
let lineLength = maxTaskHeight;
masterY += 100;
- lineLength = lineLength + drawEvents(diagram24, task.events, sectionColor, masterX, masterY, conf8);
+ lineLength = lineLength + drawEvents(diagram26, task.events, sectionColor, masterX, masterY, conf5);
masterY -= 100;
lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr(
"y2",
@@ -93607,13 +98782,13 @@ g.stateGroup line {
).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
}
masterX = masterX + 200;
- if (isWithoutSections && !conf8.timeline?.disableMulticolor) {
+ if (isWithoutSections && !conf5.timeline?.disableMulticolor) {
sectionColor++;
}
}
masterY = masterY - 10;
}, "drawTasks");
- drawEvents = /* @__PURE__ */ __name(function(diagram24, events, sectionColor, masterX, masterY, conf8) {
+ drawEvents = /* @__PURE__ */ __name(function(diagram26, events, sectionColor, masterX, masterY, conf5) {
let maxEventHeight = 0;
const eventBeginY = masterY;
masterY = masterY + 100;
@@ -93627,8 +98802,8 @@ g.stateGroup line {
maxHeight: 50
};
log.debug("eventNode", eventNode);
- const eventWrapper = diagram24.append("g").attr("class", "eventWrapper");
- const node2 = svgDraw_default5.drawNode(eventWrapper, eventNode, sectionColor, conf8);
+ const eventWrapper = diagram26.append("g").attr("class", "eventWrapper");
+ const node2 = svgDraw_default4.drawNode(eventWrapper, eventNode, sectionColor, conf5);
const eventHeight = node2.height;
maxEventHeight = maxEventHeight + eventHeight;
eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
@@ -93640,7 +98815,7 @@ g.stateGroup line {
timelineRenderer_default = {
setConf: /* @__PURE__ */ __name(() => {
}, "setConf"),
- draw: draw18
+ draw: draw17
};
}
});
@@ -93652,7 +98827,7 @@ g.stateGroup line {
"use strict";
init_dist();
genSections = /* @__PURE__ */ __name((options3) => {
- let sections5 = "";
+ let sections6 = "";
for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) {
options3["lineColor" + i2] = options3["lineColor" + i2] || options3["cScaleInv" + i2];
if (is_dark_default(options3["lineColor" + i2])) {
@@ -93663,7 +98838,7 @@ g.stateGroup line {
}
for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) {
const sw = "" + (17 - 3 * i2);
- sections5 += `
+ sections6 += `
.section-${i2 - 1} rect, .section-${i2 - 1} path, .section-${i2 - 1} circle, .section-${i2 - 1} path {
fill: ${options3["cScale" + i2]};
}
@@ -93697,7 +98872,7 @@ g.stateGroup line {
}
`;
}
- return sections5;
+ return sections6;
}, "genSections");
getStyles13 = /* @__PURE__ */ __name((options3) => `
.edge {
@@ -93759,7 +98934,7 @@ g.stateGroup line {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [6, 7, 8], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [6, 7, 11], $Vc = [1, 6, 13, 15, 16, 19, 22], $Vd = [1, 33], $Ve = [1, 34], $Vf = [1, 6, 7, 11, 13, 15, 16, 19, 22];
- var parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -93831,7 +99006,7 @@ g.stateGroup line {
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -93861,7 +99036,7 @@ g.stateGroup line {
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -93873,22 +99048,22 @@ g.stateGroup line {
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -93907,7 +99082,7 @@ g.stateGroup line {
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -94207,7 +99382,7 @@ g.stateGroup line {
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -94412,13 +99587,13 @@ g.stateGroup line {
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
parser17.parser = parser17;
@@ -94427,7 +99602,7 @@ g.stateGroup line {
});
// src/diagrams/mindmap/mindmapDb.ts
- var nodes2, cnt2, elements2, clear25, getParent, getMindmap, addNode, nodeType, getType, setElementForId, decorateNode, type2Str, getLogger, getElementById, db4, mindmapDb_default;
+ var nodes, cnt2, elements, clear15, getParent, getMindmap, addNode, nodeType, getType, setElementForId, decorateNode, type2Str, getLogger, getElementById, db4, mindmapDb_default;
var init_mindmapDb = __esm({
"src/diagrams/mindmap/mindmapDb.ts"() {
"use strict";
@@ -94435,52 +99610,52 @@ g.stateGroup line {
init_common();
init_logger();
init_defaultConfig();
- nodes2 = [];
+ nodes = [];
cnt2 = 0;
- elements2 = {};
- clear25 = /* @__PURE__ */ __name(() => {
- nodes2 = [];
+ elements = {};
+ clear15 = /* @__PURE__ */ __name(() => {
+ nodes = [];
cnt2 = 0;
- elements2 = {};
+ elements = {};
}, "clear");
getParent = /* @__PURE__ */ __name(function(level) {
- for (let i2 = nodes2.length - 1; i2 >= 0; i2--) {
- if (nodes2[i2].level < level) {
- return nodes2[i2];
+ for (let i2 = nodes.length - 1; i2 >= 0; i2--) {
+ if (nodes[i2].level < level) {
+ return nodes[i2];
}
}
return null;
}, "getParent");
getMindmap = /* @__PURE__ */ __name(() => {
- return nodes2.length > 0 ? nodes2[0] : null;
+ return nodes.length > 0 ? nodes[0] : null;
}, "getMindmap");
- addNode = /* @__PURE__ */ __name((level, id27, descr, type3) => {
- log.info("addNode", level, id27, descr, type3);
- const conf8 = getConfig2();
- let padding3 = conf8.mindmap?.padding ?? defaultConfig_default.mindmap.padding;
+ addNode = /* @__PURE__ */ __name((level, id29, descr, type3) => {
+ log.info("addNode", level, id29, descr, type3);
+ const conf5 = getConfig2();
+ let padding2 = conf5.mindmap?.padding ?? defaultConfig_default.mindmap.padding;
switch (type3) {
case nodeType.ROUNDED_RECT:
case nodeType.RECT:
case nodeType.HEXAGON:
- padding3 *= 2;
+ padding2 *= 2;
}
const node2 = {
id: cnt2++,
- nodeId: sanitizeText(id27, conf8),
+ nodeId: sanitizeText(id29, conf5),
level,
- descr: sanitizeText(descr, conf8),
+ descr: sanitizeText(descr, conf5),
type: type3,
children: [],
- width: conf8.mindmap?.maxNodeWidth ?? defaultConfig_default.mindmap.maxNodeWidth,
- padding: padding3
+ width: conf5.mindmap?.maxNodeWidth ?? defaultConfig_default.mindmap.maxNodeWidth,
+ padding: padding2
};
const parent4 = getParent(level);
if (parent4) {
parent4.children.push(node2);
- nodes2.push(node2);
+ nodes.push(node2);
} else {
- if (nodes2.length === 0) {
- nodes2.push(node2);
+ if (nodes.length === 0) {
+ nodes.push(node2);
} else {
throw new Error(
'There can be only one root. No parent could be found for ("' + node2.descr + '")'
@@ -94517,20 +99692,20 @@ g.stateGroup line {
return nodeType.DEFAULT;
}
}, "getType");
- setElementForId = /* @__PURE__ */ __name((id27, element3) => {
- elements2[id27] = element3;
+ setElementForId = /* @__PURE__ */ __name((id29, element3) => {
+ elements[id29] = element3;
}, "setElementForId");
decorateNode = /* @__PURE__ */ __name((decoration) => {
if (!decoration) {
return;
}
- const config6 = getConfig2();
- const node2 = nodes2[nodes2.length - 1];
+ const config5 = getConfig2();
+ const node2 = nodes[nodes.length - 1];
if (decoration.icon) {
- node2.icon = sanitizeText(decoration.icon, config6);
+ node2.icon = sanitizeText(decoration.icon, config5);
}
if (decoration.class) {
- node2.class = sanitizeText(decoration.class, config6);
+ node2.class = sanitizeText(decoration.class, config5);
}
}, "decorateNode");
type2Str = /* @__PURE__ */ __name((type3) => {
@@ -94549,14 +99724,15 @@ g.stateGroup line {
return "bang";
case nodeType.HEXAGON:
return "hexgon";
+ // cspell: disable-line
default:
return "no-border";
}
}, "type2Str");
getLogger = /* @__PURE__ */ __name(() => log, "getLogger");
- getElementById = /* @__PURE__ */ __name((id27) => elements2[id27], "getElementById");
+ getElementById = /* @__PURE__ */ __name((id29) => elements[id29], "getElementById");
db4 = {
- clear: clear25,
+ clear: clear15,
addNode,
getMindmap,
nodeType,
@@ -94571,7 +99747,7 @@ g.stateGroup line {
}
});
- // ../../node_modules/.pnpm/cytoscape@3.30.1/node_modules/cytoscape/dist/cytoscape.esm.mjs
+ // ../../node_modules/.pnpm/cytoscape@3.31.0/node_modules/cytoscape/dist/cytoscape.esm.mjs
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
@@ -94618,9 +99794,18 @@ g.stateGroup line {
function _slicedToArray(arr, i2) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
}
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+ }
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+ }
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
+ function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+ }
function _iterableToArrayLimit(arr, i2) {
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (_i == null) return;
@@ -94658,6 +99843,9 @@ g.stateGroup line {
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
return arr2;
}
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
@@ -94711,7 +99899,7 @@ g.stateGroup line {
}, "f")
};
}
- function isObject2(value2) {
+ function isObject3(value2) {
var type3 = typeof value2;
return value2 != null && (type3 == "object" || type3 == "function");
}
@@ -94766,9 +99954,9 @@ g.stateGroup line {
if (isSymbol_1(value2)) {
return NAN2;
}
- if (isObject_1(value2)) {
- var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2;
- value2 = isObject_1(other) ? other + "" : other;
+ if (isObject_12(value2)) {
+ var other2 = typeof value2.valueOf == "function" ? value2.valueOf() : value2;
+ value2 = isObject_12(other2) ? other2 + "" : other2;
}
if (typeof value2 != "string") {
return value2 === 0 ? value2 : +value2;
@@ -94783,7 +99971,7 @@ g.stateGroup line {
throw new TypeError(FUNC_ERROR_TEXT$1);
}
wait = toNumber_1(wait) || 0;
- if (isObject_1(options3)) {
+ if (isObject_12(options3)) {
leading = !!options3.leading;
maxing = "maxWait" in options3;
maxWait = maxing ? nativeMax6(toNumber_1(options3.maxWait) || 0, wait) : maxWait;
@@ -94891,7 +100079,7 @@ g.stateGroup line {
return reIsPlainProp2.test(value2) || !reIsDeepProp2.test(value2) || object3 != null && value2 in Object(object3);
}
function isFunction2(value2) {
- if (!isObject_1(value2)) {
+ if (!isObject_12(value2)) {
return false;
}
var tag2 = _baseGetTag(value2);
@@ -94914,7 +100102,7 @@ g.stateGroup line {
return "";
}
function baseIsNative2(value2) {
- if (!isObject_1(value2) || _isMasked(value2)) {
+ if (!isObject_12(value2) || _isMasked(value2)) {
return false;
}
var pattern = isFunction_1(value2) ? reIsNative2 : reIsHostCtor2;
@@ -94937,28 +100125,28 @@ g.stateGroup line {
return result;
}
function hashGet2(key) {
- var data5 = this.__data__;
+ var data6 = this.__data__;
if (_nativeCreate) {
- var result = data5[key];
+ var result = data6[key];
return result === HASH_UNDEFINED$1 ? void 0 : result;
}
- return hasOwnProperty$2.call(data5, key) ? data5[key] : void 0;
+ return hasOwnProperty$2.call(data6, key) ? data6[key] : void 0;
}
function hashHas2(key) {
- var data5 = this.__data__;
- return _nativeCreate ? data5[key] !== void 0 : hasOwnProperty$1.call(data5, key);
+ var data6 = this.__data__;
+ return _nativeCreate ? data6[key] !== void 0 : hasOwnProperty$1.call(data6, key);
}
function hashSet2(key, value2) {
- var data5 = this.__data__;
+ var data6 = this.__data__;
this.size += this.has(key) ? 0 : 1;
- data5[key] = _nativeCreate && value2 === void 0 ? HASH_UNDEFINED4 : value2;
+ data6[key] = _nativeCreate && value2 === void 0 ? HASH_UNDEFINED4 : value2;
return this;
}
- function Hash2(entries) {
- var index = -1, length2 = entries == null ? 0 : entries.length;
+ function Hash2(entries2) {
+ var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
- var entry = entries[index];
+ var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
@@ -94966,8 +100154,8 @@ g.stateGroup line {
this.__data__ = [];
this.size = 0;
}
- function eq2(value2, other) {
- return value2 === other || value2 !== value2 && other !== other;
+ function eq2(value2, other2) {
+ return value2 === other2 || value2 !== value2 && other2 !== other2;
}
function assocIndexOf2(array4, key) {
var length2 = array4.length;
@@ -94979,41 +100167,41 @@ g.stateGroup line {
return -1;
}
function listCacheDelete2(key) {
- var data5 = this.__data__, index = _assocIndexOf(data5, key);
+ var data6 = this.__data__, index = _assocIndexOf(data6, key);
if (index < 0) {
return false;
}
- var lastIndex = data5.length - 1;
+ var lastIndex = data6.length - 1;
if (index == lastIndex) {
- data5.pop();
+ data6.pop();
} else {
- splice2.call(data5, index, 1);
+ splice2.call(data6, index, 1);
}
--this.size;
return true;
}
function listCacheGet2(key) {
- var data5 = this.__data__, index = _assocIndexOf(data5, key);
- return index < 0 ? void 0 : data5[index][1];
+ var data6 = this.__data__, index = _assocIndexOf(data6, key);
+ return index < 0 ? void 0 : data6[index][1];
}
function listCacheHas2(key) {
return _assocIndexOf(this.__data__, key) > -1;
}
function listCacheSet2(key, value2) {
- var data5 = this.__data__, index = _assocIndexOf(data5, key);
+ var data6 = this.__data__, index = _assocIndexOf(data6, key);
if (index < 0) {
++this.size;
- data5.push([key, value2]);
+ data6.push([key, value2]);
} else {
- data5[index][1] = value2;
+ data6[index][1] = value2;
}
return this;
}
- function ListCache2(entries) {
- var index = -1, length2 = entries == null ? 0 : entries.length;
+ function ListCache2(entries2) {
+ var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
- var entry = entries[index];
+ var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
@@ -95030,8 +100218,8 @@ g.stateGroup line {
return type3 == "string" || type3 == "number" || type3 == "symbol" || type3 == "boolean" ? value2 !== "__proto__" : value2 === null;
}
function getMapData2(map5, key) {
- var data5 = map5.__data__;
- return _isKeyable(key) ? data5[typeof key == "string" ? "string" : "hash"] : data5.map;
+ var data6 = map5.__data__;
+ return _isKeyable(key) ? data6[typeof key == "string" ? "string" : "hash"] : data6.map;
}
function mapCacheDelete2(key) {
var result = _getMapData(this, key)["delete"](key);
@@ -95045,16 +100233,16 @@ g.stateGroup line {
return _getMapData(this, key).has(key);
}
function mapCacheSet2(key, value2) {
- var data5 = _getMapData(this, key), size5 = data5.size;
- data5.set(key, value2);
- this.size += data5.size == size5 ? 0 : 1;
+ var data6 = _getMapData(this, key), size5 = data6.size;
+ data6.set(key, value2);
+ this.size += data6.size == size5 ? 0 : 1;
return this;
}
- function MapCache2(entries) {
- var index = -1, length2 = entries == null ? 0 : entries.length;
+ function MapCache2(entries2) {
+ var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
- var entry = entries[index];
+ var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
@@ -95156,7 +100344,7 @@ g.stateGroup line {
return !!length2 && (type3 == "number" || type3 != "symbol" && reIsUint2.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2);
}
function baseSet2(object3, path4, value2, customizer) {
- if (!isObject_1(object3)) {
+ if (!isObject_12(object3)) {
return object3;
}
path4 = _castPath(path4, object3);
@@ -95170,7 +100358,7 @@ g.stateGroup line {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : void 0;
if (newValue === void 0) {
- newValue = isObject_1(objValue) ? objValue : _isIndex(path4[index + 1]) ? [] : {};
+ newValue = isObject_12(objValue) ? objValue : _isIndex(path4[index + 1]) ? [] : {};
}
}
_assignValue(nested, key, newValue);
@@ -95178,7 +100366,7 @@ g.stateGroup line {
}
return object3;
}
- function set4(object3, path4, value2) {
+ function set5(object3, path4, value2) {
return object3 == null ? object3 : _baseSet(object3, path4, value2);
}
function copyArray3(source, array4) {
@@ -95287,7 +100475,7 @@ g.stateGroup line {
function returnTrue() {
return true;
}
- function Emitter2() {
+ function Emitter3() {
var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : emptyOpts;
var context = arguments.length > 1 ? arguments[1] : void 0;
for (var i2 = 0; i2 < defaultsKeys.length; i2++) {
@@ -95329,10 +100517,10 @@ g.stateGroup line {
}
function checkCompound(ele, parentOk) {
var _p = ele._private;
- var parents4 = _p.data.parent ? ele.parents() : null;
- if (parents4) {
- for (var i2 = 0; i2 < parents4.length; i2++) {
- var parent4 = parents4[i2];
+ var parents3 = _p.data.parent ? ele.parents() : null;
+ if (parents3) {
+ for (var i2 = 0; i2 < parents3.length; i2++) {
+ var parent4 = parents3[i2];
if (!parentOk(parent4)) {
return false;
}
@@ -95371,9 +100559,9 @@ g.stateGroup line {
var args = arguments;
var changedEles = [];
if (args.length === 2) {
- var data5 = args[0];
+ var data6 = args[0];
var handler = args[1];
- this.on(params.event, data5, handler);
+ this.on(params.event, data6, handler);
} else if (args.length === 1 && fn$6(args[0])) {
var _handler = args[0];
this.on(params.event, _handler);
@@ -95459,9 +100647,9 @@ g.stateGroup line {
otherNodes = cy.$(otherNodes);
}
for (var h2 = 0; h2 < otherNodes.length; h2++) {
- var edges5 = otherNodes[h2]._private.edges;
- for (var i2 = 0; i2 < edges5.length; i2++) {
- var edge = edges5[i2];
+ var edges3 = otherNodes[h2]._private.edges;
+ for (var i2 = 0; i2 < edges3.length; i2++) {
+ var edge = edges3[i2];
var edgeData2 = edge._private.data;
var thisToOther = this.hasElementWithId(edgeData2.source) && otherNodes.hasElementWithId(edgeData2.target);
var otherToThis = otherNodes.hasElementWithId(edgeData2.source) && this.hasElementWithId(edgeData2.target);
@@ -95487,13 +100675,13 @@ g.stateGroup line {
var defaults4 = {
codirected: false
};
- params = extend2({}, defaults4, params);
+ params = extend4({}, defaults4, params);
return /* @__PURE__ */ __name(function parallelEdgesImpl(selector) {
var elements3 = [];
- var edges5 = this.edges();
+ var edges3 = this.edges();
var p3 = params;
- for (var i2 = 0; i2 < edges5.length; i2++) {
- var edge1 = edges5[i2];
+ for (var i2 = 0; i2 < edges3.length; i2++) {
+ var edge1 = edges3[i2];
var edge1_p = edge1._private;
var src1 = edge1_p.source;
var srcid1 = src1._private.data.id;
@@ -95605,7 +100793,7 @@ g.stateGroup line {
}
}
__name(precompute, "precompute");
- var f3 = /* @__PURE__ */ __name(function f4(aX) {
+ var f2 = /* @__PURE__ */ __name(function f3(aX) {
if (!_precomputed) {
precompute();
}
@@ -95620,7 +100808,7 @@ g.stateGroup line {
}
return calcBezier(getTForX(aX), mY1, mY2);
}, "f");
- f3.getControlPoints = function() {
+ f2.getControlPoints = function() {
return [{
x: mX1,
y: mY1
@@ -95630,10 +100818,10 @@ g.stateGroup line {
}];
};
var str2 = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")";
- f3.toString = function() {
+ f2.toString = function() {
return str2;
};
- return f3;
+ return f2;
}
function getEasedValue(type3, start3, end2, percent, easingFn) {
if (percent === 1) {
@@ -95902,20 +101090,20 @@ g.stateGroup line {
cy.emit("step");
}
function BreadthFirstLayout(options3) {
- this.options = extend2({}, defaults$7, deprecatedOptionDefaults, options3);
+ this.options = extend4({}, defaults$7, deprecatedOptionDefaults, options3);
}
function CircleLayout(options3) {
- this.options = extend2({}, defaults$6, options3);
+ this.options = extend4({}, defaults$6, options3);
}
function ConcentricLayout(options3) {
- this.options = extend2({}, defaults$5, options3);
+ this.options = extend4({}, defaults$5, options3);
}
function CoseLayout(options3) {
- this.options = extend2({}, defaults$4, options3);
+ this.options = extend4({}, defaults$4, options3);
this.options.layout = this;
var nodes6 = this.options.eles.nodes();
- var edges5 = this.options.eles.edges();
- var notEdges = edges5.filter(function(e3) {
+ var edges3 = this.options.eles.edges();
+ var notEdges = edges3.filter(function(e3) {
var sourceId = e3.source().data("id");
var targetId = e3.target().data("id");
var hasSource = nodes6.some(function(n2) {
@@ -95929,16 +101117,16 @@ g.stateGroup line {
this.options.eles = this.options.eles.not(notEdges);
}
function GridLayout(options3) {
- this.options = extend2({}, defaults$3, options3);
+ this.options = extend4({}, defaults$3, options3);
}
function NullLayout(options3) {
- this.options = extend2({}, defaults$2, options3);
+ this.options = extend4({}, defaults$2, options3);
}
function PresetLayout(options3) {
- this.options = extend2({}, defaults$1, options3);
+ this.options = extend4({}, defaults$1, options3);
}
function RandomLayout(options3) {
- this.options = extend2({}, defaults3, options3);
+ this.options = extend4({}, defaults3, options3);
}
function NullRenderer(options3) {
this.options = options3;
@@ -96058,7 +101246,7 @@ g.stateGroup line {
context.closePath();
}
}
- function circle5(context, rx, ry, r2) {
+ function circle3(context, rx, ry, r2) {
context.arc(rx, ry, r2, 0, Math.PI * 2, false);
}
function roundRect(ctx, x5, y5, width3, height2) {
@@ -96078,6 +101266,620 @@ g.stateGroup line {
if (stroke) ctx.stroke();
else ctx.fill();
}
+ function compileShader(gl, type3, source) {
+ var shader = gl.createShader(type3);
+ gl.shaderSource(shader, source);
+ gl.compileShader(shader);
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
+ throw new Error(gl.getShaderInfoLog(shader));
+ }
+ return shader;
+ }
+ function createProgram(gl, vertexSource, fragementSource) {
+ var vertexShader = compileShader(gl, gl.VERTEX_SHADER, vertexSource);
+ var fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fragementSource);
+ var program = gl.createProgram();
+ gl.attachShader(program, vertexShader);
+ gl.attachShader(program, fragmentShader);
+ gl.linkProgram(program);
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
+ throw new Error("Could not initialize shaders");
+ }
+ return program;
+ }
+ function createTextureCanvas(r2, width3, height2) {
+ if (height2 === void 0) {
+ height2 = width3;
+ }
+ var canvas = r2.makeOffscreenCanvas(width3, height2);
+ var ctx = canvas.context = canvas.getContext("2d");
+ canvas.clear = function() {
+ return ctx.clearRect(0, 0, canvas.width, canvas.height);
+ };
+ canvas.clear();
+ return canvas;
+ }
+ function getEffectivePanZoom(r2) {
+ var pixelRatio = r2.pixelRatio;
+ var zoom2 = r2.cy.zoom();
+ var pan2 = r2.cy.pan();
+ return {
+ zoom: zoom2 * pixelRatio,
+ pan: {
+ x: pan2.x * pixelRatio,
+ y: pan2.y * pixelRatio
+ }
+ };
+ }
+ function modelToRenderedPosition2(r2, pan2, zoom2, x5, y5) {
+ var rx = x5 * zoom2 + pan2.x;
+ var ry = y5 * zoom2 + pan2.y;
+ ry = Math.round(r2.canvasHeight - ry);
+ return [rx, ry];
+ }
+ function toWebGLColor(color2, opacity, outArray) {
+ var r2 = color2[0] / 255;
+ var g2 = color2[1] / 255;
+ var b2 = color2[2] / 255;
+ var a2 = opacity;
+ var arr = outArray || new Array(4);
+ arr[0] = r2 * a2;
+ arr[1] = g2 * a2;
+ arr[2] = b2 * a2;
+ arr[3] = a2;
+ return arr;
+ }
+ function indexToVec4(index, outArray) {
+ var arr = outArray || new Array(4);
+ arr[0] = (index >> 0 & 255) / 255;
+ arr[1] = (index >> 8 & 255) / 255;
+ arr[2] = (index >> 16 & 255) / 255;
+ arr[3] = (index >> 24 & 255) / 255;
+ return arr;
+ }
+ function vec4ToIndex(vec4) {
+ return vec4[0] + (vec4[1] << 8) + (vec4[2] << 16) + (vec4[3] << 24);
+ }
+ function createTexture(gl, debugID) {
+ var texture = gl.createTexture();
+ texture.buffer = function(offscreenCanvas) {
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, offscreenCanvas);
+ gl.generateMipmap(gl.TEXTURE_2D);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ };
+ texture.deleteTexture = function() {
+ gl.deleteTexture(texture);
+ };
+ return texture;
+ }
+ function getTypeInfo(gl, glslType) {
+ switch (glslType) {
+ case "float":
+ return [1, gl.FLOAT, 4];
+ case "vec2":
+ return [2, gl.FLOAT, 4];
+ case "vec3":
+ return [3, gl.FLOAT, 4];
+ case "vec4":
+ return [4, gl.FLOAT, 4];
+ case "int":
+ return [1, gl.INT, 4];
+ case "ivec2":
+ return [2, gl.INT, 4];
+ }
+ }
+ function createTypedArray(gl, glType, dataOrSize) {
+ switch (glType) {
+ case gl.FLOAT:
+ return new Float32Array(dataOrSize);
+ case gl.INT:
+ return new Int32Array(dataOrSize);
+ }
+ }
+ function createTypedArrayView(gl, glType, array4, stride, size5, i2) {
+ switch (glType) {
+ case gl.FLOAT:
+ return new Float32Array(array4.buffer, i2 * stride, size5);
+ case gl.INT:
+ return new Int32Array(array4.buffer, i2 * stride, size5);
+ }
+ }
+ function createBufferStaticDraw(gl, type3, attributeLoc, dataArray) {
+ var _getTypeInfo = getTypeInfo(gl, type3), _getTypeInfo2 = _slicedToArray(_getTypeInfo, 2), size5 = _getTypeInfo2[0], glType = _getTypeInfo2[1];
+ var data6 = createTypedArray(gl, glType, dataArray);
+ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, data6, gl.STATIC_DRAW);
+ if (glType === gl.FLOAT) {
+ gl.vertexAttribPointer(attributeLoc, size5, glType, false, 0, 0);
+ } else if (glType === gl.INT) {
+ gl.vertexAttribIPointer(attributeLoc, size5, glType, 0, 0);
+ }
+ gl.enableVertexAttribArray(attributeLoc);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ return buffer;
+ }
+ function createBufferDynamicDraw(gl, instances, type3, attributeLoc) {
+ var _getTypeInfo3 = getTypeInfo(gl, type3), _getTypeInfo4 = _slicedToArray(_getTypeInfo3, 3), size5 = _getTypeInfo4[0], glType = _getTypeInfo4[1], bytes = _getTypeInfo4[2];
+ var dataArray = createTypedArray(gl, glType, instances * size5);
+ var stride = size5 * bytes;
+ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, instances * stride, gl.DYNAMIC_DRAW);
+ gl.enableVertexAttribArray(attributeLoc);
+ if (glType === gl.FLOAT) {
+ gl.vertexAttribPointer(attributeLoc, size5, glType, false, stride, 0);
+ } else if (glType === gl.INT) {
+ gl.vertexAttribIPointer(attributeLoc, size5, glType, stride, 0);
+ }
+ gl.vertexAttribDivisor(attributeLoc, 1);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ var views = new Array(instances);
+ for (var i2 = 0; i2 < instances; i2++) {
+ views[i2] = createTypedArrayView(gl, glType, dataArray, stride, size5, i2);
+ }
+ buffer.dataArray = dataArray;
+ buffer.stride = stride;
+ buffer.size = size5;
+ buffer.getView = function(i3) {
+ return views[i3];
+ };
+ buffer.setPoint = function(i3, x5, y5) {
+ var view = views[i3];
+ view[0] = x5;
+ view[1] = y5;
+ };
+ buffer.bufferSubData = function(count) {
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ if (count) {
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, dataArray, 0, count * size5);
+ } else {
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, dataArray);
+ }
+ };
+ return buffer;
+ }
+ function createPickingFrameBuffer(gl) {
+ var fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ var targetTexture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, targetTexture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, targetTexture, 0);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ fb.setFramebufferAttachmentSizes = function(width3, height2) {
+ gl.bindTexture(gl.TEXTURE_2D, targetTexture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width3, height2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ };
+ return fb;
+ }
+ function create3() {
+ var out = new ARRAY_TYPE(9);
+ if (ARRAY_TYPE != Float32Array) {
+ out[1] = 0;
+ out[2] = 0;
+ out[3] = 0;
+ out[5] = 0;
+ out[6] = 0;
+ out[7] = 0;
+ }
+ out[0] = 1;
+ out[4] = 1;
+ out[8] = 1;
+ return out;
+ }
+ function identity6(out) {
+ out[0] = 1;
+ out[1] = 0;
+ out[2] = 0;
+ out[3] = 0;
+ out[4] = 1;
+ out[5] = 0;
+ out[6] = 0;
+ out[7] = 0;
+ out[8] = 1;
+ return out;
+ }
+ function multiply(out, a2, b2) {
+ var a00 = a2[0], a01 = a2[1], a02 = a2[2];
+ var a10 = a2[3], a11 = a2[4], a12 = a2[5];
+ var a20 = a2[6], a21 = a2[7], a22 = a2[8];
+ var b00 = b2[0], b01 = b2[1], b02 = b2[2];
+ var b10 = b2[3], b11 = b2[4], b12 = b2[5];
+ var b20 = b2[6], b21 = b2[7], b22 = b2[8];
+ out[0] = b00 * a00 + b01 * a10 + b02 * a20;
+ out[1] = b00 * a01 + b01 * a11 + b02 * a21;
+ out[2] = b00 * a02 + b01 * a12 + b02 * a22;
+ out[3] = b10 * a00 + b11 * a10 + b12 * a20;
+ out[4] = b10 * a01 + b11 * a11 + b12 * a21;
+ out[5] = b10 * a02 + b11 * a12 + b12 * a22;
+ out[6] = b20 * a00 + b21 * a10 + b22 * a20;
+ out[7] = b20 * a01 + b21 * a11 + b22 * a21;
+ out[8] = b20 * a02 + b21 * a12 + b22 * a22;
+ return out;
+ }
+ function translate(out, a2, v3) {
+ var a00 = a2[0], a01 = a2[1], a02 = a2[2], a10 = a2[3], a11 = a2[4], a12 = a2[5], a20 = a2[6], a21 = a2[7], a22 = a2[8], x5 = v3[0], y5 = v3[1];
+ out[0] = a00;
+ out[1] = a01;
+ out[2] = a02;
+ out[3] = a10;
+ out[4] = a11;
+ out[5] = a12;
+ out[6] = x5 * a00 + y5 * a10 + a20;
+ out[7] = x5 * a01 + y5 * a11 + a21;
+ out[8] = x5 * a02 + y5 * a12 + a22;
+ return out;
+ }
+ function rotate(out, a2, rad) {
+ var a00 = a2[0], a01 = a2[1], a02 = a2[2], a10 = a2[3], a11 = a2[4], a12 = a2[5], a20 = a2[6], a21 = a2[7], a22 = a2[8], s2 = Math.sin(rad), c3 = Math.cos(rad);
+ out[0] = c3 * a00 + s2 * a10;
+ out[1] = c3 * a01 + s2 * a11;
+ out[2] = c3 * a02 + s2 * a12;
+ out[3] = c3 * a10 - s2 * a00;
+ out[4] = c3 * a11 - s2 * a01;
+ out[5] = c3 * a12 - s2 * a02;
+ out[6] = a20;
+ out[7] = a21;
+ out[8] = a22;
+ return out;
+ }
+ function scale(out, a2, v3) {
+ var x5 = v3[0], y5 = v3[1];
+ out[0] = x5 * a2[0];
+ out[1] = x5 * a2[1];
+ out[2] = x5 * a2[2];
+ out[3] = y5 * a2[3];
+ out[4] = y5 * a2[4];
+ out[5] = y5 * a2[5];
+ out[6] = a2[6];
+ out[7] = a2[7];
+ out[8] = a2[8];
+ return out;
+ }
+ function projection(out, width3, height2) {
+ out[0] = 2 / width3;
+ out[1] = 0;
+ out[2] = 0;
+ out[3] = 0;
+ out[4] = -2 / height2;
+ out[5] = 0;
+ out[6] = -1;
+ out[7] = 1;
+ out[8] = 1;
+ return out;
+ }
+ function intersection2(set1, set22) {
+ if (set1.intersection) return set1.intersection(set22);
+ else return new Set(_toConsumableArray(set1).filter(function(x5) {
+ return set22.has(x5);
+ }));
+ }
+ function fillStyle(color2, opacity) {
+ return "rgba(".concat(color2[0], ", ").concat(color2[1], ", ").concat(color2[2], ", ").concat(opacity, ")");
+ }
+ function getBGColor(container2) {
+ var cssColor = container2 && container2.style && container2.style.backgroundColor || "white";
+ return color2tuple(cssColor);
+ }
+ function overrideCanvasRendererFunctions(r2) {
+ {
+ var renderCanvas = r2.render;
+ r2.render = function(options3) {
+ options3 = options3 || {};
+ var cy = r2.cy;
+ if (r2.webgl) {
+ if (cy.zoom() > maxZoom$1) {
+ clearWebgl(r2);
+ renderCanvas.call(r2, options3);
+ } else {
+ clearCanvas(r2);
+ renderWebgl(r2, options3, RENDER_TARGET.SCREEN);
+ }
+ }
+ };
+ }
+ {
+ var baseFunc = r2.matchCanvasSize;
+ r2.matchCanvasSize = function(container2) {
+ baseFunc.call(r2, container2);
+ r2.pickingFrameBuffer.setFramebufferAttachmentSizes(r2.canvasWidth, r2.canvasHeight);
+ r2.pickingFrameBuffer.needsDraw = true;
+ };
+ }
+ {
+ r2.findNearestElements = function(x5, y5, interactiveElementsOnly, isTouch) {
+ return findNearestElementsWebgl(r2, x5, y5);
+ };
+ }
+ {
+ var _baseFunc = r2.invalidateCachedZSortedEles;
+ r2.invalidateCachedZSortedEles = function() {
+ _baseFunc.call(r2);
+ r2.pickingFrameBuffer.needsDraw = true;
+ };
+ }
+ {
+ var _baseFunc2 = r2.notify;
+ r2.notify = function(eventName, eles) {
+ _baseFunc2.call(r2, eventName, eles);
+ if (eventName === "viewport" || eventName === "bounds") {
+ r2.pickingFrameBuffer.needsDraw = true;
+ } else if (eventName === "background") {
+ r2.eleDrawing.invalidate(eles, {
+ type: "node-body"
+ });
+ }
+ };
+ }
+ }
+ function clearWebgl(r2) {
+ var gl = r2.data.contexts[r2.WEBGL];
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ }
+ function clearCanvas(r2) {
+ var clear22 = /* @__PURE__ */ __name(function clear23(context) {
+ context.save();
+ context.setTransform(1, 0, 0, 1, 0, 0);
+ context.clearRect(0, 0, r2.canvasWidth, r2.canvasHeight);
+ context.restore();
+ }, "clear");
+ clear22(r2.data.contexts[r2.NODE]);
+ clear22(r2.data.contexts[r2.DRAG]);
+ }
+ function createPanZoomMatrix(r2) {
+ var width3 = r2.canvasWidth;
+ var height2 = r2.canvasHeight;
+ var _util$getEffectivePan = getEffectivePanZoom(r2), pan2 = _util$getEffectivePan.pan, zoom2 = _util$getEffectivePan.zoom;
+ var transform8 = create3();
+ translate(transform8, transform8, [pan2.x, pan2.y]);
+ scale(transform8, transform8, [zoom2, zoom2]);
+ var projection$1 = create3();
+ projection(projection$1, width3, height2);
+ var product = create3();
+ multiply(product, projection$1, transform8);
+ return product;
+ }
+ function setContextTransform(r2, context) {
+ var width3 = r2.canvasWidth;
+ var height2 = r2.canvasHeight;
+ var _util$getEffectivePan2 = getEffectivePanZoom(r2), pan2 = _util$getEffectivePan2.pan, zoom2 = _util$getEffectivePan2.zoom;
+ context.setTransform(1, 0, 0, 1, 0, 0);
+ context.clearRect(0, 0, width3, height2);
+ context.translate(pan2.x, pan2.y);
+ context.scale(zoom2, zoom2);
+ }
+ function drawSelectionRectangle(r2, options3) {
+ r2.drawSelectionRectangle(options3, function(context) {
+ return setContextTransform(r2, context);
+ });
+ }
+ function drawAxes(r2) {
+ var context = r2.data.contexts[r2.NODE];
+ context.save();
+ setContextTransform(r2, context);
+ context.strokeStyle = "rgba(0, 0, 0, 0.3)";
+ context.beginPath();
+ context.moveTo(-1e3, 0);
+ context.lineTo(1e3, 0);
+ context.stroke();
+ context.beginPath();
+ context.moveTo(0, -1e3);
+ context.lineTo(0, 1e3);
+ context.stroke();
+ context.restore();
+ }
+ function drawAtlases(r2) {
+ var draw25 = /* @__PURE__ */ __name(function draw26(drawing, renderType, row) {
+ var opts = drawing.atlasManager.getRenderTypeOpts(renderType);
+ var context = r2.data.contexts[r2.NODE];
+ var scale2 = 0.125;
+ var atlases = opts.atlasCollection.atlases;
+ for (var _i = 0; _i < atlases.length; _i++) {
+ var atlas = atlases[_i];
+ var canvas = atlas.canvas;
+ var w3 = canvas.width;
+ var h2 = canvas.height;
+ var x5 = w3 * _i;
+ var y5 = canvas.height * row;
+ context.save();
+ context.scale(scale2, scale2);
+ context.drawImage(canvas, x5, y5);
+ context.strokeStyle = "black";
+ context.rect(x5, y5, w3, h2);
+ context.stroke();
+ context.restore();
+ }
+ }, "draw");
+ var i2 = 0;
+ draw25(r2.eleDrawing, "node-body", i2++);
+ draw25(r2.eleDrawing, "node-label", i2++);
+ }
+ function getPickingIndexes(r2, mX1, mY1, mX2, mY2) {
+ var x5, y5, w3, h2;
+ var _util$getEffectivePan3 = getEffectivePanZoom(r2), pan2 = _util$getEffectivePan3.pan, zoom2 = _util$getEffectivePan3.zoom;
+ if (mX2 === void 0 || mY2 === void 0) {
+ var _util$modelToRendered = modelToRenderedPosition2(r2, pan2, zoom2, mX1, mY1), _util$modelToRendered2 = _slicedToArray(_util$modelToRendered, 2), cX1 = _util$modelToRendered2[0], cY1 = _util$modelToRendered2[1];
+ var t4 = 6;
+ x5 = cX1 - t4 / 2;
+ y5 = cY1 - t4 / 2;
+ w3 = t4;
+ h2 = t4;
+ } else {
+ var _util$modelToRendered3 = modelToRenderedPosition2(r2, pan2, zoom2, mX1, mY1), _util$modelToRendered4 = _slicedToArray(_util$modelToRendered3, 2), _cX = _util$modelToRendered4[0], _cY = _util$modelToRendered4[1];
+ var _util$modelToRendered5 = modelToRenderedPosition2(r2, pan2, zoom2, mX2, mY2), _util$modelToRendered6 = _slicedToArray(_util$modelToRendered5, 2), cX2 = _util$modelToRendered6[0], cY2 = _util$modelToRendered6[1];
+ x5 = _cX;
+ y5 = cY2;
+ w3 = Math.abs(cX2 - _cX);
+ h2 = Math.abs(cY2 - _cY);
+ }
+ if (w3 === 0 || h2 === 0) {
+ return [];
+ }
+ var gl = r2.data.contexts[r2.WEBGL];
+ gl.bindFramebuffer(gl.FRAMEBUFFER, r2.pickingFrameBuffer);
+ if (r2.pickingFrameBuffer.needsDraw) {
+ gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
+ renderWebgl(r2, null, RENDER_TARGET.PICKING);
+ r2.pickingFrameBuffer.needsDraw = false;
+ }
+ var n2 = w3 * h2;
+ var data6 = new Uint8Array(n2 * 4);
+ gl.readPixels(x5, y5, w3, h2, gl.RGBA, gl.UNSIGNED_BYTE, data6);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ var indexes = /* @__PURE__ */ new Set();
+ for (var i2 = 0; i2 < n2; i2++) {
+ var pixel = data6.slice(i2 * 4, i2 * 4 + 4);
+ var index = vec4ToIndex(pixel) - 1;
+ if (index >= 0) {
+ indexes.add(index);
+ }
+ }
+ return indexes;
+ }
+ function findNearestElementsWebgl(r2, x5, y5) {
+ var indexes = getPickingIndexes(r2, x5, y5);
+ var eles = r2.getCachedZSortedEles();
+ var node2, edge;
+ var _iterator = _createForOfIteratorHelper(indexes), _step;
+ try {
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
+ var index = _step.value;
+ var ele = eles[index];
+ if (!node2 && ele.isNode()) {
+ node2 = ele;
+ }
+ if (!edge && ele.isEdge()) {
+ edge = ele;
+ }
+ if (node2 && edge) {
+ break;
+ }
+ }
+ } catch (err) {
+ _iterator.e(err);
+ } finally {
+ _iterator.f();
+ }
+ return [node2, edge].filter(Boolean);
+ }
+ function renderWebgl(r2, options3, renderTarget) {
+ var start3;
+ var debugInfo;
+ if (r2.webglDebug) {
+ debugInfo = [];
+ start3 = performance.now();
+ }
+ var eleDrawing = r2.eleDrawing;
+ var eleCount = 0;
+ if (renderTarget.screen) {
+ if (r2.data.canvasNeedsRedraw[r2.SELECT_BOX]) {
+ drawSelectionRectangle(r2, options3);
+ }
+ }
+ if (r2.data.canvasNeedsRedraw[r2.NODE] || renderTarget.picking) {
+ var draw25 = /* @__PURE__ */ __name(function draw26(ele, index) {
+ index += 1;
+ if (ele.isNode()) {
+ eleDrawing.drawTexture(ele, index, "node-underlay");
+ eleDrawing.drawTexture(ele, index, "node-body");
+ eleDrawing.drawTexture(ele, index, "node-label");
+ eleDrawing.drawTexture(ele, index, "node-overlay");
+ } else {
+ eleDrawing.drawEdgeLine(ele, index);
+ eleDrawing.drawEdgeArrow(ele, index, "source");
+ eleDrawing.drawEdgeArrow(ele, index, "target");
+ eleDrawing.drawTexture(ele, index, "edge-label");
+ }
+ }, "draw");
+ var gl = r2.data.contexts[r2.WEBGL];
+ if (renderTarget.screen) {
+ gl.clearColor(0, 0, 0, 0);
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
+ } else {
+ gl.disable(gl.BLEND);
+ }
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
+ var panZoomMatrix = createPanZoomMatrix(r2);
+ var eles = r2.getCachedZSortedEles();
+ eleCount = eles.length;
+ eleDrawing.startFrame(panZoomMatrix, debugInfo, renderTarget);
+ if (renderTarget.screen) {
+ for (var i2 = 0; i2 < eles.nondrag.length; i2++) {
+ draw25(eles.nondrag[i2], i2);
+ }
+ for (var _i2 = 0; _i2 < eles.drag.length; _i2++) {
+ draw25(eles.drag[_i2], -1);
+ }
+ } else if (renderTarget.picking) {
+ for (var _i3 = 0; _i3 < eles.length; _i3++) {
+ draw25(eles[_i3], _i3);
+ }
+ }
+ eleDrawing.endFrame();
+ if (r2.data.gc) {
+ console.log("Garbage Collect!");
+ r2.data.gc = false;
+ eleDrawing.gc();
+ }
+ if (renderTarget.screen && r2.webglDebugShowAtlases) {
+ drawAxes(r2);
+ drawAtlases(r2);
+ }
+ r2.data.canvasNeedsRedraw[r2.NODE] = false;
+ r2.data.canvasNeedsRedraw[r2.DRAG] = false;
+ }
+ if (r2.webglDebug) {
+ var end2 = performance.now();
+ var compact2 = true;
+ var batchCount = 0;
+ var count = 0;
+ var _iterator3 = _createForOfIteratorHelper(debugInfo), _step3;
+ try {
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
+ var _info = _step3.value;
+ batchCount++;
+ count += _info.count;
+ }
+ } catch (err) {
+ _iterator3.e(err);
+ } finally {
+ _iterator3.f();
+ }
+ var time4 = Math.ceil(end2 - start3);
+ var report = "".concat(eleCount, " elements, ").concat(count, " rectangles, ").concat(batchCount, " batches");
+ if (compact2) {
+ console.log("WebGL (".concat(renderTarget.name, ") - ").concat(report));
+ } else {
+ console.log("WebGL render (".concat(renderTarget.name, ") - frame time ").concat(time4, "ms"));
+ console.log(" ".concat(report));
+ console.log("Texture Atlases Used:");
+ var atlasInfo = eleDrawing.getAtlasDebugInfo();
+ var _iterator4 = _createForOfIteratorHelper(atlasInfo), _step4;
+ try {
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
+ var info2 = _step4.value;
+ console.log(" ".concat(info2.type, ": ").concat(info2.keyCount, " keys, ").concat(info2.atlasCount, " atlases"));
+ }
+ } catch (err) {
+ _iterator4.e(err);
+ } finally {
+ _iterator4.f();
+ }
+ console.log("");
+ }
+ }
+ }
function b64ToBlob(b64, mimeType) {
var bytes = atob(b64);
var buff = new ArrayBuffer(bytes.length);
@@ -96125,6 +101927,10 @@ g.stateGroup line {
var r2 = this;
var containerWindow = r2.cy.window();
var document2 = containerWindow.document;
+ if (options3.webgl) {
+ CRp.CANVAS_LAYERS = r2.CANVAS_LAYERS = 4;
+ console.log("webgl rendering enabled");
+ }
r2.data = {
canvases: new Array(CRp.CANVAS_LAYERS),
contexts: new Array(CRp.CANVAS_LAYERS),
@@ -96156,7 +101962,11 @@ g.stateGroup line {
}
for (var i2 = 0; i2 < CRp.CANVAS_LAYERS; i2++) {
var canvas = r2.data.canvases[i2] = document2.createElement("canvas");
- r2.data.contexts[i2] = canvas.getContext("2d");
+ var type3 = CRp.CANVAS_TYPES[i2];
+ r2.data.contexts[i2] = canvas.getContext(type3);
+ if (!r2.data.contexts[i2]) {
+ error("Could not create canvas of type " + type3);
+ }
Object.keys(styleMap2).forEach(function(k2) {
canvas.style[k2] = styleMap2[k2];
});
@@ -96170,6 +101980,9 @@ g.stateGroup line {
r2.data.canvases[CRp.NODE].setAttribute("data-id", "layer" + CRp.NODE + "-node");
r2.data.canvases[CRp.SELECT_BOX].setAttribute("data-id", "layer" + CRp.SELECT_BOX + "-selectbox");
r2.data.canvases[CRp.DRAG].setAttribute("data-id", "layer" + CRp.DRAG + "-drag");
+ if (r2.data.canvases[CRp.WEBGL]) {
+ r2.data.canvases[CRp.WEBGL].setAttribute("data-id", "layer" + CRp.WEBGL + "-webgl");
+ }
for (var i2 = 0; i2 < CRp.BUFFER_COUNT; i2++) {
r2.data.bufferCanvases[i2] = document2.createElement("canvas");
r2.data.bufferContexts[i2] = r2.data.bufferCanvases[i2].getContext("2d");
@@ -96281,18 +102094,18 @@ g.stateGroup line {
if (ele.isNode()) {
switch (ele.pstyle("text-halign").value) {
case "left":
- p3.x = -bb.w;
+ p3.x = -bb.w - (bb.leftPad || 0);
break;
case "right":
- p3.x = 0;
+ p3.x = -(bb.rightPad || 0);
break;
}
switch (ele.pstyle("text-valign").value) {
case "top":
- p3.y = -bb.h;
+ p3.y = -bb.h - (bb.topPad || 0);
break;
case "bottom":
- p3.y = 0;
+ p3.y = -(bb.botPad || 0);
break;
}
}
@@ -96353,6 +102166,20 @@ g.stateGroup line {
lblTxrCache.onDequeue(refineInLayers);
slbTxrCache.onDequeue(refineInLayers);
tlbTxrCache.onDequeue(refineInLayers);
+ if (options3.webgl) {
+ r2.initWebgl(options3, {
+ getStyleKey,
+ getLabelKey,
+ drawElement,
+ drawLabel: drawLabel4,
+ getElementBox,
+ getLabelBox,
+ getElementRotationPoint,
+ getElementRotationOffset,
+ getLabelRotationPoint,
+ getLabelRotationOffset
+ });
+ }
}
function setExtension(type3, name, registrant) {
var ext = registrant;
@@ -96443,9 +102270,9 @@ g.stateGroup line {
return getCy(layout6);
}, "parent")
};
- extend2(layoutProto, {
+ extend4(layoutProto, {
createEmitter: /* @__PURE__ */ __name(function createEmitter3() {
- this._private.emitter = new Emitter2(emitterOpts, this);
+ this._private.emitter = new Emitter3(emitterOpts, this);
return this;
}, "createEmitter"),
emitter: /* @__PURE__ */ __name(function emitter3() {
@@ -96533,9 +102360,9 @@ g.stateGroup line {
keys: [type3, name, moduleType, moduleName]
});
}
- var _window, navigator2, typeofstr, typeofobj, typeoffn, typeofhtmlele, instanceStr, string, fn$6, array2, plainObject, object, number$1, integer2, htmlElement, elementOrCollection, element, collection, core, stylesheet, event, emptyString, domElement, boundingBox, promise, ms, memoize$1, camel2dash, dash2camel, prependCamel, capitalize, number6, rgba3, rgbaNoBackRefs, hsla2, hslaNoBackRefs, hex3, hex6, ascending3, descending2, extend2, hex2tuple, hsl2tuple, rgb2tuple, colorname2tuple, color2tuple, colors, setMap, getMap, isObject_1, commonjsGlobal, freeGlobal2, _freeGlobal, freeSelf2, root3, _root, now3, now_1, reWhitespace2, _trimmedEndIndex, reTrimStart2, _baseTrim, Symbol$1, _Symbol, objectProto$5, hasOwnProperty$4, nativeObjectToString$1, symToStringTag$1, _getRawTag, objectProto$4, nativeObjectToString3, _objectToString, nullTag2, undefinedTag2, symToStringTag3, _baseGetTag, isObjectLike_1, symbolTag5, isSymbol_1, NAN2, reIsBadHex2, reIsBinary2, reIsOctal2, freeParseInt2, toNumber_1, FUNC_ERROR_TEXT$1, nativeMax6, nativeMin, debounce_1, performance2, pnow, raf, requestAnimationFrame2, performanceNow, DEFAULT_HASH_SEED, K3, DEFAULT_HASH_SEED_ALT, hashIterableInts, hashInt, hashIntAlt, combineHashes, combineHashesArray, hashArrays, hashIntsArray, hashString, hashStrings, hashStringsArray, warningsEnabled, warnSupported, traceSupported, MAX_INT$1, trueify, falsify, zeroify, noop$1, error, warnings, warn, clone3, copy4, copyArray$1, uuid, _staticEmptyObject, staticEmptyObject, defaults$g, removeFromArray, clearArray, push, getPrefixedProperty, setPrefixedProperty, ObjectMap, Map$2, undef, ObjectSet, Set$1, Element, defineSearch, elesfn$v, heap$1, heap, dijkstraDefaults, elesfn$u, elesfn$t, aStarDefaults, elesfn$s, floydWarshallDefaults, elesfn$r, bellmanFordDefaults, elesfn$q, sqrt2, collapse, contractUntil, elesfn$p, copyPosition, modelToRenderedPosition, renderedToModelPosition, array2point, min5, max5, mean, median, deg2rad, getAngleFromDisp, log22, signum, dist, sqdist, inPlaceSumNormalize, qbezierAt, qbezierPtAt, lineAt, bound, makeBoundingBox, copyBoundingBox, clearBoundingBox, shiftBoundingBox, updateBoundingBox, expandBoundingBoxByPoint, expandBoundingBox, expandBoundingBoxSides, assignBoundingBox, boundingBoxesIntersect, inBoundingBox, pointInBoundingBox, boundingBoxInBoundingBox, roundRectangleIntersectLine, inLineVicinity, inBezierVicinity, solveQuadratic, solveCubic, sqdistToQuadraticBezier, sqdistToFiniteLine, pointInsidePolygonPoints, pointInsidePolygon, pointInsideRoundPolygon, joinLines, expandPolygon, intersectLineEllipse, checkInEllipse, intersectLineCircle, midOfThree, finiteLinesIntersect, polygonIntersectLine, roundPolygonIntersectLine, shortenIntersection, generateUnitNgonPointsFitToSquare, fitPolygonToSquare, generateUnitNgonPoints, getRoundRectangleRadius, getRoundPolygonRadius, getCutRectangleCornerLength, bezierPtsToQuadCoeff, getBarrelCurveConstants, pageRankDefaults, elesfn$o, defaults$f, elesfn$n, defaults$e, elesfn$m, defaults$d, elesfn$l, defaults$c, setOptions$3, getSimilarity$1, addLoops, normalize2, mmult, expand, inflate, hasConverged, assign$2, isDuplicate, removeDuplicates, markovClustering, markovClustering$1, identity5, absDiff, addAbsDiff, addSquaredDiff, sqrt3, maxAbsDiff, getDistance, distances, defaults$b, setOptions$2, getDist, randomCentroids, classify, buildCluster, haveValuesConverged, haveMatricesConverged, seenBefore, randomMedoids, findCost, kMeans, kMedoids, updateCentroids, updateMembership, assign$1, fuzzyCMeans, kClustering, defaults$a, linkageAliases, setOptions$1, mergeClosest, getAllChildren, buildDendrogram, buildClustersFromTree, hierarchicalClustering, hierarchicalClustering$1, defaults$9, setOptions6, getSimilarity2, getPreference, findExemplars, assignClusters, assign4, affinityPropagation, affinityPropagation$1, hierholzerDefaults, elesfn$k, hopcroftTarjanBiconnected, hopcroftTarjanBiconnected$1, tarjanStronglyConnected, tarjanStronglyConnected$1, elesfn$j, STATE_PENDING, STATE_FULFILLED, STATE_REJECTED, api, deliver, execute, execute_handlers, resolver, resolve, Promise$1, Animation, anifn, define$3, isArray2, isArray_1, reIsDeepProp2, reIsPlainProp2, _isKey, asyncTag2, funcTag4, genTag3, proxyTag2, isFunction_1, coreJsData2, _coreJsData, maskSrcKey2, _isMasked, funcProto$1, funcToString$1, _toSource, reRegExpChar2, reIsHostCtor2, funcProto4, objectProto$3, funcToString4, hasOwnProperty$3, reIsNative2, _baseIsNative, _getValue, _getNative, nativeCreate2, _nativeCreate, _hashClear, _hashDelete, HASH_UNDEFINED$1, objectProto$2, hasOwnProperty$2, _hashGet, objectProto$1, hasOwnProperty$1, _hashHas, HASH_UNDEFINED4, _hashSet, _Hash, _listCacheClear, eq_1, _assocIndexOf, arrayProto2, splice2, _listCacheDelete, _listCacheGet, _listCacheHas, _listCacheSet, _ListCache, Map$1, _Map, _mapCacheClear, _isKeyable, _getMapData, _mapCacheDelete, _mapCacheGet, _mapCacheHas, _mapCacheSet, _MapCache, FUNC_ERROR_TEXT3, memoize_1, MAX_MEMOIZE_SIZE2, _memoizeCapped, rePropName2, reEscapeChar2, stringToPath2, _stringToPath, _arrayMap, INFINITY$1, symbolProto4, symbolToString2, _baseToString, toString_1, _castPath, INFINITY5, _toKey, _baseGet, get_1, defineProperty2, _defineProperty, _baseAssignValue, objectProto22, hasOwnProperty19, _assignValue, MAX_SAFE_INTEGER3, reIsUint2, _isIndex, _baseSet, set_1, _copyArray, toPath_1, define$2, define$1, define2, elesfn$i, elesfn$h, tokens, newQuery, Type3, stateSelectors, lookup, stateSelectorMatches, stateSelectorRegex, cleanMetaChars, replaceLastQuery, exprs, consumeExpr, consumeWhitespace, parse3, toString3, parse$1, valCmp, boolCmp, existCmp, data$1, meta, match, matches$1, filter3, matches31, matching, Selector, selfn, elesfn$g, cache, elesfn$f, fn$5, elesfn$e, data3, elesfn$d, fn$4, elesfn$c, beforePositionSet, positionDef, position2, fn$3, elesfn$b, noninf, updateBounds, updateBoundsFromBox, prefixedProperty, updateBoundsFromArrow, updateBoundsFromLabel, updateBoundsFromOutline, boundingBoxImpl, getKey, getBoundingBoxPosKey, cachedBoundingBoxImpl, defBbOpts, defBbOptsKey, filledBbOpts, bounds3, fn$2, elesfn$a, defineDimFns, widthHeight, ifEdge, ifEdgeRenderedPosition, ifEdgeRenderedPositions, controlPoints2, segmentPoints, sourceEndpoint, targetEndpoint, midpoint, pts, renderedName, edgePoints, dimensions, Event, eventRegex, universalNamespace, defaults$8, defaultsKeys, emptyOpts, p2, forEachEvent, makeEventObj, forEachEventObj, emitterOptions$1, argSelector$1, elesfn$9, elesfn$8, fn$1, elesfn$7, zIndexSort, elesfn$6, defineSymbolIterator, getLayoutDimensionOptions, elesfn$5, elesfn$4, eleTakesUpSpace, eleInteractive, parentInteractive, eleVisible, edgeVisibleViaNode, elesfn$3, elesfn$2, defineDagExtremity, defineDagOneHop, defineDagAllHops, Collection, elesfn$1, corefn$9, generateSpringRK4, cubicBezier, easings, corefn$8, emitterOptions, argSelector2, elesfn, corefn$7, corefn$6, corefn$5, rendererDefaults, corefn$4, corefn$3, styfn$8, TRUE, FALSE, styfn$7, styfn$6, styfn$5, styfn$4, styfn$3, styfn$2, styfn$1, Style2, styfn, corefn$2, defaultSelectionType, corefn$1, fn2, Core, corefn, defaults$7, deprecatedOptionDefaults, getInfo, setInfo, defaults$6, defaults$5, DEBUG, defaults$4, createLayoutInfo, findLCA, findLCA_aux, printLayoutInfo, randomizePositions, getScaleInBoundsFn, refreshPositions, step, calculateNodeForces, randomDistance, nodeRepulsion2, nodesOverlap, findClippingPoint, calculateEdgeForces, calculateGravityForces, propagateForces, updatePositions, limitForce, updateAncestryBoundaries, separateComponents, defaults$3, defaults$2, defaults$1, defaults3, layout4, noop4, throwImgErr, BRp$f, BRp$e, BRp$d, x3, y3, v1, v2, sinA, sinA90, radDirection, drawDirection, angle, halfAngle, cRadius, lenOut, radius, limit, startX, startY, stopX, stopY, lastPoint, asVec, invertVec, calcCornerArc, BRp$c, BRp$b, BRp$a, BRp$9, lineAngleFromDelta, lineAngle, bezierAngle, BRp$8, TOO_SMALL_CUT_RECT, warnedCutRect, BRp$7, BRp$6, BRp$5, BRp$4, BRp$3, BRp$2, BRp$1, beforeRenderCallbacks, BaseRenderer, BR, BRp, fullFpsTime, defs, ElementTextureCacheLookup, minTxrH, txrStepH, minLvl$1, maxLvl$1, maxZoom$1, eleTxrSpacing, defTxrWidth, maxTxrW, maxTxrH, minUtility, maxFullness, maxFullnessChecks, deqCost$1, deqAvgCost$1, deqNoDrawCost$1, deqFastCost$1, deqRedrawThreshold$1, maxDeqSize$1, getTxrReasons, initDefaults, ElementTextureCache, ETCp, defNumLayers, minLvl, maxLvl, maxZoom2, deqRedrawThreshold, refineEleDebounceTime, deqCost, deqAvgCost, deqNoDrawCost, deqFastCost, maxDeqSize, invalidThreshold, maxLayerArea, useHighQualityEleTxrReqs, LayeredTextureCache, LTCp, layerIdPool, MAX_INT, CRp$a, impl, CRp$9, getZeroRotation, getLabelRotation, getSourceLabelRotation, getTargetLabelRotation, getOpacity, getTextOpacity, CRp$8, drawEdgeOverlayUnderlay, CRp$7, CRp$6, CRp$5, drawNodeOverlayUnderlay, CRp$4, motionBlurDelay, CRp$3, sin0, cos0, sin2, cos2, ellipseStepSize, i2, CRp$2, CRp$1, CR, CRp, pathsImpld, renderer5, incExts, extensions, modules, extension3, Stylesheet, sheetfn, version3, cytoscape2;
+ var _window, navigator2, typeofstr, typeofobj, typeoffn, typeofhtmlele, instanceStr, string, fn$6, array2, plainObject, object, number$1, integer2, htmlElement, elementOrCollection, element, collection, core2, stylesheet, event, emptyString, domElement, boundingBox, promise, ms, memoize$1, camel2dash, dash2camel, prependCamel, capitalize, number6, rgba3, rgbaNoBackRefs, hsla2, hslaNoBackRefs, hex3, hex6, ascending3, descending2, extend4, hex2tuple, hsl2tuple, rgb2tuple, colorname2tuple, color2tuple, colors, setMap, getMap, isObject_12, commonjsGlobal, freeGlobal2, _freeGlobal, freeSelf2, root3, _root, now3, now_1, reWhitespace2, _trimmedEndIndex, reTrimStart2, _baseTrim, Symbol$1, _Symbol, objectProto$5, hasOwnProperty$4, nativeObjectToString$1, symToStringTag$1, _getRawTag, objectProto$4, nativeObjectToString3, _objectToString, nullTag2, undefinedTag2, symToStringTag3, _baseGetTag, isObjectLike_1, symbolTag5, isSymbol_1, NAN2, reIsBadHex2, reIsBinary2, reIsOctal2, freeParseInt2, toNumber_1, FUNC_ERROR_TEXT$1, nativeMax6, nativeMin, debounce_1, performance$1, pnow, raf, requestAnimationFrame2, performanceNow, DEFAULT_HASH_SEED, K3, DEFAULT_HASH_SEED_ALT, hashIterableInts, hashInt, hashIntAlt, combineHashes, combineHashesArray, hashArrays, hashIntsArray, hashString, hashStrings, hashStringsArray, warningsEnabled, warnSupported, traceSupported, MAX_INT$1, trueify, falsify, zeroify, noop$1, error, warnings, warn, clone4, copy3, copyArray$1, uuid, _staticEmptyObject, staticEmptyObject, defaults$g, removeFromArray, clearArray, push, getPrefixedProperty, setPrefixedProperty, ObjectMap, Map$2, undef, ObjectSet, Set$1, Element2, defineSearch, elesfn$v, heap$1, heap, dijkstraDefaults, elesfn$u, elesfn$t, aStarDefaults, elesfn$s, floydWarshallDefaults, elesfn$r, bellmanFordDefaults, elesfn$q, sqrt2, collapse, contractUntil, elesfn$p, copyPosition, modelToRenderedPosition$1, renderedToModelPosition, array2point, min5, max5, mean, median, deg2rad, getAngleFromDisp, log22, signum, dist, sqdist, inPlaceSumNormalize, qbezierAt, qbezierPtAt, lineAt, bound, makeBoundingBox, copyBoundingBox, clearBoundingBox, shiftBoundingBox, updateBoundingBox, expandBoundingBoxByPoint, expandBoundingBox, expandBoundingBoxSides, assignBoundingBox, boundingBoxesIntersect, inBoundingBox, pointInBoundingBox, boundingBoxInBoundingBox, roundRectangleIntersectLine, inLineVicinity, inBezierVicinity, solveQuadratic, solveCubic, sqdistToQuadraticBezier, sqdistToFiniteLine, pointInsidePolygonPoints, pointInsidePolygon, pointInsideRoundPolygon, joinLines, expandPolygon, intersectLineEllipse, checkInEllipse, intersectLineCircle, midOfThree, finiteLinesIntersect, polygonIntersectLine, roundPolygonIntersectLine, shortenIntersection, generateUnitNgonPointsFitToSquare, fitPolygonToSquare, generateUnitNgonPoints, getRoundRectangleRadius, getRoundPolygonRadius, getCutRectangleCornerLength, bezierPtsToQuadCoeff, getBarrelCurveConstants, pageRankDefaults, elesfn$o, defaults$f, elesfn$n, defaults$e, elesfn$m, defaults$d, elesfn$l, defaults$c, setOptions$3, getSimilarity$1, addLoops, normalize2, mmult, expand, inflate, hasConverged, assign$2, isDuplicate, removeDuplicates, markovClustering, markovClustering$1, identity$1, absDiff, addAbsDiff, addSquaredDiff, sqrt3, maxAbsDiff, getDistance, distances, defaults$b, setOptions$2, getDist, randomCentroids, classify, buildCluster, haveValuesConverged, haveMatricesConverged, seenBefore, randomMedoids, findCost, kMeans, kMedoids, updateCentroids, updateMembership, assign$1, fuzzyCMeans, kClustering, defaults$a, linkageAliases, setOptions$1, mergeClosest, getAllChildren, buildDendrogram, buildClustersFromTree, hierarchicalClustering, hierarchicalClustering$1, defaults$9, setOptions6, getSimilarity2, getPreference, findExemplars, assignClusters, assign4, affinityPropagation, affinityPropagation$1, hierholzerDefaults, elesfn$k, hopcroftTarjanBiconnected, hopcroftTarjanBiconnected$1, tarjanStronglyConnected, tarjanStronglyConnected$1, elesfn$j, STATE_PENDING, STATE_FULFILLED, STATE_REJECTED, api, deliver, execute, execute_handlers, resolver, resolve, Promise$1, Animation, anifn, define$3, isArray2, isArray_1, reIsDeepProp2, reIsPlainProp2, _isKey, asyncTag2, funcTag4, genTag3, proxyTag2, isFunction_1, coreJsData2, _coreJsData, maskSrcKey2, _isMasked, funcProto$1, funcToString$1, _toSource, reRegExpChar2, reIsHostCtor2, funcProto4, objectProto$3, funcToString4, hasOwnProperty$3, reIsNative2, _baseIsNative, _getValue, _getNative, nativeCreate2, _nativeCreate, _hashClear, _hashDelete, HASH_UNDEFINED$1, objectProto$2, hasOwnProperty$2, _hashGet, objectProto$1, hasOwnProperty$1, _hashHas, HASH_UNDEFINED4, _hashSet, _Hash, _listCacheClear, eq_1, _assocIndexOf, arrayProto2, splice2, _listCacheDelete, _listCacheGet, _listCacheHas, _listCacheSet, _ListCache, Map$1, _Map, _mapCacheClear, _isKeyable, _getMapData, _mapCacheDelete, _mapCacheGet, _mapCacheHas, _mapCacheSet, _MapCache, FUNC_ERROR_TEXT3, memoize_1, MAX_MEMOIZE_SIZE2, _memoizeCapped, rePropName2, reEscapeChar2, stringToPath2, _stringToPath, _arrayMap, INFINITY$1, symbolProto4, symbolToString2, _baseToString, toString_1, _castPath, INFINITY5, _toKey, _baseGet, get_1, defineProperty2, _defineProperty, _baseAssignValue, objectProto22, hasOwnProperty19, _assignValue, MAX_SAFE_INTEGER3, reIsUint2, _isIndex, _baseSet, set_1, _copyArray, toPath_1, define$2, define$1, define2, elesfn$i, elesfn$h, tokens, newQuery, Type3, stateSelectors, lookup, stateSelectorMatches, stateSelectorRegex, cleanMetaChars, replaceLastQuery, exprs, consumeExpr, consumeWhitespace, parse2, toString4, parse$1, valCmp, boolCmp, existCmp, data$1, meta, match, matches$1, filter3, matches31, matching, Selector, selfn, elesfn$g, cache, elesfn$f, fn$5, elesfn$e, data3, elesfn$d, fn$4, elesfn$c, beforePositionSet, positionDef, position2, fn$3, elesfn$b, noninf, updateBounds, updateBoundsFromBox, prefixedProperty, updateBoundsFromArrow, updateBoundsFromLabel, updateBoundsFromOutline, boundingBoxImpl, getKey, getBoundingBoxPosKey, cachedBoundingBoxImpl, defBbOpts, defBbOptsKey, filledBbOpts, bounds3, fn$2, elesfn$a, defineDimFns, widthHeight, ifEdge, ifEdgeRenderedPosition, ifEdgeRenderedPositions, controlPoints2, segmentPoints, sourceEndpoint, targetEndpoint, midpoint, pts, renderedName, edgePoints, dimensions, Event, eventRegex, universalNamespace, defaults$8, defaultsKeys, emptyOpts, p2, forEachEvent, makeEventObj, forEachEventObj, emitterOptions$1, argSelector$1, elesfn$9, elesfn$8, fn$1, elesfn$7, zIndexSort, elesfn$6, defineSymbolIterator, getLayoutDimensionOptions, elesfn$5, elesfn$4, eleTakesUpSpace, eleInteractive, parentInteractive, eleVisible, edgeVisibleViaNode, elesfn$3, elesfn$2, defineDagExtremity, defineDagOneHop, defineDagAllHops, Collection, elesfn$1, corefn$9, generateSpringRK4, cubicBezier, easings, corefn$8, emitterOptions, argSelector2, elesfn, corefn$7, corefn$6, corefn$5, rendererDefaults, corefn$4, corefn$3, styfn$8, TRUE, FALSE, styfn$7, styfn$6, styfn$5, styfn$4, styfn$3, styfn$2, styfn$1, Style2, styfn, corefn$2, defaultSelectionType, corefn$1, fn2, Core, corefn, defaults$7, deprecatedOptionDefaults, getInfo, setInfo, defaults$6, defaults$5, DEBUG, defaults$4, createLayoutInfo, findLCA, findLCA_aux, printLayoutInfo, randomizePositions, getScaleInBoundsFn, refreshPositions, step, calculateNodeForces, randomDistance, nodeRepulsion2, nodesOverlap, findClippingPoint, calculateEdgeForces, calculateGravityForces, propagateForces, updatePositions, limitForce, updateAncestryBoundaries, separateComponents, defaults$3, defaults$2, defaults$1, defaults3, layout4, noop4, throwImgErr, BRp$f, BRp$e, BRp$d, x3, y3, v1, v2, sinA, sinA90, radDirection, drawDirection, angle, halfAngle, cRadius, lenOut, radius, limit, startX, startY, stopX, stopY, lastPoint, asVec, invertVec, calcCornerArc, BRp$c, BRp$b, BRp$a, BRp$9, lineAngleFromDelta, lineAngle, bezierAngle, BRp$8, TOO_SMALL_CUT_RECT, warnedCutRect, BRp$7, BRp$6, BRp$5, BRp$4, BRp$3, BRp$2, BRp$1, beforeRenderCallbacks, BaseRenderer, BR, BRp, fullFpsTime, defs, ElementTextureCacheLookup, minTxrH, txrStepH, minLvl$1, maxLvl$1, maxZoom$1, eleTxrSpacing, defTxrWidth, maxTxrW, maxTxrH, minUtility, maxFullness, maxFullnessChecks, deqCost$1, deqAvgCost$1, deqNoDrawCost$1, deqFastCost$1, deqRedrawThreshold$1, maxDeqSize$1, getTxrReasons, initDefaults, ElementTextureCache, ETCp, defNumLayers, minLvl, maxLvl, maxZoom2, deqRedrawThreshold, refineEleDebounceTime, deqCost, deqAvgCost, deqNoDrawCost, deqFastCost, maxDeqSize, invalidThreshold, maxLayerArea, maxLayerDim, useHighQualityEleTxrReqs, LayeredTextureCache, LTCp, layerIdPool, MAX_INT, CRp$b, impl, CRp$a, getZeroRotation, getLabelRotation, getSourceLabelRotation, getTargetLabelRotation, getOpacity, getTextOpacity, CRp$9, drawEdgeOverlayUnderlay, CRp$8, CRp$7, CRp$6, drawNodeOverlayUnderlay, CRp$5, motionBlurDelay, fpsHeight, ARRAY_TYPE, RENDER_TARGET, renderDefaults, Atlas, AtlasCollection, AtlasManager, TEXTURE, EDGE_STRAIGHT, EDGE_CURVE_SEGMENT, EDGE_ARROW, ElementDrawingWebGL, OverlayUnderlayRenderer, CRp$4, CRp$3, sin0, cos0, sin2, cos2, ellipseStepSize, i2, CRp$2, CRp$1, CR, CRp, pathsImpld, renderer5, incExts, extensions, modules, extension2, Stylesheet, sheetfn, version, cytoscape2;
var init_cytoscape_esm = __esm({
- "../../node_modules/.pnpm/cytoscape@3.30.1/node_modules/cytoscape/dist/cytoscape.esm.mjs"() {
+ "../../node_modules/.pnpm/cytoscape@3.31.0/node_modules/cytoscape/dist/cytoscape.esm.mjs"() {
"use strict";
__name(_typeof, "_typeof");
__name(_classCallCheck, "_classCallCheck");
@@ -96543,10 +102370,14 @@ g.stateGroup line {
__name(_createClass, "_createClass");
__name(_defineProperty$1, "_defineProperty$1");
__name(_slicedToArray, "_slicedToArray");
+ __name(_toConsumableArray, "_toConsumableArray");
+ __name(_arrayWithoutHoles, "_arrayWithoutHoles");
__name(_arrayWithHoles, "_arrayWithHoles");
+ __name(_iterableToArray, "_iterableToArray");
__name(_iterableToArrayLimit, "_iterableToArrayLimit");
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
__name(_arrayLikeToArray, "_arrayLikeToArray");
+ __name(_nonIterableSpread, "_nonIterableSpread");
__name(_nonIterableRest, "_nonIterableRest");
__name(_createForOfIteratorHelper, "_createForOfIteratorHelper");
_window = typeof window === "undefined" ? null : window;
@@ -96597,7 +102428,7 @@ g.stateGroup line {
collection = /* @__PURE__ */ __name(function collection2(obj) {
return instanceStr(obj) === "collection" && !obj._private.single;
}, "collection");
- core = /* @__PURE__ */ __name(function core2(obj) {
+ core2 = /* @__PURE__ */ __name(function core3(obj) {
return instanceStr(obj) === "core";
}, "core");
stylesheet = /* @__PURE__ */ __name(function stylesheet2(obj) {
@@ -96699,7 +102530,7 @@ g.stateGroup line {
descending2 = /* @__PURE__ */ __name(function descending3(a2, b2) {
return -1 * ascending3(a2, b2);
}, "descending");
- extend2 = Object.assign != null ? Object.assign.bind(Object) : function(tgt) {
+ extend4 = Object.assign != null ? Object.assign.bind(Object) : function(tgt) {
var args = arguments;
for (var i2 = 1; i2 < args.length; i2++) {
var obj = args[i2];
@@ -97013,8 +102844,8 @@ g.stateGroup line {
}
return obj;
}, "getMap");
- __name(isObject2, "isObject");
- isObject_1 = isObject2;
+ __name(isObject3, "isObject");
+ isObject_12 = isObject3;
commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
__name(createCommonjsModule, "createCommonjsModule");
freeGlobal2 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
@@ -97066,9 +102897,9 @@ g.stateGroup line {
nativeMin = Math.min;
__name(debounce, "debounce");
debounce_1 = debounce;
- performance2 = _window ? _window.performance : null;
- pnow = performance2 && performance2.now ? function() {
- return performance2.now();
+ performance$1 = _window ? _window.performance : null;
+ pnow = performance$1 && performance$1.now ? function() {
+ return performance$1.now();
} : function() {
return Date.now();
};
@@ -97228,17 +103059,17 @@ g.stateGroup line {
}
}
}, "warn");
- clone3 = /* @__PURE__ */ __name(function clone4(obj) {
- return extend2({}, obj);
+ clone4 = /* @__PURE__ */ __name(function clone5(obj) {
+ return extend4({}, obj);
}, "clone");
- copy4 = /* @__PURE__ */ __name(function copy5(obj) {
+ copy3 = /* @__PURE__ */ __name(function copy4(obj) {
if (obj == null) {
return obj;
}
if (array2(obj)) {
return obj.slice();
} else if (plainObject(obj)) {
- return clone3(obj);
+ return clone4(obj);
} else {
return obj;
}
@@ -97331,7 +103162,7 @@ g.stateGroup line {
}, "_delete")
}, {
key: "clear",
- value: /* @__PURE__ */ __name(function clear30() {
+ value: /* @__PURE__ */ __name(function clear22() {
this._obj = {};
}, "clear")
}, {
@@ -97392,7 +103223,7 @@ g.stateGroup line {
}, "_delete")
}, {
key: "clear",
- value: /* @__PURE__ */ __name(function clear30() {
+ value: /* @__PURE__ */ __name(function clear22() {
this._obj = /* @__PURE__ */ Object.create(null);
}, "clear")
}, {
@@ -97417,9 +103248,9 @@ g.stateGroup line {
return ObjectSet2;
}();
Set$1 = (typeof Set === "undefined" ? "undefined" : _typeof(Set)) !== undef ? Set : ObjectSet;
- Element = /* @__PURE__ */ __name(function Element2(cy, params) {
+ Element2 = /* @__PURE__ */ __name(function Element3(cy, params) {
var restore = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
- if (cy === void 0 || params === void 0 || !core(cy)) {
+ if (cy === void 0 || params === void 0 || !core2(cy)) {
error("An element must have a core reference and parameters set");
return;
}
@@ -97544,14 +103375,14 @@ g.stateGroup line {
y: (rpos.y - pan2.y) / zoom2
};
}
- var classes6 = [];
+ var classes3 = [];
if (array2(params.classes)) {
- classes6 = params.classes;
+ classes3 = params.classes;
} else if (string(params.classes)) {
- classes6 = params.classes.split(/\s+/);
+ classes3 = params.classes.split(/\s+/);
}
- for (var i2 = 0, l2 = classes6.length; i2 < l2; i2++) {
- var cls = classes6[i2];
+ for (var i2 = 0, l2 = classes3.length; i2 < l2; i2++) {
+ var cls = classes3[i2];
if (!cls || cls === "") {
continue;
}
@@ -97592,7 +103423,7 @@ g.stateGroup line {
var V2 = {};
var j2 = 0;
var found;
- var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges;
+ var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges3 = _this$byGroup.edges;
for (var i2 = 0; i2 < v3.length; i2++) {
var vi2 = v3[i2];
var viId = vi2.id();
@@ -97630,7 +103461,7 @@ g.stateGroup line {
return "break";
}
var vwEdges = v4.connectedEdges().filter(function(e4) {
- return (!directed || e4.source().same(v4)) && edges5.has(e4);
+ return (!directed || e4.source().same(v4)) && edges3.has(e4);
});
for (var _i2 = 0; _i2 < vwEdges.length; _i2++) {
var e3 = vwEdges[_i2];
@@ -97973,8 +103804,8 @@ g.stateGroup line {
var dist3 = {};
var prev2 = {};
var knownDist = {};
- var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges;
- edges5.unmergeBy(function(ele) {
+ var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges3 = _this$byGroup.edges;
+ edges3.unmergeBy(function(ele) {
return ele.isLoop();
});
var getDist3 = /* @__PURE__ */ __name(function getDist4(node3) {
@@ -97993,7 +103824,7 @@ g.stateGroup line {
Q2.push(node2);
}
var distBetween = /* @__PURE__ */ __name(function distBetween2(u3, v4) {
- var uvs = (directed ? u3.edgesTo(v4) : u3.edgesWith(v4)).intersect(edges5);
+ var uvs = (directed ? u3.edgesTo(v4) : u3.edgesWith(v4)).intersect(edges3);
var smallestDistance = Infinity;
var smallestEdge;
for (var _i = 0; _i < uvs.length; _i++) {
@@ -98064,7 +103895,7 @@ g.stateGroup line {
weightFn = weightFn || function(edge2) {
return 1;
};
- var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges;
+ var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges3 = _this$byGroup.edges;
var numNodes = nodes6.length;
var forest = new Array(numNodes);
var A2 = nodes6;
@@ -98079,7 +103910,7 @@ g.stateGroup line {
for (var i2 = 0; i2 < numNodes; i2++) {
forest[i2] = this.spawn(nodes6[i2]);
}
- var S3 = edges5.sort(function(a2, b2) {
+ var S3 = edges3.sort(function(a2, b2) {
return weightFn(a2) - weightFn(b2);
});
for (var _i = 0; _i < S3.length; _i++) {
@@ -98128,9 +103959,9 @@ g.stateGroup line {
var openSetIds = new Set$1();
var cameFrom = {};
var cameFromEdge = {};
- var addToOpenSet = /* @__PURE__ */ __name(function addToOpenSet2(ele, id27) {
+ var addToOpenSet = /* @__PURE__ */ __name(function addToOpenSet2(ele, id29) {
openSet.push(ele);
- openSetIds.add(id27);
+ openSetIds.add(id29);
}, "addToOpenSet");
var cMin, cMinId;
var popFromOpenSet = /* @__PURE__ */ __name(function popFromOpenSet2() {
@@ -98138,8 +103969,8 @@ g.stateGroup line {
cMinId = cMin.id();
openSetIds["delete"](cMinId);
}, "popFromOpenSet");
- var isInOpenSet = /* @__PURE__ */ __name(function isInOpenSet2(id27) {
- return openSetIds.has(id27);
+ var isInOpenSet = /* @__PURE__ */ __name(function isInOpenSet2(id29) {
+ return openSetIds.has(id29);
}, "isInOpenSet");
addToOpenSet(root4, sid);
gScore[sid] = 0;
@@ -98229,7 +104060,7 @@ g.stateGroup line {
var cy = this.cy();
var _floydWarshallDefault = floydWarshallDefaults(options3), weight8 = _floydWarshallDefault.weight, directed = _floydWarshallDefault.directed;
var weightFn = weight8;
- var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges;
+ var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges3 = _this$byGroup.edges;
var N2 = nodes6.length;
var Nsq = N2 * N2;
var indexOf2 = /* @__PURE__ */ __name(function indexOf3(node2) {
@@ -98250,8 +104081,8 @@ g.stateGroup line {
}
var next3 = new Array(Nsq);
var edgeNext = new Array(Nsq);
- for (var _i = 0; _i < edges5.length; _i++) {
- var edge = edges5[_i];
+ for (var _i = 0; _i < edges3.length; _i++) {
+ var edge = edges3[_i];
var src = edge.source()[0];
var tgt = edge.target()[0];
if (src === tgt) {
@@ -98343,16 +104174,16 @@ g.stateGroup line {
var weightFn = weight8;
var eles = this;
var cy = this.cy();
- var _this$byGroup = this.byGroup(), edges5 = _this$byGroup.edges, nodes6 = _this$byGroup.nodes;
+ var _this$byGroup = this.byGroup(), edges3 = _this$byGroup.edges, nodes6 = _this$byGroup.nodes;
var numNodes = nodes6.length;
var infoMap = new Map$2();
var hasNegativeWeightCycle = false;
var negativeWeightCycles = [];
root4 = cy.collection(root4)[0];
- edges5.unmergeBy(function(edge2) {
+ edges3.unmergeBy(function(edge2) {
return edge2.isLoop();
});
- var numEdges = edges5.length;
+ var numEdges = edges3.length;
var getInfo3 = /* @__PURE__ */ __name(function getInfo4(node3) {
var obj = infoMap.get(node3.id());
if (!obj) {
@@ -98412,7 +104243,7 @@ g.stateGroup line {
for (var _i = 1; _i < numNodes; _i++) {
replacedEdge = false;
for (var e3 = 0; e3 < numEdges; e3++) {
- var edge = edges5[e3];
+ var edge = edges3[e3];
var src = edge.source();
var tgt = edge.target();
var _weight = weightFn(edge);
@@ -98430,7 +104261,7 @@ g.stateGroup line {
if (replacedEdge) {
var negativeWeightCycleIds = [];
for (var _e = 0; _e < numEdges; _e++) {
- var _edge = edges5[_e];
+ var _edge = edges3[_e];
var _src = _edge.source();
var _tgt = _edge.target();
var _weight2 = weightFn(_edge);
@@ -98543,12 +104374,12 @@ g.stateGroup line {
// Returns the correct answer with high probability
kargerStein: /* @__PURE__ */ __name(function kargerStein() {
var _this = this;
- var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges;
- edges5.unmergeBy(function(edge) {
+ var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges3 = _this$byGroup.edges;
+ edges3.unmergeBy(function(edge) {
return edge.isLoop();
});
var numNodes = nodes6.length;
- var numEdges = edges5.length;
+ var numEdges = edges3.length;
var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2));
var stopSize = Math.floor(numNodes / sqrt2);
if (numNodes < 2) {
@@ -98557,7 +104388,7 @@ g.stateGroup line {
}
var edgeIndexes = [];
for (var i2 = 0; i2 < numEdges; i2++) {
- var e3 = edges5[i2];
+ var e3 = edges3[i2];
edgeIndexes.push([i2, nodes6.indexOf(e3.source()), nodes6.indexOf(e3.target())]);
}
var minCutSize = Infinity;
@@ -98590,7 +104421,7 @@ g.stateGroup line {
}
}
var cut = this.spawn(minCutEdgeIndexes.map(function(e4) {
- return edges5[e4[0]];
+ return edges3[e4[0]];
}));
var partition1 = this.spawn();
var partition2 = this.spawn();
@@ -98634,7 +104465,7 @@ g.stateGroup line {
y: p3.y
};
}, "copyPosition");
- modelToRenderedPosition = /* @__PURE__ */ __name(function modelToRenderedPosition2(p3, zoom2, pan2) {
+ modelToRenderedPosition$1 = /* @__PURE__ */ __name(function modelToRenderedPosition(p3, zoom2, pan2) {
return {
x: p3.x * zoom2 + pan2.x,
y: p3.y * zoom2 + pan2.y
@@ -98693,10 +104524,10 @@ g.stateGroup line {
median = /* @__PURE__ */ __name(function median2(arr) {
var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length;
- var copy6 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
+ var copy5 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
var sort3 = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
var includeHoles = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
- if (copy6) {
+ if (copy5) {
arr = arr.slice(begin, end2);
} else {
if (end2 < arr.length) {
@@ -98874,25 +104705,25 @@ g.stateGroup line {
bb.h = bb.y2 - bb.y1;
}, "expandBoundingBoxByPoint");
expandBoundingBox = /* @__PURE__ */ __name(function expandBoundingBox2(bb) {
- var padding3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- bb.x1 -= padding3;
- bb.x2 += padding3;
- bb.y1 -= padding3;
- bb.y2 += padding3;
+ var padding2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
+ bb.x1 -= padding2;
+ bb.x2 += padding2;
+ bb.y1 -= padding2;
+ bb.y2 += padding2;
bb.w = bb.x2 - bb.x1;
bb.h = bb.y2 - bb.y1;
return bb;
}, "expandBoundingBox");
expandBoundingBoxSides = /* @__PURE__ */ __name(function expandBoundingBoxSides2(bb) {
- var padding3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0];
+ var padding2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0];
var top2, right3, bottom2, left3;
- if (padding3.length === 1) {
- top2 = right3 = bottom2 = left3 = padding3[0];
- } else if (padding3.length === 2) {
- top2 = bottom2 = padding3[0];
- left3 = right3 = padding3[1];
- } else if (padding3.length === 4) {
- var _padding = _slicedToArray(padding3, 4);
+ if (padding2.length === 1) {
+ top2 = right3 = bottom2 = left3 = padding2[0];
+ } else if (padding2.length === 2) {
+ top2 = bottom2 = padding2[0];
+ left3 = right3 = padding2[1];
+ } else if (padding2.length === 4) {
+ var _padding = _slicedToArray(padding2, 4);
top2 = _padding[0];
right3 = _padding[1];
bottom2 = _padding[2];
@@ -98950,7 +104781,7 @@ g.stateGroup line {
boundingBoxInBoundingBox = /* @__PURE__ */ __name(function boundingBoxInBoundingBox2(bb1, bb2) {
return inBoundingBox(bb1, bb2.x1, bb2.y1) && inBoundingBox(bb1, bb2.x2, bb2.y2);
}, "boundingBoxInBoundingBox");
- roundRectangleIntersectLine = /* @__PURE__ */ __name(function roundRectangleIntersectLine2(x5, y5, nodeX, nodeY, width3, height2, padding3) {
+ roundRectangleIntersectLine = /* @__PURE__ */ __name(function roundRectangleIntersectLine2(x5, y5, nodeX, nodeY, width3, height2, padding2) {
var radius2 = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto";
var cornerRadius = radius2 === "auto" ? getRoundRectangleRadius(width3, height2) : radius2;
var halfWidth = width3 / 2;
@@ -98959,9 +104790,9 @@ g.stateGroup line {
var doWidth = cornerRadius !== halfWidth, doHeight = cornerRadius !== halfHeight;
var straightLineIntersections;
if (doWidth) {
- var topStartX = nodeX - halfWidth + cornerRadius - padding3;
- var topStartY = nodeY - halfHeight - padding3;
- var topEndX = nodeX + halfWidth - cornerRadius + padding3;
+ var topStartX = nodeX - halfWidth + cornerRadius - padding2;
+ var topStartY = nodeY - halfHeight - padding2;
+ var topEndX = nodeX + halfWidth - cornerRadius + padding2;
var topEndY = topStartY;
straightLineIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false);
if (straightLineIntersections.length > 0) {
@@ -98969,19 +104800,19 @@ g.stateGroup line {
}
}
if (doHeight) {
- var rightStartX = nodeX + halfWidth + padding3;
- var rightStartY = nodeY - halfHeight + cornerRadius - padding3;
+ var rightStartX = nodeX + halfWidth + padding2;
+ var rightStartY = nodeY - halfHeight + cornerRadius - padding2;
var rightEndX = rightStartX;
- var rightEndY = nodeY + halfHeight - cornerRadius + padding3;
+ var rightEndY = nodeY + halfHeight - cornerRadius + padding2;
straightLineIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false);
if (straightLineIntersections.length > 0) {
return straightLineIntersections;
}
}
if (doWidth) {
- var bottomStartX = nodeX - halfWidth + cornerRadius - padding3;
- var bottomStartY = nodeY + halfHeight + padding3;
- var bottomEndX = nodeX + halfWidth - cornerRadius + padding3;
+ var bottomStartX = nodeX - halfWidth + cornerRadius - padding2;
+ var bottomStartY = nodeY + halfHeight + padding2;
+ var bottomEndX = nodeX + halfWidth - cornerRadius + padding2;
var bottomEndY = bottomStartY;
straightLineIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false);
if (straightLineIntersections.length > 0) {
@@ -98989,10 +104820,10 @@ g.stateGroup line {
}
}
if (doHeight) {
- var leftStartX = nodeX - halfWidth - padding3;
- var leftStartY = nodeY - halfHeight + cornerRadius - padding3;
+ var leftStartX = nodeX - halfWidth - padding2;
+ var leftStartY = nodeY - halfHeight + cornerRadius - padding2;
var leftEndX = leftStartX;
- var leftEndY = nodeY + halfHeight - cornerRadius + padding3;
+ var leftEndY = nodeY + halfHeight - cornerRadius + padding2;
straightLineIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false);
if (straightLineIntersections.length > 0) {
return straightLineIntersections;
@@ -99002,7 +104833,7 @@ g.stateGroup line {
{
var topLeftCenterX = nodeX - halfWidth + cornerRadius;
var topLeftCenterY = nodeY - halfHeight + cornerRadius;
- arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding3);
+ arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding2);
if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) {
return [arcIntersections[0], arcIntersections[1]];
}
@@ -99010,7 +104841,7 @@ g.stateGroup line {
{
var topRightCenterX = nodeX + halfWidth - cornerRadius;
var topRightCenterY = nodeY - halfHeight + cornerRadius;
- arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding3);
+ arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding2);
if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) {
return [arcIntersections[0], arcIntersections[1]];
}
@@ -99018,7 +104849,7 @@ g.stateGroup line {
{
var bottomRightCenterX = nodeX + halfWidth - cornerRadius;
var bottomRightCenterY = nodeY + halfHeight - cornerRadius;
- arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding3);
+ arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding2);
if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) {
return [arcIntersections[0], arcIntersections[1]];
}
@@ -99026,7 +104857,7 @@ g.stateGroup line {
{
var bottomLeftCenterX = nodeX - halfWidth + cornerRadius;
var bottomLeftCenterY = nodeY + halfHeight - cornerRadius;
- arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding3);
+ arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding2);
if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) {
return [arcIntersections[0], arcIntersections[1]];
}
@@ -99187,18 +105018,18 @@ g.stateGroup line {
return true;
}
}, "pointInsidePolygonPoints");
- pointInsidePolygon = /* @__PURE__ */ __name(function pointInsidePolygon2(x5, y5, basePoints, centerX, centerY, width3, height2, direction4, padding3) {
+ pointInsidePolygon = /* @__PURE__ */ __name(function pointInsidePolygon2(x5, y5, basePoints, centerX, centerY, width3, height2, direction, padding2) {
var transformedPoints = new Array(basePoints.length);
var angle2;
- if (direction4[0] != null) {
- angle2 = Math.atan(direction4[1] / direction4[0]);
- if (direction4[0] < 0) {
+ if (direction[0] != null) {
+ angle2 = Math.atan(direction[1] / direction[0]);
+ if (direction[0] < 0) {
angle2 = angle2 + Math.PI / 2;
} else {
angle2 = -angle2 - Math.PI / 2;
}
} else {
- angle2 = direction4;
+ angle2 = direction;
}
var cos3 = Math.cos(-angle2);
var sin3 = Math.sin(-angle2);
@@ -99209,8 +105040,8 @@ g.stateGroup line {
transformedPoints[i2 * 2 + 1] += centerY;
}
var points;
- if (padding3 > 0) {
- var expandedLineSet = expandPolygon(transformedPoints, -padding3);
+ if (padding2 > 0) {
+ var expandedLineSet = expandPolygon(transformedPoints, -padding2);
points = joinLines(expandedLineSet);
} else {
points = transformedPoints;
@@ -99233,7 +105064,7 @@ g.stateGroup line {
return pointInsidePolygonPoints(x5, y5, cutPolygonPoints);
}, "pointInsideRoundPolygon");
joinLines = /* @__PURE__ */ __name(function joinLines2(lineSet) {
- var vertices2 = new Array(lineSet.length / 2);
+ var vertices = new Array(lineSet.length / 2);
var currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY;
var nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY;
for (var i2 = 0; i2 < lineSet.length / 4; i2++) {
@@ -99252,11 +105083,11 @@ g.stateGroup line {
nextLineEndX = lineSet[2];
nextLineEndY = lineSet[3];
}
- var intersection3 = finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true);
- vertices2[i2 * 2] = intersection3[0];
- vertices2[i2 * 2 + 1] = intersection3[1];
+ var intersection4 = finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true);
+ vertices[i2 * 2] = intersection4[0];
+ vertices[i2 * 2 + 1] = intersection4[1];
}
- return vertices2;
+ return vertices;
}, "joinLines");
expandPolygon = /* @__PURE__ */ __name(function expandPolygon2(points, pad3) {
var expandedLineSet = new Array(points.length * 2);
@@ -99296,19 +105127,19 @@ g.stateGroup line {
var lenProportion = newLength / len;
return [(centerX - x5) * lenProportion + x5, (centerY - y5) * lenProportion + y5];
}, "intersectLineEllipse");
- checkInEllipse = /* @__PURE__ */ __name(function checkInEllipse2(x5, y5, width3, height2, centerX, centerY, padding3) {
+ checkInEllipse = /* @__PURE__ */ __name(function checkInEllipse2(x5, y5, width3, height2, centerX, centerY, padding2) {
x5 -= centerX;
y5 -= centerY;
- x5 /= width3 / 2 + padding3;
- y5 /= height2 / 2 + padding3;
+ x5 /= width3 / 2 + padding2;
+ y5 /= height2 / 2 + padding2;
return x5 * x5 + y5 * y5 <= 1;
}, "checkInEllipse");
intersectLineCircle = /* @__PURE__ */ __name(function intersectLineCircle2(x1, y1, x22, y22, centerX, centerY, radius2) {
var d2 = [x22 - x1, y22 - y1];
- var f3 = [x1 - centerX, y1 - centerY];
+ var f2 = [x1 - centerX, y1 - centerY];
var a2 = d2[0] * d2[0] + d2[1] * d2[1];
- var b2 = 2 * (f3[0] * d2[0] + f3[1] * d2[1]);
- var c3 = f3[0] * f3[0] + f3[1] * f3[1] - radius2 * radius2;
+ var b2 = 2 * (f2[0] * d2[0] + f2[1] * d2[1]);
+ var c3 = f2[0] * f2[0] + f2[1] * f2[1] - radius2 * radius2;
var discriminant = b2 * b2 - 4 * a2 * c3;
if (discriminant < 0) {
return [];
@@ -99392,9 +105223,9 @@ g.stateGroup line {
}
}
}, "finiteLinesIntersect");
- polygonIntersectLine = /* @__PURE__ */ __name(function polygonIntersectLine2(x5, y5, basePoints, centerX, centerY, width3, height2, padding3) {
+ polygonIntersectLine = /* @__PURE__ */ __name(function polygonIntersectLine2(x5, y5, basePoints, centerX, centerY, width3, height2, padding2) {
var intersections = [];
- var intersection3;
+ var intersection4;
var transformedPoints = new Array(basePoints.length);
var doTransform = true;
if (width3 == null) {
@@ -99406,8 +105237,8 @@ g.stateGroup line {
transformedPoints[i2 * 2] = basePoints[i2 * 2] * width3 + centerX;
transformedPoints[i2 * 2 + 1] = basePoints[i2 * 2 + 1] * height2 + centerY;
}
- if (padding3 > 0) {
- var expandedLineSet = expandPolygon(transformedPoints, -padding3);
+ if (padding2 > 0) {
+ var expandedLineSet = expandPolygon(transformedPoints, -padding2);
points = joinLines(expandedLineSet);
} else {
points = transformedPoints;
@@ -99426,16 +105257,16 @@ g.stateGroup line {
nextX = points[0];
nextY = points[1];
}
- intersection3 = finiteLinesIntersect(x5, y5, centerX, centerY, currentX, currentY, nextX, nextY);
- if (intersection3.length !== 0) {
- intersections.push(intersection3[0], intersection3[1]);
+ intersection4 = finiteLinesIntersect(x5, y5, centerX, centerY, currentX, currentY, nextX, nextY);
+ if (intersection4.length !== 0) {
+ intersections.push(intersection4[0], intersection4[1]);
}
}
return intersections;
}, "polygonIntersectLine");
- roundPolygonIntersectLine = /* @__PURE__ */ __name(function roundPolygonIntersectLine2(x5, y5, basePoints, centerX, centerY, width3, height2, padding3, corners) {
+ roundPolygonIntersectLine = /* @__PURE__ */ __name(function roundPolygonIntersectLine2(x5, y5, basePoints, centerX, centerY, width3, height2, padding2, corners) {
var intersections = [];
- var intersection3;
+ var intersection4;
var lines = new Array(basePoints.length * 2);
corners.forEach(function(corner, i3) {
if (i3 === 0) {
@@ -99447,15 +105278,15 @@ g.stateGroup line {
}
lines[i3 * 4] = corner.stopX;
lines[i3 * 4 + 1] = corner.stopY;
- intersection3 = intersectLineCircle(x5, y5, centerX, centerY, corner.cx, corner.cy, corner.radius);
- if (intersection3.length !== 0) {
- intersections.push(intersection3[0], intersection3[1]);
+ intersection4 = intersectLineCircle(x5, y5, centerX, centerY, corner.cx, corner.cy, corner.radius);
+ if (intersection4.length !== 0) {
+ intersections.push(intersection4[0], intersection4[1]);
}
});
for (var i2 = 0; i2 < lines.length / 4; i2++) {
- intersection3 = finiteLinesIntersect(x5, y5, centerX, centerY, lines[i2 * 4], lines[i2 * 4 + 1], lines[i2 * 4 + 2], lines[i2 * 4 + 3], false);
- if (intersection3.length !== 0) {
- intersections.push(intersection3[0], intersection3[1]);
+ intersection4 = finiteLinesIntersect(x5, y5, centerX, centerY, lines[i2 * 4], lines[i2 * 4 + 1], lines[i2 * 4 + 2], lines[i2 * 4 + 3], false);
+ if (intersection4.length !== 0) {
+ intersections.push(intersection4[0], intersection4[1]);
}
}
if (intersections.length > 2) {
@@ -99473,8 +105304,8 @@ g.stateGroup line {
}
return intersections;
}, "roundPolygonIntersectLine");
- shortenIntersection = /* @__PURE__ */ __name(function shortenIntersection2(intersection3, offset, amount) {
- var disp = [intersection3[0] - offset[0], intersection3[1] - offset[1]];
+ shortenIntersection = /* @__PURE__ */ __name(function shortenIntersection2(intersection4, offset, amount) {
+ var disp = [intersection4[0] - offset[0], intersection4[1] - offset[1]];
var length2 = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]);
var lenRatio = (length2 - amount) / length2;
if (lenRatio < 0) {
@@ -99560,10 +105391,10 @@ g.stateGroup line {
pageRank: /* @__PURE__ */ __name(function pageRank(options3) {
var _pageRankDefaults = pageRankDefaults(options3), dampingFactor = _pageRankDefaults.dampingFactor, precision = _pageRankDefaults.precision, iterations = _pageRankDefaults.iterations, weight8 = _pageRankDefaults.weight;
var cy = this._private.cy;
- var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges;
+ var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges3 = _this$byGroup.edges;
var numNodes = nodes6.length;
var numNodesSqd = numNodes * numNodes;
- var numEdges = edges5.length;
+ var numEdges = edges3.length;
var matrix = new Array(numNodesSqd);
var columnSum = new Array(numNodes);
var additionalProb = (1 - dampingFactor) / numNodes;
@@ -99575,7 +105406,7 @@ g.stateGroup line {
columnSum[i2] = 0;
}
for (var _i = 0; _i < numEdges; _i++) {
- var edge = edges5[_i];
+ var edge = edges3[_i];
var srcId = edge.data("source");
var tgtId = edge.data("target");
if (srcId === tgtId) {
@@ -99685,13 +105516,13 @@ g.stateGroup line {
var maxOutdegree = 0;
for (var _i = 0; _i < numNodes; _i++) {
var _node = nodes6[_i];
- var id27 = _node.id();
+ var id29 = _node.id();
options3.root = _node;
var _currDegree = this.degreeCentrality(options3);
if (maxIndegree < _currDegree.indegree) maxIndegree = _currDegree.indegree;
if (maxOutdegree < _currDegree.outdegree) maxOutdegree = _currDegree.outdegree;
- indegrees[id27] = _currDegree.indegree;
- outdegrees[id27] = _currDegree.outdegree;
+ indegrees[id29] = _currDegree.indegree;
+ outdegrees[id29] = _currDegree.outdegree;
}
return {
indegree: /* @__PURE__ */ __name(function indegree(node3) {
@@ -99736,11 +105567,11 @@ g.stateGroup line {
degree: Math.pow(k2, 1 - alpha) * Math.pow(s2, alpha)
};
} else {
- var edges5 = root4.connectedEdges();
- var incoming = edges5.filter(function(edge) {
+ var edges3 = root4.connectedEdges();
+ var incoming = edges3.filter(function(edge) {
return edge.target().same(root4) && callingEles.has(edge);
});
- var outgoing = edges5.filter(function(edge) {
+ var outgoing = edges3.filter(function(edge) {
return edge.source().same(root4) && callingEles.has(edge);
});
var k_in = incoming.length;
@@ -99962,15 +105793,15 @@ g.stateGroup line {
}
var ret = {
betweenness: /* @__PURE__ */ __name(function betweenness(node2) {
- var id27 = cy.collection(node2).id();
- return C2.get(id27);
+ var id29 = cy.collection(node2).id();
+ return C2.get(id29);
}, "betweenness"),
betweennessNormalized: /* @__PURE__ */ __name(function betweennessNormalized(node2) {
if (max10 == 0) {
return 0;
}
- var id27 = cy.collection(node2).id();
- return C2.get(id27) / max10;
+ var id29 = cy.collection(node2).id();
+ return C2.get(id29) / max10;
}, "betweennessNormalized")
};
ret.betweennessNormalised = ret.betweennessNormalized;
@@ -100096,7 +105927,7 @@ g.stateGroup line {
}, "removeDuplicates");
markovClustering = /* @__PURE__ */ __name(function markovClustering2(options3) {
var nodes6 = this.nodes();
- var edges5 = this.edges();
+ var edges3 = this.edges();
var cy = this.cy();
var opts = setOptions$3(options3);
var id2position = {};
@@ -100108,8 +105939,8 @@ g.stateGroup line {
for (var _i = 0; _i < n22; _i++) {
M2[_i] = 0;
}
- for (var e3 = 0; e3 < edges5.length; e3++) {
- var edge = edges5[e3];
+ for (var e3 = 0; e3 < edges3.length; e3++) {
+ var edge = edges3[e3];
var _i2 = id2position[edge.source().id()];
var j2 = id2position[edge.target().id()];
var sim = getSimilarity$1(edge, opts.attributes);
@@ -100137,7 +105968,7 @@ g.stateGroup line {
markovClustering,
mcl: markovClustering
};
- identity5 = /* @__PURE__ */ __name(function identity6(x5) {
+ identity$1 = /* @__PURE__ */ __name(function identity5(x5) {
return x5;
}, "identity");
absDiff = /* @__PURE__ */ __name(function absDiff2(p3, q2) {
@@ -100156,7 +105987,7 @@ g.stateGroup line {
return Math.max(currentMax, absDiff(p3, q2));
}, "maxAbsDiff");
getDistance = /* @__PURE__ */ __name(function getDistance2(length2, getP, getQ, init3, visit) {
- var post = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : identity5;
+ var post = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : identity$1;
var ret = init3;
var p3, q2;
for (var dim = 0; dim < length2; dim++) {
@@ -101023,10 +106854,10 @@ g.stateGroup line {
var startVertex;
if (root4) startVertex = string(root4) ? this.filter(root4)[0].id() : root4[0].id();
var nodes6 = {};
- var edges5 = {};
+ var edges3 = {};
if (directed) {
eles.forEach(function(ele) {
- var id27 = ele.id();
+ var id29 = ele.id();
if (ele.isNode()) {
var ind = ele.indegree(true);
var outd = ele.outdegree(true);
@@ -101034,37 +106865,37 @@ g.stateGroup line {
var d22 = outd - ind;
if (d1 == 1) {
if (oddIn) dflag = true;
- else oddIn = id27;
+ else oddIn = id29;
} else if (d22 == 1) {
if (oddOut) dflag = true;
- else oddOut = id27;
+ else oddOut = id29;
} else if (d22 > 1 || d1 > 1) {
dflag = true;
}
- nodes6[id27] = [];
+ nodes6[id29] = [];
ele.outgoers().forEach(function(e3) {
- if (e3.isEdge()) nodes6[id27].push(e3.id());
+ if (e3.isEdge()) nodes6[id29].push(e3.id());
});
} else {
- edges5[id27] = [void 0, ele.target().id()];
+ edges3[id29] = [void 0, ele.target().id()];
}
});
} else {
eles.forEach(function(ele) {
- var id27 = ele.id();
+ var id29 = ele.id();
if (ele.isNode()) {
var d3 = ele.degree(true);
if (d3 % 2) {
- if (!oddIn) oddIn = id27;
- else if (!oddOut) oddOut = id27;
+ if (!oddIn) oddIn = id29;
+ else if (!oddOut) oddOut = id29;
else dflag = true;
}
- nodes6[id27] = [];
+ nodes6[id29] = [];
ele.connectedEdges().forEach(function(e3) {
- return nodes6[id27].push(e3.id());
+ return nodes6[id29].push(e3.id());
});
} else {
- edges5[id27] = [ele.source().id(), ele.target().id()];
+ edges3[id29] = [ele.source().id(), ele.target().id()];
}
});
}
@@ -101095,8 +106926,8 @@ g.stateGroup line {
var adj, adjTail, adjHead;
while (nodes6[currentNode].length) {
adj = nodes6[currentNode].shift();
- adjTail = edges5[adj][0];
- adjHead = edges5[adj][1];
+ adjTail = edges3[adj][0];
+ adjHead = edges3[adj][1];
if (currentNode != adjHead) {
nodes6[adjHead] = nodes6[adjHead].filter(function(e3) {
return e3 != adj;
@@ -101138,8 +106969,8 @@ g.stateGroup line {
hopcroftTarjanBiconnected = /* @__PURE__ */ __name(function hopcroftTarjanBiconnected2() {
var eles = this;
var nodes6 = {};
- var id27 = 0;
- var edgeCount4 = 0;
+ var id29 = 0;
+ var edgeCount3 = 0;
var components3 = [];
var stack = [];
var visitedEdges = {};
@@ -101171,18 +107002,18 @@ g.stateGroup line {
components3.push(component2);
}, "buildComponent");
var biconnectedSearch = /* @__PURE__ */ __name(function biconnectedSearch2(root4, currentNode, parent4) {
- if (root4 === parent4) edgeCount4 += 1;
+ if (root4 === parent4) edgeCount3 += 1;
nodes6[currentNode] = {
- id: id27,
- low: id27++,
+ id: id29,
+ low: id29++,
cutVertex: false
};
- var edges5 = eles.getElementById(currentNode).connectedEdges().intersection(eles);
- if (edges5.size() === 0) {
+ var edges3 = eles.getElementById(currentNode).connectedEdges().intersection(eles);
+ if (edges3.size() === 0) {
components3.push(eles.spawn(eles.getElementById(currentNode)));
} else {
var sourceId, targetId, otherNodeId, edgeId;
- edges5.forEach(function(edge) {
+ edges3.forEach(function(edge) {
sourceId = edge.source().id();
targetId = edge.target().id();
otherNodeId = sourceId === currentNode ? targetId : sourceId;
@@ -101214,16 +107045,16 @@ g.stateGroup line {
if (ele.isNode()) {
var nodeId = ele.id();
if (!(nodeId in nodes6)) {
- edgeCount4 = 0;
+ edgeCount3 = 0;
biconnectedSearch(nodeId, nodeId);
- nodes6[nodeId].cutVertex = edgeCount4 > 1;
+ nodes6[nodeId].cutVertex = edgeCount3 > 1;
}
}
});
- var cutVertices = Object.keys(nodes6).filter(function(id28) {
- return nodes6[id28].cutVertex;
- }).map(function(id28) {
- return eles.getElementById(id28);
+ var cutVertices = Object.keys(nodes6).filter(function(id30) {
+ return nodes6[id30].cutVertex;
+ }).map(function(id30) {
+ return eles.getElementById(id30);
});
return {
cut: eles.spawn(cutVertices),
@@ -101300,7 +107131,7 @@ g.stateGroup line {
};
elesfn$j = {};
[elesfn$v, elesfn$u, elesfn$t, elesfn$s, elesfn$r, elesfn$q, elesfn$p, elesfn$o, elesfn$n, elesfn$m, elesfn$l, markovClustering$1, kClustering, hierarchicalClustering$1, affinityPropagation$1, elesfn$k, hopcroftTarjanBiconnected$1, tarjanStronglyConnected$1].forEach(function(props) {
- extend2(elesfn$j, props);
+ extend4(elesfn$j, props);
});
STATE_PENDING = 0;
STATE_FULFILLED = 1;
@@ -101336,9 +107167,9 @@ g.stateGroup line {
return next3.proxy;
}, "then")
};
- deliver = /* @__PURE__ */ __name(function deliver2(curr, state5, name, value2) {
+ deliver = /* @__PURE__ */ __name(function deliver2(curr, state4, name, value2) {
if (curr.state === STATE_PENDING) {
- curr.state = state5;
+ curr.state = state4;
curr[name] = value2;
execute(curr);
}
@@ -101461,9 +107292,9 @@ g.stateGroup line {
};
Promise$1 = typeof Promise !== "undefined" ? Promise : api;
Animation = /* @__PURE__ */ __name(function Animation2(target, opts, opts2) {
- var isCore = core(target);
+ var isCore = core2(target);
var isEle = !isCore;
- var _p = this._private = extend2({
+ var _p = this._private = extend4({
duration: 1e3
}, opts, opts2);
_p.target = target;
@@ -101498,7 +107329,7 @@ g.stateGroup line {
this[0] = this;
}, "Animation");
anifn = Animation.prototype;
- extend2(anifn, {
+ extend4(anifn, {
instanceString: /* @__PURE__ */ __name(function instanceString() {
return "animation";
}, "instanceString"),
@@ -101721,7 +107552,7 @@ g.stateGroup line {
return this;
}
var style3 = cy.style();
- properties = extend2({}, properties, params);
+ properties = extend4({}, properties, params);
var propertiesEmpty = Object.keys(properties).length === 0;
if (propertiesEmpty) {
return new Animation(all[0], properties);
@@ -101797,7 +107628,7 @@ g.stateGroup line {
return this;
}
if (params) {
- properties = extend2({}, properties, params);
+ properties = extend4({}, properties, params);
}
for (var i2 = 0; i2 < all.length; i2++) {
var ele = all[i2];
@@ -102013,8 +107844,8 @@ g.stateGroup line {
_isIndex = isIndex2;
__name(baseSet2, "baseSet");
_baseSet = baseSet2;
- __name(set4, "set");
- set_1 = set4;
+ __name(set5, "set");
+ set_1 = set5;
__name(copyArray3, "copyArray");
_copyArray = copyArray3;
__name(toPath, "toPath");
@@ -102044,7 +107875,7 @@ g.stateGroup line {
return true;
}, "canSet")
};
- params = extend2({}, defaults4, params);
+ params = extend4({}, defaults4, params);
return /* @__PURE__ */ __name(function dataImpl(name, value2) {
var p3 = params;
var self2 = this;
@@ -102139,7 +107970,7 @@ g.stateGroup line {
immutableKeys: {}
// key => true if immutable
};
- params = extend2({}, defaults4, params);
+ params = extend4({}, defaults4, params);
return /* @__PURE__ */ __name(function removeDataImpl(names) {
var p3 = params;
var self2 = this;
@@ -102207,7 +108038,7 @@ g.stateGroup line {
};
define2 = {};
[define$3, define$2, define$1].forEach(function(m2) {
- extend2(define2, m2);
+ extend4(define2, m2);
});
elesfn$i = {
animate: define2.animate(),
@@ -102219,7 +108050,7 @@ g.stateGroup line {
stop: define2.stop()
};
elesfn$h = {
- classes: /* @__PURE__ */ __name(function classes4(_classes) {
+ classes: /* @__PURE__ */ __name(function classes(_classes) {
var self2 = this;
if (_classes === void 0) {
var ret = [];
@@ -102258,16 +108089,16 @@ g.stateGroup line {
}
return self2;
}, "classes"),
- addClass: /* @__PURE__ */ __name(function addClass4(classes6) {
- return this.toggleClass(classes6, true);
+ addClass: /* @__PURE__ */ __name(function addClass2(classes3) {
+ return this.toggleClass(classes3, true);
}, "addClass"),
hasClass: /* @__PURE__ */ __name(function hasClass(className) {
var ele = this[0];
return ele != null && ele._private.classes.has(className);
}, "hasClass"),
- toggleClass: /* @__PURE__ */ __name(function toggleClass(classes6, toggle) {
- if (!array2(classes6)) {
- classes6 = classes6.match(/\S+/g) || [];
+ toggleClass: /* @__PURE__ */ __name(function toggleClass(classes3, toggle) {
+ if (!array2(classes3)) {
+ classes3 = classes3.match(/\S+/g) || [];
}
var self2 = this;
var toggleUndefd = toggle === void 0;
@@ -102276,8 +108107,8 @@ g.stateGroup line {
var ele = self2[i2];
var eleClasses = ele._private.classes;
var changedEle = false;
- for (var j2 = 0; j2 < classes6.length; j2++) {
- var cls = classes6[j2];
+ for (var j2 = 0; j2 < classes3.length; j2++) {
+ var cls = classes3[j2];
var hasClass2 = eleClasses.has(cls);
var changedNow = false;
if (toggle || toggleUndefd && !hasClass2) {
@@ -102298,19 +108129,19 @@ g.stateGroup line {
}
return self2;
}, "toggleClass"),
- removeClass: /* @__PURE__ */ __name(function removeClass(classes6) {
- return this.toggleClass(classes6, false);
+ removeClass: /* @__PURE__ */ __name(function removeClass(classes3) {
+ return this.toggleClass(classes3, false);
}, "removeClass"),
- flashClass: /* @__PURE__ */ __name(function flashClass(classes6, duration) {
+ flashClass: /* @__PURE__ */ __name(function flashClass(classes3, duration) {
var self2 = this;
if (duration == null) {
duration = 250;
} else if (duration === 0) {
return self2;
}
- self2.addClass(classes6);
+ self2.addClass(classes3);
setTimeout(function() {
- self2.removeClass(classes6);
+ self2.removeClass(classes3);
}, duration);
return self2;
}, "flashClass")
@@ -102602,10 +108433,10 @@ g.stateGroup line {
query: true,
regex: stateSelectorRegex,
populate: /* @__PURE__ */ __name(function populate3(selector, query, _ref3) {
- var _ref4 = _slicedToArray(_ref3, 1), state5 = _ref4[0];
+ var _ref4 = _slicedToArray(_ref3, 1), state4 = _ref4[0];
query.checks.push({
type: Type3.STATE,
- value: state5
+ value: state4
});
}, "populate")
}, {
@@ -102613,10 +108444,10 @@ g.stateGroup line {
query: true,
regex: "\\#(" + tokens.id + ")",
populate: /* @__PURE__ */ __name(function populate4(selector, query, _ref5) {
- var _ref6 = _slicedToArray(_ref5, 1), id27 = _ref6[0];
+ var _ref6 = _slicedToArray(_ref5, 1), id29 = _ref6[0];
query.checks.push({
type: Type3.ID,
- value: cleanMetaChars(id27)
+ value: cleanMetaChars(id29)
});
}, "populate")
}, {
@@ -102691,14 +108522,14 @@ g.stateGroup line {
regex: tokens.separator,
populate: /* @__PURE__ */ __name(function populate10(selector, query) {
var currentSubject = selector.currentSubject;
- var edgeCount4 = selector.edgeCount;
+ var edgeCount3 = selector.edgeCount;
var compoundCount = selector.compoundCount;
var lastQ = selector[selector.length - 1];
if (currentSubject != null) {
lastQ.subject = currentSubject;
selector.currentSubject = null;
}
- lastQ.edgeCount = edgeCount4;
+ lastQ.edgeCount = edgeCount3;
lastQ.compoundCount = compoundCount;
selector.edgeCount = 0;
selector.compoundCount = 0;
@@ -102947,7 +108778,7 @@ g.stateGroup line {
}
return remaining;
}, "consumeWhitespace");
- parse3 = /* @__PURE__ */ __name(function parse4(selector) {
+ parse2 = /* @__PURE__ */ __name(function parse3(selector) {
var self2 = this;
var remaining = self2.inputText = selector;
var currentQuery = self2[0] = newQuery();
@@ -102993,7 +108824,7 @@ g.stateGroup line {
}
return true;
}, "parse");
- toString3 = /* @__PURE__ */ __name(function toString4() {
+ toString4 = /* @__PURE__ */ __name(function toString5() {
if (this.toStringCache != null) {
return this.toStringCache;
}
@@ -103082,8 +108913,8 @@ g.stateGroup line {
return str2;
}, "toString");
parse$1 = {
- parse: parse3,
- toString: toString3
+ parse: parse2,
+ toString: toString4
};
valCmp = /* @__PURE__ */ __name(function valCmp2(fieldVal, operator, value2) {
var matches33;
@@ -103182,8 +109013,8 @@ g.stateGroup line {
return stateSelectorMatches(stateSelector, ele);
};
match[Type3.ID] = function(check, ele) {
- var id27 = check.value;
- return ele.id() === id27;
+ var id29 = check.value;
+ return ele.id() === id29;
};
match[Type3.CLASS] = function(check, ele) {
var cls = check.value;
@@ -103329,7 +109160,7 @@ g.stateGroup line {
}, "Selector");
selfn = Selector.prototype;
[parse$1, matching].forEach(function(p3) {
- return extend2(selfn, p3);
+ return extend4(selfn, p3);
});
selfn.text = function() {
return this.inputText;
@@ -103447,7 +109278,7 @@ g.stateGroup line {
}, "cache");
elesfn$f = {
parent: /* @__PURE__ */ __name(function parent(selector) {
- var parents4 = [];
+ var parents3 = [];
if (this.length === 1) {
var parent4 = this[0]._private.parent;
if (parent4) {
@@ -103458,30 +109289,30 @@ g.stateGroup line {
var ele = this[i2];
var _parent = ele._private.parent;
if (_parent) {
- parents4.push(_parent);
+ parents3.push(_parent);
}
}
- return this.spawn(parents4, true).filter(selector);
+ return this.spawn(parents3, true).filter(selector);
}, "parent"),
- parents: /* @__PURE__ */ __name(function parents3(selector) {
- var parents4 = [];
+ parents: /* @__PURE__ */ __name(function parents2(selector) {
+ var parents3 = [];
var eles = this.parent();
while (eles.nonempty()) {
for (var i2 = 0; i2 < eles.length; i2++) {
var ele = eles[i2];
- parents4.push(ele);
+ parents3.push(ele);
}
eles = eles.parent();
}
- return this.spawn(parents4, true).filter(selector);
+ return this.spawn(parents3, true).filter(selector);
}, "parents"),
commonAncestors: /* @__PURE__ */ __name(function commonAncestors(selector) {
var ancestors;
for (var i2 = 0; i2 < this.length; i2++) {
var ele = this[i2];
- var parents4 = ele.parents();
- ancestors = ancestors || parents4;
- ancestors = ancestors.intersect(parents4);
+ var parents3 = ele.parents();
+ ancestors = ancestors || parents3;
+ ancestors = ancestors.intersect(parents3);
}
return ancestors.filter(selector);
}, "commonAncestors"),
@@ -103533,7 +109364,7 @@ g.stateGroup line {
return ele.isNode() && ele._private.parent == null;
}
}, "isOrphan"),
- descendants: /* @__PURE__ */ __name(function descendants3(selector) {
+ descendants: /* @__PURE__ */ __name(function descendants2(selector) {
var elements3 = [];
function add3(eles) {
for (var i2 = 0; i2 < eles.length; i2++) {
@@ -103638,7 +109469,7 @@ g.stateGroup line {
data3 = elesfn$e;
elesfn$d = {};
__name(defineDegreeFunction, "defineDegreeFunction");
- extend2(elesfn$d, {
+ extend4(elesfn$d, {
degree: defineDegreeFunction(function(node2, edge) {
if (edge.source().same(edge.target())) {
return 2;
@@ -103662,7 +109493,7 @@ g.stateGroup line {
})
});
__name(defineDegreeBoundsFunction, "defineDegreeBoundsFunction");
- extend2(elesfn$d, {
+ extend4(elesfn$d, {
minDegree: defineDegreeBoundsFunction("degree", function(degree, min9) {
return degree < min9;
}),
@@ -103682,7 +109513,7 @@ g.stateGroup line {
return degree > max10;
})
});
- extend2(elesfn$d, {
+ extend4(elesfn$d, {
totalDegree: /* @__PURE__ */ __name(function totalDegree(includeLoops) {
var total = 0;
var nodes6 = this.nodes();
@@ -103734,7 +109565,7 @@ g.stateGroup line {
fn$4 = elesfn$c = {
position: define2.data(positionDef),
// position but no notification to renderer
- silentPosition: define2.data(extend2({}, positionDef, {
+ silentPosition: define2.data(extend4({}, positionDef, {
allowBinding: false,
allowSetting: true,
settingTriggersEvent: false,
@@ -103841,7 +109672,7 @@ g.stateGroup line {
}
} else {
var pos = ele.position();
- rpos = modelToRenderedPosition(pos, zoom2, pan2);
+ rpos = modelToRenderedPosition$1(pos, zoom2, pan2);
if (dim === void 0) {
return rpos;
} else {
@@ -104166,7 +109997,7 @@ g.stateGroup line {
var outlineWidth = ele.pstyle("text-outline-width").pfValue;
var borderWidth = ele.pstyle("text-border-width").pfValue;
var halfBorderWidth = borderWidth / 2;
- var padding3 = ele.pstyle("text-background-padding").pfValue;
+ var padding2 = ele.pstyle("text-background-padding").pfValue;
var marginOfError = 2;
var lh = labelHeight;
var lw = labelWidth;
@@ -104208,10 +110039,14 @@ g.stateGroup line {
break;
}
}
- lx1 += marginX - Math.max(outlineWidth, halfBorderWidth) - padding3 - marginOfError;
- lx2 += marginX + Math.max(outlineWidth, halfBorderWidth) + padding3 + marginOfError;
- ly1 += marginY - Math.max(outlineWidth, halfBorderWidth) - padding3 - marginOfError;
- ly2 += marginY + Math.max(outlineWidth, halfBorderWidth) + padding3 + marginOfError;
+ var leftPad = marginX - Math.max(outlineWidth, halfBorderWidth) - padding2 - marginOfError;
+ var rightPad = marginX + Math.max(outlineWidth, halfBorderWidth) + padding2 + marginOfError;
+ var topPad = marginY - Math.max(outlineWidth, halfBorderWidth) - padding2 - marginOfError;
+ var botPad = marginY + Math.max(outlineWidth, halfBorderWidth) + padding2 + marginOfError;
+ lx1 += leftPad;
+ lx2 += rightPad;
+ ly1 += topPad;
+ ly2 += botPad;
var bbPrefix = prefix || "main";
var bbs = _p.labelBounds;
var bb = bbs[bbPrefix] = bbs[bbPrefix] || {};
@@ -104221,6 +110056,10 @@ g.stateGroup line {
bb.y2 = ly2;
bb.w = lx2 - lx1;
bb.h = ly2 - ly1;
+ bb.leftPad = leftPad;
+ bb.rightPad = rightPad;
+ bb.topPad = topPad;
+ bb.botPad = botPad;
var isAutorotate = isEdge2 && rotation.strValue === "autorotate";
var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0;
if (isAutorotate || isPfValue) {
@@ -104247,7 +110086,7 @@ g.stateGroup line {
break;
}
}
- var rotate = /* @__PURE__ */ __name(function rotate2(x5, y5) {
+ var rotate2 = /* @__PURE__ */ __name(function rotate3(x5, y5) {
x5 = x5 - xo;
y5 = y5 - yo;
return {
@@ -104255,10 +110094,10 @@ g.stateGroup line {
y: x5 * sin3 + y5 * cos3 + yo
};
}, "rotate");
- var px1y1 = rotate(lx1, ly1);
- var px1y2 = rotate(lx1, ly2);
- var px2y1 = rotate(lx2, ly1);
- var px2y2 = rotate(lx2, ly2);
+ var px1y1 = rotate2(lx1, ly1);
+ var px1y2 = rotate2(lx1, ly2);
+ var px2y1 = rotate2(lx2, ly1);
+ var px2y2 = rotate2(lx2, ly2);
lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x);
lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x);
ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y);
@@ -104351,7 +110190,7 @@ g.stateGroup line {
underlayPadding = ele.pstyle("underlay-padding").value;
}
}
- var padding3 = Math.max(overlayPadding, underlayPadding);
+ var padding2 = Math.max(overlayPadding, underlayPadding);
var w3 = 0;
var wHalf = 0;
if (styleEnabled2) {
@@ -104479,7 +110318,7 @@ g.stateGroup line {
ex2 = bounds4.x2;
ey1 = bounds4.y1;
ey2 = bounds4.y2;
- updateBounds(bounds4, ex1 - padding3, ey1 - padding3, ex2 + padding3, ey2 + padding3);
+ updateBounds(bounds4, ex1 - padding2, ey1 - padding2, ex2 + padding2, ey2 + padding2);
}
var bbOverlay = _p.overlayBounds = _p.overlayBounds || {};
assignBoundingBox(bbOverlay, bounds4);
@@ -104557,7 +110396,7 @@ g.stateGroup line {
var isDirty = /* @__PURE__ */ __name(function isDirty2(ele2) {
return ele2._private.bbCache == null || ele2._private.styleDirty;
}, "isDirty");
- var needRecalc = !useCache || isDirty(ele) || isEdge2 && isDirty(ele.source()) || isDirty(ele.target());
+ var needRecalc = !useCache || isDirty(ele) || isEdge2 && (isDirty(ele.source()) || isDirty(ele.target()));
if (needRecalc) {
if (!isPosKeySame) {
ele.recalculateRenderedStyle(useCache);
@@ -104678,12 +110517,12 @@ g.stateGroup line {
var nodes6 = this.nodes();
var cy = this.cy();
var hasCompoundNodes2 = cy.hasCompoundNodes();
- var parents4 = cy.collection();
+ var parents3 = cy.collection();
if (hasCompoundNodes2) {
- parents4 = nodes6.filter(function(node2) {
+ parents3 = nodes6.filter(function(node2) {
return node2.isParent();
});
- nodes6 = nodes6.not(parents4);
+ nodes6 = nodes6.not(parents3);
}
if (plainObject(fn3)) {
var obj = fn3;
@@ -104700,18 +110539,18 @@ g.stateGroup line {
cy.startBatch();
nodes6.forEach(storeOldPos).silentPositions(fn3);
if (hasCompoundNodes2) {
- parents4.dirtyCompoundBoundsCache();
- parents4.dirtyBoundingBoxCache();
- parents4.updateCompoundBounds(true);
+ parents3.dirtyCompoundBoundsCache();
+ parents3.dirtyBoundingBoxCache();
+ parents3.updateCompoundBounds(true);
}
var bb = copyBoundingBox(this.boundingBox({
useCache: false
}));
nodes6.silentPositions(getOldPos);
if (hasCompoundNodes2) {
- parents4.dirtyCompoundBoundsCache();
- parents4.dirtyBoundingBoxCache();
- parents4.updateCompoundBounds(true);
+ parents3.dirtyCompoundBoundsCache();
+ parents3.dirtyBoundingBoxCache();
+ parents3.updateCompoundBounds(true);
}
cy.endBatch();
return bb;
@@ -104759,8 +110598,8 @@ g.stateGroup line {
if (styleEnabled2) {
var dim = ele[opts.name]();
var border = ele.pstyle("border-width").pfValue;
- var padding3 = 2 * ele.padding();
- return dim + border + padding3;
+ var padding2 = 2 * ele.padding();
+ return dim + border + padding2;
} else {
return 1;
}
@@ -104818,7 +110657,7 @@ g.stateGroup line {
ifEdgeRenderedPosition = /* @__PURE__ */ __name(function ifEdgeRenderedPosition2(ele, getPoint) {
if (ele.isEdge()) {
var cy = ele.cy();
- return modelToRenderedPosition(getPoint(ele), cy.zoom(), cy.pan());
+ return modelToRenderedPosition$1(getPoint(ele), cy.zoom(), cy.pan());
}
}, "ifEdgeRenderedPosition");
ifEdgeRenderedPositions = /* @__PURE__ */ __name(function ifEdgeRenderedPositions2(ele, getPoints) {
@@ -104827,7 +110666,7 @@ g.stateGroup line {
var pan2 = cy.pan();
var zoom2 = cy.zoom();
return getPoints(ele).map(function(p3) {
- return modelToRenderedPosition(p3, zoom2, pan2);
+ return modelToRenderedPosition$1(p3, zoom2, pan2);
});
}
}, "ifEdgeRenderedPositions");
@@ -104885,7 +110724,7 @@ g.stateGroup line {
}
return obj;
}, {});
- dimensions = extend2({}, position2, bounds3, widthHeight, edgePoints);
+ dimensions = extend4({}, position2, bounds3, widthHeight, edgePoints);
Event = /* @__PURE__ */ __name(function Event2(src, props) {
this.recycle(src, props);
}, "Event");
@@ -104982,18 +110821,18 @@ g.stateGroup line {
};
defaultsKeys = Object.keys(defaults$8);
emptyOpts = {};
- __name(Emitter2, "Emitter");
- p2 = Emitter2.prototype;
- forEachEvent = /* @__PURE__ */ __name(function forEachEvent2(self2, handler, events, qualifier, callback, conf8, confOverrides) {
+ __name(Emitter3, "Emitter");
+ p2 = Emitter3.prototype;
+ forEachEvent = /* @__PURE__ */ __name(function forEachEvent2(self2, handler, events, qualifier, callback, conf5, confOverrides) {
if (fn$6(qualifier)) {
callback = qualifier;
qualifier = null;
}
if (confOverrides) {
- if (conf8 == null) {
- conf8 = confOverrides;
+ if (conf5 == null) {
+ conf5 = confOverrides;
} else {
- conf8 = extend2({}, conf8, confOverrides);
+ conf5 = extend4({}, conf5, confOverrides);
}
}
var eventList = array2(events) ? events : events.split(/\s+/);
@@ -105006,7 +110845,7 @@ g.stateGroup line {
if (match2) {
var type3 = match2[1];
var namespace = match2[2] ? match2[2] : null;
- var ret = handler(self2, evt, type3, namespace, qualifier, callback, conf8);
+ var ret = handler(self2, evt, type3, namespace, qualifier, callback, conf5);
if (ret === false) {
break;
}
@@ -105044,8 +110883,8 @@ g.stateGroup line {
}
}
}, "forEachEventObj");
- p2.on = p2.addListener = function(events, qualifier, callback, conf8, confOverrides) {
- forEachEvent(this, function(self2, event3, type3, namespace, qualifier2, callback2, conf9) {
+ p2.on = p2.addListener = function(events, qualifier, callback, conf5, confOverrides) {
+ forEachEvent(this, function(self2, event3, type3, namespace, qualifier2, callback2, conf6) {
if (fn$6(callback2)) {
self2.listeners.push({
event: event3,
@@ -105058,19 +110897,19 @@ g.stateGroup line {
// the event namespace (e.g. ".foo")
qualifier: qualifier2,
// a restriction on whether to match this emitter
- conf: conf9
+ conf: conf6
// additional configuration
});
}
- }, events, qualifier, callback, conf8, confOverrides);
+ }, events, qualifier, callback, conf5, confOverrides);
return this;
};
- p2.one = function(events, qualifier, callback, conf8) {
- return this.on(events, qualifier, callback, conf8, {
+ p2.one = function(events, qualifier, callback, conf5) {
+ return this.on(events, qualifier, callback, conf5, {
one: true
});
};
- p2.removeListener = p2.off = function(events, qualifier, callback, conf8) {
+ p2.removeListener = p2.off = function(events, qualifier, callback, conf5) {
var _this = this;
if (this.emitting !== 0) {
this.listeners = copyArray$1(this.listeners);
@@ -105083,7 +110922,7 @@ g.stateGroup line {
listeners.splice(i3, 1);
return false;
}
- }, events, qualifier, callback, conf8);
+ }, events, qualifier, callback, conf5);
}, "_loop");
for (var i2 = listeners.length - 1; i2 >= 0; i2--) {
_loop(i2);
@@ -105189,7 +111028,7 @@ g.stateGroup line {
var ele = this[i2];
var _p = ele._private;
if (!_p.emitter) {
- _p.emitter = new Emitter2(emitterOptions$1, ele);
+ _p.emitter = new Emitter3(emitterOptions$1, ele);
}
}
return this;
@@ -105256,12 +111095,12 @@ g.stateGroup line {
};
define2.eventAliasesOn(elesfn$9);
elesfn$8 = {
- nodes: /* @__PURE__ */ __name(function nodes3(selector) {
+ nodes: /* @__PURE__ */ __name(function nodes2(selector) {
return this.filter(function(ele) {
return ele.isNode();
}).filter(selector);
}, "nodes"),
- edges: /* @__PURE__ */ __name(function edges3(selector) {
+ edges: /* @__PURE__ */ __name(function edges(selector) {
return this.filter(function(ele) {
return ele.isEdge();
}).filter(selector);
@@ -105269,18 +111108,18 @@ g.stateGroup line {
// internal helper to get nodes and edges as separate collections with single iteration over elements
byGroup: /* @__PURE__ */ __name(function byGroup() {
var nodes6 = this.spawn();
- var edges5 = this.spawn();
+ var edges3 = this.spawn();
for (var i2 = 0; i2 < this.length; i2++) {
var ele = this[i2];
if (ele.isNode()) {
nodes6.push(ele);
} else {
- edges5.push(ele);
+ edges3.push(ele);
}
}
return {
nodes: nodes6,
- edges: edges5
+ edges: edges3
};
}, "byGroup"),
filter: /* @__PURE__ */ __name(function filter5(_filter, thisArg) {
@@ -105324,15 +111163,15 @@ g.stateGroup line {
var cy = this.cy();
return cy.mutableElements().not(this);
}, "absoluteComplement"),
- intersect: /* @__PURE__ */ __name(function intersect2(other) {
- if (string(other)) {
- var selector = other;
+ intersect: /* @__PURE__ */ __name(function intersect2(other2) {
+ if (string(other2)) {
+ var selector = other2;
return this.filter(selector);
}
var elements3 = this.spawn();
var col1 = this;
- var col2 = other;
- var col1Smaller = this.length < other.length;
+ var col2 = other2;
+ var col1Smaller = this.length < other2.length;
var colS = col1Smaller ? col1 : col2;
var colL = col1Smaller ? col2 : col1;
for (var i2 = 0; i2 < colS.length; i2++) {
@@ -105343,19 +111182,19 @@ g.stateGroup line {
}
return elements3;
}, "intersect"),
- xor: /* @__PURE__ */ __name(function xor(other) {
+ xor: /* @__PURE__ */ __name(function xor(other2) {
var cy = this._private.cy;
- if (string(other)) {
- other = cy.$(other);
+ if (string(other2)) {
+ other2 = cy.$(other2);
}
var elements3 = this.spawn();
var col1 = this;
- var col2 = other;
- var add3 = /* @__PURE__ */ __name(function add4(col, other2) {
+ var col2 = other2;
+ var add3 = /* @__PURE__ */ __name(function add4(col, other3) {
for (var i2 = 0; i2 < col.length; i2++) {
var ele = col[i2];
- var id27 = ele._private.data.id;
- var inOther = other2.hasElementWithId(id27);
+ var id29 = ele._private.data.id;
+ var inOther = other3.hasElementWithId(id29);
if (!inOther) {
elements3.push(ele);
}
@@ -105365,21 +111204,21 @@ g.stateGroup line {
add3(col2, col1);
return elements3;
}, "xor"),
- diff: /* @__PURE__ */ __name(function diff(other) {
+ diff: /* @__PURE__ */ __name(function diff(other2) {
var cy = this._private.cy;
- if (string(other)) {
- other = cy.$(other);
+ if (string(other2)) {
+ other2 = cy.$(other2);
}
var left3 = this.spawn();
var right3 = this.spawn();
var both = this.spawn();
var col1 = this;
- var col2 = other;
- var add3 = /* @__PURE__ */ __name(function add4(col, other2, retEles) {
+ var col2 = other2;
+ var add3 = /* @__PURE__ */ __name(function add4(col, other3, retEles) {
for (var i2 = 0; i2 < col.length; i2++) {
var ele = col[i2];
- var id27 = ele._private.data.id;
- var inOther = other2.hasElementWithId(id27);
+ var id29 = ele._private.data.id;
+ var inOther = other3.hasElementWithId(id29);
if (inOther) {
both.merge(ele);
} else {
@@ -105415,7 +111254,7 @@ g.stateGroup line {
return elements3;
}, "add"),
// in place merge on calling collection
- merge: /* @__PURE__ */ __name(function merge3(toAdd) {
+ merge: /* @__PURE__ */ __name(function merge4(toAdd) {
var _p = this._private;
var cy = _p.cy;
if (!toAdd) {
@@ -105428,12 +111267,12 @@ g.stateGroup line {
var map5 = _p.map;
for (var i2 = 0; i2 < toAdd.length; i2++) {
var toAddEle = toAdd[i2];
- var id27 = toAddEle._private.data.id;
- var add3 = !map5.has(id27);
+ var id29 = toAddEle._private.data.id;
+ var add3 = !map5.has(id29);
if (add3) {
var index = this.length++;
this[index] = toAddEle;
- map5.set(id27, {
+ map5.set(id29, {
ele: toAddEle,
index
});
@@ -105443,11 +111282,11 @@ g.stateGroup line {
}, "merge"),
unmergeAt: /* @__PURE__ */ __name(function unmergeAt(i2) {
var ele = this[i2];
- var id27 = ele.id();
+ var id29 = ele.id();
var _p = this._private;
var map5 = _p.map;
this[i2] = void 0;
- map5["delete"](id27);
+ map5["delete"](id29);
var unmergedLastEle = i2 === this.length - 1;
if (this.length > 1 && !unmergedLastEle) {
var lastEleI = this.length - 1;
@@ -105467,9 +111306,9 @@ g.stateGroup line {
unmergeOne: /* @__PURE__ */ __name(function unmergeOne(ele) {
ele = ele[0];
var _p = this._private;
- var id27 = ele._private.data.id;
+ var id29 = ele._private.data.id;
var map5 = _p.map;
- var entry = map5.get(id27);
+ var entry = map5.get(id29);
if (!entry) {
return this;
}
@@ -105501,7 +111340,7 @@ g.stateGroup line {
}
return this;
}, "unmergeBy"),
- map: /* @__PURE__ */ __name(function map3(mapFn, thisArg) {
+ map: /* @__PURE__ */ __name(function map4(mapFn, thisArg) {
var arr = [];
var eles = this;
for (var i2 = 0; i2 < eles.length; i2++) {
@@ -105632,7 +111471,7 @@ g.stateGroup line {
}
return this;
}, "forEach"),
- toArray: /* @__PURE__ */ __name(function toArray() {
+ toArray: /* @__PURE__ */ __name(function toArray2() {
var array4 = [];
for (var i2 = 0; i2 < this.length; i2++) {
array4.push(this[i2]);
@@ -105903,7 +111742,7 @@ g.stateGroup line {
}, "layoutPositions"),
layout: /* @__PURE__ */ __name(function layout2(options3) {
var cy = this.cy();
- return cy.makeLayout(extend2({}, options3, {
+ return cy.makeLayout(extend4({}, options3, {
eles: this
}));
}, "layout")
@@ -105915,10 +111754,10 @@ g.stateGroup line {
elesfn$4 = {
recalculateRenderedStyle: /* @__PURE__ */ __name(function recalculateRenderedStyle(useCache) {
var cy = this.cy();
- var renderer8 = cy.renderer();
+ var renderer9 = cy.renderer();
var styleEnabled2 = cy.styleEnabled();
- if (renderer8 && styleEnabled2) {
- renderer8.recalculateRenderedStyle(this, useCache);
+ if (renderer9 && styleEnabled2) {
+ renderer9.recalculateRenderedStyle(this, useCache);
}
return this;
}, "recalculateRenderedStyle"),
@@ -105991,7 +111830,10 @@ g.stateGroup line {
return;
}
if (ele) {
- this.cleanStyle();
+ if (ele._private.styleDirty) {
+ ele._private.styleDirty = false;
+ cy.style().apply(ele);
+ }
var overriddenStyle = ele._private.style[property2];
if (overriddenStyle != null) {
return overriddenStyle;
@@ -106111,10 +111953,10 @@ g.stateGroup line {
if (!hasCompoundNodes2) {
return parentOpacity;
}
- var parents4 = !_p.data.parent ? null : ele.parents();
- if (parents4) {
- for (var i2 = 0; i2 < parents4.length; i2++) {
- var parent4 = parents4[i2];
+ var parents3 = !_p.data.parent ? null : ele.parents();
+ if (parents3) {
+ for (var i2 = 0; i2 < parents3.length; i2++) {
+ var parent4 = parents3[i2];
var opacity = parent4.pstyle("opacity").value;
parentOpacity = opacity * parentOpacity;
}
@@ -106265,9 +112107,9 @@ g.stateGroup line {
continue;
}
var disqualified = false;
- var edges5 = ele.connectedEdges();
- for (var j2 = 0; j2 < edges5.length; j2++) {
- var edge = edges5[j2];
+ var edges3 = ele.connectedEdges();
+ for (var j2 = 0; j2 < edges3.length; j2++) {
+ var edge = edges3[j2];
var src = edge.source();
var tgt = edge.target();
if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) {
@@ -106291,9 +112133,9 @@ g.stateGroup line {
if (!ele.isNode()) {
continue;
}
- var edges5 = ele.connectedEdges();
- for (var j2 = 0; j2 < edges5.length; j2++) {
- var edge = edges5[j2];
+ var edges3 = ele.connectedEdges();
+ for (var j2 = 0; j2 < edges3.length; j2++) {
+ var edge = edges3[j2];
var src = edge.source();
var tgt = edge.target();
if (params.outgoing && src === ele) {
@@ -106341,7 +112183,7 @@ g.stateGroup line {
this[i2]._private.traversalCache = null;
}
};
- extend2(elesfn$2, {
+ extend4(elesfn$2, {
// get the root nodes in the DAG
roots: defineDagExtremity({
noIncomingEdges: true
@@ -106369,7 +112211,7 @@ g.stateGroup line {
incoming: true
})
});
- extend2(elesfn$2, {
+ extend4(elesfn$2, {
neighborhood: cache(function(selector) {
var elements3 = [];
var nodes6 = this.nodes();
@@ -106399,7 +112241,7 @@ g.stateGroup line {
elesfn$2.neighbourhood = elesfn$2.neighborhood;
elesfn$2.closedNeighbourhood = elesfn$2.closedNeighborhood;
elesfn$2.openNeighbourhood = elesfn$2.openNeighborhood;
- extend2(elesfn$2, {
+ extend4(elesfn$2, {
source: cache(/* @__PURE__ */ __name(function sourceImpl(selector) {
var ele = this[0];
var src;
@@ -106424,14 +112266,14 @@ g.stateGroup line {
})
});
__name(defineSourceFunction, "defineSourceFunction");
- extend2(elesfn$2, {
+ extend4(elesfn$2, {
edgesWith: cache(defineEdgesWithFunction(), "edgesWith"),
edgesTo: cache(defineEdgesWithFunction({
thisIsSrc: true
}), "edgesTo")
});
__name(defineEdgesWithFunction, "defineEdgesWithFunction");
- extend2(elesfn$2, {
+ extend4(elesfn$2, {
connectedEdges: cache(function(selector) {
var retEles = [];
var eles = this;
@@ -106440,9 +112282,9 @@ g.stateGroup line {
if (!node2.isNode()) {
continue;
}
- var edges5 = node2._private.edges;
- for (var j2 = 0; j2 < edges5.length; j2++) {
- var edge = edges5[j2];
+ var edges3 = node2._private.edges;
+ for (var j2 = 0; j2 < edges3.length; j2++) {
+ var edge = edges3[j2];
retEles.push(edge);
}
}
@@ -106467,7 +112309,7 @@ g.stateGroup line {
}), "codirectedEdges")
});
__name(defineParallelEdgesFunction, "defineParallelEdgesFunction");
- extend2(elesfn$2, {
+ extend4(elesfn$2, {
components: /* @__PURE__ */ __name(function components2(root4) {
var self2 = this;
var cy = self2.cy();
@@ -106542,7 +112384,7 @@ g.stateGroup line {
} else if (cy.hasElementWithId(_data.id) || elesIds.has(_data.id)) {
continue;
}
- var ele = new Element(cy, json3, false);
+ var ele = new Element2(cy, json3, false);
eles.push(ele);
elesIds.add(_data.id);
}
@@ -106554,10 +112396,10 @@ g.stateGroup line {
if (element$1 == null) {
continue;
}
- var id27 = element$1._private.data.id;
- if (!unique || !map5.has(id27)) {
+ var id29 = element$1._private.data.id;
+ if (!unique || !map5.has(id29)) {
if (unique) {
- map5.set(id27, {
+ map5.set(id29, {
index: this.length,
ele: element$1
});
@@ -106597,7 +112439,7 @@ g.stateGroup line {
this.restore();
}
}, "Collection");
- elesfn$1 = Element.prototype = Collection.prototype = Object.create(Array.prototype);
+ elesfn$1 = Element2.prototype = Collection.prototype = Object.create(Array.prototype);
elesfn$1.instanceString = function() {
return "collection";
};
@@ -106626,30 +112468,30 @@ g.stateGroup line {
elesfn$1.unique = function() {
return new Collection(this._private.cy, this, true);
};
- elesfn$1.hasElementWithId = function(id27) {
- id27 = "" + id27;
- return this._private.map.has(id27);
+ elesfn$1.hasElementWithId = function(id29) {
+ id29 = "" + id29;
+ return this._private.map.has(id29);
};
- elesfn$1.getElementById = function(id27) {
- id27 = "" + id27;
+ elesfn$1.getElementById = function(id29) {
+ id29 = "" + id29;
var cy = this._private.cy;
- var entry = this._private.map.get(id27);
+ var entry = this._private.map.get(id29);
return entry ? entry.ele : new Collection(cy);
};
elesfn$1.$id = elesfn$1.getElementById;
elesfn$1.poolIndex = function() {
var cy = this._private.cy;
var eles = cy._private.elements;
- var id27 = this[0]._private.data.id;
- return eles._private.map.get(id27).index;
+ var id29 = this[0]._private.data.id;
+ return eles._private.map.get(id29).index;
};
elesfn$1.indexOf = function(ele) {
- var id27 = ele[0]._private.data.id;
- return this._private.map.get(id27).index;
+ var id29 = ele[0]._private.data.id;
+ return this._private.map.get(id29).index;
};
- elesfn$1.indexOfId = function(id27) {
- id27 = "" + id27;
- return this._private.map.get(id27).index;
+ elesfn$1.indexOfId = function(id29) {
+ id29 = "" + id29;
+ return this._private.map.get(id29).index;
};
elesfn$1.json = function(obj) {
var ele = this.element();
@@ -106724,8 +112566,8 @@ g.stateGroup line {
return this;
} else if (obj === void 0) {
var json3 = {
- data: copy4(p3.data),
- position: copy4(p3.position),
+ data: copy3(p3.data),
+ position: copy3(p3.position),
group: p3.group,
removed: p3.removed,
selected: p3.selected,
@@ -106758,8 +112600,8 @@ g.stateGroup line {
for (var i2 = 0; i2 < this.length; i2++) {
var ele = this[i2];
var json3 = ele.json();
- var clone5 = new Element(cy, json3, false);
- elesArr.push(clone5);
+ var clone6 = new Element2(cy, json3, false);
+ elesArr.push(clone6);
}
return new Collection(cy, elesArr);
};
@@ -106771,7 +112613,7 @@ g.stateGroup line {
var cy = self2.cy();
var cy_p = cy._private;
var nodes6 = [];
- var edges5 = [];
+ var edges3 = [];
var elements3;
for (var _i3 = 0, l2 = self2.length; _i3 < l2; _i3++) {
var ele = self2[_i3];
@@ -106781,10 +112623,10 @@ g.stateGroup line {
if (ele.isNode()) {
nodes6.push(ele);
} else {
- edges5.push(ele);
+ edges3.push(ele);
}
}
- elements3 = nodes6.concat(edges5);
+ elements3 = nodes6.concat(edges3);
var i2;
var removeFromElements = /* @__PURE__ */ __name(function removeFromElements2() {
elements3.splice(i2, 1);
@@ -106809,7 +112651,7 @@ g.stateGroup line {
removeFromElements();
continue;
}
- var id27 = _data3.id;
+ var id29 = _data3.id;
if (_ele2.isNode()) {
var pos = _private.position;
if (pos.x == null) {
@@ -106831,10 +112673,10 @@ g.stateGroup line {
val = _data3[field] = "" + _data3[field];
}
if (val == null || val === "") {
- error("Can not create edge `" + id27 + "` with unspecified " + field);
+ error("Can not create edge `" + id29 + "` with unspecified " + field);
badSourceOrTarget = true;
} else if (!cy.hasElementWithId(val)) {
- error("Can not create edge `" + id27 + "` with nonexistant " + field + " `" + val + "`");
+ error("Can not create edge `" + id29 + "` with nonexistant " + field + " `" + val + "`");
badSourceOrTarget = true;
}
}
@@ -106854,7 +112696,7 @@ g.stateGroup line {
edge._private.target = tgt;
}
_private.map = new Map$2();
- _private.map.set(id27, {
+ _private.map.set(id29, {
ele: _ele2,
index: 0
});
@@ -106940,9 +112782,9 @@ g.stateGroup line {
var elesToRemoveIds = {};
var cy = self2._private.cy;
function addConnectedEdges(node2) {
- var edges5 = node2._private.edges;
- for (var i3 = 0; i3 < edges5.length; i3++) {
- add3(edges5[i3]);
+ var edges3 = node2._private.edges;
+ for (var i3 = 0; i3 < edges3.length; i3++) {
+ add3(edges3[i3]);
}
}
__name(addConnectedEdges, "addConnectedEdges");
@@ -107057,8 +112899,8 @@ g.stateGroup line {
var eles = this;
var notifyRenderer = false;
var modifyPool = false;
- var toString6 = /* @__PURE__ */ __name(function toString7(id27) {
- return id27 == null ? id27 : "" + id27;
+ var toString6 = /* @__PURE__ */ __name(function toString7(id29) {
+ return id29 == null ? id29 : "" + id29;
}, "toString");
if (struct.source !== void 0 || struct.target !== void 0) {
var srcId = toString6(struct.source);
@@ -107108,7 +112950,7 @@ g.stateGroup line {
return this;
};
[elesfn$j, elesfn$i, elesfn$h, elesfn$g, elesfn$f, data3, elesfn$d, dimensions, elesfn$9, elesfn$8, elesfn$7, elesfn$6, elesfn$5, elesfn$4, elesfn$3, elesfn$2].forEach(function(props) {
- extend2(elesfn$1, props);
+ extend4(elesfn$1, props);
});
corefn$9 = {
add: /* @__PURE__ */ __name(function add2(opts) {
@@ -107138,7 +112980,7 @@ g.stateGroup line {
var elesArray = elesByGroup[group2];
if (array2(elesArray)) {
for (var j2 = 0, jl = elesArray.length; j2 < jl; j2++) {
- var json3 = extend2({
+ var json3 = extend4({
group: group2
}, elesArray[j2]);
_jsons2.push(json3);
@@ -107148,7 +112990,7 @@ g.stateGroup line {
elements3 = new Collection(cy, _jsons2);
} else {
var _json = opts;
- elements3 = new Element(cy, _json).collection();
+ elements3 = new Element2(cy, _json).collection();
}
return elements3;
}, "add"),
@@ -107163,31 +113005,31 @@ g.stateGroup line {
};
__name(generateCubicBezier, "generateCubicBezier");
generateSpringRK4 = /* @__PURE__ */ function() {
- function springAccelerationForState(state5) {
- return -state5.tension * state5.x - state5.friction * state5.v;
+ function springAccelerationForState(state4) {
+ return -state4.tension * state4.x - state4.friction * state4.v;
}
__name(springAccelerationForState, "springAccelerationForState");
function springEvaluateStateWithDerivative(initialState, dt, derivative) {
- var state5 = {
+ var state4 = {
x: initialState.x + derivative.dx * dt,
v: initialState.v + derivative.dv * dt,
tension: initialState.tension,
friction: initialState.friction
};
return {
- dx: state5.v,
- dv: springAccelerationForState(state5)
+ dx: state4.v,
+ dv: springAccelerationForState(state4)
};
}
__name(springEvaluateStateWithDerivative, "springEvaluateStateWithDerivative");
- function springIntegrateState(state5, dt) {
+ function springIntegrateState(state4, dt) {
var a2 = {
- dx: state5.v,
- dv: springAccelerationForState(state5)
- }, b2 = springEvaluateStateWithDerivative(state5, dt * 0.5, a2), c3 = springEvaluateStateWithDerivative(state5, dt * 0.5, b2), d2 = springEvaluateStateWithDerivative(state5, dt, c3), dxdt = 1 / 6 * (a2.dx + 2 * (b2.dx + c3.dx) + d2.dx), dvdt = 1 / 6 * (a2.dv + 2 * (b2.dv + c3.dv) + d2.dv);
- state5.x = state5.x + dxdt * dt;
- state5.v = state5.v + dvdt * dt;
- return state5;
+ dx: state4.v,
+ dv: springAccelerationForState(state4)
+ }, b2 = springEvaluateStateWithDerivative(state4, dt * 0.5, a2), c3 = springEvaluateStateWithDerivative(state4, dt * 0.5, b2), d2 = springEvaluateStateWithDerivative(state4, dt, c3), dxdt = 1 / 6 * (a2.dx + 2 * (b2.dx + c3.dx) + d2.dx), dvdt = 1 / 6 * (a2.dv + 2 * (b2.dv + c3.dv) + d2.dv);
+ state4.x = state4.x + dxdt * dt;
+ state4.v = state4.v + dvdt * dt;
+ return state4;
}
__name(springIntegrateState, "springIntegrateState");
return /* @__PURE__ */ __name(function springRK4Factory(tension, friction, duration) {
@@ -107319,11 +113161,11 @@ g.stateGroup line {
}, "animationStep"));
}
__name(headlessStep, "headlessStep");
- var renderer8 = cy.renderer();
- if (renderer8 && renderer8.beforeRender) {
- renderer8.beforeRender(/* @__PURE__ */ __name(function rendererAnimationStep(willDraw, now4) {
+ var renderer9 = cy.renderer();
+ if (renderer9 && renderer9.beforeRender) {
+ renderer9.beforeRender(/* @__PURE__ */ __name(function rendererAnimationStep(willDraw, now4) {
stepAll(now4, cy);
- }, "rendererAnimationStep"), renderer8.beforeRenderPriorities.animations);
+ }, "rendererAnimationStep"), renderer9.beforeRenderPriorities.animations);
} else {
headlessStep();
}
@@ -107363,7 +113205,7 @@ g.stateGroup line {
createEmitter: /* @__PURE__ */ __name(function createEmitter2() {
var _p = this._private;
if (!_p.emitter) {
- _p.emitter = new Emitter2(emitterOptions, this);
+ _p.emitter = new Emitter3(emitterOptions, this);
}
return this;
}, "createEmitter"),
@@ -107403,15 +113245,15 @@ g.stateGroup line {
define2.eventAliasesOn(elesfn);
corefn$7 = {
png: /* @__PURE__ */ __name(function png(options3) {
- var renderer8 = this._private.renderer;
+ var renderer9 = this._private.renderer;
options3 = options3 || {};
- return renderer8.png(options3);
+ return renderer9.png(options3);
}, "png"),
jpg: /* @__PURE__ */ __name(function jpg(options3) {
- var renderer8 = this._private.renderer;
+ var renderer9 = this._private.renderer;
options3 = options3 || {};
options3.bg = options3.bg || "#fff";
- return renderer8.jpg(options3);
+ return renderer9.jpg(options3);
}, "jpg")
};
corefn$7.jpeg = corefn$7.jpg;
@@ -107438,7 +113280,7 @@ g.stateGroup line {
} else {
eles = options3.eles != null ? options3.eles : cy.$();
}
- var layout6 = new Layout2(extend2({}, options3, {
+ var layout6 = new Layout2(extend4({}, options3, {
cy,
eles
}));
@@ -107460,11 +113302,11 @@ g.stateGroup line {
if (!_p.notificationsEnabled) {
return;
}
- var renderer8 = this.renderer();
- if (this.destroyed() || !renderer8) {
+ var renderer9 = this.renderer();
+ if (this.destroyed() || !renderer9) {
return;
}
- renderer8.notify(eventName, eventEles);
+ renderer9.notify(eventName, eventEles);
}, "notify"),
notifications: /* @__PURE__ */ __name(function notifications(bool2) {
var p3 = this._private;
@@ -107503,13 +113345,13 @@ g.stateGroup line {
_p.batchCount--;
if (_p.batchCount === 0) {
_p.batchStyleEles.updateStyle();
- var renderer8 = this.renderer();
+ var renderer9 = this.renderer();
Object.keys(_p.batchNotifications).forEach(function(eventName) {
var eles = _p.batchNotifications[eventName];
if (eles.empty()) {
- renderer8.notify(eventName);
+ renderer9.notify(eventName);
} else {
- renderer8.notify(eventName, eles);
+ renderer9.notify(eventName, eles);
}
});
}
@@ -107527,10 +113369,10 @@ g.stateGroup line {
return this.batch(function() {
var ids = Object.keys(map5);
for (var i2 = 0; i2 < ids.length; i2++) {
- var id27 = ids[i2];
- var data5 = map5[id27];
- var ele = cy.getElementById(id27);
- ele.data(data5);
+ var id29 = ids[i2];
+ var data6 = map5[id29];
+ var ele = cy.getElementById(id29);
+ ele.data(data6);
}
});
}, "batchData")
@@ -107545,7 +113387,17 @@ g.stateGroup line {
touchTapThreshold: 8,
wheelSensitivity: 1,
debug: false,
- showFps: false
+ showFps: false,
+ // webgl options
+ webgl: false,
+ webglDebug: false,
+ webglDebugShowAtlases: false,
+ // defaults good for mobile
+ webglTexSize: 2048,
+ webglTexRows: 12,
+ webglBatchSize: 2048,
+ webglTexPerBatch: 14,
+ webglBgColor: [255, 255, 255]
});
corefn$4 = {
renderTo: /* @__PURE__ */ __name(function renderTo(context, zoom2, pan2, pxRatio) {
@@ -107625,7 +113477,7 @@ g.stateGroup line {
}
return new Collection(this);
}, "collection"),
- nodes: /* @__PURE__ */ __name(function nodes4(selector) {
+ nodes: /* @__PURE__ */ __name(function nodes3(selector) {
var nodes6 = this.$(function(ele) {
return ele.isNode();
});
@@ -107634,14 +113486,14 @@ g.stateGroup line {
}
return nodes6;
}, "nodes"),
- edges: /* @__PURE__ */ __name(function edges4(selector) {
- var edges5 = this.$(function(ele) {
+ edges: /* @__PURE__ */ __name(function edges2(selector) {
+ var edges3 = this.$(function(ele) {
return ele.isEdge();
});
if (selector) {
- return edges5.filter(selector);
+ return edges3.filter(selector);
}
- return edges5;
+ return edges3;
}, "edges"),
// search the graph like jQuery
$: /* @__PURE__ */ __name(function $2(selector) {
@@ -108009,6 +113861,7 @@ g.stateGroup line {
warn("Do not assign mappings to elements without corresponding data (i.e. ele `" + ele.id() + "` has no mapping for property `" + prop.name + "` with data field `" + prop.field + "`); try a `[" + prop.field + "]` selector to limit scope to elements with `" + prop.field + "` defined");
}, "printMappingErr");
switch (prop.mapped) {
+ // flatten the property if mapped
case types.mapData: {
var fields = prop.field.split(".");
var fieldVal = _p.data;
@@ -108069,6 +113922,7 @@ g.stateGroup line {
prop = flatProp;
break;
}
+ // direct mapping
case types.data: {
var _fields = prop.field.split(".");
var _fieldVal = _p.data;
@@ -108100,12 +113954,13 @@ g.stateGroup line {
warn("Custom function mappers may not return invalid values for the property type (i.e. `" + prop.name + "` for ele `" + ele.id() + "` is invalid)");
return false;
}
- flatProp.mapping = copy4(prop);
+ flatProp.mapping = copy3(prop);
prop = flatProp;
break;
}
case void 0:
break;
+ // just set the property
default:
return false;
}
@@ -108251,9 +114106,7 @@ g.stateGroup line {
prop.triggersBoundsOfParallelBeziers && name === "curve-style" && (fromValue === "bezier" || toValue === "bezier")
) {
ele.parallelEdges().forEach(function(pllEdge) {
- if (pllEdge.isBundledBezier()) {
- pllEdge.dirtyBoundingBoxCache();
- }
+ pllEdge.dirtyBoundingBoxCache();
});
}
if (prop.triggersBoundsOfConnectedEdges && name === "display" && (fromValue === "none" || toValue === "none")) {
@@ -108325,7 +114178,7 @@ g.stateGroup line {
prev: prevProp
};
}
- ret = this.applyParsedProperty(ele, copy4(_prop)) || ret;
+ ret = this.applyParsedProperty(ele, copy3(_prop)) || ret;
if (updateTransitions) {
diffProp.next = ele.pstyle(_prop.name);
}
@@ -108699,7 +114552,7 @@ g.stateGroup line {
var hsla3 = hslaNoBackRefs;
var hex3$1 = hex3;
var hex6$1 = hex6;
- var data5 = /* @__PURE__ */ __name(function data6(prefix) {
+ var data6 = /* @__PURE__ */ __name(function data7(prefix) {
return "^" + prefix + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$";
}, "data");
var mapData = /* @__PURE__ */ __name(function mapData2(prefix) {
@@ -108964,15 +114817,15 @@ g.stateGroup line {
},
data: {
mapping: true,
- regex: data5("data")
+ regex: data6("data")
},
layoutData: {
mapping: true,
- regex: data5("layoutData")
+ regex: data6("layoutData")
},
scratch: {
mapping: true,
- regex: data5("scratch")
+ regex: data6("scratch")
},
mapData: {
mapping: true,
@@ -109031,7 +114884,7 @@ g.stateGroup line {
implicitUnits: "px",
enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"],
singleEnum: true,
- validate: /* @__PURE__ */ __name(function validate2(valArr, unitsArr) {
+ validate: /* @__PURE__ */ __name(function validate(valArr, unitsArr) {
switch (valArr.length) {
case 2:
return unitsArr[0] !== "deg" && unitsArr[0] !== "rad" && unitsArr[1] !== "deg" && unitsArr[1] !== "rad";
@@ -109067,7 +114920,7 @@ g.stateGroup line {
number: true,
multiple: true,
min: 0,
- validate: /* @__PURE__ */ __name(function validate2(valArr) {
+ validate: /* @__PURE__ */ __name(function validate(valArr) {
var length2 = valArr.length;
return length2 === 1 || length2 === 2 || length2 === 4;
}, "validate")
@@ -109837,7 +115690,7 @@ g.stateGroup line {
if (_p.defaultProperties != null) {
return _p.defaultProperties;
}
- var rawProps = extend2({
+ var rawProps = extend4({
// core props
"selection-box-color": "#ddd",
"selection-box-opacity": 0.65,
@@ -110107,9 +115960,9 @@ g.stateGroup line {
ret = propCache[argHash] = self2.parseImplWarn(name, value2, propIsBypass, propIsFlat);
}
if (propIsBypass || propIsFlat === "mapping") {
- ret = copy4(ret);
+ ret = copy3(ret);
if (ret) {
- ret.value = copy4(ret.value);
+ ret.value = copy3(ret.value);
}
}
return ret;
@@ -110165,19 +116018,19 @@ g.stateGroup line {
bypass: propIsBypass
};
}
- var data5, mapData;
+ var data6, mapData;
if (!valueIsString || propIsFlat || value2.length < 7 || value2[1] !== "a") ;
- else if (value2.length >= 7 && value2[0] === "d" && (data5 = new RegExp(types.data.regex).exec(value2))) {
+ else if (value2.length >= 7 && value2[0] === "d" && (data6 = new RegExp(types.data.regex).exec(value2))) {
if (propIsBypass) {
return false;
}
var mapped = types.data;
return {
name,
- value: data5,
+ value: data6,
strValue: "" + value2,
mapped,
- field: data5[1],
+ field: data6[1],
bypass: propIsBypass
};
} else if (value2.length >= 10 && value2[0] === "m" && (mapData = new RegExp(types.mapData.regex).exec(value2))) {
@@ -110423,7 +116276,7 @@ g.stateGroup line {
if (!(this instanceof Style3)) {
return new Style3(cy);
}
- if (!core(cy)) {
+ if (!core2(cy)) {
error("A style must have a core reference");
return;
}
@@ -110534,7 +116387,7 @@ g.stateGroup line {
return new Style2(cy).fromString(string3);
};
[styfn$8, styfn$7, styfn$6, styfn$5, styfn$4, styfn$3, styfn$2, styfn$1].forEach(function(props) {
- extend2(styfn, props);
+ extend4(styfn, props);
});
Style2.types = styfn.types;
Style2.properties = styfn.properties;
@@ -110549,7 +116402,7 @@ g.stateGroup line {
}
return this._private.style;
}, "style"),
- setStyle: /* @__PURE__ */ __name(function setStyle2(style3) {
+ setStyle: /* @__PURE__ */ __name(function setStyle(style3) {
var _p = this._private;
if (stylesheet(style3)) {
_p.style = style3.generateStyle(this);
@@ -110723,8 +116576,11 @@ g.stateGroup line {
this.notify("viewport");
return this;
}, "panBy"),
- fit: /* @__PURE__ */ __name(function fit(elements3, padding3) {
- var viewportState = this.getFitViewport(elements3, padding3);
+ gc: /* @__PURE__ */ __name(function gc() {
+ this.notify("gc");
+ }, "gc"),
+ fit: /* @__PURE__ */ __name(function fit(elements3, padding2) {
+ var viewportState = this.getFitViewport(elements3, padding2);
if (viewportState) {
var _p = this._private;
_p.zoom = viewportState.zoom;
@@ -110734,9 +116590,9 @@ g.stateGroup line {
}
return this;
}, "fit"),
- getFitViewport: /* @__PURE__ */ __name(function getFitViewport(elements3, padding3) {
- if (number$1(elements3) && padding3 === void 0) {
- padding3 = elements3;
+ getFitViewport: /* @__PURE__ */ __name(function getFitViewport(elements3, padding2) {
+ if (number$1(elements3) && padding2 === void 0) {
+ padding2 = elements3;
elements3 = void 0;
}
if (!this._private.panningEnabled || !this._private.zoomingEnabled) {
@@ -110766,9 +116622,9 @@ g.stateGroup line {
var w3 = this.width();
var h2 = this.height();
var zoom2;
- padding3 = number$1(padding3) ? padding3 : 0;
+ padding2 = number$1(padding2) ? padding2 : 0;
if (!isNaN(w3) && !isNaN(h2) && w3 > 0 && h2 > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) {
- zoom2 = Math.min((w3 - 2 * padding3) / bb.w, (h2 - 2 * padding3) / bb.h);
+ zoom2 = Math.min((w3 - 2 * padding2) / bb.w, (h2 - 2 * padding2) / bb.h);
zoom2 = zoom2 > this._private.maxZoom ? this._private.maxZoom : zoom2;
zoom2 = zoom2 < this._private.minZoom ? this._private.minZoom : zoom2;
var pan2 = {
@@ -110833,7 +116689,7 @@ g.stateGroup line {
} else if (plainObject(params)) {
zoom2 = params.level;
if (params.position != null) {
- pos = modelToRenderedPosition(params.position, currentZoom, currentPan);
+ pos = modelToRenderedPosition$1(params.position, currentZoom, currentPan);
} else if (params.renderedPosition != null) {
pos = params.renderedPosition;
}
@@ -111088,7 +116944,7 @@ g.stateGroup line {
fn2.removeAttr = fn2.removeData;
Core = /* @__PURE__ */ __name(function Core2(opts) {
var cy = this;
- opts = extend2({}, opts);
+ opts = extend4({}, opts);
var container2 = opts.container;
if (container2 && !htmlElement(container2) && htmlElement(container2[0])) {
container2 = container2[0];
@@ -111106,10 +116962,10 @@ g.stateGroup line {
reg.cy = cy;
var head2 = _window !== void 0 && container2 !== void 0 && !opts.headless;
var options3 = opts;
- options3.layout = extend2({
+ options3.layout = extend4({
name: head2 ? "grid" : "null"
}, options3.layout);
- options3.renderer = extend2({
+ options3.renderer = extend4({
name: head2 ? "canvas" : "null"
}, options3.renderer);
var defVal = /* @__PURE__ */ __name(function defVal2(def2, val, altVal) {
@@ -111185,7 +117041,7 @@ g.stateGroup line {
if (_p.styleEnabled) {
cy.setStyle([]);
}
- var rendererOptions = extend2({}, options3, options3.renderer);
+ var rendererOptions = extend4({}, options3, options3.renderer);
cy.initRenderer(rendererOptions);
var setElesAndLayout = /* @__PURE__ */ __name(function setElesAndLayout2(elements3, onload, ondone) {
cy.notifications(false);
@@ -111207,7 +117063,7 @@ g.stateGroup line {
cy.one("done", ondone);
cy.emit("done");
});
- var layoutOpts = extend2({}, cy._private.options.layout);
+ var layoutOpts = extend4({}, cy._private.options.layout);
layoutOpts.eles = cy.elements();
cy.layout(layoutOpts).run();
}, "setElesAndLayout");
@@ -111235,7 +117091,7 @@ g.stateGroup line {
});
}, "Core");
corefn = Core.prototype;
- extend2(corefn, {
+ extend4(corefn, {
instanceString: /* @__PURE__ */ __name(function instanceString3() {
return "core";
}, "instanceString"),
@@ -111262,11 +117118,11 @@ g.stateGroup line {
cy._private.destroyed = true;
return cy;
}, "destroy"),
- hasElementWithId: /* @__PURE__ */ __name(function hasElementWithId(id27) {
- return this._private.elements.hasElementWithId(id27);
+ hasElementWithId: /* @__PURE__ */ __name(function hasElementWithId(id29) {
+ return this._private.elements.hasElementWithId(id29);
}, "hasElementWithId"),
- getElementById: /* @__PURE__ */ __name(function getElementById2(id27) {
- return this._private.elements.getElementById(id27);
+ getElementById: /* @__PURE__ */ __name(function getElementById2(id29) {
+ return this._private.elements.getElementById(id29);
}, "getElementById"),
hasCompoundNodes: /* @__PURE__ */ __name(function hasCompoundNodes() {
return this._private.hasCompoundNodes;
@@ -111312,7 +117168,7 @@ g.stateGroup line {
_p.container = container2;
_p.styleEnabled = true;
cy.invalidateSize();
- cy.initRenderer(extend2({}, options3, options3.renderer, {
+ cy.initRenderer(extend4({}, options3, options3.renderer, {
// allow custom renderer name to be re-used, otherwise use canvas
name: options3.renderer.name === "null" ? "canvas" : options3.renderer.name
}));
@@ -111332,9 +117188,9 @@ g.stateGroup line {
return cy;
}, "unmount"),
options: /* @__PURE__ */ __name(function options2() {
- return copy4(this._private.options);
+ return copy3(this._private.options);
}, "options"),
- json: /* @__PURE__ */ __name(function json(obj) {
+ json: /* @__PURE__ */ __name(function json2(obj) {
var cy = this;
var _p = cy._private;
var eles = cy.mutableElements();
@@ -111354,9 +117210,9 @@ g.stateGroup line {
warn("cy.json() cannot handle elements without an ID attribute");
continue;
}
- var id27 = "" + json4.data.id;
- var ele = cy.getElementById(id27);
- idInJson[id27] = true;
+ var id29 = "" + json4.data.id;
+ var ele = cy.getElementById(id29);
+ idInJson[id29] = true;
if (ele.length !== 0) {
toMod.push({
ele,
@@ -111424,9 +117280,9 @@ g.stateGroup line {
}
var fields = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"];
for (var _i2 = 0; _i2 < fields.length; _i2++) {
- var f3 = fields[_i2];
- if (obj[f3] != null) {
- cy[f3](obj[f3]);
+ var f2 = fields[_i2];
+ if (obj[f2] != null) {
+ cy[f2](obj[f2]);
}
}
cy.endBatch();
@@ -111451,7 +117307,7 @@ g.stateGroup line {
if (this._private.styleEnabled) {
json3.style = cy.style().json();
}
- json3.data = copy4(cy.data());
+ json3.data = copy3(cy.data());
var options3 = _p.options;
json3.zoomingEnabled = _p.zoomingEnabled;
json3.userZoomingEnabled = _p.userZoomingEnabled;
@@ -111460,9 +117316,9 @@ g.stateGroup line {
json3.maxZoom = _p.maxZoom;
json3.panningEnabled = _p.panningEnabled;
json3.userPanningEnabled = _p.userPanningEnabled;
- json3.pan = copy4(_p.pan);
+ json3.pan = copy3(_p.pan);
json3.boxSelectionEnabled = _p.boxSelectionEnabled;
- json3.renderer = copy4(options3.renderer);
+ json3.renderer = copy3(options3.renderer);
json3.hideEdgesOnViewport = options3.hideEdgesOnViewport;
json3.textureOnViewport = options3.textureOnViewport;
json3.wheelSensitivity = options3.wheelSensitivity;
@@ -111474,7 +117330,7 @@ g.stateGroup line {
});
corefn.$id = corefn.getElementById;
[corefn$9, corefn$8, elesfn, corefn$7, corefn$6, corefn$5, corefn$4, corefn$3, corefn$2, corefn$1, fn2].forEach(function(props) {
- extend2(corefn, props);
+ extend4(corefn, props);
});
defaults$7 = {
fit: true,
@@ -111532,21 +117388,22 @@ g.stateGroup line {
}, "setInfo");
__name(BreadthFirstLayout, "BreadthFirstLayout");
BreadthFirstLayout.prototype.run = function() {
- var params = this.options;
- var options3 = params;
- var cy = params.cy;
+ var options3 = this.options;
+ var cy = options3.cy;
var eles = options3.eles;
var nodes6 = eles.nodes().filter(function(n3) {
- return !n3.isParent();
+ return n3.isChildless();
});
var graph = eles;
var directed = options3.directed;
var maximal = options3.acyclic || options3.maximal || options3.maximalAdjustments > 0;
- var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : {
- x1: 0,
- y1: 0,
- w: cy.width(),
- h: cy.height()
+ var hasBoundingBox = !!options3.boundingBox;
+ var cyExtent = cy.extent();
+ var bb = makeBoundingBox(hasBoundingBox ? options3.boundingBox : {
+ x1: cyExtent.x1,
+ y1: cyExtent.y1,
+ w: cyExtent.w,
+ h: cyExtent.h
});
var roots;
if (elementOrCollection(options3.roots)) {
@@ -111554,8 +117411,8 @@ g.stateGroup line {
} else if (array2(options3.roots)) {
var rootsArray = [];
for (var i2 = 0; i2 < options3.roots.length; i2++) {
- var id27 = options3.roots[i2];
- var ele = cy.getElementById(id27);
+ var id29 = options3.roots[i2];
+ var ele = cy.getElementById(id29);
rootsArray.push(ele);
}
roots = cy.collection(rootsArray);
@@ -111567,8 +117424,8 @@ g.stateGroup line {
} else {
var components3 = eles.components();
roots = cy.collection();
- var _loop = /* @__PURE__ */ __name(function _loop2(_i3) {
- var comp = components3[_i3];
+ var _loop = /* @__PURE__ */ __name(function _loop2(_i4) {
+ var comp = components3[_i4];
var maxDegree = comp.maxDegree(false);
var compRoots = comp.filter(function(ele2) {
return ele2.degree(false) === maxDegree;
@@ -111596,16 +117453,16 @@ g.stateGroup line {
var changeDepth = /* @__PURE__ */ __name(function changeDepth2(ele2, newDepth) {
var _getInfo = getInfo(ele2), depth = _getInfo.depth, index = _getInfo.index;
depths[depth][index] = null;
- addToDepth(ele2, newDepth);
+ if (ele2.isChildless()) addToDepth(ele2, newDepth);
}, "changeDepth");
graph.bfs({
roots,
directed: options3.directed,
visit: /* @__PURE__ */ __name(function visit(node2, edge, pNode, i3, depth) {
var ele2 = node2[0];
- var id28 = ele2.id();
- addToDepth(ele2, depth);
- foundByBfs[id28] = true;
+ var id30 = ele2.id();
+ if (ele2.isChildless()) addToDepth(ele2, depth);
+ foundByBfs[id30] = true;
}, "visit")
});
var orphanNodes = [];
@@ -111632,30 +117489,25 @@ g.stateGroup line {
});
}
}, "assignDepthsAt");
- var assignDepths = /* @__PURE__ */ __name(function assignDepths2() {
- for (var _i3 = 0; _i3 < depths.length; _i3++) {
- assignDepthsAt(_i3);
- }
- }, "assignDepths");
var adjustMaximally = /* @__PURE__ */ __name(function adjustMaximally2(ele2, shifted2) {
var eInfo = getInfo(ele2);
var incomers = ele2.incomers().filter(function(el) {
return el.isNode() && eles.has(el);
});
var maxDepth = -1;
- var id28 = ele2.id();
+ var id30 = ele2.id();
for (var k2 = 0; k2 < incomers.length; k2++) {
var incmr = incomers[k2];
var iInfo = getInfo(incmr);
maxDepth = Math.max(maxDepth, iInfo.depth);
}
if (eInfo.depth <= maxDepth) {
- if (!options3.acyclic && shifted2[id28]) {
+ if (!options3.acyclic && shifted2[id30]) {
return null;
}
var newDepth = maxDepth + 1;
changeDepth(ele2, newDepth);
- shifted2[id28] = newDepth;
+ shifted2[id30] = newDepth;
return true;
}
return false;
@@ -111685,11 +117537,10 @@ g.stateGroup line {
}
}
}
- assignDepths();
var minDistance = 0;
if (options3.avoidOverlap) {
- for (var _i4 = 0; _i4 < nodes6.length; _i4++) {
- var n2 = nodes6[_i4];
+ for (var _i3 = 0; _i3 < nodes6.length; _i3++) {
+ var n2 = nodes6[_i3];
var nbb = n2.layoutDimensions(options3);
var w3 = nbb.w;
var h2 = nbb.h;
@@ -111705,8 +117556,8 @@ g.stateGroup line {
var neighbors = ele2.neighborhood();
var percent = 0;
var samples = 0;
- for (var _i5 = 0; _i5 < neighbors.length; _i5++) {
- var neighbor = neighbors[_i5];
+ for (var _i4 = 0; _i4 < neighbors.length; _i4++) {
+ var neighbor = neighbors[_i4];
if (neighbor.isEdge() || neighbor.isParent() || !nodes6.has(neighbor)) {
continue;
}
@@ -111746,42 +117597,63 @@ g.stateGroup line {
if (options3.depthSort !== void 0) {
sortFn = options3.depthSort;
}
- for (var _i6 = 0; _i6 < depths.length; _i6++) {
- depths[_i6].sort(sortFn);
- assignDepthsAt(_i6);
+ var depthsLen = depths.length;
+ for (var _i5 = 0; _i5 < depthsLen; _i5++) {
+ depths[_i5].sort(sortFn);
+ assignDepthsAt(_i5);
}
var orphanDepth = [];
- for (var _i7 = 0; _i7 < orphanNodes.length; _i7++) {
- orphanDepth.push(orphanNodes[_i7]);
+ for (var _i6 = 0; _i6 < orphanNodes.length; _i6++) {
+ orphanDepth.push(orphanNodes[_i6]);
+ }
+ var assignDepths = /* @__PURE__ */ __name(function assignDepths2() {
+ for (var _i7 = 0; _i7 < depthsLen; _i7++) {
+ assignDepthsAt(_i7);
+ }
+ }, "assignDepths");
+ if (orphanDepth.length) {
+ depths.unshift(orphanDepth);
+ depthsLen = depths.length;
+ assignDepths();
}
- depths.unshift(orphanDepth);
- assignDepths();
var biggestDepthSize = 0;
- for (var _i8 = 0; _i8 < depths.length; _i8++) {
+ for (var _i8 = 0; _i8 < depthsLen; _i8++) {
biggestDepthSize = Math.max(depths[_i8].length, biggestDepthSize);
}
var center4 = {
x: bb.x1 + bb.w / 2,
- y: bb.x1 + bb.h / 2
+ y: bb.y1 + bb.h / 2
};
+ var aveNodeSize = nodes6.reduce(function(acc, node2) {
+ return function(box) {
+ return {
+ w: acc.w === -1 ? box.w : (acc.w + box.w) / 2,
+ h: acc.h === -1 ? box.h : (acc.h + box.h) / 2
+ };
+ }(node2.boundingBox({
+ includeLabels: options3.nodeDimensionsIncludeLabels
+ }));
+ }, {
+ w: -1,
+ h: -1
+ });
+ var distanceY = Math.max(
+ // only one depth
+ depthsLen === 1 ? 0 : (
+ // inside a bounding box, no need for top & bottom padding
+ hasBoundingBox ? (bb.h - options3.padding * 2 - aveNodeSize.h) / (depthsLen - 1) : (bb.h - options3.padding * 2 - aveNodeSize.h) / (depthsLen + 1)
+ ),
+ minDistance
+ );
var maxDepthSize = depths.reduce(function(max10, eles2) {
return Math.max(max10, eles2.length);
}, 0);
var getPosition = /* @__PURE__ */ __name(function getPosition2(ele2) {
var _getInfo2 = getInfo(ele2), depth = _getInfo2.depth, index = _getInfo2.index;
- var depthSize = depths[depth].length;
- var distanceX = Math.max(bb.w / ((options3.grid ? maxDepthSize : depthSize) + 1), minDistance);
- var distanceY = Math.max(bb.h / (depths.length + 1), minDistance);
- var radiusStepSize = Math.min(bb.w / 2 / depths.length, bb.h / 2 / depths.length);
- radiusStepSize = Math.max(radiusStepSize, minDistance);
- if (!options3.circle) {
- var epos = {
- x: center4.x + (index + 1 - (depthSize + 1) / 2) * distanceX,
- y: (depth + 1) * distanceY
- };
- return epos;
- } else {
- var radius2 = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0);
+ if (options3.circle) {
+ var radiusStepSize = Math.min(bb.w / 2 / depthsLen, bb.h / 2 / depthsLen);
+ radiusStepSize = Math.max(radiusStepSize, minDistance);
+ var radius2 = radiusStepSize * depth + radiusStepSize - (depthsLen > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0);
var theta = 2 * Math.PI / depths[depth].length * index;
if (depth === 0 && depths[0].length === 1) {
radius2 = 1;
@@ -111790,6 +117662,21 @@ g.stateGroup line {
x: center4.x + radius2 * Math.cos(theta),
y: center4.y + radius2 * Math.sin(theta)
};
+ } else {
+ var depthSize = depths[depth].length;
+ var distanceX = Math.max(
+ // only one depth
+ depthSize === 1 ? 0 : (
+ // inside a bounding box, no need for left & right padding
+ hasBoundingBox ? (bb.w - options3.padding * 2 - aveNodeSize.w) / ((options3.grid ? maxDepthSize : depthSize) - 1) : (bb.w - options3.padding * 2 - aveNodeSize.w) / ((options3.grid ? maxDepthSize : depthSize) + 1)
+ ),
+ minDistance
+ );
+ var epos = {
+ x: center4.x + (index + 1 - (depthSize + 1) / 2) * distanceX,
+ y: center4.y + (depth + 1 - (depthsLen + 1) / 2) * distanceY
+ };
+ return epos;
}
}, "getPosition");
eles.nodes().layoutPositions(this, options3, getPosition);
@@ -112056,8 +117943,8 @@ g.stateGroup line {
}
}
eles.nodes().layoutPositions(this, options3, function(ele) {
- var id27 = ele.id();
- return pos[id27];
+ var id29 = ele.id();
+ return pos[id29];
});
return this;
};
@@ -112187,11 +118074,11 @@ g.stateGroup line {
var loopRet = true;
if (options3.animate === true) {
var frame2 = /* @__PURE__ */ __name(function frame3() {
- var f3 = 0;
- while (loopRet && f3 < options3.refresh) {
+ var f2 = 0;
+ while (loopRet && f2 < options3.refresh) {
loopRet = mainLoop(i2);
i2++;
- f3++;
+ f2++;
}
if (!loopRet) {
separateComponents(layoutInfo, options3);
@@ -112230,7 +118117,7 @@ g.stateGroup line {
return this;
};
createLayoutInfo = /* @__PURE__ */ __name(function createLayoutInfo2(cy, layout6, options3) {
- var edges5 = options3.eles.edges();
+ var edges3 = options3.eles.edges();
var nodes6 = options3.eles.nodes();
var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : {
x1: 0,
@@ -112246,7 +118133,7 @@ g.stateGroup line {
graphSet: [],
indexToGraph: [],
layoutEdges: [],
- edgeSize: edges5.size(),
+ edgeSize: edges3.size(),
temperature: options3.initialTemp,
clientWidth: bb.w,
clientHeight: bb.h,
@@ -112323,7 +118210,7 @@ g.stateGroup line {
}
}
for (var i2 = 0; i2 < layoutInfo.edgeSize; i2++) {
- var e3 = edges5[i2];
+ var e3 = edges3[i2];
var tempEdge = {};
tempEdge.id = e3.data("id");
tempEdge.sourceId = e3.data("source");
@@ -113213,12 +119100,12 @@ g.stateGroup line {
BRp$f.arrowShapeWidth = 0.3;
BRp$f.registerArrowShapes = function() {
var arrowShapes = this.arrowShapes = {};
- var renderer8 = this;
- var bbCollide = /* @__PURE__ */ __name(function bbCollide2(x5, y5, size5, angle2, translation, edgeWidth, padding3) {
- var x1 = translation.x - size5 / 2 - padding3;
- var x22 = translation.x + size5 / 2 + padding3;
- var y1 = translation.y - size5 / 2 - padding3;
- var y22 = translation.y + size5 / 2 + padding3;
+ var renderer9 = this;
+ var bbCollide = /* @__PURE__ */ __name(function bbCollide2(x5, y5, size5, angle2, translation, edgeWidth, padding2) {
+ var x1 = translation.x - size5 / 2 - padding2;
+ var x22 = translation.x + size5 / 2 + padding2;
+ var y1 = translation.y - size5 / 2 - padding2;
+ var y22 = translation.y + size5 / 2 + padding2;
var inside = x1 <= x5 && x5 <= x22 && y1 <= y5 && y5 <= y22;
return inside;
}, "bbCollide");
@@ -113258,18 +119145,18 @@ g.stateGroup line {
if (string(defn)) {
defn = arrowShapes[defn];
}
- arrowShapes[name] = extend2({
+ arrowShapes[name] = extend4({
name,
points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3],
- collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, padding3) {
- var points = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation));
+ collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, padding2) {
+ var points = pointsToArr(transformPoints(this.points, size5 + 2 * padding2, angle2, translation));
var inside = pointInsidePolygonPoints(x5, y5, points);
return inside;
}, "collide"),
roughCollide: bbCollide,
- draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation) {
+ draw: /* @__PURE__ */ __name(function draw25(context, size5, angle2, translation) {
var points = transformPoints(this.points, size5, angle2, translation);
- renderer8.arrowShapeImpl("polygon")(context, points);
+ renderer9.arrowShapeImpl("polygon")(context, points);
}, "draw"),
spacing: /* @__PURE__ */ __name(function spacing2(edge) {
return 0;
@@ -113292,11 +119179,11 @@ g.stateGroup line {
points: arrowShapes["triangle"].points,
controlPoint: [0, -0.15],
roughCollide: bbCollide,
- draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) {
+ draw: /* @__PURE__ */ __name(function draw25(context, size5, angle2, translation, edgeWidth) {
var ptsTrans = transformPoints(this.points, size5, angle2, translation);
var ctrlPt = this.controlPoint;
var ctrlPtTrans = transform8(ctrlPt[0], ctrlPt[1], size5, angle2, translation);
- renderer8.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans);
+ renderer9.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans);
}, "draw"),
gap: /* @__PURE__ */ __name(function gap(edge) {
return standardGap(edge) * 0.8;
@@ -113305,33 +119192,33 @@ g.stateGroup line {
defineArrowShape("triangle-tee", {
points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],
pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4],
- collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding3) {
- var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation));
- var teePts = pointsToArr(transformPoints(this.pointsTee, size5 + 2 * padding3, angle2, translation));
+ collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding2) {
+ var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding2, angle2, translation));
+ var teePts = pointsToArr(transformPoints(this.pointsTee, size5 + 2 * padding2, angle2, translation));
var inside = pointInsidePolygonPoints(x5, y5, triPts) || pointInsidePolygonPoints(x5, y5, teePts);
return inside;
}, "collide"),
- draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) {
+ draw: /* @__PURE__ */ __name(function draw25(context, size5, angle2, translation, edgeWidth) {
var triPts = transformPoints(this.points, size5, angle2, translation);
var teePts = transformPoints(this.pointsTee, size5, angle2, translation);
- renderer8.arrowShapeImpl(this.name)(context, triPts, teePts);
+ renderer9.arrowShapeImpl(this.name)(context, triPts, teePts);
}, "draw")
});
defineArrowShape("circle-triangle", {
radius: 0.15,
pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15],
- collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding3) {
+ collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding2) {
var t4 = translation;
- var circleInside = Math.pow(t4.x - x5, 2) + Math.pow(t4.y - y5, 2) <= Math.pow((size5 + 2 * padding3) * this.radius, 2);
- var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation));
+ var circleInside = Math.pow(t4.x - x5, 2) + Math.pow(t4.y - y5, 2) <= Math.pow((size5 + 2 * padding2) * this.radius, 2);
+ var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding2, angle2, translation));
return pointInsidePolygonPoints(x5, y5, triPts) || circleInside;
}, "collide"),
- draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) {
+ draw: /* @__PURE__ */ __name(function draw25(context, size5, angle2, translation, edgeWidth) {
var triPts = transformPoints(this.pointsTr, size5, angle2, translation);
- renderer8.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size5);
+ renderer9.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size5);
}, "draw"),
spacing: /* @__PURE__ */ __name(function spacing2(edge) {
- return renderer8.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius;
+ return renderer9.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius;
}, "spacing")
});
defineArrowShape("triangle-cross", {
@@ -113357,16 +119244,16 @@ g.stateGroup line {
p3[y1] = p3[y1] - shiftFactor;
return p3;
}, "crossLinePts"),
- collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding3) {
- var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation));
- var teePts = pointsToArr(transformPoints(this.crossLinePts(size5, edgeWidth), size5 + 2 * padding3, angle2, translation));
+ collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding2) {
+ var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding2, angle2, translation));
+ var teePts = pointsToArr(transformPoints(this.crossLinePts(size5, edgeWidth), size5 + 2 * padding2, angle2, translation));
var inside = pointInsidePolygonPoints(x5, y5, triPts) || pointInsidePolygonPoints(x5, y5, teePts);
return inside;
}, "collide"),
- draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) {
+ draw: /* @__PURE__ */ __name(function draw25(context, size5, angle2, translation, edgeWidth) {
var triPts = transformPoints(this.points, size5, angle2, translation);
var crossLinePts = transformPoints(this.crossLinePts(size5, edgeWidth), size5, angle2, translation);
- renderer8.arrowShapeImpl(this.name)(context, triPts, crossLinePts);
+ renderer9.arrowShapeImpl(this.name)(context, triPts, crossLinePts);
}, "draw")
});
defineArrowShape("vee", {
@@ -113377,16 +119264,16 @@ g.stateGroup line {
});
defineArrowShape("circle", {
radius: 0.15,
- collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding3) {
+ collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding2) {
var t4 = translation;
- var inside = Math.pow(t4.x - x5, 2) + Math.pow(t4.y - y5, 2) <= Math.pow((size5 + 2 * padding3) * this.radius, 2);
+ var inside = Math.pow(t4.x - x5, 2) + Math.pow(t4.y - y5, 2) <= Math.pow((size5 + 2 * padding2) * this.radius, 2);
return inside;
}, "collide"),
- draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) {
- renderer8.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size5);
+ draw: /* @__PURE__ */ __name(function draw25(context, size5, angle2, translation, edgeWidth) {
+ renderer9.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size5);
}, "draw"),
spacing: /* @__PURE__ */ __name(function spacing2(edge) {
- return renderer8.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius;
+ return renderer9.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius;
}, "spacing")
});
defineArrowShape("tee", {
@@ -113420,11 +119307,11 @@ g.stateGroup line {
var offsets = this.findContainerClientCoords();
var offsetLeft = offsets[0];
var offsetTop = offsets[1];
- var scale = offsets[4];
+ var scale2 = offsets[4];
var pan2 = cy.pan();
var zoom2 = cy.zoom();
- var x5 = ((clientX - offsetLeft) / scale - pan2.x) / zoom2;
- var y5 = ((clientY - offsetTop) / scale - pan2.y) / zoom2;
+ var x5 = ((clientX - offsetLeft) / scale2 - pan2.x) / zoom2;
+ var y5 = ((clientY - offsetTop) / scale2 - pan2.y) / zoom2;
return [x5, y5];
};
BRp$e.findContainerClientCoords = function() {
@@ -113432,12 +119319,12 @@ g.stateGroup line {
return this.containerBB;
}
var container2 = this.container;
- var rect4 = container2.getBoundingClientRect();
+ var rect3 = container2.getBoundingClientRect();
var style3 = this.cy.window().getComputedStyle(container2);
var styleValue2 = /* @__PURE__ */ __name(function styleValue3(name) {
return parseFloat(style3.getPropertyValue(name));
}, "styleValue");
- var padding3 = {
+ var padding2 = {
left: styleValue2("padding-left"),
right: styleValue2("padding-right"),
top: styleValue2("padding-top"),
@@ -113451,15 +119338,15 @@ g.stateGroup line {
};
var clientWidth = container2.clientWidth;
var clientHeight = container2.clientHeight;
- var paddingHor = padding3.left + padding3.right;
- var paddingVer = padding3.top + padding3.bottom;
+ var paddingHor = padding2.left + padding2.right;
+ var paddingVer = padding2.top + padding2.bottom;
var borderHor = border.left + border.right;
- var scale = rect4.width / (clientWidth + borderHor);
+ var scale2 = rect3.width / (clientWidth + borderHor);
var unscaledW = clientWidth - paddingHor;
var unscaledH = clientHeight - paddingVer;
- var left3 = rect4.left + padding3.left + border.left;
- var top2 = rect4.top + padding3.top + border.top;
- return this.containerBB = [left3, top2, unscaledW, unscaledH, scale];
+ var left3 = rect3.left + padding2.left + border.left;
+ var top2 = rect3.top + padding2.top + border.top;
+ return this.containerBB = [left3, top2, unscaledW, unscaledH, scale2];
};
BRp$e.invalidateContainerClientCoordsCache = function() {
this.containerBB = null;
@@ -113533,7 +119420,7 @@ g.stateGroup line {
var _p = edge._private;
var rs = _p.rscratch;
var styleWidth = edge.pstyle("width").pfValue;
- var scale = edge.pstyle("arrow-scale").value;
+ var scale2 = edge.pstyle("arrow-scale").value;
var width3 = styleWidth / 2 + edgeThreshold;
var widthSq = width3 * width3;
var width22 = width3 * 2;
@@ -113559,7 +119446,7 @@ g.stateGroup line {
}
var src = src || _p.source;
var tgt = tgt || _p.target;
- var arSize = self2.getArrowWidth(styleWidth, scale);
+ var arSize = self2.getArrowWidth(styleWidth, scale2);
var arrows = [{
name: "source",
x: rs.arrowStartX,
@@ -113617,9 +119504,9 @@ g.stateGroup line {
}
ele2.boundingBox();
var bb = _p.labelBounds[prefix || "main"];
- var text2 = ele2.pstyle(prefixDash + "label").value;
+ var text4 = ele2.pstyle(prefixDash + "label").value;
var eventsEnabled = ele2.pstyle("text-events").strValue === "yes";
- if (!eventsEnabled || !text2) {
+ if (!eventsEnabled || !text4) {
return;
}
var lx = preprop(_p.rscratch, "labelX", prefix);
@@ -113634,7 +119521,7 @@ g.stateGroup line {
if (theta) {
var cos3 = Math.cos(theta);
var sin3 = Math.sin(theta);
- var rotate = /* @__PURE__ */ __name(function rotate2(x6, y6) {
+ var rotate2 = /* @__PURE__ */ __name(function rotate3(x6, y6) {
x6 = x6 - lx;
y6 = y6 - ly;
return {
@@ -113642,10 +119529,10 @@ g.stateGroup line {
y: x6 * sin3 + y6 * cos3 + ly
};
}, "rotate");
- var px1y1 = rotate(lx1, ly1);
- var px1y2 = rotate(lx1, ly2);
- var px2y1 = rotate(lx2, ly1);
- var px2y2 = rotate(lx2, ly2);
+ var px1y1 = rotate2(lx1, ly1);
+ var px1y2 = rotate2(lx1, ly2);
+ var px2y1 = rotate2(lx2, ly1);
+ var px2y2 = rotate2(lx2, ly2);
var points = [
// with the margin added after the rotation is applied
px1y1.x + ox,
@@ -113856,14 +119743,14 @@ g.stateGroup line {
}
rs.tgtArrowAngle = getAngleFromDisp(dispX, dispY);
};
- BRp$d.getArrowWidth = BRp$d.getArrowHeight = function(edgeWidth, scale) {
+ BRp$d.getArrowWidth = BRp$d.getArrowHeight = function(edgeWidth, scale2) {
var cache3 = this.arrowWidthCache = this.arrowWidthCache || {};
- var cachedVal = cache3[edgeWidth + ", " + scale];
+ var cachedVal = cache3[edgeWidth + ", " + scale2];
if (cachedVal) {
return cachedVal;
}
- cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale;
- cache3[edgeWidth + ", " + scale] = cachedVal;
+ cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale2;
+ cache3[edgeWidth + ", " + scale2] = cachedVal;
return cachedVal;
};
v1 = {};
@@ -113988,9 +119875,9 @@ g.stateGroup line {
vectorNormInverse
};
};
- BRp$c.findHaystackPoints = function(edges5) {
- for (var i2 = 0; i2 < edges5.length; i2++) {
- var edge = edges5[i2];
+ BRp$c.findHaystackPoints = function(edges3) {
+ for (var i2 = 0; i2 < edges3.length; i2++) {
+ var edge = edges3[i2];
var _p = edge._private;
var rs = _p.rscratch;
if (!rs.haystack) {
@@ -114438,9 +120325,9 @@ g.stateGroup line {
}
}
};
- BRp$c.findEdgeControlPoints = function(edges5) {
+ BRp$c.findEdgeControlPoints = function(edges3) {
var _this = this;
- if (!edges5 || edges5.length === 0) {
+ if (!edges3 || edges3.length === 0) {
return;
}
var r2 = this;
@@ -114467,8 +120354,8 @@ g.stateGroup line {
};
var pairIds = [];
var haystackEdges = [];
- for (var i2 = 0; i2 < edges5.length; i2++) {
- var edge = edges5[i2];
+ for (var i2 = 0; i2 < edges3.length; i2++) {
+ var edge = edges3[i2];
var _p = edge._private;
var curveStyle = edge.pstyle("curve-style").value;
if (edge.removed() || !edge.takesUpSpace()) {
@@ -114596,7 +120483,9 @@ g.stateGroup line {
hasUnbundled: pairInfo.hasUnbundled,
eles: pairInfo.eles,
srcPos: tgtPos,
+ srcRs: tgtRs,
tgtPos: srcPos,
+ tgtRs: srcRs,
srcW: tgtW,
srcH: tgtH,
tgtW: srcW,
@@ -114667,17 +120556,17 @@ g.stateGroup line {
__name(getPts, "getPts");
BRp$c.getSegmentPoints = function(edge) {
var rs = edge[0]._private.rscratch;
+ this.recalculateRenderedStyle(edge);
var type3 = rs.edgeType;
if (type3 === "segments") {
- this.recalculateRenderedStyle(edge);
return getPts(rs.segpts);
}
};
BRp$c.getControlPoints = function(edge) {
var rs = edge[0]._private.rscratch;
+ this.recalculateRenderedStyle(edge);
var type3 = rs.edgeType;
if (type3 === "bezier" || type3 === "multibezier" || type3 === "self" || type3 === "compound") {
- this.recalculateRenderedStyle(edge);
return getPts(rs.ctrlpts);
}
};
@@ -114958,8 +120847,8 @@ g.stateGroup line {
}
_p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.arrowShapeWidth;
};
- BRp$a.recalculateEdgeProjections = function(edges5) {
- this.findEdgeControlPoints(edges5);
+ BRp$a.recalculateEdgeProjections = function(edges3) {
+ this.findEdgeControlPoints(edges3);
};
BRp$9 = {};
BRp$9.recalculateNodeLabelProjection = function(node2) {
@@ -114971,7 +120860,7 @@ g.stateGroup line {
var _p = node2._private;
var nodeWidth = node2.width();
var nodeHeight = node2.height();
- var padding3 = node2.padding();
+ var padding2 = node2.padding();
var nodePos = node2.position();
var textHalign = node2.pstyle("text-halign").strValue;
var textValign = node2.pstyle("text-valign").strValue;
@@ -114979,20 +120868,20 @@ g.stateGroup line {
var rstyle = _p.rstyle;
switch (textHalign) {
case "left":
- textX = nodePos.x - nodeWidth / 2 - padding3;
+ textX = nodePos.x - nodeWidth / 2 - padding2;
break;
case "right":
- textX = nodePos.x + nodeWidth / 2 + padding3;
+ textX = nodePos.x + nodeWidth / 2 + padding2;
break;
default:
textX = nodePos.x;
}
switch (textValign) {
case "top":
- textY = nodePos.y - nodeHeight / 2 - padding3;
+ textY = nodePos.y - nodeHeight / 2 - padding2;
break;
case "bottom":
- textY = nodePos.y + nodeHeight / 2 + padding3;
+ textY = nodePos.y + nodeHeight / 2 + padding2;
break;
default:
textY = nodePos.y;
@@ -115210,8 +121099,8 @@ g.stateGroup line {
};
BRp$9.applyPrefixedLabelDimensions = function(ele, prefix) {
var _p = ele._private;
- var text2 = this.getLabelText(ele, prefix);
- var labelDims = this.calculateLabelDimensions(ele, text2);
+ var text4 = this.getLabelText(ele, prefix);
+ var labelDims = this.calculateLabelDimensions(ele, text4);
var lineHeight = ele.pstyle("line-height").pfValue;
var textWrap = ele.pstyle("text-wrap").strValue;
var lines = getPrefixedProperty(_p.rscratch, "labelWrapCachedLines", prefix) || [];
@@ -115229,7 +121118,7 @@ g.stateGroup line {
BRp$9.getLabelText = function(ele, prefix) {
var _p = ele._private;
var pfd = prefix ? prefix + "-" : "";
- var text2 = ele.pstyle(pfd + "label").strValue;
+ var text4 = ele.pstyle(pfd + "label").strValue;
var textTransform = ele.pstyle("text-transform").value;
var rscratch = /* @__PURE__ */ __name(function rscratch2(propName, value2) {
if (value2) {
@@ -115239,14 +121128,14 @@ g.stateGroup line {
return getPrefixedProperty(_p.rscratch, propName, prefix);
}
}, "rscratch");
- if (!text2) {
+ if (!text4) {
return "";
}
if (textTransform == "none") ;
else if (textTransform == "uppercase") {
- text2 = text2.toUpperCase();
+ text4 = text4.toUpperCase();
} else if (textTransform == "lowercase") {
- text2 = text2.toLowerCase();
+ text4 = text4.toLowerCase();
}
var wrapStyle = ele.pstyle("text-wrap").value;
if (wrapStyle === "wrap") {
@@ -115255,7 +121144,7 @@ g.stateGroup line {
return rscratch("labelWrapCachedText");
}
var zwsp = "\u200B";
- var lines = text2.split("\n");
+ var lines = text4.split("\n");
var maxW = ele.pstyle("text-max-width").pfValue;
var overflow = ele.pstyle("text-overflow-wrap").value;
var overflowAny = overflow === "anywhere";
@@ -115305,23 +121194,23 @@ g.stateGroup line {
}
}
rscratch("labelWrapCachedLines", wrappedLines);
- text2 = rscratch("labelWrapCachedText", wrappedLines.join("\n"));
+ text4 = rscratch("labelWrapCachedText", wrappedLines.join("\n"));
rscratch("labelWrapKey", labelKey);
} else if (wrapStyle === "ellipsis") {
var _maxW = ele.pstyle("text-max-width").pfValue;
var ellipsized = "";
var ellipsis = "\u2026";
var incLastCh = false;
- if (this.calculateLabelDimensions(ele, text2).width < _maxW) {
- return text2;
+ if (this.calculateLabelDimensions(ele, text4).width < _maxW) {
+ return text4;
}
- for (var i2 = 0; i2 < text2.length; i2++) {
- var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text2[i2] + ellipsis).width;
+ for (var i2 = 0; i2 < text4.length; i2++) {
+ var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text4[i2] + ellipsis).width;
if (widthWithNextCh > _maxW) {
break;
}
- ellipsized += text2[i2];
- if (i2 === text2.length - 1) {
+ ellipsized += text4[i2];
+ if (i2 === text4.length - 1) {
incLastCh = true;
}
}
@@ -115330,7 +121219,7 @@ g.stateGroup line {
}
return ellipsized;
}
- return text2;
+ return text4;
};
BRp$9.getLabelJustification = function(ele) {
var justification = ele.pstyle("text-justification").strValue;
@@ -115352,17 +121241,17 @@ g.stateGroup line {
return justification;
}
};
- BRp$9.calculateLabelDimensions = function(ele, text2) {
+ BRp$9.calculateLabelDimensions = function(ele, text4) {
var r2 = this;
var containerWindow = r2.cy.window();
var document2 = containerWindow.document;
- var cacheKey = hashString(text2, ele._private.labelDimsKey);
+ var cacheKey = hashString(text4, ele._private.labelDimsKey);
var cache3 = r2.labelDimCache || (r2.labelDimCache = []);
var existingVal = cache3[cacheKey];
if (existingVal != null) {
return existingVal;
}
- var padding3 = 0;
+ var padding2 = 0;
var fStyle = ele.pstyle("font-style").strValue;
var size5 = ele.pstyle("font-size").pfValue;
var family = ele.pstyle("font-family").strValue;
@@ -115383,7 +121272,7 @@ g.stateGroup line {
c2d.font = "".concat(fStyle, " ").concat(weight8, " ").concat(size5, "px ").concat(family);
var width3 = 0;
var height2 = 0;
- var lines = text2.split("\n");
+ var lines = text4.split("\n");
for (var i2 = 0; i2 < lines.length; i2++) {
var line2 = lines[i2];
var metrics = c2d.measureText(line2);
@@ -115392,8 +121281,8 @@ g.stateGroup line {
width3 = Math.max(w3, width3);
height2 += h2;
}
- width3 += padding3;
- height2 += padding3;
+ width3 += padding2;
+ height2 += padding2;
return cache3[cacheKey] = {
width: width3,
height: height2
@@ -115513,7 +121402,7 @@ g.stateGroup line {
var isCleanConnected = /* @__PURE__ */ __name(function isCleanConnected2(ele2) {
return ele2._private.rstyle.cleanConnected;
}, "isCleanConnected");
- var edges5 = [];
+ var edges3 = [];
var nodes6 = [];
if (this.destroyed) {
return;
@@ -115537,7 +121426,7 @@ g.stateGroup line {
if (_p.group === "nodes") {
nodes6.push(ele);
} else {
- edges5.push(ele);
+ edges3.push(ele);
}
rstyle.clean = true;
}
@@ -115552,9 +121441,9 @@ g.stateGroup line {
_rstyle.nodeW = _ele.pstyle("width").pfValue;
_rstyle.nodeH = _ele.pstyle("height").pfValue;
}
- this.recalculateEdgeProjections(edges5);
- for (var _i3 = 0; _i3 < edges5.length; _i3++) {
- var _ele2 = edges5[_i3];
+ this.recalculateEdgeProjections(edges3);
+ for (var _i3 = 0; _i3 < edges3.length; _i3++) {
+ var _ele2 = edges3[_i3];
var _p3 = _ele2._private;
var _rstyle2 = _p3.rstyle;
var rs = _p3.rscratch;
@@ -115613,7 +121502,7 @@ g.stateGroup line {
};
BRp$5 = {};
[BRp$e, BRp$d, BRp$c, BRp$b, BRp$a, BRp$9, BRp$8, BRp$7, BRp$6].forEach(function(props) {
- extend2(BRp$5, props);
+ extend4(BRp$5, props);
});
BRp$4 = {};
BRp$4.getCachedImage = function(url, crossOrigin, onLoad) {
@@ -115645,6 +121534,17 @@ g.stateGroup line {
BRp$3 = {};
BRp$3.registerBinding = function(target, event3, handler, useCapture) {
var args = Array.prototype.slice.apply(arguments, [1]);
+ if (Array.isArray(target)) {
+ var res = [];
+ for (var i2 = 0; i2 < target.length; i2++) {
+ var t4 = target[i2];
+ if (t4 !== void 0) {
+ var b2 = this.binder(t4);
+ res.push(b2.on.apply(b2, args));
+ }
+ }
+ return res;
+ }
var b2 = this.binder(target);
return b2.on.apply(b2, args);
};
@@ -115701,6 +121601,12 @@ g.stateGroup line {
var isSelected = /* @__PURE__ */ __name(function isSelected2(ele) {
return ele.selected();
}, "isSelected");
+ var getShadowRoot = /* @__PURE__ */ __name(function getShadowRoot2(element3) {
+ var rootNode = element3.getRootNode();
+ if (rootNode && rootNode.nodeType === 11 && rootNode.host !== void 0) {
+ return rootNode;
+ }
+ }, "getShadowRoot");
var triggerEvents = /* @__PURE__ */ __name(function triggerEvents2(target, names, e3, position5) {
if (target == null) {
target = r2.cy;
@@ -115818,9 +121724,9 @@ g.stateGroup line {
return;
}
var nodes6 = parent4.descendants().spawnSelf().merge(parent4).unmerge(node2).unmerge(node2.descendants());
- var edges5 = nodes6.connectedEdges();
+ var edges3 = nodes6.connectedEdges();
if (opts.inDragLayer) {
- edges5.forEach(setInDragLayer);
+ edges3.forEach(setInDragLayer);
nodes6.forEach(setInDragLayer);
}
if (opts.addToList) {
@@ -116065,7 +121971,8 @@ g.stateGroup line {
select[0] = select[2] = pos[0];
select[1] = select[3] = pos[1];
}, "mousedownHandler"), false);
- r2.registerBinding(containerWindow, "mousemove", /* @__PURE__ */ __name(function mousemoveHandler(e3) {
+ var shadowRoot = getShadowRoot(r2.container);
+ r2.registerBinding([containerWindow, shadowRoot], "mousemove", /* @__PURE__ */ __name(function mousemoveHandler(e3) {
var capture = r2.hoverData.capture;
if (!capture && !eventInContainer(e3)) {
return;
@@ -116463,6 +122370,7 @@ g.stateGroup line {
r2.hoverData.dragDelta = [];
r2.hoverData.mdownPos = null;
r2.hoverData.mdownGPos = null;
+ r2.hoverData.which = null;
}, "mouseupHandler"), false);
var wheelHandler = /* @__PURE__ */ __name(function wheelHandler2(e3) {
if (r2.scrollingPage) {
@@ -117394,14 +123302,14 @@ g.stateGroup line {
renderer: this,
name,
points,
- draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) {
+ draw: /* @__PURE__ */ __name(function draw25(context, centerX, centerY, width3, height2, cornerRadius) {
this.renderer.nodeShapeImpl("polygon", context, centerX, centerY, width3, height2, this.points);
}, "draw"),
- intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) {
- return polygonIntersectLine(x5, y5, this.points, nodeX, nodeY, width3 / 2, height2 / 2, padding3);
+ intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding2, cornerRadius) {
+ return polygonIntersectLine(x5, y5, this.points, nodeX, nodeY, width3 / 2, height2 / 2, padding2);
}, "intersectLine"),
- checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) {
- return pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2, [0, -1], padding3);
+ checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding2, width3, height2, centerX, centerY, cornerRadius) {
+ return pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2, [0, -1], padding2);
}, "checkPoint")
};
};
@@ -117409,14 +123317,14 @@ g.stateGroup line {
return this.nodeShapes["ellipse"] = {
renderer: this,
name: "ellipse",
- draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) {
+ draw: /* @__PURE__ */ __name(function draw25(context, centerX, centerY, width3, height2, cornerRadius) {
this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2);
}, "draw"),
- intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) {
- return intersectLineEllipse(x5, y5, nodeX, nodeY, width3 / 2 + padding3, height2 / 2 + padding3);
+ intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding2, cornerRadius) {
+ return intersectLineEllipse(x5, y5, nodeX, nodeY, width3 / 2 + padding2, height2 / 2 + padding2);
}, "intersectLine"),
- checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) {
- return checkInEllipse(x5, y5, width3, height2, centerX, centerY, padding3);
+ checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding2, width3, height2, centerX, centerY, cornerRadius) {
+ return checkInEllipse(x5, y5, width3, height2, centerX, centerY, padding2);
}, "checkPoint")
};
};
@@ -117453,13 +123361,13 @@ g.stateGroup line {
}
return rs[field];
}, "getOrCreateCorners"),
- draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius, rs) {
+ draw: /* @__PURE__ */ __name(function draw25(context, centerX, centerY, width3, height2, cornerRadius, rs) {
this.renderer.nodeShapeImpl("round-polygon", context, centerX, centerY, width3, height2, this.points, this.getOrCreateCorners(centerX, centerY, width3, height2, cornerRadius, rs, "drawCorners"));
}, "draw"),
- intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius, rs) {
- return roundPolygonIntersectLine(x5, y5, this.points, nodeX, nodeY, width3, height2, padding3, this.getOrCreateCorners(nodeX, nodeY, width3, height2, cornerRadius, rs, "corners"));
+ intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding2, cornerRadius, rs) {
+ return roundPolygonIntersectLine(x5, y5, this.points, nodeX, nodeY, width3, height2, padding2, this.getOrCreateCorners(nodeX, nodeY, width3, height2, cornerRadius, rs, "corners"));
}, "intersectLine"),
- checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius, rs) {
+ checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding2, width3, height2, centerX, centerY, cornerRadius, rs) {
return pointInsideRoundPolygon(x5, y5, this.points, centerX, centerY, width3, height2, this.getOrCreateCorners(centerX, centerY, width3, height2, cornerRadius, rs, "corners"));
}, "checkPoint")
};
@@ -117469,34 +123377,34 @@ g.stateGroup line {
renderer: this,
name: "round-rectangle",
points: generateUnitNgonPointsFitToSquare(4, 0),
- draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) {
+ draw: /* @__PURE__ */ __name(function draw25(context, centerX, centerY, width3, height2, cornerRadius) {
this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, this.points, cornerRadius);
}, "draw"),
- intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) {
- return roundRectangleIntersectLine(x5, y5, nodeX, nodeY, width3, height2, padding3, cornerRadius);
+ intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding2, cornerRadius) {
+ return roundRectangleIntersectLine(x5, y5, nodeX, nodeY, width3, height2, padding2, cornerRadius);
}, "intersectLine"),
- checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) {
+ checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding2, width3, height2, centerX, centerY, cornerRadius) {
var halfWidth = width3 / 2;
var halfHeight = height2 / 2;
cornerRadius = cornerRadius === "auto" ? getRoundRectangleRadius(width3, height2) : cornerRadius;
cornerRadius = Math.min(halfWidth, halfHeight, cornerRadius);
var diam = cornerRadius * 2;
- if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - diam, [0, -1], padding3)) {
+ if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - diam, [0, -1], padding2)) {
return true;
}
- if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - diam, height2, [0, -1], padding3)) {
+ if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - diam, height2, [0, -1], padding2)) {
return true;
}
- if (checkInEllipse(x5, y5, diam, diam, centerX - halfWidth + cornerRadius, centerY - halfHeight + cornerRadius, padding3)) {
+ if (checkInEllipse(x5, y5, diam, diam, centerX - halfWidth + cornerRadius, centerY - halfHeight + cornerRadius, padding2)) {
return true;
}
- if (checkInEllipse(x5, y5, diam, diam, centerX + halfWidth - cornerRadius, centerY - halfHeight + cornerRadius, padding3)) {
+ if (checkInEllipse(x5, y5, diam, diam, centerX + halfWidth - cornerRadius, centerY - halfHeight + cornerRadius, padding2)) {
return true;
}
- if (checkInEllipse(x5, y5, diam, diam, centerX + halfWidth - cornerRadius, centerY + halfHeight - cornerRadius, padding3)) {
+ if (checkInEllipse(x5, y5, diam, diam, centerX + halfWidth - cornerRadius, centerY + halfHeight - cornerRadius, padding2)) {
return true;
}
- if (checkInEllipse(x5, y5, diam, diam, centerX - halfWidth + cornerRadius, centerY + halfHeight - cornerRadius, padding3)) {
+ if (checkInEllipse(x5, y5, diam, diam, centerX - halfWidth + cornerRadius, centerY + halfHeight - cornerRadius, padding2)) {
return true;
}
return false;
@@ -117509,7 +123417,7 @@ g.stateGroup line {
name: "cut-rectangle",
cornerLength: getCutRectangleCornerLength(),
points: generateUnitNgonPointsFitToSquare(4, 0),
- draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) {
+ draw: /* @__PURE__ */ __name(function draw25(context, centerX, centerY, width3, height2, cornerRadius) {
this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, null, cornerRadius);
}, "draw"),
generateCutTrianglePts: /* @__PURE__ */ __name(function generateCutTrianglePts(width3, height2, centerX, centerY, cornerRadius) {
@@ -117527,17 +123435,17 @@ g.stateGroup line {
bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl]
};
}, "generateCutTrianglePts"),
- intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) {
- var cPts = this.generateCutTrianglePts(width3 + 2 * padding3, height2 + 2 * padding3, nodeX, nodeY, cornerRadius);
+ intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding2, cornerRadius) {
+ var cPts = this.generateCutTrianglePts(width3 + 2 * padding2, height2 + 2 * padding2, nodeX, nodeY, cornerRadius);
var pts2 = [].concat.apply([], [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4)]);
return polygonIntersectLine(x5, y5, pts2, nodeX, nodeY);
}, "intersectLine"),
- checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) {
+ checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding2, width3, height2, centerX, centerY, cornerRadius) {
var cl = cornerRadius === "auto" ? this.cornerLength : cornerRadius;
- if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - 2 * cl, [0, -1], padding3)) {
+ if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - 2 * cl, [0, -1], padding2)) {
return true;
}
- if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - 2 * cl, height2, [0, -1], padding3)) {
+ if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - 2 * cl, height2, [0, -1], padding2)) {
return true;
}
var cutTrianglePts = this.generateCutTrianglePts(width3, height2, centerX, centerY);
@@ -117550,14 +123458,14 @@ g.stateGroup line {
renderer: this,
name: "barrel",
points: generateUnitNgonPointsFitToSquare(4, 0),
- draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) {
+ draw: /* @__PURE__ */ __name(function draw25(context, centerX, centerY, width3, height2, cornerRadius) {
this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2);
}, "draw"),
- intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) {
+ intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding2, cornerRadius) {
var t03 = 0.15;
var t13 = 0.5;
var t22 = 0.85;
- var bPts = this.generateBarrelBezierPts(width3 + 2 * padding3, height2 + 2 * padding3, nodeX, nodeY);
+ var bPts = this.generateBarrelBezierPts(width3 + 2 * padding2, height2 + 2 * padding2, nodeX, nodeY);
var approximateBarrelCurvePts = /* @__PURE__ */ __name(function approximateBarrelCurvePts2(pts3) {
var m0 = qbezierPtAt({
x: pts3[0],
@@ -117617,14 +123525,14 @@ g.stateGroup line {
pts2.bottomRight.isBottom = true;
return pts2;
}, "generateBarrelBezierPts"),
- checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) {
+ checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding2, width3, height2, centerX, centerY, cornerRadius) {
var curveConstants = getBarrelCurveConstants(width3, height2);
var hOffset = curveConstants.heightOffset;
var wOffset = curveConstants.widthOffset;
- if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - 2 * hOffset, [0, -1], padding3)) {
+ if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - 2 * hOffset, [0, -1], padding2)) {
return true;
}
- if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - 2 * wOffset, height2, [0, -1], padding3)) {
+ if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - 2 * wOffset, height2, [0, -1], padding2)) {
return true;
}
var barrelCurvePts = this.generateBarrelBezierPts(width3, height2, centerX, centerY);
@@ -117678,39 +123586,39 @@ g.stateGroup line {
renderer: this,
name: "bottom-round-rectangle",
points: generateUnitNgonPointsFitToSquare(4, 0),
- draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) {
+ draw: /* @__PURE__ */ __name(function draw25(context, centerX, centerY, width3, height2, cornerRadius) {
this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, this.points, cornerRadius);
}, "draw"),
- intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) {
- var topStartX = nodeX - (width3 / 2 + padding3);
- var topStartY = nodeY - (height2 / 2 + padding3);
+ intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding2, cornerRadius) {
+ var topStartX = nodeX - (width3 / 2 + padding2);
+ var topStartY = nodeY - (height2 / 2 + padding2);
var topEndY = topStartY;
- var topEndX = nodeX + (width3 / 2 + padding3);
+ var topEndX = nodeX + (width3 / 2 + padding2);
var topIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false);
if (topIntersections.length > 0) {
return topIntersections;
}
- return roundRectangleIntersectLine(x5, y5, nodeX, nodeY, width3, height2, padding3, cornerRadius);
+ return roundRectangleIntersectLine(x5, y5, nodeX, nodeY, width3, height2, padding2, cornerRadius);
}, "intersectLine"),
- checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) {
+ checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding2, width3, height2, centerX, centerY, cornerRadius) {
cornerRadius = cornerRadius === "auto" ? getRoundRectangleRadius(width3, height2) : cornerRadius;
var diam = 2 * cornerRadius;
- if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - diam, [0, -1], padding3)) {
+ if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - diam, [0, -1], padding2)) {
return true;
}
- if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - diam, height2, [0, -1], padding3)) {
+ if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - diam, height2, [0, -1], padding2)) {
return true;
}
- var outerWidth = width3 / 2 + 2 * padding3;
- var outerHeight = height2 / 2 + 2 * padding3;
+ var outerWidth = width3 / 2 + 2 * padding2;
+ var outerHeight = height2 / 2 + 2 * padding2;
var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight];
if (pointInsidePolygonPoints(x5, y5, points)) {
return true;
}
- if (checkInEllipse(x5, y5, diam, diam, centerX + width3 / 2 - cornerRadius, centerY + height2 / 2 - cornerRadius, padding3)) {
+ if (checkInEllipse(x5, y5, diam, diam, centerX + width3 / 2 - cornerRadius, centerY + height2 / 2 - cornerRadius, padding2)) {
return true;
}
- if (checkInEllipse(x5, y5, diam, diam, centerX - width3 / 2 + cornerRadius, centerY + height2 / 2 - cornerRadius, padding3)) {
+ if (checkInEllipse(x5, y5, diam, diam, centerX - width3 / 2 + cornerRadius, centerY + height2 / 2 - cornerRadius, padding2)) {
return true;
}
return false;
@@ -117719,7 +123627,7 @@ g.stateGroup line {
};
BRp$2.registerNodeShapes = function() {
var nodeShapes = this.nodeShapes = {};
- var renderer8 = this;
+ var renderer9 = this;
this.generateEllipse();
this.generatePolygon("triangle", generateUnitNgonPointsFitToSquare(3, 0));
this.generateRoundPolygon("round-triangle", generateUnitNgonPointsFitToSquare(3, 0));
@@ -117777,7 +123685,7 @@ g.stateGroup line {
if (shape = this[name]) {
return shape;
}
- return renderer8.generatePolygon(name, points);
+ return renderer9.generatePolygon(name, points);
};
};
BRp$1 = {};
@@ -117922,6 +123830,7 @@ g.stateGroup line {
r2.redraws = 0;
r2.showFps = options3.showFps;
r2.debug = options3.debug;
+ r2.webgl = options3.webgl;
r2.hideEdgesOnViewport = options3.hideEdgesOnViewport;
r2.textureOnViewport = options3.textureOnViewport;
r2.wheelSensitivity = options3.wheelSensitivity;
@@ -117974,6 +123883,9 @@ g.stateGroup line {
if (eventName === "viewport") {
r2.redrawHint("select", true);
}
+ if (eventName === "gc") {
+ r2.redrawHint("gc", true);
+ }
if (eventName === "load" || eventName === "resize" || eventName === "mount") {
r2.invalidateContainerClientCoordsCache();
r2.matchCanvasSize(r2.container);
@@ -118016,7 +123928,7 @@ g.stateGroup line {
return false;
};
[BRp$f, BRp$5, BRp$4, BRp$3, BRp$2, BRp$1].forEach(function(props) {
- extend2(BRp, props);
+ extend4(BRp, props);
});
fullFpsTime = 1e3 / 60;
defs = {
@@ -118111,16 +124023,16 @@ g.stateGroup line {
}, "getIdsFor")
}, {
key: "addIdForKey",
- value: /* @__PURE__ */ __name(function addIdForKey(key, id27) {
+ value: /* @__PURE__ */ __name(function addIdForKey(key, id29) {
if (key != null) {
- this.getIdsFor(key).add(id27);
+ this.getIdsFor(key).add(id29);
}
}, "addIdForKey")
}, {
key: "deleteIdForKey",
- value: /* @__PURE__ */ __name(function deleteIdForKey(key, id27) {
+ value: /* @__PURE__ */ __name(function deleteIdForKey(key, id29) {
if (key != null) {
- this.getIdsFor(key)["delete"](id27);
+ this.getIdsFor(key)["delete"](id29);
}
}, "deleteIdForKey")
}, {
@@ -118135,26 +124047,26 @@ g.stateGroup line {
}, {
key: "updateKeyMappingFor",
value: /* @__PURE__ */ __name(function updateKeyMappingFor(ele) {
- var id27 = ele.id();
- var prevKey = this.keyForId.get(id27);
+ var id29 = ele.id();
+ var prevKey = this.keyForId.get(id29);
var currKey = this.getKey(ele);
- this.deleteIdForKey(prevKey, id27);
- this.addIdForKey(currKey, id27);
- this.keyForId.set(id27, currKey);
+ this.deleteIdForKey(prevKey, id29);
+ this.addIdForKey(currKey, id29);
+ this.keyForId.set(id29, currKey);
}, "updateKeyMappingFor")
}, {
key: "deleteKeyMappingFor",
value: /* @__PURE__ */ __name(function deleteKeyMappingFor(ele) {
- var id27 = ele.id();
- var prevKey = this.keyForId.get(id27);
- this.deleteIdForKey(prevKey, id27);
- this.keyForId["delete"](id27);
+ var id29 = ele.id();
+ var prevKey = this.keyForId.get(id29);
+ this.deleteIdForKey(prevKey, id29);
+ this.keyForId["delete"](id29);
}, "deleteKeyMappingFor")
}, {
key: "keyHasChangedFor",
value: /* @__PURE__ */ __name(function keyHasChangedFor(ele) {
- var id27 = ele.id();
- var prevKey = this.keyForId.get(id27);
+ var id29 = ele.id();
+ var prevKey = this.keyForId.get(id29);
var newKey = this.getKey(ele);
return prevKey !== newKey;
}, "keyHasChangedFor")
@@ -118244,8 +124156,8 @@ g.stateGroup line {
}, {
key: "invalidate",
value: /* @__PURE__ */ __name(function invalidate(ele) {
- var id27 = ele.id();
- var key = this.keyForId.get(id27);
+ var id29 = ele.id();
+ var key = this.keyForId.get(id29);
this.deleteKeyMappingFor(ele);
var entireKeyInvalidated = this.doesEleInvalidateKey(ele);
if (entireKeyInvalidated) {
@@ -118290,12 +124202,12 @@ g.stateGroup line {
allowEdgeTxrCaching: true,
allowParentTxrCaching: true
});
- ElementTextureCache = /* @__PURE__ */ __name(function ElementTextureCache2(renderer8, initOptions) {
+ ElementTextureCache = /* @__PURE__ */ __name(function ElementTextureCache2(renderer9, initOptions) {
var self2 = this;
- self2.renderer = renderer8;
+ self2.renderer = renderer9;
self2.onDequeues = [];
var opts = initDefaults(initOptions);
- extend2(self2, opts);
+ extend4(self2, opts);
self2.lookup = new ElementTextureCacheLookup(opts.getKey, opts.doesEleInvalidateKey);
self2.setupDequeueing();
}, "ElementTextureCache");
@@ -118343,10 +124255,10 @@ g.stateGroup line {
} else if (zoom2 >= maxZoom$1 || lvl > maxLvl$1) {
return null;
}
- var scale = Math.pow(2, lvl);
- var eleScaledH = bb.h * scale;
- var eleScaledW = bb.w * scale;
- var scaledLabelShown = r2.eleTextBiggerThanMin(ele, scale);
+ var scale2 = Math.pow(2, lvl);
+ var eleScaledH = bb.h * scale2;
+ var eleScaledW = bb.w * scale2;
+ var scaledLabelShown = r2.eleTextBiggerThanMin(ele, scale2);
if (!this.isVisible(ele, scaledLabelShown)) {
return null;
}
@@ -118431,16 +124343,16 @@ g.stateGroup line {
return lowerCache;
}
txr.context.translate(txr.usedWidth, 0);
- txr.context.scale(scale, scale);
+ txr.context.scale(scale2, scale2);
this.drawElement(txr.context, ele, bb, scaledLabelShown, false);
- txr.context.scale(1 / scale, 1 / scale);
+ txr.context.scale(1 / scale2, 1 / scale2);
txr.context.translate(-txr.usedWidth, 0);
}
eleCache = {
x: txr.usedWidth,
texture: txr,
level: lvl,
- scale,
+ scale: scale2,
width: eleScaledW,
height: eleScaledH,
scaledLabelShown
@@ -118661,10 +124573,11 @@ g.stateGroup line {
maxDeqSize = 1;
invalidThreshold = 250;
maxLayerArea = 4e3 * 4e3;
+ maxLayerDim = 32767;
useHighQualityEleTxrReqs = true;
- LayeredTextureCache = /* @__PURE__ */ __name(function LayeredTextureCache2(renderer8) {
+ LayeredTextureCache = /* @__PURE__ */ __name(function LayeredTextureCache2(renderer9) {
var self2 = this;
- var r2 = self2.renderer = renderer8;
+ var r2 = self2.renderer = renderer9;
var cy = r2.cy;
self2.layersByLevel = {};
self2.firstGet = true;
@@ -118692,9 +124605,9 @@ g.stateGroup line {
layerIdPool = 0;
MAX_INT = Math.pow(2, 53) - 1;
LTCp.makeLayer = function(bb, lvl) {
- var scale = Math.pow(2, lvl);
- var w3 = Math.ceil(bb.w * scale);
- var h2 = Math.ceil(bb.h * scale);
+ var scale2 = Math.pow(2, lvl);
+ var w3 = Math.ceil(bb.w * scale2);
+ var h2 = Math.ceil(bb.h * scale2);
var canvas = this.renderer.makeOffscreenCanvas(w3, h2);
var layer = {
id: layerIdPool = ++layerIdPool % MAX_INT,
@@ -118711,7 +124624,7 @@ g.stateGroup line {
var cxt = layer.context;
var dx = -layer.bb.x1;
var dy = -layer.bb.y1;
- cxt.scale(scale, scale);
+ cxt.scale(scale2, scale2);
cxt.translate(dx, dy);
return layer;
};
@@ -118732,7 +124645,7 @@ g.stateGroup line {
}
self2.validateLayersElesOrdering(lvl, eles);
var layersByLvl = self2.layersByLevel;
- var scale = Math.pow(2, lvl);
+ var scale2 = Math.pow(2, lvl);
var layers = layersByLvl[lvl] = layersByLvl[lvl] || [];
var bb;
var lvlComplete = self2.levelIsComplete(lvl, eles);
@@ -118782,7 +124695,12 @@ g.stateGroup line {
opts = opts || {};
var after = opts.after;
getBb();
- var area = bb.w * scale * (bb.h * scale);
+ var w3 = Math.ceil(bb.w * scale2);
+ var h2 = Math.ceil(bb.h * scale2);
+ if (w3 > maxLayerDim || h2 > maxLayerDim) {
+ return null;
+ }
+ var area = w3 * h2;
if (area > maxLayerArea) {
return null;
}
@@ -119095,24 +125013,24 @@ g.stateGroup line {
return self2.renderer.beforeRenderPriorities.lyrTxrDeq;
}, "priority")
});
- CRp$a = {};
+ CRp$b = {};
__name(polygon, "polygon");
__name(triangleBackcurve, "triangleBackcurve");
__name(triangleTee, "triangleTee");
__name(circleTriangle, "circleTriangle");
- __name(circle5, "circle");
- CRp$a.arrowShapeImpl = function(name) {
+ __name(circle3, "circle");
+ CRp$b.arrowShapeImpl = function(name) {
return (impl || (impl = {
"polygon": polygon,
"triangle-backcurve": triangleBackcurve,
"triangle-tee": triangleTee,
"circle-triangle": circleTriangle,
"triangle-cross": triangleTee,
- "circle": circle5
+ "circle": circle3
}))[name];
};
- CRp$9 = {};
- CRp$9.drawElement = function(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity) {
+ CRp$a = {};
+ CRp$a.drawElement = function(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity) {
var r2 = this;
if (ele.isNode()) {
r2.drawNode(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity);
@@ -119120,7 +125038,7 @@ g.stateGroup line {
r2.drawEdge(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity);
}
};
- CRp$9.drawElementOverlay = function(context, ele) {
+ CRp$a.drawElementOverlay = function(context, ele) {
var r2 = this;
if (ele.isNode()) {
r2.drawNodeOverlay(context, ele);
@@ -119128,7 +125046,7 @@ g.stateGroup line {
r2.drawEdgeOverlay(context, ele);
}
};
- CRp$9.drawElementUnderlay = function(context, ele) {
+ CRp$a.drawElementUnderlay = function(context, ele) {
var r2 = this;
if (ele.isNode()) {
r2.drawNodeUnderlay(context, ele);
@@ -119136,7 +125054,7 @@ g.stateGroup line {
r2.drawEdgeUnderlay(context, ele);
}
};
- CRp$9.drawCachedElementPortion = function(context, ele, eleTxrCache, pxRatio, lvl, reason, getRotation, getOpacity3) {
+ CRp$a.drawCachedElementPortion = function(context, ele, eleTxrCache, pxRatio, lvl, reason, getRotation, getOpacity3) {
var r2 = this;
var bb = eleTxrCache.getBoundingBox(ele);
if (bb.w === 0 || bb.h === 0) {
@@ -119206,7 +125124,7 @@ g.stateGroup line {
getTextOpacity = /* @__PURE__ */ __name(function getTextOpacity2(e3, ele) {
return ele.pstyle("text-opacity").pfValue * ele.effectiveOpacity();
}, "getTextOpacity");
- CRp$9.drawCachedElement = function(context, ele, pxRatio, extent2, lvl, requestHighQuality) {
+ CRp$a.drawCachedElement = function(context, ele, pxRatio, extent2, lvl, requestHighQuality) {
var r2 = this;
var _r$data = r2.data, eleTxrCache = _r$data.eleTxrCache, lblTxrCache = _r$data.lblTxrCache, slbTxrCache = _r$data.slbTxrCache, tlbTxrCache = _r$data.tlbTxrCache;
var bb = ele.boundingBox();
@@ -119229,21 +125147,21 @@ g.stateGroup line {
r2.drawElementOverlay(context, ele);
}
};
- CRp$9.drawElements = function(context, eles) {
+ CRp$a.drawElements = function(context, eles) {
var r2 = this;
for (var i2 = 0; i2 < eles.length; i2++) {
var ele = eles[i2];
r2.drawElement(context, ele);
}
};
- CRp$9.drawCachedElements = function(context, eles, pxRatio, extent2) {
+ CRp$a.drawCachedElements = function(context, eles, pxRatio, extent2) {
var r2 = this;
for (var i2 = 0; i2 < eles.length; i2++) {
var ele = eles[i2];
r2.drawCachedElement(context, ele, pxRatio, extent2);
}
};
- CRp$9.drawCachedNodes = function(context, eles, pxRatio, extent2) {
+ CRp$a.drawCachedNodes = function(context, eles, pxRatio, extent2) {
var r2 = this;
for (var i2 = 0; i2 < eles.length; i2++) {
var ele = eles[i2];
@@ -119253,7 +125171,7 @@ g.stateGroup line {
r2.drawCachedElement(context, ele, pxRatio, extent2);
}
};
- CRp$9.drawLayeredElements = function(context, eles, pxRatio, extent2) {
+ CRp$a.drawLayeredElements = function(context, eles, pxRatio, extent2) {
var r2 = this;
var layers = r2.data.lyrTxrCache.getLayers(eles, pxRatio);
if (layers) {
@@ -119269,8 +125187,8 @@ g.stateGroup line {
r2.drawCachedElements(context, eles, pxRatio, extent2);
}
};
- CRp$8 = {};
- CRp$8.drawEdge = function(context, edge, shiftToOriginWithBb) {
+ CRp$9 = {};
+ CRp$9.drawEdge = function(context, edge, shiftToOriginWithBb) {
var drawLabel4 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
var shouldDrawOverlay = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
var shouldDrawOpacity = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
@@ -119384,8 +125302,8 @@ g.stateGroup line {
var r2 = this;
var usePaths = r2.usePaths();
var rs = edge._private.rscratch;
- var padding3 = edge.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue;
- var width3 = 2 * padding3;
+ var padding2 = edge.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue;
+ var width3 = 2 * padding2;
var color2 = edge.pstyle("".concat(overlayOrUnderlay, "-color")).value;
context.lineWidth = width3;
if (rs.edgeType === "self" && !usePaths) {
@@ -119397,9 +125315,9 @@ g.stateGroup line {
r2.drawEdgePath(edge, context, rs.allpts, "solid");
};
}, "drawEdgeOverlayUnderlay");
- CRp$8.drawEdgeOverlay = drawEdgeOverlayUnderlay("overlay");
- CRp$8.drawEdgeUnderlay = drawEdgeOverlayUnderlay("underlay");
- CRp$8.drawEdgePath = function(edge, context, pts2, type3) {
+ CRp$9.drawEdgeOverlay = drawEdgeOverlayUnderlay("overlay");
+ CRp$9.drawEdgeUnderlay = drawEdgeOverlayUnderlay("underlay");
+ CRp$9.drawEdgePath = function(edge, context, pts2, type3) {
var rs = edge._private.rscratch;
var canvasCxt = context;
var path4;
@@ -119485,7 +125403,7 @@ g.stateGroup line {
context.setLineDash([]);
}
};
- CRp$8.drawEdgeTrianglePath = function(edge, context, pts2) {
+ CRp$9.drawEdgeTrianglePath = function(edge, context, pts2) {
context.fillStyle = context.strokeStyle;
var edgeWidth = edge.pstyle("width").pfValue;
for (var i2 = 0; i2 + 1 < pts2.length; i2 += 2) {
@@ -119501,7 +125419,7 @@ g.stateGroup line {
context.fill();
}
};
- CRp$8.drawArrowheads = function(context, edge, opacity) {
+ CRp$9.drawArrowheads = function(context, edge, opacity) {
var rs = edge._private.rscratch;
var isHaystack = rs.edgeType === "haystack";
if (!isHaystack) {
@@ -119513,7 +125431,7 @@ g.stateGroup line {
this.drawArrowhead(context, edge, "target", rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity);
}
};
- CRp$8.drawArrowhead = function(context, edge, prefix, x5, y5, angle2, opacity) {
+ CRp$9.drawArrowhead = function(context, edge, prefix, x5, y5, angle2, opacity) {
if (isNaN(x5) || x5 == null || isNaN(y5) || y5 == null || isNaN(angle2) || angle2 == null) {
return;
}
@@ -119545,7 +125463,7 @@ g.stateGroup line {
self2.colorStrokeStyle(context, color2[0], color2[1], color2[2], opacity);
self2.drawArrowShape(edge, context, arrowFill, edgeWidth, arrowShape, arrowWidth, x5, y5, angle2);
};
- CRp$8.drawArrowShape = function(edge, context, fill, edgeWidth, shape, shapeWidth, x5, y5, angle2) {
+ CRp$9.drawArrowShape = function(edge, context, fill, edgeWidth, shape, shapeWidth, x5, y5, angle2) {
var r2 = this;
var usePaths = this.usePaths() && shape !== "triangle-cross";
var pathCacheHit = false;
@@ -119555,8 +125473,8 @@ g.stateGroup line {
x: x5,
y: y5
};
- var scale = edge.pstyle("arrow-scale").value;
- var size5 = this.getArrowWidth(edgeWidth, scale);
+ var scale2 = edge.pstyle("arrow-scale").value;
+ var size5 = this.getArrowWidth(edgeWidth, scale2);
var shapeImpl = r2.arrowShapes[shape];
if (usePaths) {
var cache3 = r2.arrowPathCache = r2.arrowPathCache || [];
@@ -119614,8 +125532,8 @@ g.stateGroup line {
context.translate(-x5, -y5);
}
};
- CRp$7 = {};
- CRp$7.safeDrawImage = function(context, img, ix, iy, iw, ih, x5, y5, w3, h2) {
+ CRp$8 = {};
+ CRp$8.safeDrawImage = function(context, img, ix, iy, iw, ih, x5, y5, w3, h2) {
if (iw <= 0 || ih <= 0 || w3 <= 0 || h2 <= 0) {
return;
}
@@ -119625,7 +125543,7 @@ g.stateGroup line {
warn(e3);
}
};
- CRp$7.drawInscribedImage = function(context, img, node2, index, nodeOpacity) {
+ CRp$8.drawInscribedImage = function(context, img, node2, index, nodeOpacity) {
var r2 = this;
var pos = node2.position();
var nodeX = pos.x;
@@ -119674,13 +125592,13 @@ g.stateGroup line {
return;
}
if (fit2 === "contain") {
- var scale = Math.min(nodeTW / w3, nodeTH / h2);
- w3 *= scale;
- h2 *= scale;
+ var scale2 = Math.min(nodeTW / w3, nodeTH / h2);
+ w3 *= scale2;
+ h2 *= scale2;
} else if (fit2 === "cover") {
- var scale = Math.max(nodeTW / w3, nodeTH / h2);
- w3 *= scale;
- h2 *= scale;
+ var scale2 = Math.max(nodeTW / w3, nodeTH / h2);
+ w3 *= scale2;
+ h2 *= scale2;
}
var x5 = nodeX - nodeTW / 2;
var posXUnits = getIndexedStyle(node2, "background-position-x", "units", index);
@@ -119756,22 +125674,22 @@ g.stateGroup line {
r2.setImgSmoothing(context, smoothingEnabled);
}
};
- CRp$6 = {};
- CRp$6.eleTextBiggerThanMin = function(ele, scale) {
- if (!scale) {
+ CRp$7 = {};
+ CRp$7.eleTextBiggerThanMin = function(ele, scale2) {
+ if (!scale2) {
var zoom2 = ele.cy().zoom();
var pxRatio = this.getPixelRatio();
var lvl = Math.ceil(log22(zoom2 * pxRatio));
- scale = Math.pow(2, lvl);
+ scale2 = Math.pow(2, lvl);
}
- var computedSize = ele.pstyle("font-size").pfValue * scale;
+ var computedSize = ele.pstyle("font-size").pfValue * scale2;
var minSize = ele.pstyle("min-zoomed-font-size").pfValue;
if (computedSize < minSize) {
return false;
}
return true;
};
- CRp$6.drawElementText = function(context, ele, shiftToOriginWithBb, force, prefix) {
+ CRp$7.drawElementText = function(context, ele, shiftToOriginWithBb, force, prefix) {
var useEleOpacity = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
var r2 = this;
if (force == null) {
@@ -119819,7 +125737,7 @@ g.stateGroup line {
context.translate(bb.x1, bb.y1);
}
};
- CRp$6.getFontCache = function(context) {
+ CRp$7.getFontCache = function(context) {
var cache3;
this.fontCaches = this.fontCaches || [];
for (var i2 = 0; i2 < this.fontCaches.length; i2++) {
@@ -119834,7 +125752,7 @@ g.stateGroup line {
this.fontCaches.push(cache3);
return cache3;
};
- CRp$6.setupTextStyle = function(context, ele) {
+ CRp$7.setupTextStyle = function(context, ele) {
var useEleOpacity = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
var labelStyle = ele.pstyle("font-style").strValue;
var labelSize = ele.pstyle("font-size").pfValue + "px";
@@ -119850,14 +125768,14 @@ g.stateGroup line {
this.colorStrokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity);
};
__name(roundRect, "roundRect");
- CRp$6.getTextAngle = function(ele, prefix) {
+ CRp$7.getTextAngle = function(ele, prefix) {
var theta;
var _p = ele._private;
var rscratch = _p.rscratch;
var pdash = prefix ? prefix + "-" : "";
var rotation = ele.pstyle(pdash + "text-rotation");
- var textAngle = getPrefixedProperty(rscratch, "labelAngle", prefix);
if (rotation.strValue === "autorotate") {
+ var textAngle = getPrefixedProperty(rscratch, "labelAngle", prefix);
theta = ele.isEdge() ? textAngle : 0;
} else if (rotation.strValue === "none") {
theta = 0;
@@ -119866,7 +125784,7 @@ g.stateGroup line {
}
return theta;
};
- CRp$6.drawText = function(context, ele, prefix) {
+ CRp$7.drawText = function(context, ele, prefix) {
var applyRotation = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
var useEleOpacity = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
var _p = ele._private;
@@ -119881,8 +125799,8 @@ g.stateGroup line {
var textX = getPrefixedProperty(rscratch, "labelX", prefix);
var textY = getPrefixedProperty(rscratch, "labelY", prefix);
var orgTextX, orgTextY;
- var text2 = this.getLabelText(ele, prefix);
- if (text2 != null && text2 !== "" && !isNaN(textX) && !isNaN(textY)) {
+ var text4 = this.getLabelText(ele, prefix);
+ if (text4 != null && text4 !== "" && !isNaN(textX) && !isNaN(textY)) {
this.setupTextStyle(context, ele, useEleOpacity);
var pdash = prefix ? prefix + "-" : "";
var textW = getPrefixedProperty(rscratch, "labelWidth", prefix);
@@ -120044,9 +125962,9 @@ g.stateGroup line {
}
} else {
if (lineWidth > 0) {
- context.strokeText(text2, textX, textY);
+ context.strokeText(text4, textX, textY);
}
- context.fillText(text2, textX, textY);
+ context.fillText(text4, textX, textY);
}
if (theta !== 0) {
context.rotate(-theta);
@@ -120054,8 +125972,8 @@ g.stateGroup line {
}
}
};
- CRp$5 = {};
- CRp$5.drawNode = function(context, node2, shiftToOriginWithBb) {
+ CRp$6 = {};
+ CRp$6.drawNode = function(context, node2, shiftToOriginWithBb) {
var drawLabel4 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
var shouldDrawOverlay = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
var shouldDrawOpacity = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
@@ -120074,9 +125992,9 @@ g.stateGroup line {
var usePaths = r2.usePaths();
var path4;
var pathCacheHit = false;
- var padding3 = node2.padding();
- nodeWidth = node2.width() + 2 * padding3;
- nodeHeight = node2.height() + 2 * padding3;
+ var padding2 = node2.padding();
+ nodeWidth = node2.width() + 2 * padding2;
+ nodeHeight = node2.height() + 2 * padding2;
var bb;
if (shiftToOriginWithBb) {
bb = shiftToOriginWithBb;
@@ -120471,7 +126389,7 @@ g.stateGroup line {
if (!node2.visible()) {
return;
}
- var padding3 = node2.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue;
+ var padding2 = node2.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue;
var opacity = node2.pstyle("".concat(overlayOrUnderlay, "-opacity")).value;
var color2 = node2.pstyle("".concat(overlayOrUnderlay, "-color")).value;
var shape = node2.pstyle("".concat(overlayOrUnderlay, "-shape")).value;
@@ -120484,18 +126402,18 @@ g.stateGroup line {
nodeHeight = node2.height() + 2 * _padding;
}
r2.colorFillStyle(context, color2[0], color2[1], color2[2], opacity);
- r2.nodeShapes[shape].draw(context, pos.x, pos.y, nodeWidth + padding3 * 2, nodeHeight + padding3 * 2, radius2);
+ r2.nodeShapes[shape].draw(context, pos.x, pos.y, nodeWidth + padding2 * 2, nodeHeight + padding2 * 2, radius2);
context.fill();
}
};
}, "drawNodeOverlayUnderlay");
- CRp$5.drawNodeOverlay = drawNodeOverlayUnderlay("overlay");
- CRp$5.drawNodeUnderlay = drawNodeOverlayUnderlay("underlay");
- CRp$5.hasPie = function(node2) {
+ CRp$6.drawNodeOverlay = drawNodeOverlayUnderlay("overlay");
+ CRp$6.drawNodeUnderlay = drawNodeOverlayUnderlay("underlay");
+ CRp$6.hasPie = function(node2) {
node2 = node2[0];
return node2._private.hasPie;
};
- CRp$5.drawPie = function(context, node2, nodeOpacity, pos) {
+ CRp$6.drawPie = function(context, node2, nodeOpacity, pos) {
node2 = node2[0];
pos = pos || node2.position();
var cyStyle = node2.cy().style();
@@ -120539,9 +126457,9 @@ g.stateGroup line {
lastPercent += percent;
}
};
- CRp$4 = {};
+ CRp$5 = {};
motionBlurDelay = 100;
- CRp$4.getPixelRatio = function() {
+ CRp$5.getPixelRatio = function() {
var context = this.data.contexts[0];
if (this.forcedPixelRatio != null) {
return this.forcedPixelRatio;
@@ -120550,7 +126468,7 @@ g.stateGroup line {
var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
return (containerWindow.devicePixelRatio || 1) / backingStore;
};
- CRp$4.paintCache = function(context) {
+ CRp$5.paintCache = function(context) {
var caches = this.paintCaches = this.paintCaches || [];
var needToCreateCache = true;
var cache3;
@@ -120569,7 +126487,7 @@ g.stateGroup line {
}
return cache3;
};
- CRp$4.createGradientStyleFor = function(context, shapeStyleName, ele, fill, opacity) {
+ CRp$5.createGradientStyleFor = function(context, shapeStyleName, ele, fill, opacity) {
var gradientStyle;
var usePaths = this.usePaths();
var colors2 = ele.pstyle(shapeStyleName + "-gradient-stop-colors").value, positions2 = ele.pstyle(shapeStyleName + "-gradient-stop-positions").pfValue;
@@ -120595,8 +126513,8 @@ g.stateGroup line {
x: 0,
y: 0
} : ele.position(), _width = ele.paddedWidth(), _height = ele.paddedHeight(), halfWidth = _width / 2, halfHeight = _height / 2;
- var direction4 = ele.pstyle("background-gradient-direction").value;
- switch (direction4) {
+ var direction = ele.pstyle("background-gradient-direction").value;
+ switch (direction) {
case "to-bottom":
gradientStyle = context.createLinearGradient(_pos.x, _pos.y - halfHeight, _pos.x, _pos.y + halfHeight);
break;
@@ -120636,15 +126554,15 @@ g.stateGroup line {
}
return gradientStyle;
};
- CRp$4.gradientFillStyle = function(context, ele, fill, opacity) {
+ CRp$5.gradientFillStyle = function(context, ele, fill, opacity) {
var gradientStyle = this.createGradientStyleFor(context, "background", ele, fill, opacity);
if (!gradientStyle) return null;
context.fillStyle = gradientStyle;
};
- CRp$4.colorFillStyle = function(context, r2, g2, b2, a2) {
+ CRp$5.colorFillStyle = function(context, r2, g2, b2, a2) {
context.fillStyle = "rgba(" + r2 + "," + g2 + "," + b2 + "," + a2 + ")";
};
- CRp$4.eleFillStyle = function(context, ele, opacity) {
+ CRp$5.eleFillStyle = function(context, ele, opacity) {
var backgroundFill = ele.pstyle("background-fill").value;
if (backgroundFill === "linear-gradient" || backgroundFill === "radial-gradient") {
this.gradientFillStyle(context, ele, backgroundFill, opacity);
@@ -120653,15 +126571,15 @@ g.stateGroup line {
this.colorFillStyle(context, backgroundColor[0], backgroundColor[1], backgroundColor[2], opacity);
}
};
- CRp$4.gradientStrokeStyle = function(context, ele, fill, opacity) {
+ CRp$5.gradientStrokeStyle = function(context, ele, fill, opacity) {
var gradientStyle = this.createGradientStyleFor(context, "line", ele, fill, opacity);
if (!gradientStyle) return null;
context.strokeStyle = gradientStyle;
};
- CRp$4.colorStrokeStyle = function(context, r2, g2, b2, a2) {
+ CRp$5.colorStrokeStyle = function(context, r2, g2, b2, a2) {
context.strokeStyle = "rgba(" + r2 + "," + g2 + "," + b2 + "," + a2 + ")";
};
- CRp$4.eleStrokeStyle = function(context, ele, opacity) {
+ CRp$5.eleStrokeStyle = function(context, ele, opacity) {
var lineFill = ele.pstyle("line-fill").value;
if (lineFill === "linear-gradient" || lineFill === "radial-gradient") {
this.gradientStrokeStyle(context, ele, lineFill, opacity);
@@ -120670,9 +126588,9 @@ g.stateGroup line {
this.colorStrokeStyle(context, lineColor[0], lineColor[1], lineColor[2], opacity);
}
};
- CRp$4.matchCanvasSize = function(container2) {
+ CRp$5.matchCanvasSize = function(container2) {
var r2 = this;
- var data5 = r2.data;
+ var data6 = r2.data;
var bb = r2.findContainerClientCoords();
var width3 = bb[2];
var height2 = bb[3];
@@ -120688,18 +126606,18 @@ g.stateGroup line {
return;
}
r2.fontCaches = null;
- var canvasContainer = data5.canvasContainer;
+ var canvasContainer = data6.canvasContainer;
canvasContainer.style.width = width3 + "px";
canvasContainer.style.height = height2 + "px";
for (var i2 = 0; i2 < r2.CANVAS_LAYERS; i2++) {
- canvas = data5.canvases[i2];
+ canvas = data6.canvases[i2];
canvas.width = canvasWidth;
canvas.height = canvasHeight;
canvas.style.width = width3 + "px";
canvas.style.height = height2 + "px";
}
for (var i2 = 0; i2 < r2.BUFFER_COUNT; i2++) {
- canvas = data5.bufferCanvases[i2];
+ canvas = data6.bufferCanvases[i2];
canvas.width = canvasWidth;
canvas.height = canvasHeight;
canvas.style.width = width3 + "px";
@@ -120707,15 +126625,16 @@ g.stateGroup line {
}
r2.textureMult = 1;
if (pixelRatio <= 1) {
- canvas = data5.bufferCanvases[r2.TEXTURE_BUFFER];
+ canvas = data6.bufferCanvases[r2.TEXTURE_BUFFER];
r2.textureMult = 2;
canvas.width = canvasWidth * r2.textureMult;
canvas.height = canvasHeight * r2.textureMult;
}
r2.canvasWidth = canvasWidth;
r2.canvasHeight = canvasHeight;
+ r2.pixelRatio = pixelRatio;
};
- CRp$4.renderTo = function(cxt, zoom2, pan2, pxRatio) {
+ CRp$5.renderTo = function(cxt, zoom2, pan2, pxRatio) {
this.render({
forcedContext: cxt,
forcedZoom: zoom2,
@@ -120724,18 +126643,28 @@ g.stateGroup line {
forcedPxRatio: pxRatio
});
};
- CRp$4.render = function(options3) {
+ CRp$5.clearCanvas = function() {
+ var r2 = this;
+ var data6 = r2.data;
+ function clear22(context) {
+ context.clearRect(0, 0, r2.canvasWidth, r2.canvasHeight);
+ }
+ __name(clear22, "clear");
+ clear22(data6.contexts[r2.NODE]);
+ clear22(data6.contexts[r2.DRAG]);
+ };
+ CRp$5.render = function(options3) {
+ var r2 = this;
options3 = options3 || staticEmptyObject();
+ var cy = r2.cy;
var forcedContext = options3.forcedContext;
var drawAllLayers = options3.drawAllLayers;
var drawOnlyNodeLayer = options3.drawOnlyNodeLayer;
var forcedZoom = options3.forcedZoom;
var forcedPan = options3.forcedPan;
- var r2 = this;
var pixelRatio = options3.forcedPxRatio === void 0 ? this.getPixelRatio() : options3.forcedPxRatio;
- var cy = r2.cy;
- var data5 = r2.data;
- var needDraw = data5.canvasNeedsRedraw;
+ var data6 = r2.data;
+ var needDraw = data6.canvasNeedsRedraw;
var textureDraw = r2.textureOnViewport && !forcedContext && (r2.pinching || r2.hoverData.dragging || r2.swipePanning || r2.data.wheelZooming);
var motionBlur = options3.motionBlur !== void 0 ? options3.motionBlur : r2.motionBlur;
var mbPxRatio = r2.motionBlurPxRatio;
@@ -120810,9 +126739,9 @@ g.stateGroup line {
context2.globalCompositeOperation = gco;
}
__name(mbclear, "mbclear");
- function setContextTransform(context2, clear31) {
+ function setContextTransform2(context2, clear23) {
var ePan, eZoom, w3, h2;
- if (!r2.clearingMotionBlur && (context2 === data5.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] || context2 === data5.bufferContexts[r2.MOTIONBLUR_BUFFER_DRAG])) {
+ if (!r2.clearingMotionBlur && (context2 === data6.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] || context2 === data6.bufferContexts[r2.MOTIONBLUR_BUFFER_DRAG])) {
ePan = {
x: pan2.x * mbPxRatio,
y: pan2.y * mbPxRatio
@@ -120827,9 +126756,9 @@ g.stateGroup line {
h2 = r2.canvasHeight;
}
context2.setTransform(1, 0, 0, 1, 0, 0);
- if (clear31 === "motionBlur") {
+ if (clear23 === "motionBlur") {
mbclear(context2, 0, 0, w3, h2);
- } else if (!forcedContext && (clear31 === void 0 || clear31)) {
+ } else if (!forcedContext && (clear23 === void 0 || clear23)) {
context2.clearRect(0, 0, w3, h2);
}
if (!drawAllLayers) {
@@ -120843,7 +126772,7 @@ g.stateGroup line {
context2.scale(forcedZoom, forcedZoom);
}
}
- __name(setContextTransform, "setContextTransform");
+ __name(setContextTransform2, "setContextTransform");
if (!textureDraw) {
r2.textureDrawLastFrame = false;
}
@@ -120874,7 +126803,7 @@ g.stateGroup line {
}
needDraw[r2.DRAG] = false;
needDraw[r2.NODE] = false;
- var context = data5.contexts[r2.NODE];
+ var context = data6.contexts[r2.NODE];
var texture = r2.textureCache.texture;
var vp = r2.textureCache.viewport;
context.setTransform(1, 0, 0, 1, 0, 0);
@@ -120888,7 +126817,7 @@ g.stateGroup line {
r2.colorFillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity);
context.fillRect(0, 0, vp.width, vp.height);
var zoom2 = cy.zoom();
- setContextTransform(context, false);
+ setContextTransform2(context, false);
context.clearRect(vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio);
context.drawImage(texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio);
} else if (r2.textureOnViewport && !forcedContext) {
@@ -120908,9 +126837,9 @@ g.stateGroup line {
}
if (needDraw[r2.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r2.NODE]) {
var useBuffer = motionBlur && !needMbClear[r2.NODE] && mbPxRatio !== 1;
- var context = forcedContext || (useBuffer ? r2.data.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] : data5.contexts[r2.NODE]);
- var clear30 = motionBlur && !useBuffer ? "motionBlur" : void 0;
- setContextTransform(context, clear30);
+ var context = forcedContext || (useBuffer ? r2.data.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] : data6.contexts[r2.NODE]);
+ var clear22 = motionBlur && !useBuffer ? "motionBlur" : void 0;
+ setContextTransform2(context, clear22);
if (hideEdges) {
r2.drawCachedNodes(context, eles.nondrag, pixelRatio, extent2);
} else {
@@ -120925,8 +126854,8 @@ g.stateGroup line {
}
if (!drawOnlyNodeLayer && (needDraw[r2.DRAG] || drawAllLayers || needMbClear[r2.DRAG])) {
var useBuffer = motionBlur && !needMbClear[r2.DRAG] && mbPxRatio !== 1;
- var context = forcedContext || (useBuffer ? r2.data.bufferContexts[r2.MOTIONBLUR_BUFFER_DRAG] : data5.contexts[r2.DRAG]);
- setContextTransform(context, motionBlur && !useBuffer ? "motionBlur" : void 0);
+ var context = forcedContext || (useBuffer ? r2.data.bufferContexts[r2.MOTIONBLUR_BUFFER_DRAG] : data6.contexts[r2.DRAG]);
+ setContextTransform2(context, motionBlur && !useBuffer ? "motionBlur" : void 0);
if (hideEdges) {
r2.drawCachedNodes(context, eles.drag, pixelRatio, extent2);
} else {
@@ -120939,9 +126868,81 @@ g.stateGroup line {
needDraw[r2.DRAG] = false;
}
}
+ this.drawSelectionRectangle(options3, setContextTransform2);
+ if (motionBlur && mbPxRatio !== 1) {
+ var cxtNode = data6.contexts[r2.NODE];
+ var txtNode = r2.data.bufferCanvases[r2.MOTIONBLUR_BUFFER_NODE];
+ var cxtDrag = data6.contexts[r2.DRAG];
+ var txtDrag = r2.data.bufferCanvases[r2.MOTIONBLUR_BUFFER_DRAG];
+ var drawMotionBlur = /* @__PURE__ */ __name(function drawMotionBlur2(cxt2, txt, needClear) {
+ cxt2.setTransform(1, 0, 0, 1, 0, 0);
+ if (needClear || !motionBlurFadeEffect) {
+ cxt2.clearRect(0, 0, r2.canvasWidth, r2.canvasHeight);
+ } else {
+ mbclear(cxt2, 0, 0, r2.canvasWidth, r2.canvasHeight);
+ }
+ var pxr = mbPxRatio;
+ cxt2.drawImage(
+ txt,
+ // img
+ 0,
+ 0,
+ // sx, sy
+ r2.canvasWidth * pxr,
+ r2.canvasHeight * pxr,
+ // sw, sh
+ 0,
+ 0,
+ // x, y
+ r2.canvasWidth,
+ r2.canvasHeight
+ // w, h
+ );
+ }, "drawMotionBlur");
+ if (needDraw[r2.NODE] || needMbClear[r2.NODE]) {
+ drawMotionBlur(cxtNode, txtNode, needMbClear[r2.NODE]);
+ needDraw[r2.NODE] = false;
+ }
+ if (needDraw[r2.DRAG] || needMbClear[r2.DRAG]) {
+ drawMotionBlur(cxtDrag, txtDrag, needMbClear[r2.DRAG]);
+ needDraw[r2.DRAG] = false;
+ }
+ }
+ r2.prevViewport = vp;
+ if (r2.clearingMotionBlur) {
+ r2.clearingMotionBlur = false;
+ r2.motionBlurCleared = true;
+ r2.motionBlur = true;
+ }
+ if (motionBlur) {
+ r2.motionBlurTimeout = setTimeout(function() {
+ r2.motionBlurTimeout = null;
+ r2.clearedForMotionBlur[r2.NODE] = false;
+ r2.clearedForMotionBlur[r2.DRAG] = false;
+ r2.motionBlur = false;
+ r2.clearingMotionBlur = !textureDraw;
+ r2.mbFrames = 0;
+ needDraw[r2.NODE] = true;
+ needDraw[r2.DRAG] = true;
+ r2.redraw();
+ }, motionBlurDelay);
+ }
+ if (!forcedContext) {
+ cy.emit("render");
+ }
+ };
+ CRp$5.drawSelectionRectangle = function(options3, setContextTransform2) {
+ var r2 = this;
+ var cy = r2.cy;
+ var data6 = r2.data;
+ var style3 = cy.style();
+ var drawOnlyNodeLayer = options3.drawOnlyNodeLayer;
+ var drawAllLayers = options3.drawAllLayers;
+ var needDraw = data6.canvasNeedsRedraw;
+ var forcedContext = options3.forcedContext;
if (r2.showFps || !drawOnlyNodeLayer && needDraw[r2.SELECT_BOX] && !drawAllLayers) {
- var context = forcedContext || data5.contexts[r2.SELECT_BOX];
- setContextTransform(context);
+ var context = forcedContext || data6.contexts[r2.SELECT_BOX];
+ setContextTransform2(context);
if (r2.selection[4] == 1 && (r2.hoverData.selecting || r2.touchData.selecting)) {
var zoom2 = r2.cy.zoom();
var borderWidth = style3.core("selection-box-border-width").value / zoom2;
@@ -120953,9 +126954,9 @@ g.stateGroup line {
context.strokeRect(r2.selection[0], r2.selection[1], r2.selection[2] - r2.selection[0], r2.selection[3] - r2.selection[1]);
}
}
- if (data5.bgActivePosistion && !r2.hoverData.selecting) {
+ if (data6.bgActivePosistion && !r2.hoverData.selecting) {
var zoom2 = r2.cy.zoom();
- var pos = data5.bgActivePosistion;
+ var pos = data6.bgActivePosistion;
context.fillStyle = "rgba(" + style3.core("active-bg-color").value[0] + "," + style3.core("active-bg-color").value[1] + "," + style3.core("active-bg-color").value[2] + "," + style3.core("active-bg-opacity").value + ")";
context.beginPath();
context.arc(pos.x, pos.y, style3.core("active-bg-size").pfValue / zoom2, 0, 2 * Math.PI);
@@ -120965,81 +126966,1397 @@ g.stateGroup line {
if (r2.showFps && timeToRender) {
timeToRender = Math.round(timeToRender);
var fps = Math.round(1e3 / timeToRender);
+ var text4 = "1 frame = " + timeToRender + " ms = " + fps + " fps";
context.setTransform(1, 0, 0, 1, 0, 0);
context.fillStyle = "rgba(255, 0, 0, 0.75)";
context.strokeStyle = "rgba(255, 0, 0, 0.75)";
- context.lineWidth = 1;
- context.fillText("1 frame = " + timeToRender + " ms = " + fps + " fps", 0, 20);
+ context.font = "30px Arial";
+ if (!fpsHeight) {
+ var dims = context.measureText(text4);
+ fpsHeight = dims.actualBoundingBoxAscent;
+ }
+ context.fillText(text4, 0, fpsHeight);
var maxFps = 60;
- context.strokeRect(0, 30, 250, 20);
- context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20);
+ context.strokeRect(0, fpsHeight + 10, 250, 20);
+ context.fillRect(0, fpsHeight + 10, 250 * Math.min(fps / maxFps, 1), 20);
}
if (!drawAllLayers) {
needDraw[r2.SELECT_BOX] = false;
}
}
- if (motionBlur && mbPxRatio !== 1) {
- var cxtNode = data5.contexts[r2.NODE];
- var txtNode = r2.data.bufferCanvases[r2.MOTIONBLUR_BUFFER_NODE];
- var cxtDrag = data5.contexts[r2.DRAG];
- var txtDrag = r2.data.bufferCanvases[r2.MOTIONBLUR_BUFFER_DRAG];
- var drawMotionBlur = /* @__PURE__ */ __name(function drawMotionBlur2(cxt2, txt, needClear) {
- cxt2.setTransform(1, 0, 0, 1, 0, 0);
- if (needClear || !motionBlurFadeEffect) {
- cxt2.clearRect(0, 0, r2.canvasWidth, r2.canvasHeight);
+ };
+ __name(compileShader, "compileShader");
+ __name(createProgram, "createProgram");
+ __name(createTextureCanvas, "createTextureCanvas");
+ __name(getEffectivePanZoom, "getEffectivePanZoom");
+ __name(modelToRenderedPosition2, "modelToRenderedPosition");
+ __name(toWebGLColor, "toWebGLColor");
+ __name(indexToVec4, "indexToVec4");
+ __name(vec4ToIndex, "vec4ToIndex");
+ __name(createTexture, "createTexture");
+ __name(getTypeInfo, "getTypeInfo");
+ __name(createTypedArray, "createTypedArray");
+ __name(createTypedArrayView, "createTypedArrayView");
+ __name(createBufferStaticDraw, "createBufferStaticDraw");
+ __name(createBufferDynamicDraw, "createBufferDynamicDraw");
+ __name(createPickingFrameBuffer, "createPickingFrameBuffer");
+ ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
+ if (!Math.hypot) Math.hypot = function() {
+ var y5 = 0, i2 = arguments.length;
+ while (i2--) {
+ y5 += arguments[i2] * arguments[i2];
+ }
+ return Math.sqrt(y5);
+ };
+ __name(create3, "create");
+ __name(identity6, "identity");
+ __name(multiply, "multiply");
+ __name(translate, "translate");
+ __name(rotate, "rotate");
+ __name(scale, "scale");
+ __name(projection, "projection");
+ RENDER_TARGET = {
+ SCREEN: {
+ name: "screen",
+ screen: true
+ },
+ PICKING: {
+ name: "picking",
+ picking: true
+ }
+ };
+ renderDefaults = defaults$g({
+ getKey: null,
+ drawElement: null,
+ getBoundingBox: null,
+ getRotation: null,
+ getRotationPoint: null,
+ getRotationOffset: null,
+ isVisible: null,
+ getPadding: null
+ });
+ Atlas = /* @__PURE__ */ function() {
+ function Atlas2(r2, opts) {
+ _classCallCheck(this, Atlas2);
+ this.debugID = Math.floor(Math.random() * 1e4);
+ this.r = r2;
+ this.atlasSize = opts.webglTexSize;
+ this.rows = opts.webglTexRows;
+ this.enableWrapping = opts.enableWrapping;
+ this.texHeight = Math.floor(this.atlasSize / this.rows);
+ this.maxTexWidth = this.atlasSize;
+ this.texture = null;
+ this.canvas = null;
+ this.needsBuffer = true;
+ this.freePointer = {
+ x: 0,
+ row: 0
+ };
+ this.keyToLocation = /* @__PURE__ */ new Map();
+ this.canvas = opts.createTextureCanvas(r2, this.atlasSize, this.atlasSize);
+ this.scratch = opts.createTextureCanvas(r2, this.atlasSize, this.texHeight, "scratch");
+ }
+ __name(Atlas2, "Atlas");
+ _createClass(Atlas2, [{
+ key: "getKeys",
+ value: /* @__PURE__ */ __name(function getKeys() {
+ return new Set(this.keyToLocation.keys());
+ }, "getKeys")
+ }, {
+ key: "getScale",
+ value: /* @__PURE__ */ __name(function getScale(_ref) {
+ var w3 = _ref.w, h2 = _ref.h;
+ var texHeight = this.texHeight, maxTexWidth = this.maxTexWidth;
+ var scale2 = texHeight / h2;
+ var texW = w3 * scale2;
+ var texH = h2 * scale2;
+ if (texW > maxTexWidth) {
+ scale2 = maxTexWidth / w3;
+ texW = w3 * scale2;
+ texH = h2 * scale2;
+ }
+ return {
+ scale: scale2,
+ texW,
+ texH
+ };
+ }, "getScale")
+ }, {
+ key: "draw",
+ value: /* @__PURE__ */ __name(function draw25(key, bb, doDrawing) {
+ var _this = this;
+ var atlasSize = this.atlasSize, rows = this.rows, texHeight = this.texHeight;
+ var _this$getScale = this.getScale(bb), scale2 = _this$getScale.scale, texW = _this$getScale.texW, texH = _this$getScale.texH;
+ var locations = [null, null];
+ var drawAt = /* @__PURE__ */ __name(function drawAt2(location, canvas) {
+ if (doDrawing && canvas) {
+ var context = canvas.context;
+ var x5 = location.x, row = location.row;
+ var xOffset = x5;
+ var yOffset = texHeight * row;
+ context.save();
+ context.translate(xOffset, yOffset);
+ context.scale(scale2, scale2);
+ doDrawing(context, bb);
+ context.restore();
+ }
+ }, "drawAt");
+ var drawNormal = /* @__PURE__ */ __name(function drawNormal2() {
+ drawAt(_this.freePointer, _this.canvas);
+ locations[0] = {
+ x: _this.freePointer.x,
+ y: _this.freePointer.row * texHeight,
+ w: texW,
+ h: texH
+ };
+ locations[1] = {
+ // indlude a second location with a width of 0, for convenience
+ x: _this.freePointer.x + texW,
+ y: _this.freePointer.row * texHeight,
+ w: 0,
+ h: texH
+ };
+ _this.freePointer.x += texW;
+ if (_this.freePointer.x == atlasSize) {
+ _this.freePointer.x = 0;
+ _this.freePointer.row++;
+ }
+ }, "drawNormal");
+ var drawWrapped = /* @__PURE__ */ __name(function drawWrapped2() {
+ var scratch = _this.scratch, canvas = _this.canvas;
+ scratch.clear();
+ drawAt({
+ x: 0,
+ row: 0
+ }, scratch);
+ var firstTexW = atlasSize - _this.freePointer.x;
+ var secondTexW = texW - firstTexW;
+ var h2 = texHeight;
+ {
+ var dx = _this.freePointer.x;
+ var dy = _this.freePointer.row * texHeight;
+ var w3 = firstTexW;
+ canvas.context.drawImage(scratch, 0, 0, w3, h2, dx, dy, w3, h2);
+ locations[0] = {
+ x: dx,
+ y: dy,
+ w: w3,
+ h: texH
+ };
+ }
+ {
+ var sx = firstTexW;
+ var _dy = (_this.freePointer.row + 1) * texHeight;
+ var _w = secondTexW;
+ if (canvas) {
+ canvas.context.drawImage(scratch, sx, 0, _w, h2, 0, _dy, _w, h2);
+ }
+ locations[1] = {
+ x: 0,
+ y: _dy,
+ w: _w,
+ h: texH
+ };
+ }
+ _this.freePointer.x = secondTexW;
+ _this.freePointer.row++;
+ }, "drawWrapped");
+ var moveToStartOfNextRow = /* @__PURE__ */ __name(function moveToStartOfNextRow2() {
+ _this.freePointer.x = 0;
+ _this.freePointer.row++;
+ }, "moveToStartOfNextRow");
+ if (this.freePointer.x + texW <= atlasSize) {
+ drawNormal();
+ } else if (this.freePointer.row >= rows - 1) {
+ return false;
+ } else if (this.freePointer.x === atlasSize) {
+ moveToStartOfNextRow();
+ drawNormal();
+ } else if (this.enableWrapping) {
+ drawWrapped();
} else {
- mbclear(cxt2, 0, 0, r2.canvasWidth, r2.canvasHeight);
+ moveToStartOfNextRow();
+ drawNormal();
}
- var pxr = mbPxRatio;
- cxt2.drawImage(
- txt,
- // img
- 0,
- 0,
- // sx, sy
- r2.canvasWidth * pxr,
- r2.canvasHeight * pxr,
- // sw, sh
- 0,
- 0,
- // x, y
- r2.canvasWidth,
- r2.canvasHeight
- // w, h
- );
- }, "drawMotionBlur");
- if (needDraw[r2.NODE] || needMbClear[r2.NODE]) {
- drawMotionBlur(cxtNode, txtNode, needMbClear[r2.NODE]);
- needDraw[r2.NODE] = false;
- }
- if (needDraw[r2.DRAG] || needMbClear[r2.DRAG]) {
- drawMotionBlur(cxtDrag, txtDrag, needMbClear[r2.DRAG]);
- needDraw[r2.DRAG] = false;
+ this.keyToLocation.set(key, locations);
+ this.needsBuffer = true;
+ return locations;
+ }, "draw")
+ }, {
+ key: "getOffsets",
+ value: /* @__PURE__ */ __name(function getOffsets(key) {
+ return this.keyToLocation.get(key);
+ }, "getOffsets")
+ }, {
+ key: "isEmpty",
+ value: /* @__PURE__ */ __name(function isEmpty2() {
+ return this.freePointer.x === 0 && this.freePointer.row === 0;
+ }, "isEmpty")
+ }, {
+ key: "canFit",
+ value: /* @__PURE__ */ __name(function canFit(bb) {
+ var atlasSize = this.atlasSize, rows = this.rows;
+ var _this$getScale2 = this.getScale(bb), texW = _this$getScale2.texW;
+ if (this.freePointer.x + texW > atlasSize) {
+ return this.freePointer.row < rows - 1;
+ }
+ return true;
+ }, "canFit")
+ }, {
+ key: "bufferIfNeeded",
+ value: /* @__PURE__ */ __name(function bufferIfNeeded(gl) {
+ if (!this.texture) {
+ this.texture = createTexture(gl, this.debugID);
+ }
+ if (this.needsBuffer) {
+ this.texture.buffer(this.canvas);
+ this.needsBuffer = false;
+ }
+ }, "bufferIfNeeded")
+ }, {
+ key: "dispose",
+ value: /* @__PURE__ */ __name(function dispose() {
+ if (this.texture) {
+ this.texture.deleteTexture();
+ this.texture = null;
+ this.needsBuffer = true;
+ }
+ }, "dispose")
+ }]);
+ return Atlas2;
+ }();
+ AtlasCollection = /* @__PURE__ */ function() {
+ function AtlasCollection2(r2, opts) {
+ _classCallCheck(this, AtlasCollection2);
+ this.r = r2;
+ this.opts = opts;
+ this.keyToIds = /* @__PURE__ */ new Map();
+ this.idToKey = /* @__PURE__ */ new Map();
+ this.atlases = [];
+ this.styleKeyToAtlas = /* @__PURE__ */ new Map();
+ this.styleKeyNeedsRedraw = /* @__PURE__ */ new Set();
+ this.forceGC = false;
+ }
+ __name(AtlasCollection2, "AtlasCollection");
+ _createClass(AtlasCollection2, [{
+ key: "getKeys",
+ value: /* @__PURE__ */ __name(function getKeys() {
+ return new Set(this.styleKeyToAtlas.keys());
+ }, "getKeys")
+ }, {
+ key: "getIdsFor",
+ value: /* @__PURE__ */ __name(function getIdsFor(key) {
+ var ids = this.keyToIds.get(key);
+ if (!ids) {
+ ids = /* @__PURE__ */ new Set();
+ this.keyToIds.set(key, ids);
+ }
+ return ids;
+ }, "getIdsFor")
+ }, {
+ key: "_createAtlas",
+ value: /* @__PURE__ */ __name(function _createAtlas() {
+ var r2 = this.r, opts = this.opts;
+ return new Atlas(r2, opts);
+ }, "_createAtlas")
+ }, {
+ key: "_getScratchCanvas",
+ value: /* @__PURE__ */ __name(function _getScratchCanvas() {
+ if (!this.scratch) {
+ var r2 = this.r, opts = this.opts;
+ var atlasSize = opts.webglTexSize;
+ var texHeight = Math.floor(atlasSize / opts.webglTexRows);
+ this.scratch = opts.createTextureCanvas(r2, atlasSize, texHeight, "scratch");
+ }
+ return this.scratch;
+ }, "_getScratchCanvas")
+ }, {
+ key: "draw",
+ value: /* @__PURE__ */ __name(function draw25(id29, key, bb, doDrawing) {
+ if (this.styleKeyNeedsRedraw.has(key)) {
+ this.styleKeyNeedsRedraw["delete"](key);
+ this.deleteKey(id29, key);
+ var _atlas = this.styleKeyToAtlas.get(key);
+ if (_atlas) {
+ _atlas.forceGC = true;
+ }
+ this.styleKeyToAtlas["delete"](key);
+ }
+ var atlas = this.styleKeyToAtlas.get(key);
+ if (!atlas) {
+ atlas = this.atlases[this.atlases.length - 1];
+ if (!atlas || !atlas.canFit(bb)) {
+ atlas = this._createAtlas();
+ this.atlases.push(atlas);
+ }
+ atlas.draw(key, bb, doDrawing);
+ this.styleKeyToAtlas.set(key, atlas);
+ this.getIdsFor(key).add(id29);
+ this.idToKey.set(id29, key);
+ }
+ return atlas;
+ }, "draw")
+ }, {
+ key: "getAtlas",
+ value: /* @__PURE__ */ __name(function getAtlas(key) {
+ return this.styleKeyToAtlas.get(key);
+ }, "getAtlas")
+ }, {
+ key: "hasAtlas",
+ value: /* @__PURE__ */ __name(function hasAtlas(key) {
+ return this.styleKeyToAtlas.has(key);
+ }, "hasAtlas")
+ }, {
+ key: "deleteKey",
+ value: /* @__PURE__ */ __name(function deleteKey(id29, key) {
+ this.idToKey["delete"](id29);
+ this.getIdsFor(key)["delete"](id29);
+ }, "deleteKey")
+ }, {
+ key: "checkKeyIsInvalid",
+ value: /* @__PURE__ */ __name(function checkKeyIsInvalid(id29, newKey) {
+ if (!this.idToKey.has(id29)) return false;
+ var oldKey = this.idToKey.get(id29);
+ if (oldKey != newKey) {
+ this.deleteKey(id29, oldKey);
+ return true;
+ }
+ return false;
+ }, "checkKeyIsInvalid")
+ }, {
+ key: "_getKeysToCollect",
+ value: /* @__PURE__ */ __name(function _getKeysToCollect() {
+ var markedKeys = /* @__PURE__ */ new Set();
+ var _iterator = _createForOfIteratorHelper(this.styleKeyToAtlas.keys()), _step;
+ try {
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
+ var key = _step.value;
+ if (this.getIdsFor(key).size == 0) {
+ markedKeys.add(key);
+ }
+ }
+ } catch (err) {
+ _iterator.e(err);
+ } finally {
+ _iterator.f();
+ }
+ return markedKeys;
+ }, "_getKeysToCollect")
+ /**
+ * TODO dispose of the old atlas and texture
+ */
+ }, {
+ key: "gc",
+ value: /* @__PURE__ */ __name(function gc2() {
+ var _this2 = this;
+ var forceGC = this.atlases.some(function(atlas) {
+ return atlas.forceGC;
+ });
+ var markedKeys = this._getKeysToCollect();
+ if (markedKeys.size === 0 && !forceGC) {
+ console.log("nothing to garbage collect");
+ return;
+ }
+ var newAtlases = [];
+ var newStyleKeyToAtlas = /* @__PURE__ */ new Map();
+ var newAtlas = null;
+ var _iterator2 = _createForOfIteratorHelper(this.atlases), _step2;
+ try {
+ var _loop = /* @__PURE__ */ __name(function _loop2() {
+ var atlas = _step2.value;
+ var keys3 = atlas.getKeys();
+ var keysToCollect = intersection2(markedKeys, keys3);
+ if (keysToCollect.size === 0 && !atlas.forceGC) {
+ newAtlases.push(atlas);
+ keys3.forEach(function(k2) {
+ return newStyleKeyToAtlas.set(k2, atlas);
+ });
+ return "continue";
+ }
+ if (!newAtlas) {
+ newAtlas = _this2._createAtlas();
+ newAtlases.push(newAtlas);
+ }
+ var _iterator3 = _createForOfIteratorHelper(keys3), _step3;
+ try {
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
+ var key = _step3.value;
+ if (!keysToCollect.has(key)) {
+ var _atlas$getOffsets = atlas.getOffsets(key), _atlas$getOffsets2 = _slicedToArray(_atlas$getOffsets, 2), s1 = _atlas$getOffsets2[0], s2 = _atlas$getOffsets2[1];
+ if (!newAtlas.canFit({
+ w: s1.w + s2.w,
+ h: s1.h
+ })) {
+ newAtlas = _this2._createAtlas();
+ newAtlases.push(newAtlas);
+ }
+ _this2._copyTextureToNewAtlas(key, atlas, newAtlas);
+ newStyleKeyToAtlas.set(key, newAtlas);
+ }
+ }
+ } catch (err) {
+ _iterator3.e(err);
+ } finally {
+ _iterator3.f();
+ }
+ }, "_loop");
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
+ var _ret = _loop();
+ if (_ret === "continue") continue;
+ }
+ } catch (err) {
+ _iterator2.e(err);
+ } finally {
+ _iterator2.f();
+ }
+ this.atlases = newAtlases;
+ this.styleKeyToAtlas = newStyleKeyToAtlas;
+ }, "gc")
+ }, {
+ key: "_copyTextureToNewAtlas",
+ value: /* @__PURE__ */ __name(function _copyTextureToNewAtlas(key, oldAtlas, newAtlas) {
+ var _oldAtlas$getOffsets = oldAtlas.getOffsets(key), _oldAtlas$getOffsets2 = _slicedToArray(_oldAtlas$getOffsets, 2), s1 = _oldAtlas$getOffsets2[0], s2 = _oldAtlas$getOffsets2[1];
+ if (s2.w === 0) {
+ newAtlas.draw(key, s1, function(context) {
+ context.drawImage(oldAtlas.canvas, s1.x, s1.y, s1.w, s1.h, 0, 0, s1.w, s1.h);
+ });
+ } else {
+ var scratch = this._getScratchCanvas();
+ scratch.clear();
+ scratch.context.drawImage(oldAtlas.canvas, s1.x, s1.y, s1.w, s1.h, 0, 0, s1.w, s1.h);
+ scratch.context.drawImage(oldAtlas.canvas, s2.x, s2.y, s2.w, s2.h, s1.w, 0, s2.w, s2.h);
+ var w3 = s1.w + s2.w;
+ var h2 = s1.h;
+ newAtlas.draw(key, {
+ w: w3,
+ h: h2
+ }, function(context) {
+ context.drawImage(
+ scratch,
+ 0,
+ 0,
+ w3,
+ h2,
+ 0,
+ 0,
+ w3,
+ h2
+ // the destination context has already been translated to the correct position
+ );
+ });
+ }
+ }, "_copyTextureToNewAtlas")
+ }, {
+ key: "getCounts",
+ value: /* @__PURE__ */ __name(function getCounts() {
+ return {
+ keyCount: this.styleKeyToAtlas.size,
+ atlasCount: new Set(this.styleKeyToAtlas.values()).size
+ };
+ }, "getCounts")
+ }]);
+ return AtlasCollection2;
+ }();
+ __name(intersection2, "intersection");
+ AtlasManager = /* @__PURE__ */ function() {
+ function AtlasManager2(r2, globalOptions) {
+ _classCallCheck(this, AtlasManager2);
+ this.r = r2;
+ var opts = globalOptions;
+ this.globalOptions = opts;
+ this.maxAtlases = opts.webglTexPerBatch;
+ this.atlasSize = opts.webglTexSize;
+ this.renderTypes = /* @__PURE__ */ new Map();
+ this.maxAtlasesPerBatch = globalOptions.webglTexPerBatch;
+ this.batchAtlases = [];
+ this._cacheScratchCanvas(opts);
+ }
+ __name(AtlasManager2, "AtlasManager");
+ _createClass(AtlasManager2, [{
+ key: "_cacheScratchCanvas",
+ value: /* @__PURE__ */ __name(function _cacheScratchCanvas(opts) {
+ var prevW = -1;
+ var prevH = -1;
+ var scratchCanvas = null;
+ var baseCreateTextureCanvas = opts.createTextureCanvas;
+ opts.createTextureCanvas = function(r2, w3, h2, scratch) {
+ if (scratch) {
+ if (!scratchCanvas || w3 != prevW || h2 != prevH) {
+ prevW = w3;
+ prevH = h2;
+ scratchCanvas = baseCreateTextureCanvas(r2, w3, h2);
+ }
+ return scratchCanvas;
+ } else {
+ return baseCreateTextureCanvas(r2, w3, h2);
+ }
+ };
+ }, "_cacheScratchCanvas")
+ }, {
+ key: "addRenderType",
+ value: /* @__PURE__ */ __name(function addRenderType(type3, renderTypeOptions) {
+ var atlasCollection = new AtlasCollection(this.r, this.globalOptions);
+ var typeOpts = renderTypeOptions;
+ this.renderTypes.set(type3, extend4({
+ type: type3,
+ atlasCollection
+ }, typeOpts));
+ }, "addRenderType")
+ }, {
+ key: "getRenderTypes",
+ value: /* @__PURE__ */ __name(function getRenderTypes() {
+ return _toConsumableArray(this.renderTypes.values());
+ }, "getRenderTypes")
+ }, {
+ key: "getRenderTypeOpts",
+ value: /* @__PURE__ */ __name(function getRenderTypeOpts(type3) {
+ return this.renderTypes.get(type3);
+ }, "getRenderTypeOpts")
+ /** Marks textues associated with the element for garbage collection. */
+ }, {
+ key: "invalidate",
+ value: /* @__PURE__ */ __name(function invalidate(eles) {
+ var _ref2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref2$forceRedraw = _ref2.forceRedraw, forceRedraw = _ref2$forceRedraw === void 0 ? false : _ref2$forceRedraw, _ref2$filterEle = _ref2.filterEle, filterEle = _ref2$filterEle === void 0 ? function() {
+ return true;
+ } : _ref2$filterEle, _ref2$filterType = _ref2.filterType, filterType = _ref2$filterType === void 0 ? function() {
+ return true;
+ } : _ref2$filterType;
+ var gcNeeded = false;
+ var _iterator4 = _createForOfIteratorHelper(eles), _step4;
+ try {
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
+ var ele = _step4.value;
+ if (filterEle(ele)) {
+ var id29 = ele.id();
+ var _iterator5 = _createForOfIteratorHelper(this.getRenderTypes()), _step5;
+ try {
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
+ var opts = _step5.value;
+ if (filterType(opts.type)) {
+ var styleKey = opts.getKey(ele);
+ if (forceRedraw) {
+ opts.atlasCollection.deleteKey(id29, styleKey);
+ opts.atlasCollection.styleKeyNeedsRedraw.add(styleKey);
+ gcNeeded = true;
+ } else {
+ gcNeeded |= opts.atlasCollection.checkKeyIsInvalid(id29, styleKey);
+ }
+ }
+ }
+ } catch (err) {
+ _iterator5.e(err);
+ } finally {
+ _iterator5.f();
+ }
+ }
+ }
+ } catch (err) {
+ _iterator4.e(err);
+ } finally {
+ _iterator4.f();
+ }
+ return gcNeeded;
+ }, "invalidate")
+ /** Garbage collect */
+ }, {
+ key: "gc",
+ value: /* @__PURE__ */ __name(function gc2() {
+ var _iterator6 = _createForOfIteratorHelper(this.getRenderTypes()), _step6;
+ try {
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done; ) {
+ var opts = _step6.value;
+ opts.atlasCollection.gc();
+ }
+ } catch (err) {
+ _iterator6.e(err);
+ } finally {
+ _iterator6.f();
+ }
+ }, "gc")
+ }, {
+ key: "isRenderable",
+ value: /* @__PURE__ */ __name(function isRenderable(ele, type3) {
+ var opts = this.getRenderTypeOpts(type3);
+ return opts && opts.isVisible(ele);
+ }, "isRenderable")
+ }, {
+ key: "startBatch",
+ value: /* @__PURE__ */ __name(function startBatch2() {
+ this.batchAtlases = [];
+ }, "startBatch")
+ }, {
+ key: "getAtlasCount",
+ value: /* @__PURE__ */ __name(function getAtlasCount() {
+ return this.batchAtlases.length;
+ }, "getAtlasCount")
+ }, {
+ key: "getAtlases",
+ value: /* @__PURE__ */ __name(function getAtlases() {
+ return this.batchAtlases;
+ }, "getAtlases")
+ }, {
+ key: "getOrCreateAtlas",
+ value: /* @__PURE__ */ __name(function getOrCreateAtlas(ele, bb, type3) {
+ var opts = this.renderTypes.get(type3);
+ var styleKey = opts.getKey(ele);
+ var id29 = ele.id();
+ return opts.atlasCollection.draw(id29, styleKey, bb, function(context) {
+ opts.drawElement(context, ele, bb, true, true);
+ });
+ }, "getOrCreateAtlas")
+ }, {
+ key: "getAtlasIndexForBatch",
+ value: /* @__PURE__ */ __name(function getAtlasIndexForBatch(atlas) {
+ var atlasID = this.batchAtlases.indexOf(atlas);
+ if (atlasID < 0) {
+ if (this.batchAtlases.length === this.maxAtlasesPerBatch) {
+ return;
+ }
+ this.batchAtlases.push(atlas);
+ atlasID = this.batchAtlases.length - 1;
+ }
+ return atlasID;
+ }, "getAtlasIndexForBatch")
+ }, {
+ key: "getIndexArray",
+ value: /* @__PURE__ */ __name(function getIndexArray() {
+ return Array.from({
+ length: this.maxAtlases
+ }, function(v3, i2) {
+ return i2;
+ });
+ }, "getIndexArray")
+ }, {
+ key: "getAtlasInfo",
+ value: /* @__PURE__ */ __name(function getAtlasInfo(ele, type3) {
+ var opts = this.renderTypes.get(type3);
+ var bb = opts.getBoundingBox(ele);
+ var atlas = this.getOrCreateAtlas(ele, bb, type3);
+ var atlasID = this.getAtlasIndexForBatch(atlas);
+ if (atlasID === void 0) {
+ return void 0;
+ }
+ var styleKey = opts.getKey(ele);
+ var _atlas$getOffsets3 = atlas.getOffsets(styleKey), _atlas$getOffsets4 = _slicedToArray(_atlas$getOffsets3, 2), tex1 = _atlas$getOffsets4[0], tex2 = _atlas$getOffsets4[1];
+ return {
+ atlasID,
+ tex: tex1,
+ tex1,
+ tex2,
+ bb,
+ type: type3,
+ styleKey
+ };
+ }, "getAtlasInfo")
+ }, {
+ key: "canAddToCurrentBatch",
+ value: /* @__PURE__ */ __name(function canAddToCurrentBatch(ele, type3) {
+ if (this.batchAtlases.length === this.maxAtlasesPerBatch) {
+ var opts = this.renderTypes.get(type3);
+ var styleKey = opts.getKey(ele);
+ var atlas = opts.atlasCollection.getAtlas(styleKey);
+ return atlas && this.batchAtlases.includes(atlas);
+ }
+ return true;
+ }, "canAddToCurrentBatch")
+ /**
+ * matrix is expected to be a 9 element array
+ * this function follows same pattern as CRp.drawCachedElementPortion(...)
+ */
+ }, {
+ key: "setTransformMatrix",
+ value: /* @__PURE__ */ __name(function setTransformMatrix(matrix, atlasInfo, ele) {
+ var first3 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
+ var bb = atlasInfo.bb, type3 = atlasInfo.type, tex1 = atlasInfo.tex1, tex2 = atlasInfo.tex2;
+ var opts = this.getRenderTypeOpts(type3);
+ var padding2 = opts.getPadding ? opts.getPadding(ele) : 0;
+ var ratio = tex1.w / (tex1.w + tex2.w);
+ if (!first3) {
+ ratio = 1 - ratio;
+ }
+ var adjBB = this.getAdjustedBB(bb, padding2, first3, ratio);
+ var x5, y5;
+ identity6(matrix);
+ var theta = opts.getRotation ? opts.getRotation(ele) : 0;
+ if (theta !== 0) {
+ var _opts$getRotationPoin = opts.getRotationPoint(ele), sx = _opts$getRotationPoin.x, sy = _opts$getRotationPoin.y;
+ translate(matrix, matrix, [sx, sy]);
+ rotate(matrix, matrix, theta);
+ var offset = opts.getRotationOffset(ele);
+ x5 = offset.x + adjBB.xOffset;
+ y5 = offset.y;
+ } else {
+ x5 = adjBB.x1;
+ y5 = adjBB.y1;
+ }
+ translate(matrix, matrix, [x5, y5]);
+ scale(matrix, matrix, [adjBB.w, adjBB.h]);
+ }, "setTransformMatrix")
+ }, {
+ key: "getTransformMatrix",
+ value: /* @__PURE__ */ __name(function getTransformMatrix(atlasInfo, ele) {
+ var first3 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
+ var matrix = create3();
+ this.setTransformMatrix(matrix, atlasInfo, ele, first3);
+ return matrix;
+ }, "getTransformMatrix")
+ /**
+ * Adjusts a node or label BB to accomodate padding and split for wrapped textures.
+ * @param bb - the original bounding box
+ * @param padding - the padding to add to the bounding box
+ * @param first - whether this is the first part of a wrapped texture
+ * @param ratio - the ratio of the texture width of part of the text to the entire texture
+ */
+ }, {
+ key: "getAdjustedBB",
+ value: /* @__PURE__ */ __name(function getAdjustedBB(bb, padding2, first3, ratio) {
+ var x1 = bb.x1, y1 = bb.y1, w3 = bb.w, h2 = bb.h;
+ if (padding2) {
+ x1 -= padding2;
+ y1 -= padding2;
+ w3 += 2 * padding2;
+ h2 += 2 * padding2;
+ }
+ var xOffset = 0;
+ var adjW = w3 * ratio;
+ if (first3 && ratio < 1) {
+ w3 = adjW;
+ } else if (!first3 && ratio < 1) {
+ xOffset = w3 - adjW;
+ x1 += xOffset;
+ w3 = adjW;
+ }
+ return {
+ x1,
+ y1,
+ w: w3,
+ h: h2,
+ xOffset
+ };
+ }, "getAdjustedBB")
+ }, {
+ key: "getDebugInfo",
+ value: /* @__PURE__ */ __name(function getDebugInfo() {
+ var debugInfo = [];
+ var _iterator7 = _createForOfIteratorHelper(this.renderTypes), _step7;
+ try {
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) {
+ var _step7$value = _slicedToArray(_step7.value, 2), type3 = _step7$value[0], opts = _step7$value[1];
+ var _opts$atlasCollection = opts.atlasCollection.getCounts(), keyCount = _opts$atlasCollection.keyCount, atlasCount = _opts$atlasCollection.atlasCount;
+ debugInfo.push({
+ type: type3,
+ keyCount,
+ atlasCount
+ });
+ }
+ } catch (err) {
+ _iterator7.e(err);
+ } finally {
+ _iterator7.f();
+ }
+ return debugInfo;
+ }, "getDebugInfo")
+ }]);
+ return AtlasManager2;
+ }();
+ TEXTURE = 0;
+ EDGE_STRAIGHT = 1;
+ EDGE_CURVE_SEGMENT = 2;
+ EDGE_ARROW = 3;
+ ElementDrawingWebGL = /* @__PURE__ */ function() {
+ function ElementDrawingWebGL2(r2, gl, opts) {
+ _classCallCheck(this, ElementDrawingWebGL2);
+ this.r = r2;
+ this.gl = gl;
+ this.maxInstances = opts.webglBatchSize;
+ this.maxAtlases = opts.webglTexPerBatch;
+ this.atlasSize = opts.webglTexSize;
+ this.bgColor = opts.bgColor;
+ opts.enableWrapping = true;
+ opts.createTextureCanvas = createTextureCanvas;
+ this.atlasManager = new AtlasManager(r2, opts);
+ this.program = this.createShaderProgram(RENDER_TARGET.SCREEN);
+ this.pickingProgram = this.createShaderProgram(RENDER_TARGET.PICKING);
+ this.vao = this.createVAO();
+ this.debugInfo = [];
+ }
+ __name(ElementDrawingWebGL2, "ElementDrawingWebGL");
+ _createClass(ElementDrawingWebGL2, [{
+ key: "addTextureRenderType",
+ value: /* @__PURE__ */ __name(function addTextureRenderType(type3, opts) {
+ this.atlasManager.addRenderType(type3, opts);
+ }, "addTextureRenderType")
+ }, {
+ key: "invalidate",
+ value: /* @__PURE__ */ __name(function invalidate(eles) {
+ var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, type3 = _ref.type;
+ var atlasManager = this.atlasManager;
+ if (type3) {
+ return atlasManager.invalidate(eles, {
+ filterType: /* @__PURE__ */ __name(function filterType(t4) {
+ return t4 === type3;
+ }, "filterType"),
+ forceRedraw: true
+ });
+ } else {
+ return atlasManager.invalidate(eles);
+ }
+ }, "invalidate")
+ }, {
+ key: "gc",
+ value: /* @__PURE__ */ __name(function gc2() {
+ this.atlasManager.gc();
+ }, "gc")
+ }, {
+ key: "createShaderProgram",
+ value: /* @__PURE__ */ __name(function createShaderProgram(renderTarget) {
+ var gl = this.gl;
+ var vertexShaderSource = "#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; \n\n // what are we rendering?\n in int aVertType;\n\n // for picking\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex1; // x/y/w/h of texture in atlas\n in vec4 aTex2; \n\n // for any transforms that are needed\n in vec4 aScaleRotate1; // vectors use fewer attributes than matrices\n in vec2 aTranslate1;\n in vec4 aScaleRotate2;\n in vec2 aTranslate2;\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in float aLineWidth;\n in vec4 aEdgeColor;\n\n out vec2 vTexCoord;\n out vec4 vEdgeColor;\n flat out int vAtlasId;\n flat out vec4 vIndex;\n flat out int vVertType;\n\n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition;\n\n if(aVertType == ".concat(TEXTURE, ") {\n float texX;\n float texY;\n float texW;\n float texH;\n mat3 texMatrix;\n\n int vid = gl_VertexID;\n if(vid <= 5) {\n texX = aTex1.x;\n texY = aTex1.y;\n texW = aTex1.z;\n texH = aTex1.w;\n texMatrix = mat3(\n vec3(aScaleRotate1.xy, 0.0),\n vec3(aScaleRotate2.zw, 0.0),\n vec3(aTranslate1, 1.0)\n );\n } else {\n texX = aTex2.x;\n texY = aTex2.y;\n texW = aTex2.z;\n texH = aTex2.w;\n texMatrix = mat3(\n vec3(aScaleRotate2.xy, 0.0),\n vec3(aScaleRotate2.zw, 0.0),\n vec3(aTranslate2, 1.0)\n );\n }\n\n if(vid == 1 || vid == 2 || vid == 4 || vid == 7 || vid == 8 || vid == 10) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5 || vid == 8 || vid == 10 || vid == 11) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * texMatrix * vec3(position, 1.0), 1.0);\n } \n else if(aVertType == ").concat(EDGE_STRAIGHT, " && vid < 6) {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vEdgeColor = aEdgeColor;\n } \n else if(aVertType == ").concat(EDGE_CURVE_SEGMENT, " && vid < 6) {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0 = pointA;\n vec2 p1 = pointB;\n vec2 p2 = pointC;\n vec2 pos = position;\n if(position.x == 1.0) {\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth;\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vEdgeColor = aEdgeColor;\n } \n else if(aVertType == ").concat(EDGE_ARROW, " && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n mat3 transform = mat3(\n vec3(aScaleRotate1.xy, 0.0),\n vec3(aScaleRotate1.zw, 0.0),\n vec3(aTranslate1, 1.0)\n );\n gl_Position = vec4(uPanZoomMatrix * transform * vec3(position, 1.0), 1.0);\n vEdgeColor = aEdgeColor;\n } else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vIndex = aIndex;\n vVertType = aVertType;\n }\n ");
+ var idxs = this.atlasManager.getIndexArray();
+ var fragmentShaderSource = "#version 300 es\n precision highp float;\n\n // define texture unit for each node in the batch\n ".concat(idxs.map(function(i3) {
+ return "uniform sampler2D uTexture".concat(i3, ";");
+ }).join("\n "), "\n\n uniform vec4 uBGColor;\n\n in vec2 vTexCoord;\n in vec4 vEdgeColor;\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n\n out vec4 outColor;\n\n void main(void) {\n if(vVertType == ").concat(TEXTURE, ") {\n ").concat(idxs.map(function(i3) {
+ return "if(vAtlasId == ".concat(i3, ") outColor = texture(uTexture").concat(i3, ", vTexCoord);");
+ }).join("\n else "), "\n } else if(vVertType == ").concat(EDGE_ARROW, ") {\n // blend arrow color with background (using premultiplied alpha)\n outColor.rgb = vEdgeColor.rgb + (uBGColor.rgb * (1.0 - vEdgeColor.a)); \n outColor.a = 1.0; // make opaque, masks out line under arrow\n } else {\n outColor = vEdgeColor;\n }\n\n ").concat(renderTarget.picking ? "if(outColor.a == 0.0) discard;\n else outColor = vIndex;" : "", "\n }\n ");
+ var program = createProgram(gl, vertexShaderSource, fragmentShaderSource);
+ program.aPosition = gl.getAttribLocation(program, "aPosition");
+ program.aIndex = gl.getAttribLocation(program, "aIndex");
+ program.aVertType = gl.getAttribLocation(program, "aVertType");
+ program.aAtlasId = gl.getAttribLocation(program, "aAtlasId");
+ program.aTex1 = gl.getAttribLocation(program, "aTex1");
+ program.aTex2 = gl.getAttribLocation(program, "aTex2");
+ program.aScaleRotate1 = gl.getAttribLocation(program, "aScaleRotate1");
+ program.aTranslate1 = gl.getAttribLocation(program, "aTranslate1");
+ program.aScaleRotate2 = gl.getAttribLocation(program, "aScaleRotate2");
+ program.aTranslate2 = gl.getAttribLocation(program, "aTranslate2");
+ program.aPointAPointB = gl.getAttribLocation(program, "aPointAPointB");
+ program.aPointCPointD = gl.getAttribLocation(program, "aPointCPointD");
+ program.aLineWidth = gl.getAttribLocation(program, "aLineWidth");
+ program.aEdgeColor = gl.getAttribLocation(program, "aEdgeColor");
+ program.uPanZoomMatrix = gl.getUniformLocation(program, "uPanZoomMatrix");
+ program.uAtlasSize = gl.getUniformLocation(program, "uAtlasSize");
+ program.uBGColor = gl.getUniformLocation(program, "uBGColor");
+ program.uTextures = [];
+ for (var i2 = 0; i2 < this.atlasManager.maxAtlases; i2++) {
+ program.uTextures.push(gl.getUniformLocation(program, "uTexture".concat(i2)));
+ }
+ return program;
+ }, "createShaderProgram")
+ }, {
+ key: "createVAO",
+ value: /* @__PURE__ */ __name(function createVAO() {
+ var quad = [0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1];
+ var instanceGeometry = [].concat(quad, quad);
+ this.vertexCount = instanceGeometry.length / 2;
+ var n2 = this.maxInstances;
+ var gl = this.gl, program = this.program;
+ var vao = gl.createVertexArray();
+ gl.bindVertexArray(vao);
+ createBufferStaticDraw(gl, "vec2", program.aPosition, instanceGeometry);
+ this.indexBuffer = createBufferDynamicDraw(gl, n2, "vec4", program.aIndex);
+ this.vertTypeBuffer = createBufferDynamicDraw(gl, n2, "int", program.aVertType);
+ this.atlasIdBuffer = createBufferDynamicDraw(gl, n2, "int", program.aAtlasId);
+ this.tex1Buffer = createBufferDynamicDraw(gl, n2, "vec4", program.aTex1);
+ this.tex2Buffer = createBufferDynamicDraw(gl, n2, "vec4", program.aTex2);
+ this.scaleRotate1Buffer = createBufferDynamicDraw(gl, n2, "vec4", program.aScaleRotate1);
+ this.translate1Buffer = createBufferDynamicDraw(gl, n2, "vec2", program.aTranslate1);
+ this.scaleRotate2Buffer = createBufferDynamicDraw(gl, n2, "vec4", program.aScaleRotate2);
+ this.translate2Buffer = createBufferDynamicDraw(gl, n2, "vec2", program.aTranslate2);
+ this.pointAPointBBuffer = createBufferDynamicDraw(gl, n2, "vec4", program.aPointAPointB);
+ this.pointCPointDBuffer = createBufferDynamicDraw(gl, n2, "vec4", program.aPointCPointD);
+ this.lineWidthBuffer = createBufferDynamicDraw(gl, n2, "float", program.aLineWidth);
+ this.edgeColorBuffer = createBufferDynamicDraw(gl, n2, "vec4", program.aEdgeColor);
+ gl.bindVertexArray(null);
+ return vao;
+ }, "createVAO")
+ }, {
+ key: "buffers",
+ get: /* @__PURE__ */ __name(function get6() {
+ var _this = this;
+ if (!this._buffers) {
+ this._buffers = Object.keys(this).filter(function(k2) {
+ return k2.endsWith("Buffer");
+ }).map(function(k2) {
+ return _this[k2];
+ });
+ }
+ return this._buffers;
+ }, "get")
+ }, {
+ key: "startFrame",
+ value: /* @__PURE__ */ __name(function startFrame(panZoomMatrix, debugInfo) {
+ var renderTarget = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : RENDER_TARGET.SCREEN;
+ this.panZoomMatrix = panZoomMatrix;
+ this.debugInfo = debugInfo;
+ this.renderTarget = renderTarget;
+ this.startBatch();
+ }, "startFrame")
+ }, {
+ key: "startBatch",
+ value: /* @__PURE__ */ __name(function startBatch2() {
+ this.instanceCount = 0;
+ this.atlasManager.startBatch();
+ }, "startBatch")
+ }, {
+ key: "endFrame",
+ value: /* @__PURE__ */ __name(function endFrame() {
+ this.endBatch();
+ }, "endFrame")
+ }, {
+ key: "getTempMatrix",
+ value: /* @__PURE__ */ __name(function getTempMatrix() {
+ return this.tempMatrix = this.tempMatrix || create3();
+ }, "getTempMatrix")
+ }, {
+ key: "drawTexture",
+ value: /* @__PURE__ */ __name(function drawTexture(ele, eleIndex, type3) {
+ var atlasManager = this.atlasManager;
+ if (!atlasManager.isRenderable(ele, type3)) {
+ return;
+ }
+ if (!atlasManager.canAddToCurrentBatch(ele, type3)) {
+ this.endBatch();
+ }
+ var instance2 = this.instanceCount;
+ this.vertTypeBuffer.getView(instance2)[0] = TEXTURE;
+ var indexView = this.indexBuffer.getView(instance2);
+ indexToVec4(eleIndex, indexView);
+ var atlasInfo = atlasManager.getAtlasInfo(ele, type3, atlasInfo);
+ var atlasID = atlasInfo.atlasID, tex1 = atlasInfo.tex1, tex2 = atlasInfo.tex2;
+ var atlasIdView = this.atlasIdBuffer.getView(instance2);
+ atlasIdView[0] = atlasID;
+ var tex1View = this.tex1Buffer.getView(instance2);
+ tex1View[0] = tex1.x;
+ tex1View[1] = tex1.y;
+ tex1View[2] = tex1.w;
+ tex1View[3] = tex1.h;
+ var tex2View = this.tex2Buffer.getView(instance2);
+ tex2View[0] = tex2.x;
+ tex2View[1] = tex2.y;
+ tex2View[2] = tex2.w;
+ tex2View[3] = tex2.h;
+ var transform8 = this.getTempMatrix();
+ for (var _i = 0, _arr = [1, 2]; _i < _arr.length; _i++) {
+ var tex = _arr[_i];
+ atlasManager.setTransformMatrix(transform8, atlasInfo, ele, tex === 1);
+ var scaleRotateView = this["scaleRotate".concat(tex, "Buffer")].getView(instance2);
+ scaleRotateView[0] = transform8[0];
+ scaleRotateView[1] = transform8[1];
+ scaleRotateView[2] = transform8[3];
+ scaleRotateView[3] = transform8[4];
+ var translateView = this["translate".concat(tex, "Buffer")].getView(instance2);
+ translateView[0] = transform8[6];
+ translateView[1] = transform8[7];
+ }
+ this.instanceCount++;
+ if (this.instanceCount >= this.maxInstances) {
+ this.endBatch();
+ }
+ }, "drawTexture")
+ }, {
+ key: "drawEdgeArrow",
+ value: /* @__PURE__ */ __name(function drawEdgeArrow(edge, eleIndex, prefix) {
+ var rs = edge._private.rscratch;
+ var x5, y5, angle2;
+ if (prefix === "source") {
+ x5 = rs.arrowStartX;
+ y5 = rs.arrowStartY;
+ angle2 = rs.srcArrowAngle;
+ } else {
+ x5 = rs.arrowEndX;
+ y5 = rs.arrowEndY;
+ angle2 = rs.tgtArrowAngle;
+ }
+ if (isNaN(x5) || x5 == null || isNaN(y5) || y5 == null || isNaN(angle2) || angle2 == null) {
+ return;
+ }
+ var arrowShape = edge.pstyle(prefix + "-arrow-shape").value;
+ if (arrowShape === "none") {
+ return;
+ }
+ var color2 = edge.pstyle(prefix + "-arrow-color").value;
+ var baseOpacity = edge.pstyle("opacity").value;
+ var lineOpacity = edge.pstyle("line-opacity").value;
+ var opacity = baseOpacity * lineOpacity;
+ var lineWidth = edge.pstyle("width").pfValue;
+ var scale$1 = edge.pstyle("arrow-scale").value;
+ var size5 = this.r.getArrowWidth(lineWidth, scale$1);
+ var transform8 = this.getTempMatrix();
+ identity6(transform8);
+ translate(transform8, transform8, [x5, y5]);
+ scale(transform8, transform8, [size5, size5]);
+ rotate(transform8, transform8, angle2);
+ var instance2 = this.instanceCount;
+ this.vertTypeBuffer.getView(instance2)[0] = EDGE_ARROW;
+ var indexView = this.indexBuffer.getView(instance2);
+ indexToVec4(eleIndex, indexView);
+ var colorView = this.edgeColorBuffer.getView(instance2);
+ toWebGLColor(color2, opacity, colorView);
+ var scaleRotateView = this.scaleRotate1Buffer.getView(instance2);
+ scaleRotateView[0] = transform8[0];
+ scaleRotateView[1] = transform8[1];
+ scaleRotateView[2] = transform8[3];
+ scaleRotateView[3] = transform8[4];
+ var translateView = this.translate1Buffer.getView(instance2);
+ translateView[0] = transform8[6];
+ translateView[1] = transform8[7];
+ this.instanceCount++;
+ if (this.instanceCount >= this.maxInstances) {
+ this.endBatch();
+ }
+ }, "drawEdgeArrow")
+ }, {
+ key: "drawEdgeLine",
+ value: /* @__PURE__ */ __name(function drawEdgeLine(edge, eleIndex) {
+ var baseOpacity = edge.pstyle("opacity").value;
+ var lineOpacity = edge.pstyle("line-opacity").value;
+ var width3 = edge.pstyle("width").pfValue;
+ var color2 = edge.pstyle("line-color").value;
+ var opacity = baseOpacity * lineOpacity;
+ var points = this.getEdgePoints(edge);
+ if (points.length / 2 + this.instanceCount > this.maxInstances) {
+ this.endBatch();
+ }
+ if (points.length == 4) {
+ var instance2 = this.instanceCount;
+ this.vertTypeBuffer.getView(instance2)[0] = EDGE_STRAIGHT;
+ var indexView = this.indexBuffer.getView(instance2);
+ indexToVec4(eleIndex, indexView);
+ var colorView = this.edgeColorBuffer.getView(instance2);
+ toWebGLColor(color2, opacity, colorView);
+ var lineWidthBuffer = this.lineWidthBuffer.getView(instance2);
+ lineWidthBuffer[0] = width3;
+ var sourceTargetView = this.pointAPointBBuffer.getView(instance2);
+ sourceTargetView[0] = points[0];
+ sourceTargetView[1] = points[1];
+ sourceTargetView[2] = points[2];
+ sourceTargetView[3] = points[3];
+ this.instanceCount++;
+ if (this.instanceCount >= this.maxInstances) {
+ this.endBatch();
+ }
+ } else {
+ for (var i2 = 0; i2 < points.length - 2; i2 += 2) {
+ var _instance = this.instanceCount;
+ this.vertTypeBuffer.getView(_instance)[0] = EDGE_CURVE_SEGMENT;
+ var _indexView = this.indexBuffer.getView(_instance);
+ indexToVec4(eleIndex, _indexView);
+ var _colorView = this.edgeColorBuffer.getView(_instance);
+ toWebGLColor(color2, opacity, _colorView);
+ var _lineWidthBuffer = this.lineWidthBuffer.getView(_instance);
+ _lineWidthBuffer[0] = width3;
+ var pAx = points[i2 - 2], pAy = points[i2 - 1];
+ var pBx = points[i2], pBy = points[i2 + 1];
+ var pCx = points[i2 + 2], pCy = points[i2 + 3];
+ var pDx = points[i2 + 4], pDy = points[i2 + 5];
+ if (i2 == 0) {
+ pAx = 2 * pBx - pCx + 1e-3;
+ pAy = 2 * pBy - pCy + 1e-3;
+ }
+ if (i2 == points.length - 4) {
+ pDx = 2 * pCx - pBx + 1e-3;
+ pDy = 2 * pCy - pBy + 1e-3;
+ }
+ var pointABView = this.pointAPointBBuffer.getView(_instance);
+ pointABView[0] = pAx;
+ pointABView[1] = pAy;
+ pointABView[2] = pBx;
+ pointABView[3] = pBy;
+ var pointCDView = this.pointCPointDBuffer.getView(_instance);
+ pointCDView[0] = pCx;
+ pointCDView[1] = pCy;
+ pointCDView[2] = pDx;
+ pointCDView[3] = pDy;
+ this.instanceCount++;
+ if (this.instanceCount >= this.maxInstances) {
+ this.endBatch();
+ }
+ }
+ }
+ }, "drawEdgeLine")
+ }, {
+ key: "getEdgePoints",
+ value: /* @__PURE__ */ __name(function getEdgePoints(edge) {
+ var rs = edge._private.rscratch;
+ var controlPoints4 = rs.allpts;
+ if (controlPoints4.length == 4) {
+ return controlPoints4;
+ }
+ var numSegments = this.getNumSegments(edge);
+ return this.getCurveSegmentPoints(controlPoints4, numSegments);
+ }, "getEdgePoints")
+ }, {
+ key: "getNumSegments",
+ value: /* @__PURE__ */ __name(function getNumSegments(edge) {
+ var numSegments = 15;
+ return Math.min(Math.max(numSegments, 5), this.maxInstances);
+ }, "getNumSegments")
+ }, {
+ key: "getCurveSegmentPoints",
+ value: /* @__PURE__ */ __name(function getCurveSegmentPoints(controlPoints4, segments) {
+ if (controlPoints4.length == 4) {
+ return controlPoints4;
+ }
+ var curvePoints = Array((segments + 1) * 2);
+ for (var i2 = 0; i2 <= segments; i2++) {
+ if (i2 == 0) {
+ curvePoints[0] = controlPoints4[0];
+ curvePoints[1] = controlPoints4[1];
+ } else if (i2 == segments) {
+ curvePoints[i2 * 2] = controlPoints4[controlPoints4.length - 2];
+ curvePoints[i2 * 2 + 1] = controlPoints4[controlPoints4.length - 1];
+ } else {
+ var t4 = i2 / segments;
+ this.setCurvePoint(controlPoints4, t4, curvePoints, i2 * 2);
+ }
+ }
+ return curvePoints;
+ }, "getCurveSegmentPoints")
+ }, {
+ key: "setCurvePoint",
+ value: /* @__PURE__ */ __name(function setCurvePoint(points, t4, curvePoints, cpi) {
+ if (points.length <= 2) {
+ curvePoints[cpi] = points[0];
+ curvePoints[cpi + 1] = points[1];
+ } else {
+ var newpoints = Array(points.length - 2);
+ for (var i2 = 0; i2 < newpoints.length; i2 += 2) {
+ var x5 = (1 - t4) * points[i2] + t4 * points[i2 + 2];
+ var y5 = (1 - t4) * points[i2 + 1] + t4 * points[i2 + 3];
+ newpoints[i2] = x5;
+ newpoints[i2 + 1] = y5;
+ }
+ return this.setCurvePoint(newpoints, t4, curvePoints, cpi);
+ }
+ }, "setCurvePoint")
+ }, {
+ key: "endBatch",
+ value: /* @__PURE__ */ __name(function endBatch2() {
+ var gl = this.gl, vao = this.vao, vertexCount = this.vertexCount, count = this.instanceCount;
+ if (count === 0) return;
+ var program = this.renderTarget.picking ? this.pickingProgram : this.program;
+ gl.useProgram(program);
+ gl.bindVertexArray(vao);
+ var _iterator = _createForOfIteratorHelper(this.buffers), _step;
+ try {
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
+ var buffer = _step.value;
+ buffer.bufferSubData(count);
+ }
+ } catch (err) {
+ _iterator.e(err);
+ } finally {
+ _iterator.f();
+ }
+ var atlases = this.atlasManager.getAtlases();
+ for (var i2 = 0; i2 < atlases.length; i2++) {
+ atlases[i2].bufferIfNeeded(gl);
+ }
+ for (var _i2 = 0; _i2 < atlases.length; _i2++) {
+ gl.activeTexture(gl.TEXTURE0 + _i2);
+ gl.bindTexture(gl.TEXTURE_2D, atlases[_i2].texture);
+ gl.uniform1i(program.uTextures[_i2], _i2);
+ }
+ gl.uniformMatrix3fv(program.uPanZoomMatrix, false, this.panZoomMatrix);
+ gl.uniform1i(program.uAtlasSize, this.atlasManager.atlasSize);
+ var webglBgColor = toWebGLColor(this.bgColor, 1);
+ gl.uniform4fv(program.uBGColor, webglBgColor);
+ gl.drawArraysInstanced(gl.TRIANGLES, 0, vertexCount, count);
+ gl.bindVertexArray(null);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ if (this.debugInfo) {
+ this.debugInfo.push({
+ count,
+ atlasCount: atlases.length
+ });
+ }
+ this.startBatch();
+ }, "endBatch")
+ }, {
+ key: "getDebugInfo",
+ value: /* @__PURE__ */ __name(function getDebugInfo() {
+ return this.debugInfo;
+ }, "getDebugInfo")
+ }, {
+ key: "getAtlasDebugInfo",
+ value: /* @__PURE__ */ __name(function getAtlasDebugInfo() {
+ return this.atlasManager.getDebugInfo();
+ }, "getAtlasDebugInfo")
+ }]);
+ return ElementDrawingWebGL2;
+ }();
+ __name(fillStyle, "fillStyle");
+ OverlayUnderlayRenderer = /* @__PURE__ */ function() {
+ function OverlayUnderlayRenderer2(r2) {
+ _classCallCheck(this, OverlayUnderlayRenderer2);
+ this.r = r2;
+ }
+ __name(OverlayUnderlayRenderer2, "OverlayUnderlayRenderer");
+ _createClass(OverlayUnderlayRenderer2, [{
+ key: "getStyleKey",
+ value: /* @__PURE__ */ __name(function getStyleKey(type3, node2) {
+ var _this$getStyle = this.getStyle(type3, node2), shape = _this$getStyle.shape, opacity = _this$getStyle.opacity, color2 = _this$getStyle.color;
+ if (!shape) return null;
+ var w3 = node2.width();
+ var h2 = node2.height();
+ var c3 = fillStyle(color2, opacity);
+ return hashString("".concat(shape, "-").concat(w3, "-").concat(h2, "-").concat(c3));
+ }, "getStyleKey")
+ }, {
+ key: "isVisible",
+ value: /* @__PURE__ */ __name(function isVisible(type3, node2) {
+ var opacity = node2.pstyle("".concat(type3, "-opacity")).value;
+ return opacity > 0;
+ }, "isVisible")
+ }, {
+ key: "getStyle",
+ value: /* @__PURE__ */ __name(function getStyle(type3, node2) {
+ var opacity = node2.pstyle("".concat(type3, "-opacity")).value;
+ var color2 = node2.pstyle("".concat(type3, "-color")).value;
+ var shape = node2.pstyle("".concat(type3, "-shape")).value;
+ return {
+ opacity,
+ color: color2,
+ shape
+ };
+ }, "getStyle")
+ }, {
+ key: "getPadding",
+ value: /* @__PURE__ */ __name(function getPadding(type3, node2) {
+ return node2.pstyle("".concat(type3, "-padding")).pfValue;
+ }, "getPadding")
+ }, {
+ key: "draw",
+ value: /* @__PURE__ */ __name(function draw25(type3, context, node2, bb) {
+ if (!this.isVisible(type3, node2)) return;
+ var r2 = this.r;
+ var w3 = bb.w;
+ var h2 = bb.h;
+ var x5 = w3 / 2;
+ var y5 = h2 / 2;
+ var _this$getStyle2 = this.getStyle(type3, node2), shape = _this$getStyle2.shape, color2 = _this$getStyle2.color, opacity = _this$getStyle2.opacity;
+ context.save();
+ context.fillStyle = fillStyle(color2, opacity);
+ if (shape === "round-rectangle" || shape === "roundrectangle") {
+ r2.drawRoundRectanglePath(context, x5, y5, w3, h2, "auto");
+ } else if (shape === "ellipse") {
+ r2.drawEllipsePath(context, x5, y5, w3, h2);
+ }
+ context.fill();
+ context.restore();
+ }, "draw")
+ }]);
+ return OverlayUnderlayRenderer2;
+ }();
+ __name(getBGColor, "getBGColor");
+ CRp$4 = {};
+ CRp$4.initWebgl = function(opts, fns) {
+ var r2 = this;
+ var gl = r2.data.contexts[r2.WEBGL];
+ var container2 = opts.cy.container();
+ opts.bgColor = getBGColor(container2);
+ opts.webglTexSize = Math.min(opts.webglTexSize, gl.getParameter(gl.MAX_TEXTURE_SIZE));
+ opts.webglTexRows = Math.min(opts.webglTexRows, 54);
+ opts.webglBatchSize = Math.min(opts.webglBatchSize, 16384);
+ opts.webglTexPerBatch = Math.min(opts.webglTexPerBatch, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));
+ r2.webglDebug = opts.webglDebug;
+ r2.webglDebugShowAtlases = opts.webglDebugShowAtlases;
+ console.log("max texture units", gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));
+ console.log("max texture size", gl.getParameter(gl.MAX_TEXTURE_SIZE));
+ console.log("webgl options", opts);
+ r2.pickingFrameBuffer = createPickingFrameBuffer(gl);
+ r2.pickingFrameBuffer.needsDraw = true;
+ var getLabelRotation3 = /* @__PURE__ */ __name(function getLabelRotation4(ele) {
+ return r2.getTextAngle(ele, null);
+ }, "getLabelRotation");
+ var isLabelVisible = /* @__PURE__ */ __name(function isLabelVisible2(ele) {
+ var label = ele.pstyle("label");
+ return label && label.value;
+ }, "isLabelVisible");
+ r2.eleDrawing = new ElementDrawingWebGL(r2, gl, opts);
+ var our = new OverlayUnderlayRenderer(r2);
+ r2.eleDrawing.addTextureRenderType("node-body", renderDefaults({
+ getKey: fns.getStyleKey,
+ getBoundingBox: fns.getElementBox,
+ drawElement: fns.drawElement,
+ isVisible: /* @__PURE__ */ __name(function isVisible(ele) {
+ return ele.visible();
+ }, "isVisible")
+ }));
+ r2.eleDrawing.addTextureRenderType("node-label", renderDefaults({
+ getKey: fns.getLabelKey,
+ getBoundingBox: fns.getLabelBox,
+ drawElement: fns.drawLabel,
+ getRotation: getLabelRotation3,
+ getRotationPoint: fns.getLabelRotationPoint,
+ getRotationOffset: fns.getLabelRotationOffset,
+ isVisible: isLabelVisible
+ }));
+ r2.eleDrawing.addTextureRenderType("node-overlay", renderDefaults({
+ getBoundingBox: fns.getElementBox,
+ getKey: /* @__PURE__ */ __name(function getKey3(ele) {
+ return our.getStyleKey("overlay", ele);
+ }, "getKey"),
+ drawElement: /* @__PURE__ */ __name(function drawElement(ctx, ele, bb) {
+ return our.draw("overlay", ctx, ele, bb);
+ }, "drawElement"),
+ isVisible: /* @__PURE__ */ __name(function isVisible(ele) {
+ return our.isVisible("overlay", ele);
+ }, "isVisible"),
+ getPadding: /* @__PURE__ */ __name(function getPadding(ele) {
+ return our.getPadding("overlay", ele);
+ }, "getPadding")
+ }));
+ r2.eleDrawing.addTextureRenderType("node-underlay", renderDefaults({
+ getBoundingBox: fns.getElementBox,
+ getKey: /* @__PURE__ */ __name(function getKey3(ele) {
+ return our.getStyleKey("underlay", ele);
+ }, "getKey"),
+ drawElement: /* @__PURE__ */ __name(function drawElement(ctx, ele, bb) {
+ return our.draw("underlay", ctx, ele, bb);
+ }, "drawElement"),
+ isVisible: /* @__PURE__ */ __name(function isVisible(ele) {
+ return our.isVisible("underlay", ele);
+ }, "isVisible"),
+ getPadding: /* @__PURE__ */ __name(function getPadding(ele) {
+ return our.getPadding("underlay", ele);
+ }, "getPadding")
+ }));
+ r2.eleDrawing.addTextureRenderType("edge-label", renderDefaults({
+ getKey: fns.getLabelKey,
+ getBoundingBox: fns.getLabelBox,
+ drawElement: fns.drawLabel,
+ getRotation: getLabelRotation3,
+ getRotationPoint: fns.getLabelRotationPoint,
+ getRotationOffset: fns.getLabelRotationOffset,
+ isVisible: isLabelVisible
+ }));
+ var setGCFlag = debounce_1(function() {
+ console.log("garbage collect flag set");
+ r2.data.gc = true;
+ }, 1e4);
+ r2.onUpdateEleCalcs(function(willDraw, eles) {
+ var gcNeeded = false;
+ if (eles && eles.length > 0) {
+ gcNeeded |= r2.eleDrawing.invalidate(eles);
+ }
+ if (gcNeeded) {
+ setGCFlag();
}
- }
- r2.prevViewport = vp;
- if (r2.clearingMotionBlur) {
- r2.clearingMotionBlur = false;
- r2.motionBlurCleared = true;
- r2.motionBlur = true;
- }
- if (motionBlur) {
- r2.motionBlurTimeout = setTimeout(function() {
- r2.motionBlurTimeout = null;
- r2.clearedForMotionBlur[r2.NODE] = false;
- r2.clearedForMotionBlur[r2.DRAG] = false;
- r2.motionBlur = false;
- r2.clearingMotionBlur = !textureDraw;
- r2.mbFrames = 0;
- needDraw[r2.NODE] = true;
- needDraw[r2.DRAG] = true;
- r2.redraw();
- }, motionBlurDelay);
- }
- if (!forcedContext) {
- cy.emit("render");
- }
- };
+ });
+ overrideCanvasRendererFunctions(r2);
+ };
+ __name(overrideCanvasRendererFunctions, "overrideCanvasRendererFunctions");
+ __name(clearWebgl, "clearWebgl");
+ __name(clearCanvas, "clearCanvas");
+ __name(createPanZoomMatrix, "createPanZoomMatrix");
+ __name(setContextTransform, "setContextTransform");
+ __name(drawSelectionRectangle, "drawSelectionRectangle");
+ __name(drawAxes, "drawAxes");
+ __name(drawAtlases, "drawAtlases");
+ __name(getPickingIndexes, "getPickingIndexes");
+ __name(findNearestElementsWebgl, "findNearestElementsWebgl");
+ __name(renderWebgl, "renderWebgl");
CRp$3 = {};
CRp$3.drawPolygonPath = function(context, x5, y5, width3, height2, points) {
var halfW = width3 / 2;
@@ -121179,28 +128496,28 @@ g.stateGroup line {
var height2 = options3.full ? Math.ceil(bb.h) : ctrRect[3];
var specdMaxDims = number$1(options3.maxWidth) || number$1(options3.maxHeight);
var pxRatio = this.getPixelRatio();
- var scale = 1;
+ var scale2 = 1;
if (options3.scale !== void 0) {
width3 *= options3.scale;
height2 *= options3.scale;
- scale = options3.scale;
+ scale2 = options3.scale;
} else if (specdMaxDims) {
var maxScaleW = Infinity;
var maxScaleH = Infinity;
if (number$1(options3.maxWidth)) {
- maxScaleW = scale * options3.maxWidth / width3;
+ maxScaleW = scale2 * options3.maxWidth / width3;
}
if (number$1(options3.maxHeight)) {
- maxScaleH = scale * options3.maxHeight / height2;
+ maxScaleH = scale2 * options3.maxHeight / height2;
}
- scale = Math.min(maxScaleW, maxScaleH);
- width3 *= scale;
- height2 *= scale;
+ scale2 = Math.min(maxScaleW, maxScaleH);
+ width3 *= scale2;
+ height2 *= scale2;
}
if (!specdMaxDims) {
width3 *= pxRatio;
height2 *= pxRatio;
- scale *= pxRatio;
+ scale2 *= pxRatio;
}
var buffCanvas = document.createElement("canvas");
buffCanvas.width = width3;
@@ -121213,22 +128530,22 @@ g.stateGroup line {
buffCxt.globalCompositeOperation = "source-over";
var zsortedEles = this.getCachedZSortedEles();
if (options3.full) {
- buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale);
- buffCxt.scale(scale, scale);
+ buffCxt.translate(-bb.x1 * scale2, -bb.y1 * scale2);
+ buffCxt.scale(scale2, scale2);
this.drawElements(buffCxt, zsortedEles);
- buffCxt.scale(1 / scale, 1 / scale);
- buffCxt.translate(bb.x1 * scale, bb.y1 * scale);
+ buffCxt.scale(1 / scale2, 1 / scale2);
+ buffCxt.translate(bb.x1 * scale2, bb.y1 * scale2);
} else {
var pan2 = cy.pan();
var translation = {
- x: pan2.x * scale,
- y: pan2.y * scale
+ x: pan2.x * scale2,
+ y: pan2.y * scale2
};
- scale *= cy.zoom();
+ scale2 *= cy.zoom();
buffCxt.translate(translation.x, translation.y);
- buffCxt.scale(scale, scale);
+ buffCxt.scale(scale2, scale2);
this.drawElements(buffCxt, zsortedEles);
- buffCxt.scale(1 / scale, 1 / scale);
+ buffCxt.scale(1 / scale2, 1 / scale2);
buffCxt.translate(-translation.x, -translation.y);
}
if (options3.bg) {
@@ -121277,6 +128594,8 @@ g.stateGroup line {
CRp.SELECT_BOX = 0;
CRp.DRAG = 1;
CRp.NODE = 2;
+ CRp.WEBGL = 3;
+ CRp.CANVAS_TYPES = ["2d", "2d", "2d", "webgl2"];
CRp.BUFFER_COUNT = 3;
CRp.TEXTURE_BUFFER = 0;
CRp.MOTIONBLUR_BUFFER_NODE = 1;
@@ -121294,6 +128613,9 @@ g.stateGroup line {
case "select":
r2.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool2;
break;
+ case "gc":
+ r2.data.gc = true;
+ break;
}
};
pathsImpld = typeof Path2D !== "undefined";
@@ -121335,8 +128657,8 @@ g.stateGroup line {
}
return canvas;
};
- [CRp$a, CRp$9, CRp$8, CRp$7, CRp$6, CRp$5, CRp$4, CRp$3, CRp$2, CRp$1].forEach(function(props) {
- extend2(CRp, props);
+ [CRp$b, CRp$a, CRp$9, CRp$8, CRp$7, CRp$6, CRp$5, CRp$4, CRp$3, CRp$2, CRp$1].forEach(function(props) {
+ extend4(CRp, props);
});
renderer5 = [{
name: "null",
@@ -121361,7 +128683,7 @@ g.stateGroup line {
__name(getExtension, "getExtension");
__name(setModule, "setModule");
__name(getModule, "getModule");
- extension3 = /* @__PURE__ */ __name(function extension4() {
+ extension2 = /* @__PURE__ */ __name(function extension3() {
if (arguments.length === 2) {
return getExtension.apply(null, arguments);
} else if (arguments.length === 3) {
@@ -121374,7 +128696,7 @@ g.stateGroup line {
error("Invalid extension access syntax");
}
}, "extension");
- Core.prototype.extension = extension3;
+ Core.prototype.extension = extension2;
incExts.forEach(function(group2) {
group2.extensions.forEach(function(ext) {
setExtension(group2.type, ext.name, ext.impl);
@@ -121446,7 +128768,7 @@ g.stateGroup line {
}
return style3;
};
- version3 = "3.30.1";
+ version = "3.31.0";
cytoscape2 = /* @__PURE__ */ __name(function cytoscape3(options3) {
if (options3 === void 0) {
options3 = {};
@@ -121454,7 +128776,7 @@ g.stateGroup line {
if (plainObject(options3)) {
return new Core(options3);
} else if (string(options3)) {
- return extension3.apply(extension3, arguments);
+ return extension2.apply(extension2, arguments);
}
}, "cytoscape");
cytoscape2.use = function(ext) {
@@ -121466,7 +128788,7 @@ g.stateGroup line {
cytoscape2.warnings = function(bool2) {
return warnings(bool2);
};
- cytoscape2.version = version3;
+ cytoscape2.version = version;
cytoscape2.stylesheet = cytoscape2.Stylesheet = Stylesheet;
}
});
@@ -121781,13 +129103,13 @@ g.stateGroup line {
});
return edgeList2;
};
- LNode.prototype.getEdgesBetween = function(other) {
+ LNode.prototype.getEdgesBetween = function(other2) {
var edgeList2 = [];
var edge;
var self2 = this;
self2.edges.forEach(function(edge2) {
if (!(edge2.source == self2 || edge2.target == self2)) throw "Incorrect edge source and/or target";
- if (edge2.target == other || edge2.source == other) {
+ if (edge2.target == other2 || edge2.source == other2) {
edgeList2.push(edge2);
}
});
@@ -122561,10 +129883,10 @@ g.stateGroup line {
var targetNode;
var sourceAncestorGraph;
var targetAncestorGraph;
- var edges5 = this.getAllEdges();
- var s2 = edges5.length;
+ var edges3 = this.getAllEdges();
+ var s2 = edges3.length;
for (var i2 = 0; i2 < s2; i2++) {
- edge = edges5[i2];
+ edge = edges3[i2];
sourceNode = edge.source;
targetNode = edge.target;
edge.lca = null;
@@ -122941,8 +130263,8 @@ g.stateGroup line {
return 1 + line2 % 4;
}
};
- IGeometry.getIntersection = function(s1, s2, f1, f22) {
- if (f22 == null) {
+ IGeometry.getIntersection = function(s1, s2, f1, f2) {
+ if (f2 == null) {
return this.getIntersection2(s1, s2, f1);
}
var x1 = s1.x;
@@ -122951,8 +130273,8 @@ g.stateGroup line {
var y22 = s2.y;
var x32 = f1.x;
var y32 = f1.y;
- var x42 = f22.x;
- var y42 = f22.y;
+ var x42 = f2.x;
+ var y42 = f2.y;
var x5 = void 0, y5 = void 0;
var a1 = void 0, a2 = void 0, b1 = void 0, b2 = void 0, c1 = void 0, c22 = void 0;
var denom = void 0;
@@ -123386,9 +130708,9 @@ g.stateGroup line {
UniqueIDGeneretor.lastID++;
return obj.uniqueID;
};
- UniqueIDGeneretor.getString = function(id27) {
- if (id27 == null) id27 = UniqueIDGeneretor.lastID;
- return "Object#" + id27;
+ UniqueIDGeneretor.getString = function(id29) {
+ if (id29 == null) id29 = UniqueIDGeneretor.lastID;
+ return "Object#" + id29;
};
UniqueIDGeneretor.isPrimitive = function(arg) {
var type3 = typeof arg === "undefined" ? "undefined" : _typeof2(arg);
@@ -123400,7 +130722,7 @@ g.stateGroup line {
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function _toConsumableArray(arr) {
+ function _toConsumableArray2(arr) {
if (Array.isArray(arr)) {
for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
arr2[i2] = arr[i2];
@@ -123410,7 +130732,7 @@ g.stateGroup line {
return Array.from(arr);
}
}
- __name(_toConsumableArray, "_toConsumableArray");
+ __name(_toConsumableArray2, "_toConsumableArray");
var LayoutConstants = __webpack_require__(0);
var LGraphManager = __webpack_require__(6);
var LNode = __webpack_require__(3);
@@ -123418,9 +130740,9 @@ g.stateGroup line {
var LGraph = __webpack_require__(5);
var PointD = __webpack_require__(4);
var Transform2 = __webpack_require__(17);
- var Emitter3 = __webpack_require__(27);
+ var Emitter4 = __webpack_require__(27);
function Layout2(isRemoteUse) {
- Emitter3.call(this);
+ Emitter4.call(this);
this.layoutQuality = LayoutConstants.QUALITY;
this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;
@@ -123439,7 +130761,7 @@ g.stateGroup line {
}
__name(Layout2, "Layout");
Layout2.RANDOM_SEED = 1;
- Layout2.prototype = Object.create(Emitter3.prototype);
+ Layout2.prototype = Object.create(Emitter4.prototype);
Layout2.prototype.getGraphManager = function() {
return this.graphManager;
};
@@ -123620,7 +130942,7 @@ g.stateGroup line {
}
var visited = /* @__PURE__ */ new Set();
var toBeVisited = [];
- var parents4 = /* @__PURE__ */ new Map();
+ var parents3 = /* @__PURE__ */ new Map();
var unProcessedNodes = [];
unProcessedNodes = unProcessedNodes.concat(allNodes);
while (unProcessedNodes.length > 0 && isForest) {
@@ -123632,10 +130954,10 @@ g.stateGroup line {
var neighborEdges = currentNode.getEdges();
for (var i2 = 0; i2 < neighborEdges.length; i2++) {
var currentNeighbor = neighborEdges[i2].getOtherEnd(currentNode);
- if (parents4.get(currentNode) != currentNeighbor) {
+ if (parents3.get(currentNode) != currentNeighbor) {
if (!visited.has(currentNeighbor)) {
toBeVisited.push(currentNeighbor);
- parents4.set(currentNeighbor, currentNode);
+ parents3.set(currentNeighbor, currentNode);
} else {
isForest = false;
break;
@@ -123646,7 +130968,7 @@ g.stateGroup line {
if (!isForest) {
flatForest = [];
} else {
- var temp = [].concat(_toConsumableArray(visited));
+ var temp = [].concat(_toConsumableArray2(visited));
flatForest.push(temp);
for (var i2 = 0; i2 < temp.length; i2++) {
var value2 = temp[i2];
@@ -123656,7 +130978,7 @@ g.stateGroup line {
}
}
visited = /* @__PURE__ */ new Set();
- parents4 = /* @__PURE__ */ new Map();
+ parents3 = /* @__PURE__ */ new Map();
}
}
return flatForest;
@@ -123685,11 +131007,11 @@ g.stateGroup line {
return dummyNodes;
};
Layout2.prototype.createBendpointsFromDummyNodes = function() {
- var edges5 = [];
- edges5 = edges5.concat(this.graphManager.getAllEdges());
- edges5 = [].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges5);
- for (var k2 = 0; k2 < edges5.length; k2++) {
- var lEdge = edges5[k2];
+ var edges3 = [];
+ edges3 = edges3.concat(this.graphManager.getAllEdges());
+ edges3 = [].concat(_toConsumableArray2(this.edgeToDummyNodes.keys())).concat(edges3);
+ for (var k2 = 0; k2 < edges3.length; k2++) {
+ var lEdge = edges3[k2];
if (lEdge.bendpoints.length > 0) {
var path4 = this.edgeToDummyNodes.get(lEdge);
for (var i2 = 0; i2 < path4.length; i2++) {
@@ -123904,7 +131226,7 @@ g.stateGroup line {
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function _toConsumableArray(arr) {
+ function _toConsumableArray2(arr) {
if (Array.isArray(arr)) {
for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
arr2[i2] = arr[i2];
@@ -123914,7 +131236,7 @@ g.stateGroup line {
return Array.from(arr);
}
}
- __name(_toConsumableArray, "_toConsumableArray");
+ __name(_toConsumableArray2, "_toConsumableArray");
var Layout2 = __webpack_require__(15);
var FDLayoutConstants = __webpack_require__(7);
var LayoutConstants = __webpack_require__(0);
@@ -124244,7 +131566,7 @@ g.stateGroup line {
}
}
}
- nodeA.surrounding = [].concat(_toConsumableArray(surrounding));
+ nodeA.surrounding = [].concat(_toConsumableArray2(surrounding));
}
for (i2 = 0; i2 < nodeA.surrounding.length; i2++) {
this.calcRepulsionForce(nodeA, nodeA.surrounding[i2]);
@@ -124704,11 +132026,11 @@ g.stateGroup line {
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function Emitter3() {
+ function Emitter4() {
this.listeners = [];
}
- __name(Emitter3, "Emitter");
- var p3 = Emitter3.prototype;
+ __name(Emitter4, "Emitter");
+ var p3 = Emitter4.prototype;
p3.addListener = function(event3, callback) {
this.listeners.push({
event: event3,
@@ -124723,15 +132045,15 @@ g.stateGroup line {
}
}
};
- p3.emit = function(event3, data5) {
+ p3.emit = function(event3, data6) {
for (var i2 = 0; i2 < this.listeners.length; i2++) {
var l2 = this.listeners[i2];
if (event3 === l2.event) {
- l2.callback(data5);
+ l2.callback(data6);
}
}
};
- module3.exports = Emitter3;
+ module3.exports = Emitter4;
}
/******/
])
@@ -125056,10 +132378,10 @@ g.stateGroup line {
this.reduceTrees();
this.graphManager.resetAllNodesToApplyGravitation();
var allNodes = new Set(this.getAllNodes());
- var intersection3 = this.nodesWithGravity.filter(function(x5) {
+ var intersection4 = this.nodesWithGravity.filter(function(x5) {
return allNodes.has(x5);
});
- this.graphManager.setAllNodesToApplyGravitation(intersection3);
+ this.graphManager.setAllNodesToApplyGravitation(intersection4);
this.positionNodesRandomly();
}
} else {
@@ -125067,10 +132389,10 @@ g.stateGroup line {
this.reduceTrees();
this.graphManager.resetAllNodesToApplyGravitation();
var allNodes = new Set(this.getAllNodes());
- var intersection3 = this.nodesWithGravity.filter(function(x5) {
+ var intersection4 = this.nodesWithGravity.filter(function(x5) {
return allNodes.has(x5);
});
- this.graphManager.setAllNodesToApplyGravitation(intersection3);
+ this.graphManager.setAllNodesToApplyGravitation(intersection4);
}
}
this.initSpringEmbedder();
@@ -125111,10 +132433,10 @@ g.stateGroup line {
this.growTree(this.prunedNodesAll);
this.graphManager.resetAllNodesToApplyGravitation();
var allNodes = new Set(this.getAllNodes());
- var intersection3 = this.nodesWithGravity.filter(function(x5) {
+ var intersection4 = this.nodesWithGravity.filter(function(x5) {
return allNodes.has(x5);
});
- this.graphManager.setAllNodesToApplyGravitation(intersection3);
+ this.graphManager.setAllNodesToApplyGravitation(intersection4);
this.graphManager.updateBounds();
this.updateGrid();
this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
@@ -125151,14 +132473,14 @@ g.stateGroup line {
var allNodes = this.graphManager.getAllNodes();
var pData = {};
for (var i2 = 0; i2 < allNodes.length; i2++) {
- var rect4 = allNodes[i2].rect;
- var id27 = allNodes[i2].id;
- pData[id27] = {
- id: id27,
- x: rect4.getCenterX(),
- y: rect4.getCenterY(),
- w: rect4.width,
- h: rect4.height
+ var rect3 = allNodes[i2].rect;
+ var id29 = allNodes[i2].id;
+ pData[id29] = {
+ id: id29,
+ x: rect3.getCenterX(),
+ y: rect3.getCenterY(),
+ w: rect3.width,
+ h: rect3.height
};
}
return pData;
@@ -125192,12 +132514,12 @@ g.stateGroup line {
return nodeList;
};
CoSELayout.prototype.createBendpoints = function() {
- var edges5 = [];
- edges5 = edges5.concat(this.graphManager.getAllEdges());
+ var edges3 = [];
+ edges3 = edges3.concat(this.graphManager.getAllEdges());
var visited = /* @__PURE__ */ new Set();
var i2;
- for (i2 = 0; i2 < edges5.length; i2++) {
- var edge = edges5[i2];
+ for (i2 = 0; i2 < edges3.length; i2++) {
+ var edge = edges3[i2];
if (!visited.has(edge)) {
var source = edge.getSource();
var target = edge.getTarget();
@@ -125225,7 +132547,7 @@ g.stateGroup line {
}
}
}
- if (visited.size == edges5.length) {
+ if (visited.size == edges3.length) {
break;
}
}
@@ -125294,10 +132616,10 @@ g.stateGroup line {
var branchCount = 0;
var incEdgesCount = neighborEdges.length;
var startIndex;
- var edges5 = node2.getEdgesBetween(parentOfNode);
- while (edges5.length > 1) {
- var temp = edges5[0];
- edges5.splice(0, 1);
+ var edges3 = node2.getEdgesBetween(parentOfNode);
+ while (edges3.length > 1) {
+ var temp = edges3[0];
+ edges3.splice(0, 1);
var index = neighborEdges.indexOf(temp);
if (index >= 0) {
neighborEdges.splice(index, 1);
@@ -125306,7 +132628,7 @@ g.stateGroup line {
childCount--;
}
if (parentOfNode != null) {
- startIndex = (neighborEdges.indexOf(edges5[0]) + 1) % incEdgesCount;
+ startIndex = (neighborEdges.indexOf(edges3[0]) + 1) % incEdgesCount;
} else {
startIndex = 0;
}
@@ -125395,47 +132717,47 @@ g.stateGroup line {
CoSELayout.prototype.clearZeroDegreeMembers = function() {
var self2 = this;
var tiledZeroDegreePack = this.tiledZeroDegreePack = [];
- Object.keys(this.memberGroups).forEach(function(id27) {
- var compoundNode = self2.idToDummyNode[id27];
- tiledZeroDegreePack[id27] = self2.tileNodes(self2.memberGroups[id27], compoundNode.paddingLeft + compoundNode.paddingRight);
- compoundNode.rect.width = tiledZeroDegreePack[id27].width;
- compoundNode.rect.height = tiledZeroDegreePack[id27].height;
+ Object.keys(this.memberGroups).forEach(function(id29) {
+ var compoundNode = self2.idToDummyNode[id29];
+ tiledZeroDegreePack[id29] = self2.tileNodes(self2.memberGroups[id29], compoundNode.paddingLeft + compoundNode.paddingRight);
+ compoundNode.rect.width = tiledZeroDegreePack[id29].width;
+ compoundNode.rect.height = tiledZeroDegreePack[id29].height;
});
};
CoSELayout.prototype.repopulateCompounds = function() {
for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) {
var lCompoundNode = this.compoundOrder[i2];
- var id27 = lCompoundNode.id;
+ var id29 = lCompoundNode.id;
var horizontalMargin = lCompoundNode.paddingLeft;
var verticalMargin = lCompoundNode.paddingTop;
- this.adjustLocations(this.tiledMemberPack[id27], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin);
+ this.adjustLocations(this.tiledMemberPack[id29], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin);
}
};
CoSELayout.prototype.repopulateZeroDegreeMembers = function() {
var self2 = this;
var tiledPack = this.tiledZeroDegreePack;
- Object.keys(tiledPack).forEach(function(id27) {
- var compoundNode = self2.idToDummyNode[id27];
+ Object.keys(tiledPack).forEach(function(id29) {
+ var compoundNode = self2.idToDummyNode[id29];
var horizontalMargin = compoundNode.paddingLeft;
var verticalMargin = compoundNode.paddingTop;
- self2.adjustLocations(tiledPack[id27], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin);
+ self2.adjustLocations(tiledPack[id29], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin);
});
};
CoSELayout.prototype.getToBeTiled = function(node2) {
- var id27 = node2.id;
- if (this.toBeTiled[id27] != null) {
- return this.toBeTiled[id27];
+ var id29 = node2.id;
+ if (this.toBeTiled[id29] != null) {
+ return this.toBeTiled[id29];
}
var childGraph = node2.getChild();
if (childGraph == null) {
- this.toBeTiled[id27] = false;
+ this.toBeTiled[id29] = false;
return false;
}
var children2 = childGraph.getNodes();
for (var i2 = 0; i2 < children2.length; i2++) {
var theChild = children2[i2];
if (this.getNodeDegree(theChild) > 0) {
- this.toBeTiled[id27] = false;
+ this.toBeTiled[id29] = false;
return false;
}
if (theChild.getChild() == null) {
@@ -125443,19 +132765,19 @@ g.stateGroup line {
continue;
}
if (!this.getToBeTiled(theChild)) {
- this.toBeTiled[id27] = false;
+ this.toBeTiled[id29] = false;
return false;
}
}
- this.toBeTiled[id27] = true;
+ this.toBeTiled[id29] = true;
return true;
};
CoSELayout.prototype.getNodeDegree = function(node2) {
- var id27 = node2.id;
- var edges5 = node2.getEdges();
+ var id29 = node2.id;
+ var edges3 = node2.getEdges();
var degree = 0;
- for (var i2 = 0; i2 < edges5.length; i2++) {
- var edge = edges5[i2];
+ for (var i2 = 0; i2 < edges3.length; i2++) {
+ var edge = edges3[i2];
if (edge.getSource().id !== edge.getTarget().id) {
degree = degree + 1;
}
@@ -125510,11 +132832,11 @@ g.stateGroup line {
CoSELayout.prototype.tileCompoundMembers = function(childGraphMap, idToNode) {
var self2 = this;
this.tiledMemberPack = [];
- Object.keys(childGraphMap).forEach(function(id27) {
- var compoundNode = idToNode[id27];
- self2.tiledMemberPack[id27] = self2.tileNodes(childGraphMap[id27], compoundNode.paddingLeft + compoundNode.paddingRight);
- compoundNode.rect.width = self2.tiledMemberPack[id27].width;
- compoundNode.rect.height = self2.tiledMemberPack[id27].height;
+ Object.keys(childGraphMap).forEach(function(id29) {
+ var compoundNode = idToNode[id29];
+ self2.tiledMemberPack[id29] = self2.tileNodes(childGraphMap[id29], compoundNode.paddingLeft + compoundNode.paddingRight);
+ compoundNode.rect.width = self2.tiledMemberPack[id29].width;
+ compoundNode.rect.height = self2.tiledMemberPack[id29].height;
});
};
CoSELayout.prototype.tileNodes = function(nodes6, minWidth) {
@@ -125846,9 +133168,9 @@ g.stateGroup line {
}
});
- // ../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.30.1/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js
+ // ../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.31.0/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js
var require_cytoscape_cose_bilkent = __commonJS({
- "../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.30.1/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js"(exports2, module2) {
+ "../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.31.0/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js"(exports2, module2) {
"use strict";
(/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) {
if (typeof exports2 === "object" && typeof module2 === "object")
@@ -126041,11 +133363,11 @@ g.stateGroup line {
var gm = layout6.newGraphManager();
this.gm = gm;
var nodes6 = this.options.eles.nodes();
- var edges5 = this.options.eles.edges();
+ var edges3 = this.options.eles.edges();
this.root = gm.addRoot();
this.processChildrenList(this.root, this.getTopMostNodes(nodes6), layout6);
- for (var i2 = 0; i2 < edges5.length; i2++) {
- var edge = edges5[i2];
+ for (var i2 = 0; i2 < edges3.length; i2++) {
+ var edge = edges3[i2];
var sourceNode = this.idToLNode[edge.data("source")];
var targetNode = this.idToLNode[edge.data("target")];
if (sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) {
@@ -126226,7 +133548,7 @@ g.stateGroup line {
});
// src/diagrams/mindmap/svgDraw.ts
- function insertPolygonShape3(parent4, w3, h2, points, node2) {
+ function insertPolygonShape2(parent4, w3, h2, points, node2) {
return parent4.insert("polygon", ":first-child").attr(
"points",
points.map(function(d2) {
@@ -126234,32 +133556,32 @@ g.stateGroup line {
}).join(" ")
).attr("transform", "translate(" + (node2.width - w3) / 2 + ", " + h2 + ")");
}
- var MAX_SECTIONS2, defaultBkg2, rectBkg, cloudBkg, bangBkg, circleBkg, hexagonBkg, roundedRectBkg, drawNode2, positionNode3;
- var init_svgDraw6 = __esm({
+ var MAX_SECTIONS2, defaultBkg2, rectBkg, cloudBkg, bangBkg, circleBkg, hexagonBkg, roundedRectBkg, drawNode2, positionNode2;
+ var init_svgDraw5 = __esm({
"src/diagrams/mindmap/svgDraw.ts"() {
"use strict";
init_createText();
init_utils2();
MAX_SECTIONS2 = 12;
- defaultBkg2 = /* @__PURE__ */ __name(function(db8, elem, node2, section) {
+ defaultBkg2 = /* @__PURE__ */ __name(function(db10, elem, node2, section) {
const rd = 5;
- elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr(
+ elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db10.type2Str(node2.type)).attr(
"d",
`M0 ${node2.height - rd} v${-node2.height + 2 * rd} q0,-5 5,-5 h${node2.width - 2 * rd} q5,0 5,5 v${node2.height - rd} H0 Z`
);
elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node2.height).attr("x2", node2.width).attr("y2", node2.height);
}, "defaultBkg");
- rectBkg = /* @__PURE__ */ __name(function(db8, elem, node2) {
- elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr("height", node2.height).attr("width", node2.width);
+ rectBkg = /* @__PURE__ */ __name(function(db10, elem, node2) {
+ elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db10.type2Str(node2.type)).attr("height", node2.height).attr("width", node2.width);
}, "rectBkg");
- cloudBkg = /* @__PURE__ */ __name(function(db8, elem, node2) {
+ cloudBkg = /* @__PURE__ */ __name(function(db10, elem, node2) {
const w3 = node2.width;
const h2 = node2.height;
const r1 = 0.15 * w3;
const r2 = 0.25 * w3;
const r3 = 0.35 * w3;
const r4 = 0.2 * w3;
- elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr(
+ elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db10.type2Str(node2.type)).attr(
"d",
`M0 0 a${r1},${r1} 0 0,1 ${w3 * 0.25},${-1 * w3 * 0.1}
a${r3},${r3} 1 0,1 ${w3 * 0.4},${-1 * w3 * 0.1}
@@ -126278,11 +133600,11 @@ g.stateGroup line {
H0 V0 Z`
);
}, "cloudBkg");
- bangBkg = /* @__PURE__ */ __name(function(db8, elem, node2) {
+ bangBkg = /* @__PURE__ */ __name(function(db10, elem, node2) {
const w3 = node2.width;
const h2 = node2.height;
const r2 = 0.15 * w3;
- elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr(
+ elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db10.type2Str(node2.type)).attr(
"d",
`M0 0 a${r2},${r2} 1 0,0 ${w3 * 0.25},${-1 * h2 * 0.1}
a${r2},${r2} 1 0,0 ${w3 * 0.25},${0}
@@ -126305,14 +133627,14 @@ g.stateGroup line {
H0 V0 Z`
);
}, "bangBkg");
- circleBkg = /* @__PURE__ */ __name(function(db8, elem, node2) {
- elem.append("circle").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr("r", node2.width / 2);
+ circleBkg = /* @__PURE__ */ __name(function(db10, elem, node2) {
+ elem.append("circle").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db10.type2Str(node2.type)).attr("r", node2.width / 2);
}, "circleBkg");
- __name(insertPolygonShape3, "insertPolygonShape");
+ __name(insertPolygonShape2, "insertPolygonShape");
hexagonBkg = /* @__PURE__ */ __name(function(_db, elem, node2) {
const h2 = node2.height;
- const f3 = 4;
- const m2 = h2 / f3;
+ const f2 = 4;
+ const m2 = h2 / f2;
const w3 = node2.width - node2.padding + 2 * m2;
const points = [
{ x: m2, y: 0 },
@@ -126322,13 +133644,13 @@ g.stateGroup line {
{ x: m2, y: -h2 },
{ x: 0, y: -h2 / 2 }
];
- insertPolygonShape3(elem, w3, h2, points, node2);
+ insertPolygonShape2(elem, w3, h2, points, node2);
}, "hexagonBkg");
- roundedRectBkg = /* @__PURE__ */ __name(function(db8, elem, node2) {
- elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr("height", node2.height).attr("rx", node2.padding).attr("ry", node2.padding).attr("width", node2.width);
+ roundedRectBkg = /* @__PURE__ */ __name(function(db10, elem, node2) {
+ elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db10.type2Str(node2.type)).attr("height", node2.height).attr("rx", node2.padding).attr("ry", node2.padding).attr("width", node2.width);
}, "roundedRectBkg");
- drawNode2 = /* @__PURE__ */ __name(async function(db8, elem, node2, fullSection, conf8) {
- const htmlLabels = conf8.htmlLabels;
+ drawNode2 = /* @__PURE__ */ __name(async function(db10, elem, node2, fullSection, conf5) {
+ const htmlLabels = conf5.htmlLabels;
const section = fullSection % (MAX_SECTIONS2 - 1);
const nodeElem = elem.append("g");
node2.section = section;
@@ -126348,21 +133670,21 @@ g.stateGroup line {
width: node2.width,
classes: "mindmap-node-label"
},
- conf8
+ conf5
);
if (!htmlLabels) {
textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle");
}
const bbox = textElem.node().getBBox();
- const [fontSize] = parseFontSize(conf8.fontSize);
+ const [fontSize] = parseFontSize(conf5.fontSize);
node2.height = bbox.height + fontSize * 1.1 * 0.5 + node2.padding;
node2.width = bbox.width + 2 * node2.padding;
if (node2.icon) {
- if (node2.type === db8.nodeType.CIRCLE) {
+ if (node2.type === db10.nodeType.CIRCLE) {
node2.height += 50;
node2.width += 50;
- const icon = nodeElem.append("foreignObject").attr("height", "50px").attr("width", node2.width).attr("style", "text-align: center;");
- icon.append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + section + " " + node2.icon);
+ const icon2 = nodeElem.append("foreignObject").attr("height", "50px").attr("width", node2.width).attr("style", "text-align: center;");
+ icon2.append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + section + " " + node2.icon);
textElem.attr(
"transform",
"translate(" + node2.width / 2 + ", " + (node2.height / 2 - 1.5 * node2.padding) + ")"
@@ -126372,8 +133694,8 @@ g.stateGroup line {
const orgHeight = node2.height;
node2.height = Math.max(orgHeight, 60);
const heightDiff = Math.abs(node2.height - orgHeight);
- const icon = nodeElem.append("foreignObject").attr("width", "60px").attr("height", node2.height).attr("style", "text-align: center;margin-top:" + heightDiff / 2 + "px;");
- icon.append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + section + " " + node2.icon);
+ const icon2 = nodeElem.append("foreignObject").attr("width", "60px").attr("height", node2.height).attr("style", "text-align: center;margin-top:" + heightDiff / 2 + "px;");
+ icon2.append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + section + " " + node2.icon);
textElem.attr(
"transform",
"translate(" + (25 + node2.width / 2) + ", " + (heightDiff / 2 + node2.padding / 2) + ")"
@@ -126391,34 +133713,34 @@ g.stateGroup line {
}
}
switch (node2.type) {
- case db8.nodeType.DEFAULT:
- defaultBkg2(db8, bkgElem, node2, section);
+ case db10.nodeType.DEFAULT:
+ defaultBkg2(db10, bkgElem, node2, section);
break;
- case db8.nodeType.ROUNDED_RECT:
- roundedRectBkg(db8, bkgElem, node2, section);
+ case db10.nodeType.ROUNDED_RECT:
+ roundedRectBkg(db10, bkgElem, node2, section);
break;
- case db8.nodeType.RECT:
- rectBkg(db8, bkgElem, node2, section);
+ case db10.nodeType.RECT:
+ rectBkg(db10, bkgElem, node2, section);
break;
- case db8.nodeType.CIRCLE:
+ case db10.nodeType.CIRCLE:
bkgElem.attr("transform", "translate(" + node2.width / 2 + ", " + +node2.height / 2 + ")");
- circleBkg(db8, bkgElem, node2, section);
+ circleBkg(db10, bkgElem, node2, section);
break;
- case db8.nodeType.CLOUD:
- cloudBkg(db8, bkgElem, node2, section);
+ case db10.nodeType.CLOUD:
+ cloudBkg(db10, bkgElem, node2, section);
break;
- case db8.nodeType.BANG:
- bangBkg(db8, bkgElem, node2, section);
+ case db10.nodeType.BANG:
+ bangBkg(db10, bkgElem, node2, section);
break;
- case db8.nodeType.HEXAGON:
- hexagonBkg(db8, bkgElem, node2, section);
+ case db10.nodeType.HEXAGON:
+ hexagonBkg(db10, bkgElem, node2, section);
break;
}
- db8.setElementForId(node2.id, nodeElem);
+ db10.setElementForId(node2.id, nodeElem);
return node2.height;
}, "drawNode");
- positionNode3 = /* @__PURE__ */ __name(function(db8, node2) {
- const nodeElem = db8.getElementById(node2.id);
+ positionNode2 = /* @__PURE__ */ __name(function(db10, node2) {
+ const nodeElem = db10.getElementById(node2.id);
const x5 = node2.x || 0;
const y5 = node2.y || 0;
nodeElem.attr("transform", "translate(" + x5 + "," + y5 + ")");
@@ -126427,30 +133749,30 @@ g.stateGroup line {
});
// src/diagrams/mindmap/mindmapRenderer.ts
- async function drawNodes(db8, svg, mindmap, section, conf8) {
- await drawNode2(db8, svg, mindmap, section, conf8);
+ async function drawNodes(db10, svg2, mindmap, section, conf5) {
+ await drawNode2(db10, svg2, mindmap, section, conf5);
if (mindmap.children) {
await Promise.all(
mindmap.children.map(
- (child, index) => drawNodes(db8, svg, child, section < 0 ? index : section, conf8)
+ (child, index) => drawNodes(db10, svg2, child, section < 0 ? index : section, conf5)
)
);
}
}
function drawEdges(edgesEl, cy) {
- cy.edges().map((edge, id27) => {
- const data5 = edge.data();
+ cy.edges().map((edge, id29) => {
+ const data6 = edge.data();
if (edge[0]._private.bodyBounds) {
const bounds4 = edge[0]._private.rscratch;
- log.trace("Edge: ", id27, data5);
+ log.trace("Edge: ", id29, data6);
edgesEl.insert("path").attr(
"d",
`M ${bounds4.startX},${bounds4.startY} L ${bounds4.midX},${bounds4.midY} L${bounds4.endX},${bounds4.endY} `
- ).attr("class", "edge section-edge-" + data5.section + " edge-depth-" + data5.depth);
+ ).attr("class", "edge section-edge-" + data6.section + " edge-depth-" + data6.depth);
}
});
}
- function addNodes(mindmap, cy, conf8, level) {
+ function addNodes(mindmap, cy, conf5, level) {
cy.add({
group: "nodes",
data: {
@@ -126470,7 +133792,7 @@ g.stateGroup line {
});
if (mindmap.children) {
mindmap.children.forEach((child) => {
- addNodes(child, cy, conf8, level + 1);
+ addNodes(child, cy, conf5, level + 1);
cy.add({
group: "edges",
data: {
@@ -126484,7 +133806,7 @@ g.stateGroup line {
});
}
}
- function layoutMindmap(node2, conf8) {
+ function layoutMindmap(node2, conf5) {
return new Promise((resolve3) => {
const renderEl = select_default2("body").append("div").attr("id", "cy").attr("style", "display:none");
const cy = cytoscape2({
@@ -126500,11 +133822,11 @@ g.stateGroup line {
]
});
renderEl.remove();
- addNodes(node2, cy, conf8, 0);
+ addNodes(node2, cy, conf5, 0);
cy.nodes().forEach(function(n2) {
n2.layoutDimensions = () => {
- const data5 = n2.data();
- return { w: data5.width, h: data5.height };
+ const data6 = n2.data();
+ return { w: data6.width, h: data6.height };
};
});
cy.layout({
@@ -126520,22 +133842,22 @@ g.stateGroup line {
});
});
}
- function positionNodes(db8, cy) {
- cy.nodes().map((node2, id27) => {
- const data5 = node2.data();
- data5.x = node2.position().x;
- data5.y = node2.position().y;
- positionNode3(db8, data5);
- const el = db8.getElementById(data5.nodeId);
- log.info("Id:", id27, "Position: (", node2.position().x, ", ", node2.position().y, ")", data5);
+ function positionNodes(db10, cy) {
+ cy.nodes().map((node2, id29) => {
+ const data6 = node2.data();
+ data6.x = node2.position().x;
+ data6.y = node2.position().y;
+ positionNode2(db10, data6);
+ const el = db10.getElementById(data6.nodeId);
+ log.info("Id:", id29, "Position: (", node2.position().x, ", ", node2.position().y, ")", data6);
el.attr(
"transform",
- `translate(${node2.position().x - data5.width / 2}, ${node2.position().y - data5.height / 2})`
+ `translate(${node2.position().x - data6.width / 2}, ${node2.position().y - data6.height / 2})`
);
- el.attr("attr", `apa-${id27})`);
+ el.attr("attr", `apa-${id29})`);
});
}
- var import_cytoscape_cose_bilkent, draw19, mindmapRenderer_default;
+ var import_cytoscape_cose_bilkent, draw18, mindmapRenderer_default;
var init_mindmapRenderer = __esm({
"src/diagrams/mindmap/mindmapRenderer.ts"() {
"use strict";
@@ -126546,7 +133868,7 @@ g.stateGroup line {
init_logger();
init_selectSvgElement();
init_setupGraphViewbox();
- init_svgDraw6();
+ init_svgDraw5();
init_defaultConfig();
cytoscape2.use(import_cytoscape_cose_bilkent.default);
__name(drawNodes, "drawNodes");
@@ -126554,33 +133876,33 @@ g.stateGroup line {
__name(addNodes, "addNodes");
__name(layoutMindmap, "layoutMindmap");
__name(positionNodes, "positionNodes");
- draw19 = /* @__PURE__ */ __name(async (text2, id27, _version, diagObj) => {
- log.debug("Rendering mindmap diagram\n" + text2);
- const db8 = diagObj.db;
- const mm = db8.getMindmap();
+ draw18 = /* @__PURE__ */ __name(async (text4, id29, _version, diagObj) => {
+ log.debug("Rendering mindmap diagram\n" + text4);
+ const db10 = diagObj.db;
+ const mm = db10.getMindmap();
if (!mm) {
return;
}
- const conf8 = getConfig2();
- conf8.htmlLabels = false;
- const svg = selectSvgElement(id27);
- const edgesElem = svg.append("g");
+ const conf5 = getConfig2();
+ conf5.htmlLabels = false;
+ const svg2 = selectSvgElement(id29);
+ const edgesElem = svg2.append("g");
edgesElem.attr("class", "mindmap-edges");
- const nodesElem = svg.append("g");
+ const nodesElem = svg2.append("g");
nodesElem.attr("class", "mindmap-nodes");
- await drawNodes(db8, nodesElem, mm, -1, conf8);
- const cy = await layoutMindmap(mm, conf8);
+ await drawNodes(db10, nodesElem, mm, -1, conf5);
+ const cy = await layoutMindmap(mm, conf5);
drawEdges(edgesElem, cy);
- positionNodes(db8, cy);
+ positionNodes(db10, cy);
setupGraphViewbox(
void 0,
- svg,
- conf8.mindmap?.padding ?? defaultConfig_default.mindmap.padding,
- conf8.mindmap?.useMaxWidth ?? defaultConfig_default.mindmap.useMaxWidth
+ svg2,
+ conf5.mindmap?.padding ?? defaultConfig_default.mindmap.padding,
+ conf5.mindmap?.useMaxWidth ?? defaultConfig_default.mindmap.useMaxWidth
);
}, "draw");
mindmapRenderer_default = {
- draw: draw19
+ draw: draw18
};
}
});
@@ -126592,7 +133914,7 @@ g.stateGroup line {
"use strict";
init_dist();
genSections2 = /* @__PURE__ */ __name((options3) => {
- let sections5 = "";
+ let sections6 = "";
for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) {
options3["lineColor" + i2] = options3["lineColor" + i2] || options3["cScaleInv" + i2];
if (is_dark_default(options3["lineColor" + i2])) {
@@ -126603,7 +133925,7 @@ g.stateGroup line {
}
for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) {
const sw = "" + (17 - 3 * i2);
- sections5 += `
+ sections6 += `
.section-${i2 - 1} rect, .section-${i2 - 1} path, .section-${i2 - 1} circle, .section-${i2 - 1} polygon, .section-${i2 - 1} path {
fill: ${options3["cScale" + i2]};
}
@@ -126633,7 +133955,7 @@ g.stateGroup line {
}
`;
}
- return sections5;
+ return sections6;
}, "genSections");
getStyles14 = /* @__PURE__ */ __name((options3) => `
.edge {
@@ -126689,17 +134011,1161 @@ g.stateGroup line {
}
});
+ // src/diagrams/kanban/parser/kanban.jison
+ var parser18, kanban_default;
+ var init_kanban = __esm({
+ "src/diagrams/kanban/parser/kanban.jison"() {
+ "use strict";
+ parser18 = function() {
+ var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
+ for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
+ return o3;
+ }, "o"), $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [6, 7, 8], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [6, 7, 11], $Vc = [1, 31], $Vd = [6, 7, 11, 24], $Ve = [1, 6, 13, 16, 17, 20, 23], $Vf = [1, 35], $Vg = [1, 36], $Vh = [1, 6, 7, 11, 13, 16, 17, 20, 23], $Vi = [1, 38];
+ var parser24 = {
+ trace: /* @__PURE__ */ __name(function trace() {
+ }, "trace"),
+ yy: {},
+ symbols_: { "error": 2, "start": 3, "mindMap": 4, "spaceLines": 5, "SPACELINE": 6, "NL": 7, "KANBAN": 8, "document": 9, "stop": 10, "EOF": 11, "statement": 12, "SPACELIST": 13, "node": 14, "shapeData": 15, "ICON": 16, "CLASS": 17, "nodeWithId": 18, "nodeWithoutId": 19, "NODE_DSTART": 20, "NODE_DESCR": 21, "NODE_DEND": 22, "NODE_ID": 23, "SHAPE_DATA": 24, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "KANBAN", 11: "EOF", 13: "SPACELIST", 16: "ICON", 17: "CLASS", 20: "NODE_DSTART", 21: "NODE_DESCR", 22: "NODE_DEND", 23: "NODE_ID", 24: "SHAPE_DATA" },
+ productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 3], [12, 2], [12, 2], [12, 2], [12, 1], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [19, 3], [18, 1], [18, 4], [15, 2], [15, 1]],
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
+ var $0 = $$.length - 1;
+ switch (yystate) {
+ case 6:
+ case 7:
+ return yy;
+ break;
+ case 8:
+ yy.getLogger().trace("Stop NL ");
+ break;
+ case 9:
+ yy.getLogger().trace("Stop EOF ");
+ break;
+ case 11:
+ yy.getLogger().trace("Stop NL2 ");
+ break;
+ case 12:
+ yy.getLogger().trace("Stop EOF2 ");
+ break;
+ case 15:
+ yy.getLogger().info("Node: ", $$[$0 - 1].id);
+ yy.addNode($$[$0 - 2].length, $$[$0 - 1].id, $$[$0 - 1].descr, $$[$0 - 1].type, $$[$0]);
+ break;
+ case 16:
+ yy.getLogger().info("Node: ", $$[$0].id);
+ yy.addNode($$[$0 - 1].length, $$[$0].id, $$[$0].descr, $$[$0].type);
+ break;
+ case 17:
+ yy.getLogger().trace("Icon: ", $$[$0]);
+ yy.decorateNode({ icon: $$[$0] });
+ break;
+ case 18:
+ case 23:
+ yy.decorateNode({ class: $$[$0] });
+ break;
+ case 19:
+ yy.getLogger().trace("SPACELIST");
+ break;
+ case 20:
+ yy.getLogger().trace("Node: ", $$[$0 - 1].id);
+ yy.addNode(0, $$[$0 - 1].id, $$[$0 - 1].descr, $$[$0 - 1].type, $$[$0]);
+ break;
+ case 21:
+ yy.getLogger().trace("Node: ", $$[$0].id);
+ yy.addNode(0, $$[$0].id, $$[$0].descr, $$[$0].type);
+ break;
+ case 22:
+ yy.decorateNode({ icon: $$[$0] });
+ break;
+ case 27:
+ yy.getLogger().trace("node found ..", $$[$0 - 2]);
+ this.$ = { id: $$[$0 - 1], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) };
+ break;
+ case 28:
+ this.$ = { id: $$[$0], descr: $$[$0], type: 0 };
+ break;
+ case 29:
+ yy.getLogger().trace("node found ..", $$[$0 - 3]);
+ this.$ = { id: $$[$0 - 3], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) };
+ break;
+ case 30:
+ this.$ = $$[$0 - 1] + $$[$0];
+ break;
+ case 31:
+ this.$ = $$[$0];
+ break;
+ }
+ }, "anonymous"),
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: $V0 }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: $V0 }, { 6: $V1, 7: [1, 10], 9: 9, 12: 11, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, o2($V7, [2, 3]), { 1: [2, 2] }, o2($V7, [2, 4]), o2($V7, [2, 5]), { 1: [2, 6], 6: $V1, 12: 21, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, { 6: $V1, 9: 22, 12: 11, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, { 6: $V8, 7: $V9, 10: 23, 11: $Va }, o2($Vb, [2, 24], { 18: 17, 19: 18, 14: 27, 16: [1, 28], 17: [1, 29], 20: $V5, 23: $V6 }), o2($Vb, [2, 19]), o2($Vb, [2, 21], { 15: 30, 24: $Vc }), o2($Vb, [2, 22]), o2($Vb, [2, 23]), o2($Vd, [2, 25]), o2($Vd, [2, 26]), o2($Vd, [2, 28], { 20: [1, 32] }), { 21: [1, 33] }, { 6: $V8, 7: $V9, 10: 34, 11: $Va }, { 1: [2, 7], 6: $V1, 12: 21, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, o2($Ve, [2, 14], { 7: $Vf, 11: $Vg }), o2($Vh, [2, 8]), o2($Vh, [2, 9]), o2($Vh, [2, 10]), o2($Vb, [2, 16], { 15: 37, 24: $Vc }), o2($Vb, [2, 17]), o2($Vb, [2, 18]), o2($Vb, [2, 20], { 24: $Vi }), o2($Vd, [2, 31]), { 21: [1, 39] }, { 22: [1, 40] }, o2($Ve, [2, 13], { 7: $Vf, 11: $Vg }), o2($Vh, [2, 11]), o2($Vh, [2, 12]), o2($Vb, [2, 15], { 24: $Vi }), o2($Vd, [2, 30]), { 22: [1, 41] }, o2($Vd, [2, 27]), o2($Vd, [2, 29])],
+ defaultActions: { 2: [2, 1], 6: [2, 2] },
+ parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
+ if (hash.recoverable) {
+ this.trace(str2);
+ } else {
+ var error3 = new Error(str2);
+ error3.hash = hash;
+ throw error3;
+ }
+ }, "parseError"),
+ parse: /* @__PURE__ */ __name(function parse7(input) {
+ var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
+ var args = lstack.slice.call(arguments, 1);
+ var lexer3 = Object.create(this.lexer);
+ var sharedState = { yy: {} };
+ for (var k2 in this.yy) {
+ if (Object.prototype.hasOwnProperty.call(this.yy, k2)) {
+ sharedState.yy[k2] = this.yy[k2];
+ }
+ }
+ lexer3.setInput(input, sharedState.yy);
+ sharedState.yy.lexer = lexer3;
+ sharedState.yy.parser = this;
+ if (typeof lexer3.yylloc == "undefined") {
+ lexer3.yylloc = {};
+ }
+ var yyloc = lexer3.yylloc;
+ lstack.push(yyloc);
+ var ranges = lexer3.options && lexer3.options.ranges;
+ if (typeof sharedState.yy.parseError === "function") {
+ this.parseError = sharedState.yy.parseError;
+ } else {
+ this.parseError = Object.getPrototypeOf(this).parseError;
+ }
+ function popStack(n2) {
+ stack.length = stack.length - 2 * n2;
+ vstack.length = vstack.length - n2;
+ lstack.length = lstack.length - n2;
+ }
+ __name(popStack, "popStack");
+ function lex() {
+ var token2;
+ token2 = tstack.pop() || lexer3.lex() || EOF2;
+ if (typeof token2 !== "number") {
+ if (token2 instanceof Array) {
+ tstack = token2;
+ token2 = tstack.pop();
+ }
+ token2 = self2.symbols_[token2] || token2;
+ }
+ return token2;
+ }
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ while (true) {
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
+ } else {
+ if (symbol === null || typeof symbol == "undefined") {
+ symbol = lex();
+ }
+ action = table[state4] && table[state4][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ var errStr = "";
+ expected = [];
+ for (p3 in table[state4]) {
+ if (this.terminals_[p3] && p3 > TERROR) {
+ expected.push("'" + this.terminals_[p3] + "'");
+ }
+ }
+ if (lexer3.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {
+ text: lexer3.match,
+ token: this.terminals_[symbol] || symbol,
+ line: lexer3.yylineno,
+ loc: yyloc,
+ expected
+ });
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(lexer3.yytext);
+ lstack.push(lexer3.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ if (!preErrorSymbol) {
+ yyleng = lexer3.yyleng;
+ yytext = lexer3.yytext;
+ yylineno = lexer3.yylineno;
+ yyloc = lexer3.yylloc;
+ if (recovering > 0) {
+ recovering--;
+ }
+ } else {
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ 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]
+ ];
+ }
+ r2 = this.performAction.apply(yyval, [
+ yytext,
+ yyleng,
+ yylineno,
+ sharedState.yy,
+ action[1],
+ vstack,
+ lstack
+ ].concat(args));
+ if (typeof r2 !== "undefined") {
+ return r2;
+ }
+ 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._$);
+ newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState2);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+ }, "parse")
+ };
+ var lexer2 = /* @__PURE__ */ function() {
+ var lexer3 = {
+ EOF: 1,
+ parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
+ if (this.yy.parser) {
+ this.yy.parser.parseError(str2, hash);
+ } else {
+ throw new Error(str2);
+ }
+ }, "parseError"),
+ // resets the lexer, sets new input
+ setInput: /* @__PURE__ */ __name(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;
+ }, "setInput"),
+ // consumes and returns one char from the input
+ input: /* @__PURE__ */ __name(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;
+ }, "input"),
+ // unshifts one char (or a string) into the input
+ unput: /* @__PURE__ */ __name(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 r2 = 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 = [r2[0], r2[0] + this.yyleng - len];
+ }
+ this.yyleng = this.yytext.length;
+ return this;
+ }, "unput"),
+ // When called from action, caches matched text and appends it on next action
+ more: /* @__PURE__ */ __name(function() {
+ this._more = true;
+ return this;
+ }, "more"),
+ // 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: /* @__PURE__ */ __name(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;
+ }, "reject"),
+ // retain first n characters of the match
+ less: /* @__PURE__ */ __name(function(n2) {
+ this.unput(this.match.slice(n2));
+ }, "less"),
+ // displays already matched input, i.e. for error messages
+ pastInput: /* @__PURE__ */ __name(function() {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
+ }, "pastInput"),
+ // displays upcoming input, i.e. for error messages
+ upcomingInput: /* @__PURE__ */ __name(function() {
+ var next3 = this.match;
+ if (next3.length < 20) {
+ next3 += this._input.substr(0, 20 - next3.length);
+ }
+ return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, "");
+ }, "upcomingInput"),
+ // displays the character position where the lexing error occurred, i.e. for error messages
+ showPosition: /* @__PURE__ */ __name(function() {
+ var pre = this.pastInput();
+ var c3 = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c3 + "^";
+ }, "showPosition"),
+ // test the lexed token: return FALSE when not a match, otherwise return token
+ test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) {
+ var token2, 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 = match2[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 + match2[0].length
+ };
+ this.yytext += match2[0];
+ this.match += match2[0];
+ this.matches = match2;
+ 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(match2[0].length);
+ this.matched += match2[0];
+ token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
+ if (this.done && this._input) {
+ this.done = false;
+ }
+ if (token2) {
+ return token2;
+ } else if (this._backtrack) {
+ for (var k2 in backup) {
+ this[k2] = backup[k2];
+ }
+ return false;
+ }
+ return false;
+ }, "test_match"),
+ // return next match in input
+ next: /* @__PURE__ */ __name(function() {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) {
+ this.done = true;
+ }
+ var token2, match2, tempMatch, index;
+ if (!this._more) {
+ this.yytext = "";
+ this.match = "";
+ }
+ var rules = this._currentRules();
+ for (var i2 = 0; i2 < rules.length; i2++) {
+ tempMatch = this._input.match(this.rules[rules[i2]]);
+ if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) {
+ match2 = tempMatch;
+ index = i2;
+ if (this.options.backtrack_lexer) {
+ token2 = this.test_match(tempMatch, rules[i2]);
+ if (token2 !== false) {
+ return token2;
+ } else if (this._backtrack) {
+ match2 = false;
+ continue;
+ } else {
+ return false;
+ }
+ } else if (!this.options.flex) {
+ break;
+ }
+ }
+ }
+ if (match2) {
+ token2 = this.test_match(match2, rules[index]);
+ if (token2 !== false) {
+ return token2;
+ }
+ 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
+ });
+ }
+ }, "next"),
+ // return next match that has a token
+ lex: /* @__PURE__ */ __name(function lex() {
+ var r2 = this.next();
+ if (r2) {
+ return r2;
+ } else {
+ return this.lex();
+ }
+ }, "lex"),
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
+ begin: /* @__PURE__ */ __name(function begin(condition) {
+ this.conditionStack.push(condition);
+ }, "begin"),
+ // pop the previously active lexer condition state off the condition stack
+ popState: /* @__PURE__ */ __name(function popState() {
+ var n2 = this.conditionStack.length - 1;
+ if (n2 > 0) {
+ return this.conditionStack.pop();
+ } else {
+ return this.conditionStack[0];
+ }
+ }, "popState"),
+ // produce the lexer rule set which is active for the currently active lexer condition state
+ _currentRules: /* @__PURE__ */ __name(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;
+ }
+ }, "_currentRules"),
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
+ topState: /* @__PURE__ */ __name(function topState(n2) {
+ n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0);
+ if (n2 >= 0) {
+ return this.conditionStack[n2];
+ } else {
+ return "INITIAL";
+ }
+ }, "topState"),
+ // alias for begin(condition)
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
+ this.begin(condition);
+ }, "pushState"),
+ // return the number of states currently on the stack
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
+ return this.conditionStack.length;
+ }, "stateStackSize"),
+ options: { "case-insensitive": true },
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
+ var YYSTATE = YY_START;
+ switch ($avoiding_name_collisions) {
+ case 0:
+ this.pushState("shapeData");
+ yy_.yytext = "";
+ return 24;
+ break;
+ case 1:
+ this.pushState("shapeDataStr");
+ return 24;
+ break;
+ case 2:
+ this.popState();
+ return 24;
+ break;
+ case 3:
+ const re2 = /\n\s*/g;
+ yy_.yytext = yy_.yytext.replace(re2, " ");
+ return 24;
+ break;
+ case 4:
+ return 24;
+ break;
+ case 5:
+ this.popState();
+ break;
+ case 6:
+ yy.getLogger().trace("Found comment", yy_.yytext);
+ return 6;
+ break;
+ case 7:
+ return 8;
+ break;
+ case 8:
+ this.begin("CLASS");
+ break;
+ case 9:
+ this.popState();
+ return 17;
+ break;
+ case 10:
+ this.popState();
+ break;
+ case 11:
+ yy.getLogger().trace("Begin icon");
+ this.begin("ICON");
+ break;
+ case 12:
+ yy.getLogger().trace("SPACELINE");
+ return 6;
+ break;
+ case 13:
+ return 7;
+ break;
+ case 14:
+ return 16;
+ break;
+ case 15:
+ yy.getLogger().trace("end icon");
+ this.popState();
+ break;
+ case 16:
+ yy.getLogger().trace("Exploding node");
+ this.begin("NODE");
+ return 20;
+ break;
+ case 17:
+ yy.getLogger().trace("Cloud");
+ this.begin("NODE");
+ return 20;
+ break;
+ case 18:
+ yy.getLogger().trace("Explosion Bang");
+ this.begin("NODE");
+ return 20;
+ break;
+ case 19:
+ yy.getLogger().trace("Cloud Bang");
+ this.begin("NODE");
+ return 20;
+ break;
+ case 20:
+ this.begin("NODE");
+ return 20;
+ break;
+ case 21:
+ this.begin("NODE");
+ return 20;
+ break;
+ case 22:
+ this.begin("NODE");
+ return 20;
+ break;
+ case 23:
+ this.begin("NODE");
+ return 20;
+ break;
+ case 24:
+ return 13;
+ break;
+ case 25:
+ return 23;
+ break;
+ case 26:
+ return 11;
+ break;
+ case 27:
+ this.begin("NSTR2");
+ break;
+ case 28:
+ return "NODE_DESCR";
+ break;
+ case 29:
+ this.popState();
+ break;
+ case 30:
+ yy.getLogger().trace("Starting NSTR");
+ this.begin("NSTR");
+ break;
+ case 31:
+ yy.getLogger().trace("description:", yy_.yytext);
+ return "NODE_DESCR";
+ break;
+ case 32:
+ this.popState();
+ break;
+ case 33:
+ this.popState();
+ yy.getLogger().trace("node end ))");
+ return "NODE_DEND";
+ break;
+ case 34:
+ this.popState();
+ yy.getLogger().trace("node end )");
+ return "NODE_DEND";
+ break;
+ case 35:
+ this.popState();
+ yy.getLogger().trace("node end ...", yy_.yytext);
+ return "NODE_DEND";
+ break;
+ case 36:
+ this.popState();
+ yy.getLogger().trace("node end ((");
+ return "NODE_DEND";
+ break;
+ case 37:
+ this.popState();
+ yy.getLogger().trace("node end (-");
+ return "NODE_DEND";
+ break;
+ case 38:
+ this.popState();
+ yy.getLogger().trace("node end (-");
+ return "NODE_DEND";
+ break;
+ case 39:
+ this.popState();
+ yy.getLogger().trace("node end ((");
+ return "NODE_DEND";
+ break;
+ case 40:
+ this.popState();
+ yy.getLogger().trace("node end ((");
+ return "NODE_DEND";
+ break;
+ case 41:
+ yy.getLogger().trace("Long description:", yy_.yytext);
+ return 21;
+ break;
+ case 42:
+ yy.getLogger().trace("Long description:", yy_.yytext);
+ return 21;
+ break;
+ }
+ }, "anonymous"),
+ rules: [/^(?:@\{)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^\"]+)/i, /^(?:[^}^"]+)/i, /^(?:\})/i, /^(?:\s*%%.*)/i, /^(?:kanban\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}@]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i],
+ conditions: { "shapeDataEndBracket": { "rules": [], "inclusive": false }, "shapeDataStr": { "rules": [2, 3], "inclusive": false }, "shapeData": { "rules": [1, 4, 5], "inclusive": false }, "CLASS": { "rules": [9, 10], "inclusive": false }, "ICON": { "rules": [14, 15], "inclusive": false }, "NSTR2": { "rules": [28, 29], "inclusive": false }, "NSTR": { "rules": [31, 32], "inclusive": false }, "NODE": { "rules": [27, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], "inclusive": false }, "INITIAL": { "rules": [0, 6, 7, 8, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], "inclusive": true } }
+ };
+ return lexer3;
+ }();
+ parser24.lexer = lexer2;
+ function Parser3() {
+ this.yy = {};
+ }
+ __name(Parser3, "Parser");
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
+ return new Parser3();
+ }();
+ parser18.parser = parser18;
+ kanban_default = parser18;
+ }
+ });
+
+ // src/diagrams/kanban/kanbanDb.ts
+ var nodes4, sections5, cnt3, elements2, clear16, getSection, getSections5, getData, addNode2, nodeType2, getType2, setElementForId2, decorateNode2, type2Str2, getLogger2, getElementById3, db5, kanbanDb_default;
+ var init_kanbanDb = __esm({
+ "src/diagrams/kanban/kanbanDb.ts"() {
+ "use strict";
+ init_diagramAPI();
+ init_common();
+ init_logger();
+ init_defaultConfig();
+ init_js_yaml();
+ nodes4 = [];
+ sections5 = [];
+ cnt3 = 0;
+ elements2 = {};
+ clear16 = /* @__PURE__ */ __name(() => {
+ nodes4 = [];
+ sections5 = [];
+ cnt3 = 0;
+ elements2 = {};
+ }, "clear");
+ getSection = /* @__PURE__ */ __name((level) => {
+ if (nodes4.length === 0) {
+ return null;
+ }
+ const sectionLevel = nodes4[0].level;
+ let lastSection = null;
+ for (let i2 = nodes4.length - 1; i2 >= 0; i2--) {
+ if (nodes4[i2].level === sectionLevel && !lastSection) {
+ lastSection = nodes4[i2];
+ }
+ if (nodes4[i2].level < sectionLevel) {
+ throw new Error('Items without section detected, found section ("' + nodes4[i2].label + '")');
+ }
+ }
+ if (level === lastSection?.level) {
+ return null;
+ }
+ return lastSection;
+ }, "getSection");
+ getSections5 = /* @__PURE__ */ __name(function() {
+ return sections5;
+ }, "getSections");
+ getData = /* @__PURE__ */ __name(function() {
+ const edges3 = [];
+ const _nodes = [];
+ const sections6 = getSections5();
+ const conf5 = getConfig2();
+ for (const section of sections6) {
+ const node2 = {
+ id: section.id,
+ label: sanitizeText(section.label ?? "", conf5),
+ isGroup: true,
+ ticket: section.ticket,
+ shape: "kanbanSection",
+ level: section.level,
+ look: conf5.look
+ };
+ _nodes.push(node2);
+ const children2 = nodes4.filter((n2) => n2.parentId === section.id);
+ for (const item of children2) {
+ const childNode = {
+ id: item.id,
+ parentId: section.id,
+ label: sanitizeText(item.label ?? "", conf5),
+ isGroup: false,
+ ticket: item?.ticket,
+ priority: item?.priority,
+ assigned: item?.assigned,
+ icon: item?.icon,
+ shape: "kanbanItem",
+ level: item.level,
+ rx: 5,
+ ry: 5,
+ cssStyles: ["text-align: left"]
+ };
+ _nodes.push(childNode);
+ }
+ }
+ return { nodes: _nodes, edges: edges3, other: {}, config: getConfig2() };
+ }, "getData");
+ addNode2 = /* @__PURE__ */ __name((level, id29, descr, type3, shapeData) => {
+ const conf5 = getConfig2();
+ let padding2 = conf5.mindmap?.padding ?? defaultConfig_default.mindmap.padding;
+ switch (type3) {
+ case nodeType2.ROUNDED_RECT:
+ case nodeType2.RECT:
+ case nodeType2.HEXAGON:
+ padding2 *= 2;
+ }
+ const node2 = {
+ id: sanitizeText(id29, conf5) || "kbn" + cnt3++,
+ level,
+ label: sanitizeText(descr, conf5),
+ width: conf5.mindmap?.maxNodeWidth ?? defaultConfig_default.mindmap.maxNodeWidth,
+ padding: padding2,
+ isGroup: false
+ };
+ if (shapeData !== void 0) {
+ let yamlData;
+ if (!shapeData.includes("\n")) {
+ yamlData = "{\n" + shapeData + "\n}";
+ } else {
+ yamlData = shapeData + "\n";
+ }
+ const doc = load(yamlData, { schema: JSON_SCHEMA });
+ if (doc.shape && (doc.shape !== doc.shape.toLowerCase() || doc.shape.includes("_"))) {
+ throw new Error(`No such shape: ${doc.shape}. Shape names should be lowercase.`);
+ }
+ if (doc?.shape && doc.shape === "kanbanItem") {
+ node2.shape = doc?.shape;
+ }
+ if (doc?.label) {
+ node2.label = doc?.label;
+ }
+ if (doc?.icon) {
+ node2.icon = doc?.icon.toString();
+ }
+ if (doc?.assigned) {
+ node2.assigned = doc?.assigned.toString();
+ }
+ if (doc?.ticket) {
+ node2.ticket = doc?.ticket.toString();
+ }
+ if (doc?.priority) {
+ node2.priority = doc?.priority;
+ }
+ }
+ const section = getSection(level);
+ if (section) {
+ node2.parentId = section.id || "kbn" + cnt3++;
+ } else {
+ sections5.push(node2);
+ }
+ nodes4.push(node2);
+ }, "addNode");
+ nodeType2 = {
+ DEFAULT: 0,
+ NO_BORDER: 0,
+ ROUNDED_RECT: 1,
+ RECT: 2,
+ CIRCLE: 3,
+ CLOUD: 4,
+ BANG: 5,
+ HEXAGON: 6
+ };
+ getType2 = /* @__PURE__ */ __name((startStr, endStr) => {
+ log.debug("In get type", startStr, endStr);
+ switch (startStr) {
+ case "[":
+ return nodeType2.RECT;
+ case "(":
+ return endStr === ")" ? nodeType2.ROUNDED_RECT : nodeType2.CLOUD;
+ case "((":
+ return nodeType2.CIRCLE;
+ case ")":
+ return nodeType2.CLOUD;
+ case "))":
+ return nodeType2.BANG;
+ case "{{":
+ return nodeType2.HEXAGON;
+ default:
+ return nodeType2.DEFAULT;
+ }
+ }, "getType");
+ setElementForId2 = /* @__PURE__ */ __name((id29, element3) => {
+ elements2[id29] = element3;
+ }, "setElementForId");
+ decorateNode2 = /* @__PURE__ */ __name((decoration) => {
+ if (!decoration) {
+ return;
+ }
+ const config5 = getConfig2();
+ const node2 = nodes4[nodes4.length - 1];
+ if (decoration.icon) {
+ node2.icon = sanitizeText(decoration.icon, config5);
+ }
+ if (decoration.class) {
+ node2.cssClasses = sanitizeText(decoration.class, config5);
+ }
+ }, "decorateNode");
+ type2Str2 = /* @__PURE__ */ __name((type3) => {
+ switch (type3) {
+ case nodeType2.DEFAULT:
+ return "no-border";
+ case nodeType2.RECT:
+ return "rect";
+ case nodeType2.ROUNDED_RECT:
+ return "rounded-rect";
+ case nodeType2.CIRCLE:
+ return "circle";
+ case nodeType2.CLOUD:
+ return "cloud";
+ case nodeType2.BANG:
+ return "bang";
+ case nodeType2.HEXAGON:
+ return "hexgon";
+ // cspell: disable-line
+ default:
+ return "no-border";
+ }
+ }, "type2Str");
+ getLogger2 = /* @__PURE__ */ __name(() => log, "getLogger");
+ getElementById3 = /* @__PURE__ */ __name((id29) => elements2[id29], "getElementById");
+ db5 = {
+ clear: clear16,
+ addNode: addNode2,
+ getSections: getSections5,
+ getData,
+ nodeType: nodeType2,
+ getType: getType2,
+ setElementForId: setElementForId2,
+ decorateNode: decorateNode2,
+ type2Str: type2Str2,
+ getLogger: getLogger2,
+ getElementById: getElementById3
+ };
+ kanbanDb_default = db5;
+ }
+ });
+
+ // src/diagrams/kanban/kanbanRenderer.ts
+ var draw19, kanbanRenderer_default;
+ var init_kanbanRenderer = __esm({
+ "src/diagrams/kanban/kanbanRenderer.ts"() {
+ "use strict";
+ init_diagramAPI();
+ init_logger();
+ init_selectSvgElement();
+ init_setupGraphViewbox();
+ init_defaultConfig();
+ init_clusters();
+ init_nodes2();
+ draw19 = /* @__PURE__ */ __name(async (text4, id29, _version, diagObj) => {
+ log.debug("Rendering kanban diagram\n" + text4);
+ const db10 = diagObj.db;
+ const data4Layout = db10.getData();
+ const conf5 = getConfig2();
+ conf5.htmlLabels = false;
+ const svg2 = selectSvgElement(id29);
+ const sectionsElem = svg2.append("g");
+ sectionsElem.attr("class", "sections");
+ const nodesElem = svg2.append("g");
+ nodesElem.attr("class", "items");
+ const sections6 = data4Layout.nodes.filter(
+ // TODO: TypeScript 5.5 will infer this predicate automatically
+ (node2) => node2.isGroup
+ );
+ let cnt5 = 0;
+ const padding2 = 10;
+ const sectionObjects = [];
+ let maxLabelHeight = 25;
+ for (const section of sections6) {
+ const WIDTH = conf5?.kanban?.sectionWidth || 200;
+ cnt5 = cnt5 + 1;
+ section.x = WIDTH * cnt5 + (cnt5 - 1) * padding2 / 2;
+ section.width = WIDTH;
+ section.y = 0;
+ section.height = WIDTH * 3;
+ section.rx = 5;
+ section.ry = 5;
+ section.cssClasses = section.cssClasses + " section-" + cnt5;
+ const sectionObj = await insertCluster(sectionsElem, section);
+ maxLabelHeight = Math.max(maxLabelHeight, sectionObj?.labelBBox?.height);
+ sectionObjects.push(sectionObj);
+ }
+ let i2 = 0;
+ for (const section of sections6) {
+ const sectionObj = sectionObjects[i2];
+ i2 = i2 + 1;
+ const WIDTH = conf5?.kanban?.sectionWidth || 200;
+ const top2 = -WIDTH * 3 / 2 + maxLabelHeight;
+ let y5 = top2;
+ const sectionItems = data4Layout.nodes.filter((node2) => node2.parentId === section.id);
+ for (const item of sectionItems) {
+ if (item.isGroup) {
+ throw new Error("Groups within groups are not allowed in Kanban diagrams");
+ }
+ item.x = section.x;
+ item.width = WIDTH - 1.5 * padding2;
+ const nodeEl = await insertNode(nodesElem, item, { config: conf5 });
+ const bbox = nodeEl.node().getBBox();
+ item.y = y5 + bbox.height / 2;
+ await positionNode(item);
+ y5 = item.y + bbox.height / 2 + padding2 / 2;
+ }
+ const rect3 = sectionObj.cluster.select("rect");
+ const height2 = Math.max(y5 - top2 + 3 * padding2, 50) + (maxLabelHeight - 25);
+ rect3.attr("height", height2);
+ }
+ setupGraphViewbox(
+ void 0,
+ svg2,
+ conf5.mindmap?.padding ?? defaultConfig_default.kanban.padding,
+ conf5.mindmap?.useMaxWidth ?? defaultConfig_default.kanban.useMaxWidth
+ );
+ }, "draw");
+ kanbanRenderer_default = {
+ draw: draw19
+ };
+ }
+ });
+
+ // src/diagrams/kanban/styles.ts
+ var genSections3, getStyles15, styles_default14;
+ var init_styles14 = __esm({
+ "src/diagrams/kanban/styles.ts"() {
+ "use strict";
+ init_dist();
+ genSections3 = /* @__PURE__ */ __name((options3) => {
+ let sections6 = "";
+ for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) {
+ options3["lineColor" + i2] = options3["lineColor" + i2] || options3["cScaleInv" + i2];
+ if (is_dark_default(options3["lineColor" + i2])) {
+ options3["lineColor" + i2] = lighten_default(options3["lineColor" + i2], 20);
+ } else {
+ options3["lineColor" + i2] = darken_default(options3["lineColor" + i2], 20);
+ }
+ }
+ const adjuster = /* @__PURE__ */ __name((color2, level) => options3.darkMode ? darken_default(color2, level) : lighten_default(color2, level), "adjuster");
+ for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) {
+ const sw = "" + (17 - 3 * i2);
+ sections6 += `
+ .section-${i2 - 1} rect, .section-${i2 - 1} path, .section-${i2 - 1} circle, .section-${i2 - 1} polygon, .section-${i2 - 1} path {
+ fill: ${adjuster(options3["cScale" + i2], 10)};
+ stroke: ${adjuster(options3["cScale" + i2], 10)};
+
+ }
+ .section-${i2 - 1} text {
+ fill: ${options3["cScaleLabel" + i2]};
+ }
+ .node-icon-${i2 - 1} {
+ font-size: 40px;
+ color: ${options3["cScaleLabel" + i2]};
+ }
+ .section-edge-${i2 - 1}{
+ stroke: ${options3["cScale" + i2]};
+ }
+ .edge-depth-${i2 - 1}{
+ stroke-width: ${sw};
+ }
+ .section-${i2 - 1} line {
+ stroke: ${options3["cScaleInv" + i2]} ;
+ stroke-width: 3;
+ }
+
+ .disabled, .disabled circle, .disabled text {
+ fill: lightgray;
+ }
+ .disabled text {
+ fill: #efefef;
+ }
+
+ .node rect,
+ .node circle,
+ .node ellipse,
+ .node polygon,
+ .node path {
+ fill: ${options3.background};
+ stroke: ${options3.nodeBorder};
+ stroke-width: 1px;
+ }
+
+ .kanban-ticket-link {
+ fill: ${options3.background};
+ stroke: ${options3.nodeBorder};
+ text-decoration: underline;
+ }
+ `;
+ }
+ return sections6;
+ }, "genSections");
+ getStyles15 = /* @__PURE__ */ __name((options3) => `
+ .edge {
+ stroke-width: 3;
+ }
+ ${genSections3(options3)}
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
+ fill: ${options3.git0};
+ }
+ .section-root text {
+ fill: ${options3.gitBranchLabel0};
+ }
+ .icon-container {
+ height:100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ .edge {
+ fill: none;
+ }
+ .cluster-label, .label {
+ color: ${options3.textColor};
+ fill: ${options3.textColor};
+ }
+ .kanban-label {
+ dy: 1em;
+ alignment-baseline: middle;
+ text-anchor: middle;
+ dominant-baseline: middle;
+ text-align: center;
+ }
+`, "getStyles");
+ styles_default14 = getStyles15;
+ }
+ });
+
+ // src/diagrams/kanban/kanban-definition.ts
+ var kanban_definition_exports = {};
+ __export(kanban_definition_exports, {
+ diagram: () => diagram20
+ });
+ var diagram20;
+ var init_kanban_definition = __esm({
+ "src/diagrams/kanban/kanban-definition.ts"() {
+ "use strict";
+ init_kanban();
+ init_kanbanDb();
+ init_kanbanRenderer();
+ init_styles14();
+ diagram20 = {
+ db: kanbanDb_default,
+ renderer: kanbanRenderer_default,
+ parser: kanban_default,
+ styles: styles_default14
+ };
+ }
+ });
+
// src/diagrams/sankey/parser/sankey.jison
- var parser18, sankey_default;
+ var parser19, sankey_default;
var init_sankey = __esm({
"src/diagrams/sankey/parser/sankey.jison"() {
"use strict";
- parser18 = function() {
+ parser19 = function() {
var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $V0 = [1, 9], $V1 = [1, 10], $V2 = [1, 5, 10, 12];
- var parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -126736,7 +135202,7 @@ g.stateGroup line {
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -126766,7 +135232,7 @@ g.stateGroup line {
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -126778,22 +135244,22 @@ g.stateGroup line {
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -126812,7 +135278,7 @@ g.stateGroup line {
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -127112,7 +135578,7 @@ g.stateGroup line {
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -127196,22 +135662,22 @@ g.stateGroup line {
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
- parser18.parser = parser18;
- sankey_default = parser18;
+ parser19.parser = parser19;
+ sankey_default = parser19;
}
});
// src/diagrams/sankey/sankeyDB.ts
- var links2, nodes5, nodesMap, clear26, SankeyLink, addLink2, SankeyNode, findOrCreateNode, getNodes, getLinks2, getGraph, sankeyDB_default;
+ var links2, nodes5, nodesMap, clear17, SankeyLink, addLink, SankeyNode, findOrCreateNode, getNodes, getLinks2, getGraph, sankeyDB_default;
var init_sankeyDB = __esm({
"src/diagrams/sankey/sankeyDB.ts"() {
"use strict";
@@ -127221,7 +135687,7 @@ g.stateGroup line {
links2 = [];
nodes5 = [];
nodesMap = /* @__PURE__ */ new Map();
- clear26 = /* @__PURE__ */ __name(() => {
+ clear17 = /* @__PURE__ */ __name(() => {
links2 = [];
nodes5 = [];
nodesMap = /* @__PURE__ */ new Map();
@@ -127237,7 +135703,7 @@ g.stateGroup line {
__name(this, "SankeyLink");
}
};
- addLink2 = /* @__PURE__ */ __name((source, target, value2) => {
+ addLink = /* @__PURE__ */ __name((source, target, value2) => {
links2.push(new SankeyLink(source, target, value2));
}, "addLink");
SankeyNode = class {
@@ -127274,7 +135740,7 @@ g.stateGroup line {
getNodes,
getLinks: getLinks2,
getGraph,
- addLink: addLink2,
+ addLink,
findOrCreateNode,
getAccTitle,
setAccTitle,
@@ -127282,7 +135748,7 @@ g.stateGroup line {
setAccDescription,
getDiagramTitle,
setDiagramTitle,
- clear: clear26
+ clear: clear17
};
}
});
@@ -127438,9 +135904,9 @@ g.stateGroup line {
function defaultLinks(graph) {
return graph.links;
}
- function find3(nodeById, id27) {
- const node2 = nodeById.get(id27);
- if (!node2) throw new Error("missing: " + id27);
+ function find3(nodeById, id29) {
+ const node2 = nodeById.get(id29);
+ if (!node2) throw new Error("missing: " + id29);
return node2;
}
function computeLinkBreadths({ nodes: nodes6 }) {
@@ -127461,7 +135927,7 @@ g.stateGroup line {
let x0 = 0, y0 = 0, x1 = 1, y1 = 1;
let dx = 24;
let dy = 8, py;
- let id27 = defaultId;
+ let id29 = defaultId;
let align = justify;
let sort3;
let linkSort;
@@ -127484,7 +135950,7 @@ g.stateGroup line {
return graph;
};
sankey.nodeId = function(_2) {
- return arguments.length ? (id27 = typeof _2 === "function" ? _2 : constant2(_2), sankey) : id27;
+ return arguments.length ? (id29 = typeof _2 === "function" ? _2 : constant2(_2), sankey) : id29;
};
sankey.nodeAlign = function(_2) {
return arguments.length ? (align = typeof _2 === "function" ? _2 : constant2(_2), sankey) : align;
@@ -127522,7 +135988,7 @@ g.stateGroup line {
node2.sourceLinks = [];
node2.targetLinks = [];
}
- const nodeById = new Map(nodes7.map((d2, i2) => [id27(d2, i2, nodes7), d2]));
+ const nodeById = new Map(nodes7.map((d2, i2) => [id29(d2, i2, nodes7), d2]));
for (const [i2, link3] of links4.entries()) {
link3.index = i2;
let { source, target } = link3;
@@ -128008,9 +136474,9 @@ g.stateGroup line {
static next(name) {
return new _Uid(name + ++_Uid.count);
}
- constructor(id27) {
- this.id = id27;
- this.href = `#${id27}`;
+ constructor(id29) {
+ this.id = id29;
+ this.href = `#${id29}`;
}
toString() {
return "url(" + this.href + ")";
@@ -128035,22 +136501,22 @@ g.stateGroup line {
center: center3,
justify
};
- draw20 = /* @__PURE__ */ __name(function(text2, id27, _version, diagObj) {
- const { securityLevel, sankey: conf8 } = getConfig2();
+ draw20 = /* @__PURE__ */ __name(function(text4, id29, _version, diagObj) {
+ const { securityLevel, sankey: conf5 } = getConfig2();
const defaultSankeyConfig = defaultConfig2.sankey;
let sandboxElement;
if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ sandboxElement = select_default2("#i" + id29);
}
const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const svg = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`);
- const width3 = conf8?.width ?? defaultSankeyConfig.width;
- const height2 = conf8?.height ?? defaultSankeyConfig.width;
- const useMaxWidth = conf8?.useMaxWidth ?? defaultSankeyConfig.useMaxWidth;
- const nodeAlignment = conf8?.nodeAlignment ?? defaultSankeyConfig.nodeAlignment;
- const prefix = conf8?.prefix ?? defaultSankeyConfig.prefix;
- const suffix = conf8?.suffix ?? defaultSankeyConfig.suffix;
- const showValues = conf8?.showValues ?? defaultSankeyConfig.showValues;
+ const svg2 = securityLevel === "sandbox" ? root4.select(`[id="${id29}"]`) : select_default2(`[id="${id29}"]`);
+ const width3 = conf5?.width ?? defaultSankeyConfig.width;
+ const height2 = conf5?.height ?? defaultSankeyConfig.width;
+ const useMaxWidth = conf5?.useMaxWidth ?? defaultSankeyConfig.useMaxWidth;
+ const nodeAlignment = conf5?.nodeAlignment ?? defaultSankeyConfig.nodeAlignment;
+ const prefix = conf5?.prefix ?? defaultSankeyConfig.prefix;
+ const suffix = conf5?.suffix ?? defaultSankeyConfig.suffix;
+ const showValues = conf5?.showValues ?? defaultSankeyConfig.showValues;
const graph = diagObj.db.getGraph();
const nodeAlign = alignmentsMap[nodeAlignment];
const nodeWidth = 10;
@@ -128060,21 +136526,21 @@ g.stateGroup line {
]);
sankey(graph);
const colorScheme = ordinal(Tableau10_default);
- svg.append("g").attr("class", "nodes").selectAll(".node").data(graph.nodes).join("g").attr("class", "node").attr("id", (d2) => (d2.uid = Uid.next("node-")).id).attr("transform", function(d2) {
+ svg2.append("g").attr("class", "nodes").selectAll(".node").data(graph.nodes).join("g").attr("class", "node").attr("id", (d2) => (d2.uid = Uid.next("node-")).id).attr("transform", function(d2) {
return "translate(" + d2.x0 + "," + d2.y0 + ")";
}).attr("x", (d2) => d2.x0).attr("y", (d2) => d2.y0).append("rect").attr("height", (d2) => {
return d2.y1 - d2.y0;
}).attr("width", (d2) => d2.x1 - d2.x0).attr("fill", (d2) => colorScheme(d2.id));
- const getText = /* @__PURE__ */ __name(({ id: id28, value: value2 }) => {
+ const getText = /* @__PURE__ */ __name(({ id: id30, value: value2 }) => {
if (!showValues) {
- return id28;
+ return id30;
}
- return `${id28}
+ return `${id30}
${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}, "getText");
- svg.append("g").attr("class", "node-labels").attr("font-family", "sans-serif").attr("font-size", 14).selectAll("text").data(graph.nodes).join("text").attr("x", (d2) => d2.x0 < width3 / 2 ? d2.x1 + 6 : d2.x0 - 6).attr("y", (d2) => (d2.y1 + d2.y0) / 2).attr("dy", `${showValues ? "0" : "0.35"}em`).attr("text-anchor", (d2) => d2.x0 < width3 / 2 ? "start" : "end").text(getText);
- const link3 = svg.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(graph.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply");
- const linkColor = conf8?.linkColor ?? "gradient";
+ svg2.append("g").attr("class", "node-labels").attr("font-size", 14).selectAll("text").data(graph.nodes).join("text").attr("x", (d2) => d2.x0 < width3 / 2 ? d2.x1 + 6 : d2.x0 - 6).attr("y", (d2) => (d2.y1 + d2.y0) / 2).attr("dy", `${showValues ? "0" : "0.35"}em`).attr("text-anchor", (d2) => d2.x0 < width3 / 2 ? "start" : "end").text(getText);
+ const link3 = svg2.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(graph.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply");
+ const linkColor = conf5?.linkColor ?? "gradient";
if (linkColor === "gradient") {
const gradient = link3.append("linearGradient").attr("id", (d2) => (d2.uid = Uid.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (d2) => d2.source.x1).attr("x2", (d2) => d2.target.x0);
gradient.append("stop").attr("offset", "0%").attr("stop-color", (d2) => colorScheme(d2.source.id));
@@ -128095,7 +136561,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
coloring = linkColor;
}
link3.append("path").attr("d", sankeyLinkHorizontal_default()).attr("stroke", coloring).attr("stroke-width", (d2) => Math.max(1, d2.width));
- setupGraphViewbox(void 0, svg, 0, useMaxWidth);
+ setupGraphViewbox(void 0, svg2, 0, useMaxWidth);
}, "draw");
sankeyRenderer_default = {
draw: draw20
@@ -128108,19 +136574,31 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
var init_sankeyUtils = __esm({
"src/diagrams/sankey/sankeyUtils.ts"() {
"use strict";
- prepareTextForParsing = /* @__PURE__ */ __name((text2) => {
- const textToParse = text2.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, "\n").trim();
+ prepareTextForParsing = /* @__PURE__ */ __name((text4) => {
+ const textToParse = text4.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, "\n").trim();
return textToParse;
}, "prepareTextForParsing");
}
});
+ // src/diagrams/sankey/styles.js
+ var getStyles16, styles_default15;
+ var init_styles15 = __esm({
+ "src/diagrams/sankey/styles.js"() {
+ "use strict";
+ getStyles16 = /* @__PURE__ */ __name((options3) => `.label {
+ font-family: ${options3.fontFamily};
+ }`, "getStyles");
+ styles_default15 = getStyles16;
+ }
+ });
+
// src/diagrams/sankey/sankeyDiagram.ts
var sankeyDiagram_exports = {};
__export(sankeyDiagram_exports, {
- diagram: () => diagram20
+ diagram: () => diagram21
});
- var originalParse, diagram20;
+ var originalParse, diagram21;
var init_sankeyDiagram = __esm({
"src/diagrams/sankey/sankeyDiagram.ts"() {
"use strict";
@@ -128128,9 +136606,11 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
init_sankeyDB();
init_sankeyRenderer();
init_sankeyUtils();
+ init_styles15();
originalParse = sankey_default.parse.bind(sankey_default);
- sankey_default.parse = (text2) => originalParse(prepareTextForParsing(text2));
- diagram20 = {
+ sankey_default.parse = (text4) => originalParse(prepareTextForParsing(text4));
+ diagram21 = {
+ styles: styles_default15,
parser: sankey_default,
db: sankeyDB_default,
renderer: sankeyRenderer_default
@@ -128139,7 +136619,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
});
// src/diagrams/packet/db.ts
- var defaultPacketData, data4, DEFAULT_PACKET_CONFIG, getConfig5, getPacket, pushWord, clear27, db5;
+ var defaultPacketData, data4, DEFAULT_PACKET_CONFIG, getConfig5, getPacket, pushWord, clear18, db6;
var init_db = __esm({
"src/diagrams/packet/db.ts"() {
"use strict";
@@ -128153,14 +136633,14 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
data4 = structuredClone(defaultPacketData);
DEFAULT_PACKET_CONFIG = defaultConfig_default.packet;
getConfig5 = /* @__PURE__ */ __name(() => {
- const config6 = cleanAndMerge({
+ const config5 = cleanAndMerge({
...DEFAULT_PACKET_CONFIG,
...getConfig().packet
});
- if (config6.showBits) {
- config6.paddingY += 10;
+ if (config5.showBits) {
+ config5.paddingY += 10;
}
- return config6;
+ return config5;
}, "getConfig");
getPacket = /* @__PURE__ */ __name(() => data4.packet, "getPacket");
pushWord = /* @__PURE__ */ __name((word) => {
@@ -128168,15 +136648,15 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
data4.packet.push(word);
}
}, "pushWord");
- clear27 = /* @__PURE__ */ __name(() => {
+ clear18 = /* @__PURE__ */ __name(() => {
clear();
data4 = structuredClone(defaultPacketData);
}, "clear");
- db5 = {
+ db6 = {
pushWord,
getPacket,
getConfig: getConfig5,
- clear: clear27,
+ clear: clear18,
setAccTitle,
getAccTitle,
setDiagramTitle,
@@ -128188,7 +136668,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
});
// src/diagrams/packet/parser.ts
- var maxPacketSize, populate16, getNextFittingBlock, parser19;
+ var maxPacketSize, populate16, getNextFittingBlock, parser20;
var init_parser3 = __esm({
"src/diagrams/packet/parser.ts"() {
"use strict";
@@ -128198,11 +136678,11 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
init_db();
maxPacketSize = 1e4;
populate16 = /* @__PURE__ */ __name((ast) => {
- populateCommonDb(ast, db5);
+ populateCommonDb(ast, db6);
let lastByte = -1;
let word = [];
let row = 1;
- const { bitsPerRow } = db5.getConfig();
+ const { bitsPerRow } = db6.getConfig();
for (let { start: start3, end: end2, label } of ast.blocks) {
if (end2 && end2 < start3) {
throw new Error(`Packet block ${start3} - ${end2} is invalid. End must be greater than start.`);
@@ -128214,11 +136694,11 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}
lastByte = end2 ?? start3;
log.debug(`Packet block ${start3} - ${lastByte} with label ${label}`);
- while (word.length <= bitsPerRow + 1 && db5.getPacket().length < maxPacketSize) {
+ while (word.length <= bitsPerRow + 1 && db6.getPacket().length < maxPacketSize) {
const [block3, nextBlock] = getNextFittingBlock({ start: start3, end: end2, label }, row, bitsPerRow);
word.push(block3);
if (block3.end + 1 === row * bitsPerRow) {
- db5.pushWord(word);
+ db6.pushWord(word);
word = [];
row++;
}
@@ -128228,7 +136708,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
({ start: start3, end: end2, label } = nextBlock);
}
}
- db5.pushWord(word);
+ db6.pushWord(word);
}, "populate");
getNextFittingBlock = /* @__PURE__ */ __name((block3, row, bitsPerRow) => {
if (block3.end === void 0) {
@@ -128253,9 +136733,9 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}
];
}, "getNextFittingBlock");
- parser19 = {
+ parser20 = {
parse: /* @__PURE__ */ __name(async (input) => {
- const ast = await parse2("packet", input);
+ const ast = await parse("packet", input);
log.debug(ast);
populate16(ast);
}, "parse")
@@ -128270,25 +136750,25 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
"use strict";
init_selectSvgElement();
init_setupGraphViewbox();
- draw21 = /* @__PURE__ */ __name((_text, id27, _version, diagram24) => {
- const db8 = diagram24.db;
- const config6 = db8.getConfig();
- const { rowHeight, paddingY, bitWidth, bitsPerRow } = config6;
- const words = db8.getPacket();
- const title2 = db8.getDiagramTitle();
+ draw21 = /* @__PURE__ */ __name((_text, id29, _version, diagram26) => {
+ const db10 = diagram26.db;
+ const config5 = db10.getConfig();
+ const { rowHeight, paddingY, bitWidth, bitsPerRow } = config5;
+ const words = db10.getPacket();
+ const title2 = db10.getDiagramTitle();
const totalRowHeight = rowHeight + paddingY;
const svgHeight = totalRowHeight * (words.length + 1) - (title2 ? 0 : rowHeight);
const svgWidth = bitWidth * bitsPerRow + 2;
- const svg = selectSvgElement(id27);
- svg.attr("viewbox", `0 0 ${svgWidth} ${svgHeight}`);
- configureSvgSize(svg, svgHeight, svgWidth, config6.useMaxWidth);
+ const svg2 = selectSvgElement(id29);
+ svg2.attr("viewbox", `0 0 ${svgWidth} ${svgHeight}`);
+ configureSvgSize(svg2, svgHeight, svgWidth, config5.useMaxWidth);
for (const [word, packet2] of words.entries()) {
- drawWord(svg, packet2, word, config6);
+ drawWord(svg2, packet2, word, config5);
}
- svg.append("text").text(title2).attr("x", svgWidth / 2).attr("y", svgHeight - totalRowHeight / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
+ svg2.append("text").text(title2).attr("x", svgWidth / 2).attr("y", svgHeight - totalRowHeight / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
}, "draw");
- drawWord = /* @__PURE__ */ __name((svg, word, rowNumber, { rowHeight, paddingX, paddingY, bitWidth, bitsPerRow, showBits }) => {
- const group2 = svg.append("g");
+ drawWord = /* @__PURE__ */ __name((svg2, word, rowNumber, { rowHeight, paddingX, paddingY, bitWidth, bitsPerRow, showBits }) => {
+ const group2 = svg2.append("g");
const wordY = rowNumber * (rowHeight + paddingY) + paddingY;
for (const block3 of word) {
const blockX = block3.start % bitsPerRow * bitWidth + 1;
@@ -128312,7 +136792,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
// src/diagrams/packet/styles.ts
var defaultPacketStyleOptions, styles2;
- var init_styles14 = __esm({
+ var init_styles16 = __esm({
"src/diagrams/packet/styles.ts"() {
"use strict";
init_utils2();
@@ -128361,36 +136841,390 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
// src/diagrams/packet/diagram.ts
var diagram_exports = {};
__export(diagram_exports, {
- diagram: () => diagram21
+ diagram: () => diagram22
});
- var diagram21;
+ var diagram22;
var init_diagram = __esm({
"src/diagrams/packet/diagram.ts"() {
"use strict";
init_db();
init_parser3();
init_renderer();
- init_styles14();
- diagram21 = {
- parser: parser19,
- db: db5,
+ init_styles16();
+ diagram22 = {
+ parser: parser20,
+ db: db6,
renderer: renderer6,
styles: styles2
};
}
});
+ // src/diagrams/radar/db.ts
+ var defaultOptions, defaultRadarData, data5, DEFAULT_RADAR_CONFIG, getConfig6, getAxes, getCurves, getOptions2, setAxes, setCurves, computeCurveEntries, setOptions8, clear19, db7;
+ var init_db2 = __esm({
+ "src/diagrams/radar/db.ts"() {
+ "use strict";
+ init_config();
+ init_defaultConfig();
+ init_utils2();
+ init_commonDb();
+ defaultOptions = {
+ showLegend: true,
+ ticks: 5,
+ max: null,
+ min: 0,
+ graticule: "circle"
+ };
+ defaultRadarData = {
+ axes: [],
+ curves: [],
+ options: defaultOptions
+ };
+ data5 = structuredClone(defaultRadarData);
+ DEFAULT_RADAR_CONFIG = defaultConfig_default.radar;
+ getConfig6 = /* @__PURE__ */ __name(() => {
+ const config5 = cleanAndMerge({
+ ...DEFAULT_RADAR_CONFIG,
+ ...getConfig().radar
+ });
+ return config5;
+ }, "getConfig");
+ getAxes = /* @__PURE__ */ __name(() => data5.axes, "getAxes");
+ getCurves = /* @__PURE__ */ __name(() => data5.curves, "getCurves");
+ getOptions2 = /* @__PURE__ */ __name(() => data5.options, "getOptions");
+ setAxes = /* @__PURE__ */ __name((axes) => {
+ data5.axes = axes.map((axis2) => {
+ return {
+ name: axis2.name,
+ label: axis2.label ?? axis2.name
+ };
+ });
+ }, "setAxes");
+ setCurves = /* @__PURE__ */ __name((curves) => {
+ data5.curves = curves.map((curve) => {
+ return {
+ name: curve.name,
+ label: curve.label ?? curve.name,
+ entries: computeCurveEntries(curve.entries)
+ };
+ });
+ }, "setCurves");
+ computeCurveEntries = /* @__PURE__ */ __name((entries2) => {
+ if (entries2[0].axis == void 0) {
+ return entries2.map((entry) => entry.value);
+ }
+ const axes = getAxes();
+ if (axes.length === 0) {
+ throw new Error("Axes must be populated before curves for reference entries");
+ }
+ return axes.map((axis2) => {
+ const entry = entries2.find((entry2) => entry2.axis?.$refText === axis2.name);
+ if (entry === void 0) {
+ throw new Error("Missing entry for axis " + axis2.label);
+ }
+ return entry.value;
+ });
+ }, "computeCurveEntries");
+ setOptions8 = /* @__PURE__ */ __name((options3) => {
+ const optionMap = options3.reduce(
+ (acc, option2) => {
+ acc[option2.name] = option2;
+ return acc;
+ },
+ {}
+ );
+ data5.options = {
+ showLegend: optionMap.showLegend?.value ?? defaultOptions.showLegend,
+ ticks: optionMap.ticks?.value ?? defaultOptions.ticks,
+ max: optionMap.max?.value ?? defaultOptions.max,
+ min: optionMap.min?.value ?? defaultOptions.min,
+ graticule: optionMap.graticule?.value ?? defaultOptions.graticule
+ };
+ }, "setOptions");
+ clear19 = /* @__PURE__ */ __name(() => {
+ clear();
+ data5 = structuredClone(defaultRadarData);
+ }, "clear");
+ db7 = {
+ getAxes,
+ getCurves,
+ getOptions: getOptions2,
+ setAxes,
+ setCurves,
+ setOptions: setOptions8,
+ getConfig: getConfig6,
+ clear: clear19,
+ setAccTitle,
+ getAccTitle,
+ setDiagramTitle,
+ getDiagramTitle,
+ getAccDescription,
+ setAccDescription
+ };
+ }
+ });
+
+ // src/diagrams/radar/parser.ts
+ var populate17, parser21;
+ var init_parser4 = __esm({
+ "src/diagrams/radar/parser.ts"() {
+ "use strict";
+ init_mermaid_parser_core();
+ init_logger();
+ init_populateCommonDb();
+ init_db2();
+ populate17 = /* @__PURE__ */ __name((ast) => {
+ populateCommonDb(ast, db7);
+ const { axes, curves, options: options3 } = ast;
+ db7.setAxes(axes);
+ db7.setCurves(curves);
+ db7.setOptions(options3);
+ }, "populate");
+ parser21 = {
+ parse: /* @__PURE__ */ __name(async (input) => {
+ const ast = await parse("radar", input);
+ log.debug(ast);
+ populate17(ast);
+ }, "parse")
+ };
+ }
+ });
+
+ // src/diagrams/radar/renderer.ts
+ function drawCurves(g2, axes, curves, minValue, maxValue, graticule, config5) {
+ const numAxes = axes.length;
+ const radius2 = Math.min(config5.width, config5.height) / 2;
+ curves.forEach((curve, index) => {
+ if (curve.entries.length !== numAxes) {
+ return;
+ }
+ const points = curve.entries.map((entry, i2) => {
+ const angle2 = 2 * Math.PI * i2 / numAxes - Math.PI / 2;
+ const r2 = relativeRadius(entry, minValue, maxValue, radius2);
+ const x5 = r2 * Math.cos(angle2);
+ const y5 = r2 * Math.sin(angle2);
+ return { x: x5, y: y5 };
+ });
+ if (graticule === "circle") {
+ g2.append("path").attr("d", closedRoundCurve(points, config5.curveTension)).attr("class", `radarCurve-${index}`);
+ } else if (graticule === "polygon") {
+ g2.append("polygon").attr("points", points.map((p3) => `${p3.x},${p3.y}`).join(" ")).attr("class", `radarCurve-${index}`);
+ }
+ });
+ }
+ function relativeRadius(value2, minValue, maxValue, radius2) {
+ const clippedValue = Math.min(Math.max(value2, minValue), maxValue);
+ return radius2 * (clippedValue - minValue) / (maxValue - minValue);
+ }
+ function closedRoundCurve(points, tension) {
+ const numPoints = points.length;
+ let d2 = `M${points[0].x},${points[0].y}`;
+ for (let i2 = 0; i2 < numPoints; i2++) {
+ const p0 = points[(i2 - 1 + numPoints) % numPoints];
+ const p1 = points[i2];
+ const p22 = points[(i2 + 1) % numPoints];
+ const p3 = points[(i2 + 2) % numPoints];
+ const cp1 = {
+ x: p1.x + (p22.x - p0.x) * tension,
+ y: p1.y + (p22.y - p0.y) * tension
+ };
+ const cp2 = {
+ x: p22.x - (p3.x - p1.x) * tension,
+ y: p22.y - (p3.y - p1.y) * tension
+ };
+ d2 += ` C${cp1.x},${cp1.y} ${cp2.x},${cp2.y} ${p22.x},${p22.y}`;
+ }
+ return `${d2} Z`;
+ }
+ function drawLegend(g2, curves, showLegend, config5) {
+ if (!showLegend) {
+ return;
+ }
+ const legendX = (config5.width / 2 + config5.marginRight) * 3 / 4;
+ const legendY = -(config5.height / 2 + config5.marginTop) * 3 / 4;
+ const lineHeight = 20;
+ curves.forEach((curve, index) => {
+ const itemGroup = g2.append("g").attr("transform", `translate(${legendX}, ${legendY + index * lineHeight})`);
+ itemGroup.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${index}`);
+ itemGroup.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(curve.label);
+ });
+ }
+ var draw22, drawFrame, drawGraticule, drawAxes2, renderer7;
+ var init_renderer2 = __esm({
+ "src/diagrams/radar/renderer.ts"() {
+ "use strict";
+ init_selectSvgElement();
+ draw22 = /* @__PURE__ */ __name((_text, id29, _version, diagram26) => {
+ const db10 = diagram26.db;
+ const axes = db10.getAxes();
+ const curves = db10.getCurves();
+ const options3 = db10.getOptions();
+ const config5 = db10.getConfig();
+ const title2 = db10.getDiagramTitle();
+ const svg2 = selectSvgElement(id29);
+ const g2 = drawFrame(svg2, config5);
+ const maxValue = options3.max ?? Math.max(...curves.map((curve) => Math.max(...curve.entries)));
+ const minValue = options3.min;
+ const radius2 = Math.min(config5.width, config5.height) / 2;
+ drawGraticule(g2, axes, radius2, options3.ticks, options3.graticule);
+ drawAxes2(g2, axes, radius2, config5);
+ drawCurves(g2, axes, curves, minValue, maxValue, options3.graticule, config5);
+ drawLegend(g2, curves, options3.showLegend, config5);
+ g2.append("text").attr("class", "radarTitle").text(title2).attr("x", 0).attr("y", -config5.height / 2 - config5.marginTop);
+ }, "draw");
+ drawFrame = /* @__PURE__ */ __name((svg2, config5) => {
+ const totalWidth = config5.width + config5.marginLeft + config5.marginRight;
+ const totalHeight = config5.height + config5.marginTop + config5.marginBottom;
+ const center4 = {
+ x: config5.marginLeft + config5.width / 2,
+ y: config5.marginTop + config5.height / 2
+ };
+ svg2.attr("viewbox", `0 0 ${totalWidth} ${totalHeight}`).attr("width", totalWidth).attr("height", totalHeight);
+ return svg2.append("g").attr("transform", `translate(${center4.x}, ${center4.y})`);
+ }, "drawFrame");
+ drawGraticule = /* @__PURE__ */ __name((g2, axes, radius2, ticks2, graticule) => {
+ if (graticule === "circle") {
+ for (let i2 = 0; i2 < ticks2; i2++) {
+ const r2 = radius2 * (i2 + 1) / ticks2;
+ g2.append("circle").attr("r", r2).attr("class", "radarGraticule");
+ }
+ } else if (graticule === "polygon") {
+ const numAxes = axes.length;
+ for (let i2 = 0; i2 < ticks2; i2++) {
+ const r2 = radius2 * (i2 + 1) / ticks2;
+ const points = axes.map((_2, j2) => {
+ const angle2 = 2 * j2 * Math.PI / numAxes - Math.PI / 2;
+ const x5 = r2 * Math.cos(angle2);
+ const y5 = r2 * Math.sin(angle2);
+ return `${x5},${y5}`;
+ }).join(" ");
+ g2.append("polygon").attr("points", points).attr("class", "radarGraticule");
+ }
+ }
+ }, "drawGraticule");
+ drawAxes2 = /* @__PURE__ */ __name((g2, axes, radius2, config5) => {
+ const numAxes = axes.length;
+ for (let i2 = 0; i2 < numAxes; i2++) {
+ const label = axes[i2].label;
+ const angle2 = 2 * i2 * Math.PI / numAxes - Math.PI / 2;
+ g2.append("line").attr("x1", 0).attr("y1", 0).attr("x2", radius2 * config5.axisScaleFactor * Math.cos(angle2)).attr("y2", radius2 * config5.axisScaleFactor * Math.sin(angle2)).attr("class", "radarAxisLine");
+ g2.append("text").text(label).attr("x", radius2 * config5.axisLabelFactor * Math.cos(angle2)).attr("y", radius2 * config5.axisLabelFactor * Math.sin(angle2)).attr("class", "radarAxisLabel");
+ }
+ }, "drawAxes");
+ __name(drawCurves, "drawCurves");
+ __name(relativeRadius, "relativeRadius");
+ __name(closedRoundCurve, "closedRoundCurve");
+ __name(drawLegend, "drawLegend");
+ renderer7 = { draw: draw22 };
+ }
+ });
+
+ // src/diagrams/radar/styles.ts
+ var genIndexStyles, buildRadarStyleOptions, styles3;
+ var init_styles17 = __esm({
+ "src/diagrams/radar/styles.ts"() {
+ "use strict";
+ init_utils2();
+ init_theme_default();
+ init_config();
+ genIndexStyles = /* @__PURE__ */ __name((themeVariables, radarOptions) => {
+ let sections6 = "";
+ for (let i2 = 0; i2 < themeVariables.THEME_COLOR_LIMIT; i2++) {
+ const indexColor = themeVariables[`cScale${i2}`];
+ sections6 += `
+ .radarCurve-${i2} {
+ color: ${indexColor};
+ fill: ${indexColor};
+ fill-opacity: ${radarOptions.curveOpacity};
+ stroke: ${indexColor};
+ stroke-width: ${radarOptions.curveStrokeWidth};
+ }
+ .radarLegendBox-${i2} {
+ fill: ${indexColor};
+ fill-opacity: ${radarOptions.curveOpacity};
+ stroke: ${indexColor};
+ }
+ `;
+ }
+ return sections6;
+ }, "genIndexStyles");
+ buildRadarStyleOptions = /* @__PURE__ */ __name((radar2) => {
+ const defaultThemeVariables2 = getThemeVariables3();
+ const currentConfig2 = getConfig();
+ const themeVariables = cleanAndMerge(defaultThemeVariables2, currentConfig2.themeVariables);
+ const radarOptions = cleanAndMerge(themeVariables.radar, radar2);
+ return { themeVariables, radarOptions };
+ }, "buildRadarStyleOptions");
+ styles3 = /* @__PURE__ */ __name(({ radar: radar2 } = {}) => {
+ const { themeVariables, radarOptions } = buildRadarStyleOptions(radar2);
+ return `
+ .radarTitle {
+ font-size: ${themeVariables.fontSize};
+ color: ${themeVariables.titleColor};
+ dominant-baseline: hanging;
+ text-anchor: middle;
+ }
+ .radarAxisLine {
+ stroke: ${radarOptions.axisColor};
+ stroke-width: ${radarOptions.axisStrokeWidth};
+ }
+ .radarAxisLabel {
+ dominant-baseline: middle;
+ text-anchor: middle;
+ font-size: ${radarOptions.axisLabelFontSize}px;
+ color: ${radarOptions.axisColor};
+ }
+ .radarGraticule {
+ fill: ${radarOptions.graticuleColor};
+ fill-opacity: ${radarOptions.graticuleOpacity};
+ stroke: ${radarOptions.graticuleColor};
+ stroke-width: ${radarOptions.graticuleStrokeWidth};
+ }
+ .radarLegendText {
+ text-anchor: start;
+ font-size: ${radarOptions.legendFontSize}px;
+ dominant-baseline: hanging;
+ }
+ ${genIndexStyles(themeVariables, radarOptions)}
+ `;
+ }, "styles");
+ }
+ });
+
+ // src/diagrams/radar/diagram.ts
+ var diagram_exports2 = {};
+ __export(diagram_exports2, {
+ diagram: () => diagram23
+ });
+ var diagram23;
+ var init_diagram2 = __esm({
+ "src/diagrams/radar/diagram.ts"() {
+ "use strict";
+ init_db2();
+ init_parser4();
+ init_renderer2();
+ init_styles17();
+ diagram23 = {
+ parser: parser21,
+ db: db7,
+ renderer: renderer7,
+ styles: styles3
+ };
+ }
+ });
+
// src/diagrams/block/parser/block.jison
- var parser20, block_default;
+ var parser22, block_default;
var init_block = __esm({
"src/diagrams/block/parser/block.jison"() {
"use strict";
- parser20 = function() {
+ parser22 = function() {
var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ;
return o3;
}, "o"), $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 parser22 = {
+ var parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
@@ -128470,13 +137304,13 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
break;
case 27:
yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]);
- const id27 = yy.generateId();
+ const id29 = yy.generateId();
this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] };
break;
case 28:
yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
- const id28 = yy.generateId();
- this.$ = { id: id28, type: "composite", label: "", children: $$[$0 - 1] };
+ const id30 = yy.generateId();
+ this.$ = { id: id30, type: "composite", label: "", children: $$[$0 - 1] };
break;
case 29:
yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]);
@@ -128525,7 +137359,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
throw error3;
}
}, "parseError"),
- parse: /* @__PURE__ */ __name(function parse8(input) {
+ parse: /* @__PURE__ */ __name(function parse7(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
@@ -128555,7 +137389,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
- function lex2() {
+ function lex() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
@@ -128567,22 +137401,22 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}
return token2;
}
- __name(lex2, "lex");
- var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected;
+ __name(lex, "lex");
+ var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
- state5 = stack[stack.length - 1];
- if (this.defaultActions[state5]) {
- action = this.defaultActions[state5];
+ state4 = stack[stack.length - 1];
+ if (this.defaultActions[state4]) {
+ action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
- symbol = lex2();
+ symbol = lex();
}
- action = table[state5] && table[state5][symbol];
+ action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
- for (p3 in table[state5]) {
+ for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
@@ -128601,7 +137435,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
});
}
if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol);
+ throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
@@ -128901,7 +137735,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}
}, "next"),
// return next match that has a token
- lex: /* @__PURE__ */ __name(function lex2() {
+ lex: /* @__PURE__ */ __name(function lex() {
var r2 = this.next();
if (r2) {
return r2;
@@ -129416,17 +138250,17 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
};
return lexer3;
}();
- parser22.lexer = lexer2;
+ parser24.lexer = lexer2;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
- Parser3.prototype = parser22;
- parser22.Parser = Parser3;
+ Parser3.prototype = parser24;
+ parser24.Parser = Parser3;
return new Parser3();
}();
- parser20.parser = parser20;
- block_default = parser20;
+ parser22.parser = parser22;
+ block_default = parser22;
}
});
@@ -129488,7 +138322,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
return "arrow_point";
}
}
- var blockDatabase, edgeList, edgeCount3, COLOR_KEYWORD2, FILL_KEYWORD2, BG_FILL2, STYLECLASS_SEP2, config5, classes5, sanitizeText7, addStyleClass2, addStyle2Node, setCssClass3, populateBlockDatabase, blocks, rootBlock, clear28, cnt3, generateId3, setHierarchy, getColumns, getBlocksFlat, getBlocks, getEdges2, getBlock, setBlock, getLogger2, getClasses6, db6, blockDB_default;
+ var blockDatabase, edgeList, edgeCount2, COLOR_KEYWORD2, FILL_KEYWORD2, BG_FILL2, STYLECLASS_SEP2, config4, classes2, sanitizeText5, addStyleClass, addStyle2Node, setCssClass, populateBlockDatabase, blocks, rootBlock, clear20, cnt4, generateId2, setHierarchy, getColumns, getBlocksFlat, getBlocks, getEdges, getBlock, setBlock, getLogger3, getClasses4, db8, blockDB_default;
var init_blockDB = __esm({
"src/diagrams/block/blockDB.ts"() {
"use strict";
@@ -129500,19 +138334,19 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
init_commonDb();
blockDatabase = /* @__PURE__ */ new Map();
edgeList = [];
- edgeCount3 = /* @__PURE__ */ new Map();
+ edgeCount2 = /* @__PURE__ */ new Map();
COLOR_KEYWORD2 = "color";
FILL_KEYWORD2 = "fill";
BG_FILL2 = "bgFill";
STYLECLASS_SEP2 = ",";
- config5 = getConfig2();
- classes5 = /* @__PURE__ */ new Map();
- sanitizeText7 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, config5), "sanitizeText");
- addStyleClass2 = /* @__PURE__ */ __name(function(id27, styleAttributes = "") {
- let foundClass = classes5.get(id27);
+ config4 = getConfig2();
+ classes2 = /* @__PURE__ */ new Map();
+ sanitizeText5 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, config4), "sanitizeText");
+ addStyleClass = /* @__PURE__ */ __name(function(id29, styleAttributes = "") {
+ let foundClass = classes2.get(id29);
if (!foundClass) {
- foundClass = { id: id27, styles: [], textStyles: [] };
- classes5.set(id27, foundClass);
+ foundClass = { id: id29, styles: [], textStyles: [] };
+ classes2.set(id29, foundClass);
}
if (styleAttributes !== void 0 && styleAttributes !== null) {
styleAttributes.split(STYLECLASS_SEP2).forEach((attrib) => {
@@ -129526,17 +138360,17 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
});
}
}, "addStyleClass");
- addStyle2Node = /* @__PURE__ */ __name(function(id27, styles3 = "") {
- const foundBlock = blockDatabase.get(id27);
- if (styles3 !== void 0 && styles3 !== null) {
- foundBlock.styles = styles3.split(STYLECLASS_SEP2);
+ addStyle2Node = /* @__PURE__ */ __name(function(id29, styles4 = "") {
+ const foundBlock = blockDatabase.get(id29);
+ if (styles4 !== void 0 && styles4 !== null) {
+ foundBlock.styles = styles4.split(STYLECLASS_SEP2);
}
}, "addStyle2Node");
- setCssClass3 = /* @__PURE__ */ __name(function(itemIds, cssClassName) {
- itemIds.split(",").forEach(function(id27) {
- let foundBlock = blockDatabase.get(id27);
+ setCssClass = /* @__PURE__ */ __name(function(itemIds, cssClassName) {
+ itemIds.split(",").forEach(function(id29) {
+ let foundBlock = blockDatabase.get(id29);
if (foundBlock === void 0) {
- const trimmedId = id27.trim();
+ const trimmedId = id29.trim();
foundBlock = { id: trimmedId, type: "na", children: [] };
blockDatabase.set(trimmedId, foundBlock);
}
@@ -129551,14 +138385,14 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
const children2 = [];
for (const block3 of blockList) {
if (block3.label) {
- block3.label = sanitizeText7(block3.label);
+ block3.label = sanitizeText5(block3.label);
}
if (block3.type === "classDef") {
- addStyleClass2(block3.id, block3.css);
+ addStyleClass(block3.id, block3.css);
continue;
}
if (block3.type === "applyClass") {
- setCssClass3(block3.id, block3?.styleClass ?? "");
+ setCssClass(block3.id, block3?.styleClass ?? "");
continue;
}
if (block3.type === "applyStyles") {
@@ -129570,8 +138404,8 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
if (block3.type === "column-setting") {
parent4.columns = block3.columns ?? -1;
} else if (block3.type === "edge") {
- const count = (edgeCount3.get(block3.id) ?? 0) + 1;
- edgeCount3.set(block3.id, count);
+ const count = (edgeCount2.get(block3.id) ?? 0) + 1;
+ edgeCount2.set(block3.id, count);
block3.id = count + "-" + block3.id;
edgeList.push(block3);
} else {
@@ -129613,23 +138447,23 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}, "populateBlockDatabase");
blocks = [];
rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
- clear28 = /* @__PURE__ */ __name(() => {
+ clear20 = /* @__PURE__ */ __name(() => {
log.debug("Clear called");
clear();
rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
blockDatabase = /* @__PURE__ */ new Map([["root", rootBlock]]);
blocks = [];
- classes5 = /* @__PURE__ */ new Map();
+ classes2 = /* @__PURE__ */ new Map();
edgeList = [];
- edgeCount3 = /* @__PURE__ */ new Map();
+ edgeCount2 = /* @__PURE__ */ new Map();
}, "clear");
__name(typeStr2Type, "typeStr2Type");
__name(edgeTypeStr2Type, "edgeTypeStr2Type");
__name(edgeStrToEdgeData, "edgeStrToEdgeData");
- cnt3 = 0;
- generateId3 = /* @__PURE__ */ __name(() => {
- cnt3++;
- return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt3;
+ cnt4 = 0;
+ generateId2 = /* @__PURE__ */ __name(() => {
+ cnt4++;
+ return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt4;
}, "generateId");
setHierarchy = /* @__PURE__ */ __name((block3) => {
rootBlock.children = block3;
@@ -129655,54 +138489,54 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
getBlocks = /* @__PURE__ */ __name(() => {
return blocks || [];
}, "getBlocks");
- getEdges2 = /* @__PURE__ */ __name(() => {
+ getEdges = /* @__PURE__ */ __name(() => {
return edgeList;
}, "getEdges");
- getBlock = /* @__PURE__ */ __name((id27) => {
- return blockDatabase.get(id27);
+ getBlock = /* @__PURE__ */ __name((id29) => {
+ return blockDatabase.get(id29);
}, "getBlock");
setBlock = /* @__PURE__ */ __name((block3) => {
blockDatabase.set(block3.id, block3);
}, "setBlock");
- getLogger2 = /* @__PURE__ */ __name(() => console, "getLogger");
- getClasses6 = /* @__PURE__ */ __name(function() {
- return classes5;
+ getLogger3 = /* @__PURE__ */ __name(() => console, "getLogger");
+ getClasses4 = /* @__PURE__ */ __name(function() {
+ return classes2;
}, "getClasses");
- db6 = {
+ db8 = {
getConfig: /* @__PURE__ */ __name(() => getConfig().block, "getConfig"),
typeStr2Type,
edgeTypeStr2Type,
edgeStrToEdgeData,
- getLogger: getLogger2,
+ getLogger: getLogger3,
getBlocksFlat,
getBlocks,
- getEdges: getEdges2,
+ getEdges,
setHierarchy,
getBlock,
setBlock,
getColumns,
- getClasses: getClasses6,
- clear: clear28,
- generateId: generateId3
+ getClasses: getClasses4,
+ clear: clear20,
+ generateId: generateId2
};
- blockDB_default = db6;
+ blockDB_default = db8;
}
});
// src/diagrams/block/styles.ts
- var fade2, getStyles15, styles_default14;
- var init_styles15 = __esm({
+ var fade3, getStyles17, styles_default16;
+ var init_styles18 = __esm({
"src/diagrams/block/styles.ts"() {
"use strict";
init_dist();
- fade2 = /* @__PURE__ */ __name((color2, opacity) => {
+ fade3 = /* @__PURE__ */ __name((color2, opacity) => {
const channel2 = channel_default2;
const r2 = channel2(color2, "r");
const g2 = channel2(color2, "g");
const b2 = channel2(color2, "b");
return rgba_default(r2, g2, b2, opacity);
}, "fade");
- getStyles15 = /* @__PURE__ */ __name((options3) => `.label {
+ getStyles17 = /* @__PURE__ */ __name((options3) => `.label {
font-family: ${options3.fontFamily};
color: ${options3.nodeTextColor || options3.textColor};
}
@@ -129772,14 +138606,14 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
/* For html labels only */
.labelBkg {
- background-color: ${fade2(options3.edgeLabelBackground, 0.5)};
+ background-color: ${fade3(options3.edgeLabelBackground, 0.5)};
// background-color:
}
.node .cluster {
- // fill: ${fade2(options3.mainBkg, 0.5)};
- fill: ${fade2(options3.clusterBkg, 0.5)};
- stroke: ${fade2(options3.clusterBorder, 0.2)};
+ // fill: ${fade3(options3.mainBkg, 0.5)};
+ fill: ${fade3(options3.clusterBkg, 0.5)};
+ stroke: ${fade3(options3.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;
}
@@ -129815,7 +138649,69 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
fill: ${options3.textColor};
}
`, "getStyles");
- styles_default14 = getStyles15;
+ styles_default16 = getStyles17;
+ }
+ });
+
+ // src/dagre-wrapper/markers.js
+ var insertMarkers3, extension4, composition2, aggregation2, dependency2, lollipop2, point7, circle4, cross2, barb2, markers2, markers_default2;
+ var init_markers2 = __esm({
+ "src/dagre-wrapper/markers.js"() {
+ "use strict";
+ init_logger();
+ insertMarkers3 = /* @__PURE__ */ __name((elem, markerArray, type3, id29) => {
+ markerArray.forEach((markerName) => {
+ markers2[markerName](elem, type3, id29);
+ });
+ }, "insertMarkers");
+ extension4 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ log.trace("Making markers for ", id29);
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).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", id29 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).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");
+ }, "extension");
+ composition2 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).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", id29 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).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");
+ }, "composition");
+ aggregation2 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).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", id29 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).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");
+ }, "aggregation");
+ dependency2 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).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", id29 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).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");
+ }, "dependency");
+ lollipop2 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).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", id29 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).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);
+ }, "lollipop");
+ point7 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("marker").attr("id", id29 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).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", id29 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).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");
+ }, "point");
+ circle4 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("marker").attr("id", id29 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).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", id29 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).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");
+ }, "circle");
+ cross2 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("marker").attr("id", id29 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).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", id29 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).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");
+ }, "cross");
+ barb2 = /* @__PURE__ */ __name((elem, type3, id29) => {
+ elem.append("defs").append("marker").attr("id", id29 + "_" + type3 + "-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");
+ }, "barb");
+ markers2 = {
+ extension: extension4,
+ composition: composition2,
+ aggregation: aggregation2,
+ dependency: dependency2,
+ lollipop: lollipop2,
+ point: point7,
+ circle: circle4,
+ cross: cross2,
+ barb: barb2
+ };
+ markers_default2 = insertMarkers3;
}
});
@@ -129837,7 +138733,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
const py = Math.floor(position5 / columns);
return { px, py };
}
- function setBlockSizes(block3, db8, siblingWidth = 0, siblingHeight = 0) {
+ function setBlockSizes(block3, db10, siblingWidth = 0, siblingHeight = 0) {
log.debug(
"setBlockSizes abc95 (start)",
block3.id,
@@ -129859,7 +138755,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
let maxHeight = 0;
if (block3.children?.length > 0) {
for (const child of block3.children) {
- setBlockSizes(child, db8);
+ setBlockSizes(child, db10);
}
const childSize = getMaxChildSize(block3);
maxWidth = childSize.width;
@@ -129870,7 +138766,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
log.debug(
`abc95 Setting size of children of ${block3.id} id=${child.id} ${maxWidth} ${maxHeight} ${JSON.stringify(child.size)}`
);
- child.size.width = maxWidth * (child.widthInColumns ?? 1) + padding2 * ((child.widthInColumns ?? 1) - 1);
+ child.size.width = maxWidth * (child.widthInColumns ?? 1) + padding * ((child.widthInColumns ?? 1) - 1);
child.size.height = maxHeight;
child.size.x = 0;
child.size.y = 0;
@@ -129880,7 +138776,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}
}
for (const child of block3.children) {
- setBlockSizes(child, db8, maxWidth, maxHeight);
+ setBlockSizes(child, db10, maxWidth, maxHeight);
}
const columns = block3.columns ?? -1;
let numItems = 0;
@@ -129892,19 +138788,19 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
xSize = columns;
}
const ySize = Math.ceil(numItems / xSize);
- let width3 = xSize * (maxWidth + padding2) + padding2;
- let height2 = ySize * (maxHeight + padding2) + padding2;
+ let width3 = xSize * (maxWidth + padding) + padding;
+ let height2 = ySize * (maxHeight + padding) + padding;
if (width3 < siblingWidth) {
log.debug(
`Detected to small siebling: abc95 ${block3.id} sieblingWidth ${siblingWidth} sieblingHeight ${siblingHeight} width ${width3}`
);
width3 = siblingWidth;
height2 = siblingHeight;
- const childWidth = (siblingWidth - xSize * padding2 - padding2) / xSize;
- const childHeight = (siblingHeight - ySize * padding2 - padding2) / ySize;
+ const childWidth = (siblingWidth - xSize * padding - padding) / xSize;
+ const childHeight = (siblingHeight - ySize * padding - padding) / ySize;
log.debug("Size indata abc88", block3.id, "childWidth", childWidth, "maxWidth", maxWidth);
log.debug("Size indata abc88", block3.id, "childHeight", childHeight, "maxHeight", maxHeight);
- log.debug("Size indata abc88 xSize", xSize, "padding", padding2);
+ log.debug("Size indata abc88 xSize", xSize, "padding", padding);
for (const child of block3.children) {
if (child.size) {
child.size.width = childWidth;
@@ -129921,7 +138817,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
width3 = block3?.size?.width || 0;
const num = columns > 0 ? Math.min(block3.children.length, columns) : block3.children.length;
if (num > 0) {
- const childWidth = (width3 - num * padding2 - padding2) / num;
+ const childWidth = (width3 - num * padding - padding) / num;
log.debug("abc95 (growing to fit) width", block3.id, width3, block3.size?.width, childWidth);
for (const child of block3.children) {
if (child.size) {
@@ -129946,7 +138842,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
block3?.size?.height
);
}
- function layoutBlocks(block3, db8) {
+ function layoutBlocks(block3, db10) {
log.debug(
`abc85 layout blocks (=>layoutBlocks) ${block3.id} x: ${block3?.size?.x} y: ${block3?.size?.y} width: ${block3?.size?.width}`
);
@@ -129955,11 +138851,11 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
if (block3.children && // find max width of children
block3.children.length > 0) {
const width3 = block3?.children[0]?.size?.width ?? 0;
- const widthOfChildren = block3.children.length * width3 + (block3.children.length - 1) * padding2;
+ const widthOfChildren = block3.children.length * width3 + (block3.children.length - 1) * padding;
log.debug("widthOfChildren 88", widthOfChildren, "posX");
let columnPos = 0;
log.debug("abc91 block?.size?.x", block3.id, block3?.size?.x);
- let startingPosX = block3?.size?.x ? block3?.size?.x + (-block3?.size?.width / 2 || 0) : -padding2;
+ let startingPosX = block3?.size?.x ? block3?.size?.x + (-block3?.size?.width / 2 || 0) : -padding;
let rowPos = 0;
for (const child of block3.children) {
const parent4 = block3;
@@ -129970,26 +138866,26 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
const { px, py } = calculateBlockPosition(columns, columnPos);
if (py != rowPos) {
rowPos = py;
- startingPosX = block3?.size?.x ? block3?.size?.x + (-block3?.size?.width / 2 || 0) : -padding2;
+ startingPosX = block3?.size?.x ? block3?.size?.x + (-block3?.size?.width / 2 || 0) : -padding;
log.debug("New row in layout for block", block3.id, " and child ", child.id, rowPos);
}
log.debug(
- `abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${parent4?.size?.x},${parent4?.size?.y}) parent: ${parent4.id} width: ${width4}${padding2}`
+ `abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${parent4?.size?.x},${parent4?.size?.y}) parent: ${parent4.id} width: ${width4}${padding}`
);
if (parent4.size) {
const halfWidth = width4 / 2;
- child.size.x = startingPosX + padding2 + halfWidth;
+ 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=${padding2} width=${width4} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width4 * (child?.widthInColumns ?? 1) / 2}`
+ `abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width4} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width4 * (child?.widthInColumns ?? 1) / 2}`
);
startingPosX = child.size.x + halfWidth;
- child.size.y = parent4.size.y - parent4.size.height / 2 + py * (height2 + padding2) + height2 / 2 + padding2;
+ child.size.y = parent4.size.y - parent4.size.height / 2 + py * (height2 + padding) + height2 / 2 + padding;
log.debug(
- `abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding2}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width4 * (child?.widthInColumns ?? 1) / 2}`
+ `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${width4 * (child?.widthInColumns ?? 1) / 2}`
);
}
if (child.children) {
- layoutBlocks(child, db8);
+ layoutBlocks(child, db10);
}
columnPos += child?.widthInColumns ?? 1;
log.debug("abc88 columnsPos", child, columnPos);
@@ -130022,26 +138918,26 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}
return { minX, minY, maxX, maxY };
}
- function layout5(db8) {
- const root4 = db8.getBlock("root");
+ function layout5(db10) {
+ const root4 = db10.getBlock("root");
if (!root4) {
return;
}
- setBlockSizes(root4, db8, 0, 0);
- layoutBlocks(root4, db8);
+ setBlockSizes(root4, db10, 0, 0);
+ layoutBlocks(root4, db10);
log.debug("getBlocks", JSON.stringify(root4, null, 2));
const { minX, minY, maxX, maxY } = findBounds(root4);
const height2 = maxY - minY;
const width3 = maxX - minX;
return { x: minX, y: minY, width: width3, height: height2 };
}
- var padding2, getMaxChildSize;
+ var padding, getMaxChildSize;
var init_layout2 = __esm({
"src/diagrams/block/layout.ts"() {
"use strict";
init_logger();
init_diagramAPI();
- padding2 = getConfig2()?.block?.padding ?? 8;
+ padding = getConfig2()?.block?.padding ?? 8;
__name(calculateBlockPosition, "calculateBlockPosition");
getMaxChildSize = /* @__PURE__ */ __name((block3) => {
let maxWidth = 0;
@@ -130080,3815 +138976,4226 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}
});
- // src/diagrams/block/renderHelpers.ts
- function getNodeFromBlock(block3, db8, positioned = false) {
- const vertex = block3;
- let classStr = "default";
- if ((vertex?.classes?.length || 0) > 0) {
- classStr = (vertex?.classes ?? []).join(" ");
- }
- classStr = classStr + " flowchart-label";
- let radius2 = 0;
- let shape = "";
- let padding3;
- switch (vertex.type) {
- case "round":
- radius2 = 5;
- shape = "rect";
- break;
- case "composite":
- radius2 = 0;
- shape = "composite";
- padding3 = 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 styles3 = getStylesFromArray(vertex?.styles ?? []);
- const vertexText = vertex.label;
- const bounds4 = vertex.size ?? { width: 0, height: 0, x: 0, y: 0 };
- const node2 = {
- labelStyle: styles3.labelStyle,
- shape,
- labelText: vertexText,
- rx: radius2,
- ry: radius2,
- class: classStr,
- style: styles3.style,
- id: vertex.id,
- directions: vertex.directions,
- width: bounds4.width,
- height: bounds4.height,
- x: bounds4.x,
- y: bounds4.y,
- positioned,
- intersect: void 0,
- type: vertex.type,
- padding: padding3 ?? getConfig()?.block?.padding ?? 0
- };
- return node2;
- }
- async function calculateBlockSize(elem, block3, db8) {
- const node2 = getNodeFromBlock(block3, db8, false);
- if (node2.type === "group") {
- return;
- }
- const nodeEl = await insertNode(elem, node2);
- const boundingBox3 = nodeEl.node().getBBox();
- const obj = db8.getBlock(node2.id);
- obj.size = { width: boundingBox3.width, height: boundingBox3.height, x: 0, y: 0, node: nodeEl };
- db8.setBlock(obj);
- nodeEl.remove();
- }
- async function insertBlockPositioned(elem, block3, db8) {
- const node2 = getNodeFromBlock(block3, db8, true);
- const obj = db8.getBlock(node2.id);
- if (obj.type !== "space") {
- await insertNode(elem, node2);
- block3.intersect = node2?.intersect;
- positionNode(node2);
- }
- }
- async function performOperations(elem, blocks2, db8, operation) {
- for (const block3 of blocks2) {
- await operation(elem, block3, db8);
- if (block3.children) {
- await performOperations(elem, block3.children, db8, operation);
- }
+ // src/dagre-wrapper/createLabel.js
+ function applyStyle3(dom, styleFn) {
+ if (styleFn) {
+ dom.attr("style", styleFn);
}
}
- async function calculateBlockSizes(elem, blocks2, db8) {
- await performOperations(elem, blocks2, db8, calculateBlockSize);
- }
- async function insertBlocks(elem, blocks2, db8) {
- await performOperations(elem, blocks2, db8, insertBlockPositioned);
- }
- async function insertEdges(elem, edges5, blocks2, db8, id27) {
- const g2 = new Graph({
- multigraph: true,
- compound: true
- });
- g2.setGraph({
- rankdir: "TB",
- nodesep: 10,
- ranksep: 10,
- marginx: 8,
- marginy: 8
- });
- for (const block3 of blocks2) {
- if (block3.size) {
- g2.setNode(block3.id, {
- width: block3.size.width,
- height: block3.size.height,
- intersect: block3.intersect
- });
- }
- }
- for (const edge of edges5) {
- if (edge.start && edge.end) {
- const startBlock = db8.getBlock(edge.start);
- const endBlock = db8.getBlock(edge.end);
- if (startBlock?.size && endBlock?.size) {
- const start3 = startBlock.size;
- const end2 = endBlock.size;
- const points = [
- { x: start3.x, y: start3.y },
- { x: start3.x + (end2.x - start3.x) / 2, y: start3.y + (end2.y - start3.y) / 2 },
- { x: end2.x, y: end2.y }
- ];
- insertEdge2(
- 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",
- g2,
- id27
- );
- if (edge.label) {
- await insertEdgeLabel2(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"
- });
- positionEdgeLabel2(
- { ...edge, x: points[1].x, y: points[1].y },
- {
- originalPath: points
- }
- );
- }
- }
- }
- }
+ function addHtmlLabel2(node2) {
+ const fo = select_default2(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"));
+ const div = fo.append("xhtml:div");
+ const label = node2.label;
+ const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel";
+ const span = div.append("span");
+ span.html(label);
+ applyStyle3(span, node2.labelStyle);
+ span.attr("class", labelClass);
+ applyStyle3(div, node2.labelStyle);
+ div.style("display", "inline-block");
+ div.style("white-space", "nowrap");
+ div.attr("xmlns", "http://www.w3.org/1999/xhtml");
+ return fo.node();
}
- var init_renderHelpers = __esm({
- "src/diagrams/block/renderHelpers.ts"() {
+ var createLabel2, createLabel_default2;
+ var init_createLabel2 = __esm({
+ "src/dagre-wrapper/createLabel.js"() {
"use strict";
- init_graphlib();
- init_config();
- init_edges2();
- init_nodes2();
+ init_src32();
+ init_logger();
+ init_diagramAPI();
+ init_common();
init_utils2();
- __name(getNodeFromBlock, "getNodeFromBlock");
- __name(calculateBlockSize, "calculateBlockSize");
- __name(insertBlockPositioned, "insertBlockPositioned");
- __name(performOperations, "performOperations");
- __name(calculateBlockSizes, "calculateBlockSizes");
- __name(insertBlocks, "insertBlocks");
- __name(insertEdges, "insertEdges");
+ init_createText();
+ __name(applyStyle3, "applyStyle");
+ __name(addHtmlLabel2, "addHtmlLabel");
+ createLabel2 = /* @__PURE__ */ __name((_vertexText, style3, isTitle, isNode2) => {
+ let vertexText = _vertexText || "";
+ if (typeof vertexText === "object") {
+ vertexText = vertexText[0];
+ }
+ if (evaluate(getConfig2().flowchart.htmlLabels)) {
+ vertexText = vertexText.replace(/\\n|\n/g, " ");
+ log.debug("vertexText" + vertexText);
+ const node2 = {
+ isNode: isNode2,
+ label: replaceIconSubstring(decodeEntities(vertexText)),
+ labelStyle: style3.replace("fill:", "color:")
+ };
+ let vertexNode = addHtmlLabel2(node2);
+ return vertexNode;
+ } else {
+ const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
+ svgLabel.setAttribute("style", style3.replace("color:", "fill:"));
+ let rows = [];
+ if (typeof vertexText === "string") {
+ rows = vertexText.split(/\\n|\n| /gi);
+ } else if (Array.isArray(vertexText)) {
+ rows = vertexText;
+ } else {
+ rows = [];
+ }
+ for (const row of rows) {
+ const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
+ tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
+ tspan.setAttribute("dy", "1em");
+ tspan.setAttribute("x", "0");
+ if (isTitle) {
+ tspan.setAttribute("class", "title-row");
+ } else {
+ tspan.setAttribute("class", "row");
+ }
+ tspan.textContent = row.trim();
+ svgLabel.appendChild(tspan);
+ }
+ return svgLabel;
+ }
+ }, "createLabel");
+ createLabel_default2 = createLabel2;
}
});
- // src/diagrams/block/blockRenderer.ts
- var getClasses7, draw22, blockRenderer_default;
- var init_blockRenderer = __esm({
- "src/diagrams/block/blockRenderer.ts"() {
+ // src/dagre-wrapper/edgeMarker.ts
+ var addEdgeMarkers2, arrowTypesMap2, addEdgeMarker2;
+ var init_edgeMarker2 = __esm({
+ "src/dagre-wrapper/edgeMarker.ts"() {
"use strict";
- init_src32();
- init_config();
- init_markers2();
init_logger();
- init_setupGraphViewbox();
- init_layout2();
- init_renderHelpers();
- getClasses7 = /* @__PURE__ */ __name(function(text2, diagObj) {
- return diagObj.db.getClasses();
- }, "getClasses");
- draw22 = /* @__PURE__ */ __name(async function(text2, id27, _version, diagObj) {
- const { securityLevel, block: conf8 } = getConfig();
- const db8 = diagObj.db;
- let sandboxElement;
- if (securityLevel === "sandbox") {
- sandboxElement = select_default2("#i" + id27);
+ addEdgeMarkers2 = /* @__PURE__ */ __name((svgPath, edge, url, id29, diagramType) => {
+ if (edge.arrowTypeStart) {
+ addEdgeMarker2(svgPath, "start", edge.arrowTypeStart, url, id29, diagramType);
}
- const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
- const svg = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`);
- const markers3 = ["point", "circle", "cross"];
- markers_default2(svg, markers3, diagObj.type, id27);
- const bl = db8.getBlocks();
- const blArr = db8.getBlocksFlat();
- const edges5 = db8.getEdges();
- const nodes6 = svg.insert("g").attr("class", "block");
- await calculateBlockSizes(nodes6, bl, db8);
- const bounds4 = layout5(db8);
- await insertBlocks(nodes6, bl, db8);
- await insertEdges(nodes6, edges5, blArr, db8, id27);
- if (bounds4) {
- const bounds22 = bounds4;
- const magicFactor = Math.max(1, Math.round(0.125 * (bounds22.width / bounds22.height)));
- const height2 = bounds22.height + magicFactor + 10;
- const width3 = bounds22.width + 10;
- const { useMaxWidth } = conf8;
- configureSvgSize(svg, height2, width3, !!useMaxWidth);
- log.debug("Here Bounds", bounds4, bounds22);
- svg.attr(
- "viewBox",
- `${bounds22.x - 5} ${bounds22.y - 5} ${bounds22.width + 10} ${bounds22.height + 10}`
- );
+ if (edge.arrowTypeEnd) {
+ addEdgeMarker2(svgPath, "end", edge.arrowTypeEnd, url, id29, diagramType);
}
- }, "draw");
- blockRenderer_default = {
- draw: draw22,
- getClasses: getClasses7
+ }, "addEdgeMarkers");
+ arrowTypesMap2 = {
+ arrow_cross: "cross",
+ arrow_point: "point",
+ arrow_barb: "barb",
+ arrow_circle: "circle",
+ aggregation: "aggregation",
+ extension: "extension",
+ composition: "composition",
+ dependency: "dependency",
+ lollipop: "lollipop"
};
+ addEdgeMarker2 = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id29, diagramType) => {
+ const endMarkerType = arrowTypesMap2[arrowType];
+ if (!endMarkerType) {
+ log.warn(`Unknown arrow type: ${arrowType}`);
+ return;
+ }
+ const suffix = position5 === "start" ? "Start" : "End";
+ svgPath.attr(`marker-${position5}`, `url(${url}#${id29}_${diagramType}-${endMarkerType}${suffix})`);
+ }, "addEdgeMarker");
}
});
- // src/diagrams/block/blockDiagram.ts
- var blockDiagram_exports = {};
- __export(blockDiagram_exports, {
- diagram: () => diagram22
- });
- var diagram22;
- var init_blockDiagram = __esm({
- "src/diagrams/block/blockDiagram.ts"() {
- "use strict";
- init_block();
- init_blockDB();
- init_styles15();
- init_blockRenderer();
- diagram22 = {
- parser: block_default,
- db: blockDB_default,
- renderer: blockRenderer_default,
- styles: styles_default14
- };
+ // src/dagre-wrapper/edges.js
+ function setTerminalWidth2(fo, value2) {
+ if (getConfig2().flowchart.htmlLabels && fo) {
+ fo.style.width = value2.length * 9 + "px";
+ fo.style.height = "12px";
}
- });
-
- // src/diagrams/architecture/architectureTypes.ts
- var ArchitectureDirectionName, ArchitectureDirectionArrow, ArchitectureDirectionArrowShift, getOppositeArchitectureDirection, isArchitectureDirection, isArchitectureDirectionX, isArchitectureDirectionY, isArchitectureDirectionXY, isArchitecturePairXY, isValidArchitectureDirectionPair, getArchitectureDirectionPair, shiftPositionByArchitectureDirectionPair, getArchitectureDirectionXYFactors, isArchitectureService, isArchitectureJunction, edgeData, nodeData;
- var init_architectureTypes = __esm({
- "src/diagrams/architecture/architectureTypes.ts"() {
+ }
+ var edgeLabels2, terminalLabels2, insertEdgeLabel2, positionEdgeLabel2, outsideNode2, intersection3, cutPathAtIntersect2, insertEdge2;
+ var init_edges2 = __esm({
+ "src/dagre-wrapper/edges.js"() {
"use strict";
- ArchitectureDirectionName = {
- L: "left",
- R: "right",
- T: "top",
- B: "bottom"
- };
- ArchitectureDirectionArrow = {
- L: /* @__PURE__ */ __name((scale) => `${scale},${scale / 2} 0,${scale} 0,0`, "L"),
- R: /* @__PURE__ */ __name((scale) => `0,${scale / 2} ${scale},0 ${scale},${scale}`, "R"),
- T: /* @__PURE__ */ __name((scale) => `0,0 ${scale},0 ${scale / 2},${scale}`, "T"),
- B: /* @__PURE__ */ __name((scale) => `${scale / 2},0 ${scale},${scale} 0,${scale}`, "B")
- };
- ArchitectureDirectionArrowShift = {
- L: /* @__PURE__ */ __name((orig, arrowSize) => orig - arrowSize + 2, "L"),
- R: /* @__PURE__ */ __name((orig, _arrowSize) => orig - 2, "R"),
- T: /* @__PURE__ */ __name((orig, arrowSize) => orig - arrowSize + 2, "T"),
- B: /* @__PURE__ */ __name((orig, _arrowSize) => orig - 2, "B")
- };
- getOppositeArchitectureDirection = /* @__PURE__ */ __name(function(x5) {
- if (isArchitectureDirectionX(x5)) {
- return x5 === "L" ? "R" : "L";
- } else {
- return x5 === "T" ? "B" : "T";
+ init_logger();
+ init_createLabel2();
+ init_createText();
+ init_src32();
+ init_diagramAPI();
+ init_utils2();
+ init_common();
+ init_lineWithOffset();
+ init_subGraphTitleMargins();
+ init_edgeMarker2();
+ edgeLabels2 = {};
+ terminalLabels2 = {};
+ insertEdgeLabel2 = /* @__PURE__ */ __name((elem, edge) => {
+ const config5 = getConfig2();
+ const useHtmlLabels = evaluate(config5.flowchart.htmlLabels);
+ const labelElement = edge.labelType === "markdown" ? createText(
+ elem,
+ edge.label,
+ {
+ style: edge.labelStyle,
+ useHtmlLabels,
+ addSvgBackground: true
+ },
+ config5
+ ) : createLabel_default2(edge.label, edge.labelStyle);
+ const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
+ const label = edgeLabel.insert("g").attr("class", "label");
+ label.node().appendChild(labelElement);
+ let bbox = labelElement.getBBox();
+ if (useHtmlLabels) {
+ const div = labelElement.children[0];
+ const dv = select_default2(labelElement);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
}
- }, "getOppositeArchitectureDirection");
- isArchitectureDirection = /* @__PURE__ */ __name(function(x5) {
- const temp = x5;
- return temp === "L" || temp === "R" || temp === "T" || temp === "B";
- }, "isArchitectureDirection");
- isArchitectureDirectionX = /* @__PURE__ */ __name(function(x5) {
- const temp = x5;
- return temp === "L" || temp === "R";
- }, "isArchitectureDirectionX");
- isArchitectureDirectionY = /* @__PURE__ */ __name(function(x5) {
- const temp = x5;
- return temp === "T" || temp === "B";
- }, "isArchitectureDirectionY");
- isArchitectureDirectionXY = /* @__PURE__ */ __name(function(a2, b2) {
- const aX_bY = isArchitectureDirectionX(a2) && isArchitectureDirectionY(b2);
- const aY_bX = isArchitectureDirectionY(a2) && isArchitectureDirectionX(b2);
- return aX_bY || aY_bX;
- }, "isArchitectureDirectionXY");
- isArchitecturePairXY = /* @__PURE__ */ __name(function(pair) {
- const lhs = pair[0];
- const rhs = pair[1];
- const aX_bY = isArchitectureDirectionX(lhs) && isArchitectureDirectionY(rhs);
- const aY_bX = isArchitectureDirectionY(lhs) && isArchitectureDirectionX(rhs);
- return aX_bY || aY_bX;
- }, "isArchitecturePairXY");
- isValidArchitectureDirectionPair = /* @__PURE__ */ __name(function(x5) {
- return x5 !== "LL" && x5 !== "RR" && x5 !== "TT" && x5 !== "BB";
- }, "isValidArchitectureDirectionPair");
- getArchitectureDirectionPair = /* @__PURE__ */ __name(function(sourceDir, targetDir) {
- const pair = `${sourceDir}${targetDir}`;
- return isValidArchitectureDirectionPair(pair) ? pair : void 0;
- }, "getArchitectureDirectionPair");
- shiftPositionByArchitectureDirectionPair = /* @__PURE__ */ __name(function([x5, y5], pair) {
- const lhs = pair[0];
- const rhs = pair[1];
- if (isArchitectureDirectionX(lhs)) {
- if (isArchitectureDirectionY(rhs)) {
- return [x5 + (lhs === "L" ? -1 : 1), y5 + (rhs === "T" ? 1 : -1)];
- } else {
- return [x5 + (lhs === "L" ? -1 : 1), y5];
+ label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
+ edgeLabels2[edge.id] = edgeLabel;
+ edge.width = bbox.width;
+ edge.height = bbox.height;
+ let fo;
+ if (edge.startLabelLeft) {
+ const startLabelElement = createLabel_default2(edge.startLabelLeft, edge.labelStyle);
+ const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
+ const inner2 = startEdgeLabelLeft.insert("g").attr("class", "inner");
+ fo = inner2.node().appendChild(startLabelElement);
+ const slBox = startLabelElement.getBBox();
+ inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
+ if (!terminalLabels2[edge.id]) {
+ terminalLabels2[edge.id] = {};
}
- } else {
- if (isArchitectureDirectionX(rhs)) {
- return [x5 + (rhs === "L" ? 1 : -1), y5 + (lhs === "T" ? 1 : -1)];
- } else {
- return [x5, y5 + (lhs === "T" ? 1 : -1)];
+ terminalLabels2[edge.id].startLeft = startEdgeLabelLeft;
+ setTerminalWidth2(fo, edge.startLabelLeft);
+ }
+ if (edge.startLabelRight) {
+ const startLabelElement = createLabel_default2(edge.startLabelRight, edge.labelStyle);
+ const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
+ const inner2 = startEdgeLabelRight.insert("g").attr("class", "inner");
+ fo = startEdgeLabelRight.node().appendChild(startLabelElement);
+ inner2.node().appendChild(startLabelElement);
+ const slBox = startLabelElement.getBBox();
+ inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
+ if (!terminalLabels2[edge.id]) {
+ terminalLabels2[edge.id] = {};
}
+ terminalLabels2[edge.id].startRight = startEdgeLabelRight;
+ setTerminalWidth2(fo, edge.startLabelRight);
}
- }, "shiftPositionByArchitectureDirectionPair");
- getArchitectureDirectionXYFactors = /* @__PURE__ */ __name(function(pair) {
- if (pair === "LT" || pair === "TL") {
- return [1, 1];
- } else if (pair === "BL" || pair === "LB") {
- return [1, -1];
- } else if (pair === "BR" || pair === "RB") {
- return [-1, -1];
- } else {
- return [-1, 1];
+ if (edge.endLabelLeft) {
+ const endLabelElement = createLabel_default2(edge.endLabelLeft, edge.labelStyle);
+ const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
+ const inner2 = endEdgeLabelLeft.insert("g").attr("class", "inner");
+ fo = inner2.node().appendChild(endLabelElement);
+ const slBox = endLabelElement.getBBox();
+ inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
+ endEdgeLabelLeft.node().appendChild(endLabelElement);
+ if (!terminalLabels2[edge.id]) {
+ terminalLabels2[edge.id] = {};
+ }
+ terminalLabels2[edge.id].endLeft = endEdgeLabelLeft;
+ setTerminalWidth2(fo, edge.endLabelLeft);
}
- }, "getArchitectureDirectionXYFactors");
- isArchitectureService = /* @__PURE__ */ __name(function(x5) {
- const temp = x5;
- return temp.type === "service";
- }, "isArchitectureService");
- isArchitectureJunction = /* @__PURE__ */ __name(function(x5) {
- const temp = x5;
- return temp.type === "junction";
- }, "isArchitectureJunction");
- edgeData = /* @__PURE__ */ __name((edge) => {
- return edge.data();
- }, "edgeData");
- nodeData = /* @__PURE__ */ __name((node2) => {
- return node2.data();
- }, "nodeData");
- }
- });
-
- // src/diagrams/architecture/architectureDb.ts
- function getConfigField(field) {
- const arch = getConfig2().architecture;
- if (arch?.[field]) {
- return arch[field];
- }
- return DEFAULT_ARCHITECTURE_CONFIG[field];
- }
- var DEFAULT_ARCHITECTURE_CONFIG, state4, clear29, addService, getServices, addJunction, getJunctions, getNodes2, getNode, addGroup, getGroups, addEdge, getEdges3, getDataStructures, setElementForId2, getElementById3, db7;
- var init_architectureDb = __esm({
- "src/diagrams/architecture/architectureDb.ts"() {
- "use strict";
- init_defaultConfig();
- init_diagramAPI();
- init_imperativeState();
- init_commonDb();
- init_architectureTypes();
- DEFAULT_ARCHITECTURE_CONFIG = defaultConfig_default.architecture;
- state4 = new ImperativeState(() => ({
- nodes: {},
- groups: {},
- edges: [],
- registeredIds: {},
- config: DEFAULT_ARCHITECTURE_CONFIG,
- dataStructures: void 0,
- elements: {}
- }));
- clear29 = /* @__PURE__ */ __name(() => {
- state4.reset();
- clear();
- }, "clear");
- addService = /* @__PURE__ */ __name(function({
- id: id27,
- icon,
- in: parent4,
- title: title2,
- iconText
- }) {
- if (state4.records.registeredIds[id27] !== void 0) {
- throw new Error(
- `The service id [${id27}] is already in use by another ${state4.records.registeredIds[id27]}`
- );
+ if (edge.endLabelRight) {
+ const endLabelElement = createLabel_default2(edge.endLabelRight, edge.labelStyle);
+ const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
+ const inner2 = endEdgeLabelRight.insert("g").attr("class", "inner");
+ fo = inner2.node().appendChild(endLabelElement);
+ const slBox = endLabelElement.getBBox();
+ inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
+ endEdgeLabelRight.node().appendChild(endLabelElement);
+ if (!terminalLabels2[edge.id]) {
+ terminalLabels2[edge.id] = {};
+ }
+ terminalLabels2[edge.id].endRight = endEdgeLabelRight;
+ setTerminalWidth2(fo, edge.endLabelRight);
}
- if (parent4 !== void 0) {
- if (id27 === parent4) {
- throw new Error(`The service [${id27}] cannot be placed within itself`);
+ return labelElement;
+ }, "insertEdgeLabel");
+ __name(setTerminalWidth2, "setTerminalWidth");
+ positionEdgeLabel2 = /* @__PURE__ */ __name((edge, paths) => {
+ log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels2[edge.id], paths);
+ let path4 = paths.updatedPath ? paths.updatedPath : paths.originalPath;
+ const siteConfig2 = getConfig2();
+ const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2);
+ if (edge.label) {
+ const el = edgeLabels2[edge.id];
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcLabelPosition(path4);
+ log.debug(
+ "Moving label " + edge.label + " from (",
+ x5,
+ ",",
+ y5,
+ ") to (",
+ pos.x,
+ ",",
+ pos.y,
+ ") abc88"
+ );
+ if (paths.updatedPath) {
+ x5 = pos.x;
+ y5 = pos.y;
+ }
}
- if (state4.records.registeredIds[parent4] === void 0) {
- throw new Error(
- `The service [${id27}]'s parent does not exist. Please make sure the parent is created before this service`
+ el.attr("transform", `translate(${x5}, ${y5 + subGraphTitleTotalMargin / 2})`);
+ }
+ if (edge.startLabelLeft) {
+ const el = terminalLabels2[edge.id].startLeft;
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path4);
+ x5 = pos.x;
+ y5 = pos.y;
+ }
+ el.attr("transform", `translate(${x5}, ${y5})`);
+ }
+ if (edge.startLabelRight) {
+ const el = terminalLabels2[edge.id].startRight;
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcTerminalLabelPosition(
+ edge.arrowTypeStart ? 10 : 0,
+ "start_right",
+ path4
);
+ x5 = pos.x;
+ y5 = pos.y;
}
- if (state4.records.registeredIds[parent4] === "node") {
- throw new Error(`The service [${id27}]'s parent is not a group`);
+ el.attr("transform", `translate(${x5}, ${y5})`);
+ }
+ if (edge.endLabelLeft) {
+ const el = terminalLabels2[edge.id].endLeft;
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path4);
+ x5 = pos.x;
+ y5 = pos.y;
}
+ el.attr("transform", `translate(${x5}, ${y5})`);
}
- state4.records.registeredIds[id27] = "node";
- state4.records.nodes[id27] = {
- id: id27,
- type: "service",
- icon,
- iconText,
- title: title2,
- edges: [],
- in: parent4
- };
- }, "addService");
- getServices = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes).filter(isArchitectureService), "getServices");
- addJunction = /* @__PURE__ */ __name(function({ id: id27, in: parent4 }) {
- state4.records.registeredIds[id27] = "node";
- state4.records.nodes[id27] = {
- id: id27,
- type: "junction",
- edges: [],
- in: parent4
- };
- }, "addJunction");
- getJunctions = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes).filter(isArchitectureJunction), "getJunctions");
- getNodes2 = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes), "getNodes");
- getNode = /* @__PURE__ */ __name((id27) => state4.records.nodes[id27], "getNode");
- addGroup = /* @__PURE__ */ __name(function({ id: id27, icon, in: parent4, title: title2 }) {
- if (state4.records.registeredIds[id27] !== void 0) {
- throw new Error(
- `The group id [${id27}] is already in use by another ${state4.records.registeredIds[id27]}`
- );
+ if (edge.endLabelRight) {
+ const el = terminalLabels2[edge.id].endRight;
+ let x5 = edge.x;
+ let y5 = edge.y;
+ if (path4) {
+ const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path4);
+ x5 = pos.x;
+ y5 = pos.y;
+ }
+ el.attr("transform", `translate(${x5}, ${y5})`);
}
- if (parent4 !== void 0) {
- if (id27 === parent4) {
- throw new Error(`The group [${id27}] cannot be placed within itself`);
+ }, "positionEdgeLabel");
+ outsideNode2 = /* @__PURE__ */ __name((node2, point8) => {
+ const x5 = node2.x;
+ const y5 = node2.y;
+ const dx = Math.abs(point8.x - x5);
+ const dy = Math.abs(point8.y - y5);
+ const w3 = node2.width / 2;
+ const h2 = node2.height / 2;
+ if (dx >= w3 || dy >= h2) {
+ return true;
+ }
+ return false;
+ }, "outsideNode");
+ intersection3 = /* @__PURE__ */ __name((node2, outsidePoint, insidePoint) => {
+ log.debug(`intersection calc abc89:
+ outsidePoint: ${JSON.stringify(outsidePoint)}
+ insidePoint : ${JSON.stringify(insidePoint)}
+ node : x:${node2.x} y:${node2.y} w:${node2.width} h:${node2.height}`);
+ const x5 = node2.x;
+ const y5 = node2.y;
+ const dx = Math.abs(x5 - insidePoint.x);
+ const w3 = node2.width / 2;
+ let r2 = insidePoint.x < outsidePoint.x ? w3 - dx : w3 + dx;
+ const h2 = node2.height / 2;
+ const Q2 = Math.abs(outsidePoint.y - insidePoint.y);
+ const R2 = Math.abs(outsidePoint.x - insidePoint.x);
+ if (Math.abs(y5 - outsidePoint.y) * w3 > Math.abs(x5 - outsidePoint.x) * h2) {
+ let q2 = insidePoint.y < outsidePoint.y ? outsidePoint.y - h2 - y5 : y5 - h2 - outsidePoint.y;
+ r2 = R2 * q2 / Q2;
+ const res = {
+ x: insidePoint.x < outsidePoint.x ? insidePoint.x + r2 : insidePoint.x - R2 + r2,
+ y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q2 - q2 : insidePoint.y - Q2 + q2
+ };
+ if (r2 === 0) {
+ res.x = outsidePoint.x;
+ res.y = outsidePoint.y;
}
- if (state4.records.registeredIds[parent4] === void 0) {
- throw new Error(
- `The group [${id27}]'s parent does not exist. Please make sure the parent is created before this group`
- );
+ if (R2 === 0) {
+ res.x = outsidePoint.x;
+ }
+ if (Q2 === 0) {
+ res.y = outsidePoint.y;
+ }
+ log.debug(`abc89 topp/bott calc, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, res);
+ return res;
+ } else {
+ if (insidePoint.x < outsidePoint.x) {
+ r2 = outsidePoint.x - w3 - x5;
+ } else {
+ r2 = x5 - w3 - outsidePoint.x;
+ }
+ let q2 = Q2 * r2 / R2;
+ let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R2 - r2 : insidePoint.x - R2 + r2;
+ let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q2 : insidePoint.y - q2;
+ log.debug(`sides calc abc89, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, { _x, _y });
+ if (r2 === 0) {
+ _x = outsidePoint.x;
+ _y = outsidePoint.y;
+ }
+ if (R2 === 0) {
+ _x = outsidePoint.x;
}
- if (state4.records.registeredIds[parent4] === "node") {
- throw new Error(`The group [${id27}]'s parent is not a group`);
+ if (Q2 === 0) {
+ _y = outsidePoint.y;
}
+ return { x: _x, y: _y };
}
- state4.records.registeredIds[id27] = "group";
- state4.records.groups[id27] = {
- id: id27,
- icon,
- title: title2,
- in: parent4
- };
- }, "addGroup");
- getGroups = /* @__PURE__ */ __name(() => {
- return Object.values(state4.records.groups);
- }, "getGroups");
- addEdge = /* @__PURE__ */ __name(function({
- lhsId,
- rhsId,
- lhsDir,
- rhsDir,
- lhsInto,
- rhsInto,
- lhsGroup,
- rhsGroup,
- title: title2
- }) {
- if (!isArchitectureDirection(lhsDir)) {
- throw new Error(
- `Invalid direction given for left hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${lhsDir}`
- );
+ }, "intersection");
+ cutPathAtIntersect2 = /* @__PURE__ */ __name((_points, boundaryNode) => {
+ log.debug("abc88 cutPathAtIntersect", _points, boundaryNode);
+ let points = [];
+ let lastPointOutside = _points[0];
+ let isInside = false;
+ _points.forEach((point8) => {
+ if (!outsideNode2(boundaryNode, point8) && !isInside) {
+ const inter = intersection3(boundaryNode, lastPointOutside, point8);
+ let pointPresent = false;
+ points.forEach((p3) => {
+ pointPresent = pointPresent || p3.x === inter.x && p3.y === inter.y;
+ });
+ if (!points.some((e3) => e3.x === inter.x && e3.y === inter.y)) {
+ points.push(inter);
+ }
+ isInside = true;
+ } else {
+ lastPointOutside = point8;
+ if (!isInside) {
+ points.push(point8);
+ }
+ }
+ });
+ return points;
+ }, "cutPathAtIntersect");
+ insertEdge2 = /* @__PURE__ */ __name(function(elem, e3, edge, clusterDb2, diagramType, graph, id29) {
+ let points = edge.points;
+ log.debug("abc88 InsertEdge: edge=", edge, "e=", e3);
+ let pointsHasChanged = false;
+ const tail = graph.node(e3.v);
+ var head2 = graph.node(e3.w);
+ if (head2?.intersect && tail?.intersect) {
+ points = points.slice(1, edge.points.length - 1);
+ points.unshift(tail.intersect(points[0]));
+ points.push(head2.intersect(points[points.length - 1]));
}
- if (!isArchitectureDirection(rhsDir)) {
- throw new Error(
- `Invalid direction given for right hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${rhsDir}`
- );
+ if (edge.toCluster) {
+ log.debug("to cluster abc88", clusterDb2[edge.toCluster]);
+ points = cutPathAtIntersect2(edge.points, clusterDb2[edge.toCluster].node);
+ pointsHasChanged = true;
}
- if (state4.records.nodes[lhsId] === void 0 && state4.records.groups[lhsId] === void 0) {
- throw new Error(
- `The left-hand id [${lhsId}] does not yet exist. Please create the service/group before declaring an edge to it.`
- );
+ if (edge.fromCluster) {
+ log.debug("from cluster abc88", clusterDb2[edge.fromCluster]);
+ points = cutPathAtIntersect2(points.reverse(), clusterDb2[edge.fromCluster].node).reverse();
+ pointsHasChanged = true;
}
- if (state4.records.nodes[rhsId] === void 0 && state4.records.groups[lhsId] === void 0) {
- throw new Error(
- `The right-hand id [${rhsId}] does not yet exist. Please create the service/group before declaring an edge to it.`
- );
+ const lineData = points.filter((p3) => !Number.isNaN(p3.y));
+ let curve = basis_default2;
+ if (edge.curve && (diagramType === "graph" || diagramType === "flowchart")) {
+ curve = edge.curve;
}
- const lhsGroupId = state4.records.nodes[lhsId].in;
- const rhsGroupId = state4.records.nodes[rhsId].in;
- if (lhsGroup && lhsGroupId && rhsGroupId && lhsGroupId == rhsGroupId) {
- throw new Error(
- `The left-hand id [${lhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
- );
+ const { x: x5, y: y5 } = getLineFunctionsWithOffset(edge);
+ const lineFunction = line_default().x(x5).y(y5).curve(curve);
+ let strokeClasses;
+ switch (edge.thickness) {
+ case "normal":
+ strokeClasses = "edge-thickness-normal";
+ break;
+ case "thick":
+ strokeClasses = "edge-thickness-thick";
+ break;
+ case "invisible":
+ strokeClasses = "edge-thickness-thick";
+ break;
+ default:
+ strokeClasses = "";
}
- if (rhsGroup && lhsGroupId && rhsGroupId && lhsGroupId == rhsGroupId) {
- throw new Error(
- `The right-hand id [${rhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
- );
+ switch (edge.pattern) {
+ case "solid":
+ strokeClasses += " edge-pattern-solid";
+ break;
+ case "dotted":
+ strokeClasses += " edge-pattern-dotted";
+ break;
+ case "dashed":
+ strokeClasses += " edge-pattern-dashed";
+ break;
}
- const edge = {
- lhsId,
- lhsDir,
- lhsInto,
- lhsGroup,
- rhsId,
- rhsDir,
- rhsInto,
- rhsGroup,
- title: title2
- };
- state4.records.edges.push(edge);
- if (state4.records.nodes[lhsId] && state4.records.nodes[rhsId]) {
- state4.records.nodes[lhsId].edges.push(state4.records.edges[state4.records.edges.length - 1]);
- state4.records.nodes[rhsId].edges.push(state4.records.edges[state4.records.edges.length - 1]);
+ const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edge.style);
+ let url = "";
+ if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) {
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
+ url = url.replace(/\(/g, "\\(");
+ url = url.replace(/\)/g, "\\)");
}
- }, "addEdge");
- getEdges3 = /* @__PURE__ */ __name(() => state4.records.edges, "getEdges");
- getDataStructures = /* @__PURE__ */ __name(() => {
- if (state4.records.dataStructures === void 0) {
- const adjList = Object.entries(state4.records.nodes).reduce((prevOuter, [id27, service]) => {
- prevOuter[id27] = service.edges.reduce((prevInner, edge) => {
- if (edge.lhsId === id27) {
- const pair = getArchitectureDirectionPair(edge.lhsDir, edge.rhsDir);
- if (pair) {
- prevInner[pair] = edge.rhsId;
- }
- } else {
- const pair = getArchitectureDirectionPair(edge.rhsDir, edge.lhsDir);
- if (pair) {
- prevInner[pair] = edge.lhsId;
- }
- }
- return prevInner;
- }, {});
- return prevOuter;
- }, {});
- const firstId = Object.keys(adjList)[0];
- const visited = { [firstId]: 1 };
- const notVisited = Object.keys(adjList).reduce(
- (prev2, id27) => id27 === firstId ? prev2 : { ...prev2, [id27]: 1 },
- {}
- );
- const BFS = /* @__PURE__ */ __name((startingId) => {
- const spatialMap = { [startingId]: [0, 0] };
- const queue = [startingId];
- while (queue.length > 0) {
- const id27 = queue.shift();
- if (id27) {
- visited[id27] = 1;
- delete notVisited[id27];
- const adj = adjList[id27];
- const [posX, posY] = spatialMap[id27];
- Object.entries(adj).forEach(([dir2, rhsId]) => {
- if (!visited[rhsId]) {
- spatialMap[rhsId] = shiftPositionByArchitectureDirectionPair(
- [posX, posY],
- dir2
- );
- queue.push(rhsId);
- }
- });
- }
- }
- return spatialMap;
- }, "BFS");
- const spatialMaps = [BFS(firstId)];
- while (Object.keys(notVisited).length > 0) {
- spatialMaps.push(BFS(Object.keys(notVisited)[0]));
- }
- state4.records.dataStructures = {
- adjList,
- spatialMaps
- };
+ addEdgeMarkers2(svgPath, edge, url, id29, diagramType);
+ let paths = {};
+ if (pointsHasChanged) {
+ paths.updatedPath = points;
}
- return state4.records.dataStructures;
- }, "getDataStructures");
- setElementForId2 = /* @__PURE__ */ __name((id27, element3) => {
- state4.records.elements[id27] = element3;
- }, "setElementForId");
- getElementById3 = /* @__PURE__ */ __name((id27) => state4.records.elements[id27], "getElementById");
- db7 = {
- clear: clear29,
- setDiagramTitle,
- getDiagramTitle,
- setAccTitle,
- getAccTitle,
- setAccDescription,
- getAccDescription,
- addService,
- getServices,
- addJunction,
- getJunctions,
- getNodes: getNodes2,
- getNode,
- addGroup,
- getGroups,
- addEdge,
- getEdges: getEdges3,
- setElementForId: setElementForId2,
- getElementById: getElementById3,
- getDataStructures
- };
- __name(getConfigField, "getConfigField");
+ paths.originalPath = edge.points;
+ return paths;
+ }, "insertEdge");
}
});
- // src/diagrams/architecture/architectureParser.ts
- var populateDb2, parser21;
- var init_architectureParser = __esm({
- "src/diagrams/architecture/architectureParser.ts"() {
+ // src/dagre-wrapper/blockArrowHelper.ts
+ var expandAndDeduplicateDirections, getArrowPoints;
+ var init_blockArrowHelper = __esm({
+ "src/dagre-wrapper/blockArrowHelper.ts"() {
"use strict";
- init_mermaid_parser_core();
- init_logger();
- init_populateCommonDb();
- init_architectureDb();
- populateDb2 = /* @__PURE__ */ __name((ast, db8) => {
- populateCommonDb(ast, db8);
- ast.groups.map(db8.addGroup);
- ast.services.map((service) => db8.addService({ ...service, type: "service" }));
- ast.junctions.map((service) => db8.addJunction({ ...service, type: "junction" }));
- ast.edges.map(db8.addEdge);
- }, "populateDb");
- parser21 = {
- parse: /* @__PURE__ */ __name(async (input) => {
- const ast = await parse2("architecture", input);
- log.debug(ast);
- populateDb2(ast, db7);
- }, "parse")
- };
+ expandAndDeduplicateDirections = /* @__PURE__ */ __name((directions) => {
+ const uniqueDirections = /* @__PURE__ */ new Set();
+ for (const direction of directions) {
+ switch (direction) {
+ case "x":
+ uniqueDirections.add("right");
+ uniqueDirections.add("left");
+ break;
+ case "y":
+ uniqueDirections.add("up");
+ uniqueDirections.add("down");
+ break;
+ default:
+ uniqueDirections.add(direction);
+ break;
+ }
+ }
+ return uniqueDirections;
+ }, "expandAndDeduplicateDirections");
+ getArrowPoints = /* @__PURE__ */ __name((duplicatedDirections, bbox, node2) => {
+ const directions = expandAndDeduplicateDirections(duplicatedDirections);
+ const f2 = 2;
+ const height2 = bbox.height + 2 * node2.padding;
+ const midpoint3 = height2 / f2;
+ const width3 = bbox.width + 2 * midpoint3 + node2.padding;
+ const padding2 = node2.padding / 2;
+ if (directions.has("right") && directions.has("left") && directions.has("up") && directions.has("down")) {
+ return [
+ // Bottom
+ { x: 0, y: 0 },
+ { x: midpoint3, y: 0 },
+ { x: width3 / 2, y: 2 * padding2 },
+ { x: width3 - midpoint3, y: 0 },
+ { x: width3, y: 0 },
+ // Right
+ { x: width3, y: -height2 / 3 },
+ { x: width3 + 2 * padding2, y: -height2 / 2 },
+ { x: width3, y: -2 * height2 / 3 },
+ { x: width3, y: -height2 },
+ // Top
+ { x: width3 - midpoint3, y: -height2 },
+ { x: width3 / 2, y: -height2 - 2 * padding2 },
+ { x: midpoint3, y: -height2 },
+ // Left
+ { x: 0, y: -height2 },
+ { x: 0, y: -2 * height2 / 3 },
+ { x: -2 * padding2, y: -height2 / 2 },
+ { x: 0, y: -height2 / 3 }
+ ];
+ }
+ if (directions.has("right") && directions.has("left") && directions.has("up")) {
+ return [
+ { x: midpoint3, y: 0 },
+ { x: width3 - midpoint3, y: 0 },
+ { x: width3, y: -height2 / 2 },
+ { x: width3 - midpoint3, y: -height2 },
+ { x: midpoint3, y: -height2 },
+ { x: 0, y: -height2 / 2 }
+ ];
+ }
+ if (directions.has("right") && directions.has("left") && directions.has("down")) {
+ return [
+ { x: 0, y: 0 },
+ { x: midpoint3, y: -height2 },
+ { x: width3 - midpoint3, y: -height2 },
+ { x: width3, y: 0 }
+ ];
+ }
+ if (directions.has("right") && directions.has("up") && directions.has("down")) {
+ return [
+ { x: 0, y: 0 },
+ { x: width3, y: -midpoint3 },
+ { x: width3, y: -height2 + midpoint3 },
+ { x: 0, y: -height2 }
+ ];
+ }
+ if (directions.has("left") && directions.has("up") && directions.has("down")) {
+ return [
+ { x: width3, y: 0 },
+ { x: 0, y: -midpoint3 },
+ { x: 0, y: -height2 + midpoint3 },
+ { x: width3, y: -height2 }
+ ];
+ }
+ if (directions.has("right") && directions.has("left")) {
+ return [
+ { x: midpoint3, y: 0 },
+ { x: midpoint3, y: -padding2 },
+ { x: width3 - midpoint3, y: -padding2 },
+ { x: width3 - midpoint3, y: 0 },
+ { x: width3, y: -height2 / 2 },
+ { x: width3 - midpoint3, y: -height2 },
+ { x: width3 - midpoint3, y: -height2 + padding2 },
+ { x: midpoint3, y: -height2 + padding2 },
+ { x: midpoint3, y: -height2 },
+ { x: 0, y: -height2 / 2 }
+ ];
+ }
+ if (directions.has("up") && directions.has("down")) {
+ return [
+ // Bottom center
+ { x: width3 / 2, y: 0 },
+ // Left pont of bottom arrow
+ { x: 0, y: -padding2 },
+ { x: midpoint3, y: -padding2 },
+ // Left top over vertical section
+ { x: midpoint3, y: -height2 + padding2 },
+ { x: 0, y: -height2 + padding2 },
+ // Top of arrow
+ { x: width3 / 2, y: -height2 },
+ { x: width3, y: -height2 + padding2 },
+ // Top of right vertical bar
+ { x: width3 - midpoint3, y: -height2 + padding2 },
+ { x: width3 - midpoint3, y: -padding2 },
+ { x: width3, y: -padding2 }
+ ];
+ }
+ if (directions.has("right") && directions.has("up")) {
+ return [
+ { x: 0, y: 0 },
+ { x: width3, y: -midpoint3 },
+ { x: 0, y: -height2 }
+ ];
+ }
+ if (directions.has("right") && directions.has("down")) {
+ return [
+ { x: 0, y: 0 },
+ { x: width3, y: 0 },
+ { x: 0, y: -height2 }
+ ];
+ }
+ if (directions.has("left") && directions.has("up")) {
+ return [
+ { x: width3, y: 0 },
+ { x: 0, y: -midpoint3 },
+ { x: width3, y: -height2 }
+ ];
+ }
+ if (directions.has("left") && directions.has("down")) {
+ return [
+ { x: width3, y: 0 },
+ { x: 0, y: 0 },
+ { x: width3, y: -height2 }
+ ];
+ }
+ if (directions.has("right")) {
+ return [
+ { x: midpoint3, y: -padding2 },
+ { x: midpoint3, y: -padding2 },
+ { x: width3 - midpoint3, y: -padding2 },
+ { x: width3 - midpoint3, y: 0 },
+ { x: width3, y: -height2 / 2 },
+ { x: width3 - midpoint3, y: -height2 },
+ { x: width3 - midpoint3, y: -height2 + padding2 },
+ // top left corner of arrow
+ { x: midpoint3, y: -height2 + padding2 },
+ { x: midpoint3, y: -height2 + padding2 }
+ ];
+ }
+ if (directions.has("left")) {
+ return [
+ { x: midpoint3, y: 0 },
+ { x: midpoint3, y: -padding2 },
+ // Two points, the right corners
+ { x: width3 - midpoint3, y: -padding2 },
+ { x: width3 - midpoint3, y: -height2 + padding2 },
+ { x: midpoint3, y: -height2 + padding2 },
+ { x: midpoint3, y: -height2 },
+ { x: 0, y: -height2 / 2 }
+ ];
+ }
+ if (directions.has("up")) {
+ return [
+ // Bottom center
+ { x: midpoint3, y: -padding2 },
+ // Left top over vertical section
+ { x: midpoint3, y: -height2 + padding2 },
+ { x: 0, y: -height2 + padding2 },
+ // Top of arrow
+ { x: width3 / 2, y: -height2 },
+ { x: width3, y: -height2 + padding2 },
+ // Top of right vertical bar
+ { x: width3 - midpoint3, y: -height2 + padding2 },
+ { x: width3 - midpoint3, y: -padding2 }
+ ];
+ }
+ if (directions.has("down")) {
+ return [
+ // Bottom center
+ { x: width3 / 2, y: 0 },
+ // Left pont of bottom arrow
+ { x: 0, y: -padding2 },
+ { x: midpoint3, y: -padding2 },
+ // Left top over vertical section
+ { x: midpoint3, y: -height2 + padding2 },
+ { x: width3 - midpoint3, y: -height2 + padding2 },
+ { x: width3 - midpoint3, y: -padding2 },
+ { x: width3, y: -padding2 }
+ ];
+ }
+ return [{ x: 0, y: 0 }];
+ }, "getArrowPoints");
}
});
- // src/diagrams/architecture/architectureStyles.ts
- var getStyles16, architectureStyles_default;
- var init_architectureStyles = __esm({
- "src/diagrams/architecture/architectureStyles.ts"() {
+ // src/dagre-wrapper/intersect/intersect-node.js
+ function intersectNode2(node2, point8) {
+ return node2.intersect(point8);
+ }
+ var intersect_node_default2;
+ var init_intersect_node2 = __esm({
+ "src/dagre-wrapper/intersect/intersect-node.js"() {
"use strict";
- getStyles16 = /* @__PURE__ */ __name((options3) => `
- .edge {
- stroke-width: ${options3.archEdgeWidth};
- stroke: ${options3.archEdgeColor};
- fill: none;
+ __name(intersectNode2, "intersectNode");
+ intersect_node_default2 = intersectNode2;
+ }
+ });
+
+ // src/dagre-wrapper/intersect/intersect-ellipse.js
+ function intersectEllipse2(node2, rx, ry, point8) {
+ var cx = node2.x;
+ var cy = node2.y;
+ var px = cx - point8.x;
+ var py = cy - point8.y;
+ var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);
+ var dx = Math.abs(rx * ry * px / det);
+ if (point8.x < cx) {
+ dx = -dx;
+ }
+ var dy = Math.abs(rx * ry * py / det);
+ if (point8.y < cy) {
+ dy = -dy;
+ }
+ return { x: cx + dx, y: cy + dy };
}
+ var intersect_ellipse_default2;
+ var init_intersect_ellipse2 = __esm({
+ "src/dagre-wrapper/intersect/intersect-ellipse.js"() {
+ "use strict";
+ __name(intersectEllipse2, "intersectEllipse");
+ intersect_ellipse_default2 = intersectEllipse2;
+ }
+ });
- .arrow {
- fill: ${options3.archEdgeArrowColor};
+ // src/dagre-wrapper/intersect/intersect-circle.js
+ function intersectCircle2(node2, rx, point8) {
+ return intersect_ellipse_default2(node2, rx, rx, point8);
}
+ var intersect_circle_default2;
+ var init_intersect_circle2 = __esm({
+ "src/dagre-wrapper/intersect/intersect-circle.js"() {
+ "use strict";
+ init_intersect_ellipse2();
+ __name(intersectCircle2, "intersectCircle");
+ intersect_circle_default2 = intersectCircle2;
+ }
+ });
- .node-bkg {
- fill: none;
- stroke: ${options3.archGroupBorderColor};
- stroke-width: ${options3.archGroupBorderWidth};
- stroke-dasharray: 8;
+ // src/dagre-wrapper/intersect/intersect-line.js
+ function intersectLine2(p1, p22, q1, q2) {
+ var a1, a2, b1, b2, c1, c22;
+ var r1, r2, r3, r4;
+ var denom, offset, num;
+ var x5, y5;
+ a1 = p22.y - p1.y;
+ b1 = p1.x - p22.x;
+ c1 = p22.x * p1.y - p1.x * p22.y;
+ r3 = a1 * q1.x + b1 * q1.y + c1;
+ r4 = a1 * q2.x + b1 * q2.y + c1;
+ if (r3 !== 0 && r4 !== 0 && sameSign2(r3, r4)) {
+ return;
+ }
+ a2 = q2.y - q1.y;
+ b2 = q1.x - q2.x;
+ c22 = q2.x * q1.y - q1.x * q2.y;
+ r1 = a2 * p1.x + b2 * p1.y + c22;
+ r2 = a2 * p22.x + b2 * p22.y + c22;
+ if (r1 !== 0 && r2 !== 0 && sameSign2(r1, r2)) {
+ return;
+ }
+ denom = a1 * b2 - a2 * b1;
+ if (denom === 0) {
+ return;
+ }
+ offset = Math.abs(denom / 2);
+ num = b1 * c22 - b2 * c1;
+ x5 = num < 0 ? (num - offset) / denom : (num + offset) / denom;
+ num = a2 * c1 - a1 * c22;
+ y5 = num < 0 ? (num - offset) / denom : (num + offset) / denom;
+ return { x: x5, y: y5 };
}
- .node-icon-text {
- display: flex;
- align-items: center;
+ function sameSign2(r1, r2) {
+ return r1 * r2 > 0;
}
-
- .node-icon-text > div {
- color: #fff;
- margin: 1px;
- height: fit-content;
- text-align: center;
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-orient: vertical;
+ var intersect_line_default2;
+ var init_intersect_line2 = __esm({
+ "src/dagre-wrapper/intersect/intersect-line.js"() {
+ "use strict";
+ __name(intersectLine2, "intersectLine");
+ __name(sameSign2, "sameSign");
+ intersect_line_default2 = intersectLine2;
+ }
+ });
+
+ // src/dagre-wrapper/intersect/intersect-polygon.js
+ function intersectPolygon2(node2, polyPoints, point8) {
+ var x1 = node2.x;
+ var y1 = node2.y;
+ var intersections = [];
+ var minX = Number.POSITIVE_INFINITY;
+ var minY = Number.POSITIVE_INFINITY;
+ if (typeof polyPoints.forEach === "function") {
+ polyPoints.forEach(function(entry) {
+ minX = Math.min(minX, entry.x);
+ minY = Math.min(minY, entry.y);
+ });
+ } else {
+ minX = Math.min(minX, polyPoints.x);
+ minY = Math.min(minY, polyPoints.y);
+ }
+ var left3 = x1 - node2.width / 2 - minX;
+ var top2 = y1 - node2.height / 2 - minY;
+ for (var i2 = 0; i2 < polyPoints.length; i2++) {
+ var p1 = polyPoints[i2];
+ var p22 = polyPoints[i2 < polyPoints.length - 1 ? i2 + 1 : 0];
+ var intersect3 = intersect_line_default2(
+ node2,
+ point8,
+ { x: left3 + p1.x, y: top2 + p1.y },
+ { x: left3 + p22.x, y: top2 + p22.y }
+ );
+ if (intersect3) {
+ intersections.push(intersect3);
+ }
+ }
+ if (!intersections.length) {
+ return node2;
+ }
+ if (intersections.length > 1) {
+ intersections.sort(function(p3, q2) {
+ var pdx = p3.x - point8.x;
+ var pdy = p3.y - point8.y;
+ var distp = Math.sqrt(pdx * pdx + pdy * pdy);
+ var qdx = q2.x - point8.x;
+ var qdy = q2.y - point8.y;
+ var distq = Math.sqrt(qdx * qdx + qdy * qdy);
+ return distp < distq ? -1 : distp === distq ? 0 : 1;
+ });
+ }
+ return intersections[0];
}
-`, "getStyles");
- architectureStyles_default = getStyles16;
+ var intersect_polygon_default2;
+ var init_intersect_polygon2 = __esm({
+ "src/dagre-wrapper/intersect/intersect-polygon.js"() {
+ "use strict";
+ init_intersect_line2();
+ intersect_polygon_default2 = intersectPolygon2;
+ __name(intersectPolygon2, "intersectPolygon");
}
});
- // ../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js
- var require_layout_base2 = __commonJS({
- "../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js"(exports2, module2) {
+ // src/dagre-wrapper/intersect/intersect-rect.js
+ var intersectRect3, intersect_rect_default2;
+ var init_intersect_rect2 = __esm({
+ "src/dagre-wrapper/intersect/intersect-rect.js"() {
"use strict";
- (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) {
- if (typeof exports2 === "object" && typeof module2 === "object")
- module2.exports = factory();
- else if (typeof define === "function" && define.amd)
- define([], factory);
- else if (typeof exports2 === "object")
- exports2["layoutBase"] = factory();
- else
- root4["layoutBase"] = factory();
- }, "webpackUniversalModuleDefinition"))(exports2, function() {
- return (
- /******/
- function(modules2) {
- var installedModules = {};
- function __webpack_require__(moduleId) {
- if (installedModules[moduleId]) {
- return installedModules[moduleId].exports;
- }
- var module3 = installedModules[moduleId] = {
- /******/
- i: moduleId,
- /******/
- l: false,
- /******/
- exports: {}
- /******/
- };
- modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
- module3.l = true;
- return module3.exports;
- }
- __name(__webpack_require__, "__webpack_require__");
- __webpack_require__.m = modules2;
- __webpack_require__.c = installedModules;
- __webpack_require__.i = function(value2) {
- return value2;
- };
- __webpack_require__.d = function(exports3, name, getter) {
- if (!__webpack_require__.o(exports3, name)) {
- Object.defineProperty(exports3, name, {
- /******/
- configurable: false,
- /******/
- enumerable: true,
- /******/
- get: getter
- /******/
- });
- }
- };
- __webpack_require__.n = function(module3) {
- var getter = module3 && module3.__esModule ? (
- /******/
- /* @__PURE__ */ __name(function getDefault() {
- return module3["default"];
- }, "getDefault")
- ) : (
- /******/
- /* @__PURE__ */ __name(function getModuleExports() {
- return module3;
- }, "getModuleExports")
- );
- __webpack_require__.d(getter, "a", getter);
- return getter;
- };
- __webpack_require__.o = function(object3, property2) {
- return Object.prototype.hasOwnProperty.call(object3, property2);
- };
- __webpack_require__.p = "";
- return __webpack_require__(__webpack_require__.s = 28);
- }([
- /* 0 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- function LayoutConstants() {
- }
- __name(LayoutConstants, "LayoutConstants");
- LayoutConstants.QUALITY = 1;
- LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED = false;
- LayoutConstants.DEFAULT_INCREMENTAL = false;
- LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT = true;
- LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT = false;
- LayoutConstants.DEFAULT_ANIMATION_PERIOD = 50;
- LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = false;
- LayoutConstants.DEFAULT_GRAPH_MARGIN = 15;
- LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = false;
- LayoutConstants.SIMPLE_NODE_SIZE = 40;
- LayoutConstants.SIMPLE_NODE_HALF_SIZE = LayoutConstants.SIMPLE_NODE_SIZE / 2;
- LayoutConstants.EMPTY_COMPOUND_NODE_SIZE = 40;
- LayoutConstants.MIN_EDGE_LENGTH = 1;
- LayoutConstants.WORLD_BOUNDARY = 1e6;
- LayoutConstants.INITIAL_WORLD_BOUNDARY = LayoutConstants.WORLD_BOUNDARY / 1e3;
- LayoutConstants.WORLD_CENTER_X = 1200;
- LayoutConstants.WORLD_CENTER_Y = 900;
- module3.exports = LayoutConstants;
- },
- /* 1 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var LGraphObject = __webpack_require__(2);
- var IGeometry = __webpack_require__(8);
- var IMath = __webpack_require__(9);
- function LEdge(source, target, vEdge) {
- LGraphObject.call(this, vEdge);
- this.isOverlapingSourceAndTarget = false;
- this.vGraphObject = vEdge;
- this.bendpoints = [];
- this.source = source;
- this.target = target;
- }
- __name(LEdge, "LEdge");
- LEdge.prototype = Object.create(LGraphObject.prototype);
- for (var prop in LGraphObject) {
- LEdge[prop] = LGraphObject[prop];
- }
- LEdge.prototype.getSource = function() {
- return this.source;
- };
- LEdge.prototype.getTarget = function() {
- return this.target;
- };
- LEdge.prototype.isInterGraph = function() {
- return this.isInterGraph;
- };
- LEdge.prototype.getLength = function() {
- return this.length;
- };
- LEdge.prototype.isOverlapingSourceAndTarget = function() {
- return this.isOverlapingSourceAndTarget;
- };
- LEdge.prototype.getBendpoints = function() {
- return this.bendpoints;
- };
- LEdge.prototype.getLca = function() {
- return this.lca;
- };
- LEdge.prototype.getSourceInLca = function() {
- return this.sourceInLca;
- };
- LEdge.prototype.getTargetInLca = function() {
- return this.targetInLca;
- };
- LEdge.prototype.getOtherEnd = function(node2) {
- if (this.source === node2) {
- return this.target;
- } else if (this.target === node2) {
- return this.source;
- } else {
- throw "Node is not incident with this edge";
- }
- };
- LEdge.prototype.getOtherEndInGraph = function(node2, graph) {
- var otherEnd = this.getOtherEnd(node2);
- var root4 = graph.getGraphManager().getRoot();
- while (true) {
- if (otherEnd.getOwner() == graph) {
- return otherEnd;
- }
- if (otherEnd.getOwner() == root4) {
- break;
- }
- otherEnd = otherEnd.getOwner().getParent();
- }
- return null;
- };
- LEdge.prototype.updateLength = function() {
- var clipPointCoordinates = new Array(4);
- this.isOverlapingSourceAndTarget = IGeometry.getIntersection(this.target.getRect(), this.source.getRect(), clipPointCoordinates);
- if (!this.isOverlapingSourceAndTarget) {
- this.lengthX = clipPointCoordinates[0] - clipPointCoordinates[2];
- this.lengthY = clipPointCoordinates[1] - clipPointCoordinates[3];
- if (Math.abs(this.lengthX) < 1) {
- this.lengthX = IMath.sign(this.lengthX);
- }
- if (Math.abs(this.lengthY) < 1) {
- this.lengthY = IMath.sign(this.lengthY);
- }
- this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
- }
- };
- LEdge.prototype.updateLengthSimple = function() {
- this.lengthX = this.target.getCenterX() - this.source.getCenterX();
- this.lengthY = this.target.getCenterY() - this.source.getCenterY();
- if (Math.abs(this.lengthX) < 1) {
- this.lengthX = IMath.sign(this.lengthX);
- }
- if (Math.abs(this.lengthY) < 1) {
- this.lengthY = IMath.sign(this.lengthY);
- }
- this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
- };
- module3.exports = LEdge;
- },
- /* 2 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- function LGraphObject(vGraphObject) {
- this.vGraphObject = vGraphObject;
- }
- __name(LGraphObject, "LGraphObject");
- module3.exports = LGraphObject;
+ intersectRect3 = /* @__PURE__ */ __name((node2, point8) => {
+ var x5 = node2.x;
+ var y5 = node2.y;
+ var dx = point8.x - x5;
+ var dy = point8.y - y5;
+ var w3 = node2.width / 2;
+ var h2 = node2.height / 2;
+ var sx, sy;
+ if (Math.abs(dy) * w3 > Math.abs(dx) * h2) {
+ if (dy < 0) {
+ h2 = -h2;
+ }
+ sx = dy === 0 ? 0 : h2 * dx / dy;
+ sy = h2;
+ } else {
+ if (dx < 0) {
+ w3 = -w3;
+ }
+ sx = w3;
+ sy = dx === 0 ? 0 : w3 * dy / dx;
+ }
+ return { x: x5 + sx, y: y5 + sy };
+ }, "intersectRect");
+ intersect_rect_default2 = intersectRect3;
+ }
+ });
+
+ // src/dagre-wrapper/intersect/index.js
+ var intersect_default2;
+ var init_intersect2 = __esm({
+ "src/dagre-wrapper/intersect/index.js"() {
+ "use strict";
+ init_intersect_node2();
+ init_intersect_circle2();
+ init_intersect_ellipse2();
+ init_intersect_polygon2();
+ init_intersect_rect2();
+ intersect_default2 = {
+ node: intersect_node_default2,
+ circle: intersect_circle_default2,
+ ellipse: intersect_ellipse_default2,
+ polygon: intersect_polygon_default2,
+ rect: intersect_rect_default2
+ };
+ }
+ });
+
+ // src/dagre-wrapper/shapes/util.js
+ function insertPolygonShape3(parent4, w3, h2, points) {
+ return parent4.insert("polygon", ":first-child").attr(
+ "points",
+ points.map(function(d2) {
+ return d2.x + "," + d2.y;
+ }).join(" ")
+ ).attr("class", "label-container").attr("transform", "translate(" + -w3 / 2 + "," + h2 / 2 + ")");
+ }
+ var labelHelper2, updateNodeBounds2;
+ var init_util4 = __esm({
+ "src/dagre-wrapper/shapes/util.js"() {
+ "use strict";
+ init_createLabel2();
+ init_createText();
+ init_diagramAPI();
+ init_src32();
+ init_common();
+ init_utils2();
+ labelHelper2 = /* @__PURE__ */ __name(async (parent4, node2, _classes, isNode2) => {
+ const config5 = getConfig2();
+ let classes3;
+ const useHtmlLabels = node2.useHtmlLabels || evaluate(config5.flowchart.htmlLabels);
+ if (!_classes) {
+ classes3 = "node default";
+ } else {
+ classes3 = _classes;
+ }
+ const shapeSvg = parent4.insert("g").attr("class", classes3).attr("id", node2.domId || node2.id);
+ const label = shapeSvg.insert("g").attr("class", "label").attr("style", node2.labelStyle);
+ let labelText;
+ if (node2.labelText === void 0) {
+ labelText = "";
+ } else {
+ labelText = typeof node2.labelText === "string" ? node2.labelText : node2.labelText[0];
+ }
+ const textNode = label.node();
+ let text4;
+ if (node2.labelType === "markdown") {
+ text4 = createText(
+ label,
+ sanitizeText(decodeEntities(labelText), config5),
+ {
+ useHtmlLabels,
+ width: node2.width || config5.flowchart.wrappingWidth,
+ classes: "markdown-node-label"
},
- /* 3 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var LGraphObject = __webpack_require__(2);
- var Integer = __webpack_require__(10);
- var RectangleD = __webpack_require__(13);
- var LayoutConstants = __webpack_require__(0);
- var RandomSeed = __webpack_require__(16);
- var PointD = __webpack_require__(5);
- function LNode(gm, loc, size5, vNode) {
- if (size5 == null && vNode == null) {
- vNode = loc;
- }
- LGraphObject.call(this, vNode);
- if (gm.graphManager != null) gm = gm.graphManager;
- this.estimatedSize = Integer.MIN_VALUE;
- this.inclusionTreeDepth = Integer.MAX_VALUE;
- this.vGraphObject = vNode;
- this.edges = [];
- this.graphManager = gm;
- if (size5 != null && loc != null) this.rect = new RectangleD(loc.x, loc.y, size5.width, size5.height);
- else this.rect = new RectangleD();
- }
- __name(LNode, "LNode");
- LNode.prototype = Object.create(LGraphObject.prototype);
- for (var prop in LGraphObject) {
- LNode[prop] = LGraphObject[prop];
- }
- LNode.prototype.getEdges = function() {
- return this.edges;
- };
- LNode.prototype.getChild = function() {
- return this.child;
- };
- LNode.prototype.getOwner = function() {
- return this.owner;
- };
- LNode.prototype.getWidth = function() {
- return this.rect.width;
- };
- LNode.prototype.setWidth = function(width3) {
- this.rect.width = width3;
- };
- LNode.prototype.getHeight = function() {
- return this.rect.height;
- };
- LNode.prototype.setHeight = function(height2) {
- this.rect.height = height2;
- };
- LNode.prototype.getCenterX = function() {
- return this.rect.x + this.rect.width / 2;
- };
- LNode.prototype.getCenterY = function() {
- return this.rect.y + this.rect.height / 2;
- };
- LNode.prototype.getCenter = function() {
- return new PointD(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
- };
- LNode.prototype.getLocation = function() {
- return new PointD(this.rect.x, this.rect.y);
- };
- LNode.prototype.getRect = function() {
- return this.rect;
- };
- LNode.prototype.getDiagonal = function() {
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
- };
- LNode.prototype.getHalfTheDiagonal = function() {
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
- };
- LNode.prototype.setRect = function(upperLeft, dimension) {
- this.rect.x = upperLeft.x;
- this.rect.y = upperLeft.y;
- this.rect.width = dimension.width;
- this.rect.height = dimension.height;
- };
- LNode.prototype.setCenter = function(cx, cy) {
- this.rect.x = cx - this.rect.width / 2;
- this.rect.y = cy - this.rect.height / 2;
- };
- LNode.prototype.setLocation = function(x5, y5) {
- this.rect.x = x5;
- this.rect.y = y5;
- };
- LNode.prototype.moveBy = function(dx, dy) {
- this.rect.x += dx;
- this.rect.y += dy;
- };
- LNode.prototype.getEdgeListToNode = function(to) {
- var edgeList2 = [];
- var edge;
- var self2 = this;
- self2.edges.forEach(function(edge2) {
- if (edge2.target == to) {
- if (edge2.source != self2) throw "Incorrect edge source!";
- edgeList2.push(edge2);
- }
- });
- return edgeList2;
- };
- LNode.prototype.getEdgesBetween = function(other) {
- var edgeList2 = [];
- var edge;
- var self2 = this;
- self2.edges.forEach(function(edge2) {
- if (!(edge2.source == self2 || edge2.target == self2)) throw "Incorrect edge source and/or target";
- if (edge2.target == other || edge2.source == other) {
- edgeList2.push(edge2);
- }
- });
- return edgeList2;
- };
- LNode.prototype.getNeighborsList = function() {
- var neighbors = /* @__PURE__ */ new Set();
- var self2 = this;
- self2.edges.forEach(function(edge) {
- if (edge.source == self2) {
- neighbors.add(edge.target);
- } else {
- if (edge.target != self2) {
- throw "Incorrect incidency!";
+ config5
+ );
+ } else {
+ text4 = textNode.appendChild(
+ createLabel_default2(sanitizeText(decodeEntities(labelText), config5), node2.labelStyle, false, isNode2)
+ );
+ }
+ let bbox = text4.getBBox();
+ const halfPadding = node2.padding / 2;
+ if (evaluate(config5.flowchart.htmlLabels)) {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ const images = div.getElementsByTagName("img");
+ if (images) {
+ const noImgText = labelText.replace(/ ]*>/g, "").trim() === "";
+ await Promise.all(
+ [...images].map(
+ (img) => new Promise((res) => {
+ function setupImage() {
+ img.style.display = "flex";
+ img.style.flexDirection = "column";
+ if (noImgText) {
+ const bodyFontSize = config5.fontSize ? config5.fontSize : window.getComputedStyle(document.body).fontSize;
+ const enlargingFactor = 5;
+ const width3 = parseInt(bodyFontSize, 10) * enlargingFactor + "px";
+ img.style.minWidth = width3;
+ img.style.maxWidth = width3;
+ } else {
+ img.style.width = "100%";
}
- neighbors.add(edge.source);
- }
- });
- return neighbors;
- };
- LNode.prototype.withChildren = function() {
- var withNeighborsList = /* @__PURE__ */ new Set();
- var childNode;
- var children2;
- withNeighborsList.add(this);
- if (this.child != null) {
- var nodes6 = this.child.getNodes();
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- childNode = nodes6[i2];
- children2 = childNode.withChildren();
- children2.forEach(function(node2) {
- withNeighborsList.add(node2);
- });
- }
- }
- return withNeighborsList;
- };
- LNode.prototype.getNoOfChildren = function() {
- var noOfChildren = 0;
- var childNode;
- if (this.child == null) {
- noOfChildren = 1;
- } else {
- var nodes6 = this.child.getNodes();
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- childNode = nodes6[i2];
- noOfChildren += childNode.getNoOfChildren();
+ res(img);
}
- }
- if (noOfChildren == 0) {
- noOfChildren = 1;
- }
- return noOfChildren;
- };
- LNode.prototype.getEstimatedSize = function() {
- if (this.estimatedSize == Integer.MIN_VALUE) {
- throw "assert failed";
- }
- return this.estimatedSize;
- };
- LNode.prototype.calcEstimatedSize = function() {
- if (this.child == null) {
- return this.estimatedSize = (this.rect.width + this.rect.height) / 2;
- } else {
- this.estimatedSize = this.child.calcEstimatedSize();
- this.rect.width = this.estimatedSize;
- this.rect.height = this.estimatedSize;
- return this.estimatedSize;
- }
- };
- LNode.prototype.scatter = function() {
- var randomCenterX;
- var randomCenterY;
- var minX = -LayoutConstants.INITIAL_WORLD_BOUNDARY;
- var maxX = LayoutConstants.INITIAL_WORLD_BOUNDARY;
- randomCenterX = LayoutConstants.WORLD_CENTER_X + RandomSeed.nextDouble() * (maxX - minX) + minX;
- var minY = -LayoutConstants.INITIAL_WORLD_BOUNDARY;
- var maxY = LayoutConstants.INITIAL_WORLD_BOUNDARY;
- randomCenterY = LayoutConstants.WORLD_CENTER_Y + RandomSeed.nextDouble() * (maxY - minY) + minY;
- this.rect.x = randomCenterX;
- this.rect.y = randomCenterY;
- };
- LNode.prototype.updateBounds = function() {
- if (this.getChild() == null) {
- throw "assert failed";
- }
- if (this.getChild().getNodes().length != 0) {
- var childGraph = this.getChild();
- childGraph.updateBounds(true);
- this.rect.x = childGraph.getLeft();
- this.rect.y = childGraph.getTop();
- this.setWidth(childGraph.getRight() - childGraph.getLeft());
- this.setHeight(childGraph.getBottom() - childGraph.getTop());
- if (LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {
- var width3 = childGraph.getRight() - childGraph.getLeft();
- var height2 = childGraph.getBottom() - childGraph.getTop();
- if (this.labelWidth) {
- if (this.labelPosHorizontal == "left") {
- this.rect.x -= this.labelWidth;
- this.setWidth(width3 + this.labelWidth);
- } else if (this.labelPosHorizontal == "center" && this.labelWidth > width3) {
- this.rect.x -= (this.labelWidth - width3) / 2;
- this.setWidth(this.labelWidth);
- } else if (this.labelPosHorizontal == "right") {
- this.setWidth(width3 + this.labelWidth);
- }
- }
- if (this.labelHeight) {
- if (this.labelPosVertical == "top") {
- this.rect.y -= this.labelHeight;
- this.setHeight(height2 + this.labelHeight);
- } else if (this.labelPosVertical == "center" && this.labelHeight > height2) {
- this.rect.y -= (this.labelHeight - height2) / 2;
- this.setHeight(this.labelHeight);
- } else if (this.labelPosVertical == "bottom") {
- this.setHeight(height2 + this.labelHeight);
- }
- }
- }
- }
- };
- LNode.prototype.getInclusionTreeDepth = function() {
- if (this.inclusionTreeDepth == Integer.MAX_VALUE) {
- throw "assert failed";
- }
- return this.inclusionTreeDepth;
- };
- LNode.prototype.transform = function(trans) {
- var left3 = this.rect.x;
- if (left3 > LayoutConstants.WORLD_BOUNDARY) {
- left3 = LayoutConstants.WORLD_BOUNDARY;
- } else if (left3 < -LayoutConstants.WORLD_BOUNDARY) {
- left3 = -LayoutConstants.WORLD_BOUNDARY;
- }
- var top2 = this.rect.y;
- if (top2 > LayoutConstants.WORLD_BOUNDARY) {
- top2 = LayoutConstants.WORLD_BOUNDARY;
- } else if (top2 < -LayoutConstants.WORLD_BOUNDARY) {
- top2 = -LayoutConstants.WORLD_BOUNDARY;
- }
- var leftTop = new PointD(left3, top2);
- var vLeftTop = trans.inverseTransformPoint(leftTop);
- this.setLocation(vLeftTop.x, vLeftTop.y);
- };
- LNode.prototype.getLeft = function() {
- return this.rect.x;
- };
- LNode.prototype.getRight = function() {
- return this.rect.x + this.rect.width;
- };
- LNode.prototype.getTop = function() {
- return this.rect.y;
- };
- LNode.prototype.getBottom = function() {
- return this.rect.y + this.rect.height;
- };
- LNode.prototype.getParent = function() {
- if (this.owner == null) {
- return null;
- }
- return this.owner.getParent();
- };
- module3.exports = LNode;
- },
- /* 4 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var LayoutConstants = __webpack_require__(0);
- function FDLayoutConstants() {
- }
- __name(FDLayoutConstants, "FDLayoutConstants");
- for (var prop in LayoutConstants) {
- FDLayoutConstants[prop] = LayoutConstants[prop];
- }
- FDLayoutConstants.MAX_ITERATIONS = 2500;
- FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50;
- FDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45;
- FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500;
- FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4;
- FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1;
- FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8;
- FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5;
- FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true;
- FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true;
- FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3;
- FDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33;
- FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1e3;
- FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5e3;
- FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100;
- FDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3;
- FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10;
- FDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100;
- FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1;
- FDLayoutConstants.MIN_EDGE_LENGTH = 1;
- FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10;
- module3.exports = FDLayoutConstants;
- },
- /* 5 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- function PointD(x5, y5) {
- if (x5 == null && y5 == null) {
- this.x = 0;
- this.y = 0;
- } else {
- this.x = x5;
- this.y = y5;
- }
- }
- __name(PointD, "PointD");
- PointD.prototype.getX = function() {
- return this.x;
- };
- PointD.prototype.getY = function() {
- return this.y;
- };
- PointD.prototype.setX = function(x5) {
- this.x = x5;
- };
- PointD.prototype.setY = function(y5) {
- this.y = y5;
- };
- PointD.prototype.getDifference = function(pt) {
- return new DimensionD(this.x - pt.x, this.y - pt.y);
- };
- PointD.prototype.getCopy = function() {
- return new PointD(this.x, this.y);
- };
- PointD.prototype.translate = function(dim) {
- this.x += dim.width;
- this.y += dim.height;
- return this;
- };
- module3.exports = PointD;
- },
- /* 6 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var LGraphObject = __webpack_require__(2);
- var Integer = __webpack_require__(10);
- var LayoutConstants = __webpack_require__(0);
- var LGraphManager = __webpack_require__(7);
- var LNode = __webpack_require__(3);
- var LEdge = __webpack_require__(1);
- var RectangleD = __webpack_require__(13);
- var Point3 = __webpack_require__(12);
- var LinkedList = __webpack_require__(11);
- function LGraph(parent4, obj2, vGraph) {
- LGraphObject.call(this, vGraph);
- this.estimatedSize = Integer.MIN_VALUE;
- this.margin = LayoutConstants.DEFAULT_GRAPH_MARGIN;
- this.edges = [];
- this.nodes = [];
- this.isConnected = false;
- this.parent = parent4;
- if (obj2 != null && obj2 instanceof LGraphManager) {
- this.graphManager = obj2;
- } else if (obj2 != null && obj2 instanceof Layout) {
- this.graphManager = obj2.graphManager;
- }
- }
- __name(LGraph, "LGraph");
- LGraph.prototype = Object.create(LGraphObject.prototype);
- for (var prop in LGraphObject) {
- LGraph[prop] = LGraphObject[prop];
- }
- LGraph.prototype.getNodes = function() {
- return this.nodes;
- };
- LGraph.prototype.getEdges = function() {
- return this.edges;
- };
- LGraph.prototype.getGraphManager = function() {
- return this.graphManager;
- };
- LGraph.prototype.getParent = function() {
- return this.parent;
- };
- LGraph.prototype.getLeft = function() {
- return this.left;
- };
- LGraph.prototype.getRight = function() {
- return this.right;
- };
- LGraph.prototype.getTop = function() {
- return this.top;
- };
- LGraph.prototype.getBottom = function() {
- return this.bottom;
- };
- LGraph.prototype.isConnected = function() {
- return this.isConnected;
- };
- LGraph.prototype.add = function(obj1, sourceNode, targetNode) {
- if (sourceNode == null && targetNode == null) {
- var newNode = obj1;
- if (this.graphManager == null) {
- throw "Graph has no graph mgr!";
- }
- if (this.getNodes().indexOf(newNode) > -1) {
- throw "Node already in graph!";
- }
- newNode.owner = this;
- this.getNodes().push(newNode);
- return newNode;
- } else {
- var newEdge = obj1;
- if (!(this.getNodes().indexOf(sourceNode) > -1 && this.getNodes().indexOf(targetNode) > -1)) {
- throw "Source or target not in graph!";
- }
- if (!(sourceNode.owner == targetNode.owner && sourceNode.owner == this)) {
- throw "Both owners must be this graph!";
- }
- if (sourceNode.owner != targetNode.owner) {
- return null;
- }
- newEdge.source = sourceNode;
- newEdge.target = targetNode;
- newEdge.isInterGraph = false;
- this.getEdges().push(newEdge);
- sourceNode.edges.push(newEdge);
- if (targetNode != sourceNode) {
- targetNode.edges.push(newEdge);
- }
- return newEdge;
- }
- };
- LGraph.prototype.remove = function(obj) {
- var node2 = obj;
- if (obj instanceof LNode) {
- if (node2 == null) {
- throw "Node is null!";
- }
- if (!(node2.owner != null && node2.owner == this)) {
- throw "Owner graph is invalid!";
- }
- if (this.graphManager == null) {
- throw "Owner graph manager is invalid!";
- }
- var edgesToBeRemoved = node2.edges.slice();
- var edge;
- var s2 = edgesToBeRemoved.length;
- for (var i2 = 0; i2 < s2; i2++) {
- edge = edgesToBeRemoved[i2];
- if (edge.isInterGraph) {
- this.graphManager.remove(edge);
- } else {
- edge.source.owner.remove(edge);
- }
- }
- var index = this.nodes.indexOf(node2);
- if (index == -1) {
- throw "Node not in owner node list!";
- }
- this.nodes.splice(index, 1);
- } else if (obj instanceof LEdge) {
- var edge = obj;
- if (edge == null) {
- throw "Edge is null!";
- }
- if (!(edge.source != null && edge.target != null)) {
- throw "Source and/or target is null!";
- }
- if (!(edge.source.owner != null && edge.target.owner != null && edge.source.owner == this && edge.target.owner == this)) {
- throw "Source and/or target owner is invalid!";
- }
- var sourceIndex = edge.source.edges.indexOf(edge);
- var targetIndex = edge.target.edges.indexOf(edge);
- if (!(sourceIndex > -1 && targetIndex > -1)) {
- throw "Source and/or target doesn't know this edge!";
- }
- edge.source.edges.splice(sourceIndex, 1);
- if (edge.target != edge.source) {
- edge.target.edges.splice(targetIndex, 1);
- }
- var index = edge.source.owner.getEdges().indexOf(edge);
- if (index == -1) {
- throw "Not in owner's edge list!";
- }
- edge.source.owner.getEdges().splice(index, 1);
- }
- };
- LGraph.prototype.updateLeftTop = function() {
- var top2 = Integer.MAX_VALUE;
- var left3 = Integer.MAX_VALUE;
- var nodeTop;
- var nodeLeft;
- var margin;
- var nodes6 = this.getNodes();
- var s2 = nodes6.length;
- for (var i2 = 0; i2 < s2; i2++) {
- var lNode = nodes6[i2];
- nodeTop = lNode.getTop();
- nodeLeft = lNode.getLeft();
- if (top2 > nodeTop) {
- top2 = nodeTop;
- }
- if (left3 > nodeLeft) {
- left3 = nodeLeft;
- }
- }
- if (top2 == Integer.MAX_VALUE) {
- return null;
- }
- if (nodes6[0].getParent().paddingLeft != void 0) {
- margin = nodes6[0].getParent().paddingLeft;
- } else {
- margin = this.margin;
- }
- this.left = left3 - margin;
- this.top = top2 - margin;
- return new Point3(this.left, this.top);
- };
- LGraph.prototype.updateBounds = function(recursive) {
- var left3 = Integer.MAX_VALUE;
- var right3 = -Integer.MAX_VALUE;
- var top2 = Integer.MAX_VALUE;
- var bottom2 = -Integer.MAX_VALUE;
- var nodeLeft;
- var nodeRight;
- var nodeTop;
- var nodeBottom;
- var margin;
- var nodes6 = this.nodes;
- var s2 = nodes6.length;
- for (var i2 = 0; i2 < s2; i2++) {
- var lNode = nodes6[i2];
- if (recursive && lNode.child != null) {
- lNode.updateBounds();
- }
- nodeLeft = lNode.getLeft();
- nodeRight = lNode.getRight();
- nodeTop = lNode.getTop();
- nodeBottom = lNode.getBottom();
- if (left3 > nodeLeft) {
- left3 = nodeLeft;
- }
- if (right3 < nodeRight) {
- right3 = nodeRight;
- }
- if (top2 > nodeTop) {
- top2 = nodeTop;
- }
- if (bottom2 < nodeBottom) {
- bottom2 = nodeBottom;
- }
- }
- var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2);
- if (left3 == Integer.MAX_VALUE) {
- this.left = this.parent.getLeft();
- this.right = this.parent.getRight();
- this.top = this.parent.getTop();
- this.bottom = this.parent.getBottom();
- }
- if (nodes6[0].getParent().paddingLeft != void 0) {
- margin = nodes6[0].getParent().paddingLeft;
- } else {
- margin = this.margin;
- }
- this.left = boundingRect.x - margin;
- this.right = boundingRect.x + boundingRect.width + margin;
- this.top = boundingRect.y - margin;
- this.bottom = boundingRect.y + boundingRect.height + margin;
- };
- LGraph.calculateBounds = function(nodes6) {
- var left3 = Integer.MAX_VALUE;
- var right3 = -Integer.MAX_VALUE;
- var top2 = Integer.MAX_VALUE;
- var bottom2 = -Integer.MAX_VALUE;
- var nodeLeft;
- var nodeRight;
- var nodeTop;
- var nodeBottom;
- var s2 = nodes6.length;
- for (var i2 = 0; i2 < s2; i2++) {
- var lNode = nodes6[i2];
- nodeLeft = lNode.getLeft();
- nodeRight = lNode.getRight();
- nodeTop = lNode.getTop();
- nodeBottom = lNode.getBottom();
- if (left3 > nodeLeft) {
- left3 = nodeLeft;
- }
- if (right3 < nodeRight) {
- right3 = nodeRight;
- }
- if (top2 > nodeTop) {
- top2 = nodeTop;
- }
- if (bottom2 < nodeBottom) {
- bottom2 = nodeBottom;
- }
- }
- var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2);
- return boundingRect;
- };
- LGraph.prototype.getInclusionTreeDepth = function() {
- if (this == this.graphManager.getRoot()) {
- return 1;
- } else {
- return this.parent.getInclusionTreeDepth();
- }
- };
- LGraph.prototype.getEstimatedSize = function() {
- if (this.estimatedSize == Integer.MIN_VALUE) {
- throw "assert failed";
- }
- return this.estimatedSize;
- };
- LGraph.prototype.calcEstimatedSize = function() {
- var size5 = 0;
- var nodes6 = this.nodes;
- var s2 = nodes6.length;
- for (var i2 = 0; i2 < s2; i2++) {
- var lNode = nodes6[i2];
- size5 += lNode.calcEstimatedSize();
- }
- if (size5 == 0) {
- this.estimatedSize = LayoutConstants.EMPTY_COMPOUND_NODE_SIZE;
- } else {
- this.estimatedSize = size5 / Math.sqrt(this.nodes.length);
- }
- return this.estimatedSize;
- };
- LGraph.prototype.updateConnected = function() {
- var self2 = this;
- if (this.nodes.length == 0) {
- this.isConnected = true;
- return;
- }
- var queue = new LinkedList();
- var visited = /* @__PURE__ */ new Set();
- var currentNode = this.nodes[0];
- var neighborEdges;
- var currentNeighbor;
- var childrenOfNode = currentNode.withChildren();
- childrenOfNode.forEach(function(node2) {
- queue.push(node2);
- visited.add(node2);
- });
- while (queue.length !== 0) {
- currentNode = queue.shift();
- neighborEdges = currentNode.getEdges();
- var size5 = neighborEdges.length;
- for (var i2 = 0; i2 < size5; i2++) {
- var neighborEdge = neighborEdges[i2];
- currentNeighbor = neighborEdge.getOtherEndInGraph(currentNode, this);
- if (currentNeighbor != null && !visited.has(currentNeighbor)) {
- var childrenOfNeighbor = currentNeighbor.withChildren();
- childrenOfNeighbor.forEach(function(node2) {
- queue.push(node2);
- visited.add(node2);
- });
- }
- }
- }
- this.isConnected = false;
- if (visited.size >= this.nodes.length) {
- var noOfVisitedInThisGraph = 0;
- visited.forEach(function(visitedNode) {
- if (visitedNode.owner == self2) {
- noOfVisitedInThisGraph++;
+ __name(setupImage, "setupImage");
+ setTimeout(() => {
+ if (img.complete) {
+ setupImage();
}
});
- if (noOfVisitedInThisGraph == this.nodes.length) {
- this.isConnected = true;
- }
- }
- };
- module3.exports = LGraph;
- },
- /* 7 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var LGraph;
- var LEdge = __webpack_require__(1);
- function LGraphManager(layout6) {
- LGraph = __webpack_require__(6);
- this.layout = layout6;
- this.graphs = [];
- this.edges = [];
- }
- __name(LGraphManager, "LGraphManager");
- LGraphManager.prototype.addRoot = function() {
- var ngraph = this.layout.newGraph();
- var nnode = this.layout.newNode(null);
- var root4 = this.add(ngraph, nnode);
- this.setRootGraph(root4);
- return this.rootGraph;
- };
- LGraphManager.prototype.add = function(newGraph, parentNode, newEdge, sourceNode, targetNode) {
- if (newEdge == null && sourceNode == null && targetNode == null) {
- if (newGraph == null) {
- throw "Graph is null!";
- }
- if (parentNode == null) {
- throw "Parent node is null!";
- }
- if (this.graphs.indexOf(newGraph) > -1) {
- throw "Graph already in this graph mgr!";
- }
- this.graphs.push(newGraph);
- if (newGraph.parent != null) {
- throw "Already has a parent!";
- }
- if (parentNode.child != null) {
- throw "Already has a child!";
- }
- newGraph.parent = parentNode;
- parentNode.child = newGraph;
- return newGraph;
- } else {
- targetNode = newEdge;
- sourceNode = parentNode;
- newEdge = newGraph;
- var sourceGraph = sourceNode.getOwner();
- var targetGraph = targetNode.getOwner();
- if (!(sourceGraph != null && sourceGraph.getGraphManager() == this)) {
- throw "Source not in this graph mgr!";
- }
- if (!(targetGraph != null && targetGraph.getGraphManager() == this)) {
- throw "Target not in this graph mgr!";
- }
- if (sourceGraph == targetGraph) {
- newEdge.isInterGraph = false;
- return sourceGraph.add(newEdge, sourceNode, targetNode);
- } else {
- newEdge.isInterGraph = true;
- newEdge.source = sourceNode;
- newEdge.target = targetNode;
- if (this.edges.indexOf(newEdge) > -1) {
- throw "Edge already in inter-graph edge list!";
- }
- this.edges.push(newEdge);
- if (!(newEdge.source != null && newEdge.target != null)) {
- throw "Edge source and/or target is null!";
- }
- if (!(newEdge.source.edges.indexOf(newEdge) == -1 && newEdge.target.edges.indexOf(newEdge) == -1)) {
- throw "Edge already in source and/or target incidency list!";
- }
- newEdge.source.edges.push(newEdge);
- newEdge.target.edges.push(newEdge);
- return newEdge;
- }
- }
- };
- LGraphManager.prototype.remove = function(lObj) {
- if (lObj instanceof LGraph) {
- var graph = lObj;
- if (graph.getGraphManager() != this) {
- throw "Graph not in this graph mgr";
- }
- if (!(graph == this.rootGraph || graph.parent != null && graph.parent.graphManager == this)) {
- throw "Invalid parent node!";
- }
- var edgesToBeRemoved = [];
- edgesToBeRemoved = edgesToBeRemoved.concat(graph.getEdges());
- var edge;
- var s2 = edgesToBeRemoved.length;
- for (var i2 = 0; i2 < s2; i2++) {
- edge = edgesToBeRemoved[i2];
- graph.remove(edge);
- }
- var nodesToBeRemoved = [];
- nodesToBeRemoved = nodesToBeRemoved.concat(graph.getNodes());
- var node2;
- s2 = nodesToBeRemoved.length;
- for (var i2 = 0; i2 < s2; i2++) {
- node2 = nodesToBeRemoved[i2];
- graph.remove(node2);
- }
- if (graph == this.rootGraph) {
- this.setRootGraph(null);
- }
- var index = this.graphs.indexOf(graph);
- this.graphs.splice(index, 1);
- graph.parent = null;
- } else if (lObj instanceof LEdge) {
- edge = lObj;
- if (edge == null) {
- throw "Edge is null!";
- }
- if (!edge.isInterGraph) {
- throw "Not an inter-graph edge!";
- }
- if (!(edge.source != null && edge.target != null)) {
- throw "Source and/or target is null!";
- }
- if (!(edge.source.edges.indexOf(edge) != -1 && edge.target.edges.indexOf(edge) != -1)) {
- throw "Source and/or target doesn't know this edge!";
- }
- var index = edge.source.edges.indexOf(edge);
- edge.source.edges.splice(index, 1);
- index = edge.target.edges.indexOf(edge);
- edge.target.edges.splice(index, 1);
- if (!(edge.source.owner != null && edge.source.owner.getGraphManager() != null)) {
- throw "Edge owner graph or owner graph manager is null!";
- }
- if (edge.source.owner.getGraphManager().edges.indexOf(edge) == -1) {
- throw "Not in owner graph manager's edge list!";
- }
- var index = edge.source.owner.getGraphManager().edges.indexOf(edge);
- edge.source.owner.getGraphManager().edges.splice(index, 1);
- }
- };
- LGraphManager.prototype.updateBounds = function() {
- this.rootGraph.updateBounds(true);
- };
- LGraphManager.prototype.getGraphs = function() {
- return this.graphs;
- };
- LGraphManager.prototype.getAllNodes = function() {
- if (this.allNodes == null) {
- var nodeList = [];
- var graphs = this.getGraphs();
- var s2 = graphs.length;
- for (var i2 = 0; i2 < s2; i2++) {
- nodeList = nodeList.concat(graphs[i2].getNodes());
- }
- this.allNodes = nodeList;
- }
- return this.allNodes;
- };
- LGraphManager.prototype.resetAllNodes = function() {
- this.allNodes = null;
- };
- LGraphManager.prototype.resetAllEdges = function() {
- this.allEdges = null;
- };
- LGraphManager.prototype.resetAllNodesToApplyGravitation = function() {
- this.allNodesToApplyGravitation = null;
- };
- LGraphManager.prototype.getAllEdges = function() {
- if (this.allEdges == null) {
- var edgeList2 = [];
- var graphs = this.getGraphs();
- var s2 = graphs.length;
- for (var i2 = 0; i2 < graphs.length; i2++) {
- edgeList2 = edgeList2.concat(graphs[i2].getEdges());
- }
- edgeList2 = edgeList2.concat(this.edges);
- this.allEdges = edgeList2;
- }
- return this.allEdges;
- };
- LGraphManager.prototype.getAllNodesToApplyGravitation = function() {
- return this.allNodesToApplyGravitation;
- };
- LGraphManager.prototype.setAllNodesToApplyGravitation = function(nodeList) {
- if (this.allNodesToApplyGravitation != null) {
- throw "assert failed";
- }
- this.allNodesToApplyGravitation = nodeList;
- };
- LGraphManager.prototype.getRoot = function() {
- return this.rootGraph;
- };
- LGraphManager.prototype.setRootGraph = function(graph) {
- if (graph.getGraphManager() != this) {
- throw "Root not in this graph mgr!";
- }
- this.rootGraph = graph;
- if (graph.parent == null) {
- graph.parent = this.layout.newNode("Root node");
- }
- };
- LGraphManager.prototype.getLayout = function() {
- return this.layout;
- };
- LGraphManager.prototype.isOneAncestorOfOther = function(firstNode, secondNode) {
- if (!(firstNode != null && secondNode != null)) {
- throw "assert failed";
- }
- if (firstNode == secondNode) {
- return true;
- }
- var ownerGraph = firstNode.getOwner();
- var parentNode;
- do {
- parentNode = ownerGraph.getParent();
- if (parentNode == null) {
- break;
- }
- if (parentNode == secondNode) {
- return true;
- }
- ownerGraph = parentNode.getOwner();
- if (ownerGraph == null) {
- break;
- }
- } while (true);
- ownerGraph = secondNode.getOwner();
- do {
- parentNode = ownerGraph.getParent();
- if (parentNode == null) {
- break;
- }
- if (parentNode == firstNode) {
- return true;
- }
- ownerGraph = parentNode.getOwner();
- if (ownerGraph == null) {
- break;
- }
- } while (true);
- return false;
- };
- LGraphManager.prototype.calcLowestCommonAncestors = function() {
- var edge;
- var sourceNode;
- var targetNode;
- var sourceAncestorGraph;
- var targetAncestorGraph;
- var edges5 = this.getAllEdges();
- var s2 = edges5.length;
- for (var i2 = 0; i2 < s2; i2++) {
- edge = edges5[i2];
- sourceNode = edge.source;
- targetNode = edge.target;
- edge.lca = null;
- edge.sourceInLca = sourceNode;
- edge.targetInLca = targetNode;
- if (sourceNode == targetNode) {
- edge.lca = sourceNode.getOwner();
- continue;
- }
- sourceAncestorGraph = sourceNode.getOwner();
- while (edge.lca == null) {
- edge.targetInLca = targetNode;
- targetAncestorGraph = targetNode.getOwner();
- while (edge.lca == null) {
- if (targetAncestorGraph == sourceAncestorGraph) {
- edge.lca = targetAncestorGraph;
- break;
- }
- if (targetAncestorGraph == this.rootGraph) {
- break;
- }
- if (edge.lca != null) {
- throw "assert failed";
- }
- edge.targetInLca = targetAncestorGraph.getParent();
- targetAncestorGraph = edge.targetInLca.getOwner();
- }
- if (sourceAncestorGraph == this.rootGraph) {
- break;
- }
- if (edge.lca == null) {
- edge.sourceInLca = sourceAncestorGraph.getParent();
- sourceAncestorGraph = edge.sourceInLca.getOwner();
- }
- }
- if (edge.lca == null) {
- throw "assert failed";
- }
- }
- };
- LGraphManager.prototype.calcLowestCommonAncestor = function(firstNode, secondNode) {
- if (firstNode == secondNode) {
- return firstNode.getOwner();
- }
- var firstOwnerGraph = firstNode.getOwner();
- do {
- if (firstOwnerGraph == null) {
- break;
- }
- var secondOwnerGraph = secondNode.getOwner();
- do {
- if (secondOwnerGraph == null) {
- break;
- }
- if (secondOwnerGraph == firstOwnerGraph) {
- return secondOwnerGraph;
- }
- secondOwnerGraph = secondOwnerGraph.getParent().getOwner();
- } while (true);
- firstOwnerGraph = firstOwnerGraph.getParent().getOwner();
- } while (true);
- return firstOwnerGraph;
- };
- LGraphManager.prototype.calcInclusionTreeDepths = function(graph, depth) {
- if (graph == null && depth == null) {
- graph = this.rootGraph;
- depth = 1;
- }
- var node2;
- var nodes6 = graph.getNodes();
- var s2 = nodes6.length;
- for (var i2 = 0; i2 < s2; i2++) {
- node2 = nodes6[i2];
- node2.inclusionTreeDepth = depth;
- if (node2.child != null) {
- this.calcInclusionTreeDepths(node2.child, depth + 1);
- }
- }
- };
- LGraphManager.prototype.includesInvalidEdge = function() {
- var edge;
- var edgesToRemove = [];
- var s2 = this.edges.length;
- for (var i2 = 0; i2 < s2; i2++) {
- edge = this.edges[i2];
- if (this.isOneAncestorOfOther(edge.source, edge.target)) {
- edgesToRemove.push(edge);
- }
- }
- for (var i2 = 0; i2 < edgesToRemove.length; i2++) {
- this.remove(edgesToRemove[i2]);
- }
- return false;
- };
- module3.exports = LGraphManager;
- },
- /* 8 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var Point3 = __webpack_require__(12);
- function IGeometry() {
- }
- __name(IGeometry, "IGeometry");
- IGeometry.calcSeparationAmount = function(rectA, rectB, overlapAmount, separationBuffer) {
- if (!rectA.intersects(rectB)) {
- throw "assert failed";
- }
- var directions = new Array(2);
- this.decideDirectionsForOverlappingNodes(rectA, rectB, directions);
- overlapAmount[0] = Math.min(rectA.getRight(), rectB.getRight()) - Math.max(rectA.x, rectB.x);
- overlapAmount[1] = Math.min(rectA.getBottom(), rectB.getBottom()) - Math.max(rectA.y, rectB.y);
- if (rectA.getX() <= rectB.getX() && rectA.getRight() >= rectB.getRight()) {
- overlapAmount[0] += Math.min(rectB.getX() - rectA.getX(), rectA.getRight() - rectB.getRight());
- } else if (rectB.getX() <= rectA.getX() && rectB.getRight() >= rectA.getRight()) {
- overlapAmount[0] += Math.min(rectA.getX() - rectB.getX(), rectB.getRight() - rectA.getRight());
- }
- if (rectA.getY() <= rectB.getY() && rectA.getBottom() >= rectB.getBottom()) {
- overlapAmount[1] += Math.min(rectB.getY() - rectA.getY(), rectA.getBottom() - rectB.getBottom());
- } else if (rectB.getY() <= rectA.getY() && rectB.getBottom() >= rectA.getBottom()) {
- overlapAmount[1] += Math.min(rectA.getY() - rectB.getY(), rectB.getBottom() - rectA.getBottom());
- }
- var slope = Math.abs((rectB.getCenterY() - rectA.getCenterY()) / (rectB.getCenterX() - rectA.getCenterX()));
- if (rectB.getCenterY() === rectA.getCenterY() && rectB.getCenterX() === rectA.getCenterX()) {
- slope = 1;
- }
- var moveByY = slope * overlapAmount[0];
- var moveByX = overlapAmount[1] / slope;
- if (overlapAmount[0] < moveByX) {
- moveByX = overlapAmount[0];
- } else {
- moveByY = overlapAmount[1];
- }
- overlapAmount[0] = -1 * directions[0] * (moveByX / 2 + separationBuffer);
- overlapAmount[1] = -1 * directions[1] * (moveByY / 2 + separationBuffer);
- };
- IGeometry.decideDirectionsForOverlappingNodes = function(rectA, rectB, directions) {
- if (rectA.getCenterX() < rectB.getCenterX()) {
- directions[0] = -1;
- } else {
- directions[0] = 1;
- }
- if (rectA.getCenterY() < rectB.getCenterY()) {
- directions[1] = -1;
- } else {
- directions[1] = 1;
- }
- };
- IGeometry.getIntersection2 = function(rectA, rectB, result) {
- var p1x = rectA.getCenterX();
- var p1y = rectA.getCenterY();
- var p2x = rectB.getCenterX();
- var p2y = rectB.getCenterY();
- if (rectA.intersects(rectB)) {
- result[0] = p1x;
- result[1] = p1y;
- result[2] = p2x;
- result[3] = p2y;
- return true;
- }
- var topLeftAx = rectA.getX();
- var topLeftAy = rectA.getY();
- var topRightAx = rectA.getRight();
- var bottomLeftAx = rectA.getX();
- var bottomLeftAy = rectA.getBottom();
- var bottomRightAx = rectA.getRight();
- var halfWidthA = rectA.getWidthHalf();
- var halfHeightA = rectA.getHeightHalf();
- var topLeftBx = rectB.getX();
- var topLeftBy = rectB.getY();
- var topRightBx = rectB.getRight();
- var bottomLeftBx = rectB.getX();
- var bottomLeftBy = rectB.getBottom();
- var bottomRightBx = rectB.getRight();
- var halfWidthB = rectB.getWidthHalf();
- var halfHeightB = rectB.getHeightHalf();
- var clipPointAFound = false;
- var clipPointBFound = false;
- if (p1x === p2x) {
- if (p1y > p2y) {
- result[0] = p1x;
- result[1] = topLeftAy;
- result[2] = p2x;
- result[3] = bottomLeftBy;
- return false;
- } else if (p1y < p2y) {
- result[0] = p1x;
- result[1] = bottomLeftAy;
- result[2] = p2x;
- result[3] = topLeftBy;
- return false;
- } else {
- }
- } else if (p1y === p2y) {
- if (p1x > p2x) {
- result[0] = topLeftAx;
- result[1] = p1y;
- result[2] = topRightBx;
- result[3] = p2y;
- return false;
- } else if (p1x < p2x) {
- result[0] = topRightAx;
- result[1] = p1y;
- result[2] = topLeftBx;
- result[3] = p2y;
- return false;
- } else {
- }
- } else {
- var slopeA = rectA.height / rectA.width;
- var slopeB = rectB.height / rectB.width;
- var slopePrime = (p2y - p1y) / (p2x - p1x);
- var cardinalDirectionA = void 0;
- var cardinalDirectionB = void 0;
- var tempPointAx = void 0;
- var tempPointAy = void 0;
- var tempPointBx = void 0;
- var tempPointBy = void 0;
- if (-slopeA === slopePrime) {
- if (p1x > p2x) {
- result[0] = bottomLeftAx;
- result[1] = bottomLeftAy;
- clipPointAFound = true;
- } else {
- result[0] = topRightAx;
- result[1] = topLeftAy;
- clipPointAFound = true;
- }
- } else if (slopeA === slopePrime) {
- if (p1x > p2x) {
- result[0] = topLeftAx;
- result[1] = topLeftAy;
- clipPointAFound = true;
- } else {
- result[0] = bottomRightAx;
- result[1] = bottomLeftAy;
- clipPointAFound = true;
- }
- }
- if (-slopeB === slopePrime) {
- if (p2x > p1x) {
- result[2] = bottomLeftBx;
- result[3] = bottomLeftBy;
- clipPointBFound = true;
- } else {
- result[2] = topRightBx;
- result[3] = topLeftBy;
- clipPointBFound = true;
- }
- } else if (slopeB === slopePrime) {
- if (p2x > p1x) {
- result[2] = topLeftBx;
- result[3] = topLeftBy;
- clipPointBFound = true;
- } else {
- result[2] = bottomRightBx;
- result[3] = bottomLeftBy;
- clipPointBFound = true;
- }
- }
- if (clipPointAFound && clipPointBFound) {
- return false;
- }
- if (p1x > p2x) {
- if (p1y > p2y) {
- cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 4);
- cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 2);
- } else {
- cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 3);
- cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 1);
- }
- } else {
- if (p1y > p2y) {
- cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 1);
- cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 3);
- } else {
- cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 2);
- cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 4);
- }
- }
- if (!clipPointAFound) {
- switch (cardinalDirectionA) {
- case 1:
- tempPointAy = topLeftAy;
- tempPointAx = p1x + -halfHeightA / slopePrime;
- result[0] = tempPointAx;
- result[1] = tempPointAy;
- break;
- case 2:
- tempPointAx = bottomRightAx;
- tempPointAy = p1y + halfWidthA * slopePrime;
- result[0] = tempPointAx;
- result[1] = tempPointAy;
- break;
- case 3:
- tempPointAy = bottomLeftAy;
- tempPointAx = p1x + halfHeightA / slopePrime;
- result[0] = tempPointAx;
- result[1] = tempPointAy;
- break;
- case 4:
- tempPointAx = bottomLeftAx;
- tempPointAy = p1y + -halfWidthA * slopePrime;
- result[0] = tempPointAx;
- result[1] = tempPointAy;
- break;
- }
- }
- if (!clipPointBFound) {
- switch (cardinalDirectionB) {
- case 1:
- tempPointBy = topLeftBy;
- tempPointBx = p2x + -halfHeightB / slopePrime;
- result[2] = tempPointBx;
- result[3] = tempPointBy;
- break;
- case 2:
- tempPointBx = bottomRightBx;
- tempPointBy = p2y + halfWidthB * slopePrime;
- result[2] = tempPointBx;
- result[3] = tempPointBy;
- break;
- case 3:
- tempPointBy = bottomLeftBy;
- tempPointBx = p2x + halfHeightB / slopePrime;
- result[2] = tempPointBx;
- result[3] = tempPointBy;
- break;
- case 4:
- tempPointBx = bottomLeftBx;
- tempPointBy = p2y + -halfWidthB * slopePrime;
- result[2] = tempPointBx;
- result[3] = tempPointBy;
- break;
- }
- }
- }
- return false;
- };
- IGeometry.getCardinalDirection = function(slope, slopePrime, line2) {
- if (slope > slopePrime) {
- return line2;
- } else {
- return 1 + line2 % 4;
- }
- };
- IGeometry.getIntersection = function(s1, s2, f1, f22) {
- if (f22 == null) {
- return this.getIntersection2(s1, s2, f1);
- }
- var x1 = s1.x;
- var y1 = s1.y;
- var x22 = s2.x;
- var y22 = s2.y;
- var x32 = f1.x;
- var y32 = f1.y;
- var x42 = f22.x;
- var y42 = f22.y;
- var x5 = void 0, y5 = void 0;
- var a1 = void 0, a2 = void 0, b1 = void 0, b2 = void 0, c1 = void 0, c22 = void 0;
- var denom = void 0;
- a1 = y22 - y1;
- b1 = x1 - x22;
- c1 = x22 * y1 - x1 * y22;
- a2 = y42 - y32;
- b2 = x32 - x42;
- c22 = x42 * y32 - x32 * y42;
- denom = a1 * b2 - a2 * b1;
- if (denom === 0) {
- return null;
- }
- x5 = (b1 * c22 - b2 * c1) / denom;
- y5 = (a2 * c1 - a1 * c22) / denom;
- return new Point3(x5, y5);
- };
- IGeometry.angleOfVector = function(Cx, Cy, Nx, Ny) {
- var C_angle = void 0;
- if (Cx !== Nx) {
- C_angle = Math.atan((Ny - Cy) / (Nx - Cx));
- if (Nx < Cx) {
- C_angle += Math.PI;
- } else if (Ny < Cy) {
- C_angle += this.TWO_PI;
- }
- } else if (Ny < Cy) {
- C_angle = this.ONE_AND_HALF_PI;
- } else {
- C_angle = this.HALF_PI;
- }
- return C_angle;
- };
- IGeometry.doIntersect = function(p1, p22, p3, p4) {
- var a2 = p1.x;
- var b2 = p1.y;
- var c3 = p22.x;
- var d2 = p22.y;
- var p5 = p3.x;
- var q2 = p3.y;
- var r2 = p4.x;
- var s2 = p4.y;
- var det = (c3 - a2) * (s2 - q2) - (r2 - p5) * (d2 - b2);
- if (det === 0) {
- return false;
- } else {
- var lambda = ((s2 - q2) * (r2 - a2) + (p5 - r2) * (s2 - b2)) / det;
- var gamma2 = ((b2 - d2) * (r2 - a2) + (c3 - a2) * (s2 - b2)) / det;
- return 0 < lambda && lambda < 1 && 0 < gamma2 && gamma2 < 1;
- }
- };
- IGeometry.findCircleLineIntersections = function(Ex, Ey, Lx, Ly, Cx, Cy, r2) {
- var a2 = (Lx - Ex) * (Lx - Ex) + (Ly - Ey) * (Ly - Ey);
- var b2 = 2 * ((Ex - Cx) * (Lx - Ex) + (Ey - Cy) * (Ly - Ey));
- var c3 = (Ex - Cx) * (Ex - Cx) + (Ey - Cy) * (Ey - Cy) - r2 * r2;
- var disc = b2 * b2 - 4 * a2 * c3;
- if (disc >= 0) {
- var t13 = (-b2 + Math.sqrt(b2 * b2 - 4 * a2 * c3)) / (2 * a2);
- var t22 = (-b2 - Math.sqrt(b2 * b2 - 4 * a2 * c3)) / (2 * a2);
- var intersections = null;
- if (t13 >= 0 && t13 <= 1) {
- return [t13];
- }
- if (t22 >= 0 && t22 <= 1) {
- return [t22];
- }
- return intersections;
- } else return null;
- };
- IGeometry.HALF_PI = 0.5 * Math.PI;
- IGeometry.ONE_AND_HALF_PI = 1.5 * Math.PI;
- IGeometry.TWO_PI = 2 * Math.PI;
- IGeometry.THREE_PI = 3 * Math.PI;
- module3.exports = IGeometry;
- },
- /* 9 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- function IMath() {
- }
- __name(IMath, "IMath");
- IMath.sign = function(value2) {
- if (value2 > 0) {
- return 1;
- } else if (value2 < 0) {
- return -1;
- } else {
- return 0;
- }
- };
- IMath.floor = function(value2) {
- return value2 < 0 ? Math.ceil(value2) : Math.floor(value2);
- };
- IMath.ceil = function(value2) {
- return value2 < 0 ? Math.floor(value2) : Math.ceil(value2);
- };
- module3.exports = IMath;
- },
- /* 10 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- function Integer() {
- }
- __name(Integer, "Integer");
- Integer.MAX_VALUE = 2147483647;
- Integer.MIN_VALUE = -2147483648;
- module3.exports = Integer;
+ img.addEventListener("error", setupImage);
+ img.addEventListener("load", setupImage);
+ })
+ )
+ );
+ }
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ if (useHtmlLabels) {
+ label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
+ } else {
+ label.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
+ }
+ if (node2.centerLabel) {
+ label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
+ }
+ label.insert("rect", ":first-child");
+ return { shapeSvg, bbox, halfPadding, label };
+ }, "labelHelper");
+ updateNodeBounds2 = /* @__PURE__ */ __name((node2, element3) => {
+ const bbox = element3.node().getBBox();
+ node2.width = bbox.width;
+ node2.height = bbox.height;
+ }, "updateNodeBounds");
+ __name(insertPolygonShape3, "insertPolygonShape");
+ }
+ });
+
+ // src/dagre-wrapper/shapes/note.js
+ var note2, note_default;
+ var init_note2 = __esm({
+ "src/dagre-wrapper/shapes/note.js"() {
+ "use strict";
+ init_util4();
+ init_logger();
+ init_diagramAPI();
+ init_intersect2();
+ note2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const useHtmlLabels = node2.useHtmlLabels || getConfig2().flowchart.htmlLabels;
+ if (!useHtmlLabels) {
+ node2.centerLabel = true;
+ }
+ const { shapeSvg, bbox, halfPadding } = await labelHelper2(
+ parent4,
+ node2,
+ "node " + node2.classes,
+ true
+ );
+ log.info("Classes = ", node2.classes);
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ rect3.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding);
+ updateNodeBounds2(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default2.rect(node2, point8);
+ };
+ return shapeSvg;
+ }, "note");
+ note_default = note2;
+ }
+ });
+
+ // src/dagre-wrapper/nodes.js
+ function applyNodePropertyBorders(rect3, borders, totalWidth, totalHeight) {
+ const strokeDashArray = [];
+ const addBorder = /* @__PURE__ */ __name((length2) => {
+ strokeDashArray.push(length2, 0);
+ }, "addBorder");
+ const skipBorder = /* @__PURE__ */ __name((length2) => {
+ strokeDashArray.push(0, length2);
+ }, "skipBorder");
+ if (borders.includes("t")) {
+ log.debug("add top border");
+ addBorder(totalWidth);
+ } else {
+ skipBorder(totalWidth);
+ }
+ if (borders.includes("r")) {
+ log.debug("add right border");
+ addBorder(totalHeight);
+ } else {
+ skipBorder(totalHeight);
+ }
+ if (borders.includes("b")) {
+ log.debug("add bottom border");
+ addBorder(totalWidth);
+ } else {
+ skipBorder(totalWidth);
+ }
+ if (borders.includes("l")) {
+ log.debug("add left border");
+ addBorder(totalHeight);
+ } else {
+ skipBorder(totalHeight);
+ }
+ rect3.attr("stroke-dasharray", strokeDashArray.join(" "));
+ }
+ var formatClass, getClassesFromNode, question2, choice2, hexagon2, block_arrow, rect_left_inv_arrow2, lean_right2, lean_left2, trapezoid2, inv_trapezoid2, rect_right_inv_arrow, cylinder2, rect2, composite, labelRect2, rectWithTitle2, stadium2, circle5, doublecircle2, subroutine2, start2, forkJoin2, end, class_box, shapes3, nodeElems2, insertNode2, positionNode3;
+ var init_nodes3 = __esm({
+ "src/dagre-wrapper/nodes.js"() {
+ "use strict";
+ init_src32();
+ init_diagramAPI();
+ init_common();
+ init_logger();
+ init_blockArrowHelper();
+ init_createLabel2();
+ init_intersect2();
+ init_note2();
+ init_util4();
+ formatClass = /* @__PURE__ */ __name((str2) => {
+ if (str2) {
+ return " " + str2;
+ }
+ return "";
+ }, "formatClass");
+ getClassesFromNode = /* @__PURE__ */ __name((node2, otherClasses) => {
+ return `${otherClasses ? otherClasses : "node default"}${formatClass(node2.classes)} ${formatClass(
+ node2.class
+ )}`;
+ }, "getClassesFromNode");
+ question2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const s2 = w3 + h2;
+ const points = [
+ { x: s2 / 2, y: 0 },
+ { x: s2, y: -s2 / 2 },
+ { x: s2 / 2, y: -s2 },
+ { x: 0, y: -s2 / 2 }
+ ];
+ log.info("Question main (Circle)");
+ const questionElem = insertPolygonShape3(shapeSvg, s2, s2, points);
+ questionElem.attr("style", node2.style);
+ updateNodeBounds2(node2, questionElem);
+ node2.intersect = function(point8) {
+ log.warn("Intersect called");
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "question");
+ choice2 = /* @__PURE__ */ __name((parent4, node2) => {
+ const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
+ const s2 = 28;
+ const points = [
+ { x: 0, y: s2 / 2 },
+ { x: s2 / 2, y: 0 },
+ { x: 0, y: -s2 / 2 },
+ { x: -s2 / 2, y: 0 }
+ ];
+ const choice3 = shapeSvg.insert("polygon", ":first-child").attr(
+ "points",
+ points.map(function(d2) {
+ return d2.x + "," + d2.y;
+ }).join(" ")
+ );
+ choice3.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28);
+ node2.width = 28;
+ node2.height = 28;
+ node2.intersect = function(point8) {
+ return intersect_default2.circle(node2, 14, point8);
+ };
+ return shapeSvg;
+ }, "choice");
+ hexagon2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const f2 = 4;
+ const h2 = bbox.height + node2.padding;
+ const m2 = h2 / f2;
+ const w3 = bbox.width + 2 * m2 + node2.padding;
+ const points = [
+ { x: m2, y: 0 },
+ { x: w3 - m2, y: 0 },
+ { x: w3, y: -h2 / 2 },
+ { x: w3 - m2, y: -h2 },
+ { x: m2, y: -h2 },
+ { x: 0, y: -h2 / 2 }
+ ];
+ const hex2 = insertPolygonShape3(shapeSvg, w3, h2, points);
+ hex2.attr("style", node2.style);
+ updateNodeBounds2(node2, hex2);
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "hexagon");
+ block_arrow = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(parent4, node2, void 0, true);
+ const f2 = 2;
+ const h2 = bbox.height + 2 * node2.padding;
+ const m2 = h2 / f2;
+ const w3 = bbox.width + 2 * m2 + node2.padding;
+ const points = getArrowPoints(node2.directions, bbox, node2);
+ const blockArrow = insertPolygonShape3(shapeSvg, w3, h2, points);
+ blockArrow.attr("style", node2.style);
+ updateNodeBounds2(node2, blockArrow);
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "block_arrow");
+ rect_left_inv_arrow2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const points = [
+ { x: -h2 / 2, y: 0 },
+ { x: w3, y: 0 },
+ { x: w3, y: -h2 },
+ { x: -h2 / 2, y: -h2 },
+ { x: 0, y: -h2 / 2 }
+ ];
+ const el = insertPolygonShape3(shapeSvg, w3, h2, points);
+ el.attr("style", node2.style);
+ node2.width = w3 + h2;
+ node2.height = h2;
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "rect_left_inv_arrow");
+ lean_right2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getClassesFromNode(node2), true);
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const points = [
+ { x: -2 * h2 / 6, y: 0 },
+ { x: w3 - h2 / 6, y: 0 },
+ { x: w3 + 2 * h2 / 6, y: -h2 },
+ { x: h2 / 6, y: -h2 }
+ ];
+ const el = insertPolygonShape3(shapeSvg, w3, h2, points);
+ el.attr("style", node2.style);
+ updateNodeBounds2(node2, el);
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "lean_right");
+ lean_left2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const points = [
+ { x: 2 * h2 / 6, y: 0 },
+ { x: w3 + h2 / 6, y: 0 },
+ { x: w3 - 2 * h2 / 6, y: -h2 },
+ { x: -h2 / 6, y: -h2 }
+ ];
+ const el = insertPolygonShape3(shapeSvg, w3, h2, points);
+ el.attr("style", node2.style);
+ updateNodeBounds2(node2, el);
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "lean_left");
+ trapezoid2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const points = [
+ { x: -2 * h2 / 6, y: 0 },
+ { x: w3 + 2 * h2 / 6, y: 0 },
+ { x: w3 - h2 / 6, y: -h2 },
+ { x: h2 / 6, y: -h2 }
+ ];
+ const el = insertPolygonShape3(shapeSvg, w3, h2, points);
+ el.attr("style", node2.style);
+ updateNodeBounds2(node2, el);
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "trapezoid");
+ inv_trapezoid2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const points = [
+ { x: h2 / 6, y: 0 },
+ { x: w3 - h2 / 6, y: 0 },
+ { x: w3 + 2 * h2 / 6, y: -h2 },
+ { x: -2 * h2 / 6, y: -h2 }
+ ];
+ const el = insertPolygonShape3(shapeSvg, w3, h2, points);
+ el.attr("style", node2.style);
+ updateNodeBounds2(node2, el);
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "inv_trapezoid");
+ rect_right_inv_arrow = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const points = [
+ { x: 0, y: 0 },
+ { x: w3 + h2 / 2, y: 0 },
+ { x: w3, y: -h2 / 2 },
+ { x: w3 + h2 / 2, y: -h2 },
+ { x: 0, y: -h2 }
+ ];
+ const el = insertPolygonShape3(shapeSvg, w3, h2, points);
+ el.attr("style", node2.style);
+ updateNodeBounds2(node2, el);
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "rect_right_inv_arrow");
+ cylinder2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const w3 = bbox.width + node2.padding;
+ const rx = w3 / 2;
+ const ry = rx / (2.5 + w3 / 50);
+ const h2 = bbox.height + ry + node2.padding;
+ const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w3 + " 0 a " + rx + "," + ry + " 0,0,0 " + -w3 + " 0 l 0," + h2 + " a " + rx + "," + ry + " 0,0,0 " + w3 + " 0 l 0," + -h2;
+ const el = shapeSvg.attr("label-offset-y", ry).insert("path", ":first-child").attr("style", node2.style).attr("d", shape).attr("transform", "translate(" + -w3 / 2 + "," + -(h2 / 2 + ry) + ")");
+ updateNodeBounds2(node2, el);
+ node2.intersect = function(point8) {
+ const pos = intersect_default2.rect(node2, point8);
+ const x5 = pos.x - node2.x;
+ if (rx != 0 && (Math.abs(x5) < node2.width / 2 || Math.abs(x5) == node2.width / 2 && Math.abs(pos.y - node2.y) > node2.height / 2 - ry)) {
+ let y5 = ry * ry * (1 - x5 * x5 / (rx * rx));
+ if (y5 != 0) {
+ y5 = Math.sqrt(y5);
+ }
+ y5 = ry - y5;
+ if (point8.y - node2.y > 0) {
+ y5 = -y5;
+ }
+ pos.y += y5;
+ }
+ return pos;
+ };
+ return shapeSvg;
+ }, "cylinder");
+ rect2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox, halfPadding } = await labelHelper2(
+ parent4,
+ node2,
+ "node " + node2.classes + " " + node2.class,
+ true
+ );
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ const totalWidth = node2.positioned ? node2.width : bbox.width + node2.padding;
+ const totalHeight = node2.positioned ? node2.height : bbox.height + node2.padding;
+ const x5 = node2.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
+ const y5 = node2.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
+ rect3.attr("class", "basic label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
+ if (node2.props) {
+ const propKeys = new Set(Object.keys(node2.props));
+ if (node2.props.borders) {
+ applyNodePropertyBorders(rect3, node2.props.borders, totalWidth, totalHeight);
+ propKeys.delete("borders");
+ }
+ propKeys.forEach((propKey) => {
+ log.warn(`Unknown node property ${propKey}`);
+ });
+ }
+ updateNodeBounds2(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default2.rect(node2, point8);
+ };
+ return shapeSvg;
+ }, "rect");
+ composite = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox, halfPadding } = await labelHelper2(
+ parent4,
+ node2,
+ "node " + node2.classes,
+ true
+ );
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ const totalWidth = node2.positioned ? node2.width : bbox.width + node2.padding;
+ const totalHeight = node2.positioned ? node2.height : bbox.height + node2.padding;
+ const x5 = node2.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
+ const y5 = node2.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
+ rect3.attr("class", "basic cluster composite label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight);
+ if (node2.props) {
+ const propKeys = new Set(Object.keys(node2.props));
+ if (node2.props.borders) {
+ applyNodePropertyBorders(rect3, node2.props.borders, totalWidth, totalHeight);
+ propKeys.delete("borders");
+ }
+ propKeys.forEach((propKey) => {
+ log.warn(`Unknown node property ${propKey}`);
+ });
+ }
+ updateNodeBounds2(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default2.rect(node2, point8);
+ };
+ return shapeSvg;
+ }, "composite");
+ labelRect2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg } = await labelHelper2(parent4, node2, "label", true);
+ log.trace("Classes = ", node2.class);
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ const totalWidth = 0;
+ const totalHeight = 0;
+ rect3.attr("width", totalWidth).attr("height", totalHeight);
+ shapeSvg.attr("class", "label edgeLabel");
+ if (node2.props) {
+ const propKeys = new Set(Object.keys(node2.props));
+ if (node2.props.borders) {
+ applyNodePropertyBorders(rect3, node2.props.borders, totalWidth, totalHeight);
+ propKeys.delete("borders");
+ }
+ propKeys.forEach((propKey) => {
+ log.warn(`Unknown node property ${propKey}`);
+ });
+ }
+ updateNodeBounds2(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default2.rect(node2, point8);
+ };
+ return shapeSvg;
+ }, "labelRect");
+ __name(applyNodePropertyBorders, "applyNodePropertyBorders");
+ rectWithTitle2 = /* @__PURE__ */ __name((parent4, node2) => {
+ let classes3;
+ if (!node2.classes) {
+ classes3 = "node default";
+ } else {
+ classes3 = "node " + node2.classes;
+ }
+ const shapeSvg = parent4.insert("g").attr("class", classes3).attr("id", node2.domId || node2.id);
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ const innerLine = shapeSvg.insert("line");
+ const label = shapeSvg.insert("g").attr("class", "label");
+ const text22 = node2.labelText.flat ? node2.labelText.flat() : node2.labelText;
+ let title2 = "";
+ if (typeof text22 === "object") {
+ title2 = text22[0];
+ } else {
+ title2 = text22;
+ }
+ log.info("Label text abc79", title2, text22, typeof text22 === "object");
+ const text4 = label.node().appendChild(createLabel_default2(title2, node2.labelStyle, true, true));
+ let bbox = { width: 0, height: 0 };
+ if (evaluate(getConfig2().flowchart.htmlLabels)) {
+ const div = text4.children[0];
+ const dv = select_default2(text4);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ log.info("Text 2", text22);
+ const textRows = text22.slice(1, text22.length);
+ let titleBox = text4.getBBox();
+ const descr = label.node().appendChild(
+ createLabel_default2(textRows.join ? textRows.join(" ") : textRows, node2.labelStyle, true, true)
+ );
+ if (evaluate(getConfig2().flowchart.htmlLabels)) {
+ const div = descr.children[0];
+ const dv = select_default2(descr);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ const halfPadding = node2.padding / 2;
+ select_default2(descr).attr(
+ "transform",
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
+ (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")"
+ );
+ select_default2(text4).attr(
+ "transform",
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
+ (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)"
+ );
+ bbox = label.node().getBBox();
+ label.attr(
+ "transform",
+ "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")"
+ );
+ rect3.attr("class", "outer title-state").attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding);
+ innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);
+ updateNodeBounds2(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default2.rect(node2, point8);
+ };
+ return shapeSvg;
+ }, "rectWithTitle");
+ stadium2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const h2 = bbox.height + node2.padding;
+ const w3 = bbox.width + h2 / 4 + node2.padding;
+ const rect3 = shapeSvg.insert("rect", ":first-child").attr("style", node2.style).attr("rx", h2 / 2).attr("ry", h2 / 2).attr("x", -w3 / 2).attr("y", -h2 / 2).attr("width", w3).attr("height", h2);
+ updateNodeBounds2(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default2.rect(node2, point8);
+ };
+ return shapeSvg;
+ }, "stadium");
+ circle5 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox, halfPadding } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const circle6 = shapeSvg.insert("circle", ":first-child");
+ circle6.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding);
+ log.info("Circle main");
+ updateNodeBounds2(node2, circle6);
+ node2.intersect = function(point8) {
+ log.info("Circle intersect", node2, bbox.width / 2 + halfPadding, point8);
+ return intersect_default2.circle(node2, bbox.width / 2 + halfPadding, point8);
+ };
+ return shapeSvg;
+ }, "circle");
+ doublecircle2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox, halfPadding } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const gap = 5;
+ const circleGroup = shapeSvg.insert("g", ":first-child");
+ const outerCircle = circleGroup.insert("circle");
+ const innerCircle = circleGroup.insert("circle");
+ circleGroup.attr("class", node2.class);
+ outerCircle.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding + gap).attr("width", bbox.width + node2.padding + gap * 2).attr("height", bbox.height + node2.padding + gap * 2);
+ innerCircle.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding);
+ log.info("DoubleCircle main");
+ updateNodeBounds2(node2, outerCircle);
+ node2.intersect = function(point8) {
+ log.info("DoubleCircle intersect", node2, bbox.width / 2 + halfPadding + gap, point8);
+ return intersect_default2.circle(node2, bbox.width / 2 + halfPadding + gap, point8);
+ };
+ return shapeSvg;
+ }, "doublecircle");
+ subroutine2 = /* @__PURE__ */ __name(async (parent4, node2) => {
+ const { shapeSvg, bbox } = await labelHelper2(
+ parent4,
+ node2,
+ getClassesFromNode(node2, void 0),
+ true
+ );
+ const w3 = bbox.width + node2.padding;
+ const h2 = bbox.height + node2.padding;
+ const points = [
+ { x: 0, y: 0 },
+ { x: w3, y: 0 },
+ { x: w3, y: -h2 },
+ { x: 0, y: -h2 },
+ { x: 0, y: 0 },
+ { x: -8, y: 0 },
+ { x: w3 + 8, y: 0 },
+ { x: w3 + 8, y: -h2 },
+ { x: -8, y: -h2 },
+ { x: -8, y: 0 }
+ ];
+ const el = insertPolygonShape3(shapeSvg, w3, h2, points);
+ el.attr("style", node2.style);
+ updateNodeBounds2(node2, el);
+ node2.intersect = function(point8) {
+ return intersect_default2.polygon(node2, points, point8);
+ };
+ return shapeSvg;
+ }, "subroutine");
+ start2 = /* @__PURE__ */ __name((parent4, node2) => {
+ const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
+ const circle6 = shapeSvg.insert("circle", ":first-child");
+ circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
+ updateNodeBounds2(node2, circle6);
+ node2.intersect = function(point8) {
+ return intersect_default2.circle(node2, 7, point8);
+ };
+ return shapeSvg;
+ }, "start");
+ forkJoin2 = /* @__PURE__ */ __name((parent4, node2, dir2) => {
+ const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
+ let width3 = 70;
+ let height2 = 10;
+ if (dir2 === "LR") {
+ width3 = 10;
+ height2 = 70;
+ }
+ const shape = shapeSvg.append("rect").attr("x", -1 * width3 / 2).attr("y", -1 * height2 / 2).attr("width", width3).attr("height", height2).attr("class", "fork-join");
+ updateNodeBounds2(node2, shape);
+ node2.height = node2.height + node2.padding / 2;
+ node2.width = node2.width + node2.padding / 2;
+ node2.intersect = function(point8) {
+ return intersect_default2.rect(node2, point8);
+ };
+ return shapeSvg;
+ }, "forkJoin");
+ end = /* @__PURE__ */ __name((parent4, node2) => {
+ const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id);
+ const innerCircle = shapeSvg.insert("circle", ":first-child");
+ const circle6 = shapeSvg.insert("circle", ":first-child");
+ circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
+ innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10);
+ updateNodeBounds2(node2, circle6);
+ node2.intersect = function(point8) {
+ return intersect_default2.circle(node2, 7, point8);
+ };
+ return shapeSvg;
+ }, "end");
+ class_box = /* @__PURE__ */ __name((parent4, node2) => {
+ const halfPadding = node2.padding / 2;
+ const rowPadding = 4;
+ const lineHeight = 8;
+ let classes3;
+ if (!node2.classes) {
+ classes3 = "node default";
+ } else {
+ classes3 = "node " + node2.classes;
+ }
+ const shapeSvg = parent4.insert("g").attr("class", classes3).attr("id", node2.domId || node2.id);
+ const rect3 = shapeSvg.insert("rect", ":first-child");
+ const topLine = shapeSvg.insert("line");
+ const bottomLine = shapeSvg.insert("line");
+ let maxWidth = 0;
+ let maxHeight = rowPadding;
+ const labelContainer = shapeSvg.insert("g").attr("class", "label");
+ let verticalPos = 0;
+ const hasInterface = node2.classData.annotations?.[0];
+ const interfaceLabelText = node2.classData.annotations[0] ? "\xAB" + node2.classData.annotations[0] + "\xBB" : "";
+ const interfaceLabel = labelContainer.node().appendChild(createLabel_default2(interfaceLabelText, node2.labelStyle, true, true));
+ let interfaceBBox = interfaceLabel.getBBox();
+ if (evaluate(getConfig2().flowchart.htmlLabels)) {
+ const div = interfaceLabel.children[0];
+ const dv = select_default2(interfaceLabel);
+ interfaceBBox = div.getBoundingClientRect();
+ dv.attr("width", interfaceBBox.width);
+ dv.attr("height", interfaceBBox.height);
+ }
+ if (node2.classData.annotations[0]) {
+ maxHeight += interfaceBBox.height + rowPadding;
+ maxWidth += interfaceBBox.width;
+ }
+ let classTitleString = node2.classData.label;
+ if (node2.classData.type !== void 0 && node2.classData.type !== "") {
+ if (getConfig2().flowchart.htmlLabels) {
+ classTitleString += "<" + node2.classData.type + ">";
+ } else {
+ classTitleString += "<" + node2.classData.type + ">";
+ }
+ }
+ const classTitleLabel = labelContainer.node().appendChild(createLabel_default2(classTitleString, node2.labelStyle, true, true));
+ select_default2(classTitleLabel).attr("class", "classTitle");
+ let classTitleBBox = classTitleLabel.getBBox();
+ if (evaluate(getConfig2().flowchart.htmlLabels)) {
+ const div = classTitleLabel.children[0];
+ const dv = select_default2(classTitleLabel);
+ classTitleBBox = div.getBoundingClientRect();
+ dv.attr("width", classTitleBBox.width);
+ dv.attr("height", classTitleBBox.height);
+ }
+ maxHeight += classTitleBBox.height + rowPadding;
+ if (classTitleBBox.width > maxWidth) {
+ maxWidth = classTitleBBox.width;
+ }
+ const classAttributes = [];
+ node2.classData.members.forEach((member) => {
+ const parsedInfo = member.getDisplayDetails();
+ let parsedText = parsedInfo.displayText;
+ if (getConfig2().flowchart.htmlLabels) {
+ parsedText = parsedText.replace(//g, ">");
+ }
+ const lbl = labelContainer.node().appendChild(
+ createLabel_default2(
+ parsedText,
+ parsedInfo.cssStyle ? parsedInfo.cssStyle : node2.labelStyle,
+ true,
+ true
+ )
+ );
+ let bbox = lbl.getBBox();
+ if (evaluate(getConfig2().flowchart.htmlLabels)) {
+ const div = lbl.children[0];
+ const dv = select_default2(lbl);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ if (bbox.width > maxWidth) {
+ maxWidth = bbox.width;
+ }
+ maxHeight += bbox.height + rowPadding;
+ classAttributes.push(lbl);
+ });
+ maxHeight += lineHeight;
+ const classMethods = [];
+ node2.classData.methods.forEach((member) => {
+ const parsedInfo = member.getDisplayDetails();
+ let displayText = parsedInfo.displayText;
+ if (getConfig2().flowchart.htmlLabels) {
+ displayText = displayText.replace(//g, ">");
+ }
+ const lbl = labelContainer.node().appendChild(
+ createLabel_default2(
+ displayText,
+ parsedInfo.cssStyle ? parsedInfo.cssStyle : node2.labelStyle,
+ true,
+ true
+ )
+ );
+ let bbox = lbl.getBBox();
+ if (evaluate(getConfig2().flowchart.htmlLabels)) {
+ const div = lbl.children[0];
+ const dv = select_default2(lbl);
+ bbox = div.getBoundingClientRect();
+ dv.attr("width", bbox.width);
+ dv.attr("height", bbox.height);
+ }
+ if (bbox.width > maxWidth) {
+ maxWidth = bbox.width;
+ }
+ maxHeight += bbox.height + rowPadding;
+ classMethods.push(lbl);
+ });
+ maxHeight += lineHeight;
+ if (hasInterface) {
+ let diffX2 = (maxWidth - interfaceBBox.width) / 2;
+ select_default2(interfaceLabel).attr(
+ "transform",
+ "translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")"
+ );
+ verticalPos = interfaceBBox.height + rowPadding;
+ }
+ let diffX = (maxWidth - classTitleBBox.width) / 2;
+ select_default2(classTitleLabel).attr(
+ "transform",
+ "translate( " + (-1 * maxWidth / 2 + diffX) + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
+ );
+ verticalPos += classTitleBBox.height + rowPadding;
+ topLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos);
+ verticalPos += lineHeight;
+ classAttributes.forEach((lbl) => {
+ select_default2(lbl).attr(
+ "transform",
+ "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")"
+ );
+ const memberBBox = lbl?.getBBox();
+ verticalPos += (memberBBox?.height ?? 0) + rowPadding;
+ });
+ verticalPos += lineHeight;
+ bottomLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos);
+ verticalPos += lineHeight;
+ classMethods.forEach((lbl) => {
+ select_default2(lbl).attr(
+ "transform",
+ "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
+ );
+ const memberBBox = lbl?.getBBox();
+ verticalPos += (memberBBox?.height ?? 0) + rowPadding;
+ });
+ rect3.attr("style", node2.style).attr("class", "outer title-state").attr("x", -maxWidth / 2 - halfPadding).attr("y", -(maxHeight / 2) - halfPadding).attr("width", maxWidth + node2.padding).attr("height", maxHeight + node2.padding);
+ updateNodeBounds2(node2, rect3);
+ node2.intersect = function(point8) {
+ return intersect_default2.rect(node2, point8);
+ };
+ return shapeSvg;
+ }, "class_box");
+ shapes3 = {
+ rhombus: question2,
+ composite,
+ question: question2,
+ rect: rect2,
+ labelRect: labelRect2,
+ rectWithTitle: rectWithTitle2,
+ choice: choice2,
+ circle: circle5,
+ doublecircle: doublecircle2,
+ stadium: stadium2,
+ hexagon: hexagon2,
+ block_arrow,
+ rect_left_inv_arrow: rect_left_inv_arrow2,
+ lean_right: lean_right2,
+ lean_left: lean_left2,
+ trapezoid: trapezoid2,
+ inv_trapezoid: inv_trapezoid2,
+ rect_right_inv_arrow,
+ cylinder: cylinder2,
+ start: start2,
+ end,
+ note: note_default,
+ subroutine: subroutine2,
+ fork: forkJoin2,
+ join: forkJoin2,
+ class_box
+ };
+ nodeElems2 = {};
+ insertNode2 = /* @__PURE__ */ __name(async (elem, node2, renderOptions) => {
+ let newEl;
+ let el;
+ if (node2.link) {
+ let target;
+ if (getConfig2().securityLevel === "sandbox") {
+ target = "_top";
+ } else if (node2.linkTarget) {
+ target = node2.linkTarget || "_blank";
+ }
+ newEl = elem.insert("svg:a").attr("xlink:href", node2.link).attr("target", target);
+ el = await shapes3[node2.shape](newEl, node2, renderOptions);
+ } else {
+ el = await shapes3[node2.shape](elem, node2, renderOptions);
+ newEl = el;
+ }
+ if (node2.tooltip) {
+ el.attr("title", node2.tooltip);
+ }
+ if (node2.class) {
+ el.attr("class", "node default " + node2.class);
+ }
+ nodeElems2[node2.id] = newEl;
+ if (node2.haveCallback) {
+ nodeElems2[node2.id].attr("class", nodeElems2[node2.id].attr("class") + " clickable");
+ }
+ return newEl;
+ }, "insertNode");
+ positionNode3 = /* @__PURE__ */ __name((node2) => {
+ const el = nodeElems2[node2.id];
+ log.trace(
+ "Transforming node",
+ node2.diff,
+ node2,
+ "translate(" + (node2.x - node2.width / 2 - 5) + ", " + node2.width / 2 + ")"
+ );
+ const padding2 = 8;
+ const diff2 = node2.diff || 0;
+ if (node2.clusterNode) {
+ el.attr(
+ "transform",
+ "translate(" + (node2.x + diff2 - node2.width / 2) + ", " + (node2.y - node2.height / 2 - padding2) + ")"
+ );
+ } else {
+ el.attr("transform", "translate(" + node2.x + ", " + node2.y + ")");
+ }
+ return diff2;
+ }, "positionNode");
+ }
+ });
+
+ // src/diagrams/block/renderHelpers.ts
+ function getNodeFromBlock(block3, db10, positioned = false) {
+ const vertex = block3;
+ let classStr = "default";
+ if ((vertex?.classes?.length || 0) > 0) {
+ classStr = (vertex?.classes ?? []).join(" ");
+ }
+ classStr = classStr + " flowchart-label";
+ let radius2 = 0;
+ let shape = "";
+ let padding2;
+ switch (vertex.type) {
+ case "round":
+ radius2 = 5;
+ shape = "rect";
+ break;
+ case "composite":
+ radius2 = 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 styles4 = getStylesFromArray(vertex?.styles ?? []);
+ const vertexText = vertex.label;
+ const bounds4 = vertex.size ?? { width: 0, height: 0, x: 0, y: 0 };
+ const node2 = {
+ labelStyle: styles4.labelStyle,
+ shape,
+ labelText: vertexText,
+ rx: radius2,
+ ry: radius2,
+ class: classStr,
+ style: styles4.style,
+ id: vertex.id,
+ directions: vertex.directions,
+ width: bounds4.width,
+ height: bounds4.height,
+ x: bounds4.x,
+ y: bounds4.y,
+ positioned,
+ intersect: void 0,
+ type: vertex.type,
+ padding: padding2 ?? getConfig()?.block?.padding ?? 0
+ };
+ return node2;
+ }
+ async function calculateBlockSize(elem, block3, db10) {
+ const node2 = getNodeFromBlock(block3, db10, false);
+ if (node2.type === "group") {
+ return;
+ }
+ const config5 = getConfig();
+ const nodeEl = await insertNode2(elem, node2, { config: config5 });
+ const boundingBox3 = nodeEl.node().getBBox();
+ const obj = db10.getBlock(node2.id);
+ obj.size = { width: boundingBox3.width, height: boundingBox3.height, x: 0, y: 0, node: nodeEl };
+ db10.setBlock(obj);
+ nodeEl.remove();
+ }
+ async function insertBlockPositioned(elem, block3, db10) {
+ const node2 = getNodeFromBlock(block3, db10, true);
+ const obj = db10.getBlock(node2.id);
+ if (obj.type !== "space") {
+ const config5 = getConfig();
+ await insertNode2(elem, node2, { config: config5 });
+ block3.intersect = node2?.intersect;
+ positionNode3(node2);
+ }
+ }
+ async function performOperations(elem, blocks2, db10, operation) {
+ for (const block3 of blocks2) {
+ await operation(elem, block3, db10);
+ if (block3.children) {
+ await performOperations(elem, block3.children, db10, operation);
+ }
+ }
+ }
+ async function calculateBlockSizes(elem, blocks2, db10) {
+ await performOperations(elem, blocks2, db10, calculateBlockSize);
+ }
+ async function insertBlocks(elem, blocks2, db10) {
+ await performOperations(elem, blocks2, db10, insertBlockPositioned);
+ }
+ async function insertEdges(elem, edges3, blocks2, db10, id29) {
+ const g2 = new Graph({
+ multigraph: true,
+ compound: true
+ });
+ g2.setGraph({
+ rankdir: "TB",
+ nodesep: 10,
+ ranksep: 10,
+ marginx: 8,
+ marginy: 8
+ });
+ for (const block3 of blocks2) {
+ if (block3.size) {
+ g2.setNode(block3.id, {
+ width: block3.size.width,
+ height: block3.size.height,
+ intersect: block3.intersect
+ });
+ }
+ }
+ for (const edge of edges3) {
+ if (edge.start && edge.end) {
+ const startBlock = db10.getBlock(edge.start);
+ const endBlock = db10.getBlock(edge.end);
+ if (startBlock?.size && endBlock?.size) {
+ const start3 = startBlock.size;
+ const end2 = endBlock.size;
+ const points = [
+ { x: start3.x, y: start3.y },
+ { x: start3.x + (end2.x - start3.x) / 2, y: start3.y + (end2.y - start3.y) / 2 },
+ { x: end2.x, y: end2.y }
+ ];
+ insertEdge2(
+ 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"
},
- /* 11 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var _createClass2 = /* @__PURE__ */ function() {
- function defineProperties(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- __name(defineProperties, "defineProperties");
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
- function _classCallCheck2(instance2, Constructor) {
- if (!(instance2 instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
+ void 0,
+ "block",
+ g2,
+ id29
+ );
+ if (edge.label) {
+ await insertEdgeLabel2(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"
+ });
+ positionEdgeLabel2(
+ { ...edge, x: points[1].x, y: points[1].y },
+ {
+ originalPath: points
}
- __name(_classCallCheck2, "_classCallCheck");
- var nodeFrom = /* @__PURE__ */ __name(function nodeFrom2(value2) {
- return { value: value2, next: null, prev: null };
- }, "nodeFrom");
- var add3 = /* @__PURE__ */ __name(function add4(prev2, node2, next3, list2) {
- if (prev2 !== null) {
- prev2.next = node2;
- } else {
- list2.head = node2;
- }
- if (next3 !== null) {
- next3.prev = node2;
- } else {
- list2.tail = node2;
- }
- node2.prev = prev2;
- node2.next = next3;
- list2.length++;
- return node2;
- }, "add");
- var _remove = /* @__PURE__ */ __name(function _remove2(node2, list2) {
- var prev2 = node2.prev, next3 = node2.next;
- if (prev2 !== null) {
- prev2.next = next3;
- } else {
- list2.head = next3;
- }
- if (next3 !== null) {
- next3.prev = prev2;
- } else {
- list2.tail = prev2;
- }
- node2.prev = node2.next = null;
- list2.length--;
- return node2;
- }, "_remove");
- var LinkedList = function() {
- function LinkedList2(vals) {
- var _this = this;
- _classCallCheck2(this, LinkedList2);
- this.length = 0;
- this.head = null;
- this.tail = null;
- if (vals != null) {
- vals.forEach(function(v3) {
- return _this.push(v3);
- });
- }
+ );
+ }
+ }
+ }
+ }
+ }
+ var init_renderHelpers = __esm({
+ "src/diagrams/block/renderHelpers.ts"() {
+ "use strict";
+ init_graphlib();
+ init_config();
+ init_edges2();
+ init_nodes3();
+ init_utils2();
+ __name(getNodeFromBlock, "getNodeFromBlock");
+ __name(calculateBlockSize, "calculateBlockSize");
+ __name(insertBlockPositioned, "insertBlockPositioned");
+ __name(performOperations, "performOperations");
+ __name(calculateBlockSizes, "calculateBlockSizes");
+ __name(insertBlocks, "insertBlocks");
+ __name(insertEdges, "insertEdges");
+ }
+ });
+
+ // src/diagrams/block/blockRenderer.ts
+ var getClasses5, draw23, blockRenderer_default;
+ var init_blockRenderer = __esm({
+ "src/diagrams/block/blockRenderer.ts"() {
+ "use strict";
+ init_src32();
+ init_config();
+ init_markers2();
+ init_logger();
+ init_setupGraphViewbox();
+ init_layout2();
+ init_renderHelpers();
+ getClasses5 = /* @__PURE__ */ __name(function(text4, diagObj) {
+ return diagObj.db.getClasses();
+ }, "getClasses");
+ draw23 = /* @__PURE__ */ __name(async function(text4, id29, _version, diagObj) {
+ const { securityLevel, block: conf5 } = getConfig();
+ const db10 = diagObj.db;
+ let sandboxElement;
+ if (securityLevel === "sandbox") {
+ sandboxElement = select_default2("#i" + id29);
+ }
+ const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
+ const svg2 = securityLevel === "sandbox" ? root4.select(`[id="${id29}"]`) : select_default2(`[id="${id29}"]`);
+ const markers3 = ["point", "circle", "cross"];
+ markers_default2(svg2, markers3, diagObj.type, id29);
+ const bl = db10.getBlocks();
+ const blArr = db10.getBlocksFlat();
+ const edges3 = db10.getEdges();
+ const nodes6 = svg2.insert("g").attr("class", "block");
+ await calculateBlockSizes(nodes6, bl, db10);
+ const bounds4 = layout5(db10);
+ await insertBlocks(nodes6, bl, db10);
+ await insertEdges(nodes6, edges3, blArr, db10, id29);
+ if (bounds4) {
+ const bounds22 = bounds4;
+ const magicFactor = Math.max(1, Math.round(0.125 * (bounds22.width / bounds22.height)));
+ const height2 = bounds22.height + magicFactor + 10;
+ const width3 = bounds22.width + 10;
+ const { useMaxWidth } = conf5;
+ configureSvgSize(svg2, height2, width3, !!useMaxWidth);
+ log.debug("Here Bounds", bounds4, bounds22);
+ svg2.attr(
+ "viewBox",
+ `${bounds22.x - 5} ${bounds22.y - 5} ${bounds22.width + 10} ${bounds22.height + 10}`
+ );
+ }
+ }, "draw");
+ blockRenderer_default = {
+ draw: draw23,
+ getClasses: getClasses5
+ };
+ }
+ });
+
+ // src/diagrams/block/blockDiagram.ts
+ var blockDiagram_exports = {};
+ __export(blockDiagram_exports, {
+ diagram: () => diagram24
+ });
+ var diagram24;
+ var init_blockDiagram = __esm({
+ "src/diagrams/block/blockDiagram.ts"() {
+ "use strict";
+ init_block();
+ init_blockDB();
+ init_styles18();
+ init_blockRenderer();
+ diagram24 = {
+ parser: block_default,
+ db: blockDB_default,
+ renderer: blockRenderer_default,
+ styles: styles_default16
+ };
+ }
+ });
+
+ // src/diagrams/architecture/architectureTypes.ts
+ var ArchitectureDirectionName, ArchitectureDirectionArrow, ArchitectureDirectionArrowShift, getOppositeArchitectureDirection, isArchitectureDirection, isArchitectureDirectionX, isArchitectureDirectionY, isArchitectureDirectionXY, isArchitecturePairXY, isValidArchitectureDirectionPair, getArchitectureDirectionPair, shiftPositionByArchitectureDirectionPair, getArchitectureDirectionXYFactors, getArchitectureDirectionAlignment, isArchitectureService, isArchitectureJunction, edgeData, nodeData;
+ var init_architectureTypes = __esm({
+ "src/diagrams/architecture/architectureTypes.ts"() {
+ "use strict";
+ ArchitectureDirectionName = {
+ L: "left",
+ R: "right",
+ T: "top",
+ B: "bottom"
+ };
+ ArchitectureDirectionArrow = {
+ L: /* @__PURE__ */ __name((scale2) => `${scale2},${scale2 / 2} 0,${scale2} 0,0`, "L"),
+ R: /* @__PURE__ */ __name((scale2) => `0,${scale2 / 2} ${scale2},0 ${scale2},${scale2}`, "R"),
+ T: /* @__PURE__ */ __name((scale2) => `0,0 ${scale2},0 ${scale2 / 2},${scale2}`, "T"),
+ B: /* @__PURE__ */ __name((scale2) => `${scale2 / 2},0 ${scale2},${scale2} 0,${scale2}`, "B")
+ };
+ ArchitectureDirectionArrowShift = {
+ L: /* @__PURE__ */ __name((orig, arrowSize) => orig - arrowSize + 2, "L"),
+ R: /* @__PURE__ */ __name((orig, _arrowSize) => orig - 2, "R"),
+ T: /* @__PURE__ */ __name((orig, arrowSize) => orig - arrowSize + 2, "T"),
+ B: /* @__PURE__ */ __name((orig, _arrowSize) => orig - 2, "B")
+ };
+ getOppositeArchitectureDirection = /* @__PURE__ */ __name(function(x5) {
+ if (isArchitectureDirectionX(x5)) {
+ return x5 === "L" ? "R" : "L";
+ } else {
+ return x5 === "T" ? "B" : "T";
+ }
+ }, "getOppositeArchitectureDirection");
+ isArchitectureDirection = /* @__PURE__ */ __name(function(x5) {
+ const temp = x5;
+ return temp === "L" || temp === "R" || temp === "T" || temp === "B";
+ }, "isArchitectureDirection");
+ isArchitectureDirectionX = /* @__PURE__ */ __name(function(x5) {
+ const temp = x5;
+ return temp === "L" || temp === "R";
+ }, "isArchitectureDirectionX");
+ isArchitectureDirectionY = /* @__PURE__ */ __name(function(x5) {
+ const temp = x5;
+ return temp === "T" || temp === "B";
+ }, "isArchitectureDirectionY");
+ isArchitectureDirectionXY = /* @__PURE__ */ __name(function(a2, b2) {
+ const aX_bY = isArchitectureDirectionX(a2) && isArchitectureDirectionY(b2);
+ const aY_bX = isArchitectureDirectionY(a2) && isArchitectureDirectionX(b2);
+ return aX_bY || aY_bX;
+ }, "isArchitectureDirectionXY");
+ isArchitecturePairXY = /* @__PURE__ */ __name(function(pair) {
+ const lhs = pair[0];
+ const rhs = pair[1];
+ const aX_bY = isArchitectureDirectionX(lhs) && isArchitectureDirectionY(rhs);
+ const aY_bX = isArchitectureDirectionY(lhs) && isArchitectureDirectionX(rhs);
+ return aX_bY || aY_bX;
+ }, "isArchitecturePairXY");
+ isValidArchitectureDirectionPair = /* @__PURE__ */ __name(function(x5) {
+ return x5 !== "LL" && x5 !== "RR" && x5 !== "TT" && x5 !== "BB";
+ }, "isValidArchitectureDirectionPair");
+ getArchitectureDirectionPair = /* @__PURE__ */ __name(function(sourceDir, targetDir) {
+ const pair = `${sourceDir}${targetDir}`;
+ return isValidArchitectureDirectionPair(pair) ? pair : void 0;
+ }, "getArchitectureDirectionPair");
+ shiftPositionByArchitectureDirectionPair = /* @__PURE__ */ __name(function([x5, y5], pair) {
+ const lhs = pair[0];
+ const rhs = pair[1];
+ if (isArchitectureDirectionX(lhs)) {
+ if (isArchitectureDirectionY(rhs)) {
+ return [x5 + (lhs === "L" ? -1 : 1), y5 + (rhs === "T" ? 1 : -1)];
+ } else {
+ return [x5 + (lhs === "L" ? -1 : 1), y5];
+ }
+ } else {
+ if (isArchitectureDirectionX(rhs)) {
+ return [x5 + (rhs === "L" ? 1 : -1), y5 + (lhs === "T" ? 1 : -1)];
+ } else {
+ return [x5, y5 + (lhs === "T" ? 1 : -1)];
+ }
+ }
+ }, "shiftPositionByArchitectureDirectionPair");
+ getArchitectureDirectionXYFactors = /* @__PURE__ */ __name(function(pair) {
+ if (pair === "LT" || pair === "TL") {
+ return [1, 1];
+ } else if (pair === "BL" || pair === "LB") {
+ return [1, -1];
+ } else if (pair === "BR" || pair === "RB") {
+ return [-1, -1];
+ } else {
+ return [-1, 1];
+ }
+ }, "getArchitectureDirectionXYFactors");
+ getArchitectureDirectionAlignment = /* @__PURE__ */ __name(function(a2, b2) {
+ if (isArchitectureDirectionXY(a2, b2)) {
+ return "bend";
+ } else if (isArchitectureDirectionX(a2)) {
+ return "horizontal";
+ }
+ return "vertical";
+ }, "getArchitectureDirectionAlignment");
+ isArchitectureService = /* @__PURE__ */ __name(function(x5) {
+ const temp = x5;
+ return temp.type === "service";
+ }, "isArchitectureService");
+ isArchitectureJunction = /* @__PURE__ */ __name(function(x5) {
+ const temp = x5;
+ return temp.type === "junction";
+ }, "isArchitectureJunction");
+ edgeData = /* @__PURE__ */ __name((edge) => {
+ return edge.data();
+ }, "edgeData");
+ nodeData = /* @__PURE__ */ __name((node2) => {
+ return node2.data();
+ }, "nodeData");
+ }
+ });
+
+ // src/diagrams/architecture/architectureDb.ts
+ function getConfigField(field) {
+ const arch = getConfig2().architecture;
+ if (arch?.[field]) {
+ return arch[field];
+ }
+ return DEFAULT_ARCHITECTURE_CONFIG[field];
+ }
+ var DEFAULT_ARCHITECTURE_CONFIG, state3, clear21, addService, getServices, addJunction, getJunctions, getNodes2, getNode, addGroup, getGroups, addEdge, getEdges2, getDataStructures, setElementForId3, getElementById4, db9;
+ var init_architectureDb = __esm({
+ "src/diagrams/architecture/architectureDb.ts"() {
+ "use strict";
+ init_defaultConfig();
+ init_diagramAPI();
+ init_imperativeState();
+ init_commonDb();
+ init_architectureTypes();
+ DEFAULT_ARCHITECTURE_CONFIG = defaultConfig_default.architecture;
+ state3 = new ImperativeState(() => ({
+ nodes: {},
+ groups: {},
+ edges: [],
+ registeredIds: {},
+ config: DEFAULT_ARCHITECTURE_CONFIG,
+ dataStructures: void 0,
+ elements: {}
+ }));
+ clear21 = /* @__PURE__ */ __name(() => {
+ state3.reset();
+ clear();
+ }, "clear");
+ addService = /* @__PURE__ */ __name(function({
+ id: id29,
+ icon: icon2,
+ in: parent4,
+ title: title2,
+ iconText
+ }) {
+ if (state3.records.registeredIds[id29] !== void 0) {
+ throw new Error(
+ `The service id [${id29}] is already in use by another ${state3.records.registeredIds[id29]}`
+ );
+ }
+ if (parent4 !== void 0) {
+ if (id29 === parent4) {
+ throw new Error(`The service [${id29}] cannot be placed within itself`);
+ }
+ if (state3.records.registeredIds[parent4] === void 0) {
+ throw new Error(
+ `The service [${id29}]'s parent does not exist. Please make sure the parent is created before this service`
+ );
+ }
+ if (state3.records.registeredIds[parent4] === "node") {
+ throw new Error(`The service [${id29}]'s parent is not a group`);
+ }
+ }
+ state3.records.registeredIds[id29] = "node";
+ state3.records.nodes[id29] = {
+ id: id29,
+ type: "service",
+ icon: icon2,
+ iconText,
+ title: title2,
+ edges: [],
+ in: parent4
+ };
+ }, "addService");
+ getServices = /* @__PURE__ */ __name(() => Object.values(state3.records.nodes).filter(isArchitectureService), "getServices");
+ addJunction = /* @__PURE__ */ __name(function({ id: id29, in: parent4 }) {
+ state3.records.registeredIds[id29] = "node";
+ state3.records.nodes[id29] = {
+ id: id29,
+ type: "junction",
+ edges: [],
+ in: parent4
+ };
+ }, "addJunction");
+ getJunctions = /* @__PURE__ */ __name(() => Object.values(state3.records.nodes).filter(isArchitectureJunction), "getJunctions");
+ getNodes2 = /* @__PURE__ */ __name(() => Object.values(state3.records.nodes), "getNodes");
+ getNode = /* @__PURE__ */ __name((id29) => state3.records.nodes[id29], "getNode");
+ addGroup = /* @__PURE__ */ __name(function({ id: id29, icon: icon2, in: parent4, title: title2 }) {
+ if (state3.records.registeredIds[id29] !== void 0) {
+ throw new Error(
+ `The group id [${id29}] is already in use by another ${state3.records.registeredIds[id29]}`
+ );
+ }
+ if (parent4 !== void 0) {
+ if (id29 === parent4) {
+ throw new Error(`The group [${id29}] cannot be placed within itself`);
+ }
+ if (state3.records.registeredIds[parent4] === void 0) {
+ throw new Error(
+ `The group [${id29}]'s parent does not exist. Please make sure the parent is created before this group`
+ );
+ }
+ if (state3.records.registeredIds[parent4] === "node") {
+ throw new Error(`The group [${id29}]'s parent is not a group`);
+ }
+ }
+ state3.records.registeredIds[id29] = "group";
+ state3.records.groups[id29] = {
+ id: id29,
+ icon: icon2,
+ title: title2,
+ in: parent4
+ };
+ }, "addGroup");
+ getGroups = /* @__PURE__ */ __name(() => {
+ return Object.values(state3.records.groups);
+ }, "getGroups");
+ addEdge = /* @__PURE__ */ __name(function({
+ lhsId,
+ rhsId,
+ lhsDir,
+ rhsDir,
+ lhsInto,
+ rhsInto,
+ lhsGroup,
+ rhsGroup,
+ title: title2
+ }) {
+ if (!isArchitectureDirection(lhsDir)) {
+ throw new Error(
+ `Invalid direction given for left hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${lhsDir}`
+ );
+ }
+ if (!isArchitectureDirection(rhsDir)) {
+ throw new Error(
+ `Invalid direction given for right hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${rhsDir}`
+ );
+ }
+ if (state3.records.nodes[lhsId] === void 0 && state3.records.groups[lhsId] === void 0) {
+ throw new Error(
+ `The left-hand id [${lhsId}] does not yet exist. Please create the service/group before declaring an edge to it.`
+ );
+ }
+ if (state3.records.nodes[rhsId] === void 0 && state3.records.groups[lhsId] === void 0) {
+ throw new Error(
+ `The right-hand id [${rhsId}] does not yet exist. Please create the service/group before declaring an edge to it.`
+ );
+ }
+ const lhsGroupId = state3.records.nodes[lhsId].in;
+ const rhsGroupId = state3.records.nodes[rhsId].in;
+ if (lhsGroup && lhsGroupId && rhsGroupId && lhsGroupId == rhsGroupId) {
+ throw new Error(
+ `The left-hand id [${lhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
+ );
+ }
+ if (rhsGroup && lhsGroupId && rhsGroupId && lhsGroupId == rhsGroupId) {
+ throw new Error(
+ `The right-hand id [${rhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
+ );
+ }
+ const edge = {
+ lhsId,
+ lhsDir,
+ lhsInto,
+ lhsGroup,
+ rhsId,
+ rhsDir,
+ rhsInto,
+ rhsGroup,
+ title: title2
+ };
+ state3.records.edges.push(edge);
+ if (state3.records.nodes[lhsId] && state3.records.nodes[rhsId]) {
+ state3.records.nodes[lhsId].edges.push(state3.records.edges[state3.records.edges.length - 1]);
+ state3.records.nodes[rhsId].edges.push(state3.records.edges[state3.records.edges.length - 1]);
+ }
+ }, "addEdge");
+ getEdges2 = /* @__PURE__ */ __name(() => state3.records.edges, "getEdges");
+ getDataStructures = /* @__PURE__ */ __name(() => {
+ if (state3.records.dataStructures === void 0) {
+ const groupAlignments = {};
+ const adjList = Object.entries(state3.records.nodes).reduce((prevOuter, [id29, service]) => {
+ prevOuter[id29] = service.edges.reduce((prevInner, edge) => {
+ const lhsGroupId = getNode(edge.lhsId)?.in;
+ const rhsGroupId = getNode(edge.rhsId)?.in;
+ if (lhsGroupId && rhsGroupId && lhsGroupId !== rhsGroupId) {
+ const alignment = getArchitectureDirectionAlignment(edge.lhsDir, edge.rhsDir);
+ if (alignment !== "bend") {
+ groupAlignments[lhsGroupId] ??= {};
+ groupAlignments[lhsGroupId][rhsGroupId] = alignment;
+ groupAlignments[rhsGroupId] ??= {};
+ groupAlignments[rhsGroupId][lhsGroupId] = alignment;
+ }
+ }
+ if (edge.lhsId === id29) {
+ const pair = getArchitectureDirectionPair(edge.lhsDir, edge.rhsDir);
+ if (pair) {
+ prevInner[pair] = edge.rhsId;
}
- __name(LinkedList2, "LinkedList");
- _createClass2(LinkedList2, [{
- key: "size",
- value: /* @__PURE__ */ __name(function size5() {
- return this.length;
- }, "size")
- }, {
- key: "insertBefore",
- value: /* @__PURE__ */ __name(function insertBefore(val, otherNode) {
- return add3(otherNode.prev, nodeFrom(val), otherNode, this);
- }, "insertBefore")
- }, {
- key: "insertAfter",
- value: /* @__PURE__ */ __name(function insertAfter(val, otherNode) {
- return add3(otherNode, nodeFrom(val), otherNode.next, this);
- }, "insertAfter")
- }, {
- key: "insertNodeBefore",
- value: /* @__PURE__ */ __name(function insertNodeBefore(newNode, otherNode) {
- return add3(otherNode.prev, newNode, otherNode, this);
- }, "insertNodeBefore")
- }, {
- key: "insertNodeAfter",
- value: /* @__PURE__ */ __name(function insertNodeAfter(newNode, otherNode) {
- return add3(otherNode, newNode, otherNode.next, this);
- }, "insertNodeAfter")
- }, {
- key: "push",
- value: /* @__PURE__ */ __name(function push3(val) {
- return add3(this.tail, nodeFrom(val), null, this);
- }, "push")
- }, {
- key: "unshift",
- value: /* @__PURE__ */ __name(function unshift(val) {
- return add3(null, nodeFrom(val), this.head, this);
- }, "unshift")
- }, {
- key: "remove",
- value: /* @__PURE__ */ __name(function remove3(node2) {
- return _remove(node2, this);
- }, "remove")
- }, {
- key: "pop",
- value: /* @__PURE__ */ __name(function pop() {
- return _remove(this.tail, this).value;
- }, "pop")
- }, {
- key: "popNode",
- value: /* @__PURE__ */ __name(function popNode() {
- return _remove(this.tail, this);
- }, "popNode")
- }, {
- key: "shift",
- value: /* @__PURE__ */ __name(function shift2() {
- return _remove(this.head, this).value;
- }, "shift")
- }, {
- key: "shiftNode",
- value: /* @__PURE__ */ __name(function shiftNode() {
- return _remove(this.head, this);
- }, "shiftNode")
- }, {
- key: "get_object_at",
- value: /* @__PURE__ */ __name(function get_object_at(index) {
- if (index <= this.length()) {
- var i2 = 1;
- var current = this.head;
- while (i2 < index) {
- current = current.next;
- i2++;
- }
- return current.value;
- }
- }, "get_object_at")
- }, {
- key: "set_object_at",
- value: /* @__PURE__ */ __name(function set_object_at(index, value2) {
- if (index <= this.length()) {
- var i2 = 1;
- var current = this.head;
- while (i2 < index) {
- current = current.next;
- i2++;
- }
- current.value = value2;
- }
- }, "set_object_at")
- }]);
- return LinkedList2;
- }();
- module3.exports = LinkedList;
- },
- /* 12 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- function Point3(x5, y5, p3) {
- this.x = null;
- this.y = null;
- if (x5 == null && y5 == null && p3 == null) {
- this.x = 0;
- this.y = 0;
- } else if (typeof x5 == "number" && typeof y5 == "number" && p3 == null) {
- this.x = x5;
- this.y = y5;
- } else if (x5.constructor.name == "Point" && y5 == null && p3 == null) {
- p3 = x5;
- this.x = p3.x;
- this.y = p3.y;
+ } else {
+ const pair = getArchitectureDirectionPair(edge.rhsDir, edge.lhsDir);
+ if (pair) {
+ prevInner[pair] = edge.lhsId;
}
}
- __name(Point3, "Point");
- Point3.prototype.getX = function() {
- return this.x;
- };
- Point3.prototype.getY = function() {
- return this.y;
- };
- Point3.prototype.getLocation = function() {
- return new Point3(this.x, this.y);
- };
- Point3.prototype.setLocation = function(x5, y5, p3) {
- if (x5.constructor.name == "Point" && y5 == null && p3 == null) {
- p3 = x5;
- this.setLocation(p3.x, p3.y);
- } else if (typeof x5 == "number" && typeof y5 == "number" && p3 == null) {
- if (parseInt(x5) == x5 && parseInt(y5) == y5) {
- this.move(x5, y5);
- } else {
- this.x = Math.floor(x5 + 0.5);
- this.y = Math.floor(y5 + 0.5);
+ return prevInner;
+ }, {});
+ return prevOuter;
+ }, {});
+ const firstId = Object.keys(adjList)[0];
+ const visited = { [firstId]: 1 };
+ const notVisited = Object.keys(adjList).reduce(
+ (prev2, id29) => id29 === firstId ? prev2 : { ...prev2, [id29]: 1 },
+ {}
+ );
+ const BFS = /* @__PURE__ */ __name((startingId) => {
+ const spatialMap = { [startingId]: [0, 0] };
+ const queue = [startingId];
+ while (queue.length > 0) {
+ const id29 = queue.shift();
+ if (id29) {
+ visited[id29] = 1;
+ delete notVisited[id29];
+ const adj = adjList[id29];
+ const [posX, posY] = spatialMap[id29];
+ Object.entries(adj).forEach(([dir2, rhsId]) => {
+ if (!visited[rhsId]) {
+ spatialMap[rhsId] = shiftPositionByArchitectureDirectionPair(
+ [posX, posY],
+ dir2
+ );
+ queue.push(rhsId);
}
- }
- };
- Point3.prototype.move = function(x5, y5) {
- this.x = x5;
- this.y = y5;
- };
- Point3.prototype.translate = function(dx, dy) {
- this.x += dx;
- this.y += dy;
- };
- Point3.prototype.equals = function(obj) {
- if (obj.constructor.name == "Point") {
- var pt = obj;
- return this.x == pt.x && this.y == pt.y;
- }
- return this == obj;
- };
- Point3.prototype.toString = function() {
- return new Point3().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
+ });
+ }
+ }
+ return spatialMap;
+ }, "BFS");
+ const spatialMaps = [BFS(firstId)];
+ while (Object.keys(notVisited).length > 0) {
+ spatialMaps.push(BFS(Object.keys(notVisited)[0]));
+ }
+ state3.records.dataStructures = {
+ adjList,
+ spatialMaps,
+ groupAlignments
+ };
+ }
+ return state3.records.dataStructures;
+ }, "getDataStructures");
+ setElementForId3 = /* @__PURE__ */ __name((id29, element3) => {
+ state3.records.elements[id29] = element3;
+ }, "setElementForId");
+ getElementById4 = /* @__PURE__ */ __name((id29) => state3.records.elements[id29], "getElementById");
+ db9 = {
+ clear: clear21,
+ setDiagramTitle,
+ getDiagramTitle,
+ setAccTitle,
+ getAccTitle,
+ setAccDescription,
+ getAccDescription,
+ addService,
+ getServices,
+ addJunction,
+ getJunctions,
+ getNodes: getNodes2,
+ getNode,
+ addGroup,
+ getGroups,
+ addEdge,
+ getEdges: getEdges2,
+ setElementForId: setElementForId3,
+ getElementById: getElementById4,
+ getDataStructures
+ };
+ __name(getConfigField, "getConfigField");
+ }
+ });
+
+ // src/diagrams/architecture/architectureParser.ts
+ var populateDb2, parser23;
+ var init_architectureParser = __esm({
+ "src/diagrams/architecture/architectureParser.ts"() {
+ "use strict";
+ init_mermaid_parser_core();
+ init_logger();
+ init_populateCommonDb();
+ init_architectureDb();
+ populateDb2 = /* @__PURE__ */ __name((ast, db10) => {
+ populateCommonDb(ast, db10);
+ ast.groups.map(db10.addGroup);
+ ast.services.map((service) => db10.addService({ ...service, type: "service" }));
+ ast.junctions.map((service) => db10.addJunction({ ...service, type: "junction" }));
+ ast.edges.map(db10.addEdge);
+ }, "populateDb");
+ parser23 = {
+ parse: /* @__PURE__ */ __name(async (input) => {
+ const ast = await parse("architecture", input);
+ log.debug(ast);
+ populateDb2(ast, db9);
+ }, "parse")
+ };
+ }
+ });
+
+ // src/diagrams/architecture/architectureStyles.ts
+ var getStyles18, architectureStyles_default;
+ var init_architectureStyles = __esm({
+ "src/diagrams/architecture/architectureStyles.ts"() {
+ "use strict";
+ getStyles18 = /* @__PURE__ */ __name((options3) => `
+ .edge {
+ stroke-width: ${options3.archEdgeWidth};
+ stroke: ${options3.archEdgeColor};
+ fill: none;
+ }
+
+ .arrow {
+ fill: ${options3.archEdgeArrowColor};
+ }
+
+ .node-bkg {
+ fill: none;
+ stroke: ${options3.archGroupBorderColor};
+ stroke-width: ${options3.archGroupBorderWidth};
+ stroke-dasharray: 8;
+ }
+ .node-icon-text {
+ display: flex;
+ align-items: center;
+ }
+
+ .node-icon-text > div {
+ color: #fff;
+ margin: 1px;
+ height: fit-content;
+ text-align: center;
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ }
+`, "getStyles");
+ architectureStyles_default = getStyles18;
+ }
+ });
+
+ // ../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js
+ var require_layout_base2 = __commonJS({
+ "../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js"(exports2, module2) {
+ "use strict";
+ (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) {
+ if (typeof exports2 === "object" && typeof module2 === "object")
+ module2.exports = factory();
+ else if (typeof define === "function" && define.amd)
+ define([], factory);
+ else if (typeof exports2 === "object")
+ exports2["layoutBase"] = factory();
+ else
+ root4["layoutBase"] = factory();
+ }, "webpackUniversalModuleDefinition"))(exports2, function() {
+ return (
+ /******/
+ function(modules2) {
+ var installedModules = {};
+ function __webpack_require__(moduleId) {
+ if (installedModules[moduleId]) {
+ return installedModules[moduleId].exports;
+ }
+ var module3 = installedModules[moduleId] = {
+ /******/
+ i: moduleId,
+ /******/
+ l: false,
+ /******/
+ exports: {}
+ /******/
};
- module3.exports = Point3;
+ modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
+ module3.l = true;
+ return module3.exports;
+ }
+ __name(__webpack_require__, "__webpack_require__");
+ __webpack_require__.m = modules2;
+ __webpack_require__.c = installedModules;
+ __webpack_require__.i = function(value2) {
+ return value2;
+ };
+ __webpack_require__.d = function(exports3, name, getter) {
+ if (!__webpack_require__.o(exports3, name)) {
+ Object.defineProperty(exports3, name, {
+ /******/
+ configurable: false,
+ /******/
+ enumerable: true,
+ /******/
+ get: getter
+ /******/
+ });
+ }
+ };
+ __webpack_require__.n = function(module3) {
+ var getter = module3 && module3.__esModule ? (
+ /******/
+ /* @__PURE__ */ __name(function getDefault() {
+ return module3["default"];
+ }, "getDefault")
+ ) : (
+ /******/
+ /* @__PURE__ */ __name(function getModuleExports() {
+ return module3;
+ }, "getModuleExports")
+ );
+ __webpack_require__.d(getter, "a", getter);
+ return getter;
+ };
+ __webpack_require__.o = function(object3, property2) {
+ return Object.prototype.hasOwnProperty.call(object3, property2);
+ };
+ __webpack_require__.p = "";
+ return __webpack_require__(__webpack_require__.s = 28);
+ }([
+ /* 0 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function LayoutConstants() {
+ }
+ __name(LayoutConstants, "LayoutConstants");
+ LayoutConstants.QUALITY = 1;
+ LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED = false;
+ LayoutConstants.DEFAULT_INCREMENTAL = false;
+ LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT = true;
+ LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT = false;
+ LayoutConstants.DEFAULT_ANIMATION_PERIOD = 50;
+ LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = false;
+ LayoutConstants.DEFAULT_GRAPH_MARGIN = 15;
+ LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = false;
+ LayoutConstants.SIMPLE_NODE_SIZE = 40;
+ LayoutConstants.SIMPLE_NODE_HALF_SIZE = LayoutConstants.SIMPLE_NODE_SIZE / 2;
+ LayoutConstants.EMPTY_COMPOUND_NODE_SIZE = 40;
+ LayoutConstants.MIN_EDGE_LENGTH = 1;
+ LayoutConstants.WORLD_BOUNDARY = 1e6;
+ LayoutConstants.INITIAL_WORLD_BOUNDARY = LayoutConstants.WORLD_BOUNDARY / 1e3;
+ LayoutConstants.WORLD_CENTER_X = 1200;
+ LayoutConstants.WORLD_CENTER_Y = 900;
+ module3.exports = LayoutConstants;
},
- /* 13 */
+ /* 1 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function RectangleD(x5, y5, width3, height2) {
- this.x = 0;
- this.y = 0;
- this.width = 0;
- this.height = 0;
- if (x5 != null && y5 != null && width3 != null && height2 != null) {
- this.x = x5;
- this.y = y5;
- this.width = width3;
- this.height = height2;
- }
+ var LGraphObject = __webpack_require__(2);
+ var IGeometry = __webpack_require__(8);
+ var IMath = __webpack_require__(9);
+ function LEdge(source, target, vEdge) {
+ LGraphObject.call(this, vEdge);
+ this.isOverlapingSourceAndTarget = false;
+ this.vGraphObject = vEdge;
+ this.bendpoints = [];
+ this.source = source;
+ this.target = target;
}
- __name(RectangleD, "RectangleD");
- RectangleD.prototype.getX = function() {
- return this.x;
+ __name(LEdge, "LEdge");
+ LEdge.prototype = Object.create(LGraphObject.prototype);
+ for (var prop in LGraphObject) {
+ LEdge[prop] = LGraphObject[prop];
+ }
+ LEdge.prototype.getSource = function() {
+ return this.source;
};
- RectangleD.prototype.setX = function(x5) {
- this.x = x5;
+ LEdge.prototype.getTarget = function() {
+ return this.target;
};
- RectangleD.prototype.getY = function() {
- return this.y;
+ LEdge.prototype.isInterGraph = function() {
+ return this.isInterGraph;
};
- RectangleD.prototype.setY = function(y5) {
- this.y = y5;
+ LEdge.prototype.getLength = function() {
+ return this.length;
};
- RectangleD.prototype.getWidth = function() {
- return this.width;
+ LEdge.prototype.isOverlapingSourceAndTarget = function() {
+ return this.isOverlapingSourceAndTarget;
};
- RectangleD.prototype.setWidth = function(width3) {
- this.width = width3;
+ LEdge.prototype.getBendpoints = function() {
+ return this.bendpoints;
};
- RectangleD.prototype.getHeight = function() {
- return this.height;
+ LEdge.prototype.getLca = function() {
+ return this.lca;
};
- RectangleD.prototype.setHeight = function(height2) {
- this.height = height2;
+ LEdge.prototype.getSourceInLca = function() {
+ return this.sourceInLca;
};
- RectangleD.prototype.getRight = function() {
- return this.x + this.width;
+ LEdge.prototype.getTargetInLca = function() {
+ return this.targetInLca;
};
- RectangleD.prototype.getBottom = function() {
- return this.y + this.height;
+ LEdge.prototype.getOtherEnd = function(node2) {
+ if (this.source === node2) {
+ return this.target;
+ } else if (this.target === node2) {
+ return this.source;
+ } else {
+ throw "Node is not incident with this edge";
+ }
};
- RectangleD.prototype.intersects = function(a2) {
- if (this.getRight() < a2.x) {
- return false;
+ LEdge.prototype.getOtherEndInGraph = function(node2, graph) {
+ var otherEnd = this.getOtherEnd(node2);
+ var root4 = graph.getGraphManager().getRoot();
+ while (true) {
+ if (otherEnd.getOwner() == graph) {
+ return otherEnd;
+ }
+ if (otherEnd.getOwner() == root4) {
+ break;
+ }
+ otherEnd = otherEnd.getOwner().getParent();
}
- if (this.getBottom() < a2.y) {
- return false;
+ return null;
+ };
+ LEdge.prototype.updateLength = function() {
+ var clipPointCoordinates = new Array(4);
+ this.isOverlapingSourceAndTarget = IGeometry.getIntersection(this.target.getRect(), this.source.getRect(), clipPointCoordinates);
+ if (!this.isOverlapingSourceAndTarget) {
+ this.lengthX = clipPointCoordinates[0] - clipPointCoordinates[2];
+ this.lengthY = clipPointCoordinates[1] - clipPointCoordinates[3];
+ if (Math.abs(this.lengthX) < 1) {
+ this.lengthX = IMath.sign(this.lengthX);
+ }
+ if (Math.abs(this.lengthY) < 1) {
+ this.lengthY = IMath.sign(this.lengthY);
+ }
+ this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
}
- if (a2.getRight() < this.x) {
- return false;
+ };
+ LEdge.prototype.updateLengthSimple = function() {
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX();
+ this.lengthY = this.target.getCenterY() - this.source.getCenterY();
+ if (Math.abs(this.lengthX) < 1) {
+ this.lengthX = IMath.sign(this.lengthX);
}
- if (a2.getBottom() < this.y) {
- return false;
+ if (Math.abs(this.lengthY) < 1) {
+ this.lengthY = IMath.sign(this.lengthY);
}
- return true;
- };
- RectangleD.prototype.getCenterX = function() {
- return this.x + this.width / 2;
- };
- RectangleD.prototype.getMinX = function() {
- return this.getX();
- };
- RectangleD.prototype.getMaxX = function() {
- return this.getX() + this.width;
- };
- RectangleD.prototype.getCenterY = function() {
- return this.y + this.height / 2;
- };
- RectangleD.prototype.getMinY = function() {
- return this.getY();
- };
- RectangleD.prototype.getMaxY = function() {
- return this.getY() + this.height;
- };
- RectangleD.prototype.getWidthHalf = function() {
- return this.width / 2;
- };
- RectangleD.prototype.getHeightHalf = function() {
- return this.height / 2;
+ this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
};
- module3.exports = RectangleD;
+ module3.exports = LEdge;
},
- /* 14 */
+ /* 2 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
- return typeof obj;
- } : function(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- function UniqueIDGeneretor() {
+ function LGraphObject(vGraphObject) {
+ this.vGraphObject = vGraphObject;
}
- __name(UniqueIDGeneretor, "UniqueIDGeneretor");
- UniqueIDGeneretor.lastID = 0;
- UniqueIDGeneretor.createID = function(obj) {
- if (UniqueIDGeneretor.isPrimitive(obj)) {
- return obj;
- }
- if (obj.uniqueID != null) {
- return obj.uniqueID;
- }
- obj.uniqueID = UniqueIDGeneretor.getString();
- UniqueIDGeneretor.lastID++;
- return obj.uniqueID;
- };
- UniqueIDGeneretor.getString = function(id27) {
- if (id27 == null) id27 = UniqueIDGeneretor.lastID;
- return "Object#" + id27;
- };
- UniqueIDGeneretor.isPrimitive = function(arg) {
- var type3 = typeof arg === "undefined" ? "undefined" : _typeof2(arg);
- return arg == null || type3 != "object" && type3 != "function";
- };
- module3.exports = UniqueIDGeneretor;
+ __name(LGraphObject, "LGraphObject");
+ module3.exports = LGraphObject;
},
- /* 15 */
+ /* 3 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function _toConsumableArray(arr) {
- if (Array.isArray(arr)) {
- for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- } else {
- return Array.from(arr);
- }
- }
- __name(_toConsumableArray, "_toConsumableArray");
+ var LGraphObject = __webpack_require__(2);
+ var Integer = __webpack_require__(10);
+ var RectangleD = __webpack_require__(13);
var LayoutConstants = __webpack_require__(0);
- var LGraphManager = __webpack_require__(7);
- var LNode = __webpack_require__(3);
- var LEdge = __webpack_require__(1);
- var LGraph = __webpack_require__(6);
+ var RandomSeed = __webpack_require__(16);
var PointD = __webpack_require__(5);
- var Transform2 = __webpack_require__(17);
- var Emitter3 = __webpack_require__(29);
- function Layout2(isRemoteUse) {
- Emitter3.call(this);
- this.layoutQuality = LayoutConstants.QUALITY;
- this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
- this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;
- this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;
- this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;
- this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;
- this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;
- this.edgeToDummyNodes = /* @__PURE__ */ new Map();
- this.graphManager = new LGraphManager(this);
- this.isLayoutFinished = false;
- this.isSubLayout = false;
- this.isRemoteUse = false;
- if (isRemoteUse != null) {
- this.isRemoteUse = isRemoteUse;
+ function LNode(gm, loc, size5, vNode) {
+ if (size5 == null && vNode == null) {
+ vNode = loc;
}
+ LGraphObject.call(this, vNode);
+ if (gm.graphManager != null) gm = gm.graphManager;
+ this.estimatedSize = Integer.MIN_VALUE;
+ this.inclusionTreeDepth = Integer.MAX_VALUE;
+ this.vGraphObject = vNode;
+ this.edges = [];
+ this.graphManager = gm;
+ if (size5 != null && loc != null) this.rect = new RectangleD(loc.x, loc.y, size5.width, size5.height);
+ else this.rect = new RectangleD();
}
- __name(Layout2, "Layout");
- Layout2.RANDOM_SEED = 1;
- Layout2.prototype = Object.create(Emitter3.prototype);
- Layout2.prototype.getGraphManager = function() {
- return this.graphManager;
+ __name(LNode, "LNode");
+ LNode.prototype = Object.create(LGraphObject.prototype);
+ for (var prop in LGraphObject) {
+ LNode[prop] = LGraphObject[prop];
+ }
+ LNode.prototype.getEdges = function() {
+ return this.edges;
};
- Layout2.prototype.getAllNodes = function() {
- return this.graphManager.getAllNodes();
+ LNode.prototype.getChild = function() {
+ return this.child;
};
- Layout2.prototype.getAllEdges = function() {
- return this.graphManager.getAllEdges();
+ LNode.prototype.getOwner = function() {
+ return this.owner;
};
- Layout2.prototype.getAllNodesToApplyGravitation = function() {
- return this.graphManager.getAllNodesToApplyGravitation();
+ LNode.prototype.getWidth = function() {
+ return this.rect.width;
};
- Layout2.prototype.newGraphManager = function() {
- var gm = new LGraphManager(this);
- this.graphManager = gm;
- return gm;
+ LNode.prototype.setWidth = function(width3) {
+ this.rect.width = width3;
};
- Layout2.prototype.newGraph = function(vGraph) {
- return new LGraph(null, this.graphManager, vGraph);
+ LNode.prototype.getHeight = function() {
+ return this.rect.height;
};
- Layout2.prototype.newNode = function(vNode) {
- return new LNode(this.graphManager, vNode);
+ LNode.prototype.setHeight = function(height2) {
+ this.rect.height = height2;
};
- Layout2.prototype.newEdge = function(vEdge) {
- return new LEdge(null, null, vEdge);
+ LNode.prototype.getCenterX = function() {
+ return this.rect.x + this.rect.width / 2;
};
- Layout2.prototype.checkLayoutSuccess = function() {
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
+ LNode.prototype.getCenterY = function() {
+ return this.rect.y + this.rect.height / 2;
};
- Layout2.prototype.runLayout = function() {
- this.isLayoutFinished = false;
- if (this.tilingPreLayout) {
- this.tilingPreLayout();
- }
- this.initParameters();
- var isLayoutSuccessfull;
- if (this.checkLayoutSuccess()) {
- isLayoutSuccessfull = false;
- } else {
- isLayoutSuccessfull = this.layout();
- }
- if (LayoutConstants.ANIMATE === "during") {
- return false;
- }
- if (isLayoutSuccessfull) {
- if (!this.isSubLayout) {
- this.doPostLayout();
- }
- }
- if (this.tilingPostLayout) {
- this.tilingPostLayout();
- }
- this.isLayoutFinished = true;
- return isLayoutSuccessfull;
+ LNode.prototype.getCenter = function() {
+ return new PointD(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
};
- Layout2.prototype.doPostLayout = function() {
- if (!this.incremental) {
- this.transform();
- }
- this.update();
+ LNode.prototype.getLocation = function() {
+ return new PointD(this.rect.x, this.rect.y);
};
- Layout2.prototype.update2 = function() {
- if (this.createBendsAsNeeded) {
- this.createBendpointsFromDummyNodes();
- this.graphManager.resetAllEdges();
- }
- if (!this.isRemoteUse) {
- var edge;
- var allEdges = this.graphManager.getAllEdges();
- for (var i2 = 0; i2 < allEdges.length; i2++) {
- edge = allEdges[i2];
- }
- var node2;
- var nodes6 = this.graphManager.getRoot().getNodes();
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- node2 = nodes6[i2];
- }
- this.update(this.graphManager.getRoot());
- }
+ LNode.prototype.getRect = function() {
+ return this.rect;
};
- Layout2.prototype.update = function(obj) {
- if (obj == null) {
- this.update2();
- } else if (obj instanceof LNode) {
- var node2 = obj;
- if (node2.getChild() != null) {
- var nodes6 = node2.getChild().getNodes();
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- update(nodes6[i2]);
- }
- }
- if (node2.vGraphObject != null) {
- var vNode = node2.vGraphObject;
- vNode.update(node2);
- }
- } else if (obj instanceof LEdge) {
- var edge = obj;
- if (edge.vGraphObject != null) {
- var vEdge = edge.vGraphObject;
- vEdge.update(edge);
- }
- } else if (obj instanceof LGraph) {
- var graph = obj;
- if (graph.vGraphObject != null) {
- var vGraph = graph.vGraphObject;
- vGraph.update(graph);
- }
- }
+ LNode.prototype.getDiagonal = function() {
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
};
- Layout2.prototype.initParameters = function() {
- if (!this.isSubLayout) {
- this.layoutQuality = LayoutConstants.QUALITY;
- this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;
- this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;
- this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;
- this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;
- this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
- this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;
- }
- if (this.animationDuringLayout) {
- this.animationOnLayout = false;
- }
+ LNode.prototype.getHalfTheDiagonal = function() {
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
};
- Layout2.prototype.transform = function(newLeftTop) {
- if (newLeftTop == void 0) {
- this.transform(new PointD(0, 0));
- } else {
- var trans = new Transform2();
- var leftTop = this.graphManager.getRoot().updateLeftTop();
- if (leftTop != null) {
- trans.setWorldOrgX(newLeftTop.x);
- trans.setWorldOrgY(newLeftTop.y);
- trans.setDeviceOrgX(leftTop.x);
- trans.setDeviceOrgY(leftTop.y);
- var nodes6 = this.getAllNodes();
- var node2;
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- node2 = nodes6[i2];
- node2.transform(trans);
+ LNode.prototype.setRect = function(upperLeft, dimension) {
+ this.rect.x = upperLeft.x;
+ this.rect.y = upperLeft.y;
+ this.rect.width = dimension.width;
+ this.rect.height = dimension.height;
+ };
+ LNode.prototype.setCenter = function(cx, cy) {
+ this.rect.x = cx - this.rect.width / 2;
+ this.rect.y = cy - this.rect.height / 2;
+ };
+ LNode.prototype.setLocation = function(x5, y5) {
+ this.rect.x = x5;
+ this.rect.y = y5;
+ };
+ LNode.prototype.moveBy = function(dx, dy) {
+ this.rect.x += dx;
+ this.rect.y += dy;
+ };
+ LNode.prototype.getEdgeListToNode = function(to) {
+ var edgeList2 = [];
+ var edge;
+ var self2 = this;
+ self2.edges.forEach(function(edge2) {
+ if (edge2.target == to) {
+ if (edge2.source != self2) throw "Incorrect edge source!";
+ edgeList2.push(edge2);
+ }
+ });
+ return edgeList2;
+ };
+ LNode.prototype.getEdgesBetween = function(other2) {
+ var edgeList2 = [];
+ var edge;
+ var self2 = this;
+ self2.edges.forEach(function(edge2) {
+ if (!(edge2.source == self2 || edge2.target == self2)) throw "Incorrect edge source and/or target";
+ if (edge2.target == other2 || edge2.source == other2) {
+ edgeList2.push(edge2);
+ }
+ });
+ return edgeList2;
+ };
+ LNode.prototype.getNeighborsList = function() {
+ var neighbors = /* @__PURE__ */ new Set();
+ var self2 = this;
+ self2.edges.forEach(function(edge) {
+ if (edge.source == self2) {
+ neighbors.add(edge.target);
+ } else {
+ if (edge.target != self2) {
+ throw "Incorrect incidency!";
}
+ neighbors.add(edge.source);
}
- }
+ });
+ return neighbors;
};
- Layout2.prototype.positionNodesRandomly = function(graph) {
- if (graph == void 0) {
- this.positionNodesRandomly(this.getGraphManager().getRoot());
- this.getGraphManager().getRoot().updateBounds(true);
- } else {
- var lNode;
- var childGraph;
- var nodes6 = graph.getNodes();
+ LNode.prototype.withChildren = function() {
+ var withNeighborsList = /* @__PURE__ */ new Set();
+ var childNode;
+ var children2;
+ withNeighborsList.add(this);
+ if (this.child != null) {
+ var nodes6 = this.child.getNodes();
for (var i2 = 0; i2 < nodes6.length; i2++) {
- lNode = nodes6[i2];
- childGraph = lNode.getChild();
- if (childGraph == null) {
- lNode.scatter();
- } else if (childGraph.getNodes().length == 0) {
- lNode.scatter();
- } else {
- this.positionNodesRandomly(childGraph);
- lNode.updateBounds();
- }
+ childNode = nodes6[i2];
+ children2 = childNode.withChildren();
+ children2.forEach(function(node2) {
+ withNeighborsList.add(node2);
+ });
}
}
+ return withNeighborsList;
};
- Layout2.prototype.getFlatForest = function() {
- var flatForest = [];
- var isForest = true;
- var allNodes = this.graphManager.getRoot().getNodes();
- var isFlat = true;
- for (var i2 = 0; i2 < allNodes.length; i2++) {
- if (allNodes[i2].getChild() != null) {
- isFlat = false;
+ LNode.prototype.getNoOfChildren = function() {
+ var noOfChildren = 0;
+ var childNode;
+ if (this.child == null) {
+ noOfChildren = 1;
+ } else {
+ var nodes6 = this.child.getNodes();
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ childNode = nodes6[i2];
+ noOfChildren += childNode.getNoOfChildren();
}
}
- if (!isFlat) {
- return flatForest;
- }
- var visited = /* @__PURE__ */ new Set();
- var toBeVisited = [];
- var parents4 = /* @__PURE__ */ new Map();
- var unProcessedNodes = [];
- unProcessedNodes = unProcessedNodes.concat(allNodes);
- while (unProcessedNodes.length > 0 && isForest) {
- toBeVisited.push(unProcessedNodes[0]);
- while (toBeVisited.length > 0 && isForest) {
- var currentNode = toBeVisited[0];
- toBeVisited.splice(0, 1);
- visited.add(currentNode);
- var neighborEdges = currentNode.getEdges();
- for (var i2 = 0; i2 < neighborEdges.length; i2++) {
- var currentNeighbor = neighborEdges[i2].getOtherEnd(currentNode);
- if (parents4.get(currentNode) != currentNeighbor) {
- if (!visited.has(currentNeighbor)) {
- toBeVisited.push(currentNeighbor);
- parents4.set(currentNeighbor, currentNode);
- } else {
- isForest = false;
- break;
- }
- }
- }
- }
- if (!isForest) {
- flatForest = [];
- } else {
- var temp = [].concat(_toConsumableArray(visited));
- flatForest.push(temp);
- for (var i2 = 0; i2 < temp.length; i2++) {
- var value2 = temp[i2];
- var index = unProcessedNodes.indexOf(value2);
- if (index > -1) {
- unProcessedNodes.splice(index, 1);
- }
- }
- visited = /* @__PURE__ */ new Set();
- parents4 = /* @__PURE__ */ new Map();
- }
+ if (noOfChildren == 0) {
+ noOfChildren = 1;
}
- return flatForest;
+ return noOfChildren;
};
- Layout2.prototype.createDummyNodesForBendpoints = function(edge) {
- var dummyNodes = [];
- var prev2 = edge.source;
- var graph = this.graphManager.calcLowestCommonAncestor(edge.source, edge.target);
- for (var i2 = 0; i2 < edge.bendpoints.length; i2++) {
- var dummyNode = this.newNode(null);
- dummyNode.setRect(new Point(0, 0), new Dimension(1, 1));
- graph.add(dummyNode);
- var dummyEdge = this.newEdge(null);
- this.graphManager.add(dummyEdge, prev2, dummyNode);
- dummyNodes.add(dummyNode);
- prev2 = dummyNode;
+ LNode.prototype.getEstimatedSize = function() {
+ if (this.estimatedSize == Integer.MIN_VALUE) {
+ throw "assert failed";
}
- var dummyEdge = this.newEdge(null);
- this.graphManager.add(dummyEdge, prev2, edge.target);
- this.edgeToDummyNodes.set(edge, dummyNodes);
- if (edge.isInterGraph()) {
- this.graphManager.remove(edge);
+ return this.estimatedSize;
+ };
+ LNode.prototype.calcEstimatedSize = function() {
+ if (this.child == null) {
+ return this.estimatedSize = (this.rect.width + this.rect.height) / 2;
} else {
- graph.remove(edge);
+ this.estimatedSize = this.child.calcEstimatedSize();
+ this.rect.width = this.estimatedSize;
+ this.rect.height = this.estimatedSize;
+ return this.estimatedSize;
}
- return dummyNodes;
};
- Layout2.prototype.createBendpointsFromDummyNodes = function() {
- var edges5 = [];
- edges5 = edges5.concat(this.graphManager.getAllEdges());
- edges5 = [].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges5);
- for (var k2 = 0; k2 < edges5.length; k2++) {
- var lEdge = edges5[k2];
- if (lEdge.bendpoints.length > 0) {
- var path4 = this.edgeToDummyNodes.get(lEdge);
- for (var i2 = 0; i2 < path4.length; i2++) {
- var dummyNode = path4[i2];
- var p3 = new PointD(dummyNode.getCenterX(), dummyNode.getCenterY());
- var ebp = lEdge.bendpoints.get(i2);
- ebp.x = p3.x;
- ebp.y = p3.y;
- dummyNode.getOwner().remove(dummyNode);
+ LNode.prototype.scatter = function() {
+ var randomCenterX;
+ var randomCenterY;
+ var minX = -LayoutConstants.INITIAL_WORLD_BOUNDARY;
+ var maxX = LayoutConstants.INITIAL_WORLD_BOUNDARY;
+ randomCenterX = LayoutConstants.WORLD_CENTER_X + RandomSeed.nextDouble() * (maxX - minX) + minX;
+ var minY = -LayoutConstants.INITIAL_WORLD_BOUNDARY;
+ var maxY = LayoutConstants.INITIAL_WORLD_BOUNDARY;
+ randomCenterY = LayoutConstants.WORLD_CENTER_Y + RandomSeed.nextDouble() * (maxY - minY) + minY;
+ this.rect.x = randomCenterX;
+ this.rect.y = randomCenterY;
+ };
+ LNode.prototype.updateBounds = function() {
+ if (this.getChild() == null) {
+ throw "assert failed";
+ }
+ if (this.getChild().getNodes().length != 0) {
+ var childGraph = this.getChild();
+ childGraph.updateBounds(true);
+ this.rect.x = childGraph.getLeft();
+ this.rect.y = childGraph.getTop();
+ this.setWidth(childGraph.getRight() - childGraph.getLeft());
+ this.setHeight(childGraph.getBottom() - childGraph.getTop());
+ if (LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {
+ var width3 = childGraph.getRight() - childGraph.getLeft();
+ var height2 = childGraph.getBottom() - childGraph.getTop();
+ if (this.labelWidth) {
+ if (this.labelPosHorizontal == "left") {
+ this.rect.x -= this.labelWidth;
+ this.setWidth(width3 + this.labelWidth);
+ } else if (this.labelPosHorizontal == "center" && this.labelWidth > width3) {
+ this.rect.x -= (this.labelWidth - width3) / 2;
+ this.setWidth(this.labelWidth);
+ } else if (this.labelPosHorizontal == "right") {
+ this.setWidth(width3 + this.labelWidth);
+ }
+ }
+ if (this.labelHeight) {
+ if (this.labelPosVertical == "top") {
+ this.rect.y -= this.labelHeight;
+ this.setHeight(height2 + this.labelHeight);
+ } else if (this.labelPosVertical == "center" && this.labelHeight > height2) {
+ this.rect.y -= (this.labelHeight - height2) / 2;
+ this.setHeight(this.labelHeight);
+ } else if (this.labelPosVertical == "bottom") {
+ this.setHeight(height2 + this.labelHeight);
+ }
}
- this.graphManager.add(lEdge, lEdge.source, lEdge.target);
}
}
};
- Layout2.transform = function(sliderValue, defaultValue, minDiv, maxMul) {
- if (minDiv != void 0 && maxMul != void 0) {
- var value2 = defaultValue;
- if (sliderValue <= 50) {
- var minValue = defaultValue / minDiv;
- value2 -= (defaultValue - minValue) / 50 * (50 - sliderValue);
- } else {
- var maxValue = defaultValue * maxMul;
- value2 += (maxValue - defaultValue) / 50 * (sliderValue - 50);
- }
- return value2;
- } else {
- var a2, b2;
- if (sliderValue <= 50) {
- a2 = 9 * defaultValue / 500;
- b2 = defaultValue / 10;
- } else {
- a2 = 9 * defaultValue / 50;
- b2 = -8 * defaultValue;
- }
- return a2 * sliderValue + b2;
+ LNode.prototype.getInclusionTreeDepth = function() {
+ if (this.inclusionTreeDepth == Integer.MAX_VALUE) {
+ throw "assert failed";
}
+ return this.inclusionTreeDepth;
};
- Layout2.findCenterOfTree = function(nodes6) {
- var list2 = [];
- list2 = list2.concat(nodes6);
- var removedNodes = [];
- var remainingDegrees = /* @__PURE__ */ new Map();
- var foundCenter = false;
- var centerNode = null;
- if (list2.length == 1 || list2.length == 2) {
- foundCenter = true;
- centerNode = list2[0];
- }
- for (var i2 = 0; i2 < list2.length; i2++) {
- var node2 = list2[i2];
- var degree = node2.getNeighborsList().size;
- remainingDegrees.set(node2, node2.getNeighborsList().size);
- if (degree == 1) {
- removedNodes.push(node2);
- }
+ LNode.prototype.transform = function(trans) {
+ var left3 = this.rect.x;
+ if (left3 > LayoutConstants.WORLD_BOUNDARY) {
+ left3 = LayoutConstants.WORLD_BOUNDARY;
+ } else if (left3 < -LayoutConstants.WORLD_BOUNDARY) {
+ left3 = -LayoutConstants.WORLD_BOUNDARY;
}
- var tempList = [];
- tempList = tempList.concat(removedNodes);
- while (!foundCenter) {
- var tempList2 = [];
- tempList2 = tempList2.concat(tempList);
- tempList = [];
- for (var i2 = 0; i2 < list2.length; i2++) {
- var node2 = list2[i2];
- var index = list2.indexOf(node2);
- if (index >= 0) {
- list2.splice(index, 1);
- }
- var neighbours = node2.getNeighborsList();
- neighbours.forEach(function(neighbour) {
- if (removedNodes.indexOf(neighbour) < 0) {
- var otherDegree = remainingDegrees.get(neighbour);
- var newDegree = otherDegree - 1;
- if (newDegree == 1) {
- tempList.push(neighbour);
- }
- remainingDegrees.set(neighbour, newDegree);
- }
- });
- }
- removedNodes = removedNodes.concat(tempList);
- if (list2.length == 1 || list2.length == 2) {
- foundCenter = true;
- centerNode = list2[0];
- }
+ var top2 = this.rect.y;
+ if (top2 > LayoutConstants.WORLD_BOUNDARY) {
+ top2 = LayoutConstants.WORLD_BOUNDARY;
+ } else if (top2 < -LayoutConstants.WORLD_BOUNDARY) {
+ top2 = -LayoutConstants.WORLD_BOUNDARY;
}
- return centerNode;
+ var leftTop = new PointD(left3, top2);
+ var vLeftTop = trans.inverseTransformPoint(leftTop);
+ this.setLocation(vLeftTop.x, vLeftTop.y);
};
- Layout2.prototype.setGraphManager = function(gm) {
- this.graphManager = gm;
+ LNode.prototype.getLeft = function() {
+ return this.rect.x;
};
- module3.exports = Layout2;
+ LNode.prototype.getRight = function() {
+ return this.rect.x + this.rect.width;
+ };
+ LNode.prototype.getTop = function() {
+ return this.rect.y;
+ };
+ LNode.prototype.getBottom = function() {
+ return this.rect.y + this.rect.height;
+ };
+ LNode.prototype.getParent = function() {
+ if (this.owner == null) {
+ return null;
+ }
+ return this.owner.getParent();
+ };
+ module3.exports = LNode;
},
- /* 16 */
+ /* 4 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function RandomSeed() {
+ var LayoutConstants = __webpack_require__(0);
+ function FDLayoutConstants() {
}
- __name(RandomSeed, "RandomSeed");
- RandomSeed.seed = 1;
- RandomSeed.x = 0;
- RandomSeed.nextDouble = function() {
- RandomSeed.x = Math.sin(RandomSeed.seed++) * 1e4;
- return RandomSeed.x - Math.floor(RandomSeed.x);
- };
- module3.exports = RandomSeed;
+ __name(FDLayoutConstants, "FDLayoutConstants");
+ for (var prop in LayoutConstants) {
+ FDLayoutConstants[prop] = LayoutConstants[prop];
+ }
+ FDLayoutConstants.MAX_ITERATIONS = 2500;
+ FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50;
+ FDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45;
+ FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500;
+ FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4;
+ FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1;
+ FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8;
+ FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5;
+ FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true;
+ FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true;
+ FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3;
+ FDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33;
+ FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1e3;
+ FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5e3;
+ FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100;
+ FDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3;
+ FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10;
+ FDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100;
+ FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1;
+ FDLayoutConstants.MIN_EDGE_LENGTH = 1;
+ FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10;
+ module3.exports = FDLayoutConstants;
},
- /* 17 */
+ /* 5 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- var PointD = __webpack_require__(5);
- function Transform2(x5, y5) {
- this.lworldOrgX = 0;
- this.lworldOrgY = 0;
- this.ldeviceOrgX = 0;
- this.ldeviceOrgY = 0;
- this.lworldExtX = 1;
- this.lworldExtY = 1;
- this.ldeviceExtX = 1;
- this.ldeviceExtY = 1;
+ function PointD(x5, y5) {
+ if (x5 == null && y5 == null) {
+ this.x = 0;
+ this.y = 0;
+ } else {
+ this.x = x5;
+ this.y = y5;
+ }
}
- __name(Transform2, "Transform");
- Transform2.prototype.getWorldOrgX = function() {
- return this.lworldOrgX;
- };
- Transform2.prototype.setWorldOrgX = function(wox) {
- this.lworldOrgX = wox;
- };
- Transform2.prototype.getWorldOrgY = function() {
- return this.lworldOrgY;
- };
- Transform2.prototype.setWorldOrgY = function(woy) {
- this.lworldOrgY = woy;
- };
- Transform2.prototype.getWorldExtX = function() {
- return this.lworldExtX;
- };
- Transform2.prototype.setWorldExtX = function(wex) {
- this.lworldExtX = wex;
+ __name(PointD, "PointD");
+ PointD.prototype.getX = function() {
+ return this.x;
};
- Transform2.prototype.getWorldExtY = function() {
- return this.lworldExtY;
+ PointD.prototype.getY = function() {
+ return this.y;
};
- Transform2.prototype.setWorldExtY = function(wey) {
- this.lworldExtY = wey;
+ PointD.prototype.setX = function(x5) {
+ this.x = x5;
};
- Transform2.prototype.getDeviceOrgX = function() {
- return this.ldeviceOrgX;
+ PointD.prototype.setY = function(y5) {
+ this.y = y5;
};
- Transform2.prototype.setDeviceOrgX = function(dox) {
- this.ldeviceOrgX = dox;
+ PointD.prototype.getDifference = function(pt) {
+ return new DimensionD(this.x - pt.x, this.y - pt.y);
};
- Transform2.prototype.getDeviceOrgY = function() {
- return this.ldeviceOrgY;
+ PointD.prototype.getCopy = function() {
+ return new PointD(this.x, this.y);
};
- Transform2.prototype.setDeviceOrgY = function(doy) {
- this.ldeviceOrgY = doy;
+ PointD.prototype.translate = function(dim) {
+ this.x += dim.width;
+ this.y += dim.height;
+ return this;
};
- Transform2.prototype.getDeviceExtX = function() {
- return this.ldeviceExtX;
+ module3.exports = PointD;
+ },
+ /* 6 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var LGraphObject = __webpack_require__(2);
+ var Integer = __webpack_require__(10);
+ var LayoutConstants = __webpack_require__(0);
+ var LGraphManager = __webpack_require__(7);
+ var LNode = __webpack_require__(3);
+ var LEdge = __webpack_require__(1);
+ var RectangleD = __webpack_require__(13);
+ var Point3 = __webpack_require__(12);
+ var LinkedList = __webpack_require__(11);
+ function LGraph(parent4, obj2, vGraph) {
+ LGraphObject.call(this, vGraph);
+ this.estimatedSize = Integer.MIN_VALUE;
+ this.margin = LayoutConstants.DEFAULT_GRAPH_MARGIN;
+ this.edges = [];
+ this.nodes = [];
+ this.isConnected = false;
+ this.parent = parent4;
+ if (obj2 != null && obj2 instanceof LGraphManager) {
+ this.graphManager = obj2;
+ } else if (obj2 != null && obj2 instanceof Layout) {
+ this.graphManager = obj2.graphManager;
+ }
+ }
+ __name(LGraph, "LGraph");
+ LGraph.prototype = Object.create(LGraphObject.prototype);
+ for (var prop in LGraphObject) {
+ LGraph[prop] = LGraphObject[prop];
+ }
+ LGraph.prototype.getNodes = function() {
+ return this.nodes;
};
- Transform2.prototype.setDeviceExtX = function(dex) {
- this.ldeviceExtX = dex;
+ LGraph.prototype.getEdges = function() {
+ return this.edges;
};
- Transform2.prototype.getDeviceExtY = function() {
- return this.ldeviceExtY;
+ LGraph.prototype.getGraphManager = function() {
+ return this.graphManager;
};
- Transform2.prototype.setDeviceExtY = function(dey) {
- this.ldeviceExtY = dey;
+ LGraph.prototype.getParent = function() {
+ return this.parent;
};
- Transform2.prototype.transformX = function(x5) {
- var xDevice = 0;
- var worldExtX = this.lworldExtX;
- if (worldExtX != 0) {
- xDevice = this.ldeviceOrgX + (x5 - this.lworldOrgX) * this.ldeviceExtX / worldExtX;
- }
- return xDevice;
+ LGraph.prototype.getLeft = function() {
+ return this.left;
};
- Transform2.prototype.transformY = function(y5) {
- var yDevice = 0;
- var worldExtY = this.lworldExtY;
- if (worldExtY != 0) {
- yDevice = this.ldeviceOrgY + (y5 - this.lworldOrgY) * this.ldeviceExtY / worldExtY;
- }
- return yDevice;
+ LGraph.prototype.getRight = function() {
+ return this.right;
};
- Transform2.prototype.inverseTransformX = function(x5) {
- var xWorld = 0;
- var deviceExtX = this.ldeviceExtX;
- if (deviceExtX != 0) {
- xWorld = this.lworldOrgX + (x5 - this.ldeviceOrgX) * this.lworldExtX / deviceExtX;
- }
- return xWorld;
+ LGraph.prototype.getTop = function() {
+ return this.top;
};
- Transform2.prototype.inverseTransformY = function(y5) {
- var yWorld = 0;
- var deviceExtY = this.ldeviceExtY;
- if (deviceExtY != 0) {
- yWorld = this.lworldOrgY + (y5 - this.ldeviceOrgY) * this.lworldExtY / deviceExtY;
- }
- return yWorld;
+ LGraph.prototype.getBottom = function() {
+ return this.bottom;
};
- Transform2.prototype.inverseTransformPoint = function(inPoint) {
- var outPoint = new PointD(this.inverseTransformX(inPoint.x), this.inverseTransformY(inPoint.y));
- return outPoint;
+ LGraph.prototype.isConnected = function() {
+ return this.isConnected;
};
- module3.exports = Transform2;
- },
- /* 18 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- function _toConsumableArray(arr) {
- if (Array.isArray(arr)) {
- for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
- arr2[i2] = arr[i2];
+ LGraph.prototype.add = function(obj1, sourceNode, targetNode) {
+ if (sourceNode == null && targetNode == null) {
+ var newNode = obj1;
+ if (this.graphManager == null) {
+ throw "Graph has no graph mgr!";
}
- return arr2;
+ if (this.getNodes().indexOf(newNode) > -1) {
+ throw "Node already in graph!";
+ }
+ newNode.owner = this;
+ this.getNodes().push(newNode);
+ return newNode;
} else {
- return Array.from(arr);
+ var newEdge = obj1;
+ if (!(this.getNodes().indexOf(sourceNode) > -1 && this.getNodes().indexOf(targetNode) > -1)) {
+ throw "Source or target not in graph!";
+ }
+ if (!(sourceNode.owner == targetNode.owner && sourceNode.owner == this)) {
+ throw "Both owners must be this graph!";
+ }
+ if (sourceNode.owner != targetNode.owner) {
+ return null;
+ }
+ newEdge.source = sourceNode;
+ newEdge.target = targetNode;
+ newEdge.isInterGraph = false;
+ this.getEdges().push(newEdge);
+ sourceNode.edges.push(newEdge);
+ if (targetNode != sourceNode) {
+ targetNode.edges.push(newEdge);
+ }
+ return newEdge;
}
- }
- __name(_toConsumableArray, "_toConsumableArray");
- var Layout2 = __webpack_require__(15);
- var FDLayoutConstants = __webpack_require__(4);
- var LayoutConstants = __webpack_require__(0);
- var IGeometry = __webpack_require__(8);
- var IMath = __webpack_require__(9);
- function FDLayout() {
- Layout2.call(this);
- this.useSmartIdealEdgeLengthCalculation = FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;
- this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;
- this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;
- this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;
- this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;
- this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100;
- this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
- this.initialCoolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
- this.totalDisplacement = 0;
- this.oldTotalDisplacement = 0;
- this.maxIterations = FDLayoutConstants.MAX_ITERATIONS;
- }
- __name(FDLayout, "FDLayout");
- FDLayout.prototype = Object.create(Layout2.prototype);
- for (var prop in Layout2) {
- FDLayout[prop] = Layout2[prop];
- }
- FDLayout.prototype.initParameters = function() {
- Layout2.prototype.initParameters.call(this, arguments);
- this.totalIterations = 0;
- this.notAnimatedIterations = 0;
- this.useFRGridVariant = FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION;
- this.grid = [];
};
- FDLayout.prototype.calcIdealEdgeLengths = function() {
- var edge;
- var originalIdealLength;
- var lcaDepth;
- var source;
- var target;
- var sizeOfSourceInLca;
- var sizeOfTargetInLca;
- var allEdges = this.getGraphManager().getAllEdges();
- for (var i2 = 0; i2 < allEdges.length; i2++) {
- edge = allEdges[i2];
- originalIdealLength = edge.idealLength;
- if (edge.isInterGraph) {
- source = edge.getSource();
- target = edge.getTarget();
- sizeOfSourceInLca = edge.getSourceInLca().getEstimatedSize();
- sizeOfTargetInLca = edge.getTargetInLca().getEstimatedSize();
- if (this.useSmartIdealEdgeLengthCalculation) {
- edge.idealLength += sizeOfSourceInLca + sizeOfTargetInLca - 2 * LayoutConstants.SIMPLE_NODE_SIZE;
+ LGraph.prototype.remove = function(obj) {
+ var node2 = obj;
+ if (obj instanceof LNode) {
+ if (node2 == null) {
+ throw "Node is null!";
+ }
+ if (!(node2.owner != null && node2.owner == this)) {
+ throw "Owner graph is invalid!";
+ }
+ if (this.graphManager == null) {
+ throw "Owner graph manager is invalid!";
+ }
+ var edgesToBeRemoved = node2.edges.slice();
+ var edge;
+ var s2 = edgesToBeRemoved.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ edge = edgesToBeRemoved[i2];
+ if (edge.isInterGraph) {
+ this.graphManager.remove(edge);
+ } else {
+ edge.source.owner.remove(edge);
}
- lcaDepth = edge.getLca().getInclusionTreeDepth();
- edge.idealLength += originalIdealLength * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth);
}
+ var index = this.nodes.indexOf(node2);
+ if (index == -1) {
+ throw "Node not in owner node list!";
+ }
+ this.nodes.splice(index, 1);
+ } else if (obj instanceof LEdge) {
+ var edge = obj;
+ if (edge == null) {
+ throw "Edge is null!";
+ }
+ if (!(edge.source != null && edge.target != null)) {
+ throw "Source and/or target is null!";
+ }
+ if (!(edge.source.owner != null && edge.target.owner != null && edge.source.owner == this && edge.target.owner == this)) {
+ throw "Source and/or target owner is invalid!";
+ }
+ var sourceIndex = edge.source.edges.indexOf(edge);
+ var targetIndex = edge.target.edges.indexOf(edge);
+ if (!(sourceIndex > -1 && targetIndex > -1)) {
+ throw "Source and/or target doesn't know this edge!";
+ }
+ edge.source.edges.splice(sourceIndex, 1);
+ if (edge.target != edge.source) {
+ edge.target.edges.splice(targetIndex, 1);
+ }
+ var index = edge.source.owner.getEdges().indexOf(edge);
+ if (index == -1) {
+ throw "Not in owner's edge list!";
+ }
+ edge.source.owner.getEdges().splice(index, 1);
}
};
- FDLayout.prototype.initSpringEmbedder = function() {
- var s2 = this.getAllNodes().length;
- if (this.incremental) {
- if (s2 > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {
- this.coolingFactor = Math.max(this.coolingFactor * FDLayoutConstants.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s2 - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));
+ LGraph.prototype.updateLeftTop = function() {
+ var top2 = Integer.MAX_VALUE;
+ var left3 = Integer.MAX_VALUE;
+ var nodeTop;
+ var nodeLeft;
+ var margin;
+ var nodes6 = this.getNodes();
+ var s2 = nodes6.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ var lNode = nodes6[i2];
+ nodeTop = lNode.getTop();
+ nodeLeft = lNode.getLeft();
+ if (top2 > nodeTop) {
+ top2 = nodeTop;
}
- this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL;
- } else {
- if (s2 > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {
- this.coolingFactor = Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR, 1 - (s2 - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));
- } else {
- this.coolingFactor = 1;
+ if (left3 > nodeLeft) {
+ left3 = nodeLeft;
}
- this.initialCoolingFactor = this.coolingFactor;
- this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT;
}
- this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations);
- this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100;
- this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length;
- this.repulsionRange = this.calcRepulsionRange();
- };
- FDLayout.prototype.calcSpringForces = function() {
- var lEdges = this.getAllEdges();
- var edge;
- for (var i2 = 0; i2 < lEdges.length; i2++) {
- edge = lEdges[i2];
- this.calcSpringForce(edge, edge.idealLength);
+ if (top2 == Integer.MAX_VALUE) {
+ return null;
+ }
+ if (nodes6[0].getParent().paddingLeft != void 0) {
+ margin = nodes6[0].getParent().paddingLeft;
+ } else {
+ margin = this.margin;
}
+ this.left = left3 - margin;
+ this.top = top2 - margin;
+ return new Point3(this.left, this.top);
};
- FDLayout.prototype.calcRepulsionForces = function() {
- var gridUpdateAllowed = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
- var forceToNodeSurroundingUpdate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var i2, j2;
- var nodeA, nodeB;
- var lNodes = this.getAllNodes();
- var processedNodeSet;
- if (this.useFRGridVariant) {
- if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed) {
- this.updateGrid();
+ LGraph.prototype.updateBounds = function(recursive) {
+ var left3 = Integer.MAX_VALUE;
+ var right3 = -Integer.MAX_VALUE;
+ var top2 = Integer.MAX_VALUE;
+ var bottom2 = -Integer.MAX_VALUE;
+ var nodeLeft;
+ var nodeRight;
+ var nodeTop;
+ var nodeBottom;
+ var margin;
+ var nodes6 = this.nodes;
+ var s2 = nodes6.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ var lNode = nodes6[i2];
+ if (recursive && lNode.child != null) {
+ lNode.updateBounds();
}
- processedNodeSet = /* @__PURE__ */ new Set();
- for (i2 = 0; i2 < lNodes.length; i2++) {
- nodeA = lNodes[i2];
- this.calculateRepulsionForceOfANode(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate);
- processedNodeSet.add(nodeA);
+ nodeLeft = lNode.getLeft();
+ nodeRight = lNode.getRight();
+ nodeTop = lNode.getTop();
+ nodeBottom = lNode.getBottom();
+ if (left3 > nodeLeft) {
+ left3 = nodeLeft;
}
- } else {
- for (i2 = 0; i2 < lNodes.length; i2++) {
- nodeA = lNodes[i2];
- for (j2 = i2 + 1; j2 < lNodes.length; j2++) {
- nodeB = lNodes[j2];
- if (nodeA.getOwner() != nodeB.getOwner()) {
- continue;
- }
- this.calcRepulsionForce(nodeA, nodeB);
- }
+ if (right3 < nodeRight) {
+ right3 = nodeRight;
+ }
+ if (top2 > nodeTop) {
+ top2 = nodeTop;
+ }
+ if (bottom2 < nodeBottom) {
+ bottom2 = nodeBottom;
}
}
- };
- FDLayout.prototype.calcGravitationalForces = function() {
- var node2;
- var lNodes = this.getAllNodesToApplyGravitation();
- for (var i2 = 0; i2 < lNodes.length; i2++) {
- node2 = lNodes[i2];
- this.calcGravitationalForce(node2);
- }
- };
- FDLayout.prototype.moveNodes = function() {
- var lNodes = this.getAllNodes();
- var node2;
- for (var i2 = 0; i2 < lNodes.length; i2++) {
- node2 = lNodes[i2];
- node2.move();
+ var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2);
+ if (left3 == Integer.MAX_VALUE) {
+ this.left = this.parent.getLeft();
+ this.right = this.parent.getRight();
+ this.top = this.parent.getTop();
+ this.bottom = this.parent.getBottom();
}
- };
- FDLayout.prototype.calcSpringForce = function(edge, idealLength) {
- var sourceNode = edge.getSource();
- var targetNode = edge.getTarget();
- var length2;
- var springForce;
- var springForceX;
- var springForceY;
- if (this.uniformLeafNodeSizes && sourceNode.getChild() == null && targetNode.getChild() == null) {
- edge.updateLengthSimple();
+ if (nodes6[0].getParent().paddingLeft != void 0) {
+ margin = nodes6[0].getParent().paddingLeft;
} else {
- edge.updateLength();
- if (edge.isOverlapingSourceAndTarget) {
- return;
- }
+ margin = this.margin;
}
- length2 = edge.getLength();
- if (length2 == 0) return;
- springForce = edge.edgeElasticity * (length2 - idealLength);
- springForceX = springForce * (edge.lengthX / length2);
- springForceY = springForce * (edge.lengthY / length2);
- sourceNode.springForceX += springForceX;
- sourceNode.springForceY += springForceY;
- targetNode.springForceX -= springForceX;
- targetNode.springForceY -= springForceY;
+ this.left = boundingRect.x - margin;
+ this.right = boundingRect.x + boundingRect.width + margin;
+ this.top = boundingRect.y - margin;
+ this.bottom = boundingRect.y + boundingRect.height + margin;
};
- FDLayout.prototype.calcRepulsionForce = function(nodeA, nodeB) {
- var rectA = nodeA.getRect();
- var rectB = nodeB.getRect();
- var overlapAmount = new Array(2);
- var clipPoints = new Array(4);
- var distanceX;
- var distanceY;
- var distanceSquared;
- var distance2;
- var repulsionForce;
- var repulsionForceX;
- var repulsionForceY;
- if (rectA.intersects(rectB)) {
- IGeometry.calcSeparationAmount(rectA, rectB, overlapAmount, FDLayoutConstants.DEFAULT_EDGE_LENGTH / 2);
- repulsionForceX = 2 * overlapAmount[0];
- repulsionForceY = 2 * overlapAmount[1];
- var childrenConstant = nodeA.noOfChildren * nodeB.noOfChildren / (nodeA.noOfChildren + nodeB.noOfChildren);
- nodeA.repulsionForceX -= childrenConstant * repulsionForceX;
- nodeA.repulsionForceY -= childrenConstant * repulsionForceY;
- nodeB.repulsionForceX += childrenConstant * repulsionForceX;
- nodeB.repulsionForceY += childrenConstant * repulsionForceY;
- } else {
- if (this.uniformLeafNodeSizes && nodeA.getChild() == null && nodeB.getChild() == null) {
- distanceX = rectB.getCenterX() - rectA.getCenterX();
- distanceY = rectB.getCenterY() - rectA.getCenterY();
- } else {
- IGeometry.getIntersection(rectA, rectB, clipPoints);
- distanceX = clipPoints[2] - clipPoints[0];
- distanceY = clipPoints[3] - clipPoints[1];
+ LGraph.calculateBounds = function(nodes6) {
+ var left3 = Integer.MAX_VALUE;
+ var right3 = -Integer.MAX_VALUE;
+ var top2 = Integer.MAX_VALUE;
+ var bottom2 = -Integer.MAX_VALUE;
+ var nodeLeft;
+ var nodeRight;
+ var nodeTop;
+ var nodeBottom;
+ var s2 = nodes6.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ var lNode = nodes6[i2];
+ nodeLeft = lNode.getLeft();
+ nodeRight = lNode.getRight();
+ nodeTop = lNode.getTop();
+ nodeBottom = lNode.getBottom();
+ if (left3 > nodeLeft) {
+ left3 = nodeLeft;
}
- if (Math.abs(distanceX) < FDLayoutConstants.MIN_REPULSION_DIST) {
- distanceX = IMath.sign(distanceX) * FDLayoutConstants.MIN_REPULSION_DIST;
+ if (right3 < nodeRight) {
+ right3 = nodeRight;
}
- if (Math.abs(distanceY) < FDLayoutConstants.MIN_REPULSION_DIST) {
- distanceY = IMath.sign(distanceY) * FDLayoutConstants.MIN_REPULSION_DIST;
+ if (top2 > nodeTop) {
+ top2 = nodeTop;
+ }
+ if (bottom2 < nodeBottom) {
+ bottom2 = nodeBottom;
}
- distanceSquared = distanceX * distanceX + distanceY * distanceY;
- distance2 = Math.sqrt(distanceSquared);
- repulsionForce = (nodeA.nodeRepulsion / 2 + nodeB.nodeRepulsion / 2) * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared;
- repulsionForceX = repulsionForce * distanceX / distance2;
- repulsionForceY = repulsionForce * distanceY / distance2;
- nodeA.repulsionForceX -= repulsionForceX;
- nodeA.repulsionForceY -= repulsionForceY;
- nodeB.repulsionForceX += repulsionForceX;
- nodeB.repulsionForceY += repulsionForceY;
}
+ var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2);
+ return boundingRect;
};
- FDLayout.prototype.calcGravitationalForce = function(node2) {
- var ownerGraph;
- var ownerCenterX;
- var ownerCenterY;
- var distanceX;
- var distanceY;
- var absDistanceX;
- var absDistanceY;
- var estimatedSize;
- ownerGraph = node2.getOwner();
- ownerCenterX = (ownerGraph.getRight() + ownerGraph.getLeft()) / 2;
- ownerCenterY = (ownerGraph.getTop() + ownerGraph.getBottom()) / 2;
- distanceX = node2.getCenterX() - ownerCenterX;
- distanceY = node2.getCenterY() - ownerCenterY;
- absDistanceX = Math.abs(distanceX) + node2.getWidth() / 2;
- absDistanceY = Math.abs(distanceY) + node2.getHeight() / 2;
- if (node2.getOwner() == this.graphManager.getRoot()) {
- estimatedSize = ownerGraph.getEstimatedSize() * this.gravityRangeFactor;
- if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {
- node2.gravitationForceX = -this.gravityConstant * distanceX;
- node2.gravitationForceY = -this.gravityConstant * distanceY;
- }
+ LGraph.prototype.getInclusionTreeDepth = function() {
+ if (this == this.graphManager.getRoot()) {
+ return 1;
} else {
- estimatedSize = ownerGraph.getEstimatedSize() * this.compoundGravityRangeFactor;
- if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {
- node2.gravitationForceX = -this.gravityConstant * distanceX * this.compoundGravityConstant;
- node2.gravitationForceY = -this.gravityConstant * distanceY * this.compoundGravityConstant;
- }
+ return this.parent.getInclusionTreeDepth();
}
};
- FDLayout.prototype.isConverged = function() {
- var converged;
- var oscilating = false;
- if (this.totalIterations > this.maxIterations / 3) {
- oscilating = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2;
+ LGraph.prototype.getEstimatedSize = function() {
+ if (this.estimatedSize == Integer.MIN_VALUE) {
+ throw "assert failed";
}
- converged = this.totalDisplacement < this.totalDisplacementThreshold;
- this.oldTotalDisplacement = this.totalDisplacement;
- return converged || oscilating;
+ return this.estimatedSize;
};
- FDLayout.prototype.animate = function() {
- if (this.animationDuringLayout && !this.isSubLayout) {
- if (this.notAnimatedIterations == this.animationPeriod) {
- this.update();
- this.notAnimatedIterations = 0;
- } else {
- this.notAnimatedIterations++;
- }
+ LGraph.prototype.calcEstimatedSize = function() {
+ var size5 = 0;
+ var nodes6 = this.nodes;
+ var s2 = nodes6.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ var lNode = nodes6[i2];
+ size5 += lNode.calcEstimatedSize();
}
- };
- FDLayout.prototype.calcNoOfChildrenForAllNodes = function() {
- var node2;
- var allNodes = this.graphManager.getAllNodes();
- for (var i2 = 0; i2 < allNodes.length; i2++) {
- node2 = allNodes[i2];
- node2.noOfChildren = node2.getNoOfChildren();
+ if (size5 == 0) {
+ this.estimatedSize = LayoutConstants.EMPTY_COMPOUND_NODE_SIZE;
+ } else {
+ this.estimatedSize = size5 / Math.sqrt(this.nodes.length);
}
+ return this.estimatedSize;
};
- FDLayout.prototype.calcGrid = function(graph) {
- var sizeX = 0;
- var sizeY = 0;
- sizeX = parseInt(Math.ceil((graph.getRight() - graph.getLeft()) / this.repulsionRange));
- sizeY = parseInt(Math.ceil((graph.getBottom() - graph.getTop()) / this.repulsionRange));
- var grid = new Array(sizeX);
- for (var i2 = 0; i2 < sizeX; i2++) {
- grid[i2] = new Array(sizeY);
- }
- for (var i2 = 0; i2 < sizeX; i2++) {
- for (var j2 = 0; j2 < sizeY; j2++) {
- grid[i2][j2] = new Array();
- }
+ LGraph.prototype.updateConnected = function() {
+ var self2 = this;
+ if (this.nodes.length == 0) {
+ this.isConnected = true;
+ return;
}
- return grid;
- };
- FDLayout.prototype.addNodeToGrid = function(v3, left3, top2) {
- var startX2 = 0;
- var finishX = 0;
- var startY2 = 0;
- var finishY = 0;
- startX2 = parseInt(Math.floor((v3.getRect().x - left3) / this.repulsionRange));
- finishX = parseInt(Math.floor((v3.getRect().width + v3.getRect().x - left3) / this.repulsionRange));
- startY2 = parseInt(Math.floor((v3.getRect().y - top2) / this.repulsionRange));
- finishY = parseInt(Math.floor((v3.getRect().height + v3.getRect().y - top2) / this.repulsionRange));
- for (var i2 = startX2; i2 <= finishX; i2++) {
- for (var j2 = startY2; j2 <= finishY; j2++) {
- this.grid[i2][j2].push(v3);
- v3.setGridCoordinates(startX2, finishX, startY2, finishY);
+ var queue = new LinkedList();
+ var visited = /* @__PURE__ */ new Set();
+ var currentNode = this.nodes[0];
+ var neighborEdges;
+ var currentNeighbor;
+ var childrenOfNode = currentNode.withChildren();
+ childrenOfNode.forEach(function(node2) {
+ queue.push(node2);
+ visited.add(node2);
+ });
+ while (queue.length !== 0) {
+ currentNode = queue.shift();
+ neighborEdges = currentNode.getEdges();
+ var size5 = neighborEdges.length;
+ for (var i2 = 0; i2 < size5; i2++) {
+ var neighborEdge = neighborEdges[i2];
+ currentNeighbor = neighborEdge.getOtherEndInGraph(currentNode, this);
+ if (currentNeighbor != null && !visited.has(currentNeighbor)) {
+ var childrenOfNeighbor = currentNeighbor.withChildren();
+ childrenOfNeighbor.forEach(function(node2) {
+ queue.push(node2);
+ visited.add(node2);
+ });
+ }
}
}
- };
- FDLayout.prototype.updateGrid = function() {
- var i2;
- var nodeA;
- var lNodes = this.getAllNodes();
- this.grid = this.calcGrid(this.graphManager.getRoot());
- for (i2 = 0; i2 < lNodes.length; i2++) {
- nodeA = lNodes[i2];
- this.addNodeToGrid(nodeA, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
- }
- };
- FDLayout.prototype.calculateRepulsionForceOfANode = function(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate) {
- if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed || forceToNodeSurroundingUpdate) {
- var surrounding = /* @__PURE__ */ new Set();
- nodeA.surrounding = new Array();
- var nodeB;
- var grid = this.grid;
- for (var i2 = nodeA.startX - 1; i2 < nodeA.finishX + 2; i2++) {
- for (var j2 = nodeA.startY - 1; j2 < nodeA.finishY + 2; j2++) {
- if (!(i2 < 0 || j2 < 0 || i2 >= grid.length || j2 >= grid[0].length)) {
- for (var k2 = 0; k2 < grid[i2][j2].length; k2++) {
- nodeB = grid[i2][j2][k2];
- if (nodeA.getOwner() != nodeB.getOwner() || nodeA == nodeB) {
- continue;
- }
- if (!processedNodeSet.has(nodeB) && !surrounding.has(nodeB)) {
- var distanceX = Math.abs(nodeA.getCenterX() - nodeB.getCenterX()) - (nodeA.getWidth() / 2 + nodeB.getWidth() / 2);
- var distanceY = Math.abs(nodeA.getCenterY() - nodeB.getCenterY()) - (nodeA.getHeight() / 2 + nodeB.getHeight() / 2);
- if (distanceX <= this.repulsionRange && distanceY <= this.repulsionRange) {
- surrounding.add(nodeB);
- }
- }
- }
- }
+ this.isConnected = false;
+ if (visited.size >= this.nodes.length) {
+ var noOfVisitedInThisGraph = 0;
+ visited.forEach(function(visitedNode) {
+ if (visitedNode.owner == self2) {
+ noOfVisitedInThisGraph++;
}
+ });
+ if (noOfVisitedInThisGraph == this.nodes.length) {
+ this.isConnected = true;
}
- nodeA.surrounding = [].concat(_toConsumableArray(surrounding));
}
- for (i2 = 0; i2 < nodeA.surrounding.length; i2++) {
- this.calcRepulsionForce(nodeA, nodeA.surrounding[i2]);
- }
- };
- FDLayout.prototype.calcRepulsionRange = function() {
- return 0;
};
- module3.exports = FDLayout;
+ module3.exports = LGraph;
},
- /* 19 */
+ /* 7 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
+ var LGraph;
var LEdge = __webpack_require__(1);
- var FDLayoutConstants = __webpack_require__(4);
- function FDLayoutEdge(source, target, vEdge) {
- LEdge.call(this, source, target, vEdge);
- this.idealLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
- this.edgeElasticity = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;
- }
- __name(FDLayoutEdge, "FDLayoutEdge");
- FDLayoutEdge.prototype = Object.create(LEdge.prototype);
- for (var prop in LEdge) {
- FDLayoutEdge[prop] = LEdge[prop];
- }
- module3.exports = FDLayoutEdge;
- },
- /* 20 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var LNode = __webpack_require__(3);
- var FDLayoutConstants = __webpack_require__(4);
- function FDLayoutNode(gm, loc, size5, vNode) {
- LNode.call(this, gm, loc, size5, vNode);
- this.nodeRepulsion = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;
- this.springForceX = 0;
- this.springForceY = 0;
- this.repulsionForceX = 0;
- this.repulsionForceY = 0;
- this.gravitationForceX = 0;
- this.gravitationForceY = 0;
- this.displacementX = 0;
- this.displacementY = 0;
- this.startX = 0;
- this.finishX = 0;
- this.startY = 0;
- this.finishY = 0;
- this.surrounding = [];
- }
- __name(FDLayoutNode, "FDLayoutNode");
- FDLayoutNode.prototype = Object.create(LNode.prototype);
- for (var prop in LNode) {
- FDLayoutNode[prop] = LNode[prop];
+ function LGraphManager(layout6) {
+ LGraph = __webpack_require__(6);
+ this.layout = layout6;
+ this.graphs = [];
+ this.edges = [];
}
- FDLayoutNode.prototype.setGridCoordinates = function(_startX, _finishX, _startY, _finishY) {
- this.startX = _startX;
- this.finishX = _finishX;
- this.startY = _startY;
- this.finishY = _finishY;
+ __name(LGraphManager, "LGraphManager");
+ LGraphManager.prototype.addRoot = function() {
+ var ngraph = this.layout.newGraph();
+ var nnode = this.layout.newNode(null);
+ var root4 = this.add(ngraph, nnode);
+ this.setRootGraph(root4);
+ return this.rootGraph;
};
- module3.exports = FDLayoutNode;
- },
- /* 21 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- function DimensionD2(width3, height2) {
- this.width = 0;
- this.height = 0;
- if (width3 !== null && height2 !== null) {
- this.height = height2;
- this.width = width3;
+ LGraphManager.prototype.add = function(newGraph, parentNode, newEdge, sourceNode, targetNode) {
+ if (newEdge == null && sourceNode == null && targetNode == null) {
+ if (newGraph == null) {
+ throw "Graph is null!";
+ }
+ if (parentNode == null) {
+ throw "Parent node is null!";
+ }
+ if (this.graphs.indexOf(newGraph) > -1) {
+ throw "Graph already in this graph mgr!";
+ }
+ this.graphs.push(newGraph);
+ if (newGraph.parent != null) {
+ throw "Already has a parent!";
+ }
+ if (parentNode.child != null) {
+ throw "Already has a child!";
+ }
+ newGraph.parent = parentNode;
+ parentNode.child = newGraph;
+ return newGraph;
+ } else {
+ targetNode = newEdge;
+ sourceNode = parentNode;
+ newEdge = newGraph;
+ var sourceGraph = sourceNode.getOwner();
+ var targetGraph = targetNode.getOwner();
+ if (!(sourceGraph != null && sourceGraph.getGraphManager() == this)) {
+ throw "Source not in this graph mgr!";
+ }
+ if (!(targetGraph != null && targetGraph.getGraphManager() == this)) {
+ throw "Target not in this graph mgr!";
+ }
+ if (sourceGraph == targetGraph) {
+ newEdge.isInterGraph = false;
+ return sourceGraph.add(newEdge, sourceNode, targetNode);
+ } else {
+ newEdge.isInterGraph = true;
+ newEdge.source = sourceNode;
+ newEdge.target = targetNode;
+ if (this.edges.indexOf(newEdge) > -1) {
+ throw "Edge already in inter-graph edge list!";
+ }
+ this.edges.push(newEdge);
+ if (!(newEdge.source != null && newEdge.target != null)) {
+ throw "Edge source and/or target is null!";
+ }
+ if (!(newEdge.source.edges.indexOf(newEdge) == -1 && newEdge.target.edges.indexOf(newEdge) == -1)) {
+ throw "Edge already in source and/or target incidency list!";
+ }
+ newEdge.source.edges.push(newEdge);
+ newEdge.target.edges.push(newEdge);
+ return newEdge;
+ }
}
- }
- __name(DimensionD2, "DimensionD");
- DimensionD2.prototype.getWidth = function() {
- return this.width;
};
- DimensionD2.prototype.setWidth = function(width3) {
- this.width = width3;
+ LGraphManager.prototype.remove = function(lObj) {
+ if (lObj instanceof LGraph) {
+ var graph = lObj;
+ if (graph.getGraphManager() != this) {
+ throw "Graph not in this graph mgr";
+ }
+ if (!(graph == this.rootGraph || graph.parent != null && graph.parent.graphManager == this)) {
+ throw "Invalid parent node!";
+ }
+ var edgesToBeRemoved = [];
+ edgesToBeRemoved = edgesToBeRemoved.concat(graph.getEdges());
+ var edge;
+ var s2 = edgesToBeRemoved.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ edge = edgesToBeRemoved[i2];
+ graph.remove(edge);
+ }
+ var nodesToBeRemoved = [];
+ nodesToBeRemoved = nodesToBeRemoved.concat(graph.getNodes());
+ var node2;
+ s2 = nodesToBeRemoved.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ node2 = nodesToBeRemoved[i2];
+ graph.remove(node2);
+ }
+ if (graph == this.rootGraph) {
+ this.setRootGraph(null);
+ }
+ var index = this.graphs.indexOf(graph);
+ this.graphs.splice(index, 1);
+ graph.parent = null;
+ } else if (lObj instanceof LEdge) {
+ edge = lObj;
+ if (edge == null) {
+ throw "Edge is null!";
+ }
+ if (!edge.isInterGraph) {
+ throw "Not an inter-graph edge!";
+ }
+ if (!(edge.source != null && edge.target != null)) {
+ throw "Source and/or target is null!";
+ }
+ if (!(edge.source.edges.indexOf(edge) != -1 && edge.target.edges.indexOf(edge) != -1)) {
+ throw "Source and/or target doesn't know this edge!";
+ }
+ var index = edge.source.edges.indexOf(edge);
+ edge.source.edges.splice(index, 1);
+ index = edge.target.edges.indexOf(edge);
+ edge.target.edges.splice(index, 1);
+ if (!(edge.source.owner != null && edge.source.owner.getGraphManager() != null)) {
+ throw "Edge owner graph or owner graph manager is null!";
+ }
+ if (edge.source.owner.getGraphManager().edges.indexOf(edge) == -1) {
+ throw "Not in owner graph manager's edge list!";
+ }
+ var index = edge.source.owner.getGraphManager().edges.indexOf(edge);
+ edge.source.owner.getGraphManager().edges.splice(index, 1);
+ }
};
- DimensionD2.prototype.getHeight = function() {
- return this.height;
+ LGraphManager.prototype.updateBounds = function() {
+ this.rootGraph.updateBounds(true);
};
- DimensionD2.prototype.setHeight = function(height2) {
- this.height = height2;
+ LGraphManager.prototype.getGraphs = function() {
+ return this.graphs;
};
- module3.exports = DimensionD2;
- },
- /* 22 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var UniqueIDGeneretor = __webpack_require__(14);
- function HashMap() {
- this.map = {};
- this.keys = [];
- }
- __name(HashMap, "HashMap");
- HashMap.prototype.put = function(key, value2) {
- var theId = UniqueIDGeneretor.createID(key);
- if (!this.contains(theId)) {
- this.map[theId] = value2;
- this.keys.push(key);
+ LGraphManager.prototype.getAllNodes = function() {
+ if (this.allNodes == null) {
+ var nodeList = [];
+ var graphs = this.getGraphs();
+ var s2 = graphs.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ nodeList = nodeList.concat(graphs[i2].getNodes());
+ }
+ this.allNodes = nodeList;
}
+ return this.allNodes;
};
- HashMap.prototype.contains = function(key) {
- var theId = UniqueIDGeneretor.createID(key);
- return this.map[key] != null;
+ LGraphManager.prototype.resetAllNodes = function() {
+ this.allNodes = null;
};
- HashMap.prototype.get = function(key) {
- var theId = UniqueIDGeneretor.createID(key);
- return this.map[theId];
+ LGraphManager.prototype.resetAllEdges = function() {
+ this.allEdges = null;
};
- HashMap.prototype.keySet = function() {
- return this.keys;
+ LGraphManager.prototype.resetAllNodesToApplyGravitation = function() {
+ this.allNodesToApplyGravitation = null;
};
- module3.exports = HashMap;
- },
- /* 23 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var UniqueIDGeneretor = __webpack_require__(14);
- function HashSet() {
- this.set = {};
- }
- __name(HashSet, "HashSet");
- ;
- HashSet.prototype.add = function(obj) {
- var theId = UniqueIDGeneretor.createID(obj);
- if (!this.contains(theId)) this.set[theId] = obj;
+ LGraphManager.prototype.getAllEdges = function() {
+ if (this.allEdges == null) {
+ var edgeList2 = [];
+ var graphs = this.getGraphs();
+ var s2 = graphs.length;
+ for (var i2 = 0; i2 < graphs.length; i2++) {
+ edgeList2 = edgeList2.concat(graphs[i2].getEdges());
+ }
+ edgeList2 = edgeList2.concat(this.edges);
+ this.allEdges = edgeList2;
+ }
+ return this.allEdges;
};
- HashSet.prototype.remove = function(obj) {
- delete this.set[UniqueIDGeneretor.createID(obj)];
+ LGraphManager.prototype.getAllNodesToApplyGravitation = function() {
+ return this.allNodesToApplyGravitation;
};
- HashSet.prototype.clear = function() {
- this.set = {};
+ LGraphManager.prototype.setAllNodesToApplyGravitation = function(nodeList) {
+ if (this.allNodesToApplyGravitation != null) {
+ throw "assert failed";
+ }
+ this.allNodesToApplyGravitation = nodeList;
};
- HashSet.prototype.contains = function(obj) {
- return this.set[UniqueIDGeneretor.createID(obj)] == obj;
+ LGraphManager.prototype.getRoot = function() {
+ return this.rootGraph;
};
- HashSet.prototype.isEmpty = function() {
- return this.size() === 0;
+ LGraphManager.prototype.setRootGraph = function(graph) {
+ if (graph.getGraphManager() != this) {
+ throw "Root not in this graph mgr!";
+ }
+ this.rootGraph = graph;
+ if (graph.parent == null) {
+ graph.parent = this.layout.newNode("Root node");
+ }
};
- HashSet.prototype.size = function() {
- return Object.keys(this.set).length;
+ LGraphManager.prototype.getLayout = function() {
+ return this.layout;
};
- HashSet.prototype.addAllTo = function(list2) {
- var keys3 = Object.keys(this.set);
- var length2 = keys3.length;
- for (var i2 = 0; i2 < length2; i2++) {
- list2.push(this.set[keys3[i2]]);
+ LGraphManager.prototype.isOneAncestorOfOther = function(firstNode, secondNode) {
+ if (!(firstNode != null && secondNode != null)) {
+ throw "assert failed";
+ }
+ if (firstNode == secondNode) {
+ return true;
}
+ var ownerGraph = firstNode.getOwner();
+ var parentNode;
+ do {
+ parentNode = ownerGraph.getParent();
+ if (parentNode == null) {
+ break;
+ }
+ if (parentNode == secondNode) {
+ return true;
+ }
+ ownerGraph = parentNode.getOwner();
+ if (ownerGraph == null) {
+ break;
+ }
+ } while (true);
+ ownerGraph = secondNode.getOwner();
+ do {
+ parentNode = ownerGraph.getParent();
+ if (parentNode == null) {
+ break;
+ }
+ if (parentNode == firstNode) {
+ return true;
+ }
+ ownerGraph = parentNode.getOwner();
+ if (ownerGraph == null) {
+ break;
+ }
+ } while (true);
+ return false;
};
- HashSet.prototype.size = function() {
- return Object.keys(this.set).length;
+ LGraphManager.prototype.calcLowestCommonAncestors = function() {
+ var edge;
+ var sourceNode;
+ var targetNode;
+ var sourceAncestorGraph;
+ var targetAncestorGraph;
+ var edges3 = this.getAllEdges();
+ var s2 = edges3.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ edge = edges3[i2];
+ sourceNode = edge.source;
+ targetNode = edge.target;
+ edge.lca = null;
+ edge.sourceInLca = sourceNode;
+ edge.targetInLca = targetNode;
+ if (sourceNode == targetNode) {
+ edge.lca = sourceNode.getOwner();
+ continue;
+ }
+ sourceAncestorGraph = sourceNode.getOwner();
+ while (edge.lca == null) {
+ edge.targetInLca = targetNode;
+ targetAncestorGraph = targetNode.getOwner();
+ while (edge.lca == null) {
+ if (targetAncestorGraph == sourceAncestorGraph) {
+ edge.lca = targetAncestorGraph;
+ break;
+ }
+ if (targetAncestorGraph == this.rootGraph) {
+ break;
+ }
+ if (edge.lca != null) {
+ throw "assert failed";
+ }
+ edge.targetInLca = targetAncestorGraph.getParent();
+ targetAncestorGraph = edge.targetInLca.getOwner();
+ }
+ if (sourceAncestorGraph == this.rootGraph) {
+ break;
+ }
+ if (edge.lca == null) {
+ edge.sourceInLca = sourceAncestorGraph.getParent();
+ sourceAncestorGraph = edge.sourceInLca.getOwner();
+ }
+ }
+ if (edge.lca == null) {
+ throw "assert failed";
+ }
+ }
};
- HashSet.prototype.addAll = function(list2) {
- var s2 = list2.length;
+ LGraphManager.prototype.calcLowestCommonAncestor = function(firstNode, secondNode) {
+ if (firstNode == secondNode) {
+ return firstNode.getOwner();
+ }
+ var firstOwnerGraph = firstNode.getOwner();
+ do {
+ if (firstOwnerGraph == null) {
+ break;
+ }
+ var secondOwnerGraph = secondNode.getOwner();
+ do {
+ if (secondOwnerGraph == null) {
+ break;
+ }
+ if (secondOwnerGraph == firstOwnerGraph) {
+ return secondOwnerGraph;
+ }
+ secondOwnerGraph = secondOwnerGraph.getParent().getOwner();
+ } while (true);
+ firstOwnerGraph = firstOwnerGraph.getParent().getOwner();
+ } while (true);
+ return firstOwnerGraph;
+ };
+ LGraphManager.prototype.calcInclusionTreeDepths = function(graph, depth) {
+ if (graph == null && depth == null) {
+ graph = this.rootGraph;
+ depth = 1;
+ }
+ var node2;
+ var nodes6 = graph.getNodes();
+ var s2 = nodes6.length;
for (var i2 = 0; i2 < s2; i2++) {
- var v3 = list2[i2];
- this.add(v3);
+ node2 = nodes6[i2];
+ node2.inclusionTreeDepth = depth;
+ if (node2.child != null) {
+ this.calcInclusionTreeDepths(node2.child, depth + 1);
+ }
}
};
- module3.exports = HashSet;
+ LGraphManager.prototype.includesInvalidEdge = function() {
+ var edge;
+ var edgesToRemove = [];
+ var s2 = this.edges.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ edge = this.edges[i2];
+ if (this.isOneAncestorOfOther(edge.source, edge.target)) {
+ edgesToRemove.push(edge);
+ }
+ }
+ for (var i2 = 0; i2 < edgesToRemove.length; i2++) {
+ this.remove(edgesToRemove[i2]);
+ }
+ return false;
+ };
+ module3.exports = LGraphManager;
},
- /* 24 */
+ /* 8 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function Matrix() {
+ var Point3 = __webpack_require__(12);
+ function IGeometry() {
}
- __name(Matrix, "Matrix");
- Matrix.multMat = function(array1, array22) {
- var result = [];
- for (var i2 = 0; i2 < array1.length; i2++) {
- result[i2] = [];
- for (var j2 = 0; j2 < array22[0].length; j2++) {
- result[i2][j2] = 0;
- for (var k2 = 0; k2 < array1[0].length; k2++) {
- result[i2][j2] += array1[i2][k2] * array22[k2][j2];
- }
- }
+ __name(IGeometry, "IGeometry");
+ IGeometry.calcSeparationAmount = function(rectA, rectB, overlapAmount, separationBuffer) {
+ if (!rectA.intersects(rectB)) {
+ throw "assert failed";
}
- return result;
- };
- Matrix.transpose = function(array4) {
- var result = [];
- for (var i2 = 0; i2 < array4[0].length; i2++) {
- result[i2] = [];
- for (var j2 = 0; j2 < array4.length; j2++) {
- result[i2][j2] = array4[j2][i2];
- }
+ var directions = new Array(2);
+ this.decideDirectionsForOverlappingNodes(rectA, rectB, directions);
+ overlapAmount[0] = Math.min(rectA.getRight(), rectB.getRight()) - Math.max(rectA.x, rectB.x);
+ overlapAmount[1] = Math.min(rectA.getBottom(), rectB.getBottom()) - Math.max(rectA.y, rectB.y);
+ if (rectA.getX() <= rectB.getX() && rectA.getRight() >= rectB.getRight()) {
+ overlapAmount[0] += Math.min(rectB.getX() - rectA.getX(), rectA.getRight() - rectB.getRight());
+ } else if (rectB.getX() <= rectA.getX() && rectB.getRight() >= rectA.getRight()) {
+ overlapAmount[0] += Math.min(rectA.getX() - rectB.getX(), rectB.getRight() - rectA.getRight());
}
- return result;
- };
- Matrix.multCons = function(array4, constant3) {
- var result = [];
- for (var i2 = 0; i2 < array4.length; i2++) {
- result[i2] = array4[i2] * constant3;
+ if (rectA.getY() <= rectB.getY() && rectA.getBottom() >= rectB.getBottom()) {
+ overlapAmount[1] += Math.min(rectB.getY() - rectA.getY(), rectA.getBottom() - rectB.getBottom());
+ } else if (rectB.getY() <= rectA.getY() && rectB.getBottom() >= rectA.getBottom()) {
+ overlapAmount[1] += Math.min(rectA.getY() - rectB.getY(), rectB.getBottom() - rectA.getBottom());
}
- return result;
- };
- Matrix.minusOp = function(array1, array22) {
- var result = [];
- for (var i2 = 0; i2 < array1.length; i2++) {
- result[i2] = array1[i2] - array22[i2];
+ var slope = Math.abs((rectB.getCenterY() - rectA.getCenterY()) / (rectB.getCenterX() - rectA.getCenterX()));
+ if (rectB.getCenterY() === rectA.getCenterY() && rectB.getCenterX() === rectA.getCenterX()) {
+ slope = 1;
}
- return result;
+ var moveByY = slope * overlapAmount[0];
+ var moveByX = overlapAmount[1] / slope;
+ if (overlapAmount[0] < moveByX) {
+ moveByX = overlapAmount[0];
+ } else {
+ moveByY = overlapAmount[1];
+ }
+ overlapAmount[0] = -1 * directions[0] * (moveByX / 2 + separationBuffer);
+ overlapAmount[1] = -1 * directions[1] * (moveByY / 2 + separationBuffer);
};
- Matrix.dotProduct = function(array1, array22) {
- var product = 0;
- for (var i2 = 0; i2 < array1.length; i2++) {
- product += array1[i2] * array22[i2];
+ IGeometry.decideDirectionsForOverlappingNodes = function(rectA, rectB, directions) {
+ if (rectA.getCenterX() < rectB.getCenterX()) {
+ directions[0] = -1;
+ } else {
+ directions[0] = 1;
+ }
+ if (rectA.getCenterY() < rectB.getCenterY()) {
+ directions[1] = -1;
+ } else {
+ directions[1] = 1;
}
- return product;
};
- Matrix.mag = function(array4) {
- return Math.sqrt(this.dotProduct(array4, array4));
+ IGeometry.getIntersection2 = function(rectA, rectB, result) {
+ var p1x = rectA.getCenterX();
+ var p1y = rectA.getCenterY();
+ var p2x = rectB.getCenterX();
+ var p2y = rectB.getCenterY();
+ if (rectA.intersects(rectB)) {
+ result[0] = p1x;
+ result[1] = p1y;
+ result[2] = p2x;
+ result[3] = p2y;
+ return true;
+ }
+ var topLeftAx = rectA.getX();
+ var topLeftAy = rectA.getY();
+ var topRightAx = rectA.getRight();
+ var bottomLeftAx = rectA.getX();
+ var bottomLeftAy = rectA.getBottom();
+ var bottomRightAx = rectA.getRight();
+ var halfWidthA = rectA.getWidthHalf();
+ var halfHeightA = rectA.getHeightHalf();
+ var topLeftBx = rectB.getX();
+ var topLeftBy = rectB.getY();
+ var topRightBx = rectB.getRight();
+ var bottomLeftBx = rectB.getX();
+ var bottomLeftBy = rectB.getBottom();
+ var bottomRightBx = rectB.getRight();
+ var halfWidthB = rectB.getWidthHalf();
+ var halfHeightB = rectB.getHeightHalf();
+ var clipPointAFound = false;
+ var clipPointBFound = false;
+ if (p1x === p2x) {
+ if (p1y > p2y) {
+ result[0] = p1x;
+ result[1] = topLeftAy;
+ result[2] = p2x;
+ result[3] = bottomLeftBy;
+ return false;
+ } else if (p1y < p2y) {
+ result[0] = p1x;
+ result[1] = bottomLeftAy;
+ result[2] = p2x;
+ result[3] = topLeftBy;
+ return false;
+ } else {
+ }
+ } else if (p1y === p2y) {
+ if (p1x > p2x) {
+ result[0] = topLeftAx;
+ result[1] = p1y;
+ result[2] = topRightBx;
+ result[3] = p2y;
+ return false;
+ } else if (p1x < p2x) {
+ result[0] = topRightAx;
+ result[1] = p1y;
+ result[2] = topLeftBx;
+ result[3] = p2y;
+ return false;
+ } else {
+ }
+ } else {
+ var slopeA = rectA.height / rectA.width;
+ var slopeB = rectB.height / rectB.width;
+ var slopePrime = (p2y - p1y) / (p2x - p1x);
+ var cardinalDirectionA = void 0;
+ var cardinalDirectionB = void 0;
+ var tempPointAx = void 0;
+ var tempPointAy = void 0;
+ var tempPointBx = void 0;
+ var tempPointBy = void 0;
+ if (-slopeA === slopePrime) {
+ if (p1x > p2x) {
+ result[0] = bottomLeftAx;
+ result[1] = bottomLeftAy;
+ clipPointAFound = true;
+ } else {
+ result[0] = topRightAx;
+ result[1] = topLeftAy;
+ clipPointAFound = true;
+ }
+ } else if (slopeA === slopePrime) {
+ if (p1x > p2x) {
+ result[0] = topLeftAx;
+ result[1] = topLeftAy;
+ clipPointAFound = true;
+ } else {
+ result[0] = bottomRightAx;
+ result[1] = bottomLeftAy;
+ clipPointAFound = true;
+ }
+ }
+ if (-slopeB === slopePrime) {
+ if (p2x > p1x) {
+ result[2] = bottomLeftBx;
+ result[3] = bottomLeftBy;
+ clipPointBFound = true;
+ } else {
+ result[2] = topRightBx;
+ result[3] = topLeftBy;
+ clipPointBFound = true;
+ }
+ } else if (slopeB === slopePrime) {
+ if (p2x > p1x) {
+ result[2] = topLeftBx;
+ result[3] = topLeftBy;
+ clipPointBFound = true;
+ } else {
+ result[2] = bottomRightBx;
+ result[3] = bottomLeftBy;
+ clipPointBFound = true;
+ }
+ }
+ if (clipPointAFound && clipPointBFound) {
+ return false;
+ }
+ if (p1x > p2x) {
+ if (p1y > p2y) {
+ cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 4);
+ cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 2);
+ } else {
+ cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 3);
+ cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 1);
+ }
+ } else {
+ if (p1y > p2y) {
+ cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 1);
+ cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 3);
+ } else {
+ cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 2);
+ cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 4);
+ }
+ }
+ if (!clipPointAFound) {
+ switch (cardinalDirectionA) {
+ case 1:
+ tempPointAy = topLeftAy;
+ tempPointAx = p1x + -halfHeightA / slopePrime;
+ result[0] = tempPointAx;
+ result[1] = tempPointAy;
+ break;
+ case 2:
+ tempPointAx = bottomRightAx;
+ tempPointAy = p1y + halfWidthA * slopePrime;
+ result[0] = tempPointAx;
+ result[1] = tempPointAy;
+ break;
+ case 3:
+ tempPointAy = bottomLeftAy;
+ tempPointAx = p1x + halfHeightA / slopePrime;
+ result[0] = tempPointAx;
+ result[1] = tempPointAy;
+ break;
+ case 4:
+ tempPointAx = bottomLeftAx;
+ tempPointAy = p1y + -halfWidthA * slopePrime;
+ result[0] = tempPointAx;
+ result[1] = tempPointAy;
+ break;
+ }
+ }
+ if (!clipPointBFound) {
+ switch (cardinalDirectionB) {
+ case 1:
+ tempPointBy = topLeftBy;
+ tempPointBx = p2x + -halfHeightB / slopePrime;
+ result[2] = tempPointBx;
+ result[3] = tempPointBy;
+ break;
+ case 2:
+ tempPointBx = bottomRightBx;
+ tempPointBy = p2y + halfWidthB * slopePrime;
+ result[2] = tempPointBx;
+ result[3] = tempPointBy;
+ break;
+ case 3:
+ tempPointBy = bottomLeftBy;
+ tempPointBx = p2x + halfHeightB / slopePrime;
+ result[2] = tempPointBx;
+ result[3] = tempPointBy;
+ break;
+ case 4:
+ tempPointBx = bottomLeftBx;
+ tempPointBy = p2y + -halfWidthB * slopePrime;
+ result[2] = tempPointBx;
+ result[3] = tempPointBy;
+ break;
+ }
+ }
+ }
+ return false;
};
- Matrix.normalize = function(array4) {
- var result = [];
- var magnitude = this.mag(array4);
- for (var i2 = 0; i2 < array4.length; i2++) {
- result[i2] = array4[i2] / magnitude;
+ IGeometry.getCardinalDirection = function(slope, slopePrime, line2) {
+ if (slope > slopePrime) {
+ return line2;
+ } else {
+ return 1 + line2 % 4;
}
- return result;
};
- Matrix.multGamma = function(array4) {
- var result = [];
- var sum2 = 0;
- for (var i2 = 0; i2 < array4.length; i2++) {
- sum2 += array4[i2];
+ IGeometry.getIntersection = function(s1, s2, f1, f2) {
+ if (f2 == null) {
+ return this.getIntersection2(s1, s2, f1);
}
- sum2 *= -1 / array4.length;
- for (var _i = 0; _i < array4.length; _i++) {
- result[_i] = sum2 + array4[_i];
+ var x1 = s1.x;
+ var y1 = s1.y;
+ var x22 = s2.x;
+ var y22 = s2.y;
+ var x32 = f1.x;
+ var y32 = f1.y;
+ var x42 = f2.x;
+ var y42 = f2.y;
+ var x5 = void 0, y5 = void 0;
+ var a1 = void 0, a2 = void 0, b1 = void 0, b2 = void 0, c1 = void 0, c22 = void 0;
+ var denom = void 0;
+ a1 = y22 - y1;
+ b1 = x1 - x22;
+ c1 = x22 * y1 - x1 * y22;
+ a2 = y42 - y32;
+ b2 = x32 - x42;
+ c22 = x42 * y32 - x32 * y42;
+ denom = a1 * b2 - a2 * b1;
+ if (denom === 0) {
+ return null;
}
- return result;
+ x5 = (b1 * c22 - b2 * c1) / denom;
+ y5 = (a2 * c1 - a1 * c22) / denom;
+ return new Point3(x5, y5);
};
- Matrix.multL = function(array4, C2, INV) {
- var result = [];
- var temp1 = [];
- var temp2 = [];
- for (var i2 = 0; i2 < C2[0].length; i2++) {
- var sum2 = 0;
- for (var j2 = 0; j2 < C2.length; j2++) {
- sum2 += -0.5 * C2[j2][i2] * array4[j2];
+ IGeometry.angleOfVector = function(Cx, Cy, Nx, Ny) {
+ var C_angle = void 0;
+ if (Cx !== Nx) {
+ C_angle = Math.atan((Ny - Cy) / (Nx - Cx));
+ if (Nx < Cx) {
+ C_angle += Math.PI;
+ } else if (Ny < Cy) {
+ C_angle += this.TWO_PI;
}
- temp1[i2] = sum2;
+ } else if (Ny < Cy) {
+ C_angle = this.ONE_AND_HALF_PI;
+ } else {
+ C_angle = this.HALF_PI;
}
- for (var _i2 = 0; _i2 < INV.length; _i2++) {
- var _sum = 0;
- for (var _j = 0; _j < INV.length; _j++) {
- _sum += INV[_i2][_j] * temp1[_j];
- }
- temp2[_i2] = _sum;
+ return C_angle;
+ };
+ IGeometry.doIntersect = function(p1, p22, p3, p4) {
+ var a2 = p1.x;
+ var b2 = p1.y;
+ var c3 = p22.x;
+ var d2 = p22.y;
+ var p5 = p3.x;
+ var q2 = p3.y;
+ var r2 = p4.x;
+ var s2 = p4.y;
+ var det = (c3 - a2) * (s2 - q2) - (r2 - p5) * (d2 - b2);
+ if (det === 0) {
+ return false;
+ } else {
+ var lambda = ((s2 - q2) * (r2 - a2) + (p5 - r2) * (s2 - b2)) / det;
+ var gamma2 = ((b2 - d2) * (r2 - a2) + (c3 - a2) * (s2 - b2)) / det;
+ return 0 < lambda && lambda < 1 && 0 < gamma2 && gamma2 < 1;
}
- for (var _i3 = 0; _i3 < C2.length; _i3++) {
- var _sum2 = 0;
- for (var _j2 = 0; _j2 < C2[0].length; _j2++) {
- _sum2 += C2[_i3][_j2] * temp2[_j2];
+ };
+ IGeometry.findCircleLineIntersections = function(Ex, Ey, Lx, Ly, Cx, Cy, r2) {
+ var a2 = (Lx - Ex) * (Lx - Ex) + (Ly - Ey) * (Ly - Ey);
+ var b2 = 2 * ((Ex - Cx) * (Lx - Ex) + (Ey - Cy) * (Ly - Ey));
+ var c3 = (Ex - Cx) * (Ex - Cx) + (Ey - Cy) * (Ey - Cy) - r2 * r2;
+ var disc = b2 * b2 - 4 * a2 * c3;
+ if (disc >= 0) {
+ var t13 = (-b2 + Math.sqrt(b2 * b2 - 4 * a2 * c3)) / (2 * a2);
+ var t22 = (-b2 - Math.sqrt(b2 * b2 - 4 * a2 * c3)) / (2 * a2);
+ var intersections = null;
+ if (t13 >= 0 && t13 <= 1) {
+ return [t13];
}
- result[_i3] = _sum2;
+ if (t22 >= 0 && t22 <= 1) {
+ return [t22];
+ }
+ return intersections;
+ } else return null;
+ };
+ IGeometry.HALF_PI = 0.5 * Math.PI;
+ IGeometry.ONE_AND_HALF_PI = 1.5 * Math.PI;
+ IGeometry.TWO_PI = 2 * Math.PI;
+ IGeometry.THREE_PI = 3 * Math.PI;
+ module3.exports = IGeometry;
+ },
+ /* 9 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function IMath() {
+ }
+ __name(IMath, "IMath");
+ IMath.sign = function(value2) {
+ if (value2 > 0) {
+ return 1;
+ } else if (value2 < 0) {
+ return -1;
+ } else {
+ return 0;
}
- return result;
};
- module3.exports = Matrix;
+ IMath.floor = function(value2) {
+ return value2 < 0 ? Math.ceil(value2) : Math.floor(value2);
+ };
+ IMath.ceil = function(value2) {
+ return value2 < 0 ? Math.floor(value2) : Math.ceil(value2);
+ };
+ module3.exports = IMath;
},
- /* 25 */
+ /* 10 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function Integer() {
+ }
+ __name(Integer, "Integer");
+ Integer.MAX_VALUE = 2147483647;
+ Integer.MIN_VALUE = -2147483648;
+ module3.exports = Integer;
+ },
+ /* 11 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
@@ -133915,9066 +143222,7941 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
}
}
__name(_classCallCheck2, "_classCallCheck");
- var LinkedList = __webpack_require__(11);
- var Quicksort = function() {
- function Quicksort2(A2, compareFunction) {
- _classCallCheck2(this, Quicksort2);
- if (compareFunction !== null || compareFunction !== void 0) this.compareFunction = this._defaultCompareFunction;
- var length2 = void 0;
- if (A2 instanceof LinkedList) length2 = A2.size();
- else length2 = A2.length;
- this._quicksort(A2, 0, length2 - 1);
+ var nodeFrom = /* @__PURE__ */ __name(function nodeFrom2(value2) {
+ return { value: value2, next: null, prev: null };
+ }, "nodeFrom");
+ var add3 = /* @__PURE__ */ __name(function add4(prev2, node2, next3, list2) {
+ if (prev2 !== null) {
+ prev2.next = node2;
+ } else {
+ list2.head = node2;
}
- __name(Quicksort2, "Quicksort");
- _createClass2(Quicksort2, [{
- key: "_quicksort",
- value: /* @__PURE__ */ __name(function _quicksort(A2, p3, r2) {
- if (p3 < r2) {
- var q2 = this._partition(A2, p3, r2);
- this._quicksort(A2, p3, q2);
- this._quicksort(A2, q2 + 1, r2);
- }
- }, "_quicksort")
- }, {
- key: "_partition",
- value: /* @__PURE__ */ __name(function _partition(A2, p3, r2) {
- var x5 = this._get(A2, p3);
- var i2 = p3;
- var j2 = r2;
- while (true) {
- while (this.compareFunction(x5, this._get(A2, j2))) {
- j2--;
- }
- while (this.compareFunction(this._get(A2, i2), x5)) {
- i2++;
- }
- if (i2 < j2) {
- this._swap(A2, i2, j2);
- i2++;
- j2--;
- } else return j2;
- }
- }, "_partition")
- }, {
- key: "_get",
- value: /* @__PURE__ */ __name(function _get(object3, index) {
- if (object3 instanceof LinkedList) return object3.get_object_at(index);
- else return object3[index];
- }, "_get")
- }, {
- key: "_set",
- value: /* @__PURE__ */ __name(function _set(object3, index, value2) {
- if (object3 instanceof LinkedList) object3.set_object_at(index, value2);
- else object3[index] = value2;
- }, "_set")
- }, {
- key: "_swap",
- value: /* @__PURE__ */ __name(function _swap(A2, i2, j2) {
- var temp = this._get(A2, i2);
- this._set(A2, i2, this._get(A2, j2));
- this._set(A2, j2, temp);
- }, "_swap")
- }, {
- key: "_defaultCompareFunction",
- value: /* @__PURE__ */ __name(function _defaultCompareFunction(a2, b2) {
- return b2 > a2;
- }, "_defaultCompareFunction")
+ if (next3 !== null) {
+ next3.prev = node2;
+ } else {
+ list2.tail = node2;
+ }
+ node2.prev = prev2;
+ node2.next = next3;
+ list2.length++;
+ return node2;
+ }, "add");
+ var _remove = /* @__PURE__ */ __name(function _remove2(node2, list2) {
+ var prev2 = node2.prev, next3 = node2.next;
+ if (prev2 !== null) {
+ prev2.next = next3;
+ } else {
+ list2.head = next3;
+ }
+ if (next3 !== null) {
+ next3.prev = prev2;
+ } else {
+ list2.tail = prev2;
+ }
+ node2.prev = node2.next = null;
+ list2.length--;
+ return node2;
+ }, "_remove");
+ var LinkedList = function() {
+ function LinkedList2(vals) {
+ var _this = this;
+ _classCallCheck2(this, LinkedList2);
+ this.length = 0;
+ this.head = null;
+ this.tail = null;
+ if (vals != null) {
+ vals.forEach(function(v3) {
+ return _this.push(v3);
+ });
+ }
+ }
+ __name(LinkedList2, "LinkedList");
+ _createClass2(LinkedList2, [{
+ key: "size",
+ value: /* @__PURE__ */ __name(function size5() {
+ return this.length;
+ }, "size")
+ }, {
+ key: "insertBefore",
+ value: /* @__PURE__ */ __name(function insertBefore(val, otherNode) {
+ return add3(otherNode.prev, nodeFrom(val), otherNode, this);
+ }, "insertBefore")
+ }, {
+ key: "insertAfter",
+ value: /* @__PURE__ */ __name(function insertAfter(val, otherNode) {
+ return add3(otherNode, nodeFrom(val), otherNode.next, this);
+ }, "insertAfter")
+ }, {
+ key: "insertNodeBefore",
+ value: /* @__PURE__ */ __name(function insertNodeBefore(newNode, otherNode) {
+ return add3(otherNode.prev, newNode, otherNode, this);
+ }, "insertNodeBefore")
+ }, {
+ key: "insertNodeAfter",
+ value: /* @__PURE__ */ __name(function insertNodeAfter(newNode, otherNode) {
+ return add3(otherNode, newNode, otherNode.next, this);
+ }, "insertNodeAfter")
+ }, {
+ key: "push",
+ value: /* @__PURE__ */ __name(function push3(val) {
+ return add3(this.tail, nodeFrom(val), null, this);
+ }, "push")
+ }, {
+ key: "unshift",
+ value: /* @__PURE__ */ __name(function unshift(val) {
+ return add3(null, nodeFrom(val), this.head, this);
+ }, "unshift")
+ }, {
+ key: "remove",
+ value: /* @__PURE__ */ __name(function remove3(node2) {
+ return _remove(node2, this);
+ }, "remove")
+ }, {
+ key: "pop",
+ value: /* @__PURE__ */ __name(function pop() {
+ return _remove(this.tail, this).value;
+ }, "pop")
+ }, {
+ key: "popNode",
+ value: /* @__PURE__ */ __name(function popNode() {
+ return _remove(this.tail, this);
+ }, "popNode")
+ }, {
+ key: "shift",
+ value: /* @__PURE__ */ __name(function shift2() {
+ return _remove(this.head, this).value;
+ }, "shift")
+ }, {
+ key: "shiftNode",
+ value: /* @__PURE__ */ __name(function shiftNode() {
+ return _remove(this.head, this);
+ }, "shiftNode")
+ }, {
+ key: "get_object_at",
+ value: /* @__PURE__ */ __name(function get_object_at(index) {
+ if (index <= this.length()) {
+ var i2 = 1;
+ var current = this.head;
+ while (i2 < index) {
+ current = current.next;
+ i2++;
+ }
+ return current.value;
+ }
+ }, "get_object_at")
+ }, {
+ key: "set_object_at",
+ value: /* @__PURE__ */ __name(function set_object_at(index, value2) {
+ if (index <= this.length()) {
+ var i2 = 1;
+ var current = this.head;
+ while (i2 < index) {
+ current = current.next;
+ i2++;
+ }
+ current.value = value2;
+ }
+ }, "set_object_at")
}]);
- return Quicksort2;
+ return LinkedList2;
}();
- module3.exports = Quicksort;
+ module3.exports = LinkedList;
},
- /* 26 */
+ /* 12 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function SVD() {
+ function Point3(x5, y5, p3) {
+ this.x = null;
+ this.y = null;
+ if (x5 == null && y5 == null && p3 == null) {
+ this.x = 0;
+ this.y = 0;
+ } else if (typeof x5 == "number" && typeof y5 == "number" && p3 == null) {
+ this.x = x5;
+ this.y = y5;
+ } else if (x5.constructor.name == "Point" && y5 == null && p3 == null) {
+ p3 = x5;
+ this.x = p3.x;
+ this.y = p3.y;
+ }
}
- __name(SVD, "SVD");
- ;
- SVD.svd = function(A2) {
- this.U = null;
- this.V = null;
- this.s = null;
- this.m = 0;
- this.n = 0;
- this.m = A2.length;
- this.n = A2[0].length;
- var nu = Math.min(this.m, this.n);
- this.s = function(s2) {
- var a2 = [];
- while (s2-- > 0) {
- a2.push(0);
+ __name(Point3, "Point");
+ Point3.prototype.getX = function() {
+ return this.x;
+ };
+ Point3.prototype.getY = function() {
+ return this.y;
+ };
+ Point3.prototype.getLocation = function() {
+ return new Point3(this.x, this.y);
+ };
+ Point3.prototype.setLocation = function(x5, y5, p3) {
+ if (x5.constructor.name == "Point" && y5 == null && p3 == null) {
+ p3 = x5;
+ this.setLocation(p3.x, p3.y);
+ } else if (typeof x5 == "number" && typeof y5 == "number" && p3 == null) {
+ if (parseInt(x5) == x5 && parseInt(y5) == y5) {
+ this.move(x5, y5);
+ } else {
+ this.x = Math.floor(x5 + 0.5);
+ this.y = Math.floor(y5 + 0.5);
}
- return a2;
- }(Math.min(this.m + 1, this.n));
- this.U = function(dims) {
- var allocate = /* @__PURE__ */ __name(function allocate2(dims2) {
- if (dims2.length == 0) {
- return 0;
- } else {
- var array4 = [];
- for (var i3 = 0; i3 < dims2[0]; i3++) {
- array4.push(allocate2(dims2.slice(1)));
- }
- return array4;
- }
- }, "allocate");
- return allocate(dims);
- }([this.m, nu]);
- this.V = function(dims) {
- var allocate = /* @__PURE__ */ __name(function allocate2(dims2) {
- if (dims2.length == 0) {
- return 0;
- } else {
- var array4 = [];
- for (var i3 = 0; i3 < dims2[0]; i3++) {
- array4.push(allocate2(dims2.slice(1)));
- }
- return array4;
- }
- }, "allocate");
- return allocate(dims);
- }([this.n, this.n]);
- var e3 = function(s2) {
- var a2 = [];
- while (s2-- > 0) {
- a2.push(0);
+ }
+ };
+ Point3.prototype.move = function(x5, y5) {
+ this.x = x5;
+ this.y = y5;
+ };
+ Point3.prototype.translate = function(dx, dy) {
+ this.x += dx;
+ this.y += dy;
+ };
+ Point3.prototype.equals = function(obj) {
+ if (obj.constructor.name == "Point") {
+ var pt = obj;
+ return this.x == pt.x && this.y == pt.y;
+ }
+ return this == obj;
+ };
+ Point3.prototype.toString = function() {
+ return new Point3().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
+ };
+ module3.exports = Point3;
+ },
+ /* 13 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function RectangleD(x5, y5, width3, height2) {
+ this.x = 0;
+ this.y = 0;
+ this.width = 0;
+ this.height = 0;
+ if (x5 != null && y5 != null && width3 != null && height2 != null) {
+ this.x = x5;
+ this.y = y5;
+ this.width = width3;
+ this.height = height2;
+ }
+ }
+ __name(RectangleD, "RectangleD");
+ RectangleD.prototype.getX = function() {
+ return this.x;
+ };
+ RectangleD.prototype.setX = function(x5) {
+ this.x = x5;
+ };
+ RectangleD.prototype.getY = function() {
+ return this.y;
+ };
+ RectangleD.prototype.setY = function(y5) {
+ this.y = y5;
+ };
+ RectangleD.prototype.getWidth = function() {
+ return this.width;
+ };
+ RectangleD.prototype.setWidth = function(width3) {
+ this.width = width3;
+ };
+ RectangleD.prototype.getHeight = function() {
+ return this.height;
+ };
+ RectangleD.prototype.setHeight = function(height2) {
+ this.height = height2;
+ };
+ RectangleD.prototype.getRight = function() {
+ return this.x + this.width;
+ };
+ RectangleD.prototype.getBottom = function() {
+ return this.y + this.height;
+ };
+ RectangleD.prototype.intersects = function(a2) {
+ if (this.getRight() < a2.x) {
+ return false;
+ }
+ if (this.getBottom() < a2.y) {
+ return false;
+ }
+ if (a2.getRight() < this.x) {
+ return false;
+ }
+ if (a2.getBottom() < this.y) {
+ return false;
+ }
+ return true;
+ };
+ RectangleD.prototype.getCenterX = function() {
+ return this.x + this.width / 2;
+ };
+ RectangleD.prototype.getMinX = function() {
+ return this.getX();
+ };
+ RectangleD.prototype.getMaxX = function() {
+ return this.getX() + this.width;
+ };
+ RectangleD.prototype.getCenterY = function() {
+ return this.y + this.height / 2;
+ };
+ RectangleD.prototype.getMinY = function() {
+ return this.getY();
+ };
+ RectangleD.prototype.getMaxY = function() {
+ return this.getY() + this.height;
+ };
+ RectangleD.prototype.getWidthHalf = function() {
+ return this.width / 2;
+ };
+ RectangleD.prototype.getHeightHalf = function() {
+ return this.height / 2;
+ };
+ module3.exports = RectangleD;
+ },
+ /* 14 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
+ return typeof obj;
+ } : function(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ function UniqueIDGeneretor() {
+ }
+ __name(UniqueIDGeneretor, "UniqueIDGeneretor");
+ UniqueIDGeneretor.lastID = 0;
+ UniqueIDGeneretor.createID = function(obj) {
+ if (UniqueIDGeneretor.isPrimitive(obj)) {
+ return obj;
+ }
+ if (obj.uniqueID != null) {
+ return obj.uniqueID;
+ }
+ obj.uniqueID = UniqueIDGeneretor.getString();
+ UniqueIDGeneretor.lastID++;
+ return obj.uniqueID;
+ };
+ UniqueIDGeneretor.getString = function(id29) {
+ if (id29 == null) id29 = UniqueIDGeneretor.lastID;
+ return "Object#" + id29;
+ };
+ UniqueIDGeneretor.isPrimitive = function(arg) {
+ var type3 = typeof arg === "undefined" ? "undefined" : _typeof2(arg);
+ return arg == null || type3 != "object" && type3 != "function";
+ };
+ module3.exports = UniqueIDGeneretor;
+ },
+ /* 15 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function _toConsumableArray2(arr) {
+ if (Array.isArray(arr)) {
+ for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
+ arr2[i2] = arr[i2];
}
- return a2;
- }(this.n);
- var work = function(s2) {
- var a2 = [];
- while (s2-- > 0) {
- a2.push(0);
+ return arr2;
+ } else {
+ return Array.from(arr);
+ }
+ }
+ __name(_toConsumableArray2, "_toConsumableArray");
+ var LayoutConstants = __webpack_require__(0);
+ var LGraphManager = __webpack_require__(7);
+ var LNode = __webpack_require__(3);
+ var LEdge = __webpack_require__(1);
+ var LGraph = __webpack_require__(6);
+ var PointD = __webpack_require__(5);
+ var Transform2 = __webpack_require__(17);
+ var Emitter4 = __webpack_require__(29);
+ function Layout2(isRemoteUse) {
+ Emitter4.call(this);
+ this.layoutQuality = LayoutConstants.QUALITY;
+ this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
+ this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;
+ this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;
+ this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;
+ this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;
+ this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;
+ this.edgeToDummyNodes = /* @__PURE__ */ new Map();
+ this.graphManager = new LGraphManager(this);
+ this.isLayoutFinished = false;
+ this.isSubLayout = false;
+ this.isRemoteUse = false;
+ if (isRemoteUse != null) {
+ this.isRemoteUse = isRemoteUse;
+ }
+ }
+ __name(Layout2, "Layout");
+ Layout2.RANDOM_SEED = 1;
+ Layout2.prototype = Object.create(Emitter4.prototype);
+ Layout2.prototype.getGraphManager = function() {
+ return this.graphManager;
+ };
+ Layout2.prototype.getAllNodes = function() {
+ return this.graphManager.getAllNodes();
+ };
+ Layout2.prototype.getAllEdges = function() {
+ return this.graphManager.getAllEdges();
+ };
+ Layout2.prototype.getAllNodesToApplyGravitation = function() {
+ return this.graphManager.getAllNodesToApplyGravitation();
+ };
+ Layout2.prototype.newGraphManager = function() {
+ var gm = new LGraphManager(this);
+ this.graphManager = gm;
+ return gm;
+ };
+ Layout2.prototype.newGraph = function(vGraph) {
+ return new LGraph(null, this.graphManager, vGraph);
+ };
+ Layout2.prototype.newNode = function(vNode) {
+ return new LNode(this.graphManager, vNode);
+ };
+ Layout2.prototype.newEdge = function(vEdge) {
+ return new LEdge(null, null, vEdge);
+ };
+ Layout2.prototype.checkLayoutSuccess = function() {
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
+ };
+ Layout2.prototype.runLayout = function() {
+ this.isLayoutFinished = false;
+ if (this.tilingPreLayout) {
+ this.tilingPreLayout();
+ }
+ this.initParameters();
+ var isLayoutSuccessfull;
+ if (this.checkLayoutSuccess()) {
+ isLayoutSuccessfull = false;
+ } else {
+ isLayoutSuccessfull = this.layout();
+ }
+ if (LayoutConstants.ANIMATE === "during") {
+ return false;
+ }
+ if (isLayoutSuccessfull) {
+ if (!this.isSubLayout) {
+ this.doPostLayout();
}
- return a2;
- }(this.m);
- var wantu = true;
- var wantv = true;
- var nct = Math.min(this.m - 1, this.n);
- var nrt = Math.max(0, Math.min(this.n - 2, this.m));
- for (var k2 = 0; k2 < Math.max(nct, nrt); k2++) {
- if (k2 < nct) {
- this.s[k2] = 0;
- for (var i2 = k2; i2 < this.m; i2++) {
- this.s[k2] = SVD.hypot(this.s[k2], A2[i2][k2]);
- }
- ;
- if (this.s[k2] !== 0) {
- if (A2[k2][k2] < 0) {
- this.s[k2] = -this.s[k2];
- }
- for (var _i = k2; _i < this.m; _i++) {
- A2[_i][k2] /= this.s[k2];
- }
- ;
- A2[k2][k2] += 1;
- }
- this.s[k2] = -this.s[k2];
+ }
+ if (this.tilingPostLayout) {
+ this.tilingPostLayout();
+ }
+ this.isLayoutFinished = true;
+ return isLayoutSuccessfull;
+ };
+ Layout2.prototype.doPostLayout = function() {
+ if (!this.incremental) {
+ this.transform();
+ }
+ this.update();
+ };
+ Layout2.prototype.update2 = function() {
+ if (this.createBendsAsNeeded) {
+ this.createBendpointsFromDummyNodes();
+ this.graphManager.resetAllEdges();
+ }
+ if (!this.isRemoteUse) {
+ var edge;
+ var allEdges = this.graphManager.getAllEdges();
+ for (var i2 = 0; i2 < allEdges.length; i2++) {
+ edge = allEdges[i2];
}
- for (var j2 = k2 + 1; j2 < this.n; j2++) {
- if (/* @__PURE__ */ function(lhs, rhs) {
- return lhs && rhs;
- }(k2 < nct, this.s[k2] !== 0)) {
- var t4 = 0;
- for (var _i2 = k2; _i2 < this.m; _i2++) {
- t4 += A2[_i2][k2] * A2[_i2][j2];
- }
- ;
- t4 = -t4 / A2[k2][k2];
- for (var _i3 = k2; _i3 < this.m; _i3++) {
- A2[_i3][j2] += t4 * A2[_i3][k2];
- }
- ;
- }
- e3[j2] = A2[k2][j2];
+ var node2;
+ var nodes6 = this.graphManager.getRoot().getNodes();
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ node2 = nodes6[i2];
}
- ;
- if (/* @__PURE__ */ function(lhs, rhs) {
- return lhs && rhs;
- }(wantu, k2 < nct)) {
- for (var _i4 = k2; _i4 < this.m; _i4++) {
- this.U[_i4][k2] = A2[_i4][k2];
+ this.update(this.graphManager.getRoot());
+ }
+ };
+ Layout2.prototype.update = function(obj) {
+ if (obj == null) {
+ this.update2();
+ } else if (obj instanceof LNode) {
+ var node2 = obj;
+ if (node2.getChild() != null) {
+ var nodes6 = node2.getChild().getNodes();
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ update(nodes6[i2]);
}
- ;
}
- if (k2 < nrt) {
- e3[k2] = 0;
- for (var _i5 = k2 + 1; _i5 < this.n; _i5++) {
- e3[k2] = SVD.hypot(e3[k2], e3[_i5]);
- }
- ;
- if (e3[k2] !== 0) {
- if (e3[k2 + 1] < 0) {
- e3[k2] = -e3[k2];
- }
- for (var _i6 = k2 + 1; _i6 < this.n; _i6++) {
- e3[_i6] /= e3[k2];
- }
- ;
- e3[k2 + 1] += 1;
- }
- e3[k2] = -e3[k2];
- if (/* @__PURE__ */ function(lhs, rhs) {
- return lhs && rhs;
- }(k2 + 1 < this.m, e3[k2] !== 0)) {
- for (var _i7 = k2 + 1; _i7 < this.m; _i7++) {
- work[_i7] = 0;
- }
- ;
- for (var _j = k2 + 1; _j < this.n; _j++) {
- for (var _i8 = k2 + 1; _i8 < this.m; _i8++) {
- work[_i8] += e3[_j] * A2[_i8][_j];
- }
- ;
- }
- ;
- for (var _j2 = k2 + 1; _j2 < this.n; _j2++) {
- var _t = -e3[_j2] / e3[k2 + 1];
- for (var _i9 = k2 + 1; _i9 < this.m; _i9++) {
- A2[_i9][_j2] += _t * work[_i9];
- }
- ;
- }
- ;
- }
- if (wantv) {
- for (var _i10 = k2 + 1; _i10 < this.n; _i10++) {
- this.V[_i10][k2] = e3[_i10];
- }
- ;
- }
+ if (node2.vGraphObject != null) {
+ var vNode = node2.vGraphObject;
+ vNode.update(node2);
+ }
+ } else if (obj instanceof LEdge) {
+ var edge = obj;
+ if (edge.vGraphObject != null) {
+ var vEdge = edge.vGraphObject;
+ vEdge.update(edge);
+ }
+ } else if (obj instanceof LGraph) {
+ var graph = obj;
+ if (graph.vGraphObject != null) {
+ var vGraph = graph.vGraphObject;
+ vGraph.update(graph);
}
}
- ;
- var p3 = Math.min(this.n, this.m + 1);
- if (nct < this.n) {
- this.s[nct] = A2[nct][nct];
- }
- if (this.m < p3) {
- this.s[p3 - 1] = 0;
+ };
+ Layout2.prototype.initParameters = function() {
+ if (!this.isSubLayout) {
+ this.layoutQuality = LayoutConstants.QUALITY;
+ this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;
+ this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;
+ this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;
+ this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;
+ this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
+ this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;
}
- if (nrt + 1 < p3) {
- e3[nrt] = A2[nrt][p3 - 1];
+ if (this.animationDuringLayout) {
+ this.animationOnLayout = false;
}
- e3[p3 - 1] = 0;
- if (wantu) {
- for (var _j3 = nct; _j3 < nu; _j3++) {
- for (var _i11 = 0; _i11 < this.m; _i11++) {
- this.U[_i11][_j3] = 0;
+ };
+ Layout2.prototype.transform = function(newLeftTop) {
+ if (newLeftTop == void 0) {
+ this.transform(new PointD(0, 0));
+ } else {
+ var trans = new Transform2();
+ var leftTop = this.graphManager.getRoot().updateLeftTop();
+ if (leftTop != null) {
+ trans.setWorldOrgX(newLeftTop.x);
+ trans.setWorldOrgY(newLeftTop.y);
+ trans.setDeviceOrgX(leftTop.x);
+ trans.setDeviceOrgY(leftTop.y);
+ var nodes6 = this.getAllNodes();
+ var node2;
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ node2 = nodes6[i2];
+ node2.transform(trans);
}
- ;
- this.U[_j3][_j3] = 1;
}
- ;
- for (var _k = nct - 1; _k >= 0; _k--) {
- if (this.s[_k] !== 0) {
- for (var _j4 = _k + 1; _j4 < nu; _j4++) {
- var _t2 = 0;
- for (var _i12 = _k; _i12 < this.m; _i12++) {
- _t2 += this.U[_i12][_k] * this.U[_i12][_j4];
- }
- ;
- _t2 = -_t2 / this.U[_k][_k];
- for (var _i13 = _k; _i13 < this.m; _i13++) {
- this.U[_i13][_j4] += _t2 * this.U[_i13][_k];
- }
- ;
- }
- ;
- for (var _i14 = _k; _i14 < this.m; _i14++) {
- this.U[_i14][_k] = -this.U[_i14][_k];
- }
- ;
- this.U[_k][_k] = 1 + this.U[_k][_k];
- for (var _i15 = 0; _i15 < _k - 1; _i15++) {
- this.U[_i15][_k] = 0;
- }
- ;
+ }
+ };
+ Layout2.prototype.positionNodesRandomly = function(graph) {
+ if (graph == void 0) {
+ this.positionNodesRandomly(this.getGraphManager().getRoot());
+ this.getGraphManager().getRoot().updateBounds(true);
+ } else {
+ var lNode;
+ var childGraph;
+ var nodes6 = graph.getNodes();
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ lNode = nodes6[i2];
+ childGraph = lNode.getChild();
+ if (childGraph == null) {
+ lNode.scatter();
+ } else if (childGraph.getNodes().length == 0) {
+ lNode.scatter();
} else {
- for (var _i16 = 0; _i16 < this.m; _i16++) {
- this.U[_i16][_k] = 0;
- }
- ;
- this.U[_k][_k] = 1;
+ this.positionNodesRandomly(childGraph);
+ lNode.updateBounds();
}
}
- ;
}
- if (wantv) {
- for (var _k2 = this.n - 1; _k2 >= 0; _k2--) {
- if (/* @__PURE__ */ function(lhs, rhs) {
- return lhs && rhs;
- }(_k2 < nrt, e3[_k2] !== 0)) {
- for (var _j5 = _k2 + 1; _j5 < nu; _j5++) {
- var _t3 = 0;
- for (var _i17 = _k2 + 1; _i17 < this.n; _i17++) {
- _t3 += this.V[_i17][_k2] * this.V[_i17][_j5];
- }
- ;
- _t3 = -_t3 / this.V[_k2 + 1][_k2];
- for (var _i18 = _k2 + 1; _i18 < this.n; _i18++) {
- this.V[_i18][_j5] += _t3 * this.V[_i18][_k2];
- }
- ;
- }
- ;
- }
- for (var _i19 = 0; _i19 < this.n; _i19++) {
- this.V[_i19][_k2] = 0;
- }
- ;
- this.V[_k2][_k2] = 1;
+ };
+ Layout2.prototype.getFlatForest = function() {
+ var flatForest = [];
+ var isForest = true;
+ var allNodes = this.graphManager.getRoot().getNodes();
+ var isFlat = true;
+ for (var i2 = 0; i2 < allNodes.length; i2++) {
+ if (allNodes[i2].getChild() != null) {
+ isFlat = false;
}
- ;
}
- var pp = p3 - 1;
- var iter = 0;
- var eps = Math.pow(2, -52);
- var tiny = Math.pow(2, -966);
- while (p3 > 0) {
- var _k3 = void 0;
- var kase = void 0;
- for (_k3 = p3 - 2; _k3 >= -1; _k3--) {
- if (_k3 === -1) {
- break;
- }
- if (Math.abs(e3[_k3]) <= tiny + eps * (Math.abs(this.s[_k3]) + Math.abs(this.s[_k3 + 1]))) {
- e3[_k3] = 0;
- break;
+ if (!isFlat) {
+ return flatForest;
+ }
+ var visited = /* @__PURE__ */ new Set();
+ var toBeVisited = [];
+ var parents3 = /* @__PURE__ */ new Map();
+ var unProcessedNodes = [];
+ unProcessedNodes = unProcessedNodes.concat(allNodes);
+ while (unProcessedNodes.length > 0 && isForest) {
+ toBeVisited.push(unProcessedNodes[0]);
+ while (toBeVisited.length > 0 && isForest) {
+ var currentNode = toBeVisited[0];
+ toBeVisited.splice(0, 1);
+ visited.add(currentNode);
+ var neighborEdges = currentNode.getEdges();
+ for (var i2 = 0; i2 < neighborEdges.length; i2++) {
+ var currentNeighbor = neighborEdges[i2].getOtherEnd(currentNode);
+ if (parents3.get(currentNode) != currentNeighbor) {
+ if (!visited.has(currentNeighbor)) {
+ toBeVisited.push(currentNeighbor);
+ parents3.set(currentNeighbor, currentNode);
+ } else {
+ isForest = false;
+ break;
+ }
+ }
}
}
- ;
- if (_k3 === p3 - 2) {
- kase = 4;
+ if (!isForest) {
+ flatForest = [];
} else {
- var ks = void 0;
- for (ks = p3 - 1; ks >= _k3; ks--) {
- if (ks === _k3) {
- break;
- }
- var _t4 = (ks !== p3 ? Math.abs(e3[ks]) : 0) + (ks !== _k3 + 1 ? Math.abs(e3[ks - 1]) : 0);
- if (Math.abs(this.s[ks]) <= tiny + eps * _t4) {
- this.s[ks] = 0;
- break;
+ var temp = [].concat(_toConsumableArray2(visited));
+ flatForest.push(temp);
+ for (var i2 = 0; i2 < temp.length; i2++) {
+ var value2 = temp[i2];
+ var index = unProcessedNodes.indexOf(value2);
+ if (index > -1) {
+ unProcessedNodes.splice(index, 1);
}
}
- ;
- if (ks === _k3) {
- kase = 3;
- } else if (ks === p3 - 1) {
- kase = 1;
- } else {
- kase = 2;
- _k3 = ks;
- }
- }
- _k3++;
- switch (kase) {
- case 1:
- {
- var f3 = e3[p3 - 2];
- e3[p3 - 2] = 0;
- for (var _j6 = p3 - 2; _j6 >= _k3; _j6--) {
- var _t5 = SVD.hypot(this.s[_j6], f3);
- var cs = this.s[_j6] / _t5;
- var sn = f3 / _t5;
- this.s[_j6] = _t5;
- if (_j6 !== _k3) {
- f3 = -sn * e3[_j6 - 1];
- e3[_j6 - 1] = cs * e3[_j6 - 1];
- }
- if (wantv) {
- for (var _i20 = 0; _i20 < this.n; _i20++) {
- _t5 = cs * this.V[_i20][_j6] + sn * this.V[_i20][p3 - 1];
- this.V[_i20][p3 - 1] = -sn * this.V[_i20][_j6] + cs * this.V[_i20][p3 - 1];
- this.V[_i20][_j6] = _t5;
- }
- ;
- }
- }
- ;
- }
- ;
- break;
- case 2:
- {
- var _f = e3[_k3 - 1];
- e3[_k3 - 1] = 0;
- for (var _j7 = _k3; _j7 < p3; _j7++) {
- var _t6 = SVD.hypot(this.s[_j7], _f);
- var _cs = this.s[_j7] / _t6;
- var _sn = _f / _t6;
- this.s[_j7] = _t6;
- _f = -_sn * e3[_j7];
- e3[_j7] = _cs * e3[_j7];
- if (wantu) {
- for (var _i21 = 0; _i21 < this.m; _i21++) {
- _t6 = _cs * this.U[_i21][_j7] + _sn * this.U[_i21][_k3 - 1];
- this.U[_i21][_k3 - 1] = -_sn * this.U[_i21][_j7] + _cs * this.U[_i21][_k3 - 1];
- this.U[_i21][_j7] = _t6;
- }
- ;
- }
- }
- ;
- }
- ;
- break;
- case 3:
- {
- var scale = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[p3 - 1]), Math.abs(this.s[p3 - 2])), Math.abs(e3[p3 - 2])), Math.abs(this.s[_k3])), Math.abs(e3[_k3]));
- var sp = this.s[p3 - 1] / scale;
- var spm1 = this.s[p3 - 2] / scale;
- var epm1 = e3[p3 - 2] / scale;
- var sk = this.s[_k3] / scale;
- var ek = e3[_k3] / scale;
- var b2 = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2;
- var c3 = sp * epm1 * (sp * epm1);
- var shift2 = 0;
- if (/* @__PURE__ */ function(lhs, rhs) {
- return lhs || rhs;
- }(b2 !== 0, c3 !== 0)) {
- shift2 = Math.sqrt(b2 * b2 + c3);
- if (b2 < 0) {
- shift2 = -shift2;
- }
- shift2 = c3 / (b2 + shift2);
- }
- var _f2 = (sk + sp) * (sk - sp) + shift2;
- var g2 = sk * ek;
- for (var _j8 = _k3; _j8 < p3 - 1; _j8++) {
- var _t7 = SVD.hypot(_f2, g2);
- var _cs2 = _f2 / _t7;
- var _sn2 = g2 / _t7;
- if (_j8 !== _k3) {
- e3[_j8 - 1] = _t7;
- }
- _f2 = _cs2 * this.s[_j8] + _sn2 * e3[_j8];
- e3[_j8] = _cs2 * e3[_j8] - _sn2 * this.s[_j8];
- g2 = _sn2 * this.s[_j8 + 1];
- this.s[_j8 + 1] = _cs2 * this.s[_j8 + 1];
- if (wantv) {
- for (var _i22 = 0; _i22 < this.n; _i22++) {
- _t7 = _cs2 * this.V[_i22][_j8] + _sn2 * this.V[_i22][_j8 + 1];
- this.V[_i22][_j8 + 1] = -_sn2 * this.V[_i22][_j8] + _cs2 * this.V[_i22][_j8 + 1];
- this.V[_i22][_j8] = _t7;
- }
- ;
- }
- _t7 = SVD.hypot(_f2, g2);
- _cs2 = _f2 / _t7;
- _sn2 = g2 / _t7;
- this.s[_j8] = _t7;
- _f2 = _cs2 * e3[_j8] + _sn2 * this.s[_j8 + 1];
- this.s[_j8 + 1] = -_sn2 * e3[_j8] + _cs2 * this.s[_j8 + 1];
- g2 = _sn2 * e3[_j8 + 1];
- e3[_j8 + 1] = _cs2 * e3[_j8 + 1];
- if (wantu && _j8 < this.m - 1) {
- for (var _i23 = 0; _i23 < this.m; _i23++) {
- _t7 = _cs2 * this.U[_i23][_j8] + _sn2 * this.U[_i23][_j8 + 1];
- this.U[_i23][_j8 + 1] = -_sn2 * this.U[_i23][_j8] + _cs2 * this.U[_i23][_j8 + 1];
- this.U[_i23][_j8] = _t7;
- }
- ;
- }
- }
- ;
- e3[p3 - 2] = _f2;
- iter = iter + 1;
- }
- ;
- break;
- case 4:
- {
- if (this.s[_k3] <= 0) {
- this.s[_k3] = this.s[_k3] < 0 ? -this.s[_k3] : 0;
- if (wantv) {
- for (var _i24 = 0; _i24 <= pp; _i24++) {
- this.V[_i24][_k3] = -this.V[_i24][_k3];
- }
- ;
- }
- }
- while (_k3 < pp) {
- if (this.s[_k3] >= this.s[_k3 + 1]) {
- break;
- }
- var _t8 = this.s[_k3];
- this.s[_k3] = this.s[_k3 + 1];
- this.s[_k3 + 1] = _t8;
- if (wantv && _k3 < this.n - 1) {
- for (var _i25 = 0; _i25 < this.n; _i25++) {
- _t8 = this.V[_i25][_k3 + 1];
- this.V[_i25][_k3 + 1] = this.V[_i25][_k3];
- this.V[_i25][_k3] = _t8;
- }
- ;
- }
- if (wantu && _k3 < this.m - 1) {
- for (var _i26 = 0; _i26 < this.m; _i26++) {
- _t8 = this.U[_i26][_k3 + 1];
- this.U[_i26][_k3 + 1] = this.U[_i26][_k3];
- this.U[_i26][_k3] = _t8;
- }
- ;
- }
- _k3++;
- }
- ;
- iter = 0;
- p3--;
- }
- ;
- break;
+ visited = /* @__PURE__ */ new Set();
+ parents3 = /* @__PURE__ */ new Map();
}
}
- ;
- var result = { U: this.U, V: this.V, S: this.s };
- return result;
+ return flatForest;
};
- SVD.hypot = function(a2, b2) {
- var r2 = void 0;
- if (Math.abs(a2) > Math.abs(b2)) {
- r2 = b2 / a2;
- r2 = Math.abs(a2) * Math.sqrt(1 + r2 * r2);
- } else if (b2 != 0) {
- r2 = a2 / b2;
- r2 = Math.abs(b2) * Math.sqrt(1 + r2 * r2);
+ Layout2.prototype.createDummyNodesForBendpoints = function(edge) {
+ var dummyNodes = [];
+ var prev2 = edge.source;
+ var graph = this.graphManager.calcLowestCommonAncestor(edge.source, edge.target);
+ for (var i2 = 0; i2 < edge.bendpoints.length; i2++) {
+ var dummyNode = this.newNode(null);
+ dummyNode.setRect(new Point(0, 0), new Dimension(1, 1));
+ graph.add(dummyNode);
+ var dummyEdge = this.newEdge(null);
+ this.graphManager.add(dummyEdge, prev2, dummyNode);
+ dummyNodes.add(dummyNode);
+ prev2 = dummyNode;
+ }
+ var dummyEdge = this.newEdge(null);
+ this.graphManager.add(dummyEdge, prev2, edge.target);
+ this.edgeToDummyNodes.set(edge, dummyNodes);
+ if (edge.isInterGraph()) {
+ this.graphManager.remove(edge);
} else {
- r2 = 0;
+ graph.remove(edge);
}
- return r2;
+ return dummyNodes;
};
- module3.exports = SVD;
- },
- /* 27 */
- /***/
- function(module3, exports3, __webpack_require__) {
- "use strict";
- var _createClass2 = /* @__PURE__ */ function() {
- function defineProperties(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
+ Layout2.prototype.createBendpointsFromDummyNodes = function() {
+ var edges3 = [];
+ edges3 = edges3.concat(this.graphManager.getAllEdges());
+ edges3 = [].concat(_toConsumableArray2(this.edgeToDummyNodes.keys())).concat(edges3);
+ for (var k2 = 0; k2 < edges3.length; k2++) {
+ var lEdge = edges3[k2];
+ if (lEdge.bendpoints.length > 0) {
+ var path4 = this.edgeToDummyNodes.get(lEdge);
+ for (var i2 = 0; i2 < path4.length; i2++) {
+ var dummyNode = path4[i2];
+ var p3 = new PointD(dummyNode.getCenterX(), dummyNode.getCenterY());
+ var ebp = lEdge.bendpoints.get(i2);
+ ebp.x = p3.x;
+ ebp.y = p3.y;
+ dummyNode.getOwner().remove(dummyNode);
+ }
+ this.graphManager.add(lEdge, lEdge.source, lEdge.target);
}
}
- __name(defineProperties, "defineProperties");
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
- function _classCallCheck2(instance2, Constructor) {
- if (!(instance2 instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- __name(_classCallCheck2, "_classCallCheck");
- var NeedlemanWunsch = function() {
- function NeedlemanWunsch2(sequence1, sequence2) {
- var match_score = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
- var mismatch_penalty = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1;
- var gap_penalty = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
- _classCallCheck2(this, NeedlemanWunsch2);
- this.sequence1 = sequence1;
- this.sequence2 = sequence2;
- this.match_score = match_score;
- this.mismatch_penalty = mismatch_penalty;
- this.gap_penalty = gap_penalty;
- this.iMax = sequence1.length + 1;
- this.jMax = sequence2.length + 1;
- this.grid = new Array(this.iMax);
- for (var i2 = 0; i2 < this.iMax; i2++) {
- this.grid[i2] = new Array(this.jMax);
- for (var j2 = 0; j2 < this.jMax; j2++) {
- this.grid[i2][j2] = 0;
- }
+ };
+ Layout2.transform = function(sliderValue, defaultValue, minDiv, maxMul) {
+ if (minDiv != void 0 && maxMul != void 0) {
+ var value2 = defaultValue;
+ if (sliderValue <= 50) {
+ var minValue = defaultValue / minDiv;
+ value2 -= (defaultValue - minValue) / 50 * (50 - sliderValue);
+ } else {
+ var maxValue = defaultValue * maxMul;
+ value2 += (maxValue - defaultValue) / 50 * (sliderValue - 50);
}
- this.tracebackGrid = new Array(this.iMax);
- for (var _i = 0; _i < this.iMax; _i++) {
- this.tracebackGrid[_i] = new Array(this.jMax);
- for (var _j = 0; _j < this.jMax; _j++) {
- this.tracebackGrid[_i][_j] = [null, null, null];
- }
+ return value2;
+ } else {
+ var a2, b2;
+ if (sliderValue <= 50) {
+ a2 = 9 * defaultValue / 500;
+ b2 = defaultValue / 10;
+ } else {
+ a2 = 9 * defaultValue / 50;
+ b2 = -8 * defaultValue;
}
- this.alignments = [];
- this.score = -1;
- this.computeGrids();
+ return a2 * sliderValue + b2;
}
- __name(NeedlemanWunsch2, "NeedlemanWunsch");
- _createClass2(NeedlemanWunsch2, [{
- key: "getScore",
- value: /* @__PURE__ */ __name(function getScore() {
- return this.score;
- }, "getScore")
- }, {
- key: "getAlignments",
- value: /* @__PURE__ */ __name(function getAlignments2() {
- return this.alignments;
- }, "getAlignments")
- // Main dynamic programming procedure
- }, {
- key: "computeGrids",
- value: /* @__PURE__ */ __name(function computeGrids() {
- for (var j2 = 1; j2 < this.jMax; j2++) {
- this.grid[0][j2] = this.grid[0][j2 - 1] + this.gap_penalty;
- this.tracebackGrid[0][j2] = [false, false, true];
- }
- for (var i2 = 1; i2 < this.iMax; i2++) {
- this.grid[i2][0] = this.grid[i2 - 1][0] + this.gap_penalty;
- this.tracebackGrid[i2][0] = [false, true, false];
+ };
+ Layout2.findCenterOfTree = function(nodes6) {
+ var list2 = [];
+ list2 = list2.concat(nodes6);
+ var removedNodes = [];
+ var remainingDegrees = /* @__PURE__ */ new Map();
+ var foundCenter = false;
+ var centerNode = null;
+ if (list2.length == 1 || list2.length == 2) {
+ foundCenter = true;
+ centerNode = list2[0];
+ }
+ for (var i2 = 0; i2 < list2.length; i2++) {
+ var node2 = list2[i2];
+ var degree = node2.getNeighborsList().size;
+ remainingDegrees.set(node2, node2.getNeighborsList().size);
+ if (degree == 1) {
+ removedNodes.push(node2);
+ }
+ }
+ var tempList = [];
+ tempList = tempList.concat(removedNodes);
+ while (!foundCenter) {
+ var tempList2 = [];
+ tempList2 = tempList2.concat(tempList);
+ tempList = [];
+ for (var i2 = 0; i2 < list2.length; i2++) {
+ var node2 = list2[i2];
+ var index = list2.indexOf(node2);
+ if (index >= 0) {
+ list2.splice(index, 1);
}
- for (var _i2 = 1; _i2 < this.iMax; _i2++) {
- for (var _j2 = 1; _j2 < this.jMax; _j2++) {
- var diag = void 0;
- if (this.sequence1[_i2 - 1] === this.sequence2[_j2 - 1]) diag = this.grid[_i2 - 1][_j2 - 1] + this.match_score;
- else diag = this.grid[_i2 - 1][_j2 - 1] + this.mismatch_penalty;
- var up = this.grid[_i2 - 1][_j2] + this.gap_penalty;
- var left3 = this.grid[_i2][_j2 - 1] + this.gap_penalty;
- var maxOf = [diag, up, left3];
- var indices = this.arrayAllMaxIndexes(maxOf);
- this.grid[_i2][_j2] = maxOf[indices[0]];
- this.tracebackGrid[_i2][_j2] = [indices.includes(0), indices.includes(1), indices.includes(2)];
+ var neighbours = node2.getNeighborsList();
+ neighbours.forEach(function(neighbour) {
+ if (removedNodes.indexOf(neighbour) < 0) {
+ var otherDegree = remainingDegrees.get(neighbour);
+ var newDegree = otherDegree - 1;
+ if (newDegree == 1) {
+ tempList.push(neighbour);
+ }
+ remainingDegrees.set(neighbour, newDegree);
}
- }
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
- }, "computeGrids")
- // Gets all possible valid sequence combinations
- }, {
- key: "alignmentTraceback",
- value: /* @__PURE__ */ __name(function alignmentTraceback() {
- var inProcessAlignments = [];
- inProcessAlignments.push({
- pos: [this.sequence1.length, this.sequence2.length],
- seq1: "",
- seq2: ""
});
- while (inProcessAlignments[0]) {
- var current = inProcessAlignments[0];
- var directions = this.tracebackGrid[current.pos[0]][current.pos[1]];
- if (directions[0]) {
- inProcessAlignments.push({
- pos: [current.pos[0] - 1, current.pos[1] - 1],
- seq1: this.sequence1[current.pos[0] - 1] + current.seq1,
- seq2: this.sequence2[current.pos[1] - 1] + current.seq2
- });
- }
- if (directions[1]) {
- inProcessAlignments.push({
- pos: [current.pos[0] - 1, current.pos[1]],
- seq1: this.sequence1[current.pos[0] - 1] + current.seq1,
- seq2: "-" + current.seq2
- });
- }
- if (directions[2]) {
- inProcessAlignments.push({
- pos: [current.pos[0], current.pos[1] - 1],
- seq1: "-" + current.seq1,
- seq2: this.sequence2[current.pos[1] - 1] + current.seq2
- });
- }
- if (current.pos[0] === 0 && current.pos[1] === 0) this.alignments.push({
- sequence1: current.seq1,
- sequence2: current.seq2
- });
- inProcessAlignments.shift();
- }
- return this.alignments;
- }, "alignmentTraceback")
- // Helper Functions
- }, {
- key: "getAllIndexes",
- value: /* @__PURE__ */ __name(function getAllIndexes(arr, val) {
- var indexes = [], i2 = -1;
- while ((i2 = arr.indexOf(val, i2 + 1)) !== -1) {
- indexes.push(i2);
- }
- return indexes;
- }, "getAllIndexes")
- }, {
- key: "arrayAllMaxIndexes",
- value: /* @__PURE__ */ __name(function arrayAllMaxIndexes(array4) {
- return this.getAllIndexes(array4, Math.max.apply(null, array4));
- }, "arrayAllMaxIndexes")
- }]);
- return NeedlemanWunsch2;
- }();
- module3.exports = NeedlemanWunsch;
+ }
+ removedNodes = removedNodes.concat(tempList);
+ if (list2.length == 1 || list2.length == 2) {
+ foundCenter = true;
+ centerNode = list2[0];
+ }
+ }
+ return centerNode;
+ };
+ Layout2.prototype.setGraphManager = function(gm) {
+ this.graphManager = gm;
+ };
+ module3.exports = Layout2;
},
- /* 28 */
+ /* 16 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- var layoutBase = /* @__PURE__ */ __name(function layoutBase2() {
- return;
- }, "layoutBase");
- layoutBase.FDLayout = __webpack_require__(18);
- layoutBase.FDLayoutConstants = __webpack_require__(4);
- layoutBase.FDLayoutEdge = __webpack_require__(19);
- layoutBase.FDLayoutNode = __webpack_require__(20);
- layoutBase.DimensionD = __webpack_require__(21);
- layoutBase.HashMap = __webpack_require__(22);
- layoutBase.HashSet = __webpack_require__(23);
- layoutBase.IGeometry = __webpack_require__(8);
- layoutBase.IMath = __webpack_require__(9);
- layoutBase.Integer = __webpack_require__(10);
- layoutBase.Point = __webpack_require__(12);
- layoutBase.PointD = __webpack_require__(5);
- layoutBase.RandomSeed = __webpack_require__(16);
- layoutBase.RectangleD = __webpack_require__(13);
- layoutBase.Transform = __webpack_require__(17);
- layoutBase.UniqueIDGeneretor = __webpack_require__(14);
- layoutBase.Quicksort = __webpack_require__(25);
- layoutBase.LinkedList = __webpack_require__(11);
- layoutBase.LGraphObject = __webpack_require__(2);
- layoutBase.LGraph = __webpack_require__(6);
- layoutBase.LEdge = __webpack_require__(1);
- layoutBase.LGraphManager = __webpack_require__(7);
- layoutBase.LNode = __webpack_require__(3);
- layoutBase.Layout = __webpack_require__(15);
- layoutBase.LayoutConstants = __webpack_require__(0);
- layoutBase.NeedlemanWunsch = __webpack_require__(27);
- layoutBase.Matrix = __webpack_require__(24);
- layoutBase.SVD = __webpack_require__(26);
- module3.exports = layoutBase;
+ function RandomSeed() {
+ }
+ __name(RandomSeed, "RandomSeed");
+ RandomSeed.seed = 1;
+ RandomSeed.x = 0;
+ RandomSeed.nextDouble = function() {
+ RandomSeed.x = Math.sin(RandomSeed.seed++) * 1e4;
+ return RandomSeed.x - Math.floor(RandomSeed.x);
+ };
+ module3.exports = RandomSeed;
},
- /* 29 */
+ /* 17 */
/***/
function(module3, exports3, __webpack_require__) {
"use strict";
- function Emitter3() {
- this.listeners = [];
+ var PointD = __webpack_require__(5);
+ function Transform2(x5, y5) {
+ this.lworldOrgX = 0;
+ this.lworldOrgY = 0;
+ this.ldeviceOrgX = 0;
+ this.ldeviceOrgY = 0;
+ this.lworldExtX = 1;
+ this.lworldExtY = 1;
+ this.ldeviceExtX = 1;
+ this.ldeviceExtY = 1;
}
- __name(Emitter3, "Emitter");
- var p3 = Emitter3.prototype;
- p3.addListener = function(event3, callback) {
- this.listeners.push({
- event: event3,
- callback
- });
+ __name(Transform2, "Transform");
+ Transform2.prototype.getWorldOrgX = function() {
+ return this.lworldOrgX;
};
- p3.removeListener = function(event3, callback) {
- for (var i2 = this.listeners.length; i2 >= 0; i2--) {
- var l2 = this.listeners[i2];
- if (l2.event === event3 && l2.callback === callback) {
- this.listeners.splice(i2, 1);
- }
+ Transform2.prototype.setWorldOrgX = function(wox) {
+ this.lworldOrgX = wox;
+ };
+ Transform2.prototype.getWorldOrgY = function() {
+ return this.lworldOrgY;
+ };
+ Transform2.prototype.setWorldOrgY = function(woy) {
+ this.lworldOrgY = woy;
+ };
+ Transform2.prototype.getWorldExtX = function() {
+ return this.lworldExtX;
+ };
+ Transform2.prototype.setWorldExtX = function(wex) {
+ this.lworldExtX = wex;
+ };
+ Transform2.prototype.getWorldExtY = function() {
+ return this.lworldExtY;
+ };
+ Transform2.prototype.setWorldExtY = function(wey) {
+ this.lworldExtY = wey;
+ };
+ Transform2.prototype.getDeviceOrgX = function() {
+ return this.ldeviceOrgX;
+ };
+ Transform2.prototype.setDeviceOrgX = function(dox) {
+ this.ldeviceOrgX = dox;
+ };
+ Transform2.prototype.getDeviceOrgY = function() {
+ return this.ldeviceOrgY;
+ };
+ Transform2.prototype.setDeviceOrgY = function(doy) {
+ this.ldeviceOrgY = doy;
+ };
+ Transform2.prototype.getDeviceExtX = function() {
+ return this.ldeviceExtX;
+ };
+ Transform2.prototype.setDeviceExtX = function(dex) {
+ this.ldeviceExtX = dex;
+ };
+ Transform2.prototype.getDeviceExtY = function() {
+ return this.ldeviceExtY;
+ };
+ Transform2.prototype.setDeviceExtY = function(dey) {
+ this.ldeviceExtY = dey;
+ };
+ Transform2.prototype.transformX = function(x5) {
+ var xDevice = 0;
+ var worldExtX = this.lworldExtX;
+ if (worldExtX != 0) {
+ xDevice = this.ldeviceOrgX + (x5 - this.lworldOrgX) * this.ldeviceExtX / worldExtX;
}
+ return xDevice;
};
- p3.emit = function(event3, data5) {
- for (var i2 = 0; i2 < this.listeners.length; i2++) {
- var l2 = this.listeners[i2];
- if (event3 === l2.event) {
- l2.callback(data5);
+ Transform2.prototype.transformY = function(y5) {
+ var yDevice = 0;
+ var worldExtY = this.lworldExtY;
+ if (worldExtY != 0) {
+ yDevice = this.ldeviceOrgY + (y5 - this.lworldOrgY) * this.ldeviceExtY / worldExtY;
+ }
+ return yDevice;
+ };
+ Transform2.prototype.inverseTransformX = function(x5) {
+ var xWorld = 0;
+ var deviceExtX = this.ldeviceExtX;
+ if (deviceExtX != 0) {
+ xWorld = this.lworldOrgX + (x5 - this.ldeviceOrgX) * this.lworldExtX / deviceExtX;
+ }
+ return xWorld;
+ };
+ Transform2.prototype.inverseTransformY = function(y5) {
+ var yWorld = 0;
+ var deviceExtY = this.ldeviceExtY;
+ if (deviceExtY != 0) {
+ yWorld = this.lworldOrgY + (y5 - this.ldeviceOrgY) * this.lworldExtY / deviceExtY;
+ }
+ return yWorld;
+ };
+ Transform2.prototype.inverseTransformPoint = function(inPoint) {
+ var outPoint = new PointD(this.inverseTransformX(inPoint.x), this.inverseTransformY(inPoint.y));
+ return outPoint;
+ };
+ module3.exports = Transform2;
+ },
+ /* 18 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function _toConsumableArray2(arr) {
+ if (Array.isArray(arr)) {
+ for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
+ arr2[i2] = arr[i2];
}
+ return arr2;
+ } else {
+ return Array.from(arr);
}
+ }
+ __name(_toConsumableArray2, "_toConsumableArray");
+ var Layout2 = __webpack_require__(15);
+ var FDLayoutConstants = __webpack_require__(4);
+ var LayoutConstants = __webpack_require__(0);
+ var IGeometry = __webpack_require__(8);
+ var IMath = __webpack_require__(9);
+ function FDLayout() {
+ Layout2.call(this);
+ this.useSmartIdealEdgeLengthCalculation = FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;
+ this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;
+ this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;
+ this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;
+ this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;
+ this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100;
+ this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
+ this.initialCoolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
+ this.totalDisplacement = 0;
+ this.oldTotalDisplacement = 0;
+ this.maxIterations = FDLayoutConstants.MAX_ITERATIONS;
+ }
+ __name(FDLayout, "FDLayout");
+ FDLayout.prototype = Object.create(Layout2.prototype);
+ for (var prop in Layout2) {
+ FDLayout[prop] = Layout2[prop];
+ }
+ FDLayout.prototype.initParameters = function() {
+ Layout2.prototype.initParameters.call(this, arguments);
+ this.totalIterations = 0;
+ this.notAnimatedIterations = 0;
+ this.useFRGridVariant = FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION;
+ this.grid = [];
};
- module3.exports = Emitter3;
- }
- /******/
- ])
- );
- });
- }
- });
-
- // ../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js
- var require_cose_base2 = __commonJS({
- "../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js"(exports2, module2) {
- "use strict";
- (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) {
- if (typeof exports2 === "object" && typeof module2 === "object")
- module2.exports = factory(require_layout_base2());
- else if (typeof define === "function" && define.amd)
- define(["layout-base"], factory);
- else if (typeof exports2 === "object")
- exports2["coseBase"] = factory(require_layout_base2());
- else
- root4["coseBase"] = factory(root4["layoutBase"]);
- }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE__551__) {
- return (
- /******/
- (() => {
- "use strict";
- var __webpack_modules__ = {
- /***/
- 45: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var coseBase = {};
- coseBase.layoutBase = __webpack_require__2(551);
- coseBase.CoSEConstants = __webpack_require__2(806);
- coseBase.CoSEEdge = __webpack_require__2(767);
- coseBase.CoSEGraph = __webpack_require__2(880);
- coseBase.CoSEGraphManager = __webpack_require__2(578);
- coseBase.CoSELayout = __webpack_require__2(765);
- coseBase.CoSENode = __webpack_require__2(991);
- coseBase.ConstraintHandler = __webpack_require__2(902);
- module3.exports = coseBase;
+ FDLayout.prototype.calcIdealEdgeLengths = function() {
+ var edge;
+ var originalIdealLength;
+ var lcaDepth;
+ var source;
+ var target;
+ var sizeOfSourceInLca;
+ var sizeOfTargetInLca;
+ var allEdges = this.getGraphManager().getAllEdges();
+ for (var i2 = 0; i2 < allEdges.length; i2++) {
+ edge = allEdges[i2];
+ originalIdealLength = edge.idealLength;
+ if (edge.isInterGraph) {
+ source = edge.getSource();
+ target = edge.getTarget();
+ sizeOfSourceInLca = edge.getSourceInLca().getEstimatedSize();
+ sizeOfTargetInLca = edge.getTargetInLca().getEstimatedSize();
+ if (this.useSmartIdealEdgeLengthCalculation) {
+ edge.idealLength += sizeOfSourceInLca + sizeOfTargetInLca - 2 * LayoutConstants.SIMPLE_NODE_SIZE;
+ }
+ lcaDepth = edge.getLca().getInclusionTreeDepth();
+ edge.idealLength += originalIdealLength * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth);
+ }
}
- ),
- /***/
- 806: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var FDLayoutConstants = __webpack_require__2(551).FDLayoutConstants;
- function CoSEConstants() {
+ };
+ FDLayout.prototype.initSpringEmbedder = function() {
+ var s2 = this.getAllNodes().length;
+ if (this.incremental) {
+ if (s2 > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {
+ this.coolingFactor = Math.max(this.coolingFactor * FDLayoutConstants.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s2 - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));
}
- __name(CoSEConstants, "CoSEConstants");
- for (var prop in FDLayoutConstants) {
- CoSEConstants[prop] = FDLayoutConstants[prop];
+ this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL;
+ } else {
+ if (s2 > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {
+ this.coolingFactor = Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR, 1 - (s2 - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));
+ } else {
+ this.coolingFactor = 1;
}
- CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false;
- CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
- CoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60;
- CoSEConstants.TILE = true;
- CoSEConstants.TILING_PADDING_VERTICAL = 10;
- CoSEConstants.TILING_PADDING_HORIZONTAL = 10;
- CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true;
- CoSEConstants.ENFORCE_CONSTRAINTS = true;
- CoSEConstants.APPLY_LAYOUT = true;
- CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS = true;
- CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = true;
- CoSEConstants.PURE_INCREMENTAL = CoSEConstants.DEFAULT_INCREMENTAL;
- module3.exports = CoSEConstants;
+ this.initialCoolingFactor = this.coolingFactor;
+ this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT;
}
- ),
- /***/
- 767: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var FDLayoutEdge = __webpack_require__2(551).FDLayoutEdge;
- function CoSEEdge(source, target, vEdge) {
- FDLayoutEdge.call(this, source, target, vEdge);
+ this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations);
+ this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100;
+ this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length;
+ this.repulsionRange = this.calcRepulsionRange();
+ };
+ FDLayout.prototype.calcSpringForces = function() {
+ var lEdges = this.getAllEdges();
+ var edge;
+ for (var i2 = 0; i2 < lEdges.length; i2++) {
+ edge = lEdges[i2];
+ this.calcSpringForce(edge, edge.idealLength);
+ }
+ };
+ FDLayout.prototype.calcRepulsionForces = function() {
+ var gridUpdateAllowed = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
+ var forceToNodeSurroundingUpdate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
+ var i2, j2;
+ var nodeA, nodeB;
+ var lNodes = this.getAllNodes();
+ var processedNodeSet;
+ if (this.useFRGridVariant) {
+ if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed) {
+ this.updateGrid();
}
- __name(CoSEEdge, "CoSEEdge");
- CoSEEdge.prototype = Object.create(FDLayoutEdge.prototype);
- for (var prop in FDLayoutEdge) {
- CoSEEdge[prop] = FDLayoutEdge[prop];
+ processedNodeSet = /* @__PURE__ */ new Set();
+ for (i2 = 0; i2 < lNodes.length; i2++) {
+ nodeA = lNodes[i2];
+ this.calculateRepulsionForceOfANode(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate);
+ processedNodeSet.add(nodeA);
+ }
+ } else {
+ for (i2 = 0; i2 < lNodes.length; i2++) {
+ nodeA = lNodes[i2];
+ for (j2 = i2 + 1; j2 < lNodes.length; j2++) {
+ nodeB = lNodes[j2];
+ if (nodeA.getOwner() != nodeB.getOwner()) {
+ continue;
+ }
+ this.calcRepulsionForce(nodeA, nodeB);
+ }
}
- module3.exports = CoSEEdge;
}
- ),
- /***/
- 880: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var LGraph = __webpack_require__2(551).LGraph;
- function CoSEGraph(parent4, graphMgr, vGraph) {
- LGraph.call(this, parent4, graphMgr, vGraph);
+ };
+ FDLayout.prototype.calcGravitationalForces = function() {
+ var node2;
+ var lNodes = this.getAllNodesToApplyGravitation();
+ for (var i2 = 0; i2 < lNodes.length; i2++) {
+ node2 = lNodes[i2];
+ this.calcGravitationalForce(node2);
+ }
+ };
+ FDLayout.prototype.moveNodes = function() {
+ var lNodes = this.getAllNodes();
+ var node2;
+ for (var i2 = 0; i2 < lNodes.length; i2++) {
+ node2 = lNodes[i2];
+ node2.move();
+ }
+ };
+ FDLayout.prototype.calcSpringForce = function(edge, idealLength) {
+ var sourceNode = edge.getSource();
+ var targetNode = edge.getTarget();
+ var length2;
+ var springForce;
+ var springForceX;
+ var springForceY;
+ if (this.uniformLeafNodeSizes && sourceNode.getChild() == null && targetNode.getChild() == null) {
+ edge.updateLengthSimple();
+ } else {
+ edge.updateLength();
+ if (edge.isOverlapingSourceAndTarget) {
+ return;
}
- __name(CoSEGraph, "CoSEGraph");
- CoSEGraph.prototype = Object.create(LGraph.prototype);
- for (var prop in LGraph) {
- CoSEGraph[prop] = LGraph[prop];
+ }
+ length2 = edge.getLength();
+ if (length2 == 0) return;
+ springForce = edge.edgeElasticity * (length2 - idealLength);
+ springForceX = springForce * (edge.lengthX / length2);
+ springForceY = springForce * (edge.lengthY / length2);
+ sourceNode.springForceX += springForceX;
+ sourceNode.springForceY += springForceY;
+ targetNode.springForceX -= springForceX;
+ targetNode.springForceY -= springForceY;
+ };
+ FDLayout.prototype.calcRepulsionForce = function(nodeA, nodeB) {
+ var rectA = nodeA.getRect();
+ var rectB = nodeB.getRect();
+ var overlapAmount = new Array(2);
+ var clipPoints = new Array(4);
+ var distanceX;
+ var distanceY;
+ var distanceSquared;
+ var distance2;
+ var repulsionForce;
+ var repulsionForceX;
+ var repulsionForceY;
+ if (rectA.intersects(rectB)) {
+ IGeometry.calcSeparationAmount(rectA, rectB, overlapAmount, FDLayoutConstants.DEFAULT_EDGE_LENGTH / 2);
+ repulsionForceX = 2 * overlapAmount[0];
+ repulsionForceY = 2 * overlapAmount[1];
+ var childrenConstant = nodeA.noOfChildren * nodeB.noOfChildren / (nodeA.noOfChildren + nodeB.noOfChildren);
+ nodeA.repulsionForceX -= childrenConstant * repulsionForceX;
+ nodeA.repulsionForceY -= childrenConstant * repulsionForceY;
+ nodeB.repulsionForceX += childrenConstant * repulsionForceX;
+ nodeB.repulsionForceY += childrenConstant * repulsionForceY;
+ } else {
+ if (this.uniformLeafNodeSizes && nodeA.getChild() == null && nodeB.getChild() == null) {
+ distanceX = rectB.getCenterX() - rectA.getCenterX();
+ distanceY = rectB.getCenterY() - rectA.getCenterY();
+ } else {
+ IGeometry.getIntersection(rectA, rectB, clipPoints);
+ distanceX = clipPoints[2] - clipPoints[0];
+ distanceY = clipPoints[3] - clipPoints[1];
}
- module3.exports = CoSEGraph;
+ if (Math.abs(distanceX) < FDLayoutConstants.MIN_REPULSION_DIST) {
+ distanceX = IMath.sign(distanceX) * FDLayoutConstants.MIN_REPULSION_DIST;
+ }
+ if (Math.abs(distanceY) < FDLayoutConstants.MIN_REPULSION_DIST) {
+ distanceY = IMath.sign(distanceY) * FDLayoutConstants.MIN_REPULSION_DIST;
+ }
+ distanceSquared = distanceX * distanceX + distanceY * distanceY;
+ distance2 = Math.sqrt(distanceSquared);
+ repulsionForce = (nodeA.nodeRepulsion / 2 + nodeB.nodeRepulsion / 2) * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared;
+ repulsionForceX = repulsionForce * distanceX / distance2;
+ repulsionForceY = repulsionForce * distanceY / distance2;
+ nodeA.repulsionForceX -= repulsionForceX;
+ nodeA.repulsionForceY -= repulsionForceY;
+ nodeB.repulsionForceX += repulsionForceX;
+ nodeB.repulsionForceY += repulsionForceY;
}
- ),
- /***/
- 578: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var LGraphManager = __webpack_require__2(551).LGraphManager;
- function CoSEGraphManager(layout6) {
- LGraphManager.call(this, layout6);
+ };
+ FDLayout.prototype.calcGravitationalForce = function(node2) {
+ var ownerGraph;
+ var ownerCenterX;
+ var ownerCenterY;
+ var distanceX;
+ var distanceY;
+ var absDistanceX;
+ var absDistanceY;
+ var estimatedSize;
+ ownerGraph = node2.getOwner();
+ ownerCenterX = (ownerGraph.getRight() + ownerGraph.getLeft()) / 2;
+ ownerCenterY = (ownerGraph.getTop() + ownerGraph.getBottom()) / 2;
+ distanceX = node2.getCenterX() - ownerCenterX;
+ distanceY = node2.getCenterY() - ownerCenterY;
+ absDistanceX = Math.abs(distanceX) + node2.getWidth() / 2;
+ absDistanceY = Math.abs(distanceY) + node2.getHeight() / 2;
+ if (node2.getOwner() == this.graphManager.getRoot()) {
+ estimatedSize = ownerGraph.getEstimatedSize() * this.gravityRangeFactor;
+ if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {
+ node2.gravitationForceX = -this.gravityConstant * distanceX;
+ node2.gravitationForceY = -this.gravityConstant * distanceY;
}
- __name(CoSEGraphManager, "CoSEGraphManager");
- CoSEGraphManager.prototype = Object.create(LGraphManager.prototype);
- for (var prop in LGraphManager) {
- CoSEGraphManager[prop] = LGraphManager[prop];
+ } else {
+ estimatedSize = ownerGraph.getEstimatedSize() * this.compoundGravityRangeFactor;
+ if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {
+ node2.gravitationForceX = -this.gravityConstant * distanceX * this.compoundGravityConstant;
+ node2.gravitationForceY = -this.gravityConstant * distanceY * this.compoundGravityConstant;
}
- module3.exports = CoSEGraphManager;
}
- ),
- /***/
- 765: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var FDLayout = __webpack_require__2(551).FDLayout;
- var CoSEGraphManager = __webpack_require__2(578);
- var CoSEGraph = __webpack_require__2(880);
- var CoSENode = __webpack_require__2(991);
- var CoSEEdge = __webpack_require__2(767);
- var CoSEConstants = __webpack_require__2(806);
- var ConstraintHandler = __webpack_require__2(902);
- var FDLayoutConstants = __webpack_require__2(551).FDLayoutConstants;
- var LayoutConstants = __webpack_require__2(551).LayoutConstants;
- var Point3 = __webpack_require__2(551).Point;
- var PointD = __webpack_require__2(551).PointD;
- var DimensionD2 = __webpack_require__2(551).DimensionD;
- var Layout2 = __webpack_require__2(551).Layout;
- var Integer = __webpack_require__2(551).Integer;
- var IGeometry = __webpack_require__2(551).IGeometry;
- var LGraph = __webpack_require__2(551).LGraph;
- var Transform2 = __webpack_require__2(551).Transform;
- var LinkedList = __webpack_require__2(551).LinkedList;
- function CoSELayout() {
- FDLayout.call(this);
- this.toBeTiled = {};
- this.constraints = {};
+ };
+ FDLayout.prototype.isConverged = function() {
+ var converged;
+ var oscilating = false;
+ if (this.totalIterations > this.maxIterations / 3) {
+ oscilating = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2;
+ }
+ converged = this.totalDisplacement < this.totalDisplacementThreshold;
+ this.oldTotalDisplacement = this.totalDisplacement;
+ return converged || oscilating;
+ };
+ FDLayout.prototype.animate = function() {
+ if (this.animationDuringLayout && !this.isSubLayout) {
+ if (this.notAnimatedIterations == this.animationPeriod) {
+ this.update();
+ this.notAnimatedIterations = 0;
+ } else {
+ this.notAnimatedIterations++;
}
- __name(CoSELayout, "CoSELayout");
- CoSELayout.prototype = Object.create(FDLayout.prototype);
- for (var prop in FDLayout) {
- CoSELayout[prop] = FDLayout[prop];
+ }
+ };
+ FDLayout.prototype.calcNoOfChildrenForAllNodes = function() {
+ var node2;
+ var allNodes = this.graphManager.getAllNodes();
+ for (var i2 = 0; i2 < allNodes.length; i2++) {
+ node2 = allNodes[i2];
+ node2.noOfChildren = node2.getNoOfChildren();
+ }
+ };
+ FDLayout.prototype.calcGrid = function(graph) {
+ var sizeX = 0;
+ var sizeY = 0;
+ sizeX = parseInt(Math.ceil((graph.getRight() - graph.getLeft()) / this.repulsionRange));
+ sizeY = parseInt(Math.ceil((graph.getBottom() - graph.getTop()) / this.repulsionRange));
+ var grid = new Array(sizeX);
+ for (var i2 = 0; i2 < sizeX; i2++) {
+ grid[i2] = new Array(sizeY);
+ }
+ for (var i2 = 0; i2 < sizeX; i2++) {
+ for (var j2 = 0; j2 < sizeY; j2++) {
+ grid[i2][j2] = new Array();
}
- CoSELayout.prototype.newGraphManager = function() {
- var gm = new CoSEGraphManager(this);
- this.graphManager = gm;
- return gm;
- };
- CoSELayout.prototype.newGraph = function(vGraph) {
- return new CoSEGraph(null, this.graphManager, vGraph);
- };
- CoSELayout.prototype.newNode = function(vNode) {
- return new CoSENode(this.graphManager, vNode);
- };
- CoSELayout.prototype.newEdge = function(vEdge) {
- return new CoSEEdge(null, null, vEdge);
- };
- CoSELayout.prototype.initParameters = function() {
- FDLayout.prototype.initParameters.call(this, arguments);
- if (!this.isSubLayout) {
- if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) {
- this.idealEdgeLength = 10;
- } else {
- this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH;
- }
- this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;
- this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;
- this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;
- this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;
- this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;
- this.prunedNodesAll = [];
- this.growTreeIterations = 0;
- this.afterGrowthIterations = 0;
- this.isTreeGrowing = false;
- this.isGrowthFinished = false;
- }
- };
- CoSELayout.prototype.initSpringEmbedder = function() {
- FDLayout.prototype.initSpringEmbedder.call(this);
- this.coolingCycle = 0;
- this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD;
- this.finalTemperature = 0.04;
- this.coolingAdjuster = 1;
- };
- CoSELayout.prototype.layout = function() {
- var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
- if (createBendsAsNeeded) {
- this.createBendpoints();
- this.graphManager.resetAllEdges();
- }
- this.level = 0;
- return this.classicLayout();
- };
- CoSELayout.prototype.classicLayout = function() {
- this.nodesWithGravity = this.calculateNodesToApplyGravitationTo();
- this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);
- this.calcNoOfChildrenForAllNodes();
- this.graphManager.calcLowestCommonAncestors();
- this.graphManager.calcInclusionTreeDepths();
- this.graphManager.getRoot().calcEstimatedSize();
- this.calcIdealEdgeLengths();
- if (!this.incremental) {
- var forest = this.getFlatForest();
- if (forest.length > 0) {
- this.positionNodesRadially(forest);
- } else {
- this.reduceTrees();
- this.graphManager.resetAllNodesToApplyGravitation();
- var allNodes = new Set(this.getAllNodes());
- var intersection3 = this.nodesWithGravity.filter(function(x5) {
- return allNodes.has(x5);
- });
- this.graphManager.setAllNodesToApplyGravitation(intersection3);
- this.positionNodesRandomly();
- }
- } else {
- if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) {
- this.reduceTrees();
- this.graphManager.resetAllNodesToApplyGravitation();
- var allNodes = new Set(this.getAllNodes());
- var intersection3 = this.nodesWithGravity.filter(function(x5) {
- return allNodes.has(x5);
- });
- this.graphManager.setAllNodesToApplyGravitation(intersection3);
- }
- }
- if (Object.keys(this.constraints).length > 0) {
- ConstraintHandler.handleConstraints(this);
- this.initConstraintVariables();
- }
- this.initSpringEmbedder();
- if (CoSEConstants.APPLY_LAYOUT) {
- this.runSpringEmbedder();
- }
- return true;
- };
- CoSELayout.prototype.tick = function() {
- this.totalIterations++;
- if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {
- if (this.prunedNodesAll.length > 0) {
- this.isTreeGrowing = true;
- } else {
- return true;
- }
- }
- if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
- if (this.isConverged()) {
- if (this.prunedNodesAll.length > 0) {
- this.isTreeGrowing = true;
- } else {
- return true;
- }
- }
- this.coolingCycle++;
- if (this.layoutQuality == 0) {
- this.coolingAdjuster = this.coolingCycle;
- } else if (this.layoutQuality == 1) {
- this.coolingAdjuster = this.coolingCycle / 3;
- }
- this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature);
- this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
- }
- if (this.isTreeGrowing) {
- if (this.growTreeIterations % 10 == 0) {
- if (this.prunedNodesAll.length > 0) {
- this.graphManager.updateBounds();
- this.updateGrid();
- this.growTree(this.prunedNodesAll);
- this.graphManager.resetAllNodesToApplyGravitation();
- var allNodes = new Set(this.getAllNodes());
- var intersection3 = this.nodesWithGravity.filter(function(x5) {
- return allNodes.has(x5);
- });
- this.graphManager.setAllNodesToApplyGravitation(intersection3);
- this.graphManager.updateBounds();
- this.updateGrid();
- if (CoSEConstants.PURE_INCREMENTAL) this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2;
- else this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
- } else {
- this.isTreeGrowing = false;
- this.isGrowthFinished = true;
- }
- }
- this.growTreeIterations++;
- }
- if (this.isGrowthFinished) {
- if (this.isConverged()) {
- return true;
- }
- if (this.afterGrowthIterations % 10 == 0) {
- this.graphManager.updateBounds();
- this.updateGrid();
- }
- if (CoSEConstants.PURE_INCREMENTAL) this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100);
- else this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100);
- this.afterGrowthIterations++;
- }
- var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished;
- var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
- this.totalDisplacement = 0;
- this.graphManager.updateBounds();
- this.calcSpringForces();
- this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate);
- this.calcGravitationalForces();
- this.moveNodes();
- this.animate();
- return false;
- };
- CoSELayout.prototype.getPositionsData = function() {
- var allNodes = this.graphManager.getAllNodes();
- var pData = {};
- for (var i2 = 0; i2 < allNodes.length; i2++) {
- var rect4 = allNodes[i2].rect;
- var id27 = allNodes[i2].id;
- pData[id27] = {
- id: id27,
- x: rect4.getCenterX(),
- y: rect4.getCenterY(),
- w: rect4.width,
- h: rect4.height
- };
- }
- return pData;
- };
- CoSELayout.prototype.runSpringEmbedder = function() {
- this.initialAnimationPeriod = 25;
- this.animationPeriod = this.initialAnimationPeriod;
- var layoutEnded = false;
- if (FDLayoutConstants.ANIMATE === "during") {
- this.emit("layoutstarted");
- } else {
- while (!layoutEnded) {
- layoutEnded = this.tick();
- }
- this.graphManager.updateBounds();
- }
- };
- CoSELayout.prototype.moveNodes = function() {
- var lNodes = this.getAllNodes();
- var node2;
- for (var i2 = 0; i2 < lNodes.length; i2++) {
- node2 = lNodes[i2];
- node2.calculateDisplacement();
- }
- if (Object.keys(this.constraints).length > 0) {
- this.updateDisplacements();
- }
- for (var i2 = 0; i2 < lNodes.length; i2++) {
- node2 = lNodes[i2];
- node2.move();
- }
- };
- CoSELayout.prototype.initConstraintVariables = function() {
- var self2 = this;
- this.idToNodeMap = /* @__PURE__ */ new Map();
- this.fixedNodeSet = /* @__PURE__ */ new Set();
- var allNodes = this.graphManager.getAllNodes();
- for (var i2 = 0; i2 < allNodes.length; i2++) {
- var node2 = allNodes[i2];
- this.idToNodeMap.set(node2.id, node2);
- }
- var calculateCompoundWeight = /* @__PURE__ */ __name(function calculateCompoundWeight2(compoundNode) {
- var nodes6 = compoundNode.getChild().getNodes();
- var node3;
- var fixedNodeWeight2 = 0;
- for (var i3 = 0; i3 < nodes6.length; i3++) {
- node3 = nodes6[i3];
- if (node3.getChild() == null) {
- if (self2.fixedNodeSet.has(node3.id)) {
- fixedNodeWeight2 += 100;
+ }
+ return grid;
+ };
+ FDLayout.prototype.addNodeToGrid = function(v3, left3, top2) {
+ var startX2 = 0;
+ var finishX = 0;
+ var startY2 = 0;
+ var finishY = 0;
+ startX2 = parseInt(Math.floor((v3.getRect().x - left3) / this.repulsionRange));
+ finishX = parseInt(Math.floor((v3.getRect().width + v3.getRect().x - left3) / this.repulsionRange));
+ startY2 = parseInt(Math.floor((v3.getRect().y - top2) / this.repulsionRange));
+ finishY = parseInt(Math.floor((v3.getRect().height + v3.getRect().y - top2) / this.repulsionRange));
+ for (var i2 = startX2; i2 <= finishX; i2++) {
+ for (var j2 = startY2; j2 <= finishY; j2++) {
+ this.grid[i2][j2].push(v3);
+ v3.setGridCoordinates(startX2, finishX, startY2, finishY);
+ }
+ }
+ };
+ FDLayout.prototype.updateGrid = function() {
+ var i2;
+ var nodeA;
+ var lNodes = this.getAllNodes();
+ this.grid = this.calcGrid(this.graphManager.getRoot());
+ for (i2 = 0; i2 < lNodes.length; i2++) {
+ nodeA = lNodes[i2];
+ this.addNodeToGrid(nodeA, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
+ }
+ };
+ FDLayout.prototype.calculateRepulsionForceOfANode = function(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate) {
+ if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed || forceToNodeSurroundingUpdate) {
+ var surrounding = /* @__PURE__ */ new Set();
+ nodeA.surrounding = new Array();
+ var nodeB;
+ var grid = this.grid;
+ for (var i2 = nodeA.startX - 1; i2 < nodeA.finishX + 2; i2++) {
+ for (var j2 = nodeA.startY - 1; j2 < nodeA.finishY + 2; j2++) {
+ if (!(i2 < 0 || j2 < 0 || i2 >= grid.length || j2 >= grid[0].length)) {
+ for (var k2 = 0; k2 < grid[i2][j2].length; k2++) {
+ nodeB = grid[i2][j2][k2];
+ if (nodeA.getOwner() != nodeB.getOwner() || nodeA == nodeB) {
+ continue;
}
- } else {
- fixedNodeWeight2 += calculateCompoundWeight2(node3);
- }
- }
- return fixedNodeWeight2;
- }, "calculateCompoundWeight");
- if (this.constraints.fixedNodeConstraint) {
- this.constraints.fixedNodeConstraint.forEach(function(nodeData2) {
- self2.fixedNodeSet.add(nodeData2.nodeId);
- });
- var allNodes = this.graphManager.getAllNodes();
- var node2;
- for (var i2 = 0; i2 < allNodes.length; i2++) {
- node2 = allNodes[i2];
- if (node2.getChild() != null) {
- var fixedNodeWeight = calculateCompoundWeight(node2);
- if (fixedNodeWeight > 0) {
- node2.fixedNodeWeight = fixedNodeWeight;
+ if (!processedNodeSet.has(nodeB) && !surrounding.has(nodeB)) {
+ var distanceX = Math.abs(nodeA.getCenterX() - nodeB.getCenterX()) - (nodeA.getWidth() / 2 + nodeB.getWidth() / 2);
+ var distanceY = Math.abs(nodeA.getCenterY() - nodeB.getCenterY()) - (nodeA.getHeight() / 2 + nodeB.getHeight() / 2);
+ if (distanceX <= this.repulsionRange && distanceY <= this.repulsionRange) {
+ surrounding.add(nodeB);
+ }
}
}
}
}
- if (this.constraints.relativePlacementConstraint) {
- var nodeToDummyForVerticalAlignment = /* @__PURE__ */ new Map();
- var nodeToDummyForHorizontalAlignment = /* @__PURE__ */ new Map();
- this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map();
- this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map();
- this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set();
- this.fixedNodesOnVertical = /* @__PURE__ */ new Set();
- this.fixedNodeSet.forEach(function(nodeId) {
- self2.fixedNodesOnHorizontal.add(nodeId);
- self2.fixedNodesOnVertical.add(nodeId);
- });
- if (this.constraints.alignmentConstraint) {
- if (this.constraints.alignmentConstraint.vertical) {
- var verticalAlignment2 = this.constraints.alignmentConstraint.vertical;
- for (var i2 = 0; i2 < verticalAlignment2.length; i2++) {
- this.dummyToNodeForVerticalAlignment.set("dummy" + i2, []);
- verticalAlignment2[i2].forEach(function(nodeId) {
- nodeToDummyForVerticalAlignment.set(nodeId, "dummy" + i2);
- self2.dummyToNodeForVerticalAlignment.get("dummy" + i2).push(nodeId);
- if (self2.fixedNodeSet.has(nodeId)) {
- self2.fixedNodesOnHorizontal.add("dummy" + i2);
- }
- });
- }
- }
- if (this.constraints.alignmentConstraint.horizontal) {
- var horizontalAlignment = this.constraints.alignmentConstraint.horizontal;
- for (var i2 = 0; i2 < horizontalAlignment.length; i2++) {
- this.dummyToNodeForHorizontalAlignment.set("dummy" + i2, []);
- horizontalAlignment[i2].forEach(function(nodeId) {
- nodeToDummyForHorizontalAlignment.set(nodeId, "dummy" + i2);
- self2.dummyToNodeForHorizontalAlignment.get("dummy" + i2).push(nodeId);
- if (self2.fixedNodeSet.has(nodeId)) {
- self2.fixedNodesOnVertical.add("dummy" + i2);
- }
- });
- }
- }
- }
- if (CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS) {
- this.shuffle = function(array4) {
- var j2, x5, i3;
- for (i3 = array4.length - 1; i3 >= 2 * array4.length / 3; i3--) {
- j2 = Math.floor(Math.random() * (i3 + 1));
- x5 = array4[i3];
- array4[i3] = array4[j2];
- array4[j2] = x5;
- }
- return array4;
- };
- this.nodesInRelativeHorizontal = [];
- this.nodesInRelativeVertical = [];
- this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map();
- this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map();
- this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map();
- this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map();
- this.constraints.relativePlacementConstraint.forEach(function(constraint) {
- if (constraint.left) {
- var nodeIdLeft = nodeToDummyForVerticalAlignment.has(constraint.left) ? nodeToDummyForVerticalAlignment.get(constraint.left) : constraint.left;
- var nodeIdRight = nodeToDummyForVerticalAlignment.has(constraint.right) ? nodeToDummyForVerticalAlignment.get(constraint.right) : constraint.right;
- if (!self2.nodesInRelativeHorizontal.includes(nodeIdLeft)) {
- self2.nodesInRelativeHorizontal.push(nodeIdLeft);
- self2.nodeToRelativeConstraintMapHorizontal.set(nodeIdLeft, []);
- if (self2.dummyToNodeForVerticalAlignment.has(nodeIdLeft)) {
- self2.nodeToTempPositionMapHorizontal.set(nodeIdLeft, self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeIdLeft)[0]).getCenterX());
- } else {
- self2.nodeToTempPositionMapHorizontal.set(nodeIdLeft, self2.idToNodeMap.get(nodeIdLeft).getCenterX());
- }
- }
- if (!self2.nodesInRelativeHorizontal.includes(nodeIdRight)) {
- self2.nodesInRelativeHorizontal.push(nodeIdRight);
- self2.nodeToRelativeConstraintMapHorizontal.set(nodeIdRight, []);
- if (self2.dummyToNodeForVerticalAlignment.has(nodeIdRight)) {
- self2.nodeToTempPositionMapHorizontal.set(nodeIdRight, self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeIdRight)[0]).getCenterX());
- } else {
- self2.nodeToTempPositionMapHorizontal.set(nodeIdRight, self2.idToNodeMap.get(nodeIdRight).getCenterX());
- }
- }
- self2.nodeToRelativeConstraintMapHorizontal.get(nodeIdLeft).push({ right: nodeIdRight, gap: constraint.gap });
- self2.nodeToRelativeConstraintMapHorizontal.get(nodeIdRight).push({ left: nodeIdLeft, gap: constraint.gap });
- } else {
- var nodeIdTop = nodeToDummyForHorizontalAlignment.has(constraint.top) ? nodeToDummyForHorizontalAlignment.get(constraint.top) : constraint.top;
- var nodeIdBottom = nodeToDummyForHorizontalAlignment.has(constraint.bottom) ? nodeToDummyForHorizontalAlignment.get(constraint.bottom) : constraint.bottom;
- if (!self2.nodesInRelativeVertical.includes(nodeIdTop)) {
- self2.nodesInRelativeVertical.push(nodeIdTop);
- self2.nodeToRelativeConstraintMapVertical.set(nodeIdTop, []);
- if (self2.dummyToNodeForHorizontalAlignment.has(nodeIdTop)) {
- self2.nodeToTempPositionMapVertical.set(nodeIdTop, self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeIdTop)[0]).getCenterY());
- } else {
- self2.nodeToTempPositionMapVertical.set(nodeIdTop, self2.idToNodeMap.get(nodeIdTop).getCenterY());
- }
- }
- if (!self2.nodesInRelativeVertical.includes(nodeIdBottom)) {
- self2.nodesInRelativeVertical.push(nodeIdBottom);
- self2.nodeToRelativeConstraintMapVertical.set(nodeIdBottom, []);
- if (self2.dummyToNodeForHorizontalAlignment.has(nodeIdBottom)) {
- self2.nodeToTempPositionMapVertical.set(nodeIdBottom, self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeIdBottom)[0]).getCenterY());
- } else {
- self2.nodeToTempPositionMapVertical.set(nodeIdBottom, self2.idToNodeMap.get(nodeIdBottom).getCenterY());
- }
- }
- self2.nodeToRelativeConstraintMapVertical.get(nodeIdTop).push({ bottom: nodeIdBottom, gap: constraint.gap });
- self2.nodeToRelativeConstraintMapVertical.get(nodeIdBottom).push({ top: nodeIdTop, gap: constraint.gap });
- }
- });
- } else {
- var subGraphOnHorizontal = /* @__PURE__ */ new Map();
- var subGraphOnVertical = /* @__PURE__ */ new Map();
- this.constraints.relativePlacementConstraint.forEach(function(constraint) {
- if (constraint.left) {
- var left3 = nodeToDummyForVerticalAlignment.has(constraint.left) ? nodeToDummyForVerticalAlignment.get(constraint.left) : constraint.left;
- var right3 = nodeToDummyForVerticalAlignment.has(constraint.right) ? nodeToDummyForVerticalAlignment.get(constraint.right) : constraint.right;
- if (subGraphOnHorizontal.has(left3)) {
- subGraphOnHorizontal.get(left3).push(right3);
- } else {
- subGraphOnHorizontal.set(left3, [right3]);
- }
- if (subGraphOnHorizontal.has(right3)) {
- subGraphOnHorizontal.get(right3).push(left3);
- } else {
- subGraphOnHorizontal.set(right3, [left3]);
- }
- } else {
- var top2 = nodeToDummyForHorizontalAlignment.has(constraint.top) ? nodeToDummyForHorizontalAlignment.get(constraint.top) : constraint.top;
- var bottom2 = nodeToDummyForHorizontalAlignment.has(constraint.bottom) ? nodeToDummyForHorizontalAlignment.get(constraint.bottom) : constraint.bottom;
- if (subGraphOnVertical.has(top2)) {
- subGraphOnVertical.get(top2).push(bottom2);
- } else {
- subGraphOnVertical.set(top2, [bottom2]);
- }
- if (subGraphOnVertical.has(bottom2)) {
- subGraphOnVertical.get(bottom2).push(top2);
- } else {
- subGraphOnVertical.set(bottom2, [top2]);
- }
- }
- });
- var constructComponents = /* @__PURE__ */ __name(function constructComponents2(graph, fixedNodes) {
- var components3 = [];
- var isFixed = [];
- var queue = new LinkedList();
- var visited = /* @__PURE__ */ new Set();
- var count = 0;
- graph.forEach(function(value2, key) {
- if (!visited.has(key)) {
- components3[count] = [];
- isFixed[count] = false;
- var currentNode = key;
- queue.push(currentNode);
- visited.add(currentNode);
- components3[count].push(currentNode);
- while (queue.length != 0) {
- currentNode = queue.shift();
- if (fixedNodes.has(currentNode)) {
- isFixed[count] = true;
- }
- var neighbors = graph.get(currentNode);
- neighbors.forEach(function(neighbor) {
- if (!visited.has(neighbor)) {
- queue.push(neighbor);
- visited.add(neighbor);
- components3[count].push(neighbor);
- }
- });
- }
- count++;
- }
- });
- return { components: components3, isFixed };
- }, "constructComponents");
- var resultOnHorizontal = constructComponents(subGraphOnHorizontal, self2.fixedNodesOnHorizontal);
- this.componentsOnHorizontal = resultOnHorizontal.components;
- this.fixedComponentsOnHorizontal = resultOnHorizontal.isFixed;
- var resultOnVertical = constructComponents(subGraphOnVertical, self2.fixedNodesOnVertical);
- this.componentsOnVertical = resultOnVertical.components;
- this.fixedComponentsOnVertical = resultOnVertical.isFixed;
- }
+ }
+ nodeA.surrounding = [].concat(_toConsumableArray2(surrounding));
+ }
+ for (i2 = 0; i2 < nodeA.surrounding.length; i2++) {
+ this.calcRepulsionForce(nodeA, nodeA.surrounding[i2]);
+ }
+ };
+ FDLayout.prototype.calcRepulsionRange = function() {
+ return 0;
+ };
+ module3.exports = FDLayout;
+ },
+ /* 19 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var LEdge = __webpack_require__(1);
+ var FDLayoutConstants = __webpack_require__(4);
+ function FDLayoutEdge(source, target, vEdge) {
+ LEdge.call(this, source, target, vEdge);
+ this.idealLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
+ this.edgeElasticity = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;
+ }
+ __name(FDLayoutEdge, "FDLayoutEdge");
+ FDLayoutEdge.prototype = Object.create(LEdge.prototype);
+ for (var prop in LEdge) {
+ FDLayoutEdge[prop] = LEdge[prop];
+ }
+ module3.exports = FDLayoutEdge;
+ },
+ /* 20 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var LNode = __webpack_require__(3);
+ var FDLayoutConstants = __webpack_require__(4);
+ function FDLayoutNode(gm, loc, size5, vNode) {
+ LNode.call(this, gm, loc, size5, vNode);
+ this.nodeRepulsion = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;
+ this.springForceX = 0;
+ this.springForceY = 0;
+ this.repulsionForceX = 0;
+ this.repulsionForceY = 0;
+ this.gravitationForceX = 0;
+ this.gravitationForceY = 0;
+ this.displacementX = 0;
+ this.displacementY = 0;
+ this.startX = 0;
+ this.finishX = 0;
+ this.startY = 0;
+ this.finishY = 0;
+ this.surrounding = [];
+ }
+ __name(FDLayoutNode, "FDLayoutNode");
+ FDLayoutNode.prototype = Object.create(LNode.prototype);
+ for (var prop in LNode) {
+ FDLayoutNode[prop] = LNode[prop];
+ }
+ FDLayoutNode.prototype.setGridCoordinates = function(_startX, _finishX, _startY, _finishY) {
+ this.startX = _startX;
+ this.finishX = _finishX;
+ this.startY = _startY;
+ this.finishY = _finishY;
+ };
+ module3.exports = FDLayoutNode;
+ },
+ /* 21 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function DimensionD2(width3, height2) {
+ this.width = 0;
+ this.height = 0;
+ if (width3 !== null && height2 !== null) {
+ this.height = height2;
+ this.width = width3;
+ }
+ }
+ __name(DimensionD2, "DimensionD");
+ DimensionD2.prototype.getWidth = function() {
+ return this.width;
+ };
+ DimensionD2.prototype.setWidth = function(width3) {
+ this.width = width3;
+ };
+ DimensionD2.prototype.getHeight = function() {
+ return this.height;
+ };
+ DimensionD2.prototype.setHeight = function(height2) {
+ this.height = height2;
+ };
+ module3.exports = DimensionD2;
+ },
+ /* 22 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var UniqueIDGeneretor = __webpack_require__(14);
+ function HashMap() {
+ this.map = {};
+ this.keys = [];
+ }
+ __name(HashMap, "HashMap");
+ HashMap.prototype.put = function(key, value2) {
+ var theId = UniqueIDGeneretor.createID(key);
+ if (!this.contains(theId)) {
+ this.map[theId] = value2;
+ this.keys.push(key);
+ }
+ };
+ HashMap.prototype.contains = function(key) {
+ var theId = UniqueIDGeneretor.createID(key);
+ return this.map[key] != null;
+ };
+ HashMap.prototype.get = function(key) {
+ var theId = UniqueIDGeneretor.createID(key);
+ return this.map[theId];
+ };
+ HashMap.prototype.keySet = function() {
+ return this.keys;
+ };
+ module3.exports = HashMap;
+ },
+ /* 23 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var UniqueIDGeneretor = __webpack_require__(14);
+ function HashSet() {
+ this.set = {};
+ }
+ __name(HashSet, "HashSet");
+ ;
+ HashSet.prototype.add = function(obj) {
+ var theId = UniqueIDGeneretor.createID(obj);
+ if (!this.contains(theId)) this.set[theId] = obj;
+ };
+ HashSet.prototype.remove = function(obj) {
+ delete this.set[UniqueIDGeneretor.createID(obj)];
+ };
+ HashSet.prototype.clear = function() {
+ this.set = {};
+ };
+ HashSet.prototype.contains = function(obj) {
+ return this.set[UniqueIDGeneretor.createID(obj)] == obj;
+ };
+ HashSet.prototype.isEmpty = function() {
+ return this.size() === 0;
+ };
+ HashSet.prototype.size = function() {
+ return Object.keys(this.set).length;
+ };
+ HashSet.prototype.addAllTo = function(list2) {
+ var keys3 = Object.keys(this.set);
+ var length2 = keys3.length;
+ for (var i2 = 0; i2 < length2; i2++) {
+ list2.push(this.set[keys3[i2]]);
+ }
+ };
+ HashSet.prototype.size = function() {
+ return Object.keys(this.set).length;
+ };
+ HashSet.prototype.addAll = function(list2) {
+ var s2 = list2.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ var v3 = list2[i2];
+ this.add(v3);
+ }
+ };
+ module3.exports = HashSet;
+ },
+ /* 24 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function Matrix() {
+ }
+ __name(Matrix, "Matrix");
+ Matrix.multMat = function(array1, array22) {
+ var result = [];
+ for (var i2 = 0; i2 < array1.length; i2++) {
+ result[i2] = [];
+ for (var j2 = 0; j2 < array22[0].length; j2++) {
+ result[i2][j2] = 0;
+ for (var k2 = 0; k2 < array1[0].length; k2++) {
+ result[i2][j2] += array1[i2][k2] * array22[k2][j2];
}
- };
- CoSELayout.prototype.updateDisplacements = function() {
- var self2 = this;
- if (this.constraints.fixedNodeConstraint) {
- this.constraints.fixedNodeConstraint.forEach(function(nodeData2) {
- var fixedNode = self2.idToNodeMap.get(nodeData2.nodeId);
- fixedNode.displacementX = 0;
- fixedNode.displacementY = 0;
- });
+ }
+ }
+ return result;
+ };
+ Matrix.transpose = function(array4) {
+ var result = [];
+ for (var i2 = 0; i2 < array4[0].length; i2++) {
+ result[i2] = [];
+ for (var j2 = 0; j2 < array4.length; j2++) {
+ result[i2][j2] = array4[j2][i2];
+ }
+ }
+ return result;
+ };
+ Matrix.multCons = function(array4, constant3) {
+ var result = [];
+ for (var i2 = 0; i2 < array4.length; i2++) {
+ result[i2] = array4[i2] * constant3;
+ }
+ return result;
+ };
+ Matrix.minusOp = function(array1, array22) {
+ var result = [];
+ for (var i2 = 0; i2 < array1.length; i2++) {
+ result[i2] = array1[i2] - array22[i2];
+ }
+ return result;
+ };
+ Matrix.dotProduct = function(array1, array22) {
+ var product = 0;
+ for (var i2 = 0; i2 < array1.length; i2++) {
+ product += array1[i2] * array22[i2];
+ }
+ return product;
+ };
+ Matrix.mag = function(array4) {
+ return Math.sqrt(this.dotProduct(array4, array4));
+ };
+ Matrix.normalize = function(array4) {
+ var result = [];
+ var magnitude = this.mag(array4);
+ for (var i2 = 0; i2 < array4.length; i2++) {
+ result[i2] = array4[i2] / magnitude;
+ }
+ return result;
+ };
+ Matrix.multGamma = function(array4) {
+ var result = [];
+ var sum2 = 0;
+ for (var i2 = 0; i2 < array4.length; i2++) {
+ sum2 += array4[i2];
+ }
+ sum2 *= -1 / array4.length;
+ for (var _i = 0; _i < array4.length; _i++) {
+ result[_i] = sum2 + array4[_i];
+ }
+ return result;
+ };
+ Matrix.multL = function(array4, C2, INV) {
+ var result = [];
+ var temp1 = [];
+ var temp2 = [];
+ for (var i2 = 0; i2 < C2[0].length; i2++) {
+ var sum2 = 0;
+ for (var j2 = 0; j2 < C2.length; j2++) {
+ sum2 += -0.5 * C2[j2][i2] * array4[j2];
+ }
+ temp1[i2] = sum2;
+ }
+ for (var _i2 = 0; _i2 < INV.length; _i2++) {
+ var _sum = 0;
+ for (var _j = 0; _j < INV.length; _j++) {
+ _sum += INV[_i2][_j] * temp1[_j];
+ }
+ temp2[_i2] = _sum;
+ }
+ for (var _i3 = 0; _i3 < C2.length; _i3++) {
+ var _sum2 = 0;
+ for (var _j2 = 0; _j2 < C2[0].length; _j2++) {
+ _sum2 += C2[_i3][_j2] * temp2[_j2];
+ }
+ result[_i3] = _sum2;
+ }
+ return result;
+ };
+ module3.exports = Matrix;
+ },
+ /* 25 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var _createClass2 = /* @__PURE__ */ function() {
+ function defineProperties(target, props) {
+ for (var i2 = 0; i2 < props.length; i2++) {
+ var descriptor = props[i2];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+ __name(defineProperties, "defineProperties");
+ return function(Constructor, protoProps, staticProps) {
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) defineProperties(Constructor, staticProps);
+ return Constructor;
+ };
+ }();
+ function _classCallCheck2(instance2, Constructor) {
+ if (!(instance2 instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
+ __name(_classCallCheck2, "_classCallCheck");
+ var LinkedList = __webpack_require__(11);
+ var Quicksort = function() {
+ function Quicksort2(A2, compareFunction) {
+ _classCallCheck2(this, Quicksort2);
+ if (compareFunction !== null || compareFunction !== void 0) this.compareFunction = this._defaultCompareFunction;
+ var length2 = void 0;
+ if (A2 instanceof LinkedList) length2 = A2.size();
+ else length2 = A2.length;
+ this._quicksort(A2, 0, length2 - 1);
+ }
+ __name(Quicksort2, "Quicksort");
+ _createClass2(Quicksort2, [{
+ key: "_quicksort",
+ value: /* @__PURE__ */ __name(function _quicksort(A2, p3, r2) {
+ if (p3 < r2) {
+ var q2 = this._partition(A2, p3, r2);
+ this._quicksort(A2, p3, q2);
+ this._quicksort(A2, q2 + 1, r2);
}
- if (this.constraints.alignmentConstraint) {
- if (this.constraints.alignmentConstraint.vertical) {
- var allVerticalAlignments = this.constraints.alignmentConstraint.vertical;
- for (var i2 = 0; i2 < allVerticalAlignments.length; i2++) {
- var totalDisplacementX = 0;
- for (var j2 = 0; j2 < allVerticalAlignments[i2].length; j2++) {
- if (this.fixedNodeSet.has(allVerticalAlignments[i2][j2])) {
- totalDisplacementX = 0;
- break;
- }
- totalDisplacementX += this.idToNodeMap.get(allVerticalAlignments[i2][j2]).displacementX;
- }
- var averageDisplacementX = totalDisplacementX / allVerticalAlignments[i2].length;
- for (var j2 = 0; j2 < allVerticalAlignments[i2].length; j2++) {
- this.idToNodeMap.get(allVerticalAlignments[i2][j2]).displacementX = averageDisplacementX;
- }
- }
+ }, "_quicksort")
+ }, {
+ key: "_partition",
+ value: /* @__PURE__ */ __name(function _partition(A2, p3, r2) {
+ var x5 = this._get(A2, p3);
+ var i2 = p3;
+ var j2 = r2;
+ while (true) {
+ while (this.compareFunction(x5, this._get(A2, j2))) {
+ j2--;
}
- if (this.constraints.alignmentConstraint.horizontal) {
- var allHorizontalAlignments = this.constraints.alignmentConstraint.horizontal;
- for (var i2 = 0; i2 < allHorizontalAlignments.length; i2++) {
- var totalDisplacementY = 0;
- for (var j2 = 0; j2 < allHorizontalAlignments[i2].length; j2++) {
- if (this.fixedNodeSet.has(allHorizontalAlignments[i2][j2])) {
- totalDisplacementY = 0;
- break;
- }
- totalDisplacementY += this.idToNodeMap.get(allHorizontalAlignments[i2][j2]).displacementY;
- }
- var averageDisplacementY = totalDisplacementY / allHorizontalAlignments[i2].length;
- for (var j2 = 0; j2 < allHorizontalAlignments[i2].length; j2++) {
- this.idToNodeMap.get(allHorizontalAlignments[i2][j2]).displacementY = averageDisplacementY;
- }
- }
+ while (this.compareFunction(this._get(A2, i2), x5)) {
+ i2++;
}
+ if (i2 < j2) {
+ this._swap(A2, i2, j2);
+ i2++;
+ j2--;
+ } else return j2;
}
- if (this.constraints.relativePlacementConstraint) {
- if (CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS) {
- if (this.totalIterations % 10 == 0) {
- this.shuffle(this.nodesInRelativeHorizontal);
- this.shuffle(this.nodesInRelativeVertical);
- }
- this.nodesInRelativeHorizontal.forEach(function(nodeId) {
- if (!self2.fixedNodesOnHorizontal.has(nodeId)) {
- var displacement = 0;
- if (self2.dummyToNodeForVerticalAlignment.has(nodeId)) {
- displacement = self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeId)[0]).displacementX;
- } else {
- displacement = self2.idToNodeMap.get(nodeId).displacementX;
- }
- self2.nodeToRelativeConstraintMapHorizontal.get(nodeId).forEach(function(constraint) {
- if (constraint.right) {
- var diff2 = self2.nodeToTempPositionMapHorizontal.get(constraint.right) - self2.nodeToTempPositionMapHorizontal.get(nodeId) - displacement;
- if (diff2 < constraint.gap) {
- displacement -= constraint.gap - diff2;
- }
- } else {
- var diff2 = self2.nodeToTempPositionMapHorizontal.get(nodeId) - self2.nodeToTempPositionMapHorizontal.get(constraint.left) + displacement;
- if (diff2 < constraint.gap) {
- displacement += constraint.gap - diff2;
- }
- }
- });
- self2.nodeToTempPositionMapHorizontal.set(nodeId, self2.nodeToTempPositionMapHorizontal.get(nodeId) + displacement);
- if (self2.dummyToNodeForVerticalAlignment.has(nodeId)) {
- self2.dummyToNodeForVerticalAlignment.get(nodeId).forEach(function(nodeId2) {
- self2.idToNodeMap.get(nodeId2).displacementX = displacement;
- });
- } else {
- self2.idToNodeMap.get(nodeId).displacementX = displacement;
- }
- }
- });
- this.nodesInRelativeVertical.forEach(function(nodeId) {
- if (!self2.fixedNodesOnHorizontal.has(nodeId)) {
- var displacement = 0;
- if (self2.dummyToNodeForHorizontalAlignment.has(nodeId)) {
- displacement = self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeId)[0]).displacementY;
- } else {
- displacement = self2.idToNodeMap.get(nodeId).displacementY;
- }
- self2.nodeToRelativeConstraintMapVertical.get(nodeId).forEach(function(constraint) {
- if (constraint.bottom) {
- var diff2 = self2.nodeToTempPositionMapVertical.get(constraint.bottom) - self2.nodeToTempPositionMapVertical.get(nodeId) - displacement;
- if (diff2 < constraint.gap) {
- displacement -= constraint.gap - diff2;
- }
- } else {
- var diff2 = self2.nodeToTempPositionMapVertical.get(nodeId) - self2.nodeToTempPositionMapVertical.get(constraint.top) + displacement;
- if (diff2 < constraint.gap) {
- displacement += constraint.gap - diff2;
- }
- }
- });
- self2.nodeToTempPositionMapVertical.set(nodeId, self2.nodeToTempPositionMapVertical.get(nodeId) + displacement);
- if (self2.dummyToNodeForHorizontalAlignment.has(nodeId)) {
- self2.dummyToNodeForHorizontalAlignment.get(nodeId).forEach(function(nodeId2) {
- self2.idToNodeMap.get(nodeId2).displacementY = displacement;
- });
- } else {
- self2.idToNodeMap.get(nodeId).displacementY = displacement;
- }
- }
- });
- } else {
- for (var i2 = 0; i2 < this.componentsOnHorizontal.length; i2++) {
- var component2 = this.componentsOnHorizontal[i2];
- if (this.fixedComponentsOnHorizontal[i2]) {
- for (var j2 = 0; j2 < component2.length; j2++) {
- if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) {
- this.dummyToNodeForVerticalAlignment.get(component2[j2]).forEach(function(nodeId) {
- self2.idToNodeMap.get(nodeId).displacementX = 0;
- });
- } else {
- this.idToNodeMap.get(component2[j2]).displacementX = 0;
- }
- }
- } else {
- var sum2 = 0;
- var count = 0;
- for (var j2 = 0; j2 < component2.length; j2++) {
- if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) {
- var actualNodes = this.dummyToNodeForVerticalAlignment.get(component2[j2]);
- sum2 += actualNodes.length * this.idToNodeMap.get(actualNodes[0]).displacementX;
- count += actualNodes.length;
- } else {
- sum2 += this.idToNodeMap.get(component2[j2]).displacementX;
- count++;
- }
- }
- var averageDisplacement = sum2 / count;
- for (var j2 = 0; j2 < component2.length; j2++) {
- if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) {
- this.dummyToNodeForVerticalAlignment.get(component2[j2]).forEach(function(nodeId) {
- self2.idToNodeMap.get(nodeId).displacementX = averageDisplacement;
- });
- } else {
- this.idToNodeMap.get(component2[j2]).displacementX = averageDisplacement;
- }
- }
- }
- }
- for (var i2 = 0; i2 < this.componentsOnVertical.length; i2++) {
- var component2 = this.componentsOnVertical[i2];
- if (this.fixedComponentsOnVertical[i2]) {
- for (var j2 = 0; j2 < component2.length; j2++) {
- if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) {
- this.dummyToNodeForHorizontalAlignment.get(component2[j2]).forEach(function(nodeId) {
- self2.idToNodeMap.get(nodeId).displacementY = 0;
- });
- } else {
- this.idToNodeMap.get(component2[j2]).displacementY = 0;
- }
- }
- } else {
- var sum2 = 0;
- var count = 0;
- for (var j2 = 0; j2 < component2.length; j2++) {
- if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) {
- var actualNodes = this.dummyToNodeForHorizontalAlignment.get(component2[j2]);
- sum2 += actualNodes.length * this.idToNodeMap.get(actualNodes[0]).displacementY;
- count += actualNodes.length;
- } else {
- sum2 += this.idToNodeMap.get(component2[j2]).displacementY;
- count++;
- }
- }
- var averageDisplacement = sum2 / count;
- for (var j2 = 0; j2 < component2.length; j2++) {
- if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) {
- this.dummyToNodeForHorizontalAlignment.get(component2[j2]).forEach(function(nodeId) {
- self2.idToNodeMap.get(nodeId).displacementY = averageDisplacement;
- });
- } else {
- this.idToNodeMap.get(component2[j2]).displacementY = averageDisplacement;
- }
- }
- }
- }
+ }, "_partition")
+ }, {
+ key: "_get",
+ value: /* @__PURE__ */ __name(function _get(object3, index) {
+ if (object3 instanceof LinkedList) return object3.get_object_at(index);
+ else return object3[index];
+ }, "_get")
+ }, {
+ key: "_set",
+ value: /* @__PURE__ */ __name(function _set(object3, index, value2) {
+ if (object3 instanceof LinkedList) object3.set_object_at(index, value2);
+ else object3[index] = value2;
+ }, "_set")
+ }, {
+ key: "_swap",
+ value: /* @__PURE__ */ __name(function _swap(A2, i2, j2) {
+ var temp = this._get(A2, i2);
+ this._set(A2, i2, this._get(A2, j2));
+ this._set(A2, j2, temp);
+ }, "_swap")
+ }, {
+ key: "_defaultCompareFunction",
+ value: /* @__PURE__ */ __name(function _defaultCompareFunction(a2, b2) {
+ return b2 > a2;
+ }, "_defaultCompareFunction")
+ }]);
+ return Quicksort2;
+ }();
+ module3.exports = Quicksort;
+ },
+ /* 26 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function SVD() {
+ }
+ __name(SVD, "SVD");
+ ;
+ SVD.svd = function(A2) {
+ this.U = null;
+ this.V = null;
+ this.s = null;
+ this.m = 0;
+ this.n = 0;
+ this.m = A2.length;
+ this.n = A2[0].length;
+ var nu = Math.min(this.m, this.n);
+ this.s = function(s2) {
+ var a2 = [];
+ while (s2-- > 0) {
+ a2.push(0);
+ }
+ return a2;
+ }(Math.min(this.m + 1, this.n));
+ this.U = function(dims) {
+ var allocate = /* @__PURE__ */ __name(function allocate2(dims2) {
+ if (dims2.length == 0) {
+ return 0;
+ } else {
+ var array4 = [];
+ for (var i3 = 0; i3 < dims2[0]; i3++) {
+ array4.push(allocate2(dims2.slice(1)));
}
+ return array4;
}
- };
- CoSELayout.prototype.calculateNodesToApplyGravitationTo = function() {
- var nodeList = [];
- var graph;
- var graphs = this.graphManager.getGraphs();
- var size5 = graphs.length;
- var i2;
- for (i2 = 0; i2 < size5; i2++) {
- graph = graphs[i2];
- graph.updateConnected();
- if (!graph.isConnected) {
- nodeList = nodeList.concat(graph.getNodes());
+ }, "allocate");
+ return allocate(dims);
+ }([this.m, nu]);
+ this.V = function(dims) {
+ var allocate = /* @__PURE__ */ __name(function allocate2(dims2) {
+ if (dims2.length == 0) {
+ return 0;
+ } else {
+ var array4 = [];
+ for (var i3 = 0; i3 < dims2[0]; i3++) {
+ array4.push(allocate2(dims2.slice(1)));
}
+ return array4;
}
- return nodeList;
- };
- CoSELayout.prototype.createBendpoints = function() {
- var edges5 = [];
- edges5 = edges5.concat(this.graphManager.getAllEdges());
- var visited = /* @__PURE__ */ new Set();
- var i2;
- for (i2 = 0; i2 < edges5.length; i2++) {
- var edge = edges5[i2];
- if (!visited.has(edge)) {
- var source = edge.getSource();
- var target = edge.getTarget();
- if (source == target) {
- edge.getBendpoints().push(new PointD());
- edge.getBendpoints().push(new PointD());
- this.createDummyNodesForBendpoints(edge);
- visited.add(edge);
- } else {
- var edgeList2 = [];
- edgeList2 = edgeList2.concat(source.getEdgeListToNode(target));
- edgeList2 = edgeList2.concat(target.getEdgeListToNode(source));
- if (!visited.has(edgeList2[0])) {
- if (edgeList2.length > 1) {
- var k2;
- for (k2 = 0; k2 < edgeList2.length; k2++) {
- var multiEdge = edgeList2[k2];
- multiEdge.getBendpoints().push(new PointD());
- this.createDummyNodesForBendpoints(multiEdge);
- }
- }
- edgeList2.forEach(function(edge2) {
- visited.add(edge2);
- });
- }
- }
+ }, "allocate");
+ return allocate(dims);
+ }([this.n, this.n]);
+ var e3 = function(s2) {
+ var a2 = [];
+ while (s2-- > 0) {
+ a2.push(0);
+ }
+ return a2;
+ }(this.n);
+ var work = function(s2) {
+ var a2 = [];
+ while (s2-- > 0) {
+ a2.push(0);
+ }
+ return a2;
+ }(this.m);
+ var wantu = true;
+ var wantv = true;
+ var nct = Math.min(this.m - 1, this.n);
+ var nrt = Math.max(0, Math.min(this.n - 2, this.m));
+ for (var k2 = 0; k2 < Math.max(nct, nrt); k2++) {
+ if (k2 < nct) {
+ this.s[k2] = 0;
+ for (var i2 = k2; i2 < this.m; i2++) {
+ this.s[k2] = SVD.hypot(this.s[k2], A2[i2][k2]);
+ }
+ ;
+ if (this.s[k2] !== 0) {
+ if (A2[k2][k2] < 0) {
+ this.s[k2] = -this.s[k2];
}
- if (visited.size == edges5.length) {
- break;
+ for (var _i = k2; _i < this.m; _i++) {
+ A2[_i][k2] /= this.s[k2];
}
+ ;
+ A2[k2][k2] += 1;
}
- };
- CoSELayout.prototype.positionNodesRadially = function(forest) {
- var currentStartingPoint = new Point3(0, 0);
- var numberOfColumns = Math.ceil(Math.sqrt(forest.length));
- var height2 = 0;
- var currentY = 0;
- var currentX = 0;
- var point8 = new PointD(0, 0);
- for (var i2 = 0; i2 < forest.length; i2++) {
- if (i2 % numberOfColumns == 0) {
- currentX = 0;
- currentY = height2;
- if (i2 != 0) {
- currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION;
- }
- height2 = 0;
+ this.s[k2] = -this.s[k2];
+ }
+ for (var j2 = k2 + 1; j2 < this.n; j2++) {
+ if (/* @__PURE__ */ function(lhs, rhs) {
+ return lhs && rhs;
+ }(k2 < nct, this.s[k2] !== 0)) {
+ var t4 = 0;
+ for (var _i2 = k2; _i2 < this.m; _i2++) {
+ t4 += A2[_i2][k2] * A2[_i2][j2];
}
- var tree = forest[i2];
- var centerNode = Layout2.findCenterOfTree(tree);
- currentStartingPoint.x = currentX;
- currentStartingPoint.y = currentY;
- point8 = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint);
- if (point8.y > height2) {
- height2 = Math.floor(point8.y);
+ ;
+ t4 = -t4 / A2[k2][k2];
+ for (var _i3 = k2; _i3 < this.m; _i3++) {
+ A2[_i3][j2] += t4 * A2[_i3][k2];
}
- currentX = Math.floor(point8.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION);
- }
- this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point8.x / 2, LayoutConstants.WORLD_CENTER_Y - point8.y / 2));
- };
- CoSELayout.radialLayout = function(tree, centerNode, startingPoint) {
- var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION);
- CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);
- var bounds4 = LGraph.calculateBounds(tree);
- var transform8 = new Transform2();
- transform8.setDeviceOrgX(bounds4.getMinX());
- transform8.setDeviceOrgY(bounds4.getMinY());
- transform8.setWorldOrgX(startingPoint.x);
- transform8.setWorldOrgY(startingPoint.y);
- for (var i2 = 0; i2 < tree.length; i2++) {
- var node2 = tree[i2];
- node2.transform(transform8);
+ ;
}
- var bottomRight = new PointD(bounds4.getMaxX(), bounds4.getMaxY());
- return transform8.inverseTransformPoint(bottomRight);
- };
- CoSELayout.branchRadialLayout = function(node2, parentOfNode, startAngle, endAngle, distance2, radialSeparation) {
- var halfInterval = (endAngle - startAngle + 1) / 2;
- if (halfInterval < 0) {
- halfInterval += 180;
+ e3[j2] = A2[k2][j2];
+ }
+ ;
+ if (/* @__PURE__ */ function(lhs, rhs) {
+ return lhs && rhs;
+ }(wantu, k2 < nct)) {
+ for (var _i4 = k2; _i4 < this.m; _i4++) {
+ this.U[_i4][k2] = A2[_i4][k2];
}
- var nodeAngle = (halfInterval + startAngle) % 360;
- var teta = nodeAngle * IGeometry.TWO_PI / 360;
- var cos_teta = Math.cos(teta);
- var x_ = distance2 * Math.cos(teta);
- var y_ = distance2 * Math.sin(teta);
- node2.setCenter(x_, y_);
- var neighborEdges = [];
- neighborEdges = neighborEdges.concat(node2.getEdges());
- var childCount = neighborEdges.length;
- if (parentOfNode != null) {
- childCount--;
+ ;
+ }
+ if (k2 < nrt) {
+ e3[k2] = 0;
+ for (var _i5 = k2 + 1; _i5 < this.n; _i5++) {
+ e3[k2] = SVD.hypot(e3[k2], e3[_i5]);
}
- var branchCount = 0;
- var incEdgesCount = neighborEdges.length;
- var startIndex;
- var edges5 = node2.getEdgesBetween(parentOfNode);
- while (edges5.length > 1) {
- var temp = edges5[0];
- edges5.splice(0, 1);
- var index = neighborEdges.indexOf(temp);
- if (index >= 0) {
- neighborEdges.splice(index, 1);
+ ;
+ if (e3[k2] !== 0) {
+ if (e3[k2 + 1] < 0) {
+ e3[k2] = -e3[k2];
}
- incEdgesCount--;
- childCount--;
- }
- if (parentOfNode != null) {
- startIndex = (neighborEdges.indexOf(edges5[0]) + 1) % incEdgesCount;
- } else {
- startIndex = 0;
- }
- var stepAngle = Math.abs(endAngle - startAngle) / childCount;
- for (var i2 = startIndex; branchCount != childCount; i2 = ++i2 % incEdgesCount) {
- var currentNeighbor = neighborEdges[i2].getOtherEnd(node2);
- if (currentNeighbor == parentOfNode) {
- continue;
+ for (var _i6 = k2 + 1; _i6 < this.n; _i6++) {
+ e3[_i6] /= e3[k2];
}
- var childStartAngle = (startAngle + branchCount * stepAngle) % 360;
- var childEndAngle = (childStartAngle + stepAngle) % 360;
- CoSELayout.branchRadialLayout(currentNeighbor, node2, childStartAngle, childEndAngle, distance2 + radialSeparation, radialSeparation);
- branchCount++;
+ ;
+ e3[k2 + 1] += 1;
}
- };
- CoSELayout.maxDiagonalInTree = function(tree) {
- var maxDiagonal = Integer.MIN_VALUE;
- for (var i2 = 0; i2 < tree.length; i2++) {
- var node2 = tree[i2];
- var diagonal = node2.getDiagonal();
- if (diagonal > maxDiagonal) {
- maxDiagonal = diagonal;
+ e3[k2] = -e3[k2];
+ if (/* @__PURE__ */ function(lhs, rhs) {
+ return lhs && rhs;
+ }(k2 + 1 < this.m, e3[k2] !== 0)) {
+ for (var _i7 = k2 + 1; _i7 < this.m; _i7++) {
+ work[_i7] = 0;
}
- }
- return maxDiagonal;
- };
- CoSELayout.prototype.calcRepulsionRange = function() {
- return 2 * (this.level + 1) * this.idealEdgeLength;
- };
- CoSELayout.prototype.groupZeroDegreeMembers = function() {
- var self2 = this;
- var tempMemberGroups = {};
- this.memberGroups = {};
- this.idToDummyNode = {};
- var zeroDegree = [];
- var allNodes = this.graphManager.getAllNodes();
- for (var i2 = 0; i2 < allNodes.length; i2++) {
- var node2 = allNodes[i2];
- var parent4 = node2.getParent();
- if (this.getNodeDegreeWithChildren(node2) === 0 && (parent4.id == void 0 || !this.getToBeTiled(parent4))) {
- zeroDegree.push(node2);
+ ;
+ for (var _j = k2 + 1; _j < this.n; _j++) {
+ for (var _i8 = k2 + 1; _i8 < this.m; _i8++) {
+ work[_i8] += e3[_j] * A2[_i8][_j];
+ }
+ ;
+ }
+ ;
+ for (var _j2 = k2 + 1; _j2 < this.n; _j2++) {
+ var _t = -e3[_j2] / e3[k2 + 1];
+ for (var _i9 = k2 + 1; _i9 < this.m; _i9++) {
+ A2[_i9][_j2] += _t * work[_i9];
+ }
+ ;
}
+ ;
}
- for (var i2 = 0; i2 < zeroDegree.length; i2++) {
- var node2 = zeroDegree[i2];
- var p_id = node2.getParent().id;
- if (typeof tempMemberGroups[p_id] === "undefined") tempMemberGroups[p_id] = [];
- tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node2);
+ if (wantv) {
+ for (var _i10 = k2 + 1; _i10 < this.n; _i10++) {
+ this.V[_i10][k2] = e3[_i10];
+ }
+ ;
}
- Object.keys(tempMemberGroups).forEach(function(p_id2) {
- if (tempMemberGroups[p_id2].length > 1) {
- var dummyCompoundId = "DummyCompound_" + p_id2;
- self2.memberGroups[dummyCompoundId] = tempMemberGroups[p_id2];
- var parent5 = tempMemberGroups[p_id2][0].getParent();
- var dummyCompound = new CoSENode(self2.graphManager);
- dummyCompound.id = dummyCompoundId;
- dummyCompound.paddingLeft = parent5.paddingLeft || 0;
- dummyCompound.paddingRight = parent5.paddingRight || 0;
- dummyCompound.paddingBottom = parent5.paddingBottom || 0;
- dummyCompound.paddingTop = parent5.paddingTop || 0;
- self2.idToDummyNode[dummyCompoundId] = dummyCompound;
- var dummyParentGraph = self2.getGraphManager().add(self2.newGraph(), dummyCompound);
- var parentGraph = parent5.getChild();
- parentGraph.add(dummyCompound);
- for (var i3 = 0; i3 < tempMemberGroups[p_id2].length; i3++) {
- var node3 = tempMemberGroups[p_id2][i3];
- parentGraph.remove(node3);
- dummyParentGraph.add(node3);
- }
- }
- });
- };
- CoSELayout.prototype.clearCompounds = function() {
- var childGraphMap = {};
- var idToNode = {};
- this.performDFSOnCompounds();
- for (var i2 = 0; i2 < this.compoundOrder.length; i2++) {
- idToNode[this.compoundOrder[i2].id] = this.compoundOrder[i2];
- childGraphMap[this.compoundOrder[i2].id] = [].concat(this.compoundOrder[i2].getChild().getNodes());
- this.graphManager.remove(this.compoundOrder[i2].getChild());
- this.compoundOrder[i2].child = null;
- }
- this.graphManager.resetAllNodes();
- this.tileCompoundMembers(childGraphMap, idToNode);
- };
- CoSELayout.prototype.clearZeroDegreeMembers = function() {
- var self2 = this;
- var tiledZeroDegreePack = this.tiledZeroDegreePack = [];
- Object.keys(this.memberGroups).forEach(function(id27) {
- var compoundNode = self2.idToDummyNode[id27];
- tiledZeroDegreePack[id27] = self2.tileNodes(self2.memberGroups[id27], compoundNode.paddingLeft + compoundNode.paddingRight);
- compoundNode.rect.width = tiledZeroDegreePack[id27].width;
- compoundNode.rect.height = tiledZeroDegreePack[id27].height;
- compoundNode.setCenter(tiledZeroDegreePack[id27].centerX, tiledZeroDegreePack[id27].centerY);
- compoundNode.labelMarginLeft = 0;
- compoundNode.labelMarginTop = 0;
- if (CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {
- var width3 = compoundNode.rect.width;
- var height2 = compoundNode.rect.height;
- if (compoundNode.labelWidth) {
- if (compoundNode.labelPosHorizontal == "left") {
- compoundNode.rect.x -= compoundNode.labelWidth;
- compoundNode.setWidth(width3 + compoundNode.labelWidth);
- compoundNode.labelMarginLeft = compoundNode.labelWidth;
- } else if (compoundNode.labelPosHorizontal == "center" && compoundNode.labelWidth > width3) {
- compoundNode.rect.x -= (compoundNode.labelWidth - width3) / 2;
- compoundNode.setWidth(compoundNode.labelWidth);
- compoundNode.labelMarginLeft = (compoundNode.labelWidth - width3) / 2;
- } else if (compoundNode.labelPosHorizontal == "right") {
- compoundNode.setWidth(width3 + compoundNode.labelWidth);
- }
- }
- if (compoundNode.labelHeight) {
- if (compoundNode.labelPosVertical == "top") {
- compoundNode.rect.y -= compoundNode.labelHeight;
- compoundNode.setHeight(height2 + compoundNode.labelHeight);
- compoundNode.labelMarginTop = compoundNode.labelHeight;
- } else if (compoundNode.labelPosVertical == "center" && compoundNode.labelHeight > height2) {
- compoundNode.rect.y -= (compoundNode.labelHeight - height2) / 2;
- compoundNode.setHeight(compoundNode.labelHeight);
- compoundNode.labelMarginTop = (compoundNode.labelHeight - height2) / 2;
- } else if (compoundNode.labelPosVertical == "bottom") {
- compoundNode.setHeight(height2 + compoundNode.labelHeight);
- }
- }
- }
- });
- };
- CoSELayout.prototype.repopulateCompounds = function() {
- for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) {
- var lCompoundNode = this.compoundOrder[i2];
- var id27 = lCompoundNode.id;
- var horizontalMargin = lCompoundNode.paddingLeft;
- var verticalMargin = lCompoundNode.paddingTop;
- var labelMarginLeft = lCompoundNode.labelMarginLeft;
- var labelMarginTop = lCompoundNode.labelMarginTop;
- this.adjustLocations(this.tiledMemberPack[id27], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin, labelMarginLeft, labelMarginTop);
- }
- };
- CoSELayout.prototype.repopulateZeroDegreeMembers = function() {
- var self2 = this;
- var tiledPack = this.tiledZeroDegreePack;
- Object.keys(tiledPack).forEach(function(id27) {
- var compoundNode = self2.idToDummyNode[id27];
- var horizontalMargin = compoundNode.paddingLeft;
- var verticalMargin = compoundNode.paddingTop;
- var labelMarginLeft = compoundNode.labelMarginLeft;
- var labelMarginTop = compoundNode.labelMarginTop;
- self2.adjustLocations(tiledPack[id27], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin, labelMarginLeft, labelMarginTop);
- });
- };
- CoSELayout.prototype.getToBeTiled = function(node2) {
- var id27 = node2.id;
- if (this.toBeTiled[id27] != null) {
- return this.toBeTiled[id27];
- }
- var childGraph = node2.getChild();
- if (childGraph == null) {
- this.toBeTiled[id27] = false;
- return false;
- }
- var children2 = childGraph.getNodes();
- for (var i2 = 0; i2 < children2.length; i2++) {
- var theChild = children2[i2];
- if (this.getNodeDegree(theChild) > 0) {
- this.toBeTiled[id27] = false;
- return false;
- }
- if (theChild.getChild() == null) {
- this.toBeTiled[theChild.id] = false;
- continue;
- }
- if (!this.getToBeTiled(theChild)) {
- this.toBeTiled[id27] = false;
- return false;
- }
- }
- this.toBeTiled[id27] = true;
- return true;
- };
- CoSELayout.prototype.getNodeDegree = function(node2) {
- var id27 = node2.id;
- var edges5 = node2.getEdges();
- var degree = 0;
- for (var i2 = 0; i2 < edges5.length; i2++) {
- var edge = edges5[i2];
- if (edge.getSource().id !== edge.getTarget().id) {
- degree = degree + 1;
- }
- }
- return degree;
- };
- CoSELayout.prototype.getNodeDegreeWithChildren = function(node2) {
- var degree = this.getNodeDegree(node2);
- if (node2.getChild() == null) {
- return degree;
- }
- var children2 = node2.getChild().getNodes();
- for (var i2 = 0; i2 < children2.length; i2++) {
- var child = children2[i2];
- degree += this.getNodeDegreeWithChildren(child);
- }
- return degree;
- };
- CoSELayout.prototype.performDFSOnCompounds = function() {
- this.compoundOrder = [];
- this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
- };
- CoSELayout.prototype.fillCompexOrderByDFS = function(children2) {
- for (var i2 = 0; i2 < children2.length; i2++) {
- var child = children2[i2];
- if (child.getChild() != null) {
- this.fillCompexOrderByDFS(child.getChild().getNodes());
- }
- if (this.getToBeTiled(child)) {
- this.compoundOrder.push(child);
- }
- }
- };
- CoSELayout.prototype.adjustLocations = function(organization, x5, y5, compoundHorizontalMargin, compoundVerticalMargin, compoundLabelMarginLeft, compoundLabelMarginTop) {
- x5 += compoundHorizontalMargin + compoundLabelMarginLeft;
- y5 += compoundVerticalMargin + compoundLabelMarginTop;
- var left3 = x5;
- for (var i2 = 0; i2 < organization.rows.length; i2++) {
- var row = organization.rows[i2];
- x5 = left3;
- var maxHeight = 0;
- for (var j2 = 0; j2 < row.length; j2++) {
- var lnode = row[j2];
- lnode.rect.x = x5;
- lnode.rect.y = y5;
- x5 += lnode.rect.width + organization.horizontalPadding;
- if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height;
- }
- y5 += maxHeight + organization.verticalPadding;
+ }
+ }
+ ;
+ var p3 = Math.min(this.n, this.m + 1);
+ if (nct < this.n) {
+ this.s[nct] = A2[nct][nct];
+ }
+ if (this.m < p3) {
+ this.s[p3 - 1] = 0;
+ }
+ if (nrt + 1 < p3) {
+ e3[nrt] = A2[nrt][p3 - 1];
+ }
+ e3[p3 - 1] = 0;
+ if (wantu) {
+ for (var _j3 = nct; _j3 < nu; _j3++) {
+ for (var _i11 = 0; _i11 < this.m; _i11++) {
+ this.U[_i11][_j3] = 0;
}
- };
- CoSELayout.prototype.tileCompoundMembers = function(childGraphMap, idToNode) {
- var self2 = this;
- this.tiledMemberPack = [];
- Object.keys(childGraphMap).forEach(function(id27) {
- var compoundNode = idToNode[id27];
- self2.tiledMemberPack[id27] = self2.tileNodes(childGraphMap[id27], compoundNode.paddingLeft + compoundNode.paddingRight);
- compoundNode.rect.width = self2.tiledMemberPack[id27].width;
- compoundNode.rect.height = self2.tiledMemberPack[id27].height;
- compoundNode.setCenter(self2.tiledMemberPack[id27].centerX, self2.tiledMemberPack[id27].centerY);
- compoundNode.labelMarginLeft = 0;
- compoundNode.labelMarginTop = 0;
- if (CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {
- var width3 = compoundNode.rect.width;
- var height2 = compoundNode.rect.height;
- if (compoundNode.labelWidth) {
- if (compoundNode.labelPosHorizontal == "left") {
- compoundNode.rect.x -= compoundNode.labelWidth;
- compoundNode.setWidth(width3 + compoundNode.labelWidth);
- compoundNode.labelMarginLeft = compoundNode.labelWidth;
- } else if (compoundNode.labelPosHorizontal == "center" && compoundNode.labelWidth > width3) {
- compoundNode.rect.x -= (compoundNode.labelWidth - width3) / 2;
- compoundNode.setWidth(compoundNode.labelWidth);
- compoundNode.labelMarginLeft = (compoundNode.labelWidth - width3) / 2;
- } else if (compoundNode.labelPosHorizontal == "right") {
- compoundNode.setWidth(width3 + compoundNode.labelWidth);
- }
+ ;
+ this.U[_j3][_j3] = 1;
+ }
+ ;
+ for (var _k = nct - 1; _k >= 0; _k--) {
+ if (this.s[_k] !== 0) {
+ for (var _j4 = _k + 1; _j4 < nu; _j4++) {
+ var _t2 = 0;
+ for (var _i12 = _k; _i12 < this.m; _i12++) {
+ _t2 += this.U[_i12][_k] * this.U[_i12][_j4];
}
- if (compoundNode.labelHeight) {
- if (compoundNode.labelPosVertical == "top") {
- compoundNode.rect.y -= compoundNode.labelHeight;
- compoundNode.setHeight(height2 + compoundNode.labelHeight);
- compoundNode.labelMarginTop = compoundNode.labelHeight;
- } else if (compoundNode.labelPosVertical == "center" && compoundNode.labelHeight > height2) {
- compoundNode.rect.y -= (compoundNode.labelHeight - height2) / 2;
- compoundNode.setHeight(compoundNode.labelHeight);
- compoundNode.labelMarginTop = (compoundNode.labelHeight - height2) / 2;
- } else if (compoundNode.labelPosVertical == "bottom") {
- compoundNode.setHeight(height2 + compoundNode.labelHeight);
- }
+ ;
+ _t2 = -_t2 / this.U[_k][_k];
+ for (var _i13 = _k; _i13 < this.m; _i13++) {
+ this.U[_i13][_j4] += _t2 * this.U[_i13][_k];
}
+ ;
}
- });
- };
- CoSELayout.prototype.tileNodes = function(nodes6, minWidth) {
- var horizontalOrg = this.tileNodesByFavoringDim(nodes6, minWidth, true);
- var verticalOrg = this.tileNodesByFavoringDim(nodes6, minWidth, false);
- var horizontalRatio = this.getOrgRatio(horizontalOrg);
- var verticalRatio = this.getOrgRatio(verticalOrg);
- var bestOrg;
- if (verticalRatio < horizontalRatio) {
- bestOrg = verticalOrg;
- } else {
- bestOrg = horizontalOrg;
- }
- return bestOrg;
- };
- CoSELayout.prototype.getOrgRatio = function(organization) {
- var width3 = organization.width;
- var height2 = organization.height;
- var ratio = width3 / height2;
- if (ratio < 1) {
- ratio = 1 / ratio;
- }
- return ratio;
- };
- CoSELayout.prototype.calcIdealRowWidth = function(members, favorHorizontalDim) {
- var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;
- var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;
- var membersSize = members.length;
- var totalWidth = 0;
- var totalHeight = 0;
- var maxWidth = 0;
- members.forEach(function(node2) {
- totalWidth += node2.getWidth();
- totalHeight += node2.getHeight();
- if (node2.getWidth() > maxWidth) {
- maxWidth = node2.getWidth();
+ ;
+ for (var _i14 = _k; _i14 < this.m; _i14++) {
+ this.U[_i14][_k] = -this.U[_i14][_k];
}
- });
- var averageWidth = totalWidth / membersSize;
- var averageHeight = totalHeight / membersSize;
- var delta = Math.pow(verticalPadding - horizontalPadding, 2) + 4 * (averageWidth + horizontalPadding) * (averageHeight + verticalPadding) * membersSize;
- var horizontalCountDouble = (horizontalPadding - verticalPadding + Math.sqrt(delta)) / (2 * (averageWidth + horizontalPadding));
- var horizontalCount;
- if (favorHorizontalDim) {
- horizontalCount = Math.ceil(horizontalCountDouble);
- if (horizontalCount == horizontalCountDouble) {
- horizontalCount++;
+ ;
+ this.U[_k][_k] = 1 + this.U[_k][_k];
+ for (var _i15 = 0; _i15 < _k - 1; _i15++) {
+ this.U[_i15][_k] = 0;
}
+ ;
} else {
- horizontalCount = Math.floor(horizontalCountDouble);
- }
- var idealWidth = horizontalCount * (averageWidth + horizontalPadding) - horizontalPadding;
- if (maxWidth > idealWidth) {
- idealWidth = maxWidth;
- }
- idealWidth += horizontalPadding * 2;
- return idealWidth;
- };
- CoSELayout.prototype.tileNodesByFavoringDim = function(nodes6, minWidth, favorHorizontalDim) {
- var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;
- var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;
- var tilingCompareBy = CoSEConstants.TILING_COMPARE_BY;
- var organization = {
- rows: [],
- rowWidth: [],
- rowHeight: [],
- width: 0,
- height: minWidth,
- // assume minHeight equals to minWidth
- verticalPadding,
- horizontalPadding,
- centerX: 0,
- centerY: 0
- };
- if (tilingCompareBy) {
- organization.idealRowWidth = this.calcIdealRowWidth(nodes6, favorHorizontalDim);
- }
- var getNodeArea = /* @__PURE__ */ __name(function getNodeArea2(n2) {
- return n2.rect.width * n2.rect.height;
- }, "getNodeArea");
- var areaCompareFcn = /* @__PURE__ */ __name(function areaCompareFcn2(n1, n2) {
- return getNodeArea(n2) - getNodeArea(n1);
- }, "areaCompareFcn");
- nodes6.sort(function(n1, n2) {
- var cmpBy = areaCompareFcn;
- if (organization.idealRowWidth) {
- cmpBy = tilingCompareBy;
- return cmpBy(n1.id, n2.id);
+ for (var _i16 = 0; _i16 < this.m; _i16++) {
+ this.U[_i16][_k] = 0;
}
- return cmpBy(n1, n2);
- });
- var sumCenterX = 0;
- var sumCenterY = 0;
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- var lNode = nodes6[i2];
- sumCenterX += lNode.getCenterX();
- sumCenterY += lNode.getCenterY();
+ ;
+ this.U[_k][_k] = 1;
}
- organization.centerX = sumCenterX / nodes6.length;
- organization.centerY = sumCenterY / nodes6.length;
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- var lNode = nodes6[i2];
- if (organization.rows.length == 0) {
- this.insertNodeToRow(organization, lNode, 0, minWidth);
- } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) {
- var rowIndex = organization.rows.length - 1;
- if (!organization.idealRowWidth) {
- rowIndex = this.getShortestRowIndex(organization);
+ }
+ ;
+ }
+ if (wantv) {
+ for (var _k2 = this.n - 1; _k2 >= 0; _k2--) {
+ if (/* @__PURE__ */ function(lhs, rhs) {
+ return lhs && rhs;
+ }(_k2 < nrt, e3[_k2] !== 0)) {
+ for (var _j5 = _k2 + 1; _j5 < nu; _j5++) {
+ var _t3 = 0;
+ for (var _i17 = _k2 + 1; _i17 < this.n; _i17++) {
+ _t3 += this.V[_i17][_k2] * this.V[_i17][_j5];
}
- this.insertNodeToRow(organization, lNode, rowIndex, minWidth);
- } else {
- this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth);
+ ;
+ _t3 = -_t3 / this.V[_k2 + 1][_k2];
+ for (var _i18 = _k2 + 1; _i18 < this.n; _i18++) {
+ this.V[_i18][_j5] += _t3 * this.V[_i18][_k2];
+ }
+ ;
}
- this.shiftToLastRow(organization);
- }
- return organization;
- };
- CoSELayout.prototype.insertNodeToRow = function(organization, node2, rowIndex, minWidth) {
- var minCompoundSize = minWidth;
- if (rowIndex == organization.rows.length) {
- var secondDimension = [];
- organization.rows.push(secondDimension);
- organization.rowWidth.push(minCompoundSize);
- organization.rowHeight.push(0);
+ ;
}
- var w3 = organization.rowWidth[rowIndex] + node2.rect.width;
- if (organization.rows[rowIndex].length > 0) {
- w3 += organization.horizontalPadding;
+ for (var _i19 = 0; _i19 < this.n; _i19++) {
+ this.V[_i19][_k2] = 0;
}
- organization.rowWidth[rowIndex] = w3;
- if (organization.width < w3) {
- organization.width = w3;
+ ;
+ this.V[_k2][_k2] = 1;
+ }
+ ;
+ }
+ var pp = p3 - 1;
+ var iter = 0;
+ var eps = Math.pow(2, -52);
+ var tiny = Math.pow(2, -966);
+ while (p3 > 0) {
+ var _k3 = void 0;
+ var kase = void 0;
+ for (_k3 = p3 - 2; _k3 >= -1; _k3--) {
+ if (_k3 === -1) {
+ break;
}
- var h2 = node2.rect.height;
- if (rowIndex > 0) h2 += organization.verticalPadding;
- var extraHeight = 0;
- if (h2 > organization.rowHeight[rowIndex]) {
- extraHeight = organization.rowHeight[rowIndex];
- organization.rowHeight[rowIndex] = h2;
- extraHeight = organization.rowHeight[rowIndex] - extraHeight;
+ if (Math.abs(e3[_k3]) <= tiny + eps * (Math.abs(this.s[_k3]) + Math.abs(this.s[_k3 + 1]))) {
+ e3[_k3] = 0;
+ break;
}
- organization.height += extraHeight;
- organization.rows[rowIndex].push(node2);
- };
- CoSELayout.prototype.getShortestRowIndex = function(organization) {
- var r2 = -1;
- var min9 = Number.MAX_VALUE;
- for (var i2 = 0; i2 < organization.rows.length; i2++) {
- if (organization.rowWidth[i2] < min9) {
- r2 = i2;
- min9 = organization.rowWidth[i2];
+ }
+ ;
+ if (_k3 === p3 - 2) {
+ kase = 4;
+ } else {
+ var ks = void 0;
+ for (ks = p3 - 1; ks >= _k3; ks--) {
+ if (ks === _k3) {
+ break;
}
- }
- return r2;
- };
- CoSELayout.prototype.getLongestRowIndex = function(organization) {
- var r2 = -1;
- var max10 = Number.MIN_VALUE;
- for (var i2 = 0; i2 < organization.rows.length; i2++) {
- if (organization.rowWidth[i2] > max10) {
- r2 = i2;
- max10 = organization.rowWidth[i2];
+ var _t4 = (ks !== p3 ? Math.abs(e3[ks]) : 0) + (ks !== _k3 + 1 ? Math.abs(e3[ks - 1]) : 0);
+ if (Math.abs(this.s[ks]) <= tiny + eps * _t4) {
+ this.s[ks] = 0;
+ break;
}
}
- return r2;
- };
- CoSELayout.prototype.canAddHorizontal = function(organization, extraWidth, extraHeight) {
- if (organization.idealRowWidth) {
- var lastRowIndex = organization.rows.length - 1;
- var lastRowWidth = organization.rowWidth[lastRowIndex];
- return lastRowWidth + extraWidth + organization.horizontalPadding <= organization.idealRowWidth;
- }
- var sri = this.getShortestRowIndex(organization);
- if (sri < 0) {
- return true;
- }
- var min9 = organization.rowWidth[sri];
- if (min9 + organization.horizontalPadding + extraWidth <= organization.width) return true;
- var hDiff = 0;
- if (organization.rowHeight[sri] < extraHeight) {
- if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri];
- }
- var add_to_row_ratio;
- if (organization.width - min9 >= extraWidth + organization.horizontalPadding) {
- add_to_row_ratio = (organization.height + hDiff) / (min9 + extraWidth + organization.horizontalPadding);
- } else {
- add_to_row_ratio = (organization.height + hDiff) / organization.width;
- }
- hDiff = extraHeight + organization.verticalPadding;
- var add_new_row_ratio;
- if (organization.width < extraWidth) {
- add_new_row_ratio = (organization.height + hDiff) / extraWidth;
+ ;
+ if (ks === _k3) {
+ kase = 3;
+ } else if (ks === p3 - 1) {
+ kase = 1;
} else {
- add_new_row_ratio = (organization.height + hDiff) / organization.width;
- }
- if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio;
- if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio;
- return add_to_row_ratio < add_new_row_ratio;
- };
- CoSELayout.prototype.shiftToLastRow = function(organization) {
- var longest = this.getLongestRowIndex(organization);
- var last3 = organization.rowWidth.length - 1;
- var row = organization.rows[longest];
- var node2 = row[row.length - 1];
- var diff2 = node2.width + organization.horizontalPadding;
- if (organization.width - organization.rowWidth[last3] > diff2 && longest != last3) {
- row.splice(-1, 1);
- organization.rows[last3].push(node2);
- organization.rowWidth[longest] = organization.rowWidth[longest] - diff2;
- organization.rowWidth[last3] = organization.rowWidth[last3] + diff2;
- organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)];
- var maxHeight = Number.MIN_VALUE;
- for (var i2 = 0; i2 < row.length; i2++) {
- if (row[i2].height > maxHeight) maxHeight = row[i2].height;
- }
- if (longest > 0) maxHeight += organization.verticalPadding;
- var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last3];
- organization.rowHeight[longest] = maxHeight;
- if (organization.rowHeight[last3] < node2.height + organization.verticalPadding) organization.rowHeight[last3] = node2.height + organization.verticalPadding;
- var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last3];
- organization.height += finalTotal - prevTotal;
- this.shiftToLastRow(organization);
- }
- };
- CoSELayout.prototype.tilingPreLayout = function() {
- if (CoSEConstants.TILE) {
- this.groupZeroDegreeMembers();
- this.clearCompounds();
- this.clearZeroDegreeMembers();
- }
- };
- CoSELayout.prototype.tilingPostLayout = function() {
- if (CoSEConstants.TILE) {
- this.repopulateZeroDegreeMembers();
- this.repopulateCompounds();
+ kase = 2;
+ _k3 = ks;
}
- };
- CoSELayout.prototype.reduceTrees = function() {
- var prunedNodesAll = [];
- var containsLeaf = true;
- var node2;
- while (containsLeaf) {
- var allNodes = this.graphManager.getAllNodes();
- var prunedNodesInStepTemp = [];
- containsLeaf = false;
- for (var i2 = 0; i2 < allNodes.length; i2++) {
- node2 = allNodes[i2];
- if (node2.getEdges().length == 1 && !node2.getEdges()[0].isInterGraph && node2.getChild() == null) {
- if (CoSEConstants.PURE_INCREMENTAL) {
- var otherEnd = node2.getEdges()[0].getOtherEnd(node2);
- var relativePosition2 = new DimensionD2(node2.getCenterX() - otherEnd.getCenterX(), node2.getCenterY() - otherEnd.getCenterY());
- prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner(), relativePosition2]);
- } else {
- prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner()]);
+ }
+ _k3++;
+ switch (kase) {
+ case 1:
+ {
+ var f2 = e3[p3 - 2];
+ e3[p3 - 2] = 0;
+ for (var _j6 = p3 - 2; _j6 >= _k3; _j6--) {
+ var _t5 = SVD.hypot(this.s[_j6], f2);
+ var cs = this.s[_j6] / _t5;
+ var sn = f2 / _t5;
+ this.s[_j6] = _t5;
+ if (_j6 !== _k3) {
+ f2 = -sn * e3[_j6 - 1];
+ e3[_j6 - 1] = cs * e3[_j6 - 1];
}
- containsLeaf = true;
- }
- }
- if (containsLeaf == true) {
- var prunedNodesInStep = [];
- for (var j2 = 0; j2 < prunedNodesInStepTemp.length; j2++) {
- if (prunedNodesInStepTemp[j2][0].getEdges().length == 1) {
- prunedNodesInStep.push(prunedNodesInStepTemp[j2]);
- prunedNodesInStepTemp[j2][0].getOwner().remove(prunedNodesInStepTemp[j2][0]);
+ if (wantv) {
+ for (var _i20 = 0; _i20 < this.n; _i20++) {
+ _t5 = cs * this.V[_i20][_j6] + sn * this.V[_i20][p3 - 1];
+ this.V[_i20][p3 - 1] = -sn * this.V[_i20][_j6] + cs * this.V[_i20][p3 - 1];
+ this.V[_i20][_j6] = _t5;
+ }
+ ;
}
}
- prunedNodesAll.push(prunedNodesInStep);
- this.graphManager.resetAllNodes();
- this.graphManager.resetAllEdges();
- }
- }
- this.prunedNodesAll = prunedNodesAll;
- };
- CoSELayout.prototype.growTree = function(prunedNodesAll) {
- var lengthOfPrunedNodesInStep = prunedNodesAll.length;
- var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1];
- var nodeData2;
- for (var i2 = 0; i2 < prunedNodesInStep.length; i2++) {
- nodeData2 = prunedNodesInStep[i2];
- this.findPlaceforPrunedNode(nodeData2);
- nodeData2[2].add(nodeData2[0]);
- nodeData2[2].add(nodeData2[1], nodeData2[1].source, nodeData2[1].target);
- }
- prunedNodesAll.splice(prunedNodesAll.length - 1, 1);
- this.graphManager.resetAllNodes();
- this.graphManager.resetAllEdges();
- };
- CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData2) {
- var gridForPrunedNode;
- var nodeToConnect;
- var prunedNode = nodeData2[0];
- if (prunedNode == nodeData2[1].source) {
- nodeToConnect = nodeData2[1].target;
- } else {
- nodeToConnect = nodeData2[1].source;
- }
- if (CoSEConstants.PURE_INCREMENTAL) {
- prunedNode.setCenter(nodeToConnect.getCenterX() + nodeData2[3].getWidth(), nodeToConnect.getCenterY() + nodeData2[3].getHeight());
- } else {
- var startGridX = nodeToConnect.startX;
- var finishGridX = nodeToConnect.finishX;
- var startGridY = nodeToConnect.startY;
- var finishGridY = nodeToConnect.finishY;
- var upNodeCount = 0;
- var downNodeCount = 0;
- var rightNodeCount = 0;
- var leftNodeCount = 0;
- var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount];
- if (startGridY > 0) {
- for (var i2 = startGridX; i2 <= finishGridX; i2++) {
- controlRegions[0] += this.grid[i2][startGridY - 1].length + this.grid[i2][startGridY].length - 1;
- }
- }
- if (finishGridX < this.grid.length - 1) {
- for (var i2 = startGridY; i2 <= finishGridY; i2++) {
- controlRegions[1] += this.grid[finishGridX + 1][i2].length + this.grid[finishGridX][i2].length - 1;
- }
- }
- if (finishGridY < this.grid[0].length - 1) {
- for (var i2 = startGridX; i2 <= finishGridX; i2++) {
- controlRegions[2] += this.grid[i2][finishGridY + 1].length + this.grid[i2][finishGridY].length - 1;
- }
- }
- if (startGridX > 0) {
- for (var i2 = startGridY; i2 <= finishGridY; i2++) {
- controlRegions[3] += this.grid[startGridX - 1][i2].length + this.grid[startGridX][i2].length - 1;
- }
+ ;
}
- var min9 = Integer.MAX_VALUE;
- var minCount;
- var minIndex;
- for (var j2 = 0; j2 < controlRegions.length; j2++) {
- if (controlRegions[j2] < min9) {
- min9 = controlRegions[j2];
- minCount = 1;
- minIndex = j2;
- } else if (controlRegions[j2] == min9) {
- minCount++;
+ ;
+ break;
+ case 2:
+ {
+ var _f = e3[_k3 - 1];
+ e3[_k3 - 1] = 0;
+ for (var _j7 = _k3; _j7 < p3; _j7++) {
+ var _t6 = SVD.hypot(this.s[_j7], _f);
+ var _cs = this.s[_j7] / _t6;
+ var _sn = _f / _t6;
+ this.s[_j7] = _t6;
+ _f = -_sn * e3[_j7];
+ e3[_j7] = _cs * e3[_j7];
+ if (wantu) {
+ for (var _i21 = 0; _i21 < this.m; _i21++) {
+ _t6 = _cs * this.U[_i21][_j7] + _sn * this.U[_i21][_k3 - 1];
+ this.U[_i21][_k3 - 1] = -_sn * this.U[_i21][_j7] + _cs * this.U[_i21][_k3 - 1];
+ this.U[_i21][_j7] = _t6;
+ }
+ ;
+ }
}
+ ;
}
- if (minCount == 3 && min9 == 0) {
- if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) {
- gridForPrunedNode = 1;
- } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) {
- gridForPrunedNode = 0;
- } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {
- gridForPrunedNode = 3;
- } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {
- gridForPrunedNode = 2;
+ ;
+ break;
+ case 3:
+ {
+ var scale2 = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[p3 - 1]), Math.abs(this.s[p3 - 2])), Math.abs(e3[p3 - 2])), Math.abs(this.s[_k3])), Math.abs(e3[_k3]));
+ var sp = this.s[p3 - 1] / scale2;
+ var spm1 = this.s[p3 - 2] / scale2;
+ var epm1 = e3[p3 - 2] / scale2;
+ var sk = this.s[_k3] / scale2;
+ var ek = e3[_k3] / scale2;
+ var b2 = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2;
+ var c3 = sp * epm1 * (sp * epm1);
+ var shift2 = 0;
+ if (/* @__PURE__ */ function(lhs, rhs) {
+ return lhs || rhs;
+ }(b2 !== 0, c3 !== 0)) {
+ shift2 = Math.sqrt(b2 * b2 + c3);
+ if (b2 < 0) {
+ shift2 = -shift2;
+ }
+ shift2 = c3 / (b2 + shift2);
}
- } else if (minCount == 2 && min9 == 0) {
- var random2 = Math.floor(Math.random() * 2);
- if (controlRegions[0] == 0 && controlRegions[1] == 0) {
- ;
- if (random2 == 0) {
- gridForPrunedNode = 0;
- } else {
- gridForPrunedNode = 1;
+ var _f2 = (sk + sp) * (sk - sp) + shift2;
+ var g2 = sk * ek;
+ for (var _j8 = _k3; _j8 < p3 - 1; _j8++) {
+ var _t7 = SVD.hypot(_f2, g2);
+ var _cs2 = _f2 / _t7;
+ var _sn2 = g2 / _t7;
+ if (_j8 !== _k3) {
+ e3[_j8 - 1] = _t7;
}
- } else if (controlRegions[0] == 0 && controlRegions[2] == 0) {
- if (random2 == 0) {
- gridForPrunedNode = 0;
- } else {
- gridForPrunedNode = 2;
+ _f2 = _cs2 * this.s[_j8] + _sn2 * e3[_j8];
+ e3[_j8] = _cs2 * e3[_j8] - _sn2 * this.s[_j8];
+ g2 = _sn2 * this.s[_j8 + 1];
+ this.s[_j8 + 1] = _cs2 * this.s[_j8 + 1];
+ if (wantv) {
+ for (var _i22 = 0; _i22 < this.n; _i22++) {
+ _t7 = _cs2 * this.V[_i22][_j8] + _sn2 * this.V[_i22][_j8 + 1];
+ this.V[_i22][_j8 + 1] = -_sn2 * this.V[_i22][_j8] + _cs2 * this.V[_i22][_j8 + 1];
+ this.V[_i22][_j8] = _t7;
+ }
+ ;
}
- } else if (controlRegions[0] == 0 && controlRegions[3] == 0) {
- if (random2 == 0) {
- gridForPrunedNode = 0;
- } else {
- gridForPrunedNode = 3;
+ _t7 = SVD.hypot(_f2, g2);
+ _cs2 = _f2 / _t7;
+ _sn2 = g2 / _t7;
+ this.s[_j8] = _t7;
+ _f2 = _cs2 * e3[_j8] + _sn2 * this.s[_j8 + 1];
+ this.s[_j8 + 1] = -_sn2 * e3[_j8] + _cs2 * this.s[_j8 + 1];
+ g2 = _sn2 * e3[_j8 + 1];
+ e3[_j8 + 1] = _cs2 * e3[_j8 + 1];
+ if (wantu && _j8 < this.m - 1) {
+ for (var _i23 = 0; _i23 < this.m; _i23++) {
+ _t7 = _cs2 * this.U[_i23][_j8] + _sn2 * this.U[_i23][_j8 + 1];
+ this.U[_i23][_j8 + 1] = -_sn2 * this.U[_i23][_j8] + _cs2 * this.U[_i23][_j8 + 1];
+ this.U[_i23][_j8] = _t7;
+ }
+ ;
}
- } else if (controlRegions[1] == 0 && controlRegions[2] == 0) {
- if (random2 == 0) {
- gridForPrunedNode = 1;
- } else {
- gridForPrunedNode = 2;
+ }
+ ;
+ e3[p3 - 2] = _f2;
+ iter = iter + 1;
+ }
+ ;
+ break;
+ case 4:
+ {
+ if (this.s[_k3] <= 0) {
+ this.s[_k3] = this.s[_k3] < 0 ? -this.s[_k3] : 0;
+ if (wantv) {
+ for (var _i24 = 0; _i24 <= pp; _i24++) {
+ this.V[_i24][_k3] = -this.V[_i24][_k3];
+ }
+ ;
}
- } else if (controlRegions[1] == 0 && controlRegions[3] == 0) {
- if (random2 == 0) {
- gridForPrunedNode = 1;
- } else {
- gridForPrunedNode = 3;
+ }
+ while (_k3 < pp) {
+ if (this.s[_k3] >= this.s[_k3 + 1]) {
+ break;
}
- } else {
- if (random2 == 0) {
- gridForPrunedNode = 2;
- } else {
- gridForPrunedNode = 3;
+ var _t8 = this.s[_k3];
+ this.s[_k3] = this.s[_k3 + 1];
+ this.s[_k3 + 1] = _t8;
+ if (wantv && _k3 < this.n - 1) {
+ for (var _i25 = 0; _i25 < this.n; _i25++) {
+ _t8 = this.V[_i25][_k3 + 1];
+ this.V[_i25][_k3 + 1] = this.V[_i25][_k3];
+ this.V[_i25][_k3] = _t8;
+ }
+ ;
+ }
+ if (wantu && _k3 < this.m - 1) {
+ for (var _i26 = 0; _i26 < this.m; _i26++) {
+ _t8 = this.U[_i26][_k3 + 1];
+ this.U[_i26][_k3 + 1] = this.U[_i26][_k3];
+ this.U[_i26][_k3] = _t8;
+ }
+ ;
}
+ _k3++;
}
- } else if (minCount == 4 && min9 == 0) {
- var random2 = Math.floor(Math.random() * 4);
- gridForPrunedNode = random2;
- } else {
- gridForPrunedNode = minIndex;
- }
- if (gridForPrunedNode == 0) {
- prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2);
- } else if (gridForPrunedNode == 1) {
- prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY());
- } else if (gridForPrunedNode == 2) {
- prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2);
- } else {
- prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY());
+ ;
+ iter = 0;
+ p3--;
}
- }
- };
- module3.exports = CoSELayout;
+ ;
+ break;
+ }
}
- ),
- /***/
- 991: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var FDLayoutNode = __webpack_require__2(551).FDLayoutNode;
- var IMath = __webpack_require__2(551).IMath;
- function CoSENode(gm, loc, size5, vNode) {
- FDLayoutNode.call(this, gm, loc, size5, vNode);
+ ;
+ var result = { U: this.U, V: this.V, S: this.s };
+ return result;
+ };
+ SVD.hypot = function(a2, b2) {
+ var r2 = void 0;
+ if (Math.abs(a2) > Math.abs(b2)) {
+ r2 = b2 / a2;
+ r2 = Math.abs(a2) * Math.sqrt(1 + r2 * r2);
+ } else if (b2 != 0) {
+ r2 = a2 / b2;
+ r2 = Math.abs(b2) * Math.sqrt(1 + r2 * r2);
+ } else {
+ r2 = 0;
+ }
+ return r2;
+ };
+ module3.exports = SVD;
+ },
+ /* 27 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var _createClass2 = /* @__PURE__ */ function() {
+ function defineProperties(target, props) {
+ for (var i2 = 0; i2 < props.length; i2++) {
+ var descriptor = props[i2];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
}
- __name(CoSENode, "CoSENode");
- CoSENode.prototype = Object.create(FDLayoutNode.prototype);
- for (var prop in FDLayoutNode) {
- CoSENode[prop] = FDLayoutNode[prop];
+ }
+ __name(defineProperties, "defineProperties");
+ return function(Constructor, protoProps, staticProps) {
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) defineProperties(Constructor, staticProps);
+ return Constructor;
+ };
+ }();
+ function _classCallCheck2(instance2, Constructor) {
+ if (!(instance2 instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
+ __name(_classCallCheck2, "_classCallCheck");
+ var NeedlemanWunsch = function() {
+ function NeedlemanWunsch2(sequence1, sequence2) {
+ var match_score = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
+ var mismatch_penalty = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1;
+ var gap_penalty = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
+ _classCallCheck2(this, NeedlemanWunsch2);
+ this.sequence1 = sequence1;
+ this.sequence2 = sequence2;
+ this.match_score = match_score;
+ this.mismatch_penalty = mismatch_penalty;
+ this.gap_penalty = gap_penalty;
+ this.iMax = sequence1.length + 1;
+ this.jMax = sequence2.length + 1;
+ this.grid = new Array(this.iMax);
+ for (var i2 = 0; i2 < this.iMax; i2++) {
+ this.grid[i2] = new Array(this.jMax);
+ for (var j2 = 0; j2 < this.jMax; j2++) {
+ this.grid[i2][j2] = 0;
+ }
}
- CoSENode.prototype.calculateDisplacement = function() {
- var layout6 = this.graphManager.getLayout();
- if (this.getChild() != null && this.fixedNodeWeight) {
- this.displacementX += layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight;
- this.displacementY += layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight;
- } else {
- this.displacementX += layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren;
- this.displacementY += layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren;
+ this.tracebackGrid = new Array(this.iMax);
+ for (var _i = 0; _i < this.iMax; _i++) {
+ this.tracebackGrid[_i] = new Array(this.jMax);
+ for (var _j = 0; _j < this.jMax; _j++) {
+ this.tracebackGrid[_i][_j] = [null, null, null];
}
- if (Math.abs(this.displacementX) > layout6.coolingFactor * layout6.maxNodeDisplacement) {
- this.displacementX = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementX);
+ }
+ this.alignments = [];
+ this.score = -1;
+ this.computeGrids();
+ }
+ __name(NeedlemanWunsch2, "NeedlemanWunsch");
+ _createClass2(NeedlemanWunsch2, [{
+ key: "getScore",
+ value: /* @__PURE__ */ __name(function getScore() {
+ return this.score;
+ }, "getScore")
+ }, {
+ key: "getAlignments",
+ value: /* @__PURE__ */ __name(function getAlignments2() {
+ return this.alignments;
+ }, "getAlignments")
+ // Main dynamic programming procedure
+ }, {
+ key: "computeGrids",
+ value: /* @__PURE__ */ __name(function computeGrids() {
+ for (var j2 = 1; j2 < this.jMax; j2++) {
+ this.grid[0][j2] = this.grid[0][j2 - 1] + this.gap_penalty;
+ this.tracebackGrid[0][j2] = [false, false, true];
}
- if (Math.abs(this.displacementY) > layout6.coolingFactor * layout6.maxNodeDisplacement) {
- this.displacementY = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementY);
+ for (var i2 = 1; i2 < this.iMax; i2++) {
+ this.grid[i2][0] = this.grid[i2 - 1][0] + this.gap_penalty;
+ this.tracebackGrid[i2][0] = [false, true, false];
}
- if (this.child && this.child.getNodes().length > 0) {
- this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
+ for (var _i2 = 1; _i2 < this.iMax; _i2++) {
+ for (var _j2 = 1; _j2 < this.jMax; _j2++) {
+ var diag = void 0;
+ if (this.sequence1[_i2 - 1] === this.sequence2[_j2 - 1]) diag = this.grid[_i2 - 1][_j2 - 1] + this.match_score;
+ else diag = this.grid[_i2 - 1][_j2 - 1] + this.mismatch_penalty;
+ var up = this.grid[_i2 - 1][_j2] + this.gap_penalty;
+ var left3 = this.grid[_i2][_j2 - 1] + this.gap_penalty;
+ var maxOf = [diag, up, left3];
+ var indices = this.arrayAllMaxIndexes(maxOf);
+ this.grid[_i2][_j2] = maxOf[indices[0]];
+ this.tracebackGrid[_i2][_j2] = [indices.includes(0), indices.includes(1), indices.includes(2)];
+ }
}
- };
- CoSENode.prototype.propogateDisplacementToChildren = function(dX, dY) {
- var nodes6 = this.getChild().getNodes();
- var node2;
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- node2 = nodes6[i2];
- if (node2.getChild() == null) {
- node2.displacementX += dX;
- node2.displacementY += dY;
- } else {
- node2.propogateDisplacementToChildren(dX, dY);
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
+ }, "computeGrids")
+ // Gets all possible valid sequence combinations
+ }, {
+ key: "alignmentTraceback",
+ value: /* @__PURE__ */ __name(function alignmentTraceback() {
+ var inProcessAlignments = [];
+ inProcessAlignments.push({
+ pos: [this.sequence1.length, this.sequence2.length],
+ seq1: "",
+ seq2: ""
+ });
+ while (inProcessAlignments[0]) {
+ var current = inProcessAlignments[0];
+ var directions = this.tracebackGrid[current.pos[0]][current.pos[1]];
+ if (directions[0]) {
+ inProcessAlignments.push({
+ pos: [current.pos[0] - 1, current.pos[1] - 1],
+ seq1: this.sequence1[current.pos[0] - 1] + current.seq1,
+ seq2: this.sequence2[current.pos[1] - 1] + current.seq2
+ });
+ }
+ if (directions[1]) {
+ inProcessAlignments.push({
+ pos: [current.pos[0] - 1, current.pos[1]],
+ seq1: this.sequence1[current.pos[0] - 1] + current.seq1,
+ seq2: "-" + current.seq2
+ });
}
+ if (directions[2]) {
+ inProcessAlignments.push({
+ pos: [current.pos[0], current.pos[1] - 1],
+ seq1: "-" + current.seq1,
+ seq2: this.sequence2[current.pos[1] - 1] + current.seq2
+ });
+ }
+ if (current.pos[0] === 0 && current.pos[1] === 0) this.alignments.push({
+ sequence1: current.seq1,
+ sequence2: current.seq2
+ });
+ inProcessAlignments.shift();
}
- };
- CoSENode.prototype.move = function() {
- var layout6 = this.graphManager.getLayout();
- if (this.child == null || this.child.getNodes().length == 0) {
- this.moveBy(this.displacementX, this.displacementY);
- layout6.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY);
+ return this.alignments;
+ }, "alignmentTraceback")
+ // Helper Functions
+ }, {
+ key: "getAllIndexes",
+ value: /* @__PURE__ */ __name(function getAllIndexes(arr, val) {
+ var indexes = [], i2 = -1;
+ while ((i2 = arr.indexOf(val, i2 + 1)) !== -1) {
+ indexes.push(i2);
}
- this.springForceX = 0;
- this.springForceY = 0;
- this.repulsionForceX = 0;
- this.repulsionForceY = 0;
- this.gravitationForceX = 0;
- this.gravitationForceY = 0;
- this.displacementX = 0;
- this.displacementY = 0;
- };
- CoSENode.prototype.setPred1 = function(pred12) {
- this.pred1 = pred12;
- };
- CoSENode.prototype.getPred1 = function() {
- return pred1;
- };
- CoSENode.prototype.getPred2 = function() {
- return pred2;
- };
- CoSENode.prototype.setNext = function(next3) {
- this.next = next3;
- };
- CoSENode.prototype.getNext = function() {
- return next;
- };
- CoSENode.prototype.setProcessed = function(processed2) {
- this.processed = processed2;
- };
- CoSENode.prototype.isProcessed = function() {
- return processed;
- };
- module3.exports = CoSENode;
+ return indexes;
+ }, "getAllIndexes")
+ }, {
+ key: "arrayAllMaxIndexes",
+ value: /* @__PURE__ */ __name(function arrayAllMaxIndexes(array4) {
+ return this.getAllIndexes(array4, Math.max.apply(null, array4));
+ }, "arrayAllMaxIndexes")
+ }]);
+ return NeedlemanWunsch2;
+ }();
+ module3.exports = NeedlemanWunsch;
+ },
+ /* 28 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ var layoutBase = /* @__PURE__ */ __name(function layoutBase2() {
+ return;
+ }, "layoutBase");
+ layoutBase.FDLayout = __webpack_require__(18);
+ layoutBase.FDLayoutConstants = __webpack_require__(4);
+ layoutBase.FDLayoutEdge = __webpack_require__(19);
+ layoutBase.FDLayoutNode = __webpack_require__(20);
+ layoutBase.DimensionD = __webpack_require__(21);
+ layoutBase.HashMap = __webpack_require__(22);
+ layoutBase.HashSet = __webpack_require__(23);
+ layoutBase.IGeometry = __webpack_require__(8);
+ layoutBase.IMath = __webpack_require__(9);
+ layoutBase.Integer = __webpack_require__(10);
+ layoutBase.Point = __webpack_require__(12);
+ layoutBase.PointD = __webpack_require__(5);
+ layoutBase.RandomSeed = __webpack_require__(16);
+ layoutBase.RectangleD = __webpack_require__(13);
+ layoutBase.Transform = __webpack_require__(17);
+ layoutBase.UniqueIDGeneretor = __webpack_require__(14);
+ layoutBase.Quicksort = __webpack_require__(25);
+ layoutBase.LinkedList = __webpack_require__(11);
+ layoutBase.LGraphObject = __webpack_require__(2);
+ layoutBase.LGraph = __webpack_require__(6);
+ layoutBase.LEdge = __webpack_require__(1);
+ layoutBase.LGraphManager = __webpack_require__(7);
+ layoutBase.LNode = __webpack_require__(3);
+ layoutBase.Layout = __webpack_require__(15);
+ layoutBase.LayoutConstants = __webpack_require__(0);
+ layoutBase.NeedlemanWunsch = __webpack_require__(27);
+ layoutBase.Matrix = __webpack_require__(24);
+ layoutBase.SVD = __webpack_require__(26);
+ module3.exports = layoutBase;
+ },
+ /* 29 */
+ /***/
+ function(module3, exports3, __webpack_require__) {
+ "use strict";
+ function Emitter4() {
+ this.listeners = [];
+ }
+ __name(Emitter4, "Emitter");
+ var p3 = Emitter4.prototype;
+ p3.addListener = function(event3, callback) {
+ this.listeners.push({
+ event: event3,
+ callback
+ });
+ };
+ p3.removeListener = function(event3, callback) {
+ for (var i2 = this.listeners.length; i2 >= 0; i2--) {
+ var l2 = this.listeners[i2];
+ if (l2.event === event3 && l2.callback === callback) {
+ this.listeners.splice(i2, 1);
+ }
+ }
+ };
+ p3.emit = function(event3, data6) {
+ for (var i2 = 0; i2 < this.listeners.length; i2++) {
+ var l2 = this.listeners[i2];
+ if (event3 === l2.event) {
+ l2.callback(data6);
+ }
+ }
+ };
+ module3.exports = Emitter4;
+ }
+ /******/
+ ])
+ );
+ });
+ }
+ });
+
+ // ../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js
+ var require_cose_base2 = __commonJS({
+ "../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js"(exports2, module2) {
+ "use strict";
+ (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) {
+ if (typeof exports2 === "object" && typeof module2 === "object")
+ module2.exports = factory(require_layout_base2());
+ else if (typeof define === "function" && define.amd)
+ define(["layout-base"], factory);
+ else if (typeof exports2 === "object")
+ exports2["coseBase"] = factory(require_layout_base2());
+ else
+ root4["coseBase"] = factory(root4["layoutBase"]);
+ }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE__551__) {
+ return (
+ /******/
+ (() => {
+ "use strict";
+ var __webpack_modules__ = {
+ /***/
+ 45: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var coseBase = {};
+ coseBase.layoutBase = __webpack_require__2(551);
+ coseBase.CoSEConstants = __webpack_require__2(806);
+ coseBase.CoSEEdge = __webpack_require__2(767);
+ coseBase.CoSEGraph = __webpack_require__2(880);
+ coseBase.CoSEGraphManager = __webpack_require__2(578);
+ coseBase.CoSELayout = __webpack_require__2(765);
+ coseBase.CoSENode = __webpack_require__2(991);
+ coseBase.ConstraintHandler = __webpack_require__2(902);
+ module3.exports = coseBase;
}
),
/***/
- 902: (
+ 806: (
/***/
(module3, __unused_webpack_exports, __webpack_require__2) => {
- function _toConsumableArray(arr) {
- if (Array.isArray(arr)) {
- for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- } else {
- return Array.from(arr);
- }
+ var FDLayoutConstants = __webpack_require__2(551).FDLayoutConstants;
+ function CoSEConstants() {
+ }
+ __name(CoSEConstants, "CoSEConstants");
+ for (var prop in FDLayoutConstants) {
+ CoSEConstants[prop] = FDLayoutConstants[prop];
+ }
+ CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false;
+ CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
+ CoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60;
+ CoSEConstants.TILE = true;
+ CoSEConstants.TILING_PADDING_VERTICAL = 10;
+ CoSEConstants.TILING_PADDING_HORIZONTAL = 10;
+ CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true;
+ CoSEConstants.ENFORCE_CONSTRAINTS = true;
+ CoSEConstants.APPLY_LAYOUT = true;
+ CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS = true;
+ CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = true;
+ CoSEConstants.PURE_INCREMENTAL = CoSEConstants.DEFAULT_INCREMENTAL;
+ module3.exports = CoSEConstants;
+ }
+ ),
+ /***/
+ 767: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var FDLayoutEdge = __webpack_require__2(551).FDLayoutEdge;
+ function CoSEEdge(source, target, vEdge) {
+ FDLayoutEdge.call(this, source, target, vEdge);
+ }
+ __name(CoSEEdge, "CoSEEdge");
+ CoSEEdge.prototype = Object.create(FDLayoutEdge.prototype);
+ for (var prop in FDLayoutEdge) {
+ CoSEEdge[prop] = FDLayoutEdge[prop];
+ }
+ module3.exports = CoSEEdge;
+ }
+ ),
+ /***/
+ 880: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var LGraph = __webpack_require__2(551).LGraph;
+ function CoSEGraph(parent4, graphMgr, vGraph) {
+ LGraph.call(this, parent4, graphMgr, vGraph);
+ }
+ __name(CoSEGraph, "CoSEGraph");
+ CoSEGraph.prototype = Object.create(LGraph.prototype);
+ for (var prop in LGraph) {
+ CoSEGraph[prop] = LGraph[prop];
+ }
+ module3.exports = CoSEGraph;
+ }
+ ),
+ /***/
+ 578: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var LGraphManager = __webpack_require__2(551).LGraphManager;
+ function CoSEGraphManager(layout6) {
+ LGraphManager.call(this, layout6);
+ }
+ __name(CoSEGraphManager, "CoSEGraphManager");
+ CoSEGraphManager.prototype = Object.create(LGraphManager.prototype);
+ for (var prop in LGraphManager) {
+ CoSEGraphManager[prop] = LGraphManager[prop];
}
- __name(_toConsumableArray, "_toConsumableArray");
+ module3.exports = CoSEGraphManager;
+ }
+ ),
+ /***/
+ 765: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var FDLayout = __webpack_require__2(551).FDLayout;
+ var CoSEGraphManager = __webpack_require__2(578);
+ var CoSEGraph = __webpack_require__2(880);
+ var CoSENode = __webpack_require__2(991);
+ var CoSEEdge = __webpack_require__2(767);
var CoSEConstants = __webpack_require__2(806);
+ var ConstraintHandler = __webpack_require__2(902);
+ var FDLayoutConstants = __webpack_require__2(551).FDLayoutConstants;
+ var LayoutConstants = __webpack_require__2(551).LayoutConstants;
+ var Point3 = __webpack_require__2(551).Point;
+ var PointD = __webpack_require__2(551).PointD;
+ var DimensionD2 = __webpack_require__2(551).DimensionD;
+ var Layout2 = __webpack_require__2(551).Layout;
+ var Integer = __webpack_require__2(551).Integer;
+ var IGeometry = __webpack_require__2(551).IGeometry;
+ var LGraph = __webpack_require__2(551).LGraph;
+ var Transform2 = __webpack_require__2(551).Transform;
var LinkedList = __webpack_require__2(551).LinkedList;
- var Matrix = __webpack_require__2(551).Matrix;
- var SVD = __webpack_require__2(551).SVD;
- function ConstraintHandler() {
+ function CoSELayout() {
+ FDLayout.call(this);
+ this.toBeTiled = {};
+ this.constraints = {};
}
- __name(ConstraintHandler, "ConstraintHandler");
- ConstraintHandler.handleConstraints = function(layout6) {
- var constraints = {};
- constraints.fixedNodeConstraint = layout6.constraints.fixedNodeConstraint;
- constraints.alignmentConstraint = layout6.constraints.alignmentConstraint;
- constraints.relativePlacementConstraint = layout6.constraints.relativePlacementConstraint;
- var idToNodeMap = /* @__PURE__ */ new Map();
- var nodeIndexes = /* @__PURE__ */ new Map();
- var xCoords = [];
- var yCoords = [];
- var allNodes = layout6.getAllNodes();
- var index = 0;
+ __name(CoSELayout, "CoSELayout");
+ CoSELayout.prototype = Object.create(FDLayout.prototype);
+ for (var prop in FDLayout) {
+ CoSELayout[prop] = FDLayout[prop];
+ }
+ CoSELayout.prototype.newGraphManager = function() {
+ var gm = new CoSEGraphManager(this);
+ this.graphManager = gm;
+ return gm;
+ };
+ CoSELayout.prototype.newGraph = function(vGraph) {
+ return new CoSEGraph(null, this.graphManager, vGraph);
+ };
+ CoSELayout.prototype.newNode = function(vNode) {
+ return new CoSENode(this.graphManager, vNode);
+ };
+ CoSELayout.prototype.newEdge = function(vEdge) {
+ return new CoSEEdge(null, null, vEdge);
+ };
+ CoSELayout.prototype.initParameters = function() {
+ FDLayout.prototype.initParameters.call(this, arguments);
+ if (!this.isSubLayout) {
+ if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) {
+ this.idealEdgeLength = 10;
+ } else {
+ this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH;
+ }
+ this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;
+ this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;
+ this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;
+ this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;
+ this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;
+ this.prunedNodesAll = [];
+ this.growTreeIterations = 0;
+ this.afterGrowthIterations = 0;
+ this.isTreeGrowing = false;
+ this.isGrowthFinished = false;
+ }
+ };
+ CoSELayout.prototype.initSpringEmbedder = function() {
+ FDLayout.prototype.initSpringEmbedder.call(this);
+ this.coolingCycle = 0;
+ this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD;
+ this.finalTemperature = 0.04;
+ this.coolingAdjuster = 1;
+ };
+ CoSELayout.prototype.layout = function() {
+ var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
+ if (createBendsAsNeeded) {
+ this.createBendpoints();
+ this.graphManager.resetAllEdges();
+ }
+ this.level = 0;
+ return this.classicLayout();
+ };
+ CoSELayout.prototype.classicLayout = function() {
+ this.nodesWithGravity = this.calculateNodesToApplyGravitationTo();
+ this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);
+ this.calcNoOfChildrenForAllNodes();
+ this.graphManager.calcLowestCommonAncestors();
+ this.graphManager.calcInclusionTreeDepths();
+ this.graphManager.getRoot().calcEstimatedSize();
+ this.calcIdealEdgeLengths();
+ if (!this.incremental) {
+ var forest = this.getFlatForest();
+ if (forest.length > 0) {
+ this.positionNodesRadially(forest);
+ } else {
+ this.reduceTrees();
+ this.graphManager.resetAllNodesToApplyGravitation();
+ var allNodes = new Set(this.getAllNodes());
+ var intersection4 = this.nodesWithGravity.filter(function(x5) {
+ return allNodes.has(x5);
+ });
+ this.graphManager.setAllNodesToApplyGravitation(intersection4);
+ this.positionNodesRandomly();
+ }
+ } else {
+ if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) {
+ this.reduceTrees();
+ this.graphManager.resetAllNodesToApplyGravitation();
+ var allNodes = new Set(this.getAllNodes());
+ var intersection4 = this.nodesWithGravity.filter(function(x5) {
+ return allNodes.has(x5);
+ });
+ this.graphManager.setAllNodesToApplyGravitation(intersection4);
+ }
+ }
+ if (Object.keys(this.constraints).length > 0) {
+ ConstraintHandler.handleConstraints(this);
+ this.initConstraintVariables();
+ }
+ this.initSpringEmbedder();
+ if (CoSEConstants.APPLY_LAYOUT) {
+ this.runSpringEmbedder();
+ }
+ return true;
+ };
+ CoSELayout.prototype.tick = function() {
+ this.totalIterations++;
+ if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {
+ if (this.prunedNodesAll.length > 0) {
+ this.isTreeGrowing = true;
+ } else {
+ return true;
+ }
+ }
+ if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
+ if (this.isConverged()) {
+ if (this.prunedNodesAll.length > 0) {
+ this.isTreeGrowing = true;
+ } else {
+ return true;
+ }
+ }
+ this.coolingCycle++;
+ if (this.layoutQuality == 0) {
+ this.coolingAdjuster = this.coolingCycle;
+ } else if (this.layoutQuality == 1) {
+ this.coolingAdjuster = this.coolingCycle / 3;
+ }
+ this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature);
+ this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
+ }
+ if (this.isTreeGrowing) {
+ if (this.growTreeIterations % 10 == 0) {
+ if (this.prunedNodesAll.length > 0) {
+ this.graphManager.updateBounds();
+ this.updateGrid();
+ this.growTree(this.prunedNodesAll);
+ this.graphManager.resetAllNodesToApplyGravitation();
+ var allNodes = new Set(this.getAllNodes());
+ var intersection4 = this.nodesWithGravity.filter(function(x5) {
+ return allNodes.has(x5);
+ });
+ this.graphManager.setAllNodesToApplyGravitation(intersection4);
+ this.graphManager.updateBounds();
+ this.updateGrid();
+ if (CoSEConstants.PURE_INCREMENTAL) this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2;
+ else this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
+ } else {
+ this.isTreeGrowing = false;
+ this.isGrowthFinished = true;
+ }
+ }
+ this.growTreeIterations++;
+ }
+ if (this.isGrowthFinished) {
+ if (this.isConverged()) {
+ return true;
+ }
+ if (this.afterGrowthIterations % 10 == 0) {
+ this.graphManager.updateBounds();
+ this.updateGrid();
+ }
+ if (CoSEConstants.PURE_INCREMENTAL) this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100);
+ else this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100);
+ this.afterGrowthIterations++;
+ }
+ var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished;
+ var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
+ this.totalDisplacement = 0;
+ this.graphManager.updateBounds();
+ this.calcSpringForces();
+ this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate);
+ this.calcGravitationalForces();
+ this.moveNodes();
+ this.animate();
+ return false;
+ };
+ CoSELayout.prototype.getPositionsData = function() {
+ var allNodes = this.graphManager.getAllNodes();
+ var pData = {};
for (var i2 = 0; i2 < allNodes.length; i2++) {
- var node2 = allNodes[i2];
- if (node2.getChild() == null) {
- nodeIndexes.set(node2.id, index++);
- xCoords.push(node2.getCenterX());
- yCoords.push(node2.getCenterY());
- idToNodeMap.set(node2.id, node2);
+ var rect3 = allNodes[i2].rect;
+ var id29 = allNodes[i2].id;
+ pData[id29] = {
+ id: id29,
+ x: rect3.getCenterX(),
+ y: rect3.getCenterY(),
+ w: rect3.width,
+ h: rect3.height
+ };
+ }
+ return pData;
+ };
+ CoSELayout.prototype.runSpringEmbedder = function() {
+ this.initialAnimationPeriod = 25;
+ this.animationPeriod = this.initialAnimationPeriod;
+ var layoutEnded = false;
+ if (FDLayoutConstants.ANIMATE === "during") {
+ this.emit("layoutstarted");
+ } else {
+ while (!layoutEnded) {
+ layoutEnded = this.tick();
}
+ this.graphManager.updateBounds();
}
- if (constraints.relativePlacementConstraint) {
- constraints.relativePlacementConstraint.forEach(function(constraint) {
- if (!constraint.gap && constraint.gap != 0) {
- if (constraint.left) {
- constraint.gap = CoSEConstants.DEFAULT_EDGE_LENGTH + idToNodeMap.get(constraint.left).getWidth() / 2 + idToNodeMap.get(constraint.right).getWidth() / 2;
- } else {
- constraint.gap = CoSEConstants.DEFAULT_EDGE_LENGTH + idToNodeMap.get(constraint.top).getHeight() / 2 + idToNodeMap.get(constraint.bottom).getHeight() / 2;
+ };
+ CoSELayout.prototype.moveNodes = function() {
+ var lNodes = this.getAllNodes();
+ var node2;
+ for (var i2 = 0; i2 < lNodes.length; i2++) {
+ node2 = lNodes[i2];
+ node2.calculateDisplacement();
+ }
+ if (Object.keys(this.constraints).length > 0) {
+ this.updateDisplacements();
+ }
+ for (var i2 = 0; i2 < lNodes.length; i2++) {
+ node2 = lNodes[i2];
+ node2.move();
+ }
+ };
+ CoSELayout.prototype.initConstraintVariables = function() {
+ var self2 = this;
+ this.idToNodeMap = /* @__PURE__ */ new Map();
+ this.fixedNodeSet = /* @__PURE__ */ new Set();
+ var allNodes = this.graphManager.getAllNodes();
+ for (var i2 = 0; i2 < allNodes.length; i2++) {
+ var node2 = allNodes[i2];
+ this.idToNodeMap.set(node2.id, node2);
+ }
+ var calculateCompoundWeight = /* @__PURE__ */ __name(function calculateCompoundWeight2(compoundNode) {
+ var nodes6 = compoundNode.getChild().getNodes();
+ var node3;
+ var fixedNodeWeight2 = 0;
+ for (var i3 = 0; i3 < nodes6.length; i3++) {
+ node3 = nodes6[i3];
+ if (node3.getChild() == null) {
+ if (self2.fixedNodeSet.has(node3.id)) {
+ fixedNodeWeight2 += 100;
}
+ } else {
+ fixedNodeWeight2 += calculateCompoundWeight2(node3);
}
+ }
+ return fixedNodeWeight2;
+ }, "calculateCompoundWeight");
+ if (this.constraints.fixedNodeConstraint) {
+ this.constraints.fixedNodeConstraint.forEach(function(nodeData2) {
+ self2.fixedNodeSet.add(nodeData2.nodeId);
});
- }
- var calculatePositionDiff = /* @__PURE__ */ __name(function calculatePositionDiff2(pos1, pos2) {
- return { x: pos1.x - pos2.x, y: pos1.y - pos2.y };
- }, "calculatePositionDiff");
- var calculateAvgPosition = /* @__PURE__ */ __name(function calculateAvgPosition2(nodeIdSet) {
- var xPosSum = 0;
- var yPosSum = 0;
- nodeIdSet.forEach(function(nodeId) {
- xPosSum += xCoords[nodeIndexes.get(nodeId)];
- yPosSum += yCoords[nodeIndexes.get(nodeId)];
- });
- return { x: xPosSum / nodeIdSet.size, y: yPosSum / nodeIdSet.size };
- }, "calculateAvgPosition");
- var findAppropriatePositionForRelativePlacement = /* @__PURE__ */ __name(function findAppropriatePositionForRelativePlacement2(graph, direction4, fixedNodes2, dummyPositions, componentSources) {
- function setUnion(setA, setB) {
- var union2 = new Set(setA);
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = void 0;
- try {
- for (var _iterator = setB[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var elem = _step.value;
- union2.add(elem);
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
+ var allNodes = this.graphManager.getAllNodes();
+ var node2;
+ for (var i2 = 0; i2 < allNodes.length; i2++) {
+ node2 = allNodes[i2];
+ if (node2.getChild() != null) {
+ var fixedNodeWeight = calculateCompoundWeight(node2);
+ if (fixedNodeWeight > 0) {
+ node2.fixedNodeWeight = fixedNodeWeight;
}
}
- return union2;
}
- __name(setUnion, "setUnion");
- var inDegrees = /* @__PURE__ */ new Map();
- graph.forEach(function(value2, key) {
- inDegrees.set(key, 0);
- });
- graph.forEach(function(value2, key) {
- value2.forEach(function(adjacent) {
- inDegrees.set(adjacent.id, inDegrees.get(adjacent.id) + 1);
- });
+ }
+ if (this.constraints.relativePlacementConstraint) {
+ var nodeToDummyForVerticalAlignment = /* @__PURE__ */ new Map();
+ var nodeToDummyForHorizontalAlignment = /* @__PURE__ */ new Map();
+ this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map();
+ this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map();
+ this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set();
+ this.fixedNodesOnVertical = /* @__PURE__ */ new Set();
+ this.fixedNodeSet.forEach(function(nodeId) {
+ self2.fixedNodesOnHorizontal.add(nodeId);
+ self2.fixedNodesOnVertical.add(nodeId);
});
- var positionMap = /* @__PURE__ */ new Map();
- var pastMap = /* @__PURE__ */ new Map();
- var queue = new LinkedList();
- inDegrees.forEach(function(value2, key) {
- if (value2 == 0) {
- queue.push(key);
- if (!fixedNodes2) {
- if (direction4 == "horizontal") {
- positionMap.set(key, nodeIndexes.has(key) ? xCoords[nodeIndexes.get(key)] : dummyPositions.get(key));
- } else {
- positionMap.set(key, nodeIndexes.has(key) ? yCoords[nodeIndexes.get(key)] : dummyPositions.get(key));
- }
+ if (this.constraints.alignmentConstraint) {
+ if (this.constraints.alignmentConstraint.vertical) {
+ var verticalAlignment2 = this.constraints.alignmentConstraint.vertical;
+ for (var i2 = 0; i2 < verticalAlignment2.length; i2++) {
+ this.dummyToNodeForVerticalAlignment.set("dummy" + i2, []);
+ verticalAlignment2[i2].forEach(function(nodeId) {
+ nodeToDummyForVerticalAlignment.set(nodeId, "dummy" + i2);
+ self2.dummyToNodeForVerticalAlignment.get("dummy" + i2).push(nodeId);
+ if (self2.fixedNodeSet.has(nodeId)) {
+ self2.fixedNodesOnHorizontal.add("dummy" + i2);
+ }
+ });
}
- } else {
- positionMap.set(key, Number.NEGATIVE_INFINITY);
}
- if (fixedNodes2) {
- pastMap.set(key, /* @__PURE__ */ new Set([key]));
+ if (this.constraints.alignmentConstraint.horizontal) {
+ var horizontalAlignment = this.constraints.alignmentConstraint.horizontal;
+ for (var i2 = 0; i2 < horizontalAlignment.length; i2++) {
+ this.dummyToNodeForHorizontalAlignment.set("dummy" + i2, []);
+ horizontalAlignment[i2].forEach(function(nodeId) {
+ nodeToDummyForHorizontalAlignment.set(nodeId, "dummy" + i2);
+ self2.dummyToNodeForHorizontalAlignment.get("dummy" + i2).push(nodeId);
+ if (self2.fixedNodeSet.has(nodeId)) {
+ self2.fixedNodesOnVertical.add("dummy" + i2);
+ }
+ });
+ }
}
- });
- if (fixedNodes2) {
- componentSources.forEach(function(component2) {
- var fixedIds = [];
- component2.forEach(function(nodeId) {
- if (fixedNodes2.has(nodeId)) {
- fixedIds.push(nodeId);
- }
- });
- if (fixedIds.length > 0) {
- var position5 = 0;
- fixedIds.forEach(function(fixedId) {
- if (direction4 == "horizontal") {
- positionMap.set(fixedId, nodeIndexes.has(fixedId) ? xCoords[nodeIndexes.get(fixedId)] : dummyPositions.get(fixedId));
- position5 += positionMap.get(fixedId);
+ }
+ if (CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS) {
+ this.shuffle = function(array4) {
+ var j2, x5, i3;
+ for (i3 = array4.length - 1; i3 >= 2 * array4.length / 3; i3--) {
+ j2 = Math.floor(Math.random() * (i3 + 1));
+ x5 = array4[i3];
+ array4[i3] = array4[j2];
+ array4[j2] = x5;
+ }
+ return array4;
+ };
+ this.nodesInRelativeHorizontal = [];
+ this.nodesInRelativeVertical = [];
+ this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map();
+ this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map();
+ this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map();
+ this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map();
+ this.constraints.relativePlacementConstraint.forEach(function(constraint) {
+ if (constraint.left) {
+ var nodeIdLeft = nodeToDummyForVerticalAlignment.has(constraint.left) ? nodeToDummyForVerticalAlignment.get(constraint.left) : constraint.left;
+ var nodeIdRight = nodeToDummyForVerticalAlignment.has(constraint.right) ? nodeToDummyForVerticalAlignment.get(constraint.right) : constraint.right;
+ if (!self2.nodesInRelativeHorizontal.includes(nodeIdLeft)) {
+ self2.nodesInRelativeHorizontal.push(nodeIdLeft);
+ self2.nodeToRelativeConstraintMapHorizontal.set(nodeIdLeft, []);
+ if (self2.dummyToNodeForVerticalAlignment.has(nodeIdLeft)) {
+ self2.nodeToTempPositionMapHorizontal.set(nodeIdLeft, self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeIdLeft)[0]).getCenterX());
} else {
- positionMap.set(fixedId, nodeIndexes.has(fixedId) ? yCoords[nodeIndexes.get(fixedId)] : dummyPositions.get(fixedId));
- position5 += positionMap.get(fixedId);
+ self2.nodeToTempPositionMapHorizontal.set(nodeIdLeft, self2.idToNodeMap.get(nodeIdLeft).getCenterX());
}
- });
- position5 = position5 / fixedIds.length;
- component2.forEach(function(nodeId) {
- if (!fixedNodes2.has(nodeId)) {
- positionMap.set(nodeId, position5);
+ }
+ if (!self2.nodesInRelativeHorizontal.includes(nodeIdRight)) {
+ self2.nodesInRelativeHorizontal.push(nodeIdRight);
+ self2.nodeToRelativeConstraintMapHorizontal.set(nodeIdRight, []);
+ if (self2.dummyToNodeForVerticalAlignment.has(nodeIdRight)) {
+ self2.nodeToTempPositionMapHorizontal.set(nodeIdRight, self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeIdRight)[0]).getCenterX());
+ } else {
+ self2.nodeToTempPositionMapHorizontal.set(nodeIdRight, self2.idToNodeMap.get(nodeIdRight).getCenterX());
}
- });
+ }
+ self2.nodeToRelativeConstraintMapHorizontal.get(nodeIdLeft).push({ right: nodeIdRight, gap: constraint.gap });
+ self2.nodeToRelativeConstraintMapHorizontal.get(nodeIdRight).push({ left: nodeIdLeft, gap: constraint.gap });
} else {
- var _position = 0;
- component2.forEach(function(nodeId) {
- if (direction4 == "horizontal") {
- _position += nodeIndexes.has(nodeId) ? xCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId);
+ var nodeIdTop = nodeToDummyForHorizontalAlignment.has(constraint.top) ? nodeToDummyForHorizontalAlignment.get(constraint.top) : constraint.top;
+ var nodeIdBottom = nodeToDummyForHorizontalAlignment.has(constraint.bottom) ? nodeToDummyForHorizontalAlignment.get(constraint.bottom) : constraint.bottom;
+ if (!self2.nodesInRelativeVertical.includes(nodeIdTop)) {
+ self2.nodesInRelativeVertical.push(nodeIdTop);
+ self2.nodeToRelativeConstraintMapVertical.set(nodeIdTop, []);
+ if (self2.dummyToNodeForHorizontalAlignment.has(nodeIdTop)) {
+ self2.nodeToTempPositionMapVertical.set(nodeIdTop, self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeIdTop)[0]).getCenterY());
} else {
- _position += nodeIndexes.has(nodeId) ? yCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId);
+ self2.nodeToTempPositionMapVertical.set(nodeIdTop, self2.idToNodeMap.get(nodeIdTop).getCenterY());
}
- });
- _position = _position / component2.length;
- component2.forEach(function(nodeId) {
- positionMap.set(nodeId, _position);
- });
- }
- });
- }
- var _loop = /* @__PURE__ */ __name(function _loop2() {
- var currentNode = queue.shift();
- var neighbors = graph.get(currentNode);
- neighbors.forEach(function(neighbor) {
- if (positionMap.get(neighbor.id) < positionMap.get(currentNode) + neighbor.gap) {
- if (fixedNodes2 && fixedNodes2.has(neighbor.id)) {
- var fixedPosition = void 0;
- if (direction4 == "horizontal") {
- fixedPosition = nodeIndexes.has(neighbor.id) ? xCoords[nodeIndexes.get(neighbor.id)] : dummyPositions.get(neighbor.id);
+ }
+ if (!self2.nodesInRelativeVertical.includes(nodeIdBottom)) {
+ self2.nodesInRelativeVertical.push(nodeIdBottom);
+ self2.nodeToRelativeConstraintMapVertical.set(nodeIdBottom, []);
+ if (self2.dummyToNodeForHorizontalAlignment.has(nodeIdBottom)) {
+ self2.nodeToTempPositionMapVertical.set(nodeIdBottom, self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeIdBottom)[0]).getCenterY());
} else {
- fixedPosition = nodeIndexes.has(neighbor.id) ? yCoords[nodeIndexes.get(neighbor.id)] : dummyPositions.get(neighbor.id);
- }
- positionMap.set(neighbor.id, fixedPosition);
- if (fixedPosition < positionMap.get(currentNode) + neighbor.gap) {
- var diff2 = positionMap.get(currentNode) + neighbor.gap - fixedPosition;
- pastMap.get(currentNode).forEach(function(nodeId) {
- positionMap.set(nodeId, positionMap.get(nodeId) - diff2);
- });
+ self2.nodeToTempPositionMapVertical.set(nodeIdBottom, self2.idToNodeMap.get(nodeIdBottom).getCenterY());
}
- } else {
- positionMap.set(neighbor.id, positionMap.get(currentNode) + neighbor.gap);
}
- }
- inDegrees.set(neighbor.id, inDegrees.get(neighbor.id) - 1);
- if (inDegrees.get(neighbor.id) == 0) {
- queue.push(neighbor.id);
- }
- if (fixedNodes2) {
- pastMap.set(neighbor.id, setUnion(pastMap.get(currentNode), pastMap.get(neighbor.id)));
+ self2.nodeToRelativeConstraintMapVertical.get(nodeIdTop).push({ bottom: nodeIdBottom, gap: constraint.gap });
+ self2.nodeToRelativeConstraintMapVertical.get(nodeIdBottom).push({ top: nodeIdTop, gap: constraint.gap });
}
});
- }, "_loop");
- while (queue.length != 0) {
- _loop();
- }
- if (fixedNodes2) {
- var sinkNodes = /* @__PURE__ */ new Set();
- graph.forEach(function(value2, key) {
- if (value2.length == 0) {
- sinkNodes.add(key);
+ } else {
+ var subGraphOnHorizontal = /* @__PURE__ */ new Map();
+ var subGraphOnVertical = /* @__PURE__ */ new Map();
+ this.constraints.relativePlacementConstraint.forEach(function(constraint) {
+ if (constraint.left) {
+ var left3 = nodeToDummyForVerticalAlignment.has(constraint.left) ? nodeToDummyForVerticalAlignment.get(constraint.left) : constraint.left;
+ var right3 = nodeToDummyForVerticalAlignment.has(constraint.right) ? nodeToDummyForVerticalAlignment.get(constraint.right) : constraint.right;
+ if (subGraphOnHorizontal.has(left3)) {
+ subGraphOnHorizontal.get(left3).push(right3);
+ } else {
+ subGraphOnHorizontal.set(left3, [right3]);
+ }
+ if (subGraphOnHorizontal.has(right3)) {
+ subGraphOnHorizontal.get(right3).push(left3);
+ } else {
+ subGraphOnHorizontal.set(right3, [left3]);
+ }
+ } else {
+ var top2 = nodeToDummyForHorizontalAlignment.has(constraint.top) ? nodeToDummyForHorizontalAlignment.get(constraint.top) : constraint.top;
+ var bottom2 = nodeToDummyForHorizontalAlignment.has(constraint.bottom) ? nodeToDummyForHorizontalAlignment.get(constraint.bottom) : constraint.bottom;
+ if (subGraphOnVertical.has(top2)) {
+ subGraphOnVertical.get(top2).push(bottom2);
+ } else {
+ subGraphOnVertical.set(top2, [bottom2]);
+ }
+ if (subGraphOnVertical.has(bottom2)) {
+ subGraphOnVertical.get(bottom2).push(top2);
+ } else {
+ subGraphOnVertical.set(bottom2, [top2]);
+ }
}
});
- var _components = [];
- pastMap.forEach(function(value2, key) {
- if (sinkNodes.has(key)) {
- var isFixedComponent = false;
- var _iteratorNormalCompletion2 = true;
- var _didIteratorError2 = false;
- var _iteratorError2 = void 0;
- try {
- for (var _iterator2 = value2[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
- var nodeId = _step2.value;
- if (fixedNodes2.has(nodeId)) {
- isFixedComponent = true;
+ var constructComponents = /* @__PURE__ */ __name(function constructComponents2(graph, fixedNodes) {
+ var components3 = [];
+ var isFixed = [];
+ var queue = new LinkedList();
+ var visited = /* @__PURE__ */ new Set();
+ var count = 0;
+ graph.forEach(function(value2, key) {
+ if (!visited.has(key)) {
+ components3[count] = [];
+ isFixed[count] = false;
+ var currentNode = key;
+ queue.push(currentNode);
+ visited.add(currentNode);
+ components3[count].push(currentNode);
+ while (queue.length != 0) {
+ currentNode = queue.shift();
+ if (fixedNodes.has(currentNode)) {
+ isFixed[count] = true;
}
+ var neighbors = graph.get(currentNode);
+ neighbors.forEach(function(neighbor) {
+ if (!visited.has(neighbor)) {
+ queue.push(neighbor);
+ visited.add(neighbor);
+ components3[count].push(neighbor);
+ }
+ });
}
- } catch (err) {
- _didIteratorError2 = true;
- _iteratorError2 = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
- _iterator2.return();
+ count++;
+ }
+ });
+ return { components: components3, isFixed };
+ }, "constructComponents");
+ var resultOnHorizontal = constructComponents(subGraphOnHorizontal, self2.fixedNodesOnHorizontal);
+ this.componentsOnHorizontal = resultOnHorizontal.components;
+ this.fixedComponentsOnHorizontal = resultOnHorizontal.isFixed;
+ var resultOnVertical = constructComponents(subGraphOnVertical, self2.fixedNodesOnVertical);
+ this.componentsOnVertical = resultOnVertical.components;
+ this.fixedComponentsOnVertical = resultOnVertical.isFixed;
+ }
+ }
+ };
+ CoSELayout.prototype.updateDisplacements = function() {
+ var self2 = this;
+ if (this.constraints.fixedNodeConstraint) {
+ this.constraints.fixedNodeConstraint.forEach(function(nodeData2) {
+ var fixedNode = self2.idToNodeMap.get(nodeData2.nodeId);
+ fixedNode.displacementX = 0;
+ fixedNode.displacementY = 0;
+ });
+ }
+ if (this.constraints.alignmentConstraint) {
+ if (this.constraints.alignmentConstraint.vertical) {
+ var allVerticalAlignments = this.constraints.alignmentConstraint.vertical;
+ for (var i2 = 0; i2 < allVerticalAlignments.length; i2++) {
+ var totalDisplacementX = 0;
+ for (var j2 = 0; j2 < allVerticalAlignments[i2].length; j2++) {
+ if (this.fixedNodeSet.has(allVerticalAlignments[i2][j2])) {
+ totalDisplacementX = 0;
+ break;
+ }
+ totalDisplacementX += this.idToNodeMap.get(allVerticalAlignments[i2][j2]).displacementX;
+ }
+ var averageDisplacementX = totalDisplacementX / allVerticalAlignments[i2].length;
+ for (var j2 = 0; j2 < allVerticalAlignments[i2].length; j2++) {
+ this.idToNodeMap.get(allVerticalAlignments[i2][j2]).displacementX = averageDisplacementX;
+ }
+ }
+ }
+ if (this.constraints.alignmentConstraint.horizontal) {
+ var allHorizontalAlignments = this.constraints.alignmentConstraint.horizontal;
+ for (var i2 = 0; i2 < allHorizontalAlignments.length; i2++) {
+ var totalDisplacementY = 0;
+ for (var j2 = 0; j2 < allHorizontalAlignments[i2].length; j2++) {
+ if (this.fixedNodeSet.has(allHorizontalAlignments[i2][j2])) {
+ totalDisplacementY = 0;
+ break;
+ }
+ totalDisplacementY += this.idToNodeMap.get(allHorizontalAlignments[i2][j2]).displacementY;
+ }
+ var averageDisplacementY = totalDisplacementY / allHorizontalAlignments[i2].length;
+ for (var j2 = 0; j2 < allHorizontalAlignments[i2].length; j2++) {
+ this.idToNodeMap.get(allHorizontalAlignments[i2][j2]).displacementY = averageDisplacementY;
+ }
+ }
+ }
+ }
+ if (this.constraints.relativePlacementConstraint) {
+ if (CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS) {
+ if (this.totalIterations % 10 == 0) {
+ this.shuffle(this.nodesInRelativeHorizontal);
+ this.shuffle(this.nodesInRelativeVertical);
+ }
+ this.nodesInRelativeHorizontal.forEach(function(nodeId) {
+ if (!self2.fixedNodesOnHorizontal.has(nodeId)) {
+ var displacement = 0;
+ if (self2.dummyToNodeForVerticalAlignment.has(nodeId)) {
+ displacement = self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeId)[0]).displacementX;
+ } else {
+ displacement = self2.idToNodeMap.get(nodeId).displacementX;
+ }
+ self2.nodeToRelativeConstraintMapHorizontal.get(nodeId).forEach(function(constraint) {
+ if (constraint.right) {
+ var diff2 = self2.nodeToTempPositionMapHorizontal.get(constraint.right) - self2.nodeToTempPositionMapHorizontal.get(nodeId) - displacement;
+ if (diff2 < constraint.gap) {
+ displacement -= constraint.gap - diff2;
}
- } finally {
- if (_didIteratorError2) {
- throw _iteratorError2;
+ } else {
+ var diff2 = self2.nodeToTempPositionMapHorizontal.get(nodeId) - self2.nodeToTempPositionMapHorizontal.get(constraint.left) + displacement;
+ if (diff2 < constraint.gap) {
+ displacement += constraint.gap - diff2;
}
}
+ });
+ self2.nodeToTempPositionMapHorizontal.set(nodeId, self2.nodeToTempPositionMapHorizontal.get(nodeId) + displacement);
+ if (self2.dummyToNodeForVerticalAlignment.has(nodeId)) {
+ self2.dummyToNodeForVerticalAlignment.get(nodeId).forEach(function(nodeId2) {
+ self2.idToNodeMap.get(nodeId2).displacementX = displacement;
+ });
+ } else {
+ self2.idToNodeMap.get(nodeId).displacementX = displacement;
}
- if (!isFixedComponent) {
- var isExist = false;
- var existAt = void 0;
- _components.forEach(function(component2, index2) {
- if (component2.has([].concat(_toConsumableArray(value2))[0])) {
- isExist = true;
- existAt = index2;
+ }
+ });
+ this.nodesInRelativeVertical.forEach(function(nodeId) {
+ if (!self2.fixedNodesOnHorizontal.has(nodeId)) {
+ var displacement = 0;
+ if (self2.dummyToNodeForHorizontalAlignment.has(nodeId)) {
+ displacement = self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeId)[0]).displacementY;
+ } else {
+ displacement = self2.idToNodeMap.get(nodeId).displacementY;
+ }
+ self2.nodeToRelativeConstraintMapVertical.get(nodeId).forEach(function(constraint) {
+ if (constraint.bottom) {
+ var diff2 = self2.nodeToTempPositionMapVertical.get(constraint.bottom) - self2.nodeToTempPositionMapVertical.get(nodeId) - displacement;
+ if (diff2 < constraint.gap) {
+ displacement -= constraint.gap - diff2;
}
- });
- if (!isExist) {
- _components.push(new Set(value2));
} else {
- value2.forEach(function(ele) {
- _components[existAt].add(ele);
- });
+ var diff2 = self2.nodeToTempPositionMapVertical.get(nodeId) - self2.nodeToTempPositionMapVertical.get(constraint.top) + displacement;
+ if (diff2 < constraint.gap) {
+ displacement += constraint.gap - diff2;
+ }
}
+ });
+ self2.nodeToTempPositionMapVertical.set(nodeId, self2.nodeToTempPositionMapVertical.get(nodeId) + displacement);
+ if (self2.dummyToNodeForHorizontalAlignment.has(nodeId)) {
+ self2.dummyToNodeForHorizontalAlignment.get(nodeId).forEach(function(nodeId2) {
+ self2.idToNodeMap.get(nodeId2).displacementY = displacement;
+ });
+ } else {
+ self2.idToNodeMap.get(nodeId).displacementY = displacement;
}
}
});
- _components.forEach(function(component2, index2) {
- var minBefore = Number.POSITIVE_INFINITY;
- var minAfter = Number.POSITIVE_INFINITY;
- var maxBefore = Number.NEGATIVE_INFINITY;
- var maxAfter = Number.NEGATIVE_INFINITY;
- var _iteratorNormalCompletion3 = true;
- var _didIteratorError3 = false;
- var _iteratorError3 = void 0;
- try {
- for (var _iterator3 = component2[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
- var nodeId = _step3.value;
- var posBefore = void 0;
- if (direction4 == "horizontal") {
- posBefore = nodeIndexes.has(nodeId) ? xCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId);
+ } else {
+ for (var i2 = 0; i2 < this.componentsOnHorizontal.length; i2++) {
+ var component2 = this.componentsOnHorizontal[i2];
+ if (this.fixedComponentsOnHorizontal[i2]) {
+ for (var j2 = 0; j2 < component2.length; j2++) {
+ if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) {
+ this.dummyToNodeForVerticalAlignment.get(component2[j2]).forEach(function(nodeId) {
+ self2.idToNodeMap.get(nodeId).displacementX = 0;
+ });
} else {
- posBefore = nodeIndexes.has(nodeId) ? yCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId);
- }
- var posAfter = positionMap.get(nodeId);
- if (posBefore < minBefore) {
- minBefore = posBefore;
+ this.idToNodeMap.get(component2[j2]).displacementX = 0;
}
- if (posBefore > maxBefore) {
- maxBefore = posBefore;
+ }
+ } else {
+ var sum2 = 0;
+ var count = 0;
+ for (var j2 = 0; j2 < component2.length; j2++) {
+ if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) {
+ var actualNodes = this.dummyToNodeForVerticalAlignment.get(component2[j2]);
+ sum2 += actualNodes.length * this.idToNodeMap.get(actualNodes[0]).displacementX;
+ count += actualNodes.length;
+ } else {
+ sum2 += this.idToNodeMap.get(component2[j2]).displacementX;
+ count++;
}
- if (posAfter < minAfter) {
- minAfter = posAfter;
+ }
+ var averageDisplacement = sum2 / count;
+ for (var j2 = 0; j2 < component2.length; j2++) {
+ if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) {
+ this.dummyToNodeForVerticalAlignment.get(component2[j2]).forEach(function(nodeId) {
+ self2.idToNodeMap.get(nodeId).displacementX = averageDisplacement;
+ });
+ } else {
+ this.idToNodeMap.get(component2[j2]).displacementX = averageDisplacement;
}
- if (posAfter > maxAfter) {
- maxAfter = posAfter;
+ }
+ }
+ }
+ for (var i2 = 0; i2 < this.componentsOnVertical.length; i2++) {
+ var component2 = this.componentsOnVertical[i2];
+ if (this.fixedComponentsOnVertical[i2]) {
+ for (var j2 = 0; j2 < component2.length; j2++) {
+ if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) {
+ this.dummyToNodeForHorizontalAlignment.get(component2[j2]).forEach(function(nodeId) {
+ self2.idToNodeMap.get(nodeId).displacementY = 0;
+ });
+ } else {
+ this.idToNodeMap.get(component2[j2]).displacementY = 0;
}
}
- } catch (err) {
- _didIteratorError3 = true;
- _iteratorError3 = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion3 && _iterator3.return) {
- _iterator3.return();
+ } else {
+ var sum2 = 0;
+ var count = 0;
+ for (var j2 = 0; j2 < component2.length; j2++) {
+ if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) {
+ var actualNodes = this.dummyToNodeForHorizontalAlignment.get(component2[j2]);
+ sum2 += actualNodes.length * this.idToNodeMap.get(actualNodes[0]).displacementY;
+ count += actualNodes.length;
+ } else {
+ sum2 += this.idToNodeMap.get(component2[j2]).displacementY;
+ count++;
}
- } finally {
- if (_didIteratorError3) {
- throw _iteratorError3;
+ }
+ var averageDisplacement = sum2 / count;
+ for (var j2 = 0; j2 < component2.length; j2++) {
+ if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) {
+ this.dummyToNodeForHorizontalAlignment.get(component2[j2]).forEach(function(nodeId) {
+ self2.idToNodeMap.get(nodeId).displacementY = averageDisplacement;
+ });
+ } else {
+ this.idToNodeMap.get(component2[j2]).displacementY = averageDisplacement;
}
}
}
- var diff2 = (minBefore + maxBefore) / 2 - (minAfter + maxAfter) / 2;
- var _iteratorNormalCompletion4 = true;
- var _didIteratorError4 = false;
- var _iteratorError4 = void 0;
- try {
- for (var _iterator4 = component2[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
- var _nodeId = _step4.value;
- positionMap.set(_nodeId, positionMap.get(_nodeId) + diff2);
- }
- } catch (err) {
- _didIteratorError4 = true;
- _iteratorError4 = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion4 && _iterator4.return) {
- _iterator4.return();
- }
- } finally {
- if (_didIteratorError4) {
- throw _iteratorError4;
- }
- }
- }
- });
- }
- return positionMap;
- }, "findAppropriatePositionForRelativePlacement");
- var applyReflectionForRelativePlacement = /* @__PURE__ */ __name(function applyReflectionForRelativePlacement2(relativePlacementConstraints) {
- var reflectOnY = 0, notReflectOnY = 0;
- var reflectOnX = 0, notReflectOnX = 0;
- relativePlacementConstraints.forEach(function(constraint) {
- if (constraint.left) {
- xCoords[nodeIndexes.get(constraint.left)] - xCoords[nodeIndexes.get(constraint.right)] >= 0 ? reflectOnY++ : notReflectOnY++;
- } else {
- yCoords[nodeIndexes.get(constraint.top)] - yCoords[nodeIndexes.get(constraint.bottom)] >= 0 ? reflectOnX++ : notReflectOnX++;
- }
- });
- if (reflectOnY > notReflectOnY && reflectOnX > notReflectOnX) {
- for (var _i = 0; _i < nodeIndexes.size; _i++) {
- xCoords[_i] = -1 * xCoords[_i];
- yCoords[_i] = -1 * yCoords[_i];
- }
- } else if (reflectOnY > notReflectOnY) {
- for (var _i2 = 0; _i2 < nodeIndexes.size; _i2++) {
- xCoords[_i2] = -1 * xCoords[_i2];
- }
- } else if (reflectOnX > notReflectOnX) {
- for (var _i3 = 0; _i3 < nodeIndexes.size; _i3++) {
- yCoords[_i3] = -1 * yCoords[_i3];
}
}
- }, "applyReflectionForRelativePlacement");
- var findComponents = /* @__PURE__ */ __name(function findComponents2(graph) {
- var components4 = [];
- var queue = new LinkedList();
- var visited = /* @__PURE__ */ new Set();
- var count = 0;
- graph.forEach(function(value2, key) {
- if (!visited.has(key)) {
- components4[count] = [];
- var _currentNode = key;
- queue.push(_currentNode);
- visited.add(_currentNode);
- components4[count].push(_currentNode);
- while (queue.length != 0) {
- _currentNode = queue.shift();
- var neighbors = graph.get(_currentNode);
- neighbors.forEach(function(neighbor) {
- if (!visited.has(neighbor.id)) {
- queue.push(neighbor.id);
- visited.add(neighbor.id);
- components4[count].push(neighbor.id);
- }
- });
- }
- count++;
- }
- });
- return components4;
- }, "findComponents");
- var dagToUndirected = /* @__PURE__ */ __name(function dagToUndirected2(dag2) {
- var undirected = /* @__PURE__ */ new Map();
- dag2.forEach(function(value2, key) {
- undirected.set(key, []);
- });
- dag2.forEach(function(value2, key) {
- value2.forEach(function(adjacent) {
- undirected.get(key).push(adjacent);
- undirected.get(adjacent.id).push({ id: key, gap: adjacent.gap, direction: adjacent.direction });
- });
- });
- return undirected;
- }, "dagToUndirected");
- var dagToReversed = /* @__PURE__ */ __name(function dagToReversed2(dag2) {
- var reversed = /* @__PURE__ */ new Map();
- dag2.forEach(function(value2, key) {
- reversed.set(key, []);
- });
- dag2.forEach(function(value2, key) {
- value2.forEach(function(adjacent) {
- reversed.get(adjacent.id).push({ id: key, gap: adjacent.gap, direction: adjacent.direction });
- });
- });
- return reversed;
- }, "dagToReversed");
- var targetMatrix = [];
- var sourceMatrix = [];
- var standardTransformation = false;
- var reflectionType = false;
- var fixedNodes = /* @__PURE__ */ new Set();
- var dag = /* @__PURE__ */ new Map();
- var dagUndirected = /* @__PURE__ */ new Map();
- var components3 = [];
- if (constraints.fixedNodeConstraint) {
- constraints.fixedNodeConstraint.forEach(function(nodeData2) {
- fixedNodes.add(nodeData2.nodeId);
- });
}
- if (constraints.relativePlacementConstraint) {
- constraints.relativePlacementConstraint.forEach(function(constraint) {
- if (constraint.left) {
- if (dag.has(constraint.left)) {
- dag.get(constraint.left).push({ id: constraint.right, gap: constraint.gap, direction: "horizontal" });
- } else {
- dag.set(constraint.left, [{ id: constraint.right, gap: constraint.gap, direction: "horizontal" }]);
- }
- if (!dag.has(constraint.right)) {
- dag.set(constraint.right, []);
- }
- } else {
- if (dag.has(constraint.top)) {
- dag.get(constraint.top).push({ id: constraint.bottom, gap: constraint.gap, direction: "vertical" });
- } else {
- dag.set(constraint.top, [{ id: constraint.bottom, gap: constraint.gap, direction: "vertical" }]);
- }
- if (!dag.has(constraint.bottom)) {
- dag.set(constraint.bottom, []);
- }
- }
- });
- dagUndirected = dagToUndirected(dag);
- components3 = findComponents(dagUndirected);
+ };
+ CoSELayout.prototype.calculateNodesToApplyGravitationTo = function() {
+ var nodeList = [];
+ var graph;
+ var graphs = this.graphManager.getGraphs();
+ var size5 = graphs.length;
+ var i2;
+ for (i2 = 0; i2 < size5; i2++) {
+ graph = graphs[i2];
+ graph.updateConnected();
+ if (!graph.isConnected) {
+ nodeList = nodeList.concat(graph.getNodes());
+ }
}
- if (CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING) {
- if (constraints.fixedNodeConstraint && constraints.fixedNodeConstraint.length > 1) {
- constraints.fixedNodeConstraint.forEach(function(nodeData2, i3) {
- targetMatrix[i3] = [nodeData2.position.x, nodeData2.position.y];
- sourceMatrix[i3] = [xCoords[nodeIndexes.get(nodeData2.nodeId)], yCoords[nodeIndexes.get(nodeData2.nodeId)]];
- });
- standardTransformation = true;
- } else if (constraints.alignmentConstraint) {
- (function() {
- var count = 0;
- if (constraints.alignmentConstraint.vertical) {
- var verticalAlign = constraints.alignmentConstraint.vertical;
- var _loop2 = /* @__PURE__ */ __name(function _loop22(_i42) {
- var alignmentSet = /* @__PURE__ */ new Set();
- verticalAlign[_i42].forEach(function(nodeId) {
- alignmentSet.add(nodeId);
- });
- var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) {
- return fixedNodes.has(x5);
- }));
- var xPos = void 0;
- if (intersection3.size > 0) xPos = xCoords[nodeIndexes.get(intersection3.values().next().value)];
- else xPos = calculateAvgPosition(alignmentSet).x;
- verticalAlign[_i42].forEach(function(nodeId) {
- targetMatrix[count] = [xPos, yCoords[nodeIndexes.get(nodeId)]];
- sourceMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]];
- count++;
- });
- }, "_loop2");
- for (var _i4 = 0; _i4 < verticalAlign.length; _i4++) {
- _loop2(_i4);
- }
- standardTransformation = true;
- }
- if (constraints.alignmentConstraint.horizontal) {
- var horizontalAlign = constraints.alignmentConstraint.horizontal;
- var _loop3 = /* @__PURE__ */ __name(function _loop32(_i52) {
- var alignmentSet = /* @__PURE__ */ new Set();
- horizontalAlign[_i52].forEach(function(nodeId) {
- alignmentSet.add(nodeId);
- });
- var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) {
- return fixedNodes.has(x5);
- }));
- var yPos = void 0;
- if (intersection3.size > 0) yPos = xCoords[nodeIndexes.get(intersection3.values().next().value)];
- else yPos = calculateAvgPosition(alignmentSet).y;
- horizontalAlign[_i52].forEach(function(nodeId) {
- targetMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yPos];
- sourceMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]];
- count++;
- });
- }, "_loop3");
- for (var _i5 = 0; _i5 < horizontalAlign.length; _i5++) {
- _loop3(_i5);
- }
- standardTransformation = true;
- }
- if (constraints.relativePlacementConstraint) {
- reflectionType = true;
- }
- })();
- } else if (constraints.relativePlacementConstraint) {
- var largestComponentSize = 0;
- var largestComponentIndex = 0;
- for (var _i6 = 0; _i6 < components3.length; _i6++) {
- if (components3[_i6].length > largestComponentSize) {
- largestComponentSize = components3[_i6].length;
- largestComponentIndex = _i6;
- }
- }
- if (largestComponentSize < dagUndirected.size / 2) {
- applyReflectionForRelativePlacement(constraints.relativePlacementConstraint);
- standardTransformation = false;
- reflectionType = false;
+ return nodeList;
+ };
+ CoSELayout.prototype.createBendpoints = function() {
+ var edges3 = [];
+ edges3 = edges3.concat(this.graphManager.getAllEdges());
+ var visited = /* @__PURE__ */ new Set();
+ var i2;
+ for (i2 = 0; i2 < edges3.length; i2++) {
+ var edge = edges3[i2];
+ if (!visited.has(edge)) {
+ var source = edge.getSource();
+ var target = edge.getTarget();
+ if (source == target) {
+ edge.getBendpoints().push(new PointD());
+ edge.getBendpoints().push(new PointD());
+ this.createDummyNodesForBendpoints(edge);
+ visited.add(edge);
} else {
- var subGraphOnHorizontal = /* @__PURE__ */ new Map();
- var subGraphOnVertical = /* @__PURE__ */ new Map();
- var constraintsInlargestComponent = [];
- components3[largestComponentIndex].forEach(function(nodeId) {
- dag.get(nodeId).forEach(function(adjacent) {
- if (adjacent.direction == "horizontal") {
- if (subGraphOnHorizontal.has(nodeId)) {
- subGraphOnHorizontal.get(nodeId).push(adjacent);
- } else {
- subGraphOnHorizontal.set(nodeId, [adjacent]);
- }
- if (!subGraphOnHorizontal.has(adjacent.id)) {
- subGraphOnHorizontal.set(adjacent.id, []);
- }
- constraintsInlargestComponent.push({ left: nodeId, right: adjacent.id });
- } else {
- if (subGraphOnVertical.has(nodeId)) {
- subGraphOnVertical.get(nodeId).push(adjacent);
- } else {
- subGraphOnVertical.set(nodeId, [adjacent]);
- }
- if (!subGraphOnVertical.has(adjacent.id)) {
- subGraphOnVertical.set(adjacent.id, []);
- }
- constraintsInlargestComponent.push({ top: nodeId, bottom: adjacent.id });
+ var edgeList2 = [];
+ edgeList2 = edgeList2.concat(source.getEdgeListToNode(target));
+ edgeList2 = edgeList2.concat(target.getEdgeListToNode(source));
+ if (!visited.has(edgeList2[0])) {
+ if (edgeList2.length > 1) {
+ var k2;
+ for (k2 = 0; k2 < edgeList2.length; k2++) {
+ var multiEdge = edgeList2[k2];
+ multiEdge.getBendpoints().push(new PointD());
+ this.createDummyNodesForBendpoints(multiEdge);
}
- });
- });
- applyReflectionForRelativePlacement(constraintsInlargestComponent);
- reflectionType = false;
- var positionMapHorizontal = findAppropriatePositionForRelativePlacement(subGraphOnHorizontal, "horizontal");
- var positionMapVertical = findAppropriatePositionForRelativePlacement(subGraphOnVertical, "vertical");
- components3[largestComponentIndex].forEach(function(nodeId, i3) {
- sourceMatrix[i3] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]];
- targetMatrix[i3] = [];
- if (positionMapHorizontal.has(nodeId)) {
- targetMatrix[i3][0] = positionMapHorizontal.get(nodeId);
- } else {
- targetMatrix[i3][0] = xCoords[nodeIndexes.get(nodeId)];
}
- if (positionMapVertical.has(nodeId)) {
- targetMatrix[i3][1] = positionMapVertical.get(nodeId);
- } else {
- targetMatrix[i3][1] = yCoords[nodeIndexes.get(nodeId)];
- }
- });
- standardTransformation = true;
- }
- }
- if (standardTransformation) {
- var transformationMatrix = void 0;
- var targetMatrixTranspose = Matrix.transpose(targetMatrix);
- var sourceMatrixTranspose = Matrix.transpose(sourceMatrix);
- for (var _i7 = 0; _i7 < targetMatrixTranspose.length; _i7++) {
- targetMatrixTranspose[_i7] = Matrix.multGamma(targetMatrixTranspose[_i7]);
- sourceMatrixTranspose[_i7] = Matrix.multGamma(sourceMatrixTranspose[_i7]);
- }
- var tempMatrix = Matrix.multMat(targetMatrixTranspose, Matrix.transpose(sourceMatrixTranspose));
- var SVDResult = SVD.svd(tempMatrix);
- transformationMatrix = Matrix.multMat(SVDResult.V, Matrix.transpose(SVDResult.U));
- for (var _i8 = 0; _i8 < nodeIndexes.size; _i8++) {
- var temp1 = [xCoords[_i8], yCoords[_i8]];
- var temp2 = [transformationMatrix[0][0], transformationMatrix[1][0]];
- var temp3 = [transformationMatrix[0][1], transformationMatrix[1][1]];
- xCoords[_i8] = Matrix.dotProduct(temp1, temp2);
- yCoords[_i8] = Matrix.dotProduct(temp1, temp3);
- }
- if (reflectionType) {
- applyReflectionForRelativePlacement(constraints.relativePlacementConstraint);
- }
- }
- }
- if (CoSEConstants.ENFORCE_CONSTRAINTS) {
- if (constraints.fixedNodeConstraint && constraints.fixedNodeConstraint.length > 0) {
- var translationAmount = { x: 0, y: 0 };
- constraints.fixedNodeConstraint.forEach(function(nodeData2, i3) {
- var posInTheory = { x: xCoords[nodeIndexes.get(nodeData2.nodeId)], y: yCoords[nodeIndexes.get(nodeData2.nodeId)] };
- var posDesired = nodeData2.position;
- var posDiff = calculatePositionDiff(posDesired, posInTheory);
- translationAmount.x += posDiff.x;
- translationAmount.y += posDiff.y;
- });
- translationAmount.x /= constraints.fixedNodeConstraint.length;
- translationAmount.y /= constraints.fixedNodeConstraint.length;
- xCoords.forEach(function(value2, i3) {
- xCoords[i3] += translationAmount.x;
- });
- yCoords.forEach(function(value2, i3) {
- yCoords[i3] += translationAmount.y;
- });
- constraints.fixedNodeConstraint.forEach(function(nodeData2) {
- xCoords[nodeIndexes.get(nodeData2.nodeId)] = nodeData2.position.x;
- yCoords[nodeIndexes.get(nodeData2.nodeId)] = nodeData2.position.y;
- });
- }
- if (constraints.alignmentConstraint) {
- if (constraints.alignmentConstraint.vertical) {
- var xAlign = constraints.alignmentConstraint.vertical;
- var _loop4 = /* @__PURE__ */ __name(function _loop42(_i92) {
- var alignmentSet = /* @__PURE__ */ new Set();
- xAlign[_i92].forEach(function(nodeId) {
- alignmentSet.add(nodeId);
- });
- var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) {
- return fixedNodes.has(x5);
- }));
- var xPos = void 0;
- if (intersection3.size > 0) xPos = xCoords[nodeIndexes.get(intersection3.values().next().value)];
- else xPos = calculateAvgPosition(alignmentSet).x;
- alignmentSet.forEach(function(nodeId) {
- if (!fixedNodes.has(nodeId)) xCoords[nodeIndexes.get(nodeId)] = xPos;
- });
- }, "_loop4");
- for (var _i9 = 0; _i9 < xAlign.length; _i9++) {
- _loop4(_i9);
- }
- }
- if (constraints.alignmentConstraint.horizontal) {
- var yAlign = constraints.alignmentConstraint.horizontal;
- var _loop5 = /* @__PURE__ */ __name(function _loop52(_i102) {
- var alignmentSet = /* @__PURE__ */ new Set();
- yAlign[_i102].forEach(function(nodeId) {
- alignmentSet.add(nodeId);
- });
- var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) {
- return fixedNodes.has(x5);
- }));
- var yPos = void 0;
- if (intersection3.size > 0) yPos = yCoords[nodeIndexes.get(intersection3.values().next().value)];
- else yPos = calculateAvgPosition(alignmentSet).y;
- alignmentSet.forEach(function(nodeId) {
- if (!fixedNodes.has(nodeId)) yCoords[nodeIndexes.get(nodeId)] = yPos;
+ edgeList2.forEach(function(edge2) {
+ visited.add(edge2);
});
- }, "_loop5");
- for (var _i10 = 0; _i10 < yAlign.length; _i10++) {
- _loop5(_i10);
}
}
}
- if (constraints.relativePlacementConstraint) {
- (function() {
- var nodeToDummyForVerticalAlignment = /* @__PURE__ */ new Map();
- var nodeToDummyForHorizontalAlignment = /* @__PURE__ */ new Map();
- var dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map();
- var dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map();
- var dummyPositionsForVerticalAlignment = /* @__PURE__ */ new Map();
- var dummyPositionsForHorizontalAlignment = /* @__PURE__ */ new Map();
- var fixedNodesOnHorizontal = /* @__PURE__ */ new Set();
- var fixedNodesOnVertical = /* @__PURE__ */ new Set();
- fixedNodes.forEach(function(nodeId2) {
- fixedNodesOnHorizontal.add(nodeId2);
- fixedNodesOnVertical.add(nodeId2);
- });
- if (constraints.alignmentConstraint) {
- if (constraints.alignmentConstraint.vertical) {
- var verticalAlignment2 = constraints.alignmentConstraint.vertical;
- var _loop6 = /* @__PURE__ */ __name(function _loop62(_i112) {
- dummyToNodeForVerticalAlignment.set("dummy" + _i112, []);
- verticalAlignment2[_i112].forEach(function(nodeId2) {
- nodeToDummyForVerticalAlignment.set(nodeId2, "dummy" + _i112);
- dummyToNodeForVerticalAlignment.get("dummy" + _i112).push(nodeId2);
- if (fixedNodes.has(nodeId2)) {
- fixedNodesOnHorizontal.add("dummy" + _i112);
- }
- });
- dummyPositionsForVerticalAlignment.set("dummy" + _i112, xCoords[nodeIndexes.get(verticalAlignment2[_i112][0])]);
- }, "_loop6");
- for (var _i11 = 0; _i11 < verticalAlignment2.length; _i11++) {
- _loop6(_i11);
- }
- }
- if (constraints.alignmentConstraint.horizontal) {
- var horizontalAlignment = constraints.alignmentConstraint.horizontal;
- var _loop7 = /* @__PURE__ */ __name(function _loop72(_i122) {
- dummyToNodeForHorizontalAlignment.set("dummy" + _i122, []);
- horizontalAlignment[_i122].forEach(function(nodeId2) {
- nodeToDummyForHorizontalAlignment.set(nodeId2, "dummy" + _i122);
- dummyToNodeForHorizontalAlignment.get("dummy" + _i122).push(nodeId2);
- if (fixedNodes.has(nodeId2)) {
- fixedNodesOnVertical.add("dummy" + _i122);
- }
- });
- dummyPositionsForHorizontalAlignment.set("dummy" + _i122, yCoords[nodeIndexes.get(horizontalAlignment[_i122][0])]);
- }, "_loop7");
- for (var _i12 = 0; _i12 < horizontalAlignment.length; _i12++) {
- _loop7(_i12);
- }
- }
- }
- var dagOnHorizontal = /* @__PURE__ */ new Map();
- var dagOnVertical = /* @__PURE__ */ new Map();
- var _loop8 = /* @__PURE__ */ __name(function _loop82(nodeId2) {
- dag.get(nodeId2).forEach(function(adjacent) {
- var sourceId = void 0;
- var targetNode = void 0;
- if (adjacent["direction"] == "horizontal") {
- sourceId = nodeToDummyForVerticalAlignment.get(nodeId2) ? nodeToDummyForVerticalAlignment.get(nodeId2) : nodeId2;
- if (nodeToDummyForVerticalAlignment.get(adjacent.id)) {
- targetNode = { id: nodeToDummyForVerticalAlignment.get(adjacent.id), gap: adjacent.gap, direction: adjacent.direction };
- } else {
- targetNode = adjacent;
- }
- if (dagOnHorizontal.has(sourceId)) {
- dagOnHorizontal.get(sourceId).push(targetNode);
- } else {
- dagOnHorizontal.set(sourceId, [targetNode]);
- }
- if (!dagOnHorizontal.has(targetNode.id)) {
- dagOnHorizontal.set(targetNode.id, []);
- }
- } else {
- sourceId = nodeToDummyForHorizontalAlignment.get(nodeId2) ? nodeToDummyForHorizontalAlignment.get(nodeId2) : nodeId2;
- if (nodeToDummyForHorizontalAlignment.get(adjacent.id)) {
- targetNode = { id: nodeToDummyForHorizontalAlignment.get(adjacent.id), gap: adjacent.gap, direction: adjacent.direction };
- } else {
- targetNode = adjacent;
- }
- if (dagOnVertical.has(sourceId)) {
- dagOnVertical.get(sourceId).push(targetNode);
- } else {
- dagOnVertical.set(sourceId, [targetNode]);
- }
- if (!dagOnVertical.has(targetNode.id)) {
- dagOnVertical.set(targetNode.id, []);
- }
- }
- });
- }, "_loop8");
- var _iteratorNormalCompletion5 = true;
- var _didIteratorError5 = false;
- var _iteratorError5 = void 0;
- try {
- for (var _iterator5 = dag.keys()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
- var nodeId = _step5.value;
- _loop8(nodeId);
- }
- } catch (err) {
- _didIteratorError5 = true;
- _iteratorError5 = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion5 && _iterator5.return) {
- _iterator5.return();
- }
- } finally {
- if (_didIteratorError5) {
- throw _iteratorError5;
- }
- }
- }
- var undirectedOnHorizontal = dagToUndirected(dagOnHorizontal);
- var undirectedOnVertical = dagToUndirected(dagOnVertical);
- var componentsOnHorizontal = findComponents(undirectedOnHorizontal);
- var componentsOnVertical = findComponents(undirectedOnVertical);
- var reversedDagOnHorizontal = dagToReversed(dagOnHorizontal);
- var reversedDagOnVertical = dagToReversed(dagOnVertical);
- var componentSourcesOnHorizontal = [];
- var componentSourcesOnVertical = [];
- componentsOnHorizontal.forEach(function(component2, index2) {
- componentSourcesOnHorizontal[index2] = [];
- component2.forEach(function(nodeId2) {
- if (reversedDagOnHorizontal.get(nodeId2).length == 0) {
- componentSourcesOnHorizontal[index2].push(nodeId2);
- }
- });
- });
- componentsOnVertical.forEach(function(component2, index2) {
- componentSourcesOnVertical[index2] = [];
- component2.forEach(function(nodeId2) {
- if (reversedDagOnVertical.get(nodeId2).length == 0) {
- componentSourcesOnVertical[index2].push(nodeId2);
- }
- });
- });
- var positionMapHorizontal2 = findAppropriatePositionForRelativePlacement(dagOnHorizontal, "horizontal", fixedNodesOnHorizontal, dummyPositionsForVerticalAlignment, componentSourcesOnHorizontal);
- var positionMapVertical2 = findAppropriatePositionForRelativePlacement(dagOnVertical, "vertical", fixedNodesOnVertical, dummyPositionsForHorizontalAlignment, componentSourcesOnVertical);
- var _loop9 = /* @__PURE__ */ __name(function _loop92(key2) {
- if (dummyToNodeForVerticalAlignment.get(key2)) {
- dummyToNodeForVerticalAlignment.get(key2).forEach(function(nodeId2) {
- xCoords[nodeIndexes.get(nodeId2)] = positionMapHorizontal2.get(key2);
- });
- } else {
- xCoords[nodeIndexes.get(key2)] = positionMapHorizontal2.get(key2);
- }
- }, "_loop9");
- var _iteratorNormalCompletion6 = true;
- var _didIteratorError6 = false;
- var _iteratorError6 = void 0;
- try {
- for (var _iterator6 = positionMapHorizontal2.keys()[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
- var key = _step6.value;
- _loop9(key);
- }
- } catch (err) {
- _didIteratorError6 = true;
- _iteratorError6 = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion6 && _iterator6.return) {
- _iterator6.return();
- }
- } finally {
- if (_didIteratorError6) {
- throw _iteratorError6;
- }
- }
- }
- var _loop10 = /* @__PURE__ */ __name(function _loop102(key2) {
- if (dummyToNodeForHorizontalAlignment.get(key2)) {
- dummyToNodeForHorizontalAlignment.get(key2).forEach(function(nodeId2) {
- yCoords[nodeIndexes.get(nodeId2)] = positionMapVertical2.get(key2);
- });
- } else {
- yCoords[nodeIndexes.get(key2)] = positionMapVertical2.get(key2);
- }
- }, "_loop10");
- var _iteratorNormalCompletion7 = true;
- var _didIteratorError7 = false;
- var _iteratorError7 = void 0;
- try {
- for (var _iterator7 = positionMapVertical2.keys()[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
- var key = _step7.value;
- _loop10(key);
- }
- } catch (err) {
- _didIteratorError7 = true;
- _iteratorError7 = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion7 && _iterator7.return) {
- _iterator7.return();
- }
- } finally {
- if (_didIteratorError7) {
- throw _iteratorError7;
- }
- }
- }
- })();
+ if (visited.size == edges3.length) {
+ break;
}
}
- for (var _i13 = 0; _i13 < allNodes.length; _i13++) {
- var _node = allNodes[_i13];
- if (_node.getChild() == null) {
- _node.setCenter(xCoords[nodeIndexes.get(_node.id)], yCoords[nodeIndexes.get(_node.id)]);
+ };
+ CoSELayout.prototype.positionNodesRadially = function(forest) {
+ var currentStartingPoint = new Point3(0, 0);
+ var numberOfColumns = Math.ceil(Math.sqrt(forest.length));
+ var height2 = 0;
+ var currentY = 0;
+ var currentX = 0;
+ var point8 = new PointD(0, 0);
+ for (var i2 = 0; i2 < forest.length; i2++) {
+ if (i2 % numberOfColumns == 0) {
+ currentX = 0;
+ currentY = height2;
+ if (i2 != 0) {
+ currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION;
+ }
+ height2 = 0;
+ }
+ var tree = forest[i2];
+ var centerNode = Layout2.findCenterOfTree(tree);
+ currentStartingPoint.x = currentX;
+ currentStartingPoint.y = currentY;
+ point8 = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint);
+ if (point8.y > height2) {
+ height2 = Math.floor(point8.y);
}
+ currentX = Math.floor(point8.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION);
}
+ this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point8.x / 2, LayoutConstants.WORLD_CENTER_Y - point8.y / 2));
};
- module3.exports = ConstraintHandler;
- }
- ),
- /***/
- 551: (
- /***/
- (module3) => {
- module3.exports = __WEBPACK_EXTERNAL_MODULE__551__;
- }
- )
- /******/
- };
- var __webpack_module_cache__ = {};
- function __webpack_require__(moduleId) {
- var cachedModule = __webpack_module_cache__[moduleId];
- if (cachedModule !== void 0) {
- return cachedModule.exports;
- }
- var module3 = __webpack_module_cache__[moduleId] = {
- /******/
- // no module.id needed
- /******/
- // no module.loaded needed
- /******/
- exports: {}
- /******/
- };
- __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
- return module3.exports;
- }
- __name(__webpack_require__, "__webpack_require__");
- var __webpack_exports__ = __webpack_require__(45);
- return __webpack_exports__;
- })()
- );
- });
- }
- });
-
- // ../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.30.1/node_modules/cytoscape-fcose/cytoscape-fcose.js
- var require_cytoscape_fcose = __commonJS({
- "../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.30.1/node_modules/cytoscape-fcose/cytoscape-fcose.js"(exports2, module2) {
- "use strict";
- (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) {
- if (typeof exports2 === "object" && typeof module2 === "object")
- module2.exports = factory(require_cose_base2());
- else if (typeof define === "function" && define.amd)
- define(["cose-base"], factory);
- else if (typeof exports2 === "object")
- exports2["cytoscapeFcose"] = factory(require_cose_base2());
- else
- root4["cytoscapeFcose"] = factory(root4["coseBase"]);
- }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE__140__) {
- return (
- /******/
- (() => {
- "use strict";
- var __webpack_modules__ = {
- /***/
- 658: (
- /***/
- (module3) => {
- module3.exports = Object.assign != null ? Object.assign.bind(Object) : function(tgt) {
- for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- srcs[_key - 1] = arguments[_key];
+ CoSELayout.radialLayout = function(tree, centerNode, startingPoint) {
+ var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION);
+ CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);
+ var bounds4 = LGraph.calculateBounds(tree);
+ var transform8 = new Transform2();
+ transform8.setDeviceOrgX(bounds4.getMinX());
+ transform8.setDeviceOrgY(bounds4.getMinY());
+ transform8.setWorldOrgX(startingPoint.x);
+ transform8.setWorldOrgY(startingPoint.y);
+ for (var i2 = 0; i2 < tree.length; i2++) {
+ var node2 = tree[i2];
+ node2.transform(transform8);
}
- srcs.forEach(function(src) {
- Object.keys(src).forEach(function(k2) {
- return tgt[k2] = src[k2];
- });
- });
- return tgt;
+ var bottomRight = new PointD(bounds4.getMaxX(), bounds4.getMaxY());
+ return transform8.inverseTransformPoint(bottomRight);
};
- }
- ),
- /***/
- 548: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var _slicedToArray2 = /* @__PURE__ */ function() {
- function sliceIterator(arr, i2) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i2 && _arr.length === i2) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
+ CoSELayout.branchRadialLayout = function(node2, parentOfNode, startAngle, endAngle, distance2, radialSeparation) {
+ var halfInterval = (endAngle - startAngle + 1) / 2;
+ if (halfInterval < 0) {
+ halfInterval += 180;
+ }
+ var nodeAngle = (halfInterval + startAngle) % 360;
+ var teta = nodeAngle * IGeometry.TWO_PI / 360;
+ var cos_teta = Math.cos(teta);
+ var x_ = distance2 * Math.cos(teta);
+ var y_ = distance2 * Math.sin(teta);
+ node2.setCenter(x_, y_);
+ var neighborEdges = [];
+ neighborEdges = neighborEdges.concat(node2.getEdges());
+ var childCount = neighborEdges.length;
+ if (parentOfNode != null) {
+ childCount--;
+ }
+ var branchCount = 0;
+ var incEdgesCount = neighborEdges.length;
+ var startIndex;
+ var edges3 = node2.getEdgesBetween(parentOfNode);
+ while (edges3.length > 1) {
+ var temp = edges3[0];
+ edges3.splice(0, 1);
+ var index = neighborEdges.indexOf(temp);
+ if (index >= 0) {
+ neighborEdges.splice(index, 1);
}
- return _arr;
+ incEdgesCount--;
+ childCount--;
}
- __name(sliceIterator, "sliceIterator");
- return function(arr, i2) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i2);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
+ if (parentOfNode != null) {
+ startIndex = (neighborEdges.indexOf(edges3[0]) + 1) % incEdgesCount;
+ } else {
+ startIndex = 0;
+ }
+ var stepAngle = Math.abs(endAngle - startAngle) / childCount;
+ for (var i2 = startIndex; branchCount != childCount; i2 = ++i2 % incEdgesCount) {
+ var currentNeighbor = neighborEdges[i2].getOtherEnd(node2);
+ if (currentNeighbor == parentOfNode) {
+ continue;
}
- };
- }();
- var LinkedList = __webpack_require__2(140).layoutBase.LinkedList;
- var auxiliary = {};
- auxiliary.getTopMostNodes = function(nodes6) {
- var nodesMap2 = {};
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- nodesMap2[nodes6[i2].id()] = true;
+ var childStartAngle = (startAngle + branchCount * stepAngle) % 360;
+ var childEndAngle = (childStartAngle + stepAngle) % 360;
+ CoSELayout.branchRadialLayout(currentNeighbor, node2, childStartAngle, childEndAngle, distance2 + radialSeparation, radialSeparation);
+ branchCount++;
}
- var roots = nodes6.filter(function(ele, i3) {
- if (typeof ele === "number") {
- ele = i3;
+ };
+ CoSELayout.maxDiagonalInTree = function(tree) {
+ var maxDiagonal = Integer.MIN_VALUE;
+ for (var i2 = 0; i2 < tree.length; i2++) {
+ var node2 = tree[i2];
+ var diagonal = node2.getDiagonal();
+ if (diagonal > maxDiagonal) {
+ maxDiagonal = diagonal;
}
- var parent4 = ele.parent()[0];
- while (parent4 != null) {
- if (nodesMap2[parent4.id()]) {
- return false;
+ }
+ return maxDiagonal;
+ };
+ CoSELayout.prototype.calcRepulsionRange = function() {
+ return 2 * (this.level + 1) * this.idealEdgeLength;
+ };
+ CoSELayout.prototype.groupZeroDegreeMembers = function() {
+ var self2 = this;
+ var tempMemberGroups = {};
+ this.memberGroups = {};
+ this.idToDummyNode = {};
+ var zeroDegree = [];
+ var allNodes = this.graphManager.getAllNodes();
+ for (var i2 = 0; i2 < allNodes.length; i2++) {
+ var node2 = allNodes[i2];
+ var parent4 = node2.getParent();
+ if (this.getNodeDegreeWithChildren(node2) === 0 && (parent4.id == void 0 || !this.getToBeTiled(parent4))) {
+ zeroDegree.push(node2);
+ }
+ }
+ for (var i2 = 0; i2 < zeroDegree.length; i2++) {
+ var node2 = zeroDegree[i2];
+ var p_id = node2.getParent().id;
+ if (typeof tempMemberGroups[p_id] === "undefined") tempMemberGroups[p_id] = [];
+ tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node2);
+ }
+ Object.keys(tempMemberGroups).forEach(function(p_id2) {
+ if (tempMemberGroups[p_id2].length > 1) {
+ var dummyCompoundId = "DummyCompound_" + p_id2;
+ self2.memberGroups[dummyCompoundId] = tempMemberGroups[p_id2];
+ var parent5 = tempMemberGroups[p_id2][0].getParent();
+ var dummyCompound = new CoSENode(self2.graphManager);
+ dummyCompound.id = dummyCompoundId;
+ dummyCompound.paddingLeft = parent5.paddingLeft || 0;
+ dummyCompound.paddingRight = parent5.paddingRight || 0;
+ dummyCompound.paddingBottom = parent5.paddingBottom || 0;
+ dummyCompound.paddingTop = parent5.paddingTop || 0;
+ self2.idToDummyNode[dummyCompoundId] = dummyCompound;
+ var dummyParentGraph = self2.getGraphManager().add(self2.newGraph(), dummyCompound);
+ var parentGraph = parent5.getChild();
+ parentGraph.add(dummyCompound);
+ for (var i3 = 0; i3 < tempMemberGroups[p_id2].length; i3++) {
+ var node3 = tempMemberGroups[p_id2][i3];
+ parentGraph.remove(node3);
+ dummyParentGraph.add(node3);
}
- parent4 = parent4.parent()[0];
}
- return true;
});
- return roots;
};
- auxiliary.connectComponents = function(cy, eles, topMostNodes, dummyNodes) {
- var queue = new LinkedList();
- var visited = /* @__PURE__ */ new Set();
- var visitedTopMostNodes = [];
- var currentNeighbor = void 0;
- var minDegreeNode = void 0;
- var minDegree = void 0;
- var isConnected = false;
- var count = 1;
- var nodesConnectedToDummy = [];
- var components3 = [];
- var _loop = /* @__PURE__ */ __name(function _loop2() {
- var cmpt = cy.collection();
- components3.push(cmpt);
- var currentNode = topMostNodes[0];
- var childrenOfCurrentNode = cy.collection();
- childrenOfCurrentNode.merge(currentNode).merge(currentNode.descendants().intersection(eles));
- visitedTopMostNodes.push(currentNode);
- childrenOfCurrentNode.forEach(function(node2) {
- queue.push(node2);
- visited.add(node2);
- cmpt.merge(node2);
- });
- var _loop22 = /* @__PURE__ */ __name(function _loop23() {
- currentNode = queue.shift();
- var neighborNodes = cy.collection();
- currentNode.neighborhood().nodes().forEach(function(node2) {
- if (eles.intersection(currentNode.edgesWith(node2)).length > 0) {
- neighborNodes.merge(node2);
+ CoSELayout.prototype.clearCompounds = function() {
+ var childGraphMap = {};
+ var idToNode = {};
+ this.performDFSOnCompounds();
+ for (var i2 = 0; i2 < this.compoundOrder.length; i2++) {
+ idToNode[this.compoundOrder[i2].id] = this.compoundOrder[i2];
+ childGraphMap[this.compoundOrder[i2].id] = [].concat(this.compoundOrder[i2].getChild().getNodes());
+ this.graphManager.remove(this.compoundOrder[i2].getChild());
+ this.compoundOrder[i2].child = null;
+ }
+ this.graphManager.resetAllNodes();
+ this.tileCompoundMembers(childGraphMap, idToNode);
+ };
+ CoSELayout.prototype.clearZeroDegreeMembers = function() {
+ var self2 = this;
+ var tiledZeroDegreePack = this.tiledZeroDegreePack = [];
+ Object.keys(this.memberGroups).forEach(function(id29) {
+ var compoundNode = self2.idToDummyNode[id29];
+ tiledZeroDegreePack[id29] = self2.tileNodes(self2.memberGroups[id29], compoundNode.paddingLeft + compoundNode.paddingRight);
+ compoundNode.rect.width = tiledZeroDegreePack[id29].width;
+ compoundNode.rect.height = tiledZeroDegreePack[id29].height;
+ compoundNode.setCenter(tiledZeroDegreePack[id29].centerX, tiledZeroDegreePack[id29].centerY);
+ compoundNode.labelMarginLeft = 0;
+ compoundNode.labelMarginTop = 0;
+ if (CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {
+ var width3 = compoundNode.rect.width;
+ var height2 = compoundNode.rect.height;
+ if (compoundNode.labelWidth) {
+ if (compoundNode.labelPosHorizontal == "left") {
+ compoundNode.rect.x -= compoundNode.labelWidth;
+ compoundNode.setWidth(width3 + compoundNode.labelWidth);
+ compoundNode.labelMarginLeft = compoundNode.labelWidth;
+ } else if (compoundNode.labelPosHorizontal == "center" && compoundNode.labelWidth > width3) {
+ compoundNode.rect.x -= (compoundNode.labelWidth - width3) / 2;
+ compoundNode.setWidth(compoundNode.labelWidth);
+ compoundNode.labelMarginLeft = (compoundNode.labelWidth - width3) / 2;
+ } else if (compoundNode.labelPosHorizontal == "right") {
+ compoundNode.setWidth(width3 + compoundNode.labelWidth);
}
- });
- for (var i2 = 0; i2 < neighborNodes.length; i2++) {
- var neighborNode = neighborNodes[i2];
- currentNeighbor = topMostNodes.intersection(neighborNode.union(neighborNode.ancestors()));
- if (currentNeighbor != null && !visited.has(currentNeighbor[0])) {
- var childrenOfNeighbor = currentNeighbor.union(currentNeighbor.descendants());
- childrenOfNeighbor.forEach(function(node2) {
- queue.push(node2);
- visited.add(node2);
- cmpt.merge(node2);
- if (topMostNodes.has(node2)) {
- visitedTopMostNodes.push(node2);
- }
- });
+ }
+ if (compoundNode.labelHeight) {
+ if (compoundNode.labelPosVertical == "top") {
+ compoundNode.rect.y -= compoundNode.labelHeight;
+ compoundNode.setHeight(height2 + compoundNode.labelHeight);
+ compoundNode.labelMarginTop = compoundNode.labelHeight;
+ } else if (compoundNode.labelPosVertical == "center" && compoundNode.labelHeight > height2) {
+ compoundNode.rect.y -= (compoundNode.labelHeight - height2) / 2;
+ compoundNode.setHeight(compoundNode.labelHeight);
+ compoundNode.labelMarginTop = (compoundNode.labelHeight - height2) / 2;
+ } else if (compoundNode.labelPosVertical == "bottom") {
+ compoundNode.setHeight(height2 + compoundNode.labelHeight);
}
}
- }, "_loop2");
- while (queue.length != 0) {
- _loop22();
}
- cmpt.forEach(function(node2) {
- eles.intersection(node2.connectedEdges()).forEach(function(e3) {
- if (cmpt.has(e3.source()) && cmpt.has(e3.target())) {
- cmpt.merge(e3);
- }
- });
- });
- if (visitedTopMostNodes.length == topMostNodes.length) {
- isConnected = true;
+ });
+ };
+ CoSELayout.prototype.repopulateCompounds = function() {
+ for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) {
+ var lCompoundNode = this.compoundOrder[i2];
+ var id29 = lCompoundNode.id;
+ var horizontalMargin = lCompoundNode.paddingLeft;
+ var verticalMargin = lCompoundNode.paddingTop;
+ var labelMarginLeft = lCompoundNode.labelMarginLeft;
+ var labelMarginTop = lCompoundNode.labelMarginTop;
+ this.adjustLocations(this.tiledMemberPack[id29], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin, labelMarginLeft, labelMarginTop);
+ }
+ };
+ CoSELayout.prototype.repopulateZeroDegreeMembers = function() {
+ var self2 = this;
+ var tiledPack = this.tiledZeroDegreePack;
+ Object.keys(tiledPack).forEach(function(id29) {
+ var compoundNode = self2.idToDummyNode[id29];
+ var horizontalMargin = compoundNode.paddingLeft;
+ var verticalMargin = compoundNode.paddingTop;
+ var labelMarginLeft = compoundNode.labelMarginLeft;
+ var labelMarginTop = compoundNode.labelMarginTop;
+ self2.adjustLocations(tiledPack[id29], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin, labelMarginLeft, labelMarginTop);
+ });
+ };
+ CoSELayout.prototype.getToBeTiled = function(node2) {
+ var id29 = node2.id;
+ if (this.toBeTiled[id29] != null) {
+ return this.toBeTiled[id29];
+ }
+ var childGraph = node2.getChild();
+ if (childGraph == null) {
+ this.toBeTiled[id29] = false;
+ return false;
+ }
+ var children2 = childGraph.getNodes();
+ for (var i2 = 0; i2 < children2.length; i2++) {
+ var theChild = children2[i2];
+ if (this.getNodeDegree(theChild) > 0) {
+ this.toBeTiled[id29] = false;
+ return false;
}
- if (!isConnected || isConnected && count > 1) {
- minDegreeNode = visitedTopMostNodes[0];
- minDegree = minDegreeNode.connectedEdges().length;
- visitedTopMostNodes.forEach(function(node2) {
- if (node2.connectedEdges().length < minDegree) {
- minDegree = node2.connectedEdges().length;
- minDegreeNode = node2;
- }
- });
- nodesConnectedToDummy.push(minDegreeNode.id());
- var temp = cy.collection();
- temp.merge(visitedTopMostNodes[0]);
- visitedTopMostNodes.forEach(function(node2) {
- temp.merge(node2);
- });
- visitedTopMostNodes = [];
- topMostNodes = topMostNodes.difference(temp);
- count++;
+ if (theChild.getChild() == null) {
+ this.toBeTiled[theChild.id] = false;
+ continue;
}
- }, "_loop");
- do {
- _loop();
- } while (!isConnected);
- if (dummyNodes) {
- if (nodesConnectedToDummy.length > 0) {
- dummyNodes.set("dummy" + (dummyNodes.size + 1), nodesConnectedToDummy);
+ if (!this.getToBeTiled(theChild)) {
+ this.toBeTiled[id29] = false;
+ return false;
}
}
- return components3;
+ this.toBeTiled[id29] = true;
+ return true;
};
- auxiliary.relocateComponent = function(originalCenter, componentResult, options3) {
- if (!options3.fixedNodeConstraint) {
- var minXCoord = Number.POSITIVE_INFINITY;
- var maxXCoord = Number.NEGATIVE_INFINITY;
- var minYCoord = Number.POSITIVE_INFINITY;
- var maxYCoord = Number.NEGATIVE_INFINITY;
- if (options3.quality == "draft") {
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = void 0;
- try {
- for (var _iterator = componentResult.nodeIndexes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var _ref = _step.value;
- var _ref2 = _slicedToArray2(_ref, 2);
- var key = _ref2[0];
- var value2 = _ref2[1];
- var cyNode = options3.cy.getElementById(key);
- if (cyNode) {
- var nodeBB = cyNode.boundingBox();
- var leftX = componentResult.xCoords[value2] - nodeBB.w / 2;
- var rightX = componentResult.xCoords[value2] + nodeBB.w / 2;
- var topY = componentResult.yCoords[value2] - nodeBB.h / 2;
- var bottomY = componentResult.yCoords[value2] + nodeBB.h / 2;
- if (leftX < minXCoord) minXCoord = leftX;
- if (rightX > maxXCoord) maxXCoord = rightX;
- if (topY < minYCoord) minYCoord = topY;
- if (bottomY > maxYCoord) maxYCoord = bottomY;
- }
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
- var diffOnX = originalCenter.x - (maxXCoord + minXCoord) / 2;
- var diffOnY = originalCenter.y - (maxYCoord + minYCoord) / 2;
- componentResult.xCoords = componentResult.xCoords.map(function(x5) {
- return x5 + diffOnX;
- });
- componentResult.yCoords = componentResult.yCoords.map(function(y5) {
- return y5 + diffOnY;
- });
- } else {
- Object.keys(componentResult).forEach(function(item) {
- var node2 = componentResult[item];
- var leftX2 = node2.getRect().x;
- var rightX2 = node2.getRect().x + node2.getRect().width;
- var topY2 = node2.getRect().y;
- var bottomY2 = node2.getRect().y + node2.getRect().height;
- if (leftX2 < minXCoord) minXCoord = leftX2;
- if (rightX2 > maxXCoord) maxXCoord = rightX2;
- if (topY2 < minYCoord) minYCoord = topY2;
- if (bottomY2 > maxYCoord) maxYCoord = bottomY2;
- });
- var _diffOnX = originalCenter.x - (maxXCoord + minXCoord) / 2;
- var _diffOnY = originalCenter.y - (maxYCoord + minYCoord) / 2;
- Object.keys(componentResult).forEach(function(item) {
- var node2 = componentResult[item];
- node2.setCenter(node2.getCenterX() + _diffOnX, node2.getCenterY() + _diffOnY);
- });
+ CoSELayout.prototype.getNodeDegree = function(node2) {
+ var id29 = node2.id;
+ var edges3 = node2.getEdges();
+ var degree = 0;
+ for (var i2 = 0; i2 < edges3.length; i2++) {
+ var edge = edges3[i2];
+ if (edge.getSource().id !== edge.getTarget().id) {
+ degree = degree + 1;
}
}
+ return degree;
};
- auxiliary.calcBoundingBox = function(parentNode, xCoords, yCoords, nodeIndexes) {
- var left3 = Number.MAX_SAFE_INTEGER;
- var right3 = Number.MIN_SAFE_INTEGER;
- var top2 = Number.MAX_SAFE_INTEGER;
- var bottom2 = Number.MIN_SAFE_INTEGER;
- var nodeLeft = void 0;
- var nodeRight = void 0;
- var nodeTop = void 0;
- var nodeBottom = void 0;
- var nodes6 = parentNode.descendants().not(":parent");
- var s2 = nodes6.length;
- for (var i2 = 0; i2 < s2; i2++) {
- var node2 = nodes6[i2];
- nodeLeft = xCoords[nodeIndexes.get(node2.id())] - node2.width() / 2;
- nodeRight = xCoords[nodeIndexes.get(node2.id())] + node2.width() / 2;
- nodeTop = yCoords[nodeIndexes.get(node2.id())] - node2.height() / 2;
- nodeBottom = yCoords[nodeIndexes.get(node2.id())] + node2.height() / 2;
- if (left3 > nodeLeft) {
- left3 = nodeLeft;
- }
- if (right3 < nodeRight) {
- right3 = nodeRight;
+ CoSELayout.prototype.getNodeDegreeWithChildren = function(node2) {
+ var degree = this.getNodeDegree(node2);
+ if (node2.getChild() == null) {
+ return degree;
+ }
+ var children2 = node2.getChild().getNodes();
+ for (var i2 = 0; i2 < children2.length; i2++) {
+ var child = children2[i2];
+ degree += this.getNodeDegreeWithChildren(child);
+ }
+ return degree;
+ };
+ CoSELayout.prototype.performDFSOnCompounds = function() {
+ this.compoundOrder = [];
+ this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
+ };
+ CoSELayout.prototype.fillCompexOrderByDFS = function(children2) {
+ for (var i2 = 0; i2 < children2.length; i2++) {
+ var child = children2[i2];
+ if (child.getChild() != null) {
+ this.fillCompexOrderByDFS(child.getChild().getNodes());
}
- if (top2 > nodeTop) {
- top2 = nodeTop;
+ if (this.getToBeTiled(child)) {
+ this.compoundOrder.push(child);
}
- if (bottom2 < nodeBottom) {
- bottom2 = nodeBottom;
+ }
+ };
+ CoSELayout.prototype.adjustLocations = function(organization, x5, y5, compoundHorizontalMargin, compoundVerticalMargin, compoundLabelMarginLeft, compoundLabelMarginTop) {
+ x5 += compoundHorizontalMargin + compoundLabelMarginLeft;
+ y5 += compoundVerticalMargin + compoundLabelMarginTop;
+ var left3 = x5;
+ for (var i2 = 0; i2 < organization.rows.length; i2++) {
+ var row = organization.rows[i2];
+ x5 = left3;
+ var maxHeight = 0;
+ for (var j2 = 0; j2 < row.length; j2++) {
+ var lnode = row[j2];
+ lnode.rect.x = x5;
+ lnode.rect.y = y5;
+ x5 += lnode.rect.width + organization.horizontalPadding;
+ if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height;
}
+ y5 += maxHeight + organization.verticalPadding;
}
- var boundingBox3 = {};
- boundingBox3.topLeftX = left3;
- boundingBox3.topLeftY = top2;
- boundingBox3.width = right3 - left3;
- boundingBox3.height = bottom2 - top2;
- return boundingBox3;
};
- auxiliary.calcParentsWithoutChildren = function(cy, eles) {
- var parentsWithoutChildren = cy.collection();
- eles.nodes(":parent").forEach(function(parent4) {
- var check = false;
- parent4.children().forEach(function(child) {
- if (child.css("display") != "none") {
- check = true;
+ CoSELayout.prototype.tileCompoundMembers = function(childGraphMap, idToNode) {
+ var self2 = this;
+ this.tiledMemberPack = [];
+ Object.keys(childGraphMap).forEach(function(id29) {
+ var compoundNode = idToNode[id29];
+ self2.tiledMemberPack[id29] = self2.tileNodes(childGraphMap[id29], compoundNode.paddingLeft + compoundNode.paddingRight);
+ compoundNode.rect.width = self2.tiledMemberPack[id29].width;
+ compoundNode.rect.height = self2.tiledMemberPack[id29].height;
+ compoundNode.setCenter(self2.tiledMemberPack[id29].centerX, self2.tiledMemberPack[id29].centerY);
+ compoundNode.labelMarginLeft = 0;
+ compoundNode.labelMarginTop = 0;
+ if (CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {
+ var width3 = compoundNode.rect.width;
+ var height2 = compoundNode.rect.height;
+ if (compoundNode.labelWidth) {
+ if (compoundNode.labelPosHorizontal == "left") {
+ compoundNode.rect.x -= compoundNode.labelWidth;
+ compoundNode.setWidth(width3 + compoundNode.labelWidth);
+ compoundNode.labelMarginLeft = compoundNode.labelWidth;
+ } else if (compoundNode.labelPosHorizontal == "center" && compoundNode.labelWidth > width3) {
+ compoundNode.rect.x -= (compoundNode.labelWidth - width3) / 2;
+ compoundNode.setWidth(compoundNode.labelWidth);
+ compoundNode.labelMarginLeft = (compoundNode.labelWidth - width3) / 2;
+ } else if (compoundNode.labelPosHorizontal == "right") {
+ compoundNode.setWidth(width3 + compoundNode.labelWidth);
+ }
+ }
+ if (compoundNode.labelHeight) {
+ if (compoundNode.labelPosVertical == "top") {
+ compoundNode.rect.y -= compoundNode.labelHeight;
+ compoundNode.setHeight(height2 + compoundNode.labelHeight);
+ compoundNode.labelMarginTop = compoundNode.labelHeight;
+ } else if (compoundNode.labelPosVertical == "center" && compoundNode.labelHeight > height2) {
+ compoundNode.rect.y -= (compoundNode.labelHeight - height2) / 2;
+ compoundNode.setHeight(compoundNode.labelHeight);
+ compoundNode.labelMarginTop = (compoundNode.labelHeight - height2) / 2;
+ } else if (compoundNode.labelPosVertical == "bottom") {
+ compoundNode.setHeight(height2 + compoundNode.labelHeight);
+ }
}
- });
- if (!check) {
- parentsWithoutChildren.merge(parent4);
}
});
- return parentsWithoutChildren;
};
- module3.exports = auxiliary;
- }
- ),
- /***/
- 816: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var aux = __webpack_require__2(548);
- var CoSELayout = __webpack_require__2(140).CoSELayout;
- var CoSENode = __webpack_require__2(140).CoSENode;
- var PointD = __webpack_require__2(140).layoutBase.PointD;
- var DimensionD2 = __webpack_require__2(140).layoutBase.DimensionD;
- var LayoutConstants = __webpack_require__2(140).layoutBase.LayoutConstants;
- var FDLayoutConstants = __webpack_require__2(140).layoutBase.FDLayoutConstants;
- var CoSEConstants = __webpack_require__2(140).CoSEConstants;
- var coseLayout = /* @__PURE__ */ __name(function coseLayout2(options3, spectralResult) {
- var cy = options3.cy;
- var eles = options3.eles;
- var nodes6 = eles.nodes();
- var edges5 = eles.edges();
- var nodeIndexes = void 0;
- var xCoords = void 0;
- var yCoords = void 0;
- var idToLNode = {};
- if (options3.randomize) {
- nodeIndexes = spectralResult["nodeIndexes"];
- xCoords = spectralResult["xCoords"];
- yCoords = spectralResult["yCoords"];
+ CoSELayout.prototype.tileNodes = function(nodes6, minWidth) {
+ var horizontalOrg = this.tileNodesByFavoringDim(nodes6, minWidth, true);
+ var verticalOrg = this.tileNodesByFavoringDim(nodes6, minWidth, false);
+ var horizontalRatio = this.getOrgRatio(horizontalOrg);
+ var verticalRatio = this.getOrgRatio(verticalOrg);
+ var bestOrg;
+ if (verticalRatio < horizontalRatio) {
+ bestOrg = verticalOrg;
+ } else {
+ bestOrg = horizontalOrg;
}
- var isFn = /* @__PURE__ */ __name(function isFn2(fn3) {
- return typeof fn3 === "function";
- }, "isFn");
- var optFn = /* @__PURE__ */ __name(function optFn2(opt, ele) {
- if (isFn(opt)) {
- return opt(ele);
- } else {
- return opt;
+ return bestOrg;
+ };
+ CoSELayout.prototype.getOrgRatio = function(organization) {
+ var width3 = organization.width;
+ var height2 = organization.height;
+ var ratio = width3 / height2;
+ if (ratio < 1) {
+ ratio = 1 / ratio;
+ }
+ return ratio;
+ };
+ CoSELayout.prototype.calcIdealRowWidth = function(members, favorHorizontalDim) {
+ var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;
+ var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;
+ var membersSize = members.length;
+ var totalWidth = 0;
+ var totalHeight = 0;
+ var maxWidth = 0;
+ members.forEach(function(node2) {
+ totalWidth += node2.getWidth();
+ totalHeight += node2.getHeight();
+ if (node2.getWidth() > maxWidth) {
+ maxWidth = node2.getWidth();
}
- }, "optFn");
- var parentsWithoutChildren = aux.calcParentsWithoutChildren(cy, eles);
- var processChildrenList = /* @__PURE__ */ __name(function processChildrenList2(parent4, children2, layout6, options4) {
- var size5 = children2.length;
- for (var i2 = 0; i2 < size5; i2++) {
- var theChild = children2[i2];
- var children_of_children = null;
- if (theChild.intersection(parentsWithoutChildren).length == 0) {
- children_of_children = theChild.children();
+ });
+ var averageWidth = totalWidth / membersSize;
+ var averageHeight = totalHeight / membersSize;
+ var delta = Math.pow(verticalPadding - horizontalPadding, 2) + 4 * (averageWidth + horizontalPadding) * (averageHeight + verticalPadding) * membersSize;
+ var horizontalCountDouble = (horizontalPadding - verticalPadding + Math.sqrt(delta)) / (2 * (averageWidth + horizontalPadding));
+ var horizontalCount;
+ if (favorHorizontalDim) {
+ horizontalCount = Math.ceil(horizontalCountDouble);
+ if (horizontalCount == horizontalCountDouble) {
+ horizontalCount++;
+ }
+ } else {
+ horizontalCount = Math.floor(horizontalCountDouble);
+ }
+ var idealWidth = horizontalCount * (averageWidth + horizontalPadding) - horizontalPadding;
+ if (maxWidth > idealWidth) {
+ idealWidth = maxWidth;
+ }
+ idealWidth += horizontalPadding * 2;
+ return idealWidth;
+ };
+ CoSELayout.prototype.tileNodesByFavoringDim = function(nodes6, minWidth, favorHorizontalDim) {
+ var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;
+ var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;
+ var tilingCompareBy = CoSEConstants.TILING_COMPARE_BY;
+ var organization = {
+ rows: [],
+ rowWidth: [],
+ rowHeight: [],
+ width: 0,
+ height: minWidth,
+ // assume minHeight equals to minWidth
+ verticalPadding,
+ horizontalPadding,
+ centerX: 0,
+ centerY: 0
+ };
+ if (tilingCompareBy) {
+ organization.idealRowWidth = this.calcIdealRowWidth(nodes6, favorHorizontalDim);
+ }
+ var getNodeArea = /* @__PURE__ */ __name(function getNodeArea2(n2) {
+ return n2.rect.width * n2.rect.height;
+ }, "getNodeArea");
+ var areaCompareFcn = /* @__PURE__ */ __name(function areaCompareFcn2(n1, n2) {
+ return getNodeArea(n2) - getNodeArea(n1);
+ }, "areaCompareFcn");
+ nodes6.sort(function(n1, n2) {
+ var cmpBy = areaCompareFcn;
+ if (organization.idealRowWidth) {
+ cmpBy = tilingCompareBy;
+ return cmpBy(n1.id, n2.id);
+ }
+ return cmpBy(n1, n2);
+ });
+ var sumCenterX = 0;
+ var sumCenterY = 0;
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ var lNode = nodes6[i2];
+ sumCenterX += lNode.getCenterX();
+ sumCenterY += lNode.getCenterY();
+ }
+ organization.centerX = sumCenterX / nodes6.length;
+ organization.centerY = sumCenterY / nodes6.length;
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ var lNode = nodes6[i2];
+ if (organization.rows.length == 0) {
+ this.insertNodeToRow(organization, lNode, 0, minWidth);
+ } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) {
+ var rowIndex = organization.rows.length - 1;
+ if (!organization.idealRowWidth) {
+ rowIndex = this.getShortestRowIndex(organization);
}
- var theNode = void 0;
- var dimensions2 = theChild.layoutDimensions({
- nodeDimensionsIncludeLabels: options4.nodeDimensionsIncludeLabels
- });
- if (theChild.outerWidth() != null && theChild.outerHeight() != null) {
- if (options4.randomize) {
- if (!theChild.isParent()) {
- theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(xCoords[nodeIndexes.get(theChild.id())] - dimensions2.w / 2, yCoords[nodeIndexes.get(theChild.id())] - dimensions2.h / 2), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h))));
- } else {
- var parentInfo = aux.calcBoundingBox(theChild, xCoords, yCoords, nodeIndexes);
- if (theChild.intersection(parentsWithoutChildren).length == 0) {
- theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(parentInfo.topLeftX, parentInfo.topLeftY), new DimensionD2(parentInfo.width, parentInfo.height)));
- } else {
- theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(parentInfo.topLeftX, parentInfo.topLeftY), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h))));
- }
- }
+ this.insertNodeToRow(organization, lNode, rowIndex, minWidth);
+ } else {
+ this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth);
+ }
+ this.shiftToLastRow(organization);
+ }
+ return organization;
+ };
+ CoSELayout.prototype.insertNodeToRow = function(organization, node2, rowIndex, minWidth) {
+ var minCompoundSize = minWidth;
+ if (rowIndex == organization.rows.length) {
+ var secondDimension = [];
+ organization.rows.push(secondDimension);
+ organization.rowWidth.push(minCompoundSize);
+ organization.rowHeight.push(0);
+ }
+ var w3 = organization.rowWidth[rowIndex] + node2.rect.width;
+ if (organization.rows[rowIndex].length > 0) {
+ w3 += organization.horizontalPadding;
+ }
+ organization.rowWidth[rowIndex] = w3;
+ if (organization.width < w3) {
+ organization.width = w3;
+ }
+ var h2 = node2.rect.height;
+ if (rowIndex > 0) h2 += organization.verticalPadding;
+ var extraHeight = 0;
+ if (h2 > organization.rowHeight[rowIndex]) {
+ extraHeight = organization.rowHeight[rowIndex];
+ organization.rowHeight[rowIndex] = h2;
+ extraHeight = organization.rowHeight[rowIndex] - extraHeight;
+ }
+ organization.height += extraHeight;
+ organization.rows[rowIndex].push(node2);
+ };
+ CoSELayout.prototype.getShortestRowIndex = function(organization) {
+ var r2 = -1;
+ var min9 = Number.MAX_VALUE;
+ for (var i2 = 0; i2 < organization.rows.length; i2++) {
+ if (organization.rowWidth[i2] < min9) {
+ r2 = i2;
+ min9 = organization.rowWidth[i2];
+ }
+ }
+ return r2;
+ };
+ CoSELayout.prototype.getLongestRowIndex = function(organization) {
+ var r2 = -1;
+ var max10 = Number.MIN_VALUE;
+ for (var i2 = 0; i2 < organization.rows.length; i2++) {
+ if (organization.rowWidth[i2] > max10) {
+ r2 = i2;
+ max10 = organization.rowWidth[i2];
+ }
+ }
+ return r2;
+ };
+ CoSELayout.prototype.canAddHorizontal = function(organization, extraWidth, extraHeight) {
+ if (organization.idealRowWidth) {
+ var lastRowIndex = organization.rows.length - 1;
+ var lastRowWidth = organization.rowWidth[lastRowIndex];
+ return lastRowWidth + extraWidth + organization.horizontalPadding <= organization.idealRowWidth;
+ }
+ var sri = this.getShortestRowIndex(organization);
+ if (sri < 0) {
+ return true;
+ }
+ var min9 = organization.rowWidth[sri];
+ if (min9 + organization.horizontalPadding + extraWidth <= organization.width) return true;
+ var hDiff = 0;
+ if (organization.rowHeight[sri] < extraHeight) {
+ if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri];
+ }
+ var add_to_row_ratio;
+ if (organization.width - min9 >= extraWidth + organization.horizontalPadding) {
+ add_to_row_ratio = (organization.height + hDiff) / (min9 + extraWidth + organization.horizontalPadding);
+ } else {
+ add_to_row_ratio = (organization.height + hDiff) / organization.width;
+ }
+ hDiff = extraHeight + organization.verticalPadding;
+ var add_new_row_ratio;
+ if (organization.width < extraWidth) {
+ add_new_row_ratio = (organization.height + hDiff) / extraWidth;
+ } else {
+ add_new_row_ratio = (organization.height + hDiff) / organization.width;
+ }
+ if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio;
+ if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio;
+ return add_to_row_ratio < add_new_row_ratio;
+ };
+ CoSELayout.prototype.shiftToLastRow = function(organization) {
+ var longest = this.getLongestRowIndex(organization);
+ var last3 = organization.rowWidth.length - 1;
+ var row = organization.rows[longest];
+ var node2 = row[row.length - 1];
+ var diff2 = node2.width + organization.horizontalPadding;
+ if (organization.width - organization.rowWidth[last3] > diff2 && longest != last3) {
+ row.splice(-1, 1);
+ organization.rows[last3].push(node2);
+ organization.rowWidth[longest] = organization.rowWidth[longest] - diff2;
+ organization.rowWidth[last3] = organization.rowWidth[last3] + diff2;
+ organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)];
+ var maxHeight = Number.MIN_VALUE;
+ for (var i2 = 0; i2 < row.length; i2++) {
+ if (row[i2].height > maxHeight) maxHeight = row[i2].height;
+ }
+ if (longest > 0) maxHeight += organization.verticalPadding;
+ var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last3];
+ organization.rowHeight[longest] = maxHeight;
+ if (organization.rowHeight[last3] < node2.height + organization.verticalPadding) organization.rowHeight[last3] = node2.height + organization.verticalPadding;
+ var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last3];
+ organization.height += finalTotal - prevTotal;
+ this.shiftToLastRow(organization);
+ }
+ };
+ CoSELayout.prototype.tilingPreLayout = function() {
+ if (CoSEConstants.TILE) {
+ this.groupZeroDegreeMembers();
+ this.clearCompounds();
+ this.clearZeroDegreeMembers();
+ }
+ };
+ CoSELayout.prototype.tilingPostLayout = function() {
+ if (CoSEConstants.TILE) {
+ this.repopulateZeroDegreeMembers();
+ this.repopulateCompounds();
+ }
+ };
+ CoSELayout.prototype.reduceTrees = function() {
+ var prunedNodesAll = [];
+ var containsLeaf = true;
+ var node2;
+ while (containsLeaf) {
+ var allNodes = this.graphManager.getAllNodes();
+ var prunedNodesInStepTemp = [];
+ containsLeaf = false;
+ for (var i2 = 0; i2 < allNodes.length; i2++) {
+ node2 = allNodes[i2];
+ if (node2.getEdges().length == 1 && !node2.getEdges()[0].isInterGraph && node2.getChild() == null) {
+ if (CoSEConstants.PURE_INCREMENTAL) {
+ var otherEnd = node2.getEdges()[0].getOtherEnd(node2);
+ var relativePosition2 = new DimensionD2(node2.getCenterX() - otherEnd.getCenterX(), node2.getCenterY() - otherEnd.getCenterY());
+ prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner(), relativePosition2]);
} else {
- theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(theChild.position("x") - dimensions2.w / 2, theChild.position("y") - dimensions2.h / 2), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h))));
+ prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner()]);
}
- } else {
- theNode = parent4.add(new CoSENode(this.graphManager));
- }
- theNode.id = theChild.data("id");
- theNode.nodeRepulsion = optFn(options4.nodeRepulsion, theChild);
- theNode.paddingLeft = parseInt(theChild.css("padding"));
- theNode.paddingTop = parseInt(theChild.css("padding"));
- theNode.paddingRight = parseInt(theChild.css("padding"));
- theNode.paddingBottom = parseInt(theChild.css("padding"));
- if (options4.nodeDimensionsIncludeLabels) {
- theNode.labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).w;
- theNode.labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).h;
- theNode.labelPosVertical = theChild.css("text-valign");
- theNode.labelPosHorizontal = theChild.css("text-halign");
+ containsLeaf = true;
}
- idToLNode[theChild.data("id")] = theNode;
- if (isNaN(theNode.rect.x)) {
- theNode.rect.x = 0;
+ }
+ if (containsLeaf == true) {
+ var prunedNodesInStep = [];
+ for (var j2 = 0; j2 < prunedNodesInStepTemp.length; j2++) {
+ if (prunedNodesInStepTemp[j2][0].getEdges().length == 1) {
+ prunedNodesInStep.push(prunedNodesInStepTemp[j2]);
+ prunedNodesInStepTemp[j2][0].getOwner().remove(prunedNodesInStepTemp[j2][0]);
+ }
}
- if (isNaN(theNode.rect.y)) {
- theNode.rect.y = 0;
+ prunedNodesAll.push(prunedNodesInStep);
+ this.graphManager.resetAllNodes();
+ this.graphManager.resetAllEdges();
+ }
+ }
+ this.prunedNodesAll = prunedNodesAll;
+ };
+ CoSELayout.prototype.growTree = function(prunedNodesAll) {
+ var lengthOfPrunedNodesInStep = prunedNodesAll.length;
+ var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1];
+ var nodeData2;
+ for (var i2 = 0; i2 < prunedNodesInStep.length; i2++) {
+ nodeData2 = prunedNodesInStep[i2];
+ this.findPlaceforPrunedNode(nodeData2);
+ nodeData2[2].add(nodeData2[0]);
+ nodeData2[2].add(nodeData2[1], nodeData2[1].source, nodeData2[1].target);
+ }
+ prunedNodesAll.splice(prunedNodesAll.length - 1, 1);
+ this.graphManager.resetAllNodes();
+ this.graphManager.resetAllEdges();
+ };
+ CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData2) {
+ var gridForPrunedNode;
+ var nodeToConnect;
+ var prunedNode = nodeData2[0];
+ if (prunedNode == nodeData2[1].source) {
+ nodeToConnect = nodeData2[1].target;
+ } else {
+ nodeToConnect = nodeData2[1].source;
+ }
+ if (CoSEConstants.PURE_INCREMENTAL) {
+ prunedNode.setCenter(nodeToConnect.getCenterX() + nodeData2[3].getWidth(), nodeToConnect.getCenterY() + nodeData2[3].getHeight());
+ } else {
+ var startGridX = nodeToConnect.startX;
+ var finishGridX = nodeToConnect.finishX;
+ var startGridY = nodeToConnect.startY;
+ var finishGridY = nodeToConnect.finishY;
+ var upNodeCount = 0;
+ var downNodeCount = 0;
+ var rightNodeCount = 0;
+ var leftNodeCount = 0;
+ var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount];
+ if (startGridY > 0) {
+ for (var i2 = startGridX; i2 <= finishGridX; i2++) {
+ controlRegions[0] += this.grid[i2][startGridY - 1].length + this.grid[i2][startGridY].length - 1;
}
- if (children_of_children != null && children_of_children.length > 0) {
- var theNewGraph = void 0;
- theNewGraph = layout6.getGraphManager().add(layout6.newGraph(), theNode);
- processChildrenList2(theNewGraph, children_of_children, layout6, options4);
+ }
+ if (finishGridX < this.grid.length - 1) {
+ for (var i2 = startGridY; i2 <= finishGridY; i2++) {
+ controlRegions[1] += this.grid[finishGridX + 1][i2].length + this.grid[finishGridX][i2].length - 1;
}
}
- }, "processChildrenList");
- var processEdges = /* @__PURE__ */ __name(function processEdges2(layout6, gm2, edges6) {
- var idealLengthTotal = 0;
- var edgeCount4 = 0;
- for (var i2 = 0; i2 < edges6.length; i2++) {
- var edge = edges6[i2];
- var sourceNode = idToLNode[edge.data("source")];
- var targetNode = idToLNode[edge.data("target")];
- if (sourceNode && targetNode && sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) {
- var e1 = gm2.add(layout6.newEdge(), sourceNode, targetNode);
- e1.id = edge.id();
- e1.idealLength = optFn(options3.idealEdgeLength, edge);
- e1.edgeElasticity = optFn(options3.edgeElasticity, edge);
- idealLengthTotal += e1.idealLength;
- edgeCount4++;
+ if (finishGridY < this.grid[0].length - 1) {
+ for (var i2 = startGridX; i2 <= finishGridX; i2++) {
+ controlRegions[2] += this.grid[i2][finishGridY + 1].length + this.grid[i2][finishGridY].length - 1;
}
}
- if (options3.idealEdgeLength != null) {
- if (edgeCount4 > 0) CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = idealLengthTotal / edgeCount4;
- else if (!isFn(options3.idealEdgeLength))
- CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options3.idealEdgeLength;
- else
- CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50;
- CoSEConstants.MIN_REPULSION_DIST = FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10;
- CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
+ if (startGridX > 0) {
+ for (var i2 = startGridY; i2 <= finishGridY; i2++) {
+ controlRegions[3] += this.grid[startGridX - 1][i2].length + this.grid[startGridX][i2].length - 1;
+ }
}
- }, "processEdges");
- var processConstraints = /* @__PURE__ */ __name(function processConstraints2(layout6, options4) {
- if (options4.fixedNodeConstraint) {
- layout6.constraints["fixedNodeConstraint"] = options4.fixedNodeConstraint;
+ var min9 = Integer.MAX_VALUE;
+ var minCount;
+ var minIndex;
+ for (var j2 = 0; j2 < controlRegions.length; j2++) {
+ if (controlRegions[j2] < min9) {
+ min9 = controlRegions[j2];
+ minCount = 1;
+ minIndex = j2;
+ } else if (controlRegions[j2] == min9) {
+ minCount++;
+ }
}
- if (options4.alignmentConstraint) {
- layout6.constraints["alignmentConstraint"] = options4.alignmentConstraint;
+ if (minCount == 3 && min9 == 0) {
+ if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) {
+ gridForPrunedNode = 1;
+ } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) {
+ gridForPrunedNode = 0;
+ } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {
+ gridForPrunedNode = 3;
+ } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {
+ gridForPrunedNode = 2;
+ }
+ } else if (minCount == 2 && min9 == 0) {
+ var random2 = Math.floor(Math.random() * 2);
+ if (controlRegions[0] == 0 && controlRegions[1] == 0) {
+ ;
+ if (random2 == 0) {
+ gridForPrunedNode = 0;
+ } else {
+ gridForPrunedNode = 1;
+ }
+ } else if (controlRegions[0] == 0 && controlRegions[2] == 0) {
+ if (random2 == 0) {
+ gridForPrunedNode = 0;
+ } else {
+ gridForPrunedNode = 2;
+ }
+ } else if (controlRegions[0] == 0 && controlRegions[3] == 0) {
+ if (random2 == 0) {
+ gridForPrunedNode = 0;
+ } else {
+ gridForPrunedNode = 3;
+ }
+ } else if (controlRegions[1] == 0 && controlRegions[2] == 0) {
+ if (random2 == 0) {
+ gridForPrunedNode = 1;
+ } else {
+ gridForPrunedNode = 2;
+ }
+ } else if (controlRegions[1] == 0 && controlRegions[3] == 0) {
+ if (random2 == 0) {
+ gridForPrunedNode = 1;
+ } else {
+ gridForPrunedNode = 3;
+ }
+ } else {
+ if (random2 == 0) {
+ gridForPrunedNode = 2;
+ } else {
+ gridForPrunedNode = 3;
+ }
+ }
+ } else if (minCount == 4 && min9 == 0) {
+ var random2 = Math.floor(Math.random() * 4);
+ gridForPrunedNode = random2;
+ } else {
+ gridForPrunedNode = minIndex;
}
- if (options4.relativePlacementConstraint) {
- layout6.constraints["relativePlacementConstraint"] = options4.relativePlacementConstraint;
+ if (gridForPrunedNode == 0) {
+ prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2);
+ } else if (gridForPrunedNode == 1) {
+ prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY());
+ } else if (gridForPrunedNode == 2) {
+ prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2);
+ } else {
+ prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY());
}
- }, "processConstraints");
- if (options3.nestingFactor != null) CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = options3.nestingFactor;
- if (options3.gravity != null) CoSEConstants.DEFAULT_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = options3.gravity;
- if (options3.numIter != null) CoSEConstants.MAX_ITERATIONS = FDLayoutConstants.MAX_ITERATIONS = options3.numIter;
- if (options3.gravityRange != null) CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = options3.gravityRange;
- if (options3.gravityCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = options3.gravityCompound;
- if (options3.gravityRangeCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = options3.gravityRangeCompound;
- if (options3.initialEnergyOnIncremental != null) CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = options3.initialEnergyOnIncremental;
- if (options3.tilingCompareBy != null) CoSEConstants.TILING_COMPARE_BY = options3.tilingCompareBy;
- if (options3.quality == "proof") LayoutConstants.QUALITY = 2;
- else LayoutConstants.QUALITY = 0;
- CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS = FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = options3.nodeDimensionsIncludeLabels;
- CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = !options3.randomize;
- CoSEConstants.ANIMATE = FDLayoutConstants.ANIMATE = LayoutConstants.ANIMATE = options3.animate;
- CoSEConstants.TILE = options3.tile;
- CoSEConstants.TILING_PADDING_VERTICAL = typeof options3.tilingPaddingVertical === "function" ? options3.tilingPaddingVertical.call() : options3.tilingPaddingVertical;
- CoSEConstants.TILING_PADDING_HORIZONTAL = typeof options3.tilingPaddingHorizontal === "function" ? options3.tilingPaddingHorizontal.call() : options3.tilingPaddingHorizontal;
- CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = true;
- CoSEConstants.PURE_INCREMENTAL = !options3.randomize;
- LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = options3.uniformNodeDimensions;
- if (options3.step == "transformed") {
- CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true;
- CoSEConstants.ENFORCE_CONSTRAINTS = false;
- CoSEConstants.APPLY_LAYOUT = false;
}
- if (options3.step == "enforced") {
- CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false;
- CoSEConstants.ENFORCE_CONSTRAINTS = true;
- CoSEConstants.APPLY_LAYOUT = false;
+ };
+ module3.exports = CoSELayout;
+ }
+ ),
+ /***/
+ 991: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var FDLayoutNode = __webpack_require__2(551).FDLayoutNode;
+ var IMath = __webpack_require__2(551).IMath;
+ function CoSENode(gm, loc, size5, vNode) {
+ FDLayoutNode.call(this, gm, loc, size5, vNode);
+ }
+ __name(CoSENode, "CoSENode");
+ CoSENode.prototype = Object.create(FDLayoutNode.prototype);
+ for (var prop in FDLayoutNode) {
+ CoSENode[prop] = FDLayoutNode[prop];
+ }
+ CoSENode.prototype.calculateDisplacement = function() {
+ var layout6 = this.graphManager.getLayout();
+ if (this.getChild() != null && this.fixedNodeWeight) {
+ this.displacementX += layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight;
+ this.displacementY += layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight;
+ } else {
+ this.displacementX += layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren;
+ this.displacementY += layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren;
}
- if (options3.step == "cose") {
- CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false;
- CoSEConstants.ENFORCE_CONSTRAINTS = false;
- CoSEConstants.APPLY_LAYOUT = true;
+ if (Math.abs(this.displacementX) > layout6.coolingFactor * layout6.maxNodeDisplacement) {
+ this.displacementX = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementX);
}
- if (options3.step == "all") {
- if (options3.randomize) CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true;
- else CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false;
- CoSEConstants.ENFORCE_CONSTRAINTS = true;
- CoSEConstants.APPLY_LAYOUT = true;
+ if (Math.abs(this.displacementY) > layout6.coolingFactor * layout6.maxNodeDisplacement) {
+ this.displacementY = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementY);
}
- if (options3.fixedNodeConstraint || options3.alignmentConstraint || options3.relativePlacementConstraint) {
- CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false;
- } else {
- CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = true;
+ if (this.child && this.child.getNodes().length > 0) {
+ this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
}
- var coseLayout3 = new CoSELayout();
- var gm = coseLayout3.newGraphManager();
- processChildrenList(gm.addRoot(), aux.getTopMostNodes(nodes6), coseLayout3, options3);
- processEdges(coseLayout3, gm, edges5);
- processConstraints(coseLayout3, options3);
- coseLayout3.runLayout();
- return idToLNode;
- }, "coseLayout");
- module3.exports = { coseLayout };
+ };
+ CoSENode.prototype.propogateDisplacementToChildren = function(dX, dY) {
+ var nodes6 = this.getChild().getNodes();
+ var node2;
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ node2 = nodes6[i2];
+ if (node2.getChild() == null) {
+ node2.displacementX += dX;
+ node2.displacementY += dY;
+ } else {
+ node2.propogateDisplacementToChildren(dX, dY);
+ }
+ }
+ };
+ CoSENode.prototype.move = function() {
+ var layout6 = this.graphManager.getLayout();
+ if (this.child == null || this.child.getNodes().length == 0) {
+ this.moveBy(this.displacementX, this.displacementY);
+ layout6.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY);
+ }
+ this.springForceX = 0;
+ this.springForceY = 0;
+ this.repulsionForceX = 0;
+ this.repulsionForceY = 0;
+ this.gravitationForceX = 0;
+ this.gravitationForceY = 0;
+ this.displacementX = 0;
+ this.displacementY = 0;
+ };
+ CoSENode.prototype.setPred1 = function(pred12) {
+ this.pred1 = pred12;
+ };
+ CoSENode.prototype.getPred1 = function() {
+ return pred1;
+ };
+ CoSENode.prototype.getPred2 = function() {
+ return pred2;
+ };
+ CoSENode.prototype.setNext = function(next3) {
+ this.next = next3;
+ };
+ CoSENode.prototype.getNext = function() {
+ return next;
+ };
+ CoSENode.prototype.setProcessed = function(processed2) {
+ this.processed = processed2;
+ };
+ CoSENode.prototype.isProcessed = function() {
+ return processed;
+ };
+ module3.exports = CoSENode;
}
),
/***/
- 212: (
+ 902: (
/***/
(module3, __unused_webpack_exports, __webpack_require__2) => {
- var _createClass2 = /* @__PURE__ */ function() {
- function defineProperties(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
+ function _toConsumableArray2(arr) {
+ if (Array.isArray(arr)) {
+ for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
+ arr2[i2] = arr[i2];
}
- }
- __name(defineProperties, "defineProperties");
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
- function _classCallCheck2(instance2, Constructor) {
- if (!(instance2 instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
+ return arr2;
+ } else {
+ return Array.from(arr);
}
}
- __name(_classCallCheck2, "_classCallCheck");
- var assign7 = __webpack_require__2(658);
- var aux = __webpack_require__2(548);
- var _require = __webpack_require__2(657), spectralLayout = _require.spectralLayout;
- var _require2 = __webpack_require__2(816), coseLayout = _require2.coseLayout;
- var defaults4 = Object.freeze({
- // 'draft', 'default' or 'proof'
- // - 'draft' only applies spectral layout
- // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate)
- // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate)
- quality: "default",
- // Use random node positions at beginning of layout
- // if this is set to false, then quality option must be "proof"
- randomize: true,
- // Whether or not to animate the layout
- animate: true,
- // Duration of animation in ms, if enabled
- animationDuration: 1e3,
- // Easing of animation, if enabled
- animationEasing: void 0,
- // Fit the viewport to the repositioned nodes
- fit: true,
- // Padding around layout
- padding: 30,
- // Whether to include labels in node dimensions. Valid in "proof" quality
- nodeDimensionsIncludeLabels: false,
- // Whether or not simple nodes (non-compound nodes) are of uniform dimensions
- uniformNodeDimensions: false,
- // Whether to pack disconnected components - valid only if randomize: true
- packComponents: true,
- // Layout step - all, transformed, enforced, cose - for debug purpose only
- step: "all",
- /* spectral layout options */
- // False for random, true for greedy
- samplingType: true,
- // Sample size to construct distance matrix
- sampleSize: 25,
- // Separation amount between nodes
- nodeSeparation: 75,
- // Power iteration tolerance
- piTol: 1e-7,
- /* CoSE layout options */
- // Node repulsion (non overlapping) multiplier
- nodeRepulsion: /* @__PURE__ */ __name(function nodeRepulsion4(node2) {
- return 4500;
- }, "nodeRepulsion"),
- // Ideal edge (non nested) length
- idealEdgeLength: /* @__PURE__ */ __name(function idealEdgeLength2(edge) {
- return 50;
- }, "idealEdgeLength"),
- // Divisor to compute edge forces
- edgeElasticity: /* @__PURE__ */ __name(function edgeElasticity2(edge) {
- return 0.45;
- }, "edgeElasticity"),
- // Nesting factor (multiplier) to compute ideal edge length for nested edges
- nestingFactor: 0.1,
- // Gravity force (constant)
- gravity: 0.25,
- // Maximum number of iterations to perform
- numIter: 2500,
- // For enabling tiling
- tile: true,
- // The function that specifies the criteria for comparing nodes while sorting them during tiling operation.
- // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set.
- tilingCompareBy: void 0,
- // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
- tilingPaddingVertical: 10,
- // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
- tilingPaddingHorizontal: 10,
- // Gravity range (constant) for compounds
- gravityRangeCompound: 1.5,
- // Gravity force (constant) for compounds
- gravityCompound: 1,
- // Gravity range (constant)
- gravityRange: 3.8,
- // Initial cooling factor for incremental layout
- initialEnergyOnIncremental: 0.3,
- /* constraint options */
- // Fix required nodes to predefined positions
- // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}]
- fixedNodeConstraint: void 0,
- // Align required nodes in vertical/horizontal direction
- // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']}
- alignmentConstraint: void 0,
- // Place two nodes relatively in vertical/horizontal direction
- // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}]
- relativePlacementConstraint: void 0,
- /* layout event callbacks */
- ready: /* @__PURE__ */ __name(function ready4() {
- }, "ready"),
- // on layoutready
- stop: /* @__PURE__ */ __name(function stop5() {
- }, "stop")
- // on layoutstop
- });
- var Layout2 = function() {
- function Layout3(options3) {
- _classCallCheck2(this, Layout3);
- this.options = assign7({}, defaults4, options3);
+ __name(_toConsumableArray2, "_toConsumableArray");
+ var CoSEConstants = __webpack_require__2(806);
+ var LinkedList = __webpack_require__2(551).LinkedList;
+ var Matrix = __webpack_require__2(551).Matrix;
+ var SVD = __webpack_require__2(551).SVD;
+ function ConstraintHandler() {
+ }
+ __name(ConstraintHandler, "ConstraintHandler");
+ ConstraintHandler.handleConstraints = function(layout6) {
+ var constraints = {};
+ constraints.fixedNodeConstraint = layout6.constraints.fixedNodeConstraint;
+ constraints.alignmentConstraint = layout6.constraints.alignmentConstraint;
+ constraints.relativePlacementConstraint = layout6.constraints.relativePlacementConstraint;
+ var idToNodeMap = /* @__PURE__ */ new Map();
+ var nodeIndexes = /* @__PURE__ */ new Map();
+ var xCoords = [];
+ var yCoords = [];
+ var allNodes = layout6.getAllNodes();
+ var index = 0;
+ for (var i2 = 0; i2 < allNodes.length; i2++) {
+ var node2 = allNodes[i2];
+ if (node2.getChild() == null) {
+ nodeIndexes.set(node2.id, index++);
+ xCoords.push(node2.getCenterX());
+ yCoords.push(node2.getCenterY());
+ idToNodeMap.set(node2.id, node2);
+ }
}
- __name(Layout3, "Layout");
- _createClass2(Layout3, [{
- key: "run",
- value: /* @__PURE__ */ __name(function run5() {
- var layout6 = this;
- var options3 = this.options;
- var cy = options3.cy;
- var eles = options3.eles;
- var spectralResult = [];
- var xCoords = void 0;
- var yCoords = void 0;
- var coseResult = [];
- var components3 = void 0;
- var componentCenters = [];
- if (options3.fixedNodeConstraint && (!Array.isArray(options3.fixedNodeConstraint) || options3.fixedNodeConstraint.length == 0)) {
- options3.fixedNodeConstraint = void 0;
+ if (constraints.relativePlacementConstraint) {
+ constraints.relativePlacementConstraint.forEach(function(constraint) {
+ if (!constraint.gap && constraint.gap != 0) {
+ if (constraint.left) {
+ constraint.gap = CoSEConstants.DEFAULT_EDGE_LENGTH + idToNodeMap.get(constraint.left).getWidth() / 2 + idToNodeMap.get(constraint.right).getWidth() / 2;
+ } else {
+ constraint.gap = CoSEConstants.DEFAULT_EDGE_LENGTH + idToNodeMap.get(constraint.top).getHeight() / 2 + idToNodeMap.get(constraint.bottom).getHeight() / 2;
+ }
}
- if (options3.alignmentConstraint) {
- if (options3.alignmentConstraint.vertical && (!Array.isArray(options3.alignmentConstraint.vertical) || options3.alignmentConstraint.vertical.length == 0)) {
- options3.alignmentConstraint.vertical = void 0;
+ });
+ }
+ var calculatePositionDiff = /* @__PURE__ */ __name(function calculatePositionDiff2(pos1, pos2) {
+ return { x: pos1.x - pos2.x, y: pos1.y - pos2.y };
+ }, "calculatePositionDiff");
+ var calculateAvgPosition = /* @__PURE__ */ __name(function calculateAvgPosition2(nodeIdSet) {
+ var xPosSum = 0;
+ var yPosSum = 0;
+ nodeIdSet.forEach(function(nodeId) {
+ xPosSum += xCoords[nodeIndexes.get(nodeId)];
+ yPosSum += yCoords[nodeIndexes.get(nodeId)];
+ });
+ return { x: xPosSum / nodeIdSet.size, y: yPosSum / nodeIdSet.size };
+ }, "calculateAvgPosition");
+ var findAppropriatePositionForRelativePlacement = /* @__PURE__ */ __name(function findAppropriatePositionForRelativePlacement2(graph, direction, fixedNodes2, dummyPositions, componentSources) {
+ function setUnion(setA, setB) {
+ var union2 = new Set(setA);
+ var _iteratorNormalCompletion = true;
+ var _didIteratorError = false;
+ var _iteratorError = void 0;
+ try {
+ for (var _iterator = setB[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
+ var elem = _step.value;
+ union2.add(elem);
}
- if (options3.alignmentConstraint.horizontal && (!Array.isArray(options3.alignmentConstraint.horizontal) || options3.alignmentConstraint.horizontal.length == 0)) {
- options3.alignmentConstraint.horizontal = void 0;
+ } catch (err) {
+ _didIteratorError = true;
+ _iteratorError = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion && _iterator.return) {
+ _iterator.return();
+ }
+ } finally {
+ if (_didIteratorError) {
+ throw _iteratorError;
+ }
}
}
- if (options3.relativePlacementConstraint && (!Array.isArray(options3.relativePlacementConstraint) || options3.relativePlacementConstraint.length == 0)) {
- options3.relativePlacementConstraint = void 0;
- }
- var constraintExist = options3.fixedNodeConstraint || options3.alignmentConstraint || options3.relativePlacementConstraint;
- if (constraintExist) {
- options3.tile = false;
- options3.packComponents = false;
- }
- var layUtil = void 0;
- var packingEnabled = false;
- if (cy.layoutUtilities && options3.packComponents) {
- layUtil = cy.layoutUtilities("get");
- if (!layUtil) layUtil = cy.layoutUtilities();
- packingEnabled = true;
- }
- if (eles.nodes().length > 0) {
- if (!packingEnabled) {
- var boundingBox3 = options3.eles.boundingBox();
- componentCenters.push({ x: boundingBox3.x1 + boundingBox3.w / 2, y: boundingBox3.y1 + boundingBox3.h / 2 });
- if (options3.randomize) {
- var result = spectralLayout(options3);
- spectralResult.push(result);
- }
- if (options3.quality == "default" || options3.quality == "proof") {
- coseResult.push(coseLayout(options3, spectralResult[0]));
- aux.relocateComponent(componentCenters[0], coseResult[0], options3);
+ return union2;
+ }
+ __name(setUnion, "setUnion");
+ var inDegrees = /* @__PURE__ */ new Map();
+ graph.forEach(function(value2, key) {
+ inDegrees.set(key, 0);
+ });
+ graph.forEach(function(value2, key) {
+ value2.forEach(function(adjacent) {
+ inDegrees.set(adjacent.id, inDegrees.get(adjacent.id) + 1);
+ });
+ });
+ var positionMap = /* @__PURE__ */ new Map();
+ var pastMap = /* @__PURE__ */ new Map();
+ var queue = new LinkedList();
+ inDegrees.forEach(function(value2, key) {
+ if (value2 == 0) {
+ queue.push(key);
+ if (!fixedNodes2) {
+ if (direction == "horizontal") {
+ positionMap.set(key, nodeIndexes.has(key) ? xCoords[nodeIndexes.get(key)] : dummyPositions.get(key));
} else {
- aux.relocateComponent(componentCenters[0], spectralResult[0], options3);
+ positionMap.set(key, nodeIndexes.has(key) ? yCoords[nodeIndexes.get(key)] : dummyPositions.get(key));
+ }
+ }
+ } else {
+ positionMap.set(key, Number.NEGATIVE_INFINITY);
+ }
+ if (fixedNodes2) {
+ pastMap.set(key, /* @__PURE__ */ new Set([key]));
+ }
+ });
+ if (fixedNodes2) {
+ componentSources.forEach(function(component2) {
+ var fixedIds = [];
+ component2.forEach(function(nodeId) {
+ if (fixedNodes2.has(nodeId)) {
+ fixedIds.push(nodeId);
}
+ });
+ if (fixedIds.length > 0) {
+ var position5 = 0;
+ fixedIds.forEach(function(fixedId) {
+ if (direction == "horizontal") {
+ positionMap.set(fixedId, nodeIndexes.has(fixedId) ? xCoords[nodeIndexes.get(fixedId)] : dummyPositions.get(fixedId));
+ position5 += positionMap.get(fixedId);
+ } else {
+ positionMap.set(fixedId, nodeIndexes.has(fixedId) ? yCoords[nodeIndexes.get(fixedId)] : dummyPositions.get(fixedId));
+ position5 += positionMap.get(fixedId);
+ }
+ });
+ position5 = position5 / fixedIds.length;
+ component2.forEach(function(nodeId) {
+ if (!fixedNodes2.has(nodeId)) {
+ positionMap.set(nodeId, position5);
+ }
+ });
} else {
- var topMostNodes = aux.getTopMostNodes(options3.eles.nodes());
- components3 = aux.connectComponents(cy, options3.eles, topMostNodes);
- components3.forEach(function(component2) {
- var boundingBox4 = component2.boundingBox();
- componentCenters.push({ x: boundingBox4.x1 + boundingBox4.w / 2, y: boundingBox4.y1 + boundingBox4.h / 2 });
+ var _position = 0;
+ component2.forEach(function(nodeId) {
+ if (direction == "horizontal") {
+ _position += nodeIndexes.has(nodeId) ? xCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId);
+ } else {
+ _position += nodeIndexes.has(nodeId) ? yCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId);
+ }
});
- if (options3.randomize) {
- components3.forEach(function(component2) {
- options3.eles = component2;
- spectralResult.push(spectralLayout(options3));
- });
- }
- if (options3.quality == "default" || options3.quality == "proof") {
- var toBeTiledNodes = cy.collection();
- if (options3.tile) {
- var nodeIndexes = /* @__PURE__ */ new Map();
- var _xCoords = [];
- var _yCoords = [];
- var count = 0;
- var tempSpectralResult = { nodeIndexes, xCoords: _xCoords, yCoords: _yCoords };
- var indexesToBeDeleted = [];
- components3.forEach(function(component2, index) {
- if (component2.edges().length == 0) {
- component2.nodes().forEach(function(node2, i3) {
- toBeTiledNodes.merge(component2.nodes()[i3]);
- if (!node2.isParent()) {
- tempSpectralResult.nodeIndexes.set(component2.nodes()[i3].id(), count++);
- tempSpectralResult.xCoords.push(component2.nodes()[0].position().x);
- tempSpectralResult.yCoords.push(component2.nodes()[0].position().y);
- }
- });
- indexesToBeDeleted.push(index);
- }
+ _position = _position / component2.length;
+ component2.forEach(function(nodeId) {
+ positionMap.set(nodeId, _position);
+ });
+ }
+ });
+ }
+ var _loop = /* @__PURE__ */ __name(function _loop2() {
+ var currentNode = queue.shift();
+ var neighbors = graph.get(currentNode);
+ neighbors.forEach(function(neighbor) {
+ if (positionMap.get(neighbor.id) < positionMap.get(currentNode) + neighbor.gap) {
+ if (fixedNodes2 && fixedNodes2.has(neighbor.id)) {
+ var fixedPosition = void 0;
+ if (direction == "horizontal") {
+ fixedPosition = nodeIndexes.has(neighbor.id) ? xCoords[nodeIndexes.get(neighbor.id)] : dummyPositions.get(neighbor.id);
+ } else {
+ fixedPosition = nodeIndexes.has(neighbor.id) ? yCoords[nodeIndexes.get(neighbor.id)] : dummyPositions.get(neighbor.id);
+ }
+ positionMap.set(neighbor.id, fixedPosition);
+ if (fixedPosition < positionMap.get(currentNode) + neighbor.gap) {
+ var diff2 = positionMap.get(currentNode) + neighbor.gap - fixedPosition;
+ pastMap.get(currentNode).forEach(function(nodeId) {
+ positionMap.set(nodeId, positionMap.get(nodeId) - diff2);
});
- if (toBeTiledNodes.length > 1) {
- var _boundingBox = toBeTiledNodes.boundingBox();
- componentCenters.push({ x: _boundingBox.x1 + _boundingBox.w / 2, y: _boundingBox.y1 + _boundingBox.h / 2 });
- components3.push(toBeTiledNodes);
- spectralResult.push(tempSpectralResult);
- for (var i2 = indexesToBeDeleted.length - 1; i2 >= 0; i2--) {
- components3.splice(indexesToBeDeleted[i2], 1);
- spectralResult.splice(indexesToBeDeleted[i2], 1);
- componentCenters.splice(indexesToBeDeleted[i2], 1);
- }
- ;
- }
}
- components3.forEach(function(component2, index) {
- options3.eles = component2;
- coseResult.push(coseLayout(options3, spectralResult[index]));
- aux.relocateComponent(componentCenters[index], coseResult[index], options3);
- });
} else {
- components3.forEach(function(component2, index) {
- aux.relocateComponent(componentCenters[index], spectralResult[index], options3);
- });
+ positionMap.set(neighbor.id, positionMap.get(currentNode) + neighbor.gap);
}
- var componentsEvaluated = /* @__PURE__ */ new Set();
- if (components3.length > 1) {
- var subgraphs = [];
- var hiddenEles = eles.filter(function(ele) {
- return ele.css("display") == "none";
- });
- components3.forEach(function(component2, index) {
- var nodeIndexes2 = void 0;
- if (options3.quality == "draft") {
- nodeIndexes2 = spectralResult[index].nodeIndexes;
+ }
+ inDegrees.set(neighbor.id, inDegrees.get(neighbor.id) - 1);
+ if (inDegrees.get(neighbor.id) == 0) {
+ queue.push(neighbor.id);
+ }
+ if (fixedNodes2) {
+ pastMap.set(neighbor.id, setUnion(pastMap.get(currentNode), pastMap.get(neighbor.id)));
+ }
+ });
+ }, "_loop");
+ while (queue.length != 0) {
+ _loop();
+ }
+ if (fixedNodes2) {
+ var sinkNodes = /* @__PURE__ */ new Set();
+ graph.forEach(function(value2, key) {
+ if (value2.length == 0) {
+ sinkNodes.add(key);
+ }
+ });
+ var _components = [];
+ pastMap.forEach(function(value2, key) {
+ if (sinkNodes.has(key)) {
+ var isFixedComponent = false;
+ var _iteratorNormalCompletion2 = true;
+ var _didIteratorError2 = false;
+ var _iteratorError2 = void 0;
+ try {
+ for (var _iterator2 = value2[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
+ var nodeId = _step2.value;
+ if (fixedNodes2.has(nodeId)) {
+ isFixedComponent = true;
}
- if (component2.nodes().not(hiddenEles).length > 0) {
- var subgraph = {};
- subgraph.edges = [];
- subgraph.nodes = [];
- var nodeIndex = void 0;
- component2.nodes().not(hiddenEles).forEach(function(node2) {
- if (options3.quality == "draft") {
- if (!node2.isParent()) {
- nodeIndex = nodeIndexes2.get(node2.id());
- subgraph.nodes.push({ x: spectralResult[index].xCoords[nodeIndex] - node2.boundingbox().w / 2, y: spectralResult[index].yCoords[nodeIndex] - node2.boundingbox().h / 2, width: node2.boundingbox().w, height: node2.boundingbox().h });
- } else {
- var parentInfo = aux.calcBoundingBox(node2, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2);
- subgraph.nodes.push({ x: parentInfo.topLeftX, y: parentInfo.topLeftY, width: parentInfo.width, height: parentInfo.height });
- }
- } else {
- if (coseResult[index][node2.id()]) {
- subgraph.nodes.push({ x: coseResult[index][node2.id()].getLeft(), y: coseResult[index][node2.id()].getTop(), width: coseResult[index][node2.id()].getWidth(), height: coseResult[index][node2.id()].getHeight() });
- }
- }
- });
- component2.edges().forEach(function(edge) {
- var source = edge.source();
- var target = edge.target();
- if (source.css("display") != "none" && target.css("display") != "none") {
- if (options3.quality == "draft") {
- var sourceNodeIndex = nodeIndexes2.get(source.id());
- var targetNodeIndex = nodeIndexes2.get(target.id());
- var sourceCenter = [];
- var targetCenter = [];
- if (source.isParent()) {
- var parentInfo = aux.calcBoundingBox(source, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2);
- sourceCenter.push(parentInfo.topLeftX + parentInfo.width / 2);
- sourceCenter.push(parentInfo.topLeftY + parentInfo.height / 2);
- } else {
- sourceCenter.push(spectralResult[index].xCoords[sourceNodeIndex]);
- sourceCenter.push(spectralResult[index].yCoords[sourceNodeIndex]);
- }
- if (target.isParent()) {
- var _parentInfo = aux.calcBoundingBox(target, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2);
- targetCenter.push(_parentInfo.topLeftX + _parentInfo.width / 2);
- targetCenter.push(_parentInfo.topLeftY + _parentInfo.height / 2);
- } else {
- targetCenter.push(spectralResult[index].xCoords[targetNodeIndex]);
- targetCenter.push(spectralResult[index].yCoords[targetNodeIndex]);
- }
- subgraph.edges.push({ startX: sourceCenter[0], startY: sourceCenter[1], endX: targetCenter[0], endY: targetCenter[1] });
- } else {
- if (coseResult[index][source.id()] && coseResult[index][target.id()]) {
- subgraph.edges.push({ startX: coseResult[index][source.id()].getCenterX(), startY: coseResult[index][source.id()].getCenterY(), endX: coseResult[index][target.id()].getCenterX(), endY: coseResult[index][target.id()].getCenterY() });
- }
- }
- }
- });
- if (subgraph.nodes.length > 0) {
- subgraphs.push(subgraph);
- componentsEvaluated.add(index);
- }
+ }
+ } catch (err) {
+ _didIteratorError2 = true;
+ _iteratorError2 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion2 && _iterator2.return) {
+ _iterator2.return();
+ }
+ } finally {
+ if (_didIteratorError2) {
+ throw _iteratorError2;
+ }
+ }
+ }
+ if (!isFixedComponent) {
+ var isExist = false;
+ var existAt = void 0;
+ _components.forEach(function(component2, index2) {
+ if (component2.has([].concat(_toConsumableArray2(value2))[0])) {
+ isExist = true;
+ existAt = index2;
}
});
- var shiftResult = layUtil.packComponents(subgraphs, options3.randomize).shifts;
- if (options3.quality == "draft") {
- spectralResult.forEach(function(result2, index) {
- var newXCoords = result2.xCoords.map(function(x5) {
- return x5 + shiftResult[index].dx;
- });
- var newYCoords = result2.yCoords.map(function(y5) {
- return y5 + shiftResult[index].dy;
- });
- result2.xCoords = newXCoords;
- result2.yCoords = newYCoords;
- });
+ if (!isExist) {
+ _components.push(new Set(value2));
} else {
- var _count = 0;
- componentsEvaluated.forEach(function(index) {
- Object.keys(coseResult[index]).forEach(function(item) {
- var nodeRectangle = coseResult[index][item];
- nodeRectangle.setCenter(nodeRectangle.getCenterX() + shiftResult[_count].dx, nodeRectangle.getCenterY() + shiftResult[_count].dy);
- });
- _count++;
+ value2.forEach(function(ele) {
+ _components[existAt].add(ele);
});
}
}
}
- }
- var getPositions = /* @__PURE__ */ __name(function getPositions2(ele, i3) {
- if (options3.quality == "default" || options3.quality == "proof") {
- if (typeof ele === "number") {
- ele = i3;
- }
- var pos = void 0;
- var node2 = void 0;
- var theId = ele.data("id");
- coseResult.forEach(function(result2) {
- if (theId in result2) {
- pos = { x: result2[theId].getRect().getCenterX(), y: result2[theId].getRect().getCenterY() };
- node2 = result2[theId];
+ });
+ _components.forEach(function(component2, index2) {
+ var minBefore = Number.POSITIVE_INFINITY;
+ var minAfter = Number.POSITIVE_INFINITY;
+ var maxBefore = Number.NEGATIVE_INFINITY;
+ var maxAfter = Number.NEGATIVE_INFINITY;
+ var _iteratorNormalCompletion3 = true;
+ var _didIteratorError3 = false;
+ var _iteratorError3 = void 0;
+ try {
+ for (var _iterator3 = component2[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
+ var nodeId = _step3.value;
+ var posBefore = void 0;
+ if (direction == "horizontal") {
+ posBefore = nodeIndexes.has(nodeId) ? xCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId);
+ } else {
+ posBefore = nodeIndexes.has(nodeId) ? yCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId);
}
- });
- if (options3.nodeDimensionsIncludeLabels) {
- if (node2.labelWidth) {
- if (node2.labelPosHorizontal == "left") {
- pos.x += node2.labelWidth / 2;
- } else if (node2.labelPosHorizontal == "right") {
- pos.x -= node2.labelWidth / 2;
- }
+ var posAfter = positionMap.get(nodeId);
+ if (posBefore < minBefore) {
+ minBefore = posBefore;
}
- if (node2.labelHeight) {
- if (node2.labelPosVertical == "top") {
- pos.y += node2.labelHeight / 2;
- } else if (node2.labelPosVertical == "bottom") {
- pos.y -= node2.labelHeight / 2;
- }
+ if (posBefore > maxBefore) {
+ maxBefore = posBefore;
+ }
+ if (posAfter < minAfter) {
+ minAfter = posAfter;
+ }
+ if (posAfter > maxAfter) {
+ maxAfter = posAfter;
}
}
- if (pos == void 0) pos = { x: ele.position("x"), y: ele.position("y") };
- return {
- x: pos.x,
- y: pos.y
- };
- } else {
- var _pos = void 0;
- spectralResult.forEach(function(result2) {
- var index = result2.nodeIndexes.get(ele.id());
- if (index != void 0) {
- _pos = { x: result2.xCoords[index], y: result2.yCoords[index] };
+ } catch (err) {
+ _didIteratorError3 = true;
+ _iteratorError3 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion3 && _iterator3.return) {
+ _iterator3.return();
}
- });
- if (_pos == void 0) _pos = { x: ele.position("x"), y: ele.position("y") };
- return {
- x: _pos.x,
- y: _pos.y
- };
+ } finally {
+ if (_didIteratorError3) {
+ throw _iteratorError3;
+ }
+ }
}
- }, "getPositions");
- if (options3.quality == "default" || options3.quality == "proof" || options3.randomize) {
- var parentsWithoutChildren = aux.calcParentsWithoutChildren(cy, eles);
- var _hiddenEles = eles.filter(function(ele) {
- return ele.css("display") == "none";
- });
- options3.eles = eles.not(_hiddenEles);
- eles.nodes().not(":parent").not(_hiddenEles).layoutPositions(layout6, options3, getPositions);
- if (parentsWithoutChildren.length > 0) {
- parentsWithoutChildren.forEach(function(ele) {
- ele.position(getPositions(ele));
- });
+ var diff2 = (minBefore + maxBefore) / 2 - (minAfter + maxAfter) / 2;
+ var _iteratorNormalCompletion4 = true;
+ var _didIteratorError4 = false;
+ var _iteratorError4 = void 0;
+ try {
+ for (var _iterator4 = component2[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
+ var _nodeId = _step4.value;
+ positionMap.set(_nodeId, positionMap.get(_nodeId) + diff2);
+ }
+ } catch (err) {
+ _didIteratorError4 = true;
+ _iteratorError4 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion4 && _iterator4.return) {
+ _iterator4.return();
+ }
+ } finally {
+ if (_didIteratorError4) {
+ throw _iteratorError4;
+ }
+ }
}
+ });
+ }
+ return positionMap;
+ }, "findAppropriatePositionForRelativePlacement");
+ var applyReflectionForRelativePlacement = /* @__PURE__ */ __name(function applyReflectionForRelativePlacement2(relativePlacementConstraints) {
+ var reflectOnY = 0, notReflectOnY = 0;
+ var reflectOnX = 0, notReflectOnX = 0;
+ relativePlacementConstraints.forEach(function(constraint) {
+ if (constraint.left) {
+ xCoords[nodeIndexes.get(constraint.left)] - xCoords[nodeIndexes.get(constraint.right)] >= 0 ? reflectOnY++ : notReflectOnY++;
} else {
- console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
+ yCoords[nodeIndexes.get(constraint.top)] - yCoords[nodeIndexes.get(constraint.bottom)] >= 0 ? reflectOnX++ : notReflectOnX++;
}
- }, "run")
- }]);
- return Layout3;
- }();
- module3.exports = Layout2;
- }
- ),
- /***/
- 657: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var aux = __webpack_require__2(548);
- var Matrix = __webpack_require__2(140).layoutBase.Matrix;
- var SVD = __webpack_require__2(140).layoutBase.SVD;
- var spectralLayout = /* @__PURE__ */ __name(function spectralLayout2(options3) {
- var cy = options3.cy;
- var eles = options3.eles;
- var nodes6 = eles.nodes();
- var parentNodes = eles.nodes(":parent");
- var dummyNodes = /* @__PURE__ */ new Map();
- var nodeIndexes = /* @__PURE__ */ new Map();
- var parentChildMap = /* @__PURE__ */ new Map();
- var allNodesNeighborhood = [];
- var xCoords = [];
- var yCoords = [];
- var samplesColumn = [];
- var minDistancesColumn = [];
- var C2 = [];
- var PHI = [];
- var INV = [];
- var firstSample = void 0;
- var nodeSize = void 0;
- var infinity = 1e8;
- var small = 1e-9;
- var piTol = options3.piTol;
- var samplingType = options3.samplingType;
- var nodeSeparation = options3.nodeSeparation;
- var sampleSize = void 0;
- var randomSampleCR = /* @__PURE__ */ __name(function randomSampleCR2() {
- var sample2 = 0;
- var count = 0;
- var flag = false;
- while (count < sampleSize) {
- sample2 = Math.floor(Math.random() * nodeSize);
- flag = false;
- for (var i3 = 0; i3 < count; i3++) {
- if (samplesColumn[i3] == sample2) {
- flag = true;
- break;
- }
+ });
+ if (reflectOnY > notReflectOnY && reflectOnX > notReflectOnX) {
+ for (var _i = 0; _i < nodeIndexes.size; _i++) {
+ xCoords[_i] = -1 * xCoords[_i];
+ yCoords[_i] = -1 * yCoords[_i];
}
- if (!flag) {
- samplesColumn[count] = sample2;
- count++;
- } else {
- continue;
+ } else if (reflectOnY > notReflectOnY) {
+ for (var _i2 = 0; _i2 < nodeIndexes.size; _i2++) {
+ xCoords[_i2] = -1 * xCoords[_i2];
}
- }
- }, "randomSampleCR");
- var BFS = /* @__PURE__ */ __name(function BFS2(pivot, index2, samplingMethod) {
- var path4 = [];
- var front = 0;
- var back = 0;
- var current = 0;
- var temp = void 0;
- var distance2 = [];
- var max_dist = 0;
- var max_ind = 1;
- for (var i3 = 0; i3 < nodeSize; i3++) {
- distance2[i3] = infinity;
- }
- path4[back] = pivot;
- distance2[pivot] = 0;
- while (back >= front) {
- current = path4[front++];
- var neighbors = allNodesNeighborhood[current];
- for (var _i = 0; _i < neighbors.length; _i++) {
- temp = nodeIndexes.get(neighbors[_i]);
- if (distance2[temp] == infinity) {
- distance2[temp] = distance2[current] + 1;
- path4[++back] = temp;
- }
+ } else if (reflectOnX > notReflectOnX) {
+ for (var _i3 = 0; _i3 < nodeIndexes.size; _i3++) {
+ yCoords[_i3] = -1 * yCoords[_i3];
}
- C2[current][index2] = distance2[current] * nodeSeparation;
}
- if (samplingMethod) {
- for (var _i2 = 0; _i2 < nodeSize; _i2++) {
- if (C2[_i2][index2] < minDistancesColumn[_i2]) minDistancesColumn[_i2] = C2[_i2][index2];
- }
- for (var _i3 = 0; _i3 < nodeSize; _i3++) {
- if (minDistancesColumn[_i3] > max_dist) {
- max_dist = minDistancesColumn[_i3];
- max_ind = _i3;
+ }, "applyReflectionForRelativePlacement");
+ var findComponents = /* @__PURE__ */ __name(function findComponents2(graph) {
+ var components4 = [];
+ var queue = new LinkedList();
+ var visited = /* @__PURE__ */ new Set();
+ var count = 0;
+ graph.forEach(function(value2, key) {
+ if (!visited.has(key)) {
+ components4[count] = [];
+ var _currentNode = key;
+ queue.push(_currentNode);
+ visited.add(_currentNode);
+ components4[count].push(_currentNode);
+ while (queue.length != 0) {
+ _currentNode = queue.shift();
+ var neighbors = graph.get(_currentNode);
+ neighbors.forEach(function(neighbor) {
+ if (!visited.has(neighbor.id)) {
+ queue.push(neighbor.id);
+ visited.add(neighbor.id);
+ components4[count].push(neighbor.id);
+ }
+ });
}
+ count++;
}
- }
- return max_ind;
- }, "BFS");
- var allBFS = /* @__PURE__ */ __name(function allBFS2(samplingMethod) {
- var sample2 = void 0;
- if (!samplingMethod) {
- randomSampleCR();
- for (var i3 = 0; i3 < sampleSize; i3++) {
- BFS(samplesColumn[i3], i3, samplingMethod, false);
- }
- } else {
- sample2 = Math.floor(Math.random() * nodeSize);
- firstSample = sample2;
- for (var _i4 = 0; _i4 < nodeSize; _i4++) {
- minDistancesColumn[_i4] = infinity;
- }
- for (var _i5 = 0; _i5 < sampleSize; _i5++) {
- samplesColumn[_i5] = sample2;
- sample2 = BFS(sample2, _i5, samplingMethod);
- }
- }
- for (var _i6 = 0; _i6 < nodeSize; _i6++) {
- for (var j2 = 0; j2 < sampleSize; j2++) {
- C2[_i6][j2] *= C2[_i6][j2];
- }
- }
- for (var _i7 = 0; _i7 < sampleSize; _i7++) {
- PHI[_i7] = [];
- }
- for (var _i8 = 0; _i8 < sampleSize; _i8++) {
- for (var _j = 0; _j < sampleSize; _j++) {
- PHI[_i8][_j] = C2[samplesColumn[_j]][_i8];
- }
- }
- }, "allBFS");
- var sample = /* @__PURE__ */ __name(function sample2() {
- var SVDResult = SVD.svd(PHI);
- var a_q = SVDResult.S;
- var a_u = SVDResult.U;
- var a_v = SVDResult.V;
- var max_s = a_q[0] * a_q[0] * a_q[0];
- var a_Sig = [];
- for (var i3 = 0; i3 < sampleSize; i3++) {
- a_Sig[i3] = [];
- for (var j2 = 0; j2 < sampleSize; j2++) {
- a_Sig[i3][j2] = 0;
- if (i3 == j2) {
- a_Sig[i3][j2] = a_q[i3] / (a_q[i3] * a_q[i3] + max_s / (a_q[i3] * a_q[i3]));
+ });
+ return components4;
+ }, "findComponents");
+ var dagToUndirected = /* @__PURE__ */ __name(function dagToUndirected2(dag2) {
+ var undirected = /* @__PURE__ */ new Map();
+ dag2.forEach(function(value2, key) {
+ undirected.set(key, []);
+ });
+ dag2.forEach(function(value2, key) {
+ value2.forEach(function(adjacent) {
+ undirected.get(key).push(adjacent);
+ undirected.get(adjacent.id).push({ id: key, gap: adjacent.gap, direction: adjacent.direction });
+ });
+ });
+ return undirected;
+ }, "dagToUndirected");
+ var dagToReversed = /* @__PURE__ */ __name(function dagToReversed2(dag2) {
+ var reversed = /* @__PURE__ */ new Map();
+ dag2.forEach(function(value2, key) {
+ reversed.set(key, []);
+ });
+ dag2.forEach(function(value2, key) {
+ value2.forEach(function(adjacent) {
+ reversed.get(adjacent.id).push({ id: key, gap: adjacent.gap, direction: adjacent.direction });
+ });
+ });
+ return reversed;
+ }, "dagToReversed");
+ var targetMatrix = [];
+ var sourceMatrix = [];
+ var standardTransformation = false;
+ var reflectionType = false;
+ var fixedNodes = /* @__PURE__ */ new Set();
+ var dag = /* @__PURE__ */ new Map();
+ var dagUndirected = /* @__PURE__ */ new Map();
+ var components3 = [];
+ if (constraints.fixedNodeConstraint) {
+ constraints.fixedNodeConstraint.forEach(function(nodeData2) {
+ fixedNodes.add(nodeData2.nodeId);
+ });
+ }
+ if (constraints.relativePlacementConstraint) {
+ constraints.relativePlacementConstraint.forEach(function(constraint) {
+ if (constraint.left) {
+ if (dag.has(constraint.left)) {
+ dag.get(constraint.left).push({ id: constraint.right, gap: constraint.gap, direction: "horizontal" });
+ } else {
+ dag.set(constraint.left, [{ id: constraint.right, gap: constraint.gap, direction: "horizontal" }]);
+ }
+ if (!dag.has(constraint.right)) {
+ dag.set(constraint.right, []);
+ }
+ } else {
+ if (dag.has(constraint.top)) {
+ dag.get(constraint.top).push({ id: constraint.bottom, gap: constraint.gap, direction: "vertical" });
+ } else {
+ dag.set(constraint.top, [{ id: constraint.bottom, gap: constraint.gap, direction: "vertical" }]);
+ }
+ if (!dag.has(constraint.bottom)) {
+ dag.set(constraint.bottom, []);
}
}
- }
- INV = Matrix.multMat(Matrix.multMat(a_v, a_Sig), Matrix.transpose(a_u));
- }, "sample");
- var powerIteration = /* @__PURE__ */ __name(function powerIteration2() {
- var theta1 = void 0;
- var theta2 = void 0;
- var Y1 = [];
- var Y22 = [];
- var V1 = [];
- var V2 = [];
- for (var i3 = 0; i3 < nodeSize; i3++) {
- Y1[i3] = Math.random();
- Y22[i3] = Math.random();
- }
- Y1 = Matrix.normalize(Y1);
- Y22 = Matrix.normalize(Y22);
- var count = 0;
- var current = small;
- var previous = small;
- var temp = void 0;
- while (true) {
- count++;
- for (var _i9 = 0; _i9 < nodeSize; _i9++) {
- V1[_i9] = Y1[_i9];
- }
- Y1 = Matrix.multGamma(Matrix.multL(Matrix.multGamma(V1), C2, INV));
- theta1 = Matrix.dotProduct(V1, Y1);
- Y1 = Matrix.normalize(Y1);
- current = Matrix.dotProduct(V1, Y1);
- temp = Math.abs(current / previous);
- if (temp <= 1 + piTol && temp >= 1) {
- break;
- }
- previous = current;
- }
- for (var _i10 = 0; _i10 < nodeSize; _i10++) {
- V1[_i10] = Y1[_i10];
- }
- count = 0;
- previous = small;
- while (true) {
- count++;
- for (var _i11 = 0; _i11 < nodeSize; _i11++) {
- V2[_i11] = Y22[_i11];
- }
- V2 = Matrix.minusOp(V2, Matrix.multCons(V1, Matrix.dotProduct(V1, V2)));
- Y22 = Matrix.multGamma(Matrix.multL(Matrix.multGamma(V2), C2, INV));
- theta2 = Matrix.dotProduct(V2, Y22);
- Y22 = Matrix.normalize(Y22);
- current = Matrix.dotProduct(V2, Y22);
- temp = Math.abs(current / previous);
- if (temp <= 1 + piTol && temp >= 1) {
- break;
- }
- previous = current;
- }
- for (var _i12 = 0; _i12 < nodeSize; _i12++) {
- V2[_i12] = Y22[_i12];
- }
- xCoords = Matrix.multCons(V1, Math.sqrt(Math.abs(theta1)));
- yCoords = Matrix.multCons(V2, Math.sqrt(Math.abs(theta2)));
- }, "powerIteration");
- aux.connectComponents(cy, eles, aux.getTopMostNodes(nodes6), dummyNodes);
- parentNodes.forEach(function(ele) {
- aux.connectComponents(cy, eles, aux.getTopMostNodes(ele.descendants().intersection(eles)), dummyNodes);
- });
- var index = 0;
- for (var i2 = 0; i2 < nodes6.length; i2++) {
- if (!nodes6[i2].isParent()) {
- nodeIndexes.set(nodes6[i2].id(), index++);
- }
+ });
+ dagUndirected = dagToUndirected(dag);
+ components3 = findComponents(dagUndirected);
}
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = void 0;
- try {
- for (var _iterator = dummyNodes.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var key = _step.value;
- nodeIndexes.set(key, index++);
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
+ if (CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING) {
+ if (constraints.fixedNodeConstraint && constraints.fixedNodeConstraint.length > 1) {
+ constraints.fixedNodeConstraint.forEach(function(nodeData2, i3) {
+ targetMatrix[i3] = [nodeData2.position.x, nodeData2.position.y];
+ sourceMatrix[i3] = [xCoords[nodeIndexes.get(nodeData2.nodeId)], yCoords[nodeIndexes.get(nodeData2.nodeId)]];
+ });
+ standardTransformation = true;
+ } else if (constraints.alignmentConstraint) {
+ (function() {
+ var count = 0;
+ if (constraints.alignmentConstraint.vertical) {
+ var verticalAlign = constraints.alignmentConstraint.vertical;
+ var _loop2 = /* @__PURE__ */ __name(function _loop22(_i42) {
+ var alignmentSet = /* @__PURE__ */ new Set();
+ verticalAlign[_i42].forEach(function(nodeId) {
+ alignmentSet.add(nodeId);
+ });
+ var intersection4 = new Set([].concat(_toConsumableArray2(alignmentSet)).filter(function(x5) {
+ return fixedNodes.has(x5);
+ }));
+ var xPos = void 0;
+ if (intersection4.size > 0) xPos = xCoords[nodeIndexes.get(intersection4.values().next().value)];
+ else xPos = calculateAvgPosition(alignmentSet).x;
+ verticalAlign[_i42].forEach(function(nodeId) {
+ targetMatrix[count] = [xPos, yCoords[nodeIndexes.get(nodeId)]];
+ sourceMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]];
+ count++;
+ });
+ }, "_loop2");
+ for (var _i4 = 0; _i4 < verticalAlign.length; _i4++) {
+ _loop2(_i4);
+ }
+ standardTransformation = true;
+ }
+ if (constraints.alignmentConstraint.horizontal) {
+ var horizontalAlign = constraints.alignmentConstraint.horizontal;
+ var _loop3 = /* @__PURE__ */ __name(function _loop32(_i52) {
+ var alignmentSet = /* @__PURE__ */ new Set();
+ horizontalAlign[_i52].forEach(function(nodeId) {
+ alignmentSet.add(nodeId);
+ });
+ var intersection4 = new Set([].concat(_toConsumableArray2(alignmentSet)).filter(function(x5) {
+ return fixedNodes.has(x5);
+ }));
+ var yPos = void 0;
+ if (intersection4.size > 0) yPos = xCoords[nodeIndexes.get(intersection4.values().next().value)];
+ else yPos = calculateAvgPosition(alignmentSet).y;
+ horizontalAlign[_i52].forEach(function(nodeId) {
+ targetMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yPos];
+ sourceMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]];
+ count++;
+ });
+ }, "_loop3");
+ for (var _i5 = 0; _i5 < horizontalAlign.length; _i5++) {
+ _loop3(_i5);
+ }
+ standardTransformation = true;
+ }
+ if (constraints.relativePlacementConstraint) {
+ reflectionType = true;
+ }
+ })();
+ } else if (constraints.relativePlacementConstraint) {
+ var largestComponentSize = 0;
+ var largestComponentIndex = 0;
+ for (var _i6 = 0; _i6 < components3.length; _i6++) {
+ if (components3[_i6].length > largestComponentSize) {
+ largestComponentSize = components3[_i6].length;
+ largestComponentIndex = _i6;
+ }
}
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
+ if (largestComponentSize < dagUndirected.size / 2) {
+ applyReflectionForRelativePlacement(constraints.relativePlacementConstraint);
+ standardTransformation = false;
+ reflectionType = false;
+ } else {
+ var subGraphOnHorizontal = /* @__PURE__ */ new Map();
+ var subGraphOnVertical = /* @__PURE__ */ new Map();
+ var constraintsInlargestComponent = [];
+ components3[largestComponentIndex].forEach(function(nodeId) {
+ dag.get(nodeId).forEach(function(adjacent) {
+ if (adjacent.direction == "horizontal") {
+ if (subGraphOnHorizontal.has(nodeId)) {
+ subGraphOnHorizontal.get(nodeId).push(adjacent);
+ } else {
+ subGraphOnHorizontal.set(nodeId, [adjacent]);
+ }
+ if (!subGraphOnHorizontal.has(adjacent.id)) {
+ subGraphOnHorizontal.set(adjacent.id, []);
+ }
+ constraintsInlargestComponent.push({ left: nodeId, right: adjacent.id });
+ } else {
+ if (subGraphOnVertical.has(nodeId)) {
+ subGraphOnVertical.get(nodeId).push(adjacent);
+ } else {
+ subGraphOnVertical.set(nodeId, [adjacent]);
+ }
+ if (!subGraphOnVertical.has(adjacent.id)) {
+ subGraphOnVertical.set(adjacent.id, []);
+ }
+ constraintsInlargestComponent.push({ top: nodeId, bottom: adjacent.id });
+ }
+ });
+ });
+ applyReflectionForRelativePlacement(constraintsInlargestComponent);
+ reflectionType = false;
+ var positionMapHorizontal = findAppropriatePositionForRelativePlacement(subGraphOnHorizontal, "horizontal");
+ var positionMapVertical = findAppropriatePositionForRelativePlacement(subGraphOnVertical, "vertical");
+ components3[largestComponentIndex].forEach(function(nodeId, i3) {
+ sourceMatrix[i3] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]];
+ targetMatrix[i3] = [];
+ if (positionMapHorizontal.has(nodeId)) {
+ targetMatrix[i3][0] = positionMapHorizontal.get(nodeId);
+ } else {
+ targetMatrix[i3][0] = xCoords[nodeIndexes.get(nodeId)];
+ }
+ if (positionMapVertical.has(nodeId)) {
+ targetMatrix[i3][1] = positionMapVertical.get(nodeId);
+ } else {
+ targetMatrix[i3][1] = yCoords[nodeIndexes.get(nodeId)];
+ }
+ });
+ standardTransformation = true;
}
}
- }
- for (var _i13 = 0; _i13 < nodeIndexes.size; _i13++) {
- allNodesNeighborhood[_i13] = [];
- }
- parentNodes.forEach(function(ele) {
- var children2 = ele.children().intersection(eles);
- while (children2.nodes(":childless").length == 0) {
- children2 = children2.nodes()[0].children().intersection(eles);
- }
- var index2 = 0;
- var min9 = children2.nodes(":childless")[0].connectedEdges().length;
- children2.nodes(":childless").forEach(function(ele2, i3) {
- if (ele2.connectedEdges().length < min9) {
- min9 = ele2.connectedEdges().length;
- index2 = i3;
- }
- });
- parentChildMap.set(ele.id(), children2.nodes(":childless")[index2].id());
- });
- nodes6.forEach(function(ele) {
- var eleIndex = void 0;
- if (ele.isParent()) eleIndex = nodeIndexes.get(parentChildMap.get(ele.id()));
- else eleIndex = nodeIndexes.get(ele.id());
- ele.neighborhood().nodes().forEach(function(node2) {
- if (eles.intersection(ele.edgesWith(node2)).length > 0) {
- if (node2.isParent()) allNodesNeighborhood[eleIndex].push(parentChildMap.get(node2.id()));
- else allNodesNeighborhood[eleIndex].push(node2.id());
+ if (standardTransformation) {
+ var transformationMatrix = void 0;
+ var targetMatrixTranspose = Matrix.transpose(targetMatrix);
+ var sourceMatrixTranspose = Matrix.transpose(sourceMatrix);
+ for (var _i7 = 0; _i7 < targetMatrixTranspose.length; _i7++) {
+ targetMatrixTranspose[_i7] = Matrix.multGamma(targetMatrixTranspose[_i7]);
+ sourceMatrixTranspose[_i7] = Matrix.multGamma(sourceMatrixTranspose[_i7]);
}
- });
- });
- var _loop = /* @__PURE__ */ __name(function _loop2(_key2) {
- var eleIndex = nodeIndexes.get(_key2);
- var disconnectedId = void 0;
- dummyNodes.get(_key2).forEach(function(id27) {
- if (cy.getElementById(id27).isParent()) disconnectedId = parentChildMap.get(id27);
- else disconnectedId = id27;
- allNodesNeighborhood[eleIndex].push(disconnectedId);
- allNodesNeighborhood[nodeIndexes.get(disconnectedId)].push(_key2);
- });
- }, "_loop");
- var _iteratorNormalCompletion2 = true;
- var _didIteratorError2 = false;
- var _iteratorError2 = void 0;
- try {
- for (var _iterator2 = dummyNodes.keys()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
- var _key = _step2.value;
- _loop(_key);
- }
- } catch (err) {
- _didIteratorError2 = true;
- _iteratorError2 = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
- _iterator2.return();
+ var tempMatrix = Matrix.multMat(targetMatrixTranspose, Matrix.transpose(sourceMatrixTranspose));
+ var SVDResult = SVD.svd(tempMatrix);
+ transformationMatrix = Matrix.multMat(SVDResult.V, Matrix.transpose(SVDResult.U));
+ for (var _i8 = 0; _i8 < nodeIndexes.size; _i8++) {
+ var temp1 = [xCoords[_i8], yCoords[_i8]];
+ var temp2 = [transformationMatrix[0][0], transformationMatrix[1][0]];
+ var temp3 = [transformationMatrix[0][1], transformationMatrix[1][1]];
+ xCoords[_i8] = Matrix.dotProduct(temp1, temp2);
+ yCoords[_i8] = Matrix.dotProduct(temp1, temp3);
}
- } finally {
- if (_didIteratorError2) {
- throw _iteratorError2;
+ if (reflectionType) {
+ applyReflectionForRelativePlacement(constraints.relativePlacementConstraint);
}
}
}
- nodeSize = nodeIndexes.size;
- var spectralResult = void 0;
- if (nodeSize > 2) {
- sampleSize = nodeSize < options3.sampleSize ? nodeSize : options3.sampleSize;
- for (var _i14 = 0; _i14 < nodeSize; _i14++) {
- C2[_i14] = [];
- }
- for (var _i15 = 0; _i15 < sampleSize; _i15++) {
- INV[_i15] = [];
- }
- if (options3.quality == "draft" || options3.step == "all") {
- allBFS(samplingType);
- sample();
- powerIteration();
- spectralResult = { nodeIndexes, xCoords, yCoords };
- } else {
- nodeIndexes.forEach(function(value2, key2) {
- xCoords.push(cy.getElementById(key2).position("x"));
- yCoords.push(cy.getElementById(key2).position("y"));
+ if (CoSEConstants.ENFORCE_CONSTRAINTS) {
+ if (constraints.fixedNodeConstraint && constraints.fixedNodeConstraint.length > 0) {
+ var translationAmount = { x: 0, y: 0 };
+ constraints.fixedNodeConstraint.forEach(function(nodeData2, i3) {
+ var posInTheory = { x: xCoords[nodeIndexes.get(nodeData2.nodeId)], y: yCoords[nodeIndexes.get(nodeData2.nodeId)] };
+ var posDesired = nodeData2.position;
+ var posDiff = calculatePositionDiff(posDesired, posInTheory);
+ translationAmount.x += posDiff.x;
+ translationAmount.y += posDiff.y;
+ });
+ translationAmount.x /= constraints.fixedNodeConstraint.length;
+ translationAmount.y /= constraints.fixedNodeConstraint.length;
+ xCoords.forEach(function(value2, i3) {
+ xCoords[i3] += translationAmount.x;
+ });
+ yCoords.forEach(function(value2, i3) {
+ yCoords[i3] += translationAmount.y;
+ });
+ constraints.fixedNodeConstraint.forEach(function(nodeData2) {
+ xCoords[nodeIndexes.get(nodeData2.nodeId)] = nodeData2.position.x;
+ yCoords[nodeIndexes.get(nodeData2.nodeId)] = nodeData2.position.y;
});
- spectralResult = { nodeIndexes, xCoords, yCoords };
}
- return spectralResult;
- } else {
- var iterator = nodeIndexes.keys();
- var firstNode = cy.getElementById(iterator.next().value);
- var firstNodePos = firstNode.position();
- var firstNodeWidth = firstNode.outerWidth();
- xCoords.push(firstNodePos.x);
- yCoords.push(firstNodePos.y);
- if (nodeSize == 2) {
- var secondNode = cy.getElementById(iterator.next().value);
- var secondNodeWidth = secondNode.outerWidth();
- xCoords.push(firstNodePos.x + firstNodeWidth / 2 + secondNodeWidth / 2 + options3.idealEdgeLength);
- yCoords.push(firstNodePos.y);
+ if (constraints.alignmentConstraint) {
+ if (constraints.alignmentConstraint.vertical) {
+ var xAlign = constraints.alignmentConstraint.vertical;
+ var _loop4 = /* @__PURE__ */ __name(function _loop42(_i92) {
+ var alignmentSet = /* @__PURE__ */ new Set();
+ xAlign[_i92].forEach(function(nodeId) {
+ alignmentSet.add(nodeId);
+ });
+ var intersection4 = new Set([].concat(_toConsumableArray2(alignmentSet)).filter(function(x5) {
+ return fixedNodes.has(x5);
+ }));
+ var xPos = void 0;
+ if (intersection4.size > 0) xPos = xCoords[nodeIndexes.get(intersection4.values().next().value)];
+ else xPos = calculateAvgPosition(alignmentSet).x;
+ alignmentSet.forEach(function(nodeId) {
+ if (!fixedNodes.has(nodeId)) xCoords[nodeIndexes.get(nodeId)] = xPos;
+ });
+ }, "_loop4");
+ for (var _i9 = 0; _i9 < xAlign.length; _i9++) {
+ _loop4(_i9);
+ }
+ }
+ if (constraints.alignmentConstraint.horizontal) {
+ var yAlign = constraints.alignmentConstraint.horizontal;
+ var _loop5 = /* @__PURE__ */ __name(function _loop52(_i102) {
+ var alignmentSet = /* @__PURE__ */ new Set();
+ yAlign[_i102].forEach(function(nodeId) {
+ alignmentSet.add(nodeId);
+ });
+ var intersection4 = new Set([].concat(_toConsumableArray2(alignmentSet)).filter(function(x5) {
+ return fixedNodes.has(x5);
+ }));
+ var yPos = void 0;
+ if (intersection4.size > 0) yPos = yCoords[nodeIndexes.get(intersection4.values().next().value)];
+ else yPos = calculateAvgPosition(alignmentSet).y;
+ alignmentSet.forEach(function(nodeId) {
+ if (!fixedNodes.has(nodeId)) yCoords[nodeIndexes.get(nodeId)] = yPos;
+ });
+ }, "_loop5");
+ for (var _i10 = 0; _i10 < yAlign.length; _i10++) {
+ _loop5(_i10);
+ }
+ }
+ }
+ if (constraints.relativePlacementConstraint) {
+ (function() {
+ var nodeToDummyForVerticalAlignment = /* @__PURE__ */ new Map();
+ var nodeToDummyForHorizontalAlignment = /* @__PURE__ */ new Map();
+ var dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map();
+ var dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map();
+ var dummyPositionsForVerticalAlignment = /* @__PURE__ */ new Map();
+ var dummyPositionsForHorizontalAlignment = /* @__PURE__ */ new Map();
+ var fixedNodesOnHorizontal = /* @__PURE__ */ new Set();
+ var fixedNodesOnVertical = /* @__PURE__ */ new Set();
+ fixedNodes.forEach(function(nodeId2) {
+ fixedNodesOnHorizontal.add(nodeId2);
+ fixedNodesOnVertical.add(nodeId2);
+ });
+ if (constraints.alignmentConstraint) {
+ if (constraints.alignmentConstraint.vertical) {
+ var verticalAlignment2 = constraints.alignmentConstraint.vertical;
+ var _loop6 = /* @__PURE__ */ __name(function _loop62(_i112) {
+ dummyToNodeForVerticalAlignment.set("dummy" + _i112, []);
+ verticalAlignment2[_i112].forEach(function(nodeId2) {
+ nodeToDummyForVerticalAlignment.set(nodeId2, "dummy" + _i112);
+ dummyToNodeForVerticalAlignment.get("dummy" + _i112).push(nodeId2);
+ if (fixedNodes.has(nodeId2)) {
+ fixedNodesOnHorizontal.add("dummy" + _i112);
+ }
+ });
+ dummyPositionsForVerticalAlignment.set("dummy" + _i112, xCoords[nodeIndexes.get(verticalAlignment2[_i112][0])]);
+ }, "_loop6");
+ for (var _i11 = 0; _i11 < verticalAlignment2.length; _i11++) {
+ _loop6(_i11);
+ }
+ }
+ if (constraints.alignmentConstraint.horizontal) {
+ var horizontalAlignment = constraints.alignmentConstraint.horizontal;
+ var _loop7 = /* @__PURE__ */ __name(function _loop72(_i122) {
+ dummyToNodeForHorizontalAlignment.set("dummy" + _i122, []);
+ horizontalAlignment[_i122].forEach(function(nodeId2) {
+ nodeToDummyForHorizontalAlignment.set(nodeId2, "dummy" + _i122);
+ dummyToNodeForHorizontalAlignment.get("dummy" + _i122).push(nodeId2);
+ if (fixedNodes.has(nodeId2)) {
+ fixedNodesOnVertical.add("dummy" + _i122);
+ }
+ });
+ dummyPositionsForHorizontalAlignment.set("dummy" + _i122, yCoords[nodeIndexes.get(horizontalAlignment[_i122][0])]);
+ }, "_loop7");
+ for (var _i12 = 0; _i12 < horizontalAlignment.length; _i12++) {
+ _loop7(_i12);
+ }
+ }
+ }
+ var dagOnHorizontal = /* @__PURE__ */ new Map();
+ var dagOnVertical = /* @__PURE__ */ new Map();
+ var _loop8 = /* @__PURE__ */ __name(function _loop82(nodeId2) {
+ dag.get(nodeId2).forEach(function(adjacent) {
+ var sourceId = void 0;
+ var targetNode = void 0;
+ if (adjacent["direction"] == "horizontal") {
+ sourceId = nodeToDummyForVerticalAlignment.get(nodeId2) ? nodeToDummyForVerticalAlignment.get(nodeId2) : nodeId2;
+ if (nodeToDummyForVerticalAlignment.get(adjacent.id)) {
+ targetNode = { id: nodeToDummyForVerticalAlignment.get(adjacent.id), gap: adjacent.gap, direction: adjacent.direction };
+ } else {
+ targetNode = adjacent;
+ }
+ if (dagOnHorizontal.has(sourceId)) {
+ dagOnHorizontal.get(sourceId).push(targetNode);
+ } else {
+ dagOnHorizontal.set(sourceId, [targetNode]);
+ }
+ if (!dagOnHorizontal.has(targetNode.id)) {
+ dagOnHorizontal.set(targetNode.id, []);
+ }
+ } else {
+ sourceId = nodeToDummyForHorizontalAlignment.get(nodeId2) ? nodeToDummyForHorizontalAlignment.get(nodeId2) : nodeId2;
+ if (nodeToDummyForHorizontalAlignment.get(adjacent.id)) {
+ targetNode = { id: nodeToDummyForHorizontalAlignment.get(adjacent.id), gap: adjacent.gap, direction: adjacent.direction };
+ } else {
+ targetNode = adjacent;
+ }
+ if (dagOnVertical.has(sourceId)) {
+ dagOnVertical.get(sourceId).push(targetNode);
+ } else {
+ dagOnVertical.set(sourceId, [targetNode]);
+ }
+ if (!dagOnVertical.has(targetNode.id)) {
+ dagOnVertical.set(targetNode.id, []);
+ }
+ }
+ });
+ }, "_loop8");
+ var _iteratorNormalCompletion5 = true;
+ var _didIteratorError5 = false;
+ var _iteratorError5 = void 0;
+ try {
+ for (var _iterator5 = dag.keys()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
+ var nodeId = _step5.value;
+ _loop8(nodeId);
+ }
+ } catch (err) {
+ _didIteratorError5 = true;
+ _iteratorError5 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion5 && _iterator5.return) {
+ _iterator5.return();
+ }
+ } finally {
+ if (_didIteratorError5) {
+ throw _iteratorError5;
+ }
+ }
+ }
+ var undirectedOnHorizontal = dagToUndirected(dagOnHorizontal);
+ var undirectedOnVertical = dagToUndirected(dagOnVertical);
+ var componentsOnHorizontal = findComponents(undirectedOnHorizontal);
+ var componentsOnVertical = findComponents(undirectedOnVertical);
+ var reversedDagOnHorizontal = dagToReversed(dagOnHorizontal);
+ var reversedDagOnVertical = dagToReversed(dagOnVertical);
+ var componentSourcesOnHorizontal = [];
+ var componentSourcesOnVertical = [];
+ componentsOnHorizontal.forEach(function(component2, index2) {
+ componentSourcesOnHorizontal[index2] = [];
+ component2.forEach(function(nodeId2) {
+ if (reversedDagOnHorizontal.get(nodeId2).length == 0) {
+ componentSourcesOnHorizontal[index2].push(nodeId2);
+ }
+ });
+ });
+ componentsOnVertical.forEach(function(component2, index2) {
+ componentSourcesOnVertical[index2] = [];
+ component2.forEach(function(nodeId2) {
+ if (reversedDagOnVertical.get(nodeId2).length == 0) {
+ componentSourcesOnVertical[index2].push(nodeId2);
+ }
+ });
+ });
+ var positionMapHorizontal2 = findAppropriatePositionForRelativePlacement(dagOnHorizontal, "horizontal", fixedNodesOnHorizontal, dummyPositionsForVerticalAlignment, componentSourcesOnHorizontal);
+ var positionMapVertical2 = findAppropriatePositionForRelativePlacement(dagOnVertical, "vertical", fixedNodesOnVertical, dummyPositionsForHorizontalAlignment, componentSourcesOnVertical);
+ var _loop9 = /* @__PURE__ */ __name(function _loop92(key2) {
+ if (dummyToNodeForVerticalAlignment.get(key2)) {
+ dummyToNodeForVerticalAlignment.get(key2).forEach(function(nodeId2) {
+ xCoords[nodeIndexes.get(nodeId2)] = positionMapHorizontal2.get(key2);
+ });
+ } else {
+ xCoords[nodeIndexes.get(key2)] = positionMapHorizontal2.get(key2);
+ }
+ }, "_loop9");
+ var _iteratorNormalCompletion6 = true;
+ var _didIteratorError6 = false;
+ var _iteratorError6 = void 0;
+ try {
+ for (var _iterator6 = positionMapHorizontal2.keys()[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
+ var key = _step6.value;
+ _loop9(key);
+ }
+ } catch (err) {
+ _didIteratorError6 = true;
+ _iteratorError6 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion6 && _iterator6.return) {
+ _iterator6.return();
+ }
+ } finally {
+ if (_didIteratorError6) {
+ throw _iteratorError6;
+ }
+ }
+ }
+ var _loop10 = /* @__PURE__ */ __name(function _loop102(key2) {
+ if (dummyToNodeForHorizontalAlignment.get(key2)) {
+ dummyToNodeForHorizontalAlignment.get(key2).forEach(function(nodeId2) {
+ yCoords[nodeIndexes.get(nodeId2)] = positionMapVertical2.get(key2);
+ });
+ } else {
+ yCoords[nodeIndexes.get(key2)] = positionMapVertical2.get(key2);
+ }
+ }, "_loop10");
+ var _iteratorNormalCompletion7 = true;
+ var _didIteratorError7 = false;
+ var _iteratorError7 = void 0;
+ try {
+ for (var _iterator7 = positionMapVertical2.keys()[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
+ var key = _step7.value;
+ _loop10(key);
+ }
+ } catch (err) {
+ _didIteratorError7 = true;
+ _iteratorError7 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion7 && _iterator7.return) {
+ _iterator7.return();
+ }
+ } finally {
+ if (_didIteratorError7) {
+ throw _iteratorError7;
+ }
+ }
+ }
+ })();
}
- spectralResult = { nodeIndexes, xCoords, yCoords };
- return spectralResult;
- }
- }, "spectralLayout");
- module3.exports = { spectralLayout };
- }
- ),
- /***/
- 579: (
- /***/
- (module3, __unused_webpack_exports, __webpack_require__2) => {
- var impl2 = __webpack_require__2(212);
- var register = /* @__PURE__ */ __name(function register2(cytoscape4) {
- if (!cytoscape4) {
- return;
}
- cytoscape4("layout", "fcose", impl2);
- }, "register");
- if (typeof cytoscape !== "undefined") {
- register(cytoscape);
- }
- module3.exports = register;
+ for (var _i13 = 0; _i13 < allNodes.length; _i13++) {
+ var _node = allNodes[_i13];
+ if (_node.getChild() == null) {
+ _node.setCenter(xCoords[nodeIndexes.get(_node.id)], yCoords[nodeIndexes.get(_node.id)]);
+ }
+ }
+ };
+ module3.exports = ConstraintHandler;
}
),
/***/
- 140: (
+ 551: (
/***/
(module3) => {
- module3.exports = __WEBPACK_EXTERNAL_MODULE__140__;
+ module3.exports = __WEBPACK_EXTERNAL_MODULE__551__;
}
)
/******/
};
- var __webpack_module_cache__ = {};
- function __webpack_require__(moduleId) {
- var cachedModule = __webpack_module_cache__[moduleId];
- if (cachedModule !== void 0) {
- return cachedModule.exports;
- }
- var module3 = __webpack_module_cache__[moduleId] = {
- /******/
- // no module.id needed
- /******/
- // no module.loaded needed
- /******/
- exports: {}
- /******/
- };
- __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
- return module3.exports;
- }
- __name(__webpack_require__, "__webpack_require__");
- var __webpack_exports__ = __webpack_require__(579);
- return __webpack_exports__;
- })()
- );
- });
- }
- });
-
- // src/diagrams/architecture/architectureIcons.ts
- var wrapIcon, architectureIcons;
- var init_architectureIcons = __esm({
- "src/diagrams/architecture/architectureIcons.ts"() {
- "use strict";
- init_icons();
- wrapIcon = /* @__PURE__ */ __name((icon) => {
- return ` ${icon} `;
- }, "wrapIcon");
- architectureIcons = {
- prefix: "mermaid-architecture",
- height: 80,
- width: 80,
- icons: {
- database: {
- body: wrapIcon(
- ' '
- )
- },
- server: {
- body: wrapIcon(
- ' '
- )
- },
- disk: {
- body: wrapIcon(
- ' '
- )
- },
- internet: {
- body: wrapIcon(
- ' '
- )
- },
- cloud: {
- body: wrapIcon(
- ' '
- )
- },
- unknown: unknownIcon,
- blank: {
- body: wrapIcon("")
- }
- }
- };
- }
- });
-
- // src/diagrams/architecture/svgDraw.ts
- var drawEdges2, drawGroups, drawServices, drawJunctions;
- var init_svgDraw7 = __esm({
- "src/diagrams/architecture/svgDraw.ts"() {
- "use strict";
- init_icons();
- init_diagramAPI();
- init_createText();
- init_architectureDb();
- init_architectureIcons();
- init_architectureTypes();
- drawEdges2 = /* @__PURE__ */ __name(async function(edgesEl, cy) {
- const padding3 = getConfigField("padding");
- const iconSize = getConfigField("iconSize");
- const halfIconSize = iconSize / 2;
- const arrowSize = iconSize / 6;
- const halfArrowSize = arrowSize / 2;
- await Promise.all(
- cy.edges().map(async (edge) => {
- const {
- source,
- sourceDir,
- sourceArrow,
- sourceGroup,
- target,
- targetDir,
- targetArrow,
- targetGroup,
- label
- } = edgeData(edge);
- let { x: startX2, y: startY2 } = edge[0].sourceEndpoint();
- const { x: midX, y: midY } = edge[0].midpoint();
- let { x: endX, y: endY } = edge[0].targetEndpoint();
- const groupEdgeShift = padding3 + 4;
- if (sourceGroup) {
- if (isArchitectureDirectionX(sourceDir)) {
- startX2 += sourceDir === "L" ? -groupEdgeShift : groupEdgeShift;
- } else {
- startY2 += sourceDir === "T" ? -groupEdgeShift : groupEdgeShift + 18;
- }
- }
- if (targetGroup) {
- if (isArchitectureDirectionX(targetDir)) {
- endX += targetDir === "L" ? -groupEdgeShift : groupEdgeShift;
- } else {
- endY += targetDir === "T" ? -groupEdgeShift : groupEdgeShift + 18;
- }
- }
- if (!sourceGroup && db7.getNode(source)?.type === "junction") {
- if (isArchitectureDirectionX(sourceDir)) {
- startX2 += sourceDir === "L" ? halfIconSize : -halfIconSize;
- } else {
- startY2 += sourceDir === "T" ? halfIconSize : -halfIconSize;
- }
- }
- if (!targetGroup && db7.getNode(target)?.type === "junction") {
- if (isArchitectureDirectionX(targetDir)) {
- endX += targetDir === "L" ? halfIconSize : -halfIconSize;
- } else {
- endY += targetDir === "T" ? halfIconSize : -halfIconSize;
- }
- }
- if (edge[0]._private.rscratch) {
- const g2 = edgesEl.insert("g");
- g2.insert("path").attr("d", `M ${startX2},${startY2} L ${midX},${midY} L${endX},${endY} `).attr("class", "edge");
- if (sourceArrow) {
- const xShift = isArchitectureDirectionX(sourceDir) ? ArchitectureDirectionArrowShift[sourceDir](startX2, arrowSize) : startX2 - halfArrowSize;
- const yShift = isArchitectureDirectionY(sourceDir) ? ArchitectureDirectionArrowShift[sourceDir](startY2, arrowSize) : startY2 - halfArrowSize;
- g2.insert("polygon").attr("points", ArchitectureDirectionArrow[sourceDir](arrowSize)).attr("transform", `translate(${xShift},${yShift})`).attr("class", "arrow");
- }
- if (targetArrow) {
- const xShift = isArchitectureDirectionX(targetDir) ? ArchitectureDirectionArrowShift[targetDir](endX, arrowSize) : endX - halfArrowSize;
- const yShift = isArchitectureDirectionY(targetDir) ? ArchitectureDirectionArrowShift[targetDir](endY, arrowSize) : endY - halfArrowSize;
- g2.insert("polygon").attr("points", ArchitectureDirectionArrow[targetDir](arrowSize)).attr("transform", `translate(${xShift},${yShift})`).attr("class", "arrow");
- }
- if (label) {
- const axis2 = !isArchitectureDirectionXY(sourceDir, targetDir) ? isArchitectureDirectionX(sourceDir) ? "X" : "Y" : "XY";
- let width3 = 0;
- if (axis2 === "X") {
- width3 = Math.abs(startX2 - endX);
- } else if (axis2 === "Y") {
- width3 = Math.abs(startY2 - endY) / 1.5;
- } else {
- width3 = Math.abs(startX2 - endX) / 2;
- }
- const textElem = g2.append("g");
- await createText(
- textElem,
- label,
- {
- useHtmlLabels: false,
- width: width3,
- classes: "architecture-service-label"
- },
- getConfig2()
- );
- textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle");
- if (axis2 === "X") {
- textElem.attr("transform", "translate(" + midX + ", " + midY + ")");
- } else if (axis2 === "Y") {
- textElem.attr("transform", "translate(" + midX + ", " + midY + ") rotate(-90)");
- } else if (axis2 === "XY") {
- const pair = getArchitectureDirectionPair(sourceDir, targetDir);
- if (pair && isArchitecturePairXY(pair)) {
- const bboxOrig = textElem.node().getBoundingClientRect();
- const [x5, y5] = getArchitectureDirectionXYFactors(pair);
- textElem.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * x5 * y5 * 45})`);
- const bboxNew = textElem.node().getBoundingClientRect();
- textElem.attr(
- "transform",
- `
- translate(${midX}, ${midY - bboxOrig.height / 2})
- translate(${x5 * bboxNew.width / 2}, ${y5 * bboxNew.height / 2})
- rotate(${-1 * x5 * y5 * 45}, 0, ${bboxOrig.height / 2})
- `
- );
- }
- }
- }
- }
- })
- );
- }, "drawEdges");
- drawGroups = /* @__PURE__ */ __name(async function(groupsEl, cy) {
- const padding3 = getConfigField("padding");
- const groupIconSize = padding3 * 0.75;
- const fontSize = getConfigField("fontSize");
- const iconSize = getConfigField("iconSize");
- const halfIconSize = iconSize / 2;
- await Promise.all(
- cy.nodes().map(async (node2) => {
- const data5 = nodeData(node2);
- if (data5.type === "group") {
- const { h: h2, w: w3, x1, y1 } = node2.boundingBox();
- groupsEl.append("rect").attr("x", x1 + halfIconSize).attr("y", y1 + halfIconSize).attr("width", w3).attr("height", h2).attr("class", "node-bkg");
- const groupLabelContainer = groupsEl.append("g");
- let shiftedX1 = x1;
- let shiftedY1 = y1;
- if (data5.icon) {
- const bkgElem = groupLabelContainer.append("g");
- bkgElem.html(
- `${await getIconSVG(data5.icon, { height: groupIconSize, width: groupIconSize, fallbackPrefix: architectureIcons.prefix })} `
- );
- bkgElem.attr(
- "transform",
- "translate(" + (shiftedX1 + halfIconSize + 1) + ", " + (shiftedY1 + halfIconSize + 1) + ")"
- );
- shiftedX1 += groupIconSize;
- shiftedY1 += fontSize / 2 - 1 - 2;
- }
- if (data5.label) {
- const textElem = groupLabelContainer.append("g");
- await createText(
- textElem,
- data5.label,
- {
- useHtmlLabels: false,
- width: w3,
- classes: "architecture-service-label"
- },
- getConfig2()
- );
- textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start");
- textElem.attr(
- "transform",
- "translate(" + (shiftedX1 + halfIconSize + 4) + ", " + (shiftedY1 + halfIconSize + 2) + ")"
- );
- }
- }
- })
- );
- }, "drawGroups");
- drawServices = /* @__PURE__ */ __name(async function(db8, elem, services) {
- for (const service of services) {
- const serviceElem = elem.append("g");
- const iconSize = getConfigField("iconSize");
- if (service.title) {
- const textElem = serviceElem.append("g");
- await createText(
- textElem,
- service.title,
- {
- useHtmlLabels: false,
- width: iconSize * 1.5,
- classes: "architecture-service-label"
- },
- getConfig2()
- );
- textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle");
- textElem.attr("transform", "translate(" + iconSize / 2 + ", " + iconSize + ")");
- }
- const bkgElem = serviceElem.append("g");
- if (service.icon) {
- bkgElem.html(
- `${await getIconSVG(service.icon, { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })} `
- );
- } else if (service.iconText) {
- bkgElem.html(
- `${await getIconSVG("blank", { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })} `
- );
- const textElemContainer = bkgElem.append("g");
- const fo = textElemContainer.append("foreignObject").attr("width", iconSize).attr("height", iconSize);
- const divElem = fo.append("div").attr("class", "node-icon-text").attr("style", `height: ${iconSize}px;`).append("div").html(service.iconText);
- const fontSize = parseInt(
- window.getComputedStyle(divElem.node(), null).getPropertyValue("font-size").replace(/\D/g, "")
- ) ?? 16;
- divElem.attr("style", `-webkit-line-clamp: ${Math.floor((iconSize - 2) / fontSize)};`);
- } else {
- bkgElem.append("path").attr("class", "node-bkg").attr("id", "node-" + service.id).attr(
- "d",
- `M0 ${iconSize} v${-iconSize} q0,-5 5,-5 h${iconSize} q5,0 5,5 v${iconSize} H0 Z`
- );
- }
- serviceElem.attr("class", "architecture-service");
- const { width: width3, height: height2 } = serviceElem._groups[0][0].getBBox();
- service.width = width3;
- service.height = height2;
- db8.setElementForId(service.id, serviceElem);
- }
- return 0;
- }, "drawServices");
- drawJunctions = /* @__PURE__ */ __name(function(db8, elem, junctions) {
- junctions.forEach((junction) => {
- const junctionElem = elem.append("g");
- const iconSize = getConfigField("iconSize");
- const bkgElem = junctionElem.append("g");
- bkgElem.append("rect").attr("id", "node-" + junction.id).attr("fill-opacity", "0").attr("width", iconSize).attr("height", iconSize);
- junctionElem.attr("class", "architecture-junction");
- const { width: width3, height: height2 } = junctionElem._groups[0][0].getBBox();
- junctionElem.width = width3;
- junctionElem.height = height2;
- db8.setElementForId(junction.id, junctionElem);
- });
- }, "drawJunctions");
- }
- });
-
- // src/diagrams/architecture/architectureRenderer.ts
- function addServices(services, cy) {
- services.forEach((service) => {
- cy.add({
- group: "nodes",
- data: {
- type: "service",
- id: service.id,
- icon: service.icon,
- label: service.title,
- parent: service.in,
- width: getConfigField("iconSize"),
- height: getConfigField("iconSize")
- },
- classes: "node-service"
- });
- });
- }
- function addJunctions(junctions, cy) {
- junctions.forEach((junction) => {
- cy.add({
- group: "nodes",
- data: {
- type: "junction",
- id: junction.id,
- parent: junction.in,
- width: getConfigField("iconSize"),
- height: getConfigField("iconSize")
- },
- classes: "node-junction"
- });
- });
- }
- function positionNodes2(db8, cy) {
- cy.nodes().map((node2) => {
- const data5 = nodeData(node2);
- if (data5.type === "group") {
- return;
- }
- data5.x = node2.position().x;
- data5.y = node2.position().y;
- const nodeElem = db8.getElementById(data5.id);
- nodeElem.attr("transform", "translate(" + (data5.x || 0) + "," + (data5.y || 0) + ")");
- });
- }
- function addGroups(groups, cy) {
- groups.forEach((group2) => {
- cy.add({
- group: "nodes",
- data: {
- type: "group",
- id: group2.id,
- icon: group2.icon,
- label: group2.title,
- parent: group2.in
- },
- classes: "node-group"
- });
- });
- }
- function addEdges(edges5, cy) {
- edges5.forEach((parsedEdge) => {
- const { lhsId, rhsId, lhsInto, lhsGroup, rhsInto, lhsDir, rhsDir, rhsGroup, title: title2 } = parsedEdge;
- const edgeType = isArchitectureDirectionXY(parsedEdge.lhsDir, parsedEdge.rhsDir) ? "segments" : "straight";
- const edge = {
- id: `${lhsId}-${rhsId}`,
- label: title2,
- source: lhsId,
- sourceDir: lhsDir,
- sourceArrow: lhsInto,
- sourceGroup: lhsGroup,
- sourceEndpoint: lhsDir === "L" ? "0 50%" : lhsDir === "R" ? "100% 50%" : lhsDir === "T" ? "50% 0" : "50% 100%",
- target: rhsId,
- targetDir: rhsDir,
- targetArrow: rhsInto,
- targetGroup: rhsGroup,
- targetEndpoint: rhsDir === "L" ? "0 50%" : rhsDir === "R" ? "100% 50%" : rhsDir === "T" ? "50% 0" : "50% 100%"
- };
- cy.add({
- group: "edges",
- data: edge,
- classes: edgeType
- });
- });
- }
- function getAlignments(spatialMaps) {
- const alignments = spatialMaps.map((spatialMap) => {
- const horizontalAlignments = {};
- const verticalAlignments = {};
- Object.entries(spatialMap).forEach(([id27, [x5, y5]]) => {
- if (!horizontalAlignments[y5]) {
- horizontalAlignments[y5] = [];
- }
- if (!verticalAlignments[x5]) {
- verticalAlignments[x5] = [];
- }
- horizontalAlignments[y5].push(id27);
- verticalAlignments[x5].push(id27);
- });
- return {
- horiz: Object.values(horizontalAlignments).filter((arr) => arr.length > 1),
- vert: Object.values(verticalAlignments).filter((arr) => arr.length > 1)
- };
- });
- const [horizontal, vertical] = alignments.reduce(
- ([prevHoriz, prevVert], { horiz, vert }) => {
- return [
- [...prevHoriz, ...horiz],
- [...prevVert, ...vert]
- ];
- },
- [[], []]
- );
- return {
- horizontal,
- vertical
- };
- }
- function getRelativeConstraints(spatialMaps) {
- const relativeConstraints = [];
- const posToStr = /* @__PURE__ */ __name((pos) => `${pos[0]},${pos[1]}`, "posToStr");
- const strToPos = /* @__PURE__ */ __name((pos) => pos.split(",").map((p3) => parseInt(p3)), "strToPos");
- spatialMaps.forEach((spatialMap) => {
- const invSpatialMap = Object.fromEntries(
- Object.entries(spatialMap).map(([id27, pos]) => [posToStr(pos), id27])
- );
- const queue = [posToStr([0, 0])];
- const visited = {};
- const directions = {
- L: [-1, 0],
- R: [1, 0],
- T: [0, 1],
- B: [0, -1]
- };
- while (queue.length > 0) {
- const curr = queue.shift();
- if (curr) {
- visited[curr] = 1;
- const currId = invSpatialMap[curr];
- if (currId) {
- const currPos = strToPos(curr);
- Object.entries(directions).forEach(([dir2, shift2]) => {
- const newPos = posToStr([currPos[0] + shift2[0], currPos[1] + shift2[1]]);
- const newId2 = invSpatialMap[newPos];
- if (newId2 && !visited[newPos]) {
- queue.push(newPos);
- relativeConstraints.push({
- [ArchitectureDirectionName[dir2]]: newId2,
- [ArchitectureDirectionName[getOppositeArchitectureDirection(dir2)]]: currId,
- gap: 1.5 * getConfigField("iconSize")
- });
- }
- });
- }
- }
- }
- });
- return relativeConstraints;
- }
- function layoutArchitecture(services, junctions, groups, edges5, { spatialMaps }) {
- return new Promise((resolve3) => {
- const renderEl = select_default2("body").append("div").attr("id", "cy").attr("style", "display:none");
- const cy = cytoscape2({
- container: document.getElementById("cy"),
- style: [
- {
- selector: "edge",
- style: {
- "curve-style": "straight",
- label: "data(label)",
- "source-endpoint": "data(sourceEndpoint)",
- "target-endpoint": "data(targetEndpoint)"
- }
- },
- {
- selector: "edge.segments",
- style: {
- "curve-style": "segments",
- "segment-weights": "0",
- "segment-distances": [0.5],
- // @ts-ignore Incorrect library types
- "edge-distances": "endpoints",
- "source-endpoint": "data(sourceEndpoint)",
- "target-endpoint": "data(targetEndpoint)"
- }
- },
- {
- selector: "node",
- style: {
- // @ts-ignore Incorrect library types
- "compound-sizing-wrt-labels": "include"
- }
- },
- {
- selector: "node[label]",
- style: {
- "text-valign": "bottom",
- "text-halign": "center",
- "font-size": `${getConfigField("fontSize")}px`
- }
- },
- {
- selector: ".node-service",
- style: {
- label: "data(label)",
- width: "data(width)",
- height: "data(height)"
- }
- },
- {
- selector: ".node-junction",
- style: {
- width: "data(width)",
- height: "data(height)"
- }
- },
- {
- selector: ".node-group",
- style: {
- // @ts-ignore Incorrect library types
- padding: `${getConfigField("padding")}px`
- }
- }
- ]
- });
- renderEl.remove();
- addGroups(groups, cy);
- addServices(services, cy);
- addJunctions(junctions, cy);
- addEdges(edges5, cy);
- const alignmentConstraint = getAlignments(spatialMaps);
- const relativePlacementConstraint = getRelativeConstraints(spatialMaps);
- const layout6 = cy.layout({
- name: "fcose",
- quality: "proof",
- styleEnabled: false,
- animate: false,
- nodeDimensionsIncludeLabels: false,
- // Adjust the edge parameters if it passes through the border of a group
- // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67
- idealEdgeLength(edge) {
- const [nodeA, nodeB] = edge.connectedNodes();
- const { parent: parentA } = nodeData(nodeA);
- const { parent: parentB } = nodeData(nodeB);
- const elasticity = parentA === parentB ? 1.5 * getConfigField("iconSize") : 0.5 * getConfigField("iconSize");
- return elasticity;
- },
- edgeElasticity(edge) {
- const [nodeA, nodeB] = edge.connectedNodes();
- const { parent: parentA } = nodeData(nodeA);
- const { parent: parentB } = nodeData(nodeB);
- const elasticity = parentA === parentB ? 0.45 : 1e-3;
- return elasticity;
- },
- alignmentConstraint,
- relativePlacementConstraint
- });
- layout6.one("layoutstop", () => {
- function getSegmentWeights(source, target, pointX, pointY) {
- let W2, D3;
- const { x: sX, y: sY } = source;
- const { x: tX, y: tY } = target;
- D3 = (pointY - sY + (sX - pointX) * (sY - tY) / (sX - tX)) / Math.sqrt(1 + Math.pow((sY - tY) / (sX - tX), 2));
- W2 = Math.sqrt(Math.pow(pointY - sY, 2) + Math.pow(pointX - sX, 2) - Math.pow(D3, 2));
- const distAB = Math.sqrt(Math.pow(tX - sX, 2) + Math.pow(tY - sY, 2));
- W2 = W2 / distAB;
- let delta1 = (tX - sX) * (pointY - sY) - (tY - sY) * (pointX - sX);
- switch (true) {
- case delta1 >= 0:
- delta1 = 1;
- break;
- case delta1 < 0:
- delta1 = -1;
- break;
- }
- let delta2 = (tX - sX) * (pointX - sX) + (tY - sY) * (pointY - sY);
- switch (true) {
- case delta2 >= 0:
- delta2 = 1;
- break;
- case delta2 < 0:
- delta2 = -1;
- break;
- }
- D3 = Math.abs(D3) * delta1;
- W2 = W2 * delta2;
- return {
- distances: D3,
- weights: W2
- };
- }
- __name(getSegmentWeights, "getSegmentWeights");
- cy.startBatch();
- for (const edge of Object.values(cy.edges())) {
- if (edge.data?.()) {
- const { x: sX, y: sY } = edge.source().position();
- const { x: tX, y: tY } = edge.target().position();
- if (sX !== tX && sY !== tY) {
- const sEP = edge.sourceEndpoint();
- const tEP = edge.targetEndpoint();
- const { sourceDir } = edgeData(edge);
- const [pointX, pointY] = isArchitectureDirectionY(sourceDir) ? [sEP.x, tEP.y] : [tEP.x, sEP.y];
- const { weights, distances: distances2 } = getSegmentWeights(sEP, tEP, pointX, pointY);
- edge.style("segment-distances", distances2);
- edge.style("segment-weights", weights);
- }
- }
- }
- cy.endBatch();
- layout6.run();
- });
- layout6.run();
- cy.ready((e3) => {
- log.info("Ready", e3);
- resolve3(cy);
- });
- });
- }
- var import_cytoscape_fcose, draw23, renderer7;
- var init_architectureRenderer = __esm({
- "src/diagrams/architecture/architectureRenderer.ts"() {
- "use strict";
- init_icons();
- init_cytoscape_esm();
- import_cytoscape_fcose = __toESM(require_cytoscape_fcose(), 1);
- init_src32();
- init_logger();
- init_selectSvgElement();
- init_setupGraphViewbox();
- init_architectureDb();
- init_architectureIcons();
- init_architectureTypes();
- init_svgDraw7();
- registerIconPacks([
- {
- name: architectureIcons.prefix,
- icons: architectureIcons
- }
- ]);
- cytoscape2.use(import_cytoscape_fcose.default);
- __name(addServices, "addServices");
- __name(addJunctions, "addJunctions");
- __name(positionNodes2, "positionNodes");
- __name(addGroups, "addGroups");
- __name(addEdges, "addEdges");
- __name(getAlignments, "getAlignments");
- __name(getRelativeConstraints, "getRelativeConstraints");
- __name(layoutArchitecture, "layoutArchitecture");
- draw23 = /* @__PURE__ */ __name(async (text2, id27, _version, diagObj) => {
- const db8 = diagObj.db;
- const services = db8.getServices();
- const junctions = db8.getJunctions();
- const groups = db8.getGroups();
- const edges5 = db8.getEdges();
- const ds = db8.getDataStructures();
- const svg = selectSvgElement(id27);
- const edgesElem = svg.append("g");
- edgesElem.attr("class", "architecture-edges");
- const servicesElem = svg.append("g");
- servicesElem.attr("class", "architecture-services");
- const groupElem = svg.append("g");
- groupElem.attr("class", "architecture-groups");
- await drawServices(db8, servicesElem, services);
- drawJunctions(db8, servicesElem, junctions);
- const cy = await layoutArchitecture(services, junctions, groups, edges5, ds);
- await drawEdges2(edgesElem, cy);
- await drawGroups(groupElem, cy);
- positionNodes2(db8, cy);
- setupGraphViewbox(void 0, svg, getConfigField("padding"), getConfigField("useMaxWidth"));
- }, "draw");
- renderer7 = { draw: draw23 };
- }
- });
-
- // src/diagrams/architecture/architectureDiagram.ts
- var architectureDiagram_exports = {};
- __export(architectureDiagram_exports, {
- diagram: () => diagram23
- });
- var diagram23;
- var init_architectureDiagram = __esm({
- "src/diagrams/architecture/architectureDiagram.ts"() {
- "use strict";
- init_architectureParser();
- init_architectureDb();
- init_architectureStyles();
- init_architectureRenderer();
- diagram23 = {
- parser: parser21,
- db: db7,
- renderer: renderer7,
- styles: architectureStyles_default
- };
- }
- });
-
- // src/mermaid.ts
- var mermaid_exports = {};
- __export(mermaid_exports, {
- default: () => mermaid_default
- });
- init_icons();
- init_esm();
- init_detectType();
-
- // src/diagrams/c4/c4Detector.ts
- var id2 = "c4";
- var detector = /* @__PURE__ */ __name((txt) => {
- return /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(txt);
- }, "detector");
- var loader = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_c4Diagram2(), c4Diagram_exports));
- return { id: id2, diagram: diagram24 };
- }, "loader");
- var plugin = {
- id: id2,
- detector,
- loader
- };
- var c4Detector_default = plugin;
-
- // src/diagrams/flowchart/flowDetector.ts
- var id3 = "flowchart";
- var detector2 = /* @__PURE__ */ __name((txt, config6) => {
- if (config6?.flowchart?.defaultRenderer === "dagre-wrapper" || config6?.flowchart?.defaultRenderer === "elk") {
- return false;
- }
- return /^\s*graph/.test(txt);
- }, "detector");
- var loader2 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports));
- return { id: id3, diagram: diagram24 };
- }, "loader");
- var plugin2 = {
- id: id3,
- detector: detector2,
- loader: loader2
- };
- var flowDetector_default = plugin2;
-
- // src/diagrams/flowchart/flowDetector-v2.ts
- var id4 = "flowchart-v2";
- var detector3 = /* @__PURE__ */ __name((txt, config6) => {
- if (config6?.flowchart?.defaultRenderer === "dagre-d3") {
- return false;
- }
- if (config6?.flowchart?.defaultRenderer === "elk") {
- config6.layout = "elk";
- }
- if (/^\s*graph/.test(txt) && config6?.flowchart?.defaultRenderer === "dagre-wrapper") {
- return true;
- }
- return /^\s*flowchart/.test(txt);
- }, "detector");
- var loader3 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports));
- return { id: id4, diagram: diagram24 };
- }, "loader");
- var plugin3 = {
- id: id4,
- detector: detector3,
- loader: loader3
- };
- var flowDetector_v2_default = plugin3;
-
- // src/diagrams/er/erDetector.ts
- var id5 = "er";
- var detector4 = /* @__PURE__ */ __name((txt) => {
- return /^\s*erDiagram/.test(txt);
- }, "detector");
- var loader4 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_erDiagram2(), erDiagram_exports));
- return { id: id5, diagram: diagram24 };
- }, "loader");
- var plugin4 = {
- id: id5,
- detector: detector4,
- loader: loader4
- };
- var erDetector_default = plugin4;
-
- // src/diagrams/git/gitGraphDetector.ts
- var id6 = "gitGraph";
- var detector5 = /* @__PURE__ */ __name((txt) => {
- return /^\s*gitGraph/.test(txt);
- }, "detector");
- var loader5 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_gitGraphDiagram(), gitGraphDiagram_exports));
- return { id: id6, diagram: diagram24 };
- }, "loader");
- var plugin5 = {
- id: id6,
- detector: detector5,
- loader: loader5
- };
- var gitGraphDetector_default = plugin5;
-
- // src/diagrams/gantt/ganttDetector.ts
- var id7 = "gantt";
- var detector6 = /* @__PURE__ */ __name((txt) => {
- return /^\s*gantt/.test(txt);
- }, "detector");
- var loader6 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_ganttDiagram(), ganttDiagram_exports));
- return { id: id7, diagram: diagram24 };
- }, "loader");
- var plugin6 = {
- id: id7,
- detector: detector6,
- loader: loader6
- };
- var ganttDetector_default = plugin6;
-
- // src/diagrams/info/infoDetector.ts
- var id8 = "info";
- var detector7 = /* @__PURE__ */ __name((txt) => {
- return /^\s*info/.test(txt);
- }, "detector");
- var loader7 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_infoDiagram(), infoDiagram_exports));
- return { id: id8, diagram: diagram24 };
- }, "loader");
- var info = {
- id: id8,
- detector: detector7,
- loader: loader7
- };
-
- // src/diagrams/pie/pieDetector.ts
- var id9 = "pie";
- var detector8 = /* @__PURE__ */ __name((txt) => {
- return /^\s*pie/.test(txt);
- }, "detector");
- var loader8 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_pieDiagram(), pieDiagram_exports));
- return { id: id9, diagram: diagram24 };
- }, "loader");
- var pie = {
- id: id9,
- detector: detector8,
- loader: loader8
- };
-
- // src/diagrams/quadrant-chart/quadrantDetector.ts
- var id10 = "quadrantChart";
- var detector9 = /* @__PURE__ */ __name((txt) => {
- return /^\s*quadrantChart/.test(txt);
- }, "detector");
- var loader9 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_quadrantDiagram(), quadrantDiagram_exports));
- return { id: id10, diagram: diagram24 };
- }, "loader");
- var plugin7 = {
- id: id10,
- detector: detector9,
- loader: loader9
- };
- var quadrantDetector_default = plugin7;
-
- // src/diagrams/xychart/xychartDetector.ts
- var id11 = "xychart";
- var detector10 = /* @__PURE__ */ __name((txt) => {
- return /^\s*xychart-beta/.test(txt);
- }, "detector");
- var loader10 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_xychartDiagram(), xychartDiagram_exports));
- return { id: id11, diagram: diagram24 };
- }, "loader");
- var plugin8 = {
- id: id11,
- detector: detector10,
- loader: loader10
- };
- var xychartDetector_default = plugin8;
-
- // src/diagrams/requirement/requirementDetector.ts
- var id12 = "requirement";
- var detector11 = /* @__PURE__ */ __name((txt) => {
- return /^\s*requirement(Diagram)?/.test(txt);
- }, "detector");
- var loader11 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_requirementDiagram2(), requirementDiagram_exports));
- return { id: id12, diagram: diagram24 };
- }, "loader");
- var plugin9 = {
- id: id12,
- detector: detector11,
- loader: loader11
- };
- var requirementDetector_default = plugin9;
-
- // src/diagrams/sequence/sequenceDetector.ts
- var id13 = "sequence";
- var detector12 = /* @__PURE__ */ __name((txt) => {
- return /^\s*sequenceDiagram/.test(txt);
- }, "detector");
- var loader12 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_sequenceDiagram2(), sequenceDiagram_exports));
- return { id: id13, diagram: diagram24 };
- }, "loader");
- var plugin10 = {
- id: id13,
- detector: detector12,
- loader: loader12
- };
- var sequenceDetector_default = plugin10;
-
- // src/diagrams/class/classDetector.ts
- var id14 = "class";
- var detector13 = /* @__PURE__ */ __name((txt, config6) => {
- if (config6?.class?.defaultRenderer === "dagre-wrapper") {
- return false;
- }
- return /^\s*classDiagram/.test(txt);
- }, "detector");
- var loader13 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_classDiagram2(), classDiagram_exports));
- return { id: id14, diagram: diagram24 };
- }, "loader");
- var plugin11 = {
- id: id14,
- detector: detector13,
- loader: loader13
- };
- var classDetector_default = plugin11;
-
- // src/diagrams/class/classDetector-V2.ts
- var id15 = "classDiagram";
- var detector14 = /* @__PURE__ */ __name((txt, config6) => {
- if (/^\s*classDiagram/.test(txt) && config6?.class?.defaultRenderer === "dagre-wrapper") {
- return true;
- }
- return /^\s*classDiagram-v2/.test(txt);
- }, "detector");
- var loader14 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_classDiagram_v2(), classDiagram_v2_exports));
- return { id: id15, diagram: diagram24 };
- }, "loader");
- var plugin12 = {
- id: id15,
- detector: detector14,
- loader: loader14
- };
- var classDetector_V2_default = plugin12;
-
- // src/diagrams/state/stateDetector.ts
- var id16 = "state";
- var detector15 = /* @__PURE__ */ __name((txt, config6) => {
- if (config6?.state?.defaultRenderer === "dagre-wrapper") {
- return false;
- }
- return /^\s*stateDiagram/.test(txt);
- }, "detector");
- var loader15 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_stateDiagram2(), stateDiagram_exports));
- return { id: id16, diagram: diagram24 };
- }, "loader");
- var plugin13 = {
- id: id16,
- detector: detector15,
- loader: loader15
- };
- var stateDetector_default = plugin13;
-
- // src/diagrams/state/stateDetector-V2.ts
- var id17 = "stateDiagram";
- var detector16 = /* @__PURE__ */ __name((txt, config6) => {
- if (/^\s*stateDiagram-v2/.test(txt)) {
- return true;
- }
- if (/^\s*stateDiagram/.test(txt) && config6?.state?.defaultRenderer === "dagre-wrapper") {
- return true;
- }
- return false;
- }, "detector");
- var loader16 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_stateDiagram_v2(), stateDiagram_v2_exports));
- return { id: id17, diagram: diagram24 };
- }, "loader");
- var plugin14 = {
- id: id17,
- detector: detector16,
- loader: loader16
- };
- var stateDetector_V2_default = plugin14;
-
- // src/diagrams/user-journey/journeyDetector.ts
- var id18 = "journey";
- var detector17 = /* @__PURE__ */ __name((txt) => {
- return /^\s*journey/.test(txt);
- }, "detector");
- var loader17 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_journeyDiagram(), journeyDiagram_exports));
- return { id: id18, diagram: diagram24 };
- }, "loader");
- var plugin15 = {
- id: id18,
- detector: detector17,
- loader: loader17
- };
- var journeyDetector_default = plugin15;
-
- // src/diagrams/error/errorRenderer.ts
- init_logger();
- init_selectSvgElement();
- init_setupGraphViewbox();
- var draw17 = /* @__PURE__ */ __name((_text, id27, version4) => {
- log.debug("rendering svg for syntax error\n");
- const svg = selectSvgElement(id27);
- const g2 = svg.append("g");
- svg.attr("viewBox", "0 0 2412 512");
- configureSvgSize(svg, 100, 512, true);
- g2.append("path").attr("class", "error-icon").attr(
- "d",
- "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"
- );
- g2.append("path").attr("class", "error-icon").attr(
- "d",
- "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"
- );
- g2.append("path").attr("class", "error-icon").attr(
- "d",
- "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"
- );
- g2.append("path").attr("class", "error-icon").attr(
- "d",
- "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"
- );
- g2.append("path").attr("class", "error-icon").attr(
- "d",
- "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"
- );
- g2.append("path").attr("class", "error-icon").attr(
- "d",
- "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"
- );
- g2.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text");
- g2.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${version4}`);
- }, "draw");
- var renderer3 = { draw: draw17 };
- var errorRenderer_default = renderer3;
-
- // src/diagrams/error/errorDiagram.ts
- var diagram17 = {
- db: {},
- renderer: renderer3,
- parser: {
- parse: /* @__PURE__ */ __name(() => {
- return;
- }, "parse")
- }
- };
- var errorDiagram_default = diagram17;
-
- // src/diagrams/flowchart/elk/detector.ts
- var id19 = "flowchart-elk";
- var detector18 = /* @__PURE__ */ __name((txt, config6 = {}) => {
- if (
- // If diagram explicitly states flowchart-elk
- /^\s*flowchart-elk/.test(txt) || // If a flowchart/graph diagram has their default renderer set to elk
- /^\s*flowchart|graph/.test(txt) && config6?.flowchart?.defaultRenderer === "elk"
- ) {
- config6.layout = "elk";
- return true;
- }
- return false;
- }, "detector");
- var loader18 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports));
- return { id: id19, diagram: diagram24 };
- }, "loader");
- var plugin16 = {
- id: id19,
- detector: detector18,
- loader: loader18
- };
- var detector_default = plugin16;
-
- // src/diagrams/timeline/detector.ts
- var id20 = "timeline";
- var detector19 = /* @__PURE__ */ __name((txt) => {
- return /^\s*timeline/.test(txt);
- }, "detector");
- var loader19 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_timeline_definition(), timeline_definition_exports));
- return { id: id20, diagram: diagram24 };
- }, "loader");
- var plugin17 = {
- id: id20,
- detector: detector19,
- loader: loader19
- };
- var detector_default2 = plugin17;
-
- // src/diagrams/mindmap/detector.ts
- var id22 = "mindmap";
- var detector20 = /* @__PURE__ */ __name((txt) => {
- return /^\s*mindmap/.test(txt);
- }, "detector");
- var loader20 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_mindmap_definition(), mindmap_definition_exports));
- return { id: id22, diagram: diagram24 };
- }, "loader");
- var plugin18 = {
- id: id22,
- detector: detector20,
- loader: loader20
- };
- var detector_default3 = plugin18;
-
- // src/diagrams/sankey/sankeyDetector.ts
- var id23 = "sankey";
- var detector21 = /* @__PURE__ */ __name((txt) => {
- return /^\s*sankey-beta/.test(txt);
- }, "detector");
- var loader21 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_sankeyDiagram(), sankeyDiagram_exports));
- return { id: id23, diagram: diagram24 };
- }, "loader");
- var plugin19 = {
- id: id23,
- detector: detector21,
- loader: loader21
- };
- var sankeyDetector_default = plugin19;
-
- // src/diagrams/packet/detector.ts
- var id24 = "packet";
- var detector22 = /* @__PURE__ */ __name((txt) => {
- return /^\s*packet-beta/.test(txt);
- }, "detector");
- var loader22 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_diagram(), diagram_exports));
- return { id: id24, diagram: diagram24 };
- }, "loader");
- var packet = {
- id: id24,
- detector: detector22,
- loader: loader22
- };
-
- // src/diagrams/block/blockDetector.ts
- var id25 = "block";
- var detector23 = /* @__PURE__ */ __name((txt) => {
- return /^\s*block-beta/.test(txt);
- }, "detector");
- var loader23 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_blockDiagram(), blockDiagram_exports));
- return { id: id25, diagram: diagram24 };
- }, "loader");
- var plugin20 = {
- id: id25,
- detector: detector23,
- loader: loader23
- };
- var blockDetector_default = plugin20;
-
- // src/diagrams/architecture/architectureDetector.ts
- var id26 = "architecture";
- var detector24 = /* @__PURE__ */ __name((txt) => {
- return /^\s*architecture/.test(txt);
- }, "detector");
- var loader24 = /* @__PURE__ */ __name(async () => {
- const { diagram: diagram24 } = await Promise.resolve().then(() => (init_architectureDiagram(), architectureDiagram_exports));
- return { id: id26, diagram: diagram24 };
- }, "loader");
- var architecture = {
- id: id26,
- detector: detector24,
- loader: loader24
- };
- var architectureDetector_default = architecture;
-
- // src/diagram-api/diagram-orchestration.ts
- init_detectType();
- init_diagramAPI();
- var hasLoadedDiagrams = false;
- var addDiagrams = /* @__PURE__ */ __name(() => {
- if (hasLoadedDiagrams) {
- return;
- }
- hasLoadedDiagrams = true;
- registerDiagram("error", errorDiagram_default, (text2) => {
- return text2.toLowerCase().trim() === "error";
- });
- registerDiagram(
- "---",
- // --- diagram type may appear if YAML front-matter is not parsed correctly
- {
- db: {
- clear: /* @__PURE__ */ __name(() => {
- }, "clear")
- },
- styles: {},
- // should never be used
- renderer: {
- draw: /* @__PURE__ */ __name(() => {
- }, "draw")
- },
- parser: {
- parse: /* @__PURE__ */ __name(() => {
- throw new Error(
- "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks"
- );
- }, "parse")
- },
- init: /* @__PURE__ */ __name(() => null, "init")
- // no op
- },
- (text2) => {
- return text2.toLowerCase().trimStart().startsWith("---");
- }
- );
- registerLazyLoadedDiagrams(
- c4Detector_default,
- classDetector_V2_default,
- classDetector_default,
- erDetector_default,
- ganttDetector_default,
- info,
- pie,
- requirementDetector_default,
- sequenceDetector_default,
- detector_default,
- flowDetector_v2_default,
- flowDetector_default,
- detector_default3,
- detector_default2,
- gitGraphDetector_default,
- stateDetector_V2_default,
- stateDetector_default,
- journeyDetector_default,
- quadrantDetector_default,
- sankeyDetector_default,
- packet,
- xychartDetector_default,
- blockDetector_default,
- architectureDetector_default
- );
- }, "addDiagrams");
-
- // src/diagram-api/loadDiagram.ts
- init_logger();
- init_detectType();
- init_diagramAPI();
- var loadRegisteredDiagrams = /* @__PURE__ */ __name(async () => {
- log.debug(`Loading registered diagrams`);
- const results = await Promise.allSettled(
- Object.entries(detectors).map(async ([key, { detector: detector25, loader: loader26 }]) => {
- if (loader26) {
- try {
- getDiagram(key);
- } catch {
- try {
- const { diagram: diagram24, id: id27 } = await loader26();
- registerDiagram(id27, diagram24, detector25);
- } catch (err) {
- log.error(`Failed to load external diagram with key ${key}. Removing from detectors.`);
- delete detectors[key];
- throw err;
- }
- }
- }
- })
- );
- const failed = results.filter((result) => result.status === "rejected");
- if (failed.length > 0) {
- log.error(`Failed to load ${failed.length} external diagrams`);
- for (const res of failed) {
- log.error(res);
- }
- throw new Error(`Failed to load ${failed.length} external diagrams`);
- }
- }, "loadRegisteredDiagrams");
-
- // src/mermaid.ts
- init_logger();
-
- // src/mermaidAPI.ts
- init_src32();
-
- // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Enum.js
- var COMMENT = "comm";
- var RULESET = "rule";
- var DECLARATION = "decl";
- var IMPORT = "@import";
- var KEYFRAMES = "@keyframes";
- var LAYER = "@layer";
-
- // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Utility.js
- var abs3 = Math.abs;
- var from = String.fromCharCode;
- function trim(value2) {
- return value2.trim();
- }
- __name(trim, "trim");
- function replace(value2, pattern, replacement) {
- return value2.replace(pattern, replacement);
- }
- __name(replace, "replace");
- function indexof(value2, search, position5) {
- return value2.indexOf(search, position5);
- }
- __name(indexof, "indexof");
- function charat(value2, index) {
- return value2.charCodeAt(index) | 0;
- }
- __name(charat, "charat");
- function substr(value2, begin, end2) {
- return value2.slice(begin, end2);
- }
- __name(substr, "substr");
- function strlen(value2) {
- return value2.length;
- }
- __name(strlen, "strlen");
- function sizeof(value2) {
- return value2.length;
- }
- __name(sizeof, "sizeof");
- function append2(value2, array4) {
- return array4.push(value2), value2;
- }
- __name(append2, "append");
-
- // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Tokenizer.js
- var line = 1;
- var column = 1;
- var length = 0;
- var position4 = 0;
- var character = 0;
- var characters = "";
- function node(value2, root4, parent4, type3, props, children2, length2, siblings2) {
- return { value: value2, root: root4, parent: parent4, type: type3, props, children: children2, line, column, length: length2, return: "", siblings: siblings2 };
- }
- __name(node, "node");
- function char() {
- return character;
- }
- __name(char, "char");
- function prev() {
- character = position4 > 0 ? charat(characters, --position4) : 0;
- if (column--, character === 10)
- column = 1, line--;
- return character;
- }
- __name(prev, "prev");
- function next2() {
- character = position4 < length ? charat(characters, position4++) : 0;
- if (column++, character === 10)
- column = 1, line++;
- return character;
- }
- __name(next2, "next");
- function peek() {
- return charat(characters, position4);
- }
- __name(peek, "peek");
- function caret2() {
- return position4;
- }
- __name(caret2, "caret");
- function slice4(begin, end2) {
- return substr(characters, begin, end2);
- }
- __name(slice4, "slice");
- function token(type3) {
- switch (type3) {
- case 0:
- case 9:
- case 10:
- case 13:
- case 32:
- return 5;
- case 33:
- case 43:
- case 44:
- case 47:
- case 62:
- case 64:
- case 126:
- case 59:
- case 123:
- case 125:
- return 4;
- case 58:
- return 3;
- case 34:
- case 39:
- case 40:
- case 91:
- return 2;
- case 41:
- case 93:
- return 1;
- }
- return 0;
- }
- __name(token, "token");
- function alloc(value2) {
- return line = column = 1, length = strlen(characters = value2), position4 = 0, [];
- }
- __name(alloc, "alloc");
- function dealloc(value2) {
- return characters = "", value2;
- }
- __name(dealloc, "dealloc");
- function delimit(type3) {
- return trim(slice4(position4 - 1, delimiter2(type3 === 91 ? type3 + 2 : type3 === 40 ? type3 + 1 : type3)));
- }
- __name(delimit, "delimit");
- function whitespace(type3) {
- while (character = peek())
- if (character < 33)
- next2();
- else
- break;
- return token(type3) > 2 || token(character) > 3 ? "" : " ";
- }
- __name(whitespace, "whitespace");
- function escaping(index, count) {
- while (--count && next2())
- if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
- break;
- return slice4(index, caret2() + (count < 6 && peek() == 32 && next2() == 32));
- }
- __name(escaping, "escaping");
- function delimiter2(type3) {
- while (next2())
- switch (character) {
- case type3:
- return position4;
- case 34:
- case 39:
- if (type3 !== 34 && type3 !== 39)
- delimiter2(character);
- break;
- case 40:
- if (type3 === 41)
- delimiter2(type3);
- break;
- case 92:
- next2();
- break;
- }
- return position4;
- }
- __name(delimiter2, "delimiter");
- function commenter(type3, index) {
- while (next2())
- if (type3 + character === 47 + 10)
- break;
- else if (type3 + character === 42 + 42 && peek() === 47)
- break;
- return "/*" + slice4(index, position4 - 1) + "*" + from(type3 === 47 ? type3 : next2());
- }
- __name(commenter, "commenter");
- function identifier(index) {
- while (!token(peek()))
- next2();
- return slice4(index, position4);
- }
- __name(identifier, "identifier");
-
- // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Parser.js
- function compile(value2) {
- return dealloc(parse5("", null, null, null, [""], value2 = alloc(value2), 0, [0], value2));
- }
- __name(compile, "compile");
- function parse5(value2, root4, parent4, rule, rules, rulesets, pseudo, points, declarations) {
- var index = 0;
- var offset = 0;
- var length2 = pseudo;
- var atrule = 0;
- var property2 = 0;
- var previous = 0;
- var variable = 1;
- var scanning = 1;
- var ampersand = 1;
- var character2 = 0;
- var type3 = "";
- var props = rules;
- var children2 = rulesets;
- var reference = rule;
- var characters2 = type3;
- while (scanning)
- switch (previous = character2, character2 = next2()) {
- case 40:
- if (previous != 108 && charat(characters2, length2 - 1) == 58) {
- if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs3(index ? points[index - 1] : 0)) != -1)
- ampersand = -1;
- break;
- }
- case 34:
- case 39:
- case 91:
- characters2 += delimit(character2);
- break;
- case 9:
- case 10:
- case 13:
- case 32:
- characters2 += whitespace(previous);
- break;
- case 92:
- characters2 += escaping(caret2() - 1, 7);
- continue;
- case 47:
- switch (peek()) {
- case 42:
- case 47:
- append2(comment(commenter(next2(), caret2()), root4, parent4, declarations), declarations);
- if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters2) && substr(characters2, -1, void 0) !== " ") characters2 += " ";
- break;
- default:
- characters2 += "/";
- }
- break;
- case 123 * variable:
- points[index++] = strlen(characters2) * ampersand;
- case 125 * variable:
- case 59:
- case 0:
- switch (character2) {
- case 0:
- case 125:
- scanning = 0;
- case 59 + offset:
- if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
- if (property2 > 0 && (strlen(characters2) - length2 || variable === 0 && previous === 47))
- append2(property2 > 32 ? declaration(characters2 + ";", rule, parent4, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent4, length2 - 2, declarations), declarations);
- break;
- case 59:
- characters2 += ";";
- default:
- append2(reference = ruleset(characters2, root4, parent4, index, offset, rules, points, type3, props = [], children2 = [], length2, rulesets), rulesets);
- if (character2 === 123)
- if (offset === 0)
- parse5(characters2, root4, reference, reference, props, rulesets, length2, points, children2);
- else
- switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
- case 100:
- case 108:
- case 109:
- case 115:
- parse5(value2, reference, reference, rule && append2(ruleset(value2, reference, reference, 0, 0, rules, points, type3, rules, props = [], length2, children2), children2), rules, children2, length2, points, rule ? props : children2);
- break;
- default:
- parse5(characters2, reference, reference, reference, [""], children2, 0, points, children2);
- }
- }
- index = offset = property2 = 0, variable = ampersand = 1, type3 = characters2 = "", length2 = pseudo;
- break;
- case 58:
- length2 = 1 + strlen(characters2), property2 = previous;
- default:
- if (variable < 1) {
- if (character2 == 123)
- --variable;
- else if (character2 == 125 && variable++ == 0 && prev() == 125)
- continue;
- }
- switch (characters2 += from(character2), character2 * variable) {
- case 38:
- ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
- break;
- case 44:
- points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
- break;
- case 64:
- if (peek() === 45)
- characters2 += delimit(next2());
- atrule = peek(), offset = length2 = strlen(type3 = characters2 += identifier(caret2())), character2++;
- break;
- case 45:
- if (previous === 45 && strlen(characters2) == 2)
- variable = 0;
- }
- }
- return rulesets;
- }
- __name(parse5, "parse");
- function ruleset(value2, root4, parent4, index, offset, rules, points, type3, props, children2, length2, siblings2) {
- var post = offset - 1;
- var rule = offset === 0 ? rules : [""];
- var size5 = sizeof(rule);
- for (var i2 = 0, j2 = 0, k2 = 0; i2 < index; ++i2)
- for (var x5 = 0, y5 = substr(value2, post + 1, post = abs3(j2 = points[i2])), z2 = value2; x5 < size5; ++x5)
- if (z2 = trim(j2 > 0 ? rule[x5] + " " + y5 : replace(y5, /&\f/g, rule[x5])))
- props[k2++] = z2;
- return node(value2, root4, parent4, offset === 0 ? RULESET : type3, props, children2, length2, siblings2);
- }
- __name(ruleset, "ruleset");
- function comment(value2, root4, parent4, siblings2) {
- return node(value2, root4, parent4, COMMENT, from(char()), substr(value2, 2, -2), 0, siblings2);
- }
- __name(comment, "comment");
- function declaration(value2, root4, parent4, length2, siblings2) {
- return node(value2, root4, parent4, DECLARATION, substr(value2, 0, length2), substr(value2, length2 + 1, -1), length2, siblings2);
- }
- __name(declaration, "declaration");
-
- // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Serializer.js
- function serialize(children2, callback) {
- var output2 = "";
- for (var i2 = 0; i2 < children2.length; i2++)
- output2 += callback(children2[i2], i2, children2, callback) || "";
- return output2;
- }
- __name(serialize, "serialize");
- function stringify(element3, index, children2, callback) {
- switch (element3.type) {
- case LAYER:
- if (element3.children.length) break;
- case IMPORT:
- case DECLARATION:
- return element3.return = element3.return || element3.value;
- case COMMENT:
- return "";
- case KEYFRAMES:
- return element3.return = element3.value + "{" + serialize(element3.children, callback) + "}";
- case RULESET:
- if (!strlen(element3.value = element3.props.join(","))) return "";
- }
- return strlen(children2 = serialize(element3.children, callback)) ? element3.return = element3.value + "{" + children2 + "}" : "";
- }
- __name(stringify, "stringify");
-
- // src/mermaidAPI.ts
- var import_dompurify2 = __toESM(require_purify(), 1);
- init_isEmpty();
- init_package();
-
- // src/accessibility.ts
- var SVG_ROLE = "graphics-document document";
- function setA11yDiagramInfo(svg, diagramType) {
- svg.attr("role", SVG_ROLE);
- if (diagramType !== "") {
- svg.attr("aria-roledescription", diagramType);
- }
- }
- __name(setA11yDiagramInfo, "setA11yDiagramInfo");
- function addSVGa11yTitleDescription(svg, a11yTitle, a11yDesc, baseId) {
- if (svg.insert === void 0) {
- return;
- }
- if (a11yDesc) {
- const descId = `chart-desc-${baseId}`;
- svg.attr("aria-describedby", descId);
- svg.insert("desc", ":first-child").attr("id", descId).text(a11yDesc);
- }
- if (a11yTitle) {
- const titleId = `chart-title-${baseId}`;
- svg.attr("aria-labelledby", titleId);
- svg.insert("title", ":first-child").attr("id", titleId).text(a11yTitle);
- }
- }
- __name(addSVGa11yTitleDescription, "addSVGa11yTitleDescription");
-
- // src/mermaidAPI.ts
- init_assignWithDepth();
- init_config();
-
- // src/Diagram.ts
- init_config();
- init_diagramAPI();
- init_detectType();
- init_errors();
- init_utils2();
- var Diagram = class _Diagram {
- constructor(type3, text2, db8, parser22, renderer8) {
- this.type = type3;
- this.text = text2;
- this.db = db8;
- this.parser = parser22;
- this.renderer = renderer8;
- }
- static {
- __name(this, "Diagram");
- }
- static async fromText(text2, metadata = {}) {
- const config6 = getConfig();
- const type3 = detectType(text2, config6);
- text2 = encodeEntities(text2) + "\n";
- try {
- getDiagram(type3);
- } catch {
- const loader26 = getDiagramLoader(type3);
- if (!loader26) {
- throw new UnknownDiagramError(`Diagram ${type3} not found.`);
- }
- const { id: id27, diagram: diagram24 } = await loader26();
- registerDiagram(id27, diagram24);
- }
- const { db: db8, parser: parser22, renderer: renderer8, init: init3 } = getDiagram(type3);
- if (parser22.parser) {
- parser22.parser.yy = db8;
- }
- db8.clear?.();
- init3?.(config6);
- if (metadata.title) {
- db8.setDiagramTitle?.(metadata.title);
- }
- await parser22.parse(text2);
- return new _Diagram(type3, text2, db8, parser22, renderer8);
- }
- async render(id27, version4) {
- await this.renderer.draw(this.text, id27, version4, this);
- }
- getParser() {
- return this.parser;
- }
- getType() {
- return this.type;
- }
- };
-
- // src/mermaidAPI.ts
- init_common();
-
- // src/interactionDb.ts
- var interactionFunctions = [];
- var attachFunctions = /* @__PURE__ */ __name(() => {
- interactionFunctions.forEach((f3) => {
- f3();
- });
- interactionFunctions = [];
- }, "attachFunctions");
-
- // src/mermaidAPI.ts
- init_logger();
-
- // src/diagram-api/comments.ts
- var cleanupComments = /* @__PURE__ */ __name((text2) => {
- return text2.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart();
- }, "cleanupComments");
-
- // src/diagram-api/frontmatter.ts
- init_regexes();
-
- // ../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs
- function isNothing(subject) {
- return typeof subject === "undefined" || subject === null;
- }
- __name(isNothing, "isNothing");
- function isObject3(subject) {
- return typeof subject === "object" && subject !== null;
- }
- __name(isObject3, "isObject");
- function toArray2(sequence) {
- if (Array.isArray(sequence)) return sequence;
- else if (isNothing(sequence)) return [];
- return [sequence];
- }
- __name(toArray2, "toArray");
- function extend3(target, source) {
- var index, length2, key, sourceKeys;
- if (source) {
- sourceKeys = Object.keys(source);
- for (index = 0, length2 = sourceKeys.length; index < length2; index += 1) {
- key = sourceKeys[index];
- target[key] = source[key];
- }
- }
- return target;
- }
- __name(extend3, "extend");
- function repeat(string3, count) {
- var result = "", cycle;
- for (cycle = 0; cycle < count; cycle += 1) {
- result += string3;
- }
- return result;
- }
- __name(repeat, "repeat");
- function isNegativeZero(number7) {
- return number7 === 0 && Number.NEGATIVE_INFINITY === 1 / number7;
- }
- __name(isNegativeZero, "isNegativeZero");
- var isNothing_1 = isNothing;
- var isObject_12 = isObject3;
- var toArray_1 = toArray2;
- var repeat_1 = repeat;
- var isNegativeZero_1 = isNegativeZero;
- var extend_1 = extend3;
- var common = {
- isNothing: isNothing_1,
- isObject: isObject_12,
- toArray: toArray_1,
- repeat: repeat_1,
- isNegativeZero: isNegativeZero_1,
- extend: extend_1
- };
- function formatError(exception2, compact2) {
- var where = "", message = exception2.reason || "(unknown reason)";
- if (!exception2.mark) return message;
- if (exception2.mark.name) {
- where += 'in "' + exception2.mark.name + '" ';
- }
- where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
- if (!compact2 && exception2.mark.snippet) {
- where += "\n\n" + exception2.mark.snippet;
- }
- return message + " " + where;
- }
- __name(formatError, "formatError");
- function YAMLException$1(reason, mark) {
- Error.call(this);
- this.name = "YAMLException";
- this.reason = reason;
- this.mark = mark;
- this.message = formatError(this, false);
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
- } else {
- this.stack = new Error().stack || "";
- }
- }
- __name(YAMLException$1, "YAMLException$1");
- YAMLException$1.prototype = Object.create(Error.prototype);
- YAMLException$1.prototype.constructor = YAMLException$1;
- YAMLException$1.prototype.toString = /* @__PURE__ */ __name(function toString5(compact2) {
- return this.name + ": " + formatError(this, compact2);
- }, "toString");
- var exception = YAMLException$1;
- function getLine(buffer, lineStart, lineEnd, position5, maxLineLength) {
- var head2 = "";
- var tail = "";
- var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
- if (position5 - lineStart > maxHalfLength) {
- head2 = " ... ";
- lineStart = position5 - maxHalfLength + head2.length;
- }
- if (lineEnd - position5 > maxHalfLength) {
- tail = " ...";
- lineEnd = position5 + maxHalfLength - tail.length;
- }
- return {
- str: head2 + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
- pos: position5 - lineStart + head2.length
- // relative position
- };
- }
- __name(getLine, "getLine");
- function padStart(string3, max10) {
- return common.repeat(" ", max10 - string3.length) + string3;
- }
- __name(padStart, "padStart");
- function makeSnippet(mark, options3) {
- options3 = Object.create(options3 || null);
- if (!mark.buffer) return null;
- if (!options3.maxLength) options3.maxLength = 79;
- if (typeof options3.indent !== "number") options3.indent = 1;
- if (typeof options3.linesBefore !== "number") options3.linesBefore = 3;
- if (typeof options3.linesAfter !== "number") options3.linesAfter = 2;
- var re2 = /\r?\n|\r|\0/g;
- var lineStarts = [0];
- var lineEnds = [];
- var match2;
- var foundLineNo = -1;
- while (match2 = re2.exec(mark.buffer)) {
- lineEnds.push(match2.index);
- lineStarts.push(match2.index + match2[0].length);
- if (mark.position <= match2.index && foundLineNo < 0) {
- foundLineNo = lineStarts.length - 2;
- }
- }
- if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
- var result = "", i2, line2;
- var lineNoLength = Math.min(mark.line + options3.linesAfter, lineEnds.length).toString().length;
- var maxLineLength = options3.maxLength - (options3.indent + lineNoLength + 3);
- for (i2 = 1; i2 <= options3.linesBefore; i2++) {
- if (foundLineNo - i2 < 0) break;
- line2 = getLine(
- mark.buffer,
- lineStarts[foundLineNo - i2],
- lineEnds[foundLineNo - i2],
- mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i2]),
- maxLineLength
- );
- result = common.repeat(" ", options3.indent) + padStart((mark.line - i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n" + result;
- }
- line2 = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
- result += common.repeat(" ", options3.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
- result += common.repeat("-", options3.indent + lineNoLength + 3 + line2.pos) + "^\n";
- for (i2 = 1; i2 <= options3.linesAfter; i2++) {
- if (foundLineNo + i2 >= lineEnds.length) break;
- line2 = getLine(
- mark.buffer,
- lineStarts[foundLineNo + i2],
- lineEnds[foundLineNo + i2],
- mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i2]),
- maxLineLength
- );
- result += common.repeat(" ", options3.indent) + padStart((mark.line + i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
- }
- return result.replace(/\n$/, "");
- }
- __name(makeSnippet, "makeSnippet");
- var snippet = makeSnippet;
- var TYPE_CONSTRUCTOR_OPTIONS = [
- "kind",
- "multi",
- "resolve",
- "construct",
- "instanceOf",
- "predicate",
- "represent",
- "representName",
- "defaultStyle",
- "styleAliases"
- ];
- var YAML_NODE_KINDS = [
- "scalar",
- "sequence",
- "mapping"
- ];
- function compileStyleAliases(map5) {
- var result = {};
- if (map5 !== null) {
- Object.keys(map5).forEach(function(style3) {
- map5[style3].forEach(function(alias) {
- result[String(alias)] = style3;
- });
+ var __webpack_module_cache__ = {};
+ function __webpack_require__(moduleId) {
+ var cachedModule = __webpack_module_cache__[moduleId];
+ if (cachedModule !== void 0) {
+ return cachedModule.exports;
+ }
+ var module3 = __webpack_module_cache__[moduleId] = {
+ /******/
+ // no module.id needed
+ /******/
+ // no module.loaded needed
+ /******/
+ exports: {}
+ /******/
+ };
+ __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
+ return module3.exports;
+ }
+ __name(__webpack_require__, "__webpack_require__");
+ var __webpack_exports__ = __webpack_require__(45);
+ return __webpack_exports__;
+ })()
+ );
});
}
- return result;
- }
- __name(compileStyleAliases, "compileStyleAliases");
- function Type$1(tag2, options3) {
- options3 = options3 || {};
- Object.keys(options3).forEach(function(name) {
- if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
- throw new exception('Unknown option "' + name + '" is met in definition of "' + tag2 + '" YAML type.');
- }
- });
- this.options = options3;
- this.tag = tag2;
- this.kind = options3["kind"] || null;
- this.resolve = options3["resolve"] || function() {
- return true;
- };
- this.construct = options3["construct"] || function(data5) {
- return data5;
- };
- this.instanceOf = options3["instanceOf"] || null;
- this.predicate = options3["predicate"] || null;
- this.represent = options3["represent"] || null;
- this.representName = options3["representName"] || null;
- this.defaultStyle = options3["defaultStyle"] || null;
- this.multi = options3["multi"] || false;
- this.styleAliases = compileStyleAliases(options3["styleAliases"] || null);
- if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
- throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag2 + '" YAML type.');
- }
- }
- __name(Type$1, "Type$1");
- var type2 = Type$1;
- function compileList(schema2, name) {
- var result = [];
- schema2[name].forEach(function(currentType) {
- var newIndex = result.length;
- result.forEach(function(previousType, previousIndex) {
- if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
- newIndex = previousIndex;
- }
+ });
+
+ // ../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.31.0/node_modules/cytoscape-fcose/cytoscape-fcose.js
+ var require_cytoscape_fcose = __commonJS({
+ "../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.31.0/node_modules/cytoscape-fcose/cytoscape-fcose.js"(exports2, module2) {
+ "use strict";
+ (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) {
+ if (typeof exports2 === "object" && typeof module2 === "object")
+ module2.exports = factory(require_cose_base2());
+ else if (typeof define === "function" && define.amd)
+ define(["cose-base"], factory);
+ else if (typeof exports2 === "object")
+ exports2["cytoscapeFcose"] = factory(require_cose_base2());
+ else
+ root4["cytoscapeFcose"] = factory(root4["coseBase"]);
+ }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE__140__) {
+ return (
+ /******/
+ (() => {
+ "use strict";
+ var __webpack_modules__ = {
+ /***/
+ 658: (
+ /***/
+ (module3) => {
+ module3.exports = Object.assign != null ? Object.assign.bind(Object) : function(tgt) {
+ for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ srcs[_key - 1] = arguments[_key];
+ }
+ srcs.forEach(function(src) {
+ Object.keys(src).forEach(function(k2) {
+ return tgt[k2] = src[k2];
+ });
+ });
+ return tgt;
+ };
+ }
+ ),
+ /***/
+ 548: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var _slicedToArray2 = /* @__PURE__ */ function() {
+ function sliceIterator(arr, i2) {
+ var _arr = [];
+ var _n = true;
+ var _d = false;
+ var _e = void 0;
+ try {
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
+ _arr.push(_s.value);
+ if (i2 && _arr.length === i2) break;
+ }
+ } catch (err) {
+ _d = true;
+ _e = err;
+ } finally {
+ try {
+ if (!_n && _i["return"]) _i["return"]();
+ } finally {
+ if (_d) throw _e;
+ }
+ }
+ return _arr;
+ }
+ __name(sliceIterator, "sliceIterator");
+ return function(arr, i2) {
+ if (Array.isArray(arr)) {
+ return arr;
+ } else if (Symbol.iterator in Object(arr)) {
+ return sliceIterator(arr, i2);
+ } else {
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
+ }
+ };
+ }();
+ var LinkedList = __webpack_require__2(140).layoutBase.LinkedList;
+ var auxiliary = {};
+ auxiliary.getTopMostNodes = function(nodes6) {
+ var nodesMap2 = {};
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ nodesMap2[nodes6[i2].id()] = true;
+ }
+ var roots = nodes6.filter(function(ele, i3) {
+ if (typeof ele === "number") {
+ ele = i3;
+ }
+ var parent4 = ele.parent()[0];
+ while (parent4 != null) {
+ if (nodesMap2[parent4.id()]) {
+ return false;
+ }
+ parent4 = parent4.parent()[0];
+ }
+ return true;
+ });
+ return roots;
+ };
+ auxiliary.connectComponents = function(cy, eles, topMostNodes, dummyNodes) {
+ var queue = new LinkedList();
+ var visited = /* @__PURE__ */ new Set();
+ var visitedTopMostNodes = [];
+ var currentNeighbor = void 0;
+ var minDegreeNode = void 0;
+ var minDegree = void 0;
+ var isConnected = false;
+ var count = 1;
+ var nodesConnectedToDummy = [];
+ var components3 = [];
+ var _loop = /* @__PURE__ */ __name(function _loop2() {
+ var cmpt = cy.collection();
+ components3.push(cmpt);
+ var currentNode = topMostNodes[0];
+ var childrenOfCurrentNode = cy.collection();
+ childrenOfCurrentNode.merge(currentNode).merge(currentNode.descendants().intersection(eles));
+ visitedTopMostNodes.push(currentNode);
+ childrenOfCurrentNode.forEach(function(node2) {
+ queue.push(node2);
+ visited.add(node2);
+ cmpt.merge(node2);
+ });
+ var _loop22 = /* @__PURE__ */ __name(function _loop23() {
+ currentNode = queue.shift();
+ var neighborNodes = cy.collection();
+ currentNode.neighborhood().nodes().forEach(function(node2) {
+ if (eles.intersection(currentNode.edgesWith(node2)).length > 0) {
+ neighborNodes.merge(node2);
+ }
+ });
+ for (var i2 = 0; i2 < neighborNodes.length; i2++) {
+ var neighborNode = neighborNodes[i2];
+ currentNeighbor = topMostNodes.intersection(neighborNode.union(neighborNode.ancestors()));
+ if (currentNeighbor != null && !visited.has(currentNeighbor[0])) {
+ var childrenOfNeighbor = currentNeighbor.union(currentNeighbor.descendants());
+ childrenOfNeighbor.forEach(function(node2) {
+ queue.push(node2);
+ visited.add(node2);
+ cmpt.merge(node2);
+ if (topMostNodes.has(node2)) {
+ visitedTopMostNodes.push(node2);
+ }
+ });
+ }
+ }
+ }, "_loop2");
+ while (queue.length != 0) {
+ _loop22();
+ }
+ cmpt.forEach(function(node2) {
+ eles.intersection(node2.connectedEdges()).forEach(function(e3) {
+ if (cmpt.has(e3.source()) && cmpt.has(e3.target())) {
+ cmpt.merge(e3);
+ }
+ });
+ });
+ if (visitedTopMostNodes.length == topMostNodes.length) {
+ isConnected = true;
+ }
+ if (!isConnected || isConnected && count > 1) {
+ minDegreeNode = visitedTopMostNodes[0];
+ minDegree = minDegreeNode.connectedEdges().length;
+ visitedTopMostNodes.forEach(function(node2) {
+ if (node2.connectedEdges().length < minDegree) {
+ minDegree = node2.connectedEdges().length;
+ minDegreeNode = node2;
+ }
+ });
+ nodesConnectedToDummy.push(minDegreeNode.id());
+ var temp = cy.collection();
+ temp.merge(visitedTopMostNodes[0]);
+ visitedTopMostNodes.forEach(function(node2) {
+ temp.merge(node2);
+ });
+ visitedTopMostNodes = [];
+ topMostNodes = topMostNodes.difference(temp);
+ count++;
+ }
+ }, "_loop");
+ do {
+ _loop();
+ } while (!isConnected);
+ if (dummyNodes) {
+ if (nodesConnectedToDummy.length > 0) {
+ dummyNodes.set("dummy" + (dummyNodes.size + 1), nodesConnectedToDummy);
+ }
+ }
+ return components3;
+ };
+ auxiliary.relocateComponent = function(originalCenter, componentResult, options3) {
+ if (!options3.fixedNodeConstraint) {
+ var minXCoord = Number.POSITIVE_INFINITY;
+ var maxXCoord = Number.NEGATIVE_INFINITY;
+ var minYCoord = Number.POSITIVE_INFINITY;
+ var maxYCoord = Number.NEGATIVE_INFINITY;
+ if (options3.quality == "draft") {
+ var _iteratorNormalCompletion = true;
+ var _didIteratorError = false;
+ var _iteratorError = void 0;
+ try {
+ for (var _iterator = componentResult.nodeIndexes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
+ var _ref = _step.value;
+ var _ref2 = _slicedToArray2(_ref, 2);
+ var key = _ref2[0];
+ var value2 = _ref2[1];
+ var cyNode = options3.cy.getElementById(key);
+ if (cyNode) {
+ var nodeBB = cyNode.boundingBox();
+ var leftX = componentResult.xCoords[value2] - nodeBB.w / 2;
+ var rightX = componentResult.xCoords[value2] + nodeBB.w / 2;
+ var topY = componentResult.yCoords[value2] - nodeBB.h / 2;
+ var bottomY = componentResult.yCoords[value2] + nodeBB.h / 2;
+ if (leftX < minXCoord) minXCoord = leftX;
+ if (rightX > maxXCoord) maxXCoord = rightX;
+ if (topY < minYCoord) minYCoord = topY;
+ if (bottomY > maxYCoord) maxYCoord = bottomY;
+ }
+ }
+ } catch (err) {
+ _didIteratorError = true;
+ _iteratorError = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion && _iterator.return) {
+ _iterator.return();
+ }
+ } finally {
+ if (_didIteratorError) {
+ throw _iteratorError;
+ }
+ }
+ }
+ var diffOnX = originalCenter.x - (maxXCoord + minXCoord) / 2;
+ var diffOnY = originalCenter.y - (maxYCoord + minYCoord) / 2;
+ componentResult.xCoords = componentResult.xCoords.map(function(x5) {
+ return x5 + diffOnX;
+ });
+ componentResult.yCoords = componentResult.yCoords.map(function(y5) {
+ return y5 + diffOnY;
+ });
+ } else {
+ Object.keys(componentResult).forEach(function(item) {
+ var node2 = componentResult[item];
+ var leftX2 = node2.getRect().x;
+ var rightX2 = node2.getRect().x + node2.getRect().width;
+ var topY2 = node2.getRect().y;
+ var bottomY2 = node2.getRect().y + node2.getRect().height;
+ if (leftX2 < minXCoord) minXCoord = leftX2;
+ if (rightX2 > maxXCoord) maxXCoord = rightX2;
+ if (topY2 < minYCoord) minYCoord = topY2;
+ if (bottomY2 > maxYCoord) maxYCoord = bottomY2;
+ });
+ var _diffOnX = originalCenter.x - (maxXCoord + minXCoord) / 2;
+ var _diffOnY = originalCenter.y - (maxYCoord + minYCoord) / 2;
+ Object.keys(componentResult).forEach(function(item) {
+ var node2 = componentResult[item];
+ node2.setCenter(node2.getCenterX() + _diffOnX, node2.getCenterY() + _diffOnY);
+ });
+ }
+ }
+ };
+ auxiliary.calcBoundingBox = function(parentNode, xCoords, yCoords, nodeIndexes) {
+ var left3 = Number.MAX_SAFE_INTEGER;
+ var right3 = Number.MIN_SAFE_INTEGER;
+ var top2 = Number.MAX_SAFE_INTEGER;
+ var bottom2 = Number.MIN_SAFE_INTEGER;
+ var nodeLeft = void 0;
+ var nodeRight = void 0;
+ var nodeTop = void 0;
+ var nodeBottom = void 0;
+ var nodes6 = parentNode.descendants().not(":parent");
+ var s2 = nodes6.length;
+ for (var i2 = 0; i2 < s2; i2++) {
+ var node2 = nodes6[i2];
+ nodeLeft = xCoords[nodeIndexes.get(node2.id())] - node2.width() / 2;
+ nodeRight = xCoords[nodeIndexes.get(node2.id())] + node2.width() / 2;
+ nodeTop = yCoords[nodeIndexes.get(node2.id())] - node2.height() / 2;
+ nodeBottom = yCoords[nodeIndexes.get(node2.id())] + node2.height() / 2;
+ if (left3 > nodeLeft) {
+ left3 = nodeLeft;
+ }
+ if (right3 < nodeRight) {
+ right3 = nodeRight;
+ }
+ if (top2 > nodeTop) {
+ top2 = nodeTop;
+ }
+ if (bottom2 < nodeBottom) {
+ bottom2 = nodeBottom;
+ }
+ }
+ var boundingBox3 = {};
+ boundingBox3.topLeftX = left3;
+ boundingBox3.topLeftY = top2;
+ boundingBox3.width = right3 - left3;
+ boundingBox3.height = bottom2 - top2;
+ return boundingBox3;
+ };
+ auxiliary.calcParentsWithoutChildren = function(cy, eles) {
+ var parentsWithoutChildren = cy.collection();
+ eles.nodes(":parent").forEach(function(parent4) {
+ var check = false;
+ parent4.children().forEach(function(child) {
+ if (child.css("display") != "none") {
+ check = true;
+ }
+ });
+ if (!check) {
+ parentsWithoutChildren.merge(parent4);
+ }
+ });
+ return parentsWithoutChildren;
+ };
+ module3.exports = auxiliary;
+ }
+ ),
+ /***/
+ 816: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var aux = __webpack_require__2(548);
+ var CoSELayout = __webpack_require__2(140).CoSELayout;
+ var CoSENode = __webpack_require__2(140).CoSENode;
+ var PointD = __webpack_require__2(140).layoutBase.PointD;
+ var DimensionD2 = __webpack_require__2(140).layoutBase.DimensionD;
+ var LayoutConstants = __webpack_require__2(140).layoutBase.LayoutConstants;
+ var FDLayoutConstants = __webpack_require__2(140).layoutBase.FDLayoutConstants;
+ var CoSEConstants = __webpack_require__2(140).CoSEConstants;
+ var coseLayout = /* @__PURE__ */ __name(function coseLayout2(options3, spectralResult) {
+ var cy = options3.cy;
+ var eles = options3.eles;
+ var nodes6 = eles.nodes();
+ var edges3 = eles.edges();
+ var nodeIndexes = void 0;
+ var xCoords = void 0;
+ var yCoords = void 0;
+ var idToLNode = {};
+ if (options3.randomize) {
+ nodeIndexes = spectralResult["nodeIndexes"];
+ xCoords = spectralResult["xCoords"];
+ yCoords = spectralResult["yCoords"];
+ }
+ var isFn = /* @__PURE__ */ __name(function isFn2(fn3) {
+ return typeof fn3 === "function";
+ }, "isFn");
+ var optFn = /* @__PURE__ */ __name(function optFn2(opt, ele) {
+ if (isFn(opt)) {
+ return opt(ele);
+ } else {
+ return opt;
+ }
+ }, "optFn");
+ var parentsWithoutChildren = aux.calcParentsWithoutChildren(cy, eles);
+ var processChildrenList = /* @__PURE__ */ __name(function processChildrenList2(parent4, children2, layout6, options4) {
+ var size5 = children2.length;
+ for (var i2 = 0; i2 < size5; i2++) {
+ var theChild = children2[i2];
+ var children_of_children = null;
+ if (theChild.intersection(parentsWithoutChildren).length == 0) {
+ children_of_children = theChild.children();
+ }
+ var theNode = void 0;
+ var dimensions2 = theChild.layoutDimensions({
+ nodeDimensionsIncludeLabels: options4.nodeDimensionsIncludeLabels
+ });
+ if (theChild.outerWidth() != null && theChild.outerHeight() != null) {
+ if (options4.randomize) {
+ if (!theChild.isParent()) {
+ theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(xCoords[nodeIndexes.get(theChild.id())] - dimensions2.w / 2, yCoords[nodeIndexes.get(theChild.id())] - dimensions2.h / 2), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h))));
+ } else {
+ var parentInfo = aux.calcBoundingBox(theChild, xCoords, yCoords, nodeIndexes);
+ if (theChild.intersection(parentsWithoutChildren).length == 0) {
+ theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(parentInfo.topLeftX, parentInfo.topLeftY), new DimensionD2(parentInfo.width, parentInfo.height)));
+ } else {
+ theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(parentInfo.topLeftX, parentInfo.topLeftY), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h))));
+ }
+ }
+ } else {
+ theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(theChild.position("x") - dimensions2.w / 2, theChild.position("y") - dimensions2.h / 2), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h))));
+ }
+ } else {
+ theNode = parent4.add(new CoSENode(this.graphManager));
+ }
+ theNode.id = theChild.data("id");
+ theNode.nodeRepulsion = optFn(options4.nodeRepulsion, theChild);
+ theNode.paddingLeft = parseInt(theChild.css("padding"));
+ theNode.paddingTop = parseInt(theChild.css("padding"));
+ theNode.paddingRight = parseInt(theChild.css("padding"));
+ theNode.paddingBottom = parseInt(theChild.css("padding"));
+ if (options4.nodeDimensionsIncludeLabels) {
+ theNode.labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).w;
+ theNode.labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).h;
+ theNode.labelPosVertical = theChild.css("text-valign");
+ theNode.labelPosHorizontal = theChild.css("text-halign");
+ }
+ idToLNode[theChild.data("id")] = theNode;
+ if (isNaN(theNode.rect.x)) {
+ theNode.rect.x = 0;
+ }
+ if (isNaN(theNode.rect.y)) {
+ theNode.rect.y = 0;
+ }
+ if (children_of_children != null && children_of_children.length > 0) {
+ var theNewGraph = void 0;
+ theNewGraph = layout6.getGraphManager().add(layout6.newGraph(), theNode);
+ processChildrenList2(theNewGraph, children_of_children, layout6, options4);
+ }
+ }
+ }, "processChildrenList");
+ var processEdges = /* @__PURE__ */ __name(function processEdges2(layout6, gm2, edges4) {
+ var idealLengthTotal = 0;
+ var edgeCount3 = 0;
+ for (var i2 = 0; i2 < edges4.length; i2++) {
+ var edge = edges4[i2];
+ var sourceNode = idToLNode[edge.data("source")];
+ var targetNode = idToLNode[edge.data("target")];
+ if (sourceNode && targetNode && sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) {
+ var e1 = gm2.add(layout6.newEdge(), sourceNode, targetNode);
+ e1.id = edge.id();
+ e1.idealLength = optFn(options3.idealEdgeLength, edge);
+ e1.edgeElasticity = optFn(options3.edgeElasticity, edge);
+ idealLengthTotal += e1.idealLength;
+ edgeCount3++;
+ }
+ }
+ if (options3.idealEdgeLength != null) {
+ if (edgeCount3 > 0) CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = idealLengthTotal / edgeCount3;
+ else if (!isFn(options3.idealEdgeLength))
+ CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options3.idealEdgeLength;
+ else
+ CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50;
+ CoSEConstants.MIN_REPULSION_DIST = FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10;
+ CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
+ }
+ }, "processEdges");
+ var processConstraints = /* @__PURE__ */ __name(function processConstraints2(layout6, options4) {
+ if (options4.fixedNodeConstraint) {
+ layout6.constraints["fixedNodeConstraint"] = options4.fixedNodeConstraint;
+ }
+ if (options4.alignmentConstraint) {
+ layout6.constraints["alignmentConstraint"] = options4.alignmentConstraint;
+ }
+ if (options4.relativePlacementConstraint) {
+ layout6.constraints["relativePlacementConstraint"] = options4.relativePlacementConstraint;
+ }
+ }, "processConstraints");
+ if (options3.nestingFactor != null) CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = options3.nestingFactor;
+ if (options3.gravity != null) CoSEConstants.DEFAULT_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = options3.gravity;
+ if (options3.numIter != null) CoSEConstants.MAX_ITERATIONS = FDLayoutConstants.MAX_ITERATIONS = options3.numIter;
+ if (options3.gravityRange != null) CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = options3.gravityRange;
+ if (options3.gravityCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = options3.gravityCompound;
+ if (options3.gravityRangeCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = options3.gravityRangeCompound;
+ if (options3.initialEnergyOnIncremental != null) CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = options3.initialEnergyOnIncremental;
+ if (options3.tilingCompareBy != null) CoSEConstants.TILING_COMPARE_BY = options3.tilingCompareBy;
+ if (options3.quality == "proof") LayoutConstants.QUALITY = 2;
+ else LayoutConstants.QUALITY = 0;
+ CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS = FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = options3.nodeDimensionsIncludeLabels;
+ CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = !options3.randomize;
+ CoSEConstants.ANIMATE = FDLayoutConstants.ANIMATE = LayoutConstants.ANIMATE = options3.animate;
+ CoSEConstants.TILE = options3.tile;
+ CoSEConstants.TILING_PADDING_VERTICAL = typeof options3.tilingPaddingVertical === "function" ? options3.tilingPaddingVertical.call() : options3.tilingPaddingVertical;
+ CoSEConstants.TILING_PADDING_HORIZONTAL = typeof options3.tilingPaddingHorizontal === "function" ? options3.tilingPaddingHorizontal.call() : options3.tilingPaddingHorizontal;
+ CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = true;
+ CoSEConstants.PURE_INCREMENTAL = !options3.randomize;
+ LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = options3.uniformNodeDimensions;
+ if (options3.step == "transformed") {
+ CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true;
+ CoSEConstants.ENFORCE_CONSTRAINTS = false;
+ CoSEConstants.APPLY_LAYOUT = false;
+ }
+ if (options3.step == "enforced") {
+ CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false;
+ CoSEConstants.ENFORCE_CONSTRAINTS = true;
+ CoSEConstants.APPLY_LAYOUT = false;
+ }
+ if (options3.step == "cose") {
+ CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false;
+ CoSEConstants.ENFORCE_CONSTRAINTS = false;
+ CoSEConstants.APPLY_LAYOUT = true;
+ }
+ if (options3.step == "all") {
+ if (options3.randomize) CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true;
+ else CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false;
+ CoSEConstants.ENFORCE_CONSTRAINTS = true;
+ CoSEConstants.APPLY_LAYOUT = true;
+ }
+ if (options3.fixedNodeConstraint || options3.alignmentConstraint || options3.relativePlacementConstraint) {
+ CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false;
+ } else {
+ CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = true;
+ }
+ var coseLayout3 = new CoSELayout();
+ var gm = coseLayout3.newGraphManager();
+ processChildrenList(gm.addRoot(), aux.getTopMostNodes(nodes6), coseLayout3, options3);
+ processEdges(coseLayout3, gm, edges3);
+ processConstraints(coseLayout3, options3);
+ coseLayout3.runLayout();
+ return idToLNode;
+ }, "coseLayout");
+ module3.exports = { coseLayout };
+ }
+ ),
+ /***/
+ 212: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var _createClass2 = /* @__PURE__ */ function() {
+ function defineProperties(target, props) {
+ for (var i2 = 0; i2 < props.length; i2++) {
+ var descriptor = props[i2];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+ __name(defineProperties, "defineProperties");
+ return function(Constructor, protoProps, staticProps) {
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) defineProperties(Constructor, staticProps);
+ return Constructor;
+ };
+ }();
+ function _classCallCheck2(instance2, Constructor) {
+ if (!(instance2 instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
+ __name(_classCallCheck2, "_classCallCheck");
+ var assign7 = __webpack_require__2(658);
+ var aux = __webpack_require__2(548);
+ var _require = __webpack_require__2(657), spectralLayout = _require.spectralLayout;
+ var _require2 = __webpack_require__2(816), coseLayout = _require2.coseLayout;
+ var defaults4 = Object.freeze({
+ // 'draft', 'default' or 'proof'
+ // - 'draft' only applies spectral layout
+ // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate)
+ // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate)
+ quality: "default",
+ // Use random node positions at beginning of layout
+ // if this is set to false, then quality option must be "proof"
+ randomize: true,
+ // Whether or not to animate the layout
+ animate: true,
+ // Duration of animation in ms, if enabled
+ animationDuration: 1e3,
+ // Easing of animation, if enabled
+ animationEasing: void 0,
+ // Fit the viewport to the repositioned nodes
+ fit: true,
+ // Padding around layout
+ padding: 30,
+ // Whether to include labels in node dimensions. Valid in "proof" quality
+ nodeDimensionsIncludeLabels: false,
+ // Whether or not simple nodes (non-compound nodes) are of uniform dimensions
+ uniformNodeDimensions: false,
+ // Whether to pack disconnected components - valid only if randomize: true
+ packComponents: true,
+ // Layout step - all, transformed, enforced, cose - for debug purpose only
+ step: "all",
+ /* spectral layout options */
+ // False for random, true for greedy
+ samplingType: true,
+ // Sample size to construct distance matrix
+ sampleSize: 25,
+ // Separation amount between nodes
+ nodeSeparation: 75,
+ // Power iteration tolerance
+ piTol: 1e-7,
+ /* CoSE layout options */
+ // Node repulsion (non overlapping) multiplier
+ nodeRepulsion: /* @__PURE__ */ __name(function nodeRepulsion4(node2) {
+ return 4500;
+ }, "nodeRepulsion"),
+ // Ideal edge (non nested) length
+ idealEdgeLength: /* @__PURE__ */ __name(function idealEdgeLength2(edge) {
+ return 50;
+ }, "idealEdgeLength"),
+ // Divisor to compute edge forces
+ edgeElasticity: /* @__PURE__ */ __name(function edgeElasticity2(edge) {
+ return 0.45;
+ }, "edgeElasticity"),
+ // Nesting factor (multiplier) to compute ideal edge length for nested edges
+ nestingFactor: 0.1,
+ // Gravity force (constant)
+ gravity: 0.25,
+ // Maximum number of iterations to perform
+ numIter: 2500,
+ // For enabling tiling
+ tile: true,
+ // The function that specifies the criteria for comparing nodes while sorting them during tiling operation.
+ // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set.
+ tilingCompareBy: void 0,
+ // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
+ tilingPaddingVertical: 10,
+ // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
+ tilingPaddingHorizontal: 10,
+ // Gravity range (constant) for compounds
+ gravityRangeCompound: 1.5,
+ // Gravity force (constant) for compounds
+ gravityCompound: 1,
+ // Gravity range (constant)
+ gravityRange: 3.8,
+ // Initial cooling factor for incremental layout
+ initialEnergyOnIncremental: 0.3,
+ /* constraint options */
+ // Fix required nodes to predefined positions
+ // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}]
+ fixedNodeConstraint: void 0,
+ // Align required nodes in vertical/horizontal direction
+ // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']}
+ alignmentConstraint: void 0,
+ // Place two nodes relatively in vertical/horizontal direction
+ // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}]
+ relativePlacementConstraint: void 0,
+ /* layout event callbacks */
+ ready: /* @__PURE__ */ __name(function ready4() {
+ }, "ready"),
+ // on layoutready
+ stop: /* @__PURE__ */ __name(function stop5() {
+ }, "stop")
+ // on layoutstop
+ });
+ var Layout2 = function() {
+ function Layout3(options3) {
+ _classCallCheck2(this, Layout3);
+ this.options = assign7({}, defaults4, options3);
+ }
+ __name(Layout3, "Layout");
+ _createClass2(Layout3, [{
+ key: "run",
+ value: /* @__PURE__ */ __name(function run5() {
+ var layout6 = this;
+ var options3 = this.options;
+ var cy = options3.cy;
+ var eles = options3.eles;
+ var spectralResult = [];
+ var xCoords = void 0;
+ var yCoords = void 0;
+ var coseResult = [];
+ var components3 = void 0;
+ var componentCenters = [];
+ if (options3.fixedNodeConstraint && (!Array.isArray(options3.fixedNodeConstraint) || options3.fixedNodeConstraint.length == 0)) {
+ options3.fixedNodeConstraint = void 0;
+ }
+ if (options3.alignmentConstraint) {
+ if (options3.alignmentConstraint.vertical && (!Array.isArray(options3.alignmentConstraint.vertical) || options3.alignmentConstraint.vertical.length == 0)) {
+ options3.alignmentConstraint.vertical = void 0;
+ }
+ if (options3.alignmentConstraint.horizontal && (!Array.isArray(options3.alignmentConstraint.horizontal) || options3.alignmentConstraint.horizontal.length == 0)) {
+ options3.alignmentConstraint.horizontal = void 0;
+ }
+ }
+ if (options3.relativePlacementConstraint && (!Array.isArray(options3.relativePlacementConstraint) || options3.relativePlacementConstraint.length == 0)) {
+ options3.relativePlacementConstraint = void 0;
+ }
+ var constraintExist = options3.fixedNodeConstraint || options3.alignmentConstraint || options3.relativePlacementConstraint;
+ if (constraintExist) {
+ options3.tile = false;
+ options3.packComponents = false;
+ }
+ var layUtil = void 0;
+ var packingEnabled = false;
+ if (cy.layoutUtilities && options3.packComponents) {
+ layUtil = cy.layoutUtilities("get");
+ if (!layUtil) layUtil = cy.layoutUtilities();
+ packingEnabled = true;
+ }
+ if (eles.nodes().length > 0) {
+ if (!packingEnabled) {
+ var boundingBox3 = options3.eles.boundingBox();
+ componentCenters.push({ x: boundingBox3.x1 + boundingBox3.w / 2, y: boundingBox3.y1 + boundingBox3.h / 2 });
+ if (options3.randomize) {
+ var result = spectralLayout(options3);
+ spectralResult.push(result);
+ }
+ if (options3.quality == "default" || options3.quality == "proof") {
+ coseResult.push(coseLayout(options3, spectralResult[0]));
+ aux.relocateComponent(componentCenters[0], coseResult[0], options3);
+ } else {
+ aux.relocateComponent(componentCenters[0], spectralResult[0], options3);
+ }
+ } else {
+ var topMostNodes = aux.getTopMostNodes(options3.eles.nodes());
+ components3 = aux.connectComponents(cy, options3.eles, topMostNodes);
+ components3.forEach(function(component2) {
+ var boundingBox4 = component2.boundingBox();
+ componentCenters.push({ x: boundingBox4.x1 + boundingBox4.w / 2, y: boundingBox4.y1 + boundingBox4.h / 2 });
+ });
+ if (options3.randomize) {
+ components3.forEach(function(component2) {
+ options3.eles = component2;
+ spectralResult.push(spectralLayout(options3));
+ });
+ }
+ if (options3.quality == "default" || options3.quality == "proof") {
+ var toBeTiledNodes = cy.collection();
+ if (options3.tile) {
+ var nodeIndexes = /* @__PURE__ */ new Map();
+ var _xCoords = [];
+ var _yCoords = [];
+ var count = 0;
+ var tempSpectralResult = { nodeIndexes, xCoords: _xCoords, yCoords: _yCoords };
+ var indexesToBeDeleted = [];
+ components3.forEach(function(component2, index) {
+ if (component2.edges().length == 0) {
+ component2.nodes().forEach(function(node2, i3) {
+ toBeTiledNodes.merge(component2.nodes()[i3]);
+ if (!node2.isParent()) {
+ tempSpectralResult.nodeIndexes.set(component2.nodes()[i3].id(), count++);
+ tempSpectralResult.xCoords.push(component2.nodes()[0].position().x);
+ tempSpectralResult.yCoords.push(component2.nodes()[0].position().y);
+ }
+ });
+ indexesToBeDeleted.push(index);
+ }
+ });
+ if (toBeTiledNodes.length > 1) {
+ var _boundingBox = toBeTiledNodes.boundingBox();
+ componentCenters.push({ x: _boundingBox.x1 + _boundingBox.w / 2, y: _boundingBox.y1 + _boundingBox.h / 2 });
+ components3.push(toBeTiledNodes);
+ spectralResult.push(tempSpectralResult);
+ for (var i2 = indexesToBeDeleted.length - 1; i2 >= 0; i2--) {
+ components3.splice(indexesToBeDeleted[i2], 1);
+ spectralResult.splice(indexesToBeDeleted[i2], 1);
+ componentCenters.splice(indexesToBeDeleted[i2], 1);
+ }
+ ;
+ }
+ }
+ components3.forEach(function(component2, index) {
+ options3.eles = component2;
+ coseResult.push(coseLayout(options3, spectralResult[index]));
+ aux.relocateComponent(componentCenters[index], coseResult[index], options3);
+ });
+ } else {
+ components3.forEach(function(component2, index) {
+ aux.relocateComponent(componentCenters[index], spectralResult[index], options3);
+ });
+ }
+ var componentsEvaluated = /* @__PURE__ */ new Set();
+ if (components3.length > 1) {
+ var subgraphs = [];
+ var hiddenEles = eles.filter(function(ele) {
+ return ele.css("display") == "none";
+ });
+ components3.forEach(function(component2, index) {
+ var nodeIndexes2 = void 0;
+ if (options3.quality == "draft") {
+ nodeIndexes2 = spectralResult[index].nodeIndexes;
+ }
+ if (component2.nodes().not(hiddenEles).length > 0) {
+ var subgraph = {};
+ subgraph.edges = [];
+ subgraph.nodes = [];
+ var nodeIndex = void 0;
+ component2.nodes().not(hiddenEles).forEach(function(node2) {
+ if (options3.quality == "draft") {
+ if (!node2.isParent()) {
+ nodeIndex = nodeIndexes2.get(node2.id());
+ subgraph.nodes.push({ x: spectralResult[index].xCoords[nodeIndex] - node2.boundingbox().w / 2, y: spectralResult[index].yCoords[nodeIndex] - node2.boundingbox().h / 2, width: node2.boundingbox().w, height: node2.boundingbox().h });
+ } else {
+ var parentInfo = aux.calcBoundingBox(node2, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2);
+ subgraph.nodes.push({ x: parentInfo.topLeftX, y: parentInfo.topLeftY, width: parentInfo.width, height: parentInfo.height });
+ }
+ } else {
+ if (coseResult[index][node2.id()]) {
+ subgraph.nodes.push({ x: coseResult[index][node2.id()].getLeft(), y: coseResult[index][node2.id()].getTop(), width: coseResult[index][node2.id()].getWidth(), height: coseResult[index][node2.id()].getHeight() });
+ }
+ }
+ });
+ component2.edges().forEach(function(edge) {
+ var source = edge.source();
+ var target = edge.target();
+ if (source.css("display") != "none" && target.css("display") != "none") {
+ if (options3.quality == "draft") {
+ var sourceNodeIndex = nodeIndexes2.get(source.id());
+ var targetNodeIndex = nodeIndexes2.get(target.id());
+ var sourceCenter = [];
+ var targetCenter = [];
+ if (source.isParent()) {
+ var parentInfo = aux.calcBoundingBox(source, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2);
+ sourceCenter.push(parentInfo.topLeftX + parentInfo.width / 2);
+ sourceCenter.push(parentInfo.topLeftY + parentInfo.height / 2);
+ } else {
+ sourceCenter.push(spectralResult[index].xCoords[sourceNodeIndex]);
+ sourceCenter.push(spectralResult[index].yCoords[sourceNodeIndex]);
+ }
+ if (target.isParent()) {
+ var _parentInfo = aux.calcBoundingBox(target, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2);
+ targetCenter.push(_parentInfo.topLeftX + _parentInfo.width / 2);
+ targetCenter.push(_parentInfo.topLeftY + _parentInfo.height / 2);
+ } else {
+ targetCenter.push(spectralResult[index].xCoords[targetNodeIndex]);
+ targetCenter.push(spectralResult[index].yCoords[targetNodeIndex]);
+ }
+ subgraph.edges.push({ startX: sourceCenter[0], startY: sourceCenter[1], endX: targetCenter[0], endY: targetCenter[1] });
+ } else {
+ if (coseResult[index][source.id()] && coseResult[index][target.id()]) {
+ subgraph.edges.push({ startX: coseResult[index][source.id()].getCenterX(), startY: coseResult[index][source.id()].getCenterY(), endX: coseResult[index][target.id()].getCenterX(), endY: coseResult[index][target.id()].getCenterY() });
+ }
+ }
+ }
+ });
+ if (subgraph.nodes.length > 0) {
+ subgraphs.push(subgraph);
+ componentsEvaluated.add(index);
+ }
+ }
+ });
+ var shiftResult = layUtil.packComponents(subgraphs, options3.randomize).shifts;
+ if (options3.quality == "draft") {
+ spectralResult.forEach(function(result2, index) {
+ var newXCoords = result2.xCoords.map(function(x5) {
+ return x5 + shiftResult[index].dx;
+ });
+ var newYCoords = result2.yCoords.map(function(y5) {
+ return y5 + shiftResult[index].dy;
+ });
+ result2.xCoords = newXCoords;
+ result2.yCoords = newYCoords;
+ });
+ } else {
+ var _count = 0;
+ componentsEvaluated.forEach(function(index) {
+ Object.keys(coseResult[index]).forEach(function(item) {
+ var nodeRectangle = coseResult[index][item];
+ nodeRectangle.setCenter(nodeRectangle.getCenterX() + shiftResult[_count].dx, nodeRectangle.getCenterY() + shiftResult[_count].dy);
+ });
+ _count++;
+ });
+ }
+ }
+ }
+ }
+ var getPositions = /* @__PURE__ */ __name(function getPositions2(ele, i3) {
+ if (options3.quality == "default" || options3.quality == "proof") {
+ if (typeof ele === "number") {
+ ele = i3;
+ }
+ var pos = void 0;
+ var node2 = void 0;
+ var theId = ele.data("id");
+ coseResult.forEach(function(result2) {
+ if (theId in result2) {
+ pos = { x: result2[theId].getRect().getCenterX(), y: result2[theId].getRect().getCenterY() };
+ node2 = result2[theId];
+ }
+ });
+ if (options3.nodeDimensionsIncludeLabels) {
+ if (node2.labelWidth) {
+ if (node2.labelPosHorizontal == "left") {
+ pos.x += node2.labelWidth / 2;
+ } else if (node2.labelPosHorizontal == "right") {
+ pos.x -= node2.labelWidth / 2;
+ }
+ }
+ if (node2.labelHeight) {
+ if (node2.labelPosVertical == "top") {
+ pos.y += node2.labelHeight / 2;
+ } else if (node2.labelPosVertical == "bottom") {
+ pos.y -= node2.labelHeight / 2;
+ }
+ }
+ }
+ if (pos == void 0) pos = { x: ele.position("x"), y: ele.position("y") };
+ return {
+ x: pos.x,
+ y: pos.y
+ };
+ } else {
+ var _pos = void 0;
+ spectralResult.forEach(function(result2) {
+ var index = result2.nodeIndexes.get(ele.id());
+ if (index != void 0) {
+ _pos = { x: result2.xCoords[index], y: result2.yCoords[index] };
+ }
+ });
+ if (_pos == void 0) _pos = { x: ele.position("x"), y: ele.position("y") };
+ return {
+ x: _pos.x,
+ y: _pos.y
+ };
+ }
+ }, "getPositions");
+ if (options3.quality == "default" || options3.quality == "proof" || options3.randomize) {
+ var parentsWithoutChildren = aux.calcParentsWithoutChildren(cy, eles);
+ var _hiddenEles = eles.filter(function(ele) {
+ return ele.css("display") == "none";
+ });
+ options3.eles = eles.not(_hiddenEles);
+ eles.nodes().not(":parent").not(_hiddenEles).layoutPositions(layout6, options3, getPositions);
+ if (parentsWithoutChildren.length > 0) {
+ parentsWithoutChildren.forEach(function(ele) {
+ ele.position(getPositions(ele));
+ });
+ }
+ } else {
+ console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
+ }
+ }, "run")
+ }]);
+ return Layout3;
+ }();
+ module3.exports = Layout2;
+ }
+ ),
+ /***/
+ 657: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var aux = __webpack_require__2(548);
+ var Matrix = __webpack_require__2(140).layoutBase.Matrix;
+ var SVD = __webpack_require__2(140).layoutBase.SVD;
+ var spectralLayout = /* @__PURE__ */ __name(function spectralLayout2(options3) {
+ var cy = options3.cy;
+ var eles = options3.eles;
+ var nodes6 = eles.nodes();
+ var parentNodes = eles.nodes(":parent");
+ var dummyNodes = /* @__PURE__ */ new Map();
+ var nodeIndexes = /* @__PURE__ */ new Map();
+ var parentChildMap = /* @__PURE__ */ new Map();
+ var allNodesNeighborhood = [];
+ var xCoords = [];
+ var yCoords = [];
+ var samplesColumn = [];
+ var minDistancesColumn = [];
+ var C2 = [];
+ var PHI = [];
+ var INV = [];
+ var firstSample = void 0;
+ var nodeSize = void 0;
+ var infinity = 1e8;
+ var small = 1e-9;
+ var piTol = options3.piTol;
+ var samplingType = options3.samplingType;
+ var nodeSeparation = options3.nodeSeparation;
+ var sampleSize = void 0;
+ var randomSampleCR = /* @__PURE__ */ __name(function randomSampleCR2() {
+ var sample2 = 0;
+ var count = 0;
+ var flag = false;
+ while (count < sampleSize) {
+ sample2 = Math.floor(Math.random() * nodeSize);
+ flag = false;
+ for (var i3 = 0; i3 < count; i3++) {
+ if (samplesColumn[i3] == sample2) {
+ flag = true;
+ break;
+ }
+ }
+ if (!flag) {
+ samplesColumn[count] = sample2;
+ count++;
+ } else {
+ continue;
+ }
+ }
+ }, "randomSampleCR");
+ var BFS = /* @__PURE__ */ __name(function BFS2(pivot, index2, samplingMethod) {
+ var path4 = [];
+ var front = 0;
+ var back = 0;
+ var current = 0;
+ var temp = void 0;
+ var distance2 = [];
+ var max_dist = 0;
+ var max_ind = 1;
+ for (var i3 = 0; i3 < nodeSize; i3++) {
+ distance2[i3] = infinity;
+ }
+ path4[back] = pivot;
+ distance2[pivot] = 0;
+ while (back >= front) {
+ current = path4[front++];
+ var neighbors = allNodesNeighborhood[current];
+ for (var _i = 0; _i < neighbors.length; _i++) {
+ temp = nodeIndexes.get(neighbors[_i]);
+ if (distance2[temp] == infinity) {
+ distance2[temp] = distance2[current] + 1;
+ path4[++back] = temp;
+ }
+ }
+ C2[current][index2] = distance2[current] * nodeSeparation;
+ }
+ if (samplingMethod) {
+ for (var _i2 = 0; _i2 < nodeSize; _i2++) {
+ if (C2[_i2][index2] < minDistancesColumn[_i2]) minDistancesColumn[_i2] = C2[_i2][index2];
+ }
+ for (var _i3 = 0; _i3 < nodeSize; _i3++) {
+ if (minDistancesColumn[_i3] > max_dist) {
+ max_dist = minDistancesColumn[_i3];
+ max_ind = _i3;
+ }
+ }
+ }
+ return max_ind;
+ }, "BFS");
+ var allBFS = /* @__PURE__ */ __name(function allBFS2(samplingMethod) {
+ var sample2 = void 0;
+ if (!samplingMethod) {
+ randomSampleCR();
+ for (var i3 = 0; i3 < sampleSize; i3++) {
+ BFS(samplesColumn[i3], i3, samplingMethod, false);
+ }
+ } else {
+ sample2 = Math.floor(Math.random() * nodeSize);
+ firstSample = sample2;
+ for (var _i4 = 0; _i4 < nodeSize; _i4++) {
+ minDistancesColumn[_i4] = infinity;
+ }
+ for (var _i5 = 0; _i5 < sampleSize; _i5++) {
+ samplesColumn[_i5] = sample2;
+ sample2 = BFS(sample2, _i5, samplingMethod);
+ }
+ }
+ for (var _i6 = 0; _i6 < nodeSize; _i6++) {
+ for (var j2 = 0; j2 < sampleSize; j2++) {
+ C2[_i6][j2] *= C2[_i6][j2];
+ }
+ }
+ for (var _i7 = 0; _i7 < sampleSize; _i7++) {
+ PHI[_i7] = [];
+ }
+ for (var _i8 = 0; _i8 < sampleSize; _i8++) {
+ for (var _j = 0; _j < sampleSize; _j++) {
+ PHI[_i8][_j] = C2[samplesColumn[_j]][_i8];
+ }
+ }
+ }, "allBFS");
+ var sample = /* @__PURE__ */ __name(function sample2() {
+ var SVDResult = SVD.svd(PHI);
+ var a_q = SVDResult.S;
+ var a_u = SVDResult.U;
+ var a_v = SVDResult.V;
+ var max_s = a_q[0] * a_q[0] * a_q[0];
+ var a_Sig = [];
+ for (var i3 = 0; i3 < sampleSize; i3++) {
+ a_Sig[i3] = [];
+ for (var j2 = 0; j2 < sampleSize; j2++) {
+ a_Sig[i3][j2] = 0;
+ if (i3 == j2) {
+ a_Sig[i3][j2] = a_q[i3] / (a_q[i3] * a_q[i3] + max_s / (a_q[i3] * a_q[i3]));
+ }
+ }
+ }
+ INV = Matrix.multMat(Matrix.multMat(a_v, a_Sig), Matrix.transpose(a_u));
+ }, "sample");
+ var powerIteration = /* @__PURE__ */ __name(function powerIteration2() {
+ var theta1 = void 0;
+ var theta2 = void 0;
+ var Y1 = [];
+ var Y22 = [];
+ var V1 = [];
+ var V2 = [];
+ for (var i3 = 0; i3 < nodeSize; i3++) {
+ Y1[i3] = Math.random();
+ Y22[i3] = Math.random();
+ }
+ Y1 = Matrix.normalize(Y1);
+ Y22 = Matrix.normalize(Y22);
+ var count = 0;
+ var current = small;
+ var previous = small;
+ var temp = void 0;
+ while (true) {
+ count++;
+ for (var _i9 = 0; _i9 < nodeSize; _i9++) {
+ V1[_i9] = Y1[_i9];
+ }
+ Y1 = Matrix.multGamma(Matrix.multL(Matrix.multGamma(V1), C2, INV));
+ theta1 = Matrix.dotProduct(V1, Y1);
+ Y1 = Matrix.normalize(Y1);
+ current = Matrix.dotProduct(V1, Y1);
+ temp = Math.abs(current / previous);
+ if (temp <= 1 + piTol && temp >= 1) {
+ break;
+ }
+ previous = current;
+ }
+ for (var _i10 = 0; _i10 < nodeSize; _i10++) {
+ V1[_i10] = Y1[_i10];
+ }
+ count = 0;
+ previous = small;
+ while (true) {
+ count++;
+ for (var _i11 = 0; _i11 < nodeSize; _i11++) {
+ V2[_i11] = Y22[_i11];
+ }
+ V2 = Matrix.minusOp(V2, Matrix.multCons(V1, Matrix.dotProduct(V1, V2)));
+ Y22 = Matrix.multGamma(Matrix.multL(Matrix.multGamma(V2), C2, INV));
+ theta2 = Matrix.dotProduct(V2, Y22);
+ Y22 = Matrix.normalize(Y22);
+ current = Matrix.dotProduct(V2, Y22);
+ temp = Math.abs(current / previous);
+ if (temp <= 1 + piTol && temp >= 1) {
+ break;
+ }
+ previous = current;
+ }
+ for (var _i12 = 0; _i12 < nodeSize; _i12++) {
+ V2[_i12] = Y22[_i12];
+ }
+ xCoords = Matrix.multCons(V1, Math.sqrt(Math.abs(theta1)));
+ yCoords = Matrix.multCons(V2, Math.sqrt(Math.abs(theta2)));
+ }, "powerIteration");
+ aux.connectComponents(cy, eles, aux.getTopMostNodes(nodes6), dummyNodes);
+ parentNodes.forEach(function(ele) {
+ aux.connectComponents(cy, eles, aux.getTopMostNodes(ele.descendants().intersection(eles)), dummyNodes);
+ });
+ var index = 0;
+ for (var i2 = 0; i2 < nodes6.length; i2++) {
+ if (!nodes6[i2].isParent()) {
+ nodeIndexes.set(nodes6[i2].id(), index++);
+ }
+ }
+ var _iteratorNormalCompletion = true;
+ var _didIteratorError = false;
+ var _iteratorError = void 0;
+ try {
+ for (var _iterator = dummyNodes.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
+ var key = _step.value;
+ nodeIndexes.set(key, index++);
+ }
+ } catch (err) {
+ _didIteratorError = true;
+ _iteratorError = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion && _iterator.return) {
+ _iterator.return();
+ }
+ } finally {
+ if (_didIteratorError) {
+ throw _iteratorError;
+ }
+ }
+ }
+ for (var _i13 = 0; _i13 < nodeIndexes.size; _i13++) {
+ allNodesNeighborhood[_i13] = [];
+ }
+ parentNodes.forEach(function(ele) {
+ var children2 = ele.children().intersection(eles);
+ while (children2.nodes(":childless").length == 0) {
+ children2 = children2.nodes()[0].children().intersection(eles);
+ }
+ var index2 = 0;
+ var min9 = children2.nodes(":childless")[0].connectedEdges().length;
+ children2.nodes(":childless").forEach(function(ele2, i3) {
+ if (ele2.connectedEdges().length < min9) {
+ min9 = ele2.connectedEdges().length;
+ index2 = i3;
+ }
+ });
+ parentChildMap.set(ele.id(), children2.nodes(":childless")[index2].id());
+ });
+ nodes6.forEach(function(ele) {
+ var eleIndex = void 0;
+ if (ele.isParent()) eleIndex = nodeIndexes.get(parentChildMap.get(ele.id()));
+ else eleIndex = nodeIndexes.get(ele.id());
+ ele.neighborhood().nodes().forEach(function(node2) {
+ if (eles.intersection(ele.edgesWith(node2)).length > 0) {
+ if (node2.isParent()) allNodesNeighborhood[eleIndex].push(parentChildMap.get(node2.id()));
+ else allNodesNeighborhood[eleIndex].push(node2.id());
+ }
+ });
+ });
+ var _loop = /* @__PURE__ */ __name(function _loop2(_key2) {
+ var eleIndex = nodeIndexes.get(_key2);
+ var disconnectedId = void 0;
+ dummyNodes.get(_key2).forEach(function(id29) {
+ if (cy.getElementById(id29).isParent()) disconnectedId = parentChildMap.get(id29);
+ else disconnectedId = id29;
+ allNodesNeighborhood[eleIndex].push(disconnectedId);
+ allNodesNeighborhood[nodeIndexes.get(disconnectedId)].push(_key2);
+ });
+ }, "_loop");
+ var _iteratorNormalCompletion2 = true;
+ var _didIteratorError2 = false;
+ var _iteratorError2 = void 0;
+ try {
+ for (var _iterator2 = dummyNodes.keys()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
+ var _key = _step2.value;
+ _loop(_key);
+ }
+ } catch (err) {
+ _didIteratorError2 = true;
+ _iteratorError2 = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion2 && _iterator2.return) {
+ _iterator2.return();
+ }
+ } finally {
+ if (_didIteratorError2) {
+ throw _iteratorError2;
+ }
+ }
+ }
+ nodeSize = nodeIndexes.size;
+ var spectralResult = void 0;
+ if (nodeSize > 2) {
+ sampleSize = nodeSize < options3.sampleSize ? nodeSize : options3.sampleSize;
+ for (var _i14 = 0; _i14 < nodeSize; _i14++) {
+ C2[_i14] = [];
+ }
+ for (var _i15 = 0; _i15 < sampleSize; _i15++) {
+ INV[_i15] = [];
+ }
+ if (options3.quality == "draft" || options3.step == "all") {
+ allBFS(samplingType);
+ sample();
+ powerIteration();
+ spectralResult = { nodeIndexes, xCoords, yCoords };
+ } else {
+ nodeIndexes.forEach(function(value2, key2) {
+ xCoords.push(cy.getElementById(key2).position("x"));
+ yCoords.push(cy.getElementById(key2).position("y"));
+ });
+ spectralResult = { nodeIndexes, xCoords, yCoords };
+ }
+ return spectralResult;
+ } else {
+ var iterator = nodeIndexes.keys();
+ var firstNode = cy.getElementById(iterator.next().value);
+ var firstNodePos = firstNode.position();
+ var firstNodeWidth = firstNode.outerWidth();
+ xCoords.push(firstNodePos.x);
+ yCoords.push(firstNodePos.y);
+ if (nodeSize == 2) {
+ var secondNode = cy.getElementById(iterator.next().value);
+ var secondNodeWidth = secondNode.outerWidth();
+ xCoords.push(firstNodePos.x + firstNodeWidth / 2 + secondNodeWidth / 2 + options3.idealEdgeLength);
+ yCoords.push(firstNodePos.y);
+ }
+ spectralResult = { nodeIndexes, xCoords, yCoords };
+ return spectralResult;
+ }
+ }, "spectralLayout");
+ module3.exports = { spectralLayout };
+ }
+ ),
+ /***/
+ 579: (
+ /***/
+ (module3, __unused_webpack_exports, __webpack_require__2) => {
+ var impl2 = __webpack_require__2(212);
+ var register = /* @__PURE__ */ __name(function register2(cytoscape4) {
+ if (!cytoscape4) {
+ return;
+ }
+ cytoscape4("layout", "fcose", impl2);
+ }, "register");
+ if (typeof cytoscape !== "undefined") {
+ register(cytoscape);
+ }
+ module3.exports = register;
+ }
+ ),
+ /***/
+ 140: (
+ /***/
+ (module3) => {
+ module3.exports = __WEBPACK_EXTERNAL_MODULE__140__;
+ }
+ )
+ /******/
+ };
+ var __webpack_module_cache__ = {};
+ function __webpack_require__(moduleId) {
+ var cachedModule = __webpack_module_cache__[moduleId];
+ if (cachedModule !== void 0) {
+ return cachedModule.exports;
+ }
+ var module3 = __webpack_module_cache__[moduleId] = {
+ /******/
+ // no module.id needed
+ /******/
+ // no module.loaded needed
+ /******/
+ exports: {}
+ /******/
+ };
+ __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
+ return module3.exports;
+ }
+ __name(__webpack_require__, "__webpack_require__");
+ var __webpack_exports__ = __webpack_require__(579);
+ return __webpack_exports__;
+ })()
+ );
});
- result[newIndex] = currentType;
- });
- return result;
- }
- __name(compileList, "compileList");
- function compileMap() {
- var result = {
- scalar: {},
- sequence: {},
- mapping: {},
- fallback: {},
- multi: {
- scalar: [],
- sequence: [],
- mapping: [],
- fallback: []
- }
- }, index, length2;
- function collectType(type3) {
- if (type3.multi) {
- result.multi[type3.kind].push(type3);
- result.multi["fallback"].push(type3);
- } else {
- result[type3.kind][type3.tag] = result["fallback"][type3.tag] = type3;
- }
}
- __name(collectType, "collectType");
- for (index = 0, length2 = arguments.length; index < length2; index += 1) {
- arguments[index].forEach(collectType);
- }
- return result;
- }
- __name(compileMap, "compileMap");
- function Schema$1(definition) {
- return this.extend(definition);
- }
- __name(Schema$1, "Schema$1");
- Schema$1.prototype.extend = /* @__PURE__ */ __name(function extend4(definition) {
- var implicit2 = [];
- var explicit = [];
- if (definition instanceof type2) {
- explicit.push(definition);
- } else if (Array.isArray(definition)) {
- explicit = explicit.concat(definition);
- } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
- if (definition.implicit) implicit2 = implicit2.concat(definition.implicit);
- if (definition.explicit) explicit = explicit.concat(definition.explicit);
- } else {
- throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
- }
- implicit2.forEach(function(type$1) {
- if (!(type$1 instanceof type2)) {
- throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
- }
- if (type$1.loadKind && type$1.loadKind !== "scalar") {
- throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
- }
- if (type$1.multi) {
- throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
- }
- });
- explicit.forEach(function(type$1) {
- if (!(type$1 instanceof type2)) {
- throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
- }
- });
- var result = Object.create(Schema$1.prototype);
- result.implicit = (this.implicit || []).concat(implicit2);
- result.explicit = (this.explicit || []).concat(explicit);
- result.compiledImplicit = compileList(result, "implicit");
- result.compiledExplicit = compileList(result, "explicit");
- result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
- return result;
- }, "extend");
- var schema = Schema$1;
- var str = new type2("tag:yaml.org,2002:str", {
- kind: "scalar",
- construct: /* @__PURE__ */ __name(function(data5) {
- return data5 !== null ? data5 : "";
- }, "construct")
- });
- var seq = new type2("tag:yaml.org,2002:seq", {
- kind: "sequence",
- construct: /* @__PURE__ */ __name(function(data5) {
- return data5 !== null ? data5 : [];
- }, "construct")
- });
- var map4 = new type2("tag:yaml.org,2002:map", {
- kind: "mapping",
- construct: /* @__PURE__ */ __name(function(data5) {
- return data5 !== null ? data5 : {};
- }, "construct")
- });
- var failsafe = new schema({
- explicit: [
- str,
- seq,
- map4
- ]
- });
- function resolveYamlNull(data5) {
- if (data5 === null) return true;
- var max10 = data5.length;
- return max10 === 1 && data5 === "~" || max10 === 4 && (data5 === "null" || data5 === "Null" || data5 === "NULL");
- }
- __name(resolveYamlNull, "resolveYamlNull");
- function constructYamlNull() {
- return null;
- }
- __name(constructYamlNull, "constructYamlNull");
- function isNull(object3) {
- return object3 === null;
- }
- __name(isNull, "isNull");
- var _null = new type2("tag:yaml.org,2002:null", {
- kind: "scalar",
- resolve: resolveYamlNull,
- construct: constructYamlNull,
- predicate: isNull,
- represent: {
- canonical: /* @__PURE__ */ __name(function() {
- return "~";
- }, "canonical"),
- lowercase: /* @__PURE__ */ __name(function() {
- return "null";
- }, "lowercase"),
- uppercase: /* @__PURE__ */ __name(function() {
- return "NULL";
- }, "uppercase"),
- camelcase: /* @__PURE__ */ __name(function() {
- return "Null";
- }, "camelcase"),
- empty: /* @__PURE__ */ __name(function() {
- return "";
- }, "empty")
- },
- defaultStyle: "lowercase"
- });
- function resolveYamlBoolean(data5) {
- if (data5 === null) return false;
- var max10 = data5.length;
- return max10 === 4 && (data5 === "true" || data5 === "True" || data5 === "TRUE") || max10 === 5 && (data5 === "false" || data5 === "False" || data5 === "FALSE");
- }
- __name(resolveYamlBoolean, "resolveYamlBoolean");
- function constructYamlBoolean(data5) {
- return data5 === "true" || data5 === "True" || data5 === "TRUE";
- }
- __name(constructYamlBoolean, "constructYamlBoolean");
- function isBoolean(object3) {
- return Object.prototype.toString.call(object3) === "[object Boolean]";
- }
- __name(isBoolean, "isBoolean");
- var bool = new type2("tag:yaml.org,2002:bool", {
- kind: "scalar",
- resolve: resolveYamlBoolean,
- construct: constructYamlBoolean,
- predicate: isBoolean,
- represent: {
- lowercase: /* @__PURE__ */ __name(function(object3) {
- return object3 ? "true" : "false";
- }, "lowercase"),
- uppercase: /* @__PURE__ */ __name(function(object3) {
- return object3 ? "TRUE" : "FALSE";
- }, "uppercase"),
- camelcase: /* @__PURE__ */ __name(function(object3) {
- return object3 ? "True" : "False";
- }, "camelcase")
- },
- defaultStyle: "lowercase"
});
- function isHexCode(c3) {
- return 48 <= c3 && c3 <= 57 || 65 <= c3 && c3 <= 70 || 97 <= c3 && c3 <= 102;
- }
- __name(isHexCode, "isHexCode");
- function isOctCode(c3) {
- return 48 <= c3 && c3 <= 55;
- }
- __name(isOctCode, "isOctCode");
- function isDecCode(c3) {
- return 48 <= c3 && c3 <= 57;
- }
- __name(isDecCode, "isDecCode");
- function resolveYamlInteger(data5) {
- if (data5 === null) return false;
- var max10 = data5.length, index = 0, hasDigits = false, ch;
- if (!max10) return false;
- ch = data5[index];
- if (ch === "-" || ch === "+") {
- ch = data5[++index];
- }
- if (ch === "0") {
- if (index + 1 === max10) return true;
- ch = data5[++index];
- if (ch === "b") {
- index++;
- for (; index < max10; index++) {
- ch = data5[index];
- if (ch === "_") continue;
- if (ch !== "0" && ch !== "1") return false;
- hasDigits = true;
- }
- return hasDigits && ch !== "_";
- }
- if (ch === "x") {
- index++;
- for (; index < max10; index++) {
- ch = data5[index];
- if (ch === "_") continue;
- if (!isHexCode(data5.charCodeAt(index))) return false;
- hasDigits = true;
- }
- return hasDigits && ch !== "_";
- }
- if (ch === "o") {
- index++;
- for (; index < max10; index++) {
- ch = data5[index];
- if (ch === "_") continue;
- if (!isOctCode(data5.charCodeAt(index))) return false;
- hasDigits = true;
- }
- return hasDigits && ch !== "_";
- }
- }
- if (ch === "_") return false;
- for (; index < max10; index++) {
- ch = data5[index];
- if (ch === "_") continue;
- if (!isDecCode(data5.charCodeAt(index))) {
- return false;
- }
- hasDigits = true;
- }
- if (!hasDigits || ch === "_") return false;
- return true;
- }
- __name(resolveYamlInteger, "resolveYamlInteger");
- function constructYamlInteger(data5) {
- var value2 = data5, sign2 = 1, ch;
- if (value2.indexOf("_") !== -1) {
- value2 = value2.replace(/_/g, "");
- }
- ch = value2[0];
- if (ch === "-" || ch === "+") {
- if (ch === "-") sign2 = -1;
- value2 = value2.slice(1);
- ch = value2[0];
- }
- if (value2 === "0") return 0;
- if (ch === "0") {
- if (value2[1] === "b") return sign2 * parseInt(value2.slice(2), 2);
- if (value2[1] === "x") return sign2 * parseInt(value2.slice(2), 16);
- if (value2[1] === "o") return sign2 * parseInt(value2.slice(2), 8);
- }
- return sign2 * parseInt(value2, 10);
- }
- __name(constructYamlInteger, "constructYamlInteger");
- function isInteger(object3) {
- return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 === 0 && !common.isNegativeZero(object3));
- }
- __name(isInteger, "isInteger");
- var int = new type2("tag:yaml.org,2002:int", {
- kind: "scalar",
- resolve: resolveYamlInteger,
- construct: constructYamlInteger,
- predicate: isInteger,
- represent: {
- binary: /* @__PURE__ */ __name(function(obj) {
- return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
- }, "binary"),
- octal: /* @__PURE__ */ __name(function(obj) {
- return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
- }, "octal"),
- decimal: /* @__PURE__ */ __name(function(obj) {
- return obj.toString(10);
- }, "decimal"),
- /* eslint-disable max-len */
- hexadecimal: /* @__PURE__ */ __name(function(obj) {
- return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
- }, "hexadecimal")
- },
- defaultStyle: "decimal",
- styleAliases: {
- binary: [2, "bin"],
- octal: [8, "oct"],
- decimal: [10, "dec"],
- hexadecimal: [16, "hex"]
- }
- });
- var YAML_FLOAT_PATTERN = new RegExp(
- // 2.5e4, 2.5 and integers
- "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
- );
- function resolveYamlFloat(data5) {
- if (data5 === null) return false;
- if (!YAML_FLOAT_PATTERN.test(data5) || // Quick hack to not allow integers end with `_`
- // Probably should update regexp & check speed
- data5[data5.length - 1] === "_") {
- return false;
- }
- return true;
- }
- __name(resolveYamlFloat, "resolveYamlFloat");
- function constructYamlFloat(data5) {
- var value2, sign2;
- value2 = data5.replace(/_/g, "").toLowerCase();
- sign2 = value2[0] === "-" ? -1 : 1;
- if ("+-".indexOf(value2[0]) >= 0) {
- value2 = value2.slice(1);
- }
- if (value2 === ".inf") {
- return sign2 === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
- } else if (value2 === ".nan") {
- return NaN;
- }
- return sign2 * parseFloat(value2, 10);
- }
- __name(constructYamlFloat, "constructYamlFloat");
- var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
- function representYamlFloat(object3, style3) {
- var res;
- if (isNaN(object3)) {
- switch (style3) {
- case "lowercase":
- return ".nan";
- case "uppercase":
- return ".NAN";
- case "camelcase":
- return ".NaN";
- }
- } else if (Number.POSITIVE_INFINITY === object3) {
- switch (style3) {
- case "lowercase":
- return ".inf";
- case "uppercase":
- return ".INF";
- case "camelcase":
- return ".Inf";
- }
- } else if (Number.NEGATIVE_INFINITY === object3) {
- switch (style3) {
- case "lowercase":
- return "-.inf";
- case "uppercase":
- return "-.INF";
- case "camelcase":
- return "-.Inf";
- }
- } else if (common.isNegativeZero(object3)) {
- return "-0.0";
- }
- res = object3.toString(10);
- return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
- }
- __name(representYamlFloat, "representYamlFloat");
- function isFloat(object3) {
- return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 !== 0 || common.isNegativeZero(object3));
- }
- __name(isFloat, "isFloat");
- var float = new type2("tag:yaml.org,2002:float", {
- kind: "scalar",
- resolve: resolveYamlFloat,
- construct: constructYamlFloat,
- predicate: isFloat,
- represent: representYamlFloat,
- defaultStyle: "lowercase"
- });
- var json2 = failsafe.extend({
- implicit: [
- _null,
- bool,
- int,
- float
- ]
- });
- var core3 = json2;
- var YAML_DATE_REGEXP = new RegExp(
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
- );
- var YAML_TIMESTAMP_REGEXP = new RegExp(
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
- );
- function resolveYamlTimestamp(data5) {
- if (data5 === null) return false;
- if (YAML_DATE_REGEXP.exec(data5) !== null) return true;
- if (YAML_TIMESTAMP_REGEXP.exec(data5) !== null) return true;
- return false;
- }
- __name(resolveYamlTimestamp, "resolveYamlTimestamp");
- function constructYamlTimestamp(data5) {
- var match2, year, month, day, hour, minute, second2, fraction = 0, delta = null, tz_hour, tz_minute, date2;
- match2 = YAML_DATE_REGEXP.exec(data5);
- if (match2 === null) match2 = YAML_TIMESTAMP_REGEXP.exec(data5);
- if (match2 === null) throw new Error("Date resolve error");
- year = +match2[1];
- month = +match2[2] - 1;
- day = +match2[3];
- if (!match2[4]) {
- return new Date(Date.UTC(year, month, day));
- }
- hour = +match2[4];
- minute = +match2[5];
- second2 = +match2[6];
- if (match2[7]) {
- fraction = match2[7].slice(0, 3);
- while (fraction.length < 3) {
- fraction += "0";
- }
- fraction = +fraction;
- }
- if (match2[9]) {
- tz_hour = +match2[10];
- tz_minute = +(match2[11] || 0);
- delta = (tz_hour * 60 + tz_minute) * 6e4;
- if (match2[9] === "-") delta = -delta;
- }
- date2 = new Date(Date.UTC(year, month, day, hour, minute, second2, fraction));
- if (delta) date2.setTime(date2.getTime() - delta);
- return date2;
- }
- __name(constructYamlTimestamp, "constructYamlTimestamp");
- function representYamlTimestamp(object3) {
- return object3.toISOString();
- }
- __name(representYamlTimestamp, "representYamlTimestamp");
- var timestamp = new type2("tag:yaml.org,2002:timestamp", {
- kind: "scalar",
- resolve: resolveYamlTimestamp,
- construct: constructYamlTimestamp,
- instanceOf: Date,
- represent: representYamlTimestamp
- });
- function resolveYamlMerge(data5) {
- return data5 === "<<" || data5 === null;
- }
- __name(resolveYamlMerge, "resolveYamlMerge");
- var merge4 = new type2("tag:yaml.org,2002:merge", {
- kind: "scalar",
- resolve: resolveYamlMerge
- });
- var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
- function resolveYamlBinary(data5) {
- if (data5 === null) return false;
- var code, idx, bitlen = 0, max10 = data5.length, map5 = BASE64_MAP;
- for (idx = 0; idx < max10; idx++) {
- code = map5.indexOf(data5.charAt(idx));
- if (code > 64) continue;
- if (code < 0) return false;
- bitlen += 6;
- }
- return bitlen % 8 === 0;
- }
- __name(resolveYamlBinary, "resolveYamlBinary");
- function constructYamlBinary(data5) {
- var idx, tailbits, input = data5.replace(/[\r\n=]/g, ""), max10 = input.length, map5 = BASE64_MAP, bits = 0, result = [];
- for (idx = 0; idx < max10; idx++) {
- if (idx % 4 === 0 && idx) {
- result.push(bits >> 16 & 255);
- result.push(bits >> 8 & 255);
- result.push(bits & 255);
- }
- bits = bits << 6 | map5.indexOf(input.charAt(idx));
- }
- tailbits = max10 % 4 * 6;
- if (tailbits === 0) {
- result.push(bits >> 16 & 255);
- result.push(bits >> 8 & 255);
- result.push(bits & 255);
- } else if (tailbits === 18) {
- result.push(bits >> 10 & 255);
- result.push(bits >> 2 & 255);
- } else if (tailbits === 12) {
- result.push(bits >> 4 & 255);
- }
- return new Uint8Array(result);
- }
- __name(constructYamlBinary, "constructYamlBinary");
- function representYamlBinary(object3) {
- var result = "", bits = 0, idx, tail, max10 = object3.length, map5 = BASE64_MAP;
- for (idx = 0; idx < max10; idx++) {
- if (idx % 3 === 0 && idx) {
- result += map5[bits >> 18 & 63];
- result += map5[bits >> 12 & 63];
- result += map5[bits >> 6 & 63];
- result += map5[bits & 63];
- }
- bits = (bits << 8) + object3[idx];
- }
- tail = max10 % 3;
- if (tail === 0) {
- result += map5[bits >> 18 & 63];
- result += map5[bits >> 12 & 63];
- result += map5[bits >> 6 & 63];
- result += map5[bits & 63];
- } else if (tail === 2) {
- result += map5[bits >> 10 & 63];
- result += map5[bits >> 4 & 63];
- result += map5[bits << 2 & 63];
- result += map5[64];
- } else if (tail === 1) {
- result += map5[bits >> 2 & 63];
- result += map5[bits << 4 & 63];
- result += map5[64];
- result += map5[64];
- }
- return result;
- }
- __name(representYamlBinary, "representYamlBinary");
- function isBinary(obj) {
- return Object.prototype.toString.call(obj) === "[object Uint8Array]";
- }
- __name(isBinary, "isBinary");
- var binary = new type2("tag:yaml.org,2002:binary", {
- kind: "scalar",
- resolve: resolveYamlBinary,
- construct: constructYamlBinary,
- predicate: isBinary,
- represent: representYamlBinary
- });
- var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
- var _toString$2 = Object.prototype.toString;
- function resolveYamlOmap(data5) {
- if (data5 === null) return true;
- var objectKeys = [], index, length2, pair, pairKey, pairHasKey, object3 = data5;
- for (index = 0, length2 = object3.length; index < length2; index += 1) {
- pair = object3[index];
- pairHasKey = false;
- if (_toString$2.call(pair) !== "[object Object]") return false;
- for (pairKey in pair) {
- if (_hasOwnProperty$3.call(pair, pairKey)) {
- if (!pairHasKey) pairHasKey = true;
- else return false;
+
+ // src/diagrams/architecture/architectureIcons.ts
+ var wrapIcon, architectureIcons;
+ var init_architectureIcons = __esm({
+ "src/diagrams/architecture/architectureIcons.ts"() {
+ "use strict";
+ init_icons();
+ wrapIcon = /* @__PURE__ */ __name((icon2) => {
+ return ` ${icon2} `;
+ }, "wrapIcon");
+ architectureIcons = {
+ prefix: "mermaid-architecture",
+ height: 80,
+ width: 80,
+ icons: {
+ database: {
+ body: wrapIcon(
+ ' '
+ )
+ },
+ server: {
+ body: wrapIcon(
+ ' '
+ )
+ },
+ disk: {
+ body: wrapIcon(
+ ' '
+ )
+ },
+ internet: {
+ body: wrapIcon(
+ ' '
+ )
+ },
+ cloud: {
+ body: wrapIcon(
+ ' '
+ )
+ },
+ unknown: unknownIcon,
+ blank: {
+ body: wrapIcon("")
+ }
}
- }
- if (!pairHasKey) return false;
- if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
- else return false;
- }
- return true;
- }
- __name(resolveYamlOmap, "resolveYamlOmap");
- function constructYamlOmap(data5) {
- return data5 !== null ? data5 : [];
- }
- __name(constructYamlOmap, "constructYamlOmap");
- var omap = new type2("tag:yaml.org,2002:omap", {
- kind: "sequence",
- resolve: resolveYamlOmap,
- construct: constructYamlOmap
- });
- var _toString$1 = Object.prototype.toString;
- function resolveYamlPairs(data5) {
- if (data5 === null) return true;
- var index, length2, pair, keys3, result, object3 = data5;
- result = new Array(object3.length);
- for (index = 0, length2 = object3.length; index < length2; index += 1) {
- pair = object3[index];
- if (_toString$1.call(pair) !== "[object Object]") return false;
- keys3 = Object.keys(pair);
- if (keys3.length !== 1) return false;
- result[index] = [keys3[0], pair[keys3[0]]];
- }
- return true;
- }
- __name(resolveYamlPairs, "resolveYamlPairs");
- function constructYamlPairs(data5) {
- if (data5 === null) return [];
- var index, length2, pair, keys3, result, object3 = data5;
- result = new Array(object3.length);
- for (index = 0, length2 = object3.length; index < length2; index += 1) {
- pair = object3[index];
- keys3 = Object.keys(pair);
- result[index] = [keys3[0], pair[keys3[0]]];
+ };
}
- return result;
- }
- __name(constructYamlPairs, "constructYamlPairs");
- var pairs = new type2("tag:yaml.org,2002:pairs", {
- kind: "sequence",
- resolve: resolveYamlPairs,
- construct: constructYamlPairs
});
- var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
- function resolveYamlSet(data5) {
- if (data5 === null) return true;
- var key, object3 = data5;
- for (key in object3) {
- if (_hasOwnProperty$2.call(object3, key)) {
- if (object3[key] !== null) return false;
- }
- }
- return true;
- }
- __name(resolveYamlSet, "resolveYamlSet");
- function constructYamlSet(data5) {
- return data5 !== null ? data5 : {};
- }
- __name(constructYamlSet, "constructYamlSet");
- var set5 = new type2("tag:yaml.org,2002:set", {
- kind: "mapping",
- resolve: resolveYamlSet,
- construct: constructYamlSet
- });
- var _default = core3.extend({
- implicit: [
- timestamp,
- merge4
- ],
- explicit: [
- binary,
- omap,
- pairs,
- set5
- ]
- });
- var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- var CONTEXT_FLOW_IN = 1;
- var CONTEXT_FLOW_OUT = 2;
- var CONTEXT_BLOCK_IN = 3;
- var CONTEXT_BLOCK_OUT = 4;
- var CHOMPING_CLIP = 1;
- var CHOMPING_STRIP = 2;
- var CHOMPING_KEEP = 3;
- var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
- var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
- var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
- var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
- var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
- function _class(obj) {
- return Object.prototype.toString.call(obj);
- }
- __name(_class, "_class");
- function is_EOL(c3) {
- return c3 === 10 || c3 === 13;
- }
- __name(is_EOL, "is_EOL");
- function is_WHITE_SPACE(c3) {
- return c3 === 9 || c3 === 32;
- }
- __name(is_WHITE_SPACE, "is_WHITE_SPACE");
- function is_WS_OR_EOL(c3) {
- return c3 === 9 || c3 === 32 || c3 === 10 || c3 === 13;
- }
- __name(is_WS_OR_EOL, "is_WS_OR_EOL");
- function is_FLOW_INDICATOR(c3) {
- return c3 === 44 || c3 === 91 || c3 === 93 || c3 === 123 || c3 === 125;
- }
- __name(is_FLOW_INDICATOR, "is_FLOW_INDICATOR");
- function fromHexCode(c3) {
- var lc;
- if (48 <= c3 && c3 <= 57) {
- return c3 - 48;
- }
- lc = c3 | 32;
- if (97 <= lc && lc <= 102) {
- return lc - 97 + 10;
- }
- return -1;
- }
- __name(fromHexCode, "fromHexCode");
- function escapedHexLen(c3) {
- if (c3 === 120) {
- return 2;
- }
- if (c3 === 117) {
- return 4;
- }
- if (c3 === 85) {
- return 8;
- }
- return 0;
- }
- __name(escapedHexLen, "escapedHexLen");
- function fromDecimalCode(c3) {
- if (48 <= c3 && c3 <= 57) {
- return c3 - 48;
- }
- return -1;
- }
- __name(fromDecimalCode, "fromDecimalCode");
- function simpleEscapeSequence(c3) {
- return c3 === 48 ? "\0" : c3 === 97 ? "\x07" : c3 === 98 ? "\b" : c3 === 116 ? " " : c3 === 9 ? " " : c3 === 110 ? "\n" : c3 === 118 ? "\v" : c3 === 102 ? "\f" : c3 === 114 ? "\r" : c3 === 101 ? "\x1B" : c3 === 32 ? " " : c3 === 34 ? '"' : c3 === 47 ? "/" : c3 === 92 ? "\\" : c3 === 78 ? "\x85" : c3 === 95 ? "\xA0" : c3 === 76 ? "\u2028" : c3 === 80 ? "\u2029" : "";
- }
- __name(simpleEscapeSequence, "simpleEscapeSequence");
- function charFromCodepoint(c3) {
- if (c3 <= 65535) {
- return String.fromCharCode(c3);
- }
- return String.fromCharCode(
- (c3 - 65536 >> 10) + 55296,
- (c3 - 65536 & 1023) + 56320
- );
- }
- __name(charFromCodepoint, "charFromCodepoint");
- var simpleEscapeCheck = new Array(256);
- var simpleEscapeMap = new Array(256);
- for (i2 = 0; i2 < 256; i2++) {
- simpleEscapeCheck[i2] = simpleEscapeSequence(i2) ? 1 : 0;
- simpleEscapeMap[i2] = simpleEscapeSequence(i2);
- }
- var i2;
- function State$1(input, options3) {
- this.input = input;
- this.filename = options3["filename"] || null;
- this.schema = options3["schema"] || _default;
- this.onWarning = options3["onWarning"] || null;
- this.legacy = options3["legacy"] || false;
- this.json = options3["json"] || false;
- this.listener = options3["listener"] || null;
- this.implicitTypes = this.schema.compiledImplicit;
- this.typeMap = this.schema.compiledTypeMap;
- this.length = input.length;
- this.position = 0;
- this.line = 0;
- this.lineStart = 0;
- this.lineIndent = 0;
- this.firstTabInLine = -1;
- this.documents = [];
- }
- __name(State$1, "State$1");
- function generateError(state5, message) {
- var mark = {
- name: state5.filename,
- buffer: state5.input.slice(0, -1),
- // omit trailing \0
- position: state5.position,
- line: state5.line,
- column: state5.position - state5.lineStart
- };
- mark.snippet = snippet(mark);
- return new exception(message, mark);
- }
- __name(generateError, "generateError");
- function throwError(state5, message) {
- throw generateError(state5, message);
- }
- __name(throwError, "throwError");
- function throwWarning(state5, message) {
- if (state5.onWarning) {
- state5.onWarning.call(null, generateError(state5, message));
- }
- }
- __name(throwWarning, "throwWarning");
- var directiveHandlers = {
- YAML: /* @__PURE__ */ __name(function handleYamlDirective(state5, name, args) {
- var match2, major, minor;
- if (state5.version !== null) {
- throwError(state5, "duplication of %YAML directive");
- }
- if (args.length !== 1) {
- throwError(state5, "YAML directive accepts exactly one argument");
- }
- match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
- if (match2 === null) {
- throwError(state5, "ill-formed argument of the YAML directive");
- }
- major = parseInt(match2[1], 10);
- minor = parseInt(match2[2], 10);
- if (major !== 1) {
- throwError(state5, "unacceptable YAML version of the document");
- }
- state5.version = args[0];
- state5.checkLineBreaks = minor < 2;
- if (minor !== 1 && minor !== 2) {
- throwWarning(state5, "unsupported YAML version of the document");
- }
- }, "handleYamlDirective"),
- TAG: /* @__PURE__ */ __name(function handleTagDirective(state5, name, args) {
- var handle, prefix;
- if (args.length !== 2) {
- throwError(state5, "TAG directive accepts exactly two arguments");
- }
- handle = args[0];
- prefix = args[1];
- if (!PATTERN_TAG_HANDLE.test(handle)) {
- throwError(state5, "ill-formed tag handle (first argument) of the TAG directive");
- }
- if (_hasOwnProperty$1.call(state5.tagMap, handle)) {
- throwError(state5, 'there is a previously declared suffix for "' + handle + '" tag handle');
- }
- if (!PATTERN_TAG_URI.test(prefix)) {
- throwError(state5, "ill-formed tag prefix (second argument) of the TAG directive");
- }
- try {
- prefix = decodeURIComponent(prefix);
- } catch (err) {
- throwError(state5, "tag prefix is malformed: " + prefix);
- }
- state5.tagMap[handle] = prefix;
- }, "handleTagDirective")
- };
- function captureSegment(state5, start3, end2, checkJson) {
- var _position, _length, _character, _result;
- if (start3 < end2) {
- _result = state5.input.slice(start3, end2);
- if (checkJson) {
- for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
- _character = _result.charCodeAt(_position);
- if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
- throwError(state5, "expected valid JSON character");
+
+ // src/diagrams/architecture/svgDraw.ts
+ var drawEdges2, drawGroups, drawServices, drawJunctions;
+ var init_svgDraw6 = __esm({
+ "src/diagrams/architecture/svgDraw.ts"() {
+ "use strict";
+ init_icons();
+ init_diagramAPI();
+ init_createText();
+ init_architectureDb();
+ init_architectureIcons();
+ init_architectureTypes();
+ drawEdges2 = /* @__PURE__ */ __name(async function(edgesEl, cy) {
+ const padding2 = getConfigField("padding");
+ const iconSize = getConfigField("iconSize");
+ const halfIconSize = iconSize / 2;
+ const arrowSize = iconSize / 6;
+ const halfArrowSize = arrowSize / 2;
+ await Promise.all(
+ cy.edges().map(async (edge) => {
+ const {
+ source,
+ sourceDir,
+ sourceArrow,
+ sourceGroup,
+ target,
+ targetDir,
+ targetArrow,
+ targetGroup,
+ label
+ } = edgeData(edge);
+ let { x: startX2, y: startY2 } = edge[0].sourceEndpoint();
+ const { x: midX, y: midY } = edge[0].midpoint();
+ let { x: endX, y: endY } = edge[0].targetEndpoint();
+ const groupEdgeShift = padding2 + 4;
+ if (sourceGroup) {
+ if (isArchitectureDirectionX(sourceDir)) {
+ startX2 += sourceDir === "L" ? -groupEdgeShift : groupEdgeShift;
+ } else {
+ startY2 += sourceDir === "T" ? -groupEdgeShift : groupEdgeShift + 18;
+ }
+ }
+ if (targetGroup) {
+ if (isArchitectureDirectionX(targetDir)) {
+ endX += targetDir === "L" ? -groupEdgeShift : groupEdgeShift;
+ } else {
+ endY += targetDir === "T" ? -groupEdgeShift : groupEdgeShift + 18;
+ }
+ }
+ if (!sourceGroup && db9.getNode(source)?.type === "junction") {
+ if (isArchitectureDirectionX(sourceDir)) {
+ startX2 += sourceDir === "L" ? halfIconSize : -halfIconSize;
+ } else {
+ startY2 += sourceDir === "T" ? halfIconSize : -halfIconSize;
+ }
+ }
+ if (!targetGroup && db9.getNode(target)?.type === "junction") {
+ if (isArchitectureDirectionX(targetDir)) {
+ endX += targetDir === "L" ? halfIconSize : -halfIconSize;
+ } else {
+ endY += targetDir === "T" ? halfIconSize : -halfIconSize;
+ }
+ }
+ if (edge[0]._private.rscratch) {
+ const g2 = edgesEl.insert("g");
+ g2.insert("path").attr("d", `M ${startX2},${startY2} L ${midX},${midY} L${endX},${endY} `).attr("class", "edge");
+ if (sourceArrow) {
+ const xShift = isArchitectureDirectionX(sourceDir) ? ArchitectureDirectionArrowShift[sourceDir](startX2, arrowSize) : startX2 - halfArrowSize;
+ const yShift = isArchitectureDirectionY(sourceDir) ? ArchitectureDirectionArrowShift[sourceDir](startY2, arrowSize) : startY2 - halfArrowSize;
+ g2.insert("polygon").attr("points", ArchitectureDirectionArrow[sourceDir](arrowSize)).attr("transform", `translate(${xShift},${yShift})`).attr("class", "arrow");
+ }
+ if (targetArrow) {
+ const xShift = isArchitectureDirectionX(targetDir) ? ArchitectureDirectionArrowShift[targetDir](endX, arrowSize) : endX - halfArrowSize;
+ const yShift = isArchitectureDirectionY(targetDir) ? ArchitectureDirectionArrowShift[targetDir](endY, arrowSize) : endY - halfArrowSize;
+ g2.insert("polygon").attr("points", ArchitectureDirectionArrow[targetDir](arrowSize)).attr("transform", `translate(${xShift},${yShift})`).attr("class", "arrow");
+ }
+ if (label) {
+ const axis2 = !isArchitectureDirectionXY(sourceDir, targetDir) ? isArchitectureDirectionX(sourceDir) ? "X" : "Y" : "XY";
+ let width3 = 0;
+ if (axis2 === "X") {
+ width3 = Math.abs(startX2 - endX);
+ } else if (axis2 === "Y") {
+ width3 = Math.abs(startY2 - endY) / 1.5;
+ } else {
+ width3 = Math.abs(startX2 - endX) / 2;
+ }
+ const textElem = g2.append("g");
+ await createText(
+ textElem,
+ label,
+ {
+ useHtmlLabels: false,
+ width: width3,
+ classes: "architecture-service-label"
+ },
+ getConfig2()
+ );
+ textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle");
+ if (axis2 === "X") {
+ textElem.attr("transform", "translate(" + midX + ", " + midY + ")");
+ } else if (axis2 === "Y") {
+ textElem.attr("transform", "translate(" + midX + ", " + midY + ") rotate(-90)");
+ } else if (axis2 === "XY") {
+ const pair = getArchitectureDirectionPair(sourceDir, targetDir);
+ if (pair && isArchitecturePairXY(pair)) {
+ const bboxOrig = textElem.node().getBoundingClientRect();
+ const [x5, y5] = getArchitectureDirectionXYFactors(pair);
+ textElem.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * x5 * y5 * 45})`);
+ const bboxNew = textElem.node().getBoundingClientRect();
+ textElem.attr(
+ "transform",
+ `
+ translate(${midX}, ${midY - bboxOrig.height / 2})
+ translate(${x5 * bboxNew.width / 2}, ${y5 * bboxNew.height / 2})
+ rotate(${-1 * x5 * y5 * 45}, 0, ${bboxOrig.height / 2})
+ `
+ );
+ }
+ }
+ }
+ }
+ })
+ );
+ }, "drawEdges");
+ drawGroups = /* @__PURE__ */ __name(async function(groupsEl, cy) {
+ const padding2 = getConfigField("padding");
+ const groupIconSize = padding2 * 0.75;
+ const fontSize = getConfigField("fontSize");
+ const iconSize = getConfigField("iconSize");
+ const halfIconSize = iconSize / 2;
+ await Promise.all(
+ cy.nodes().map(async (node2) => {
+ const data6 = nodeData(node2);
+ if (data6.type === "group") {
+ const { h: h2, w: w3, x1, y1 } = node2.boundingBox();
+ groupsEl.append("rect").attr("x", x1 + halfIconSize).attr("y", y1 + halfIconSize).attr("width", w3).attr("height", h2).attr("class", "node-bkg");
+ const groupLabelContainer = groupsEl.append("g");
+ let shiftedX1 = x1;
+ let shiftedY1 = y1;
+ if (data6.icon) {
+ const bkgElem = groupLabelContainer.append("g");
+ bkgElem.html(
+ `${await getIconSVG(data6.icon, { height: groupIconSize, width: groupIconSize, fallbackPrefix: architectureIcons.prefix })} `
+ );
+ bkgElem.attr(
+ "transform",
+ "translate(" + (shiftedX1 + halfIconSize + 1) + ", " + (shiftedY1 + halfIconSize + 1) + ")"
+ );
+ shiftedX1 += groupIconSize;
+ shiftedY1 += fontSize / 2 - 1 - 2;
+ }
+ if (data6.label) {
+ const textElem = groupLabelContainer.append("g");
+ await createText(
+ textElem,
+ data6.label,
+ {
+ useHtmlLabels: false,
+ width: w3,
+ classes: "architecture-service-label"
+ },
+ getConfig2()
+ );
+ textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start");
+ textElem.attr(
+ "transform",
+ "translate(" + (shiftedX1 + halfIconSize + 4) + ", " + (shiftedY1 + halfIconSize + 2) + ")"
+ );
+ }
+ }
+ })
+ );
+ }, "drawGroups");
+ drawServices = /* @__PURE__ */ __name(async function(db10, elem, services) {
+ for (const service of services) {
+ const serviceElem = elem.append("g");
+ const iconSize = getConfigField("iconSize");
+ if (service.title) {
+ const textElem = serviceElem.append("g");
+ await createText(
+ textElem,
+ service.title,
+ {
+ useHtmlLabels: false,
+ width: iconSize * 1.5,
+ classes: "architecture-service-label"
+ },
+ getConfig2()
+ );
+ textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle");
+ textElem.attr("transform", "translate(" + iconSize / 2 + ", " + iconSize + ")");
}
- }
- } else if (PATTERN_NON_PRINTABLE.test(_result)) {
- throwError(state5, "the stream contains non-printable characters");
- }
- state5.result += _result;
- }
- }
- __name(captureSegment, "captureSegment");
- function mergeMappings(state5, destination, source, overridableKeys) {
- var sourceKeys, key, index, quantity;
- if (!common.isObject(source)) {
- throwError(state5, "cannot merge mappings; the provided source object is unacceptable");
- }
- sourceKeys = Object.keys(source);
- for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
- key = sourceKeys[index];
- if (!_hasOwnProperty$1.call(destination, key)) {
- destination[key] = source[key];
- overridableKeys[key] = true;
- }
- }
- }
- __name(mergeMappings, "mergeMappings");
- function storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
- var index, quantity;
- if (Array.isArray(keyNode)) {
- keyNode = Array.prototype.slice.call(keyNode);
- for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
- if (Array.isArray(keyNode[index])) {
- throwError(state5, "nested arrays are not supported inside keys");
- }
- if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
- keyNode[index] = "[object Object]";
- }
- }
- }
- if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
- keyNode = "[object Object]";
- }
- keyNode = String(keyNode);
- if (_result === null) {
- _result = {};
- }
- if (keyTag === "tag:yaml.org,2002:merge") {
- if (Array.isArray(valueNode)) {
- for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
- mergeMappings(state5, _result, valueNode[index], overridableKeys);
- }
- } else {
- mergeMappings(state5, _result, valueNode, overridableKeys);
- }
- } else {
- if (!state5.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
- state5.line = startLine || state5.line;
- state5.lineStart = startLineStart || state5.lineStart;
- state5.position = startPos || state5.position;
- throwError(state5, "duplicated mapping key");
- }
- if (keyNode === "__proto__") {
- Object.defineProperty(_result, keyNode, {
- configurable: true,
- enumerable: true,
- writable: true,
- value: valueNode
+ const bkgElem = serviceElem.append("g");
+ if (service.icon) {
+ bkgElem.html(
+ `${await getIconSVG(service.icon, { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })} `
+ );
+ } else if (service.iconText) {
+ bkgElem.html(
+ `${await getIconSVG("blank", { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })} `
+ );
+ const textElemContainer = bkgElem.append("g");
+ const fo = textElemContainer.append("foreignObject").attr("width", iconSize).attr("height", iconSize);
+ const divElem = fo.append("div").attr("class", "node-icon-text").attr("style", `height: ${iconSize}px;`).append("div").html(service.iconText);
+ const fontSize = parseInt(
+ window.getComputedStyle(divElem.node(), null).getPropertyValue("font-size").replace(/\D/g, "")
+ ) ?? 16;
+ divElem.attr("style", `-webkit-line-clamp: ${Math.floor((iconSize - 2) / fontSize)};`);
+ } else {
+ bkgElem.append("path").attr("class", "node-bkg").attr("id", "node-" + service.id).attr(
+ "d",
+ `M0 ${iconSize} v${-iconSize} q0,-5 5,-5 h${iconSize} q5,0 5,5 v${iconSize} H0 Z`
+ );
+ }
+ serviceElem.attr("class", "architecture-service");
+ const { width: width3, height: height2 } = serviceElem._groups[0][0].getBBox();
+ service.width = width3;
+ service.height = height2;
+ db10.setElementForId(service.id, serviceElem);
+ }
+ return 0;
+ }, "drawServices");
+ drawJunctions = /* @__PURE__ */ __name(function(db10, elem, junctions) {
+ junctions.forEach((junction) => {
+ const junctionElem = elem.append("g");
+ const iconSize = getConfigField("iconSize");
+ const bkgElem = junctionElem.append("g");
+ bkgElem.append("rect").attr("id", "node-" + junction.id).attr("fill-opacity", "0").attr("width", iconSize).attr("height", iconSize);
+ junctionElem.attr("class", "architecture-junction");
+ const { width: width3, height: height2 } = junctionElem._groups[0][0].getBBox();
+ junctionElem.width = width3;
+ junctionElem.height = height2;
+ db10.setElementForId(junction.id, junctionElem);
});
- } else {
- _result[keyNode] = valueNode;
- }
- delete overridableKeys[keyNode];
+ }, "drawJunctions");
}
- return _result;
+ });
+
+ // src/diagrams/architecture/architectureRenderer.ts
+ function addServices(services, cy) {
+ services.forEach((service) => {
+ cy.add({
+ group: "nodes",
+ data: {
+ type: "service",
+ id: service.id,
+ icon: service.icon,
+ label: service.title,
+ parent: service.in,
+ width: getConfigField("iconSize"),
+ height: getConfigField("iconSize")
+ },
+ classes: "node-service"
+ });
+ });
}
- __name(storeMappingPair, "storeMappingPair");
- function readLineBreak(state5) {
- var ch;
- ch = state5.input.charCodeAt(state5.position);
- if (ch === 10) {
- state5.position++;
- } else if (ch === 13) {
- state5.position++;
- if (state5.input.charCodeAt(state5.position) === 10) {
- state5.position++;
- }
- } else {
- throwError(state5, "a line break is expected");
- }
- state5.line += 1;
- state5.lineStart = state5.position;
- state5.firstTabInLine = -1;
+ function addJunctions(junctions, cy) {
+ junctions.forEach((junction) => {
+ cy.add({
+ group: "nodes",
+ data: {
+ type: "junction",
+ id: junction.id,
+ parent: junction.in,
+ width: getConfigField("iconSize"),
+ height: getConfigField("iconSize")
+ },
+ classes: "node-junction"
+ });
+ });
}
- __name(readLineBreak, "readLineBreak");
- function skipSeparationSpace(state5, allowComments, checkIndent) {
- var lineBreaks = 0, ch = state5.input.charCodeAt(state5.position);
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- if (ch === 9 && state5.firstTabInLine === -1) {
- state5.firstTabInLine = state5.position;
- }
- ch = state5.input.charCodeAt(++state5.position);
- }
- if (allowComments && ch === 35) {
- do {
- ch = state5.input.charCodeAt(++state5.position);
- } while (ch !== 10 && ch !== 13 && ch !== 0);
- }
- if (is_EOL(ch)) {
- readLineBreak(state5);
- ch = state5.input.charCodeAt(state5.position);
- lineBreaks++;
- state5.lineIndent = 0;
- while (ch === 32) {
- state5.lineIndent++;
- ch = state5.input.charCodeAt(++state5.position);
- }
- } else {
- break;
+ function positionNodes2(db10, cy) {
+ cy.nodes().map((node2) => {
+ const data6 = nodeData(node2);
+ if (data6.type === "group") {
+ return;
}
- }
- if (checkIndent !== -1 && lineBreaks !== 0 && state5.lineIndent < checkIndent) {
- throwWarning(state5, "deficient indentation");
- }
- return lineBreaks;
+ data6.x = node2.position().x;
+ data6.y = node2.position().y;
+ const nodeElem = db10.getElementById(data6.id);
+ nodeElem.attr("transform", "translate(" + (data6.x || 0) + "," + (data6.y || 0) + ")");
+ });
}
- __name(skipSeparationSpace, "skipSeparationSpace");
- function testDocumentSeparator(state5) {
- var _position = state5.position, ch;
- ch = state5.input.charCodeAt(_position);
- if ((ch === 45 || ch === 46) && ch === state5.input.charCodeAt(_position + 1) && ch === state5.input.charCodeAt(_position + 2)) {
- _position += 3;
- ch = state5.input.charCodeAt(_position);
- if (ch === 0 || is_WS_OR_EOL(ch)) {
- return true;
- }
- }
- return false;
+ function addGroups(groups, cy) {
+ groups.forEach((group2) => {
+ cy.add({
+ group: "nodes",
+ data: {
+ type: "group",
+ id: group2.id,
+ icon: group2.icon,
+ label: group2.title,
+ parent: group2.in
+ },
+ classes: "node-group"
+ });
+ });
}
- __name(testDocumentSeparator, "testDocumentSeparator");
- function writeFoldedLines(state5, count) {
- if (count === 1) {
- state5.result += " ";
- } else if (count > 1) {
- state5.result += common.repeat("\n", count - 1);
- }
+ function addEdges(edges3, cy) {
+ edges3.forEach((parsedEdge) => {
+ const { lhsId, rhsId, lhsInto, lhsGroup, rhsInto, lhsDir, rhsDir, rhsGroup, title: title2 } = parsedEdge;
+ const edgeType = isArchitectureDirectionXY(parsedEdge.lhsDir, parsedEdge.rhsDir) ? "segments" : "straight";
+ const edge = {
+ id: `${lhsId}-${rhsId}`,
+ label: title2,
+ source: lhsId,
+ sourceDir: lhsDir,
+ sourceArrow: lhsInto,
+ sourceGroup: lhsGroup,
+ sourceEndpoint: lhsDir === "L" ? "0 50%" : lhsDir === "R" ? "100% 50%" : lhsDir === "T" ? "50% 0" : "50% 100%",
+ target: rhsId,
+ targetDir: rhsDir,
+ targetArrow: rhsInto,
+ targetGroup: rhsGroup,
+ targetEndpoint: rhsDir === "L" ? "0 50%" : rhsDir === "R" ? "100% 50%" : rhsDir === "T" ? "50% 0" : "50% 100%"
+ };
+ cy.add({
+ group: "edges",
+ data: edge,
+ classes: edgeType
+ });
+ });
}
- __name(writeFoldedLines, "writeFoldedLines");
- function readPlainScalar(state5, nodeIndent, withinFlowCollection) {
- var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state5.kind, _result = state5.result, ch;
- ch = state5.input.charCodeAt(state5.position);
- if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
- return false;
- }
- if (ch === 63 || ch === 45) {
- following = state5.input.charCodeAt(state5.position + 1);
- if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
- return false;
- }
- }
- state5.kind = "scalar";
- state5.result = "";
- captureStart = captureEnd = state5.position;
- hasPendingContent = false;
- while (ch !== 0) {
- if (ch === 58) {
- following = state5.input.charCodeAt(state5.position + 1);
- if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
- break;
- }
- } else if (ch === 35) {
- preceding = state5.input.charCodeAt(state5.position - 1);
- if (is_WS_OR_EOL(preceding)) {
- break;
- }
- } else if (state5.position === state5.lineStart && testDocumentSeparator(state5) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
- break;
- } else if (is_EOL(ch)) {
- _line = state5.line;
- _lineStart = state5.lineStart;
- _lineIndent = state5.lineIndent;
- skipSeparationSpace(state5, false, -1);
- if (state5.lineIndent >= nodeIndent) {
- hasPendingContent = true;
- ch = state5.input.charCodeAt(state5.position);
- continue;
- } else {
- state5.position = captureEnd;
- state5.line = _line;
- state5.lineStart = _lineStart;
- state5.lineIndent = _lineIndent;
- break;
- }
- }
- if (hasPendingContent) {
- captureSegment(state5, captureStart, captureEnd, false);
- writeFoldedLines(state5, state5.line - _line);
- captureStart = captureEnd = state5.position;
- hasPendingContent = false;
- }
- if (!is_WHITE_SPACE(ch)) {
- captureEnd = state5.position + 1;
- }
- ch = state5.input.charCodeAt(++state5.position);
- }
- captureSegment(state5, captureStart, captureEnd, false);
- if (state5.result) {
- return true;
- }
- state5.kind = _kind;
- state5.result = _result;
- return false;
+ function getAlignments(db10, spatialMaps, groupAlignments) {
+ const flattenAlignments = /* @__PURE__ */ __name((alignmentObj, alignmentDir) => {
+ return Object.entries(alignmentObj).reduce(
+ (prev2, [dir2, alignments2]) => {
+ let cnt5 = 0;
+ const arr = Object.entries(alignments2);
+ if (arr.length === 1) {
+ prev2[dir2] = arr[0][1];
+ return prev2;
+ }
+ for (let i2 = 0; i2 < arr.length - 1; i2++) {
+ for (let j2 = i2 + 1; j2 < arr.length; j2++) {
+ const [aGroupId, aNodeIds] = arr[i2];
+ const [bGroupId, bNodeIds] = arr[j2];
+ const alignment = groupAlignments[aGroupId]?.[bGroupId];
+ if (alignment === alignmentDir) {
+ prev2[dir2] ??= [];
+ prev2[dir2] = [...prev2[dir2], ...aNodeIds, ...bNodeIds];
+ } else if (aGroupId === "default" || bGroupId === "default") {
+ prev2[dir2] ??= [];
+ prev2[dir2] = [...prev2[dir2], ...aNodeIds, ...bNodeIds];
+ } else {
+ const keyA = `${dir2}-${cnt5++}`;
+ prev2[keyA] = aNodeIds;
+ const keyB = `${dir2}-${cnt5++}`;
+ prev2[keyB] = bNodeIds;
+ }
+ }
+ }
+ return prev2;
+ },
+ {}
+ );
+ }, "flattenAlignments");
+ const alignments = spatialMaps.map((spatialMap) => {
+ const horizontalAlignments = {};
+ const verticalAlignments = {};
+ Object.entries(spatialMap).forEach(([id29, [x5, y5]]) => {
+ const nodeGroup = db10.getNode(id29)?.in ?? "default";
+ horizontalAlignments[y5] ??= {};
+ horizontalAlignments[y5][nodeGroup] ??= [];
+ horizontalAlignments[y5][nodeGroup].push(id29);
+ verticalAlignments[x5] ??= {};
+ verticalAlignments[x5][nodeGroup] ??= [];
+ verticalAlignments[x5][nodeGroup].push(id29);
+ });
+ return {
+ horiz: Object.values(flattenAlignments(horizontalAlignments, "horizontal")).filter(
+ (arr) => arr.length > 1
+ ),
+ vert: Object.values(flattenAlignments(verticalAlignments, "vertical")).filter(
+ (arr) => arr.length > 1
+ )
+ };
+ });
+ const [horizontal, vertical] = alignments.reduce(
+ ([prevHoriz, prevVert], { horiz, vert }) => {
+ return [
+ [...prevHoriz, ...horiz],
+ [...prevVert, ...vert]
+ ];
+ },
+ [[], []]
+ );
+ return {
+ horizontal,
+ vertical
+ };
}
- __name(readPlainScalar, "readPlainScalar");
- function readSingleQuotedScalar(state5, nodeIndent) {
- var ch, captureStart, captureEnd;
- ch = state5.input.charCodeAt(state5.position);
- if (ch !== 39) {
- return false;
- }
- state5.kind = "scalar";
- state5.result = "";
- state5.position++;
- captureStart = captureEnd = state5.position;
- while ((ch = state5.input.charCodeAt(state5.position)) !== 0) {
- if (ch === 39) {
- captureSegment(state5, captureStart, state5.position, true);
- ch = state5.input.charCodeAt(++state5.position);
- if (ch === 39) {
- captureStart = state5.position;
- state5.position++;
- captureEnd = state5.position;
- } else {
- return true;
+ function getRelativeConstraints(spatialMaps) {
+ const relativeConstraints = [];
+ const posToStr = /* @__PURE__ */ __name((pos) => `${pos[0]},${pos[1]}`, "posToStr");
+ const strToPos = /* @__PURE__ */ __name((pos) => pos.split(",").map((p3) => parseInt(p3)), "strToPos");
+ spatialMaps.forEach((spatialMap) => {
+ const invSpatialMap = Object.fromEntries(
+ Object.entries(spatialMap).map(([id29, pos]) => [posToStr(pos), id29])
+ );
+ const queue = [posToStr([0, 0])];
+ const visited = {};
+ const directions = {
+ L: [-1, 0],
+ R: [1, 0],
+ T: [0, 1],
+ B: [0, -1]
+ };
+ while (queue.length > 0) {
+ const curr = queue.shift();
+ if (curr) {
+ visited[curr] = 1;
+ const currId = invSpatialMap[curr];
+ if (currId) {
+ const currPos = strToPos(curr);
+ Object.entries(directions).forEach(([dir2, shift2]) => {
+ const newPos = posToStr([currPos[0] + shift2[0], currPos[1] + shift2[1]]);
+ const newId2 = invSpatialMap[newPos];
+ if (newId2 && !visited[newPos]) {
+ queue.push(newPos);
+ relativeConstraints.push({
+ [ArchitectureDirectionName[dir2]]: newId2,
+ [ArchitectureDirectionName[getOppositeArchitectureDirection(dir2)]]: currId,
+ gap: 1.5 * getConfigField("iconSize")
+ });
+ }
+ });
+ }
}
- } else if (is_EOL(ch)) {
- captureSegment(state5, captureStart, captureEnd, true);
- writeFoldedLines(state5, skipSeparationSpace(state5, false, nodeIndent));
- captureStart = captureEnd = state5.position;
- } else if (state5.position === state5.lineStart && testDocumentSeparator(state5)) {
- throwError(state5, "unexpected end of the document within a single quoted scalar");
- } else {
- state5.position++;
- captureEnd = state5.position;
}
- }
- throwError(state5, "unexpected end of the stream within a single quoted scalar");
+ });
+ return relativeConstraints;
}
- __name(readSingleQuotedScalar, "readSingleQuotedScalar");
- function readDoubleQuotedScalar(state5, nodeIndent) {
- var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
- ch = state5.input.charCodeAt(state5.position);
- if (ch !== 34) {
- return false;
- }
- state5.kind = "scalar";
- state5.result = "";
- state5.position++;
- captureStart = captureEnd = state5.position;
- while ((ch = state5.input.charCodeAt(state5.position)) !== 0) {
- if (ch === 34) {
- captureSegment(state5, captureStart, state5.position, true);
- state5.position++;
- return true;
- } else if (ch === 92) {
- captureSegment(state5, captureStart, state5.position, true);
- ch = state5.input.charCodeAt(++state5.position);
- if (is_EOL(ch)) {
- skipSeparationSpace(state5, false, nodeIndent);
- } else if (ch < 256 && simpleEscapeCheck[ch]) {
- state5.result += simpleEscapeMap[ch];
- state5.position++;
- } else if ((tmp = escapedHexLen(ch)) > 0) {
- hexLength = tmp;
- hexResult = 0;
- for (; hexLength > 0; hexLength--) {
- ch = state5.input.charCodeAt(++state5.position);
- if ((tmp = fromHexCode(ch)) >= 0) {
- hexResult = (hexResult << 4) + tmp;
- } else {
- throwError(state5, "expected hexadecimal character");
+ function layoutArchitecture(services, junctions, groups, edges3, db10, { spatialMaps, groupAlignments }) {
+ return new Promise((resolve3) => {
+ const renderEl = select_default2("body").append("div").attr("id", "cy").attr("style", "display:none");
+ const cy = cytoscape2({
+ container: document.getElementById("cy"),
+ style: [
+ {
+ selector: "edge",
+ style: {
+ "curve-style": "straight",
+ label: "data(label)",
+ "source-endpoint": "data(sourceEndpoint)",
+ "target-endpoint": "data(targetEndpoint)"
+ }
+ },
+ {
+ selector: "edge.segments",
+ style: {
+ "curve-style": "segments",
+ "segment-weights": "0",
+ "segment-distances": [0.5],
+ // @ts-ignore Incorrect library types
+ "edge-distances": "endpoints",
+ "source-endpoint": "data(sourceEndpoint)",
+ "target-endpoint": "data(targetEndpoint)"
+ }
+ },
+ {
+ selector: "node",
+ style: {
+ // @ts-ignore Incorrect library types
+ "compound-sizing-wrt-labels": "include"
+ }
+ },
+ {
+ selector: "node[label]",
+ style: {
+ "text-valign": "bottom",
+ "text-halign": "center",
+ "font-size": `${getConfigField("fontSize")}px`
+ }
+ },
+ {
+ selector: ".node-service",
+ style: {
+ label: "data(label)",
+ width: "data(width)",
+ height: "data(height)"
+ }
+ },
+ {
+ selector: ".node-junction",
+ style: {
+ width: "data(width)",
+ height: "data(height)"
+ }
+ },
+ {
+ selector: ".node-group",
+ style: {
+ // @ts-ignore Incorrect library types
+ padding: `${getConfigField("padding")}px`
}
}
- state5.result += charFromCodepoint(hexResult);
- state5.position++;
- } else {
- throwError(state5, "unknown escape sequence");
+ ]
+ });
+ renderEl.remove();
+ addGroups(groups, cy);
+ addServices(services, cy);
+ addJunctions(junctions, cy);
+ addEdges(edges3, cy);
+ const alignmentConstraint = getAlignments(db10, spatialMaps, groupAlignments);
+ const relativePlacementConstraint = getRelativeConstraints(spatialMaps);
+ const layout6 = cy.layout({
+ name: "fcose",
+ quality: "proof",
+ styleEnabled: false,
+ animate: false,
+ nodeDimensionsIncludeLabels: false,
+ // Adjust the edge parameters if it passes through the border of a group
+ // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67
+ idealEdgeLength(edge) {
+ const [nodeA, nodeB] = edge.connectedNodes();
+ const { parent: parentA } = nodeData(nodeA);
+ const { parent: parentB } = nodeData(nodeB);
+ const elasticity = parentA === parentB ? 1.5 * getConfigField("iconSize") : 0.5 * getConfigField("iconSize");
+ return elasticity;
+ },
+ edgeElasticity(edge) {
+ const [nodeA, nodeB] = edge.connectedNodes();
+ const { parent: parentA } = nodeData(nodeA);
+ const { parent: parentB } = nodeData(nodeB);
+ const elasticity = parentA === parentB ? 0.45 : 1e-3;
+ return elasticity;
+ },
+ alignmentConstraint,
+ relativePlacementConstraint
+ });
+ layout6.one("layoutstop", () => {
+ function getSegmentWeights(source, target, pointX, pointY) {
+ let W2, D3;
+ const { x: sX, y: sY } = source;
+ const { x: tX, y: tY } = target;
+ D3 = (pointY - sY + (sX - pointX) * (sY - tY) / (sX - tX)) / Math.sqrt(1 + Math.pow((sY - tY) / (sX - tX), 2));
+ W2 = Math.sqrt(Math.pow(pointY - sY, 2) + Math.pow(pointX - sX, 2) - Math.pow(D3, 2));
+ const distAB = Math.sqrt(Math.pow(tX - sX, 2) + Math.pow(tY - sY, 2));
+ W2 = W2 / distAB;
+ let delta1 = (tX - sX) * (pointY - sY) - (tY - sY) * (pointX - sX);
+ switch (true) {
+ case delta1 >= 0:
+ delta1 = 1;
+ break;
+ case delta1 < 0:
+ delta1 = -1;
+ break;
+ }
+ let delta2 = (tX - sX) * (pointX - sX) + (tY - sY) * (pointY - sY);
+ switch (true) {
+ case delta2 >= 0:
+ delta2 = 1;
+ break;
+ case delta2 < 0:
+ delta2 = -1;
+ break;
+ }
+ D3 = Math.abs(D3) * delta1;
+ W2 = W2 * delta2;
+ return {
+ distances: D3,
+ weights: W2
+ };
}
- captureStart = captureEnd = state5.position;
- } else if (is_EOL(ch)) {
- captureSegment(state5, captureStart, captureEnd, true);
- writeFoldedLines(state5, skipSeparationSpace(state5, false, nodeIndent));
- captureStart = captureEnd = state5.position;
- } else if (state5.position === state5.lineStart && testDocumentSeparator(state5)) {
- throwError(state5, "unexpected end of the document within a double quoted scalar");
- } else {
- state5.position++;
- captureEnd = state5.position;
- }
- }
- throwError(state5, "unexpected end of the stream within a double quoted scalar");
+ __name(getSegmentWeights, "getSegmentWeights");
+ cy.startBatch();
+ for (const edge of Object.values(cy.edges())) {
+ if (edge.data?.()) {
+ const { x: sX, y: sY } = edge.source().position();
+ const { x: tX, y: tY } = edge.target().position();
+ if (sX !== tX && sY !== tY) {
+ const sEP = edge.sourceEndpoint();
+ const tEP = edge.targetEndpoint();
+ const { sourceDir } = edgeData(edge);
+ const [pointX, pointY] = isArchitectureDirectionY(sourceDir) ? [sEP.x, tEP.y] : [tEP.x, sEP.y];
+ const { weights, distances: distances2 } = getSegmentWeights(sEP, tEP, pointX, pointY);
+ edge.style("segment-distances", distances2);
+ edge.style("segment-weights", weights);
+ }
+ }
+ }
+ cy.endBatch();
+ layout6.run();
+ });
+ layout6.run();
+ cy.ready((e3) => {
+ log.info("Ready", e3);
+ resolve3(cy);
+ });
+ });
}
- __name(readDoubleQuotedScalar, "readDoubleQuotedScalar");
- function readFlowCollection(state5, nodeIndent) {
- var readNext = true, _line, _lineStart, _pos, _tag2 = state5.tag, _result, _anchor = state5.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
- ch = state5.input.charCodeAt(state5.position);
- if (ch === 91) {
- terminator = 93;
- isMapping = false;
- _result = [];
- } else if (ch === 123) {
- terminator = 125;
- isMapping = true;
- _result = {};
- } else {
- return false;
- }
- if (state5.anchor !== null) {
- state5.anchorMap[state5.anchor] = _result;
+ var import_cytoscape_fcose, draw24, renderer8;
+ var init_architectureRenderer = __esm({
+ "src/diagrams/architecture/architectureRenderer.ts"() {
+ "use strict";
+ init_icons();
+ init_cytoscape_esm();
+ import_cytoscape_fcose = __toESM(require_cytoscape_fcose(), 1);
+ init_src32();
+ init_logger();
+ init_selectSvgElement();
+ init_setupGraphViewbox();
+ init_architectureDb();
+ init_architectureIcons();
+ init_architectureTypes();
+ init_svgDraw6();
+ registerIconPacks([
+ {
+ name: architectureIcons.prefix,
+ icons: architectureIcons
+ }
+ ]);
+ cytoscape2.use(import_cytoscape_fcose.default);
+ __name(addServices, "addServices");
+ __name(addJunctions, "addJunctions");
+ __name(positionNodes2, "positionNodes");
+ __name(addGroups, "addGroups");
+ __name(addEdges, "addEdges");
+ __name(getAlignments, "getAlignments");
+ __name(getRelativeConstraints, "getRelativeConstraints");
+ __name(layoutArchitecture, "layoutArchitecture");
+ draw24 = /* @__PURE__ */ __name(async (text4, id29, _version, diagObj) => {
+ const db10 = diagObj.db;
+ const services = db10.getServices();
+ const junctions = db10.getJunctions();
+ const groups = db10.getGroups();
+ const edges3 = db10.getEdges();
+ const ds = db10.getDataStructures();
+ const svg2 = selectSvgElement(id29);
+ const edgesElem = svg2.append("g");
+ edgesElem.attr("class", "architecture-edges");
+ const servicesElem = svg2.append("g");
+ servicesElem.attr("class", "architecture-services");
+ const groupElem = svg2.append("g");
+ groupElem.attr("class", "architecture-groups");
+ await drawServices(db10, servicesElem, services);
+ drawJunctions(db10, servicesElem, junctions);
+ const cy = await layoutArchitecture(services, junctions, groups, edges3, db10, ds);
+ await drawEdges2(edgesElem, cy);
+ await drawGroups(groupElem, cy);
+ positionNodes2(db10, cy);
+ setupGraphViewbox(void 0, svg2, getConfigField("padding"), getConfigField("useMaxWidth"));
+ }, "draw");
+ renderer8 = { draw: draw24 };
}
- ch = state5.input.charCodeAt(++state5.position);
- while (ch !== 0) {
- skipSeparationSpace(state5, true, nodeIndent);
- ch = state5.input.charCodeAt(state5.position);
- if (ch === terminator) {
- state5.position++;
- state5.tag = _tag2;
- state5.anchor = _anchor;
- state5.kind = isMapping ? "mapping" : "sequence";
- state5.result = _result;
- return true;
- } else if (!readNext) {
- throwError(state5, "missed comma between flow collection entries");
- } else if (ch === 44) {
- throwError(state5, "expected the node content, but found ','");
- }
- keyTag = keyNode = valueNode = null;
- isPair = isExplicitPair = false;
- if (ch === 63) {
- following = state5.input.charCodeAt(state5.position + 1);
- if (is_WS_OR_EOL(following)) {
- isPair = isExplicitPair = true;
- state5.position++;
- skipSeparationSpace(state5, true, nodeIndent);
- }
- }
- _line = state5.line;
- _lineStart = state5.lineStart;
- _pos = state5.position;
- composeNode(state5, nodeIndent, CONTEXT_FLOW_IN, false, true);
- keyTag = state5.tag;
- keyNode = state5.result;
- skipSeparationSpace(state5, true, nodeIndent);
- ch = state5.input.charCodeAt(state5.position);
- if ((isExplicitPair || state5.line === _line) && ch === 58) {
- isPair = true;
- ch = state5.input.charCodeAt(++state5.position);
- skipSeparationSpace(state5, true, nodeIndent);
- composeNode(state5, nodeIndent, CONTEXT_FLOW_IN, false, true);
- valueNode = state5.result;
- }
- if (isMapping) {
- storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
- } else if (isPair) {
- _result.push(storeMappingPair(state5, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
- } else {
- _result.push(keyNode);
- }
- skipSeparationSpace(state5, true, nodeIndent);
- ch = state5.input.charCodeAt(state5.position);
- if (ch === 44) {
- readNext = true;
- ch = state5.input.charCodeAt(++state5.position);
- } else {
- readNext = false;
- }
+ });
+
+ // src/diagrams/architecture/architectureDiagram.ts
+ var architectureDiagram_exports = {};
+ __export(architectureDiagram_exports, {
+ diagram: () => diagram25
+ });
+ var diagram25;
+ var init_architectureDiagram = __esm({
+ "src/diagrams/architecture/architectureDiagram.ts"() {
+ "use strict";
+ init_architectureParser();
+ init_architectureDb();
+ init_architectureStyles();
+ init_architectureRenderer();
+ diagram25 = {
+ parser: parser23,
+ db: db9,
+ renderer: renderer8,
+ styles: architectureStyles_default
+ };
}
- throwError(state5, "unexpected end of the stream within a flow collection");
- }
- __name(readFlowCollection, "readFlowCollection");
- function readBlockScalar(state5, nodeIndent) {
- var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
- ch = state5.input.charCodeAt(state5.position);
- if (ch === 124) {
- folding = false;
- } else if (ch === 62) {
- folding = true;
- } else {
+ });
+
+ // src/mermaid.ts
+ var mermaid_exports = {};
+ __export(mermaid_exports, {
+ default: () => mermaid_default
+ });
+ init_icons();
+ init_esm();
+ init_detectType();
+
+ // src/diagrams/c4/c4Detector.ts
+ var id2 = "c4";
+ var detector = /* @__PURE__ */ __name((txt) => {
+ return /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(txt);
+ }, "detector");
+ var loader = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_c4Diagram2(), c4Diagram_exports));
+ return { id: id2, diagram: diagram26 };
+ }, "loader");
+ var plugin = {
+ id: id2,
+ detector,
+ loader
+ };
+ var c4Detector_default = plugin;
+
+ // src/diagrams/flowchart/flowDetector.ts
+ var id3 = "flowchart";
+ var detector2 = /* @__PURE__ */ __name((txt, config5) => {
+ if (config5?.flowchart?.defaultRenderer === "dagre-wrapper" || config5?.flowchart?.defaultRenderer === "elk") {
return false;
}
- state5.kind = "scalar";
- state5.result = "";
- while (ch !== 0) {
- ch = state5.input.charCodeAt(++state5.position);
- if (ch === 43 || ch === 45) {
- if (CHOMPING_CLIP === chomping) {
- chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
- } else {
- throwError(state5, "repeat of a chomping mode identifier");
- }
- } else if ((tmp = fromDecimalCode(ch)) >= 0) {
- if (tmp === 0) {
- throwError(state5, "bad explicit indentation width of a block scalar; it cannot be less than one");
- } else if (!detectedIndent) {
- textIndent = nodeIndent + tmp - 1;
- detectedIndent = true;
- } else {
- throwError(state5, "repeat of an indentation width identifier");
- }
- } else {
- break;
- }
- }
- if (is_WHITE_SPACE(ch)) {
- do {
- ch = state5.input.charCodeAt(++state5.position);
- } while (is_WHITE_SPACE(ch));
- if (ch === 35) {
- do {
- ch = state5.input.charCodeAt(++state5.position);
- } while (!is_EOL(ch) && ch !== 0);
- }
+ return /^\s*graph/.test(txt);
+ }, "detector");
+ var loader3 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports));
+ return { id: id3, diagram: diagram26 };
+ }, "loader");
+ var plugin2 = {
+ id: id3,
+ detector: detector2,
+ loader: loader3
+ };
+ var flowDetector_default = plugin2;
+
+ // src/diagrams/flowchart/flowDetector-v2.ts
+ var id4 = "flowchart-v2";
+ var detector3 = /* @__PURE__ */ __name((txt, config5) => {
+ if (config5?.flowchart?.defaultRenderer === "dagre-d3") {
+ return false;
}
- while (ch !== 0) {
- readLineBreak(state5);
- state5.lineIndent = 0;
- ch = state5.input.charCodeAt(state5.position);
- while ((!detectedIndent || state5.lineIndent < textIndent) && ch === 32) {
- state5.lineIndent++;
- ch = state5.input.charCodeAt(++state5.position);
- }
- if (!detectedIndent && state5.lineIndent > textIndent) {
- textIndent = state5.lineIndent;
- }
- if (is_EOL(ch)) {
- emptyLines++;
- continue;
- }
- if (state5.lineIndent < textIndent) {
- if (chomping === CHOMPING_KEEP) {
- state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
- } else if (chomping === CHOMPING_CLIP) {
- if (didReadContent) {
- state5.result += "\n";
- }
- }
- break;
- }
- if (folding) {
- if (is_WHITE_SPACE(ch)) {
- atMoreIndented = true;
- state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
- } else if (atMoreIndented) {
- atMoreIndented = false;
- state5.result += common.repeat("\n", emptyLines + 1);
- } else if (emptyLines === 0) {
- if (didReadContent) {
- state5.result += " ";
- }
- } else {
- state5.result += common.repeat("\n", emptyLines);
- }
- } else {
- state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
- }
- didReadContent = true;
- detectedIndent = true;
- emptyLines = 0;
- captureStart = state5.position;
- while (!is_EOL(ch) && ch !== 0) {
- ch = state5.input.charCodeAt(++state5.position);
- }
- captureSegment(state5, captureStart, state5.position, false);
+ if (config5?.flowchart?.defaultRenderer === "elk") {
+ config5.layout = "elk";
}
- return true;
- }
- __name(readBlockScalar, "readBlockScalar");
- function readBlockSequence(state5, nodeIndent) {
- var _line, _tag2 = state5.tag, _anchor = state5.anchor, _result = [], following, detected = false, ch;
- if (state5.firstTabInLine !== -1) return false;
- if (state5.anchor !== null) {
- state5.anchorMap[state5.anchor] = _result;
+ if (/^\s*graph/.test(txt) && config5?.flowchart?.defaultRenderer === "dagre-wrapper") {
+ return true;
}
- ch = state5.input.charCodeAt(state5.position);
- while (ch !== 0) {
- if (state5.firstTabInLine !== -1) {
- state5.position = state5.firstTabInLine;
- throwError(state5, "tab characters must not be used in indentation");
- }
- if (ch !== 45) {
- break;
- }
- following = state5.input.charCodeAt(state5.position + 1);
- if (!is_WS_OR_EOL(following)) {
- break;
- }
- detected = true;
- state5.position++;
- if (skipSeparationSpace(state5, true, -1)) {
- if (state5.lineIndent <= nodeIndent) {
- _result.push(null);
- ch = state5.input.charCodeAt(state5.position);
- continue;
- }
- }
- _line = state5.line;
- composeNode(state5, nodeIndent, CONTEXT_BLOCK_IN, false, true);
- _result.push(state5.result);
- skipSeparationSpace(state5, true, -1);
- ch = state5.input.charCodeAt(state5.position);
- if ((state5.line === _line || state5.lineIndent > nodeIndent) && ch !== 0) {
- throwError(state5, "bad indentation of a sequence entry");
- } else if (state5.lineIndent < nodeIndent) {
- break;
- }
+ return /^\s*flowchart/.test(txt);
+ }, "detector");
+ var loader4 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports));
+ return { id: id4, diagram: diagram26 };
+ }, "loader");
+ var plugin3 = {
+ id: id4,
+ detector: detector3,
+ loader: loader4
+ };
+ var flowDetector_v2_default = plugin3;
+
+ // src/diagrams/er/erDetector.ts
+ var id5 = "er";
+ var detector4 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*erDiagram/.test(txt);
+ }, "detector");
+ var loader5 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_erDiagram2(), erDiagram_exports));
+ return { id: id5, diagram: diagram26 };
+ }, "loader");
+ var plugin4 = {
+ id: id5,
+ detector: detector4,
+ loader: loader5
+ };
+ var erDetector_default = plugin4;
+
+ // src/diagrams/git/gitGraphDetector.ts
+ var id6 = "gitGraph";
+ var detector5 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*gitGraph/.test(txt);
+ }, "detector");
+ var loader6 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_gitGraphDiagram(), gitGraphDiagram_exports));
+ return { id: id6, diagram: diagram26 };
+ }, "loader");
+ var plugin5 = {
+ id: id6,
+ detector: detector5,
+ loader: loader6
+ };
+ var gitGraphDetector_default = plugin5;
+
+ // src/diagrams/gantt/ganttDetector.ts
+ var id7 = "gantt";
+ var detector6 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*gantt/.test(txt);
+ }, "detector");
+ var loader7 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_ganttDiagram(), ganttDiagram_exports));
+ return { id: id7, diagram: diagram26 };
+ }, "loader");
+ var plugin6 = {
+ id: id7,
+ detector: detector6,
+ loader: loader7
+ };
+ var ganttDetector_default = plugin6;
+
+ // src/diagrams/info/infoDetector.ts
+ var id8 = "info";
+ var detector7 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*info/.test(txt);
+ }, "detector");
+ var loader8 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_infoDiagram(), infoDiagram_exports));
+ return { id: id8, diagram: diagram26 };
+ }, "loader");
+ var info = {
+ id: id8,
+ detector: detector7,
+ loader: loader8
+ };
+
+ // src/diagrams/pie/pieDetector.ts
+ var id9 = "pie";
+ var detector8 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*pie/.test(txt);
+ }, "detector");
+ var loader9 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_pieDiagram(), pieDiagram_exports));
+ return { id: id9, diagram: diagram26 };
+ }, "loader");
+ var pie = {
+ id: id9,
+ detector: detector8,
+ loader: loader9
+ };
+
+ // src/diagrams/quadrant-chart/quadrantDetector.ts
+ var id10 = "quadrantChart";
+ var detector9 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*quadrantChart/.test(txt);
+ }, "detector");
+ var loader10 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_quadrantDiagram(), quadrantDiagram_exports));
+ return { id: id10, diagram: diagram26 };
+ }, "loader");
+ var plugin7 = {
+ id: id10,
+ detector: detector9,
+ loader: loader10
+ };
+ var quadrantDetector_default = plugin7;
+
+ // src/diagrams/xychart/xychartDetector.ts
+ var id11 = "xychart";
+ var detector10 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*xychart-beta/.test(txt);
+ }, "detector");
+ var loader11 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_xychartDiagram(), xychartDiagram_exports));
+ return { id: id11, diagram: diagram26 };
+ }, "loader");
+ var plugin8 = {
+ id: id11,
+ detector: detector10,
+ loader: loader11
+ };
+ var xychartDetector_default = plugin8;
+
+ // src/diagrams/requirement/requirementDetector.ts
+ var id12 = "requirement";
+ var detector11 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*requirement(Diagram)?/.test(txt);
+ }, "detector");
+ var loader12 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_requirementDiagram2(), requirementDiagram_exports));
+ return { id: id12, diagram: diagram26 };
+ }, "loader");
+ var plugin9 = {
+ id: id12,
+ detector: detector11,
+ loader: loader12
+ };
+ var requirementDetector_default = plugin9;
+
+ // src/diagrams/sequence/sequenceDetector.ts
+ var id13 = "sequence";
+ var detector12 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*sequenceDiagram/.test(txt);
+ }, "detector");
+ var loader13 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_sequenceDiagram2(), sequenceDiagram_exports));
+ return { id: id13, diagram: diagram26 };
+ }, "loader");
+ var plugin10 = {
+ id: id13,
+ detector: detector12,
+ loader: loader13
+ };
+ var sequenceDetector_default = plugin10;
+
+ // src/diagrams/class/classDetector.ts
+ var id14 = "class";
+ var detector13 = /* @__PURE__ */ __name((txt, config5) => {
+ if (config5?.class?.defaultRenderer === "dagre-wrapper") {
+ return false;
}
- if (detected) {
- state5.tag = _tag2;
- state5.anchor = _anchor;
- state5.kind = "sequence";
- state5.result = _result;
+ return /^\s*classDiagram/.test(txt);
+ }, "detector");
+ var loader14 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_classDiagram2(), classDiagram_exports));
+ return { id: id14, diagram: diagram26 };
+ }, "loader");
+ var plugin11 = {
+ id: id14,
+ detector: detector13,
+ loader: loader14
+ };
+ var classDetector_default = plugin11;
+
+ // src/diagrams/class/classDetector-V2.ts
+ var id15 = "classDiagram";
+ var detector14 = /* @__PURE__ */ __name((txt, config5) => {
+ if (/^\s*classDiagram/.test(txt) && config5?.class?.defaultRenderer === "dagre-wrapper") {
return true;
}
- return false;
- }
- __name(readBlockSequence, "readBlockSequence");
- function readBlockMapping(state5, nodeIndent, flowIndent) {
- var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag2 = state5.tag, _anchor = state5.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
- if (state5.firstTabInLine !== -1) return false;
- if (state5.anchor !== null) {
- state5.anchorMap[state5.anchor] = _result;
+ return /^\s*classDiagram-v2/.test(txt);
+ }, "detector");
+ var loader15 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_classDiagram_v2(), classDiagram_v2_exports));
+ return { id: id15, diagram: diagram26 };
+ }, "loader");
+ var plugin12 = {
+ id: id15,
+ detector: detector14,
+ loader: loader15
+ };
+ var classDetector_V2_default = plugin12;
+
+ // src/diagrams/state/stateDetector.ts
+ var id16 = "state";
+ var detector15 = /* @__PURE__ */ __name((txt, config5) => {
+ if (config5?.state?.defaultRenderer === "dagre-wrapper") {
+ return false;
}
- ch = state5.input.charCodeAt(state5.position);
- while (ch !== 0) {
- if (!atExplicitKey && state5.firstTabInLine !== -1) {
- state5.position = state5.firstTabInLine;
- throwError(state5, "tab characters must not be used in indentation");
- }
- following = state5.input.charCodeAt(state5.position + 1);
- _line = state5.line;
- if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
- if (ch === 63) {
- if (atExplicitKey) {
- storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
- detected = true;
- atExplicitKey = true;
- allowCompact = true;
- } else if (atExplicitKey) {
- atExplicitKey = false;
- allowCompact = true;
- } else {
- throwError(state5, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
- }
- state5.position += 1;
- ch = following;
- } else {
- _keyLine = state5.line;
- _keyLineStart = state5.lineStart;
- _keyPos = state5.position;
- if (!composeNode(state5, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
- break;
- }
- if (state5.line === _line) {
- ch = state5.input.charCodeAt(state5.position);
- while (is_WHITE_SPACE(ch)) {
- ch = state5.input.charCodeAt(++state5.position);
- }
- if (ch === 58) {
- ch = state5.input.charCodeAt(++state5.position);
- if (!is_WS_OR_EOL(ch)) {
- throwError(state5, "a whitespace character is expected after the key-value separator within a block mapping");
- }
- if (atExplicitKey) {
- storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
- detected = true;
- atExplicitKey = false;
- allowCompact = false;
- keyTag = state5.tag;
- keyNode = state5.result;
- } else if (detected) {
- throwError(state5, "can not read an implicit mapping pair; a colon is missed");
- } else {
- state5.tag = _tag2;
- state5.anchor = _anchor;
- return true;
- }
- } else if (detected) {
- throwError(state5, "can not read a block mapping entry; a multiline key may not be an implicit key");
- } else {
- state5.tag = _tag2;
- state5.anchor = _anchor;
- return true;
- }
- }
- if (state5.line === _line || state5.lineIndent > nodeIndent) {
- if (atExplicitKey) {
- _keyLine = state5.line;
- _keyLineStart = state5.lineStart;
- _keyPos = state5.position;
- }
- if (composeNode(state5, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
- if (atExplicitKey) {
- keyNode = state5.result;
- } else {
- valueNode = state5.result;
- }
- }
- if (!atExplicitKey) {
- storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
- skipSeparationSpace(state5, true, -1);
- ch = state5.input.charCodeAt(state5.position);
- }
- if ((state5.line === _line || state5.lineIndent > nodeIndent) && ch !== 0) {
- throwError(state5, "bad indentation of a mapping entry");
- } else if (state5.lineIndent < nodeIndent) {
- break;
- }
+ return /^\s*stateDiagram/.test(txt);
+ }, "detector");
+ var loader16 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_stateDiagram2(), stateDiagram_exports));
+ return { id: id16, diagram: diagram26 };
+ }, "loader");
+ var plugin13 = {
+ id: id16,
+ detector: detector15,
+ loader: loader16
+ };
+ var stateDetector_default = plugin13;
+
+ // src/diagrams/state/stateDetector-V2.ts
+ var id17 = "stateDiagram";
+ var detector16 = /* @__PURE__ */ __name((txt, config5) => {
+ if (/^\s*stateDiagram-v2/.test(txt)) {
+ return true;
}
- if (atExplicitKey) {
- storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ if (/^\s*stateDiagram/.test(txt) && config5?.state?.defaultRenderer === "dagre-wrapper") {
+ return true;
}
- if (detected) {
- state5.tag = _tag2;
- state5.anchor = _anchor;
- state5.kind = "mapping";
- state5.result = _result;
+ return false;
+ }, "detector");
+ var loader17 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_stateDiagram_v2(), stateDiagram_v2_exports));
+ return { id: id17, diagram: diagram26 };
+ }, "loader");
+ var plugin14 = {
+ id: id17,
+ detector: detector16,
+ loader: loader17
+ };
+ var stateDetector_V2_default = plugin14;
+
+ // src/diagrams/user-journey/journeyDetector.ts
+ var id18 = "journey";
+ var detector17 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*journey/.test(txt);
+ }, "detector");
+ var loader18 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_journeyDiagram(), journeyDiagram_exports));
+ return { id: id18, diagram: diagram26 };
+ }, "loader");
+ var plugin15 = {
+ id: id18,
+ detector: detector17,
+ loader: loader18
+ };
+ var journeyDetector_default = plugin15;
+
+ // src/diagrams/error/errorRenderer.ts
+ init_logger();
+ init_selectSvgElement();
+ init_setupGraphViewbox();
+ var draw16 = /* @__PURE__ */ __name((_text, id29, version2) => {
+ log.debug("rendering svg for syntax error\n");
+ const svg2 = selectSvgElement(id29);
+ const g2 = svg2.append("g");
+ svg2.attr("viewBox", "0 0 2412 512");
+ configureSvgSize(svg2, 100, 512, true);
+ g2.append("path").attr("class", "error-icon").attr(
+ "d",
+ "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"
+ );
+ g2.append("path").attr("class", "error-icon").attr(
+ "d",
+ "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"
+ );
+ g2.append("path").attr("class", "error-icon").attr(
+ "d",
+ "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"
+ );
+ g2.append("path").attr("class", "error-icon").attr(
+ "d",
+ "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"
+ );
+ g2.append("path").attr("class", "error-icon").attr(
+ "d",
+ "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"
+ );
+ g2.append("path").attr("class", "error-icon").attr(
+ "d",
+ "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"
+ );
+ g2.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text");
+ g2.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${version2}`);
+ }, "draw");
+ var renderer3 = { draw: draw16 };
+ var errorRenderer_default = renderer3;
+
+ // src/diagrams/error/errorDiagram.ts
+ var diagram17 = {
+ db: {},
+ renderer: renderer3,
+ parser: {
+ parse: /* @__PURE__ */ __name(() => {
+ return;
+ }, "parse")
}
- return detected;
- }
- __name(readBlockMapping, "readBlockMapping");
- function readTagProperty(state5) {
- var _position, isVerbatim = false, isNamed2 = false, tagHandle, tagName, ch;
- ch = state5.input.charCodeAt(state5.position);
- if (ch !== 33) return false;
- if (state5.tag !== null) {
- throwError(state5, "duplication of a tag property");
+ };
+ var errorDiagram_default = diagram17;
+
+ // src/diagrams/flowchart/elk/detector.ts
+ var id19 = "flowchart-elk";
+ var detector18 = /* @__PURE__ */ __name((txt, config5 = {}) => {
+ if (
+ // If diagram explicitly states flowchart-elk
+ /^\s*flowchart-elk/.test(txt) || // If a flowchart/graph diagram has their default renderer set to elk
+ /^\s*flowchart|graph/.test(txt) && config5?.flowchart?.defaultRenderer === "elk"
+ ) {
+ config5.layout = "elk";
+ return true;
}
- ch = state5.input.charCodeAt(++state5.position);
- if (ch === 60) {
- isVerbatim = true;
- ch = state5.input.charCodeAt(++state5.position);
- } else if (ch === 33) {
- isNamed2 = true;
- tagHandle = "!!";
- ch = state5.input.charCodeAt(++state5.position);
- } else {
- tagHandle = "!";
+ return false;
+ }, "detector");
+ var loader19 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports));
+ return { id: id19, diagram: diagram26 };
+ }, "loader");
+ var plugin16 = {
+ id: id19,
+ detector: detector18,
+ loader: loader19
+ };
+ var detector_default = plugin16;
+
+ // src/diagrams/timeline/detector.ts
+ var id20 = "timeline";
+ var detector19 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*timeline/.test(txt);
+ }, "detector");
+ var loader20 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_timeline_definition(), timeline_definition_exports));
+ return { id: id20, diagram: diagram26 };
+ }, "loader");
+ var plugin17 = {
+ id: id20,
+ detector: detector19,
+ loader: loader20
+ };
+ var detector_default2 = plugin17;
+
+ // src/diagrams/mindmap/detector.ts
+ var id22 = "mindmap";
+ var detector20 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*mindmap/.test(txt);
+ }, "detector");
+ var loader21 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_mindmap_definition(), mindmap_definition_exports));
+ return { id: id22, diagram: diagram26 };
+ }, "loader");
+ var plugin18 = {
+ id: id22,
+ detector: detector20,
+ loader: loader21
+ };
+ var detector_default3 = plugin18;
+
+ // src/diagrams/kanban/detector.ts
+ var id23 = "kanban";
+ var detector21 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*kanban/.test(txt);
+ }, "detector");
+ var loader22 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_kanban_definition(), kanban_definition_exports));
+ return { id: id23, diagram: diagram26 };
+ }, "loader");
+ var plugin19 = {
+ id: id23,
+ detector: detector21,
+ loader: loader22
+ };
+ var detector_default4 = plugin19;
+
+ // src/diagrams/sankey/sankeyDetector.ts
+ var id24 = "sankey";
+ var detector22 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*sankey-beta/.test(txt);
+ }, "detector");
+ var loader23 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_sankeyDiagram(), sankeyDiagram_exports));
+ return { id: id24, diagram: diagram26 };
+ }, "loader");
+ var plugin20 = {
+ id: id24,
+ detector: detector22,
+ loader: loader23
+ };
+ var sankeyDetector_default = plugin20;
+
+ // src/diagrams/packet/detector.ts
+ var id25 = "packet";
+ var detector23 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*packet-beta/.test(txt);
+ }, "detector");
+ var loader24 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_diagram(), diagram_exports));
+ return { id: id25, diagram: diagram26 };
+ }, "loader");
+ var packet = {
+ id: id25,
+ detector: detector23,
+ loader: loader24
+ };
+
+ // src/diagrams/radar/detector.ts
+ var id26 = "radar";
+ var detector24 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*radar-beta/.test(txt);
+ }, "detector");
+ var loader25 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_diagram2(), diagram_exports2));
+ return { id: id26, diagram: diagram26 };
+ }, "loader");
+ var radar = {
+ id: id26,
+ detector: detector24,
+ loader: loader25
+ };
+
+ // src/diagrams/block/blockDetector.ts
+ var id27 = "block";
+ var detector25 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*block-beta/.test(txt);
+ }, "detector");
+ var loader26 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_blockDiagram(), blockDiagram_exports));
+ return { id: id27, diagram: diagram26 };
+ }, "loader");
+ var plugin21 = {
+ id: id27,
+ detector: detector25,
+ loader: loader26
+ };
+ var blockDetector_default = plugin21;
+
+ // src/diagrams/architecture/architectureDetector.ts
+ var id28 = "architecture";
+ var detector26 = /* @__PURE__ */ __name((txt) => {
+ return /^\s*architecture/.test(txt);
+ }, "detector");
+ var loader27 = /* @__PURE__ */ __name(async () => {
+ const { diagram: diagram26 } = await Promise.resolve().then(() => (init_architectureDiagram(), architectureDiagram_exports));
+ return { id: id28, diagram: diagram26 };
+ }, "loader");
+ var architecture = {
+ id: id28,
+ detector: detector26,
+ loader: loader27
+ };
+ var architectureDetector_default = architecture;
+
+ // src/diagram-api/diagram-orchestration.ts
+ init_detectType();
+ init_diagramAPI();
+ var hasLoadedDiagrams = false;
+ var addDiagrams = /* @__PURE__ */ __name(() => {
+ if (hasLoadedDiagrams) {
+ return;
}
- _position = state5.position;
- if (isVerbatim) {
- do {
- ch = state5.input.charCodeAt(++state5.position);
- } while (ch !== 0 && ch !== 62);
- if (state5.position < state5.length) {
- tagName = state5.input.slice(_position, state5.position);
- ch = state5.input.charCodeAt(++state5.position);
- } else {
- throwError(state5, "unexpected end of the stream within a verbatim tag");
+ hasLoadedDiagrams = true;
+ registerDiagram("error", errorDiagram_default, (text4) => {
+ return text4.toLowerCase().trim() === "error";
+ });
+ registerDiagram(
+ "---",
+ // --- diagram type may appear if YAML front-matter is not parsed correctly
+ {
+ db: {
+ clear: /* @__PURE__ */ __name(() => {
+ }, "clear")
+ },
+ styles: {},
+ // should never be used
+ renderer: {
+ draw: /* @__PURE__ */ __name(() => {
+ }, "draw")
+ },
+ parser: {
+ parse: /* @__PURE__ */ __name(() => {
+ throw new Error(
+ "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks"
+ );
+ }, "parse")
+ },
+ init: /* @__PURE__ */ __name(() => null, "init")
+ // no op
+ },
+ (text4) => {
+ return text4.toLowerCase().trimStart().startsWith("---");
}
- } else {
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- if (ch === 33) {
- if (!isNamed2) {
- tagHandle = state5.input.slice(_position - 1, state5.position + 1);
- if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
- throwError(state5, "named tag handle cannot contain such characters");
+ );
+ registerLazyLoadedDiagrams(
+ c4Detector_default,
+ detector_default4,
+ classDetector_V2_default,
+ classDetector_default,
+ erDetector_default,
+ ganttDetector_default,
+ info,
+ pie,
+ requirementDetector_default,
+ sequenceDetector_default,
+ detector_default,
+ flowDetector_v2_default,
+ flowDetector_default,
+ detector_default3,
+ detector_default2,
+ gitGraphDetector_default,
+ stateDetector_V2_default,
+ stateDetector_default,
+ journeyDetector_default,
+ quadrantDetector_default,
+ sankeyDetector_default,
+ packet,
+ xychartDetector_default,
+ blockDetector_default,
+ architectureDetector_default,
+ radar
+ );
+ }, "addDiagrams");
+
+ // src/diagram-api/loadDiagram.ts
+ init_logger();
+ init_detectType();
+ init_diagramAPI();
+ var loadRegisteredDiagrams = /* @__PURE__ */ __name(async () => {
+ log.debug(`Loading registered diagrams`);
+ const results = await Promise.allSettled(
+ Object.entries(detectors).map(async ([key, { detector: detector27, loader: loader28 }]) => {
+ if (loader28) {
+ try {
+ getDiagram(key);
+ } catch {
+ try {
+ const { diagram: diagram26, id: id29 } = await loader28();
+ registerDiagram(id29, diagram26, detector27);
+ } catch (err) {
+ log.error(`Failed to load external diagram with key ${key}. Removing from detectors.`);
+ delete detectors[key];
+ throw err;
}
- isNamed2 = true;
- _position = state5.position + 1;
- } else {
- throwError(state5, "tag suffix cannot contain exclamation marks");
}
}
- ch = state5.input.charCodeAt(++state5.position);
- }
- tagName = state5.input.slice(_position, state5.position);
- if (PATTERN_FLOW_INDICATORS.test(tagName)) {
- throwError(state5, "tag suffix cannot contain flow indicator characters");
+ })
+ );
+ const failed = results.filter((result) => result.status === "rejected");
+ if (failed.length > 0) {
+ log.error(`Failed to load ${failed.length} external diagrams`);
+ for (const res of failed) {
+ log.error(res);
}
+ throw new Error(`Failed to load ${failed.length} external diagrams`);
}
- if (tagName && !PATTERN_TAG_URI.test(tagName)) {
- throwError(state5, "tag name cannot contain such characters: " + tagName);
- }
- try {
- tagName = decodeURIComponent(tagName);
- } catch (err) {
- throwError(state5, "tag name is malformed: " + tagName);
- }
- if (isVerbatim) {
- state5.tag = tagName;
- } else if (_hasOwnProperty$1.call(state5.tagMap, tagHandle)) {
- state5.tag = state5.tagMap[tagHandle] + tagName;
- } else if (tagHandle === "!") {
- state5.tag = "!" + tagName;
- } else if (tagHandle === "!!") {
- state5.tag = "tag:yaml.org,2002:" + tagName;
- } else {
- throwError(state5, 'undeclared tag handle "' + tagHandle + '"');
- }
- return true;
+ }, "loadRegisteredDiagrams");
+
+ // src/mermaid.ts
+ init_logger();
+
+ // src/mermaidAPI.ts
+ init_src32();
+
+ // ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Enum.js
+ var COMMENT = "comm";
+ var RULESET = "rule";
+ var DECLARATION = "decl";
+ var IMPORT = "@import";
+ var NAMESPACE = "@namespace";
+ var KEYFRAMES = "@keyframes";
+ var LAYER = "@layer";
+
+ // ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Utility.js
+ var abs3 = Math.abs;
+ var from = String.fromCharCode;
+ function trim(value2) {
+ return value2.trim();
}
- __name(readTagProperty, "readTagProperty");
- function readAnchorProperty(state5) {
- var _position, ch;
- ch = state5.input.charCodeAt(state5.position);
- if (ch !== 38) return false;
- if (state5.anchor !== null) {
- throwError(state5, "duplication of an anchor property");
- }
- ch = state5.input.charCodeAt(++state5.position);
- _position = state5.position;
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state5.input.charCodeAt(++state5.position);
- }
- if (state5.position === _position) {
- throwError(state5, "name of an anchor node must contain at least one character");
- }
- state5.anchor = state5.input.slice(_position, state5.position);
- return true;
+ __name(trim, "trim");
+ function replace(value2, pattern, replacement) {
+ return value2.replace(pattern, replacement);
}
- __name(readAnchorProperty, "readAnchorProperty");
- function readAlias(state5) {
- var _position, alias, ch;
- ch = state5.input.charCodeAt(state5.position);
- if (ch !== 42) return false;
- ch = state5.input.charCodeAt(++state5.position);
- _position = state5.position;
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state5.input.charCodeAt(++state5.position);
- }
- if (state5.position === _position) {
- throwError(state5, "name of an alias node must contain at least one character");
- }
- alias = state5.input.slice(_position, state5.position);
- if (!_hasOwnProperty$1.call(state5.anchorMap, alias)) {
- throwError(state5, 'unidentified alias "' + alias + '"');
- }
- state5.result = state5.anchorMap[alias];
- skipSeparationSpace(state5, true, -1);
- return true;
+ __name(replace, "replace");
+ function indexof(value2, search, position5) {
+ return value2.indexOf(search, position5);
}
- __name(readAlias, "readAlias");
- function composeNode(state5, parentIndent, nodeContext, allowToSeek, allowCompact) {
- var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type3, flowIndent, blockIndent;
- if (state5.listener !== null) {
- state5.listener("open", state5);
- }
- state5.tag = null;
- state5.anchor = null;
- state5.kind = null;
- state5.result = null;
- allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
- if (allowToSeek) {
- if (skipSeparationSpace(state5, true, -1)) {
- atNewLine = true;
- if (state5.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state5.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state5.lineIndent < parentIndent) {
- indentStatus = -1;
- }
- }
- }
- if (indentStatus === 1) {
- while (readTagProperty(state5) || readAnchorProperty(state5)) {
- if (skipSeparationSpace(state5, true, -1)) {
- atNewLine = true;
- allowBlockCollections = allowBlockStyles;
- if (state5.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state5.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state5.lineIndent < parentIndent) {
- indentStatus = -1;
- }
- } else {
- allowBlockCollections = false;
- }
- }
- }
- if (allowBlockCollections) {
- allowBlockCollections = atNewLine || allowCompact;
- }
- if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
- if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
- flowIndent = parentIndent;
- } else {
- flowIndent = parentIndent + 1;
- }
- blockIndent = state5.position - state5.lineStart;
- if (indentStatus === 1) {
- if (allowBlockCollections && (readBlockSequence(state5, blockIndent) || readBlockMapping(state5, blockIndent, flowIndent)) || readFlowCollection(state5, flowIndent)) {
- hasContent = true;
- } else {
- if (allowBlockScalars && readBlockScalar(state5, flowIndent) || readSingleQuotedScalar(state5, flowIndent) || readDoubleQuotedScalar(state5, flowIndent)) {
- hasContent = true;
- } else if (readAlias(state5)) {
- hasContent = true;
- if (state5.tag !== null || state5.anchor !== null) {
- throwError(state5, "alias node should not have any properties");
- }
- } else if (readPlainScalar(state5, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
- hasContent = true;
- if (state5.tag === null) {
- state5.tag = "?";
- }
- }
- if (state5.anchor !== null) {
- state5.anchorMap[state5.anchor] = state5.result;
- }
- }
- } else if (indentStatus === 0) {
- hasContent = allowBlockCollections && readBlockSequence(state5, blockIndent);
- }
- }
- if (state5.tag === null) {
- if (state5.anchor !== null) {
- state5.anchorMap[state5.anchor] = state5.result;
- }
- } else if (state5.tag === "?") {
- if (state5.result !== null && state5.kind !== "scalar") {
- throwError(state5, 'unacceptable node kind for !> tag; it should be "scalar", not "' + state5.kind + '"');
- }
- for (typeIndex = 0, typeQuantity = state5.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
- type3 = state5.implicitTypes[typeIndex];
- if (type3.resolve(state5.result)) {
- state5.result = type3.construct(state5.result);
- state5.tag = type3.tag;
- if (state5.anchor !== null) {
- state5.anchorMap[state5.anchor] = state5.result;
- }
- break;
- }
- }
- } else if (state5.tag !== "!") {
- if (_hasOwnProperty$1.call(state5.typeMap[state5.kind || "fallback"], state5.tag)) {
- type3 = state5.typeMap[state5.kind || "fallback"][state5.tag];
- } else {
- type3 = null;
- typeList = state5.typeMap.multi[state5.kind || "fallback"];
- for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
- if (state5.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
- type3 = typeList[typeIndex];
- break;
- }
- }
- }
- if (!type3) {
- throwError(state5, "unknown tag !<" + state5.tag + ">");
- }
- if (state5.result !== null && type3.kind !== state5.kind) {
- throwError(state5, "unacceptable node kind for !<" + state5.tag + '> tag; it should be "' + type3.kind + '", not "' + state5.kind + '"');
- }
- if (!type3.resolve(state5.result, state5.tag)) {
- throwError(state5, "cannot resolve a node with !<" + state5.tag + "> explicit tag");
- } else {
- state5.result = type3.construct(state5.result, state5.tag);
- if (state5.anchor !== null) {
- state5.anchorMap[state5.anchor] = state5.result;
- }
- }
- }
- if (state5.listener !== null) {
- state5.listener("close", state5);
- }
- return state5.tag !== null || state5.anchor !== null || hasContent;
+ __name(indexof, "indexof");
+ function charat(value2, index) {
+ return value2.charCodeAt(index) | 0;
}
- __name(composeNode, "composeNode");
- function readDocument(state5) {
- var documentStart = state5.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
- state5.version = null;
- state5.checkLineBreaks = state5.legacy;
- state5.tagMap = /* @__PURE__ */ Object.create(null);
- state5.anchorMap = /* @__PURE__ */ Object.create(null);
- while ((ch = state5.input.charCodeAt(state5.position)) !== 0) {
- skipSeparationSpace(state5, true, -1);
- ch = state5.input.charCodeAt(state5.position);
- if (state5.lineIndent > 0 || ch !== 37) {
- break;
- }
- hasDirectives = true;
- ch = state5.input.charCodeAt(++state5.position);
- _position = state5.position;
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state5.input.charCodeAt(++state5.position);
- }
- directiveName = state5.input.slice(_position, state5.position);
- directiveArgs = [];
- if (directiveName.length < 1) {
- throwError(state5, "directive name must not be less than one character in length");
- }
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- ch = state5.input.charCodeAt(++state5.position);
- }
- if (ch === 35) {
- do {
- ch = state5.input.charCodeAt(++state5.position);
- } while (ch !== 0 && !is_EOL(ch));
- break;
- }
- if (is_EOL(ch)) break;
- _position = state5.position;
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state5.input.charCodeAt(++state5.position);
- }
- directiveArgs.push(state5.input.slice(_position, state5.position));
- }
- if (ch !== 0) readLineBreak(state5);
- if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
- directiveHandlers[directiveName](state5, directiveName, directiveArgs);
- } else {
- throwWarning(state5, 'unknown document directive "' + directiveName + '"');
- }
- }
- skipSeparationSpace(state5, true, -1);
- if (state5.lineIndent === 0 && state5.input.charCodeAt(state5.position) === 45 && state5.input.charCodeAt(state5.position + 1) === 45 && state5.input.charCodeAt(state5.position + 2) === 45) {
- state5.position += 3;
- skipSeparationSpace(state5, true, -1);
- } else if (hasDirectives) {
- throwError(state5, "directives end mark is expected");
- }
- composeNode(state5, state5.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
- skipSeparationSpace(state5, true, -1);
- if (state5.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state5.input.slice(documentStart, state5.position))) {
- throwWarning(state5, "non-ASCII line breaks are interpreted as content");
- }
- state5.documents.push(state5.result);
- if (state5.position === state5.lineStart && testDocumentSeparator(state5)) {
- if (state5.input.charCodeAt(state5.position) === 46) {
- state5.position += 3;
- skipSeparationSpace(state5, true, -1);
- }
- return;
- }
- if (state5.position < state5.length - 1) {
- throwError(state5, "end of the stream or a document separator is expected");
- } else {
- return;
- }
+ __name(charat, "charat");
+ function substr(value2, begin, end2) {
+ return value2.slice(begin, end2);
}
- __name(readDocument, "readDocument");
- function loadDocuments(input, options3) {
- input = String(input);
- options3 = options3 || {};
- if (input.length !== 0) {
- if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
- input += "\n";
- }
- if (input.charCodeAt(0) === 65279) {
- input = input.slice(1);
- }
- }
- var state5 = new State$1(input, options3);
- var nullpos = input.indexOf("\0");
- if (nullpos !== -1) {
- state5.position = nullpos;
- throwError(state5, "null byte is not allowed in input");
- }
- state5.input += "\0";
- while (state5.input.charCodeAt(state5.position) === 32) {
- state5.lineIndent += 1;
- state5.position += 1;
- }
- while (state5.position < state5.length - 1) {
- readDocument(state5);
- }
- return state5.documents;
+ __name(substr, "substr");
+ function strlen(value2) {
+ return value2.length;
}
- __name(loadDocuments, "loadDocuments");
- function loadAll$1(input, iterator, options3) {
- if (iterator !== null && typeof iterator === "object" && typeof options3 === "undefined") {
- options3 = iterator;
- iterator = null;
- }
- var documents2 = loadDocuments(input, options3);
- if (typeof iterator !== "function") {
- return documents2;
- }
- for (var index = 0, length2 = documents2.length; index < length2; index += 1) {
- iterator(documents2[index]);
- }
+ __name(strlen, "strlen");
+ function sizeof(value2) {
+ return value2.length;
}
- __name(loadAll$1, "loadAll$1");
- function load$1(input, options3) {
- var documents2 = loadDocuments(input, options3);
- if (documents2.length === 0) {
- return void 0;
- } else if (documents2.length === 1) {
- return documents2[0];
- }
- throw new exception("expected a single document in the stream, but found more");
+ __name(sizeof, "sizeof");
+ function append2(value2, array4) {
+ return array4.push(value2), value2;
}
- __name(load$1, "load$1");
- var loadAll_1 = loadAll$1;
- var load_1 = load$1;
- var loader25 = {
- loadAll: loadAll_1,
- load: load_1
- };
- var _toString = Object.prototype.toString;
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
- var CHAR_BOM = 65279;
- var CHAR_TAB = 9;
- var CHAR_LINE_FEED = 10;
- var CHAR_CARRIAGE_RETURN = 13;
- var CHAR_SPACE = 32;
- var CHAR_EXCLAMATION = 33;
- var CHAR_DOUBLE_QUOTE = 34;
- var CHAR_SHARP = 35;
- var CHAR_PERCENT = 37;
- var CHAR_AMPERSAND = 38;
- var CHAR_SINGLE_QUOTE = 39;
- var CHAR_ASTERISK = 42;
- var CHAR_COMMA = 44;
- var CHAR_MINUS = 45;
- var CHAR_COLON = 58;
- var CHAR_EQUALS = 61;
- var CHAR_GREATER_THAN = 62;
- var CHAR_QUESTION = 63;
- var CHAR_COMMERCIAL_AT = 64;
- var CHAR_LEFT_SQUARE_BRACKET = 91;
- var CHAR_RIGHT_SQUARE_BRACKET = 93;
- var CHAR_GRAVE_ACCENT = 96;
- var CHAR_LEFT_CURLY_BRACKET = 123;
- var CHAR_VERTICAL_LINE = 124;
- var CHAR_RIGHT_CURLY_BRACKET = 125;
- var ESCAPE_SEQUENCES = {};
- ESCAPE_SEQUENCES[0] = "\\0";
- ESCAPE_SEQUENCES[7] = "\\a";
- ESCAPE_SEQUENCES[8] = "\\b";
- ESCAPE_SEQUENCES[9] = "\\t";
- ESCAPE_SEQUENCES[10] = "\\n";
- ESCAPE_SEQUENCES[11] = "\\v";
- ESCAPE_SEQUENCES[12] = "\\f";
- ESCAPE_SEQUENCES[13] = "\\r";
- ESCAPE_SEQUENCES[27] = "\\e";
- ESCAPE_SEQUENCES[34] = '\\"';
- ESCAPE_SEQUENCES[92] = "\\\\";
- ESCAPE_SEQUENCES[133] = "\\N";
- ESCAPE_SEQUENCES[160] = "\\_";
- ESCAPE_SEQUENCES[8232] = "\\L";
- ESCAPE_SEQUENCES[8233] = "\\P";
- var DEPRECATED_BOOLEANS_SYNTAX = [
- "y",
- "Y",
- "yes",
- "Yes",
- "YES",
- "on",
- "On",
- "ON",
- "n",
- "N",
- "no",
- "No",
- "NO",
- "off",
- "Off",
- "OFF"
- ];
- var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
- function compileStyleMap(schema2, map5) {
- var result, keys3, index, length2, tag2, style3, type3;
- if (map5 === null) return {};
- result = {};
- keys3 = Object.keys(map5);
- for (index = 0, length2 = keys3.length; index < length2; index += 1) {
- tag2 = keys3[index];
- style3 = String(map5[tag2]);
- if (tag2.slice(0, 2) === "!!") {
- tag2 = "tag:yaml.org,2002:" + tag2.slice(2);
- }
- type3 = schema2.compiledTypeMap["fallback"][tag2];
- if (type3 && _hasOwnProperty.call(type3.styleAliases, style3)) {
- style3 = type3.styleAliases[style3];
- }
- result[tag2] = style3;
- }
- return result;
+ __name(append2, "append");
+
+ // ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Tokenizer.js
+ var line = 1;
+ var column = 1;
+ var length = 0;
+ var position4 = 0;
+ var character = 0;
+ var characters = "";
+ function node(value2, root4, parent4, type3, props, children2, length2, siblings2) {
+ return { value: value2, root: root4, parent: parent4, type: type3, props, children: children2, line, column, length: length2, return: "", siblings: siblings2 };
}
- __name(compileStyleMap, "compileStyleMap");
- function encodeHex(character2) {
- var string3, handle, length2;
- string3 = character2.toString(16).toUpperCase();
- if (character2 <= 255) {
- handle = "x";
- length2 = 2;
- } else if (character2 <= 65535) {
- handle = "u";
- length2 = 4;
- } else if (character2 <= 4294967295) {
- handle = "U";
- length2 = 8;
- } else {
- throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
- }
- return "\\" + handle + common.repeat("0", length2 - string3.length) + string3;
+ __name(node, "node");
+ function char() {
+ return character;
}
- __name(encodeHex, "encodeHex");
- var QUOTING_TYPE_SINGLE = 1;
- var QUOTING_TYPE_DOUBLE = 2;
- function State(options3) {
- this.schema = options3["schema"] || _default;
- this.indent = Math.max(1, options3["indent"] || 2);
- this.noArrayIndent = options3["noArrayIndent"] || false;
- this.skipInvalid = options3["skipInvalid"] || false;
- this.flowLevel = common.isNothing(options3["flowLevel"]) ? -1 : options3["flowLevel"];
- this.styleMap = compileStyleMap(this.schema, options3["styles"] || null);
- this.sortKeys = options3["sortKeys"] || false;
- this.lineWidth = options3["lineWidth"] || 80;
- this.noRefs = options3["noRefs"] || false;
- this.noCompatMode = options3["noCompatMode"] || false;
- this.condenseFlow = options3["condenseFlow"] || false;
- this.quotingType = options3["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
- this.forceQuotes = options3["forceQuotes"] || false;
- this.replacer = typeof options3["replacer"] === "function" ? options3["replacer"] : null;
- this.implicitTypes = this.schema.compiledImplicit;
- this.explicitTypes = this.schema.compiledExplicit;
- this.tag = null;
- this.result = "";
- this.duplicates = [];
- this.usedDuplicates = null;
+ __name(char, "char");
+ function prev() {
+ character = position4 > 0 ? charat(characters, --position4) : 0;
+ if (column--, character === 10)
+ column = 1, line--;
+ return character;
}
- __name(State, "State");
- function indentString(string3, spaces) {
- var ind = common.repeat(" ", spaces), position5 = 0, next3 = -1, result = "", line2, length2 = string3.length;
- while (position5 < length2) {
- next3 = string3.indexOf("\n", position5);
- if (next3 === -1) {
- line2 = string3.slice(position5);
- position5 = length2;
- } else {
- line2 = string3.slice(position5, next3 + 1);
- position5 = next3 + 1;
- }
- if (line2.length && line2 !== "\n") result += ind;
- result += line2;
- }
- return result;
+ __name(prev, "prev");
+ function next2() {
+ character = position4 < length ? charat(characters, position4++) : 0;
+ if (column++, character === 10)
+ column = 1, line++;
+ return character;
}
- __name(indentString, "indentString");
- function generateNextLine(state5, level) {
- return "\n" + common.repeat(" ", state5.indent * level);
+ __name(next2, "next");
+ function peek() {
+ return charat(characters, position4);
}
- __name(generateNextLine, "generateNextLine");
- function testImplicitResolving(state5, str2) {
- var index, length2, type3;
- for (index = 0, length2 = state5.implicitTypes.length; index < length2; index += 1) {
- type3 = state5.implicitTypes[index];
- if (type3.resolve(str2)) {
- return true;
- }
- }
- return false;
+ __name(peek, "peek");
+ function caret() {
+ return position4;
}
- __name(testImplicitResolving, "testImplicitResolving");
- function isWhitespace2(c3) {
- return c3 === CHAR_SPACE || c3 === CHAR_TAB;
+ __name(caret, "caret");
+ function slice4(begin, end2) {
+ return substr(characters, begin, end2);
}
- __name(isWhitespace2, "isWhitespace");
- function isPrintable(c3) {
- return 32 <= c3 && c3 <= 126 || 161 <= c3 && c3 <= 55295 && c3 !== 8232 && c3 !== 8233 || 57344 <= c3 && c3 <= 65533 && c3 !== CHAR_BOM || 65536 <= c3 && c3 <= 1114111;
+ __name(slice4, "slice");
+ function token(type3) {
+ switch (type3) {
+ // \0 \t \n \r \s whitespace token
+ case 0:
+ case 9:
+ case 10:
+ case 13:
+ case 32:
+ return 5;
+ // ! + , / > @ ~ isolate token
+ case 33:
+ case 43:
+ case 44:
+ case 47:
+ case 62:
+ case 64:
+ case 126:
+ // ; { } breakpoint token
+ case 59:
+ case 123:
+ case 125:
+ return 4;
+ // : accompanied token
+ case 58:
+ return 3;
+ // " ' ( [ opening delimit token
+ case 34:
+ case 39:
+ case 40:
+ case 91:
+ return 2;
+ // ) ] closing delimit token
+ case 41:
+ case 93:
+ return 1;
+ }
+ return 0;
}
- __name(isPrintable, "isPrintable");
- function isNsCharOrWhitespace(c3) {
- return isPrintable(c3) && c3 !== CHAR_BOM && c3 !== CHAR_CARRIAGE_RETURN && c3 !== CHAR_LINE_FEED;
+ __name(token, "token");
+ function alloc(value2) {
+ return line = column = 1, length = strlen(characters = value2), position4 = 0, [];
}
- __name(isNsCharOrWhitespace, "isNsCharOrWhitespace");
- function isPlainSafe(c3, prev2, inblock) {
- var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c3);
- var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace2(c3);
- return (
- // ns-plain-safe
- (inblock ? (
- // c = flow-in
- cIsNsCharOrWhitespace
- ) : cIsNsCharOrWhitespace && c3 !== CHAR_COMMA && c3 !== CHAR_LEFT_SQUARE_BRACKET && c3 !== CHAR_RIGHT_SQUARE_BRACKET && c3 !== CHAR_LEFT_CURLY_BRACKET && c3 !== CHAR_RIGHT_CURLY_BRACKET) && c3 !== CHAR_SHARP && !(prev2 === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev2) && !isWhitespace2(prev2) && c3 === CHAR_SHARP || prev2 === CHAR_COLON && cIsNsChar
- );
+ __name(alloc, "alloc");
+ function dealloc(value2) {
+ return characters = "", value2;
}
- __name(isPlainSafe, "isPlainSafe");
- function isPlainSafeFirst(c3) {
- return isPrintable(c3) && c3 !== CHAR_BOM && !isWhitespace2(c3) && c3 !== CHAR_MINUS && c3 !== CHAR_QUESTION && c3 !== CHAR_COLON && c3 !== CHAR_COMMA && c3 !== CHAR_LEFT_SQUARE_BRACKET && c3 !== CHAR_RIGHT_SQUARE_BRACKET && c3 !== CHAR_LEFT_CURLY_BRACKET && c3 !== CHAR_RIGHT_CURLY_BRACKET && c3 !== CHAR_SHARP && c3 !== CHAR_AMPERSAND && c3 !== CHAR_ASTERISK && c3 !== CHAR_EXCLAMATION && c3 !== CHAR_VERTICAL_LINE && c3 !== CHAR_EQUALS && c3 !== CHAR_GREATER_THAN && c3 !== CHAR_SINGLE_QUOTE && c3 !== CHAR_DOUBLE_QUOTE && c3 !== CHAR_PERCENT && c3 !== CHAR_COMMERCIAL_AT && c3 !== CHAR_GRAVE_ACCENT;
+ __name(dealloc, "dealloc");
+ function delimit(type3) {
+ return trim(slice4(position4 - 1, delimiter2(type3 === 91 ? type3 + 2 : type3 === 40 ? type3 + 1 : type3)));
}
- __name(isPlainSafeFirst, "isPlainSafeFirst");
- function isPlainSafeLast(c3) {
- return !isWhitespace2(c3) && c3 !== CHAR_COLON;
+ __name(delimit, "delimit");
+ function whitespace(type3) {
+ while (character = peek())
+ if (character < 33)
+ next2();
+ else
+ break;
+ return token(type3) > 2 || token(character) > 3 ? "" : " ";
}
- __name(isPlainSafeLast, "isPlainSafeLast");
- function codePointAt(string3, pos) {
- var first3 = string3.charCodeAt(pos), second2;
- if (first3 >= 55296 && first3 <= 56319 && pos + 1 < string3.length) {
- second2 = string3.charCodeAt(pos + 1);
- if (second2 >= 56320 && second2 <= 57343) {
- return (first3 - 55296) * 1024 + second2 - 56320 + 65536;
+ __name(whitespace, "whitespace");
+ function escaping(index, count) {
+ while (--count && next2())
+ if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
+ break;
+ return slice4(index, caret() + (count < 6 && peek() == 32 && next2() == 32));
+ }
+ __name(escaping, "escaping");
+ function delimiter2(type3) {
+ while (next2())
+ switch (character) {
+ // ] ) " '
+ case type3:
+ return position4;
+ // " '
+ case 34:
+ case 39:
+ if (type3 !== 34 && type3 !== 39)
+ delimiter2(character);
+ break;
+ // (
+ case 40:
+ if (type3 === 41)
+ delimiter2(type3);
+ break;
+ // \
+ case 92:
+ next2();
+ break;
}
- }
- return first3;
+ return position4;
}
- __name(codePointAt, "codePointAt");
- function needIndentIndicator(string3) {
- var leadingSpaceRe = /^\n* /;
- return leadingSpaceRe.test(string3);
+ __name(delimiter2, "delimiter");
+ function commenter(type3, index) {
+ while (next2())
+ if (type3 + character === 47 + 10)
+ break;
+ else if (type3 + character === 42 + 42 && peek() === 47)
+ break;
+ return "/*" + slice4(index, position4 - 1) + "*" + from(type3 === 47 ? type3 : next2());
}
- __name(needIndentIndicator, "needIndentIndicator");
- var STYLE_PLAIN = 1;
- var STYLE_SINGLE = 2;
- var STYLE_LITERAL = 3;
- var STYLE_FOLDED = 4;
- var STYLE_DOUBLE = 5;
- function chooseScalarStyle(string3, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
- var i2;
- var char2 = 0;
- var prevChar = null;
- var hasLineBreak = false;
- var hasFoldableLine = false;
- var shouldTrackWidth = lineWidth !== -1;
- var previousLineBreak = -1;
- var plain = isPlainSafeFirst(codePointAt(string3, 0)) && isPlainSafeLast(codePointAt(string3, string3.length - 1));
- if (singleLineOnly || forceQuotes) {
- for (i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) {
- char2 = codePointAt(string3, i2);
- if (!isPrintable(char2)) {
- return STYLE_DOUBLE;
- }
- plain = plain && isPlainSafe(char2, prevChar, inblock);
- prevChar = char2;
- }
- } else {
- for (i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) {
- char2 = codePointAt(string3, i2);
- if (char2 === CHAR_LINE_FEED) {
- hasLineBreak = true;
- if (shouldTrackWidth) {
- hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
- i2 - previousLineBreak - 1 > lineWidth && string3[previousLineBreak + 1] !== " ";
- previousLineBreak = i2;
- }
- } else if (!isPrintable(char2)) {
- return STYLE_DOUBLE;
- }
- plain = plain && isPlainSafe(char2, prevChar, inblock);
- prevChar = char2;
- }
- hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i2 - previousLineBreak - 1 > lineWidth && string3[previousLineBreak + 1] !== " ");
- }
- if (!hasLineBreak && !hasFoldableLine) {
- if (plain && !forceQuotes && !testAmbiguousType(string3)) {
- return STYLE_PLAIN;
- }
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
- }
- if (indentPerLevel > 9 && needIndentIndicator(string3)) {
- return STYLE_DOUBLE;
- }
- if (!forceQuotes) {
- return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
- }
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ __name(commenter, "commenter");
+ function identifier(index) {
+ while (!token(peek()))
+ next2();
+ return slice4(index, position4);
}
- __name(chooseScalarStyle, "chooseScalarStyle");
- function writeScalar(state5, string3, level, iskey, inblock) {
- state5.dump = function() {
- if (string3.length === 0) {
- return state5.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
- }
- if (!state5.noCompatMode) {
- if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string3) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string3)) {
- return state5.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string3 + '"' : "'" + string3 + "'";
- }
- }
- var indent = state5.indent * Math.max(1, level);
- var lineWidth = state5.lineWidth === -1 ? -1 : Math.max(Math.min(state5.lineWidth, 40), state5.lineWidth - indent);
- var singleLineOnly = iskey || state5.flowLevel > -1 && level >= state5.flowLevel;
- function testAmbiguity(string4) {
- return testImplicitResolving(state5, string4);
- }
- __name(testAmbiguity, "testAmbiguity");
- switch (chooseScalarStyle(
- string3,
- singleLineOnly,
- state5.indent,
- lineWidth,
- testAmbiguity,
- state5.quotingType,
- state5.forceQuotes && !iskey,
- inblock
- )) {
- case STYLE_PLAIN:
- return string3;
- case STYLE_SINGLE:
- return "'" + string3.replace(/'/g, "''") + "'";
- case STYLE_LITERAL:
- return "|" + blockHeader(string3, state5.indent) + dropEndingNewline(indentString(string3, indent));
- case STYLE_FOLDED:
- return ">" + blockHeader(string3, state5.indent) + dropEndingNewline(indentString(foldString(string3, lineWidth), indent));
- case STYLE_DOUBLE:
- return '"' + escapeString(string3) + '"';
+ __name(identifier, "identifier");
+
+ // ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Parser.js
+ function compile(value2) {
+ return dealloc(parse4("", null, null, null, [""], value2 = alloc(value2), 0, [0], value2));
+ }
+ __name(compile, "compile");
+ function parse4(value2, root4, parent4, rule, rules, rulesets, pseudo, points, declarations) {
+ var index = 0;
+ var offset = 0;
+ var length2 = pseudo;
+ var atrule = 0;
+ var property2 = 0;
+ var previous = 0;
+ var variable = 1;
+ var scanning = 1;
+ var ampersand = 1;
+ var character2 = 0;
+ var type3 = "";
+ var props = rules;
+ var children2 = rulesets;
+ var reference = rule;
+ var characters2 = type3;
+ while (scanning)
+ switch (previous = character2, character2 = next2()) {
+ // (
+ case 40:
+ if (previous != 108 && charat(characters2, length2 - 1) == 58) {
+ if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs3(index ? points[index - 1] : 0)) != -1)
+ ampersand = -1;
+ break;
+ }
+ // " ' [
+ case 34:
+ case 39:
+ case 91:
+ characters2 += delimit(character2);
+ break;
+ // \t \n \r \s
+ case 9:
+ case 10:
+ case 13:
+ case 32:
+ characters2 += whitespace(previous);
+ break;
+ // \
+ case 92:
+ characters2 += escaping(caret() - 1, 7);
+ continue;
+ // /
+ case 47:
+ switch (peek()) {
+ case 42:
+ case 47:
+ append2(comment(commenter(next2(), caret()), root4, parent4, declarations), declarations);
+ if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters2) && substr(characters2, -1, void 0) !== " ") characters2 += " ";
+ break;
+ default:
+ characters2 += "/";
+ }
+ break;
+ // {
+ case 123 * variable:
+ points[index++] = strlen(characters2) * ampersand;
+ // } ; \0
+ case 125 * variable:
+ case 59:
+ case 0:
+ switch (character2) {
+ // \0 }
+ case 0:
+ case 125:
+ scanning = 0;
+ // ;
+ case 59 + offset:
+ if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
+ if (property2 > 0 && (strlen(characters2) - length2 || variable === 0 && previous === 47))
+ append2(property2 > 32 ? declaration(characters2 + ";", rule, parent4, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent4, length2 - 2, declarations), declarations);
+ break;
+ // @ ;
+ case 59:
+ characters2 += ";";
+ // { rule/at-rule
+ default:
+ append2(reference = ruleset(characters2, root4, parent4, index, offset, rules, points, type3, props = [], children2 = [], length2, rulesets), rulesets);
+ if (character2 === 123)
+ if (offset === 0)
+ parse4(characters2, root4, reference, reference, props, rulesets, length2, points, children2);
+ else {
+ switch (atrule) {
+ // c(ontainer)
+ case 99:
+ if (charat(characters2, 3) === 110) break;
+ // l(ayer)
+ case 108:
+ if (charat(characters2, 2) === 97) break;
+ default:
+ offset = 0;
+ // d(ocument) m(edia) s(upports)
+ case 100:
+ case 109:
+ case 115:
+ }
+ if (offset) parse4(value2, reference, reference, rule && append2(ruleset(value2, reference, reference, 0, 0, rules, points, type3, rules, props = [], length2, children2), children2), rules, children2, length2, points, rule ? props : children2);
+ else parse4(characters2, reference, reference, reference, [""], children2, 0, points, children2);
+ }
+ }
+ index = offset = property2 = 0, variable = ampersand = 1, type3 = characters2 = "", length2 = pseudo;
+ break;
+ // :
+ case 58:
+ length2 = 1 + strlen(characters2), property2 = previous;
default:
- throw new exception("impossible error: invalid scalar style");
+ if (variable < 1) {
+ if (character2 == 123)
+ --variable;
+ else if (character2 == 125 && variable++ == 0 && prev() == 125)
+ continue;
+ }
+ switch (characters2 += from(character2), character2 * variable) {
+ // &
+ case 38:
+ ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
+ break;
+ // ,
+ case 44:
+ points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
+ break;
+ // @
+ case 64:
+ if (peek() === 45)
+ characters2 += delimit(next2());
+ atrule = peek(), offset = length2 = strlen(type3 = characters2 += identifier(caret())), character2++;
+ break;
+ // -
+ case 45:
+ if (previous === 45 && strlen(characters2) == 2)
+ variable = 0;
+ }
}
- }();
- }
- __name(writeScalar, "writeScalar");
- function blockHeader(string3, indentPerLevel) {
- var indentIndicator = needIndentIndicator(string3) ? String(indentPerLevel) : "";
- var clip = string3[string3.length - 1] === "\n";
- var keep = clip && (string3[string3.length - 2] === "\n" || string3 === "\n");
- var chomp = keep ? "+" : clip ? "" : "-";
- return indentIndicator + chomp + "\n";
- }
- __name(blockHeader, "blockHeader");
- function dropEndingNewline(string3) {
- return string3[string3.length - 1] === "\n" ? string3.slice(0, -1) : string3;
+ return rulesets;
}
- __name(dropEndingNewline, "dropEndingNewline");
- function foldString(string3, width3) {
- var lineRe = /(\n+)([^\n]*)/g;
- var result = function() {
- var nextLF = string3.indexOf("\n");
- nextLF = nextLF !== -1 ? nextLF : string3.length;
- lineRe.lastIndex = nextLF;
- return foldLine(string3.slice(0, nextLF), width3);
- }();
- var prevMoreIndented = string3[0] === "\n" || string3[0] === " ";
- var moreIndented;
- var match2;
- while (match2 = lineRe.exec(string3)) {
- var prefix = match2[1], line2 = match2[2];
- moreIndented = line2[0] === " ";
- result += prefix + (!prevMoreIndented && !moreIndented && line2 !== "" ? "\n" : "") + foldLine(line2, width3);
- prevMoreIndented = moreIndented;
- }
- return result;
+ __name(parse4, "parse");
+ function ruleset(value2, root4, parent4, index, offset, rules, points, type3, props, children2, length2, siblings2) {
+ var post = offset - 1;
+ var rule = offset === 0 ? rules : [""];
+ var size5 = sizeof(rule);
+ for (var i2 = 0, j2 = 0, k2 = 0; i2 < index; ++i2)
+ for (var x5 = 0, y5 = substr(value2, post + 1, post = abs3(j2 = points[i2])), z2 = value2; x5 < size5; ++x5)
+ if (z2 = trim(j2 > 0 ? rule[x5] + " " + y5 : replace(y5, /&\f/g, rule[x5])))
+ props[k2++] = z2;
+ return node(value2, root4, parent4, offset === 0 ? RULESET : type3, props, children2, length2, siblings2);
}
- __name(foldString, "foldString");
- function foldLine(line2, width3) {
- if (line2 === "" || line2[0] === " ") return line2;
- var breakRe = / [^ ]/g;
- var match2;
- var start3 = 0, end2, curr = 0, next3 = 0;
- var result = "";
- while (match2 = breakRe.exec(line2)) {
- next3 = match2.index;
- if (next3 - start3 > width3) {
- end2 = curr > start3 ? curr : next3;
- result += "\n" + line2.slice(start3, end2);
- start3 = end2 + 1;
- }
- curr = next3;
- }
- result += "\n";
- if (line2.length - start3 > width3 && curr > start3) {
- result += line2.slice(start3, curr) + "\n" + line2.slice(curr + 1);
- } else {
- result += line2.slice(start3);
- }
- return result.slice(1);
+ __name(ruleset, "ruleset");
+ function comment(value2, root4, parent4, siblings2) {
+ return node(value2, root4, parent4, COMMENT, from(char()), substr(value2, 2, -2), 0, siblings2);
}
- __name(foldLine, "foldLine");
- function escapeString(string3) {
- var result = "";
- var char2 = 0;
- var escapeSeq;
- for (var i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) {
- char2 = codePointAt(string3, i2);
- escapeSeq = ESCAPE_SEQUENCES[char2];
- if (!escapeSeq && isPrintable(char2)) {
- result += string3[i2];
- if (char2 >= 65536) result += string3[i2 + 1];
- } else {
- result += escapeSeq || encodeHex(char2);
- }
- }
- return result;
+ __name(comment, "comment");
+ function declaration(value2, root4, parent4, length2, siblings2) {
+ return node(value2, root4, parent4, DECLARATION, substr(value2, 0, length2), substr(value2, length2 + 1, -1), length2, siblings2);
}
- __name(escapeString, "escapeString");
- function writeFlowSequence(state5, level, object3) {
- var _result = "", _tag2 = state5.tag, index, length2, value2;
- for (index = 0, length2 = object3.length; index < length2; index += 1) {
- value2 = object3[index];
- if (state5.replacer) {
- value2 = state5.replacer.call(object3, String(index), value2);
- }
- if (writeNode(state5, level, value2, false, false) || typeof value2 === "undefined" && writeNode(state5, level, null, false, false)) {
- if (_result !== "") _result += "," + (!state5.condenseFlow ? " " : "");
- _result += state5.dump;
- }
- }
- state5.tag = _tag2;
- state5.dump = "[" + _result + "]";
+ __name(declaration, "declaration");
+
+ // ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Serializer.js
+ function serialize(children2, callback) {
+ var output2 = "";
+ for (var i2 = 0; i2 < children2.length; i2++)
+ output2 += callback(children2[i2], i2, children2, callback) || "";
+ return output2;
}
- __name(writeFlowSequence, "writeFlowSequence");
- function writeBlockSequence(state5, level, object3, compact2) {
- var _result = "", _tag2 = state5.tag, index, length2, value2;
- for (index = 0, length2 = object3.length; index < length2; index += 1) {
- value2 = object3[index];
- if (state5.replacer) {
- value2 = state5.replacer.call(object3, String(index), value2);
- }
- if (writeNode(state5, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode(state5, level + 1, null, true, true, false, true)) {
- if (!compact2 || _result !== "") {
- _result += generateNextLine(state5, level);
- }
- if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) {
- _result += "-";
- } else {
- _result += "- ";
- }
- _result += state5.dump;
- }
+ __name(serialize, "serialize");
+ function stringify(element3, index, children2, callback) {
+ switch (element3.type) {
+ case LAYER:
+ if (element3.children.length) break;
+ case IMPORT:
+ case NAMESPACE:
+ case DECLARATION:
+ return element3.return = element3.return || element3.value;
+ case COMMENT:
+ return "";
+ case KEYFRAMES:
+ return element3.return = element3.value + "{" + serialize(element3.children, callback) + "}";
+ case RULESET:
+ if (!strlen(element3.value = element3.props.join(","))) return "";
}
- state5.tag = _tag2;
- state5.dump = _result || "[]";
+ return strlen(children2 = serialize(element3.children, callback)) ? element3.return = element3.value + "{" + children2 + "}" : "";
}
- __name(writeBlockSequence, "writeBlockSequence");
- function writeFlowMapping(state5, level, object3) {
- var _result = "", _tag2 = state5.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, pairBuffer;
- for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) {
- pairBuffer = "";
- if (_result !== "") pairBuffer += ", ";
- if (state5.condenseFlow) pairBuffer += '"';
- objectKey = objectKeyList[index];
- objectValue = object3[objectKey];
- if (state5.replacer) {
- objectValue = state5.replacer.call(object3, objectKey, objectValue);
- }
- if (!writeNode(state5, level, objectKey, false, false)) {
- continue;
- }
- if (state5.dump.length > 1024) pairBuffer += "? ";
- pairBuffer += state5.dump + (state5.condenseFlow ? '"' : "") + ":" + (state5.condenseFlow ? "" : " ");
- if (!writeNode(state5, level, objectValue, false, false)) {
- continue;
- }
- pairBuffer += state5.dump;
- _result += pairBuffer;
+ __name(stringify, "stringify");
+
+ // src/mermaidAPI.ts
+ init_purify_es();
+ init_isEmpty();
+ init_package();
+
+ // src/accessibility.ts
+ var SVG_ROLE = "graphics-document document";
+ function setA11yDiagramInfo(svg2, diagramType) {
+ svg2.attr("role", SVG_ROLE);
+ if (diagramType !== "") {
+ svg2.attr("aria-roledescription", diagramType);
}
- state5.tag = _tag2;
- state5.dump = "{" + _result + "}";
}
- __name(writeFlowMapping, "writeFlowMapping");
- function writeBlockMapping(state5, level, object3, compact2) {
- var _result = "", _tag2 = state5.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, explicitPair, pairBuffer;
- if (state5.sortKeys === true) {
- objectKeyList.sort();
- } else if (typeof state5.sortKeys === "function") {
- objectKeyList.sort(state5.sortKeys);
- } else if (state5.sortKeys) {
- throw new exception("sortKeys must be a boolean or a function");
+ __name(setA11yDiagramInfo, "setA11yDiagramInfo");
+ function addSVGa11yTitleDescription(svg2, a11yTitle, a11yDesc, baseId) {
+ if (svg2.insert === void 0) {
+ return;
}
- for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) {
- pairBuffer = "";
- if (!compact2 || _result !== "") {
- pairBuffer += generateNextLine(state5, level);
- }
- objectKey = objectKeyList[index];
- objectValue = object3[objectKey];
- if (state5.replacer) {
- objectValue = state5.replacer.call(object3, objectKey, objectValue);
- }
- if (!writeNode(state5, level + 1, objectKey, true, true, true)) {
- continue;
- }
- explicitPair = state5.tag !== null && state5.tag !== "?" || state5.dump && state5.dump.length > 1024;
- if (explicitPair) {
- if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) {
- pairBuffer += "?";
- } else {
- pairBuffer += "? ";
- }
- }
- pairBuffer += state5.dump;
- if (explicitPair) {
- pairBuffer += generateNextLine(state5, level);
- }
- if (!writeNode(state5, level + 1, objectValue, true, explicitPair)) {
- continue;
- }
- if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) {
- pairBuffer += ":";
- } else {
- pairBuffer += ": ";
- }
- pairBuffer += state5.dump;
- _result += pairBuffer;
+ if (a11yDesc) {
+ const descId = `chart-desc-${baseId}`;
+ svg2.attr("aria-describedby", descId);
+ svg2.insert("desc", ":first-child").attr("id", descId).text(a11yDesc);
}
- state5.tag = _tag2;
- state5.dump = _result || "{}";
- }
- __name(writeBlockMapping, "writeBlockMapping");
- function detectType2(state5, object3, explicit) {
- var _result, typeList, index, length2, type3, style3;
- typeList = explicit ? state5.explicitTypes : state5.implicitTypes;
- for (index = 0, length2 = typeList.length; index < length2; index += 1) {
- type3 = typeList[index];
- if ((type3.instanceOf || type3.predicate) && (!type3.instanceOf || typeof object3 === "object" && object3 instanceof type3.instanceOf) && (!type3.predicate || type3.predicate(object3))) {
- if (explicit) {
- if (type3.multi && type3.representName) {
- state5.tag = type3.representName(object3);
- } else {
- state5.tag = type3.tag;
- }
- } else {
- state5.tag = "?";
- }
- if (type3.represent) {
- style3 = state5.styleMap[type3.tag] || type3.defaultStyle;
- if (_toString.call(type3.represent) === "[object Function]") {
- _result = type3.represent(object3, style3);
- } else if (_hasOwnProperty.call(type3.represent, style3)) {
- _result = type3.represent[style3](object3, style3);
- } else {
- throw new exception("!<" + type3.tag + '> tag resolver accepts not "' + style3 + '" style');
- }
- state5.dump = _result;
- }
- return true;
- }
+ if (a11yTitle) {
+ const titleId = `chart-title-${baseId}`;
+ svg2.attr("aria-labelledby", titleId);
+ svg2.insert("title", ":first-child").attr("id", titleId).text(a11yTitle);
}
- return false;
}
- __name(detectType2, "detectType");
- function writeNode(state5, level, object3, block3, compact2, iskey, isblockseq) {
- state5.tag = null;
- state5.dump = object3;
- if (!detectType2(state5, object3, false)) {
- detectType2(state5, object3, true);
- }
- var type3 = _toString.call(state5.dump);
- var inblock = block3;
- var tagStr;
- if (block3) {
- block3 = state5.flowLevel < 0 || state5.flowLevel > level;
- }
- var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate;
- if (objectOrArray) {
- duplicateIndex = state5.duplicates.indexOf(object3);
- duplicate = duplicateIndex !== -1;
+ __name(addSVGa11yTitleDescription, "addSVGa11yTitleDescription");
+
+ // src/mermaidAPI.ts
+ init_assignWithDepth();
+ init_config();
+
+ // src/Diagram.ts
+ init_config();
+ init_diagramAPI();
+ init_detectType();
+ init_errors();
+ init_utils2();
+ var Diagram = class _Diagram {
+ constructor(type3, text4, db10, parser24, renderer9) {
+ this.type = type3;
+ this.text = text4;
+ this.db = db10;
+ this.parser = parser24;
+ this.renderer = renderer9;
}
- if (state5.tag !== null && state5.tag !== "?" || duplicate || state5.indent !== 2 && level > 0) {
- compact2 = false;
+ static {
+ __name(this, "Diagram");
}
- if (duplicate && state5.usedDuplicates[duplicateIndex]) {
- state5.dump = "*ref_" + duplicateIndex;
- } else {
- if (objectOrArray && duplicate && !state5.usedDuplicates[duplicateIndex]) {
- state5.usedDuplicates[duplicateIndex] = true;
- }
- if (type3 === "[object Object]") {
- if (block3 && Object.keys(state5.dump).length !== 0) {
- writeBlockMapping(state5, level, state5.dump, compact2);
- if (duplicate) {
- state5.dump = "&ref_" + duplicateIndex + state5.dump;
- }
- } else {
- writeFlowMapping(state5, level, state5.dump);
- if (duplicate) {
- state5.dump = "&ref_" + duplicateIndex + " " + state5.dump;
- }
- }
- } else if (type3 === "[object Array]") {
- if (block3 && state5.dump.length !== 0) {
- if (state5.noArrayIndent && !isblockseq && level > 0) {
- writeBlockSequence(state5, level - 1, state5.dump, compact2);
- } else {
- writeBlockSequence(state5, level, state5.dump, compact2);
- }
- if (duplicate) {
- state5.dump = "&ref_" + duplicateIndex + state5.dump;
- }
- } else {
- writeFlowSequence(state5, level, state5.dump);
- if (duplicate) {
- state5.dump = "&ref_" + duplicateIndex + " " + state5.dump;
- }
- }
- } else if (type3 === "[object String]") {
- if (state5.tag !== "?") {
- writeScalar(state5, state5.dump, level, iskey, inblock);
+ static async fromText(text4, metadata = {}) {
+ const config5 = getConfig();
+ const type3 = detectType(text4, config5);
+ text4 = encodeEntities(text4) + "\n";
+ try {
+ getDiagram(type3);
+ } catch {
+ const loader28 = getDiagramLoader(type3);
+ if (!loader28) {
+ throw new UnknownDiagramError(`Diagram ${type3} not found.`);
}
- } else if (type3 === "[object Undefined]") {
- return false;
- } else {
- if (state5.skipInvalid) return false;
- throw new exception("unacceptable kind of an object to dump " + type3);
+ const { id: id29, diagram: diagram26 } = await loader28();
+ registerDiagram(id29, diagram26);
}
- if (state5.tag !== null && state5.tag !== "?") {
- tagStr = encodeURI(
- state5.tag[0] === "!" ? state5.tag.slice(1) : state5.tag
- ).replace(/!/g, "%21");
- if (state5.tag[0] === "!") {
- tagStr = "!" + tagStr;
- } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
- tagStr = "!!" + tagStr.slice(18);
- } else {
- tagStr = "!<" + tagStr + ">";
- }
- state5.dump = tagStr + " " + state5.dump;
+ const { db: db10, parser: parser24, renderer: renderer9, init: init3 } = getDiagram(type3);
+ if (parser24.parser) {
+ parser24.parser.yy = db10;
}
+ db10.clear?.();
+ init3?.(config5);
+ if (metadata.title) {
+ db10.setDiagramTitle?.(metadata.title);
+ }
+ await parser24.parse(text4);
+ return new _Diagram(type3, text4, db10, parser24, renderer9);
}
- return true;
- }
- __name(writeNode, "writeNode");
- function getDuplicateReferences(object3, state5) {
- var objects = [], duplicatesIndexes = [], index, length2;
- inspectNode(object3, objects, duplicatesIndexes);
- for (index = 0, length2 = duplicatesIndexes.length; index < length2; index += 1) {
- state5.duplicates.push(objects[duplicatesIndexes[index]]);
+ async render(id29, version2) {
+ await this.renderer.draw(this.text, id29, version2, this);
}
- state5.usedDuplicates = new Array(length2);
- }
- __name(getDuplicateReferences, "getDuplicateReferences");
- function inspectNode(object3, objects, duplicatesIndexes) {
- var objectKeyList, index, length2;
- if (object3 !== null && typeof object3 === "object") {
- index = objects.indexOf(object3);
- if (index !== -1) {
- if (duplicatesIndexes.indexOf(index) === -1) {
- duplicatesIndexes.push(index);
- }
- } else {
- objects.push(object3);
- if (Array.isArray(object3)) {
- for (index = 0, length2 = object3.length; index < length2; index += 1) {
- inspectNode(object3[index], objects, duplicatesIndexes);
- }
- } else {
- objectKeyList = Object.keys(object3);
- for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) {
- inspectNode(object3[objectKeyList[index]], objects, duplicatesIndexes);
- }
- }
- }
+ getParser() {
+ return this.parser;
}
- }
- __name(inspectNode, "inspectNode");
- function dump$1(input, options3) {
- options3 = options3 || {};
- var state5 = new State(options3);
- if (!state5.noRefs) getDuplicateReferences(input, state5);
- var value2 = input;
- if (state5.replacer) {
- value2 = state5.replacer.call({ "": value2 }, "", value2);
+ getType() {
+ return this.type;
}
- if (writeNode(state5, 0, value2, true, true)) return state5.dump + "\n";
- return "";
- }
- __name(dump$1, "dump$1");
- var dump_1 = dump$1;
- var dumper = {
- dump: dump_1
};
- function renamed(from2, to) {
- return function() {
- throw new Error("Function yaml." + from2 + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
- };
- }
- __name(renamed, "renamed");
- var JSON_SCHEMA = json2;
- var load = loader25.load;
- var loadAll = loader25.loadAll;
- var dump = dumper.dump;
- var safeLoad = renamed("safeLoad", "load");
- var safeLoadAll = renamed("safeLoadAll", "loadAll");
- var safeDump = renamed("safeDump", "dump");
+
+ // src/mermaidAPI.ts
+ init_common();
+
+ // src/interactionDb.ts
+ var interactionFunctions = [];
+ var attachFunctions = /* @__PURE__ */ __name(() => {
+ interactionFunctions.forEach((f2) => {
+ f2();
+ });
+ interactionFunctions = [];
+ }, "attachFunctions");
+
+ // src/mermaidAPI.ts
+ init_logger();
+
+ // src/diagram-api/comments.ts
+ var cleanupComments = /* @__PURE__ */ __name((text4) => {
+ return text4.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart();
+ }, "cleanupComments");
// src/diagram-api/frontmatter.ts
- function extractFrontMatter(text2) {
- const matches33 = text2.match(frontMatterRegex);
+ init_regexes();
+ init_js_yaml();
+ function extractFrontMatter(text4) {
+ const matches33 = text4.match(frontMatterRegex);
if (!matches33) {
return {
- text: text2,
+ text: text4,
metadata: {}
};
}
@@ -142995,7 +151177,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
metadata.config = parsed.config;
}
return {
- text: text2.slice(matches33[0].length),
+ text: text4.slice(matches33[0].length),
metadata
};
}
@@ -143010,15 +151192,15 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
);
}, "cleanupText");
var processFrontmatter = /* @__PURE__ */ __name((code) => {
- const { text: text2, metadata } = extractFrontMatter(code);
- const { displayMode: displayMode2, title: title2, config: config6 = {} } = metadata;
+ const { text: text4, metadata } = extractFrontMatter(code);
+ const { displayMode: displayMode2, title: title2, config: config5 = {} } = metadata;
if (displayMode2) {
- if (!config6.gantt) {
- config6.gantt = {};
+ if (!config5.gantt) {
+ config5.gantt = {};
}
- config6.gantt.displayMode = displayMode2;
+ config5.gantt.displayMode = displayMode2;
}
- return { title: title2, config: config6, text: text2 };
+ return { title: title2, config: config5, text: text4 };
}, "processFrontmatter");
var processDirectives = /* @__PURE__ */ __name((code) => {
const initDirective = utils_default2.detectInit(code) ?? {};
@@ -143037,12 +151219,12 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
const cleanedCode = cleanupText(code);
const frontMatterResult = processFrontmatter(cleanedCode);
const directiveResult = processDirectives(frontMatterResult.text);
- const config6 = cleanAndMerge(frontMatterResult.config, directiveResult.directive);
+ const config5 = cleanAndMerge(frontMatterResult.config, directiveResult.directive);
code = cleanupComments(directiveResult.text);
return {
code,
title: frontMatterResult.title,
- config: config6
+ config: config5
};
}
__name(preprocessDiagram, "preprocessDiagram");
@@ -143076,19 +151258,19 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
var IFRAME_NOT_SUPPORTED_MSG = 'The "iframe" tag is not supported by your browser.';
var DOMPURIFY_TAGS = ["foreignobject"];
var DOMPURIFY_ATTR = ["dominant-baseline"];
- function processAndSetConfigs(text2) {
- const processed2 = preprocessDiagram(text2);
+ function processAndSetConfigs(text4) {
+ const processed2 = preprocessDiagram(text4);
reset();
addDirective(processed2.config ?? {});
return processed2;
}
__name(processAndSetConfigs, "processAndSetConfigs");
- async function parse6(text2, parseOptions) {
+ async function parse5(text4, parseOptions) {
addDiagrams();
try {
- const { code, config: config6 } = processAndSetConfigs(text2);
- const diagram24 = await getDiagramFromText(code);
- return { diagramType: diagram24.type, config: config6 };
+ const { code, config: config5 } = processAndSetConfigs(text4);
+ const diagram26 = await getDiagramFromText(code);
+ return { diagramType: diagram26.type, config: config5 };
} catch (error3) {
if (parseOptions?.suppressErrors) {
return false;
@@ -143096,27 +151278,27 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
throw error3;
}
}
- __name(parse6, "parse");
+ __name(parse5, "parse");
var cssImportantStyles = /* @__PURE__ */ __name((cssClass, element3, cssClasses = []) => {
return `
.${cssClass} ${element3} { ${cssClasses.join(" !important; ")} !important; }`;
}, "cssImportantStyles");
- var createCssStyles = /* @__PURE__ */ __name((config6, classDefs = /* @__PURE__ */ new Map()) => {
+ var createCssStyles = /* @__PURE__ */ __name((config5, classDefs = /* @__PURE__ */ new Map()) => {
let cssStyles = "";
- if (config6.themeCSS !== void 0) {
+ if (config5.themeCSS !== void 0) {
cssStyles += `
-${config6.themeCSS}`;
+${config5.themeCSS}`;
}
- if (config6.fontFamily !== void 0) {
+ if (config5.fontFamily !== void 0) {
cssStyles += `
-:root { --mermaid-font-family: ${config6.fontFamily}}`;
+:root { --mermaid-font-family: ${config5.fontFamily}}`;
}
- if (config6.altFontFamily !== void 0) {
+ if (config5.altFontFamily !== void 0) {
cssStyles += `
-:root { --mermaid-alt-font-family: ${config6.altFontFamily}}`;
+:root { --mermaid-alt-font-family: ${config5.altFontFamily}}`;
}
if (classDefs instanceof Map) {
- const htmlLabels = config6.htmlLabels ?? config6.flowchart?.htmlLabels;
+ const htmlLabels = config5.htmlLabels ?? config5.flowchart?.htmlLabels;
const cssHtmlElements = ["> *", "span"];
const cssShapeElements = ["rect", "polygon", "ellipse", "circle", "path"];
const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements;
@@ -143137,9 +151319,9 @@ ${config6.themeCSS}`;
}
return cssStyles;
}, "createCssStyles");
- var createUserStyles = /* @__PURE__ */ __name((config6, graphType, classDefs, svgId) => {
- const userCSSstyles = createCssStyles(config6, classDefs);
- const allStyles = styles_default(graphType, userCSSstyles, config6.themeVariables);
+ var createUserStyles = /* @__PURE__ */ __name((config5, graphType, classDefs, svgId) => {
+ const userCSSstyles = createCssStyles(config5, classDefs);
+ const allStyles = styles_default(graphType, userCSSstyles, config5.themeVariables);
return serialize(compile(`${svgId}{${allStyles}}`), stringify);
}, "createUserStyles");
var cleanUpSvgCode = /* @__PURE__ */ __name((svgCode = "", inSandboxMode, useArrowMarkerUrls) => {
@@ -143161,13 +151343,13 @@ ${config6.themeCSS}`;
${IFRAME_NOT_SUPPORTED_MSG}
`;
}, "putIntoIFrame");
- var appendDivSvgG = /* @__PURE__ */ __name((parentRoot, id27, enclosingDivId, divStyle, svgXlink) => {
+ var appendDivSvgG = /* @__PURE__ */ __name((parentRoot, id29, enclosingDivId, divStyle, svgXlink) => {
const enclosingDiv = parentRoot.append("div");
enclosingDiv.attr("id", enclosingDivId);
if (divStyle) {
enclosingDiv.attr("style", divStyle);
}
- const svgNode2 = enclosingDiv.append("svg").attr("id", id27).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD);
+ const svgNode2 = enclosingDiv.append("svg").attr("id", id29).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD);
if (svgXlink) {
svgNode2.attr("xmlns:xlink", svgXlink);
}
@@ -143178,24 +151360,24 @@ ${config6.themeCSS}`;
return parentNode.append("iframe").attr("id", iFrameId).attr("style", "width: 100%; height: 100%;").attr("sandbox", "");
}
__name(sandboxedIframe, "sandboxedIframe");
- var removeExistingElements = /* @__PURE__ */ __name((doc, id27, divId, iFrameId) => {
- doc.getElementById(id27)?.remove();
+ var removeExistingElements = /* @__PURE__ */ __name((doc, id29, divId, iFrameId) => {
+ doc.getElementById(id29)?.remove();
doc.getElementById(divId)?.remove();
doc.getElementById(iFrameId)?.remove();
}, "removeExistingElements");
- var render6 = /* @__PURE__ */ __name(async function(id27, text2, svgContainingElement) {
+ var render5 = /* @__PURE__ */ __name(async function(id29, text4, svgContainingElement) {
addDiagrams();
- const processed2 = processAndSetConfigs(text2);
- text2 = processed2.code;
- const config6 = getConfig();
- log.debug(config6);
- if (text2.length > (config6?.maxTextSize ?? MAX_TEXTLENGTH)) {
- text2 = MAX_TEXTLENGTH_EXCEEDED_MSG;
- }
- const idSelector = "#" + id27;
- const iFrameID = "i" + id27;
+ const processed2 = processAndSetConfigs(text4);
+ text4 = processed2.code;
+ const config5 = getConfig();
+ log.debug(config5);
+ if (text4.length > (config5?.maxTextSize ?? MAX_TEXTLENGTH)) {
+ text4 = MAX_TEXTLENGTH_EXCEEDED_MSG;
+ }
+ const idSelector = "#" + id29;
+ const iFrameID = "i" + id29;
const iFrameID_selector = "#" + iFrameID;
- const enclosingDivID = "d" + id27;
+ const enclosingDivID = "d" + id29;
const enclosingDivID_selector = "#" + enclosingDivID;
const removeTempElements = /* @__PURE__ */ __name(() => {
const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector;
@@ -143205,9 +151387,9 @@ ${config6.themeCSS}`;
}
}, "removeTempElements");
let root4 = select_default2("body");
- const isSandboxed = config6.securityLevel === SECURITY_LVL_SANDBOX;
- const isLooseSecurityLevel = config6.securityLevel === SECURITY_LVL_LOOSE;
- const fontFamily = config6.fontFamily;
+ const isSandboxed = config5.securityLevel === SECURITY_LVL_SANDBOX;
+ const isLooseSecurityLevel = config5.securityLevel === SECURITY_LVL_LOOSE;
+ const fontFamily = config5.fontFamily;
if (svgContainingElement !== void 0) {
if (svgContainingElement) {
svgContainingElement.innerHTML = "";
@@ -143219,9 +151401,9 @@ ${config6.themeCSS}`;
} else {
root4 = select_default2(svgContainingElement);
}
- appendDivSvgG(root4, id27, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD);
+ appendDivSvgG(root4, id29, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD);
} else {
- removeExistingElements(document, id27, enclosingDivID, iFrameID);
+ removeExistingElements(document, id29, enclosingDivID, iFrameID);
if (isSandboxed) {
const iframe = sandboxedIframe(select_default2("body"), iFrameID);
root4 = select_default2(iframe.nodes()[0].contentDocument.body);
@@ -143229,14 +151411,14 @@ ${config6.themeCSS}`;
} else {
root4 = select_default2("body");
}
- appendDivSvgG(root4, id27, enclosingDivID);
+ appendDivSvgG(root4, id29, enclosingDivID);
}
let diag;
let parseEncounteredException;
try {
- diag = await Diagram.fromText(text2, { title: processed2.title });
+ diag = await Diagram.fromText(text4, { title: processed2.title });
} catch (error3) {
- if (config6.suppressErrorRendering) {
+ if (config5.suppressErrorRendering) {
removeTempElements();
throw error3;
}
@@ -143245,20 +151427,20 @@ ${config6.themeCSS}`;
}
const element3 = root4.select(enclosingDivID_selector).node();
const diagramType = diag.type;
- const svg = element3.firstChild;
- const firstChild = svg.firstChild;
- const diagramClassDefs = diag.renderer.getClasses?.(text2, diag);
- const rules = createUserStyles(config6, diagramType, diagramClassDefs, idSelector);
+ const svg2 = element3.firstChild;
+ const firstChild = svg2.firstChild;
+ const diagramClassDefs = diag.renderer.getClasses?.(text4, diag);
+ const rules = createUserStyles(config5, diagramType, diagramClassDefs, idSelector);
const style1 = document.createElement("style");
style1.innerHTML = rules;
- svg.insertBefore(style1, firstChild);
+ svg2.insertBefore(style1, firstChild);
try {
- await diag.renderer.draw(text2, id27, version2, diag);
+ await diag.renderer.draw(text4, id29, package_default.version, diag);
} catch (e3) {
- if (config6.suppressErrorRendering) {
+ if (config5.suppressErrorRendering) {
removeTempElements();
} else {
- errorRenderer_default.draw(text2, id27, version2);
+ errorRenderer_default.draw(text4, id29, package_default.version);
}
throw e3;
}
@@ -143266,17 +151448,18 @@ ${config6.themeCSS}`;
const a11yTitle = diag.db.getAccTitle?.();
const a11yDescr = diag.db.getAccDescription?.();
addA11yInfo(diagramType, svgNode2, a11yTitle, a11yDescr);
- root4.select(`[id="${id27}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD);
+ root4.select(`[id="${id29}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD);
let svgCode = root4.select(enclosingDivID_selector).node().innerHTML;
- log.debug("config.arrowMarkerAbsolute", config6.arrowMarkerAbsolute);
- svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config6.arrowMarkerAbsolute));
+ log.debug("config.arrowMarkerAbsolute", config5.arrowMarkerAbsolute);
+ svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config5.arrowMarkerAbsolute));
if (isSandboxed) {
const svgEl = root4.select(enclosingDivID_selector + " svg").node();
svgCode = putIntoIFrame(svgCode, svgEl);
} else if (!isLooseSecurityLevel) {
- svgCode = import_dompurify2.default.sanitize(svgCode, {
+ svgCode = purify.sanitize(svgCode, {
ADD_TAGS: DOMPURIFY_TAGS,
- ADD_ATTR: DOMPURIFY_ATTR
+ ADD_ATTR: DOMPURIFY_ATTR,
+ HTML_INTEGRATION_POINTS: { foreignobject: true }
});
}
attachFunctions();
@@ -143306,13 +151489,13 @@ ${config6.themeCSS}`;
} else if (options3) {
options3.themeVariables = themes_default.default.getThemeVariables(options3.themeVariables);
}
- const config6 = typeof options3 === "object" ? setSiteConfig(options3) : getSiteConfig();
- setLogLevel(config6.logLevel);
+ const config5 = typeof options3 === "object" ? setSiteConfig(options3) : getSiteConfig();
+ setLogLevel(config5.logLevel);
addDiagrams();
}
__name(initialize, "initialize");
- var getDiagramFromText = /* @__PURE__ */ __name((text2, metadata = {}) => {
- const { code } = preprocessDiagram(text2);
+ var getDiagramFromText = /* @__PURE__ */ __name((text4, metadata = {}) => {
+ const { code } = preprocessDiagram(text4);
return Diagram.fromText(code, metadata);
}, "getDiagramFromText");
function addA11yInfo(diagramType, svgNode2, a11yTitle, a11yDescr) {
@@ -143321,8 +151504,8 @@ ${config6.themeCSS}`;
}
__name(addA11yInfo, "addA11yInfo");
var mermaidAPI = Object.freeze({
- render: render6,
- parse: parse6,
+ render: render5,
+ parse: parse5,
getDiagramFromText,
initialize,
getConfig,
@@ -143385,7 +151568,7 @@ ${config6.themeCSS}`;
var runThrowsErrors = /* @__PURE__ */ __name(async function({ postRenderCallback, querySelector, nodes: nodes6 } = {
querySelector: ".mermaid"
}) {
- const conf8 = mermaidAPI.getConfig();
+ const conf5 = mermaidAPI.getConfig();
log.debug(`${!postRenderCallback ? "No " : ""}Callback function found`);
let nodesToProcess;
if (nodes6) {
@@ -143396,11 +151579,11 @@ ${config6.themeCSS}`;
throw new Error("Nodes and querySelector are both undefined");
}
log.debug(`Found ${nodesToProcess.length} diagrams`);
- if (conf8?.startOnLoad !== void 0) {
- log.debug("Start On Load: " + conf8?.startOnLoad);
- mermaidAPI.updateSiteConfig({ startOnLoad: conf8?.startOnLoad });
+ if (conf5?.startOnLoad !== void 0) {
+ log.debug("Start On Load: " + conf5?.startOnLoad);
+ mermaidAPI.updateSiteConfig({ startOnLoad: conf5?.startOnLoad });
}
- const idGenerator = new utils_default2.InitIDGenerator(conf8.deterministicIds, conf8.deterministicIDSeed);
+ const idGenerator = new utils_default2.InitIDGenerator(conf5.deterministicIds, conf5.deterministicIDSeed);
let txt;
const errors = [];
for (const element3 of Array.from(nodesToProcess)) {
@@ -143409,7 +151592,7 @@ ${config6.themeCSS}`;
continue;
}
element3.setAttribute("data-processed", "true");
- const id27 = `mermaid-${idGenerator.next()}`;
+ const id29 = `mermaid-${idGenerator.next()}`;
txt = element3.innerHTML;
txt = dedent(utils_default2.entityDecode(txt)).trim().replace(/ /gi, " ");
const init3 = utils_default2.detectInit(txt);
@@ -143417,13 +151600,13 @@ ${config6.themeCSS}`;
log.debug("Detected early reinit: ", init3);
}
try {
- const { svg, bindFunctions: bindFunctions4 } = await render7(id27, txt, element3);
- element3.innerHTML = svg;
+ const { svg: svg2, bindFunctions: bindFunctions2 } = await render6(id29, txt, element3);
+ element3.innerHTML = svg2;
if (postRenderCallback) {
- await postRenderCallback(id27);
+ await postRenderCallback(id29);
}
- if (bindFunctions4) {
- bindFunctions4(element3);
+ if (bindFunctions2) {
+ bindFunctions2(element3);
}
} catch (error3) {
handleError(error3, errors, mermaid.parseError);
@@ -143433,13 +151616,13 @@ ${config6.themeCSS}`;
throw errors[0];
}
}, "runThrowsErrors");
- var initialize2 = /* @__PURE__ */ __name(function(config6) {
- mermaidAPI.initialize(config6);
+ var initialize2 = /* @__PURE__ */ __name(function(config5) {
+ mermaidAPI.initialize(config5);
}, "initialize");
- var init2 = /* @__PURE__ */ __name(async function(config6, nodes6, callback) {
+ var init2 = /* @__PURE__ */ __name(async function(config5, nodes6, callback) {
log.warn("mermaid.init is deprecated. Please use run instead.");
- if (config6) {
- initialize2(config6);
+ if (config5) {
+ initialize2(config5);
}
const runOptions = { postRenderCallback: callback, querySelector: ".mermaid" };
if (typeof nodes6 === "string") {
@@ -143484,10 +151667,10 @@ ${config6.themeCSS}`;
}
executionQueueRunning = true;
while (executionQueue.length > 0) {
- const f3 = executionQueue.shift();
- if (f3) {
+ const f2 = executionQueue.shift();
+ if (f2) {
try {
- await f3();
+ await f2();
} catch (e3) {
log.error("Error executing queue", e3);
}
@@ -143495,10 +151678,10 @@ ${config6.themeCSS}`;
}
executionQueueRunning = false;
}, "executeQueue");
- var parse7 = /* @__PURE__ */ __name(async (text2, parseOptions) => {
+ var parse6 = /* @__PURE__ */ __name(async (text4, parseOptions) => {
return new Promise((resolve3, reject3) => {
const performCall = /* @__PURE__ */ __name(() => new Promise((res, rej) => {
- mermaidAPI.parse(text2, parseOptions).then(
+ mermaidAPI.parse(text4, parseOptions).then(
(r2) => {
res(r2);
resolve3(r2);
@@ -143515,10 +151698,10 @@ ${config6.themeCSS}`;
executeQueue().catch(reject3);
});
}, "parse");
- var render7 = /* @__PURE__ */ __name((id27, text2, container2) => {
+ var render6 = /* @__PURE__ */ __name((id29, text4, container2) => {
return new Promise((resolve3, reject3) => {
const performCall = /* @__PURE__ */ __name(() => new Promise((res, rej) => {
- mermaidAPI.render(id27, text2, container2).then(
+ mermaidAPI.render(id29, text4, container2).then(
(r2) => {
res(r2);
resolve3(r2);
@@ -143538,8 +151721,8 @@ ${config6.themeCSS}`;
var mermaid = {
startOnLoad: true,
mermaidAPI,
- parse: parse7,
- render: render7,
+ parse: parse6,
+ render: render6,
init: init2,
run: run4,
registerExternalDiagrams,
@@ -143560,8 +151743,11 @@ ${config6.themeCSS}`;
*/
/*! Bundled license information:
-dompurify/dist/purify.js:
- (*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE *)
+dompurify/dist/purify.es.mjs:
+ (*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE *)
+
+js-yaml/dist/js-yaml.mjs:
+ (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
lodash-es/lodash.js:
(**
@@ -143589,8 +151775,5 @@ cytoscape/dist/cytoscape.esm.mjs:
*)
(*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
(*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
-
-js-yaml/dist/js-yaml.mjs:
- (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
*/
globalThis.mermaid = globalThis.__esbuild_esm_mermaid.default;
diff --git a/src/resources/formats/html/mermaid/mermaid.min.js b/src/resources/formats/html/mermaid/mermaid.min.js
index 9f2882748ce..6e12566eb7c 100644
--- a/src/resources/formats/html/mermaid/mermaid.min.js
+++ b/src/resources/formats/html/mermaid/mermaid.min.js
@@ -1,16 +1,16 @@
-"use strict";var __esbuild_esm_mermaid=(()=>{var Pve=Object.create;var G1=Object.defineProperty;var Bve=Object.getOwnPropertyDescriptor;var Fve=Object.getOwnPropertyNames;var zve=Object.getPrototypeOf,Gve=Object.prototype.hasOwnProperty;var o=(t,e)=>G1(t,"name",{value:e,configurable:!0});var R=(t,e)=>()=>(t&&(e=t(t=0)),e);var gi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hr=(t,e)=>{for(var r in e)G1(t,r,{get:e[r],enumerable:!0})},Rb=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fve(e))!Gve.call(t,i)&&i!==r&&G1(t,i,{get:()=>e[i],enumerable:!(n=Bve(e,i))||n.enumerable});return t},dr=(t,e,r)=>(Rb(t,e,"default"),r&&Rb(r,e,"default")),Xi=(t,e,r)=>(r=t!=null?Pve(zve(t)):{},Rb(e||!t||!t.__esModule?G1(r,"default",{value:t,enumerable:!0}):r,t)),$ve=t=>Rb(G1({},"__esModule",{value:!0}),t);var Nb=gi((AC,_C)=>{"use strict";(function(t,e){typeof AC=="object"&&typeof _C<"u"?_C.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(AC,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",s="hour",l="day",u="week",h="month",f="quarter",d="year",p="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(k){var I=["th","st","nd","rd"],C=k%100;return"["+k+(I[(C-20)%10]||I[C]||I[0])+"]"},"ordinal")},x=o(function(k,I,C){var O=String(k);return!O||O.length>=I?k:""+Array(I+1-O.length).join(C)+k},"m"),b={s:x,z:o(function(k){var I=-k.utcOffset(),C=Math.abs(I),O=Math.floor(C/60),D=C%60;return(I<=0?"+":"-")+x(O,2,"0")+":"+x(D,2,"0")},"z"),m:o(function k(I,C){if(I.date()1)return k(F[0])}else{var B=I.name;S[B]=I,D=B}return!O&&D&&(w=D),D||!O&&w},"t"),A=o(function(k,I){if(E(k))return k.clone();var C=typeof I=="object"?I:{};return C.date=k,C.args=arguments,new M(C)},"O"),L=b;L.l=_,L.i=E,L.w=function(k,I){return A(k,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var M=function(){function k(C){this.$L=_(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[T]=!0}o(k,"M");var I=k.prototype;return I.parse=function(C){this.$d=function(O){var D=O.date,P=O.utc;if(D===null)return new Date(NaN);if(L.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var F=D.match(g);if(F){var B=F[2]-1||0,$=(F[7]||"0").substring(0,3);return P?new Date(Date.UTC(F[1],B,F[3]||1,F[4]||0,F[5]||0,F[6]||0,$)):new Date(F[1],B,F[3]||1,F[4]||0,F[5]||0,F[6]||0,$)}}return new Date(D)}(C),this.init()},I.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},I.$utils=function(){return L},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(C,O){var D=A(C);return this.startOf(O)<=D&&D<=this.endOf(O)},I.isAfter=function(C,O){return A(C){"use strict";LF=Xi(Nb(),1),Zc={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:o((...t)=>{},"trace"),debug:o((...t)=>{},"debug"),info:o((...t)=>{},"info"),warn:o((...t)=>{},"warn"),error:o((...t)=>{},"error"),fatal:o((...t)=>{},"fatal")},$1=o(function(t="fatal"){let e=Zc.fatal;typeof t=="string"?t.toLowerCase()in Zc&&(e=Zc[t]):typeof t=="number"&&(e=t),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},e<=Zc.fatal&&(V.fatal=console.error?console.error.bind(console,Eo("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Eo("FATAL"))),e<=Zc.error&&(V.error=console.error?console.error.bind(console,Eo("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Eo("ERROR"))),e<=Zc.warn&&(V.warn=console.warn?console.warn.bind(console,Eo("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Eo("WARN"))),e<=Zc.info&&(V.info=console.info?console.info.bind(console,Eo("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Eo("INFO"))),e<=Zc.debug&&(V.debug=console.debug?console.debug.bind(console,Eo("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Eo("DEBUG"))),e<=Zc.trace&&(V.trace=console.debug?console.debug.bind(console,Eo("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Eo("TRACE")))},"setLogLevel"),Eo=o(t=>`%c${(0,LF.default)().format("ss.SSS")} : ${t} : `,"format")});var Vve,np,LC,DF,Mb=R(()=>{"use strict";Vve=Object.freeze({left:0,top:0,width:16,height:16}),np=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),LC=Object.freeze({...Vve,...np}),DF=Object.freeze({...LC,body:"",hidden:!1})});var Uve,RF,NF=R(()=>{"use strict";Mb();Uve=Object.freeze({width:null,height:null}),RF=Object.freeze({...Uve,...np})});var Ib,DC,Ob,MF=R(()=>{"use strict";Ib=/^[a-z0-9]+(-[a-z0-9]+)*$/,DC=o((t,e,r,n="")=>{let i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let l=i.pop(),u=i.pop(),h={provider:i.length>0?i[0]:n,prefix:u,name:l};return e&&!Ob(h)?null:h}let a=i[0],s=a.split("-");if(s.length>1){let l={provider:n,prefix:s.shift(),name:s.join("-")};return e&&!Ob(l)?null:l}if(r&&n===""){let l={provider:n,prefix:"",name:a};return e&&!Ob(l,r)?null:l}return null},"stringToIcon"),Ob=o((t,e)=>t?!!((t.provider===""||t.provider.match(Ib))&&(e&&t.prefix===""||t.prefix.match(Ib))&&t.name.match(Ib)):!1,"validateIconName")});function IF(t,e){let r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);let n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}var OF=R(()=>{"use strict";o(IF,"mergeIconTransformations")});function RC(t,e){let r=IF(t,e);for(let n in DF)n in np?n in t&&!(n in r)&&(r[n]=np[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}var PF=R(()=>{"use strict";Mb();OF();o(RC,"mergeIconData")});function BF(t,e){let r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;let l=n[s]&&n[s].parent,u=l&&a(l);u&&(i[s]=[l].concat(u))}return i[s]}return o(a,"resolve"),(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}var FF=R(()=>{"use strict";o(BF,"getIconsTree")});function zF(t,e,r){let n=t.icons,i=t.aliases||Object.create(null),a={};function s(l){a=RC(n[l]||i[l],a)}return o(s,"parse"),s(e),r.forEach(s),RC(t,a)}function NC(t,e){if(t.icons[e])return zF(t,e,[]);let r=BF(t,[e])[e];return r?zF(t,e,r):null}var GF=R(()=>{"use strict";PF();FF();o(zF,"internalGetIconData");o(NC,"getIconData")});function MC(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;let n=t.split(Hve);if(n===null||!n.length)return t;let i=[],a=n.shift(),s=Yve.test(a);for(;;){if(s){let l=parseFloat(a);isNaN(l)?i.push(a):i.push(Math.ceil(l*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}var Hve,Yve,$F=R(()=>{"use strict";Hve=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Yve=/^-?[0-9.]*[0-9]+[0-9.]*$/g;o(MC,"calculateSize")});function Wve(t,e="defs"){let r="",n=t.indexOf("<"+e);for(;n>=0;){let i=t.indexOf(">",n),a=t.indexOf(""+e);if(i===-1||a===-1)break;let s=t.indexOf(">",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function qve(t,e){return t?""+t+" "+e:e}function VF(t,e,r){let n=Wve(t);return qve(n.defs,e+n.content+r)}var UF=R(()=>{"use strict";o(Wve,"splitSVGDefs");o(qve,"mergeDefsAndContent");o(VF,"wrapSVGContent")});function IC(t,e){let r={...LC,...t},n={...RF,...e},i={left:r.left,top:r.top,width:r.width,height:r.height},a=r.body;[r,n].forEach(y=>{let v=[],x=y.hFlip,b=y.vFlip,w=y.rotate;x?b?w+=2:(v.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),v.push("scale(-1 1)"),i.top=i.left=0):b&&(v.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),v.push("scale(1 -1)"),i.top=i.left=0);let S;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:S=i.height/2+i.top,v.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:v.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:S=i.width/2+i.left,v.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}w%2===1&&(i.left!==i.top&&(S=i.left,i.left=i.top,i.top=S),i.width!==i.height&&(S=i.width,i.width=i.height,i.height=S)),v.length&&(a=VF(a,''," "))});let s=n.width,l=n.height,u=i.width,h=i.height,f,d;s===null?(d=l===null?"1em":l==="auto"?h:l,f=MC(d,u/h)):(f=s==="auto"?u:s,d=l===null?MC(f,h/u):l==="auto"?h:l);let p={},m=o((y,v)=>{Xve(v)||(p[y]=v.toString())},"setAttr");m("width",f),m("height",d);let g=[i.left,i.top,u,h];return p.viewBox=g.join(" "),{attributes:p,viewBox:g,body:a}}var Xve,HF=R(()=>{"use strict";Mb();NF();$F();UF();Xve=o(t=>t==="unset"||t==="undefined"||t==="none","isUnsetKeyword");o(IC,"iconToSVG")});function OC(t,e=Kve){let r=[],n;for(;n=jve.exec(t);)r.push(n[1]);if(!r.length)return t;let i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(a=>{let s=typeof e=="function"?e(a):e+(Qve++).toString(),l=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}var jve,Kve,Qve,YF=R(()=>{"use strict";jve=/\sid="(\S+)"/g,Kve="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Qve=0;o(OC,"replaceIDs")});function PC(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+" "}var WF=R(()=>{"use strict";o(PC,"iconToHTML")});var XF=gi((ait,qF)=>{"use strict";var ip=1e3,ap=ip*60,sp=ap*60,$f=sp*24,Zve=$f*7,Jve=$f*365.25;qF.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return e2e(t);if(r==="number"&&isFinite(t))return e.long?r2e(t):t2e(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function e2e(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Jve;case"weeks":case"week":case"w":return r*Zve;case"days":case"day":case"d":return r*$f;case"hours":case"hour":case"hrs":case"hr":case"h":return r*sp;case"minutes":case"minute":case"mins":case"min":case"m":return r*ap;case"seconds":case"second":case"secs":case"sec":case"s":return r*ip;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(e2e,"parse");function t2e(t){var e=Math.abs(t);return e>=$f?Math.round(t/$f)+"d":e>=sp?Math.round(t/sp)+"h":e>=ap?Math.round(t/ap)+"m":e>=ip?Math.round(t/ip)+"s":t+"ms"}o(t2e,"fmtShort");function r2e(t){var e=Math.abs(t);return e>=$f?Pb(t,e,$f,"day"):e>=sp?Pb(t,e,sp,"hour"):e>=ap?Pb(t,e,ap,"minute"):e>=ip?Pb(t,e,ip,"second"):t+" ms"}o(r2e,"fmtLong");function Pb(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(Pb,"plural")});var KF=gi((oit,jF)=>{"use strict";function n2e(t){r.debug=r,r.default=r,r.coerce=u,r.disable=a,r.enable=i,r.enabled=s,r.humanize=XF(),r.destroy=h,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let d=0;for(let p=0;p{if(E==="%%")return"%";S++;let A=r.formatters[_];if(typeof A=="function"){let L=v[S];E=A.call(x,L),v.splice(S,1),S--}return E}),r.formatArgs.call(x,v),(x.log||r.log).apply(x,v)}return o(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:o(()=>p!==null?p:(m!==r.namespaces&&(m=r.namespaces,g=r.enabled(f)),g),"get"),set:o(v=>{p=v},"set")}),typeof r.init=="function"&&r.init(y),y}o(r,"createDebug");function n(f,d){let p=r(this.namespace+(typeof d>"u"?":":d)+f);return p.log=this.log,p}o(n,"extend");function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let d,p=(typeof f=="string"?f:"").split(/[\s,]+/),m=p.length;for(d=0;d"-"+d)].join(",");return r.enable(""),f}o(a,"disable");function s(f){if(f[f.length-1]==="*")return!0;let d,p;for(d=0,p=r.skips.length;d{"use strict";Ys.formatArgs=a2e;Ys.save=s2e;Ys.load=o2e;Ys.useColors=i2e;Ys.storage=l2e();Ys.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ys.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function i2e(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(i2e,"useColors");function a2e(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Bb.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(a2e,"formatArgs");Ys.log=console.debug||console.log||(()=>{});function s2e(t){try{t?Ys.storage.setItem("debug",t):Ys.storage.removeItem("debug")}catch{}}o(s2e,"save");function o2e(){let t;try{t=Ys.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(o2e,"load");function l2e(){try{return localStorage}catch{}}o(l2e,"localstorage");Bb.exports=KF()(Ys);var{formatters:c2e}=Bb.exports;c2e.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var uit,ZF=R(()=>{"use strict";MF();GF();HF();YF();WF();uit=Xi(QF(),1)});var FC,BC,JF,Fb,u2e,zb,V1=R(()=>{"use strict";ut();ZF();FC={body:'? ',height:80,width:80},BC=new Map,JF=new Map,Fb=o(t=>{for(let e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(V.debug("Registering icon pack:",e.name),"loader"in e)JF.set(e.name,e.loader);else if("icons"in e)BC.set(e.name,e.icons);else throw V.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),u2e=o(async(t,e)=>{let r=DC(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);let n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=BC.get(n);if(!i){let s=JF.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},BC.set(n,i)}catch(l){throw V.error(l),new Error(`Failed to load icon set: ${r.prefix}`)}}let a=NC(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),zb=o(async(t,e)=>{let r;try{r=await u2e(t,e?.fallbackPrefix)}catch(a){V.error(a),r=FC}let n=IC(r,e);return PC(OC(n.body),n.attributes)},"getIconSVG")});function Gb(t){for(var e=[],r=1;r{var B2e=Object.create;var by=Object.defineProperty;var F2e=Object.getOwnPropertyDescriptor;var $2e=Object.getOwnPropertyNames;var z2e=Object.getPrototypeOf,G2e=Object.prototype.hasOwnProperty;var o=(t,e)=>by(t,"name",{value:e,configurable:!0});var N=(t,e)=>()=>(t&&(e=t(t=0)),e);var Mi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hr=(t,e)=>{for(var r in e)by(t,r,{get:e[r],enumerable:!0})},L4=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $2e(e))!G2e.call(t,i)&&i!==r&&by(t,i,{get:()=>e[i],enumerable:!(n=F2e(e,i))||n.enumerable});return t},Sr=(t,e,r)=>(L4(t,e,"default"),r&&L4(r,e,"default")),Sa=(t,e,r)=>(r=t!=null?B2e(z2e(t)):{},L4(e||!t||!t.__esModule?by(r,"default",{value:t,enumerable:!0}):r,t)),V2e=t=>L4(by({},"__esModule",{value:!0}),t);var R4=Mi((EC,SC)=>{"use strict";(function(t,e){typeof EC=="object"&&typeof SC<"u"?SC.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(EC,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",s="hour",l="day",u="week",h="month",f="quarter",d="year",p="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(k){var L=["th","st","nd","rd"],R=k%100;return"["+k+(L[(R-20)%10]||L[R]||L[0])+"]"},"ordinal")},x=o(function(k,L,R){var O=String(k);return!O||O.length>=L?k:""+Array(L+1-O.length).join(R)+k},"m"),b={s:x,z:o(function(k){var L=-k.utcOffset(),R=Math.abs(L),O=Math.floor(R/60),M=R%60;return(L<=0?"+":"-")+x(O,2,"0")+":"+x(M,2,"0")},"z"),m:o(function k(L,R){if(L.date()1)return k(F[0])}else{var P=L.name;C[P]=L,M=P}return!O&&M&&(w=M),M||!O&&w},"t"),S=o(function(k,L){if(E(k))return k.clone();var R=typeof L=="object"?L:{};return R.date=k,R.args=arguments,new I(R)},"O"),_=b;_.l=A,_.i=E,_.w=function(k,L){return S(k,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var I=function(){function k(R){this.$L=A(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[T]=!0}o(k,"M");var L=k.prototype;return L.parse=function(R){this.$d=function(O){var M=O.date,B=O.utc;if(M===null)return new Date(NaN);if(_.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var F=M.match(g);if(F){var P=F[2]-1||0,z=(F[7]||"0").substring(0,3);return B?new Date(Date.UTC(F[1],P,F[3]||1,F[4]||0,F[5]||0,F[6]||0,z)):new Date(F[1],P,F[3]||1,F[4]||0,F[5]||0,F[6]||0,z)}}return new Date(M)}(R),this.init()},L.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},L.$utils=function(){return _},L.isValid=function(){return this.$d.toString()!==m},L.isSame=function(R,O){var M=S(R);return this.startOf(O)<=M&&M<=this.endOf(O)},L.isAfter=function(R,O){return S(R){"use strict";CF=Sa(R4(),1),eu={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Y={trace:o((...t)=>{},"trace"),debug:o((...t)=>{},"debug"),info:o((...t)=>{},"info"),warn:o((...t)=>{},"warn"),error:o((...t)=>{},"error"),fatal:o((...t)=>{},"fatal")},wy=o(function(t="fatal"){let e=eu.fatal;typeof t=="string"?t.toLowerCase()in eu&&(e=eu[t]):typeof t=="number"&&(e=t),Y.trace=()=>{},Y.debug=()=>{},Y.info=()=>{},Y.warn=()=>{},Y.error=()=>{},Y.fatal=()=>{},e<=eu.fatal&&(Y.fatal=console.error?console.error.bind(console,bo("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",bo("FATAL"))),e<=eu.error&&(Y.error=console.error?console.error.bind(console,bo("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",bo("ERROR"))),e<=eu.warn&&(Y.warn=console.warn?console.warn.bind(console,bo("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",bo("WARN"))),e<=eu.info&&(Y.info=console.info?console.info.bind(console,bo("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",bo("INFO"))),e<=eu.debug&&(Y.debug=console.debug?console.debug.bind(console,bo("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",bo("DEBUG"))),e<=eu.trace&&(Y.trace=console.debug?console.debug.bind(console,bo("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",bo("TRACE")))},"setLogLevel"),bo=o(t=>`%c${(0,CF.default)().format("ss.SSS")} : ${t} : `,"format")});var U2e,e0,CC,AF,N4=N(()=>{"use strict";U2e=Object.freeze({left:0,top:0,width:16,height:16}),e0=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),CC=Object.freeze({...U2e,...e0}),AF=Object.freeze({...CC,body:"",hidden:!1})});var H2e,_F,DF=N(()=>{"use strict";N4();H2e=Object.freeze({width:null,height:null}),_F=Object.freeze({...H2e,...e0})});var AC,M4,LF=N(()=>{"use strict";AC=o((t,e,r,n="")=>{let i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let l=i.pop(),u=i.pop(),h={provider:i.length>0?i[0]:n,prefix:u,name:l};return e&&!M4(h)?null:h}let a=i[0],s=a.split("-");if(s.length>1){let l={provider:n,prefix:s.shift(),name:s.join("-")};return e&&!M4(l)?null:l}if(r&&n===""){let l={provider:n,prefix:"",name:a};return e&&!M4(l,r)?null:l}return null},"stringToIcon"),M4=o((t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,"validateIconName")});function RF(t,e){let r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);let n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}var NF=N(()=>{"use strict";o(RF,"mergeIconTransformations")});function _C(t,e){let r=RF(t,e);for(let n in AF)n in e0?n in t&&!(n in r)&&(r[n]=e0[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}var MF=N(()=>{"use strict";N4();NF();o(_C,"mergeIconData")});function IF(t,e){let r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;let l=n[s]&&n[s].parent,u=l&&a(l);u&&(i[s]=[l].concat(u))}return i[s]}return o(a,"resolve"),(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}var OF=N(()=>{"use strict";o(IF,"getIconsTree")});function PF(t,e,r){let n=t.icons,i=t.aliases||Object.create(null),a={};function s(l){a=_C(n[l]||i[l],a)}return o(s,"parse"),s(e),r.forEach(s),_C(t,a)}function DC(t,e){if(t.icons[e])return PF(t,e,[]);let r=IF(t,[e])[e];return r?PF(t,e,r):null}var BF=N(()=>{"use strict";MF();OF();o(PF,"internalGetIconData");o(DC,"getIconData")});function LC(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;let n=t.split(W2e);if(n===null||!n.length)return t;let i=[],a=n.shift(),s=q2e.test(a);for(;;){if(s){let l=parseFloat(a);isNaN(l)?i.push(a):i.push(Math.ceil(l*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}var W2e,q2e,FF=N(()=>{"use strict";W2e=/(-?[0-9.]*[0-9]+[0-9.]*)/g,q2e=/^-?[0-9.]*[0-9]+[0-9.]*$/g;o(LC,"calculateSize")});function Y2e(t,e="defs"){let r="",n=t.indexOf("<"+e);for(;n>=0;){let i=t.indexOf(">",n),a=t.indexOf(""+e);if(i===-1||a===-1)break;let s=t.indexOf(">",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function X2e(t,e){return t?""+t+" "+e:e}function $F(t,e,r){let n=Y2e(t);return X2e(n.defs,e+n.content+r)}var zF=N(()=>{"use strict";o(Y2e,"splitSVGDefs");o(X2e,"mergeDefsAndContent");o($F,"wrapSVGContent")});function RC(t,e){let r={...CC,...t},n={..._F,...e},i={left:r.left,top:r.top,width:r.width,height:r.height},a=r.body;[r,n].forEach(y=>{let v=[],x=y.hFlip,b=y.vFlip,w=y.rotate;x?b?w+=2:(v.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),v.push("scale(-1 1)"),i.top=i.left=0):b&&(v.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),v.push("scale(1 -1)"),i.top=i.left=0);let C;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:C=i.height/2+i.top,v.unshift("rotate(90 "+C.toString()+" "+C.toString()+")");break;case 2:v.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:C=i.width/2+i.left,v.unshift("rotate(-90 "+C.toString()+" "+C.toString()+")");break}w%2===1&&(i.left!==i.top&&(C=i.left,i.left=i.top,i.top=C),i.width!==i.height&&(C=i.width,i.width=i.height,i.height=C)),v.length&&(a=$F(a,''," "))});let s=n.width,l=n.height,u=i.width,h=i.height,f,d;s===null?(d=l===null?"1em":l==="auto"?h:l,f=LC(d,u/h)):(f=s==="auto"?u:s,d=l===null?LC(f,h/u):l==="auto"?h:l);let p={},m=o((y,v)=>{j2e(v)||(p[y]=v.toString())},"setAttr");m("width",f),m("height",d);let g=[i.left,i.top,u,h];return p.viewBox=g.join(" "),{attributes:p,viewBox:g,body:a}}var j2e,GF=N(()=>{"use strict";N4();DF();FF();zF();j2e=o(t=>t==="unset"||t==="undefined"||t==="none","isUnsetKeyword");o(RC,"iconToSVG")});function NC(t,e=Q2e){let r=[],n;for(;n=K2e.exec(t);)r.push(n[1]);if(!r.length)return t;let i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(a=>{let s=typeof e=="function"?e(a):e+(Z2e++).toString(),l=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}var K2e,Q2e,Z2e,VF=N(()=>{"use strict";K2e=/\sid="(\S+)"/g,Q2e="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Z2e=0;o(NC,"replaceIDs")});function MC(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+" "}var UF=N(()=>{"use strict";o(MC,"iconToHTML")});var WF=Mi((iit,HF)=>{"use strict";var t0=1e3,r0=t0*60,n0=r0*60,Wf=n0*24,J2e=Wf*7,exe=Wf*365.25;HF.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return txe(t);if(r==="number"&&isFinite(t))return e.long?nxe(t):rxe(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function txe(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*exe;case"weeks":case"week":case"w":return r*J2e;case"days":case"day":case"d":return r*Wf;case"hours":case"hour":case"hrs":case"hr":case"h":return r*n0;case"minutes":case"minute":case"mins":case"min":case"m":return r*r0;case"seconds":case"second":case"secs":case"sec":case"s":return r*t0;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(txe,"parse");function rxe(t){var e=Math.abs(t);return e>=Wf?Math.round(t/Wf)+"d":e>=n0?Math.round(t/n0)+"h":e>=r0?Math.round(t/r0)+"m":e>=t0?Math.round(t/t0)+"s":t+"ms"}o(rxe,"fmtShort");function nxe(t){var e=Math.abs(t);return e>=Wf?I4(t,e,Wf,"day"):e>=n0?I4(t,e,n0,"hour"):e>=r0?I4(t,e,r0,"minute"):e>=t0?I4(t,e,t0,"second"):t+" ms"}o(nxe,"fmtLong");function I4(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(I4,"plural")});var YF=Mi((sit,qF)=>{"use strict";function ixe(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=l,r.humanize=WF(),r.destroy=h,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let d=0;for(let p=0;p{if(E==="%%")return"%";C++;let S=r.formatters[A];if(typeof S=="function"){let _=v[C];E=S.call(x,_),v.splice(C,1),C--}return E}),r.formatArgs.call(x,v),(x.log||r.log).apply(x,v)}return o(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:o(()=>p!==null?p:(m!==r.namespaces&&(m=r.namespaces,g=r.enabled(f)),g),"get"),set:o(v=>{p=v},"set")}),typeof r.init=="function"&&r.init(y),y}o(r,"createDebug");function n(f,d){let p=r(this.namespace+(typeof d>"u"?":":d)+f);return p.log=this.log,p}o(n,"extend");function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let d=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let p of d)p[0]==="-"?r.skips.push(p.slice(1)):r.names.push(p)}o(i,"enable");function a(f,d){let p=0,m=0,g=-1,y=0;for(;p"-"+d)].join(",");return r.enable(""),f}o(s,"disable");function l(f){for(let d of r.skips)if(a(f,d))return!1;for(let d of r.names)if(a(f,d))return!0;return!1}o(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}o(u,"coerce");function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o(h,"destroy"),r.enable(r.load()),r}o(ixe,"setup");qF.exports=ixe});var XF=Mi((qs,O4)=>{"use strict";qs.formatArgs=sxe;qs.save=oxe;qs.load=lxe;qs.useColors=axe;qs.storage=cxe();qs.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();qs.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function axe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(axe,"useColors");function sxe(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+O4.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(sxe,"formatArgs");qs.log=console.debug||console.log||(()=>{});function oxe(t){try{t?qs.storage.setItem("debug",t):qs.storage.removeItem("debug")}catch{}}o(oxe,"save");function lxe(){let t;try{t=qs.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(lxe,"load");function cxe(){try{return localStorage}catch{}}o(cxe,"localstorage");O4.exports=YF()(qs);var{formatters:uxe}=O4.exports;uxe.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var uit,jF=N(()=>{"use strict";LF();BF();GF();VF();UF();uit=Sa(XF(),1)});var OC,IC,KF,P4,hxe,wo,tu=N(()=>{"use strict";vt();jF();OC={body:'? ',height:80,width:80},IC=new Map,KF=new Map,P4=o(t=>{for(let e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(Y.debug("Registering icon pack:",e.name),"loader"in e)KF.set(e.name,e.loader);else if("icons"in e)IC.set(e.name,e.icons);else throw Y.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),hxe=o(async(t,e)=>{let r=AC(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);let n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=IC.get(n);if(!i){let s=KF.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},IC.set(n,i)}catch(l){throw Y.error(l),new Error(`Failed to load icon set: ${r.prefix}`)}}let a=DC(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),wo=o(async(t,e)=>{let r;try{r=await hxe(t,e?.fallbackPrefix)}catch(a){Y.error(a),r=OC}let n=RC(r,e);return MC(NC(n.body),n.attributes)},"getIconSVG")});function B4(t){for(var e=[],r=1;r{"use strict";o(Gb,"dedent")});var $b,Vf,ez,Vb=R(()=>{"use strict";$b=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Vf=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ez=/\s*%%.*\n/gm});var op,GC=R(()=>{"use strict";op=class extends Error{static{o(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}}});var Uf,lp,Ub,$C,tz,Hf=R(()=>{"use strict";ut();Vb();GC();Uf={},lp=o(function(t,e){t=t.replace($b,"").replace(Vf,"").replace(ez,`
-`);for(let[r,{detector:n}]of Object.entries(Uf))if(n(t,e))return r;throw new op(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),Ub=o((...t)=>{for(let{id:e,detector:r,loader:n}of t)$C(e,r,n)},"registerLazyLoadedDiagrams"),$C=o((t,e,r)=>{Uf[t]&&V.warn(`Detector with key ${t} already exists. Overwriting.`),Uf[t]={detector:e,loader:r},V.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),tz=o(t=>Uf[t].loader,"getDiagramLoader")});var U1,rz,VC=R(()=>{"use strict";U1=function(){var t=o(function(_e,me,W,fe){for(W=W||{},fe=_e.length;fe--;W[_e[fe]]=me);return W},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],l=[1,64],u=[1,65],h=[1,66],f=[1,67],d=[1,68],p=[1,69],m=[1,29],g=[1,30],y=[1,31],v=[1,32],x=[1,33],b=[1,34],w=[1,35],S=[1,36],T=[1,37],E=[1,38],_=[1,39],A=[1,40],L=[1,41],M=[1,42],N=[1,43],k=[1,44],I=[1,45],C=[1,46],O=[1,47],D=[1,48],P=[1,50],F=[1,51],B=[1,52],$=[1,53],z=[1,54],Y=[1,55],Q=[1,56],X=[1,57],ie=[1,58],j=[1,59],J=[1,60],Z=[14,42],H=[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],q=[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],se=[1,83],ce=[1,84],ue=[1,85],te=[12,14,42],De=[12,14,33,42],oe=[12,14,33,42,76,77,79,80],ke=[12,33],Ie=[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],Se={trace:o(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:o(function(me,W,fe,ge,re,he,ne){var ae=he.length-1;switch(re){case 3:ge.setDirection("TB");break;case 4:ge.setDirection("BT");break;case 5:ge.setDirection("RL");break;case 6:ge.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:ge.setC4Type(he[ae-3]);break;case 19:ge.setTitle(he[ae].substring(6)),this.$=he[ae].substring(6);break;case 20:ge.setAccDescription(he[ae].substring(15)),this.$=he[ae].substring(15);break;case 21:this.$=he[ae].trim(),ge.setTitle(this.$);break;case 22:case 23:this.$=he[ae].trim(),ge.setAccDescription(this.$);break;case 28:he[ae].splice(2,0,"ENTERPRISE"),ge.addPersonOrSystemBoundary(...he[ae]),this.$=he[ae];break;case 29:he[ae].splice(2,0,"SYSTEM"),ge.addPersonOrSystemBoundary(...he[ae]),this.$=he[ae];break;case 30:ge.addPersonOrSystemBoundary(...he[ae]),this.$=he[ae];break;case 31:he[ae].splice(2,0,"CONTAINER"),ge.addContainerBoundary(...he[ae]),this.$=he[ae];break;case 32:ge.addDeploymentNode("node",...he[ae]),this.$=he[ae];break;case 33:ge.addDeploymentNode("nodeL",...he[ae]),this.$=he[ae];break;case 34:ge.addDeploymentNode("nodeR",...he[ae]),this.$=he[ae];break;case 35:ge.popBoundaryParseStack();break;case 39:ge.addPersonOrSystem("person",...he[ae]),this.$=he[ae];break;case 40:ge.addPersonOrSystem("external_person",...he[ae]),this.$=he[ae];break;case 41:ge.addPersonOrSystem("system",...he[ae]),this.$=he[ae];break;case 42:ge.addPersonOrSystem("system_db",...he[ae]),this.$=he[ae];break;case 43:ge.addPersonOrSystem("system_queue",...he[ae]),this.$=he[ae];break;case 44:ge.addPersonOrSystem("external_system",...he[ae]),this.$=he[ae];break;case 45:ge.addPersonOrSystem("external_system_db",...he[ae]),this.$=he[ae];break;case 46:ge.addPersonOrSystem("external_system_queue",...he[ae]),this.$=he[ae];break;case 47:ge.addContainer("container",...he[ae]),this.$=he[ae];break;case 48:ge.addContainer("container_db",...he[ae]),this.$=he[ae];break;case 49:ge.addContainer("container_queue",...he[ae]),this.$=he[ae];break;case 50:ge.addContainer("external_container",...he[ae]),this.$=he[ae];break;case 51:ge.addContainer("external_container_db",...he[ae]),this.$=he[ae];break;case 52:ge.addContainer("external_container_queue",...he[ae]),this.$=he[ae];break;case 53:ge.addComponent("component",...he[ae]),this.$=he[ae];break;case 54:ge.addComponent("component_db",...he[ae]),this.$=he[ae];break;case 55:ge.addComponent("component_queue",...he[ae]),this.$=he[ae];break;case 56:ge.addComponent("external_component",...he[ae]),this.$=he[ae];break;case 57:ge.addComponent("external_component_db",...he[ae]),this.$=he[ae];break;case 58:ge.addComponent("external_component_queue",...he[ae]),this.$=he[ae];break;case 60:ge.addRel("rel",...he[ae]),this.$=he[ae];break;case 61:ge.addRel("birel",...he[ae]),this.$=he[ae];break;case 62:ge.addRel("rel_u",...he[ae]),this.$=he[ae];break;case 63:ge.addRel("rel_d",...he[ae]),this.$=he[ae];break;case 64:ge.addRel("rel_l",...he[ae]),this.$=he[ae];break;case 65:ge.addRel("rel_r",...he[ae]),this.$=he[ae];break;case 66:ge.addRel("rel_b",...he[ae]),this.$=he[ae];break;case 67:he[ae].splice(0,1),ge.addRel("rel",...he[ae]),this.$=he[ae];break;case 68:ge.updateElStyle("update_el_style",...he[ae]),this.$=he[ae];break;case 69:ge.updateRelStyle("update_rel_style",...he[ae]),this.$=he[ae];break;case 70:ge.updateLayoutConfig("update_layout_config",...he[ae]),this.$=he[ae];break;case 71:this.$=[he[ae]];break;case 72:he[ae].unshift(he[ae-1]),this.$=he[ae];break;case 73:case 75:this.$=he[ae].trim();break;case 74:let we={};we[he[ae-1].trim()]=he[ae].trim(),this.$=we;break;case 76:this.$="";break}},"anonymous"),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:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{14:[1,74]},t(Z,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:h,39:f,40:d,41:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J}),t(Z,[2,14]),t(H,[2,16],{12:[1,76]}),t(Z,[2,36],{12:[1,77]}),t(q,[2,19]),t(q,[2,20]),{25:[1,78]},{27:[1,79]},t(q,[2,23]),{35:80,75:81,76:K,77:se,79:ce,80:ue},{35:86,75:81,76:K,77:se,79:ce,80:ue},{35:87,75:81,76:K,77:se,79:ce,80:ue},{35:88,75:81,76:K,77:se,79:ce,80:ue},{35:89,75:81,76:K,77:se,79:ce,80:ue},{35:90,75:81,76:K,77:se,79:ce,80:ue},{35:91,75:81,76:K,77:se,79:ce,80:ue},{35:92,75:81,76:K,77:se,79:ce,80:ue},{35:93,75:81,76:K,77:se,79:ce,80:ue},{35:94,75:81,76:K,77:se,79:ce,80:ue},{35:95,75:81,76:K,77:se,79:ce,80:ue},{35:96,75:81,76:K,77:se,79:ce,80:ue},{35:97,75:81,76:K,77:se,79:ce,80:ue},{35:98,75:81,76:K,77:se,79:ce,80:ue},{35:99,75:81,76:K,77:se,79:ce,80:ue},{35:100,75:81,76:K,77:se,79:ce,80:ue},{35:101,75:81,76:K,77:se,79:ce,80:ue},{35:102,75:81,76:K,77:se,79:ce,80:ue},{35:103,75:81,76:K,77:se,79:ce,80:ue},{35:104,75:81,76:K,77:se,79:ce,80:ue},t(te,[2,59]),{35:105,75:81,76:K,77:se,79:ce,80:ue},{35:106,75:81,76:K,77:se,79:ce,80:ue},{35:107,75:81,76:K,77:se,79:ce,80:ue},{35:108,75:81,76:K,77:se,79:ce,80:ue},{35:109,75:81,76:K,77:se,79:ce,80:ue},{35:110,75:81,76:K,77:se,79:ce,80:ue},{35:111,75:81,76:K,77:se,79:ce,80:ue},{35:112,75:81,76:K,77:se,79:ce,80:ue},{35:113,75:81,76:K,77:se,79:ce,80:ue},{35:114,75:81,76:K,77:se,79:ce,80:ue},{35:115,75:81,76:K,77:se,79:ce,80:ue},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:se,79:ce,80:ue},{35:120,75:81,76:K,77:se,79:ce,80:ue},{35:121,75:81,76:K,77:se,79:ce,80:ue},{35:122,75:81,76:K,77:se,79:ce,80:ue},{35:123,75:81,76:K,77:se,79:ce,80:ue},{35:124,75:81,76:K,77:se,79:ce,80:ue},{35:125,75:81,76:K,77:se,79:ce,80:ue},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(Z,[2,15]),t(H,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(Z,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:l,37:u,38:h,39:f,40:d,41:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J}),t(q,[2,21]),t(q,[2,22]),t(te,[2,39]),t(De,[2,71],{75:81,35:132,76:K,77:se,79:ce,80:ue}),t(oe,[2,73]),{78:[1,133]},t(oe,[2,75]),t(oe,[2,76]),t(te,[2,40]),t(te,[2,41]),t(te,[2,42]),t(te,[2,43]),t(te,[2,44]),t(te,[2,45]),t(te,[2,46]),t(te,[2,47]),t(te,[2,48]),t(te,[2,49]),t(te,[2,50]),t(te,[2,51]),t(te,[2,52]),t(te,[2,53]),t(te,[2,54]),t(te,[2,55]),t(te,[2,56]),t(te,[2,57]),t(te,[2,58]),t(te,[2,60]),t(te,[2,61]),t(te,[2,62]),t(te,[2,63]),t(te,[2,64]),t(te,[2,65]),t(te,[2,66]),t(te,[2,67]),t(te,[2,68]),t(te,[2,69]),t(te,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ke,[2,28]),t(ke,[2,29]),t(ke,[2,30]),t(ke,[2,31]),t(ke,[2,32]),t(ke,[2,33]),t(ke,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(H,[2,18]),t(Z,[2,38]),t(De,[2,72]),t(oe,[2,74]),t(te,[2,24]),t(te,[2,35]),t(Ie,[2,25]),t(Ie,[2,26],{12:[1,138]}),t(Ie,[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:o(function(me,W){if(W.recoverable)this.trace(me);else{var fe=new Error(me);throw fe.hash=W,fe}},"parseError"),parse:o(function(me){var W=this,fe=[0],ge=[],re=[null],he=[],ne=this.table,ae="",we=0,Te=0,Ce=0,Ae=2,Ge=1,Me=he.slice.call(arguments,1),ye=Object.create(this.lexer),He={yy:{}};for(var ze in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ze)&&(He.yy[ze]=this.yy[ze]);ye.setInput(me,He.yy),He.yy.lexer=ye,He.yy.parser=this,typeof ye.yylloc>"u"&&(ye.yylloc={});var Ze=ye.yylloc;he.push(Ze);var gt=ye.options&&ye.options.ranges;typeof He.yy.parseError=="function"?this.parseError=He.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yt(St){fe.length=fe.length-2*St,re.length=re.length-St,he.length=he.length-St}o(yt,"popStack");function tt(){var St;return St=ge.pop()||ye.lex()||Ge,typeof St!="number"&&(St instanceof Array&&(ge=St,St=ge.pop()),St=W.symbols_[St]||St),St}o(tt,"lex");for(var Ye,Je,Ve,je,kt,at,xt={},it,dt,lt,It;;){if(Ve=fe[fe.length-1],this.defaultActions[Ve]?je=this.defaultActions[Ve]:((Ye===null||typeof Ye>"u")&&(Ye=tt()),je=ne[Ve]&&ne[Ve][Ye]),typeof je>"u"||!je.length||!je[0]){var mt="";It=[];for(it in ne[Ve])this.terminals_[it]&&it>Ae&&It.push("'"+this.terminals_[it]+"'");ye.showPosition?mt="Parse error on line "+(we+1)+`:
-`+ye.showPosition()+`
-Expecting `+It.join(", ")+", got '"+(this.terminals_[Ye]||Ye)+"'":mt="Parse error on line "+(we+1)+": Unexpected "+(Ye==Ge?"end of input":"'"+(this.terminals_[Ye]||Ye)+"'"),this.parseError(mt,{text:ye.match,token:this.terminals_[Ye]||Ye,line:ye.yylineno,loc:Ze,expected:It})}if(je[0]instanceof Array&&je.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ve+", token: "+Ye);switch(je[0]){case 1:fe.push(Ye),re.push(ye.yytext),he.push(ye.yylloc),fe.push(je[1]),Ye=null,Je?(Ye=Je,Je=null):(Te=ye.yyleng,ae=ye.yytext,we=ye.yylineno,Ze=ye.yylloc,Ce>0&&Ce--);break;case 2:if(dt=this.productions_[je[1]][1],xt.$=re[re.length-dt],xt._$={first_line:he[he.length-(dt||1)].first_line,last_line:he[he.length-1].last_line,first_column:he[he.length-(dt||1)].first_column,last_column:he[he.length-1].last_column},gt&&(xt._$.range=[he[he.length-(dt||1)].range[0],he[he.length-1].range[1]]),at=this.performAction.apply(xt,[ae,Te,we,He.yy,je[1],re,he].concat(Me)),typeof at<"u")return at;dt&&(fe=fe.slice(0,-1*dt*2),re=re.slice(0,-1*dt),he=he.slice(0,-1*dt)),fe.push(this.productions_[je[1]][0]),re.push(xt.$),he.push(xt._$),lt=ne[fe[fe.length-2]][fe[fe.length-1]],fe.push(lt);break;case 3:return!0}}return!0},"parse")},Ue=function(){var _e={EOF:1,parseError:o(function(W,fe){if(this.yy.parser)this.yy.parser.parseError(W,fe);else throw new Error(W)},"parseError"),setInput:o(function(me,W){return this.yy=W||this.yy||{},this._input=me,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},"setInput"),input:o(function(){var me=this._input[0];this.yytext+=me,this.yyleng++,this.offset++,this.match+=me,this.matched+=me;var W=me.match(/(?:\r\n?|\n).*/g);return W?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),me},"input"),unput:o(function(me){var W=me.length,fe=me.split(/(?:\r\n?|\n)/g);this._input=me+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-W),this.offset-=W;var ge=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 re=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===ge.length?this.yylloc.first_column:0)+ge[ge.length-fe.length].length-fe[0].length:this.yylloc.first_column-W},this.options.ranges&&(this.yylloc.range=[re[0],re[0]+this.yyleng-W]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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},"reject"),less:o(function(me){this.unput(this.match.slice(me))},"less"),pastInput:o(function(){var me=this.matched.substr(0,this.matched.length-this.match.length);return(me.length>20?"...":"")+me.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var me=this.match;return me.length<20&&(me+=this._input.substr(0,20-me.length)),(me.substr(0,20)+(me.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var me=this.pastInput(),W=new Array(me.length+1).join("-");return me+this.upcomingInput()+`
-`+W+"^"},"showPosition"),test_match:o(function(me,W){var fe,ge,re;if(this.options.backtrack_lexer&&(re={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&&(re.yylloc.range=this.yylloc.range.slice(0))),ge=me[0].match(/(?:\r\n?|\n).*/g),ge&&(this.yylineno+=ge.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ge?ge[ge.length-1].length-ge[ge.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+me[0].length},this.yytext+=me[0],this.match+=me[0],this.matches=me,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(me[0].length),this.matched+=me[0],fe=this.performAction.call(this,this.yy,this,W,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),fe)return fe;if(this._backtrack){for(var he in re)this[he]=re[he];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var me,W,fe,ge;this._more||(this.yytext="",this.match="");for(var re=this._currentRules(),he=0;heW[0].length)){if(W=fe,ge=he,this.options.backtrack_lexer){if(me=this.test_match(fe,re[he]),me!==!1)return me;if(this._backtrack){W=!1;continue}else return!1}else if(!this.options.flex)break}return W?(me=this.test_match(W,re[ge]),me!==!1?me:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
-`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var W=this.next();return W||this.lex()},"lex"),begin:o(function(W){this.conditionStack.push(W)},"begin"),popState:o(function(){var W=this.conditionStack.length-1;return W>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:o(function(W){this.begin(W)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:o(function(W,fe,ge,re){var he=re;switch(ge){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;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),26;break;case 9:return this.popState(),"acc_descr_value";break;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;break;case 23:return this.begin("person"),44;break;case 24:return this.begin("system_ext_queue"),51;break;case 25:return this.begin("system_ext_db"),50;break;case 26:return this.begin("system_ext"),49;break;case 27:return this.begin("system_queue"),48;break;case 28:return this.begin("system_db"),47;break;case 29:return this.begin("system"),46;break;case 30:return this.begin("boundary"),37;break;case 31:return this.begin("enterprise_boundary"),34;break;case 32:return this.begin("system_boundary"),36;break;case 33:return this.begin("container_ext_queue"),57;break;case 34:return this.begin("container_ext_db"),56;break;case 35:return this.begin("container_ext"),55;break;case 36:return this.begin("container_queue"),54;break;case 37:return this.begin("container_db"),53;break;case 38:return this.begin("container"),52;break;case 39:return this.begin("container_boundary"),38;break;case 40:return this.begin("component_ext_queue"),63;break;case 41:return this.begin("component_ext_db"),62;break;case 42:return this.begin("component_ext"),61;break;case 43:return this.begin("component_queue"),60;break;case 44:return this.begin("component_db"),59;break;case 45:return this.begin("component"),58;break;case 46:return this.begin("node"),39;break;case 47:return this.begin("node"),39;break;case 48:return this.begin("node_l"),40;break;case 49:return this.begin("node_r"),41;break;case 50:return this.begin("rel"),64;break;case 51:return this.begin("birel"),65;break;case 52:return this.begin("rel_u"),66;break;case 53:return this.begin("rel_u"),66;break;case 54:return this.begin("rel_d"),67;break;case 55:return this.begin("rel_d"),67;break;case 56:return this.begin("rel_l"),68;break;case 57:return this.begin("rel_l"),68;break;case 58:return this.begin("rel_r"),69;break;case 59:return this.begin("rel_r"),69;break;case 60:return this.begin("rel_b"),70;break;case 61:return this.begin("rel_index"),71;break;case 62:return this.begin("update_el_style"),72;break;case 63:return this.begin("update_rel_style"),73;break;case 64:return this.begin("update_layout_config"),74;break;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";break;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";break;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}},"anonymous"),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 _e}();Se.lexer=Ue;function Pe(){this.yy={}}return o(Pe,"Parser"),Pe.prototype=Se,Se.Parser=Pe,new Pe}();U1.parser=U1;rz=U1});var UC,On,cp=R(()=>{"use strict";UC=o((t,e,{depth:r=2,clobber:n=!1}={})=>{let i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>UC(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=UC(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),On=UC});var Hb,nz,iz=R(()=>{"use strict";Hb={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:o(t=>t>=255?255:t<0?0:t,"r"),g:o(t=>t>=255?255:t<0?0:t,"g"),b:o(t=>t>=255?255:t<0?0:t,"b"),h:o(t=>t%360,"h"),s:o(t=>t>=100?100:t<0?0:t,"s"),l:o(t=>t>=100?100:t<0?0:t,"l"),a:o(t=>t>=1?1:t<0?0:t,"a")},toLinear:o(t=>{let e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},"toLinear"),hue2rgb:o((t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<.16666666666666666?t+(e-t)*6*r:r<.5?e:r<.6666666666666666?t+(e-t)*(.6666666666666666-r)*6:t),"hue2rgb"),hsl2rgb:o(({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;let i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return Hb.hue2rgb(a,i,t+.3333333333333333)*255;case"g":return Hb.hue2rgb(a,i,t)*255;case"b":return Hb.hue2rgb(a,i,t-.3333333333333333)*255}},"hsl2rgb"),rgb2hsl:o(({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;let i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;let l=i-a,u=s>.5?l/(2-i-a):l/(i+a);if(n==="s")return u*100;switch(i){case t:return((e-r)/l+(e{"use strict";h2e={clamp:o((t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),"clamp"),round:o(t=>Math.round(t*1e10)/1e10,"round")},az=h2e});var f2e,oz,lz=R(()=>{"use strict";f2e={dec2hex:o(t=>{let e=Math.round(t).toString(16);return e.length>1?e:`0${e}`},"dec2hex")},oz=f2e});var d2e,Bt,jl=R(()=>{"use strict";iz();sz();lz();d2e={channel:nz,lang:az,unit:oz},Bt=d2e});var Jc,Li,H1=R(()=>{"use strict";jl();Jc={};for(let t=0;t<=255;t++)Jc[t]=Bt.unit.dec2hex(t);Li={ALL:0,RGB:1,HSL:2}});var HC,cz,uz=R(()=>{"use strict";H1();HC=class{static{o(this,"Type")}constructor(){this.type=Li.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Li.ALL}is(e){return this.type===e}},cz=HC});var YC,hz,fz=R(()=>{"use strict";jl();uz();H1();YC=class{static{o(this,"Channels")}constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new cz}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Li.ALL,this}_ensureHSL(){let e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Bt.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Bt.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Bt.channel.rgb2hsl(e,"l"))}_ensureRGB(){let e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Bt.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Bt.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Bt.channel.hsl2rgb(e,"b"))}get r(){let e=this.data,r=e.r;return!this.type.is(Li.HSL)&&r!==void 0?r:(this._ensureHSL(),Bt.channel.hsl2rgb(e,"r"))}get g(){let e=this.data,r=e.g;return!this.type.is(Li.HSL)&&r!==void 0?r:(this._ensureHSL(),Bt.channel.hsl2rgb(e,"g"))}get b(){let e=this.data,r=e.b;return!this.type.is(Li.HSL)&&r!==void 0?r:(this._ensureHSL(),Bt.channel.hsl2rgb(e,"b"))}get h(){let e=this.data,r=e.h;return!this.type.is(Li.RGB)&&r!==void 0?r:(this._ensureRGB(),Bt.channel.rgb2hsl(e,"h"))}get s(){let e=this.data,r=e.s;return!this.type.is(Li.RGB)&&r!==void 0?r:(this._ensureRGB(),Bt.channel.rgb2hsl(e,"s"))}get l(){let e=this.data,r=e.l;return!this.type.is(Li.RGB)&&r!==void 0?r:(this._ensureRGB(),Bt.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Li.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Li.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Li.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Li.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Li.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Li.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}},hz=YC});var p2e,oh,Y1=R(()=>{"use strict";fz();p2e=new hz({r:0,g:0,b:0,a:0},"transparent"),oh=p2e});var dz,Yf,WC=R(()=>{"use strict";Y1();H1();dz={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:o(t=>{if(t.charCodeAt(0)!==35)return;let e=t.match(dz.re);if(!e)return;let r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,l=s?1:17,u=s?8:4,h=a?0:-1,f=s?255:15;return oh.set({r:(n>>u*(h+3)&f)*l,g:(n>>u*(h+2)&f)*l,b:(n>>u*(h+1)&f)*l,a:a?(n&f)*l/255:1},t)},"parse"),stringify:o(t=>{let{r:e,g:r,b:n,a:i}=t;return i<1?`#${Jc[Math.round(e)]}${Jc[Math.round(r)]}${Jc[Math.round(n)]}${Jc[Math.round(i*255)]}`:`#${Jc[Math.round(e)]}${Jc[Math.round(r)]}${Jc[Math.round(n)]}`},"stringify")},Yf=dz});var Yb,W1,pz=R(()=>{"use strict";jl();Y1();Yb={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:o(t=>{let e=t.match(Yb.hueRe);if(e){let[,r,n]=e;switch(n){case"grad":return Bt.channel.clamp.h(parseFloat(r)*.9);case"rad":return Bt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Bt.channel.clamp.h(parseFloat(r)*360)}}return Bt.channel.clamp.h(parseFloat(t))},"_hue2deg"),parse:o(t=>{let e=t.charCodeAt(0);if(e!==104&&e!==72)return;let r=t.match(Yb.re);if(!r)return;let[,n,i,a,s,l]=r;return oh.set({h:Yb._hue2deg(n),s:Bt.channel.clamp.s(parseFloat(i)),l:Bt.channel.clamp.l(parseFloat(a)),a:s?Bt.channel.clamp.a(l?parseFloat(s)/100:parseFloat(s)):1},t)},"parse"),stringify:o(t=>{let{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Bt.lang.round(e)}, ${Bt.lang.round(r)}%, ${Bt.lang.round(n)}%, ${i})`:`hsl(${Bt.lang.round(e)}, ${Bt.lang.round(r)}%, ${Bt.lang.round(n)}%)`},"stringify")},W1=Yb});var Wb,qC,mz=R(()=>{"use strict";WC();Wb={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:o(t=>{t=t.toLowerCase();let e=Wb.colors[t];if(e)return Yf.parse(e)},"parse"),stringify:o(t=>{let e=Yf.stringify(t);for(let r in Wb.colors)if(Wb.colors[r]===e)return r},"stringify")},qC=Wb});var gz,q1,yz=R(()=>{"use strict";jl();Y1();gz={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:o(t=>{let e=t.charCodeAt(0);if(e!==114&&e!==82)return;let r=t.match(gz.re);if(!r)return;let[,n,i,a,s,l,u,h,f]=r;return oh.set({r:Bt.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Bt.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Bt.channel.clamp.b(u?parseFloat(l)*2.55:parseFloat(l)),a:h?Bt.channel.clamp.a(f?parseFloat(h)/100:parseFloat(h)):1},t)},"parse"),stringify:o(t=>{let{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Bt.lang.round(e)}, ${Bt.lang.round(r)}, ${Bt.lang.round(n)}, ${Bt.lang.round(i)})`:`rgb(${Bt.lang.round(e)}, ${Bt.lang.round(r)}, ${Bt.lang.round(n)})`},"stringify")},q1=gz});var m2e,Di,eu=R(()=>{"use strict";WC();pz();mz();yz();H1();m2e={format:{keyword:qC,hex:Yf,rgb:q1,rgba:q1,hsl:W1,hsla:W1},parse:o(t=>{if(typeof t!="string")return t;let e=Yf.parse(t)||q1.parse(t)||W1.parse(t)||qC.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},"parse"),stringify:o(t=>!t.changed&&t.color?t.color:t.type.is(Li.HSL)||t.data.r===void 0?W1.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?q1.stringify(t):Yf.stringify(t),"stringify")},Di=m2e});var g2e,qb,XC=R(()=>{"use strict";jl();eu();g2e=o((t,e)=>{let r=Di.parse(t);for(let n in e)r[n]=Bt.channel.clamp[n](e[n]);return Di.stringify(r)},"change"),qb=g2e});var y2e,Ws,jC=R(()=>{"use strict";jl();Y1();eu();XC();y2e=o((t,e,r=0,n=1)=>{if(typeof t!="number")return qb(t,{a:e});let i=oh.set({r:Bt.channel.clamp.r(t),g:Bt.channel.clamp.g(e),b:Bt.channel.clamp.b(r),a:Bt.channel.clamp.a(n)});return Di.stringify(i)},"rgba"),Ws=y2e});var v2e,X1,vz=R(()=>{"use strict";jl();eu();v2e=o((t,e)=>Bt.lang.round(Di.parse(t)[e]),"channel"),X1=v2e});var x2e,xz,bz=R(()=>{"use strict";jl();eu();x2e=o(t=>{let{r:e,g:r,b:n}=Di.parse(t),i=.2126*Bt.channel.toLinear(e)+.7152*Bt.channel.toLinear(r)+.0722*Bt.channel.toLinear(n);return Bt.lang.round(i)},"luminance"),xz=x2e});var b2e,wz,Tz=R(()=>{"use strict";bz();b2e=o(t=>xz(t)>=.5,"isLight"),wz=b2e});var w2e,Wa,kz=R(()=>{"use strict";Tz();w2e=o(t=>!wz(t),"isDark"),Wa=w2e});var T2e,Xb,KC=R(()=>{"use strict";jl();eu();T2e=o((t,e,r)=>{let n=Di.parse(t),i=n[e],a=Bt.channel.clamp[e](i+r);return i!==a&&(n[e]=a),Di.stringify(n)},"adjustChannel"),Xb=T2e});var k2e,Et,Ez=R(()=>{"use strict";KC();k2e=o((t,e)=>Xb(t,"l",e),"lighten"),Et=k2e});var E2e,Dt,Cz=R(()=>{"use strict";KC();E2e=o((t,e)=>Xb(t,"l",-e),"darken"),Dt=E2e});var C2e,Oe,Sz=R(()=>{"use strict";eu();XC();C2e=o((t,e)=>{let r=Di.parse(t),n={};for(let i in e)e[i]&&(n[i]=r[i]+e[i]);return qb(t,n)},"adjust"),Oe=C2e});var S2e,Az,_z=R(()=>{"use strict";eu();jC();S2e=o((t,e,r=50)=>{let{r:n,g:i,b:a,a:s}=Di.parse(t),{r:l,g:u,b:h,a:f}=Di.parse(e),d=r/100,p=d*2-1,m=s-f,y=((p*m===-1?p:(p+m)/(1+p*m))+1)/2,v=1-y,x=n*y+l*v,b=i*y+u*v,w=a*y+h*v,S=s*d+f*(1-d);return Ws(x,b,w,S)},"mix"),Az=S2e});var A2e,ot,Lz=R(()=>{"use strict";eu();_z();A2e=o((t,e=100)=>{let r=Di.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Az(r,t,e)},"invert"),ot=A2e});var Dz=R(()=>{"use strict";jC();vz();kz();Ez();Cz();Sz();Lz()});var al=R(()=>{"use strict";Dz()});var lh,ch,j1=R(()=>{"use strict";lh="#ffffff",ch="#f2f2f2"});var yi,up=R(()=>{"use strict";al();yi=o((t,e)=>e?Oe(t,{s:-40,l:10}):Oe(t,{s:-40,l:-10}),"mkBorder")});var QC,Nz,Mz=R(()=>{"use strict";al();j1();up();QC=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Oe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Oe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||yi(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||yi(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||yi(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||ot(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||ot(this.tertiaryColor),this.lineColor=this.lineColor||ot(this.background),this.arrowheadColor=this.arrowheadColor||ot(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||ot(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Et(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Oe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Oe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Oe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Oe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Oe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Oe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Oe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Oe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Oe(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},Nz=o(t=>{let e=new QC;return e.calculate(t),e},"getThemeVariables")});var ZC,Iz,Oz=R(()=>{"use strict";al();up();ZC=class{static{o(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Et(this.primaryColor,16),this.tertiaryColor=Oe(this.primaryColor,{h:-160}),this.primaryBorderColor=ot(this.background),this.secondaryBorderColor=yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=yi(this.tertiaryColor,this.darkMode),this.primaryTextColor=ot(this.primaryColor),this.secondaryTextColor=ot(this.secondaryColor),this.tertiaryTextColor=ot(this.tertiaryColor),this.lineColor=ot(this.background),this.textColor=ot(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Et(ot("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ws(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=Dt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Dt(this.sectionBkgColor,10),this.taskBorderColor=Ws(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ws(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=Et(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Et(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Et(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Oe(this.primaryColor,{h:64}),this.fillType3=Oe(this.secondaryColor,{h:64}),this.fillType4=Oe(this.primaryColor,{h:-64}),this.fillType5=Oe(this.secondaryColor,{h:-64}),this.fillType6=Oe(this.primaryColor,{h:128}),this.fillType7=Oe(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Oe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Oe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Oe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Oe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Oe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Oe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Oe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Oe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Oe(this.primaryColor,{h:330});for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},Iz=o(t=>{let e=new ZC;return e.calculate(t),e},"getThemeVariables")});var JC,hp,jb=R(()=>{"use strict";al();up();j1();JC=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Oe(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Oe(this.primaryColor,{h:-160}),this.primaryBorderColor=yi(this.primaryColor,this.darkMode),this.secondaryBorderColor=yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=yi(this.tertiaryColor,this.darkMode),this.primaryTextColor=ot(this.primaryColor),this.secondaryTextColor=ot(this.secondaryColor),this.tertiaryTextColor=ot(this.tertiaryColor),this.lineColor=ot(this.background),this.textColor=ot(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=Ws(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Oe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Oe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Oe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Oe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Oe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Oe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Oe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Oe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Oe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Dt(this.tertiaryColor,40);for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},hp=o(t=>{let e=new JC;return e.calculate(t),e},"getThemeVariables")});var e7,Pz,Bz=R(()=>{"use strict";al();j1();up();e7=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Et("#cde498",10),this.primaryBorderColor=yi(this.primaryColor,this.darkMode),this.secondaryBorderColor=yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=yi(this.tertiaryColor,this.darkMode),this.primaryTextColor=ot(this.primaryColor),this.secondaryTextColor=ot(this.secondaryColor),this.tertiaryTextColor=ot(this.primaryColor),this.lineColor=ot(this.background),this.textColor=ot(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=Dt(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Oe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Oe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Oe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Oe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Oe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Oe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Oe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Oe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Oe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Dt(this.tertiaryColor,40);for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},Pz=o(t=>{let e=new e7;return e.calculate(t),e},"getThemeVariables")});var t7,Fz,zz=R(()=>{"use strict";al();up();j1();t7=class{static{o(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Et(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Oe(this.primaryColor,{h:-160}),this.primaryBorderColor=yi(this.primaryColor,this.darkMode),this.secondaryBorderColor=yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=yi(this.tertiaryColor,this.darkMode),this.primaryTextColor=ot(this.primaryColor),this.secondaryTextColor=ot(this.secondaryColor),this.tertiaryTextColor=ot(this.tertiaryColor),this.lineColor=ot(this.background),this.textColor=ot(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=Et(this.contrast,55),this.border2=this.contrast,this.actorBorder=Et(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},Fz=o(t=>{let e=new t7;return e.calculate(t),e},"getThemeVariables")});var Co,Kb=R(()=>{"use strict";Mz();Oz();jb();Bz();zz();Co={base:{getThemeVariables:Nz},dark:{getThemeVariables:Iz},default:{getThemeVariables:hp},forest:{getThemeVariables:Pz},neutral:{getThemeVariables:Fz}}});var tu,Gz=R(()=>{"use strict";tu={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1}});var $z,Vz,Uz,mr,sl=R(()=>{"use strict";Kb();Gz();$z={...tu,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"SIMPLE"},themeCSS:void 0,themeVariables:Co.default.getThemeVariables(),sequence:{...tu.sequence,messageFont:o(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:o(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:o(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},gantt:{...tu.gantt,tickInterval:void 0,useWidth:void 0},c4:{...tu.c4,useWidth:void 0,personFont:o(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),external_personFont:o(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:o(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:o(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:o(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:o(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:o(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:o(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:o(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:o(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:o(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:o(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:o(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:o(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:o(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:o(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:o(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:o(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:o(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:o(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:o(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:o(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...tu.pie,useWidth:984},xyChart:{...tu.xyChart,useWidth:void 0},requirement:{...tu.requirement,useWidth:void 0},packet:{...tu.packet}},Vz=o((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...Vz(t[n],"")]:[...r,e+n],[]),"keyify"),Uz=new Set(Vz($z,"")),mr=$z});var fp,_2e,r7=R(()=>{"use strict";sl();ut();fp=o(t=>{if(V.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>fp(e));return}for(let e of Object.keys(t)){if(V.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Uz.has(e)||t[e]==null){V.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){V.debug("sanitizing object",e),fp(t[e]);continue}let r=["themeCSS","fontFamily","altFontFamily"];for(let n of r)e.includes(n)&&(V.debug("sanitizing css option",e),t[e]=_2e(t[e]))}if(t.themeVariables)for(let e of Object.keys(t.themeVariables)){let r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}V.debug("After sanitization",t)}},"sanitizeDirective"),_2e=o(t=>{let e=0,r=0;for(let n of t){if(e{"use strict";cp();ut();Kb();sl();r7();uh=Object.freeze(mr),fs=On({},uh),dp=[],K1=On({},uh),Qb=o((t,e)=>{let r=On({},t),n={};for(let i of e)Xz(i),n=On(n,i);if(r=On(r,n),n.theme&&n.theme in Co){let i=On({},Yz),a=On(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Co&&(r.themeVariables=Co[r.theme].getThemeVariables(a))}return K1=r,Kz(K1),K1},"updateCurrentConfig"),n7=o(t=>(fs=On({},uh),fs=On(fs,t),t.theme&&Co[t.theme]&&(fs.themeVariables=Co[t.theme].getThemeVariables(t.themeVariables)),Qb(fs,dp),fs),"setSiteConfig"),Wz=o(t=>{Yz=On({},t)},"saveConfigFromInitialize"),qz=o(t=>(fs=On(fs,t),Qb(fs,dp),fs),"updateSiteConfig"),i7=o(()=>On({},fs),"getSiteConfig"),Zb=o(t=>(Kz(t),On(K1,t),Or()),"setConfig"),Or=o(()=>On({},K1),"getConfig"),Xz=o(t=>{t&&(["secure",...fs.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(V.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&Xz(t[e])}))},"sanitize"),jz=o(t=>{fp(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),dp.push(t),Qb(fs,dp)},"addDirective"),Q1=o((t=fs)=>{dp=[],Qb(t,dp)},"reset"),L2e={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},Hz={},D2e=o(t=>{Hz[t]||(V.warn(L2e[t]),Hz[t]=!0)},"issueWarning"),Kz=o(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&D2e("LAZY_LOAD_DEPRECATED")},"checkConfig")});var o7=gi((a7,s7)=>{"use strict";(function(t,e){typeof a7=="object"&&typeof s7<"u"?s7.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.DOMPurify=e())})(a7,function(){"use strict";let{entries:t,setPrototypeOf:e,isFrozen:r,getPrototypeOf:n,getOwnPropertyDescriptor:i}=Object,{freeze:a,seal:s,create:l}=Object,{apply:u,construct:h}=typeof Reflect<"u"&&Reflect;a||(a=o(function(Se){return Se},"freeze")),s||(s=o(function(Se){return Se},"seal")),u||(u=o(function(Se,Ue,Pe){return Se.apply(Ue,Pe)},"apply")),h||(h=o(function(Se,Ue){return new Se(...Ue)},"construct"));let f=E(Array.prototype.forEach),d=E(Array.prototype.pop),p=E(Array.prototype.push),m=E(String.prototype.toLowerCase),g=E(String.prototype.toString),y=E(String.prototype.match),v=E(String.prototype.replace),x=E(String.prototype.indexOf),b=E(String.prototype.trim),w=E(Object.prototype.hasOwnProperty),S=E(RegExp.prototype.test),T=_(TypeError);function E(Ie){return function(Se){for(var Ue=arguments.length,Pe=new Array(Ue>1?Ue-1:0),_e=1;_e2&&arguments[2]!==void 0?arguments[2]:m;e&&e(Ie,null);let Pe=Se.length;for(;Pe--;){let _e=Se[Pe];if(typeof _e=="string"){let me=Ue(_e);me!==_e&&(r(Se)||(Se[Pe]=me),_e=me)}Ie[_e]=!0}return Ie}o(A,"addToSet");function L(Ie){for(let Se=0;Se/gm),ie=s(/\${[\w\W]*}/gm),j=s(/^data-[\-\w.\u00B7-\uFFFF]/),J=s(/^aria-[\-\w]+$/),Z=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H=s(/^(?:\w+script|data):/i),q=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=s(/^html$/i),se=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var ce=Object.freeze({__proto__:null,MUSTACHE_EXPR:Q,ERB_EXPR:X,TMPLIT_EXPR:ie,DATA_ATTR:j,ARIA_ATTR:J,IS_ALLOWED_URI:Z,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:q,DOCTYPE_NAME:K,CUSTOM_ELEMENT:se});let ue={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},te=o(function(){return typeof window>"u"?null:window},"getGlobal"),De=o(function(Se,Ue){if(typeof Se!="object"||typeof Se.createPolicy!="function")return null;let Pe=null,_e="data-tt-policy-suffix";Ue&&Ue.hasAttribute(_e)&&(Pe=Ue.getAttribute(_e));let me="dompurify"+(Pe?"#"+Pe:"");try{return Se.createPolicy(me,{createHTML(W){return W},createScriptURL(W){return W}})}catch{return console.warn("TrustedTypes policy "+me+" could not be created."),null}},"_createTrustedTypesPolicy");function oe(){let Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:te(),Se=o(Ft=>oe(Ft),"DOMPurify");if(Se.version="3.1.6",Se.removed=[],!Ie||!Ie.document||Ie.document.nodeType!==ue.document)return Se.isSupported=!1,Se;let{document:Ue}=Ie,Pe=Ue,_e=Pe.currentScript,{DocumentFragment:me,HTMLTemplateElement:W,Node:fe,Element:ge,NodeFilter:re,NamedNodeMap:he=Ie.NamedNodeMap||Ie.MozNamedAttrMap,HTMLFormElement:ne,DOMParser:ae,trustedTypes:we}=Ie,Te=ge.prototype,Ce=N(Te,"cloneNode"),Ae=N(Te,"remove"),Ge=N(Te,"nextSibling"),Me=N(Te,"childNodes"),ye=N(Te,"parentNode");if(typeof W=="function"){let Ft=Ue.createElement("template");Ft.content&&Ft.content.ownerDocument&&(Ue=Ft.content.ownerDocument)}let He,ze="",{implementation:Ze,createNodeIterator:gt,createDocumentFragment:yt,getElementsByTagName:tt}=Ue,{importNode:Ye}=Pe,Je={};Se.isSupported=typeof t=="function"&&typeof ye=="function"&&Ze&&Ze.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Ve,ERB_EXPR:je,TMPLIT_EXPR:kt,DATA_ATTR:at,ARIA_ATTR:xt,IS_SCRIPT_OR_DATA:it,ATTR_WHITESPACE:dt,CUSTOM_ELEMENT:lt}=ce,{IS_ALLOWED_URI:It}=ce,mt=null,St=A({},[...k,...I,...C,...D,...F]),gr=null,xn=A({},[...B,...$,...z,...Y]),jt=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),rn=null,Er=null,Kn=!0,hn=!0,Qn=!1,on=!0,Rn=!1,Ha=!0,_a=!1,To=!1,qi=!1,ht=!1,At=!1,$t=!1,rt=!0,Ot=!1,pe="user-content-",ur=!0,be=!1,Ir={},Xc=null,M1=A({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),_b=null,I1=A({},["audio","video","img","source","image","track"]),O1=null,ci=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ko="http://www.w3.org/1998/Math/MathML",ih="http://www.w3.org/2000/svg",Us="http://www.w3.org/1999/xhtml",ah=Us,Lb=!1,P1=null,sa=A({},[ko,ih,Us],g),jc=null,Kc=["application/xhtml+xml","text/html"],us="text/html",_i=null,Wl=null,sh=Ue.createElement("form"),zf=o(function(Re){return Re instanceof RegExp||Re instanceof Function},"isRegexOrFunction"),Hs=o(function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Wl&&Wl===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=M(Re),jc=Kc.indexOf(Re.PARSER_MEDIA_TYPE)===-1?us:Re.PARSER_MEDIA_TYPE,_i=jc==="application/xhtml+xml"?g:m,mt=w(Re,"ALLOWED_TAGS")?A({},Re.ALLOWED_TAGS,_i):St,gr=w(Re,"ALLOWED_ATTR")?A({},Re.ALLOWED_ATTR,_i):xn,P1=w(Re,"ALLOWED_NAMESPACES")?A({},Re.ALLOWED_NAMESPACES,g):sa,O1=w(Re,"ADD_URI_SAFE_ATTR")?A(M(ci),Re.ADD_URI_SAFE_ATTR,_i):ci,_b=w(Re,"ADD_DATA_URI_TAGS")?A(M(I1),Re.ADD_DATA_URI_TAGS,_i):I1,Xc=w(Re,"FORBID_CONTENTS")?A({},Re.FORBID_CONTENTS,_i):M1,rn=w(Re,"FORBID_TAGS")?A({},Re.FORBID_TAGS,_i):{},Er=w(Re,"FORBID_ATTR")?A({},Re.FORBID_ATTR,_i):{},Ir=w(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,Kn=Re.ALLOW_ARIA_ATTR!==!1,hn=Re.ALLOW_DATA_ATTR!==!1,Qn=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,on=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Rn=Re.SAFE_FOR_TEMPLATES||!1,Ha=Re.SAFE_FOR_XML!==!1,_a=Re.WHOLE_DOCUMENT||!1,ht=Re.RETURN_DOM||!1,At=Re.RETURN_DOM_FRAGMENT||!1,$t=Re.RETURN_TRUSTED_TYPE||!1,qi=Re.FORCE_BODY||!1,rt=Re.SANITIZE_DOM!==!1,Ot=Re.SANITIZE_NAMED_PROPS||!1,ur=Re.KEEP_CONTENT!==!1,be=Re.IN_PLACE||!1,It=Re.ALLOWED_URI_REGEXP||Z,ah=Re.NAMESPACE||Us,jt=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&zf(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(jt.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&zf(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(jt.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(jt.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Rn&&(hn=!1),At&&(ht=!0),Ir&&(mt=A({},F),gr=[],Ir.html===!0&&(A(mt,k),A(gr,B)),Ir.svg===!0&&(A(mt,I),A(gr,$),A(gr,Y)),Ir.svgFilters===!0&&(A(mt,C),A(gr,$),A(gr,Y)),Ir.mathMl===!0&&(A(mt,D),A(gr,z),A(gr,Y))),Re.ADD_TAGS&&(mt===St&&(mt=M(mt)),A(mt,Re.ADD_TAGS,_i)),Re.ADD_ATTR&&(gr===xn&&(gr=M(gr)),A(gr,Re.ADD_ATTR,_i)),Re.ADD_URI_SAFE_ATTR&&A(O1,Re.ADD_URI_SAFE_ATTR,_i),Re.FORBID_CONTENTS&&(Xc===M1&&(Xc=M(Xc)),A(Xc,Re.FORBID_CONTENTS,_i)),ur&&(mt["#text"]=!0),_a&&A(mt,["html","head","body"]),mt.table&&(A(mt,["tbody"]),delete rn.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');He=Re.TRUSTED_TYPES_POLICY,ze=He.createHTML("")}else He===void 0&&(He=De(we,_e)),He!==null&&typeof ze=="string"&&(ze=He.createHTML(""));a&&a(Re),Wl=Re}},"_parseConfig"),B1=A({},["mi","mo","mn","ms","mtext"]),Gf=A({},["foreignobject","annotation-xml"]),F1=A({},["title","style","font","a","script"]),La=A({},[...I,...C,...O]),vF=A({},[...D,...P]),Ive=o(function(Re){let st=ye(Re);(!st||!st.tagName)&&(st={namespaceURI:ah,tagName:"template"});let Rt=m(Re.tagName),bn=m(st.tagName);return P1[Re.namespaceURI]?Re.namespaceURI===ih?st.namespaceURI===Us?Rt==="svg":st.namespaceURI===ko?Rt==="svg"&&(bn==="annotation-xml"||B1[bn]):!!La[Rt]:Re.namespaceURI===ko?st.namespaceURI===Us?Rt==="math":st.namespaceURI===ih?Rt==="math"&&Gf[bn]:!!vF[Rt]:Re.namespaceURI===Us?st.namespaceURI===ih&&!Gf[bn]||st.namespaceURI===ko&&!B1[bn]?!1:!vF[Rt]&&(F1[Rt]||!La[Rt]):!!(jc==="application/xhtml+xml"&&P1[Re.namespaceURI]):!1},"_checkValidNamespace"),ql=o(function(Re){p(Se.removed,{element:Re});try{ye(Re).removeChild(Re)}catch{Ae(Re)}},"_forceRemove"),Db=o(function(Re,st){try{p(Se.removed,{attribute:st.getAttributeNode(Re),from:st})}catch{p(Se.removed,{attribute:null,from:st})}if(st.removeAttribute(Re),Re==="is"&&!gr[Re])if(ht||At)try{ql(st)}catch{}else try{st.setAttribute(Re,"")}catch{}},"_removeAttribute"),xF=o(function(Re){let st=null,Rt=null;if(qi)Re=" "+Re;else{let oa=y(Re,/^[\r\n\t ]+/);Rt=oa&&oa[0]}jc==="application/xhtml+xml"&&ah===Us&&(Re=''+Re+"");let bn=He?He.createHTML(Re):Re;if(ah===Us)try{st=new ae().parseFromString(bn,jc)}catch{}if(!st||!st.documentElement){st=Ze.createDocument(ah,"template",null);try{st.documentElement.innerHTML=Lb?ze:bn}catch{}}let Da=st.body||st.documentElement;return Re&&Rt&&Da.insertBefore(Ue.createTextNode(Rt),Da.childNodes[0]||null),ah===Us?tt.call(st,_a?"html":"body")[0]:_a?st.documentElement:Da},"_initDocument"),bF=o(function(Re){return gt.call(Re.ownerDocument||Re,Re,re.SHOW_ELEMENT|re.SHOW_COMMENT|re.SHOW_TEXT|re.SHOW_PROCESSING_INSTRUCTION|re.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),wF=o(function(Re){return Re instanceof ne&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof he)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},"_isClobbered"),TF=o(function(Re){return typeof fe=="function"&&Re instanceof fe},"_isNode"),Qc=o(function(Re,st,Rt){Je[Re]&&f(Je[Re],bn=>{bn.call(Se,st,Rt,Wl)})},"_executeHook"),kF=o(function(Re){let st=null;if(Qc("beforeSanitizeElements",Re,null),wF(Re))return ql(Re),!0;let Rt=_i(Re.nodeName);if(Qc("uponSanitizeElement",Re,{tagName:Rt,allowedTags:mt}),Re.hasChildNodes()&&!TF(Re.firstElementChild)&&S(/<[/\w]/g,Re.innerHTML)&&S(/<[/\w]/g,Re.textContent)||Re.nodeType===ue.progressingInstruction||Ha&&Re.nodeType===ue.comment&&S(/<[/\w]/g,Re.data))return ql(Re),!0;if(!mt[Rt]||rn[Rt]){if(!rn[Rt]&&CF(Rt)&&(jt.tagNameCheck instanceof RegExp&&S(jt.tagNameCheck,Rt)||jt.tagNameCheck instanceof Function&&jt.tagNameCheck(Rt)))return!1;if(ur&&!Xc[Rt]){let bn=ye(Re)||Re.parentNode,Da=Me(Re)||Re.childNodes;if(Da&&bn){let oa=Da.length;for(let hs=oa-1;hs>=0;--hs){let Xl=Ce(Da[hs],!0);Xl.__removalCount=(Re.__removalCount||0)+1,bn.insertBefore(Xl,Ge(Re))}}}return ql(Re),!0}return Re instanceof ge&&!Ive(Re)||(Rt==="noscript"||Rt==="noembed"||Rt==="noframes")&&S(/<\/no(script|embed|frames)/i,Re.innerHTML)?(ql(Re),!0):(Rn&&Re.nodeType===ue.text&&(st=Re.textContent,f([Ve,je,kt],bn=>{st=v(st,bn," ")}),Re.textContent!==st&&(p(Se.removed,{element:Re.cloneNode()}),Re.textContent=st)),Qc("afterSanitizeElements",Re,null),!1)},"_sanitizeElements"),EF=o(function(Re,st,Rt){if(rt&&(st==="id"||st==="name")&&(Rt in Ue||Rt in sh))return!1;if(!(hn&&!Er[st]&&S(at,st))){if(!(Kn&&S(xt,st))){if(!gr[st]||Er[st]){if(!(CF(Re)&&(jt.tagNameCheck instanceof RegExp&&S(jt.tagNameCheck,Re)||jt.tagNameCheck instanceof Function&&jt.tagNameCheck(Re))&&(jt.attributeNameCheck instanceof RegExp&&S(jt.attributeNameCheck,st)||jt.attributeNameCheck instanceof Function&&jt.attributeNameCheck(st))||st==="is"&&jt.allowCustomizedBuiltInElements&&(jt.tagNameCheck instanceof RegExp&&S(jt.tagNameCheck,Rt)||jt.tagNameCheck instanceof Function&&jt.tagNameCheck(Rt))))return!1}else if(!O1[st]){if(!S(It,v(Rt,dt,""))){if(!((st==="src"||st==="xlink:href"||st==="href")&&Re!=="script"&&x(Rt,"data:")===0&&_b[Re])){if(!(Qn&&!S(it,v(Rt,dt,"")))){if(Rt)return!1}}}}}}return!0},"_isValidAttribute"),CF=o(function(Re){return Re!=="annotation-xml"&&y(Re,lt)},"_isBasicCustomElement"),SF=o(function(Re){Qc("beforeSanitizeAttributes",Re,null);let{attributes:st}=Re;if(!st)return;let Rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:gr},bn=st.length;for(;bn--;){let Da=st[bn],{name:oa,namespaceURI:hs,value:Xl}=Da,z1=_i(oa),Ya=oa==="value"?Xl:b(Xl);if(Rt.attrName=z1,Rt.attrValue=Ya,Rt.keepAttr=!0,Rt.forceKeepAttr=void 0,Qc("uponSanitizeAttribute",Re,Rt),Ya=Rt.attrValue,Ha&&S(/((--!?|])>)|<\/(style|title)/i,Ya)){Db(oa,Re);continue}if(Rt.forceKeepAttr||(Db(oa,Re),!Rt.keepAttr))continue;if(!on&&S(/\/>/i,Ya)){Db(oa,Re);continue}Rn&&f([Ve,je,kt],_F=>{Ya=v(Ya,_F," ")});let AF=_i(Re.nodeName);if(EF(AF,z1,Ya)){if(Ot&&(z1==="id"||z1==="name")&&(Db(oa,Re),Ya=pe+Ya),He&&typeof we=="object"&&typeof we.getAttributeType=="function"&&!hs)switch(we.getAttributeType(AF,z1)){case"TrustedHTML":{Ya=He.createHTML(Ya);break}case"TrustedScriptURL":{Ya=He.createScriptURL(Ya);break}}try{hs?Re.setAttributeNS(hs,oa,Ya):Re.setAttribute(oa,Ya),wF(Re)?ql(Re):d(Se.removed)}catch{}}}Qc("afterSanitizeAttributes",Re,null)},"_sanitizeAttributes"),Ove=o(function Ft(Re){let st=null,Rt=bF(Re);for(Qc("beforeSanitizeShadowDOM",Re,null);st=Rt.nextNode();)Qc("uponSanitizeShadowNode",st,null),!kF(st)&&(st.content instanceof me&&Ft(st.content),SF(st));Qc("afterSanitizeShadowDOM",Re,null)},"_sanitizeShadowDOM");return Se.sanitize=function(Ft){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},st=null,Rt=null,bn=null,Da=null;if(Lb=!Ft,Lb&&(Ft=""),typeof Ft!="string"&&!TF(Ft))if(typeof Ft.toString=="function"){if(Ft=Ft.toString(),typeof Ft!="string")throw T("dirty is not a string, aborting")}else throw T("toString is not a function");if(!Se.isSupported)return Ft;if(To||Hs(Re),Se.removed=[],typeof Ft=="string"&&(be=!1),be){if(Ft.nodeName){let Xl=_i(Ft.nodeName);if(!mt[Xl]||rn[Xl])throw T("root node is forbidden and cannot be sanitized in-place")}}else if(Ft instanceof fe)st=xF(""),Rt=st.ownerDocument.importNode(Ft,!0),Rt.nodeType===ue.element&&Rt.nodeName==="BODY"||Rt.nodeName==="HTML"?st=Rt:st.appendChild(Rt);else{if(!ht&&!Rn&&!_a&&Ft.indexOf("<")===-1)return He&&$t?He.createHTML(Ft):Ft;if(st=xF(Ft),!st)return ht?null:$t?ze:""}st&&qi&&ql(st.firstChild);let oa=bF(be?Ft:st);for(;bn=oa.nextNode();)kF(bn)||(bn.content instanceof me&&Ove(bn.content),SF(bn));if(be)return Ft;if(ht){if(At)for(Da=yt.call(st.ownerDocument);st.firstChild;)Da.appendChild(st.firstChild);else Da=st;return(gr.shadowroot||gr.shadowrootmode)&&(Da=Ye.call(Pe,Da,!0)),Da}let hs=_a?st.outerHTML:st.innerHTML;return _a&&mt["!doctype"]&&st.ownerDocument&&st.ownerDocument.doctype&&st.ownerDocument.doctype.name&&S(K,st.ownerDocument.doctype.name)&&(hs="
-`+hs),Rn&&f([Ve,je,kt],Xl=>{hs=v(hs,Xl," ")}),He&&$t?He.createHTML(hs):hs},Se.setConfig=function(){let Ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Hs(Ft),To=!0},Se.clearConfig=function(){Wl=null,To=!1},Se.isValidAttribute=function(Ft,Re,st){Wl||Hs({});let Rt=_i(Ft),bn=_i(Re);return EF(Rt,bn,st)},Se.addHook=function(Ft,Re){typeof Re=="function"&&(Je[Ft]=Je[Ft]||[],p(Je[Ft],Re))},Se.removeHook=function(Ft){if(Je[Ft])return d(Je[Ft])},Se.removeHooks=function(Ft){Je[Ft]&&(Je[Ft]=[])},Se.removeAllHooks=function(){Je={}},Se}o(oe,"createDOMPurify");var ke=oe();return ke})});var k$={};hr(k$,{default:()=>Ebe});function B2e(t){return String(t).replace(P2e,e=>O2e[e])}function $2e(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}function X2e(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}function LG(t){for(var e=0;e=h4[e]&&t<=h4[e+1])return!0;return!1}function axe(t,e){Zl[t]=e}function M7(t,e,r){if(!Zl[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Zl[e][n];if(!i&&t[0]in Zz&&(n=Zz[t[0]].charCodeAt(0),i=Zl[e][n]),!i&&r==="text"&&LG(n)&&(i=Zl[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}function sxe(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!l7[e]){var r=l7[e]={cssEmPerMu:Jb.quad[e]/18};for(var n in Jb)Jb.hasOwnProperty(n)&&(r[n]=Jb[n][e])}return l7[e]}function tG(t){if(t instanceof ms)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function uxe(t){if(t instanceof jf)return t;throw new Error("Expected span but got "+String(t)+".")}function G(t,e,r,n,i,a){wn[t][i]={font:e,group:r,replace:n},a&&n&&(wn[t][n]=wn[t][i])}function vt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,l={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},u=0;u0&&(a.push(s4(s,e)),s=[]),a.push(n[l]));s.length>0&&a.push(s4(s,e));var h;r?(h=s4(Ri(r,e,!0)),h.classes=["tag"],a.push(h)):i&&a.push(i);var f=su(["katex-html"],a);if(f.setAttribute("aria-hidden","true"),h){var d=h.children[0];d.style.height=ct(f.height+f.depth),f.depth&&(d.style.verticalAlign=ct(-f.depth))}return f}function $G(t){return new Xf(t)}function sG(t,e,r,n,i){var a=gs(t,r),s;a.length===1&&a[0]instanceof ps&&Vt.contains(["mrow","mtable"],a[0].type)?s=a[0]:s=new et.MathNode("mrow",a);var l=new et.MathNode("annotation",[new et.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var u=new et.MathNode("semantics",[s,l]),h=new et.MathNode("math",[u]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&h.setAttribute("display","block");var f=i?"katex":"katex-mathml";return Be.makeSpan([f],[h])}function ir(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function B7(t){var e=T4(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function T4(t){return t&&(t.type==="atom"||fxe.hasOwnProperty(t.type))?t:null}function YG(t,e){var r=Ri(t.body,e,!0);return Vxe([t.mclass],r,e)}function WG(t,e){var r,n=gs(t.body,e);return t.mclass==="minner"?r=new et.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new et.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new et.MathNode("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}function Yxe(t,e,r){var n=Uxe[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),l=r.callFunction("\\\\cdright",[e[1]],[]),u={type:"ordgroup",mode:"math",body:[i,s,l]};return r.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Wxe(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new nt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;a-1))if("<>AV".indexOf(h)>-1)for(var d=0;d<2;d++){for(var p=!0,m=u+1;mAV=|." after @',s[u]);var g=Yxe(h,f,t),y={type:"styling",body:[g],mode:"math",style:"display"};n.push(y),l=oG()}a%2===0?n.push(l):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}function E4(t,e){var r=T4(t);if(r&&Vt.contains(abe,r.text))return r;throw r?new nt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new nt("Invalid delimiter type '"+t.type+"'",t)}function uG(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}function ec(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,l={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u1||!f)&&y.pop(),x.length{"use strict";Xs=class t{static{o(this,"SourceLocation")}constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new t(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},Ao=class t{static{o(this,"Token")}constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new t(r,Xs.range(this,e))}},nt=class t{static{o(this,"ParseError")}constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var l=s.lexer.input;i=s.start,a=s.end,i===l.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var u=l.slice(i,a).replace(/[^]/g,"$&\u0332"),h;i>15?h="\u2026"+l.slice(i-15,i):h=l.slice(0,i);var f;a+15":">","<":"<",'"':""","'":"'"},P2e=/[&><"']/g;o(B2e,"escape");_G=o(function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},"getBaseElem"),F2e=o(function(e){var r=_G(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},"isCharacterBox"),z2e=o(function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},"assert"),G2e=o(function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|*58|*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},"protocolFromUrl"),Vt={contains:R2e,deflt:N2e,escape:B2e,hyphenate:I2e,getBaseElem:_G,isCharacterBox:F2e,protocolFromUrl:G2e},u4={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:o(t=>"#"+t,"cliProcessor")},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:o((t,e)=>(e.push(t),e),"cliProcessor")},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:o(t=>Math.max(0,t),"processor"),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:o(t=>Math.max(0,t),"processor"),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:o(t=>Math.max(0,t),"processor"),cli:"-e, --max-expand ",cliProcessor:o(t=>t==="Infinity"?1/0:parseInt(t),"cliProcessor")},globalGroup:{type:"boolean",cli:!1}};o($2e,"getDefaultValue");ry=class{static{o(this,"Settings")}constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r in u4)if(u4.hasOwnProperty(r)){var n=u4[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:$2e(n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new nt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var r=Vt.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},Kl=class{static{o(this,"Style")}constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Ql[V2e[this.id]]}sub(){return Ql[U2e[this.id]]}fracNum(){return Ql[H2e[this.id]]}fracDen(){return Ql[Y2e[this.id]]}cramp(){return Ql[W2e[this.id]]}text(){return Ql[q2e[this.id]]}isTight(){return this.size>=2}},N7=0,f4=1,gp=2,iu=3,ny=4,So=5,yp=6,qa=7,Ql=[new Kl(N7,0,!1),new Kl(f4,0,!0),new Kl(gp,1,!1),new Kl(iu,1,!0),new Kl(ny,2,!1),new Kl(So,2,!0),new Kl(yp,3,!1),new Kl(qa,3,!0)],V2e=[ny,So,ny,So,yp,qa,yp,qa],U2e=[So,So,So,So,qa,qa,qa,qa],H2e=[gp,iu,ny,So,yp,qa,yp,qa],Y2e=[iu,iu,So,So,qa,qa,qa,qa],W2e=[f4,f4,iu,iu,So,So,qa,qa],q2e=[N7,f4,gp,iu,gp,iu,gp,iu],Ht={DISPLAY:Ql[N7],TEXT:Ql[gp],SCRIPT:Ql[ny],SCRIPTSCRIPT:Ql[yp]},b7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];o(X2e,"scriptFromCodepoint");h4=[];b7.forEach(t=>t.blocks.forEach(e=>h4.push(...e)));o(LG,"supportedCodepoint");mp=80,j2e=o(function(e,r){return"M95,"+(622+e+r)+`
+`)),s+=d+n[u+1]}),s}var PC=N(()=>{"use strict";o(B4,"dedent")});var F4,qf,QF,$4=N(()=>{"use strict";F4=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,qf=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,QF=/\s*%%.*\n/gm});var i0,BC=N(()=>{"use strict";i0=class extends Error{static{o(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}}});var Yf,a0,z4,FC,ZF,Xf=N(()=>{"use strict";vt();$4();BC();Yf={},a0=o(function(t,e){t=t.replace(F4,"").replace(qf,"").replace(QF,`
+`);for(let[r,{detector:n}]of Object.entries(Yf))if(n(t,e))return r;throw new i0(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),z4=o((...t)=>{for(let{id:e,detector:r,loader:n}of t)FC(e,r,n)},"registerLazyLoadedDiagrams"),FC=o((t,e,r)=>{Yf[t]&&Y.warn(`Detector with key ${t} already exists. Overwriting.`),Yf[t]={detector:e,loader:r},Y.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),ZF=o(t=>Yf[t].loader,"getDiagramLoader")});var Ty,JF,$C=N(()=>{"use strict";Ty=function(){var t=o(function($e,Re,Ie,be){for(Ie=Ie||{},be=$e.length;be--;Ie[$e[be]]=Re);return Ie},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],l=[1,64],u=[1,65],h=[1,66],f=[1,67],d=[1,68],p=[1,69],m=[1,29],g=[1,30],y=[1,31],v=[1,32],x=[1,33],b=[1,34],w=[1,35],C=[1,36],T=[1,37],E=[1,38],A=[1,39],S=[1,40],_=[1,41],I=[1,42],D=[1,43],k=[1,44],L=[1,45],R=[1,46],O=[1,47],M=[1,48],B=[1,50],F=[1,51],P=[1,52],z=[1,53],$=[1,54],H=[1,55],Q=[1,56],j=[1,57],ie=[1,58],ne=[1,59],le=[1,60],he=[14,42],K=[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],X=[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],te=[1,82],J=[1,83],se=[1,84],ue=[1,85],Z=[12,14,42],Se=[12,14,33,42],ce=[12,14,33,42,76,77,79,80],ae=[12,33],Oe=[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],ge={trace:o(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:o(function(Re,Ie,be,W,de,re,oe){var V=re.length-1;switch(de){case 3:W.setDirection("TB");break;case 4:W.setDirection("BT");break;case 5:W.setDirection("RL");break;case 6:W.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:W.setC4Type(re[V-3]);break;case 19:W.setTitle(re[V].substring(6)),this.$=re[V].substring(6);break;case 20:W.setAccDescription(re[V].substring(15)),this.$=re[V].substring(15);break;case 21:this.$=re[V].trim(),W.setTitle(this.$);break;case 22:case 23:this.$=re[V].trim(),W.setAccDescription(this.$);break;case 28:re[V].splice(2,0,"ENTERPRISE"),W.addPersonOrSystemBoundary(...re[V]),this.$=re[V];break;case 29:re[V].splice(2,0,"SYSTEM"),W.addPersonOrSystemBoundary(...re[V]),this.$=re[V];break;case 30:W.addPersonOrSystemBoundary(...re[V]),this.$=re[V];break;case 31:re[V].splice(2,0,"CONTAINER"),W.addContainerBoundary(...re[V]),this.$=re[V];break;case 32:W.addDeploymentNode("node",...re[V]),this.$=re[V];break;case 33:W.addDeploymentNode("nodeL",...re[V]),this.$=re[V];break;case 34:W.addDeploymentNode("nodeR",...re[V]),this.$=re[V];break;case 35:W.popBoundaryParseStack();break;case 39:W.addPersonOrSystem("person",...re[V]),this.$=re[V];break;case 40:W.addPersonOrSystem("external_person",...re[V]),this.$=re[V];break;case 41:W.addPersonOrSystem("system",...re[V]),this.$=re[V];break;case 42:W.addPersonOrSystem("system_db",...re[V]),this.$=re[V];break;case 43:W.addPersonOrSystem("system_queue",...re[V]),this.$=re[V];break;case 44:W.addPersonOrSystem("external_system",...re[V]),this.$=re[V];break;case 45:W.addPersonOrSystem("external_system_db",...re[V]),this.$=re[V];break;case 46:W.addPersonOrSystem("external_system_queue",...re[V]),this.$=re[V];break;case 47:W.addContainer("container",...re[V]),this.$=re[V];break;case 48:W.addContainer("container_db",...re[V]),this.$=re[V];break;case 49:W.addContainer("container_queue",...re[V]),this.$=re[V];break;case 50:W.addContainer("external_container",...re[V]),this.$=re[V];break;case 51:W.addContainer("external_container_db",...re[V]),this.$=re[V];break;case 52:W.addContainer("external_container_queue",...re[V]),this.$=re[V];break;case 53:W.addComponent("component",...re[V]),this.$=re[V];break;case 54:W.addComponent("component_db",...re[V]),this.$=re[V];break;case 55:W.addComponent("component_queue",...re[V]),this.$=re[V];break;case 56:W.addComponent("external_component",...re[V]),this.$=re[V];break;case 57:W.addComponent("external_component_db",...re[V]),this.$=re[V];break;case 58:W.addComponent("external_component_queue",...re[V]),this.$=re[V];break;case 60:W.addRel("rel",...re[V]),this.$=re[V];break;case 61:W.addRel("birel",...re[V]),this.$=re[V];break;case 62:W.addRel("rel_u",...re[V]),this.$=re[V];break;case 63:W.addRel("rel_d",...re[V]),this.$=re[V];break;case 64:W.addRel("rel_l",...re[V]),this.$=re[V];break;case 65:W.addRel("rel_r",...re[V]),this.$=re[V];break;case 66:W.addRel("rel_b",...re[V]),this.$=re[V];break;case 67:re[V].splice(0,1),W.addRel("rel",...re[V]),this.$=re[V];break;case 68:W.updateElStyle("update_el_style",...re[V]),this.$=re[V];break;case 69:W.updateRelStyle("update_rel_style",...re[V]),this.$=re[V];break;case 70:W.updateLayoutConfig("update_layout_config",...re[V]),this.$=re[V];break;case 71:this.$=[re[V]];break;case 72:re[V].unshift(re[V-1]),this.$=re[V];break;case 73:case 75:this.$=re[V].trim();break;case 74:let xe={};xe[re[V-1].trim()]=re[V].trim(),this.$=xe;break;case 76:this.$="";break}},"anonymous"),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:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:C,52:T,53:E,54:A,55:S,56:_,57:I,58:D,59:k,60:L,61:R,62:O,63:M,64:B,65:F,66:P,67:z,68:$,69:H,70:Q,71:j,72:ie,73:ne,74:le},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:C,52:T,53:E,54:A,55:S,56:_,57:I,58:D,59:k,60:L,61:R,62:O,63:M,64:B,65:F,66:P,67:z,68:$,69:H,70:Q,71:j,72:ie,73:ne,74:le},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:C,52:T,53:E,54:A,55:S,56:_,57:I,58:D,59:k,60:L,61:R,62:O,63:M,64:B,65:F,66:P,67:z,68:$,69:H,70:Q,71:j,72:ie,73:ne,74:le},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:C,52:T,53:E,54:A,55:S,56:_,57:I,58:D,59:k,60:L,61:R,62:O,63:M,64:B,65:F,66:P,67:z,68:$,69:H,70:Q,71:j,72:ie,73:ne,74:le},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:C,52:T,53:E,54:A,55:S,56:_,57:I,58:D,59:k,60:L,61:R,62:O,63:M,64:B,65:F,66:P,67:z,68:$,69:H,70:Q,71:j,72:ie,73:ne,74:le},{14:[1,74]},t(he,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:h,39:f,40:d,41:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:C,52:T,53:E,54:A,55:S,56:_,57:I,58:D,59:k,60:L,61:R,62:O,63:M,64:B,65:F,66:P,67:z,68:$,69:H,70:Q,71:j,72:ie,73:ne,74:le}),t(he,[2,14]),t(K,[2,16],{12:[1,76]}),t(he,[2,36],{12:[1,77]}),t(X,[2,19]),t(X,[2,20]),{25:[1,78]},{27:[1,79]},t(X,[2,23]),{35:80,75:81,76:te,77:J,79:se,80:ue},{35:86,75:81,76:te,77:J,79:se,80:ue},{35:87,75:81,76:te,77:J,79:se,80:ue},{35:88,75:81,76:te,77:J,79:se,80:ue},{35:89,75:81,76:te,77:J,79:se,80:ue},{35:90,75:81,76:te,77:J,79:se,80:ue},{35:91,75:81,76:te,77:J,79:se,80:ue},{35:92,75:81,76:te,77:J,79:se,80:ue},{35:93,75:81,76:te,77:J,79:se,80:ue},{35:94,75:81,76:te,77:J,79:se,80:ue},{35:95,75:81,76:te,77:J,79:se,80:ue},{35:96,75:81,76:te,77:J,79:se,80:ue},{35:97,75:81,76:te,77:J,79:se,80:ue},{35:98,75:81,76:te,77:J,79:se,80:ue},{35:99,75:81,76:te,77:J,79:se,80:ue},{35:100,75:81,76:te,77:J,79:se,80:ue},{35:101,75:81,76:te,77:J,79:se,80:ue},{35:102,75:81,76:te,77:J,79:se,80:ue},{35:103,75:81,76:te,77:J,79:se,80:ue},{35:104,75:81,76:te,77:J,79:se,80:ue},t(Z,[2,59]),{35:105,75:81,76:te,77:J,79:se,80:ue},{35:106,75:81,76:te,77:J,79:se,80:ue},{35:107,75:81,76:te,77:J,79:se,80:ue},{35:108,75:81,76:te,77:J,79:se,80:ue},{35:109,75:81,76:te,77:J,79:se,80:ue},{35:110,75:81,76:te,77:J,79:se,80:ue},{35:111,75:81,76:te,77:J,79:se,80:ue},{35:112,75:81,76:te,77:J,79:se,80:ue},{35:113,75:81,76:te,77:J,79:se,80:ue},{35:114,75:81,76:te,77:J,79:se,80:ue},{35:115,75:81,76:te,77:J,79:se,80:ue},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:C,52:T,53:E,54:A,55:S,56:_,57:I,58:D,59:k,60:L,61:R,62:O,63:M,64:B,65:F,66:P,67:z,68:$,69:H,70:Q,71:j,72:ie,73:ne,74:le},{12:[1,118],33:[1,117]},{35:119,75:81,76:te,77:J,79:se,80:ue},{35:120,75:81,76:te,77:J,79:se,80:ue},{35:121,75:81,76:te,77:J,79:se,80:ue},{35:122,75:81,76:te,77:J,79:se,80:ue},{35:123,75:81,76:te,77:J,79:se,80:ue},{35:124,75:81,76:te,77:J,79:se,80:ue},{35:125,75:81,76:te,77:J,79:se,80:ue},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(he,[2,15]),t(K,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(he,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:l,37:u,38:h,39:f,40:d,41:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:C,52:T,53:E,54:A,55:S,56:_,57:I,58:D,59:k,60:L,61:R,62:O,63:M,64:B,65:F,66:P,67:z,68:$,69:H,70:Q,71:j,72:ie,73:ne,74:le}),t(X,[2,21]),t(X,[2,22]),t(Z,[2,39]),t(Se,[2,71],{75:81,35:132,76:te,77:J,79:se,80:ue}),t(ce,[2,73]),{78:[1,133]},t(ce,[2,75]),t(ce,[2,76]),t(Z,[2,40]),t(Z,[2,41]),t(Z,[2,42]),t(Z,[2,43]),t(Z,[2,44]),t(Z,[2,45]),t(Z,[2,46]),t(Z,[2,47]),t(Z,[2,48]),t(Z,[2,49]),t(Z,[2,50]),t(Z,[2,51]),t(Z,[2,52]),t(Z,[2,53]),t(Z,[2,54]),t(Z,[2,55]),t(Z,[2,56]),t(Z,[2,57]),t(Z,[2,58]),t(Z,[2,60]),t(Z,[2,61]),t(Z,[2,62]),t(Z,[2,63]),t(Z,[2,64]),t(Z,[2,65]),t(Z,[2,66]),t(Z,[2,67]),t(Z,[2,68]),t(Z,[2,69]),t(Z,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ae,[2,28]),t(ae,[2,29]),t(ae,[2,30]),t(ae,[2,31]),t(ae,[2,32]),t(ae,[2,33]),t(ae,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(K,[2,18]),t(he,[2,38]),t(Se,[2,72]),t(ce,[2,74]),t(Z,[2,24]),t(Z,[2,35]),t(Oe,[2,25]),t(Oe,[2,26],{12:[1,138]}),t(Oe,[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:o(function(Re,Ie){if(Ie.recoverable)this.trace(Re);else{var be=new Error(Re);throw be.hash=Ie,be}},"parseError"),parse:o(function(Re){var Ie=this,be=[0],W=[],de=[null],re=[],oe=this.table,V="",xe=0,q=0,pe=0,ve=2,Pe=1,_e=re.slice.call(arguments,1),we=Object.create(this.lexer),Ve={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(Ve.yy[De]=this.yy[De]);we.setInput(Re,Ve.yy),Ve.yy.lexer=we,Ve.yy.parser=this,typeof we.yylloc>"u"&&(we.yylloc={});var qe=we.yylloc;re.push(qe);var at=we.options&&we.options.ranges;typeof Ve.yy.parseError=="function"?this.parseError=Ve.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Rt(nt){be.length=be.length-2*nt,de.length=de.length-nt,re.length=re.length-nt}o(Rt,"popStack");function st(){var nt;return nt=W.pop()||we.lex()||Pe,typeof nt!="number"&&(nt instanceof Array&&(W=nt,nt=W.pop()),nt=Ie.symbols_[nt]||nt),nt}o(st,"lex");for(var Ue,ct,We,ot,Yt,bt,Mt={},xt,ut,Et,ft;;){if(We=be[be.length-1],this.defaultActions[We]?ot=this.defaultActions[We]:((Ue===null||typeof Ue>"u")&&(Ue=st()),ot=oe[We]&&oe[We][Ue]),typeof ot>"u"||!ot.length||!ot[0]){var yt="";ft=[];for(xt in oe[We])this.terminals_[xt]&&xt>ve&&ft.push("'"+this.terminals_[xt]+"'");we.showPosition?yt="Parse error on line "+(xe+1)+`:
+`+we.showPosition()+`
+Expecting `+ft.join(", ")+", got '"+(this.terminals_[Ue]||Ue)+"'":yt="Parse error on line "+(xe+1)+": Unexpected "+(Ue==Pe?"end of input":"'"+(this.terminals_[Ue]||Ue)+"'"),this.parseError(yt,{text:we.match,token:this.terminals_[Ue]||Ue,line:we.yylineno,loc:qe,expected:ft})}if(ot[0]instanceof Array&&ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+We+", token: "+Ue);switch(ot[0]){case 1:be.push(Ue),de.push(we.yytext),re.push(we.yylloc),be.push(ot[1]),Ue=null,ct?(Ue=ct,ct=null):(q=we.yyleng,V=we.yytext,xe=we.yylineno,qe=we.yylloc,pe>0&&pe--);break;case 2:if(ut=this.productions_[ot[1]][1],Mt.$=de[de.length-ut],Mt._$={first_line:re[re.length-(ut||1)].first_line,last_line:re[re.length-1].last_line,first_column:re[re.length-(ut||1)].first_column,last_column:re[re.length-1].last_column},at&&(Mt._$.range=[re[re.length-(ut||1)].range[0],re[re.length-1].range[1]]),bt=this.performAction.apply(Mt,[V,q,xe,Ve.yy,ot[1],de,re].concat(_e)),typeof bt<"u")return bt;ut&&(be=be.slice(0,-1*ut*2),de=de.slice(0,-1*ut),re=re.slice(0,-1*ut)),be.push(this.productions_[ot[1]][0]),de.push(Mt.$),re.push(Mt._$),Et=oe[be[be.length-2]][be[be.length-1]],be.push(Et);break;case 3:return!0}}return!0},"parse")},ze=function(){var $e={EOF:1,parseError:o(function(Ie,be){if(this.yy.parser)this.yy.parser.parseError(Ie,be);else throw new Error(Ie)},"parseError"),setInput:o(function(Re,Ie){return this.yy=Ie||this.yy||{},this._input=Re,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},"setInput"),input:o(function(){var Re=this._input[0];this.yytext+=Re,this.yyleng++,this.offset++,this.match+=Re,this.matched+=Re;var Ie=Re.match(/(?:\r\n?|\n).*/g);return Ie?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Re},"input"),unput:o(function(Re){var Ie=Re.length,be=Re.split(/(?:\r\n?|\n)/g);this._input=Re+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ie),this.offset-=Ie;var W=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),be.length-1&&(this.yylineno-=be.length-1);var de=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:be?(be.length===W.length?this.yylloc.first_column:0)+W[W.length-be.length].length-be[0].length:this.yylloc.first_column-Ie},this.options.ranges&&(this.yylloc.range=[de[0],de[0]+this.yyleng-Ie]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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},"reject"),less:o(function(Re){this.unput(this.match.slice(Re))},"less"),pastInput:o(function(){var Re=this.matched.substr(0,this.matched.length-this.match.length);return(Re.length>20?"...":"")+Re.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var Re=this.match;return Re.length<20&&(Re+=this._input.substr(0,20-Re.length)),(Re.substr(0,20)+(Re.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var Re=this.pastInput(),Ie=new Array(Re.length+1).join("-");return Re+this.upcomingInput()+`
+`+Ie+"^"},"showPosition"),test_match:o(function(Re,Ie){var be,W,de;if(this.options.backtrack_lexer&&(de={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&&(de.yylloc.range=this.yylloc.range.slice(0))),W=Re[0].match(/(?:\r\n?|\n).*/g),W&&(this.yylineno+=W.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Re[0].length},this.yytext+=Re[0],this.match+=Re[0],this.matches=Re,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(Re[0].length),this.matched+=Re[0],be=this.performAction.call(this,this.yy,this,Ie,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),be)return be;if(this._backtrack){for(var re in de)this[re]=de[re];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Re,Ie,be,W;this._more||(this.yytext="",this.match="");for(var de=this._currentRules(),re=0;reIe[0].length)){if(Ie=be,W=re,this.options.backtrack_lexer){if(Re=this.test_match(be,de[re]),Re!==!1)return Re;if(this._backtrack){Ie=!1;continue}else return!1}else if(!this.options.flex)break}return Ie?(Re=this.test_match(Ie,de[W]),Re!==!1?Re:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
+`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var Ie=this.next();return Ie||this.lex()},"lex"),begin:o(function(Ie){this.conditionStack.push(Ie)},"begin"),popState:o(function(){var Ie=this.conditionStack.length-1;return Ie>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(Ie){return Ie=this.conditionStack.length-1-Math.abs(Ie||0),Ie>=0?this.conditionStack[Ie]:"INITIAL"},"topState"),pushState:o(function(Ie){this.begin(Ie)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:o(function(Ie,be,W,de){var re=de;switch(W){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;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),26;break;case 9:return this.popState(),"acc_descr_value";break;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;break;case 23:return this.begin("person"),44;break;case 24:return this.begin("system_ext_queue"),51;break;case 25:return this.begin("system_ext_db"),50;break;case 26:return this.begin("system_ext"),49;break;case 27:return this.begin("system_queue"),48;break;case 28:return this.begin("system_db"),47;break;case 29:return this.begin("system"),46;break;case 30:return this.begin("boundary"),37;break;case 31:return this.begin("enterprise_boundary"),34;break;case 32:return this.begin("system_boundary"),36;break;case 33:return this.begin("container_ext_queue"),57;break;case 34:return this.begin("container_ext_db"),56;break;case 35:return this.begin("container_ext"),55;break;case 36:return this.begin("container_queue"),54;break;case 37:return this.begin("container_db"),53;break;case 38:return this.begin("container"),52;break;case 39:return this.begin("container_boundary"),38;break;case 40:return this.begin("component_ext_queue"),63;break;case 41:return this.begin("component_ext_db"),62;break;case 42:return this.begin("component_ext"),61;break;case 43:return this.begin("component_queue"),60;break;case 44:return this.begin("component_db"),59;break;case 45:return this.begin("component"),58;break;case 46:return this.begin("node"),39;break;case 47:return this.begin("node"),39;break;case 48:return this.begin("node_l"),40;break;case 49:return this.begin("node_r"),41;break;case 50:return this.begin("rel"),64;break;case 51:return this.begin("birel"),65;break;case 52:return this.begin("rel_u"),66;break;case 53:return this.begin("rel_u"),66;break;case 54:return this.begin("rel_d"),67;break;case 55:return this.begin("rel_d"),67;break;case 56:return this.begin("rel_l"),68;break;case 57:return this.begin("rel_l"),68;break;case 58:return this.begin("rel_r"),69;break;case 59:return this.begin("rel_r"),69;break;case 60:return this.begin("rel_b"),70;break;case 61:return this.begin("rel_index"),71;break;case 62:return this.begin("update_el_style"),72;break;case 63:return this.begin("update_rel_style"),73;break;case 64:return this.begin("update_layout_config"),74;break;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";break;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";break;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}},"anonymous"),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 $e}();ge.lexer=ze;function He(){this.yy={}}return o(He,"Parser"),He.prototype=ge,ge.Parser=He,new He}();Ty.parser=Ty;JF=Ty});var zC,Gn,s0=N(()=>{"use strict";zC=o((t,e,{depth:r=2,clobber:n=!1}={})=>{let i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>zC(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=zC(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),Gn=zC});var G4,e$,t$=N(()=>{"use strict";G4={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:o(t=>t>=255?255:t<0?0:t,"r"),g:o(t=>t>=255?255:t<0?0:t,"g"),b:o(t=>t>=255?255:t<0?0:t,"b"),h:o(t=>t%360,"h"),s:o(t=>t>=100?100:t<0?0:t,"s"),l:o(t=>t>=100?100:t<0?0:t,"l"),a:o(t=>t>=1?1:t<0?0:t,"a")},toLinear:o(t=>{let e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},"toLinear"),hue2rgb:o((t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<.16666666666666666?t+(e-t)*6*r:r<.5?e:r<.6666666666666666?t+(e-t)*(.6666666666666666-r)*6:t),"hue2rgb"),hsl2rgb:o(({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;let i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return G4.hue2rgb(a,i,t+.3333333333333333)*255;case"g":return G4.hue2rgb(a,i,t)*255;case"b":return G4.hue2rgb(a,i,t-.3333333333333333)*255}},"hsl2rgb"),rgb2hsl:o(({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;let i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;let l=i-a,u=s>.5?l/(2-i-a):l/(i+a);if(n==="s")return u*100;switch(i){case t:return((e-r)/l+(e{"use strict";fxe={clamp:o((t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),"clamp"),round:o(t=>Math.round(t*1e10)/1e10,"round")},r$=fxe});var dxe,i$,a$=N(()=>{"use strict";dxe={dec2hex:o(t=>{let e=Math.round(t).toString(16);return e.length>1?e:`0${e}`},"dec2hex")},i$=dxe});var pxe,jt,Wl=N(()=>{"use strict";t$();n$();a$();pxe={channel:e$,lang:r$,unit:i$},jt=pxe});var ru,Ii,ky=N(()=>{"use strict";Wl();ru={};for(let t=0;t<=255;t++)ru[t]=jt.unit.dec2hex(t);Ii={ALL:0,RGB:1,HSL:2}});var GC,s$,o$=N(()=>{"use strict";ky();GC=class{static{o(this,"Type")}constructor(){this.type=Ii.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Ii.ALL}is(e){return this.type===e}},s$=GC});var VC,l$,c$=N(()=>{"use strict";Wl();o$();ky();VC=class{static{o(this,"Channels")}constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new s$}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Ii.ALL,this}_ensureHSL(){let e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=jt.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=jt.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=jt.channel.rgb2hsl(e,"l"))}_ensureRGB(){let e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=jt.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=jt.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=jt.channel.hsl2rgb(e,"b"))}get r(){let e=this.data,r=e.r;return!this.type.is(Ii.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"r"))}get g(){let e=this.data,r=e.g;return!this.type.is(Ii.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"g"))}get b(){let e=this.data,r=e.b;return!this.type.is(Ii.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"b"))}get h(){let e=this.data,r=e.h;return!this.type.is(Ii.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"h"))}get s(){let e=this.data,r=e.s;return!this.type.is(Ii.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"s"))}get l(){let e=this.data,r=e.l;return!this.type.is(Ii.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Ii.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Ii.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Ii.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Ii.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Ii.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Ii.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}},l$=VC});var mxe,ih,Ey=N(()=>{"use strict";c$();mxe=new l$({r:0,g:0,b:0,a:0},"transparent"),ih=mxe});var u$,jf,UC=N(()=>{"use strict";Ey();ky();u$={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:o(t=>{if(t.charCodeAt(0)!==35)return;let e=t.match(u$.re);if(!e)return;let r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,l=s?1:17,u=s?8:4,h=a?0:-1,f=s?255:15;return ih.set({r:(n>>u*(h+3)&f)*l,g:(n>>u*(h+2)&f)*l,b:(n>>u*(h+1)&f)*l,a:a?(n&f)*l/255:1},t)},"parse"),stringify:o(t=>{let{r:e,g:r,b:n,a:i}=t;return i<1?`#${ru[Math.round(e)]}${ru[Math.round(r)]}${ru[Math.round(n)]}${ru[Math.round(i*255)]}`:`#${ru[Math.round(e)]}${ru[Math.round(r)]}${ru[Math.round(n)]}`},"stringify")},jf=u$});var V4,Sy,h$=N(()=>{"use strict";Wl();Ey();V4={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:o(t=>{let e=t.match(V4.hueRe);if(e){let[,r,n]=e;switch(n){case"grad":return jt.channel.clamp.h(parseFloat(r)*.9);case"rad":return jt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return jt.channel.clamp.h(parseFloat(r)*360)}}return jt.channel.clamp.h(parseFloat(t))},"_hue2deg"),parse:o(t=>{let e=t.charCodeAt(0);if(e!==104&&e!==72)return;let r=t.match(V4.re);if(!r)return;let[,n,i,a,s,l]=r;return ih.set({h:V4._hue2deg(n),s:jt.channel.clamp.s(parseFloat(i)),l:jt.channel.clamp.l(parseFloat(a)),a:s?jt.channel.clamp.a(l?parseFloat(s)/100:parseFloat(s)):1},t)},"parse"),stringify:o(t=>{let{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${jt.lang.round(e)}, ${jt.lang.round(r)}%, ${jt.lang.round(n)}%, ${i})`:`hsl(${jt.lang.round(e)}, ${jt.lang.round(r)}%, ${jt.lang.round(n)}%)`},"stringify")},Sy=V4});var U4,HC,f$=N(()=>{"use strict";UC();U4={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:o(t=>{t=t.toLowerCase();let e=U4.colors[t];if(e)return jf.parse(e)},"parse"),stringify:o(t=>{let e=jf.stringify(t);for(let r in U4.colors)if(U4.colors[r]===e)return r},"stringify")},HC=U4});var d$,Cy,p$=N(()=>{"use strict";Wl();Ey();d$={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:o(t=>{let e=t.charCodeAt(0);if(e!==114&&e!==82)return;let r=t.match(d$.re);if(!r)return;let[,n,i,a,s,l,u,h,f]=r;return ih.set({r:jt.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:jt.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:jt.channel.clamp.b(u?parseFloat(l)*2.55:parseFloat(l)),a:h?jt.channel.clamp.a(f?parseFloat(h)/100:parseFloat(h)):1},t)},"parse"),stringify:o(t=>{let{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${jt.lang.round(e)}, ${jt.lang.round(r)}, ${jt.lang.round(n)}, ${jt.lang.round(i)})`:`rgb(${jt.lang.round(e)}, ${jt.lang.round(r)}, ${jt.lang.round(n)})`},"stringify")},Cy=d$});var gxe,Oi,nu=N(()=>{"use strict";UC();h$();f$();p$();ky();gxe={format:{keyword:HC,hex:jf,rgb:Cy,rgba:Cy,hsl:Sy,hsla:Sy},parse:o(t=>{if(typeof t!="string")return t;let e=jf.parse(t)||Cy.parse(t)||Sy.parse(t)||HC.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},"parse"),stringify:o(t=>!t.changed&&t.color?t.color:t.type.is(Ii.HSL)||t.data.r===void 0?Sy.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Cy.stringify(t):jf.stringify(t),"stringify")},Oi=gxe});var yxe,H4,WC=N(()=>{"use strict";Wl();nu();yxe=o((t,e)=>{let r=Oi.parse(t);for(let n in e)r[n]=jt.channel.clamp[n](e[n]);return Oi.stringify(r)},"change"),H4=yxe});var vxe,qa,qC=N(()=>{"use strict";Wl();Ey();nu();WC();vxe=o((t,e,r=0,n=1)=>{if(typeof t!="number")return H4(t,{a:e});let i=ih.set({r:jt.channel.clamp.r(t),g:jt.channel.clamp.g(e),b:jt.channel.clamp.b(r),a:jt.channel.clamp.a(n)});return Oi.stringify(i)},"rgba"),qa=vxe});var xxe,Kf,m$=N(()=>{"use strict";Wl();nu();xxe=o((t,e)=>jt.lang.round(Oi.parse(t)[e]),"channel"),Kf=xxe});var bxe,g$,y$=N(()=>{"use strict";Wl();nu();bxe=o(t=>{let{r:e,g:r,b:n}=Oi.parse(t),i=.2126*jt.channel.toLinear(e)+.7152*jt.channel.toLinear(r)+.0722*jt.channel.toLinear(n);return jt.lang.round(i)},"luminance"),g$=bxe});var wxe,v$,x$=N(()=>{"use strict";y$();wxe=o(t=>g$(t)>=.5,"isLight"),v$=wxe});var Txe,ca,b$=N(()=>{"use strict";x$();Txe=o(t=>!v$(t),"isDark"),ca=Txe});var kxe,W4,YC=N(()=>{"use strict";Wl();nu();kxe=o((t,e,r)=>{let n=Oi.parse(t),i=n[e],a=jt.channel.clamp[e](i+r);return i!==a&&(n[e]=a),Oi.stringify(n)},"adjustChannel"),W4=kxe});var Exe,Dt,w$=N(()=>{"use strict";YC();Exe=o((t,e)=>W4(t,"l",e),"lighten"),Dt=Exe});var Sxe,Ot,T$=N(()=>{"use strict";YC();Sxe=o((t,e)=>W4(t,"l",-e),"darken"),Ot=Sxe});var Cxe,Me,k$=N(()=>{"use strict";nu();WC();Cxe=o((t,e)=>{let r=Oi.parse(t),n={};for(let i in e)e[i]&&(n[i]=r[i]+e[i]);return H4(t,n)},"adjust"),Me=Cxe});var Axe,E$,S$=N(()=>{"use strict";nu();qC();Axe=o((t,e,r=50)=>{let{r:n,g:i,b:a,a:s}=Oi.parse(t),{r:l,g:u,b:h,a:f}=Oi.parse(e),d=r/100,p=d*2-1,m=s-f,y=((p*m===-1?p:(p+m)/(1+p*m))+1)/2,v=1-y,x=n*y+l*v,b=i*y+u*v,w=a*y+h*v,C=s*d+f*(1-d);return qa(x,b,w,C)},"mix"),E$=Axe});var _xe,wt,C$=N(()=>{"use strict";nu();S$();_xe=o((t,e=100)=>{let r=Oi.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,E$(r,t,e)},"invert"),wt=_xe});var A$=N(()=>{"use strict";qC();m$();b$();w$();T$();k$();C$()});var Ys=N(()=>{"use strict";A$()});var ah,sh,Ay=N(()=>{"use strict";ah="#ffffff",sh="#f2f2f2"});var Ti,o0=N(()=>{"use strict";Ys();Ti=o((t,e)=>e?Me(t,{s:-40,l:10}):Me(t,{s:-40,l:-10}),"mkBorder")});var jC,_$,D$=N(()=>{"use strict";Ys();Ay();o0();jC=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ti(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ti(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ti(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ti(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||wt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||wt(this.tertiaryColor),this.lineColor=this.lineColor||wt(this.background),this.arrowheadColor=this.arrowheadColor||wt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||wt(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Dt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Ot(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Ot(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Dt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Dt(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Me(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},_$=o(t=>{let e=new jC;return e.calculate(t),e},"getThemeVariables")});var KC,L$,R$=N(()=>{"use strict";Ys();o0();KC=class{static{o(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Dt(this.primaryColor,16),this.tertiaryColor=Me(this.primaryColor,{h:-160}),this.primaryBorderColor=wt(this.background),this.secondaryBorderColor=Ti(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ti(this.tertiaryColor,this.darkMode),this.primaryTextColor=wt(this.primaryColor),this.secondaryTextColor=wt(this.secondaryColor),this.tertiaryTextColor=wt(this.tertiaryColor),this.lineColor=wt(this.background),this.textColor=wt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Dt(wt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=qa(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=Ot("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Ot(this.sectionBkgColor,10),this.taskBorderColor=qa(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=qa(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Dt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Ot(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=Dt(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Dt(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Dt(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Me(this.primaryColor,{h:64}),this.fillType3=Me(this.secondaryColor,{h:64}),this.fillType4=Me(this.primaryColor,{h:-64}),this.fillType5=Me(this.secondaryColor,{h:-64}),this.fillType6=Me(this.primaryColor,{h:128}),this.fillType7=Me(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Me(this.primaryColor,{h:330});for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},L$=o(t=>{let e=new KC;return e.calculate(t),e},"getThemeVariables")});var QC,oh,_y=N(()=>{"use strict";Ys();o0();Ay();QC=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Me(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Me(this.primaryColor,{h:-160}),this.primaryBorderColor=Ti(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ti(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ti(this.tertiaryColor,this.darkMode),this.primaryTextColor=wt(this.primaryColor),this.secondaryTextColor=wt(this.secondaryColor),this.tertiaryTextColor=wt(this.tertiaryColor),this.lineColor=wt(this.background),this.textColor=wt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=qa(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Ot(this.tertiaryColor,40);for(let e=0;e{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}let r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},oh=o(t=>{let e=new QC;return e.calculate(t),e},"getThemeVariables")});var ZC,N$,M$=N(()=>{"use strict";Ys();Ay();o0();ZC=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Dt("#cde498",10),this.primaryBorderColor=Ti(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ti(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ti(this.tertiaryColor,this.darkMode),this.primaryTextColor=wt(this.primaryColor),this.secondaryTextColor=wt(this.secondaryColor),this.tertiaryTextColor=wt(this.primaryColor),this.lineColor=wt(this.background),this.textColor=wt(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=Ot(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Ot(this.tertiaryColor,40);for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},N$=o(t=>{let e=new ZC;return e.calculate(t),e},"getThemeVariables")});var JC,I$,O$=N(()=>{"use strict";Ys();o0();Ay();JC=class{static{o(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Dt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Me(this.primaryColor,{h:-160}),this.primaryBorderColor=Ti(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ti(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ti(this.tertiaryColor,this.darkMode),this.primaryTextColor=wt(this.primaryColor),this.secondaryTextColor=wt(this.secondaryColor),this.tertiaryTextColor=wt(this.tertiaryColor),this.lineColor=wt(this.background),this.textColor=wt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Dt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=Dt(this.contrast,55),this.border2=this.contrast,this.actorBorder=Dt(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},I$=o(t=>{let e=new JC;return e.calculate(t),e},"getThemeVariables")});var To,q4=N(()=>{"use strict";D$();R$();_y();M$();O$();To={base:{getThemeVariables:_$},dark:{getThemeVariables:L$},default:{getThemeVariables:oh},forest:{getThemeVariables:N$},neutral:{getThemeVariables:I$}}});var ql,P$=N(()=>{"use strict";ql={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1}});var B$,F$,$$,or,Ya=N(()=>{"use strict";q4();P$();B$={...ql,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:To.default.getThemeVariables(),sequence:{...ql.sequence,messageFont:o(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:o(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:o(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...ql.gantt,tickInterval:void 0,useWidth:void 0},c4:{...ql.c4,useWidth:void 0,personFont:o(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),external_personFont:o(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:o(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:o(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:o(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:o(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:o(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:o(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:o(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:o(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:o(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:o(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:o(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:o(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:o(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:o(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:o(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:o(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:o(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:o(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:o(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:o(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...ql.pie,useWidth:984},xyChart:{...ql.xyChart,useWidth:void 0},requirement:{...ql.requirement,useWidth:void 0},packet:{...ql.packet},radar:{...ql.radar}},F$=o((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...F$(t[n],"")]:[...r,e+n],[]),"keyify"),$$=new Set(F$(B$,"")),or=B$});var l0,Dxe,e7=N(()=>{"use strict";Ya();vt();l0=o(t=>{if(Y.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>l0(e));return}for(let e of Object.keys(t)){if(Y.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!$$.has(e)||t[e]==null){Y.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){Y.debug("sanitizing object",e),l0(t[e]);continue}let r=["themeCSS","fontFamily","altFontFamily"];for(let n of r)e.includes(n)&&(Y.debug("sanitizing css option",e),t[e]=Dxe(t[e]))}if(t.themeVariables)for(let e of Object.keys(t.themeVariables)){let r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}Y.debug("After sanitization",t)}},"sanitizeDirective"),Dxe=o(t=>{let e=0,r=0;for(let n of t){if(e{"use strict";s0();vt();q4();Ya();e7();lh=Object.freeze(or),xs=Gn({},lh),c0=[],Dy=Gn({},lh),Y4=o((t,e)=>{let r=Gn({},t),n={};for(let i of e)H$(i),n=Gn(n,i);if(r=Gn(r,n),n.theme&&n.theme in To){let i=Gn({},G$),a=Gn(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in To&&(r.themeVariables=To[r.theme].getThemeVariables(a))}return Dy=r,q$(Dy),Dy},"updateCurrentConfig"),t7=o(t=>(xs=Gn({},lh),xs=Gn(xs,t),t.theme&&To[t.theme]&&(xs.themeVariables=To[t.theme].getThemeVariables(t.themeVariables)),Y4(xs,c0),xs),"setSiteConfig"),V$=o(t=>{G$=Gn({},t)},"saveConfigFromInitialize"),U$=o(t=>(xs=Gn(xs,t),Y4(xs,c0),xs),"updateSiteConfig"),r7=o(()=>Gn({},xs),"getSiteConfig"),X4=o(t=>(q$(t),Gn(Dy,t),cr()),"setConfig"),cr=o(()=>Gn({},Dy),"getConfig"),H$=o(t=>{t&&(["secure",...xs.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(Y.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&H$(t[e])}))},"sanitize"),W$=o(t=>{l0(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),c0.push(t),Y4(xs,c0)},"addDirective"),Ly=o((t=xs)=>{c0=[],Y4(t,c0)},"reset"),Lxe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},z$={},Rxe=o(t=>{z$[t]||(Y.warn(Lxe[t]),z$[t]=!0)},"issueWarning"),q$=o(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Rxe("LAZY_LOAD_DEPRECATED")},"checkConfig")});function Ka(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Q4;Y$&&Y$(t,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){let a=r(i);a!==i&&(Nxe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function zxe(t){for(let e=0;e0&&arguments[0]!==void 0?arguments[0]:Qxe(),e=o(At=>sz(At),"DOMPurify");if(e.version="3.2.4",e.removed=[],!t||!t.document||t.document.nodeType!==Oy.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t,n=r,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:h,NamedNodeMap:f=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:m}=t,g=u.prototype,y=Iy(g,"cloneNode"),v=Iy(g,"remove"),x=Iy(g,"nextSibling"),b=Iy(g,"childNodes"),w=Iy(g,"parentNode");if(typeof s=="function"){let At=r.createElement("template");At.content&&At.content.ownerDocument&&(r=At.content.ownerDocument)}let C,T="",{implementation:E,createNodeIterator:A,createDocumentFragment:S,getElementsByTagName:_}=r,{importNode:I}=n,D=tz();e.isSupported=typeof rz=="function"&&typeof w=="function"&&E&&E.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:k,ERB_EXPR:L,TMPLIT_EXPR:R,DATA_ATTR:O,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:F,CUSTOM_ELEMENT:P}=ez,{IS_ALLOWED_URI:z}=ez,$=null,H=Cr({},[...K$,...i7,...a7,...s7,...Q$]),Q=null,j=Cr({},[...Z$,...o7,...J$,...K4]),ie=Object.seal(nz(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ne=null,le=null,he=!0,K=!0,X=!1,te=!0,J=!1,se=!0,ue=!1,Z=!1,Se=!1,ce=!1,ae=!1,Oe=!1,ge=!0,ze=!1,He="user-content-",$e=!0,Re=!1,Ie={},be=null,W=Cr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),de=null,re=Cr({},["audio","video","img","source","image","track"]),oe=null,V=Cr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xe="http://www.w3.org/1998/Math/MathML",q="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",ve=pe,Pe=!1,_e=null,we=Cr({},[xe,q,pe],n7),Ve=Cr({},["mi","mo","mn","ms","mtext"]),De=Cr({},["annotation-xml"]),qe=Cr({},["title","style","font","a","script"]),at=null,Rt=["application/xhtml+xml","text/html"],st="text/html",Ue=null,ct=null,We=r.createElement("form"),ot=o(function(Ce){return Ce instanceof RegExp||Ce instanceof Function},"isRegexOrFunction"),Yt=o(function(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ct&&ct===Ce)){if((!Ce||typeof Ce!="object")&&(Ce={}),Ce=Qf(Ce),at=Rt.indexOf(Ce.PARSER_MEDIA_TYPE)===-1?st:Ce.PARSER_MEDIA_TYPE,Ue=at==="application/xhtml+xml"?n7:Q4,$=sl(Ce,"ALLOWED_TAGS")?Cr({},Ce.ALLOWED_TAGS,Ue):H,Q=sl(Ce,"ALLOWED_ATTR")?Cr({},Ce.ALLOWED_ATTR,Ue):j,_e=sl(Ce,"ALLOWED_NAMESPACES")?Cr({},Ce.ALLOWED_NAMESPACES,n7):we,oe=sl(Ce,"ADD_URI_SAFE_ATTR")?Cr(Qf(V),Ce.ADD_URI_SAFE_ATTR,Ue):V,de=sl(Ce,"ADD_DATA_URI_TAGS")?Cr(Qf(re),Ce.ADD_DATA_URI_TAGS,Ue):re,be=sl(Ce,"FORBID_CONTENTS")?Cr({},Ce.FORBID_CONTENTS,Ue):W,ne=sl(Ce,"FORBID_TAGS")?Cr({},Ce.FORBID_TAGS,Ue):{},le=sl(Ce,"FORBID_ATTR")?Cr({},Ce.FORBID_ATTR,Ue):{},Ie=sl(Ce,"USE_PROFILES")?Ce.USE_PROFILES:!1,he=Ce.ALLOW_ARIA_ATTR!==!1,K=Ce.ALLOW_DATA_ATTR!==!1,X=Ce.ALLOW_UNKNOWN_PROTOCOLS||!1,te=Ce.ALLOW_SELF_CLOSE_IN_ATTR!==!1,J=Ce.SAFE_FOR_TEMPLATES||!1,se=Ce.SAFE_FOR_XML!==!1,ue=Ce.WHOLE_DOCUMENT||!1,ce=Ce.RETURN_DOM||!1,ae=Ce.RETURN_DOM_FRAGMENT||!1,Oe=Ce.RETURN_TRUSTED_TYPE||!1,Se=Ce.FORCE_BODY||!1,ge=Ce.SANITIZE_DOM!==!1,ze=Ce.SANITIZE_NAMED_PROPS||!1,$e=Ce.KEEP_CONTENT!==!1,Re=Ce.IN_PLACE||!1,z=Ce.ALLOWED_URI_REGEXP||iz,ve=Ce.NAMESPACE||pe,Ve=Ce.MATHML_TEXT_INTEGRATION_POINTS||Ve,De=Ce.HTML_INTEGRATION_POINTS||De,ie=Ce.CUSTOM_ELEMENT_HANDLING||{},Ce.CUSTOM_ELEMENT_HANDLING&&ot(Ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ie.tagNameCheck=Ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ce.CUSTOM_ELEMENT_HANDLING&&ot(Ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ie.attributeNameCheck=Ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ce.CUSTOM_ELEMENT_HANDLING&&typeof Ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=Ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),J&&(K=!1),ae&&(ce=!0),Ie&&($=Cr({},Q$),Q=[],Ie.html===!0&&(Cr($,K$),Cr(Q,Z$)),Ie.svg===!0&&(Cr($,i7),Cr(Q,o7),Cr(Q,K4)),Ie.svgFilters===!0&&(Cr($,a7),Cr(Q,o7),Cr(Q,K4)),Ie.mathMl===!0&&(Cr($,s7),Cr(Q,J$),Cr(Q,K4))),Ce.ADD_TAGS&&($===H&&($=Qf($)),Cr($,Ce.ADD_TAGS,Ue)),Ce.ADD_ATTR&&(Q===j&&(Q=Qf(Q)),Cr(Q,Ce.ADD_ATTR,Ue)),Ce.ADD_URI_SAFE_ATTR&&Cr(oe,Ce.ADD_URI_SAFE_ATTR,Ue),Ce.FORBID_CONTENTS&&(be===W&&(be=Qf(be)),Cr(be,Ce.FORBID_CONTENTS,Ue)),$e&&($["#text"]=!0),ue&&Cr($,["html","head","body"]),$.table&&(Cr($,["tbody"]),delete ne.tbody),Ce.TRUSTED_TYPES_POLICY){if(typeof Ce.TRUSTED_TYPES_POLICY.createHTML!="function")throw My('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ce.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw My('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=Ce.TRUSTED_TYPES_POLICY,T=C.createHTML("")}else C===void 0&&(C=Zxe(m,i)),C!==null&&typeof T=="string"&&(T=C.createHTML(""));ja&&ja(Ce),ct=Ce}},"_parseConfig"),bt=Cr({},[...i7,...a7,...Gxe]),Mt=Cr({},[...s7,...Vxe]),xt=o(function(Ce){let tt=w(Ce);(!tt||!tt.tagName)&&(tt={namespaceURI:ve,tagName:"template"});let St=Q4(Ce.tagName),mr=Q4(tt.tagName);return _e[Ce.namespaceURI]?Ce.namespaceURI===q?tt.namespaceURI===pe?St==="svg":tt.namespaceURI===xe?St==="svg"&&(mr==="annotation-xml"||Ve[mr]):!!bt[St]:Ce.namespaceURI===xe?tt.namespaceURI===pe?St==="math":tt.namespaceURI===q?St==="math"&&De[mr]:!!Mt[St]:Ce.namespaceURI===pe?tt.namespaceURI===q&&!De[mr]||tt.namespaceURI===xe&&!Ve[mr]?!1:!Mt[St]&&(qe[St]||!bt[St]):!!(at==="application/xhtml+xml"&&_e[Ce.namespaceURI]):!1},"_checkValidNamespace"),ut=o(function(Ce){Ry(e.removed,{element:Ce});try{w(Ce).removeChild(Ce)}catch{v(Ce)}},"_forceRemove"),Et=o(function(Ce,tt){try{Ry(e.removed,{attribute:tt.getAttributeNode(Ce),from:tt})}catch{Ry(e.removed,{attribute:null,from:tt})}if(tt.removeAttribute(Ce),Ce==="is")if(ce||ae)try{ut(tt)}catch{}else try{tt.setAttribute(Ce,"")}catch{}},"_removeAttribute"),ft=o(function(Ce){let tt=null,St=null;if(Se)Ce=" "+Ce;else{let gn=j$(Ce,/^[\r\n\t ]+/);St=gn&&gn[0]}at==="application/xhtml+xml"&&ve===pe&&(Ce=''+Ce+"");let mr=C?C.createHTML(Ce):Ce;if(ve===pe)try{tt=new p().parseFromString(mr,at)}catch{}if(!tt||!tt.documentElement){tt=E.createDocument(ve,"template",null);try{tt.documentElement.innerHTML=Pe?T:mr}catch{}}let rn=tt.body||tt.documentElement;return Ce&&St&&rn.insertBefore(r.createTextNode(St),rn.childNodes[0]||null),ve===pe?_.call(tt,ue?"html":"body")[0]:ue?tt.documentElement:rn},"_initDocument"),yt=o(function(Ce){return A.call(Ce.ownerDocument||Ce,Ce,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),nt=o(function(Ce){return Ce instanceof d&&(typeof Ce.nodeName!="string"||typeof Ce.textContent!="string"||typeof Ce.removeChild!="function"||!(Ce.attributes instanceof f)||typeof Ce.removeAttribute!="function"||typeof Ce.setAttribute!="function"||typeof Ce.namespaceURI!="string"||typeof Ce.insertBefore!="function"||typeof Ce.hasChildNodes!="function")},"_isClobbered"),dn=o(function(Ce){return typeof l=="function"&&Ce instanceof l},"_isNode");function Tt(At,Ce,tt){j4(At,St=>{St.call(e,Ce,tt,ct)})}o(Tt,"_executeHooks");let On=o(function(Ce){let tt=null;if(Tt(D.beforeSanitizeElements,Ce,null),nt(Ce))return ut(Ce),!0;let St=Ue(Ce.nodeName);if(Tt(D.uponSanitizeElement,Ce,{tagName:St,allowedTags:$}),Ce.hasChildNodes()&&!dn(Ce.firstElementChild)&&Xa(/<[/\w]/g,Ce.innerHTML)&&Xa(/<[/\w]/g,Ce.textContent)||Ce.nodeType===Oy.progressingInstruction||se&&Ce.nodeType===Oy.comment&&Xa(/<[/\w]/g,Ce.data))return ut(Ce),!0;if(!$[St]||ne[St]){if(!ne[St]&&_r(St)&&(ie.tagNameCheck instanceof RegExp&&Xa(ie.tagNameCheck,St)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(St)))return!1;if($e&&!be[St]){let mr=w(Ce)||Ce.parentNode,rn=b(Ce)||Ce.childNodes;if(rn&&mr){let gn=rn.length;for(let Zr=gn-1;Zr>=0;--Zr){let Ni=y(rn[Zr],!0);Ni.__removalCount=(Ce.__removalCount||0)+1,mr.insertBefore(Ni,x(Ce))}}}return ut(Ce),!0}return Ce instanceof u&&!xt(Ce)||(St==="noscript"||St==="noembed"||St==="noframes")&&Xa(/<\/no(script|embed|frames)/i,Ce.innerHTML)?(ut(Ce),!0):(J&&Ce.nodeType===Oy.text&&(tt=Ce.textContent,j4([k,L,R],mr=>{tt=Ny(tt,mr," ")}),Ce.textContent!==tt&&(Ry(e.removed,{element:Ce.cloneNode()}),Ce.textContent=tt)),Tt(D.afterSanitizeElements,Ce,null),!1)},"_sanitizeElements"),tn=o(function(Ce,tt,St){if(ge&&(tt==="id"||tt==="name")&&(St in r||St in We))return!1;if(!(K&&!le[tt]&&Xa(O,tt))){if(!(he&&Xa(M,tt))){if(!Q[tt]||le[tt]){if(!(_r(Ce)&&(ie.tagNameCheck instanceof RegExp&&Xa(ie.tagNameCheck,Ce)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ce))&&(ie.attributeNameCheck instanceof RegExp&&Xa(ie.attributeNameCheck,tt)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(tt))||tt==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&Xa(ie.tagNameCheck,St)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(St))))return!1}else if(!oe[tt]){if(!Xa(z,Ny(St,F,""))){if(!((tt==="src"||tt==="xlink:href"||tt==="href")&&Ce!=="script"&&Bxe(St,"data:")===0&&de[Ce])){if(!(X&&!Xa(B,Ny(St,F,"")))){if(St)return!1}}}}}}return!0},"_isValidAttribute"),_r=o(function(Ce){return Ce!=="annotation-xml"&&j$(Ce,P)},"_isBasicCustomElement"),Dr=o(function(Ce){Tt(D.beforeSanitizeAttributes,Ce,null);let{attributes:tt}=Ce;if(!tt||nt(Ce))return;let St={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0},mr=tt.length;for(;mr--;){let rn=tt[mr],{name:gn,namespaceURI:Zr,value:Ni}=rn,Zn=Ue(gn),Sn=gn==="value"?Ni:Fxe(Ni);if(St.attrName=Zn,St.attrValue=Sn,St.keepAttr=!0,St.forceKeepAttr=void 0,Tt(D.uponSanitizeAttribute,Ce,St),Sn=St.attrValue,ze&&(Zn==="id"||Zn==="name")&&(Et(gn,Ce),Sn=He+Sn),se&&Xa(/((--!?|])>)|<\/(style|title)/i,Sn)){Et(gn,Ce);continue}if(St.forceKeepAttr||(Et(gn,Ce),!St.keepAttr))continue;if(!te&&Xa(/\/>/i,Sn)){Et(gn,Ce);continue}J&&j4([k,L,R],et=>{Sn=Ny(Sn,et," ")});let Hr=Ue(Ce.nodeName);if(tn(Hr,Zn,Sn)){if(C&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Zr)switch(m.getAttributeType(Hr,Zn)){case"TrustedHTML":{Sn=C.createHTML(Sn);break}case"TrustedScriptURL":{Sn=C.createScriptURL(Sn);break}}try{Zr?Ce.setAttributeNS(Zr,gn,Sn):Ce.setAttribute(gn,Sn),nt(Ce)?ut(Ce):X$(e.removed)}catch{}}}Tt(D.afterSanitizeAttributes,Ce,null)},"_sanitizeAttributes"),Pn=o(function At(Ce){let tt=null,St=yt(Ce);for(Tt(D.beforeSanitizeShadowDOM,Ce,null);tt=St.nextNode();)Tt(D.uponSanitizeShadowNode,tt,null),On(tt),Dr(tt),tt.content instanceof a&&At(tt.content);Tt(D.afterSanitizeShadowDOM,Ce,null)},"_sanitizeShadowDOM");return e.sanitize=function(At){let Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tt=null,St=null,mr=null,rn=null;if(Pe=!At,Pe&&(At=""),typeof At!="string"&&!dn(At))if(typeof At.toString=="function"){if(At=At.toString(),typeof At!="string")throw My("dirty is not a string, aborting")}else throw My("toString is not a function");if(!e.isSupported)return At;if(Z||Yt(Ce),e.removed=[],typeof At=="string"&&(Re=!1),Re){if(At.nodeName){let Ni=Ue(At.nodeName);if(!$[Ni]||ne[Ni])throw My("root node is forbidden and cannot be sanitized in-place")}}else if(At instanceof l)tt=ft(""),St=tt.ownerDocument.importNode(At,!0),St.nodeType===Oy.element&&St.nodeName==="BODY"||St.nodeName==="HTML"?tt=St:tt.appendChild(St);else{if(!ce&&!J&&!ue&&At.indexOf("<")===-1)return C&&Oe?C.createHTML(At):At;if(tt=ft(At),!tt)return ce?null:Oe?T:""}tt&&Se&&ut(tt.firstChild);let gn=yt(Re?At:tt);for(;mr=gn.nextNode();)On(mr),Dr(mr),mr.content instanceof a&&Pn(mr.content);if(Re)return At;if(ce){if(ae)for(rn=S.call(tt.ownerDocument);tt.firstChild;)rn.appendChild(tt.firstChild);else rn=tt;return(Q.shadowroot||Q.shadowrootmode)&&(rn=I.call(n,rn,!0)),rn}let Zr=ue?tt.outerHTML:tt.innerHTML;return ue&&$["!doctype"]&&tt.ownerDocument&&tt.ownerDocument.doctype&&tt.ownerDocument.doctype.name&&Xa(az,tt.ownerDocument.doctype.name)&&(Zr="
+`+Zr),J&&j4([k,L,R],Ni=>{Zr=Ny(Zr,Ni," ")}),C&&Oe?C.createHTML(Zr):Zr},e.setConfig=function(){let At=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yt(At),Z=!0},e.clearConfig=function(){ct=null,Z=!1},e.isValidAttribute=function(At,Ce,tt){ct||Yt({});let St=Ue(At),mr=Ue(Ce);return tn(St,mr,tt)},e.addHook=function(At,Ce){typeof Ce=="function"&&Ry(D[At],Ce)},e.removeHook=function(At,Ce){if(Ce!==void 0){let tt=Oxe(D[At],Ce);return tt===-1?void 0:Pxe(D[At],tt,1)[0]}return X$(D[At])},e.removeHooks=function(At){D[At]=[]},e.removeAllHooks=function(){D=tz()},e}var rz,Y$,Nxe,Mxe,Ixe,ja,ko,nz,l7,c7,j4,Oxe,X$,Ry,Pxe,Q4,n7,j$,Ny,Bxe,Fxe,sl,Xa,My,K$,i7,a7,Gxe,s7,Vxe,Q$,Z$,o7,J$,K4,Uxe,Hxe,Wxe,qxe,Yxe,iz,Xxe,jxe,az,Kxe,ez,Oy,Qxe,Zxe,tz,ch,u7=N(()=>{"use strict";({entries:rz,setPrototypeOf:Y$,isFrozen:Nxe,getPrototypeOf:Mxe,getOwnPropertyDescriptor:Ixe}=Object),{freeze:ja,seal:ko,create:nz}=Object,{apply:l7,construct:c7}=typeof Reflect<"u"&&Reflect;ja||(ja=o(function(e){return e},"freeze"));ko||(ko=o(function(e){return e},"seal"));l7||(l7=o(function(e,r,n){return e.apply(r,n)},"apply"));c7||(c7=o(function(e,r){return new e(...r)},"construct"));j4=Ka(Array.prototype.forEach),Oxe=Ka(Array.prototype.lastIndexOf),X$=Ka(Array.prototype.pop),Ry=Ka(Array.prototype.push),Pxe=Ka(Array.prototype.splice),Q4=Ka(String.prototype.toLowerCase),n7=Ka(String.prototype.toString),j$=Ka(String.prototype.match),Ny=Ka(String.prototype.replace),Bxe=Ka(String.prototype.indexOf),Fxe=Ka(String.prototype.trim),sl=Ka(Object.prototype.hasOwnProperty),Xa=Ka(RegExp.prototype.test),My=$xe(TypeError);o(Ka,"unapply");o($xe,"unconstruct");o(Cr,"addToSet");o(zxe,"cleanArray");o(Qf,"clone");o(Iy,"lookupGetter");K$=ja(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),i7=ja(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),a7=ja(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Gxe=ja(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),s7=ja(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Vxe=ja(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Q$=ja(["#text"]),Z$=ja(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),o7=ja(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),J$=ja(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),K4=ja(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Uxe=ko(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Hxe=ko(/<%[\w\W]*|[\w\W]*%>/gm),Wxe=ko(/\$\{[\w\W]*/gm),qxe=ko(/^data-[\-\w.\u00B7-\uFFFF]+$/),Yxe=ko(/^aria-[\-\w]+$/),iz=ko(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xxe=ko(/^(?:\w+script|data):/i),jxe=ko(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),az=ko(/^html$/i),Kxe=ko(/^[a-z][.\w]*(-[.\w]+)+$/i),ez=Object.freeze({__proto__:null,ARIA_ATTR:Yxe,ATTR_WHITESPACE:jxe,CUSTOM_ELEMENT:Kxe,DATA_ATTR:qxe,DOCTYPE_NAME:az,ERB_EXPR:Hxe,IS_ALLOWED_URI:iz,IS_SCRIPT_OR_DATA:Xxe,MUSTACHE_EXPR:Uxe,TMPLIT_EXPR:Wxe}),Oy={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qxe=o(function(){return typeof window>"u"?null:window},"getGlobal"),Zxe=o(function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null,i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));let a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},"_createTrustedTypesPolicy"),tz=o(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");o(sz,"createDOMPurify");ch=sz()});var MG={};hr(MG,{default:()=>q4e});function abe(t){return String(t).replace(ibe,e=>nbe[e])}function cbe(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}function gbe(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}function $z(t){for(var e=0;e=u3[e]&&t<=u3[e+1])return!0;return!1}function Abe(t,e){jl[t]=e}function P7(t,e,r){if(!jl[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=jl[e][n];if(!i&&t[0]in lz&&(n=lz[t[0]].charCodeAt(0),i=jl[e][n]),!i&&r==="text"&&$z(n)&&(i=jl[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}function _be(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!h7[e]){var r=h7[e]={cssEmPerMu:Z4.quad[e]/18};for(var n in Z4)Z4.hasOwnProperty(n)&&(r[n]=Z4[n][e])}return h7[e]}function hz(t){if(t instanceof Ts)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function Nbe(t){if(t instanceof td)return t;throw new Error("Expected span but got "+String(t)+".")}function G(t,e,r,n,i,a){An[t][i]={font:e,group:r,replace:n},a&&n&&(An[t][n]=An[t][i])}function Nt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,l={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},u=0;u0&&(a.push(a3(s,e)),s=[]),a.push(n[l]));s.length>0&&a.push(a3(s,e));var h;r?(h=a3(Pi(r,e,!0)),h.classes=["tag"],a.push(h)):i&&a.push(i);var f=lu(["katex-html"],a);if(f.setAttribute("aria-hidden","true"),h){var d=h.children[0];d.style.height=kt(f.height+f.depth),f.depth&&(d.style.verticalAlign=kt(-f.depth))}return f}function Qz(t){return new ed(t)}function gz(t,e,r,n,i){var a=ks(t,r),s;a.length===1&&a[0]instanceof ws&&Jt.contains(["mrow","mtable"],a[0].type)?s=a[0]:s=new dt.MathNode("mrow",a);var l=new dt.MathNode("annotation",[new dt.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var u=new dt.MathNode("semantics",[s,l]),h=new dt.MathNode("math",[u]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&h.setAttribute("display","block");var f=i?"katex":"katex-mathml";return Be.makeSpan([f],[h])}function xr(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function z7(t){var e=w3(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function w3(t){return t&&(t.type==="atom"||Ibe.hasOwnProperty(t.type))?t:null}function tG(t,e){var r=Pi(t.body,e,!0);return u4e([t.mclass],r,e)}function rG(t,e){var r,n=ks(t.body,e);return t.mclass==="minner"?r=new dt.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new dt.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new dt.MathNode("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}function d4e(t,e,r){var n=h4e[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),l=r.callFunction("\\\\cdright",[e[1]],[]),u={type:"ordgroup",mode:"math",body:[i,s,l]};return r.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function p4e(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new gt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;a-1))if("<>AV".indexOf(h)>-1)for(var d=0;d<2;d++){for(var p=!0,m=u+1;mAV=|." after @',s[u]);var g=d4e(h,f,t),y={type:"styling",body:[g],mode:"math",style:"display"};n.push(y),l=yz()}a%2===0?n.push(l):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}function k3(t,e){var r=w3(t);if(r&&Jt.contains(A4e,r.text))return r;throw r?new gt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new gt("Invalid delimiter type '"+t.type+"'",t)}function bz(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}function Ql(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,l={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u1||!f)&&y.pop(),x.length{"use strict";Xs=class t{static{o(this,"SourceLocation")}constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new t(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},So=class t{static{o(this,"Token")}constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new t(r,Xs.range(this,e))}},gt=class t{static{o(this,"ParseError")}constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var l=s.lexer.input;i=s.start,a=s.end,i===l.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var u=l.slice(i,a).replace(/[^]/g,"$&\u0332"),h;i>15?h="\u2026"+l.slice(i-15,i):h=l.slice(0,i);var f;a+15":">","<":"<",'"':""","'":"'"},ibe=/[&><"']/g;o(abe,"escape");Fz=o(function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},"getBaseElem"),sbe=o(function(e){var r=Fz(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},"isCharacterBox"),obe=o(function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},"assert"),lbe=o(function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|*58|*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},"protocolFromUrl"),Jt={contains:Jxe,deflt:ebe,escape:abe,hyphenate:rbe,getBaseElem:Fz,isCharacterBox:sbe,protocolFromUrl:lbe},c3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:o(t=>"#"+t,"cliProcessor")},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:o((t,e)=>(e.push(t),e),"cliProcessor")},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:o(t=>Math.max(0,t),"processor"),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:o(t=>Math.max(0,t),"processor"),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:o(t=>Math.max(0,t),"processor"),cli:"-e, --max-expand ",cliProcessor:o(t=>t==="Infinity"?1/0:parseInt(t),"cliProcessor")},globalGroup:{type:"boolean",cli:!1}};o(cbe,"getDefaultValue");zy=class{static{o(this,"Settings")}constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r in c3)if(c3.hasOwnProperty(r)){var n=c3[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:cbe(n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new gt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var r=Jt.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},Yl=class{static{o(this,"Style")}constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Xl[ube[this.id]]}sub(){return Xl[hbe[this.id]]}fracNum(){return Xl[fbe[this.id]]}fracDen(){return Xl[dbe[this.id]]}cramp(){return Xl[pbe[this.id]]}text(){return Xl[mbe[this.id]]}isTight(){return this.size>=2}},O7=0,h3=1,f0=2,su=3,Gy=4,Eo=5,d0=6,Qa=7,Xl=[new Yl(O7,0,!1),new Yl(h3,0,!0),new Yl(f0,1,!1),new Yl(su,1,!0),new Yl(Gy,2,!1),new Yl(Eo,2,!0),new Yl(d0,3,!1),new Yl(Qa,3,!0)],ube=[Gy,Eo,Gy,Eo,d0,Qa,d0,Qa],hbe=[Eo,Eo,Eo,Eo,Qa,Qa,Qa,Qa],fbe=[f0,su,Gy,Eo,d0,Qa,d0,Qa],dbe=[su,su,Eo,Eo,Qa,Qa,Qa,Qa],pbe=[h3,h3,su,su,Eo,Eo,Qa,Qa],mbe=[O7,h3,f0,su,f0,su,f0,su],tr={DISPLAY:Xl[O7],TEXT:Xl[f0],SCRIPT:Xl[Gy],SCRIPTSCRIPT:Xl[d0]},k7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];o(gbe,"scriptFromCodepoint");u3=[];k7.forEach(t=>t.blocks.forEach(e=>u3.push(...e)));o($z,"supportedCodepoint");h0=80,ybe=o(function(e,r){return"M95,"+(622+e+r)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -21,7 +21,7 @@ c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
-M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtMain"),K2e=o(function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119
+M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtMain"),vbe=o(function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
@@ -31,7 +31,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
-M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtSize1"),Q2e=o(function(e,r){return"M983 "+(10+e+r)+`
+M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtSize1"),xbe=o(function(e,r){return"M983 "+(10+e+r)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
@@ -40,7 +40,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
-M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtSize2"),Z2e=o(function(e,r){return"M424,"+(2398+e+r)+`
+M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtSize2"),bbe=o(function(e,r){return"M424,"+(2398+e+r)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
@@ -50,18 +50,18 @@ v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+`
-h400000v`+(40+e)+"h-400000z"},"sqrtSize3"),J2e=o(function(e,r){return"M473,"+(2713+e+r)+`
+h400000v`+(40+e)+"h-400000z"},"sqrtSize3"),wbe=o(function(e,r){return"M473,"+(2713+e+r)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
-606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},"sqrtSize4"),exe=o(function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},"phasePath"),txe=o(function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+`
+606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},"sqrtSize4"),Tbe=o(function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},"phasePath"),kbe=o(function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+`
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
-219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},"sqrtTall"),rxe=o(function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=j2e(r,mp);break;case"sqrtSize1":i=K2e(r,mp);break;case"sqrtSize2":i=Q2e(r,mp);break;case"sqrtSize3":i=Z2e(r,mp);break;case"sqrtSize4":i=J2e(r,mp);break;case"sqrtTall":i=txe(r,mp,n)}return i},"sqrtPath"),nxe=o(function(e,r){switch(e){case"\u239C":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"\u2223":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"\u2225":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"\u239F":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"\u23A2":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"\u23A5":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"\u23AA":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"\u23D0":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"\u2016":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},"innerPath"),Qz={doubleleftarrow:`M262 157
+219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},"sqrtTall"),Ebe=o(function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=ybe(r,h0);break;case"sqrtSize1":i=vbe(r,h0);break;case"sqrtSize2":i=xbe(r,h0);break;case"sqrtSize3":i=bbe(r,h0);break;case"sqrtSize4":i=wbe(r,h0);break;case"sqrtTall":i=kbe(r,h0,n)}return i},"sqrtPath"),Sbe=o(function(e,r){switch(e){case"\u239C":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"\u2223":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"\u2225":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"\u239F":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"\u23A2":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"\u23A5":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"\u23AA":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"\u23D0":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"\u2016":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},"innerPath"),oz={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
@@ -236,7 +236,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
-M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ixe=o(function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84
+M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Cbe=o(function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
@@ -264,18 +264,39 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
--470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}},"tallDelim"),Xf=class{static{o(this,"DocumentFragment")}constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Vt.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;rr.toText(),"toText");return this.children.map(e).join("")}},Zl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Jb={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Zz={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};o(axe,"setFontMetrics");o(M7,"getCharacterMetrics");l7={};o(sxe,"getGlobalMetrics");oxe=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Jz=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],eG=o(function(e,r){return r.size<2?e:oxe[e-1][r.size-1]},"sizeAtStyle"),d4=class t{static{o(this,"Options")}constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||t.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Jz[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new t(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:eG(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Jz[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=eG(t.BASESIZE,e);return this.size===r&&this.textSize===t.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==t.BASESIZE?["sizing","reset-size"+this.size,"size"+t.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=sxe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};d4.BASESIZE=6;w7={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},lxe={ex:!0,em:!0,mu:!0},DG=o(function(e){return typeof e!="string"&&(e=e.unit),e in w7||e in lxe||e==="ex"},"validUnit"),Hn=o(function(e,r){var n;if(e.unit in w7)n=w7[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new nt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},"calculateSize"),ct=o(function(e){return+e.toFixed(4)+"em"},"makeEm"),dh=o(function(e){return e.filter(r=>r).join(" ")},"createClass"),RG=o(function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},"initNode"),NG=o(function(e){var r=document.createElement(e);r.className=dh(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var a=0;a";for(var s=0;s",r},"toMarkup"),jf=class{static{o(this,"Span")}constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,RG.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Vt.contains(this.classes,e)}toNode(){return NG.call(this,"span")}toMarkup(){return MG.call(this,"span")}},iy=class{static{o(this,"Anchor")}constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,RG.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Vt.contains(this.classes,e)}toNode(){return NG.call(this,"a")}toMarkup(){return MG.call(this,"a")}},T7=class{static{o(this,"Img")}constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Vt.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e=' ",e}},cxe={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},ms=class{static{o(this,"SymbolNode")}constructor(e,r,n,i,a,s,l,u){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=r||0,this.depth=n||0,this.italic=i||0,this.skew=a||0,this.width=s||0,this.classes=l||[],this.style=u||{},this.maxFontSize=0;var h=X2e(this.text.charCodeAt(0));h&&this.classes.push(h+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=cxe[this.text])}hasClass(e){return Vt.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),r=null;this.italic>0&&(r=document.createElement("span"),r.style.marginRight=ct(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=dh(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Vt.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+Vt.escape(n)+'"');var a=Vt.escape(this.text);return e?(r+=">",r+=a,r+=" ",r):a}},ll=class{static{o(this,"SvgNode")}constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i";for(var n=0;n",e}},Jl=class{static{o(this,"PathNode")}constructor(e,r){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=r}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"path");return this.alternate?r.setAttribute("d",this.alternate):r.setAttribute("d",Qz[this.pathName]),r}toMarkup(){return this.alternate?' ':' '}},ay=class{static{o(this,"LineNode")}constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" ",e}};o(tG,"assertSymbolDomNode");o(uxe,"assertSpan");hxe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},fxe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},wn={math:{},text:{}};o(G,"defineSymbol");U="math",Qe="text",ee="main",ve="ams",Pn="accent-token",bt="bin",Xa="close",vp="inner",Ut="mathord",xi="op-token",js="open",b4="punct",xe="rel",lu="spacing",Le="textord";G(U,ee,xe,"\u2261","\\equiv",!0);G(U,ee,xe,"\u227A","\\prec",!0);G(U,ee,xe,"\u227B","\\succ",!0);G(U,ee,xe,"\u223C","\\sim",!0);G(U,ee,xe,"\u22A5","\\perp");G(U,ee,xe,"\u2AAF","\\preceq",!0);G(U,ee,xe,"\u2AB0","\\succeq",!0);G(U,ee,xe,"\u2243","\\simeq",!0);G(U,ee,xe,"\u2223","\\mid",!0);G(U,ee,xe,"\u226A","\\ll",!0);G(U,ee,xe,"\u226B","\\gg",!0);G(U,ee,xe,"\u224D","\\asymp",!0);G(U,ee,xe,"\u2225","\\parallel");G(U,ee,xe,"\u22C8","\\bowtie",!0);G(U,ee,xe,"\u2323","\\smile",!0);G(U,ee,xe,"\u2291","\\sqsubseteq",!0);G(U,ee,xe,"\u2292","\\sqsupseteq",!0);G(U,ee,xe,"\u2250","\\doteq",!0);G(U,ee,xe,"\u2322","\\frown",!0);G(U,ee,xe,"\u220B","\\ni",!0);G(U,ee,xe,"\u221D","\\propto",!0);G(U,ee,xe,"\u22A2","\\vdash",!0);G(U,ee,xe,"\u22A3","\\dashv",!0);G(U,ee,xe,"\u220B","\\owns");G(U,ee,b4,".","\\ldotp");G(U,ee,b4,"\u22C5","\\cdotp");G(U,ee,Le,"#","\\#");G(Qe,ee,Le,"#","\\#");G(U,ee,Le,"&","\\&");G(Qe,ee,Le,"&","\\&");G(U,ee,Le,"\u2135","\\aleph",!0);G(U,ee,Le,"\u2200","\\forall",!0);G(U,ee,Le,"\u210F","\\hbar",!0);G(U,ee,Le,"\u2203","\\exists",!0);G(U,ee,Le,"\u2207","\\nabla",!0);G(U,ee,Le,"\u266D","\\flat",!0);G(U,ee,Le,"\u2113","\\ell",!0);G(U,ee,Le,"\u266E","\\natural",!0);G(U,ee,Le,"\u2663","\\clubsuit",!0);G(U,ee,Le,"\u2118","\\wp",!0);G(U,ee,Le,"\u266F","\\sharp",!0);G(U,ee,Le,"\u2662","\\diamondsuit",!0);G(U,ee,Le,"\u211C","\\Re",!0);G(U,ee,Le,"\u2661","\\heartsuit",!0);G(U,ee,Le,"\u2111","\\Im",!0);G(U,ee,Le,"\u2660","\\spadesuit",!0);G(U,ee,Le,"\xA7","\\S",!0);G(Qe,ee,Le,"\xA7","\\S");G(U,ee,Le,"\xB6","\\P",!0);G(Qe,ee,Le,"\xB6","\\P");G(U,ee,Le,"\u2020","\\dag");G(Qe,ee,Le,"\u2020","\\dag");G(Qe,ee,Le,"\u2020","\\textdagger");G(U,ee,Le,"\u2021","\\ddag");G(Qe,ee,Le,"\u2021","\\ddag");G(Qe,ee,Le,"\u2021","\\textdaggerdbl");G(U,ee,Xa,"\u23B1","\\rmoustache",!0);G(U,ee,js,"\u23B0","\\lmoustache",!0);G(U,ee,Xa,"\u27EF","\\rgroup",!0);G(U,ee,js,"\u27EE","\\lgroup",!0);G(U,ee,bt,"\u2213","\\mp",!0);G(U,ee,bt,"\u2296","\\ominus",!0);G(U,ee,bt,"\u228E","\\uplus",!0);G(U,ee,bt,"\u2293","\\sqcap",!0);G(U,ee,bt,"\u2217","\\ast");G(U,ee,bt,"\u2294","\\sqcup",!0);G(U,ee,bt,"\u25EF","\\bigcirc",!0);G(U,ee,bt,"\u2219","\\bullet",!0);G(U,ee,bt,"\u2021","\\ddagger");G(U,ee,bt,"\u2240","\\wr",!0);G(U,ee,bt,"\u2A3F","\\amalg");G(U,ee,bt,"&","\\And");G(U,ee,xe,"\u27F5","\\longleftarrow",!0);G(U,ee,xe,"\u21D0","\\Leftarrow",!0);G(U,ee,xe,"\u27F8","\\Longleftarrow",!0);G(U,ee,xe,"\u27F6","\\longrightarrow",!0);G(U,ee,xe,"\u21D2","\\Rightarrow",!0);G(U,ee,xe,"\u27F9","\\Longrightarrow",!0);G(U,ee,xe,"\u2194","\\leftrightarrow",!0);G(U,ee,xe,"\u27F7","\\longleftrightarrow",!0);G(U,ee,xe,"\u21D4","\\Leftrightarrow",!0);G(U,ee,xe,"\u27FA","\\Longleftrightarrow",!0);G(U,ee,xe,"\u21A6","\\mapsto",!0);G(U,ee,xe,"\u27FC","\\longmapsto",!0);G(U,ee,xe,"\u2197","\\nearrow",!0);G(U,ee,xe,"\u21A9","\\hookleftarrow",!0);G(U,ee,xe,"\u21AA","\\hookrightarrow",!0);G(U,ee,xe,"\u2198","\\searrow",!0);G(U,ee,xe,"\u21BC","\\leftharpoonup",!0);G(U,ee,xe,"\u21C0","\\rightharpoonup",!0);G(U,ee,xe,"\u2199","\\swarrow",!0);G(U,ee,xe,"\u21BD","\\leftharpoondown",!0);G(U,ee,xe,"\u21C1","\\rightharpoondown",!0);G(U,ee,xe,"\u2196","\\nwarrow",!0);G(U,ee,xe,"\u21CC","\\rightleftharpoons",!0);G(U,ve,xe,"\u226E","\\nless",!0);G(U,ve,xe,"\uE010","\\@nleqslant");G(U,ve,xe,"\uE011","\\@nleqq");G(U,ve,xe,"\u2A87","\\lneq",!0);G(U,ve,xe,"\u2268","\\lneqq",!0);G(U,ve,xe,"\uE00C","\\@lvertneqq");G(U,ve,xe,"\u22E6","\\lnsim",!0);G(U,ve,xe,"\u2A89","\\lnapprox",!0);G(U,ve,xe,"\u2280","\\nprec",!0);G(U,ve,xe,"\u22E0","\\npreceq",!0);G(U,ve,xe,"\u22E8","\\precnsim",!0);G(U,ve,xe,"\u2AB9","\\precnapprox",!0);G(U,ve,xe,"\u2241","\\nsim",!0);G(U,ve,xe,"\uE006","\\@nshortmid");G(U,ve,xe,"\u2224","\\nmid",!0);G(U,ve,xe,"\u22AC","\\nvdash",!0);G(U,ve,xe,"\u22AD","\\nvDash",!0);G(U,ve,xe,"\u22EA","\\ntriangleleft");G(U,ve,xe,"\u22EC","\\ntrianglelefteq",!0);G(U,ve,xe,"\u228A","\\subsetneq",!0);G(U,ve,xe,"\uE01A","\\@varsubsetneq");G(U,ve,xe,"\u2ACB","\\subsetneqq",!0);G(U,ve,xe,"\uE017","\\@varsubsetneqq");G(U,ve,xe,"\u226F","\\ngtr",!0);G(U,ve,xe,"\uE00F","\\@ngeqslant");G(U,ve,xe,"\uE00E","\\@ngeqq");G(U,ve,xe,"\u2A88","\\gneq",!0);G(U,ve,xe,"\u2269","\\gneqq",!0);G(U,ve,xe,"\uE00D","\\@gvertneqq");G(U,ve,xe,"\u22E7","\\gnsim",!0);G(U,ve,xe,"\u2A8A","\\gnapprox",!0);G(U,ve,xe,"\u2281","\\nsucc",!0);G(U,ve,xe,"\u22E1","\\nsucceq",!0);G(U,ve,xe,"\u22E9","\\succnsim",!0);G(U,ve,xe,"\u2ABA","\\succnapprox",!0);G(U,ve,xe,"\u2246","\\ncong",!0);G(U,ve,xe,"\uE007","\\@nshortparallel");G(U,ve,xe,"\u2226","\\nparallel",!0);G(U,ve,xe,"\u22AF","\\nVDash",!0);G(U,ve,xe,"\u22EB","\\ntriangleright");G(U,ve,xe,"\u22ED","\\ntrianglerighteq",!0);G(U,ve,xe,"\uE018","\\@nsupseteqq");G(U,ve,xe,"\u228B","\\supsetneq",!0);G(U,ve,xe,"\uE01B","\\@varsupsetneq");G(U,ve,xe,"\u2ACC","\\supsetneqq",!0);G(U,ve,xe,"\uE019","\\@varsupsetneqq");G(U,ve,xe,"\u22AE","\\nVdash",!0);G(U,ve,xe,"\u2AB5","\\precneqq",!0);G(U,ve,xe,"\u2AB6","\\succneqq",!0);G(U,ve,xe,"\uE016","\\@nsubseteqq");G(U,ve,bt,"\u22B4","\\unlhd");G(U,ve,bt,"\u22B5","\\unrhd");G(U,ve,xe,"\u219A","\\nleftarrow",!0);G(U,ve,xe,"\u219B","\\nrightarrow",!0);G(U,ve,xe,"\u21CD","\\nLeftarrow",!0);G(U,ve,xe,"\u21CF","\\nRightarrow",!0);G(U,ve,xe,"\u21AE","\\nleftrightarrow",!0);G(U,ve,xe,"\u21CE","\\nLeftrightarrow",!0);G(U,ve,xe,"\u25B3","\\vartriangle");G(U,ve,Le,"\u210F","\\hslash");G(U,ve,Le,"\u25BD","\\triangledown");G(U,ve,Le,"\u25CA","\\lozenge");G(U,ve,Le,"\u24C8","\\circledS");G(U,ve,Le,"\xAE","\\circledR");G(Qe,ve,Le,"\xAE","\\circledR");G(U,ve,Le,"\u2221","\\measuredangle",!0);G(U,ve,Le,"\u2204","\\nexists");G(U,ve,Le,"\u2127","\\mho");G(U,ve,Le,"\u2132","\\Finv",!0);G(U,ve,Le,"\u2141","\\Game",!0);G(U,ve,Le,"\u2035","\\backprime");G(U,ve,Le,"\u25B2","\\blacktriangle");G(U,ve,Le,"\u25BC","\\blacktriangledown");G(U,ve,Le,"\u25A0","\\blacksquare");G(U,ve,Le,"\u29EB","\\blacklozenge");G(U,ve,Le,"\u2605","\\bigstar");G(U,ve,Le,"\u2222","\\sphericalangle",!0);G(U,ve,Le,"\u2201","\\complement",!0);G(U,ve,Le,"\xF0","\\eth",!0);G(Qe,ee,Le,"\xF0","\xF0");G(U,ve,Le,"\u2571","\\diagup");G(U,ve,Le,"\u2572","\\diagdown");G(U,ve,Le,"\u25A1","\\square");G(U,ve,Le,"\u25A1","\\Box");G(U,ve,Le,"\u25CA","\\Diamond");G(U,ve,Le,"\xA5","\\yen",!0);G(Qe,ve,Le,"\xA5","\\yen",!0);G(U,ve,Le,"\u2713","\\checkmark",!0);G(Qe,ve,Le,"\u2713","\\checkmark");G(U,ve,Le,"\u2136","\\beth",!0);G(U,ve,Le,"\u2138","\\daleth",!0);G(U,ve,Le,"\u2137","\\gimel",!0);G(U,ve,Le,"\u03DD","\\digamma",!0);G(U,ve,Le,"\u03F0","\\varkappa");G(U,ve,js,"\u250C","\\@ulcorner",!0);G(U,ve,Xa,"\u2510","\\@urcorner",!0);G(U,ve,js,"\u2514","\\@llcorner",!0);G(U,ve,Xa,"\u2518","\\@lrcorner",!0);G(U,ve,xe,"\u2266","\\leqq",!0);G(U,ve,xe,"\u2A7D","\\leqslant",!0);G(U,ve,xe,"\u2A95","\\eqslantless",!0);G(U,ve,xe,"\u2272","\\lesssim",!0);G(U,ve,xe,"\u2A85","\\lessapprox",!0);G(U,ve,xe,"\u224A","\\approxeq",!0);G(U,ve,bt,"\u22D6","\\lessdot");G(U,ve,xe,"\u22D8","\\lll",!0);G(U,ve,xe,"\u2276","\\lessgtr",!0);G(U,ve,xe,"\u22DA","\\lesseqgtr",!0);G(U,ve,xe,"\u2A8B","\\lesseqqgtr",!0);G(U,ve,xe,"\u2251","\\doteqdot");G(U,ve,xe,"\u2253","\\risingdotseq",!0);G(U,ve,xe,"\u2252","\\fallingdotseq",!0);G(U,ve,xe,"\u223D","\\backsim",!0);G(U,ve,xe,"\u22CD","\\backsimeq",!0);G(U,ve,xe,"\u2AC5","\\subseteqq",!0);G(U,ve,xe,"\u22D0","\\Subset",!0);G(U,ve,xe,"\u228F","\\sqsubset",!0);G(U,ve,xe,"\u227C","\\preccurlyeq",!0);G(U,ve,xe,"\u22DE","\\curlyeqprec",!0);G(U,ve,xe,"\u227E","\\precsim",!0);G(U,ve,xe,"\u2AB7","\\precapprox",!0);G(U,ve,xe,"\u22B2","\\vartriangleleft");G(U,ve,xe,"\u22B4","\\trianglelefteq");G(U,ve,xe,"\u22A8","\\vDash",!0);G(U,ve,xe,"\u22AA","\\Vvdash",!0);G(U,ve,xe,"\u2323","\\smallsmile");G(U,ve,xe,"\u2322","\\smallfrown");G(U,ve,xe,"\u224F","\\bumpeq",!0);G(U,ve,xe,"\u224E","\\Bumpeq",!0);G(U,ve,xe,"\u2267","\\geqq",!0);G(U,ve,xe,"\u2A7E","\\geqslant",!0);G(U,ve,xe,"\u2A96","\\eqslantgtr",!0);G(U,ve,xe,"\u2273","\\gtrsim",!0);G(U,ve,xe,"\u2A86","\\gtrapprox",!0);G(U,ve,bt,"\u22D7","\\gtrdot");G(U,ve,xe,"\u22D9","\\ggg",!0);G(U,ve,xe,"\u2277","\\gtrless",!0);G(U,ve,xe,"\u22DB","\\gtreqless",!0);G(U,ve,xe,"\u2A8C","\\gtreqqless",!0);G(U,ve,xe,"\u2256","\\eqcirc",!0);G(U,ve,xe,"\u2257","\\circeq",!0);G(U,ve,xe,"\u225C","\\triangleq",!0);G(U,ve,xe,"\u223C","\\thicksim");G(U,ve,xe,"\u2248","\\thickapprox");G(U,ve,xe,"\u2AC6","\\supseteqq",!0);G(U,ve,xe,"\u22D1","\\Supset",!0);G(U,ve,xe,"\u2290","\\sqsupset",!0);G(U,ve,xe,"\u227D","\\succcurlyeq",!0);G(U,ve,xe,"\u22DF","\\curlyeqsucc",!0);G(U,ve,xe,"\u227F","\\succsim",!0);G(U,ve,xe,"\u2AB8","\\succapprox",!0);G(U,ve,xe,"\u22B3","\\vartriangleright");G(U,ve,xe,"\u22B5","\\trianglerighteq");G(U,ve,xe,"\u22A9","\\Vdash",!0);G(U,ve,xe,"\u2223","\\shortmid");G(U,ve,xe,"\u2225","\\shortparallel");G(U,ve,xe,"\u226C","\\between",!0);G(U,ve,xe,"\u22D4","\\pitchfork",!0);G(U,ve,xe,"\u221D","\\varpropto");G(U,ve,xe,"\u25C0","\\blacktriangleleft");G(U,ve,xe,"\u2234","\\therefore",!0);G(U,ve,xe,"\u220D","\\backepsilon");G(U,ve,xe,"\u25B6","\\blacktriangleright");G(U,ve,xe,"\u2235","\\because",!0);G(U,ve,xe,"\u22D8","\\llless");G(U,ve,xe,"\u22D9","\\gggtr");G(U,ve,bt,"\u22B2","\\lhd");G(U,ve,bt,"\u22B3","\\rhd");G(U,ve,xe,"\u2242","\\eqsim",!0);G(U,ee,xe,"\u22C8","\\Join");G(U,ve,xe,"\u2251","\\Doteq",!0);G(U,ve,bt,"\u2214","\\dotplus",!0);G(U,ve,bt,"\u2216","\\smallsetminus");G(U,ve,bt,"\u22D2","\\Cap",!0);G(U,ve,bt,"\u22D3","\\Cup",!0);G(U,ve,bt,"\u2A5E","\\doublebarwedge",!0);G(U,ve,bt,"\u229F","\\boxminus",!0);G(U,ve,bt,"\u229E","\\boxplus",!0);G(U,ve,bt,"\u22C7","\\divideontimes",!0);G(U,ve,bt,"\u22C9","\\ltimes",!0);G(U,ve,bt,"\u22CA","\\rtimes",!0);G(U,ve,bt,"\u22CB","\\leftthreetimes",!0);G(U,ve,bt,"\u22CC","\\rightthreetimes",!0);G(U,ve,bt,"\u22CF","\\curlywedge",!0);G(U,ve,bt,"\u22CE","\\curlyvee",!0);G(U,ve,bt,"\u229D","\\circleddash",!0);G(U,ve,bt,"\u229B","\\circledast",!0);G(U,ve,bt,"\u22C5","\\centerdot");G(U,ve,bt,"\u22BA","\\intercal",!0);G(U,ve,bt,"\u22D2","\\doublecap");G(U,ve,bt,"\u22D3","\\doublecup");G(U,ve,bt,"\u22A0","\\boxtimes",!0);G(U,ve,xe,"\u21E2","\\dashrightarrow",!0);G(U,ve,xe,"\u21E0","\\dashleftarrow",!0);G(U,ve,xe,"\u21C7","\\leftleftarrows",!0);G(U,ve,xe,"\u21C6","\\leftrightarrows",!0);G(U,ve,xe,"\u21DA","\\Lleftarrow",!0);G(U,ve,xe,"\u219E","\\twoheadleftarrow",!0);G(U,ve,xe,"\u21A2","\\leftarrowtail",!0);G(U,ve,xe,"\u21AB","\\looparrowleft",!0);G(U,ve,xe,"\u21CB","\\leftrightharpoons",!0);G(U,ve,xe,"\u21B6","\\curvearrowleft",!0);G(U,ve,xe,"\u21BA","\\circlearrowleft",!0);G(U,ve,xe,"\u21B0","\\Lsh",!0);G(U,ve,xe,"\u21C8","\\upuparrows",!0);G(U,ve,xe,"\u21BF","\\upharpoonleft",!0);G(U,ve,xe,"\u21C3","\\downharpoonleft",!0);G(U,ee,xe,"\u22B6","\\origof",!0);G(U,ee,xe,"\u22B7","\\imageof",!0);G(U,ve,xe,"\u22B8","\\multimap",!0);G(U,ve,xe,"\u21AD","\\leftrightsquigarrow",!0);G(U,ve,xe,"\u21C9","\\rightrightarrows",!0);G(U,ve,xe,"\u21C4","\\rightleftarrows",!0);G(U,ve,xe,"\u21A0","\\twoheadrightarrow",!0);G(U,ve,xe,"\u21A3","\\rightarrowtail",!0);G(U,ve,xe,"\u21AC","\\looparrowright",!0);G(U,ve,xe,"\u21B7","\\curvearrowright",!0);G(U,ve,xe,"\u21BB","\\circlearrowright",!0);G(U,ve,xe,"\u21B1","\\Rsh",!0);G(U,ve,xe,"\u21CA","\\downdownarrows",!0);G(U,ve,xe,"\u21BE","\\upharpoonright",!0);G(U,ve,xe,"\u21C2","\\downharpoonright",!0);G(U,ve,xe,"\u21DD","\\rightsquigarrow",!0);G(U,ve,xe,"\u21DD","\\leadsto");G(U,ve,xe,"\u21DB","\\Rrightarrow",!0);G(U,ve,xe,"\u21BE","\\restriction");G(U,ee,Le,"\u2018","`");G(U,ee,Le,"$","\\$");G(Qe,ee,Le,"$","\\$");G(Qe,ee,Le,"$","\\textdollar");G(U,ee,Le,"%","\\%");G(Qe,ee,Le,"%","\\%");G(U,ee,Le,"_","\\_");G(Qe,ee,Le,"_","\\_");G(Qe,ee,Le,"_","\\textunderscore");G(U,ee,Le,"\u2220","\\angle",!0);G(U,ee,Le,"\u221E","\\infty",!0);G(U,ee,Le,"\u2032","\\prime");G(U,ee,Le,"\u25B3","\\triangle");G(U,ee,Le,"\u0393","\\Gamma",!0);G(U,ee,Le,"\u0394","\\Delta",!0);G(U,ee,Le,"\u0398","\\Theta",!0);G(U,ee,Le,"\u039B","\\Lambda",!0);G(U,ee,Le,"\u039E","\\Xi",!0);G(U,ee,Le,"\u03A0","\\Pi",!0);G(U,ee,Le,"\u03A3","\\Sigma",!0);G(U,ee,Le,"\u03A5","\\Upsilon",!0);G(U,ee,Le,"\u03A6","\\Phi",!0);G(U,ee,Le,"\u03A8","\\Psi",!0);G(U,ee,Le,"\u03A9","\\Omega",!0);G(U,ee,Le,"A","\u0391");G(U,ee,Le,"B","\u0392");G(U,ee,Le,"E","\u0395");G(U,ee,Le,"Z","\u0396");G(U,ee,Le,"H","\u0397");G(U,ee,Le,"I","\u0399");G(U,ee,Le,"K","\u039A");G(U,ee,Le,"M","\u039C");G(U,ee,Le,"N","\u039D");G(U,ee,Le,"O","\u039F");G(U,ee,Le,"P","\u03A1");G(U,ee,Le,"T","\u03A4");G(U,ee,Le,"X","\u03A7");G(U,ee,Le,"\xAC","\\neg",!0);G(U,ee,Le,"\xAC","\\lnot");G(U,ee,Le,"\u22A4","\\top");G(U,ee,Le,"\u22A5","\\bot");G(U,ee,Le,"\u2205","\\emptyset");G(U,ve,Le,"\u2205","\\varnothing");G(U,ee,Ut,"\u03B1","\\alpha",!0);G(U,ee,Ut,"\u03B2","\\beta",!0);G(U,ee,Ut,"\u03B3","\\gamma",!0);G(U,ee,Ut,"\u03B4","\\delta",!0);G(U,ee,Ut,"\u03F5","\\epsilon",!0);G(U,ee,Ut,"\u03B6","\\zeta",!0);G(U,ee,Ut,"\u03B7","\\eta",!0);G(U,ee,Ut,"\u03B8","\\theta",!0);G(U,ee,Ut,"\u03B9","\\iota",!0);G(U,ee,Ut,"\u03BA","\\kappa",!0);G(U,ee,Ut,"\u03BB","\\lambda",!0);G(U,ee,Ut,"\u03BC","\\mu",!0);G(U,ee,Ut,"\u03BD","\\nu",!0);G(U,ee,Ut,"\u03BE","\\xi",!0);G(U,ee,Ut,"\u03BF","\\omicron",!0);G(U,ee,Ut,"\u03C0","\\pi",!0);G(U,ee,Ut,"\u03C1","\\rho",!0);G(U,ee,Ut,"\u03C3","\\sigma",!0);G(U,ee,Ut,"\u03C4","\\tau",!0);G(U,ee,Ut,"\u03C5","\\upsilon",!0);G(U,ee,Ut,"\u03D5","\\phi",!0);G(U,ee,Ut,"\u03C7","\\chi",!0);G(U,ee,Ut,"\u03C8","\\psi",!0);G(U,ee,Ut,"\u03C9","\\omega",!0);G(U,ee,Ut,"\u03B5","\\varepsilon",!0);G(U,ee,Ut,"\u03D1","\\vartheta",!0);G(U,ee,Ut,"\u03D6","\\varpi",!0);G(U,ee,Ut,"\u03F1","\\varrho",!0);G(U,ee,Ut,"\u03C2","\\varsigma",!0);G(U,ee,Ut,"\u03C6","\\varphi",!0);G(U,ee,bt,"\u2217","*",!0);G(U,ee,bt,"+","+");G(U,ee,bt,"\u2212","-",!0);G(U,ee,bt,"\u22C5","\\cdot",!0);G(U,ee,bt,"\u2218","\\circ",!0);G(U,ee,bt,"\xF7","\\div",!0);G(U,ee,bt,"\xB1","\\pm",!0);G(U,ee,bt,"\xD7","\\times",!0);G(U,ee,bt,"\u2229","\\cap",!0);G(U,ee,bt,"\u222A","\\cup",!0);G(U,ee,bt,"\u2216","\\setminus",!0);G(U,ee,bt,"\u2227","\\land");G(U,ee,bt,"\u2228","\\lor");G(U,ee,bt,"\u2227","\\wedge",!0);G(U,ee,bt,"\u2228","\\vee",!0);G(U,ee,Le,"\u221A","\\surd");G(U,ee,js,"\u27E8","\\langle",!0);G(U,ee,js,"\u2223","\\lvert");G(U,ee,js,"\u2225","\\lVert");G(U,ee,Xa,"?","?");G(U,ee,Xa,"!","!");G(U,ee,Xa,"\u27E9","\\rangle",!0);G(U,ee,Xa,"\u2223","\\rvert");G(U,ee,Xa,"\u2225","\\rVert");G(U,ee,xe,"=","=");G(U,ee,xe,":",":");G(U,ee,xe,"\u2248","\\approx",!0);G(U,ee,xe,"\u2245","\\cong",!0);G(U,ee,xe,"\u2265","\\ge");G(U,ee,xe,"\u2265","\\geq",!0);G(U,ee,xe,"\u2190","\\gets");G(U,ee,xe,">","\\gt",!0);G(U,ee,xe,"\u2208","\\in",!0);G(U,ee,xe,"\uE020","\\@not");G(U,ee,xe,"\u2282","\\subset",!0);G(U,ee,xe,"\u2283","\\supset",!0);G(U,ee,xe,"\u2286","\\subseteq",!0);G(U,ee,xe,"\u2287","\\supseteq",!0);G(U,ve,xe,"\u2288","\\nsubseteq",!0);G(U,ve,xe,"\u2289","\\nsupseteq",!0);G(U,ee,xe,"\u22A8","\\models");G(U,ee,xe,"\u2190","\\leftarrow",!0);G(U,ee,xe,"\u2264","\\le");G(U,ee,xe,"\u2264","\\leq",!0);G(U,ee,xe,"<","\\lt",!0);G(U,ee,xe,"\u2192","\\rightarrow",!0);G(U,ee,xe,"\u2192","\\to");G(U,ve,xe,"\u2271","\\ngeq",!0);G(U,ve,xe,"\u2270","\\nleq",!0);G(U,ee,lu,"\xA0","\\ ");G(U,ee,lu,"\xA0","\\space");G(U,ee,lu,"\xA0","\\nobreakspace");G(Qe,ee,lu,"\xA0","\\ ");G(Qe,ee,lu,"\xA0"," ");G(Qe,ee,lu,"\xA0","\\space");G(Qe,ee,lu,"\xA0","\\nobreakspace");G(U,ee,lu,null,"\\nobreak");G(U,ee,lu,null,"\\allowbreak");G(U,ee,b4,",",",");G(U,ee,b4,";",";");G(U,ve,bt,"\u22BC","\\barwedge",!0);G(U,ve,bt,"\u22BB","\\veebar",!0);G(U,ee,bt,"\u2299","\\odot",!0);G(U,ee,bt,"\u2295","\\oplus",!0);G(U,ee,bt,"\u2297","\\otimes",!0);G(U,ee,Le,"\u2202","\\partial",!0);G(U,ee,bt,"\u2298","\\oslash",!0);G(U,ve,bt,"\u229A","\\circledcirc",!0);G(U,ve,bt,"\u22A1","\\boxdot",!0);G(U,ee,bt,"\u25B3","\\bigtriangleup");G(U,ee,bt,"\u25BD","\\bigtriangledown");G(U,ee,bt,"\u2020","\\dagger");G(U,ee,bt,"\u22C4","\\diamond");G(U,ee,bt,"\u22C6","\\star");G(U,ee,bt,"\u25C3","\\triangleleft");G(U,ee,bt,"\u25B9","\\triangleright");G(U,ee,js,"{","\\{");G(Qe,ee,Le,"{","\\{");G(Qe,ee,Le,"{","\\textbraceleft");G(U,ee,Xa,"}","\\}");G(Qe,ee,Le,"}","\\}");G(Qe,ee,Le,"}","\\textbraceright");G(U,ee,js,"{","\\lbrace");G(U,ee,Xa,"}","\\rbrace");G(U,ee,js,"[","\\lbrack",!0);G(Qe,ee,Le,"[","\\lbrack",!0);G(U,ee,Xa,"]","\\rbrack",!0);G(Qe,ee,Le,"]","\\rbrack",!0);G(U,ee,js,"(","\\lparen",!0);G(U,ee,Xa,")","\\rparen",!0);G(Qe,ee,Le,"<","\\textless",!0);G(Qe,ee,Le,">","\\textgreater",!0);G(U,ee,js,"\u230A","\\lfloor",!0);G(U,ee,Xa,"\u230B","\\rfloor",!0);G(U,ee,js,"\u2308","\\lceil",!0);G(U,ee,Xa,"\u2309","\\rceil",!0);G(U,ee,Le,"\\","\\backslash");G(U,ee,Le,"\u2223","|");G(U,ee,Le,"\u2223","\\vert");G(Qe,ee,Le,"|","\\textbar",!0);G(U,ee,Le,"\u2225","\\|");G(U,ee,Le,"\u2225","\\Vert");G(Qe,ee,Le,"\u2225","\\textbardbl");G(Qe,ee,Le,"~","\\textasciitilde");G(Qe,ee,Le,"\\","\\textbackslash");G(Qe,ee,Le,"^","\\textasciicircum");G(U,ee,xe,"\u2191","\\uparrow",!0);G(U,ee,xe,"\u21D1","\\Uparrow",!0);G(U,ee,xe,"\u2193","\\downarrow",!0);G(U,ee,xe,"\u21D3","\\Downarrow",!0);G(U,ee,xe,"\u2195","\\updownarrow",!0);G(U,ee,xe,"\u21D5","\\Updownarrow",!0);G(U,ee,xi,"\u2210","\\coprod");G(U,ee,xi,"\u22C1","\\bigvee");G(U,ee,xi,"\u22C0","\\bigwedge");G(U,ee,xi,"\u2A04","\\biguplus");G(U,ee,xi,"\u22C2","\\bigcap");G(U,ee,xi,"\u22C3","\\bigcup");G(U,ee,xi,"\u222B","\\int");G(U,ee,xi,"\u222B","\\intop");G(U,ee,xi,"\u222C","\\iint");G(U,ee,xi,"\u222D","\\iiint");G(U,ee,xi,"\u220F","\\prod");G(U,ee,xi,"\u2211","\\sum");G(U,ee,xi,"\u2A02","\\bigotimes");G(U,ee,xi,"\u2A01","\\bigoplus");G(U,ee,xi,"\u2A00","\\bigodot");G(U,ee,xi,"\u222E","\\oint");G(U,ee,xi,"\u222F","\\oiint");G(U,ee,xi,"\u2230","\\oiiint");G(U,ee,xi,"\u2A06","\\bigsqcup");G(U,ee,xi,"\u222B","\\smallint");G(Qe,ee,vp,"\u2026","\\textellipsis");G(U,ee,vp,"\u2026","\\mathellipsis");G(Qe,ee,vp,"\u2026","\\ldots",!0);G(U,ee,vp,"\u2026","\\ldots",!0);G(U,ee,vp,"\u22EF","\\@cdots",!0);G(U,ee,vp,"\u22F1","\\ddots",!0);G(U,ee,Le,"\u22EE","\\varvdots");G(U,ee,Pn,"\u02CA","\\acute");G(U,ee,Pn,"\u02CB","\\grave");G(U,ee,Pn,"\xA8","\\ddot");G(U,ee,Pn,"~","\\tilde");G(U,ee,Pn,"\u02C9","\\bar");G(U,ee,Pn,"\u02D8","\\breve");G(U,ee,Pn,"\u02C7","\\check");G(U,ee,Pn,"^","\\hat");G(U,ee,Pn,"\u20D7","\\vec");G(U,ee,Pn,"\u02D9","\\dot");G(U,ee,Pn,"\u02DA","\\mathring");G(U,ee,Ut,"\uE131","\\@imath");G(U,ee,Ut,"\uE237","\\@jmath");G(U,ee,Le,"\u0131","\u0131");G(U,ee,Le,"\u0237","\u0237");G(Qe,ee,Le,"\u0131","\\i",!0);G(Qe,ee,Le,"\u0237","\\j",!0);G(Qe,ee,Le,"\xDF","\\ss",!0);G(Qe,ee,Le,"\xE6","\\ae",!0);G(Qe,ee,Le,"\u0153","\\oe",!0);G(Qe,ee,Le,"\xF8","\\o",!0);G(Qe,ee,Le,"\xC6","\\AE",!0);G(Qe,ee,Le,"\u0152","\\OE",!0);G(Qe,ee,Le,"\xD8","\\O",!0);G(Qe,ee,Pn,"\u02CA","\\'");G(Qe,ee,Pn,"\u02CB","\\`");G(Qe,ee,Pn,"\u02C6","\\^");G(Qe,ee,Pn,"\u02DC","\\~");G(Qe,ee,Pn,"\u02C9","\\=");G(Qe,ee,Pn,"\u02D8","\\u");G(Qe,ee,Pn,"\u02D9","\\.");G(Qe,ee,Pn,"\xB8","\\c");G(Qe,ee,Pn,"\u02DA","\\r");G(Qe,ee,Pn,"\u02C7","\\v");G(Qe,ee,Pn,"\xA8",'\\"');G(Qe,ee,Pn,"\u02DD","\\H");G(Qe,ee,Pn,"\u25EF","\\textcircled");IG={"--":!0,"---":!0,"``":!0,"''":!0};G(Qe,ee,Le,"\u2013","--",!0);G(Qe,ee,Le,"\u2013","\\textendash");G(Qe,ee,Le,"\u2014","---",!0);G(Qe,ee,Le,"\u2014","\\textemdash");G(Qe,ee,Le,"\u2018","`",!0);G(Qe,ee,Le,"\u2018","\\textquoteleft");G(Qe,ee,Le,"\u2019","'",!0);G(Qe,ee,Le,"\u2019","\\textquoteright");G(Qe,ee,Le,"\u201C","``",!0);G(Qe,ee,Le,"\u201C","\\textquotedblleft");G(Qe,ee,Le,"\u201D","''",!0);G(Qe,ee,Le,"\u201D","\\textquotedblright");G(U,ee,Le,"\xB0","\\degree",!0);G(Qe,ee,Le,"\xB0","\\degree");G(Qe,ee,Le,"\xB0","\\textdegree",!0);G(U,ee,Le,"\xA3","\\pounds");G(U,ee,Le,"\xA3","\\mathsterling",!0);G(Qe,ee,Le,"\xA3","\\pounds");G(Qe,ee,Le,"\xA3","\\textsterling",!0);G(U,ve,Le,"\u2720","\\maltese");G(Qe,ve,Le,"\u2720","\\maltese");rG='0123456789/@."';for(e4=0;e40)return ol(a,h,i,r,s.concat(f));if(u){var d,p;if(u==="boldsymbol"){var m=mxe(a,i,r,s,n);d=m.fontName,p=[m.fontClass]}else l?(d=BG[u].fontName,p=[u]):(d=a4(u,r.fontWeight,r.fontShape),p=[u,r.fontWeight,r.fontShape]);if(w4(a,d,i).metrics)return ol(a,d,i,r,s.concat(p));if(IG.hasOwnProperty(a)&&d.slice(0,10)==="Typewriter"){for(var g=[],y=0;y{if(dh(t.classes)!==dh(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},"canCombine"),vxe=o(t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},"sizeElementFromChildren"),ds=o(function(e,r,n,i){var a=new jf(e,r,n,i);return I7(a),a},"makeSpan"),OG=o((t,e,r,n)=>new jf(t,e,r,n),"makeSvgSpan"),xxe=o(function(e,r,n){var i=ds([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=ct(i.height),i.maxFontSize=1,i},"makeLineSpan"),bxe=o(function(e,r,n,i){var a=new iy(e,r,n,i);return I7(a),a},"makeAnchor"),PG=o(function(e){var r=new Xf(e);return I7(r),r},"makeFragment"),wxe=o(function(e,r){return e instanceof Xf?ds([],[e],r):e},"wrapFragment"),Txe=o(function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=ds(["mspace"],[],e),n=Hn(t,e);return r.style.marginRight=ct(n),r},"makeGlue"),a4=o(function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return r==="textbf"&&n==="textit"?a="BoldItalic":r==="textbf"?a="Bold":r==="textit"?a="Italic":a="Regular",i+"-"+a},"retrieveTextFontName"),BG={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},FG={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Cxe=o(function(e,r){var[n,i,a]=FG[e],s=new Jl(n),l=new ll([s],{width:ct(i),height:ct(a),style:"width:"+ct(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=OG(["overlay"],[l],r);return u.height=a,u.style.height=ct(a),u.style.width=ct(i),u},"staticSvg"),Be={fontMap:BG,makeSymbol:ol,mathsym:pxe,makeSpan:ds,makeSvgSpan:OG,makeLineSpan:xxe,makeAnchor:bxe,makeFragment:PG,wrapFragment:wxe,makeVList:kxe,makeOrd:gxe,makeGlue:Exe,staticSvg:Cxe,svgData:FG,tryCombineChars:vxe},Un={number:3,unit:"mu"},Wf={number:4,unit:"mu"},nu={number:5,unit:"mu"},Sxe={mord:{mop:Un,mbin:Wf,mrel:nu,minner:Un},mop:{mord:Un,mop:Un,mrel:nu,minner:Un},mbin:{mord:Wf,mop:Wf,mopen:Wf,minner:Wf},mrel:{mord:nu,mop:nu,mopen:nu,minner:nu},mopen:{},mclose:{mop:Un,mbin:Wf,mrel:nu,minner:Un},mpunct:{mord:Un,mop:Un,mrel:nu,mopen:Un,mclose:Un,mpunct:Un,minner:Un},minner:{mord:Un,mop:Un,mbin:Wf,mrel:nu,mopen:Un,mpunct:Un,minner:Un}},Axe={mord:{mop:Un},mop:{mord:Un,mop:Un},mbin:{},mrel:{},mopen:{},mclose:{mop:Un},mpunct:{},minner:{mop:Un}},zG={},m4={},g4={};o(vt,"defineFunction");o(Kf,"defineFunctionBuilders");y4=o(function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},"normalizeArgument"),ui=o(function(e){return e.type==="ordgroup"?e.body:[e]},"ordargument"),su=Be.makeSpan,_xe=["leftmost","mbin","mopen","mrel","mop","mpunct"],Lxe=["rightmost","mrel","mclose","mpunct"],Dxe={display:Ht.DISPLAY,text:Ht.TEXT,script:Ht.SCRIPT,scriptscript:Ht.SCRIPTSCRIPT},Rxe={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Ri=o(function(e,r,n,i){i===void 0&&(i=[null,null]);for(var a=[],s=0;s{var v=y.classes[0],x=g.classes[0];v==="mbin"&&Vt.contains(Lxe,x)?y.classes[0]="mord":x==="mbin"&&Vt.contains(_xe,v)&&(g.classes[0]="mord")},{node:d},p,m),aG(a,(g,y)=>{var v=E7(y),x=E7(g),b=v&&x?g.hasClass("mtight")?Axe[v][x]:Sxe[v][x]:null;if(b)return Be.makeGlue(b,h)},{node:d},p,m),a},"buildExpression"),aG=o(function t(e,r,n,i,a){i&&e.push(i);for(var s=0;sp=>{e.splice(d+1,0,p),s++})(s)}i&&e.pop()},"traverseNonSpaceNodes"),GG=o(function(e){return e instanceof Xf||e instanceof iy||e instanceof jf&&e.hasClass("enclosing")?e:null},"checkPartialGroup"),Nxe=o(function t(e,r){var n=GG(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},"getOutermostNode"),E7=o(function(e,r){return e?(r&&(e=Nxe(e,r)),Rxe[e.classes[0]]||null):null},"getTypeOfDomTree"),sy=o(function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return su(r.concat(n))},"makeNullDelimiter"),Cr=o(function(e,r,n){if(!e)return su();if(m4[e.type]){var i=m4[e.type](e,r);if(n&&r.size!==n.size){i=su(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new nt("Got group of unknown type: '"+e.type+"'")},"buildGroup");o(s4,"buildHTMLUnbreakable");o(C7,"buildHTML");o($G,"newDocumentFragment");ps=class{static{o(this,"MathNode")}constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=dh(this.classes));for(var n=0;n0&&(e+=' class ="'+Vt.escape(dh(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}},qf=class{static{o(this,"TextNode")}constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Vt.escape(this.toText())}toText(){return this.text}},S7=class{static{o(this,"SpaceNode")}constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character="\u200A":e>=.1666&&e<=.1667?this.character="\u2009":e>=.2222&&e<=.2223?this.character="\u2005":e>=.2777&&e<=.2778?this.character="\u2005\u200A":e>=-.05556&&e<=-.05555?this.character="\u200A\u2063":e>=-.1667&&e<=-.1666?this.character="\u2009\u2063":e>=-.2223&&e<=-.2222?this.character="\u205F\u2063":e>=-.2778&&e<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ct(this.width)),e}toMarkup(){return this.character?""+this.character+" ":' '}toText(){return this.character?this.character:" "}},et={MathNode:ps,TextNode:qf,SpaceNode:S7,newDocumentFragment:$G},_o=o(function(e,r,n){return wn[r][e]&&wn[r][e].replace&&e.charCodeAt(0)!==55349&&!(IG.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=wn[r][e].replace),new et.TextNode(e)},"makeText"),O7=o(function(e){return e.length===1?e[0]:new et.MathNode("mrow",e)},"makeRow"),P7=o(function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(Vt.contains(["\\imath","\\jmath"],a))return null;wn[i][a]&&wn[i][a].replace&&(a=wn[i][a].replace);var s=Be.fontMap[n].fontName;return M7(a,s,i)?Be.fontMap[n].variant:null},"getVariant"),gs=o(function(e,r,n){if(e.length===1){var i=fn(e[0],r);return n&&i instanceof ps&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,l=0;l0&&(d.text=d.text.slice(0,1)+"\u0338"+d.text.slice(1),a.pop())}}}a.push(u),s=u}return a},"buildExpression"),ph=o(function(e,r,n){return O7(gs(e,r,n))},"buildExpressionRow"),fn=o(function(e,r){if(!e)return new et.MathNode("mrow");if(g4[e.type]){var n=g4[e.type](e,r);return n}else throw new nt("Got group of unknown type: '"+e.type+"'")},"buildGroup");o(sG,"buildMathML");VG=o(function(e){return new d4({style:e.displayMode?Ht.DISPLAY:Ht.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},"optionsFromSettings"),UG=o(function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Be.makeSpan(n,[e])}return e},"displayWrap"),Mxe=o(function(e,r,n){var i=VG(n),a;if(n.output==="mathml")return sG(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=C7(e,i);a=Be.makeSpan(["katex"],[s])}else{var l=sG(e,r,i,n.displayMode,!1),u=C7(e,i);a=Be.makeSpan(["katex"],[l,u])}return UG(a,n)},"buildTree"),Ixe=o(function(e,r,n){var i=VG(n),a=C7(e,i),s=Be.makeSpan(["katex"],[a]);return UG(s,n)},"buildHTMLTree"),Oxe={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Pxe=o(function(e){var r=new et.MathNode("mo",[new et.TextNode(Oxe[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},"mathMLnode"),Bxe={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Fxe=o(function(e){return e.type==="ordgroup"?e.body.length:1},"groupLength"),zxe=o(function(e,r){function n(){var l=4e5,u=e.label.slice(1);if(Vt.contains(["widehat","widecheck","widetilde","utilde"],u)){var h=e,f=Fxe(h.base),d,p,m;if(f>5)u==="widehat"||u==="widecheck"?(d=420,l=2364,m=.42,p=u+"4"):(d=312,l=2340,m=.34,p="tilde4");else{var g=[1,1,2,2,3,3][f];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],m=[0,.24,.3,.3,.36,.42][g],p=u+g):(l=[0,600,1033,2339,2340][g],d=[0,260,286,306,312][g],m=[0,.26,.286,.3,.306,.34][g],p="tilde"+g)}var y=new Jl(p),v=new ll([y],{width:"100%",height:ct(m),viewBox:"0 0 "+l+" "+d,preserveAspectRatio:"none"});return{span:Be.makeSvgSpan([],[v],r),minWidth:0,height:m}}else{var x=[],b=Bxe[u],[w,S,T]=b,E=T/1e3,_=w.length,A,L;if(_===1){var M=b[3];A=["hide-tail"],L=[M]}else if(_===2)A=["halfarrow-left","halfarrow-right"],L=["xMinYMin","xMaxYMin"];else if(_===3)A=["brace-left","brace-center","brace-right"],L=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
- `+_+" children.");for(var N=0;N<_;N++){var k=new Jl(w[N]),I=new ll([k],{width:"400em",height:ct(E),viewBox:"0 0 "+l+" "+T,preserveAspectRatio:L[N]+" slice"}),C=Be.makeSvgSpan([A[N]],[I],r);if(_===1)return{span:C,minWidth:S,height:E};C.style.height=ct(E),x.push(C)}return{span:Be.makeSpan(["stretchy"],x,r),minWidth:S,height:E}}}o(n,"buildSvgSpan_");var{span:i,minWidth:a,height:s}=n();return i.height=s,i.style.height=ct(s),a>0&&(i.style.minWidth=ct(a)),i},"svgSpan"),Gxe=o(function(e,r,n,i,a){var s,l=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Be.makeSpan(["stretchy",r],[],a),r==="fbox"){var u=a.color&&a.getColor();u&&(s.style.borderColor=u)}}else{var h=[];/^[bx]cancel$/.test(r)&&h.push(new ay({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&h.push(new ay({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var f=new ll(h,{width:"100%",height:ct(l)});s=Be.makeSvgSpan([],[f],a)}return s.height=l,s.style.height=ct(l),s},"encloseSpan"),ou={encloseSpan:Gxe,mathMLnode:Pxe,svgSpan:zxe};o(ir,"assertNodeType");o(B7,"assertSymbolNodeType");o(T4,"checkSymbolNodeType");F7=o((t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=ir(t.base,"accent"),r=n.base,t.base=r,i=uxe(Cr(t,e)),t.base=n):(n=ir(t,"accent"),r=n.base);var a=Cr(r,e.havingCrampedStyle()),s=n.isShifty&&Vt.isCharacterBox(r),l=0;if(s){var u=Vt.getBaseElem(r),h=Cr(u,e.havingCrampedStyle());l=tG(h).skew}var f=n.label==="\\c",d=f?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),p;if(n.isStretchy)p=ou.svgSpan(n,e),p=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+ct(2*l)+")",marginLeft:ct(2*l)}:void 0}]},e);else{var m,g;n.label==="\\vec"?(m=Be.staticSvg("vec",e),g=Be.svgData.vec[1]):(m=Be.makeOrd({mode:n.mode,text:n.label},e,"textord"),m=tG(m),m.italic=0,g=m.width,f&&(d+=m.depth)),p=Be.makeSpan(["accent-body"],[m]);var y=n.label==="\\textcircled";y&&(p.classes.push("accent-full"),d=a.height);var v=l;y||(v-=g/2),p.style.left=ct(v),n.label==="\\textcircled"&&(p.style.top=".2em"),p=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:p}]},e)}var x=Be.makeSpan(["mord","accent"],[p],e);return i?(i.children[0]=x,i.height=Math.max(x.height,i.height),i.classes[0]="mord",i):x},"htmlBuilder$a"),HG=o((t,e)=>{var r=t.isStretchy?ou.mathMLnode(t.label):new et.MathNode("mo",[_o(t.label,t.mode)]),n=new et.MathNode("mover",[fn(t.base,e),r]);return n.setAttribute("accent","true"),n},"mathmlBuilder$9"),$xe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));vt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:o((t,e)=>{var r=y4(e[0]),n=!$xe.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},"handler"),htmlBuilder:F7,mathmlBuilder:HG});vt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:o((t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},"handler"),htmlBuilder:F7,mathmlBuilder:HG});vt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},"handler"),htmlBuilder:o((t,e)=>{var r=Cr(t.base,e),n=ou.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,a=Be.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return Be.makeSpan(["mord","accentunder"],[a],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=ou.mathMLnode(t.label),n=new et.MathNode("munder",[fn(t.base,e),r]);return n.setAttribute("accentunder","true"),n},"mathmlBuilder")});o4=o(t=>{var e=new et.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e},"paddedNode");vt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Be.wrapFragment(Cr(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=Be.wrapFragment(Cr(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var l=ou.svgSpan(t,e),u=-e.fontMetrics().axisHeight+.5*l.height,h=-e.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(h-=i.depth);var f;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*l.height+.111;f=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:l,shift:u},{type:"elem",elem:s,shift:d}]},e)}else f=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:l,shift:u}]},e);return f.children[0].children[0].children[1].classes.push("svg-align"),Be.makeSpan(["mrel","x-arrow"],[f],e)},mathmlBuilder(t,e){var r=ou.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=o4(fn(t.body,e));if(t.below){var a=o4(fn(t.below,e));n=new et.MathNode("munderover",[r,a,i])}else n=new et.MathNode("mover",[r,i])}else if(t.below){var s=o4(fn(t.below,e));n=new et.MathNode("munder",[r,s])}else n=o4(),n=new et.MathNode("mover",[r,n]);return n}});Vxe=Be.makeSpan;o(YG,"htmlBuilder$9");o(WG,"mathmlBuilder$8");vt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:ui(i),isCharacterBox:Vt.isCharacterBox(i)}},htmlBuilder:YG,mathmlBuilder:WG});k4=o(t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"},"binrelClass");vt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:k4(e[0]),body:ui(e[1]),isCharacterBox:Vt.isCharacterBox(e[1])}}});vt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=k4(i):s="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:ui(i)},u={type:"supsub",mode:a.mode,base:l,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[u],isCharacterBox:Vt.isCharacterBox(u)}},htmlBuilder:YG,mathmlBuilder:WG});vt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:k4(e[0]),body:ui(e[0])}},htmlBuilder(t,e){var r=Ri(t.body,e,!0),n=Be.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=gs(t.body,e),n=new et.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});Uxe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},oG=o(()=>({type:"styling",body:[],mode:"math",style:"display"}),"newCell"),lG=o(t=>t.type==="textord"&&t.text==="@","isStartOfArrow"),Hxe=o((t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e,"isLabelEnd");o(Yxe,"cdArrow");o(Wxe,"parseCD");vt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Be.wrapFragment(Cr(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=ct(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new et.MathNode("mrow",[fn(t.label,e)]);return r=new et.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new et.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});vt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Be.wrapFragment(Cr(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new et.MathNode("mrow",[fn(t.fragment,e)])}});vt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=ir(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new nt("\\@char with invalid code point "+a);return u<=65535?h=String.fromCharCode(u):(u-=65536,h=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:r.mode,text:h}}});qG=o((t,e)=>{var r=Ri(t.body,e.withColor(t.color),!1);return Be.makeFragment(r)},"htmlBuilder$8"),XG=o((t,e)=>{var r=gs(t.body,e.withColor(t.color)),n=new et.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n},"mathmlBuilder$7");vt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=ir(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:ui(i)}},htmlBuilder:qG,mathmlBuilder:XG});vt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=ir(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:qG,mathmlBuilder:XG});vt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&ir(i,"size").value}},htmlBuilder(t,e){var r=Be.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=ct(Hn(t.size,e)))),r},mathmlBuilder(t,e){var r=new et.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",ct(Hn(t.size,e)))),r}});A7={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},jG=o(t=>{var e=t.text;if(/^(?:[\\{}$^_]|EOF)$/.test(e))throw new nt("Expected a control sequence",t);return e},"checkControlSequence"),qxe=o(t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},"getRHS"),KG=o((t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)},"letCommand");vt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(A7[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=A7[n.text]),ir(e.parseFunction(),"internal");throw new nt("Invalid token after macro prefix",n)}});vt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$^_]|EOF)$/.test(i))throw new nt("Expected a control sequence",n);for(var a=0,s,l=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),l[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new nt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new nt('Argument number "'+n.text+'" out of order');a++,l.push([])}else{if(n.text==="EOF")throw new nt("Expected a macro definition");l[a].push(n.text)}var{tokens:u}=e.gullet.consumeArg();return s&&u.unshift(s),(r==="\\edef"||r==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:l},r===A7[r]),{type:"internal",mode:e.mode}}});vt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=jG(e.gullet.popToken());e.gullet.consumeSpaces();var i=qxe(e);return KG(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});vt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=jG(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return KG(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});ey=o(function(e,r,n){var i=wn.math[e]&&wn.math[e].replace,a=M7(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},"getMetrics"),z7=o(function(e,r,n,i){var a=n.havingBaseStyle(r),s=Be.makeSpan(i.concat(a.sizingClasses(n)),[e],n),l=a.sizeMultiplier/n.sizeMultiplier;return s.height*=l,s.depth*=l,s.maxFontSize=a.sizeMultiplier,s},"styleWrap"),QG=o(function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ct(a),e.height-=a,e.depth+=a},"centerSpan"),Xxe=o(function(e,r,n,i,a,s){var l=Be.makeSymbol(e,"Main-Regular",a,i),u=z7(l,r,i,s);return n&&QG(u,i,r),u},"makeSmallDelim"),jxe=o(function(e,r,n,i){return Be.makeSymbol(e,"Size"+r+"-Regular",n,i)},"mathrmSize"),ZG=o(function(e,r,n,i,a,s){var l=jxe(e,r,a,i),u=z7(Be.makeSpan(["delimsizing","size"+r],[l],i),Ht.TEXT,i,s);return n&&QG(u,i,Ht.TEXT),u},"makeLargeDelim"),h7=o(function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Be.makeSpan(["delimsizinginner",i],[Be.makeSpan([],[Be.makeSymbol(e,r,n)])]);return{type:"elem",elem:a}},"makeGlyphSpan"),f7=o(function(e,r,n){var i=Zl["Size4-Regular"][e.charCodeAt(0)]?Zl["Size4-Regular"][e.charCodeAt(0)][4]:Zl["Size1-Regular"][e.charCodeAt(0)][4],a=new Jl("inner",nxe(e,Math.round(1e3*r))),s=new ll([a],{width:ct(i),height:ct(r),style:"width:"+ct(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),l=Be.makeSvgSpan([],[s],n);return l.height=r,l.style.height=ct(r),l.style.width=ct(i),{type:"elem",elem:l}},"makeInner"),_7=.008,l4={type:"kern",size:-1*_7},Kxe=["|","\\lvert","\\rvert","\\vert"],Qxe=["\\|","\\lVert","\\rVert","\\Vert"],JG=o(function(e,r,n,i,a,s){var l,u,h,f,d="",p=0;l=h=f=e,u=null;var m="Size1-Regular";e==="\\uparrow"?h=f="\u23D0":e==="\\Uparrow"?h=f="\u2016":e==="\\downarrow"?l=h="\u23D0":e==="\\Downarrow"?l=h="\u2016":e==="\\updownarrow"?(l="\\uparrow",h="\u23D0",f="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",h="\u2016",f="\\Downarrow"):Vt.contains(Kxe,e)?(h="\u2223",d="vert",p=333):Vt.contains(Qxe,e)?(h="\u2225",d="doublevert",p=556):e==="["||e==="\\lbrack"?(l="\u23A1",h="\u23A2",f="\u23A3",m="Size4-Regular",d="lbrack",p=667):e==="]"||e==="\\rbrack"?(l="\u23A4",h="\u23A5",f="\u23A6",m="Size4-Regular",d="rbrack",p=667):e==="\\lfloor"||e==="\u230A"?(h=l="\u23A2",f="\u23A3",m="Size4-Regular",d="lfloor",p=667):e==="\\lceil"||e==="\u2308"?(l="\u23A1",h=f="\u23A2",m="Size4-Regular",d="lceil",p=667):e==="\\rfloor"||e==="\u230B"?(h=l="\u23A5",f="\u23A6",m="Size4-Regular",d="rfloor",p=667):e==="\\rceil"||e==="\u2309"?(l="\u23A4",h=f="\u23A5",m="Size4-Regular",d="rceil",p=667):e==="("||e==="\\lparen"?(l="\u239B",h="\u239C",f="\u239D",m="Size4-Regular",d="lparen",p=875):e===")"||e==="\\rparen"?(l="\u239E",h="\u239F",f="\u23A0",m="Size4-Regular",d="rparen",p=875):e==="\\{"||e==="\\lbrace"?(l="\u23A7",u="\u23A8",f="\u23A9",h="\u23AA",m="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="\u23AB",u="\u23AC",f="\u23AD",h="\u23AA",m="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(l="\u23A7",f="\u23A9",h="\u23AA",m="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(l="\u23AB",f="\u23AD",h="\u23AA",m="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(l="\u23A7",f="\u23AD",h="\u23AA",m="Size4-Regular"):(e==="\\rmoustache"||e==="\u23B1")&&(l="\u23AB",f="\u23A9",h="\u23AA",m="Size4-Regular");var g=ey(l,m,a),y=g.height+g.depth,v=ey(h,m,a),x=v.height+v.depth,b=ey(f,m,a),w=b.height+b.depth,S=0,T=1;if(u!==null){var E=ey(u,m,a);S=E.height+E.depth,T=2}var _=y+w+S,A=Math.max(0,Math.ceil((r-_)/(T*x))),L=_+A*T*x,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var N=L/2-M,k=[];if(d.length>0){var I=L-y-w,C=Math.round(L*1e3),O=ixe(d,Math.round(I*1e3)),D=new Jl(d,O),P=(p/1e3).toFixed(3)+"em",F=(C/1e3).toFixed(3)+"em",B=new ll([D],{width:P,height:F,viewBox:"0 0 "+p+" "+C}),$=Be.makeSvgSpan([],[B],i);$.height=C/1e3,$.style.width=P,$.style.height=F,k.push({type:"elem",elem:$})}else{if(k.push(h7(f,m,a)),k.push(l4),u===null){var z=L-y-w+2*_7;k.push(f7(h,z,i))}else{var Y=(L-y-w-S)/2+2*_7;k.push(f7(h,Y,i)),k.push(l4),k.push(h7(u,m,a)),k.push(l4),k.push(f7(h,Y,i))}k.push(l4),k.push(h7(l,m,a))}var Q=i.havingBaseStyle(Ht.TEXT),X=Be.makeVList({positionType:"bottom",positionData:N,children:k},Q);return z7(Be.makeSpan(["delimsizing","mult"],[X],Q),Ht.TEXT,i,s)},"makeStackedDelim"),d7=80,p7=.08,m7=o(function(e,r,n,i,a){var s=rxe(e,i,n),l=new Jl(e,s),u=new ll([l],{width:"400em",height:ct(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Be.makeSvgSpan(["hide-tail"],[u],a)},"sqrtSvg"),Zxe=o(function(e,r){var n=r.havingBaseSizing(),i=n$("\\surd",e*n.sizeMultiplier,r$,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),l,u=0,h=0,f=0,d;return i.type==="small"?(f=1e3+1e3*s+d7,e<1?a=1:e<1.4&&(a=.7),u=(1+s+p7)/a,h=(1+s)/a,l=m7("sqrtMain",u,f,s,r),l.style.minWidth="0.853em",d=.833/a):i.type==="large"?(f=(1e3+d7)*ty[i.size],h=(ty[i.size]+s)/a,u=(ty[i.size]+s+p7)/a,l=m7("sqrtSize"+i.size,u,f,s,r),l.style.minWidth="1.02em",d=1/a):(u=e+s+p7,h=e+s,f=Math.floor(1e3*e+s)+d7,l=m7("sqrtTall",u,f,s,r),l.style.minWidth="0.742em",d=1.056),l.height=h,l.style.height=ct(u),{span:l,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},"makeSqrtImage"),e$=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],Jxe=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],t$=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ty=[0,1.2,1.8,2.4,3],ebe=o(function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),Vt.contains(e$,e)||Vt.contains(t$,e))return ZG(e,r,!1,n,i,a);if(Vt.contains(Jxe,e))return JG(e,ty[r],!1,n,i,a);throw new nt("Illegal delimiter: '"+e+"'")},"makeSizedDelim"),tbe=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],rbe=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"stack"}],r$=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],nbe=o(function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},"delimTypeToFont"),n$=o(function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return n[s]}return n[n.length-1]},"traverseSequence"),i$=o(function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle");var l;Vt.contains(t$,e)?l=tbe:Vt.contains(e$,e)?l=r$:l=rbe;var u=n$(e,r,l,i);return u.type==="small"?Xxe(e,u.style,n,i,a,s):u.type==="large"?ZG(e,u.size,n,i,a,s):JG(e,r,n,i,a,s)},"makeCustomSizedDelim"),ibe=o(function(e,r,n,i,a,s){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,h=5/i.fontMetrics().ptPerEm,f=Math.max(r-l,n+l),d=Math.max(f/500*u,2*f-h);return i$(e,d,!0,i,a,s)},"makeLeftRightDelim"),au={sqrtImage:Zxe,sizedDelim:ebe,sizeToMaxHeight:ty,customSizedDelim:i$,leftRightDelim:ibe},cG={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},abe=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];o(E4,"checkDelimiter");vt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:o((t,e)=>{var r=E4(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:cG[t.funcName].size,mclass:cG[t.funcName].mclass,delim:r.text}},"handler"),htmlBuilder:o((t,e)=>t.delim==="."?Be.makeSpan([t.mclass]):au.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),"htmlBuilder"),mathmlBuilder:o(t=>{var e=[];t.delim!=="."&&e.push(_o(t.delim,t.mode));var r=new et.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=ct(au.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r},"mathmlBuilder")});o(uG,"assertParsed");vt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new nt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:E4(e[0],t).text,color:r}},"handler")});vt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=E4(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=ir(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},"handler"),htmlBuilder:o((t,e)=>{uG(t);for(var r=Ri(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{uG(t);var r=gs(t.body,e);if(t.left!=="."){var n=new et.MathNode("mo",[_o(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new et.MathNode("mo",[_o(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return O7(r)},"mathmlBuilder")});vt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=E4(e[0],t);if(!t.parser.leftrightDepth)throw new nt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},"handler"),htmlBuilder:o((t,e)=>{var r;if(t.delim===".")r=sy(e,[]);else{r=au.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?_o("|","text"):_o(t.delim,t.mode),n=new et.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n},"mathmlBuilder")});G7=o((t,e)=>{var r=Be.wrapFragment(Cr(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s=0,l=Vt.isCharacterBox(t.body);if(n==="sout")a=Be.makeSpan(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var u=Hn({number:.6,unit:"pt"},e),h=Hn({number:.35,unit:"ex"},e),f=e.havingBaseSizing();i=i/f.sizeMultiplier;var d=r.height+r.depth+u+h;r.style.paddingLeft=ct(d/2+u);var p=Math.floor(1e3*d*i),m=exe(p),g=new ll([new Jl("phase",m)],{width:"400em",height:ct(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});a=Be.makeSvgSpan(["hide-tail"],[g],e),a.style.height=ct(d),s=r.depth+u+h}else{/cancel/.test(n)?l||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var y=0,v=0,x=0;/box/.test(n)?(x=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),y=e.fontMetrics().fboxsep+(n==="colorbox"?0:x),v=y):n==="angl"?(x=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),y=4*x,v=Math.max(0,.25-r.depth)):(y=l?.2:0,v=y),a=ou.encloseSpan(r,n,y,v,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=ct(x)):n==="angl"&&x!==.049&&(a.style.borderTopWidth=ct(x),a.style.borderRightWidth=ct(x)),s=r.depth+v,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]},e);else{var w=/cancel|phase/.test(n)?["svg-align"]:[];b=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:w}]},e)}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!l?Be.makeSpan(["mord","cancel-lap"],[b],e):Be.makeSpan(["mord"],[b],e)},"htmlBuilder$7"),$7=o((t,e)=>{var r=0,n=new et.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[fn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n},"mathmlBuilder$6");vt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=ir(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:G7,mathmlBuilder:$7});vt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=ir(e[0],"color-token").color,s=ir(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:l}},htmlBuilder:G7,mathmlBuilder:$7});vt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});vt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:G7,mathmlBuilder:$7});vt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});a$={};o(ec,"defineEnvironment");s$={};o(le,"defineMacro");o(hG,"getHLines");C4=o(t=>{var e=t.parser.settings;if(!e.displayMode)throw new nt("{"+t.envName+"} can be used only in display mode.")},"validateAmsEnvironmentContext");o(V7,"getAutoTag");o(mh,"parseArray");o(U7,"dCellStyle");tc=o(function(e,r){var n,i,a=e.body.length,s=e.hLinesBeforeRow,l=0,u=new Array(a),h=[],f=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),d=1/r.fontMetrics().ptPerEm,p=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var m=r.havingStyle(Ht.SCRIPT).sizeMultiplier;p=.2778*(m/r.sizeMultiplier)}var g=e.colSeparationType==="CD"?Hn({number:3,unit:"ex"},r):12*d,y=3*d,v=e.arraystretch*g,x=.7*v,b=.3*v,w=0;function S(ke){for(var Ie=0;Ie0&&(w+=.25),h.push({pos:w,isDashed:ke[Ie]})}for(o(S,"setHLinePos"),S(s[0]),n=0;n0&&(N+=b,_ke))for(n=0;n=l)){var J=void 0;(i>0||e.hskipBeforeAndAfter)&&(J=Vt.deflt(Y.pregap,p),J!==0&&(O=Be.makeSpan(["arraycolsep"],[]),O.style.width=ct(J),C.push(O)));var Z=[];for(n=0;n 0){for(var se=Be.makeLineSpan("hline",r,f),ce=Be.makeLineSpan("hdashline",r,f),ue=[{type:"elem",elem:u,shift:0}];h.length>0;){var te=h.pop(),De=te.pos-k;te.isDashed?ue.push({type:"elem",elem:ce,shift:De}):ue.push({type:"elem",elem:se,shift:De})}u=Be.makeVList({positionType:"individualShift",children:ue},r)}if(P.length===0)return Be.makeSpan(["mord"],[u],r);var oe=Be.makeVList({positionType:"individualShift",children:P},r);return oe=Be.makeSpan(["tag"],[oe],r),Be.makeFragment([u,oe])},"htmlBuilder"),sbe={c:"center ",l:"left ",r:"right "},rc=o(function(e,r){for(var n=[],i=new et.MathNode("mtd",[],["mtr-glue"]),a=new et.MathNode("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,y="",v=!1,x=0,b=g.length;g[0].type==="separator"&&(p+="top ",x=1),g[g.length-1].type==="separator"&&(p+="bottom ",b-=1);for(var w=x;w0?"left ":"",p+=A[A.length-1].length>0?"right ":"";for(var L=1;L-1?"alignat":"align",a=e.envName==="split",s=mh(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:V7(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),l,u=0,h={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var f="",d=0;d0&&m&&(v=1),n[g]={type:"align",align:y,pregap:v,postgap:0}}return s.colSeparationType=m?"align":"alignat",s},"alignedHandler");ec({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=T4(e[0]),n=r?[e[0]]:ir(e[0],"ordgroup").body,i=n.map(function(s){var l=B7(s),u=l.text;if("lcr".indexOf(u)!==-1)return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new nt("Unknown column alignment: "+u,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return mh(t.parser,a,U7(t.envName))},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,"lcr".indexOf(r)===-1)throw new nt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=mh(t.parser,n,U7(t.envName)),s=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=mh(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=T4(e[0]),n=r?[e[0]]:ir(e[0],"ordgroup").body,i=n.map(function(s){var l=B7(s),u=l.text;if("lc".indexOf(u)!==-1)return{type:"align",align:u};throw new nt("Unknown column alignment: "+u,s)});if(i.length>1)throw new nt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=mh(t.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new nt("{subarray} can contain only one column");return a},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=mh(t.parser,e,U7(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:o$,htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Vt.contains(["gather","gather*"],t.envName)&&C4(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:V7(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return mh(t.parser,e,"display")},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:o$,htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){C4(t);var e={autoTag:V7(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return mh(t.parser,e,"display")},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["CD"],props:{numArgs:0},handler(t){return C4(t),Wxe(t.parser)},htmlBuilder:tc,mathmlBuilder:rc});le("\\nonumber","\\gdef\\@eqnsw{0}");le("\\notag","\\nonumber");vt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new nt(t.funcName+" valid only within array environment")}});fG=a$;vt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new nt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return Cr(t.body,n)},"htmlBuilder$5"),c$=o((t,e)=>{var r=t.font,n=e.withFont(r);return fn(t.body,n)},"mathmlBuilder$4"),dG={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};vt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=y4(e[0]),a=n;return a in dG&&(a=dG[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},"handler"),htmlBuilder:l$,mathmlBuilder:c$});vt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r}=t,n=e[0],i=Vt.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:k4(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}},"handler")});vt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:o((t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i),l="math"+n.slice(1);return{type:"font",mode:a,font:l,body:{type:"ordgroup",mode:r.mode,body:s}}},"handler"),htmlBuilder:l$,mathmlBuilder:c$});u$=o((t,e)=>{var r=e;return t==="display"?r=r.id>=Ht.SCRIPT.id?r.text():Ht.DISPLAY:t==="text"&&r.size===Ht.DISPLAY.size?r=Ht.TEXT:t==="script"?r=Ht.SCRIPT:t==="scriptscript"&&(r=Ht.SCRIPTSCRIPT),r},"adjustStyle"),H7=o((t,e)=>{var r=u$(t.size,e.style),n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=Cr(t.numer,a,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,u=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*p:g=7*p,y=e.fontMetrics().denom1):(d>0?(m=e.fontMetrics().num2,g=p):(m=e.fontMetrics().num3,g=3*p),y=e.fontMetrics().denom2);var v;if(f){var b=e.fontMetrics().axisHeight;m-s.depth-(b+.5*d){var r=new et.MathNode("mfrac",[fn(t.numer,e),fn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Hn(t.barSize,e);r.setAttribute("linethickness",ct(n))}var i=u$(t.size,e.style);if(i.size!==e.style.size){r=new et.MathNode("mstyle",[r]);var a=i.size===Ht.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var s=[];if(t.leftDelim!=null){var l=new et.MathNode("mo",[new et.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}if(s.push(r),t.rightDelim!=null){var u=new et.MathNode("mo",[new et.TextNode(t.rightDelim.replace("\\",""))]);u.setAttribute("fence","true"),s.push(u)}return O7(s)}return r},"mathmlBuilder$3");vt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,l=null,u=null,h="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,l="(",u=")";break;case"\\\\bracefrac":s=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":s=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":h="display";break;case"\\tfrac":case"\\tbinom":h="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:s,leftDelim:l,rightDelim:u,size:h,barSize:null}},"handler"),htmlBuilder:H7,mathmlBuilder:Y7});vt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}},"handler")});vt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});pG=["display","text","script","scriptscript"],mG=o(function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r},"delimFromValue");vt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=y4(e[0]),s=a.type==="atom"&&a.family==="open"?mG(a.text):null,l=y4(e[1]),u=l.type==="atom"&&l.family==="close"?mG(l.text):null,h=ir(e[2],"size"),f,d=null;h.isBlank?f=!0:(d=h.value,f=d.number>0);var p="auto",m=e[3];if(m.type==="ordgroup"){if(m.body.length>0){var g=ir(m.body[0],"textord");p=pG[Number(g.text)]}}else m=ir(m,"textord"),p=pG[Number(m.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:f,barSize:d,leftDelim:s,rightDelim:u,size:p}},htmlBuilder:H7,mathmlBuilder:Y7});vt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:ir(e[0],"size").value,token:i}}});vt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=z2e(ir(e[1],"infix").size),s=e[2],l=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},"handler"),htmlBuilder:H7,mathmlBuilder:Y7});h$=o((t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Cr(t.sup,e.havingStyle(r.sup()),e):Cr(t.sub,e.havingStyle(r.sub()),e),i=ir(t.base,"horizBrace")):i=ir(t,"horizBrace");var a=Cr(i.base,e.havingBaseStyle(Ht.DISPLAY)),s=ou.svgSpan(i,e),l;if(i.isOver?(l=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=Be.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),n){var u=Be.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e);i.isOver?l=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:n}]},e):l=Be.makeVList({positionType:"bottom",positionData:u.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:u}]},e)}return Be.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e)},"htmlBuilder$3"),obe=o((t,e)=>{var r=ou.mathMLnode(t.label);return new et.MathNode(t.isOver?"mover":"munder",[fn(t.base,e),r])},"mathmlBuilder$2");vt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:h$,mathmlBuilder:obe});vt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[1],i=ir(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:ui(n)}:r.formatUnsupportedCmd("\\href")},"handler"),htmlBuilder:o((t,e)=>{var r=Ri(t.body,e,!1);return Be.makeAnchor(t.href,[],r,e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=ph(t.body,e);return r instanceof ps||(r=new ps("mrow",[r])),r.setAttribute("href",t.href),r},"mathmlBuilder")});vt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=ir(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=ir(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(n){case"\\htmlClass":u.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":u.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":u.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var h=a.split(","),f=0;f{var r=Ri(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Be.makeSpan(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},"htmlBuilder"),mathmlBuilder:o((t,e)=>ph(t.body,e),"mathmlBuilder")});vt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:ui(e[0]),mathml:ui(e[1])}},"handler"),htmlBuilder:o((t,e)=>{var r=Ri(t.html,e,!1);return Be.makeFragment(r)},"htmlBuilder"),mathmlBuilder:o((t,e)=>ph(t.mathml,e),"mathmlBuilder")});g7=o(function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new nt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!DG(n))throw new nt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n},"sizeData");vt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:o((t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},l="";if(r[0])for(var u=ir(r[0],"raw").string,h=u.split(","),f=0;f{var r=Hn(t.height,e),n=0;t.totalheight.number>0&&(n=Hn(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Hn(t.width,e));var a={height:ct(r+n)};i>0&&(a.width=ct(i)),n>0&&(a.verticalAlign=ct(-n));var s=new T7(t.src,t.alt,a);return s.height=r,s.depth=n,s},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=new et.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=Hn(t.height,e),i=0;if(t.totalheight.number>0&&(i=Hn(t.totalheight,e)-n,r.setAttribute("valign",ct(-i))),r.setAttribute("height",ct(n+i)),t.width.number>0){var a=Hn(t.width,e);r.setAttribute("width",ct(a))}return r.setAttribute("src",t.src),r},"mathmlBuilder")});vt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=ir(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return Be.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=Hn(t.dimension,e);return new et.SpaceNode(r)}});vt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},"handler"),htmlBuilder:o((t,e)=>{var r;t.alignment==="clap"?(r=Be.makeSpan([],[Cr(t.body,e)]),r=Be.makeSpan(["inner"],[r],e)):r=Be.makeSpan(["inner"],[Cr(t.body,e)]);var n=Be.makeSpan(["fix"],[]),i=Be.makeSpan([t.alignment],[r,n],e),a=Be.makeSpan(["strut"]);return a.style.height=ct(i.height+i.depth),i.depth&&(a.style.verticalAlign=ct(-i.depth)),i.children.unshift(a),i=Be.makeSpan(["thinbox"],[i],e),Be.makeSpan(["mord","vbox"],[i],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=new et.MathNode("mpadded",[fn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r},"mathmlBuilder")});vt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}});vt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new nt("Mismatched "+t.funcName)}});gG=o((t,e)=>{switch(e.style.size){case Ht.DISPLAY.size:return t.display;case Ht.TEXT.size:return t.text;case Ht.SCRIPT.size:return t.script;case Ht.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}},"chooseMathStyle");vt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:o((t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:ui(e[0]),text:ui(e[1]),script:ui(e[2]),scriptscript:ui(e[3])}},"handler"),htmlBuilder:o((t,e)=>{var r=gG(t,e),n=Ri(r,e,!1);return Be.makeFragment(n)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=gG(t,e);return ph(r,e)},"mathmlBuilder")});f$=o((t,e,r,n,i,a,s)=>{t=Be.makeSpan([],[t]);var l=r&&Vt.isCharacterBox(r),u,h;if(e){var f=Cr(e,n.havingStyle(i.sup()),n);h={elem:f,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-f.depth)}}if(r){var d=Cr(r,n.havingStyle(i.sub()),n);u={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var p;if(h&&u){var m=n.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+t.depth+s;p=Be.makeVList({positionType:"bottom",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:ct(-a)},{type:"kern",size:u.kern},{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:ct(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(u){var g=t.height-s;p=Be.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:ct(-a)},{type:"kern",size:u.kern},{type:"elem",elem:t}]},n)}else if(h){var y=t.depth+s;p=Be.makeVList({positionType:"bottom",positionData:y,children:[{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:ct(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var v=[p];if(u&&a!==0&&!l){var x=Be.makeSpan(["mspace"],[],n);x.style.marginRight=ct(a),v.unshift(x)}return Be.makeSpan(["mop","op-limits"],v,n)},"assembleSupSub"),d$=["\\smallint"],xp=o((t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=ir(t.base,"op"),i=!0):a=ir(t,"op");var s=e.style,l=!1;s.size===Ht.DISPLAY.size&&a.symbol&&!Vt.contains(d$,a.name)&&(l=!0);var u;if(a.symbol){var h=l?"Size2-Regular":"Size1-Regular",f="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(f=a.name.slice(1),a.name=f==="oiint"?"\\iint":"\\iiint"),u=Be.makeSymbol(a.name,h,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),f.length>0){var d=u.italic,p=Be.staticSvg(f+"Size"+(l?"2":"1"),e);u=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:p,shift:l?.08:0}]},e),a.name="\\"+f,u.classes.unshift("mop"),u.italic=d}}else if(a.body){var m=Ri(a.body,e,!0);m.length===1&&m[0]instanceof ms?(u=m[0],u.classes[0]="mop"):u=Be.makeSpan(["mop"],m,e)}else{for(var g=[],y=1;y{var r;if(t.symbol)r=new ps("mo",[_o(t.name,t.mode)]),Vt.contains(d$,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new ps("mo",gs(t.body,e));else{r=new ps("mi",[new qf(t.name.slice(1))]);var n=new ps("mo",[_o("\u2061","text")]);t.parentIsSupSub?r=new ps("mrow",[r,n]):r=$G([r,n])}return r},"mathmlBuilder$1"),lbe={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};vt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=lbe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},"handler"),htmlBuilder:xp,mathmlBuilder:oy});vt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ui(n)}},"handler"),htmlBuilder:xp,mathmlBuilder:oy});cbe={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};vt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:xp,mathmlBuilder:oy});vt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:xp,mathmlBuilder:oy});vt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=cbe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:xp,mathmlBuilder:oy});p$=o((t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=ir(t.base,"operatorname"),i=!0):a=ir(t,"operatorname");var s;if(a.body.length>0){for(var l=a.body.map(d=>{var p=d.text;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),u=Ri(l,e.withFont("mathrm"),!0),h=0;h{for(var r=gs(t.body,e.withFont("mathrm")),n=!0,i=0;if.toText()).join("");r=[new et.TextNode(l)]}var u=new et.MathNode("mi",r);u.setAttribute("mathvariant","normal");var h=new et.MathNode("mo",[_o("\u2061","text")]);return t.parentIsSupSub?new et.MathNode("mrow",[u,h]):et.newDocumentFragment([u,h])},"mathmlBuilder");vt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:ui(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},"handler"),htmlBuilder:p$,mathmlBuilder:ube});le("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Kf({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Be.makeFragment(Ri(t.body,e,!1)):Be.makeSpan(["mord"],Ri(t.body,e,!0),e)},mathmlBuilder(t,e){return ph(t.body,e,!0)}});vt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=Cr(t.body,e.havingCrampedStyle()),n=Be.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return Be.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new et.MathNode("mo",[new et.TextNode("\u203E")]);r.setAttribute("stretchy","true");var n=new et.MathNode("mover",[fn(t.body,e),r]);return n.setAttribute("accent","true"),n}});vt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:ui(n)}},"handler"),htmlBuilder:o((t,e)=>{var r=Ri(t.body,e.withPhantom(),!1);return Be.makeFragment(r)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=gs(t.body,e);return new et.MathNode("mphantom",r)},"mathmlBuilder")});vt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},"handler"),htmlBuilder:o((t,e)=>{var r=Be.makeSpan([],[Cr(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=gs(ui(t.body),e),n=new et.MathNode("mphantom",r),i=new et.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i},"mathmlBuilder")});vt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},"handler"),htmlBuilder:o((t,e)=>{var r=Be.makeSpan(["inner"],[Cr(t.body,e.withPhantom())]),n=Be.makeSpan(["fix"],[]);return Be.makeSpan(["mord","rlap"],[r,n],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=gs(ui(t.body),e),n=new et.MathNode("mphantom",r),i=new et.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i},"mathmlBuilder")});vt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=ir(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Cr(t.body,e),n=Hn(t.dy,e);return Be.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new et.MathNode("mpadded",[fn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});vt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});vt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=ir(e[0],"size"),s=ir(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&ir(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Be.makeSpan(["mord","rule"],[],e),n=Hn(t.width,e),i=Hn(t.height,e),a=t.shift?Hn(t.shift,e):0;return r.style.borderRightWidth=ct(n),r.style.borderTopWidth=ct(i),r.style.bottom=ct(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Hn(t.width,e),n=Hn(t.height,e),i=t.shift?Hn(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new et.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",ct(r)),s.setAttribute("height",ct(n));var l=new et.MathNode("mpadded",[s]);return i>=0?l.setAttribute("height",ct(i)):(l.setAttribute("height",ct(i)),l.setAttribute("depth",ct(-i))),l.setAttribute("voffset",ct(i)),l}});o(m$,"sizingGroup");yG=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],hbe=o((t,e)=>{var r=e.havingSize(t.size);return m$(t.body,r,e)},"htmlBuilder");vt({type:"sizing",names:yG,props:{numArgs:0,allowedInText:!0},handler:o((t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:yG.indexOf(n)+1,body:a}},"handler"),htmlBuilder:hbe,mathmlBuilder:o((t,e)=>{var r=e.havingSize(t.size),n=gs(t.body,r),i=new et.MathNode("mstyle",n);return i.setAttribute("mathsize",ct(r.sizeMultiplier)),i},"mathmlBuilder")});vt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:o((t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&ir(r[0],"ordgroup");if(s)for(var l="",u=0;u{var r=Be.makeSpan([],[Cr(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new et.MathNode("mpadded",[fn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r},"mathmlBuilder")});vt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=Cr(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Be.wrapFragment(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var p=u.height-r.height-s-h;r.style.paddingLeft=ct(f);var m=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+p)},{type:"elem",elem:u},{type:"kern",size:h}]},e);if(t.index){var g=e.havingStyle(Ht.SCRIPTSCRIPT),y=Cr(t.index,g,e),v=.6*(m.height-m.depth),x=Be.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:y}]},e),b=Be.makeSpan(["root"],[x]);return Be.makeSpan(["mord","sqrt"],[b,m],e)}else return Be.makeSpan(["mord","sqrt"],[m],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new et.MathNode("mroot",[fn(r,e),fn(n,e)]):new et.MathNode("msqrt",[fn(r,e)])}});vG={display:Ht.DISPLAY,text:Ht.TEXT,script:Ht.SCRIPT,scriptscript:Ht.SCRIPTSCRIPT};vt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=vG[t.style],n=e.havingStyle(r).withFont("");return m$(t.body,n,e)},mathmlBuilder(t,e){var r=vG[t.style],n=e.havingStyle(r),i=gs(t.body,n),a=new et.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=s[t.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});fbe=o(function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Ht.DISPLAY.size||n.alwaysHandleSupSub);return i?xp:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Ht.DISPLAY.size||n.limits);return a?p$:null}else{if(n.type==="accent")return Vt.isCharacterBox(n.base)?F7:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?h$:null}else return null}else return null},"htmlBuilderDelegate");Kf({type:"supsub",htmlBuilder(t,e){var r=fbe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=Cr(n,e),l,u,h=e.fontMetrics(),f=0,d=0,p=n&&Vt.isCharacterBox(n);if(i){var m=e.havingStyle(e.style.sup());l=Cr(i,m,e),p||(f=s.height-m.fontMetrics().supDrop*m.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());u=Cr(a,g,e),p||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var y;e.style===Ht.DISPLAY?y=h.sup1:e.style.cramped?y=h.sup3:y=h.sup2;var v=e.sizeMultiplier,x=ct(.5/h.ptPerEm/v),b=null;if(u){var w=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(s instanceof ms||w)&&(b=ct(-s.italic))}var S;if(l&&u){f=Math.max(f,y,l.depth+.25*h.xHeight),d=Math.max(d,h.sub2);var T=h.defaultRuleThickness,E=4*T;if(f-l.depth-(u.height-d)0&&(f+=_,d-=_)}var A=[{type:"elem",elem:u,shift:d,marginRight:x,marginLeft:b},{type:"elem",elem:l,shift:-f,marginRight:x}];S=Be.makeVList({positionType:"individualShift",children:A},e)}else if(u){d=Math.max(d,h.sub1,u.height-.8*h.xHeight);var L=[{type:"elem",elem:u,marginLeft:b,marginRight:x}];S=Be.makeVList({positionType:"shift",positionData:d,children:L},e)}else if(l)f=Math.max(f,y,l.depth+.25*h.xHeight),S=Be.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:l,marginRight:x}]},e);else throw new Error("supsub must have either sup or sub.");var M=E7(s,"right")||"mord";return Be.makeSpan([M],[s,Be.makeSpan(["msupsub"],[S])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[fn(t.base,e)];t.sub&&a.push(fn(t.sub,e)),t.sup&&a.push(fn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var h=t.base;h&&h.type==="op"&&h.limits&&e.style===Ht.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(e.style===Ht.DISPLAY||h.limits)?s="munderover":s="msubsup"}else{var u=t.base;u&&u.type==="op"&&u.limits&&(e.style===Ht.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||e.style===Ht.DISPLAY)?s="munder":s="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Ht.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Ht.DISPLAY)?s="mover":s="msup"}return new et.MathNode(s,a)}});Kf({type:"atom",htmlBuilder(t,e){return Be.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new et.MathNode("mo",[_o(t.text,t.mode)]);if(t.family==="bin"){var n=P7(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});g$={mi:"italic",mn:"normal",mtext:"normal"};Kf({type:"mathord",htmlBuilder(t,e){return Be.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new et.MathNode("mi",[_o(t.text,t.mode,e)]),n=P7(t,e)||"italic";return n!==g$[r.type]&&r.setAttribute("mathvariant",n),r}});Kf({type:"textord",htmlBuilder(t,e){return Be.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=_o(t.text,t.mode,e),n=P7(t,e)||"normal",i;return t.mode==="text"?i=new et.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new et.MathNode("mn",[r]):t.text==="\\prime"?i=new et.MathNode("mo",[r]):i=new et.MathNode("mi",[r]),n!==g$[i.type]&&i.setAttribute("mathvariant",n),i}});y7={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},v7={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Kf({type:"spacing",htmlBuilder(t,e){if(v7.hasOwnProperty(t.text)){var r=v7[t.text].className||"";if(t.mode==="text"){var n=Be.makeOrd(t,e,"textord");return n.classes.push(r),n}else return Be.makeSpan(["mspace",r],[Be.mathsym(t.text,t.mode,e)],e)}else{if(y7.hasOwnProperty(t.text))return Be.makeSpan(["mspace",y7[t.text]],[],e);throw new nt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(v7.hasOwnProperty(t.text))r=new et.MathNode("mtext",[new et.TextNode("\xA0")]);else{if(y7.hasOwnProperty(t.text))return new et.MathNode("mspace");throw new nt('Unknown type of space "'+t.text+'"')}return r}});xG=o(()=>{var t=new et.MathNode("mtd",[]);return t.setAttribute("width","50%"),t},"pad");Kf({type:"tag",mathmlBuilder(t,e){var r=new et.MathNode("mtable",[new et.MathNode("mtr",[xG(),new et.MathNode("mtd",[ph(t.body,e)]),xG(),new et.MathNode("mtd",[ph(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});bG={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},wG={"\\textbf":"textbf","\\textmd":"textmd"},dbe={"\\textit":"textit","\\textup":"textup"},TG=o((t,e)=>{var r=t.font;if(r){if(bG[r])return e.withTextFontFamily(bG[r]);if(wG[r])return e.withTextFontWeight(wG[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(dbe[r])},"optionsWithFont");vt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:ui(i),font:n}},htmlBuilder(t,e){var r=TG(t,e),n=Ri(t.body,r,!0);return Be.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=TG(t,e);return ph(t.body,r)}});vt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Cr(t.body,e),n=Be.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Be.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return Be.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new et.MathNode("mo",[new et.TextNode("\u203E")]);r.setAttribute("stretchy","true");var n=new et.MathNode("munder",[fn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});vt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Cr(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Be.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new et.MathNode("mpadded",[fn(t.body,e)],["vcenter"])}});vt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new nt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=kG(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"\u2423":"\xA0"),"makeVerb"),fh=zG,y$=`[ \r
- ]`,pbe="\\\\[a-zA-Z@]+",mbe="\\\\[^\uD800-\uDFFF]",gbe="("+pbe+")"+y$+"*",ybe=`\\\\(
+-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}},"tallDelim"),ed=class{static{o(this,"DocumentFragment")}constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Jt.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;rr.toText(),"toText");return this.children.map(e).join("")}},jl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Z4={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},lz={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};o(Abe,"setFontMetrics");o(P7,"getCharacterMetrics");h7={};o(_be,"getGlobalMetrics");Dbe=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],cz=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],uz=o(function(e,r){return r.size<2?e:Dbe[e-1][r.size-1]},"sizeAtStyle"),f3=class t{static{o(this,"Options")}constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||t.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=cz[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new t(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:uz(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:cz[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=uz(t.BASESIZE,e);return this.size===r&&this.textSize===t.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==t.BASESIZE?["sizing","reset-size"+this.size,"size"+t.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=_be(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};f3.BASESIZE=6;E7={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Lbe={ex:!0,em:!0,mu:!0},zz=o(function(e){return typeof e!="string"&&(e=e.unit),e in E7||e in Lbe||e==="ex"},"validUnit"),ti=o(function(e,r){var n;if(e.unit in E7)n=E7[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new gt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},"calculateSize"),kt=o(function(e){return+e.toFixed(4)+"em"},"makeEm"),fh=o(function(e){return e.filter(r=>r).join(" ")},"createClass"),Gz=o(function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},"initNode"),Vz=o(function(e){var r=document.createElement(e);r.className=fh(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var a=0;a";for(var s=0;s",r},"toMarkup"),td=class{static{o(this,"Span")}constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Gz.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Jt.contains(this.classes,e)}toNode(){return Vz.call(this,"span")}toMarkup(){return Uz.call(this,"span")}},Vy=class{static{o(this,"Anchor")}constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Gz.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Jt.contains(this.classes,e)}toNode(){return Vz.call(this,"a")}toMarkup(){return Uz.call(this,"a")}},S7=class{static{o(this,"Img")}constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Jt.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e=' ",e}},Rbe={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},Ts=class{static{o(this,"SymbolNode")}constructor(e,r,n,i,a,s,l,u){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=r||0,this.depth=n||0,this.italic=i||0,this.skew=a||0,this.width=s||0,this.classes=l||[],this.style=u||{},this.maxFontSize=0;var h=gbe(this.text.charCodeAt(0));h&&this.classes.push(h+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Rbe[this.text])}hasClass(e){return Jt.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),r=null;this.italic>0&&(r=document.createElement("span"),r.style.marginRight=kt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=fh(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Jt.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+Jt.escape(n)+'"');var a=Jt.escape(this.text);return e?(r+=">",r+=a,r+=" ",r):a}},ll=class{static{o(this,"SvgNode")}constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i";for(var n=0;n",e}},Kl=class{static{o(this,"PathNode")}constructor(e,r){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=r}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"path");return this.alternate?r.setAttribute("d",this.alternate):r.setAttribute("d",oz[this.pathName]),r}toMarkup(){return this.alternate?' ':' '}},Uy=class{static{o(this,"LineNode")}constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" ",e}};o(hz,"assertSymbolDomNode");o(Nbe,"assertSpan");Mbe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ibe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},An={math:{},text:{}};o(G,"defineSymbol");U="math",it="text",ee="main",ke="ams",Vn="accent-token",It="bin",Za="close",p0="inner",er="mathord",ki="op-token",js="open",x3="punct",Ee="rel",uu="spacing",Le="textord";G(U,ee,Ee,"\u2261","\\equiv",!0);G(U,ee,Ee,"\u227A","\\prec",!0);G(U,ee,Ee,"\u227B","\\succ",!0);G(U,ee,Ee,"\u223C","\\sim",!0);G(U,ee,Ee,"\u22A5","\\perp");G(U,ee,Ee,"\u2AAF","\\preceq",!0);G(U,ee,Ee,"\u2AB0","\\succeq",!0);G(U,ee,Ee,"\u2243","\\simeq",!0);G(U,ee,Ee,"\u2223","\\mid",!0);G(U,ee,Ee,"\u226A","\\ll",!0);G(U,ee,Ee,"\u226B","\\gg",!0);G(U,ee,Ee,"\u224D","\\asymp",!0);G(U,ee,Ee,"\u2225","\\parallel");G(U,ee,Ee,"\u22C8","\\bowtie",!0);G(U,ee,Ee,"\u2323","\\smile",!0);G(U,ee,Ee,"\u2291","\\sqsubseteq",!0);G(U,ee,Ee,"\u2292","\\sqsupseteq",!0);G(U,ee,Ee,"\u2250","\\doteq",!0);G(U,ee,Ee,"\u2322","\\frown",!0);G(U,ee,Ee,"\u220B","\\ni",!0);G(U,ee,Ee,"\u221D","\\propto",!0);G(U,ee,Ee,"\u22A2","\\vdash",!0);G(U,ee,Ee,"\u22A3","\\dashv",!0);G(U,ee,Ee,"\u220B","\\owns");G(U,ee,x3,".","\\ldotp");G(U,ee,x3,"\u22C5","\\cdotp");G(U,ee,Le,"#","\\#");G(it,ee,Le,"#","\\#");G(U,ee,Le,"&","\\&");G(it,ee,Le,"&","\\&");G(U,ee,Le,"\u2135","\\aleph",!0);G(U,ee,Le,"\u2200","\\forall",!0);G(U,ee,Le,"\u210F","\\hbar",!0);G(U,ee,Le,"\u2203","\\exists",!0);G(U,ee,Le,"\u2207","\\nabla",!0);G(U,ee,Le,"\u266D","\\flat",!0);G(U,ee,Le,"\u2113","\\ell",!0);G(U,ee,Le,"\u266E","\\natural",!0);G(U,ee,Le,"\u2663","\\clubsuit",!0);G(U,ee,Le,"\u2118","\\wp",!0);G(U,ee,Le,"\u266F","\\sharp",!0);G(U,ee,Le,"\u2662","\\diamondsuit",!0);G(U,ee,Le,"\u211C","\\Re",!0);G(U,ee,Le,"\u2661","\\heartsuit",!0);G(U,ee,Le,"\u2111","\\Im",!0);G(U,ee,Le,"\u2660","\\spadesuit",!0);G(U,ee,Le,"\xA7","\\S",!0);G(it,ee,Le,"\xA7","\\S");G(U,ee,Le,"\xB6","\\P",!0);G(it,ee,Le,"\xB6","\\P");G(U,ee,Le,"\u2020","\\dag");G(it,ee,Le,"\u2020","\\dag");G(it,ee,Le,"\u2020","\\textdagger");G(U,ee,Le,"\u2021","\\ddag");G(it,ee,Le,"\u2021","\\ddag");G(it,ee,Le,"\u2021","\\textdaggerdbl");G(U,ee,Za,"\u23B1","\\rmoustache",!0);G(U,ee,js,"\u23B0","\\lmoustache",!0);G(U,ee,Za,"\u27EF","\\rgroup",!0);G(U,ee,js,"\u27EE","\\lgroup",!0);G(U,ee,It,"\u2213","\\mp",!0);G(U,ee,It,"\u2296","\\ominus",!0);G(U,ee,It,"\u228E","\\uplus",!0);G(U,ee,It,"\u2293","\\sqcap",!0);G(U,ee,It,"\u2217","\\ast");G(U,ee,It,"\u2294","\\sqcup",!0);G(U,ee,It,"\u25EF","\\bigcirc",!0);G(U,ee,It,"\u2219","\\bullet",!0);G(U,ee,It,"\u2021","\\ddagger");G(U,ee,It,"\u2240","\\wr",!0);G(U,ee,It,"\u2A3F","\\amalg");G(U,ee,It,"&","\\And");G(U,ee,Ee,"\u27F5","\\longleftarrow",!0);G(U,ee,Ee,"\u21D0","\\Leftarrow",!0);G(U,ee,Ee,"\u27F8","\\Longleftarrow",!0);G(U,ee,Ee,"\u27F6","\\longrightarrow",!0);G(U,ee,Ee,"\u21D2","\\Rightarrow",!0);G(U,ee,Ee,"\u27F9","\\Longrightarrow",!0);G(U,ee,Ee,"\u2194","\\leftrightarrow",!0);G(U,ee,Ee,"\u27F7","\\longleftrightarrow",!0);G(U,ee,Ee,"\u21D4","\\Leftrightarrow",!0);G(U,ee,Ee,"\u27FA","\\Longleftrightarrow",!0);G(U,ee,Ee,"\u21A6","\\mapsto",!0);G(U,ee,Ee,"\u27FC","\\longmapsto",!0);G(U,ee,Ee,"\u2197","\\nearrow",!0);G(U,ee,Ee,"\u21A9","\\hookleftarrow",!0);G(U,ee,Ee,"\u21AA","\\hookrightarrow",!0);G(U,ee,Ee,"\u2198","\\searrow",!0);G(U,ee,Ee,"\u21BC","\\leftharpoonup",!0);G(U,ee,Ee,"\u21C0","\\rightharpoonup",!0);G(U,ee,Ee,"\u2199","\\swarrow",!0);G(U,ee,Ee,"\u21BD","\\leftharpoondown",!0);G(U,ee,Ee,"\u21C1","\\rightharpoondown",!0);G(U,ee,Ee,"\u2196","\\nwarrow",!0);G(U,ee,Ee,"\u21CC","\\rightleftharpoons",!0);G(U,ke,Ee,"\u226E","\\nless",!0);G(U,ke,Ee,"\uE010","\\@nleqslant");G(U,ke,Ee,"\uE011","\\@nleqq");G(U,ke,Ee,"\u2A87","\\lneq",!0);G(U,ke,Ee,"\u2268","\\lneqq",!0);G(U,ke,Ee,"\uE00C","\\@lvertneqq");G(U,ke,Ee,"\u22E6","\\lnsim",!0);G(U,ke,Ee,"\u2A89","\\lnapprox",!0);G(U,ke,Ee,"\u2280","\\nprec",!0);G(U,ke,Ee,"\u22E0","\\npreceq",!0);G(U,ke,Ee,"\u22E8","\\precnsim",!0);G(U,ke,Ee,"\u2AB9","\\precnapprox",!0);G(U,ke,Ee,"\u2241","\\nsim",!0);G(U,ke,Ee,"\uE006","\\@nshortmid");G(U,ke,Ee,"\u2224","\\nmid",!0);G(U,ke,Ee,"\u22AC","\\nvdash",!0);G(U,ke,Ee,"\u22AD","\\nvDash",!0);G(U,ke,Ee,"\u22EA","\\ntriangleleft");G(U,ke,Ee,"\u22EC","\\ntrianglelefteq",!0);G(U,ke,Ee,"\u228A","\\subsetneq",!0);G(U,ke,Ee,"\uE01A","\\@varsubsetneq");G(U,ke,Ee,"\u2ACB","\\subsetneqq",!0);G(U,ke,Ee,"\uE017","\\@varsubsetneqq");G(U,ke,Ee,"\u226F","\\ngtr",!0);G(U,ke,Ee,"\uE00F","\\@ngeqslant");G(U,ke,Ee,"\uE00E","\\@ngeqq");G(U,ke,Ee,"\u2A88","\\gneq",!0);G(U,ke,Ee,"\u2269","\\gneqq",!0);G(U,ke,Ee,"\uE00D","\\@gvertneqq");G(U,ke,Ee,"\u22E7","\\gnsim",!0);G(U,ke,Ee,"\u2A8A","\\gnapprox",!0);G(U,ke,Ee,"\u2281","\\nsucc",!0);G(U,ke,Ee,"\u22E1","\\nsucceq",!0);G(U,ke,Ee,"\u22E9","\\succnsim",!0);G(U,ke,Ee,"\u2ABA","\\succnapprox",!0);G(U,ke,Ee,"\u2246","\\ncong",!0);G(U,ke,Ee,"\uE007","\\@nshortparallel");G(U,ke,Ee,"\u2226","\\nparallel",!0);G(U,ke,Ee,"\u22AF","\\nVDash",!0);G(U,ke,Ee,"\u22EB","\\ntriangleright");G(U,ke,Ee,"\u22ED","\\ntrianglerighteq",!0);G(U,ke,Ee,"\uE018","\\@nsupseteqq");G(U,ke,Ee,"\u228B","\\supsetneq",!0);G(U,ke,Ee,"\uE01B","\\@varsupsetneq");G(U,ke,Ee,"\u2ACC","\\supsetneqq",!0);G(U,ke,Ee,"\uE019","\\@varsupsetneqq");G(U,ke,Ee,"\u22AE","\\nVdash",!0);G(U,ke,Ee,"\u2AB5","\\precneqq",!0);G(U,ke,Ee,"\u2AB6","\\succneqq",!0);G(U,ke,Ee,"\uE016","\\@nsubseteqq");G(U,ke,It,"\u22B4","\\unlhd");G(U,ke,It,"\u22B5","\\unrhd");G(U,ke,Ee,"\u219A","\\nleftarrow",!0);G(U,ke,Ee,"\u219B","\\nrightarrow",!0);G(U,ke,Ee,"\u21CD","\\nLeftarrow",!0);G(U,ke,Ee,"\u21CF","\\nRightarrow",!0);G(U,ke,Ee,"\u21AE","\\nleftrightarrow",!0);G(U,ke,Ee,"\u21CE","\\nLeftrightarrow",!0);G(U,ke,Ee,"\u25B3","\\vartriangle");G(U,ke,Le,"\u210F","\\hslash");G(U,ke,Le,"\u25BD","\\triangledown");G(U,ke,Le,"\u25CA","\\lozenge");G(U,ke,Le,"\u24C8","\\circledS");G(U,ke,Le,"\xAE","\\circledR");G(it,ke,Le,"\xAE","\\circledR");G(U,ke,Le,"\u2221","\\measuredangle",!0);G(U,ke,Le,"\u2204","\\nexists");G(U,ke,Le,"\u2127","\\mho");G(U,ke,Le,"\u2132","\\Finv",!0);G(U,ke,Le,"\u2141","\\Game",!0);G(U,ke,Le,"\u2035","\\backprime");G(U,ke,Le,"\u25B2","\\blacktriangle");G(U,ke,Le,"\u25BC","\\blacktriangledown");G(U,ke,Le,"\u25A0","\\blacksquare");G(U,ke,Le,"\u29EB","\\blacklozenge");G(U,ke,Le,"\u2605","\\bigstar");G(U,ke,Le,"\u2222","\\sphericalangle",!0);G(U,ke,Le,"\u2201","\\complement",!0);G(U,ke,Le,"\xF0","\\eth",!0);G(it,ee,Le,"\xF0","\xF0");G(U,ke,Le,"\u2571","\\diagup");G(U,ke,Le,"\u2572","\\diagdown");G(U,ke,Le,"\u25A1","\\square");G(U,ke,Le,"\u25A1","\\Box");G(U,ke,Le,"\u25CA","\\Diamond");G(U,ke,Le,"\xA5","\\yen",!0);G(it,ke,Le,"\xA5","\\yen",!0);G(U,ke,Le,"\u2713","\\checkmark",!0);G(it,ke,Le,"\u2713","\\checkmark");G(U,ke,Le,"\u2136","\\beth",!0);G(U,ke,Le,"\u2138","\\daleth",!0);G(U,ke,Le,"\u2137","\\gimel",!0);G(U,ke,Le,"\u03DD","\\digamma",!0);G(U,ke,Le,"\u03F0","\\varkappa");G(U,ke,js,"\u250C","\\@ulcorner",!0);G(U,ke,Za,"\u2510","\\@urcorner",!0);G(U,ke,js,"\u2514","\\@llcorner",!0);G(U,ke,Za,"\u2518","\\@lrcorner",!0);G(U,ke,Ee,"\u2266","\\leqq",!0);G(U,ke,Ee,"\u2A7D","\\leqslant",!0);G(U,ke,Ee,"\u2A95","\\eqslantless",!0);G(U,ke,Ee,"\u2272","\\lesssim",!0);G(U,ke,Ee,"\u2A85","\\lessapprox",!0);G(U,ke,Ee,"\u224A","\\approxeq",!0);G(U,ke,It,"\u22D6","\\lessdot");G(U,ke,Ee,"\u22D8","\\lll",!0);G(U,ke,Ee,"\u2276","\\lessgtr",!0);G(U,ke,Ee,"\u22DA","\\lesseqgtr",!0);G(U,ke,Ee,"\u2A8B","\\lesseqqgtr",!0);G(U,ke,Ee,"\u2251","\\doteqdot");G(U,ke,Ee,"\u2253","\\risingdotseq",!0);G(U,ke,Ee,"\u2252","\\fallingdotseq",!0);G(U,ke,Ee,"\u223D","\\backsim",!0);G(U,ke,Ee,"\u22CD","\\backsimeq",!0);G(U,ke,Ee,"\u2AC5","\\subseteqq",!0);G(U,ke,Ee,"\u22D0","\\Subset",!0);G(U,ke,Ee,"\u228F","\\sqsubset",!0);G(U,ke,Ee,"\u227C","\\preccurlyeq",!0);G(U,ke,Ee,"\u22DE","\\curlyeqprec",!0);G(U,ke,Ee,"\u227E","\\precsim",!0);G(U,ke,Ee,"\u2AB7","\\precapprox",!0);G(U,ke,Ee,"\u22B2","\\vartriangleleft");G(U,ke,Ee,"\u22B4","\\trianglelefteq");G(U,ke,Ee,"\u22A8","\\vDash",!0);G(U,ke,Ee,"\u22AA","\\Vvdash",!0);G(U,ke,Ee,"\u2323","\\smallsmile");G(U,ke,Ee,"\u2322","\\smallfrown");G(U,ke,Ee,"\u224F","\\bumpeq",!0);G(U,ke,Ee,"\u224E","\\Bumpeq",!0);G(U,ke,Ee,"\u2267","\\geqq",!0);G(U,ke,Ee,"\u2A7E","\\geqslant",!0);G(U,ke,Ee,"\u2A96","\\eqslantgtr",!0);G(U,ke,Ee,"\u2273","\\gtrsim",!0);G(U,ke,Ee,"\u2A86","\\gtrapprox",!0);G(U,ke,It,"\u22D7","\\gtrdot");G(U,ke,Ee,"\u22D9","\\ggg",!0);G(U,ke,Ee,"\u2277","\\gtrless",!0);G(U,ke,Ee,"\u22DB","\\gtreqless",!0);G(U,ke,Ee,"\u2A8C","\\gtreqqless",!0);G(U,ke,Ee,"\u2256","\\eqcirc",!0);G(U,ke,Ee,"\u2257","\\circeq",!0);G(U,ke,Ee,"\u225C","\\triangleq",!0);G(U,ke,Ee,"\u223C","\\thicksim");G(U,ke,Ee,"\u2248","\\thickapprox");G(U,ke,Ee,"\u2AC6","\\supseteqq",!0);G(U,ke,Ee,"\u22D1","\\Supset",!0);G(U,ke,Ee,"\u2290","\\sqsupset",!0);G(U,ke,Ee,"\u227D","\\succcurlyeq",!0);G(U,ke,Ee,"\u22DF","\\curlyeqsucc",!0);G(U,ke,Ee,"\u227F","\\succsim",!0);G(U,ke,Ee,"\u2AB8","\\succapprox",!0);G(U,ke,Ee,"\u22B3","\\vartriangleright");G(U,ke,Ee,"\u22B5","\\trianglerighteq");G(U,ke,Ee,"\u22A9","\\Vdash",!0);G(U,ke,Ee,"\u2223","\\shortmid");G(U,ke,Ee,"\u2225","\\shortparallel");G(U,ke,Ee,"\u226C","\\between",!0);G(U,ke,Ee,"\u22D4","\\pitchfork",!0);G(U,ke,Ee,"\u221D","\\varpropto");G(U,ke,Ee,"\u25C0","\\blacktriangleleft");G(U,ke,Ee,"\u2234","\\therefore",!0);G(U,ke,Ee,"\u220D","\\backepsilon");G(U,ke,Ee,"\u25B6","\\blacktriangleright");G(U,ke,Ee,"\u2235","\\because",!0);G(U,ke,Ee,"\u22D8","\\llless");G(U,ke,Ee,"\u22D9","\\gggtr");G(U,ke,It,"\u22B2","\\lhd");G(U,ke,It,"\u22B3","\\rhd");G(U,ke,Ee,"\u2242","\\eqsim",!0);G(U,ee,Ee,"\u22C8","\\Join");G(U,ke,Ee,"\u2251","\\Doteq",!0);G(U,ke,It,"\u2214","\\dotplus",!0);G(U,ke,It,"\u2216","\\smallsetminus");G(U,ke,It,"\u22D2","\\Cap",!0);G(U,ke,It,"\u22D3","\\Cup",!0);G(U,ke,It,"\u2A5E","\\doublebarwedge",!0);G(U,ke,It,"\u229F","\\boxminus",!0);G(U,ke,It,"\u229E","\\boxplus",!0);G(U,ke,It,"\u22C7","\\divideontimes",!0);G(U,ke,It,"\u22C9","\\ltimes",!0);G(U,ke,It,"\u22CA","\\rtimes",!0);G(U,ke,It,"\u22CB","\\leftthreetimes",!0);G(U,ke,It,"\u22CC","\\rightthreetimes",!0);G(U,ke,It,"\u22CF","\\curlywedge",!0);G(U,ke,It,"\u22CE","\\curlyvee",!0);G(U,ke,It,"\u229D","\\circleddash",!0);G(U,ke,It,"\u229B","\\circledast",!0);G(U,ke,It,"\u22C5","\\centerdot");G(U,ke,It,"\u22BA","\\intercal",!0);G(U,ke,It,"\u22D2","\\doublecap");G(U,ke,It,"\u22D3","\\doublecup");G(U,ke,It,"\u22A0","\\boxtimes",!0);G(U,ke,Ee,"\u21E2","\\dashrightarrow",!0);G(U,ke,Ee,"\u21E0","\\dashleftarrow",!0);G(U,ke,Ee,"\u21C7","\\leftleftarrows",!0);G(U,ke,Ee,"\u21C6","\\leftrightarrows",!0);G(U,ke,Ee,"\u21DA","\\Lleftarrow",!0);G(U,ke,Ee,"\u219E","\\twoheadleftarrow",!0);G(U,ke,Ee,"\u21A2","\\leftarrowtail",!0);G(U,ke,Ee,"\u21AB","\\looparrowleft",!0);G(U,ke,Ee,"\u21CB","\\leftrightharpoons",!0);G(U,ke,Ee,"\u21B6","\\curvearrowleft",!0);G(U,ke,Ee,"\u21BA","\\circlearrowleft",!0);G(U,ke,Ee,"\u21B0","\\Lsh",!0);G(U,ke,Ee,"\u21C8","\\upuparrows",!0);G(U,ke,Ee,"\u21BF","\\upharpoonleft",!0);G(U,ke,Ee,"\u21C3","\\downharpoonleft",!0);G(U,ee,Ee,"\u22B6","\\origof",!0);G(U,ee,Ee,"\u22B7","\\imageof",!0);G(U,ke,Ee,"\u22B8","\\multimap",!0);G(U,ke,Ee,"\u21AD","\\leftrightsquigarrow",!0);G(U,ke,Ee,"\u21C9","\\rightrightarrows",!0);G(U,ke,Ee,"\u21C4","\\rightleftarrows",!0);G(U,ke,Ee,"\u21A0","\\twoheadrightarrow",!0);G(U,ke,Ee,"\u21A3","\\rightarrowtail",!0);G(U,ke,Ee,"\u21AC","\\looparrowright",!0);G(U,ke,Ee,"\u21B7","\\curvearrowright",!0);G(U,ke,Ee,"\u21BB","\\circlearrowright",!0);G(U,ke,Ee,"\u21B1","\\Rsh",!0);G(U,ke,Ee,"\u21CA","\\downdownarrows",!0);G(U,ke,Ee,"\u21BE","\\upharpoonright",!0);G(U,ke,Ee,"\u21C2","\\downharpoonright",!0);G(U,ke,Ee,"\u21DD","\\rightsquigarrow",!0);G(U,ke,Ee,"\u21DD","\\leadsto");G(U,ke,Ee,"\u21DB","\\Rrightarrow",!0);G(U,ke,Ee,"\u21BE","\\restriction");G(U,ee,Le,"\u2018","`");G(U,ee,Le,"$","\\$");G(it,ee,Le,"$","\\$");G(it,ee,Le,"$","\\textdollar");G(U,ee,Le,"%","\\%");G(it,ee,Le,"%","\\%");G(U,ee,Le,"_","\\_");G(it,ee,Le,"_","\\_");G(it,ee,Le,"_","\\textunderscore");G(U,ee,Le,"\u2220","\\angle",!0);G(U,ee,Le,"\u221E","\\infty",!0);G(U,ee,Le,"\u2032","\\prime");G(U,ee,Le,"\u25B3","\\triangle");G(U,ee,Le,"\u0393","\\Gamma",!0);G(U,ee,Le,"\u0394","\\Delta",!0);G(U,ee,Le,"\u0398","\\Theta",!0);G(U,ee,Le,"\u039B","\\Lambda",!0);G(U,ee,Le,"\u039E","\\Xi",!0);G(U,ee,Le,"\u03A0","\\Pi",!0);G(U,ee,Le,"\u03A3","\\Sigma",!0);G(U,ee,Le,"\u03A5","\\Upsilon",!0);G(U,ee,Le,"\u03A6","\\Phi",!0);G(U,ee,Le,"\u03A8","\\Psi",!0);G(U,ee,Le,"\u03A9","\\Omega",!0);G(U,ee,Le,"A","\u0391");G(U,ee,Le,"B","\u0392");G(U,ee,Le,"E","\u0395");G(U,ee,Le,"Z","\u0396");G(U,ee,Le,"H","\u0397");G(U,ee,Le,"I","\u0399");G(U,ee,Le,"K","\u039A");G(U,ee,Le,"M","\u039C");G(U,ee,Le,"N","\u039D");G(U,ee,Le,"O","\u039F");G(U,ee,Le,"P","\u03A1");G(U,ee,Le,"T","\u03A4");G(U,ee,Le,"X","\u03A7");G(U,ee,Le,"\xAC","\\neg",!0);G(U,ee,Le,"\xAC","\\lnot");G(U,ee,Le,"\u22A4","\\top");G(U,ee,Le,"\u22A5","\\bot");G(U,ee,Le,"\u2205","\\emptyset");G(U,ke,Le,"\u2205","\\varnothing");G(U,ee,er,"\u03B1","\\alpha",!0);G(U,ee,er,"\u03B2","\\beta",!0);G(U,ee,er,"\u03B3","\\gamma",!0);G(U,ee,er,"\u03B4","\\delta",!0);G(U,ee,er,"\u03F5","\\epsilon",!0);G(U,ee,er,"\u03B6","\\zeta",!0);G(U,ee,er,"\u03B7","\\eta",!0);G(U,ee,er,"\u03B8","\\theta",!0);G(U,ee,er,"\u03B9","\\iota",!0);G(U,ee,er,"\u03BA","\\kappa",!0);G(U,ee,er,"\u03BB","\\lambda",!0);G(U,ee,er,"\u03BC","\\mu",!0);G(U,ee,er,"\u03BD","\\nu",!0);G(U,ee,er,"\u03BE","\\xi",!0);G(U,ee,er,"\u03BF","\\omicron",!0);G(U,ee,er,"\u03C0","\\pi",!0);G(U,ee,er,"\u03C1","\\rho",!0);G(U,ee,er,"\u03C3","\\sigma",!0);G(U,ee,er,"\u03C4","\\tau",!0);G(U,ee,er,"\u03C5","\\upsilon",!0);G(U,ee,er,"\u03D5","\\phi",!0);G(U,ee,er,"\u03C7","\\chi",!0);G(U,ee,er,"\u03C8","\\psi",!0);G(U,ee,er,"\u03C9","\\omega",!0);G(U,ee,er,"\u03B5","\\varepsilon",!0);G(U,ee,er,"\u03D1","\\vartheta",!0);G(U,ee,er,"\u03D6","\\varpi",!0);G(U,ee,er,"\u03F1","\\varrho",!0);G(U,ee,er,"\u03C2","\\varsigma",!0);G(U,ee,er,"\u03C6","\\varphi",!0);G(U,ee,It,"\u2217","*",!0);G(U,ee,It,"+","+");G(U,ee,It,"\u2212","-",!0);G(U,ee,It,"\u22C5","\\cdot",!0);G(U,ee,It,"\u2218","\\circ",!0);G(U,ee,It,"\xF7","\\div",!0);G(U,ee,It,"\xB1","\\pm",!0);G(U,ee,It,"\xD7","\\times",!0);G(U,ee,It,"\u2229","\\cap",!0);G(U,ee,It,"\u222A","\\cup",!0);G(U,ee,It,"\u2216","\\setminus",!0);G(U,ee,It,"\u2227","\\land");G(U,ee,It,"\u2228","\\lor");G(U,ee,It,"\u2227","\\wedge",!0);G(U,ee,It,"\u2228","\\vee",!0);G(U,ee,Le,"\u221A","\\surd");G(U,ee,js,"\u27E8","\\langle",!0);G(U,ee,js,"\u2223","\\lvert");G(U,ee,js,"\u2225","\\lVert");G(U,ee,Za,"?","?");G(U,ee,Za,"!","!");G(U,ee,Za,"\u27E9","\\rangle",!0);G(U,ee,Za,"\u2223","\\rvert");G(U,ee,Za,"\u2225","\\rVert");G(U,ee,Ee,"=","=");G(U,ee,Ee,":",":");G(U,ee,Ee,"\u2248","\\approx",!0);G(U,ee,Ee,"\u2245","\\cong",!0);G(U,ee,Ee,"\u2265","\\ge");G(U,ee,Ee,"\u2265","\\geq",!0);G(U,ee,Ee,"\u2190","\\gets");G(U,ee,Ee,">","\\gt",!0);G(U,ee,Ee,"\u2208","\\in",!0);G(U,ee,Ee,"\uE020","\\@not");G(U,ee,Ee,"\u2282","\\subset",!0);G(U,ee,Ee,"\u2283","\\supset",!0);G(U,ee,Ee,"\u2286","\\subseteq",!0);G(U,ee,Ee,"\u2287","\\supseteq",!0);G(U,ke,Ee,"\u2288","\\nsubseteq",!0);G(U,ke,Ee,"\u2289","\\nsupseteq",!0);G(U,ee,Ee,"\u22A8","\\models");G(U,ee,Ee,"\u2190","\\leftarrow",!0);G(U,ee,Ee,"\u2264","\\le");G(U,ee,Ee,"\u2264","\\leq",!0);G(U,ee,Ee,"<","\\lt",!0);G(U,ee,Ee,"\u2192","\\rightarrow",!0);G(U,ee,Ee,"\u2192","\\to");G(U,ke,Ee,"\u2271","\\ngeq",!0);G(U,ke,Ee,"\u2270","\\nleq",!0);G(U,ee,uu,"\xA0","\\ ");G(U,ee,uu,"\xA0","\\space");G(U,ee,uu,"\xA0","\\nobreakspace");G(it,ee,uu,"\xA0","\\ ");G(it,ee,uu,"\xA0"," ");G(it,ee,uu,"\xA0","\\space");G(it,ee,uu,"\xA0","\\nobreakspace");G(U,ee,uu,null,"\\nobreak");G(U,ee,uu,null,"\\allowbreak");G(U,ee,x3,",",",");G(U,ee,x3,";",";");G(U,ke,It,"\u22BC","\\barwedge",!0);G(U,ke,It,"\u22BB","\\veebar",!0);G(U,ee,It,"\u2299","\\odot",!0);G(U,ee,It,"\u2295","\\oplus",!0);G(U,ee,It,"\u2297","\\otimes",!0);G(U,ee,Le,"\u2202","\\partial",!0);G(U,ee,It,"\u2298","\\oslash",!0);G(U,ke,It,"\u229A","\\circledcirc",!0);G(U,ke,It,"\u22A1","\\boxdot",!0);G(U,ee,It,"\u25B3","\\bigtriangleup");G(U,ee,It,"\u25BD","\\bigtriangledown");G(U,ee,It,"\u2020","\\dagger");G(U,ee,It,"\u22C4","\\diamond");G(U,ee,It,"\u22C6","\\star");G(U,ee,It,"\u25C3","\\triangleleft");G(U,ee,It,"\u25B9","\\triangleright");G(U,ee,js,"{","\\{");G(it,ee,Le,"{","\\{");G(it,ee,Le,"{","\\textbraceleft");G(U,ee,Za,"}","\\}");G(it,ee,Le,"}","\\}");G(it,ee,Le,"}","\\textbraceright");G(U,ee,js,"{","\\lbrace");G(U,ee,Za,"}","\\rbrace");G(U,ee,js,"[","\\lbrack",!0);G(it,ee,Le,"[","\\lbrack",!0);G(U,ee,Za,"]","\\rbrack",!0);G(it,ee,Le,"]","\\rbrack",!0);G(U,ee,js,"(","\\lparen",!0);G(U,ee,Za,")","\\rparen",!0);G(it,ee,Le,"<","\\textless",!0);G(it,ee,Le,">","\\textgreater",!0);G(U,ee,js,"\u230A","\\lfloor",!0);G(U,ee,Za,"\u230B","\\rfloor",!0);G(U,ee,js,"\u2308","\\lceil",!0);G(U,ee,Za,"\u2309","\\rceil",!0);G(U,ee,Le,"\\","\\backslash");G(U,ee,Le,"\u2223","|");G(U,ee,Le,"\u2223","\\vert");G(it,ee,Le,"|","\\textbar",!0);G(U,ee,Le,"\u2225","\\|");G(U,ee,Le,"\u2225","\\Vert");G(it,ee,Le,"\u2225","\\textbardbl");G(it,ee,Le,"~","\\textasciitilde");G(it,ee,Le,"\\","\\textbackslash");G(it,ee,Le,"^","\\textasciicircum");G(U,ee,Ee,"\u2191","\\uparrow",!0);G(U,ee,Ee,"\u21D1","\\Uparrow",!0);G(U,ee,Ee,"\u2193","\\downarrow",!0);G(U,ee,Ee,"\u21D3","\\Downarrow",!0);G(U,ee,Ee,"\u2195","\\updownarrow",!0);G(U,ee,Ee,"\u21D5","\\Updownarrow",!0);G(U,ee,ki,"\u2210","\\coprod");G(U,ee,ki,"\u22C1","\\bigvee");G(U,ee,ki,"\u22C0","\\bigwedge");G(U,ee,ki,"\u2A04","\\biguplus");G(U,ee,ki,"\u22C2","\\bigcap");G(U,ee,ki,"\u22C3","\\bigcup");G(U,ee,ki,"\u222B","\\int");G(U,ee,ki,"\u222B","\\intop");G(U,ee,ki,"\u222C","\\iint");G(U,ee,ki,"\u222D","\\iiint");G(U,ee,ki,"\u220F","\\prod");G(U,ee,ki,"\u2211","\\sum");G(U,ee,ki,"\u2A02","\\bigotimes");G(U,ee,ki,"\u2A01","\\bigoplus");G(U,ee,ki,"\u2A00","\\bigodot");G(U,ee,ki,"\u222E","\\oint");G(U,ee,ki,"\u222F","\\oiint");G(U,ee,ki,"\u2230","\\oiiint");G(U,ee,ki,"\u2A06","\\bigsqcup");G(U,ee,ki,"\u222B","\\smallint");G(it,ee,p0,"\u2026","\\textellipsis");G(U,ee,p0,"\u2026","\\mathellipsis");G(it,ee,p0,"\u2026","\\ldots",!0);G(U,ee,p0,"\u2026","\\ldots",!0);G(U,ee,p0,"\u22EF","\\@cdots",!0);G(U,ee,p0,"\u22F1","\\ddots",!0);G(U,ee,Le,"\u22EE","\\varvdots");G(U,ee,Vn,"\u02CA","\\acute");G(U,ee,Vn,"\u02CB","\\grave");G(U,ee,Vn,"\xA8","\\ddot");G(U,ee,Vn,"~","\\tilde");G(U,ee,Vn,"\u02C9","\\bar");G(U,ee,Vn,"\u02D8","\\breve");G(U,ee,Vn,"\u02C7","\\check");G(U,ee,Vn,"^","\\hat");G(U,ee,Vn,"\u20D7","\\vec");G(U,ee,Vn,"\u02D9","\\dot");G(U,ee,Vn,"\u02DA","\\mathring");G(U,ee,er,"\uE131","\\@imath");G(U,ee,er,"\uE237","\\@jmath");G(U,ee,Le,"\u0131","\u0131");G(U,ee,Le,"\u0237","\u0237");G(it,ee,Le,"\u0131","\\i",!0);G(it,ee,Le,"\u0237","\\j",!0);G(it,ee,Le,"\xDF","\\ss",!0);G(it,ee,Le,"\xE6","\\ae",!0);G(it,ee,Le,"\u0153","\\oe",!0);G(it,ee,Le,"\xF8","\\o",!0);G(it,ee,Le,"\xC6","\\AE",!0);G(it,ee,Le,"\u0152","\\OE",!0);G(it,ee,Le,"\xD8","\\O",!0);G(it,ee,Vn,"\u02CA","\\'");G(it,ee,Vn,"\u02CB","\\`");G(it,ee,Vn,"\u02C6","\\^");G(it,ee,Vn,"\u02DC","\\~");G(it,ee,Vn,"\u02C9","\\=");G(it,ee,Vn,"\u02D8","\\u");G(it,ee,Vn,"\u02D9","\\.");G(it,ee,Vn,"\xB8","\\c");G(it,ee,Vn,"\u02DA","\\r");G(it,ee,Vn,"\u02C7","\\v");G(it,ee,Vn,"\xA8",'\\"');G(it,ee,Vn,"\u02DD","\\H");G(it,ee,Vn,"\u25EF","\\textcircled");Hz={"--":!0,"---":!0,"``":!0,"''":!0};G(it,ee,Le,"\u2013","--",!0);G(it,ee,Le,"\u2013","\\textendash");G(it,ee,Le,"\u2014","---",!0);G(it,ee,Le,"\u2014","\\textemdash");G(it,ee,Le,"\u2018","`",!0);G(it,ee,Le,"\u2018","\\textquoteleft");G(it,ee,Le,"\u2019","'",!0);G(it,ee,Le,"\u2019","\\textquoteright");G(it,ee,Le,"\u201C","``",!0);G(it,ee,Le,"\u201C","\\textquotedblleft");G(it,ee,Le,"\u201D","''",!0);G(it,ee,Le,"\u201D","\\textquotedblright");G(U,ee,Le,"\xB0","\\degree",!0);G(it,ee,Le,"\xB0","\\degree");G(it,ee,Le,"\xB0","\\textdegree",!0);G(U,ee,Le,"\xA3","\\pounds");G(U,ee,Le,"\xA3","\\mathsterling",!0);G(it,ee,Le,"\xA3","\\pounds");G(it,ee,Le,"\xA3","\\textsterling",!0);G(U,ke,Le,"\u2720","\\maltese");G(it,ke,Le,"\u2720","\\maltese");fz='0123456789/@."';for(J4=0;J40)return ol(a,h,i,r,s.concat(f));if(u){var d,p;if(u==="boldsymbol"){var m=Bbe(a,i,r,s,n);d=m.fontName,p=[m.fontClass]}else l?(d=Yz[u].fontName,p=[u]):(d=i3(u,r.fontWeight,r.fontShape),p=[u,r.fontWeight,r.fontShape]);if(b3(a,d,i).metrics)return ol(a,d,i,r,s.concat(p));if(Hz.hasOwnProperty(a)&&d.slice(0,10)==="Typewriter"){for(var g=[],y=0;y{if(fh(t.classes)!==fh(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},"canCombine"),zbe=o(t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},"sizeElementFromChildren"),bs=o(function(e,r,n,i){var a=new td(e,r,n,i);return B7(a),a},"makeSpan"),Wz=o((t,e,r,n)=>new td(t,e,r,n),"makeSvgSpan"),Gbe=o(function(e,r,n){var i=bs([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=kt(i.height),i.maxFontSize=1,i},"makeLineSpan"),Vbe=o(function(e,r,n,i){var a=new Vy(e,r,n,i);return B7(a),a},"makeAnchor"),qz=o(function(e){var r=new ed(e);return B7(r),r},"makeFragment"),Ube=o(function(e,r){return e instanceof ed?bs([],[e],r):e},"wrapFragment"),Hbe=o(function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=bs(["mspace"],[],e),n=ti(t,e);return r.style.marginRight=kt(n),r},"makeGlue"),i3=o(function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return r==="textbf"&&n==="textit"?a="BoldItalic":r==="textbf"?a="Bold":r==="textit"?a="Italic":a="Regular",i+"-"+a},"retrieveTextFontName"),Yz={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Xz={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ybe=o(function(e,r){var[n,i,a]=Xz[e],s=new Kl(n),l=new ll([s],{width:kt(i),height:kt(a),style:"width:"+kt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=Wz(["overlay"],[l],r);return u.height=a,u.style.height=kt(a),u.style.width=kt(i),u},"staticSvg"),Be={fontMap:Yz,makeSymbol:ol,mathsym:Pbe,makeSpan:bs,makeSvgSpan:Wz,makeLineSpan:Gbe,makeAnchor:Vbe,makeFragment:qz,wrapFragment:Ube,makeVList:Wbe,makeOrd:Fbe,makeGlue:qbe,staticSvg:Ybe,svgData:Xz,tryCombineChars:zbe},ei={number:3,unit:"mu"},Zf={number:4,unit:"mu"},au={number:5,unit:"mu"},Xbe={mord:{mop:ei,mbin:Zf,mrel:au,minner:ei},mop:{mord:ei,mop:ei,mrel:au,minner:ei},mbin:{mord:Zf,mop:Zf,mopen:Zf,minner:Zf},mrel:{mord:au,mop:au,mopen:au,minner:au},mopen:{},mclose:{mop:ei,mbin:Zf,mrel:au,minner:ei},mpunct:{mord:ei,mop:ei,mrel:au,mopen:ei,mclose:ei,mpunct:ei,minner:ei},minner:{mord:ei,mop:ei,mbin:Zf,mrel:au,mopen:ei,mpunct:ei,minner:ei}},jbe={mord:{mop:ei},mop:{mord:ei,mop:ei},mbin:{},mrel:{},mopen:{},mclose:{mop:ei},mpunct:{},minner:{mop:ei}},jz={},p3={},m3={};o(Nt,"defineFunction");o(rd,"defineFunctionBuilders");g3=o(function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},"normalizeArgument"),di=o(function(e){return e.type==="ordgroup"?e.body:[e]},"ordargument"),lu=Be.makeSpan,Kbe=["leftmost","mbin","mopen","mrel","mop","mpunct"],Qbe=["rightmost","mrel","mclose","mpunct"],Zbe={display:tr.DISPLAY,text:tr.TEXT,script:tr.SCRIPT,scriptscript:tr.SCRIPTSCRIPT},Jbe={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Pi=o(function(e,r,n,i){i===void 0&&(i=[null,null]);for(var a=[],s=0;s{var v=y.classes[0],x=g.classes[0];v==="mbin"&&Jt.contains(Qbe,x)?y.classes[0]="mord":x==="mbin"&&Jt.contains(Kbe,v)&&(g.classes[0]="mord")},{node:d},p,m),mz(a,(g,y)=>{var v=A7(y),x=A7(g),b=v&&x?g.hasClass("mtight")?jbe[v][x]:Xbe[v][x]:null;if(b)return Be.makeGlue(b,h)},{node:d},p,m),a},"buildExpression"),mz=o(function t(e,r,n,i,a){i&&e.push(i);for(var s=0;sp=>{e.splice(d+1,0,p),s++})(s)}i&&e.pop()},"traverseNonSpaceNodes"),Kz=o(function(e){return e instanceof ed||e instanceof Vy||e instanceof td&&e.hasClass("enclosing")?e:null},"checkPartialGroup"),e4e=o(function t(e,r){var n=Kz(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},"getOutermostNode"),A7=o(function(e,r){return e?(r&&(e=e4e(e,r)),Jbe[e.classes[0]]||null):null},"getTypeOfDomTree"),Hy=o(function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return lu(r.concat(n))},"makeNullDelimiter"),Fr=o(function(e,r,n){if(!e)return lu();if(p3[e.type]){var i=p3[e.type](e,r);if(n&&r.size!==n.size){i=lu(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new gt("Got group of unknown type: '"+e.type+"'")},"buildGroup");o(a3,"buildHTMLUnbreakable");o(_7,"buildHTML");o(Qz,"newDocumentFragment");ws=class{static{o(this,"MathNode")}constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=fh(this.classes));for(var n=0;n0&&(e+=' class ="'+Jt.escape(fh(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}},Jf=class{static{o(this,"TextNode")}constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Jt.escape(this.toText())}toText(){return this.text}},D7=class{static{o(this,"SpaceNode")}constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character="\u200A":e>=.1666&&e<=.1667?this.character="\u2009":e>=.2222&&e<=.2223?this.character="\u2005":e>=.2777&&e<=.2778?this.character="\u2005\u200A":e>=-.05556&&e<=-.05555?this.character="\u200A\u2063":e>=-.1667&&e<=-.1666?this.character="\u2009\u2063":e>=-.2223&&e<=-.2222?this.character="\u205F\u2063":e>=-.2778&&e<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",kt(this.width)),e}toMarkup(){return this.character?""+this.character+" ":' '}toText(){return this.character?this.character:" "}},dt={MathNode:ws,TextNode:Jf,SpaceNode:D7,newDocumentFragment:Qz},Co=o(function(e,r,n){return An[r][e]&&An[r][e].replace&&e.charCodeAt(0)!==55349&&!(Hz.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=An[r][e].replace),new dt.TextNode(e)},"makeText"),F7=o(function(e){return e.length===1?e[0]:new dt.MathNode("mrow",e)},"makeRow"),$7=o(function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(Jt.contains(["\\imath","\\jmath"],a))return null;An[i][a]&&An[i][a].replace&&(a=An[i][a].replace);var s=Be.fontMap[n].fontName;return P7(a,s,i)?Be.fontMap[n].variant:null},"getVariant"),ks=o(function(e,r,n){if(e.length===1){var i=yn(e[0],r);return n&&i instanceof ws&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,l=0;l0&&(d.text=d.text.slice(0,1)+"\u0338"+d.text.slice(1),a.pop())}}}a.push(u),s=u}return a},"buildExpression"),dh=o(function(e,r,n){return F7(ks(e,r,n))},"buildExpressionRow"),yn=o(function(e,r){if(!e)return new dt.MathNode("mrow");if(m3[e.type]){var n=m3[e.type](e,r);return n}else throw new gt("Got group of unknown type: '"+e.type+"'")},"buildGroup");o(gz,"buildMathML");Zz=o(function(e){return new f3({style:e.displayMode?tr.DISPLAY:tr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},"optionsFromSettings"),Jz=o(function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Be.makeSpan(n,[e])}return e},"displayWrap"),t4e=o(function(e,r,n){var i=Zz(n),a;if(n.output==="mathml")return gz(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=_7(e,i);a=Be.makeSpan(["katex"],[s])}else{var l=gz(e,r,i,n.displayMode,!1),u=_7(e,i);a=Be.makeSpan(["katex"],[l,u])}return Jz(a,n)},"buildTree"),r4e=o(function(e,r,n){var i=Zz(n),a=_7(e,i),s=Be.makeSpan(["katex"],[a]);return Jz(s,n)},"buildHTMLTree"),n4e={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},i4e=o(function(e){var r=new dt.MathNode("mo",[new dt.TextNode(n4e[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},"mathMLnode"),a4e={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},s4e=o(function(e){return e.type==="ordgroup"?e.body.length:1},"groupLength"),o4e=o(function(e,r){function n(){var l=4e5,u=e.label.slice(1);if(Jt.contains(["widehat","widecheck","widetilde","utilde"],u)){var h=e,f=s4e(h.base),d,p,m;if(f>5)u==="widehat"||u==="widecheck"?(d=420,l=2364,m=.42,p=u+"4"):(d=312,l=2340,m=.34,p="tilde4");else{var g=[1,1,2,2,3,3][f];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],m=[0,.24,.3,.3,.36,.42][g],p=u+g):(l=[0,600,1033,2339,2340][g],d=[0,260,286,306,312][g],m=[0,.26,.286,.3,.306,.34][g],p="tilde"+g)}var y=new Kl(p),v=new ll([y],{width:"100%",height:kt(m),viewBox:"0 0 "+l+" "+d,preserveAspectRatio:"none"});return{span:Be.makeSvgSpan([],[v],r),minWidth:0,height:m}}else{var x=[],b=a4e[u],[w,C,T]=b,E=T/1e3,A=w.length,S,_;if(A===1){var I=b[3];S=["hide-tail"],_=[I]}else if(A===2)S=["halfarrow-left","halfarrow-right"],_=["xMinYMin","xMaxYMin"];else if(A===3)S=["brace-left","brace-center","brace-right"],_=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
+ `+A+" children.");for(var D=0;D0&&(i.style.minWidth=kt(a)),i},"svgSpan"),l4e=o(function(e,r,n,i,a){var s,l=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Be.makeSpan(["stretchy",r],[],a),r==="fbox"){var u=a.color&&a.getColor();u&&(s.style.borderColor=u)}}else{var h=[];/^[bx]cancel$/.test(r)&&h.push(new Uy({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&h.push(new Uy({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var f=new ll(h,{width:"100%",height:kt(l)});s=Be.makeSvgSpan([],[f],a)}return s.height=l,s.style.height=kt(l),s},"encloseSpan"),cu={encloseSpan:l4e,mathMLnode:i4e,svgSpan:o4e};o(xr,"assertNodeType");o(z7,"assertSymbolNodeType");o(w3,"checkSymbolNodeType");G7=o((t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=xr(t.base,"accent"),r=n.base,t.base=r,i=Nbe(Fr(t,e)),t.base=n):(n=xr(t,"accent"),r=n.base);var a=Fr(r,e.havingCrampedStyle()),s=n.isShifty&&Jt.isCharacterBox(r),l=0;if(s){var u=Jt.getBaseElem(r),h=Fr(u,e.havingCrampedStyle());l=hz(h).skew}var f=n.label==="\\c",d=f?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),p;if(n.isStretchy)p=cu.svgSpan(n,e),p=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+kt(2*l)+")",marginLeft:kt(2*l)}:void 0}]},e);else{var m,g;n.label==="\\vec"?(m=Be.staticSvg("vec",e),g=Be.svgData.vec[1]):(m=Be.makeOrd({mode:n.mode,text:n.label},e,"textord"),m=hz(m),m.italic=0,g=m.width,f&&(d+=m.depth)),p=Be.makeSpan(["accent-body"],[m]);var y=n.label==="\\textcircled";y&&(p.classes.push("accent-full"),d=a.height);var v=l;y||(v-=g/2),p.style.left=kt(v),n.label==="\\textcircled"&&(p.style.top=".2em"),p=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:p}]},e)}var x=Be.makeSpan(["mord","accent"],[p],e);return i?(i.children[0]=x,i.height=Math.max(x.height,i.height),i.classes[0]="mord",i):x},"htmlBuilder$a"),eG=o((t,e)=>{var r=t.isStretchy?cu.mathMLnode(t.label):new dt.MathNode("mo",[Co(t.label,t.mode)]),n=new dt.MathNode("mover",[yn(t.base,e),r]);return n.setAttribute("accent","true"),n},"mathmlBuilder$9"),c4e=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Nt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:o((t,e)=>{var r=g3(e[0]),n=!c4e.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},"handler"),htmlBuilder:G7,mathmlBuilder:eG});Nt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:o((t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},"handler"),htmlBuilder:G7,mathmlBuilder:eG});Nt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},"handler"),htmlBuilder:o((t,e)=>{var r=Fr(t.base,e),n=cu.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,a=Be.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return Be.makeSpan(["mord","accentunder"],[a],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=cu.mathMLnode(t.label),n=new dt.MathNode("munder",[yn(t.base,e),r]);return n.setAttribute("accentunder","true"),n},"mathmlBuilder")});s3=o(t=>{var e=new dt.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e},"paddedNode");Nt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Be.wrapFragment(Fr(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=Be.wrapFragment(Fr(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var l=cu.svgSpan(t,e),u=-e.fontMetrics().axisHeight+.5*l.height,h=-e.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(h-=i.depth);var f;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*l.height+.111;f=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:l,shift:u},{type:"elem",elem:s,shift:d}]},e)}else f=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:l,shift:u}]},e);return f.children[0].children[0].children[1].classes.push("svg-align"),Be.makeSpan(["mrel","x-arrow"],[f],e)},mathmlBuilder(t,e){var r=cu.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=s3(yn(t.body,e));if(t.below){var a=s3(yn(t.below,e));n=new dt.MathNode("munderover",[r,a,i])}else n=new dt.MathNode("mover",[r,i])}else if(t.below){var s=s3(yn(t.below,e));n=new dt.MathNode("munder",[r,s])}else n=s3(),n=new dt.MathNode("mover",[r,n]);return n}});u4e=Be.makeSpan;o(tG,"htmlBuilder$9");o(rG,"mathmlBuilder$8");Nt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:di(i),isCharacterBox:Jt.isCharacterBox(i)}},htmlBuilder:tG,mathmlBuilder:rG});T3=o(t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"},"binrelClass");Nt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:T3(e[0]),body:di(e[1]),isCharacterBox:Jt.isCharacterBox(e[1])}}});Nt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=T3(i):s="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:di(i)},u={type:"supsub",mode:a.mode,base:l,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[u],isCharacterBox:Jt.isCharacterBox(u)}},htmlBuilder:tG,mathmlBuilder:rG});Nt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:T3(e[0]),body:di(e[0])}},htmlBuilder(t,e){var r=Pi(t.body,e,!0),n=Be.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=ks(t.body,e),n=new dt.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});h4e={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},yz=o(()=>({type:"styling",body:[],mode:"math",style:"display"}),"newCell"),vz=o(t=>t.type==="textord"&&t.text==="@","isStartOfArrow"),f4e=o((t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e,"isLabelEnd");o(d4e,"cdArrow");o(p4e,"parseCD");Nt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Be.wrapFragment(Fr(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=kt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new dt.MathNode("mrow",[yn(t.label,e)]);return r=new dt.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new dt.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});Nt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Be.wrapFragment(Fr(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new dt.MathNode("mrow",[yn(t.fragment,e)])}});Nt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=xr(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new gt("\\@char with invalid code point "+a);return u<=65535?h=String.fromCharCode(u):(u-=65536,h=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:r.mode,text:h}}});nG=o((t,e)=>{var r=Pi(t.body,e.withColor(t.color),!1);return Be.makeFragment(r)},"htmlBuilder$8"),iG=o((t,e)=>{var r=ks(t.body,e.withColor(t.color)),n=new dt.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n},"mathmlBuilder$7");Nt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=xr(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:di(i)}},htmlBuilder:nG,mathmlBuilder:iG});Nt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=xr(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:nG,mathmlBuilder:iG});Nt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&xr(i,"size").value}},htmlBuilder(t,e){var r=Be.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=kt(ti(t.size,e)))),r},mathmlBuilder(t,e){var r=new dt.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",kt(ti(t.size,e)))),r}});L7={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},aG=o(t=>{var e=t.text;if(/^(?:[\\{}$^_]|EOF)$/.test(e))throw new gt("Expected a control sequence",t);return e},"checkControlSequence"),m4e=o(t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},"getRHS"),sG=o((t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)},"letCommand");Nt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(L7[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=L7[n.text]),xr(e.parseFunction(),"internal");throw new gt("Invalid token after macro prefix",n)}});Nt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$^_]|EOF)$/.test(i))throw new gt("Expected a control sequence",n);for(var a=0,s,l=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),l[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new gt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new gt('Argument number "'+n.text+'" out of order');a++,l.push([])}else{if(n.text==="EOF")throw new gt("Expected a macro definition");l[a].push(n.text)}var{tokens:u}=e.gullet.consumeArg();return s&&u.unshift(s),(r==="\\edef"||r==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:l},r===L7[r]),{type:"internal",mode:e.mode}}});Nt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=aG(e.gullet.popToken());e.gullet.consumeSpaces();var i=m4e(e);return sG(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});Nt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=aG(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return sG(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});Fy=o(function(e,r,n){var i=An.math[e]&&An.math[e].replace,a=P7(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},"getMetrics"),V7=o(function(e,r,n,i){var a=n.havingBaseStyle(r),s=Be.makeSpan(i.concat(a.sizingClasses(n)),[e],n),l=a.sizeMultiplier/n.sizeMultiplier;return s.height*=l,s.depth*=l,s.maxFontSize=a.sizeMultiplier,s},"styleWrap"),oG=o(function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=kt(a),e.height-=a,e.depth+=a},"centerSpan"),g4e=o(function(e,r,n,i,a,s){var l=Be.makeSymbol(e,"Main-Regular",a,i),u=V7(l,r,i,s);return n&&oG(u,i,r),u},"makeSmallDelim"),y4e=o(function(e,r,n,i){return Be.makeSymbol(e,"Size"+r+"-Regular",n,i)},"mathrmSize"),lG=o(function(e,r,n,i,a,s){var l=y4e(e,r,a,i),u=V7(Be.makeSpan(["delimsizing","size"+r],[l],i),tr.TEXT,i,s);return n&&oG(u,i,tr.TEXT),u},"makeLargeDelim"),p7=o(function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Be.makeSpan(["delimsizinginner",i],[Be.makeSpan([],[Be.makeSymbol(e,r,n)])]);return{type:"elem",elem:a}},"makeGlyphSpan"),m7=o(function(e,r,n){var i=jl["Size4-Regular"][e.charCodeAt(0)]?jl["Size4-Regular"][e.charCodeAt(0)][4]:jl["Size1-Regular"][e.charCodeAt(0)][4],a=new Kl("inner",Sbe(e,Math.round(1e3*r))),s=new ll([a],{width:kt(i),height:kt(r),style:"width:"+kt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),l=Be.makeSvgSpan([],[s],n);return l.height=r,l.style.height=kt(r),l.style.width=kt(i),{type:"elem",elem:l}},"makeInner"),R7=.008,o3={type:"kern",size:-1*R7},v4e=["|","\\lvert","\\rvert","\\vert"],x4e=["\\|","\\lVert","\\rVert","\\Vert"],cG=o(function(e,r,n,i,a,s){var l,u,h,f,d="",p=0;l=h=f=e,u=null;var m="Size1-Regular";e==="\\uparrow"?h=f="\u23D0":e==="\\Uparrow"?h=f="\u2016":e==="\\downarrow"?l=h="\u23D0":e==="\\Downarrow"?l=h="\u2016":e==="\\updownarrow"?(l="\\uparrow",h="\u23D0",f="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",h="\u2016",f="\\Downarrow"):Jt.contains(v4e,e)?(h="\u2223",d="vert",p=333):Jt.contains(x4e,e)?(h="\u2225",d="doublevert",p=556):e==="["||e==="\\lbrack"?(l="\u23A1",h="\u23A2",f="\u23A3",m="Size4-Regular",d="lbrack",p=667):e==="]"||e==="\\rbrack"?(l="\u23A4",h="\u23A5",f="\u23A6",m="Size4-Regular",d="rbrack",p=667):e==="\\lfloor"||e==="\u230A"?(h=l="\u23A2",f="\u23A3",m="Size4-Regular",d="lfloor",p=667):e==="\\lceil"||e==="\u2308"?(l="\u23A1",h=f="\u23A2",m="Size4-Regular",d="lceil",p=667):e==="\\rfloor"||e==="\u230B"?(h=l="\u23A5",f="\u23A6",m="Size4-Regular",d="rfloor",p=667):e==="\\rceil"||e==="\u2309"?(l="\u23A4",h=f="\u23A5",m="Size4-Regular",d="rceil",p=667):e==="("||e==="\\lparen"?(l="\u239B",h="\u239C",f="\u239D",m="Size4-Regular",d="lparen",p=875):e===")"||e==="\\rparen"?(l="\u239E",h="\u239F",f="\u23A0",m="Size4-Regular",d="rparen",p=875):e==="\\{"||e==="\\lbrace"?(l="\u23A7",u="\u23A8",f="\u23A9",h="\u23AA",m="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="\u23AB",u="\u23AC",f="\u23AD",h="\u23AA",m="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(l="\u23A7",f="\u23A9",h="\u23AA",m="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(l="\u23AB",f="\u23AD",h="\u23AA",m="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(l="\u23A7",f="\u23AD",h="\u23AA",m="Size4-Regular"):(e==="\\rmoustache"||e==="\u23B1")&&(l="\u23AB",f="\u23A9",h="\u23AA",m="Size4-Regular");var g=Fy(l,m,a),y=g.height+g.depth,v=Fy(h,m,a),x=v.height+v.depth,b=Fy(f,m,a),w=b.height+b.depth,C=0,T=1;if(u!==null){var E=Fy(u,m,a);C=E.height+E.depth,T=2}var A=y+w+C,S=Math.max(0,Math.ceil((r-A)/(T*x))),_=A+S*T*x,I=i.fontMetrics().axisHeight;n&&(I*=i.sizeMultiplier);var D=_/2-I,k=[];if(d.length>0){var L=_-y-w,R=Math.round(_*1e3),O=Cbe(d,Math.round(L*1e3)),M=new Kl(d,O),B=(p/1e3).toFixed(3)+"em",F=(R/1e3).toFixed(3)+"em",P=new ll([M],{width:B,height:F,viewBox:"0 0 "+p+" "+R}),z=Be.makeSvgSpan([],[P],i);z.height=R/1e3,z.style.width=B,z.style.height=F,k.push({type:"elem",elem:z})}else{if(k.push(p7(f,m,a)),k.push(o3),u===null){var $=_-y-w+2*R7;k.push(m7(h,$,i))}else{var H=(_-y-w-C)/2+2*R7;k.push(m7(h,H,i)),k.push(o3),k.push(p7(u,m,a)),k.push(o3),k.push(m7(h,H,i))}k.push(o3),k.push(p7(l,m,a))}var Q=i.havingBaseStyle(tr.TEXT),j=Be.makeVList({positionType:"bottom",positionData:D,children:k},Q);return V7(Be.makeSpan(["delimsizing","mult"],[j],Q),tr.TEXT,i,s)},"makeStackedDelim"),g7=80,y7=.08,v7=o(function(e,r,n,i,a){var s=Ebe(e,i,n),l=new Kl(e,s),u=new ll([l],{width:"400em",height:kt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Be.makeSvgSpan(["hide-tail"],[u],a)},"sqrtSvg"),b4e=o(function(e,r){var n=r.havingBaseSizing(),i=dG("\\surd",e*n.sizeMultiplier,fG,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),l,u=0,h=0,f=0,d;return i.type==="small"?(f=1e3+1e3*s+g7,e<1?a=1:e<1.4&&(a=.7),u=(1+s+y7)/a,h=(1+s)/a,l=v7("sqrtMain",u,f,s,r),l.style.minWidth="0.853em",d=.833/a):i.type==="large"?(f=(1e3+g7)*$y[i.size],h=($y[i.size]+s)/a,u=($y[i.size]+s+y7)/a,l=v7("sqrtSize"+i.size,u,f,s,r),l.style.minWidth="1.02em",d=1/a):(u=e+s+y7,h=e+s,f=Math.floor(1e3*e+s)+g7,l=v7("sqrtTall",u,f,s,r),l.style.minWidth="0.742em",d=1.056),l.height=h,l.style.height=kt(u),{span:l,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},"makeSqrtImage"),uG=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],w4e=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],hG=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],$y=[0,1.2,1.8,2.4,3],T4e=o(function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),Jt.contains(uG,e)||Jt.contains(hG,e))return lG(e,r,!1,n,i,a);if(Jt.contains(w4e,e))return cG(e,$y[r],!1,n,i,a);throw new gt("Illegal delimiter: '"+e+"'")},"makeSizedDelim"),k4e=[{type:"small",style:tr.SCRIPTSCRIPT},{type:"small",style:tr.SCRIPT},{type:"small",style:tr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],E4e=[{type:"small",style:tr.SCRIPTSCRIPT},{type:"small",style:tr.SCRIPT},{type:"small",style:tr.TEXT},{type:"stack"}],fG=[{type:"small",style:tr.SCRIPTSCRIPT},{type:"small",style:tr.SCRIPT},{type:"small",style:tr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],S4e=o(function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},"delimTypeToFont"),dG=o(function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return n[s]}return n[n.length-1]},"traverseSequence"),pG=o(function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle");var l;Jt.contains(hG,e)?l=k4e:Jt.contains(uG,e)?l=fG:l=E4e;var u=dG(e,r,l,i);return u.type==="small"?g4e(e,u.style,n,i,a,s):u.type==="large"?lG(e,u.size,n,i,a,s):cG(e,r,n,i,a,s)},"makeCustomSizedDelim"),C4e=o(function(e,r,n,i,a,s){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,h=5/i.fontMetrics().ptPerEm,f=Math.max(r-l,n+l),d=Math.max(f/500*u,2*f-h);return pG(e,d,!0,i,a,s)},"makeLeftRightDelim"),ou={sqrtImage:b4e,sizedDelim:T4e,sizeToMaxHeight:$y,customSizedDelim:pG,leftRightDelim:C4e},xz={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},A4e=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];o(k3,"checkDelimiter");Nt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:o((t,e)=>{var r=k3(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:xz[t.funcName].size,mclass:xz[t.funcName].mclass,delim:r.text}},"handler"),htmlBuilder:o((t,e)=>t.delim==="."?Be.makeSpan([t.mclass]):ou.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),"htmlBuilder"),mathmlBuilder:o(t=>{var e=[];t.delim!=="."&&e.push(Co(t.delim,t.mode));var r=new dt.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=kt(ou.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r},"mathmlBuilder")});o(bz,"assertParsed");Nt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new gt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:k3(e[0],t).text,color:r}},"handler")});Nt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=k3(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=xr(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},"handler"),htmlBuilder:o((t,e)=>{bz(t);for(var r=Pi(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{bz(t);var r=ks(t.body,e);if(t.left!=="."){var n=new dt.MathNode("mo",[Co(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new dt.MathNode("mo",[Co(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return F7(r)},"mathmlBuilder")});Nt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=k3(e[0],t);if(!t.parser.leftrightDepth)throw new gt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},"handler"),htmlBuilder:o((t,e)=>{var r;if(t.delim===".")r=Hy(e,[]);else{r=ou.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Co("|","text"):Co(t.delim,t.mode),n=new dt.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n},"mathmlBuilder")});U7=o((t,e)=>{var r=Be.wrapFragment(Fr(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s=0,l=Jt.isCharacterBox(t.body);if(n==="sout")a=Be.makeSpan(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var u=ti({number:.6,unit:"pt"},e),h=ti({number:.35,unit:"ex"},e),f=e.havingBaseSizing();i=i/f.sizeMultiplier;var d=r.height+r.depth+u+h;r.style.paddingLeft=kt(d/2+u);var p=Math.floor(1e3*d*i),m=Tbe(p),g=new ll([new Kl("phase",m)],{width:"400em",height:kt(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});a=Be.makeSvgSpan(["hide-tail"],[g],e),a.style.height=kt(d),s=r.depth+u+h}else{/cancel/.test(n)?l||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var y=0,v=0,x=0;/box/.test(n)?(x=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),y=e.fontMetrics().fboxsep+(n==="colorbox"?0:x),v=y):n==="angl"?(x=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),y=4*x,v=Math.max(0,.25-r.depth)):(y=l?.2:0,v=y),a=cu.encloseSpan(r,n,y,v,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=kt(x)):n==="angl"&&x!==.049&&(a.style.borderTopWidth=kt(x),a.style.borderRightWidth=kt(x)),s=r.depth+v,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]},e);else{var w=/cancel|phase/.test(n)?["svg-align"]:[];b=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:w}]},e)}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!l?Be.makeSpan(["mord","cancel-lap"],[b],e):Be.makeSpan(["mord"],[b],e)},"htmlBuilder$7"),H7=o((t,e)=>{var r=0,n=new dt.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[yn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n},"mathmlBuilder$6");Nt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=xr(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:U7,mathmlBuilder:H7});Nt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=xr(e[0],"color-token").color,s=xr(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:l}},htmlBuilder:U7,mathmlBuilder:H7});Nt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});Nt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:U7,mathmlBuilder:H7});Nt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});mG={};o(Ql,"defineEnvironment");gG={};o(fe,"defineMacro");o(wz,"getHLines");E3=o(t=>{var e=t.parser.settings;if(!e.displayMode)throw new gt("{"+t.envName+"} can be used only in display mode.")},"validateAmsEnvironmentContext");o(W7,"getAutoTag");o(ph,"parseArray");o(q7,"dCellStyle");Zl=o(function(e,r){var n,i,a=e.body.length,s=e.hLinesBeforeRow,l=0,u=new Array(a),h=[],f=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),d=1/r.fontMetrics().ptPerEm,p=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var m=r.havingStyle(tr.SCRIPT).sizeMultiplier;p=.2778*(m/r.sizeMultiplier)}var g=e.colSeparationType==="CD"?ti({number:3,unit:"ex"},r):12*d,y=3*d,v=e.arraystretch*g,x=.7*v,b=.3*v,w=0;function C(ae){for(var Oe=0;Oe0&&(w+=.25),h.push({pos:w,isDashed:ae[Oe]})}for(o(C,"setHLinePos"),C(s[0]),n=0;n0&&(D+=b,Aae))for(n=0;n=l)){var le=void 0;(i>0||e.hskipBeforeAndAfter)&&(le=Jt.deflt(H.pregap,p),le!==0&&(O=Be.makeSpan(["arraycolsep"],[]),O.style.width=kt(le),R.push(O)));var he=[];for(n=0;n 0){for(var J=Be.makeLineSpan("hline",r,f),se=Be.makeLineSpan("hdashline",r,f),ue=[{type:"elem",elem:u,shift:0}];h.length>0;){var Z=h.pop(),Se=Z.pos-k;Z.isDashed?ue.push({type:"elem",elem:se,shift:Se}):ue.push({type:"elem",elem:J,shift:Se})}u=Be.makeVList({positionType:"individualShift",children:ue},r)}if(B.length===0)return Be.makeSpan(["mord"],[u],r);var ce=Be.makeVList({positionType:"individualShift",children:B},r);return ce=Be.makeSpan(["tag"],[ce],r),Be.makeFragment([u,ce])},"htmlBuilder"),_4e={c:"center ",l:"left ",r:"right "},Jl=o(function(e,r){for(var n=[],i=new dt.MathNode("mtd",[],["mtr-glue"]),a=new dt.MathNode("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,y="",v=!1,x=0,b=g.length;g[0].type==="separator"&&(p+="top ",x=1),g[g.length-1].type==="separator"&&(p+="bottom ",b-=1);for(var w=x;w0?"left ":"",p+=S[S.length-1].length>0?"right ":"";for(var _=1;_-1?"alignat":"align",a=e.envName==="split",s=ph(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:W7(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),l,u=0,h={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var f="",d=0;d0&&m&&(v=1),n[g]={type:"align",align:y,pregap:v,postgap:0}}return s.colSeparationType=m?"align":"alignat",s},"alignedHandler");Ql({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=w3(e[0]),n=r?[e[0]]:xr(e[0],"ordgroup").body,i=n.map(function(s){var l=z7(s),u=l.text;if("lcr".indexOf(u)!==-1)return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new gt("Unknown column alignment: "+u,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return ph(t.parser,a,q7(t.envName))},htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,"lcr".indexOf(r)===-1)throw new gt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=ph(t.parser,n,q7(t.envName)),s=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=ph(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=w3(e[0]),n=r?[e[0]]:xr(e[0],"ordgroup").body,i=n.map(function(s){var l=z7(s),u=l.text;if("lc".indexOf(u)!==-1)return{type:"align",align:u};throw new gt("Unknown column alignment: "+u,s)});if(i.length>1)throw new gt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=ph(t.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new gt("{subarray} can contain only one column");return a},htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=ph(t.parser,e,q7(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:yG,htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Jt.contains(["gather","gather*"],t.envName)&&E3(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:W7(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return ph(t.parser,e,"display")},htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:yG,htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){E3(t);var e={autoTag:W7(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return ph(t.parser,e,"display")},htmlBuilder:Zl,mathmlBuilder:Jl});Ql({type:"array",names:["CD"],props:{numArgs:0},handler(t){return E3(t),p4e(t.parser)},htmlBuilder:Zl,mathmlBuilder:Jl});fe("\\nonumber","\\gdef\\@eqnsw{0}");fe("\\notag","\\nonumber");Nt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new gt(t.funcName+" valid only within array environment")}});Tz=mG;Nt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new gt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return Fr(t.body,n)},"htmlBuilder$5"),xG=o((t,e)=>{var r=t.font,n=e.withFont(r);return yn(t.body,n)},"mathmlBuilder$4"),kz={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Nt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=g3(e[0]),a=n;return a in kz&&(a=kz[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},"handler"),htmlBuilder:vG,mathmlBuilder:xG});Nt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r}=t,n=e[0],i=Jt.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:T3(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}},"handler")});Nt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:o((t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i),l="math"+n.slice(1);return{type:"font",mode:a,font:l,body:{type:"ordgroup",mode:r.mode,body:s}}},"handler"),htmlBuilder:vG,mathmlBuilder:xG});bG=o((t,e)=>{var r=e;return t==="display"?r=r.id>=tr.SCRIPT.id?r.text():tr.DISPLAY:t==="text"&&r.size===tr.DISPLAY.size?r=tr.TEXT:t==="script"?r=tr.SCRIPT:t==="scriptscript"&&(r=tr.SCRIPTSCRIPT),r},"adjustStyle"),Y7=o((t,e)=>{var r=bG(t.size,e.style),n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=Fr(t.numer,a,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,u=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*p:g=7*p,y=e.fontMetrics().denom1):(d>0?(m=e.fontMetrics().num2,g=p):(m=e.fontMetrics().num3,g=3*p),y=e.fontMetrics().denom2);var v;if(f){var b=e.fontMetrics().axisHeight;m-s.depth-(b+.5*d){var r=new dt.MathNode("mfrac",[yn(t.numer,e),yn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=ti(t.barSize,e);r.setAttribute("linethickness",kt(n))}var i=bG(t.size,e.style);if(i.size!==e.style.size){r=new dt.MathNode("mstyle",[r]);var a=i.size===tr.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var s=[];if(t.leftDelim!=null){var l=new dt.MathNode("mo",[new dt.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}if(s.push(r),t.rightDelim!=null){var u=new dt.MathNode("mo",[new dt.TextNode(t.rightDelim.replace("\\",""))]);u.setAttribute("fence","true"),s.push(u)}return F7(s)}return r},"mathmlBuilder$3");Nt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,l=null,u=null,h="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,l="(",u=")";break;case"\\\\bracefrac":s=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":s=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":h="display";break;case"\\tfrac":case"\\tbinom":h="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:s,leftDelim:l,rightDelim:u,size:h,barSize:null}},"handler"),htmlBuilder:Y7,mathmlBuilder:X7});Nt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}},"handler")});Nt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});Ez=["display","text","script","scriptscript"],Sz=o(function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r},"delimFromValue");Nt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=g3(e[0]),s=a.type==="atom"&&a.family==="open"?Sz(a.text):null,l=g3(e[1]),u=l.type==="atom"&&l.family==="close"?Sz(l.text):null,h=xr(e[2],"size"),f,d=null;h.isBlank?f=!0:(d=h.value,f=d.number>0);var p="auto",m=e[3];if(m.type==="ordgroup"){if(m.body.length>0){var g=xr(m.body[0],"textord");p=Ez[Number(g.text)]}}else m=xr(m,"textord"),p=Ez[Number(m.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:f,barSize:d,leftDelim:s,rightDelim:u,size:p}},htmlBuilder:Y7,mathmlBuilder:X7});Nt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:xr(e[0],"size").value,token:i}}});Nt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=obe(xr(e[1],"infix").size),s=e[2],l=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},"handler"),htmlBuilder:Y7,mathmlBuilder:X7});wG=o((t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Fr(t.sup,e.havingStyle(r.sup()),e):Fr(t.sub,e.havingStyle(r.sub()),e),i=xr(t.base,"horizBrace")):i=xr(t,"horizBrace");var a=Fr(i.base,e.havingBaseStyle(tr.DISPLAY)),s=cu.svgSpan(i,e),l;if(i.isOver?(l=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=Be.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),n){var u=Be.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e);i.isOver?l=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:n}]},e):l=Be.makeVList({positionType:"bottom",positionData:u.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:u}]},e)}return Be.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e)},"htmlBuilder$3"),D4e=o((t,e)=>{var r=cu.mathMLnode(t.label);return new dt.MathNode(t.isOver?"mover":"munder",[yn(t.base,e),r])},"mathmlBuilder$2");Nt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:wG,mathmlBuilder:D4e});Nt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[1],i=xr(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:di(n)}:r.formatUnsupportedCmd("\\href")},"handler"),htmlBuilder:o((t,e)=>{var r=Pi(t.body,e,!1);return Be.makeAnchor(t.href,[],r,e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=dh(t.body,e);return r instanceof ws||(r=new ws("mrow",[r])),r.setAttribute("href",t.href),r},"mathmlBuilder")});Nt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=xr(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=xr(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(n){case"\\htmlClass":u.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":u.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":u.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var h=a.split(","),f=0;f{var r=Pi(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Be.makeSpan(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},"htmlBuilder"),mathmlBuilder:o((t,e)=>dh(t.body,e),"mathmlBuilder")});Nt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:di(e[0]),mathml:di(e[1])}},"handler"),htmlBuilder:o((t,e)=>{var r=Pi(t.html,e,!1);return Be.makeFragment(r)},"htmlBuilder"),mathmlBuilder:o((t,e)=>dh(t.mathml,e),"mathmlBuilder")});x7=o(function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new gt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!zz(n))throw new gt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n},"sizeData");Nt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:o((t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},l="";if(r[0])for(var u=xr(r[0],"raw").string,h=u.split(","),f=0;f{var r=ti(t.height,e),n=0;t.totalheight.number>0&&(n=ti(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=ti(t.width,e));var a={height:kt(r+n)};i>0&&(a.width=kt(i)),n>0&&(a.verticalAlign=kt(-n));var s=new S7(t.src,t.alt,a);return s.height=r,s.depth=n,s},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=new dt.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=ti(t.height,e),i=0;if(t.totalheight.number>0&&(i=ti(t.totalheight,e)-n,r.setAttribute("valign",kt(-i))),r.setAttribute("height",kt(n+i)),t.width.number>0){var a=ti(t.width,e);r.setAttribute("width",kt(a))}return r.setAttribute("src",t.src),r},"mathmlBuilder")});Nt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=xr(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return Be.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=ti(t.dimension,e);return new dt.SpaceNode(r)}});Nt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},"handler"),htmlBuilder:o((t,e)=>{var r;t.alignment==="clap"?(r=Be.makeSpan([],[Fr(t.body,e)]),r=Be.makeSpan(["inner"],[r],e)):r=Be.makeSpan(["inner"],[Fr(t.body,e)]);var n=Be.makeSpan(["fix"],[]),i=Be.makeSpan([t.alignment],[r,n],e),a=Be.makeSpan(["strut"]);return a.style.height=kt(i.height+i.depth),i.depth&&(a.style.verticalAlign=kt(-i.depth)),i.children.unshift(a),i=Be.makeSpan(["thinbox"],[i],e),Be.makeSpan(["mord","vbox"],[i],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=new dt.MathNode("mpadded",[yn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r},"mathmlBuilder")});Nt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}});Nt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new gt("Mismatched "+t.funcName)}});Cz=o((t,e)=>{switch(e.style.size){case tr.DISPLAY.size:return t.display;case tr.TEXT.size:return t.text;case tr.SCRIPT.size:return t.script;case tr.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}},"chooseMathStyle");Nt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:o((t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:di(e[0]),text:di(e[1]),script:di(e[2]),scriptscript:di(e[3])}},"handler"),htmlBuilder:o((t,e)=>{var r=Cz(t,e),n=Pi(r,e,!1);return Be.makeFragment(n)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=Cz(t,e);return dh(r,e)},"mathmlBuilder")});TG=o((t,e,r,n,i,a,s)=>{t=Be.makeSpan([],[t]);var l=r&&Jt.isCharacterBox(r),u,h;if(e){var f=Fr(e,n.havingStyle(i.sup()),n);h={elem:f,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-f.depth)}}if(r){var d=Fr(r,n.havingStyle(i.sub()),n);u={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var p;if(h&&u){var m=n.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+t.depth+s;p=Be.makeVList({positionType:"bottom",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:kt(-a)},{type:"kern",size:u.kern},{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:kt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(u){var g=t.height-s;p=Be.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:kt(-a)},{type:"kern",size:u.kern},{type:"elem",elem:t}]},n)}else if(h){var y=t.depth+s;p=Be.makeVList({positionType:"bottom",positionData:y,children:[{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:kt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var v=[p];if(u&&a!==0&&!l){var x=Be.makeSpan(["mspace"],[],n);x.style.marginRight=kt(a),v.unshift(x)}return Be.makeSpan(["mop","op-limits"],v,n)},"assembleSupSub"),kG=["\\smallint"],m0=o((t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=xr(t.base,"op"),i=!0):a=xr(t,"op");var s=e.style,l=!1;s.size===tr.DISPLAY.size&&a.symbol&&!Jt.contains(kG,a.name)&&(l=!0);var u;if(a.symbol){var h=l?"Size2-Regular":"Size1-Regular",f="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(f=a.name.slice(1),a.name=f==="oiint"?"\\iint":"\\iiint"),u=Be.makeSymbol(a.name,h,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),f.length>0){var d=u.italic,p=Be.staticSvg(f+"Size"+(l?"2":"1"),e);u=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:p,shift:l?.08:0}]},e),a.name="\\"+f,u.classes.unshift("mop"),u.italic=d}}else if(a.body){var m=Pi(a.body,e,!0);m.length===1&&m[0]instanceof Ts?(u=m[0],u.classes[0]="mop"):u=Be.makeSpan(["mop"],m,e)}else{for(var g=[],y=1;y{var r;if(t.symbol)r=new ws("mo",[Co(t.name,t.mode)]),Jt.contains(kG,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new ws("mo",ks(t.body,e));else{r=new ws("mi",[new Jf(t.name.slice(1))]);var n=new ws("mo",[Co("\u2061","text")]);t.parentIsSupSub?r=new ws("mrow",[r,n]):r=Qz([r,n])}return r},"mathmlBuilder$1"),L4e={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Nt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=L4e[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},"handler"),htmlBuilder:m0,mathmlBuilder:Wy});Nt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:di(n)}},"handler"),htmlBuilder:m0,mathmlBuilder:Wy});R4e={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Nt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:m0,mathmlBuilder:Wy});Nt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:m0,mathmlBuilder:Wy});Nt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=R4e[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:m0,mathmlBuilder:Wy});EG=o((t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=xr(t.base,"operatorname"),i=!0):a=xr(t,"operatorname");var s;if(a.body.length>0){for(var l=a.body.map(d=>{var p=d.text;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),u=Pi(l,e.withFont("mathrm"),!0),h=0;h{for(var r=ks(t.body,e.withFont("mathrm")),n=!0,i=0;if.toText()).join("");r=[new dt.TextNode(l)]}var u=new dt.MathNode("mi",r);u.setAttribute("mathvariant","normal");var h=new dt.MathNode("mo",[Co("\u2061","text")]);return t.parentIsSupSub?new dt.MathNode("mrow",[u,h]):dt.newDocumentFragment([u,h])},"mathmlBuilder");Nt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:di(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},"handler"),htmlBuilder:EG,mathmlBuilder:N4e});fe("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rd({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Be.makeFragment(Pi(t.body,e,!1)):Be.makeSpan(["mord"],Pi(t.body,e,!0),e)},mathmlBuilder(t,e){return dh(t.body,e,!0)}});Nt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=Fr(t.body,e.havingCrampedStyle()),n=Be.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return Be.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new dt.MathNode("mo",[new dt.TextNode("\u203E")]);r.setAttribute("stretchy","true");var n=new dt.MathNode("mover",[yn(t.body,e),r]);return n.setAttribute("accent","true"),n}});Nt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:di(n)}},"handler"),htmlBuilder:o((t,e)=>{var r=Pi(t.body,e.withPhantom(),!1);return Be.makeFragment(r)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=ks(t.body,e);return new dt.MathNode("mphantom",r)},"mathmlBuilder")});Nt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},"handler"),htmlBuilder:o((t,e)=>{var r=Be.makeSpan([],[Fr(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=ks(di(t.body),e),n=new dt.MathNode("mphantom",r),i=new dt.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i},"mathmlBuilder")});Nt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},"handler"),htmlBuilder:o((t,e)=>{var r=Be.makeSpan(["inner"],[Fr(t.body,e.withPhantom())]),n=Be.makeSpan(["fix"],[]);return Be.makeSpan(["mord","rlap"],[r,n],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=ks(di(t.body),e),n=new dt.MathNode("mphantom",r),i=new dt.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i},"mathmlBuilder")});Nt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=xr(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Fr(t.body,e),n=ti(t.dy,e);return Be.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new dt.MathNode("mpadded",[yn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});Nt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Nt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=xr(e[0],"size"),s=xr(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&xr(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Be.makeSpan(["mord","rule"],[],e),n=ti(t.width,e),i=ti(t.height,e),a=t.shift?ti(t.shift,e):0;return r.style.borderRightWidth=kt(n),r.style.borderTopWidth=kt(i),r.style.bottom=kt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=ti(t.width,e),n=ti(t.height,e),i=t.shift?ti(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new dt.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",kt(r)),s.setAttribute("height",kt(n));var l=new dt.MathNode("mpadded",[s]);return i>=0?l.setAttribute("height",kt(i)):(l.setAttribute("height",kt(i)),l.setAttribute("depth",kt(-i))),l.setAttribute("voffset",kt(i)),l}});o(SG,"sizingGroup");Az=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],M4e=o((t,e)=>{var r=e.havingSize(t.size);return SG(t.body,r,e)},"htmlBuilder");Nt({type:"sizing",names:Az,props:{numArgs:0,allowedInText:!0},handler:o((t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:Az.indexOf(n)+1,body:a}},"handler"),htmlBuilder:M4e,mathmlBuilder:o((t,e)=>{var r=e.havingSize(t.size),n=ks(t.body,r),i=new dt.MathNode("mstyle",n);return i.setAttribute("mathsize",kt(r.sizeMultiplier)),i},"mathmlBuilder")});Nt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:o((t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&xr(r[0],"ordgroup");if(s)for(var l="",u=0;u{var r=Be.makeSpan([],[Fr(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new dt.MathNode("mpadded",[yn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r},"mathmlBuilder")});Nt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=Fr(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Be.wrapFragment(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var p=u.height-r.height-s-h;r.style.paddingLeft=kt(f);var m=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+p)},{type:"elem",elem:u},{type:"kern",size:h}]},e);if(t.index){var g=e.havingStyle(tr.SCRIPTSCRIPT),y=Fr(t.index,g,e),v=.6*(m.height-m.depth),x=Be.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:y}]},e),b=Be.makeSpan(["root"],[x]);return Be.makeSpan(["mord","sqrt"],[b,m],e)}else return Be.makeSpan(["mord","sqrt"],[m],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new dt.MathNode("mroot",[yn(r,e),yn(n,e)]):new dt.MathNode("msqrt",[yn(r,e)])}});_z={display:tr.DISPLAY,text:tr.TEXT,script:tr.SCRIPT,scriptscript:tr.SCRIPTSCRIPT};Nt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=_z[t.style],n=e.havingStyle(r).withFont("");return SG(t.body,n,e)},mathmlBuilder(t,e){var r=_z[t.style],n=e.havingStyle(r),i=ks(t.body,n),a=new dt.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=s[t.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});I4e=o(function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===tr.DISPLAY.size||n.alwaysHandleSupSub);return i?m0:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===tr.DISPLAY.size||n.limits);return a?EG:null}else{if(n.type==="accent")return Jt.isCharacterBox(n.base)?G7:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?wG:null}else return null}else return null},"htmlBuilderDelegate");rd({type:"supsub",htmlBuilder(t,e){var r=I4e(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=Fr(n,e),l,u,h=e.fontMetrics(),f=0,d=0,p=n&&Jt.isCharacterBox(n);if(i){var m=e.havingStyle(e.style.sup());l=Fr(i,m,e),p||(f=s.height-m.fontMetrics().supDrop*m.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());u=Fr(a,g,e),p||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var y;e.style===tr.DISPLAY?y=h.sup1:e.style.cramped?y=h.sup3:y=h.sup2;var v=e.sizeMultiplier,x=kt(.5/h.ptPerEm/v),b=null;if(u){var w=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(s instanceof Ts||w)&&(b=kt(-s.italic))}var C;if(l&&u){f=Math.max(f,y,l.depth+.25*h.xHeight),d=Math.max(d,h.sub2);var T=h.defaultRuleThickness,E=4*T;if(f-l.depth-(u.height-d)0&&(f+=A,d-=A)}var S=[{type:"elem",elem:u,shift:d,marginRight:x,marginLeft:b},{type:"elem",elem:l,shift:-f,marginRight:x}];C=Be.makeVList({positionType:"individualShift",children:S},e)}else if(u){d=Math.max(d,h.sub1,u.height-.8*h.xHeight);var _=[{type:"elem",elem:u,marginLeft:b,marginRight:x}];C=Be.makeVList({positionType:"shift",positionData:d,children:_},e)}else if(l)f=Math.max(f,y,l.depth+.25*h.xHeight),C=Be.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:l,marginRight:x}]},e);else throw new Error("supsub must have either sup or sub.");var I=A7(s,"right")||"mord";return Be.makeSpan([I],[s,Be.makeSpan(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[yn(t.base,e)];t.sub&&a.push(yn(t.sub,e)),t.sup&&a.push(yn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var h=t.base;h&&h.type==="op"&&h.limits&&e.style===tr.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(e.style===tr.DISPLAY||h.limits)?s="munderover":s="msubsup"}else{var u=t.base;u&&u.type==="op"&&u.limits&&(e.style===tr.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||e.style===tr.DISPLAY)?s="munder":s="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===tr.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===tr.DISPLAY)?s="mover":s="msup"}return new dt.MathNode(s,a)}});rd({type:"atom",htmlBuilder(t,e){return Be.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new dt.MathNode("mo",[Co(t.text,t.mode)]);if(t.family==="bin"){var n=$7(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});CG={mi:"italic",mn:"normal",mtext:"normal"};rd({type:"mathord",htmlBuilder(t,e){return Be.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new dt.MathNode("mi",[Co(t.text,t.mode,e)]),n=$7(t,e)||"italic";return n!==CG[r.type]&&r.setAttribute("mathvariant",n),r}});rd({type:"textord",htmlBuilder(t,e){return Be.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=Co(t.text,t.mode,e),n=$7(t,e)||"normal",i;return t.mode==="text"?i=new dt.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new dt.MathNode("mn",[r]):t.text==="\\prime"?i=new dt.MathNode("mo",[r]):i=new dt.MathNode("mi",[r]),n!==CG[i.type]&&i.setAttribute("mathvariant",n),i}});b7={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},w7={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rd({type:"spacing",htmlBuilder(t,e){if(w7.hasOwnProperty(t.text)){var r=w7[t.text].className||"";if(t.mode==="text"){var n=Be.makeOrd(t,e,"textord");return n.classes.push(r),n}else return Be.makeSpan(["mspace",r],[Be.mathsym(t.text,t.mode,e)],e)}else{if(b7.hasOwnProperty(t.text))return Be.makeSpan(["mspace",b7[t.text]],[],e);throw new gt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(w7.hasOwnProperty(t.text))r=new dt.MathNode("mtext",[new dt.TextNode("\xA0")]);else{if(b7.hasOwnProperty(t.text))return new dt.MathNode("mspace");throw new gt('Unknown type of space "'+t.text+'"')}return r}});Dz=o(()=>{var t=new dt.MathNode("mtd",[]);return t.setAttribute("width","50%"),t},"pad");rd({type:"tag",mathmlBuilder(t,e){var r=new dt.MathNode("mtable",[new dt.MathNode("mtr",[Dz(),new dt.MathNode("mtd",[dh(t.body,e)]),Dz(),new dt.MathNode("mtd",[dh(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});Lz={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Rz={"\\textbf":"textbf","\\textmd":"textmd"},O4e={"\\textit":"textit","\\textup":"textup"},Nz=o((t,e)=>{var r=t.font;if(r){if(Lz[r])return e.withTextFontFamily(Lz[r]);if(Rz[r])return e.withTextFontWeight(Rz[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(O4e[r])},"optionsWithFont");Nt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:di(i),font:n}},htmlBuilder(t,e){var r=Nz(t,e),n=Pi(t.body,r,!0);return Be.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Nz(t,e);return dh(t.body,r)}});Nt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Fr(t.body,e),n=Be.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Be.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return Be.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new dt.MathNode("mo",[new dt.TextNode("\u203E")]);r.setAttribute("stretchy","true");var n=new dt.MathNode("munder",[yn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});Nt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Fr(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Be.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new dt.MathNode("mpadded",[yn(t.body,e)],["vcenter"])}});Nt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new gt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Mz(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"\u2423":"\xA0"),"makeVerb"),hh=jz,AG=`[ \r
+ ]`,P4e="\\\\[a-zA-Z@]+",B4e="\\\\[^\uD800-\uDFFF]",F4e="("+P4e+")"+AG+"*",$4e=`\\\\(
|[ \r ]+
-?)[ \r ]*`,L7="[\u0300-\u036F]",vbe=new RegExp(L7+"+$"),xbe="("+y$+"+)|"+(ybe+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(L7+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(L7+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+gbe)+("|"+mbe+")"),v4=class{static{o(this,"Lexer")}constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(xbe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Ao("EOF",new Xs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new nt("Unexpected character: '"+e[r]+"'",new Ao(e[r],new Xs(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(`
-`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Ao(i,new Xs(this,r,this.tokenRegex.lastIndex))}},D7=class{static{o(this,"Namespace")}constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new nt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}},bbe=s$;le("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});le("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});le("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});le("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});le("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});le("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");le("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});EG={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};le("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new nt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=EG[e.text],n==null||n>=r)throw new nt("Invalid base-"+r+" digit "+e.text);for(var i;(i=EG[t.future().text])!=null&&i{var n=t.consumeArg().tokens;if(n.length!==1)throw new nt("\\newcommand's first argument must be a macro name");var i=n[0].text,a=t.isDefined(i);if(a&&!e)throw new nt("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!r)throw new nt("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(n=t.consumeArg().tokens,n.length===1&&n[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new nt("Invalid number of arguments: "+l);s=parseInt(l),n=t.consumeArg().tokens}return t.macros.set(i,{tokens:n,numArgs:s}),""},"newcommand");le("\\newcommand",t=>W7(t,!1,!0));le("\\renewcommand",t=>W7(t,!0,!1));le("\\providecommand",t=>W7(t,!0,!0));le("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});le("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});le("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),fh[r],wn.math[r],wn.text[r]),""});le("\\bgroup","{");le("\\egroup","}");le("~","\\nobreakspace");le("\\lq","`");le("\\rq","'");le("\\aa","\\r a");le("\\AA","\\r A");le("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}");le("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");le("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");le("\u212C","\\mathscr{B}");le("\u2130","\\mathscr{E}");le("\u2131","\\mathscr{F}");le("\u210B","\\mathscr{H}");le("\u2110","\\mathscr{I}");le("\u2112","\\mathscr{L}");le("\u2133","\\mathscr{M}");le("\u211B","\\mathscr{R}");le("\u212D","\\mathfrak{C}");le("\u210C","\\mathfrak{H}");le("\u2128","\\mathfrak{Z}");le("\\Bbbk","\\Bbb{k}");le("\xB7","\\cdotp");le("\\llap","\\mathllap{\\textrm{#1}}");le("\\rlap","\\mathrlap{\\textrm{#1}}");le("\\clap","\\mathclap{\\textrm{#1}}");le("\\mathstrut","\\vphantom{(}");le("\\underbar","\\underline{\\text{#1}}");le("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');le("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");le("\\ne","\\neq");le("\u2260","\\neq");le("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");le("\u2209","\\notin");le("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");le("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");le("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");le("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");le("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");le("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");le("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");le("\u27C2","\\perp");le("\u203C","\\mathclose{!\\mkern-0.8mu!}");le("\u220C","\\notni");le("\u231C","\\ulcorner");le("\u231D","\\urcorner");le("\u231E","\\llcorner");le("\u231F","\\lrcorner");le("\xA9","\\copyright");le("\xAE","\\textregistered");le("\uFE0F","\\textregistered");le("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');le("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');le("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');le("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');le("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");le("\u22EE","\\vdots");le("\\varGamma","\\mathit{\\Gamma}");le("\\varDelta","\\mathit{\\Delta}");le("\\varTheta","\\mathit{\\Theta}");le("\\varLambda","\\mathit{\\Lambda}");le("\\varXi","\\mathit{\\Xi}");le("\\varPi","\\mathit{\\Pi}");le("\\varSigma","\\mathit{\\Sigma}");le("\\varUpsilon","\\mathit{\\Upsilon}");le("\\varPhi","\\mathit{\\Phi}");le("\\varPsi","\\mathit{\\Psi}");le("\\varOmega","\\mathit{\\Omega}");le("\\substack","\\begin{subarray}{c}#1\\end{subarray}");le("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");le("\\boxed","\\fbox{$\\displaystyle{#1}$}");le("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");le("\\implies","\\DOTSB\\;\\Longrightarrow\\;");le("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");CG={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};le("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in CG?e=CG[r]:(r.slice(0,4)==="\\not"||r in wn.math&&Vt.contains(["bin","rel"],wn.math[r].group))&&(e="\\dotsb"),e});q7={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};le("\\dotso",function(t){var e=t.future().text;return e in q7?"\\ldots\\,":"\\ldots"});le("\\dotsc",function(t){var e=t.future().text;return e in q7&&e!==","?"\\ldots\\,":"\\ldots"});le("\\cdots",function(t){var e=t.future().text;return e in q7?"\\@cdots\\,":"\\@cdots"});le("\\dotsb","\\cdots");le("\\dotsm","\\cdots");le("\\dotsi","\\!\\cdots");le("\\dotsx","\\ldots\\,");le("\\DOTSI","\\relax");le("\\DOTSB","\\relax");le("\\DOTSX","\\relax");le("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");le("\\,","\\tmspace+{3mu}{.1667em}");le("\\thinspace","\\,");le("\\>","\\mskip{4mu}");le("\\:","\\tmspace+{4mu}{.2222em}");le("\\medspace","\\:");le("\\;","\\tmspace+{5mu}{.2777em}");le("\\thickspace","\\;");le("\\!","\\tmspace-{3mu}{.1667em}");le("\\negthinspace","\\!");le("\\negmedspace","\\tmspace-{4mu}{.2222em}");le("\\negthickspace","\\tmspace-{5mu}{.277em}");le("\\enspace","\\kern.5em ");le("\\enskip","\\hskip.5em\\relax");le("\\quad","\\hskip1em\\relax");le("\\qquad","\\hskip2em\\relax");le("\\tag","\\@ifstar\\tag@literal\\tag@paren");le("\\tag@paren","\\tag@literal{({#1})}");le("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new nt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});le("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");le("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");le("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");le("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");le("\\newline","\\\\\\relax");le("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");v$=ct(Zl["Main-Regular"][84][1]-.7*Zl["Main-Regular"][65][1]);le("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+v$+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");le("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+v$+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");le("\\hspace","\\@ifstar\\@hspacer\\@hspace");le("\\@hspace","\\hskip #1\\relax");le("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");le("\\ordinarycolon",":");le("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");le("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');le("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');le("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');le("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');le("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');le("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');le("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');le("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');le("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');le("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');le("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');le("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');le("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');le("\u2237","\\dblcolon");le("\u2239","\\eqcolon");le("\u2254","\\coloneqq");le("\u2255","\\eqqcolon");le("\u2A74","\\Coloneqq");le("\\ratio","\\vcentcolon");le("\\coloncolon","\\dblcolon");le("\\colonequals","\\coloneqq");le("\\coloncolonequals","\\Coloneqq");le("\\equalscolon","\\eqqcolon");le("\\equalscoloncolon","\\Eqqcolon");le("\\colonminus","\\coloneq");le("\\coloncolonminus","\\Coloneq");le("\\minuscolon","\\eqcolon");le("\\minuscoloncolon","\\Eqcolon");le("\\coloncolonapprox","\\Colonapprox");le("\\coloncolonsim","\\Colonsim");le("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");le("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");le("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");le("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");le("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");le("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");le("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");le("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");le("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");le("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");le("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");le("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");le("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");le("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}");le("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}");le("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}");le("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}");le("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}");le("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}");le("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}");le("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}");le("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}");le("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}");le("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}");le("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}");le("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}");le("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}");le("\\imath","\\html@mathml{\\@imath}{\u0131}");le("\\jmath","\\html@mathml{\\@jmath}{\u0237}");le("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");le("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");le("\u27E6","\\llbracket");le("\u27E7","\\rrbracket");le("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");le("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");le("\u2983","\\lBrace");le("\u2984","\\rBrace");le("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");le("\u29B5","\\minuso");le("\\darr","\\downarrow");le("\\dArr","\\Downarrow");le("\\Darr","\\Downarrow");le("\\lang","\\langle");le("\\rang","\\rangle");le("\\uarr","\\uparrow");le("\\uArr","\\Uparrow");le("\\Uarr","\\Uparrow");le("\\N","\\mathbb{N}");le("\\R","\\mathbb{R}");le("\\Z","\\mathbb{Z}");le("\\alef","\\aleph");le("\\alefsym","\\aleph");le("\\Alpha","\\mathrm{A}");le("\\Beta","\\mathrm{B}");le("\\bull","\\bullet");le("\\Chi","\\mathrm{X}");le("\\clubs","\\clubsuit");le("\\cnums","\\mathbb{C}");le("\\Complex","\\mathbb{C}");le("\\Dagger","\\ddagger");le("\\diamonds","\\diamondsuit");le("\\empty","\\emptyset");le("\\Epsilon","\\mathrm{E}");le("\\Eta","\\mathrm{H}");le("\\exist","\\exists");le("\\harr","\\leftrightarrow");le("\\hArr","\\Leftrightarrow");le("\\Harr","\\Leftrightarrow");le("\\hearts","\\heartsuit");le("\\image","\\Im");le("\\infin","\\infty");le("\\Iota","\\mathrm{I}");le("\\isin","\\in");le("\\Kappa","\\mathrm{K}");le("\\larr","\\leftarrow");le("\\lArr","\\Leftarrow");le("\\Larr","\\Leftarrow");le("\\lrarr","\\leftrightarrow");le("\\lrArr","\\Leftrightarrow");le("\\Lrarr","\\Leftrightarrow");le("\\Mu","\\mathrm{M}");le("\\natnums","\\mathbb{N}");le("\\Nu","\\mathrm{N}");le("\\Omicron","\\mathrm{O}");le("\\plusmn","\\pm");le("\\rarr","\\rightarrow");le("\\rArr","\\Rightarrow");le("\\Rarr","\\Rightarrow");le("\\real","\\Re");le("\\reals","\\mathbb{R}");le("\\Reals","\\mathbb{R}");le("\\Rho","\\mathrm{P}");le("\\sdot","\\cdot");le("\\sect","\\S");le("\\spades","\\spadesuit");le("\\sub","\\subset");le("\\sube","\\subseteq");le("\\supe","\\supseteq");le("\\Tau","\\mathrm{T}");le("\\thetasym","\\vartheta");le("\\weierp","\\wp");le("\\Zeta","\\mathrm{Z}");le("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");le("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");le("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");le("\\bra","\\mathinner{\\langle{#1}|}");le("\\ket","\\mathinner{|{#1}\\rangle}");le("\\braket","\\mathinner{\\langle{#1}\\rangle}");le("\\Bra","\\left\\langle#1\\right|");le("\\Ket","\\left|#1\\right\\rangle");x$=o(t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var u=o(d=>p=>{t&&(p.macros.set("|",s),i.length&&p.macros.set("\\|",l));var m=d;if(!d&&i.length){var g=p.future();g.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?i:n,numArgs:0}},"midMacro");e.macros.set("|",u(!1)),i.length&&e.macros.set("\\|",u(!0));var h=e.consumeArg().tokens,f=e.expandTokens([...a,...h,...r]);return e.macros.endGroup(),{tokens:f.reverse(),numArgs:0}},"braketHelper");le("\\bra@ket",x$(!1));le("\\bra@set",x$(!0));le("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");le("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");le("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");le("\\angln","{\\angl n}");le("\\blue","\\textcolor{##6495ed}{#1}");le("\\orange","\\textcolor{##ffa500}{#1}");le("\\pink","\\textcolor{##ff00af}{#1}");le("\\red","\\textcolor{##df0030}{#1}");le("\\green","\\textcolor{##28ae7b}{#1}");le("\\gray","\\textcolor{gray}{#1}");le("\\purple","\\textcolor{##9d38bd}{#1}");le("\\blueA","\\textcolor{##ccfaff}{#1}");le("\\blueB","\\textcolor{##80f6ff}{#1}");le("\\blueC","\\textcolor{##63d9ea}{#1}");le("\\blueD","\\textcolor{##11accd}{#1}");le("\\blueE","\\textcolor{##0c7f99}{#1}");le("\\tealA","\\textcolor{##94fff5}{#1}");le("\\tealB","\\textcolor{##26edd5}{#1}");le("\\tealC","\\textcolor{##01d1c1}{#1}");le("\\tealD","\\textcolor{##01a995}{#1}");le("\\tealE","\\textcolor{##208170}{#1}");le("\\greenA","\\textcolor{##b6ffb0}{#1}");le("\\greenB","\\textcolor{##8af281}{#1}");le("\\greenC","\\textcolor{##74cf70}{#1}");le("\\greenD","\\textcolor{##1fab54}{#1}");le("\\greenE","\\textcolor{##0d923f}{#1}");le("\\goldA","\\textcolor{##ffd0a9}{#1}");le("\\goldB","\\textcolor{##ffbb71}{#1}");le("\\goldC","\\textcolor{##ff9c39}{#1}");le("\\goldD","\\textcolor{##e07d10}{#1}");le("\\goldE","\\textcolor{##a75a05}{#1}");le("\\redA","\\textcolor{##fca9a9}{#1}");le("\\redB","\\textcolor{##ff8482}{#1}");le("\\redC","\\textcolor{##f9685d}{#1}");le("\\redD","\\textcolor{##e84d39}{#1}");le("\\redE","\\textcolor{##bc2612}{#1}");le("\\maroonA","\\textcolor{##ffbde0}{#1}");le("\\maroonB","\\textcolor{##ff92c6}{#1}");le("\\maroonC","\\textcolor{##ed5fa6}{#1}");le("\\maroonD","\\textcolor{##ca337c}{#1}");le("\\maroonE","\\textcolor{##9e034e}{#1}");le("\\purpleA","\\textcolor{##ddd7ff}{#1}");le("\\purpleB","\\textcolor{##c6b9fc}{#1}");le("\\purpleC","\\textcolor{##aa87ff}{#1}");le("\\purpleD","\\textcolor{##7854ab}{#1}");le("\\purpleE","\\textcolor{##543b78}{#1}");le("\\mintA","\\textcolor{##f5f9e8}{#1}");le("\\mintB","\\textcolor{##edf2df}{#1}");le("\\mintC","\\textcolor{##e0e5cc}{#1}");le("\\grayA","\\textcolor{##f6f7f7}{#1}");le("\\grayB","\\textcolor{##f0f1f2}{#1}");le("\\grayC","\\textcolor{##e3e5e6}{#1}");le("\\grayD","\\textcolor{##d6d8da}{#1}");le("\\grayE","\\textcolor{##babec2}{#1}");le("\\grayF","\\textcolor{##888d93}{#1}");le("\\grayG","\\textcolor{##626569}{#1}");le("\\grayH","\\textcolor{##3b3e40}{#1}");le("\\grayI","\\textcolor{##21242c}{#1}");le("\\kaBlue","\\textcolor{##314453}{#1}");le("\\kaGreen","\\textcolor{##71B307}{#1}");b$={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},R7=class{static{o(this,"MacroExpander")}constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new D7(bbe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new v4(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Ao("EOF",n.loc)),this.pushTokens(i),r.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,l=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new nt("Extra }",a)}else if(a.text==="EOF")throw new nt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[l]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[l]==="{")&&a.text===e[l]){if(++l,l===e.length){r.splice(-l,l);break}}else l=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new nt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new nt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new nt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var u=a[l];if(u.text==="#"){if(l===0)throw new nt("Incomplete placeholder at end of macro body",u);if(u=a[--l],u.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(u.text))a.splice(l,2,...s[+u.text-1]);else throw new nt("Not a valid argument number",u)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Ao(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.indexOf("#")!==-1)for(var s=i.replace(/##/g,"");s.indexOf("#"+(a+1))!==-1;)++a;for(var l=new v4(i,this.settings),u=[],h=l.lex();h.text!=="EOF";)u.push(h),h=l.lex();u.reverse();var f={tokens:u,numArgs:a};return f}return i}isDefined(e){return this.macros.has(e)||fh.hasOwnProperty(e)||wn.math.hasOwnProperty(e)||wn.text.hasOwnProperty(e)||b$.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:fh.hasOwnProperty(e)&&!fh[e].primitive}},SG=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,c4=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),x7={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},AG={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u1E09:"c\u0327\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u1E1D:"e\u0327\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u0229:"e\u0327",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u0123:"g\u0327",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u1E29:"h\u0327",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u0137:"k\u0327",\u013A:"l\u0301",\u013E:"l\u030C",\u013C:"l\u0327",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u0157:"r\u0327",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u015F:"s\u0327",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u0163:"t\u0327",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u1E08:"C\u0327\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u1E1C:"E\u0327\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u0228:"E\u0327",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u0122:"G\u0327",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u1E28:"H\u0327",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0136:"K\u0327",\u0139:"L\u0301",\u013D:"L\u030C",\u013B:"L\u0327",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u0156:"R\u0327",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u015E:"S\u0327",\u0164:"T\u030C",\u1E6A:"T\u0307",\u0162:"T\u0327",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},x4=class t{static{o(this,"Parser")}constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new R7(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new nt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Ao("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(t.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&fh[i.text]&&fh[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var l=wn[this.mode][r].group,u=Xs.range(e),h;if(hxe.hasOwnProperty(l)){var f=l;h={type:"atom",mode:this.mode,family:f,loc:u,text:r}}else h={type:l,mode:this.mode,loc:u,text:r};s=h}else if(r.charCodeAt(0)>=128)this.settings.strict&&(LG(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Xs.range(e),text:r};else return null;if(this.consume(),a)for(var d=0;d{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),bp.default.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}var bp,Qf,Cbe,Sbe,A$,C$,qr,_be,Lbe,Dbe,Rbe,_$,Nbe,yr,Mbe,Ibe,gh,K7,Obe,Pbe,S$,Q7,Ni,Zf,yh,We,rr=R(()=>{"use strict";bp=Xi(o7(),1),Qf=/ /gi,Cbe=o(t=>t?_$(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Sbe=(()=>{let t=!1;return()=>{t||(Abe(),t=!0)}})();o(Abe,"setupDompurifyHooks");A$=o(t=>(Sbe(),bp.default.sanitize(t)),"removeScript"),C$=o((t,e)=>{if(e.flowchart?.htmlLabels!==!1){let r=e.securityLevel;r==="antiscript"||r==="strict"?t=A$(t):r!=="loose"&&(t=_$(t),t=t.replace(/ /g,">"),t=t.replace(/=/g,"="),t=Rbe(t))}return t},"sanitizeMore"),qr=o((t,e)=>t&&(e.dompurifyConfig?t=bp.default.sanitize(C$(t,e),e.dompurifyConfig).toString():t=bp.default.sanitize(C$(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),_be=o((t,e)=>typeof t=="string"?qr(t,e):t.flat().map(r=>qr(r,e)),"sanitizeTextOrArray"),Lbe=o(t=>Qf.test(t),"hasBreaks"),Dbe=o(t=>t.split(Qf),"splitBreaks"),Rbe=o(t=>t.replace(/#br#/g," "),"placeholderToBreak"),_$=o(t=>t.replace(Qf,"#br#"),"breakToPlaceholder"),Nbe=o(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e},"getUrl"),yr=o(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Mbe=o(function(...t){let e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Ibe=o(function(...t){let e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),gh=o(function(t){let e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),Obe=o((t,e)=>{let r=K7(t,"~"),n=K7(e,"~");return r===1&&n===1},"shouldCombineSets"),Pbe=o(t=>{let e=K7(t,"~"),r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);let n=[...t],i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),S$=o(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Q7=/\$\$(.*)\$\$/g,Ni=o(t=>(t.match(Q7)?.length??0)>0,"hasKatex"),Zf=o(async(t,e)=>{t=await yh(t,e);let r=document.createElement("div");r.innerHTML=t,r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);let i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),yh=o(async(t,e)=>{if(!Ni(t))return t;if(!(S$()||e.legacyMathML||e.forceLegacyMathML))return t.replace(Q7,"MathML is unsupported in this environment.");let{default:r}=await Promise.resolve().then(()=>(E$(),k$)),n=e.forceLegacyMathML||!S$()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(Qf).map(i=>Ni(i)?`${i}
`:`${i}
`).join("").replace(Q7,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))},"renderKatex"),We={getRows:Cbe,sanitizeText:qr,sanitizeTextOrArray:_be,hasBreaks:Lbe,splitBreaks:Dbe,lineBreakRegex:Qf,removeScript:A$,getUrl:Nbe,evaluate:yr,getMax:Mbe,getMin:Ibe}});var Bbe,Fbe,Sr,Lo,Yn=R(()=>{"use strict";ut();Bbe=o(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),Fbe=o(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Sr=o(function(t,e,r,n){let i=Fbe(e,r,n);Bbe(t,i)},"configureSvgSize"),Lo=o(function(t,e,r,n){let i=e.node().getBBox(),a=i.width,s=i.height;V.info(`SVG bounds: ${a}x${s}`,i);let l=0,u=0;V.info(`Graph bounds: ${l}x${u}`,t),l=a+r*2,u=s+r*2,V.info(`Calculated bounds: ${l}x${u}`),Sr(e,u,l,n);let h=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",h)},"setupGraphViewbox")});var S4,zbe,L$,D$,Z7=R(()=>{"use strict";ut();S4={},zbe=o((t,e,r)=>{let n="";return t in S4&&S4[t]?n=S4[t](r):V.warn(`No theme found for ${t}`),` & {
+?)[ \r ]*`,N7="[\u0300-\u036F]",z4e=new RegExp(N7+"+$"),G4e="("+AG+"+)|"+($4e+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(N7+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(N7+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+F4e)+("|"+B4e+")"),y3=class{static{o(this,"Lexer")}constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(G4e,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new So("EOF",new Xs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new gt("Unexpected character: '"+e[r]+"'",new So(e[r],new Xs(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(`
+`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new So(i,new Xs(this,r,this.tokenRegex.lastIndex))}},M7=class{static{o(this,"Namespace")}constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new gt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}},V4e=gG;fe("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});fe("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});fe("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});fe("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});fe("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});fe("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");fe("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});Iz={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};fe("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new gt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=Iz[e.text],n==null||n>=r)throw new gt("Invalid base-"+r+" digit "+e.text);for(var i;(i=Iz[t.future().text])!=null&&i{var n=t.consumeArg().tokens;if(n.length!==1)throw new gt("\\newcommand's first argument must be a macro name");var i=n[0].text,a=t.isDefined(i);if(a&&!e)throw new gt("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!r)throw new gt("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(n=t.consumeArg().tokens,n.length===1&&n[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new gt("Invalid number of arguments: "+l);s=parseInt(l),n=t.consumeArg().tokens}return t.macros.set(i,{tokens:n,numArgs:s}),""},"newcommand");fe("\\newcommand",t=>j7(t,!1,!0));fe("\\renewcommand",t=>j7(t,!0,!1));fe("\\providecommand",t=>j7(t,!0,!0));fe("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});fe("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});fe("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),hh[r],An.math[r],An.text[r]),""});fe("\\bgroup","{");fe("\\egroup","}");fe("~","\\nobreakspace");fe("\\lq","`");fe("\\rq","'");fe("\\aa","\\r a");fe("\\AA","\\r A");fe("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}");fe("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");fe("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");fe("\u212C","\\mathscr{B}");fe("\u2130","\\mathscr{E}");fe("\u2131","\\mathscr{F}");fe("\u210B","\\mathscr{H}");fe("\u2110","\\mathscr{I}");fe("\u2112","\\mathscr{L}");fe("\u2133","\\mathscr{M}");fe("\u211B","\\mathscr{R}");fe("\u212D","\\mathfrak{C}");fe("\u210C","\\mathfrak{H}");fe("\u2128","\\mathfrak{Z}");fe("\\Bbbk","\\Bbb{k}");fe("\xB7","\\cdotp");fe("\\llap","\\mathllap{\\textrm{#1}}");fe("\\rlap","\\mathrlap{\\textrm{#1}}");fe("\\clap","\\mathclap{\\textrm{#1}}");fe("\\mathstrut","\\vphantom{(}");fe("\\underbar","\\underline{\\text{#1}}");fe("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');fe("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");fe("\\ne","\\neq");fe("\u2260","\\neq");fe("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");fe("\u2209","\\notin");fe("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");fe("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");fe("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");fe("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");fe("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");fe("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");fe("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");fe("\u27C2","\\perp");fe("\u203C","\\mathclose{!\\mkern-0.8mu!}");fe("\u220C","\\notni");fe("\u231C","\\ulcorner");fe("\u231D","\\urcorner");fe("\u231E","\\llcorner");fe("\u231F","\\lrcorner");fe("\xA9","\\copyright");fe("\xAE","\\textregistered");fe("\uFE0F","\\textregistered");fe("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');fe("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');fe("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');fe("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');fe("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");fe("\u22EE","\\vdots");fe("\\varGamma","\\mathit{\\Gamma}");fe("\\varDelta","\\mathit{\\Delta}");fe("\\varTheta","\\mathit{\\Theta}");fe("\\varLambda","\\mathit{\\Lambda}");fe("\\varXi","\\mathit{\\Xi}");fe("\\varPi","\\mathit{\\Pi}");fe("\\varSigma","\\mathit{\\Sigma}");fe("\\varUpsilon","\\mathit{\\Upsilon}");fe("\\varPhi","\\mathit{\\Phi}");fe("\\varPsi","\\mathit{\\Psi}");fe("\\varOmega","\\mathit{\\Omega}");fe("\\substack","\\begin{subarray}{c}#1\\end{subarray}");fe("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");fe("\\boxed","\\fbox{$\\displaystyle{#1}$}");fe("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");fe("\\implies","\\DOTSB\\;\\Longrightarrow\\;");fe("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Oz={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};fe("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in Oz?e=Oz[r]:(r.slice(0,4)==="\\not"||r in An.math&&Jt.contains(["bin","rel"],An.math[r].group))&&(e="\\dotsb"),e});K7={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};fe("\\dotso",function(t){var e=t.future().text;return e in K7?"\\ldots\\,":"\\ldots"});fe("\\dotsc",function(t){var e=t.future().text;return e in K7&&e!==","?"\\ldots\\,":"\\ldots"});fe("\\cdots",function(t){var e=t.future().text;return e in K7?"\\@cdots\\,":"\\@cdots"});fe("\\dotsb","\\cdots");fe("\\dotsm","\\cdots");fe("\\dotsi","\\!\\cdots");fe("\\dotsx","\\ldots\\,");fe("\\DOTSI","\\relax");fe("\\DOTSB","\\relax");fe("\\DOTSX","\\relax");fe("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");fe("\\,","\\tmspace+{3mu}{.1667em}");fe("\\thinspace","\\,");fe("\\>","\\mskip{4mu}");fe("\\:","\\tmspace+{4mu}{.2222em}");fe("\\medspace","\\:");fe("\\;","\\tmspace+{5mu}{.2777em}");fe("\\thickspace","\\;");fe("\\!","\\tmspace-{3mu}{.1667em}");fe("\\negthinspace","\\!");fe("\\negmedspace","\\tmspace-{4mu}{.2222em}");fe("\\negthickspace","\\tmspace-{5mu}{.277em}");fe("\\enspace","\\kern.5em ");fe("\\enskip","\\hskip.5em\\relax");fe("\\quad","\\hskip1em\\relax");fe("\\qquad","\\hskip2em\\relax");fe("\\tag","\\@ifstar\\tag@literal\\tag@paren");fe("\\tag@paren","\\tag@literal{({#1})}");fe("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new gt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});fe("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");fe("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");fe("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");fe("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");fe("\\newline","\\\\\\relax");fe("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");_G=kt(jl["Main-Regular"][84][1]-.7*jl["Main-Regular"][65][1]);fe("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+_G+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");fe("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+_G+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");fe("\\hspace","\\@ifstar\\@hspacer\\@hspace");fe("\\@hspace","\\hskip #1\\relax");fe("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");fe("\\ordinarycolon",":");fe("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");fe("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');fe("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');fe("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');fe("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');fe("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');fe("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');fe("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');fe("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');fe("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');fe("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');fe("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');fe("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');fe("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');fe("\u2237","\\dblcolon");fe("\u2239","\\eqcolon");fe("\u2254","\\coloneqq");fe("\u2255","\\eqqcolon");fe("\u2A74","\\Coloneqq");fe("\\ratio","\\vcentcolon");fe("\\coloncolon","\\dblcolon");fe("\\colonequals","\\coloneqq");fe("\\coloncolonequals","\\Coloneqq");fe("\\equalscolon","\\eqqcolon");fe("\\equalscoloncolon","\\Eqqcolon");fe("\\colonminus","\\coloneq");fe("\\coloncolonminus","\\Coloneq");fe("\\minuscolon","\\eqcolon");fe("\\minuscoloncolon","\\Eqcolon");fe("\\coloncolonapprox","\\Colonapprox");fe("\\coloncolonsim","\\Colonsim");fe("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");fe("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");fe("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");fe("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");fe("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");fe("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");fe("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");fe("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");fe("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");fe("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");fe("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");fe("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");fe("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");fe("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}");fe("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}");fe("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}");fe("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}");fe("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}");fe("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}");fe("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}");fe("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}");fe("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}");fe("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}");fe("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}");fe("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}");fe("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}");fe("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}");fe("\\imath","\\html@mathml{\\@imath}{\u0131}");fe("\\jmath","\\html@mathml{\\@jmath}{\u0237}");fe("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");fe("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");fe("\u27E6","\\llbracket");fe("\u27E7","\\rrbracket");fe("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");fe("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");fe("\u2983","\\lBrace");fe("\u2984","\\rBrace");fe("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");fe("\u29B5","\\minuso");fe("\\darr","\\downarrow");fe("\\dArr","\\Downarrow");fe("\\Darr","\\Downarrow");fe("\\lang","\\langle");fe("\\rang","\\rangle");fe("\\uarr","\\uparrow");fe("\\uArr","\\Uparrow");fe("\\Uarr","\\Uparrow");fe("\\N","\\mathbb{N}");fe("\\R","\\mathbb{R}");fe("\\Z","\\mathbb{Z}");fe("\\alef","\\aleph");fe("\\alefsym","\\aleph");fe("\\Alpha","\\mathrm{A}");fe("\\Beta","\\mathrm{B}");fe("\\bull","\\bullet");fe("\\Chi","\\mathrm{X}");fe("\\clubs","\\clubsuit");fe("\\cnums","\\mathbb{C}");fe("\\Complex","\\mathbb{C}");fe("\\Dagger","\\ddagger");fe("\\diamonds","\\diamondsuit");fe("\\empty","\\emptyset");fe("\\Epsilon","\\mathrm{E}");fe("\\Eta","\\mathrm{H}");fe("\\exist","\\exists");fe("\\harr","\\leftrightarrow");fe("\\hArr","\\Leftrightarrow");fe("\\Harr","\\Leftrightarrow");fe("\\hearts","\\heartsuit");fe("\\image","\\Im");fe("\\infin","\\infty");fe("\\Iota","\\mathrm{I}");fe("\\isin","\\in");fe("\\Kappa","\\mathrm{K}");fe("\\larr","\\leftarrow");fe("\\lArr","\\Leftarrow");fe("\\Larr","\\Leftarrow");fe("\\lrarr","\\leftrightarrow");fe("\\lrArr","\\Leftrightarrow");fe("\\Lrarr","\\Leftrightarrow");fe("\\Mu","\\mathrm{M}");fe("\\natnums","\\mathbb{N}");fe("\\Nu","\\mathrm{N}");fe("\\Omicron","\\mathrm{O}");fe("\\plusmn","\\pm");fe("\\rarr","\\rightarrow");fe("\\rArr","\\Rightarrow");fe("\\Rarr","\\Rightarrow");fe("\\real","\\Re");fe("\\reals","\\mathbb{R}");fe("\\Reals","\\mathbb{R}");fe("\\Rho","\\mathrm{P}");fe("\\sdot","\\cdot");fe("\\sect","\\S");fe("\\spades","\\spadesuit");fe("\\sub","\\subset");fe("\\sube","\\subseteq");fe("\\supe","\\supseteq");fe("\\Tau","\\mathrm{T}");fe("\\thetasym","\\vartheta");fe("\\weierp","\\wp");fe("\\Zeta","\\mathrm{Z}");fe("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");fe("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");fe("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");fe("\\bra","\\mathinner{\\langle{#1}|}");fe("\\ket","\\mathinner{|{#1}\\rangle}");fe("\\braket","\\mathinner{\\langle{#1}\\rangle}");fe("\\Bra","\\left\\langle#1\\right|");fe("\\Ket","\\left|#1\\right\\rangle");DG=o(t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var u=o(d=>p=>{t&&(p.macros.set("|",s),i.length&&p.macros.set("\\|",l));var m=d;if(!d&&i.length){var g=p.future();g.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?i:n,numArgs:0}},"midMacro");e.macros.set("|",u(!1)),i.length&&e.macros.set("\\|",u(!0));var h=e.consumeArg().tokens,f=e.expandTokens([...a,...h,...r]);return e.macros.endGroup(),{tokens:f.reverse(),numArgs:0}},"braketHelper");fe("\\bra@ket",DG(!1));fe("\\bra@set",DG(!0));fe("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");fe("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");fe("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");fe("\\angln","{\\angl n}");fe("\\blue","\\textcolor{##6495ed}{#1}");fe("\\orange","\\textcolor{##ffa500}{#1}");fe("\\pink","\\textcolor{##ff00af}{#1}");fe("\\red","\\textcolor{##df0030}{#1}");fe("\\green","\\textcolor{##28ae7b}{#1}");fe("\\gray","\\textcolor{gray}{#1}");fe("\\purple","\\textcolor{##9d38bd}{#1}");fe("\\blueA","\\textcolor{##ccfaff}{#1}");fe("\\blueB","\\textcolor{##80f6ff}{#1}");fe("\\blueC","\\textcolor{##63d9ea}{#1}");fe("\\blueD","\\textcolor{##11accd}{#1}");fe("\\blueE","\\textcolor{##0c7f99}{#1}");fe("\\tealA","\\textcolor{##94fff5}{#1}");fe("\\tealB","\\textcolor{##26edd5}{#1}");fe("\\tealC","\\textcolor{##01d1c1}{#1}");fe("\\tealD","\\textcolor{##01a995}{#1}");fe("\\tealE","\\textcolor{##208170}{#1}");fe("\\greenA","\\textcolor{##b6ffb0}{#1}");fe("\\greenB","\\textcolor{##8af281}{#1}");fe("\\greenC","\\textcolor{##74cf70}{#1}");fe("\\greenD","\\textcolor{##1fab54}{#1}");fe("\\greenE","\\textcolor{##0d923f}{#1}");fe("\\goldA","\\textcolor{##ffd0a9}{#1}");fe("\\goldB","\\textcolor{##ffbb71}{#1}");fe("\\goldC","\\textcolor{##ff9c39}{#1}");fe("\\goldD","\\textcolor{##e07d10}{#1}");fe("\\goldE","\\textcolor{##a75a05}{#1}");fe("\\redA","\\textcolor{##fca9a9}{#1}");fe("\\redB","\\textcolor{##ff8482}{#1}");fe("\\redC","\\textcolor{##f9685d}{#1}");fe("\\redD","\\textcolor{##e84d39}{#1}");fe("\\redE","\\textcolor{##bc2612}{#1}");fe("\\maroonA","\\textcolor{##ffbde0}{#1}");fe("\\maroonB","\\textcolor{##ff92c6}{#1}");fe("\\maroonC","\\textcolor{##ed5fa6}{#1}");fe("\\maroonD","\\textcolor{##ca337c}{#1}");fe("\\maroonE","\\textcolor{##9e034e}{#1}");fe("\\purpleA","\\textcolor{##ddd7ff}{#1}");fe("\\purpleB","\\textcolor{##c6b9fc}{#1}");fe("\\purpleC","\\textcolor{##aa87ff}{#1}");fe("\\purpleD","\\textcolor{##7854ab}{#1}");fe("\\purpleE","\\textcolor{##543b78}{#1}");fe("\\mintA","\\textcolor{##f5f9e8}{#1}");fe("\\mintB","\\textcolor{##edf2df}{#1}");fe("\\mintC","\\textcolor{##e0e5cc}{#1}");fe("\\grayA","\\textcolor{##f6f7f7}{#1}");fe("\\grayB","\\textcolor{##f0f1f2}{#1}");fe("\\grayC","\\textcolor{##e3e5e6}{#1}");fe("\\grayD","\\textcolor{##d6d8da}{#1}");fe("\\grayE","\\textcolor{##babec2}{#1}");fe("\\grayF","\\textcolor{##888d93}{#1}");fe("\\grayG","\\textcolor{##626569}{#1}");fe("\\grayH","\\textcolor{##3b3e40}{#1}");fe("\\grayI","\\textcolor{##21242c}{#1}");fe("\\kaBlue","\\textcolor{##314453}{#1}");fe("\\kaGreen","\\textcolor{##71B307}{#1}");LG={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},I7=class{static{o(this,"MacroExpander")}constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new M7(V4e,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new y3(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new So("EOF",n.loc)),this.pushTokens(i),r.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,l=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new gt("Extra }",a)}else if(a.text==="EOF")throw new gt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[l]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[l]==="{")&&a.text===e[l]){if(++l,l===e.length){r.splice(-l,l);break}}else l=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new gt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new gt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new gt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var u=a[l];if(u.text==="#"){if(l===0)throw new gt("Incomplete placeholder at end of macro body",u);if(u=a[--l],u.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(u.text))a.splice(l,2,...s[+u.text-1]);else throw new gt("Not a valid argument number",u)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new So(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.indexOf("#")!==-1)for(var s=i.replace(/##/g,"");s.indexOf("#"+(a+1))!==-1;)++a;for(var l=new y3(i,this.settings),u=[],h=l.lex();h.text!=="EOF";)u.push(h),h=l.lex();u.reverse();var f={tokens:u,numArgs:a};return f}return i}isDefined(e){return this.macros.has(e)||hh.hasOwnProperty(e)||An.math.hasOwnProperty(e)||An.text.hasOwnProperty(e)||LG.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:hh.hasOwnProperty(e)&&!hh[e].primitive}},Pz=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,l3=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),T7={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},Bz={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u1E09:"c\u0327\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u1E1D:"e\u0327\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u0229:"e\u0327",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u0123:"g\u0327",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u1E29:"h\u0327",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u0137:"k\u0327",\u013A:"l\u0301",\u013E:"l\u030C",\u013C:"l\u0327",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u0157:"r\u0327",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u015F:"s\u0327",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u0163:"t\u0327",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u1E08:"C\u0327\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u1E1C:"E\u0327\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u0228:"E\u0327",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u0122:"G\u0327",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u1E28:"H\u0327",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0136:"K\u0327",\u0139:"L\u0301",\u013D:"L\u030C",\u013B:"L\u0327",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u0156:"R\u0327",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u015E:"S\u0327",\u0164:"T\u030C",\u1E6A:"T\u0307",\u0162:"T\u0327",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},v3=class t{static{o(this,"Parser")}constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new I7(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new gt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new So("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(t.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&hh[i.text]&&hh[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var l=An[this.mode][r].group,u=Xs.range(e),h;if(Mbe.hasOwnProperty(l)){var f=l;h={type:"atom",mode:this.mode,family:f,loc:u,text:r}}else h={type:l,mode:this.mode,loc:u,text:r};s=h}else if(r.charCodeAt(0)>=128)this.settings.strict&&($z(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Xs.range(e),text:r};else return null;if(this.consume(),a)for(var d=0;d{e instanceof Element&&e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),ch.addHook("afterSanitizeAttributes",e=>{e instanceof Element&&e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}var nd,Y4e,X4e,BG,OG,Tr,K4e,Q4e,Z4e,J4e,FG,e3e,fr,t3e,r3e,ec,J7,n3e,i3e,PG,eA,pi,id,mh,Ze,gr=N(()=>{"use strict";u7();nd=/ /gi,Y4e=o(t=>t?FG(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),X4e=(()=>{let t=!1;return()=>{t||(j4e(),t=!0)}})();o(j4e,"setupDompurifyHooks");BG=o(t=>(X4e(),ch.sanitize(t)),"removeScript"),OG=o((t,e)=>{if(e.flowchart?.htmlLabels!==!1){let r=e.securityLevel;r==="antiscript"||r==="strict"?t=BG(t):r!=="loose"&&(t=FG(t),t=t.replace(/ /g,">"),t=t.replace(/=/g,"="),t=J4e(t))}return t},"sanitizeMore"),Tr=o((t,e)=>t&&(e.dompurifyConfig?t=ch.sanitize(OG(t,e),e.dompurifyConfig).toString():t=ch.sanitize(OG(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),K4e=o((t,e)=>typeof t=="string"?Tr(t,e):t.flat().map(r=>Tr(r,e)),"sanitizeTextOrArray"),Q4e=o(t=>nd.test(t),"hasBreaks"),Z4e=o(t=>t.split(nd),"splitBreaks"),J4e=o(t=>t.replace(/#br#/g," "),"placeholderToBreak"),FG=o(t=>t.replace(nd,"#br#"),"breakToPlaceholder"),e3e=o(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e},"getUrl"),fr=o(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),t3e=o(function(...t){let e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),r3e=o(function(...t){let e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),ec=o(function(t){let e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),n3e=o((t,e)=>{let r=J7(t,"~"),n=J7(e,"~");return r===1&&n===1},"shouldCombineSets"),i3e=o(t=>{let e=J7(t,"~"),r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);let n=[...t],i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),PG=o(()=>window.MathMLElement!==void 0,"isMathMLSupported"),eA=/\$\$(.*)\$\$/g,pi=o(t=>(t.match(eA)?.length??0)>0,"hasKatex"),id=o(async(t,e)=>{t=await mh(t,e);let r=document.createElement("div");r.innerHTML=t,r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);let i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),mh=o(async(t,e)=>{if(!pi(t))return t;if(!(PG()||e.legacyMathML||e.forceLegacyMathML))return t.replace(eA,"MathML is unsupported in this environment.");let{default:r}=await Promise.resolve().then(()=>(IG(),MG)),n=e.forceLegacyMathML||!PG()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(nd).map(i=>pi(i)?`${i}
`:`${i}
`).join("").replace(eA,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))},"renderKatex"),Ze={getRows:Y4e,sanitizeText:Tr,sanitizeTextOrArray:K4e,hasBreaks:Q4e,splitBreaks:Z4e,lineBreakRegex:nd,removeScript:BG,getUrl:e3e,evaluate:fr,getMax:t3e,getMin:r3e}});var a3e,s3e,vn,Ao,Ei=N(()=>{"use strict";vt();a3e=o(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),s3e=o(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),vn=o(function(t,e,r,n){let i=s3e(e,r,n);a3e(t,i)},"configureSvgSize"),Ao=o(function(t,e,r,n){let i=e.node().getBBox(),a=i.width,s=i.height;Y.info(`SVG bounds: ${a}x${s}`,i);let l=0,u=0;Y.info(`Graph bounds: ${l}x${u}`,t),l=a+r*2,u=s+r*2,Y.info(`Calculated bounds: ${l}x${u}`),vn(e,u,l,n);let h=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",h)},"setupGraphViewbox")});var S3,o3e,$G,zG,tA=N(()=>{"use strict";vt();S3={},o3e=o((t,e,r)=>{let n="";return t in S3&&S3[t]?n=S3[t](r):Y.warn(`No theme found for ${t}`),` & {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
fill: ${r.textColor}
}
-
+ @keyframes edge-animation-frame {
+ from {
+ stroke-dashoffset: 0;
+ }
+ }
+ @keyframes dash {
+ to {
+ stroke-dashoffset: 0;
+ }
+ }
+ & .edge-animation-slow {
+ stroke-dasharray: 9,5 !important;
+ stroke-dashoffset: 900;
+ animation: dash 50s linear infinite;
+ stroke-linecap: round;
+ }
+ & .edge-animation-fast {
+ stroke-dasharray: 9,5 !important;
+ stroke-dashoffset: 900;
+ animation: dash 20s linear infinite;
+ stroke-linecap: round;
+ }
/* Classes common for multiple diagrams */
& .error-icon {
@@ -325,61 +346,88 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
${n}
${e}
-`},"getStyles"),L$=o((t,e)=>{e!==void 0&&(S4[t]=e)},"addStylesForDiagram"),D$=zbe});var ly={};hr(ly,{clear:()=>vr,getAccDescription:()=>Lr,getAccTitle:()=>Ar,getDiagramTitle:()=>Xr,setAccDescription:()=>_r,setAccTitle:()=>kr,setDiagramTitle:()=>nn});var J7,eS,tS,rS,vr,kr,Ar,_r,Lr,nn,Xr,bi=R(()=>{"use strict";rr();qs();J7="",eS="",tS="",rS=o(t=>qr(t,Or()),"sanitizeText"),vr=o(()=>{J7="",tS="",eS=""},"clear"),kr=o(t=>{J7=rS(t).replace(/^\s+/g,"")},"setAccTitle"),Ar=o(()=>J7,"getAccTitle"),_r=o(t=>{tS=rS(t).replace(/\n\s+/g,`
-`)},"setAccDescription"),Lr=o(()=>tS,"getAccDescription"),nn=o(t=>{eS=rS(t)},"setDiagramTitle"),Xr=o(()=>eS,"getDiagramTitle")});var R$,Gbe,de,iS,_4,$be,aS,Vbe,A4,Jf,cy,nS,_t=R(()=>{"use strict";Hf();ut();qs();rr();Yn();Z7();bi();R$=V,Gbe=$1,de=Or,iS=Zb,_4=uh,$be=o(t=>qr(t,de()),"sanitizeText"),aS=Lo,Vbe=o(()=>ly,"getCommonDb"),A4={},Jf=o((t,e,r)=>{A4[t]&&R$.warn(`Diagram with id ${t} already registered. Overwriting.`),A4[t]=e,r&&$C(t,r),L$(t,e.styles),e.injectUtils?.(R$,Gbe,de,$be,aS,Vbe(),()=>{})},"registerDiagram"),cy=o(t=>{if(t in A4)return A4[t];throw new nS(t)},"getDiagram"),nS=class extends Error{static{o(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}}});var ul,vh,ja,cl,nc,uy,sS,oS,L4,D4,N$,Ube,Hbe,Ybe,Wbe,qbe,Xbe,jbe,Kbe,Qbe,Zbe,Jbe,e4e,t4e,r4e,n4e,i4e,a4e,M$,s4e,o4e,I$,l4e,c4e,u4e,h4e,xh,f4e,d4e,p4e,m4e,g4e,hy,lS=R(()=>{"use strict";_t();rr();bi();ul=[],vh=[""],ja="global",cl="",nc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],uy=[],sS="",oS=!1,L4=4,D4=2,Ube=o(function(){return N$},"getC4Type"),Hbe=o(function(t){N$=qr(t,de())},"setC4Type"),Ybe=o(function(t,e,r,n,i,a,s,l,u){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let h={},f=uy.find(d=>d.from===e&&d.to===r);if(f?h=f:uy.push(h),h.type=t,h.from=e,h.to=r,h.label={text:n},i==null)h.techn={text:""};else if(typeof i=="object"){let[d,p]=Object.entries(i)[0];h[d]={text:p}}else h.techn={text:i};if(a==null)h.descr={text:""};else if(typeof a=="object"){let[d,p]=Object.entries(a)[0];h[d]={text:p}}else h.descr={text:a};if(typeof s=="object"){let[d,p]=Object.entries(s)[0];h[d]=p}else h.sprite=s;if(typeof l=="object"){let[d,p]=Object.entries(l)[0];h[d]=p}else h.tags=l;if(typeof u=="object"){let[d,p]=Object.entries(u)[0];h[d]=p}else h.link=u;h.wrap=xh()},"addRel"),Wbe=o(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let l={},u=ul.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ul.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.descr={text:""};else if(typeof n=="object"){let[h,f]=Object.entries(n)[0];l[h]={text:f}}else l.descr={text:n};if(typeof i=="object"){let[h,f]=Object.entries(i)[0];l[h]=f}else l.sprite=i;if(typeof a=="object"){let[h,f]=Object.entries(a)[0];l[h]=f}else l.tags=a;if(typeof s=="object"){let[h,f]=Object.entries(s)[0];l[h]=f}else l.link=s;l.typeC4Shape={text:t},l.parentBoundary=ja,l.wrap=xh()},"addPersonOrSystem"),qbe=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ul.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ul.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=xh(),u.typeC4Shape={text:t},u.parentBoundary=ja},"addContainer"),Xbe=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ul.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ul.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=xh(),u.typeC4Shape={text:t},u.parentBoundary=ja},"addComponent"),jbe=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=nc.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,nc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=ja,a.wrap=xh(),cl=ja,ja=t,vh.push(cl)},"addPersonOrSystemBoundary"),Kbe=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=nc.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,nc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=ja,a.wrap=xh(),cl=ja,ja=t,vh.push(cl)},"addContainerBoundary"),Qbe=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=nc.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,nc.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.type={text:"node"};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.type={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.nodeType=t,u.parentBoundary=ja,u.wrap=xh(),cl=ja,ja=e,vh.push(cl)},"addDeploymentNode"),Zbe=o(function(){ja=cl,vh.pop(),cl=vh.pop(),vh.push(cl)},"popBoundaryParseStack"),Jbe=o(function(t,e,r,n,i,a,s,l,u,h,f){let d=ul.find(p=>p.alias===e);if(!(d===void 0&&(d=nc.find(p=>p.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[p,m]=Object.entries(r)[0];d[p]=m}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[p,m]=Object.entries(n)[0];d[p]=m}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[p,m]=Object.entries(i)[0];d[p]=m}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[p,m]=Object.entries(a)[0];d[p]=m}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[p,m]=Object.entries(s)[0];d[p]=m}else d.shape=s;if(l!=null)if(typeof l=="object"){let[p,m]=Object.entries(l)[0];d[p]=m}else d.sprite=l;if(u!=null)if(typeof u=="object"){let[p,m]=Object.entries(u)[0];d[p]=m}else d.techn=u;if(h!=null)if(typeof h=="object"){let[p,m]=Object.entries(h)[0];d[p]=m}else d.legendText=h;if(f!=null)if(typeof f=="object"){let[p,m]=Object.entries(f)[0];d[p]=m}else d.legendSprite=f}},"updateElStyle"),e4e=o(function(t,e,r,n,i,a,s){let l=uy.find(u=>u.from===e&&u.to===r);if(l!==void 0){if(n!=null)if(typeof n=="object"){let[u,h]=Object.entries(n)[0];l[u]=h}else l.textColor=n;if(i!=null)if(typeof i=="object"){let[u,h]=Object.entries(i)[0];l[u]=h}else l.lineColor=i;if(a!=null)if(typeof a=="object"){let[u,h]=Object.entries(a)[0];l[u]=parseInt(h)}else l.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[u,h]=Object.entries(s)[0];l[u]=parseInt(h)}else l.offsetY=parseInt(s)}},"updateRelStyle"),t4e=o(function(t,e,r){let n=L4,i=D4;if(typeof e=="object"){let a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){let a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(L4=n),i>=1&&(D4=i)},"updateLayoutConfig"),r4e=o(function(){return L4},"getC4ShapeInRow"),n4e=o(function(){return D4},"getC4BoundaryInRow"),i4e=o(function(){return ja},"getCurrentBoundaryParse"),a4e=o(function(){return cl},"getParentBoundaryParse"),M$=o(function(t){return t==null?ul:ul.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),s4e=o(function(t){return ul.find(e=>e.alias===t)},"getC4Shape"),o4e=o(function(t){return Object.keys(M$(t))},"getC4ShapeKeys"),I$=o(function(t){return t==null?nc:nc.filter(e=>e.parentBoundary===t)},"getBoundaries"),l4e=I$,c4e=o(function(){return uy},"getRels"),u4e=o(function(){return sS},"getTitle"),h4e=o(function(t){oS=t},"setWrap"),xh=o(function(){return oS},"autoWrap"),f4e=o(function(){ul=[],nc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],cl="",ja="global",vh=[""],uy=[],vh=[""],sS="",oS=!1,L4=4,D4=2},"clear"),d4e={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},p4e={FILLED:0,OPEN:1},m4e={LEFTOF:0,RIGHTOF:1,OVER:2},g4e=o(function(t){sS=qr(t,de())},"setTitle"),hy={addPersonOrSystem:Wbe,addPersonOrSystemBoundary:jbe,addContainer:qbe,addContainerBoundary:Kbe,addComponent:Xbe,addDeploymentNode:Qbe,popBoundaryParseStack:Zbe,addRel:Ybe,updateElStyle:Jbe,updateRelStyle:e4e,updateLayoutConfig:t4e,autoWrap:xh,setWrap:h4e,getC4ShapeArray:M$,getC4Shape:s4e,getC4ShapeKeys:o4e,getBoundaries:I$,getBoundarys:l4e,getCurrentBoundaryParse:i4e,getParentBoundaryParse:a4e,getRels:c4e,getTitle:u4e,getC4Type:Ube,getC4ShapeInRow:r4e,getC4BoundaryInRow:n4e,setAccTitle:kr,getAccTitle:Ar,getAccDescription:Lr,setAccDescription:_r,getConfig:o(()=>de().c4,"getConfig"),clear:f4e,LINETYPE:d4e,ARROWTYPE:p4e,PLACEMENT:m4e,setTitle:g4e,setC4Type:Hbe}});function ed(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}var cS=R(()=>{"use strict";o(ed,"ascending")});function uS(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}var O$=R(()=>{"use strict";o(uS,"descending")});function td(t){let e,r,n;t.length!==2?(e=ed,r=o((l,u)=>ed(t(l),u),"compare2"),n=o((l,u)=>t(l)-u,"delta")):(e=t===ed||t===uS?t:y4e,r=t,n=t);function i(l,u,h=0,f=l.length){if(h>>1;r(l[d],u)<0?h=d+1:f=d}while(h>>1;r(l[d],u)<=0?h=d+1:f=d}while(hh&&n(l[d-1],u)>-n(l[d],u)?d-1:d}return o(s,"center"),{left:i,center:s,right:a}}function y4e(){return 0}var hS=R(()=>{"use strict";cS();O$();o(td,"bisector");o(y4e,"zero")});function fS(t){return t===null?NaN:+t}var P$=R(()=>{"use strict";o(fS,"number")});var B$,F$,v4e,x4e,dS,z$=R(()=>{"use strict";cS();hS();P$();B$=td(ed),F$=B$.right,v4e=B$.left,x4e=td(fS).center,dS=F$});function G$({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function b4e({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function w4e({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function T4e(t){return t!==null&&typeof t=="object"?t.valueOf():t}var wp,$$=R(()=>{"use strict";wp=class extends Map{static{o(this,"InternMap")}constructor(e,r=T4e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[n,i]of e)this.set(n,i)}get(e){return super.get(G$(this,e))}has(e){return super.has(G$(this,e))}set(e,r){return super.set(b4e(this,e),r)}delete(e){return super.delete(w4e(this,e))}};o(G$,"intern_get");o(b4e,"intern_set");o(w4e,"intern_delete");o(T4e,"keyof")});function R4(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=k4e?10:a>=E4e?5:a>=C4e?2:1,l,u,h;return i<0?(h=Math.pow(10,-i)/s,l=Math.round(t*h),u=Math.round(e*h),l/he&&--u,h=-h):(h=Math.pow(10,i)*s,l=Math.round(t/h),u=Math.round(e/h),l*he&&--u),u0))return[];if(t===e)return[t];let n=e=i))return[];let l=a-i+1,u=new Array(l);if(n)if(s<0)for(let h=0;h{"use strict";k4e=Math.sqrt(50),E4e=Math.sqrt(10),C4e=Math.sqrt(2);o(R4,"tickSpec");o(N4,"ticks");o(fy,"tickIncrement");o(Tp,"tickStep")});function M4(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}var U$=R(()=>{"use strict";o(M4,"max")});function I4(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var H$=R(()=>{"use strict";o(I4,"min")});function O4(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n{"use strict";o(O4,"range")});var bh=R(()=>{"use strict";z$();hS();U$();H$();Y$();V$();$$()});function pS(t){return t}var W$=R(()=>{"use strict";o(pS,"default")});function S4e(t){return"translate("+t+",0)"}function A4e(t){return"translate(0,"+t+")"}function _4e(t){return e=>+t(e)}function L4e(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function D4e(){return!this.__axis}function X$(t,e){var r=[],n=null,i=null,a=6,s=6,l=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,h=t===B4||t===P4?-1:1,f=t===P4||t===mS?"x":"y",d=t===B4||t===gS?S4e:A4e;function p(m){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),y=i??(e.tickFormat?e.tickFormat.apply(e,r):pS),v=Math.max(a,0)+l,x=e.range(),b=+x[0]+u,w=+x[x.length-1]+u,S=(e.bandwidth?L4e:_4e)(e.copy(),u),T=m.selection?m.selection():m,E=T.selectAll(".domain").data([null]),_=T.selectAll(".tick").data(g,e).order(),A=_.exit(),L=_.enter().append("g").attr("class","tick"),M=_.select("line"),N=_.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),_=_.merge(L),M=M.merge(L.append("line").attr("stroke","currentColor").attr(f+"2",h*a)),N=N.merge(L.append("text").attr("fill","currentColor").attr(f,h*v).attr("dy",t===B4?"0em":t===gS?"0.71em":"0.32em")),m!==T&&(E=E.transition(m),_=_.transition(m),M=M.transition(m),N=N.transition(m),A=A.transition(m).attr("opacity",q$).attr("transform",function(k){return isFinite(k=S(k))?d(k+u):this.getAttribute("transform")}),L.attr("opacity",q$).attr("transform",function(k){var I=this.parentNode.__axis;return d((I&&isFinite(I=I(k))?I:S(k))+u)})),A.remove(),E.attr("d",t===P4||t===mS?s?"M"+h*s+","+b+"H"+u+"V"+w+"H"+h*s:"M"+u+","+b+"V"+w:s?"M"+b+","+h*s+"V"+u+"H"+w+"V"+h*s:"M"+b+","+u+"H"+w),_.attr("opacity",1).attr("transform",function(k){return d(S(k)+u)}),M.attr(f+"2",h*a),N.attr(f,h*v).text(y),T.filter(D4e).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===mS?"start":t===P4?"end":"middle"),T.each(function(){this.__axis=S})}return o(p,"axis"),p.scale=function(m){return arguments.length?(e=m,p):e},p.ticks=function(){return r=Array.from(arguments),p},p.tickArguments=function(m){return arguments.length?(r=m==null?[]:Array.from(m),p):r.slice()},p.tickValues=function(m){return arguments.length?(n=m==null?null:Array.from(m),p):n&&n.slice()},p.tickFormat=function(m){return arguments.length?(i=m,p):i},p.tickSize=function(m){return arguments.length?(a=s=+m,p):a},p.tickSizeInner=function(m){return arguments.length?(a=+m,p):a},p.tickSizeOuter=function(m){return arguments.length?(s=+m,p):s},p.tickPadding=function(m){return arguments.length?(l=+m,p):l},p.offset=function(m){return arguments.length?(u=+m,p):u},p}function yS(t){return X$(B4,t)}function vS(t){return X$(gS,t)}var B4,mS,gS,P4,q$,j$=R(()=>{"use strict";W$();B4=1,mS=2,gS=3,P4=4,q$=1e-6;o(S4e,"translateX");o(A4e,"translateY");o(_4e,"number");o(L4e,"center");o(D4e,"entering");o(X$,"axis");o(yS,"axisTop");o(vS,"axisBottom")});var K$=R(()=>{"use strict";j$()});function Z$(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function M4e(t,e){for(var r=0,n=t.length,i;r{"use strict";R4e={value:o(()=>{},"value")};o(Z$,"dispatch");o(F4,"Dispatch");o(N4e,"parseTypenames");F4.prototype=Z$.prototype={constructor:F4,on:o(function(t,e){var r=this._,n=N4e(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n{"use strict";J$()});var z4,wS,TS=R(()=>{"use strict";z4="http://www.w3.org/1999/xhtml",wS={svg:"http://www.w3.org/2000/svg",xhtml:z4,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function ic(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),wS.hasOwnProperty(e)?{space:wS[e],local:t}:t}var G4=R(()=>{"use strict";TS();o(ic,"default")});function I4e(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===z4&&e.documentElement.namespaceURI===z4?e.createElement(t):e.createElementNS(r,t)}}function O4e(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function dy(t){var e=ic(t);return(e.local?O4e:I4e)(e)}var kS=R(()=>{"use strict";G4();TS();o(I4e,"creatorInherit");o(O4e,"creatorFixed");o(dy,"default")});function P4e(){}function wh(t){return t==null?P4e:function(){return this.querySelector(t)}}var $4=R(()=>{"use strict";o(P4e,"none");o(wh,"default")});function ES(t){typeof t!="function"&&(t=wh(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";hl();$4();o(ES,"default")});function CS(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}var tV=R(()=>{"use strict";o(CS,"array")});function B4e(){return[]}function kp(t){return t==null?B4e:function(){return this.querySelectorAll(t)}}var SS=R(()=>{"use strict";o(B4e,"empty");o(kp,"default")});function F4e(t){return function(){return CS(t.apply(this,arguments))}}function AS(t){typeof t=="function"?t=F4e(t):t=kp(t);for(var e=this._groups,r=e.length,n=[],i=[],a=0;a{"use strict";hl();tV();SS();o(F4e,"arrayAll");o(AS,"default")});function Ep(t){return function(){return this.matches(t)}}function V4(t){return function(e){return e.matches(t)}}var py=R(()=>{"use strict";o(Ep,"default");o(V4,"childMatcher")});function G4e(t){return function(){return z4e.call(this.children,t)}}function $4e(){return this.firstElementChild}function _S(t){return this.select(t==null?$4e:G4e(typeof t=="function"?t:V4(t)))}var z4e,nV=R(()=>{"use strict";py();z4e=Array.prototype.find;o(G4e,"childFind");o($4e,"childFirst");o(_S,"default")});function U4e(){return Array.from(this.children)}function H4e(t){return function(){return V4e.call(this.children,t)}}function LS(t){return this.selectAll(t==null?U4e:H4e(typeof t=="function"?t:V4(t)))}var V4e,iV=R(()=>{"use strict";py();V4e=Array.prototype.filter;o(U4e,"children");o(H4e,"childrenFilter");o(LS,"default")});function DS(t){typeof t!="function"&&(t=Ep(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";hl();py();o(DS,"default")});function my(t){return new Array(t.length)}var RS=R(()=>{"use strict";o(my,"default")});function NS(){return new Zn(this._enter||this._groups.map(my),this._parents)}function gy(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}var MS=R(()=>{"use strict";RS();hl();o(NS,"default");o(gy,"EnterNode");gy.prototype={constructor:gy,appendChild:o(function(t){return this._parent.insertBefore(t,this._next)},"appendChild"),insertBefore:o(function(t,e){return this._parent.insertBefore(t,e)},"insertBefore"),querySelector:o(function(t){return this._parent.querySelector(t)},"querySelector"),querySelectorAll:o(function(t){return this._parent.querySelectorAll(t)},"querySelectorAll")}});function IS(t){return function(){return t}}var sV=R(()=>{"use strict";o(IS,"default")});function Y4e(t,e,r,n,i,a){for(var s=0,l,u=e.length,h=a.length;s=w&&(w=b+1);!(T=v[w])&&++w{"use strict";hl();MS();sV();o(Y4e,"bindIndex");o(W4e,"bindKey");o(q4e,"datum");o(OS,"default");o(X4e,"arraylike")});function PS(){return new Zn(this._exit||this._groups.map(my),this._parents)}var lV=R(()=>{"use strict";RS();hl();o(PS,"default")});function BS(t,e,r){var n=this.enter(),i=this,a=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}var cV=R(()=>{"use strict";o(BS,"default")});function FS(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,a=n.length,s=Math.min(i,a),l=new Array(i),u=0;u{"use strict";hl();o(FS,"default")});function zS(){for(var t=this._groups,e=-1,r=t.length;++e=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}var hV=R(()=>{"use strict";o(zS,"default")});function GS(t){t||(t=j4e);function e(d,p){return d&&p?t(d.__data__,p.__data__):!d-!p}o(e,"compareNode");for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}var fV=R(()=>{"use strict";hl();o(GS,"default");o(j4e,"ascending")});function $S(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}var dV=R(()=>{"use strict";o($S,"default")});function VS(){return Array.from(this)}var pV=R(()=>{"use strict";o(VS,"default")});function US(){for(var t=this._groups,e=0,r=t.length;e{"use strict";o(US,"default")});function HS(){let t=0;for(let e of this)++t;return t}var gV=R(()=>{"use strict";o(HS,"default")});function YS(){return!this.node()}var yV=R(()=>{"use strict";o(YS,"default")});function WS(t){for(var e=this._groups,r=0,n=e.length;r{"use strict";o(WS,"default")});function K4e(t){return function(){this.removeAttribute(t)}}function Q4e(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Z4e(t,e){return function(){this.setAttribute(t,e)}}function J4e(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function e3e(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function t3e(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function qS(t,e){var r=ic(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?Q4e:K4e:typeof e=="function"?r.local?t3e:e3e:r.local?J4e:Z4e)(r,e))}var xV=R(()=>{"use strict";G4();o(K4e,"attrRemove");o(Q4e,"attrRemoveNS");o(Z4e,"attrConstant");o(J4e,"attrConstantNS");o(e3e,"attrFunction");o(t3e,"attrFunctionNS");o(qS,"default")});function yy(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}var XS=R(()=>{"use strict";o(yy,"default")});function r3e(t){return function(){this.style.removeProperty(t)}}function n3e(t,e,r){return function(){this.style.setProperty(t,e,r)}}function i3e(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function jS(t,e,r){return arguments.length>1?this.each((e==null?r3e:typeof e=="function"?i3e:n3e)(t,e,r??"")):Th(this.node(),t)}function Th(t,e){return t.style.getPropertyValue(e)||yy(t).getComputedStyle(t,null).getPropertyValue(e)}var KS=R(()=>{"use strict";XS();o(r3e,"styleRemove");o(n3e,"styleConstant");o(i3e,"styleFunction");o(jS,"default");o(Th,"styleValue")});function a3e(t){return function(){delete this[t]}}function s3e(t,e){return function(){this[t]=e}}function o3e(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function QS(t,e){return arguments.length>1?this.each((e==null?a3e:typeof e=="function"?o3e:s3e)(t,e)):this.node()[t]}var bV=R(()=>{"use strict";o(a3e,"propertyRemove");o(s3e,"propertyConstant");o(o3e,"propertyFunction");o(QS,"default")});function wV(t){return t.trim().split(/^|\s+/)}function ZS(t){return t.classList||new TV(t)}function TV(t){this._node=t,this._names=wV(t.getAttribute("class")||"")}function kV(t,e){for(var r=ZS(t),n=-1,i=e.length;++n{"use strict";o(wV,"classArray");o(ZS,"classList");o(TV,"ClassList");TV.prototype={add:o(function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(t){return this._names.indexOf(t)>=0},"contains")};o(kV,"classedAdd");o(EV,"classedRemove");o(l3e,"classedTrue");o(c3e,"classedFalse");o(u3e,"classedFunction");o(JS,"default")});function h3e(){this.textContent=""}function f3e(t){return function(){this.textContent=t}}function d3e(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function eA(t){return arguments.length?this.each(t==null?h3e:(typeof t=="function"?d3e:f3e)(t)):this.node().textContent}var SV=R(()=>{"use strict";o(h3e,"textRemove");o(f3e,"textConstant");o(d3e,"textFunction");o(eA,"default")});function p3e(){this.innerHTML=""}function m3e(t){return function(){this.innerHTML=t}}function g3e(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function tA(t){return arguments.length?this.each(t==null?p3e:(typeof t=="function"?g3e:m3e)(t)):this.node().innerHTML}var AV=R(()=>{"use strict";o(p3e,"htmlRemove");o(m3e,"htmlConstant");o(g3e,"htmlFunction");o(tA,"default")});function y3e(){this.nextSibling&&this.parentNode.appendChild(this)}function rA(){return this.each(y3e)}var _V=R(()=>{"use strict";o(y3e,"raise");o(rA,"default")});function v3e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nA(){return this.each(v3e)}var LV=R(()=>{"use strict";o(v3e,"lower");o(nA,"default")});function iA(t){var e=typeof t=="function"?t:dy(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}var DV=R(()=>{"use strict";kS();o(iA,"default")});function x3e(){return null}function aA(t,e){var r=typeof t=="function"?t:dy(t),n=e==null?x3e:typeof e=="function"?e:wh(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var RV=R(()=>{"use strict";kS();$4();o(x3e,"constantNull");o(aA,"default")});function b3e(){var t=this.parentNode;t&&t.removeChild(this)}function sA(){return this.each(b3e)}var NV=R(()=>{"use strict";o(b3e,"remove");o(sA,"default")});function w3e(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function T3e(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function oA(t){return this.select(t?T3e:w3e)}var MV=R(()=>{"use strict";o(w3e,"selection_cloneShallow");o(T3e,"selection_cloneDeep");o(oA,"default")});function lA(t){return arguments.length?this.property("__data__",t):this.node().__data__}var IV=R(()=>{"use strict";o(lA,"default")});function k3e(t){return function(e){t.call(this,e,this.__data__)}}function E3e(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function C3e(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r{"use strict";o(k3e,"contextListener");o(E3e,"parseTypenames");o(C3e,"onRemove");o(S3e,"onAdd");o(cA,"default")});function PV(t,e,r){var n=yy(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function A3e(t,e){return function(){return PV(this,t,e)}}function _3e(t,e){return function(){return PV(this,t,e.apply(this,arguments))}}function uA(t,e){return this.each((typeof e=="function"?_3e:A3e)(t,e))}var BV=R(()=>{"use strict";XS();o(PV,"dispatchEvent");o(A3e,"dispatchConstant");o(_3e,"dispatchFunction");o(uA,"default")});function*hA(){for(var t=this._groups,e=0,r=t.length;e{"use strict";o(hA,"default")});function Zn(t,e){this._groups=t,this._parents=e}function zV(){return new Zn([[document.documentElement]],fA)}function L3e(){return this}var fA,cu,hl=R(()=>{"use strict";eV();rV();nV();iV();aV();oV();MS();lV();cV();uV();hV();fV();dV();pV();mV();gV();yV();vV();xV();KS();bV();CV();SV();AV();_V();LV();DV();RV();NV();MV();IV();OV();BV();FV();fA=[null];o(Zn,"Selection");o(zV,"selection");o(L3e,"selection_selection");Zn.prototype=zV.prototype={constructor:Zn,select:ES,selectAll:AS,selectChild:_S,selectChildren:LS,filter:DS,data:OS,enter:NS,exit:PS,join:BS,merge:FS,selection:L3e,order:zS,sort:GS,call:$S,nodes:VS,node:US,size:HS,empty:YS,each:WS,attr:qS,style:jS,property:QS,classed:JS,text:eA,html:tA,raise:rA,lower:nA,append:iA,insert:aA,remove:sA,clone:oA,datum:lA,on:cA,dispatch:uA,[Symbol.iterator]:hA};cu=zV});function $e(t){return typeof t=="string"?new Zn([[document.querySelector(t)]],[document.documentElement]):new Zn([[t]],fA)}var GV=R(()=>{"use strict";hl();o($e,"default")});var fl=R(()=>{"use strict";py();G4();GV();hl();$4();SS();KS()});var $V=R(()=>{"use strict"});function kh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Cp(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}var dA=R(()=>{"use strict";o(kh,"default");o(Cp,"extend")});function Eh(){}function UV(){return this.rgb().formatHex()}function B3e(){return this.rgb().formatHex8()}function F3e(){return KV(this).formatHsl()}function HV(){return this.rgb().formatRgb()}function pl(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=D3e.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?YV(e):r===3?new la(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?U4(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?U4(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=R3e.exec(t))?new la(e[1],e[2],e[3],1):(e=N3e.exec(t))?new la(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=M3e.exec(t))?U4(e[1],e[2],e[3],e[4]):(e=I3e.exec(t))?U4(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=O3e.exec(t))?XV(e[1],e[2]/100,e[3]/100,1):(e=P3e.exec(t))?XV(e[1],e[2]/100,e[3]/100,e[4]):VV.hasOwnProperty(t)?YV(VV[t]):t==="transparent"?new la(NaN,NaN,NaN,0):null}function YV(t){return new la(t>>16&255,t>>8&255,t&255,1)}function U4(t,e,r,n){return n<=0&&(t=e=r=NaN),new la(t,e,r,n)}function mA(t){return t instanceof Eh||(t=pl(t)),t?(t=t.rgb(),new la(t.r,t.g,t.b,t.opacity)):new la}function Ap(t,e,r,n){return arguments.length===1?mA(t):new la(t,e,r,n??1)}function la(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function WV(){return`#${rd(this.r)}${rd(this.g)}${rd(this.b)}`}function z3e(){return`#${rd(this.r)}${rd(this.g)}${rd(this.b)}${rd((isNaN(this.opacity)?1:this.opacity)*255)}`}function qV(){let t=W4(this.opacity);return`${t===1?"rgb(":"rgba("}${nd(this.r)}, ${nd(this.g)}, ${nd(this.b)}${t===1?")":`, ${t})`}`}function W4(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function nd(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function rd(t){return t=nd(t),(t<16?"0":"")+t.toString(16)}function XV(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new dl(t,e,r,n)}function KV(t){if(t instanceof dl)return new dl(t.h,t.s,t.l,t.opacity);if(t instanceof Eh||(t=pl(t)),!t)return new dl;if(t instanceof dl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,l=a-i,u=(a+i)/2;return l?(e===a?s=(r-n)/l+(r0&&u<1?0:s,new dl(s,l,u,t.opacity)}function QV(t,e,r,n){return arguments.length===1?KV(t):new dl(t,e,r,n??1)}function dl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function jV(t){return t=(t||0)%360,t<0?t+360:t}function H4(t){return Math.max(0,Math.min(1,t||0))}function pA(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}var vy,Y4,Sp,xy,ac,D3e,R3e,N3e,M3e,I3e,O3e,P3e,VV,gA=R(()=>{"use strict";dA();o(Eh,"Color");vy=.7,Y4=1/vy,Sp="\\s*([+-]?\\d+)\\s*",xy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ac="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",D3e=/^#([0-9a-f]{3,8})$/,R3e=new RegExp(`^rgb\\(${Sp},${Sp},${Sp}\\)$`),N3e=new RegExp(`^rgb\\(${ac},${ac},${ac}\\)$`),M3e=new RegExp(`^rgba\\(${Sp},${Sp},${Sp},${xy}\\)$`),I3e=new RegExp(`^rgba\\(${ac},${ac},${ac},${xy}\\)$`),O3e=new RegExp(`^hsl\\(${xy},${ac},${ac}\\)$`),P3e=new RegExp(`^hsla\\(${xy},${ac},${ac},${xy}\\)$`),VV={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};kh(Eh,pl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:UV,formatHex:UV,formatHex8:B3e,formatHsl:F3e,formatRgb:HV,toString:HV});o(UV,"color_formatHex");o(B3e,"color_formatHex8");o(F3e,"color_formatHsl");o(HV,"color_formatRgb");o(pl,"color");o(YV,"rgbn");o(U4,"rgba");o(mA,"rgbConvert");o(Ap,"rgb");o(la,"Rgb");kh(la,Ap,Cp(Eh,{brighter(t){return t=t==null?Y4:Math.pow(Y4,t),new la(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?vy:Math.pow(vy,t),new la(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new la(nd(this.r),nd(this.g),nd(this.b),W4(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:WV,formatHex:WV,formatHex8:z3e,formatRgb:qV,toString:qV}));o(WV,"rgb_formatHex");o(z3e,"rgb_formatHex8");o(qV,"rgb_formatRgb");o(W4,"clampa");o(nd,"clampi");o(rd,"hex");o(XV,"hsla");o(KV,"hslConvert");o(QV,"hsl");o(dl,"Hsl");kh(dl,QV,Cp(Eh,{brighter(t){return t=t==null?Y4:Math.pow(Y4,t),new dl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?vy:Math.pow(vy,t),new dl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new la(pA(t>=240?t-240:t+120,i,n),pA(t,i,n),pA(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new dl(jV(this.h),H4(this.s),H4(this.l),W4(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=W4(this.opacity);return`${t===1?"hsl(":"hsla("}${jV(this.h)}, ${H4(this.s)*100}%, ${H4(this.l)*100}%${t===1?")":`, ${t})`}`}}));o(jV,"clamph");o(H4,"clampt");o(pA,"hsl2rgb")});var ZV,JV,eU=R(()=>{"use strict";ZV=Math.PI/180,JV=180/Math.PI});function sU(t){if(t instanceof sc)return new sc(t.l,t.a,t.b,t.opacity);if(t instanceof uu)return oU(t);t instanceof la||(t=mA(t));var e=bA(t.r),r=bA(t.g),n=bA(t.b),i=yA((.2225045*e+.7168786*r+.0606169*n)/rU),a,s;return e===r&&r===n?a=s=i:(a=yA((.4360747*e+.3850649*r+.1430804*n)/tU),s=yA((.0139322*e+.0971045*r+.7141733*n)/nU)),new sc(116*i-16,500*(a-i),200*(i-s),t.opacity)}function wA(t,e,r,n){return arguments.length===1?sU(t):new sc(t,e,r,n??1)}function sc(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function yA(t){return t>G3e?Math.pow(t,1/3):t/aU+iU}function vA(t){return t>_p?t*t*t:aU*(t-iU)}function xA(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function bA(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $3e(t){if(t instanceof uu)return new uu(t.h,t.c,t.l,t.opacity);if(t instanceof sc||(t=sU(t)),t.a===0&&t.b===0)return new uu(NaN,0{"use strict";dA();gA();eU();q4=18,tU=.96422,rU=1,nU=.82521,iU=4/29,_p=6/29,aU=3*_p*_p,G3e=_p*_p*_p;o(sU,"labConvert");o(wA,"lab");o(sc,"Lab");kh(sc,wA,Cp(Eh,{brighter(t){return new sc(this.l+q4*(t??1),this.a,this.b,this.opacity)},darker(t){return new sc(this.l-q4*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=tU*vA(e),t=rU*vA(t),r=nU*vA(r),new la(xA(3.1338561*e-1.6168667*t-.4906146*r),xA(-.9787684*e+1.9161415*t+.033454*r),xA(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));o(yA,"xyz2lab");o(vA,"lab2xyz");o(xA,"lrgb2rgb");o(bA,"rgb2lrgb");o($3e,"hclConvert");o(by,"hcl");o(uu,"Hcl");o(oU,"hcl2lab");kh(uu,by,Cp(Eh,{brighter(t){return new uu(this.h,this.c,this.l+q4*(t??1),this.opacity)},darker(t){return new uu(this.h,this.c,this.l-q4*(t??1),this.opacity)},rgb(){return oU(this).rgb()}}))});var Lp=R(()=>{"use strict";gA();lU()});function TA(t,e,r,n,i){var a=t*t,s=a*t;return((1-3*t+3*a-s)*e+(4-6*a+3*s)*r+(1+3*t+3*a-3*s)*n+s*i)/6}function kA(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],s=n>0?t[n-1]:2*i-a,l=n{"use strict";o(TA,"basis");o(kA,"default")});function CA(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],a=t[n%e],s=t[(n+1)%e],l=t[(n+2)%e];return TA((r-n/e)*e,i,a,s,l)}}var cU=R(()=>{"use strict";EA();o(CA,"default")});var Dp,SA=R(()=>{"use strict";Dp=o(t=>()=>t,"default")});function uU(t,e){return function(r){return t+r*e}}function V3e(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function hU(t,e){var r=e-t;return r?uU(t,r>180||r<-180?r-360*Math.round(r/360):r):Dp(isNaN(t)?e:t)}function fU(t){return(t=+t)==1?hu:function(e,r){return r-e?V3e(e,r,t):Dp(isNaN(e)?r:e)}}function hu(t,e){var r=e-t;return r?uU(t,r):Dp(isNaN(t)?e:t)}var AA=R(()=>{"use strict";SA();o(uU,"linear");o(V3e,"exponential");o(hU,"hue");o(fU,"gamma");o(hu,"nogamma")});function dU(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),a=new Array(r),s,l;for(s=0;s{"use strict";Lp();EA();cU();AA();id=o(function t(e){var r=fU(e);function n(i,a){var s=r((i=Ap(i)).r,(a=Ap(a)).r),l=r(i.g,a.g),u=r(i.b,a.b),h=hu(i.opacity,a.opacity);return function(f){return i.r=s(f),i.g=l(f),i.b=u(f),i.opacity=h(f),i+""}}return o(n,"rgb"),n.gamma=t,n},"rgbGamma")(1);o(dU,"rgbSpline");U3e=dU(kA),H3e=dU(CA)});function LA(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i{"use strict";o(LA,"default");o(pU,"isNumberArray")});function gU(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s{"use strict";X4();o(gU,"genericArray")});function DA(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}var vU=R(()=>{"use strict";o(DA,"default")});function ji(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var wy=R(()=>{"use strict";o(ji,"default")});function RA(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Ch(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var xU=R(()=>{"use strict";X4();o(RA,"default")});function Y3e(t){return function(){return t}}function W3e(t){return function(e){return t(e)+""}}function Rp(t,e){var r=MA.lastIndex=NA.lastIndex=0,n,i,a,s=-1,l=[],u=[];for(t=t+"",e=e+"";(n=MA.exec(t))&&(i=NA.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),l[s]?l[s]+=a:l[++s]=a),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,u.push({i:s,x:ji(n,i)})),r=NA.lastIndex;return r{"use strict";wy();MA=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,NA=new RegExp(MA.source,"g");o(Y3e,"zero");o(W3e,"one");o(Rp,"default")});function Ch(t,e){var r=typeof e,n;return e==null||r==="boolean"?Dp(e):(r==="number"?ji:r==="string"?(n=pl(e))?(e=n,id):Rp:e instanceof pl?id:e instanceof Date?DA:pU(e)?LA:Array.isArray(e)?gU:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?RA:ji)(t,e)}var X4=R(()=>{"use strict";Lp();_A();yU();vU();wy();xU();IA();SA();mU();o(Ch,"default")});function j4(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var bU=R(()=>{"use strict";o(j4,"default")});function Q4(t,e,r,n,i,a){var s,l,u;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(u=t*r+e*n)&&(r-=t*u,n-=e*u),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,u/=l),t*n{"use strict";wU=180/Math.PI,K4={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};o(Q4,"default")});function kU(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?K4:Q4(e.a,e.b,e.c,e.d,e.e,e.f)}function EU(t){return t==null?K4:(Z4||(Z4=document.createElementNS("http://www.w3.org/2000/svg","g")),Z4.setAttribute("transform",t),(t=Z4.transform.baseVal.consolidate())?(t=t.matrix,Q4(t.a,t.b,t.c,t.d,t.e,t.f)):K4)}var Z4,CU=R(()=>{"use strict";TU();o(kU,"parseCss");o(EU,"parseSvg")});function SU(t,e,r,n){function i(h){return h.length?h.pop()+" ":""}o(i,"pop");function a(h,f,d,p,m,g){if(h!==d||f!==p){var y=m.push("translate(",null,e,null,r);g.push({i:y-4,x:ji(h,d)},{i:y-2,x:ji(f,p)})}else(d||p)&&m.push("translate("+d+e+p+r)}o(a,"translate");function s(h,f,d,p){h!==f?(h-f>180?f+=360:f-h>180&&(h+=360),p.push({i:d.push(i(d)+"rotate(",null,n)-2,x:ji(h,f)})):f&&d.push(i(d)+"rotate("+f+n)}o(s,"rotate");function l(h,f,d,p){h!==f?p.push({i:d.push(i(d)+"skewX(",null,n)-2,x:ji(h,f)}):f&&d.push(i(d)+"skewX("+f+n)}o(l,"skewX");function u(h,f,d,p,m,g){if(h!==d||f!==p){var y=m.push(i(m)+"scale(",null,",",null,")");g.push({i:y-4,x:ji(h,d)},{i:y-2,x:ji(f,p)})}else(d!==1||p!==1)&&m.push(i(m)+"scale("+d+","+p+")")}return o(u,"scale"),function(h,f){var d=[],p=[];return h=t(h),f=t(f),a(h.translateX,h.translateY,f.translateX,f.translateY,d,p),s(h.rotate,f.rotate,d,p),l(h.skewX,f.skewX,d,p),u(h.scaleX,h.scaleY,f.scaleX,f.scaleY,d,p),h=f=null,function(m){for(var g=-1,y=p.length,v;++g{"use strict";wy();CU();o(SU,"interpolateTransform");OA=SU(kU,"px, ","px)","deg)"),PA=SU(EU,", ",")",")")});function _U(t){return function(e,r){var n=t((e=by(e)).h,(r=by(r)).h),i=hu(e.c,r.c),a=hu(e.l,r.l),s=hu(e.opacity,r.opacity);return function(l){return e.h=n(l),e.c=i(l),e.l=a(l),e.opacity=s(l),e+""}}}var BA,q3e,LU=R(()=>{"use strict";Lp();AA();o(_U,"hcl");BA=_U(hU),q3e=_U(hu)});var Np=R(()=>{"use strict";X4();wy();bU();IA();AU();_A();LU()});function Ay(){return ad||(NU(X3e),ad=Cy.now()+t3)}function X3e(){ad=0}function Sy(){this._call=this._time=this._next=null}function r3(t,e,r){var n=new Sy;return n.restart(t,e,r),n}function MU(){Ay(),++Mp;for(var t=J4,e;t;)(e=ad-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Mp}function DU(){ad=(e3=Cy.now())+t3,Mp=ky=0;try{MU()}finally{Mp=0,K3e(),ad=0}}function j3e(){var t=Cy.now(),e=t-e3;e>RU&&(t3-=e,e3=t)}function K3e(){for(var t,e=J4,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:J4=r);Ey=t,FA(n)}function FA(t){if(!Mp){ky&&(ky=clearTimeout(ky));var e=t-ad;e>24?(t<1/0&&(ky=setTimeout(DU,t-Cy.now()-t3)),Ty&&(Ty=clearInterval(Ty))):(Ty||(e3=Cy.now(),Ty=setInterval(j3e,RU)),Mp=1,NU(DU))}}var Mp,ky,Ty,RU,J4,Ey,e3,ad,t3,Cy,NU,zA=R(()=>{"use strict";Mp=0,ky=0,Ty=0,RU=1e3,e3=0,ad=0,t3=0,Cy=typeof performance=="object"&&performance.now?performance:Date,NU=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};o(Ay,"now");o(X3e,"clearNow");o(Sy,"Timer");Sy.prototype=r3.prototype={constructor:Sy,restart:o(function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?Ay():+r)+(e==null?0:+e),!this._next&&Ey!==this&&(Ey?Ey._next=this:J4=this,Ey=this),this._call=t,this._time=r,FA()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,FA())},"stop")};o(r3,"timer");o(MU,"timerFlush");o(DU,"wake");o(j3e,"poke");o(K3e,"nap");o(FA,"sleep")});function _y(t,e,r){var n=new Sy;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var IU=R(()=>{"use strict";zA();o(_y,"default")});var n3=R(()=>{"use strict";zA();IU()});function fu(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;J3e(t,r,{name:e,index:n,group:i,on:Q3e,tween:Z3e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:BU})}function Dy(t,e){var r=Mi(t,e);if(r.state>BU)throw new Error("too late; already scheduled");return r}function ca(t,e){var r=Mi(t,e);if(r.state>i3)throw new Error("too late; already running");return r}function Mi(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function J3e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=r3(a,0,r.time);function a(h){r.state=OU,r.timer.restart(s,r.delay,r.time),r.delay<=h&&s(h-r.delay)}o(a,"schedule");function s(h){var f,d,p,m;if(r.state!==OU)return u();for(f in n)if(m=n[f],m.name===r.name){if(m.state===i3)return _y(s);m.state===PU?(m.state=Ly,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete n[f]):+f{"use strict";bS();n3();Q3e=xS("start","end","cancel","interrupt"),Z3e=[],BU=0,OU=1,a3=2,i3=3,PU=4,s3=5,Ly=6;o(fu,"default");o(Dy,"init");o(ca,"set");o(Mi,"get");o(J3e,"create")});function Ry(t,e){var r=t.__transition,n,i,a=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((n=r[s]).name!==e){a=!1;continue}i=n.state>a3&&n.state{"use strict";ys();o(Ry,"default")});function GA(t){return this.each(function(){Ry(this,t)})}var zU=R(()=>{"use strict";FU();o(GA,"default")});function e5e(t,e){var r,n;return function(){var i=ca(this,t),a=i.tween;if(a!==r){n=r=a;for(var s=0,l=n.length;s{"use strict";ys();o(e5e,"tweenRemove");o(t5e,"tweenFunction");o($A,"default");o(Ip,"tweenValue")});function My(t,e){var r;return(typeof e=="number"?ji:e instanceof pl?id:(r=pl(e))?(e=r,id):Rp)(t,e)}var VA=R(()=>{"use strict";Lp();Np();o(My,"default")});function r5e(t){return function(){this.removeAttribute(t)}}function n5e(t){return function(){this.removeAttributeNS(t.space,t.local)}}function i5e(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttribute(t);return s===i?null:s===n?a:a=e(n=s,r)}}function a5e(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===n?a:a=e(n=s,r)}}function s5e(t,e,r){var n,i,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttribute(t):(s=this.getAttribute(t),u=l+"",s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l)))}}function o5e(t,e,r){var n,i,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),u=l+"",s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l)))}}function UA(t,e){var r=ic(t),n=r==="transform"?PA:My;return this.attrTween(t,typeof e=="function"?(r.local?o5e:s5e)(r,n,Ip(this,"attr."+t,e)):e==null?(r.local?n5e:r5e)(r):(r.local?a5e:i5e)(r,n,e))}var GU=R(()=>{"use strict";Np();fl();Ny();VA();o(r5e,"attrRemove");o(n5e,"attrRemoveNS");o(i5e,"attrConstant");o(a5e,"attrConstantNS");o(s5e,"attrFunction");o(o5e,"attrFunctionNS");o(UA,"default")});function l5e(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function c5e(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function u5e(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&c5e(t,a)),r}return o(i,"tween"),i._value=e,i}function h5e(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&l5e(t,a)),r}return o(i,"tween"),i._value=e,i}function HA(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=ic(t);return this.tween(r,(n.local?u5e:h5e)(n,e))}var $U=R(()=>{"use strict";fl();o(l5e,"attrInterpolate");o(c5e,"attrInterpolateNS");o(u5e,"attrTweenNS");o(h5e,"attrTween");o(HA,"default")});function f5e(t,e){return function(){Dy(this,t).delay=+e.apply(this,arguments)}}function d5e(t,e){return e=+e,function(){Dy(this,t).delay=e}}function YA(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?f5e:d5e)(e,t)):Mi(this.node(),e).delay}var VU=R(()=>{"use strict";ys();o(f5e,"delayFunction");o(d5e,"delayConstant");o(YA,"default")});function p5e(t,e){return function(){ca(this,t).duration=+e.apply(this,arguments)}}function m5e(t,e){return e=+e,function(){ca(this,t).duration=e}}function WA(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?p5e:m5e)(e,t)):Mi(this.node(),e).duration}var UU=R(()=>{"use strict";ys();o(p5e,"durationFunction");o(m5e,"durationConstant");o(WA,"default")});function g5e(t,e){if(typeof e!="function")throw new Error;return function(){ca(this,t).ease=e}}function qA(t){var e=this._id;return arguments.length?this.each(g5e(e,t)):Mi(this.node(),e).ease}var HU=R(()=>{"use strict";ys();o(g5e,"easeConstant");o(qA,"default")});function y5e(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;ca(this,t).ease=r}}function XA(t){if(typeof t!="function")throw new Error;return this.each(y5e(this._id,t))}var YU=R(()=>{"use strict";ys();o(y5e,"easeVarying");o(XA,"default")});function jA(t){typeof t!="function"&&(t=Ep(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";fl();sd();o(jA,"default")});function KA(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,a=Math.min(n,i),s=new Array(n),l=0;l{"use strict";sd();o(KA,"default")});function v5e(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function x5e(t,e,r){var n,i,a=v5e(e)?Dy:ca;return function(){var s=a(this,t),l=s.on;l!==n&&(i=(n=l).copy()).on(e,r),s.on=i}}function QA(t,e){var r=this._id;return arguments.length<2?Mi(this.node(),r).on.on(t):this.each(x5e(r,t,e))}var XU=R(()=>{"use strict";ys();o(v5e,"start");o(x5e,"onFunction");o(QA,"default")});function b5e(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function ZA(){return this.on("end.remove",b5e(this._id))}var jU=R(()=>{"use strict";o(b5e,"removeFunction");o(ZA,"default")});function JA(t){var e=this._name,r=this._id;typeof t!="function"&&(t=wh(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s{"use strict";fl();sd();ys();o(JA,"default")});function e8(t){var e=this._name,r=this._id;typeof t!="function"&&(t=kp(t));for(var n=this._groups,i=n.length,a=[],s=[],l=0;l{"use strict";fl();sd();ys();o(e8,"default")});function t8(){return new w5e(this._groups,this._parents)}var w5e,ZU=R(()=>{"use strict";fl();w5e=cu.prototype.constructor;o(t8,"default")});function T5e(t,e){var r,n,i;return function(){var a=Th(this,t),s=(this.style.removeProperty(t),Th(this,t));return a===s?null:a===r&&s===n?i:i=e(r=a,n=s)}}function JU(t){return function(){this.style.removeProperty(t)}}function k5e(t,e,r){var n,i=r+"",a;return function(){var s=Th(this,t);return s===i?null:s===n?a:a=e(n=s,r)}}function E5e(t,e,r){var n,i,a;return function(){var s=Th(this,t),l=r(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),Th(this,t))),s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l))}}function C5e(t,e){var r,n,i,a="style."+e,s="end."+a,l;return function(){var u=ca(this,t),h=u.on,f=u.value[a]==null?l||(l=JU(e)):void 0;(h!==r||i!==f)&&(n=(r=h).copy()).on(s,i=f),u.on=n}}function r8(t,e,r){var n=(t+="")=="transform"?OA:My;return e==null?this.styleTween(t,T5e(t,n)).on("end.style."+t,JU(t)):typeof e=="function"?this.styleTween(t,E5e(t,n,Ip(this,"style."+t,e))).each(C5e(this._id,t)):this.styleTween(t,k5e(t,n,e),r).on("end.style."+t,null)}var eH=R(()=>{"use strict";Np();fl();ys();Ny();VA();o(T5e,"styleNull");o(JU,"styleRemove");o(k5e,"styleConstant");o(E5e,"styleFunction");o(C5e,"styleMaybeRemove");o(r8,"default")});function S5e(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function A5e(t,e,r){var n,i;function a(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&S5e(t,s,r)),n}return o(a,"tween"),a._value=e,a}function n8(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,A5e(t,e,r??""))}var tH=R(()=>{"use strict";o(S5e,"styleInterpolate");o(A5e,"styleTween");o(n8,"default")});function _5e(t){return function(){this.textContent=t}}function L5e(t){return function(){var e=t(this);this.textContent=e??""}}function i8(t){return this.tween("text",typeof t=="function"?L5e(Ip(this,"text",t)):_5e(t==null?"":t+""))}var rH=R(()=>{"use strict";Ny();o(_5e,"textConstant");o(L5e,"textFunction");o(i8,"default")});function D5e(t){return function(e){this.textContent=t.call(this,e)}}function R5e(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&D5e(i)),e}return o(n,"tween"),n._value=t,n}function a8(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,R5e(t))}var nH=R(()=>{"use strict";o(D5e,"textInterpolate");o(R5e,"textTween");o(a8,"default")});function s8(){for(var t=this._name,e=this._id,r=o3(),n=this._groups,i=n.length,a=0;a{"use strict";sd();ys();o(s8,"default")});function o8(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var l={value:s},u={value:o(function(){--i===0&&a()},"value")};r.each(function(){var h=ca(this,n),f=h.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),h.on=e}),i===0&&a()})}var aH=R(()=>{"use strict";ys();o(o8,"default")});function Ka(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function sH(t){return cu().transition(t)}function o3(){return++N5e}var N5e,du,sd=R(()=>{"use strict";fl();GU();$U();VU();UU();HU();YU();WU();qU();XU();jU();KU();QU();ZU();eH();tH();rH();nH();iH();Ny();aH();N5e=0;o(Ka,"Transition");o(sH,"transition");o(o3,"newId");du=cu.prototype;Ka.prototype=sH.prototype={constructor:Ka,select:JA,selectAll:e8,selectChild:du.selectChild,selectChildren:du.selectChildren,filter:jA,merge:KA,selection:t8,transition:s8,call:du.call,nodes:du.nodes,node:du.node,size:du.size,empty:du.empty,each:du.each,on:QA,attr:UA,attrTween:HA,style:r8,styleTween:n8,text:i8,textTween:a8,remove:ZA,tween:$A,delay:YA,duration:WA,ease:qA,easeVarying:XA,end:o8,[Symbol.iterator]:du[Symbol.iterator]}});function l3(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var oH=R(()=>{"use strict";o(l3,"cubicInOut")});var l8=R(()=>{"use strict";oH()});function I5e(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function c8(t){var e,r;t instanceof Ka?(e=t._id,t=t._name):(e=o3(),(r=M5e).time=Ay(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,a=0;a{"use strict";sd();ys();l8();n3();M5e={time:null,delay:0,duration:250,ease:l3};o(I5e,"inherit");o(c8,"default")});var cH=R(()=>{"use strict";fl();zU();lH();cu.prototype.interrupt=GA;cu.prototype.transition=c8});var c3=R(()=>{"use strict";cH()});var uH=R(()=>{"use strict"});var hH=R(()=>{"use strict"});var fH=R(()=>{"use strict"});function dH(t){return[+t[0],+t[1]]}function O5e(t){return[dH(t[0]),dH(t[1])]}function u8(t){return{type:t}}var Kpt,Qpt,Zpt,Jpt,emt,tmt,pH=R(()=>{"use strict";c3();uH();hH();fH();({abs:Kpt,max:Qpt,min:Zpt}=Math);o(dH,"number1");o(O5e,"number2");Jpt={name:"x",handles:["w","e"].map(u8),input:o(function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},"input"),output:o(function(t){return t&&[t[0][0],t[1][0]]},"output")},emt={name:"y",handles:["n","s"].map(u8),input:o(function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},"input"),output:o(function(t){return t&&[t[0][1],t[1][1]]},"output")},tmt={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(u8),input:o(function(t){return t==null?null:O5e(t)},"input"),output:o(function(t){return t},"output")};o(u8,"type")});var mH=R(()=>{"use strict";pH()});function gH(t){this._+=t[0];for(let e=1,r=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return gH;let r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;i{"use strict";h8=Math.PI,f8=2*h8,od=1e-6,P5e=f8-od;o(gH,"append");o(B5e,"appendRound");ld=class{static{o(this,"Path")}constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?gH:B5e(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,a,s){this._append`C${+e},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,r,n,i,a){if(e=+e,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,u=n-e,h=i-r,f=s-e,d=l-r,p=f*f+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(p>od)if(!(Math.abs(d*u-h*f)>od)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let m=n-s,g=i-l,y=u*u+h*h,v=m*m+g*g,x=Math.sqrt(y),b=Math.sqrt(p),w=a*Math.tan((h8-Math.acos((y+p-v)/(2*x*b)))/2),S=w/b,T=w/x;Math.abs(S-1)>od&&this._append`L${e+S*f},${r+S*d}`,this._append`A${a},${a},0,0,${+(d*m>f*g)},${this._x1=e+T*u},${this._y1=r+T*h}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),h=e+l,f=r+u,d=1^s,p=s?i-a:a-i;this._x1===null?this._append`M${h},${f}`:(Math.abs(this._x1-h)>od||Math.abs(this._y1-f)>od)&&this._append`L${h},${f}`,n&&(p<0&&(p=p%f8+f8),p>P5e?this._append`A${n},${n},0,1,${d},${e-l},${r-u}A${n},${n},0,1,${d},${this._x1=h},${this._y1=f}`:p>od&&this._append`A${n},${n},0,${+(p>=h8)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};o(yH,"path");yH.prototype=ld.prototype});var d8=R(()=>{"use strict";vH()});var xH=R(()=>{"use strict"});var bH=R(()=>{"use strict"});var wH=R(()=>{"use strict"});var TH=R(()=>{"use strict"});var kH=R(()=>{"use strict"});var EH=R(()=>{"use strict"});var CH=R(()=>{"use strict"});function p8(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function cd(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}var Iy=R(()=>{"use strict";o(p8,"default");o(cd,"formatDecimalParts")});function ml(t){return t=cd(Math.abs(t)),t?t[1]:NaN}var Oy=R(()=>{"use strict";Iy();o(ml,"default")});function m8(t,e){return function(r,n){for(var i=r.length,a=[],s=0,l=t[0],u=0;i>0&&l>0&&(u+l+1>n&&(l=Math.max(1,n-u)),a.push(r.substring(i-=l,i+l)),!((u+=l+1)>n));)l=t[s=(s+1)%t.length];return a.reverse().join(e)}}var SH=R(()=>{"use strict";o(m8,"default")});function g8(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var AH=R(()=>{"use strict";o(g8,"default")});function Sh(t){if(!(e=F5e.exec(t)))throw new Error("invalid format: "+t);var e;return new u3({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function u3(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}var F5e,y8=R(()=>{"use strict";F5e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;o(Sh,"formatSpecifier");Sh.prototype=u3.prototype;o(u3,"FormatSpecifier");u3.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function v8(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var _H=R(()=>{"use strict";o(v8,"default")});function b8(t,e){var r=cd(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(x8=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+cd(t,Math.max(0,e+a-1))[0]}var x8,w8=R(()=>{"use strict";Iy();o(b8,"default")});function h3(t,e){var r=cd(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var LH=R(()=>{"use strict";Iy();o(h3,"default")});var T8,DH=R(()=>{"use strict";Iy();w8();LH();T8={"%":o((t,e)=>(t*100).toFixed(e),"%"),b:o(t=>Math.round(t).toString(2),"b"),c:o(t=>t+"","c"),d:p8,e:o((t,e)=>t.toExponential(e),"e"),f:o((t,e)=>t.toFixed(e),"f"),g:o((t,e)=>t.toPrecision(e),"g"),o:o(t=>Math.round(t).toString(8),"o"),p:o((t,e)=>h3(t*100,e),"p"),r:h3,s:b8,X:o(t=>Math.round(t).toString(16).toUpperCase(),"X"),x:o(t=>Math.round(t).toString(16),"x")}});function f3(t){return t}var RH=R(()=>{"use strict";o(f3,"default")});function k8(t){var e=t.grouping===void 0||t.thousands===void 0?f3:m8(NH.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?f3:g8(NH.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"\u2212":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function h(d){d=Sh(d);var p=d.fill,m=d.align,g=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,w=d.precision,S=d.trim,T=d.type;T==="n"?(b=!0,T="g"):T8[T]||(w===void 0&&(w=12),S=!0,T="g"),(v||p==="0"&&m==="=")&&(v=!0,p="0",m="=");var E=y==="$"?r:y==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",_=y==="$"?n:/[%p]/.test(T)?s:"",A=T8[T],L=/[defgprs%]/.test(T);w=w===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(N){var k=E,I=_,C,O,D;if(T==="c")I=A(N)+I,N="";else{N=+N;var P=N<0||1/N<0;if(N=isNaN(N)?u:A(Math.abs(N),w),S&&(N=v8(N)),P&&+N==0&&g!=="+"&&(P=!1),k=(P?g==="("?g:l:g==="-"||g==="("?"":g)+k,I=(T==="s"?MH[8+x8/3]:"")+I+(P&&g==="("?")":""),L){for(C=-1,O=N.length;++CD||D>57){I=(D===46?i+N.slice(C+1):N.slice(C))+I,N=N.slice(0,C);break}}}b&&!v&&(N=e(N,1/0));var F=k.length+N.length+I.length,B=F>1)+k+N+I+B.slice(F);break;default:N=B+k+N+I;break}return a(N)}return o(M,"format"),M.toString=function(){return d+""},M}o(h,"newFormat");function f(d,p){var m=h((d=Sh(d),d.type="f",d)),g=Math.max(-8,Math.min(8,Math.floor(ml(p)/3)))*3,y=Math.pow(10,-g),v=MH[8+g/3];return function(x){return m(y*x)+v}}return o(f,"formatPrefix"),{format:h,formatPrefix:f}}var NH,MH,IH=R(()=>{"use strict";Oy();SH();AH();y8();_H();DH();w8();RH();NH=Array.prototype.map,MH=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];o(k8,"default")});function E8(t){return d3=k8(t),p3=d3.format,m3=d3.formatPrefix,d3}var d3,p3,m3,OH=R(()=>{"use strict";IH();E8({thousands:",",grouping:[3],currency:["$",""]});o(E8,"defaultLocale")});function g3(t){return Math.max(0,-ml(Math.abs(t)))}var PH=R(()=>{"use strict";Oy();o(g3,"default")});function y3(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ml(e)/3)))*3-ml(Math.abs(t)))}var BH=R(()=>{"use strict";Oy();o(y3,"default")});function v3(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ml(e)-ml(t))+1}var FH=R(()=>{"use strict";Oy();o(v3,"default")});var C8=R(()=>{"use strict";OH();y8();PH();BH();FH()});var zH=R(()=>{"use strict"});var GH=R(()=>{"use strict"});var $H=R(()=>{"use strict"});var VH=R(()=>{"use strict"});function Ah(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var Py=R(()=>{"use strict";o(Ah,"initRange")});function pu(){var t=new wp,e=[],r=[],n=S8;function i(a){let s=t.get(a);if(s===void 0){if(n!==S8)return n;t.set(a,s=e.push(a)-1)}return r[s%r.length]}return o(i,"scale"),i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new wp;for(let s of a)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return pu(e,r).unknown(n)},Ah.apply(i,arguments),i}var S8,A8=R(()=>{"use strict";bh();Py();S8=Symbol("implicit");o(pu,"ordinal")});function Op(){var t=pu().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,s,l=!1,u=0,h=0,f=.5;delete t.unknown;function d(){var p=e().length,m=i{"use strict";bh();Py();A8();o(Op,"band")});function _8(t){return function(){return t}}var HH=R(()=>{"use strict";o(_8,"constants")});function L8(t){return+t}var YH=R(()=>{"use strict";o(L8,"number")});function Pp(t){return t}function D8(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:_8(isNaN(e)?NaN:.5)}function z5e(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function G5e(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?$5e:G5e,u=h=null,d}o(f,"rescale");function d(p){return p==null||isNaN(p=+p)?a:(u||(u=l(t.map(n),e,r)))(n(s(p)))}return o(d,"scale"),d.invert=function(p){return s(i((h||(h=l(e,t.map(n),ji)))(p)))},d.domain=function(p){return arguments.length?(t=Array.from(p,L8),f()):t.slice()},d.range=function(p){return arguments.length?(e=Array.from(p),f()):e.slice()},d.rangeRound=function(p){return e=Array.from(p),r=j4,f()},d.clamp=function(p){return arguments.length?(s=p?!0:Pp,f()):s!==Pp},d.interpolate=function(p){return arguments.length?(r=p,f()):r},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,m){return n=p,i=m,f()}}function By(){return V5e()(Pp,Pp)}var WH,R8=R(()=>{"use strict";bh();Np();HH();YH();WH=[0,1];o(Pp,"identity");o(D8,"normalize");o(z5e,"clamper");o(G5e,"bimap");o($5e,"polymap");o(x3,"copy");o(V5e,"transformer");o(By,"continuous")});function N8(t,e,r,n){var i=Tp(t,e,r),a;switch(n=Sh(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=y3(i,s))&&(n.precision=a),m3(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=v3(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=g3(i))&&(n.precision=a-(n.type==="%")*2);break}}return p3(n)}var qH=R(()=>{"use strict";bh();C8();o(N8,"tickFormat")});function U5e(t){var e=t.domain;return t.ticks=function(r){var n=e();return N4(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return N8(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],l=n[a],u,h,f=10;for(l0;){if(h=fy(s,l,r),h===u)return n[i]=s,n[a]=l,e(n);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;u=h}return t},t}function gl(){var t=By();return t.copy=function(){return x3(t,gl())},Ah.apply(t,arguments),U5e(t)}var XH=R(()=>{"use strict";bh();R8();Py();qH();o(U5e,"linearish");o(gl,"linear")});function M8(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a{"use strict";o(M8,"nice")});function dn(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return o(i,"interval"),i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{let s=i(a),l=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{let u=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a0))return u;let h;do u.push(h=new Date(+a)),e(a,l),t(a);while(hdn(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!a(s););else for(;--l>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(I8.setTime(+a),O8.setTime(+s),t(I8),t(O8),Math.floor(r(I8,O8))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}var I8,O8,mu=R(()=>{"use strict";I8=new Date,O8=new Date;o(dn,"timeInterval")});var oc,KH,P8=R(()=>{"use strict";mu();oc=dn(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);oc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?dn(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):oc);KH=oc.range});var Ks,QH,B8=R(()=>{"use strict";mu();Ks=dn(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),QH=Ks.range});var gu,H5e,b3,Y5e,F8=R(()=>{"use strict";mu();gu=dn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),H5e=gu.range,b3=dn(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),Y5e=b3.range});var yu,W5e,w3,q5e,z8=R(()=>{"use strict";mu();yu=dn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),W5e=yu.range,w3=dn(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),q5e=w3.range});var Do,X5e,zy,j5e,T3,K5e,G8=R(()=>{"use strict";mu();Do=dn(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),X5e=Do.range,zy=dn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),j5e=zy.range,T3=dn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),K5e=T3.range});function fd(t){return dn(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}function dd(t){return dn(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var yl,_h,k3,E3,cc,C3,S3,JH,Q5e,Z5e,J5e,ewe,twe,rwe,pd,Bp,eY,tY,Lh,rY,nY,iY,nwe,iwe,awe,swe,owe,lwe,$8=R(()=>{"use strict";mu();o(fd,"timeWeekday");yl=fd(0),_h=fd(1),k3=fd(2),E3=fd(3),cc=fd(4),C3=fd(5),S3=fd(6),JH=yl.range,Q5e=_h.range,Z5e=k3.range,J5e=E3.range,ewe=cc.range,twe=C3.range,rwe=S3.range;o(dd,"utcWeekday");pd=dd(0),Bp=dd(1),eY=dd(2),tY=dd(3),Lh=dd(4),rY=dd(5),nY=dd(6),iY=pd.range,nwe=Bp.range,iwe=eY.range,awe=tY.range,swe=Lh.range,owe=rY.range,lwe=nY.range});var vu,cwe,A3,uwe,V8=R(()=>{"use strict";mu();vu=dn(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),cwe=vu.range,A3=dn(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),uwe=A3.range});var Qs,hwe,vl,fwe,U8=R(()=>{"use strict";mu();Qs=dn(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Qs.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:dn(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});hwe=Qs.range,vl=dn(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());vl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:dn(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});fwe=vl.range});function sY(t,e,r,n,i,a){let s=[[Ks,1,1e3],[Ks,5,5*1e3],[Ks,15,15*1e3],[Ks,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function l(h,f,d){let p=fv).right(s,p);if(m===s.length)return t.every(Tp(h/31536e6,f/31536e6,d));if(m===0)return oc.every(Math.max(Tp(h,f,d),1));let[g,y]=s[p/s[m-1][2]{"use strict";bh();P8();B8();F8();z8();G8();$8();V8();U8();o(sY,"ticker");[pwe,mwe]=sY(vl,A3,pd,T3,w3,b3),[H8,Y8]=sY(Qs,vu,yl,Do,yu,gu)});var _3=R(()=>{"use strict";P8();B8();F8();z8();G8();$8();V8();U8();oY()});function W8(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function q8(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Gy(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function X8(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,u=t.shortMonths,h=$y(i),f=Vy(i),d=$y(a),p=Vy(a),m=$y(s),g=Vy(s),y=$y(l),v=Vy(l),x=$y(u),b=Vy(u),w={a:P,A:F,b:B,B:$,c:null,d:dY,e:dY,f:Fwe,g:Xwe,G:Kwe,H:Owe,I:Pwe,j:Bwe,L:vY,m:zwe,M:Gwe,p:z,q:Y,Q:gY,s:yY,S:$we,u:Vwe,U:Uwe,V:Hwe,w:Ywe,W:Wwe,x:null,X:null,y:qwe,Y:jwe,Z:Qwe,"%":mY},S={a:Q,A:X,b:ie,B:j,c:null,d:pY,e:pY,f:tTe,g:hTe,G:dTe,H:Zwe,I:Jwe,j:eTe,L:bY,m:rTe,M:nTe,p:J,q:Z,Q:gY,s:yY,S:iTe,u:aTe,U:sTe,V:oTe,w:lTe,W:cTe,x:null,X:null,y:uTe,Y:fTe,Z:pTe,"%":mY},T={a:M,A:N,b:k,B:I,c:C,d:hY,e:hY,f:Rwe,g:uY,G:cY,H:fY,I:fY,j:Awe,L:Dwe,m:Swe,M:_we,p:L,q:Cwe,Q:Mwe,s:Iwe,S:Lwe,u:bwe,U:wwe,V:Twe,w:xwe,W:kwe,x:O,X:D,y:uY,Y:cY,Z:Ewe,"%":Nwe};w.x=E(r,w),w.X=E(n,w),w.c=E(e,w),S.x=E(r,S),S.X=E(n,S),S.c=E(e,S);function E(H,q){return function(K){var se=[],ce=-1,ue=0,te=H.length,De,oe,ke;for(K instanceof Date||(K=new Date(+K));++ce53)return null;"w"in se||(se.w=1),"Z"in se?(ue=q8(Gy(se.y,0,1)),te=ue.getUTCDay(),ue=te>4||te===0?Bp.ceil(ue):Bp(ue),ue=zy.offset(ue,(se.V-1)*7),se.y=ue.getUTCFullYear(),se.m=ue.getUTCMonth(),se.d=ue.getUTCDate()+(se.w+6)%7):(ue=W8(Gy(se.y,0,1)),te=ue.getDay(),ue=te>4||te===0?_h.ceil(ue):_h(ue),ue=Do.offset(ue,(se.V-1)*7),se.y=ue.getFullYear(),se.m=ue.getMonth(),se.d=ue.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),te="Z"in se?q8(Gy(se.y,0,1)).getUTCDay():W8(Gy(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(te+5)%7:se.w+se.U*7-(te+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,q8(se)):W8(se)}}o(_,"newParse");function A(H,q,K,se){for(var ce=0,ue=q.length,te=K.length,De,oe;ce=te)return-1;if(De=q.charCodeAt(ce++),De===37){if(De=q.charAt(ce++),oe=T[De in lY?q.charAt(ce++):De],!oe||(se=oe(H,K,se))<0)return-1}else if(De!=K.charCodeAt(se++))return-1}return se}o(A,"parseSpecifier");function L(H,q,K){var se=h.exec(q.slice(K));return se?(H.p=f.get(se[0].toLowerCase()),K+se[0].length):-1}o(L,"parsePeriod");function M(H,q,K){var se=m.exec(q.slice(K));return se?(H.w=g.get(se[0].toLowerCase()),K+se[0].length):-1}o(M,"parseShortWeekday");function N(H,q,K){var se=d.exec(q.slice(K));return se?(H.w=p.get(se[0].toLowerCase()),K+se[0].length):-1}o(N,"parseWeekday");function k(H,q,K){var se=x.exec(q.slice(K));return se?(H.m=b.get(se[0].toLowerCase()),K+se[0].length):-1}o(k,"parseShortMonth");function I(H,q,K){var se=y.exec(q.slice(K));return se?(H.m=v.get(se[0].toLowerCase()),K+se[0].length):-1}o(I,"parseMonth");function C(H,q,K){return A(H,e,q,K)}o(C,"parseLocaleDateTime");function O(H,q,K){return A(H,r,q,K)}o(O,"parseLocaleDate");function D(H,q,K){return A(H,n,q,K)}o(D,"parseLocaleTime");function P(H){return s[H.getDay()]}o(P,"formatShortWeekday");function F(H){return a[H.getDay()]}o(F,"formatWeekday");function B(H){return u[H.getMonth()]}o(B,"formatShortMonth");function $(H){return l[H.getMonth()]}o($,"formatMonth");function z(H){return i[+(H.getHours()>=12)]}o(z,"formatPeriod");function Y(H){return 1+~~(H.getMonth()/3)}o(Y,"formatQuarter");function Q(H){return s[H.getUTCDay()]}o(Q,"formatUTCShortWeekday");function X(H){return a[H.getUTCDay()]}o(X,"formatUTCWeekday");function ie(H){return u[H.getUTCMonth()]}o(ie,"formatUTCShortMonth");function j(H){return l[H.getUTCMonth()]}o(j,"formatUTCMonth");function J(H){return i[+(H.getUTCHours()>=12)]}o(J,"formatUTCPeriod");function Z(H){return 1+~~(H.getUTCMonth()/3)}return o(Z,"formatUTCQuarter"),{format:o(function(H){var q=E(H+="",w);return q.toString=function(){return H},q},"format"),parse:o(function(H){var q=_(H+="",!1);return q.toString=function(){return H},q},"parse"),utcFormat:o(function(H){var q=E(H+="",S);return q.toString=function(){return H},q},"utcFormat"),utcParse:o(function(H){var q=_(H+="",!0);return q.toString=function(){return H},q},"utcParse")}}function Pr(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function xwe(t,e,r){var n=Ki.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function bwe(t,e,r){var n=Ki.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function wwe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Twe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function kwe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function cY(t,e,r){var n=Ki.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function uY(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Ewe(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Cwe(t,e,r){var n=Ki.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Swe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function hY(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Awe(t,e,r){var n=Ki.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function fY(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function _we(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Lwe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Dwe(t,e,r){var n=Ki.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Rwe(t,e,r){var n=Ki.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Nwe(t,e,r){var n=gwe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Mwe(t,e,r){var n=Ki.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Iwe(t,e,r){var n=Ki.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function dY(t,e){return Pr(t.getDate(),e,2)}function Owe(t,e){return Pr(t.getHours(),e,2)}function Pwe(t,e){return Pr(t.getHours()%12||12,e,2)}function Bwe(t,e){return Pr(1+Do.count(Qs(t),t),e,3)}function vY(t,e){return Pr(t.getMilliseconds(),e,3)}function Fwe(t,e){return vY(t,e)+"000"}function zwe(t,e){return Pr(t.getMonth()+1,e,2)}function Gwe(t,e){return Pr(t.getMinutes(),e,2)}function $we(t,e){return Pr(t.getSeconds(),e,2)}function Vwe(t){var e=t.getDay();return e===0?7:e}function Uwe(t,e){return Pr(yl.count(Qs(t)-1,t),e,2)}function xY(t){var e=t.getDay();return e>=4||e===0?cc(t):cc.ceil(t)}function Hwe(t,e){return t=xY(t),Pr(cc.count(Qs(t),t)+(Qs(t).getDay()===4),e,2)}function Ywe(t){return t.getDay()}function Wwe(t,e){return Pr(_h.count(Qs(t)-1,t),e,2)}function qwe(t,e){return Pr(t.getFullYear()%100,e,2)}function Xwe(t,e){return t=xY(t),Pr(t.getFullYear()%100,e,2)}function jwe(t,e){return Pr(t.getFullYear()%1e4,e,4)}function Kwe(t,e){var r=t.getDay();return t=r>=4||r===0?cc(t):cc.ceil(t),Pr(t.getFullYear()%1e4,e,4)}function Qwe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Pr(e/60|0,"0",2)+Pr(e%60,"0",2)}function pY(t,e){return Pr(t.getUTCDate(),e,2)}function Zwe(t,e){return Pr(t.getUTCHours(),e,2)}function Jwe(t,e){return Pr(t.getUTCHours()%12||12,e,2)}function eTe(t,e){return Pr(1+zy.count(vl(t),t),e,3)}function bY(t,e){return Pr(t.getUTCMilliseconds(),e,3)}function tTe(t,e){return bY(t,e)+"000"}function rTe(t,e){return Pr(t.getUTCMonth()+1,e,2)}function nTe(t,e){return Pr(t.getUTCMinutes(),e,2)}function iTe(t,e){return Pr(t.getUTCSeconds(),e,2)}function aTe(t){var e=t.getUTCDay();return e===0?7:e}function sTe(t,e){return Pr(pd.count(vl(t)-1,t),e,2)}function wY(t){var e=t.getUTCDay();return e>=4||e===0?Lh(t):Lh.ceil(t)}function oTe(t,e){return t=wY(t),Pr(Lh.count(vl(t),t)+(vl(t).getUTCDay()===4),e,2)}function lTe(t){return t.getUTCDay()}function cTe(t,e){return Pr(Bp.count(vl(t)-1,t),e,2)}function uTe(t,e){return Pr(t.getUTCFullYear()%100,e,2)}function hTe(t,e){return t=wY(t),Pr(t.getUTCFullYear()%100,e,2)}function fTe(t,e){return Pr(t.getUTCFullYear()%1e4,e,4)}function dTe(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Lh(t):Lh.ceil(t),Pr(t.getUTCFullYear()%1e4,e,4)}function pTe(){return"+0000"}function mY(){return"%"}function gY(t){return+t}function yY(t){return Math.floor(+t/1e3)}var lY,Ki,gwe,ywe,TY=R(()=>{"use strict";_3();o(W8,"localDate");o(q8,"utcDate");o(Gy,"newDate");o(X8,"formatLocale");lY={"-":"",_:" ",0:"0"},Ki=/^\s*\d+/,gwe=/^%/,ywe=/[\\^$*+?|[\]().{}]/g;o(Pr,"pad");o(vwe,"requote");o($y,"formatRe");o(Vy,"formatLookup");o(xwe,"parseWeekdayNumberSunday");o(bwe,"parseWeekdayNumberMonday");o(wwe,"parseWeekNumberSunday");o(Twe,"parseWeekNumberISO");o(kwe,"parseWeekNumberMonday");o(cY,"parseFullYear");o(uY,"parseYear");o(Ewe,"parseZone");o(Cwe,"parseQuarter");o(Swe,"parseMonthNumber");o(hY,"parseDayOfMonth");o(Awe,"parseDayOfYear");o(fY,"parseHour24");o(_we,"parseMinutes");o(Lwe,"parseSeconds");o(Dwe,"parseMilliseconds");o(Rwe,"parseMicroseconds");o(Nwe,"parseLiteralPercent");o(Mwe,"parseUnixTimestamp");o(Iwe,"parseUnixTimestampSeconds");o(dY,"formatDayOfMonth");o(Owe,"formatHour24");o(Pwe,"formatHour12");o(Bwe,"formatDayOfYear");o(vY,"formatMilliseconds");o(Fwe,"formatMicroseconds");o(zwe,"formatMonthNumber");o(Gwe,"formatMinutes");o($we,"formatSeconds");o(Vwe,"formatWeekdayNumberMonday");o(Uwe,"formatWeekNumberSunday");o(xY,"dISO");o(Hwe,"formatWeekNumberISO");o(Ywe,"formatWeekdayNumberSunday");o(Wwe,"formatWeekNumberMonday");o(qwe,"formatYear");o(Xwe,"formatYearISO");o(jwe,"formatFullYear");o(Kwe,"formatFullYearISO");o(Qwe,"formatZone");o(pY,"formatUTCDayOfMonth");o(Zwe,"formatUTCHour24");o(Jwe,"formatUTCHour12");o(eTe,"formatUTCDayOfYear");o(bY,"formatUTCMilliseconds");o(tTe,"formatUTCMicroseconds");o(rTe,"formatUTCMonthNumber");o(nTe,"formatUTCMinutes");o(iTe,"formatUTCSeconds");o(aTe,"formatUTCWeekdayNumberMonday");o(sTe,"formatUTCWeekNumberSunday");o(wY,"UTCdISO");o(oTe,"formatUTCWeekNumberISO");o(lTe,"formatUTCWeekdayNumberSunday");o(cTe,"formatUTCWeekNumberMonday");o(uTe,"formatUTCYear");o(hTe,"formatUTCYearISO");o(fTe,"formatUTCFullYear");o(dTe,"formatUTCFullYearISO");o(pTe,"formatUTCZone");o(mY,"formatLiteralPercent");o(gY,"formatUnixTimestamp");o(yY,"formatUnixTimestampSeconds")});function j8(t){return Fp=X8(t),md=Fp.format,kY=Fp.parse,EY=Fp.utcFormat,CY=Fp.utcParse,Fp}var Fp,md,kY,EY,CY,SY=R(()=>{"use strict";TY();j8({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});o(j8,"defaultLocale")});var K8=R(()=>{"use strict";SY()});function mTe(t){return new Date(t)}function gTe(t){return t instanceof Date?+t:+new Date(+t)}function AY(t,e,r,n,i,a,s,l,u,h){var f=By(),d=f.invert,p=f.domain,m=h(".%L"),g=h(":%S"),y=h("%I:%M"),v=h("%I %p"),x=h("%a %d"),b=h("%b %d"),w=h("%B"),S=h("%Y");function T(E){return(u(E){"use strict";_3();K8();R8();Py();jH();o(mTe,"date");o(gTe,"number");o(AY,"calendar");o(L3,"time")});var LY=R(()=>{"use strict";UH();XH();A8();_Y()});function Q8(t){for(var e=t.length/6|0,r=new Array(e),n=0;n{"use strict";o(Q8,"default")});var Z8,RY=R(()=>{"use strict";DY();Z8=Q8("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab")});var NY=R(()=>{"use strict";RY()});function Nn(t){return o(function(){return t},"constant")}var D3=R(()=>{"use strict";o(Nn,"default")});function IY(t){return t>1?0:t<-1?zp:Math.acos(t)}function e_(t){return t>=1?Uy:t<=-1?-Uy:Math.asin(t)}var J8,ua,Dh,MY,R3,xl,gd,Qi,zp,Uy,Gp,N3=R(()=>{"use strict";J8=Math.abs,ua=Math.atan2,Dh=Math.cos,MY=Math.max,R3=Math.min,xl=Math.sin,gd=Math.sqrt,Qi=1e-12,zp=Math.PI,Uy=zp/2,Gp=2*zp;o(IY,"acos");o(e_,"asin")});function M3(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new ld(e)}var t_=R(()=>{"use strict";d8();o(M3,"withPath")});function yTe(t){return t.innerRadius}function vTe(t){return t.outerRadius}function xTe(t){return t.startAngle}function bTe(t){return t.endAngle}function wTe(t){return t&&t.padAngle}function TTe(t,e,r,n,i,a,s,l){var u=r-t,h=n-e,f=s-i,d=l-a,p=d*u-f*h;if(!(p*pC*C+O*O&&(A=M,L=N),{cx:A,cy:L,x01:-f,y01:-d,x11:A*(i/T-1),y11:L*(i/T-1)}}function bl(){var t=yTe,e=vTe,r=Nn(0),n=null,i=xTe,a=bTe,s=wTe,l=null,u=M3(h);function h(){var f,d,p=+t.apply(this,arguments),m=+e.apply(this,arguments),g=i.apply(this,arguments)-Uy,y=a.apply(this,arguments)-Uy,v=J8(y-g),x=y>g;if(l||(l=f=u()),mQi))l.moveTo(0,0);else if(v>Gp-Qi)l.moveTo(m*Dh(g),m*xl(g)),l.arc(0,0,m,g,y,!x),p>Qi&&(l.moveTo(p*Dh(y),p*xl(y)),l.arc(0,0,p,y,g,x));else{var b=g,w=y,S=g,T=y,E=v,_=v,A=s.apply(this,arguments)/2,L=A>Qi&&(n?+n.apply(this,arguments):gd(p*p+m*m)),M=R3(J8(m-p)/2,+r.apply(this,arguments)),N=M,k=M,I,C;if(L>Qi){var O=e_(L/p*xl(A)),D=e_(L/m*xl(A));(E-=O*2)>Qi?(O*=x?1:-1,S+=O,T-=O):(E=0,S=T=(g+y)/2),(_-=D*2)>Qi?(D*=x?1:-1,b+=D,w-=D):(_=0,b=w=(g+y)/2)}var P=m*Dh(b),F=m*xl(b),B=p*Dh(T),$=p*xl(T);if(M>Qi){var z=m*Dh(w),Y=m*xl(w),Q=p*Dh(S),X=p*xl(S),ie;if(vQi?k>Qi?(I=I3(Q,X,P,F,m,k,x),C=I3(z,Y,B,$,m,k,x),l.moveTo(I.cx+I.x01,I.cy+I.y01),kQi)||!(E>Qi)?l.lineTo(B,$):N>Qi?(I=I3(B,$,z,Y,p,-N,x),C=I3(P,F,Q,X,p,-N,x),l.lineTo(I.cx+I.x01,I.cy+I.y01),N{"use strict";D3();N3();t_();o(yTe,"arcInnerRadius");o(vTe,"arcOuterRadius");o(xTe,"arcStartAngle");o(bTe,"arcEndAngle");o(wTe,"arcPadAngle");o(TTe,"intersect");o(I3,"cornerTangents");o(bl,"default")});function Hy(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var Dyt,r_=R(()=>{"use strict";Dyt=Array.prototype.slice;o(Hy,"default")});function PY(t){this._context=t}function xu(t){return new PY(t)}var n_=R(()=>{"use strict";o(PY,"Linear");PY.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}},"point")};o(xu,"default")});function BY(t){return t[0]}function FY(t){return t[1]}var zY=R(()=>{"use strict";o(BY,"x");o(FY,"y")});function ha(t,e){var r=Nn(!0),n=null,i=xu,a=null,s=M3(l);t=typeof t=="function"?t:t===void 0?BY:Nn(t),e=typeof e=="function"?e:e===void 0?FY:Nn(e);function l(u){var h,f=(u=Hy(u)).length,d,p=!1,m;for(n==null&&(a=i(m=s())),h=0;h<=f;++h)!(h{"use strict";r_();D3();n_();t_();zY();o(ha,"default")});function i_(t,e){return et?1:e>=t?0:NaN}var $Y=R(()=>{"use strict";o(i_,"default")});function a_(t){return t}var VY=R(()=>{"use strict";o(a_,"default")});function O3(){var t=a_,e=i_,r=null,n=Nn(0),i=Nn(Gp),a=Nn(0);function s(l){var u,h=(l=Hy(l)).length,f,d,p=0,m=new Array(h),g=new Array(h),y=+n.apply(this,arguments),v=Math.min(Gp,Math.max(-Gp,i.apply(this,arguments)-y)),x,b=Math.min(Math.abs(v)/h,a.apply(this,arguments)),w=b*(v<0?-1:1),S;for(u=0;u0&&(p+=S);for(e!=null?m.sort(function(T,E){return e(g[T],g[E])}):r!=null&&m.sort(function(T,E){return r(l[T],l[E])}),u=0,d=p?(v-h*w)/p:0;u0?S*d:0)+w,g[f]={data:l[f],index:u,value:S,startAngle:y,endAngle:x,padAngle:b};return g}return o(s,"pie"),s.value=function(l){return arguments.length?(t=typeof l=="function"?l:Nn(+l),s):t},s.sortValues=function(l){return arguments.length?(e=l,r=null,s):e},s.sort=function(l){return arguments.length?(r=l,e=null,s):r},s.startAngle=function(l){return arguments.length?(n=typeof l=="function"?l:Nn(+l),s):n},s.endAngle=function(l){return arguments.length?(i=typeof l=="function"?l:Nn(+l),s):i},s.padAngle=function(l){return arguments.length?(a=typeof l=="function"?l:Nn(+l),s):a},s}var UY=R(()=>{"use strict";r_();D3();$Y();VY();N3();o(O3,"default")});function s_(t){return new P3(t,!0)}function o_(t){return new P3(t,!1)}var P3,HY=R(()=>{"use strict";P3=class{static{o(this,"Bump")}constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}};o(s_,"bumpX");o(o_,"bumpY")});function Zs(){}var Yy=R(()=>{"use strict";o(Zs,"default")});function $p(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function Wy(t){this._context=t}function vs(t){return new Wy(t)}var qy=R(()=>{"use strict";o($p,"point");o(Wy,"Basis");Wy.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 3:$p(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:$p(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};o(vs,"default")});function YY(t){this._context=t}function B3(t){return new YY(t)}var WY=R(()=>{"use strict";Yy();qy();o(YY,"BasisClosed");YY.prototype={areaStart:Zs,areaEnd:Zs,lineStart:o(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$p(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};o(B3,"default")});function qY(t){this._context=t}function F3(t){return new qY(t)}var XY=R(()=>{"use strict";qy();o(qY,"BasisOpen");qY.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:o(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:$p(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};o(F3,"default")});function jY(t,e){this._basis=new Wy(t),this._beta=e}var l_,KY=R(()=>{"use strict";qy();o(jY,"Bundle");jY.prototype={lineStart:o(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:o(function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,l=-1,u;++l<=r;)u=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(n+u*a),this._beta*e[l]+(1-this._beta)*(i+u*s));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:o(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};l_=o(function t(e){function r(n){return e===1?new Wy(n):new jY(n,e)}return o(r,"bundle"),r.beta=function(n){return t(+n)},r},"custom")(.85)});function Vp(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function z3(t,e){this._context=t,this._k=(1-e)/6}var c_,Xy=R(()=>{"use strict";o(Vp,"point");o(z3,"Cardinal");z3.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Vp(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Vp(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};c_=o(function t(e){function r(n){return new z3(n,e)}return o(r,"cardinal"),r.tension=function(n){return t(+n)},r},"custom")(0)});function G3(t,e){this._context=t,this._k=(1-e)/6}var u_,h_=R(()=>{"use strict";Yy();Xy();o(G3,"CardinalClosed");G3.prototype={areaStart:Zs,areaEnd:Zs,lineStart:o(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Vp(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};u_=o(function t(e){function r(n){return new G3(n,e)}return o(r,"cardinal"),r.tension=function(n){return t(+n)},r},"custom")(0)});function $3(t,e){this._context=t,this._k=(1-e)/6}var f_,d_=R(()=>{"use strict";Xy();o($3,"CardinalOpen");$3.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:o(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Vp(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};f_=o(function t(e){function r(n){return new $3(n,e)}return o(r,"cardinal"),r.tension=function(n){return t(+n)},r},"custom")(0)});function jy(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Qi){var l=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*l-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*l-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Qi){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/f,s=(s*h+t._y1*t._l23_2a-r*t._l12_2a)/f}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function QY(t,e){this._context=t,this._alpha=e}var p_,V3=R(()=>{"use strict";N3();Xy();o(jy,"point");o(QY,"CatmullRom");QY.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:jy(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};p_=o(function t(e){function r(n){return e?new QY(n,e):new z3(n,0)}return o(r,"catmullRom"),r.alpha=function(n){return t(+n)},r},"custom")(.5)});function ZY(t,e){this._context=t,this._alpha=e}var m_,JY=R(()=>{"use strict";h_();Yy();V3();o(ZY,"CatmullRomClosed");ZY.prototype={areaStart:Zs,areaEnd:Zs,lineStart:o(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},"lineEnd"),point:o(function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:jy(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};m_=o(function t(e){function r(n){return e?new ZY(n,e):new G3(n,0)}return o(r,"catmullRom"),r.alpha=function(n){return t(+n)},r},"custom")(.5)});function eW(t,e){this._context=t,this._alpha=e}var g_,tW=R(()=>{"use strict";d_();V3();o(eW,"CatmullRomOpen");eW.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:o(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jy(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};g_=o(function t(e){function r(n){return e?new eW(n,e):new $3(n,0)}return o(r,"catmullRom"),r.alpha=function(n){return t(+n)},r},"custom")(.5)});function rW(t){this._context=t}function U3(t){return new rW(t)}var nW=R(()=>{"use strict";Yy();o(rW,"LinearClosed");rW.prototype={areaStart:Zs,areaEnd:Zs,lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){this._point&&this._context.closePath()},"lineEnd"),point:o(function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))},"point")};o(U3,"default")});function iW(t){return t<0?-1:1}function aW(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),l=(a*i+s*n)/(n+i);return(iW(a)+iW(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function sW(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function y_(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,l=(a-n)/3;t._context.bezierCurveTo(n+l,i+l*e,a-l,s-l*r,a,s)}function H3(t){this._context=t}function oW(t){this._context=new lW(t)}function lW(t){this._context=t}function v_(t){return new H3(t)}function x_(t){return new oW(t)}var cW=R(()=>{"use strict";o(iW,"sign");o(aW,"slope3");o(sW,"slope2");o(y_,"point");o(H3,"MonotoneX");H3.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:y_(this,this._t0,sW(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,y_(this,sW(this,r=aW(this,t,e)),r);break;default:y_(this,this._t0,r=aW(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}},"point")};o(oW,"MonotoneY");(oW.prototype=Object.create(H3.prototype)).point=function(t,e){H3.prototype.point.call(this,e,t)};o(lW,"ReflectContext");lW.prototype={moveTo:o(function(t,e){this._context.moveTo(e,t)},"moveTo"),closePath:o(function(){this._context.closePath()},"closePath"),lineTo:o(function(t,e){this._context.lineTo(e,t)},"lineTo"),bezierCurveTo:o(function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)},"bezierCurveTo")};o(v_,"monotoneX");o(x_,"monotoneY")});function hW(t){this._context=t}function uW(t){var e,r=t.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e{"use strict";o(hW,"Natural");hW.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:o(function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=uW(t),i=uW(e),a=0,s=1;s{"use strict";o(W3,"Step");W3.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:o(function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e},"point")};o(q3,"default");o(b_,"stepBefore");o(w_,"stepAfter")});var pW=R(()=>{"use strict";OY();GY();UY();WY();XY();qy();HY();KY();h_();d_();Xy();JY();tW();V3();nW();n_();cW();fW();dW()});var mW=R(()=>{"use strict"});var gW=R(()=>{"use strict"});function Rh(t,e,r){this.k=t,this.x=e,this.y=r}function k_(t){for(;!t.__zoom;)if(!(t=t.parentNode))return T_;return t.__zoom}var T_,E_=R(()=>{"use strict";o(Rh,"Transform");Rh.prototype={constructor:Rh,scale:o(function(t){return t===1?this:new Rh(this.k*t,this.x,this.y)},"scale"),translate:o(function(t,e){return t===0&e===0?this:new Rh(this.k,this.x+this.k*t,this.y+this.k*e)},"translate"),apply:o(function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},"apply"),applyX:o(function(t){return t*this.k+this.x},"applyX"),applyY:o(function(t){return t*this.k+this.y},"applyY"),invert:o(function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},"invert"),invertX:o(function(t){return(t-this.x)/this.k},"invertX"),invertY:o(function(t){return(t-this.y)/this.k},"invertY"),rescaleX:o(function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},"rescaleX"),rescaleY:o(function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};T_=new Rh(1,0,0);k_.prototype=Rh.prototype;o(k_,"transform")});var yW=R(()=>{"use strict"});var vW=R(()=>{"use strict";c3();mW();gW();E_();yW()});var xW=R(()=>{"use strict";vW();E_()});var Zt=R(()=>{"use strict";bh();K$();mH();xH();Lp();bH();wH();bS();$V();TH();l8();kH();CH();C8();zH();GH();Np();d8();$H();EH();VH();LY();NY();fl();pW();_3();K8();n3();c3();xW()});var bW=gi(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.BLANK_URL=Zi.relativeFirstCharacters=Zi.whitespaceEscapeCharsRegex=Zi.urlSchemeRegex=Zi.ctrlCharactersRegex=Zi.htmlCtrlEntityRegex=Zi.htmlEntitiesRegex=Zi.invalidProtocolRegex=void 0;Zi.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;Zi.htmlEntitiesRegex=/(\w+)(^\w|;)?/g;Zi.htmlCtrlEntityRegex=/&(newline|tab);/gi;Zi.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;Zi.urlSchemeRegex=/^.+(:|:)/gim;Zi.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;Zi.relativeFirstCharacters=[".","/"];Zi.BLANK_URL="about:blank"});var Up=gi(X3=>{"use strict";Object.defineProperty(X3,"__esModule",{value:!0});X3.sanitizeUrl=void 0;var Na=bW();function kTe(t){return Na.relativeFirstCharacters.indexOf(t[0])>-1}o(kTe,"isRelativeUrlWithoutProtocol");function ETe(t){var e=t.replace(Na.ctrlCharactersRegex,"");return e.replace(Na.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}o(ETe,"decodeHtmlCharacters");function CTe(t){return URL.canParse(t)}o(CTe,"isValidUrl");function wW(t){try{return decodeURIComponent(t)}catch{return t}}o(wW,"decodeURI");function STe(t){if(!t)return Na.BLANK_URL;var e,r=wW(t.trim());do r=ETe(r).replace(Na.htmlCtrlEntityRegex,"").replace(Na.ctrlCharactersRegex,"").replace(Na.whitespaceEscapeCharsRegex,"").trim(),r=wW(r),e=r.match(Na.ctrlCharactersRegex)||r.match(Na.htmlEntitiesRegex)||r.match(Na.htmlCtrlEntityRegex)||r.match(Na.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return Na.BLANK_URL;if(kTe(n))return n;var i=n.trimStart(),a=i.match(Na.urlSchemeRegex);if(!a)return n;var s=a[0].toLowerCase().trim();if(Na.invalidProtocolRegex.test(s))return Na.BLANK_URL;var l=i.replace(/\\/g,"/");if(s==="mailto:"||s.includes("://"))return l;if(s==="http:"||s==="https:"){if(!CTe(l))return Na.BLANK_URL;var u=new URL(l);return u.protocol=u.protocol.toLowerCase(),u.hostname=u.hostname.toLowerCase(),u.toString()}return l}o(STe,"sanitizeUrl");X3.sanitizeUrl=STe});var C_,yd,j3,TW,kW,EW,wl,Ky,Qy=R(()=>{"use strict";C_=Xi(Up(),1);rr();yd=o((t,e)=>{let r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(let n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),j3=o((t,e)=>{let r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};yd(t,r).lower()},"drawBackgroundRect"),TW=o((t,e)=>{let r=e.text.replace(Qf," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);let i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),kW=o((t,e,r,n)=>{let i=t.append("image");i.attr("x",e),i.attr("y",r);let a=(0,C_.sanitizeUrl)(n);i.attr("xlink:href",a)},"drawImage"),EW=o((t,e,r,n)=>{let i=t.append("use");i.attr("x",e),i.attr("y",r);let a=(0,C_.sanitizeUrl)(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),wl=o(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Ky=o(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj")});var CW,S_,SW,ATe,_Te,LTe,DTe,RTe,NTe,MTe,ITe,OTe,PTe,BTe,FTe,bu,Tl,AW=R(()=>{"use strict";rr();Qy();CW=Xi(Up(),1),S_=o(function(t,e){return yd(t,e)},"drawRect"),SW=o(function(t,e,r,n,i,a){let s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let l=a.startsWith("data:image/png;base64")?a:(0,CW.sanitizeUrl)(a);s.attr("xlink:href",l)},"drawImage"),ATe=o((t,e,r)=>{let n=t.append("g"),i=0;for(let a of e){let s=a.textColor?a.textColor:"#444444",l=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,h=a.offsetY?parseInt(a.offsetY):0,f="";if(i===0){let p=n.append("line");p.attr("x1",a.startPoint.x),p.attr("y1",a.startPoint.y),p.attr("x2",a.endPoint.x),p.attr("y2",a.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),a.type!=="rel_b"&&p.attr("marker-end","url("+f+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+f+"#arrowend)"),i=-1}else{let p=n.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&p.attr("marker-end","url("+f+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+f+"#arrowend)")}let d=r.messageFont();bu(r)(a.label.text,n,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+h,a.label.width,a.label.height,{fill:s},d),a.techn&&a.techn.text!==""&&(d=r.messageFont(),bu(r)("["+a.techn.text+"]",n,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+r.messageFontSize+5+h,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:s,"font-style":"italic"},d))}},"drawRels"),_Te=o(function(t,e,r){let n=t.append("g"),i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",l={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(l={"stroke-width":1});let u={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:l};S_(n,u);let h=r.boundaryFont();h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=s,bu(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},h),e.type&&e.type.text!==""&&(h=r.boundaryFont(),h.fontColor=s,bu(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},h)),e.descr&&e.descr.text!==""&&(h=r.boundaryFont(),h.fontSize=h.fontSize-2,h.fontColor=s,bu(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},h))},"drawBoundary"),LTe=o(function(t,e,r){let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="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":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}let l=t.append("g");l.attr("class","person-man");let u=wl();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":u.x=e.x,u.y=e.y,u.fill=n,u.width=e.width,u.height=e.height,u.stroke=i,u.rx=2.5,u.ry=2.5,u.attrs={"stroke-width":.5},S_(l,u);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":l.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).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",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),l.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":l.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).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",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),l.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let h=FTe(r,e.typeC4Shape.text);switch(l.append("text").attr("fill",a).attr("font-family",h.fontFamily).attr("font-size",h.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":SW(l,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let f=r[e.typeC4Shape.text+"Font"]();return f.fontWeight="bold",f.fontSize=f.fontSize+2,f.fontColor=a,bu(r)(e.label.text,l,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},f),f=r[e.typeC4Shape.text+"Font"](),f.fontColor=a,e.techn&&e.techn?.text!==""?bu(r)(e.techn.text,l,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},f):e.type&&e.type.text!==""&&bu(r)(e.type.text,l,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},f),e.descr&&e.descr.text!==""&&(f=r.personFont(),f.fontColor=a,bu(r)(e.descr.text,l,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},f)),e.height},"drawC4Shape"),DTe=o(function(t){t.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")},"insertDatabaseIcon"),RTe=o(function(t){t.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")},"insertComputerIcon"),NTe=o(function(t){t.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")},"insertClockIcon"),MTe=o(function(t){t.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")},"insertArrowHead"),ITe=o(function(t){t.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")},"insertArrowEnd"),OTe=o(function(t){t.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")},"insertArrowFilledHead"),PTe=o(function(t){t.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)},"insertDynamicNumber"),BTe=o(function(t){let r=t.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")},"insertArrowCrossHead"),FTe=o((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),bu=function(){function t(i,a,s,l,u,h,f){let d=a.append("text").attr("x",s+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(i);n(d,f)}o(t,"byText");function e(i,a,s,l,u,h,f,d){let{fontSize:p,fontFamily:m,fontWeight:g}=d,y=i.split(We.lineBreakRegex);for(let v=0;v{"use strict";zTe=typeof global=="object"&&global&&global.Object===Object&&global,Q3=zTe});var GTe,$Te,Jn,Ro=R(()=>{"use strict";A_();GTe=typeof self=="object"&&self&&self.Object===Object&&self,$Te=Q3||GTe||Function("return this")(),Jn=$Te});var VTe,Ji,vd=R(()=>{"use strict";Ro();VTe=Jn.Symbol,Ji=VTe});function YTe(t){var e=UTe.call(t,Zy),r=t[Zy];try{t[Zy]=void 0;var n=!0}catch{}var i=HTe.call(t);return n&&(e?t[Zy]=r:delete t[Zy]),i}var _W,UTe,HTe,Zy,LW,DW=R(()=>{"use strict";vd();_W=Object.prototype,UTe=_W.hasOwnProperty,HTe=_W.toString,Zy=Ji?Ji.toStringTag:void 0;o(YTe,"getRawTag");LW=YTe});function XTe(t){return qTe.call(t)}var WTe,qTe,RW,NW=R(()=>{"use strict";WTe=Object.prototype,qTe=WTe.toString;o(XTe,"objectToString");RW=XTe});function QTe(t){return t==null?t===void 0?KTe:jTe:MW&&MW in Object(t)?LW(t):RW(t)}var jTe,KTe,MW,fa,wu=R(()=>{"use strict";vd();DW();NW();jTe="[object Null]",KTe="[object Undefined]",MW=Ji?Ji.toStringTag:void 0;o(QTe,"baseGetTag");fa=QTe});function ZTe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pn,Js=R(()=>{"use strict";o(ZTe,"isObject");pn=ZTe});function nke(t){if(!pn(t))return!1;var e=fa(t);return e==eke||e==tke||e==JTe||e==rke}var JTe,eke,tke,rke,wi,Jy=R(()=>{"use strict";wu();Js();JTe="[object AsyncFunction]",eke="[object Function]",tke="[object GeneratorFunction]",rke="[object Proxy]";o(nke,"isFunction");wi=nke});var ike,Z3,IW=R(()=>{"use strict";Ro();ike=Jn["__core-js_shared__"],Z3=ike});function ake(t){return!!OW&&OW in t}var OW,PW,BW=R(()=>{"use strict";IW();OW=function(){var t=/[^.]+$/.exec(Z3&&Z3.keys&&Z3.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();o(ake,"isMasked");PW=ake});function lke(t){if(t!=null){try{return oke.call(t)}catch{}try{return t+""}catch{}}return""}var ske,oke,Tu,__=R(()=>{"use strict";ske=Function.prototype,oke=ske.toString;o(lke,"toSource");Tu=lke});function gke(t){if(!pn(t)||PW(t))return!1;var e=wi(t)?mke:uke;return e.test(Tu(t))}var cke,uke,hke,fke,dke,pke,mke,FW,zW=R(()=>{"use strict";Jy();BW();Js();__();cke=/[\\^$.*+?()[\]{}|]/g,uke=/^\[object .+?Constructor\]$/,hke=Function.prototype,fke=Object.prototype,dke=hke.toString,pke=fke.hasOwnProperty,mke=RegExp("^"+dke.call(pke).replace(cke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");o(gke,"baseIsNative");FW=gke});function yke(t,e){return t?.[e]}var GW,$W=R(()=>{"use strict";o(yke,"getValue");GW=yke});function vke(t,e){var r=GW(t,e);return FW(r)?r:void 0}var xs,Nh=R(()=>{"use strict";zW();$W();o(vke,"getNative");xs=vke});var xke,ku,ev=R(()=>{"use strict";Nh();xke=xs(Object,"create"),ku=xke});function bke(){this.__data__=ku?ku(null):{},this.size=0}var VW,UW=R(()=>{"use strict";ev();o(bke,"hashClear");VW=bke});function wke(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var HW,YW=R(()=>{"use strict";o(wke,"hashDelete");HW=wke});function Cke(t){var e=this.__data__;if(ku){var r=e[t];return r===Tke?void 0:r}return Eke.call(e,t)?e[t]:void 0}var Tke,kke,Eke,WW,qW=R(()=>{"use strict";ev();Tke="__lodash_hash_undefined__",kke=Object.prototype,Eke=kke.hasOwnProperty;o(Cke,"hashGet");WW=Cke});function _ke(t){var e=this.__data__;return ku?e[t]!==void 0:Ake.call(e,t)}var Ske,Ake,XW,jW=R(()=>{"use strict";ev();Ske=Object.prototype,Ake=Ske.hasOwnProperty;o(_ke,"hashHas");XW=_ke});function Dke(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ku&&e===void 0?Lke:e,this}var Lke,KW,QW=R(()=>{"use strict";ev();Lke="__lodash_hash_undefined__";o(Dke,"hashSet");KW=Dke});function Hp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{"use strict";UW();YW();qW();jW();QW();o(Hp,"Hash");Hp.prototype.clear=VW;Hp.prototype.delete=HW;Hp.prototype.get=WW;Hp.prototype.has=XW;Hp.prototype.set=KW;L_=Hp});function Rke(){this.__data__=[],this.size=0}var JW,eq=R(()=>{"use strict";o(Rke,"listCacheClear");JW=Rke});function Nke(t,e){return t===e||t!==t&&e!==e}var No,xd=R(()=>{"use strict";o(Nke,"eq");No=Nke});function Mke(t,e){for(var r=t.length;r--;)if(No(t[r][0],e))return r;return-1}var Mh,tv=R(()=>{"use strict";xd();o(Mke,"assocIndexOf");Mh=Mke});function Pke(t){var e=this.__data__,r=Mh(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Oke.call(e,r,1),--this.size,!0}var Ike,Oke,tq,rq=R(()=>{"use strict";tv();Ike=Array.prototype,Oke=Ike.splice;o(Pke,"listCacheDelete");tq=Pke});function Bke(t){var e=this.__data__,r=Mh(e,t);return r<0?void 0:e[r][1]}var nq,iq=R(()=>{"use strict";tv();o(Bke,"listCacheGet");nq=Bke});function Fke(t){return Mh(this.__data__,t)>-1}var aq,sq=R(()=>{"use strict";tv();o(Fke,"listCacheHas");aq=Fke});function zke(t,e){var r=this.__data__,n=Mh(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var oq,lq=R(()=>{"use strict";tv();o(zke,"listCacheSet");oq=zke});function Yp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{"use strict";eq();rq();iq();sq();lq();o(Yp,"ListCache");Yp.prototype.clear=JW;Yp.prototype.delete=tq;Yp.prototype.get=nq;Yp.prototype.has=aq;Yp.prototype.set=oq;Ih=Yp});var Gke,Oh,J3=R(()=>{"use strict";Nh();Ro();Gke=xs(Jn,"Map"),Oh=Gke});function $ke(){this.size=0,this.__data__={hash:new L_,map:new(Oh||Ih),string:new L_}}var cq,uq=R(()=>{"use strict";ZW();rv();J3();o($ke,"mapCacheClear");cq=$ke});function Vke(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var hq,fq=R(()=>{"use strict";o(Vke,"isKeyable");hq=Vke});function Uke(t,e){var r=t.__data__;return hq(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ph,nv=R(()=>{"use strict";fq();o(Uke,"getMapData");Ph=Uke});function Hke(t){var e=Ph(this,t).delete(t);return this.size-=e?1:0,e}var dq,pq=R(()=>{"use strict";nv();o(Hke,"mapCacheDelete");dq=Hke});function Yke(t){return Ph(this,t).get(t)}var mq,gq=R(()=>{"use strict";nv();o(Yke,"mapCacheGet");mq=Yke});function Wke(t){return Ph(this,t).has(t)}var yq,vq=R(()=>{"use strict";nv();o(Wke,"mapCacheHas");yq=Wke});function qke(t,e){var r=Ph(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var xq,bq=R(()=>{"use strict";nv();o(qke,"mapCacheSet");xq=qke});function Wp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{"use strict";uq();pq();gq();vq();bq();o(Wp,"MapCache");Wp.prototype.clear=cq;Wp.prototype.delete=dq;Wp.prototype.get=mq;Wp.prototype.has=yq;Wp.prototype.set=xq;bd=Wp});function D_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Xke);var r=o(function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s},"memoized");return r.cache=new(D_.Cache||bd),r}var Xke,qp,R_=R(()=>{"use strict";e5();Xke="Expected a function";o(D_,"memoize");D_.Cache=bd;qp=D_});function jke(){this.__data__=new Ih,this.size=0}var wq,Tq=R(()=>{"use strict";rv();o(jke,"stackClear");wq=jke});function Kke(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var kq,Eq=R(()=>{"use strict";o(Kke,"stackDelete");kq=Kke});function Qke(t){return this.__data__.get(t)}var Cq,Sq=R(()=>{"use strict";o(Qke,"stackGet");Cq=Qke});function Zke(t){return this.__data__.has(t)}var Aq,_q=R(()=>{"use strict";o(Zke,"stackHas");Aq=Zke});function eEe(t,e){var r=this.__data__;if(r instanceof Ih){var n=r.__data__;if(!Oh||n.length{"use strict";rv();J3();e5();Jke=200;o(eEe,"stackSet");Lq=eEe});function Xp(t){var e=this.__data__=new Ih(t);this.size=e.size}var uc,iv=R(()=>{"use strict";rv();Tq();Eq();Sq();_q();Dq();o(Xp,"Stack");Xp.prototype.clear=wq;Xp.prototype.delete=kq;Xp.prototype.get=Cq;Xp.prototype.has=Aq;Xp.prototype.set=Lq;uc=Xp});var tEe,jp,N_=R(()=>{"use strict";Nh();tEe=function(){try{var t=xs(Object,"defineProperty");return t({},"",{}),t}catch{}}(),jp=tEe});function rEe(t,e,r){e=="__proto__"&&jp?jp(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var hc,Kp=R(()=>{"use strict";N_();o(rEe,"baseAssignValue");hc=rEe});function nEe(t,e,r){(r!==void 0&&!No(t[e],r)||r===void 0&&!(e in t))&&hc(t,e,r)}var av,M_=R(()=>{"use strict";Kp();xd();o(nEe,"assignMergeValue");av=nEe});function iEe(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),l=s.length;l--;){var u=s[t?l:++i];if(r(a[u],u,a)===!1)break}return e}}var Rq,Nq=R(()=>{"use strict";o(iEe,"createBaseFor");Rq=iEe});var aEe,Qp,t5=R(()=>{"use strict";Nq();aEe=Rq(),Qp=aEe});function oEe(t,e){if(e)return t.slice();var r=t.length,n=Oq?Oq(r):new t.constructor(r);return t.copy(n),n}var Pq,Mq,sEe,Iq,Oq,r5,I_=R(()=>{"use strict";Ro();Pq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mq=Pq&&typeof module=="object"&&module&&!module.nodeType&&module,sEe=Mq&&Mq.exports===Pq,Iq=sEe?Jn.Buffer:void 0,Oq=Iq?Iq.allocUnsafe:void 0;o(oEe,"cloneBuffer");r5=oEe});var lEe,Zp,O_=R(()=>{"use strict";Ro();lEe=Jn.Uint8Array,Zp=lEe});function cEe(t){var e=new t.constructor(t.byteLength);return new Zp(e).set(new Zp(t)),e}var Jp,n5=R(()=>{"use strict";O_();o(cEe,"cloneArrayBuffer");Jp=cEe});function uEe(t,e){var r=e?Jp(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var i5,P_=R(()=>{"use strict";n5();o(uEe,"cloneTypedArray");i5=uEe});function hEe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r{"use strict";o(hEe,"copyArray");a5=hEe});var Bq,fEe,Fq,zq=R(()=>{"use strict";Js();Bq=Object.create,fEe=function(){function t(){}return o(t,"object"),function(e){if(!pn(e))return{};if(Bq)return Bq(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Fq=fEe});function dEe(t,e){return function(r){return t(e(r))}}var s5,F_=R(()=>{"use strict";o(dEe,"overArg");s5=dEe});var pEe,em,o5=R(()=>{"use strict";F_();pEe=s5(Object.getPrototypeOf,Object),em=pEe});function gEe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||mEe;return t===r}var mEe,fc,tm=R(()=>{"use strict";mEe=Object.prototype;o(gEe,"isPrototype");fc=gEe});function yEe(t){return typeof t.constructor=="function"&&!fc(t)?Fq(em(t)):{}}var l5,z_=R(()=>{"use strict";zq();o5();tm();o(yEe,"initCloneObject");l5=yEe});function vEe(t){return t!=null&&typeof t=="object"}var Wn,Mo=R(()=>{"use strict";o(vEe,"isObjectLike");Wn=vEe});function bEe(t){return Wn(t)&&fa(t)==xEe}var xEe,G_,Gq=R(()=>{"use strict";wu();Mo();xEe="[object Arguments]";o(bEe,"baseIsArguments");G_=bEe});var $q,wEe,TEe,kEe,kl,rm=R(()=>{"use strict";Gq();Mo();$q=Object.prototype,wEe=$q.hasOwnProperty,TEe=$q.propertyIsEnumerable,kEe=G_(function(){return arguments}())?G_:function(t){return Wn(t)&&wEe.call(t,"callee")&&!TEe.call(t,"callee")},kl=kEe});var EEe,wt,Bn=R(()=>{"use strict";EEe=Array.isArray,wt=EEe});function SEe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=CEe}var CEe,nm,c5=R(()=>{"use strict";CEe=9007199254740991;o(SEe,"isLength");nm=SEe});function AEe(t){return t!=null&&nm(t.length)&&!wi(t)}var ei,Io=R(()=>{"use strict";Jy();c5();o(AEe,"isArrayLike");ei=AEe});function _Ee(t){return Wn(t)&&ei(t)}var wd,u5=R(()=>{"use strict";Io();Mo();o(_Ee,"isArrayLikeObject");wd=_Ee});function LEe(){return!1}var Vq,Uq=R(()=>{"use strict";o(LEe,"stubFalse");Vq=LEe});var Wq,Hq,DEe,Yq,REe,NEe,El,im=R(()=>{"use strict";Ro();Uq();Wq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hq=Wq&&typeof module=="object"&&module&&!module.nodeType&&module,DEe=Hq&&Hq.exports===Wq,Yq=DEe?Jn.Buffer:void 0,REe=Yq?Yq.isBuffer:void 0,NEe=REe||Vq,El=NEe});function FEe(t){if(!Wn(t)||fa(t)!=MEe)return!1;var e=em(t);if(e===null)return!0;var r=PEe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&qq.call(r)==BEe}var MEe,IEe,OEe,qq,PEe,BEe,Xq,jq=R(()=>{"use strict";wu();o5();Mo();MEe="[object Object]",IEe=Function.prototype,OEe=Object.prototype,qq=IEe.toString,PEe=OEe.hasOwnProperty,BEe=qq.call(Object);o(FEe,"isPlainObject");Xq=FEe});function c6e(t){return Wn(t)&&nm(t.length)&&!!Mn[fa(t)]}var zEe,GEe,$Ee,VEe,UEe,HEe,YEe,WEe,qEe,XEe,jEe,KEe,QEe,ZEe,JEe,e6e,t6e,r6e,n6e,i6e,a6e,s6e,o6e,l6e,Mn,Kq,Qq=R(()=>{"use strict";wu();c5();Mo();zEe="[object Arguments]",GEe="[object Array]",$Ee="[object Boolean]",VEe="[object Date]",UEe="[object Error]",HEe="[object Function]",YEe="[object Map]",WEe="[object Number]",qEe="[object Object]",XEe="[object RegExp]",jEe="[object Set]",KEe="[object String]",QEe="[object WeakMap]",ZEe="[object ArrayBuffer]",JEe="[object DataView]",e6e="[object Float32Array]",t6e="[object Float64Array]",r6e="[object Int8Array]",n6e="[object Int16Array]",i6e="[object Int32Array]",a6e="[object Uint8Array]",s6e="[object Uint8ClampedArray]",o6e="[object Uint16Array]",l6e="[object Uint32Array]",Mn={};Mn[e6e]=Mn[t6e]=Mn[r6e]=Mn[n6e]=Mn[i6e]=Mn[a6e]=Mn[s6e]=Mn[o6e]=Mn[l6e]=!0;Mn[zEe]=Mn[GEe]=Mn[ZEe]=Mn[$Ee]=Mn[JEe]=Mn[VEe]=Mn[UEe]=Mn[HEe]=Mn[YEe]=Mn[WEe]=Mn[qEe]=Mn[XEe]=Mn[jEe]=Mn[KEe]=Mn[QEe]=!1;o(c6e,"baseIsTypedArray");Kq=c6e});function u6e(t){return function(e){return t(e)}}var Oo,Td=R(()=>{"use strict";o(u6e,"baseUnary");Oo=u6e});var Zq,sv,h6e,$_,f6e,Po,ov=R(()=>{"use strict";A_();Zq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,sv=Zq&&typeof module=="object"&&module&&!module.nodeType&&module,h6e=sv&&sv.exports===Zq,$_=h6e&&Q3.process,f6e=function(){try{var t=sv&&sv.require&&sv.require("util").types;return t||$_&&$_.binding&&$_.binding("util")}catch{}}(),Po=f6e});var Jq,d6e,Bh,lv=R(()=>{"use strict";Qq();Td();ov();Jq=Po&&Po.isTypedArray,d6e=Jq?Oo(Jq):Kq,Bh=d6e});function p6e(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var cv,V_=R(()=>{"use strict";o(p6e,"safeGet");cv=p6e});function y6e(t,e,r){var n=t[e];(!(g6e.call(t,e)&&No(n,r))||r===void 0&&!(e in t))&&hc(t,e,r)}var m6e,g6e,dc,am=R(()=>{"use strict";Kp();xd();m6e=Object.prototype,g6e=m6e.hasOwnProperty;o(y6e,"assignValue");dc=y6e});function v6e(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a{"use strict";am();Kp();o(v6e,"copyObject");Bo=v6e});function x6e(t,e){for(var r=-1,n=Array(t);++r{"use strict";o(x6e,"baseTimes");eX=x6e});function T6e(t,e){var r=typeof t;return e=e??b6e,!!e&&(r=="number"||r!="symbol"&&w6e.test(t))&&t>-1&&t%1==0&&t{"use strict";b6e=9007199254740991,w6e=/^(?:0|[1-9]\d*)$/;o(T6e,"isIndex");Fh=T6e});function C6e(t,e){var r=wt(t),n=!r&&kl(t),i=!r&&!n&&El(t),a=!r&&!n&&!i&&Bh(t),s=r||n||i||a,l=s?eX(t.length,String):[],u=l.length;for(var h in t)(e||E6e.call(t,h))&&!(s&&(h=="length"||i&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Fh(h,u)))&&l.push(h);return l}var k6e,E6e,h5,U_=R(()=>{"use strict";tX();rm();Bn();im();uv();lv();k6e=Object.prototype,E6e=k6e.hasOwnProperty;o(C6e,"arrayLikeKeys");h5=C6e});function S6e(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var rX,nX=R(()=>{"use strict";o(S6e,"nativeKeysIn");rX=S6e});function L6e(t){if(!pn(t))return rX(t);var e=fc(t),r=[];for(var n in t)n=="constructor"&&(e||!_6e.call(t,n))||r.push(n);return r}var A6e,_6e,iX,aX=R(()=>{"use strict";Js();tm();nX();A6e=Object.prototype,_6e=A6e.hasOwnProperty;o(L6e,"baseKeysIn");iX=L6e});function D6e(t){return ei(t)?h5(t,!0):iX(t)}var bs,zh=R(()=>{"use strict";U_();aX();Io();o(D6e,"keysIn");bs=D6e});function R6e(t){return Bo(t,bs(t))}var sX,oX=R(()=>{"use strict";kd();zh();o(R6e,"toPlainObject");sX=R6e});function N6e(t,e,r,n,i,a,s){var l=cv(t,r),u=cv(e,r),h=s.get(u);if(h){av(t,r,h);return}var f=a?a(l,u,r+"",t,e,s):void 0,d=f===void 0;if(d){var p=wt(u),m=!p&&El(u),g=!p&&!m&&Bh(u);f=u,p||m||g?wt(l)?f=l:wd(l)?f=a5(l):m?(d=!1,f=r5(u,!0)):g?(d=!1,f=i5(u,!0)):f=[]:Xq(u)||kl(u)?(f=l,kl(l)?f=sX(l):(!pn(l)||wi(l))&&(f=l5(u))):d=!1}d&&(s.set(u,f),i(f,u,n,a,s),s.delete(u)),av(t,r,f)}var lX,cX=R(()=>{"use strict";M_();I_();P_();B_();z_();rm();Bn();u5();im();Jy();Js();jq();lv();V_();oX();o(N6e,"baseMergeDeep");lX=N6e});function uX(t,e,r,n,i){t!==e&&Qp(e,function(a,s){if(i||(i=new uc),pn(a))lX(t,e,s,r,uX,n,i);else{var l=n?n(cv(t,s),a,s+"",t,e,i):void 0;l===void 0&&(l=a),av(t,s,l)}},bs)}var hX,fX=R(()=>{"use strict";iv();M_();t5();cX();Js();zh();V_();o(uX,"baseMerge");hX=uX});function M6e(t){return t}var ea,Eu=R(()=>{"use strict";o(M6e,"identity");ea=M6e});function I6e(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var dX,pX=R(()=>{"use strict";o(I6e,"apply");dX=I6e});function O6e(t,e,r){return e=mX(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=mX(n.length-e,0),s=Array(a);++i{"use strict";pX();mX=Math.max;o(O6e,"overRest");f5=O6e});function P6e(t){return function(){return t}}var ws,Y_=R(()=>{"use strict";o(P6e,"constant");ws=P6e});var B6e,gX,yX=R(()=>{"use strict";Y_();N_();Eu();B6e=jp?function(t,e){return jp(t,"toString",{configurable:!0,enumerable:!1,value:ws(e),writable:!0})}:ea,gX=B6e});function $6e(t){var e=0,r=0;return function(){var n=G6e(),i=z6e-(n-r);if(r=n,i>0){if(++e>=F6e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var F6e,z6e,G6e,vX,xX=R(()=>{"use strict";F6e=800,z6e=16,G6e=Date.now;o($6e,"shortOut");vX=$6e});var V6e,d5,W_=R(()=>{"use strict";yX();xX();V6e=vX(gX),d5=V6e});function U6e(t,e){return d5(f5(t,e,ea),t+"")}var pc,sm=R(()=>{"use strict";Eu();H_();W_();o(U6e,"baseRest");pc=U6e});function H6e(t,e,r){if(!pn(r))return!1;var n=typeof e;return(n=="number"?ei(r)&&Fh(e,r.length):n=="string"&&e in r)?No(r[e],t):!1}var eo,Ed=R(()=>{"use strict";xd();Io();uv();Js();o(H6e,"isIterateeCall");eo=H6e});function Y6e(t){return pc(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&eo(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n{"use strict";sm();Ed();o(Y6e,"createAssigner");p5=Y6e});var W6e,Gh,X_=R(()=>{"use strict";fX();q_();W6e=p5(function(t,e,r){hX(t,e,r)}),Gh=W6e});function om(t,e){if(!t)return e;let r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return q6e[r]??e}function Q6e(t,e){let r=t.trim();if(r)return e.securityLevel!=="loose"?(0,TX.sanitizeUrl)(r):r}function CX(t,e){return!t||!e?0:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function J6e(t){let e,r=0;t.forEach(i=>{r+=CX(i,e),e=i});let n=r/2;return Q_(t,n)}function eCe(t){return t.length===1?t[0]:J6e(t)}function rCe(t,e,r){let n=structuredClone(r);V.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();let i=25+t,a=Q_(n,i),s=10+t*.5,l=Math.atan2(n[0].y-a.y,n[0].x-a.x),u={x:0,y:0};return e==="start_left"?(u.x=Math.sin(l+Math.PI)*s+(n[0].x+a.x)/2,u.y=-Math.cos(l+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(u.x=Math.sin(l-Math.PI)*s+(n[0].x+a.x)/2-5,u.y=-Math.cos(l-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(u.x=Math.sin(l)*s+(n[0].x+a.x)/2-5,u.y=-Math.cos(l)*s+(n[0].y+a.y)/2-5):(u.x=Math.sin(l)*s+(n[0].x+a.x)/2,u.y=-Math.cos(l)*s+(n[0].y+a.y)/2),u}function lm(t){let e="",r="";for(let n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}function nCe(t){let e="",r="0123456789abcdef",n=r.length;for(let i=0;i{"use strict";TX=Xi(Up(),1);Zt();rr();r7();ut();Hf();cp();R_();X_();Vb();K_="\u200B",q6e={curveBasis:vs,curveBasisClosed:B3,curveBasisOpen:F3,curveBumpX:s_,curveBumpY:o_,curveBundle:l_,curveCardinalClosed:u_,curveCardinalOpen:f_,curveCardinal:c_,curveCatmullRomClosed:m_,curveCatmullRomOpen:g_,curveCatmullRom:p_,curveLinear:xu,curveLinearClosed:U3,curveMonotoneX:v_,curveMonotoneY:x_,curveNatural:Y3,curveStep:q3,curveStepAfter:w_,curveStepBefore:b_},X6e=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,j6e=o(function(t,e){let r=kX(t,/(?:init\b)|(?:initialize\b)/),n={};if(Array.isArray(r)){let s=r.map(l=>l.args);fp(s),n=On(n,[...s])}else n=r.args;if(!n)return;let i=lp(t,e),a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),kX=o(function(t,e=null){try{let r=new RegExp(`[%]{2}(?![{]${X6e.source})(?=[}][%]{2}).*
-`,"ig");t=t.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let n,i=[];for(;(n=Vf.exec(t))!==null;)if(n.index===Vf.lastIndex&&Vf.lastIndex++,n&&!e||e&&n[1]?.match(e)||e&&n[2]?.match(e)){let a=n[1]?n[1]:n[2],s=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:a,args:s})}return i.length===0?{type:t,args:null}:i.length===1?i[0]:i}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),EX=o(function(t){return t.replace(Vf,"")},"removeDirectives"),K6e=o(function(t,e){for(let[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");o(om,"interpolateToCurve");o(Q6e,"formatUrl");Z6e=o((t,...e)=>{let r=t.split("."),n=r.length-1,i=r[n],a=window;for(let s=0;s{let r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),Q_=o((t,e)=>{let r,n=e;for(let i of t){if(r){let a=CX(i,r);if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:bX((1-s)*r.x+s*i.x,5),y:bX((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),tCe=o((t,e,r)=>{V.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());let i=Q_(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),l={x:0,y:0};return l.x=Math.sin(s)*a+(e[0].x+i.x)/2,l.y=-Math.cos(s)*a+(e[0].y+i.y)/2,l},"calcCardinalityPosition");o(rCe,"calcTerminalLabelPosition");o(lm,"getStylesFromArray");wX=0,Z_=o(()=>(wX++,"id-"+Math.random().toString(36).substr(2,12)+"-"+wX),"generateId");o(nCe,"makeRandomHex");J_=o(t=>nCe(t.length),"random"),iCe=o(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),aCe=o(function(t,e){let r=e.text.replace(We.lineBreakRegex," "),[,n]=mc(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);let a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),e9=qp((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:" "},r),We.lineBreakRegex.test(t)))return t;let n=t.split(" ").filter(Boolean),i=[],a="";return n.forEach((s,l)=>{let u=Cl(`${s} `,r),h=Cl(a,r);if(u>e){let{hyphenatedStrings:p,remainingWord:m}=sCe(s,e,"-",r);i.push(a,...p),a=m}else h+u>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");l+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),sCe=qp((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);let i=[...t],a=[],s="";return i.forEach((l,u)=>{let h=`${s}${l}`;if(Cl(h,n)>=e){let d=u+1,p=i.length===d,m=`${h}${r}`;a.push(p?h:m),s=""}else s=h}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);o(g5,"calculateTextHeight");o(Cl,"calculateTextWidth");t9=qp((t,e)=>{let{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};let[,a]=mc(r),s=["sans-serif",n],l=t.split(We.lineBreakRegex),u=[],h=$e("body");if(!h.remove)return{width:0,height:0,lineHeight:0};let f=h.append("svg");for(let p of s){let m=0,g={width:0,height:0,lineHeight:0};for(let y of l){let v=iCe();v.text=y||K_;let x=aCe(f,v).style("font-size",a).style("font-weight",i).style("font-family",p),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),m=Math.round(b.height),g.height+=m,g.lineHeight=Math.round(Math.max(g.lineHeight,m))}u.push(g)}f.remove();let d=isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1;return u[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),j_=class{constructor(e=!1,r){this.count=0;this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{o(this,"InitIDGenerator")}},oCe=o(function(t){return m5=m5||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),m5.innerHTML=t,unescape(m5.textContent)},"entityDecode");o(r9,"isDetailedError");lCe=o((t,e,r,n)=>{if(!n)return;let i=t.node()?.getBBox();i&&t.append("text").text(n).attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),mc=o(t=>{if(typeof t=="number")return[t,t+"px"];let e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");o(Ts,"cleanAndMerge");Lt={assignWithDepth:On,wrapLabel:e9,calculateTextHeight:g5,calculateTextWidth:Cl,calculateTextDimensions:t9,cleanAndMerge:Ts,detectInit:j6e,detectDirective:kX,isSubstringInArray:K6e,interpolateToCurve:om,calcLabelPosition:eCe,calcCardinalityPosition:tCe,calcTerminalLabelPosition:rCe,formatUrl:Q6e,getStylesFromArray:lm,generateId:Z_,random:J_,runFunc:Z6e,entityDecode:oCe,insertTitle:lCe,parseFontSize:mc,InitIDGenerator:j_},SX=o(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){let n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"\uFB02\xB0\xB0"+n+"\xB6\xDF":"\uFB02\xB0"+n+"\xB6\xDF"}),e},"encodeEntities"),to=o(function(t){return t.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),y5=o((t,e,{counter:r=0,prefix:n,suffix:i})=>`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId")});function Sl(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=e9(e[t].text,i,n),e[t].textLines=e[t].text.split(We.lineBreakRegex).length,e[t].width=i,e[t].height=g5(e[t].text,n);else{let a=e[t].text.split(We.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(let l of a)e[t].width=Math.max(Cl(l,n),e[t].width),s=g5(l,n),e[t].height=e[t].height+s}}function RX(t,e,r,n,i){let a=new w5(i);a.data.widthLimit=r.data.widthLimit/Math.min(n9,n.length);for(let[s,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);let h=l.wrap&&Nt.wrap,f=v5(Nt);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",Sl("label",l,h,f,a.data.widthLimit),l.label.Y=u+8,u=l.label.Y+l.label.height,l.type&&l.type.text!==""){l.type.text="["+l.type.text+"]";let g=v5(Nt);Sl("type",l,h,g,a.data.widthLimit),l.type.Y=u+5,u=l.type.Y+l.type.height}if(l.descr&&l.descr.text!==""){let g=v5(Nt);g.fontSize=g.fontSize-2,Sl("descr",l,h,g,a.data.widthLimit),l.descr.Y=u+20,u=l.descr.Y+l.descr.height}if(s==0||s%n9===0){let g=r.data.startx+Nt.diagramMarginX,y=r.data.stopy+Nt.diagramMarginY+u;a.setData(g,g,y,y)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Nt.diagramMarginX:a.data.startx,y=a.data.starty;a.setData(g,g,y,y)}a.name=l.alias;let d=i.db.getC4ShapeArray(l.alias),p=i.db.getC4ShapeKeys(l.alias);p.length>0&&DX(a,t,d,p),e=l.alias;let m=i.db.getBoundarys(e);m.length>0&&RX(t,e,a,m,i),l.alias!=="global"&&LX(t,l,a),r.data.stopy=Math.max(a.data.stopy+Nt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Nt.c4ShapeMargin,r.data.stopx),x5=Math.max(x5,r.data.stopx),b5=Math.max(b5,r.data.stopy)}}var x5,b5,_X,n9,Nt,w5,i9,hv,v5,cCe,LX,DX,ks,AX,uCe,hCe,fCe,a9,NX=R(()=>{"use strict";Zt();AW();ut();VC();rr();lS();_t();cp();xr();Yn();x5=0,b5=0,_X=4,n9=2;U1.yy=hy;Nt={},w5=class{static{o(this,"Bounds")}constructor(e){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,i9(e.db.getConfig())}setData(e,r,n,i){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(e,r,n,i){e[r]===void 0?e[r]=n:e[r]=i(n,e[r])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let r=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+e.margin:this.nextData.stopx+e.margin*2,n=r+e.width,i=this.nextData.starty+e.margin*2,a=i+e.height;(r>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>_X)&&(r=this.nextData.startx+e.margin+Nt.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){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},i9(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},i9=o(function(t){On(Nt,t),t.fontFamily&&(Nt.personFontFamily=Nt.systemFontFamily=Nt.messageFontFamily=t.fontFamily),t.fontSize&&(Nt.personFontSize=Nt.systemFontSize=Nt.messageFontSize=t.fontSize),t.fontWeight&&(Nt.personFontWeight=Nt.systemFontWeight=Nt.messageFontWeight=t.fontWeight)},"setConf"),hv=o((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),v5=o(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),cCe=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");o(Sl,"calcC4ShapeTextWH");LX=o(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Nt.c4ShapeMargin-35;let n=e.wrap&&Nt.wrap,i=v5(Nt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Cl(e.label.text,i);Sl("label",e,n,i,a),Tl.drawBoundary(t,e,Nt)},"drawBoundary"),DX=o(function(t,e,r,n){let i=0;for(let a of n){i=0;let s=r[a],l=hv(Nt,s.typeC4Shape.text);switch(l.fontSize=l.fontSize-2,s.typeC4Shape.width=Cl("\xAB"+s.typeC4Shape.text+"\xBB",l),s.typeC4Shape.height=l.fontSize+2,s.typeC4Shape.Y=Nt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}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&&Nt.wrap,h=Nt.width-Nt.c4ShapePadding*2,f=hv(Nt,s.typeC4Shape.text);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",Sl("label",s,u,f,h),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let m=hv(Nt,s.typeC4Shape.text);Sl("type",s,u,m,h),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let m=hv(Nt,s.techn.text);Sl("techn",s,u,m,h),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,p=s.label.width;if(s.descr&&s.descr.text!==""){let m=hv(Nt,s.typeC4Shape.text);Sl("descr",s,u,m,h),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,p=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}p=p+Nt.c4ShapePadding,s.width=Math.max(s.width||Nt.width,p,Nt.width),s.height=Math.max(s.height||Nt.height,d,Nt.height),s.margin=s.margin||Nt.c4ShapeMargin,t.insert(s),Tl.drawC4Shape(e,s,Nt)}t.bumpLastMargin(Nt.c4ShapeMargin)},"drawC4ShapeArray"),ks=class{static{o(this,"Point")}constructor(e,r){this.x=e,this.y=r}},AX=o(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,l=n+t.height/2,u=Math.abs(r-i),h=Math.abs(n-a),f=h/u,d=t.height/t.width,p=null;return n==a&&ri?p=new ks(r,l):r==i&&na&&(p=new ks(s,n)),r>i&&n =f?p=new ks(r,l+f*t.width/2):p=new ks(s-u/h*t.height/2,n+t.height):r=f?p=new ks(r+t.width,l+f*t.width/2):p=new ks(s+u/h*t.height/2,n+t.height):ra?d>=f?p=new ks(r+t.width,l-f*t.width/2):p=new ks(s+t.height/2*u/h,n):r>i&&n>a&&(d>=f?p=new ks(r,l-t.width/2*f):p=new ks(s-t.height/2*u/h,n)),p},"getIntersectPoint"),uCe=o(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=AX(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=AX(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),hCe=o(function(t,e,r,n){let i=0;for(let a of e){i=i+1;let s=a.wrap&&Nt.wrap,l=cCe(Nt);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=i+": "+a.label.text);let h=Cl(a.label.text,l);Sl("label",a,s,l,h),a.techn&&a.techn.text!==""&&(h=Cl(a.techn.text,l),Sl("techn",a,s,l,h)),a.descr&&a.descr.text!==""&&(h=Cl(a.descr.text,l),Sl("descr",a,s,l,h));let f=r(a.from),d=r(a.to),p=uCe(f,d);a.startPoint=p.startPoint,a.endPoint=p.endPoint}Tl.drawRels(t,e,Nt)},"drawRels");o(RX,"drawInsideBoundary");fCe=o(function(t,e,r,n){Nt=de().c4;let i=de().securityLevel,a;i==="sandbox"&&(a=$e("#i"+e));let s=i==="sandbox"?$e(a.nodes()[0].contentDocument.body):$e("body"),l=n.db;n.db.setWrap(Nt.wrap),_X=l.getC4ShapeInRow(),n9=l.getC4BoundaryInRow(),V.debug(`C:${JSON.stringify(Nt,null,2)}`);let u=i==="sandbox"?s.select(`[id="${e}"]`):$e(`[id="${e}"]`);Tl.insertComputerIcon(u),Tl.insertDatabaseIcon(u),Tl.insertClockIcon(u);let h=new w5(n);h.setData(Nt.diagramMarginX,Nt.diagramMarginX,Nt.diagramMarginY,Nt.diagramMarginY),h.data.widthLimit=screen.availWidth,x5=Nt.diagramMarginX,b5=Nt.diagramMarginY;let f=n.db.getTitle(),d=n.db.getBoundarys("");RX(u,"",h,d,n),Tl.insertArrowHead(u),Tl.insertArrowEnd(u),Tl.insertArrowCrossHead(u),Tl.insertArrowFilledHead(u),hCe(u,n.db.getRels(),n.db.getC4Shape,n),h.data.stopx=x5,h.data.stopy=b5;let p=h.data,g=p.stopy-p.starty+2*Nt.diagramMarginY,v=p.stopx-p.startx+2*Nt.diagramMarginX;f&&u.append("text").text(f).attr("x",(p.stopx-p.startx)/2-4*Nt.diagramMarginX).attr("y",p.starty+Nt.diagramMarginY),Sr(u,g,v,Nt.useMaxWidth);let x=f?60:0;u.attr("viewBox",p.startx-Nt.diagramMarginX+" -"+(Nt.diagramMarginY+x)+" "+v+" "+(g+x)),V.debug("models:",p)},"draw"),a9={drawPersonOrSystemArray:DX,drawBoundary:LX,setConf:i9,draw:fCe}});var dCe,MX,IX=R(()=>{"use strict";dCe=o(t=>`.person {
+`},"getStyles"),$G=o((t,e)=>{e!==void 0&&(S3[t]=e)},"addStylesForDiagram"),zG=o3e});var qy={};hr(qy,{clear:()=>Ar,getAccDescription:()=>Mr,getAccTitle:()=>Rr,getDiagramTitle:()=>Ir,setAccDescription:()=>Nr,setAccTitle:()=>Lr,setDiagramTitle:()=>$r});var rA,nA,iA,aA,Ar,Lr,Rr,Nr,Mr,$r,Ir,mi=N(()=>{"use strict";gr();ji();rA="",nA="",iA="",aA=o(t=>Tr(t,cr()),"sanitizeText"),Ar=o(()=>{rA="",iA="",nA=""},"clear"),Lr=o(t=>{rA=aA(t).replace(/^\s+/g,"")},"setAccTitle"),Rr=o(()=>rA,"getAccTitle"),Nr=o(t=>{iA=aA(t).replace(/\n\s+/g,`
+`)},"setAccDescription"),Mr=o(()=>iA,"getAccDescription"),$r=o(t=>{nA=aA(t)},"setDiagramTitle"),Ir=o(()=>nA,"getDiagramTitle")});var GG,l3e,me,Yy,A3,Xy,oA,c3e,C3,ad,jy,sA,zt=N(()=>{"use strict";Xf();vt();ji();gr();Ei();tA();mi();GG=Y,l3e=wy,me=cr,Yy=X4,A3=lh,Xy=o(t=>Tr(t,me()),"sanitizeText"),oA=Ao,c3e=o(()=>qy,"getCommonDb"),C3={},ad=o((t,e,r)=>{C3[t]&&GG.warn(`Diagram with id ${t} already registered. Overwriting.`),C3[t]=e,r&&FC(t,r),$G(t,e.styles),e.injectUtils?.(GG,l3e,me,Xy,oA,c3e(),()=>{})},"registerDiagram"),jy=o(t=>{if(t in C3)return C3[t];throw new sA(t)},"getDiagram"),sA=class extends Error{static{o(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}}});var ul,gh,Ja,cl,tc,Ky,lA,cA,_3,D3,VG,u3e,h3e,f3e,d3e,p3e,m3e,g3e,y3e,v3e,x3e,b3e,w3e,T3e,k3e,E3e,S3e,C3e,UG,A3e,_3e,HG,D3e,L3e,R3e,N3e,yh,M3e,I3e,O3e,P3e,B3e,Qy,uA=N(()=>{"use strict";zt();gr();mi();ul=[],gh=[""],Ja="global",cl="",tc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Ky=[],lA="",cA=!1,_3=4,D3=2,u3e=o(function(){return VG},"getC4Type"),h3e=o(function(t){VG=Tr(t,me())},"setC4Type"),f3e=o(function(t,e,r,n,i,a,s,l,u){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let h={},f=Ky.find(d=>d.from===e&&d.to===r);if(f?h=f:Ky.push(h),h.type=t,h.from=e,h.to=r,h.label={text:n},i==null)h.techn={text:""};else if(typeof i=="object"){let[d,p]=Object.entries(i)[0];h[d]={text:p}}else h.techn={text:i};if(a==null)h.descr={text:""};else if(typeof a=="object"){let[d,p]=Object.entries(a)[0];h[d]={text:p}}else h.descr={text:a};if(typeof s=="object"){let[d,p]=Object.entries(s)[0];h[d]=p}else h.sprite=s;if(typeof l=="object"){let[d,p]=Object.entries(l)[0];h[d]=p}else h.tags=l;if(typeof u=="object"){let[d,p]=Object.entries(u)[0];h[d]=p}else h.link=u;h.wrap=yh()},"addRel"),d3e=o(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let l={},u=ul.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ul.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.descr={text:""};else if(typeof n=="object"){let[h,f]=Object.entries(n)[0];l[h]={text:f}}else l.descr={text:n};if(typeof i=="object"){let[h,f]=Object.entries(i)[0];l[h]=f}else l.sprite=i;if(typeof a=="object"){let[h,f]=Object.entries(a)[0];l[h]=f}else l.tags=a;if(typeof s=="object"){let[h,f]=Object.entries(s)[0];l[h]=f}else l.link=s;l.typeC4Shape={text:t},l.parentBoundary=Ja,l.wrap=yh()},"addPersonOrSystem"),p3e=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ul.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ul.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=yh(),u.typeC4Shape={text:t},u.parentBoundary=Ja},"addContainer"),m3e=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ul.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ul.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=yh(),u.typeC4Shape={text:t},u.parentBoundary=Ja},"addComponent"),g3e=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=tc.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=Ja,a.wrap=yh(),cl=Ja,Ja=t,gh.push(cl)},"addPersonOrSystemBoundary"),y3e=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=tc.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=Ja,a.wrap=yh(),cl=Ja,Ja=t,gh.push(cl)},"addContainerBoundary"),v3e=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=tc.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,tc.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.type={text:"node"};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.type={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.nodeType=t,u.parentBoundary=Ja,u.wrap=yh(),cl=Ja,Ja=e,gh.push(cl)},"addDeploymentNode"),x3e=o(function(){Ja=cl,gh.pop(),cl=gh.pop(),gh.push(cl)},"popBoundaryParseStack"),b3e=o(function(t,e,r,n,i,a,s,l,u,h,f){let d=ul.find(p=>p.alias===e);if(!(d===void 0&&(d=tc.find(p=>p.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[p,m]=Object.entries(r)[0];d[p]=m}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[p,m]=Object.entries(n)[0];d[p]=m}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[p,m]=Object.entries(i)[0];d[p]=m}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[p,m]=Object.entries(a)[0];d[p]=m}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[p,m]=Object.entries(s)[0];d[p]=m}else d.shape=s;if(l!=null)if(typeof l=="object"){let[p,m]=Object.entries(l)[0];d[p]=m}else d.sprite=l;if(u!=null)if(typeof u=="object"){let[p,m]=Object.entries(u)[0];d[p]=m}else d.techn=u;if(h!=null)if(typeof h=="object"){let[p,m]=Object.entries(h)[0];d[p]=m}else d.legendText=h;if(f!=null)if(typeof f=="object"){let[p,m]=Object.entries(f)[0];d[p]=m}else d.legendSprite=f}},"updateElStyle"),w3e=o(function(t,e,r,n,i,a,s){let l=Ky.find(u=>u.from===e&&u.to===r);if(l!==void 0){if(n!=null)if(typeof n=="object"){let[u,h]=Object.entries(n)[0];l[u]=h}else l.textColor=n;if(i!=null)if(typeof i=="object"){let[u,h]=Object.entries(i)[0];l[u]=h}else l.lineColor=i;if(a!=null)if(typeof a=="object"){let[u,h]=Object.entries(a)[0];l[u]=parseInt(h)}else l.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[u,h]=Object.entries(s)[0];l[u]=parseInt(h)}else l.offsetY=parseInt(s)}},"updateRelStyle"),T3e=o(function(t,e,r){let n=_3,i=D3;if(typeof e=="object"){let a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){let a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(_3=n),i>=1&&(D3=i)},"updateLayoutConfig"),k3e=o(function(){return _3},"getC4ShapeInRow"),E3e=o(function(){return D3},"getC4BoundaryInRow"),S3e=o(function(){return Ja},"getCurrentBoundaryParse"),C3e=o(function(){return cl},"getParentBoundaryParse"),UG=o(function(t){return t==null?ul:ul.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),A3e=o(function(t){return ul.find(e=>e.alias===t)},"getC4Shape"),_3e=o(function(t){return Object.keys(UG(t))},"getC4ShapeKeys"),HG=o(function(t){return t==null?tc:tc.filter(e=>e.parentBoundary===t)},"getBoundaries"),D3e=HG,L3e=o(function(){return Ky},"getRels"),R3e=o(function(){return lA},"getTitle"),N3e=o(function(t){cA=t},"setWrap"),yh=o(function(){return cA},"autoWrap"),M3e=o(function(){ul=[],tc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],cl="",Ja="global",gh=[""],Ky=[],gh=[""],lA="",cA=!1,_3=4,D3=2},"clear"),I3e={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},O3e={FILLED:0,OPEN:1},P3e={LEFTOF:0,RIGHTOF:1,OVER:2},B3e=o(function(t){lA=Tr(t,me())},"setTitle"),Qy={addPersonOrSystem:d3e,addPersonOrSystemBoundary:g3e,addContainer:p3e,addContainerBoundary:y3e,addComponent:m3e,addDeploymentNode:v3e,popBoundaryParseStack:x3e,addRel:f3e,updateElStyle:b3e,updateRelStyle:w3e,updateLayoutConfig:T3e,autoWrap:yh,setWrap:N3e,getC4ShapeArray:UG,getC4Shape:A3e,getC4ShapeKeys:_3e,getBoundaries:HG,getBoundarys:D3e,getCurrentBoundaryParse:S3e,getParentBoundaryParse:C3e,getRels:L3e,getTitle:R3e,getC4Type:u3e,getC4ShapeInRow:k3e,getC4BoundaryInRow:E3e,setAccTitle:Lr,getAccTitle:Rr,getAccDescription:Mr,setAccDescription:Nr,getConfig:o(()=>me().c4,"getConfig"),clear:M3e,LINETYPE:I3e,ARROWTYPE:O3e,PLACEMENT:P3e,setTitle:B3e,setC4Type:h3e}});function sd(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}var hA=N(()=>{"use strict";o(sd,"ascending")});function fA(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}var WG=N(()=>{"use strict";o(fA,"descending")});function od(t){let e,r,n;t.length!==2?(e=sd,r=o((l,u)=>sd(t(l),u),"compare2"),n=o((l,u)=>t(l)-u,"delta")):(e=t===sd||t===fA?t:F3e,r=t,n=t);function i(l,u,h=0,f=l.length){if(h>>1;r(l[d],u)<0?h=d+1:f=d}while(h>>1;r(l[d],u)<=0?h=d+1:f=d}while(hh&&n(l[d-1],u)>-n(l[d],u)?d-1:d}return o(s,"center"),{left:i,center:s,right:a}}function F3e(){return 0}var dA=N(()=>{"use strict";hA();WG();o(od,"bisector");o(F3e,"zero")});function pA(t){return t===null?NaN:+t}var qG=N(()=>{"use strict";o(pA,"number")});var YG,XG,$3e,z3e,mA,jG=N(()=>{"use strict";hA();dA();qG();YG=od(sd),XG=YG.right,$3e=YG.left,z3e=od(pA).center,mA=XG});function KG({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function G3e({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function V3e({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function U3e(t){return t!==null&&typeof t=="object"?t.valueOf():t}var g0,QG=N(()=>{"use strict";g0=class extends Map{static{o(this,"InternMap")}constructor(e,r=U3e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[n,i]of e)this.set(n,i)}get(e){return super.get(KG(this,e))}has(e){return super.has(KG(this,e))}set(e,r){return super.set(G3e(this,e),r)}delete(e){return super.delete(V3e(this,e))}};o(KG,"intern_get");o(G3e,"intern_set");o(V3e,"intern_delete");o(U3e,"keyof")});function L3(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=H3e?10:a>=W3e?5:a>=q3e?2:1,l,u,h;return i<0?(h=Math.pow(10,-i)/s,l=Math.round(t*h),u=Math.round(e*h),l/he&&--u,h=-h):(h=Math.pow(10,i)*s,l=Math.round(t/h),u=Math.round(e/h),l*he&&--u),u0))return[];if(t===e)return[t];let n=e=i))return[];let l=a-i+1,u=new Array(l);if(n)if(s<0)for(let h=0;h{"use strict";H3e=Math.sqrt(50),W3e=Math.sqrt(10),q3e=Math.sqrt(2);o(L3,"tickSpec");o(R3,"ticks");o(Zy,"tickIncrement");o(y0,"tickStep")});function N3(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}var JG=N(()=>{"use strict";o(N3,"max")});function M3(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var eV=N(()=>{"use strict";o(M3,"min")});function I3(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n{"use strict";o(I3,"range")});var vh=N(()=>{"use strict";jG();dA();JG();eV();tV();ZG();QG()});function gA(t){return t}var rV=N(()=>{"use strict";o(gA,"default")});function Y3e(t){return"translate("+t+",0)"}function X3e(t){return"translate(0,"+t+")"}function j3e(t){return e=>+t(e)}function K3e(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Q3e(){return!this.__axis}function iV(t,e){var r=[],n=null,i=null,a=6,s=6,l=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,h=t===P3||t===O3?-1:1,f=t===O3||t===yA?"x":"y",d=t===P3||t===vA?Y3e:X3e;function p(m){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),y=i??(e.tickFormat?e.tickFormat.apply(e,r):gA),v=Math.max(a,0)+l,x=e.range(),b=+x[0]+u,w=+x[x.length-1]+u,C=(e.bandwidth?K3e:j3e)(e.copy(),u),T=m.selection?m.selection():m,E=T.selectAll(".domain").data([null]),A=T.selectAll(".tick").data(g,e).order(),S=A.exit(),_=A.enter().append("g").attr("class","tick"),I=A.select("line"),D=A.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(_),I=I.merge(_.append("line").attr("stroke","currentColor").attr(f+"2",h*a)),D=D.merge(_.append("text").attr("fill","currentColor").attr(f,h*v).attr("dy",t===P3?"0em":t===vA?"0.71em":"0.32em")),m!==T&&(E=E.transition(m),A=A.transition(m),I=I.transition(m),D=D.transition(m),S=S.transition(m).attr("opacity",nV).attr("transform",function(k){return isFinite(k=C(k))?d(k+u):this.getAttribute("transform")}),_.attr("opacity",nV).attr("transform",function(k){var L=this.parentNode.__axis;return d((L&&isFinite(L=L(k))?L:C(k))+u)})),S.remove(),E.attr("d",t===O3||t===yA?s?"M"+h*s+","+b+"H"+u+"V"+w+"H"+h*s:"M"+u+","+b+"V"+w:s?"M"+b+","+h*s+"V"+u+"H"+w+"V"+h*s:"M"+b+","+u+"H"+w),A.attr("opacity",1).attr("transform",function(k){return d(C(k)+u)}),I.attr(f+"2",h*a),D.attr(f,h*v).text(y),T.filter(Q3e).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===yA?"start":t===O3?"end":"middle"),T.each(function(){this.__axis=C})}return o(p,"axis"),p.scale=function(m){return arguments.length?(e=m,p):e},p.ticks=function(){return r=Array.from(arguments),p},p.tickArguments=function(m){return arguments.length?(r=m==null?[]:Array.from(m),p):r.slice()},p.tickValues=function(m){return arguments.length?(n=m==null?null:Array.from(m),p):n&&n.slice()},p.tickFormat=function(m){return arguments.length?(i=m,p):i},p.tickSize=function(m){return arguments.length?(a=s=+m,p):a},p.tickSizeInner=function(m){return arguments.length?(a=+m,p):a},p.tickSizeOuter=function(m){return arguments.length?(s=+m,p):s},p.tickPadding=function(m){return arguments.length?(l=+m,p):l},p.offset=function(m){return arguments.length?(u=+m,p):u},p}function xA(t){return iV(P3,t)}function bA(t){return iV(vA,t)}var P3,yA,vA,O3,nV,aV=N(()=>{"use strict";rV();P3=1,yA=2,vA=3,O3=4,nV=1e-6;o(Y3e,"translateX");o(X3e,"translateY");o(j3e,"number");o(K3e,"center");o(Q3e,"entering");o(iV,"axis");o(xA,"axisTop");o(bA,"axisBottom")});var sV=N(()=>{"use strict";aV()});function lV(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function e5e(t,e){for(var r=0,n=t.length,i;r{"use strict";Z3e={value:o(()=>{},"value")};o(lV,"dispatch");o(B3,"Dispatch");o(J3e,"parseTypenames");B3.prototype=lV.prototype={constructor:B3,on:o(function(t,e){var r=this._,n=J3e(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n{"use strict";cV()});var F3,kA,EA=N(()=>{"use strict";F3="http://www.w3.org/1999/xhtml",kA={svg:"http://www.w3.org/2000/svg",xhtml:F3,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function rc(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),kA.hasOwnProperty(e)?{space:kA[e],local:t}:t}var $3=N(()=>{"use strict";EA();o(rc,"default")});function t5e(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===F3&&e.documentElement.namespaceURI===F3?e.createElement(t):e.createElementNS(r,t)}}function r5e(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Jy(t){var e=rc(t);return(e.local?r5e:t5e)(e)}var SA=N(()=>{"use strict";$3();EA();o(t5e,"creatorInherit");o(r5e,"creatorFixed");o(Jy,"default")});function n5e(){}function xh(t){return t==null?n5e:function(){return this.querySelector(t)}}var z3=N(()=>{"use strict";o(n5e,"none");o(xh,"default")});function CA(t){typeof t!="function"&&(t=xh(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";hl();z3();o(CA,"default")});function AA(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}var hV=N(()=>{"use strict";o(AA,"array")});function i5e(){return[]}function v0(t){return t==null?i5e:function(){return this.querySelectorAll(t)}}var _A=N(()=>{"use strict";o(i5e,"empty");o(v0,"default")});function a5e(t){return function(){return AA(t.apply(this,arguments))}}function DA(t){typeof t=="function"?t=a5e(t):t=v0(t);for(var e=this._groups,r=e.length,n=[],i=[],a=0;a{"use strict";hl();hV();_A();o(a5e,"arrayAll");o(DA,"default")});function x0(t){return function(){return this.matches(t)}}function G3(t){return function(e){return e.matches(t)}}var ev=N(()=>{"use strict";o(x0,"default");o(G3,"childMatcher")});function o5e(t){return function(){return s5e.call(this.children,t)}}function l5e(){return this.firstElementChild}function LA(t){return this.select(t==null?l5e:o5e(typeof t=="function"?t:G3(t)))}var s5e,dV=N(()=>{"use strict";ev();s5e=Array.prototype.find;o(o5e,"childFind");o(l5e,"childFirst");o(LA,"default")});function u5e(){return Array.from(this.children)}function h5e(t){return function(){return c5e.call(this.children,t)}}function RA(t){return this.selectAll(t==null?u5e:h5e(typeof t=="function"?t:G3(t)))}var c5e,pV=N(()=>{"use strict";ev();c5e=Array.prototype.filter;o(u5e,"children");o(h5e,"childrenFilter");o(RA,"default")});function NA(t){typeof t!="function"&&(t=x0(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";hl();ev();o(NA,"default")});function tv(t){return new Array(t.length)}var MA=N(()=>{"use strict";o(tv,"default")});function IA(){return new oi(this._enter||this._groups.map(tv),this._parents)}function rv(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}var OA=N(()=>{"use strict";MA();hl();o(IA,"default");o(rv,"EnterNode");rv.prototype={constructor:rv,appendChild:o(function(t){return this._parent.insertBefore(t,this._next)},"appendChild"),insertBefore:o(function(t,e){return this._parent.insertBefore(t,e)},"insertBefore"),querySelector:o(function(t){return this._parent.querySelector(t)},"querySelector"),querySelectorAll:o(function(t){return this._parent.querySelectorAll(t)},"querySelectorAll")}});function PA(t){return function(){return t}}var gV=N(()=>{"use strict";o(PA,"default")});function f5e(t,e,r,n,i,a){for(var s=0,l,u=e.length,h=a.length;s=w&&(w=b+1);!(T=v[w])&&++w{"use strict";hl();OA();gV();o(f5e,"bindIndex");o(d5e,"bindKey");o(p5e,"datum");o(BA,"default");o(m5e,"arraylike")});function FA(){return new oi(this._exit||this._groups.map(tv),this._parents)}var vV=N(()=>{"use strict";MA();hl();o(FA,"default")});function $A(t,e,r){var n=this.enter(),i=this,a=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}var xV=N(()=>{"use strict";o($A,"default")});function zA(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,a=n.length,s=Math.min(i,a),l=new Array(i),u=0;u{"use strict";hl();o(zA,"default")});function GA(){for(var t=this._groups,e=-1,r=t.length;++e=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}var wV=N(()=>{"use strict";o(GA,"default")});function VA(t){t||(t=g5e);function e(d,p){return d&&p?t(d.__data__,p.__data__):!d-!p}o(e,"compareNode");for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}var TV=N(()=>{"use strict";hl();o(VA,"default");o(g5e,"ascending")});function UA(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}var kV=N(()=>{"use strict";o(UA,"default")});function HA(){return Array.from(this)}var EV=N(()=>{"use strict";o(HA,"default")});function WA(){for(var t=this._groups,e=0,r=t.length;e{"use strict";o(WA,"default")});function qA(){let t=0;for(let e of this)++t;return t}var CV=N(()=>{"use strict";o(qA,"default")});function YA(){return!this.node()}var AV=N(()=>{"use strict";o(YA,"default")});function XA(t){for(var e=this._groups,r=0,n=e.length;r{"use strict";o(XA,"default")});function y5e(t){return function(){this.removeAttribute(t)}}function v5e(t){return function(){this.removeAttributeNS(t.space,t.local)}}function x5e(t,e){return function(){this.setAttribute(t,e)}}function b5e(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function w5e(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function T5e(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function jA(t,e){var r=rc(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?v5e:y5e:typeof e=="function"?r.local?T5e:w5e:r.local?b5e:x5e)(r,e))}var DV=N(()=>{"use strict";$3();o(y5e,"attrRemove");o(v5e,"attrRemoveNS");o(x5e,"attrConstant");o(b5e,"attrConstantNS");o(w5e,"attrFunction");o(T5e,"attrFunctionNS");o(jA,"default")});function nv(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}var KA=N(()=>{"use strict";o(nv,"default")});function k5e(t){return function(){this.style.removeProperty(t)}}function E5e(t,e,r){return function(){this.style.setProperty(t,e,r)}}function S5e(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function QA(t,e,r){return arguments.length>1?this.each((e==null?k5e:typeof e=="function"?S5e:E5e)(t,e,r??"")):bh(this.node(),t)}function bh(t,e){return t.style.getPropertyValue(e)||nv(t).getComputedStyle(t,null).getPropertyValue(e)}var ZA=N(()=>{"use strict";KA();o(k5e,"styleRemove");o(E5e,"styleConstant");o(S5e,"styleFunction");o(QA,"default");o(bh,"styleValue")});function C5e(t){return function(){delete this[t]}}function A5e(t,e){return function(){this[t]=e}}function _5e(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function JA(t,e){return arguments.length>1?this.each((e==null?C5e:typeof e=="function"?_5e:A5e)(t,e)):this.node()[t]}var LV=N(()=>{"use strict";o(C5e,"propertyRemove");o(A5e,"propertyConstant");o(_5e,"propertyFunction");o(JA,"default")});function RV(t){return t.trim().split(/^|\s+/)}function e8(t){return t.classList||new NV(t)}function NV(t){this._node=t,this._names=RV(t.getAttribute("class")||"")}function MV(t,e){for(var r=e8(t),n=-1,i=e.length;++n{"use strict";o(RV,"classArray");o(e8,"classList");o(NV,"ClassList");NV.prototype={add:o(function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(t){return this._names.indexOf(t)>=0},"contains")};o(MV,"classedAdd");o(IV,"classedRemove");o(D5e,"classedTrue");o(L5e,"classedFalse");o(R5e,"classedFunction");o(t8,"default")});function N5e(){this.textContent=""}function M5e(t){return function(){this.textContent=t}}function I5e(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function r8(t){return arguments.length?this.each(t==null?N5e:(typeof t=="function"?I5e:M5e)(t)):this.node().textContent}var PV=N(()=>{"use strict";o(N5e,"textRemove");o(M5e,"textConstant");o(I5e,"textFunction");o(r8,"default")});function O5e(){this.innerHTML=""}function P5e(t){return function(){this.innerHTML=t}}function B5e(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function n8(t){return arguments.length?this.each(t==null?O5e:(typeof t=="function"?B5e:P5e)(t)):this.node().innerHTML}var BV=N(()=>{"use strict";o(O5e,"htmlRemove");o(P5e,"htmlConstant");o(B5e,"htmlFunction");o(n8,"default")});function F5e(){this.nextSibling&&this.parentNode.appendChild(this)}function i8(){return this.each(F5e)}var FV=N(()=>{"use strict";o(F5e,"raise");o(i8,"default")});function $5e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function a8(){return this.each($5e)}var $V=N(()=>{"use strict";o($5e,"lower");o(a8,"default")});function s8(t){var e=typeof t=="function"?t:Jy(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}var zV=N(()=>{"use strict";SA();o(s8,"default")});function z5e(){return null}function o8(t,e){var r=typeof t=="function"?t:Jy(t),n=e==null?z5e:typeof e=="function"?e:xh(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var GV=N(()=>{"use strict";SA();z3();o(z5e,"constantNull");o(o8,"default")});function G5e(){var t=this.parentNode;t&&t.removeChild(this)}function l8(){return this.each(G5e)}var VV=N(()=>{"use strict";o(G5e,"remove");o(l8,"default")});function V5e(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function U5e(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function c8(t){return this.select(t?U5e:V5e)}var UV=N(()=>{"use strict";o(V5e,"selection_cloneShallow");o(U5e,"selection_cloneDeep");o(c8,"default")});function u8(t){return arguments.length?this.property("__data__",t):this.node().__data__}var HV=N(()=>{"use strict";o(u8,"default")});function H5e(t){return function(e){t.call(this,e,this.__data__)}}function W5e(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function q5e(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r{"use strict";o(H5e,"contextListener");o(W5e,"parseTypenames");o(q5e,"onRemove");o(Y5e,"onAdd");o(h8,"default")});function qV(t,e,r){var n=nv(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function X5e(t,e){return function(){return qV(this,t,e)}}function j5e(t,e){return function(){return qV(this,t,e.apply(this,arguments))}}function f8(t,e){return this.each((typeof e=="function"?j5e:X5e)(t,e))}var YV=N(()=>{"use strict";KA();o(qV,"dispatchEvent");o(X5e,"dispatchConstant");o(j5e,"dispatchFunction");o(f8,"default")});function*d8(){for(var t=this._groups,e=0,r=t.length;e{"use strict";o(d8,"default")});function oi(t,e){this._groups=t,this._parents=e}function jV(){return new oi([[document.documentElement]],p8)}function K5e(){return this}var p8,hu,hl=N(()=>{"use strict";uV();fV();dV();pV();mV();yV();OA();vV();xV();bV();wV();TV();kV();EV();SV();CV();AV();_V();DV();ZA();LV();OV();PV();BV();FV();$V();zV();GV();VV();UV();HV();WV();YV();XV();p8=[null];o(oi,"Selection");o(jV,"selection");o(K5e,"selection_selection");oi.prototype=jV.prototype={constructor:oi,select:CA,selectAll:DA,selectChild:LA,selectChildren:RA,filter:NA,data:BA,enter:IA,exit:FA,join:$A,merge:zA,selection:K5e,order:GA,sort:VA,call:UA,nodes:HA,node:WA,size:qA,empty:YA,each:XA,attr:jA,style:QA,property:JA,classed:t8,text:r8,html:n8,raise:i8,lower:a8,append:s8,insert:o8,remove:l8,clone:c8,datum:u8,on:h8,dispatch:f8,[Symbol.iterator]:d8};hu=jV});function Ge(t){return typeof t=="string"?new oi([[document.querySelector(t)]],[document.documentElement]):new oi([[t]],p8)}var KV=N(()=>{"use strict";hl();o(Ge,"default")});var fl=N(()=>{"use strict";ev();$3();KV();hl();z3();_A();ZA()});var QV=N(()=>{"use strict"});function wh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function b0(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}var m8=N(()=>{"use strict";o(wh,"default");o(b0,"extend")});function Th(){}function JV(){return this.rgb().formatHex()}function iwe(){return this.rgb().formatHex8()}function awe(){return sU(this).formatHsl()}function eU(){return this.rgb().formatRgb()}function pl(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Q5e.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?tU(e):r===3?new ua(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?V3(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?V3(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Z5e.exec(t))?new ua(e[1],e[2],e[3],1):(e=J5e.exec(t))?new ua(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ewe.exec(t))?V3(e[1],e[2],e[3],e[4]):(e=twe.exec(t))?V3(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=rwe.exec(t))?iU(e[1],e[2]/100,e[3]/100,1):(e=nwe.exec(t))?iU(e[1],e[2]/100,e[3]/100,e[4]):ZV.hasOwnProperty(t)?tU(ZV[t]):t==="transparent"?new ua(NaN,NaN,NaN,0):null}function tU(t){return new ua(t>>16&255,t>>8&255,t&255,1)}function V3(t,e,r,n){return n<=0&&(t=e=r=NaN),new ua(t,e,r,n)}function y8(t){return t instanceof Th||(t=pl(t)),t?(t=t.rgb(),new ua(t.r,t.g,t.b,t.opacity)):new ua}function T0(t,e,r,n){return arguments.length===1?y8(t):new ua(t,e,r,n??1)}function ua(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function rU(){return`#${ld(this.r)}${ld(this.g)}${ld(this.b)}`}function swe(){return`#${ld(this.r)}${ld(this.g)}${ld(this.b)}${ld((isNaN(this.opacity)?1:this.opacity)*255)}`}function nU(){let t=W3(this.opacity);return`${t===1?"rgb(":"rgba("}${cd(this.r)}, ${cd(this.g)}, ${cd(this.b)}${t===1?")":`, ${t})`}`}function W3(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function cd(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ld(t){return t=cd(t),(t<16?"0":"")+t.toString(16)}function iU(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new dl(t,e,r,n)}function sU(t){if(t instanceof dl)return new dl(t.h,t.s,t.l,t.opacity);if(t instanceof Th||(t=pl(t)),!t)return new dl;if(t instanceof dl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,l=a-i,u=(a+i)/2;return l?(e===a?s=(r-n)/l+(r0&&u<1?0:s,new dl(s,l,u,t.opacity)}function oU(t,e,r,n){return arguments.length===1?sU(t):new dl(t,e,r,n??1)}function dl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function aU(t){return t=(t||0)%360,t<0?t+360:t}function U3(t){return Math.max(0,Math.min(1,t||0))}function g8(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}var iv,H3,w0,av,nc,Q5e,Z5e,J5e,ewe,twe,rwe,nwe,ZV,v8=N(()=>{"use strict";m8();o(Th,"Color");iv=.7,H3=1/iv,w0="\\s*([+-]?\\d+)\\s*",av="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q5e=/^#([0-9a-f]{3,8})$/,Z5e=new RegExp(`^rgb\\(${w0},${w0},${w0}\\)$`),J5e=new RegExp(`^rgb\\(${nc},${nc},${nc}\\)$`),ewe=new RegExp(`^rgba\\(${w0},${w0},${w0},${av}\\)$`),twe=new RegExp(`^rgba\\(${nc},${nc},${nc},${av}\\)$`),rwe=new RegExp(`^hsl\\(${av},${nc},${nc}\\)$`),nwe=new RegExp(`^hsla\\(${av},${nc},${nc},${av}\\)$`),ZV={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};wh(Th,pl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:JV,formatHex:JV,formatHex8:iwe,formatHsl:awe,formatRgb:eU,toString:eU});o(JV,"color_formatHex");o(iwe,"color_formatHex8");o(awe,"color_formatHsl");o(eU,"color_formatRgb");o(pl,"color");o(tU,"rgbn");o(V3,"rgba");o(y8,"rgbConvert");o(T0,"rgb");o(ua,"Rgb");wh(ua,T0,b0(Th,{brighter(t){return t=t==null?H3:Math.pow(H3,t),new ua(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?iv:Math.pow(iv,t),new ua(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ua(cd(this.r),cd(this.g),cd(this.b),W3(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rU,formatHex:rU,formatHex8:swe,formatRgb:nU,toString:nU}));o(rU,"rgb_formatHex");o(swe,"rgb_formatHex8");o(nU,"rgb_formatRgb");o(W3,"clampa");o(cd,"clampi");o(ld,"hex");o(iU,"hsla");o(sU,"hslConvert");o(oU,"hsl");o(dl,"Hsl");wh(dl,oU,b0(Th,{brighter(t){return t=t==null?H3:Math.pow(H3,t),new dl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?iv:Math.pow(iv,t),new dl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new ua(g8(t>=240?t-240:t+120,i,n),g8(t,i,n),g8(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new dl(aU(this.h),U3(this.s),U3(this.l),W3(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=W3(this.opacity);return`${t===1?"hsl(":"hsla("}${aU(this.h)}, ${U3(this.s)*100}%, ${U3(this.l)*100}%${t===1?")":`, ${t})`}`}}));o(aU,"clamph");o(U3,"clampt");o(g8,"hsl2rgb")});var lU,cU,uU=N(()=>{"use strict";lU=Math.PI/180,cU=180/Math.PI});function gU(t){if(t instanceof ic)return new ic(t.l,t.a,t.b,t.opacity);if(t instanceof fu)return yU(t);t instanceof ua||(t=y8(t));var e=T8(t.r),r=T8(t.g),n=T8(t.b),i=x8((.2225045*e+.7168786*r+.0606169*n)/fU),a,s;return e===r&&r===n?a=s=i:(a=x8((.4360747*e+.3850649*r+.1430804*n)/hU),s=x8((.0139322*e+.0971045*r+.7141733*n)/dU)),new ic(116*i-16,500*(a-i),200*(i-s),t.opacity)}function k8(t,e,r,n){return arguments.length===1?gU(t):new ic(t,e,r,n??1)}function ic(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function x8(t){return t>owe?Math.pow(t,1/3):t/mU+pU}function b8(t){return t>k0?t*t*t:mU*(t-pU)}function w8(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function T8(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function lwe(t){if(t instanceof fu)return new fu(t.h,t.c,t.l,t.opacity);if(t instanceof ic||(t=gU(t)),t.a===0&&t.b===0)return new fu(NaN,0{"use strict";m8();v8();uU();q3=18,hU=.96422,fU=1,dU=.82521,pU=4/29,k0=6/29,mU=3*k0*k0,owe=k0*k0*k0;o(gU,"labConvert");o(k8,"lab");o(ic,"Lab");wh(ic,k8,b0(Th,{brighter(t){return new ic(this.l+q3*(t??1),this.a,this.b,this.opacity)},darker(t){return new ic(this.l-q3*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=hU*b8(e),t=fU*b8(t),r=dU*b8(r),new ua(w8(3.1338561*e-1.6168667*t-.4906146*r),w8(-.9787684*e+1.9161415*t+.033454*r),w8(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));o(x8,"xyz2lab");o(b8,"lab2xyz");o(w8,"lrgb2rgb");o(T8,"rgb2lrgb");o(lwe,"hclConvert");o(sv,"hcl");o(fu,"Hcl");o(yU,"hcl2lab");wh(fu,sv,b0(Th,{brighter(t){return new fu(this.h,this.c,this.l+q3*(t??1),this.opacity)},darker(t){return new fu(this.h,this.c,this.l-q3*(t??1),this.opacity)},rgb(){return yU(this).rgb()}}))});var E0=N(()=>{"use strict";v8();vU()});function E8(t,e,r,n,i){var a=t*t,s=a*t;return((1-3*t+3*a-s)*e+(4-6*a+3*s)*r+(1+3*t+3*a-3*s)*n+s*i)/6}function S8(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],s=n>0?t[n-1]:2*i-a,l=n{"use strict";o(E8,"basis");o(S8,"default")});function A8(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],a=t[n%e],s=t[(n+1)%e],l=t[(n+2)%e];return E8((r-n/e)*e,i,a,s,l)}}var xU=N(()=>{"use strict";C8();o(A8,"default")});var S0,_8=N(()=>{"use strict";S0=o(t=>()=>t,"default")});function bU(t,e){return function(r){return t+r*e}}function cwe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function wU(t,e){var r=e-t;return r?bU(t,r>180||r<-180?r-360*Math.round(r/360):r):S0(isNaN(t)?e:t)}function TU(t){return(t=+t)==1?du:function(e,r){return r-e?cwe(e,r,t):S0(isNaN(e)?r:e)}}function du(t,e){var r=e-t;return r?bU(t,r):S0(isNaN(t)?e:t)}var D8=N(()=>{"use strict";_8();o(bU,"linear");o(cwe,"exponential");o(wU,"hue");o(TU,"gamma");o(du,"nogamma")});function kU(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),a=new Array(r),s,l;for(s=0;s{"use strict";E0();C8();xU();D8();ud=o(function t(e){var r=TU(e);function n(i,a){var s=r((i=T0(i)).r,(a=T0(a)).r),l=r(i.g,a.g),u=r(i.b,a.b),h=du(i.opacity,a.opacity);return function(f){return i.r=s(f),i.g=l(f),i.b=u(f),i.opacity=h(f),i+""}}return o(n,"rgb"),n.gamma=t,n},"rgbGamma")(1);o(kU,"rgbSpline");uwe=kU(S8),hwe=kU(A8)});function R8(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i{"use strict";o(R8,"default");o(EU,"isNumberArray")});function CU(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s{"use strict";Y3();o(CU,"genericArray")});function N8(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}var _U=N(()=>{"use strict";o(N8,"default")});function Ki(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var ov=N(()=>{"use strict";o(Ki,"default")});function M8(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=kh(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var DU=N(()=>{"use strict";Y3();o(M8,"default")});function fwe(t){return function(){return t}}function dwe(t){return function(e){return t(e)+""}}function C0(t,e){var r=O8.lastIndex=I8.lastIndex=0,n,i,a,s=-1,l=[],u=[];for(t=t+"",e=e+"";(n=O8.exec(t))&&(i=I8.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),l[s]?l[s]+=a:l[++s]=a),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,u.push({i:s,x:Ki(n,i)})),r=I8.lastIndex;return r{"use strict";ov();O8=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,I8=new RegExp(O8.source,"g");o(fwe,"zero");o(dwe,"one");o(C0,"default")});function kh(t,e){var r=typeof e,n;return e==null||r==="boolean"?S0(e):(r==="number"?Ki:r==="string"?(n=pl(e))?(e=n,ud):C0:e instanceof pl?ud:e instanceof Date?N8:EU(e)?R8:Array.isArray(e)?CU:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?M8:Ki)(t,e)}var Y3=N(()=>{"use strict";E0();L8();AU();_U();ov();DU();P8();_8();SU();o(kh,"default")});function X3(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var LU=N(()=>{"use strict";o(X3,"default")});function K3(t,e,r,n,i,a){var s,l,u;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(u=t*r+e*n)&&(r-=t*u,n-=e*u),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,u/=l),t*n{"use strict";RU=180/Math.PI,j3={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};o(K3,"default")});function MU(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?j3:K3(e.a,e.b,e.c,e.d,e.e,e.f)}function IU(t){return t==null?j3:(Q3||(Q3=document.createElementNS("http://www.w3.org/2000/svg","g")),Q3.setAttribute("transform",t),(t=Q3.transform.baseVal.consolidate())?(t=t.matrix,K3(t.a,t.b,t.c,t.d,t.e,t.f)):j3)}var Q3,OU=N(()=>{"use strict";NU();o(MU,"parseCss");o(IU,"parseSvg")});function PU(t,e,r,n){function i(h){return h.length?h.pop()+" ":""}o(i,"pop");function a(h,f,d,p,m,g){if(h!==d||f!==p){var y=m.push("translate(",null,e,null,r);g.push({i:y-4,x:Ki(h,d)},{i:y-2,x:Ki(f,p)})}else(d||p)&&m.push("translate("+d+e+p+r)}o(a,"translate");function s(h,f,d,p){h!==f?(h-f>180?f+=360:f-h>180&&(h+=360),p.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Ki(h,f)})):f&&d.push(i(d)+"rotate("+f+n)}o(s,"rotate");function l(h,f,d,p){h!==f?p.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Ki(h,f)}):f&&d.push(i(d)+"skewX("+f+n)}o(l,"skewX");function u(h,f,d,p,m,g){if(h!==d||f!==p){var y=m.push(i(m)+"scale(",null,",",null,")");g.push({i:y-4,x:Ki(h,d)},{i:y-2,x:Ki(f,p)})}else(d!==1||p!==1)&&m.push(i(m)+"scale("+d+","+p+")")}return o(u,"scale"),function(h,f){var d=[],p=[];return h=t(h),f=t(f),a(h.translateX,h.translateY,f.translateX,f.translateY,d,p),s(h.rotate,f.rotate,d,p),l(h.skewX,f.skewX,d,p),u(h.scaleX,h.scaleY,f.scaleX,f.scaleY,d,p),h=f=null,function(m){for(var g=-1,y=p.length,v;++g{"use strict";ov();OU();o(PU,"interpolateTransform");B8=PU(MU,"px, ","px)","deg)"),F8=PU(IU,", ",")",")")});function FU(t){return function(e,r){var n=t((e=sv(e)).h,(r=sv(r)).h),i=du(e.c,r.c),a=du(e.l,r.l),s=du(e.opacity,r.opacity);return function(l){return e.h=n(l),e.c=i(l),e.l=a(l),e.opacity=s(l),e+""}}}var $8,pwe,$U=N(()=>{"use strict";E0();D8();o(FU,"hcl");$8=FU(wU),pwe=FU(du)});var A0=N(()=>{"use strict";Y3();ov();LU();P8();BU();L8();$U()});function dv(){return hd||(VU(mwe),hd=hv.now()+e5)}function mwe(){hd=0}function fv(){this._call=this._time=this._next=null}function t5(t,e,r){var n=new fv;return n.restart(t,e,r),n}function UU(){dv(),++_0;for(var t=Z3,e;t;)(e=hd-t._time)>=0&&t._call.call(void 0,e),t=t._next;--_0}function zU(){hd=(J3=hv.now())+e5,_0=cv=0;try{UU()}finally{_0=0,ywe(),hd=0}}function gwe(){var t=hv.now(),e=t-J3;e>GU&&(e5-=e,J3=t)}function ywe(){for(var t,e=Z3,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Z3=r);uv=t,z8(n)}function z8(t){if(!_0){cv&&(cv=clearTimeout(cv));var e=t-hd;e>24?(t<1/0&&(cv=setTimeout(zU,t-hv.now()-e5)),lv&&(lv=clearInterval(lv))):(lv||(J3=hv.now(),lv=setInterval(gwe,GU)),_0=1,VU(zU))}}var _0,cv,lv,GU,Z3,uv,J3,hd,e5,hv,VU,G8=N(()=>{"use strict";_0=0,cv=0,lv=0,GU=1e3,J3=0,hd=0,e5=0,hv=typeof performance=="object"&&performance.now?performance:Date,VU=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};o(dv,"now");o(mwe,"clearNow");o(fv,"Timer");fv.prototype=t5.prototype={constructor:fv,restart:o(function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?dv():+r)+(e==null?0:+e),!this._next&&uv!==this&&(uv?uv._next=this:Z3=this,uv=this),this._call=t,this._time=r,z8()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,z8())},"stop")};o(t5,"timer");o(UU,"timerFlush");o(zU,"wake");o(gwe,"poke");o(ywe,"nap");o(z8,"sleep")});function pv(t,e,r){var n=new fv;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var HU=N(()=>{"use strict";G8();o(pv,"default")});var r5=N(()=>{"use strict";G8();HU()});function pu(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;bwe(t,r,{name:e,index:n,group:i,on:vwe,tween:xwe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:YU})}function gv(t,e){var r=Bi(t,e);if(r.state>YU)throw new Error("too late; already scheduled");return r}function ha(t,e){var r=Bi(t,e);if(r.state>n5)throw new Error("too late; already running");return r}function Bi(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function bwe(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=t5(a,0,r.time);function a(h){r.state=WU,r.timer.restart(s,r.delay,r.time),r.delay<=h&&s(h-r.delay)}o(a,"schedule");function s(h){var f,d,p,m;if(r.state!==WU)return u();for(f in n)if(m=n[f],m.name===r.name){if(m.state===n5)return pv(s);m.state===qU?(m.state=mv,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete n[f]):+f{"use strict";TA();r5();vwe=wA("start","end","cancel","interrupt"),xwe=[],YU=0,WU=1,i5=2,n5=3,qU=4,a5=5,mv=6;o(pu,"default");o(gv,"init");o(ha,"set");o(Bi,"get");o(bwe,"create")});function yv(t,e){var r=t.__transition,n,i,a=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((n=r[s]).name!==e){a=!1;continue}i=n.state>i5&&n.state{"use strict";Es();o(yv,"default")});function V8(t){return this.each(function(){yv(this,t)})}var jU=N(()=>{"use strict";XU();o(V8,"default")});function wwe(t,e){var r,n;return function(){var i=ha(this,t),a=i.tween;if(a!==r){n=r=a;for(var s=0,l=n.length;s{"use strict";Es();o(wwe,"tweenRemove");o(Twe,"tweenFunction");o(U8,"default");o(D0,"tweenValue")});function xv(t,e){var r;return(typeof e=="number"?Ki:e instanceof pl?ud:(r=pl(e))?(e=r,ud):C0)(t,e)}var H8=N(()=>{"use strict";E0();A0();o(xv,"default")});function kwe(t){return function(){this.removeAttribute(t)}}function Ewe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Swe(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttribute(t);return s===i?null:s===n?a:a=e(n=s,r)}}function Cwe(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===n?a:a=e(n=s,r)}}function Awe(t,e,r){var n,i,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttribute(t):(s=this.getAttribute(t),u=l+"",s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l)))}}function _we(t,e,r){var n,i,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),u=l+"",s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l)))}}function W8(t,e){var r=rc(t),n=r==="transform"?F8:xv;return this.attrTween(t,typeof e=="function"?(r.local?_we:Awe)(r,n,D0(this,"attr."+t,e)):e==null?(r.local?Ewe:kwe)(r):(r.local?Cwe:Swe)(r,n,e))}var KU=N(()=>{"use strict";A0();fl();vv();H8();o(kwe,"attrRemove");o(Ewe,"attrRemoveNS");o(Swe,"attrConstant");o(Cwe,"attrConstantNS");o(Awe,"attrFunction");o(_we,"attrFunctionNS");o(W8,"default")});function Dwe(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function Lwe(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function Rwe(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&Lwe(t,a)),r}return o(i,"tween"),i._value=e,i}function Nwe(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&Dwe(t,a)),r}return o(i,"tween"),i._value=e,i}function q8(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=rc(t);return this.tween(r,(n.local?Rwe:Nwe)(n,e))}var QU=N(()=>{"use strict";fl();o(Dwe,"attrInterpolate");o(Lwe,"attrInterpolateNS");o(Rwe,"attrTweenNS");o(Nwe,"attrTween");o(q8,"default")});function Mwe(t,e){return function(){gv(this,t).delay=+e.apply(this,arguments)}}function Iwe(t,e){return e=+e,function(){gv(this,t).delay=e}}function Y8(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Mwe:Iwe)(e,t)):Bi(this.node(),e).delay}var ZU=N(()=>{"use strict";Es();o(Mwe,"delayFunction");o(Iwe,"delayConstant");o(Y8,"default")});function Owe(t,e){return function(){ha(this,t).duration=+e.apply(this,arguments)}}function Pwe(t,e){return e=+e,function(){ha(this,t).duration=e}}function X8(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Owe:Pwe)(e,t)):Bi(this.node(),e).duration}var JU=N(()=>{"use strict";Es();o(Owe,"durationFunction");o(Pwe,"durationConstant");o(X8,"default")});function Bwe(t,e){if(typeof e!="function")throw new Error;return function(){ha(this,t).ease=e}}function j8(t){var e=this._id;return arguments.length?this.each(Bwe(e,t)):Bi(this.node(),e).ease}var eH=N(()=>{"use strict";Es();o(Bwe,"easeConstant");o(j8,"default")});function Fwe(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;ha(this,t).ease=r}}function K8(t){if(typeof t!="function")throw new Error;return this.each(Fwe(this._id,t))}var tH=N(()=>{"use strict";Es();o(Fwe,"easeVarying");o(K8,"default")});function Q8(t){typeof t!="function"&&(t=x0(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";fl();fd();o(Q8,"default")});function Z8(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,a=Math.min(n,i),s=new Array(n),l=0;l{"use strict";fd();o(Z8,"default")});function $we(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function zwe(t,e,r){var n,i,a=$we(e)?gv:ha;return function(){var s=a(this,t),l=s.on;l!==n&&(i=(n=l).copy()).on(e,r),s.on=i}}function J8(t,e){var r=this._id;return arguments.length<2?Bi(this.node(),r).on.on(t):this.each(zwe(r,t,e))}var iH=N(()=>{"use strict";Es();o($we,"start");o(zwe,"onFunction");o(J8,"default")});function Gwe(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function e_(){return this.on("end.remove",Gwe(this._id))}var aH=N(()=>{"use strict";o(Gwe,"removeFunction");o(e_,"default")});function t_(t){var e=this._name,r=this._id;typeof t!="function"&&(t=xh(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s{"use strict";fl();fd();Es();o(t_,"default")});function r_(t){var e=this._name,r=this._id;typeof t!="function"&&(t=v0(t));for(var n=this._groups,i=n.length,a=[],s=[],l=0;l{"use strict";fl();fd();Es();o(r_,"default")});function n_(){return new Vwe(this._groups,this._parents)}var Vwe,lH=N(()=>{"use strict";fl();Vwe=hu.prototype.constructor;o(n_,"default")});function Uwe(t,e){var r,n,i;return function(){var a=bh(this,t),s=(this.style.removeProperty(t),bh(this,t));return a===s?null:a===r&&s===n?i:i=e(r=a,n=s)}}function cH(t){return function(){this.style.removeProperty(t)}}function Hwe(t,e,r){var n,i=r+"",a;return function(){var s=bh(this,t);return s===i?null:s===n?a:a=e(n=s,r)}}function Wwe(t,e,r){var n,i,a;return function(){var s=bh(this,t),l=r(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),bh(this,t))),s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l))}}function qwe(t,e){var r,n,i,a="style."+e,s="end."+a,l;return function(){var u=ha(this,t),h=u.on,f=u.value[a]==null?l||(l=cH(e)):void 0;(h!==r||i!==f)&&(n=(r=h).copy()).on(s,i=f),u.on=n}}function i_(t,e,r){var n=(t+="")=="transform"?B8:xv;return e==null?this.styleTween(t,Uwe(t,n)).on("end.style."+t,cH(t)):typeof e=="function"?this.styleTween(t,Wwe(t,n,D0(this,"style."+t,e))).each(qwe(this._id,t)):this.styleTween(t,Hwe(t,n,e),r).on("end.style."+t,null)}var uH=N(()=>{"use strict";A0();fl();Es();vv();H8();o(Uwe,"styleNull");o(cH,"styleRemove");o(Hwe,"styleConstant");o(Wwe,"styleFunction");o(qwe,"styleMaybeRemove");o(i_,"default")});function Ywe(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function Xwe(t,e,r){var n,i;function a(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&Ywe(t,s,r)),n}return o(a,"tween"),a._value=e,a}function a_(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,Xwe(t,e,r??""))}var hH=N(()=>{"use strict";o(Ywe,"styleInterpolate");o(Xwe,"styleTween");o(a_,"default")});function jwe(t){return function(){this.textContent=t}}function Kwe(t){return function(){var e=t(this);this.textContent=e??""}}function s_(t){return this.tween("text",typeof t=="function"?Kwe(D0(this,"text",t)):jwe(t==null?"":t+""))}var fH=N(()=>{"use strict";vv();o(jwe,"textConstant");o(Kwe,"textFunction");o(s_,"default")});function Qwe(t){return function(e){this.textContent=t.call(this,e)}}function Zwe(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&Qwe(i)),e}return o(n,"tween"),n._value=t,n}function o_(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Zwe(t))}var dH=N(()=>{"use strict";o(Qwe,"textInterpolate");o(Zwe,"textTween");o(o_,"default")});function l_(){for(var t=this._name,e=this._id,r=s5(),n=this._groups,i=n.length,a=0;a{"use strict";fd();Es();o(l_,"default")});function c_(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var l={value:s},u={value:o(function(){--i===0&&a()},"value")};r.each(function(){var h=ha(this,n),f=h.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),h.on=e}),i===0&&a()})}var mH=N(()=>{"use strict";Es();o(c_,"default")});function es(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function gH(t){return hu().transition(t)}function s5(){return++Jwe}var Jwe,mu,fd=N(()=>{"use strict";fl();KU();QU();ZU();JU();eH();tH();rH();nH();iH();aH();sH();oH();lH();uH();hH();fH();dH();pH();vv();mH();Jwe=0;o(es,"Transition");o(gH,"transition");o(s5,"newId");mu=hu.prototype;es.prototype=gH.prototype={constructor:es,select:t_,selectAll:r_,selectChild:mu.selectChild,selectChildren:mu.selectChildren,filter:Q8,merge:Z8,selection:n_,transition:l_,call:mu.call,nodes:mu.nodes,node:mu.node,size:mu.size,empty:mu.empty,each:mu.each,on:J8,attr:W8,attrTween:q8,style:i_,styleTween:a_,text:s_,textTween:o_,remove:e_,tween:U8,delay:Y8,duration:X8,ease:j8,easeVarying:K8,end:c_,[Symbol.iterator]:mu[Symbol.iterator]}});function o5(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var yH=N(()=>{"use strict";o(o5,"cubicInOut")});var u_=N(()=>{"use strict";yH()});function tTe(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function h_(t){var e,r;t instanceof es?(e=t._id,t=t._name):(e=s5(),(r=eTe).time=dv(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,a=0;a{"use strict";fd();Es();u_();r5();eTe={time:null,delay:0,duration:250,ease:o5};o(tTe,"inherit");o(h_,"default")});var xH=N(()=>{"use strict";fl();jU();vH();hu.prototype.interrupt=V8;hu.prototype.transition=h_});var l5=N(()=>{"use strict";xH()});var bH=N(()=>{"use strict"});var wH=N(()=>{"use strict"});var TH=N(()=>{"use strict"});function kH(t){return[+t[0],+t[1]]}function rTe(t){return[kH(t[0]),kH(t[1])]}function f_(t){return{type:t}}var Z0t,J0t,emt,tmt,rmt,nmt,EH=N(()=>{"use strict";l5();bH();wH();TH();({abs:Z0t,max:J0t,min:emt}=Math);o(kH,"number1");o(rTe,"number2");tmt={name:"x",handles:["w","e"].map(f_),input:o(function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},"input"),output:o(function(t){return t&&[t[0][0],t[1][0]]},"output")},rmt={name:"y",handles:["n","s"].map(f_),input:o(function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},"input"),output:o(function(t){return t&&[t[0][1],t[1][1]]},"output")},nmt={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(f_),input:o(function(t){return t==null?null:rTe(t)},"input"),output:o(function(t){return t},"output")};o(f_,"type")});var SH=N(()=>{"use strict";EH()});function CH(t){this._+=t[0];for(let e=1,r=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return CH;let r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;i{"use strict";d_=Math.PI,p_=2*d_,dd=1e-6,nTe=p_-dd;o(CH,"append");o(iTe,"appendRound");pd=class{static{o(this,"Path")}constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?CH:iTe(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,a,s){this._append`C${+e},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,r,n,i,a){if(e=+e,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,u=n-e,h=i-r,f=s-e,d=l-r,p=f*f+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(p>dd)if(!(Math.abs(d*u-h*f)>dd)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let m=n-s,g=i-l,y=u*u+h*h,v=m*m+g*g,x=Math.sqrt(y),b=Math.sqrt(p),w=a*Math.tan((d_-Math.acos((y+p-v)/(2*x*b)))/2),C=w/b,T=w/x;Math.abs(C-1)>dd&&this._append`L${e+C*f},${r+C*d}`,this._append`A${a},${a},0,0,${+(d*m>f*g)},${this._x1=e+T*u},${this._y1=r+T*h}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),h=e+l,f=r+u,d=1^s,p=s?i-a:a-i;this._x1===null?this._append`M${h},${f}`:(Math.abs(this._x1-h)>dd||Math.abs(this._y1-f)>dd)&&this._append`L${h},${f}`,n&&(p<0&&(p=p%p_+p_),p>nTe?this._append`A${n},${n},0,1,${d},${e-l},${r-u}A${n},${n},0,1,${d},${this._x1=h},${this._y1=f}`:p>dd&&this._append`A${n},${n},0,${+(p>=d_)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};o(AH,"path");AH.prototype=pd.prototype});var m_=N(()=>{"use strict";_H()});var DH=N(()=>{"use strict"});var LH=N(()=>{"use strict"});var RH=N(()=>{"use strict"});var NH=N(()=>{"use strict"});var MH=N(()=>{"use strict"});var IH=N(()=>{"use strict"});var OH=N(()=>{"use strict"});function g_(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function md(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}var bv=N(()=>{"use strict";o(g_,"default");o(md,"formatDecimalParts")});function ml(t){return t=md(Math.abs(t)),t?t[1]:NaN}var wv=N(()=>{"use strict";bv();o(ml,"default")});function y_(t,e){return function(r,n){for(var i=r.length,a=[],s=0,l=t[0],u=0;i>0&&l>0&&(u+l+1>n&&(l=Math.max(1,n-u)),a.push(r.substring(i-=l,i+l)),!((u+=l+1)>n));)l=t[s=(s+1)%t.length];return a.reverse().join(e)}}var PH=N(()=>{"use strict";o(y_,"default")});function v_(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var BH=N(()=>{"use strict";o(v_,"default")});function Eh(t){if(!(e=aTe.exec(t)))throw new Error("invalid format: "+t);var e;return new c5({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function c5(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}var aTe,x_=N(()=>{"use strict";aTe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;o(Eh,"formatSpecifier");Eh.prototype=c5.prototype;o(c5,"FormatSpecifier");c5.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function b_(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var FH=N(()=>{"use strict";o(b_,"default")});function T_(t,e){var r=md(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(w_=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+md(t,Math.max(0,e+a-1))[0]}var w_,k_=N(()=>{"use strict";bv();o(T_,"default")});function u5(t,e){var r=md(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var $H=N(()=>{"use strict";bv();o(u5,"default")});var E_,zH=N(()=>{"use strict";bv();k_();$H();E_={"%":o((t,e)=>(t*100).toFixed(e),"%"),b:o(t=>Math.round(t).toString(2),"b"),c:o(t=>t+"","c"),d:g_,e:o((t,e)=>t.toExponential(e),"e"),f:o((t,e)=>t.toFixed(e),"f"),g:o((t,e)=>t.toPrecision(e),"g"),o:o(t=>Math.round(t).toString(8),"o"),p:o((t,e)=>u5(t*100,e),"p"),r:u5,s:T_,X:o(t=>Math.round(t).toString(16).toUpperCase(),"X"),x:o(t=>Math.round(t).toString(16),"x")}});function h5(t){return t}var GH=N(()=>{"use strict";o(h5,"default")});function S_(t){var e=t.grouping===void 0||t.thousands===void 0?h5:y_(VH.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?h5:v_(VH.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"\u2212":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function h(d){d=Eh(d);var p=d.fill,m=d.align,g=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,w=d.precision,C=d.trim,T=d.type;T==="n"?(b=!0,T="g"):E_[T]||(w===void 0&&(w=12),C=!0,T="g"),(v||p==="0"&&m==="=")&&(v=!0,p="0",m="=");var E=y==="$"?r:y==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",A=y==="$"?n:/[%p]/.test(T)?s:"",S=E_[T],_=/[defgprs%]/.test(T);w=w===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function I(D){var k=E,L=A,R,O,M;if(T==="c")L=S(D)+L,D="";else{D=+D;var B=D<0||1/D<0;if(D=isNaN(D)?u:S(Math.abs(D),w),C&&(D=b_(D)),B&&+D==0&&g!=="+"&&(B=!1),k=(B?g==="("?g:l:g==="-"||g==="("?"":g)+k,L=(T==="s"?UH[8+w_/3]:"")+L+(B&&g==="("?")":""),_){for(R=-1,O=D.length;++RM||M>57){L=(M===46?i+D.slice(R+1):D.slice(R))+L,D=D.slice(0,R);break}}}b&&!v&&(D=e(D,1/0));var F=k.length+D.length+L.length,P=F>1)+k+D+L+P.slice(F);break;default:D=P+k+D+L;break}return a(D)}return o(I,"format"),I.toString=function(){return d+""},I}o(h,"newFormat");function f(d,p){var m=h((d=Eh(d),d.type="f",d)),g=Math.max(-8,Math.min(8,Math.floor(ml(p)/3)))*3,y=Math.pow(10,-g),v=UH[8+g/3];return function(x){return m(y*x)+v}}return o(f,"formatPrefix"),{format:h,formatPrefix:f}}var VH,UH,HH=N(()=>{"use strict";wv();PH();BH();x_();FH();zH();k_();GH();VH=Array.prototype.map,UH=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];o(S_,"default")});function C_(t){return f5=S_(t),d5=f5.format,p5=f5.formatPrefix,f5}var f5,d5,p5,WH=N(()=>{"use strict";HH();C_({thousands:",",grouping:[3],currency:["$",""]});o(C_,"defaultLocale")});function m5(t){return Math.max(0,-ml(Math.abs(t)))}var qH=N(()=>{"use strict";wv();o(m5,"default")});function g5(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ml(e)/3)))*3-ml(Math.abs(t)))}var YH=N(()=>{"use strict";wv();o(g5,"default")});function y5(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ml(e)-ml(t))+1}var XH=N(()=>{"use strict";wv();o(y5,"default")});var A_=N(()=>{"use strict";WH();x_();qH();YH();XH()});var jH=N(()=>{"use strict"});var KH=N(()=>{"use strict"});var QH=N(()=>{"use strict"});var ZH=N(()=>{"use strict"});function Sh(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var Tv=N(()=>{"use strict";o(Sh,"initRange")});function gu(){var t=new g0,e=[],r=[],n=__;function i(a){let s=t.get(a);if(s===void 0){if(n!==__)return n;t.set(a,s=e.push(a)-1)}return r[s%r.length]}return o(i,"scale"),i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new g0;for(let s of a)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return gu(e,r).unknown(n)},Sh.apply(i,arguments),i}var __,D_=N(()=>{"use strict";vh();Tv();__=Symbol("implicit");o(gu,"ordinal")});function L0(){var t=gu().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,s,l=!1,u=0,h=0,f=.5;delete t.unknown;function d(){var p=e().length,m=i