"use strict";
var __esbuild_esm_mermaid_nm;
(__esbuild_esm_mermaid_nm ||= {}).mermaid = (() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true });
var __esm = (fn3, res) => function __init() {
return fn3 && (res = (0, fn3[__getOwnPropNames(fn3)[0]])(fn3 = 0)), res;
};
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from2, except, desc) => {
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
for (let key of __getOwnPropNames(from2))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/defaults.js
var defaultIconDimensions, defaultIconTransformations, defaultIconProps, defaultExtendedIconProps;
var init_defaults = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/defaults.js"() {
"use strict";
defaultIconDimensions = Object.freeze({
left: 0,
top: 0,
width: 16,
height: 16
});
defaultIconTransformations = Object.freeze({
rotate: 0,
vFlip: false,
hFlip: false
});
defaultIconProps = Object.freeze({
...defaultIconDimensions,
...defaultIconTransformations
});
defaultExtendedIconProps = Object.freeze({
...defaultIconProps,
body: "",
hidden: false
});
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/customisations/defaults.js
var defaultIconSizeCustomisations, defaultIconCustomisations;
var init_defaults2 = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/customisations/defaults.js"() {
"use strict";
init_defaults();
defaultIconSizeCustomisations = Object.freeze({
width: null,
height: null
});
defaultIconCustomisations = Object.freeze({
...defaultIconSizeCustomisations,
...defaultIconTransformations
});
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/name.js
var stringToIcon, validateIconName;
var init_name = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/name.js"() {
"use strict";
stringToIcon = /* @__PURE__ */ __name((value2, validate, allowSimpleName, provider = "") => {
const colonSeparated = value2.split(":");
if (value2.slice(0, 1) === "@") {
if (colonSeparated.length < 2 || colonSeparated.length > 3) return null;
provider = colonSeparated.shift().slice(1);
}
if (colonSeparated.length > 3 || !colonSeparated.length) return null;
if (colonSeparated.length > 1) {
const name$1 = colonSeparated.pop();
const prefix = colonSeparated.pop();
const result = {
provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
prefix,
name: name$1
};
return validate && !validateIconName(result) ? null : result;
}
const name = colonSeparated[0];
const dashSeparated = name.split("-");
if (dashSeparated.length > 1) {
const result = {
provider,
prefix: dashSeparated.shift(),
name: dashSeparated.join("-")
};
return validate && !validateIconName(result) ? null : result;
}
if (allowSimpleName && provider === "") {
const result = {
provider,
prefix: "",
name
};
return validate && !validateIconName(result, allowSimpleName) ? null : result;
}
return null;
}, "stringToIcon");
validateIconName = /* @__PURE__ */ __name((icon2, allowSimpleName) => {
if (!icon2) return false;
return !!((allowSimpleName && icon2.prefix === "" || !!icon2.prefix) && !!icon2.name);
}, "validateIconName");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/transformations.js
function mergeIconTransformations(obj1, obj2) {
const result = {};
if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;
if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;
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@3.0.2/node_modules/@iconify/utils/lib/icon/transformations.js"() {
"use strict";
__name(mergeIconTransformations, "mergeIconTransformations");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/merge.js
function mergeIconData(parent4, child) {
const result = mergeIconTransformations(parent4, child);
for (const key in defaultExtendedIconProps) if (key in defaultIconTransformations) {
if (key in parent4 && !(key in result)) result[key] = defaultIconTransformations[key];
} else if (key in child) result[key] = child[key];
else if (key in parent4) result[key] = parent4[key];
return result;
}
var init_merge = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/merge.js"() {
"use strict";
init_defaults();
init_transformations();
__name(mergeIconData, "mergeIconData");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/tree.js
function getIconsTree(data5, names) {
const icons = data5.icons;
const aliases = data5.aliases || /* @__PURE__ */ Object.create(null);
const resolved = /* @__PURE__ */ Object.create(null);
function resolve2(name) {
if (icons[name]) return resolved[name] = [];
if (!(name in resolved)) {
resolved[name] = null;
const parent4 = aliases[name] && aliases[name].parent;
const value2 = parent4 && resolve2(parent4);
if (value2) resolved[name] = [parent4].concat(value2);
}
return resolved[name];
}
__name(resolve2, "resolve");
(names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve2);
return resolved;
}
var init_tree = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/tree.js"() {
"use strict";
__name(getIconsTree, "getIconsTree");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/get-icon.js
function internalGetIconData(data5, name, tree) {
const icons = data5.icons;
const aliases = data5.aliases || /* @__PURE__ */ Object.create(null);
let currentProps = {};
function parse7(name$1) {
currentProps = mergeIconData(icons[name$1] || aliases[name$1], currentProps);
}
__name(parse7, "parse");
parse7(name);
tree.forEach(parse7);
return mergeIconData(data5, currentProps);
}
function getIconData(data5, name) {
if (data5.icons[name]) return internalGetIconData(data5, name, []);
const tree = getIconsTree(data5, [name])[name];
return tree ? internalGetIconData(data5, name, tree) : null;
}
var init_get_icon = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/get-icon.js"() {
"use strict";
init_merge();
init_tree();
__name(internalGetIconData, "internalGetIconData");
__name(getIconData, "getIconData");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/size.js
function calculateSize(size4, ratio, precision) {
if (ratio === 1) return size4;
precision = precision || 100;
if (typeof size4 === "number") return Math.ceil(size4 * ratio * precision) / precision;
if (typeof size4 !== "string") return size4;
const oldParts = size4.split(unitsSplit);
if (oldParts === null || !oldParts.length) return size4;
const newParts = [];
let code = oldParts.shift();
let isNumber = unitsTest.test(code);
while (true) {
if (isNumber) {
const num = parseFloat(code);
if (isNaN(num)) newParts.push(code);
else newParts.push(Math.ceil(num * ratio * precision) / precision);
} else newParts.push(code);
code = oldParts.shift();
if (code === void 0) return newParts.join("");
isNumber = !isNumber;
}
}
var unitsSplit, unitsTest;
var init_size = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/size.js"() {
"use strict";
unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
__name(calculateSize, "calculateSize");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/defs.js
function splitSVGDefs(content, tag = "defs") {
let defs2 = "";
const index = content.indexOf("<" + tag);
while (index >= 0) {
const start3 = content.indexOf(">", index);
const end2 = content.indexOf("" + tag);
if (start3 === -1 || end2 === -1) break;
const endEnd = content.indexOf(">", end2);
if (endEnd === -1) break;
defs2 += content.slice(start3 + 1, end2).trim();
content = content.slice(0, index).trim() + content.slice(endEnd + 1);
}
return {
defs: defs2,
content
};
}
function mergeDefsAndContent(defs2, content) {
return defs2 ? "" + defs2 + "" + content : content;
}
function wrapSVGContent(body, start3, end2) {
const split = splitSVGDefs(body);
return mergeDefsAndContent(split.defs, start3 + split.content + end2);
}
var init_defs = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/defs.js"() {
"use strict";
__name(splitSVGDefs, "splitSVGDefs");
__name(mergeDefsAndContent, "mergeDefsAndContent");
__name(wrapSVGContent, "wrapSVGContent");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/build.js
function iconToSVG(icon2, customisations) {
const fullIcon = {
...defaultIconProps,
...icon2
};
const fullCustomisations = {
...defaultIconCustomisations,
...customisations
};
const box = {
left: fullIcon.left,
top: fullIcon.top,
width: fullIcon.width,
height: fullIcon.height
};
let body = fullIcon.body;
[fullIcon, fullCustomisations].forEach((props) => {
const transformations = [];
const hFlip = props.hFlip;
const vFlip = props.vFlip;
let rotation = props.rotate;
if (hFlip) if (vFlip) rotation += 2;
else {
transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
transformations.push("scale(-1 1)");
box.top = box.left = 0;
}
else if (vFlip) {
transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
transformations.push("scale(1 -1)");
box.top = box.left = 0;
}
let tempValue;
if (rotation < 0) rotation -= Math.floor(rotation / 4) * 4;
rotation = rotation % 4;
switch (rotation) {
case 1:
tempValue = box.height / 2 + box.top;
transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
break;
case 2:
transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
break;
case 3:
tempValue = box.width / 2 + box.left;
transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
break;
}
if (rotation % 2 === 1) {
if (box.left !== box.top) {
tempValue = box.left;
box.left = box.top;
box.top = tempValue;
}
if (box.width !== box.height) {
tempValue = box.width;
box.width = box.height;
box.height = tempValue;
}
}
if (transformations.length) body = wrapSVGContent(body, '', "");
});
const customisationsWidth = fullCustomisations.width;
const customisationsHeight = fullCustomisations.height;
const boxWidth = box.width;
const boxHeight = box.height;
let width3;
let height2;
if (customisationsWidth === null) {
height2 = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
width3 = calculateSize(height2, boxWidth / boxHeight);
} else {
width3 = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
height2 = customisationsHeight === null ? calculateSize(width3, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
}
const attributes = {};
const setAttr = /* @__PURE__ */ __name((prop, value2) => {
if (!isUnsetKeyword(value2)) attributes[prop] = value2.toString();
}, "setAttr");
setAttr("width", width3);
setAttr("height", height2);
const viewBox = [
box.left,
box.top,
boxWidth,
boxHeight
];
attributes.viewBox = viewBox.join(" ");
return {
attributes,
viewBox,
body
};
}
var isUnsetKeyword;
var init_build = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/build.js"() {
"use strict";
init_defaults();
init_defaults2();
init_size();
init_defs();
isUnsetKeyword = /* @__PURE__ */ __name((value2) => value2 === "unset" || value2 === "undefined" || value2 === "none", "isUnsetKeyword");
__name(iconToSVG, "iconToSVG");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/id.js
function replaceIDs(body, prefix = randomPrefix) {
const ids = [];
let match2;
while (match2 = regex.exec(body)) ids.push(match2[1]);
if (!ids.length) return body;
const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
ids.forEach((id30) => {
const newID = typeof prefix === "function" ? prefix(id30) : prefix + (counter++).toString();
const escapedID = id30.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
body = body.replace(new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), "$1" + newID + suffix + "$3");
});
body = body.replace(new RegExp(suffix, "g"), "");
return body;
}
var regex, randomPrefix, counter;
var init_id = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/id.js"() {
"use strict";
regex = /\sid="(\S+)"/g;
randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
counter = 0;
__name(replaceIDs, "replaceIDs");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/html.js
function iconToHTML(body, attributes) {
let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
for (const attr in attributes) renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
return '";
}
var init_html = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/html.js"() {
"use strict";
__name(iconToHTML, "iconToHTML");
}
});
// ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/index.js
var init_lib = __esm({
"../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/index.js"() {
"use strict";
init_name();
init_get_icon();
init_build();
init_id();
init_html();
}
});
// src/assignWithDepth.ts
var assignWithDepth, assignWithDepth_default;
var init_assignWithDepth = __esm({
"src/assignWithDepth.ts"() {
"use strict";
assignWithDepth = /* @__PURE__ */ __name((dst, src, { depth = 2, clobber = false } = {}) => {
const config5 = { depth, clobber };
if (Array.isArray(src) && !Array.isArray(dst)) {
src.forEach((s2) => assignWithDepth(dst, s2, config5));
return dst;
} else if (Array.isArray(src) && Array.isArray(dst)) {
src.forEach((s2) => {
if (!dst.includes(s2)) {
dst.push(s2);
}
});
return dst;
}
if (dst === void 0 || depth <= 0) {
if (dst !== void 0 && dst !== null && typeof dst === "object" && typeof src === "object") {
return Object.assign(dst, src);
} else {
return src;
}
}
if (src !== void 0 && typeof dst === "object" && typeof src === "object") {
Object.keys(src).forEach((key) => {
if (typeof src[key] === "object" && (dst[key] === void 0 || typeof dst[key] === "object")) {
if (dst[key] === void 0) {
dst[key] = Array.isArray(src[key]) ? [] : {};
}
dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber });
} else if (clobber || typeof dst[key] !== "object" && typeof src[key] !== "object") {
dst[key] = src[key];
}
});
}
return dst;
}, "assignWithDepth");
assignWithDepth_default = assignWithDepth;
}
});
// ../../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js
var require_dayjs_min = __commonJS({
"../../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js"(exports2, module2) {
"use strict";
!(function(t4, e3) {
"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", f2 = "quarter", h3 = "year", d3 = "date", l4 = "Invalid Date", $4 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y6 = /\[([^\]]+)]|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, M3 = { 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") }, m3 = /* @__PURE__ */ __name(function(t5, e4, n3) {
var r3 = String(t5);
return !r3 || r3.length >= e4 ? t5 : "" + Array(e4 + 1 - r3.length).join(n3) + t5;
}, "m"), v3 = { s: m3, z: /* @__PURE__ */ __name(function(t5) {
var e4 = -t5.utcOffset(), n3 = Math.abs(e4), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
return (e4 <= 0 ? "+" : "-") + m3(r3, 2, "0") + ":" + m3(i3, 2, "0");
}, "z"), m: /* @__PURE__ */ __name(function t5(e4, n3) {
if (e4.date() < n3.date()) return -t5(n3, e4);
var r3 = 12 * (n3.year() - e4.year()) + (n3.month() - e4.month()), i3 = e4.clone().add(r3, c3), s3 = n3 - i3 < 0, u3 = e4.clone().add(r3 + (s3 ? -1 : 1), c3);
return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
}, "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: h3, w: o2, d: a2, D: d3, 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", D4 = {};
D4[g2] = M3;
var p3 = "$isDayjsObject", S4 = /* @__PURE__ */ __name(function(t5) {
return t5 instanceof _3 || !(!t5 || !t5[p3]);
}, "S"), w4 = /* @__PURE__ */ __name(function t5(e4, n3, r3) {
var i3;
if (!e4) return g2;
if ("string" == typeof e4) {
var s3 = e4.toLowerCase();
D4[s3] && (i3 = s3), n3 && (D4[s3] = n3, i3 = s3);
var u3 = e4.split("-");
if (!i3 && u3.length > 1) return t5(u3[0]);
} else {
var a3 = e4.name;
D4[a3] = e4, i3 = a3;
}
return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
}, "t"), O3 = /* @__PURE__ */ __name(function(t5, e4) {
if (S4(t5)) return t5.clone();
var n3 = "object" == typeof e4 ? e4 : {};
return n3.date = t5, n3.args = arguments, new _3(n3);
}, "O"), b3 = v3;
b3.l = w4, b3.i = S4, b3.w = function(t5, e4) {
return O3(t5, { locale: e4.$L, utc: e4.$u, x: e4.$x, $offset: e4.$offset });
};
var _3 = (function() {
function M4(t5) {
this.$L = w4(t5.locale, null, true), this.parse(t5), this.$x = this.$x || t5.x || {}, this[p3] = true;
}
__name(M4, "M");
var m4 = M4.prototype;
return m4.parse = function(t5) {
this.$d = (function(t6) {
var e4 = t6.date, n3 = t6.utc;
if (null === e4) return /* @__PURE__ */ new Date(NaN);
if (b3.u(e4)) return /* @__PURE__ */ new Date();
if (e4 instanceof Date) return new Date(e4);
if ("string" == typeof e4 && !/Z$/i.test(e4)) {
var r3 = e4.match($4);
if (r3) {
var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
}
}
return new Date(e4);
})(t5), this.init();
}, m4.init = function() {
var t5 = this.$d;
this.$y = t5.getFullYear(), this.$M = t5.getMonth(), this.$D = t5.getDate(), this.$W = t5.getDay(), this.$H = t5.getHours(), this.$m = t5.getMinutes(), this.$s = t5.getSeconds(), this.$ms = t5.getMilliseconds();
}, m4.$utils = function() {
return b3;
}, m4.isValid = function() {
return !(this.$d.toString() === l4);
}, m4.isSame = function(t5, e4) {
var n3 = O3(t5);
return this.startOf(e4) <= n3 && n3 <= this.endOf(e4);
}, m4.isAfter = function(t5, e4) {
return O3(t5) < this.startOf(e4);
}, m4.isBefore = function(t5, e4) {
return this.endOf(e4) < O3(t5);
}, m4.$g = function(t5, e4, n3) {
return b3.u(t5) ? this[e4] : this.set(n3, t5);
}, m4.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, m4.valueOf = function() {
return this.$d.getTime();
}, m4.startOf = function(t5, e4) {
var n3 = this, r3 = !!b3.u(e4) || e4, f3 = b3.p(t5), l5 = /* @__PURE__ */ __name(function(t6, e6) {
var i3 = b3.w(n3.$u ? Date.UTC(n3.$y, e6, t6) : new Date(n3.$y, e6, t6), n3);
return r3 ? i3 : i3.endOf(a2);
}, "l"), $5 = /* @__PURE__ */ __name(function(t6, e6) {
return b3.w(n3.toDate()[t6].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e6)), n3);
}, "$"), y7 = this.$W, M5 = this.$M, m5 = this.$D, v5 = "set" + (this.$u ? "UTC" : "");
switch (f3) {
case h3:
return r3 ? l5(1, 0) : l5(31, 11);
case c3:
return r3 ? l5(1, M5) : l5(0, M5 + 1);
case o2:
var g3 = this.$locale().weekStart || 0, D5 = (y7 < g3 ? y7 + 7 : y7) - g3;
return l5(r3 ? m5 - D5 : m5 + (6 - D5), M5);
case a2:
case d3:
return $5(v5 + "Hours", 0);
case u2:
return $5(v5 + "Minutes", 1);
case s2:
return $5(v5 + "Seconds", 2);
case i2:
return $5(v5 + "Milliseconds", 3);
default:
return this.clone();
}
}, m4.endOf = function(t5) {
return this.startOf(t5, false);
}, m4.$set = function(t5, e4) {
var n3, o3 = b3.p(t5), f3 = "set" + (this.$u ? "UTC" : ""), l5 = (n3 = {}, n3[a2] = f3 + "Date", n3[d3] = f3 + "Date", n3[c3] = f3 + "Month", n3[h3] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $5 = o3 === a2 ? this.$D + (e4 - this.$W) : e4;
if (o3 === c3 || o3 === h3) {
var y7 = this.clone().set(d3, 1);
y7.$d[l5]($5), y7.init(), this.$d = y7.set(d3, Math.min(this.$D, y7.daysInMonth())).$d;
} else l5 && this.$d[l5]($5);
return this.init(), this;
}, m4.set = function(t5, e4) {
return this.clone().$set(t5, e4);
}, m4.get = function(t5) {
return this[b3.p(t5)]();
}, m4.add = function(r3, f3) {
var d4, l5 = this;
r3 = Number(r3);
var $5 = b3.p(f3), y7 = /* @__PURE__ */ __name(function(t5) {
var e4 = O3(l5);
return b3.w(e4.date(e4.date() + Math.round(t5 * r3)), l5);
}, "y");
if ($5 === c3) return this.set(c3, this.$M + r3);
if ($5 === h3) return this.set(h3, this.$y + r3);
if ($5 === a2) return y7(1);
if ($5 === o2) return y7(7);
var M5 = (d4 = {}, d4[s2] = e3, d4[u2] = n2, d4[i2] = t4, d4)[$5] || 1, m5 = this.$d.getTime() + r3 * M5;
return b3.w(m5, this);
}, m4.subtract = function(t5, e4) {
return this.add(-1 * t5, e4);
}, m4.format = function(t5) {
var e4 = this, n3 = this.$locale();
if (!this.isValid()) return n3.invalidDate || l4;
var r3 = t5 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b3.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c4 = n3.months, f3 = n3.meridiem, h4 = /* @__PURE__ */ __name(function(t6, n4, i4, s4) {
return t6 && (t6[n4] || t6(e4, r3)) || i4[n4].slice(0, s4);
}, "h"), d4 = /* @__PURE__ */ __name(function(t6) {
return b3.s(s3 % 12 || 12, t6, "0");
}, "d"), $5 = f3 || function(t6, e6, n4) {
var r4 = t6 < 12 ? "AM" : "PM";
return n4 ? r4.toLowerCase() : r4;
};
return r3.replace(y6, (function(t6, r4) {
return r4 || (function(t7) {
switch (t7) {
case "YY":
return String(e4.$y).slice(-2);
case "YYYY":
return b3.s(e4.$y, 4, "0");
case "M":
return a3 + 1;
case "MM":
return b3.s(a3 + 1, 2, "0");
case "MMM":
return h4(n3.monthsShort, a3, c4, 3);
case "MMMM":
return h4(c4, a3);
case "D":
return e4.$D;
case "DD":
return b3.s(e4.$D, 2, "0");
case "d":
return String(e4.$W);
case "dd":
return h4(n3.weekdaysMin, e4.$W, o3, 2);
case "ddd":
return h4(n3.weekdaysShort, e4.$W, o3, 3);
case "dddd":
return o3[e4.$W];
case "H":
return String(s3);
case "HH":
return b3.s(s3, 2, "0");
case "h":
return d4(1);
case "hh":
return d4(2);
case "a":
return $5(s3, u3, true);
case "A":
return $5(s3, u3, false);
case "m":
return String(u3);
case "mm":
return b3.s(u3, 2, "0");
case "s":
return String(e4.$s);
case "ss":
return b3.s(e4.$s, 2, "0");
case "SSS":
return b3.s(e4.$ms, 3, "0");
case "Z":
return i3;
}
return null;
})(t6) || i3.replace(":", "");
}));
}, m4.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, m4.diff = function(r3, d4, l5) {
var $5, y7 = this, M5 = b3.p(d4), m5 = O3(r3), v5 = (m5.utcOffset() - this.utcOffset()) * e3, g3 = this - m5, D5 = /* @__PURE__ */ __name(function() {
return b3.m(y7, m5);
}, "D");
switch (M5) {
case h3:
$5 = D5() / 12;
break;
case c3:
$5 = D5();
break;
case f2:
$5 = D5() / 3;
break;
case o2:
$5 = (g3 - v5) / 6048e5;
break;
case a2:
$5 = (g3 - v5) / 864e5;
break;
case u2:
$5 = g3 / n2;
break;
case s2:
$5 = g3 / e3;
break;
case i2:
$5 = g3 / t4;
break;
default:
$5 = g3;
}
return l5 ? $5 : b3.a($5);
}, m4.daysInMonth = function() {
return this.endOf(c3).$D;
}, m4.$locale = function() {
return D4[this.$L];
}, m4.locale = function(t5, e4) {
if (!t5) return this.$L;
var n3 = this.clone(), r3 = w4(t5, e4, true);
return r3 && (n3.$L = r3), n3;
}, m4.clone = function() {
return b3.w(this.$d, this);
}, m4.toDate = function() {
return new Date(this.valueOf());
}, m4.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, m4.toISOString = function() {
return this.$d.toISOString();
}, m4.toString = function() {
return this.$d.toUTCString();
}, M4;
})(), k2 = _3.prototype;
return O3.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c3], ["$y", h3], ["$D", d3]].forEach((function(t5) {
k2[t5[1]] = function(e4) {
return this.$g(e4, t5[0], t5[1]);
};
})), O3.extend = function(t5, e4) {
return t5.$i || (t5(e4, _3, O3), t5.$i = true), O3;
}, O3.locale = w4, O3.isDayjs = S4, O3.unix = function(t5) {
return O3(1e3 * t5);
}, O3.en = D4[g2], O3.Ls = D4, O3.p = {}, O3;
}));
}
});
// src/logger.ts
var import_dayjs, LEVELS, log, setLogLevel, format;
var init_logger = __esm({
"src/logger.ts"() {
"use strict";
import_dayjs = __toESM(require_dayjs_min(), 1);
LEVELS = {
trace: 0,
debug: 1,
info: 2,
warn: 3,
error: 4,
fatal: 5
};
log = {
trace: /* @__PURE__ */ __name((..._args) => {
}, "trace"),
debug: /* @__PURE__ */ __name((..._args) => {
}, "debug"),
info: /* @__PURE__ */ __name((..._args) => {
}, "info"),
warn: /* @__PURE__ */ __name((..._args) => {
}, "warn"),
error: /* @__PURE__ */ __name((..._args) => {
}, "error"),
fatal: /* @__PURE__ */ __name((..._args) => {
}, "fatal")
};
setLogLevel = /* @__PURE__ */ __name(function(level = "fatal") {
let numericLevel = LEVELS.fatal;
if (typeof level === "string") {
if (level.toLowerCase() in LEVELS) {
numericLevel = LEVELS[level];
}
} else if (typeof level === "number") {
numericLevel = level;
}
log.trace = () => {
};
log.debug = () => {
};
log.info = () => {
};
log.warn = () => {
};
log.error = () => {
};
log.fatal = () => {
};
if (numericLevel <= LEVELS.fatal) {
log.fatal = console.error ? console.error.bind(console, format("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", format("FATAL"));
}
if (numericLevel <= LEVELS.error) {
log.error = console.error ? console.error.bind(console, format("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", format("ERROR"));
}
if (numericLevel <= LEVELS.warn) {
log.warn = console.warn ? console.warn.bind(console, format("WARN"), "color: orange") : console.log.bind(console, `\x1B[33m`, format("WARN"));
}
if (numericLevel <= LEVELS.info) {
log.info = console.info ? console.info.bind(console, format("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", format("INFO"));
}
if (numericLevel <= LEVELS.debug) {
log.debug = console.debug ? console.debug.bind(console, format("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("DEBUG"));
}
if (numericLevel <= LEVELS.trace) {
log.trace = console.debug ? console.debug.bind(console, format("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("TRACE"));
}
}, "setLogLevel");
format = /* @__PURE__ */ __name((level) => {
const time4 = (0, import_dayjs.default)().format("ss.SSS");
return `%c${time4} : ${level} : `;
}, "format");
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/channel.js
var Channel, channel_default;
var init_channel = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/channel.js"() {
"use strict";
Channel = {
/* CLAMP */
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: /* @__PURE__ */ __name((r2) => r2 >= 255 ? 255 : r2 < 0 ? 0 : r2, "r"),
g: /* @__PURE__ */ __name((g2) => g2 >= 255 ? 255 : g2 < 0 ? 0 : g2, "g"),
b: /* @__PURE__ */ __name((b3) => b3 >= 255 ? 255 : b3 < 0 ? 0 : b3, "b"),
h: /* @__PURE__ */ __name((h3) => h3 % 360, "h"),
s: /* @__PURE__ */ __name((s2) => s2 >= 100 ? 100 : s2 < 0 ? 0 : s2, "s"),
l: /* @__PURE__ */ __name((l4) => l4 >= 100 ? 100 : l4 < 0 ? 0 : l4, "l"),
a: /* @__PURE__ */ __name((a2) => a2 >= 1 ? 1 : a2 < 0 ? 0 : a2, "a")
},
/* CONVERSION */
//SOURCE: https://planetcalc.com/7779
toLinear: /* @__PURE__ */ __name((c3) => {
const n2 = c3 / 255;
return c3 > 0.03928 ? Math.pow((n2 + 0.055) / 1.055, 2.4) : n2 / 12.92;
}, "toLinear"),
//SOURCE: https://gist.github.com/mjackson/5311256
hue2rgb: /* @__PURE__ */ __name((p3, q3, t4) => {
if (t4 < 0)
t4 += 1;
if (t4 > 1)
t4 -= 1;
if (t4 < 1 / 6)
return p3 + (q3 - p3) * 6 * t4;
if (t4 < 1 / 2)
return q3;
if (t4 < 2 / 3)
return p3 + (q3 - p3) * (2 / 3 - t4) * 6;
return p3;
}, "hue2rgb"),
hsl2rgb: /* @__PURE__ */ __name(({ h: h3, s: s2, l: l4 }, channel2) => {
if (!s2)
return l4 * 2.55;
h3 /= 360;
s2 /= 100;
l4 /= 100;
const q3 = l4 < 0.5 ? l4 * (1 + s2) : l4 + s2 - l4 * s2;
const p3 = 2 * l4 - q3;
switch (channel2) {
case "r":
return Channel.hue2rgb(p3, q3, h3 + 1 / 3) * 255;
case "g":
return Channel.hue2rgb(p3, q3, h3) * 255;
case "b":
return Channel.hue2rgb(p3, q3, h3 - 1 / 3) * 255;
}
}, "hsl2rgb"),
rgb2hsl: /* @__PURE__ */ __name(({ r: r2, g: g2, b: b3 }, channel2) => {
r2 /= 255;
g2 /= 255;
b3 /= 255;
const max10 = Math.max(r2, g2, b3);
const min9 = Math.min(r2, g2, b3);
const l4 = (max10 + min9) / 2;
if (channel2 === "l")
return l4 * 100;
if (max10 === min9)
return 0;
const d3 = max10 - min9;
const s2 = l4 > 0.5 ? d3 / (2 - max10 - min9) : d3 / (max10 + min9);
if (channel2 === "s")
return s2 * 100;
switch (max10) {
case r2:
return ((g2 - b3) / d3 + (g2 < b3 ? 6 : 0)) * 60;
case g2:
return ((b3 - r2) / d3 + 2) * 60;
case b3:
return ((r2 - g2) / d3 + 4) * 60;
default:
return -1;
}
}, "rgb2hsl")
};
channel_default = Channel;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/lang.js
var Lang, lang_default;
var init_lang = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/lang.js"() {
"use strict";
Lang = {
/* API */
clamp: /* @__PURE__ */ __name((number7, lower2, upper) => {
if (lower2 > upper)
return Math.min(lower2, Math.max(upper, number7));
return Math.min(upper, Math.max(lower2, number7));
}, "clamp"),
round: /* @__PURE__ */ __name((number7) => {
return Math.round(number7 * 1e10) / 1e10;
}, "round")
};
lang_default = Lang;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/unit.js
var Unit, unit_default;
var init_unit = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/unit.js"() {
"use strict";
Unit = {
/* API */
dec2hex: /* @__PURE__ */ __name((dec) => {
const hex2 = Math.round(dec).toString(16);
return hex2.length > 1 ? hex2 : `0${hex2}`;
}, "dec2hex")
};
unit_default = Unit;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/index.js
var Utils, utils_default;
var init_utils = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/index.js"() {
"use strict";
init_channel();
init_lang();
init_unit();
Utils = {
channel: channel_default,
lang: lang_default,
unit: unit_default
};
utils_default = Utils;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/constants.js
var DEC2HEX, TYPE;
var init_constants = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/constants.js"() {
"use strict";
init_utils();
DEC2HEX = {};
for (let i2 = 0; i2 <= 255; i2++)
DEC2HEX[i2] = utils_default.unit.dec2hex(i2);
TYPE = {
ALL: 0,
RGB: 1,
HSL: 2
};
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/type.js
var Type, type_default;
var init_type = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/type.js"() {
"use strict";
init_constants();
Type = class {
static {
__name(this, "Type");
}
constructor() {
this.type = TYPE.ALL;
}
/* API */
get() {
return this.type;
}
set(type3) {
if (this.type && this.type !== type3)
throw new Error("Cannot change both RGB and HSL channels at the same time");
this.type = type3;
}
reset() {
this.type = TYPE.ALL;
}
is(type3) {
return this.type === type3;
}
};
type_default = Type;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/index.js
var Channels, channels_default;
var init_channels = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/index.js"() {
"use strict";
init_utils();
init_type();
init_constants();
Channels = class {
static {
__name(this, "Channels");
}
/* CONSTRUCTOR */
constructor(data5, color2) {
this.color = color2;
this.changed = false;
this.data = data5;
this.type = new type_default();
}
/* API */
set(data5, color2) {
this.color = color2;
this.changed = false;
this.data = data5;
this.type.type = TYPE.ALL;
return this;
}
/* HELPERS */
_ensureHSL() {
const data5 = this.data;
const { h: h3, s: s2, l: l4 } = data5;
if (h3 === void 0)
data5.h = utils_default.channel.rgb2hsl(data5, "h");
if (s2 === void 0)
data5.s = utils_default.channel.rgb2hsl(data5, "s");
if (l4 === void 0)
data5.l = utils_default.channel.rgb2hsl(data5, "l");
}
_ensureRGB() {
const data5 = this.data;
const { r: r2, g: g2, b: b3 } = data5;
if (r2 === void 0)
data5.r = utils_default.channel.hsl2rgb(data5, "r");
if (g2 === void 0)
data5.g = utils_default.channel.hsl2rgb(data5, "g");
if (b3 === void 0)
data5.b = utils_default.channel.hsl2rgb(data5, "b");
}
/* GETTERS */
get r() {
const data5 = this.data;
const r2 = data5.r;
if (!this.type.is(TYPE.HSL) && r2 !== void 0)
return r2;
this._ensureHSL();
return utils_default.channel.hsl2rgb(data5, "r");
}
get g() {
const data5 = this.data;
const g2 = data5.g;
if (!this.type.is(TYPE.HSL) && g2 !== void 0)
return g2;
this._ensureHSL();
return utils_default.channel.hsl2rgb(data5, "g");
}
get b() {
const data5 = this.data;
const b3 = data5.b;
if (!this.type.is(TYPE.HSL) && b3 !== void 0)
return b3;
this._ensureHSL();
return utils_default.channel.hsl2rgb(data5, "b");
}
get h() {
const data5 = this.data;
const h3 = data5.h;
if (!this.type.is(TYPE.RGB) && h3 !== void 0)
return h3;
this._ensureRGB();
return utils_default.channel.rgb2hsl(data5, "h");
}
get s() {
const data5 = this.data;
const s2 = data5.s;
if (!this.type.is(TYPE.RGB) && s2 !== void 0)
return s2;
this._ensureRGB();
return utils_default.channel.rgb2hsl(data5, "s");
}
get l() {
const data5 = this.data;
const l4 = data5.l;
if (!this.type.is(TYPE.RGB) && l4 !== void 0)
return l4;
this._ensureRGB();
return utils_default.channel.rgb2hsl(data5, "l");
}
get a() {
return this.data.a;
}
/* SETTERS */
set r(r2) {
this.type.set(TYPE.RGB);
this.changed = true;
this.data.r = r2;
}
set g(g2) {
this.type.set(TYPE.RGB);
this.changed = true;
this.data.g = g2;
}
set b(b3) {
this.type.set(TYPE.RGB);
this.changed = true;
this.data.b = b3;
}
set h(h3) {
this.type.set(TYPE.HSL);
this.changed = true;
this.data.h = h3;
}
set s(s2) {
this.type.set(TYPE.HSL);
this.changed = true;
this.data.s = s2;
}
set l(l4) {
this.type.set(TYPE.HSL);
this.changed = true;
this.data.l = l4;
}
set a(a2) {
this.changed = true;
this.data.a = a2;
}
};
channels_default = Channels;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/reusable.js
var channels, reusable_default;
var init_reusable = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/reusable.js"() {
"use strict";
init_channels();
channels = new channels_default({ r: 0, g: 0, b: 0, a: 0 }, "transparent");
reusable_default = channels;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/hex.js
var Hex, hex_default;
var init_hex = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/hex.js"() {
"use strict";
init_reusable();
init_constants();
Hex = {
/* VARIABLES */
re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,
/* API */
parse: /* @__PURE__ */ __name((color2) => {
if (color2.charCodeAt(0) !== 35)
return;
const match2 = color2.match(Hex.re);
if (!match2)
return;
const hex2 = match2[1];
const dec = parseInt(hex2, 16);
const length2 = hex2.length;
const hasAlpha = length2 % 4 === 0;
const isFullLength = length2 > 4;
const multiplier = isFullLength ? 1 : 17;
const bits = isFullLength ? 8 : 4;
const bitsOffset = hasAlpha ? 0 : -1;
const mask = isFullLength ? 255 : 15;
return reusable_default.set({
r: (dec >> bits * (bitsOffset + 3) & mask) * multiplier,
g: (dec >> bits * (bitsOffset + 2) & mask) * multiplier,
b: (dec >> bits * (bitsOffset + 1) & mask) * multiplier,
a: hasAlpha ? (dec & mask) * multiplier / 255 : 1
}, color2);
}, "parse"),
stringify: /* @__PURE__ */ __name((channels2) => {
const { r: r2, g: g2, b: b3, a: a2 } = channels2;
if (a2 < 1) {
return `#${DEC2HEX[Math.round(r2)]}${DEC2HEX[Math.round(g2)]}${DEC2HEX[Math.round(b3)]}${DEC2HEX[Math.round(a2 * 255)]}`;
} else {
return `#${DEC2HEX[Math.round(r2)]}${DEC2HEX[Math.round(g2)]}${DEC2HEX[Math.round(b3)]}`;
}
}, "stringify")
};
hex_default = Hex;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/hsl.js
var HSL, hsl_default;
var init_hsl = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/hsl.js"() {
"use strict";
init_utils();
init_reusable();
HSL = {
/* VARIABLES */
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,
/* HELPERS */
_hue2deg: /* @__PURE__ */ __name((hue2) => {
const match2 = hue2.match(HSL.hueRe);
if (match2) {
const [, number7, unit2] = match2;
switch (unit2) {
case "grad":
return utils_default.channel.clamp.h(parseFloat(number7) * 0.9);
case "rad":
return utils_default.channel.clamp.h(parseFloat(number7) * 180 / Math.PI);
case "turn":
return utils_default.channel.clamp.h(parseFloat(number7) * 360);
}
}
return utils_default.channel.clamp.h(parseFloat(hue2));
}, "_hue2deg"),
/* API */
parse: /* @__PURE__ */ __name((color2) => {
const charCode = color2.charCodeAt(0);
if (charCode !== 104 && charCode !== 72)
return;
const match2 = color2.match(HSL.re);
if (!match2)
return;
const [, h3, s2, l4, a2, isAlphaPercentage] = match2;
return reusable_default.set({
h: HSL._hue2deg(h3),
s: utils_default.channel.clamp.s(parseFloat(s2)),
l: utils_default.channel.clamp.l(parseFloat(l4)),
a: a2 ? utils_default.channel.clamp.a(isAlphaPercentage ? parseFloat(a2) / 100 : parseFloat(a2)) : 1
}, color2);
}, "parse"),
stringify: /* @__PURE__ */ __name((channels2) => {
const { h: h3, s: s2, l: l4, a: a2 } = channels2;
if (a2 < 1) {
return `hsla(${utils_default.lang.round(h3)}, ${utils_default.lang.round(s2)}%, ${utils_default.lang.round(l4)}%, ${a2})`;
} else {
return `hsl(${utils_default.lang.round(h3)}, ${utils_default.lang.round(s2)}%, ${utils_default.lang.round(l4)}%)`;
}
}, "stringify")
};
hsl_default = HSL;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/keyword.js
var Keyword, keyword_default;
var init_keyword = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/keyword.js"() {
"use strict";
init_hex();
Keyword = {
/* VARIABLES */
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"
},
/* API */
parse: /* @__PURE__ */ __name((color2) => {
color2 = color2.toLowerCase();
const hex2 = Keyword.colors[color2];
if (!hex2)
return;
return hex_default.parse(hex2);
}, "parse"),
stringify: /* @__PURE__ */ __name((channels2) => {
const hex2 = hex_default.stringify(channels2);
for (const name in Keyword.colors) {
if (Keyword.colors[name] === hex2)
return name;
}
return;
}, "stringify")
};
keyword_default = Keyword;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/rgb.js
var RGB, rgb_default;
var init_rgb = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/rgb.js"() {
"use strict";
init_utils();
init_reusable();
RGB = {
/* VARIABLES */
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,
/* API */
parse: /* @__PURE__ */ __name((color2) => {
const charCode = color2.charCodeAt(0);
if (charCode !== 114 && charCode !== 82)
return;
const match2 = color2.match(RGB.re);
if (!match2)
return;
const [, r2, isRedPercentage, g2, isGreenPercentage, b3, isBluePercentage, a2, isAlphaPercentage] = match2;
return reusable_default.set({
r: utils_default.channel.clamp.r(isRedPercentage ? parseFloat(r2) * 2.55 : parseFloat(r2)),
g: utils_default.channel.clamp.g(isGreenPercentage ? parseFloat(g2) * 2.55 : parseFloat(g2)),
b: utils_default.channel.clamp.b(isBluePercentage ? parseFloat(b3) * 2.55 : parseFloat(b3)),
a: a2 ? utils_default.channel.clamp.a(isAlphaPercentage ? parseFloat(a2) / 100 : parseFloat(a2)) : 1
}, color2);
}, "parse"),
stringify: /* @__PURE__ */ __name((channels2) => {
const { r: r2, g: g2, b: b3, a: a2 } = channels2;
if (a2 < 1) {
return `rgba(${utils_default.lang.round(r2)}, ${utils_default.lang.round(g2)}, ${utils_default.lang.round(b3)}, ${utils_default.lang.round(a2)})`;
} else {
return `rgb(${utils_default.lang.round(r2)}, ${utils_default.lang.round(g2)}, ${utils_default.lang.round(b3)})`;
}
}, "stringify")
};
rgb_default = RGB;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/index.js
var Color, color_default;
var init_color = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/index.js"() {
"use strict";
init_hex();
init_hsl();
init_keyword();
init_rgb();
init_constants();
Color = {
/* VARIABLES */
format: {
keyword: keyword_default,
hex: hex_default,
rgb: rgb_default,
rgba: rgb_default,
hsl: hsl_default,
hsla: hsl_default
},
/* API */
parse: /* @__PURE__ */ __name((color2) => {
if (typeof color2 !== "string")
return color2;
const channels2 = hex_default.parse(color2) || rgb_default.parse(color2) || hsl_default.parse(color2) || keyword_default.parse(color2);
if (channels2)
return channels2;
throw new Error(`Unsupported color format: "${color2}"`);
}, "parse"),
stringify: /* @__PURE__ */ __name((channels2) => {
if (!channels2.changed && channels2.color)
return channels2.color;
if (channels2.type.is(TYPE.HSL) || channels2.data.r === void 0) {
return hsl_default.stringify(channels2);
} else if (channels2.a < 1 || !Number.isInteger(channels2.r) || !Number.isInteger(channels2.g) || !Number.isInteger(channels2.b)) {
return rgb_default.stringify(channels2);
} else {
return hex_default.stringify(channels2);
}
}, "stringify")
};
color_default = Color;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/change.js
var change, change_default;
var init_change = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/change.js"() {
"use strict";
init_utils();
init_color();
change = /* @__PURE__ */ __name((color2, channels2) => {
const ch = color_default.parse(color2);
for (const c3 in channels2) {
ch[c3] = utils_default.channel.clamp[c3](channels2[c3]);
}
return color_default.stringify(ch);
}, "change");
change_default = change;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/rgba.js
var rgba, rgba_default;
var init_rgba = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/rgba.js"() {
"use strict";
init_utils();
init_reusable();
init_color();
init_change();
rgba = /* @__PURE__ */ __name((r2, g2, b3 = 0, a2 = 1) => {
if (typeof r2 !== "number")
return change_default(r2, { a: g2 });
const channels2 = reusable_default.set({
r: utils_default.channel.clamp.r(r2),
g: utils_default.channel.clamp.g(g2),
b: utils_default.channel.clamp.b(b3),
a: utils_default.channel.clamp.a(a2)
});
return color_default.stringify(channels2);
}, "rgba");
rgba_default = rgba;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/channel.js
var channel, channel_default2;
var init_channel2 = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/channel.js"() {
"use strict";
init_utils();
init_color();
channel = /* @__PURE__ */ __name((color2, channel2) => {
return utils_default.lang.round(color_default.parse(color2)[channel2]);
}, "channel");
channel_default2 = channel;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/luminance.js
var luminance, luminance_default;
var init_luminance = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/luminance.js"() {
"use strict";
init_utils();
init_color();
luminance = /* @__PURE__ */ __name((color2) => {
const { r: r2, g: g2, b: b3 } = color_default.parse(color2);
const luminance2 = 0.2126 * utils_default.channel.toLinear(r2) + 0.7152 * utils_default.channel.toLinear(g2) + 0.0722 * utils_default.channel.toLinear(b3);
return utils_default.lang.round(luminance2);
}, "luminance");
luminance_default = luminance;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/is_light.js
var isLight, is_light_default;
var init_is_light = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/is_light.js"() {
"use strict";
init_luminance();
isLight = /* @__PURE__ */ __name((color2) => {
return luminance_default(color2) >= 0.5;
}, "isLight");
is_light_default = isLight;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/is_dark.js
var isDark, is_dark_default;
var init_is_dark = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/is_dark.js"() {
"use strict";
init_is_light();
isDark = /* @__PURE__ */ __name((color2) => {
return !is_light_default(color2);
}, "isDark");
is_dark_default = isDark;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/adjust_channel.js
var adjustChannel, adjust_channel_default;
var init_adjust_channel = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/adjust_channel.js"() {
"use strict";
init_utils();
init_color();
adjustChannel = /* @__PURE__ */ __name((color2, channel2, amount) => {
const channels2 = color_default.parse(color2);
const amountCurrent = channels2[channel2];
const amountNext = utils_default.channel.clamp[channel2](amountCurrent + amount);
if (amountCurrent !== amountNext)
channels2[channel2] = amountNext;
return color_default.stringify(channels2);
}, "adjustChannel");
adjust_channel_default = adjustChannel;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/lighten.js
var lighten, lighten_default;
var init_lighten = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/lighten.js"() {
"use strict";
init_adjust_channel();
lighten = /* @__PURE__ */ __name((color2, amount) => {
return adjust_channel_default(color2, "l", amount);
}, "lighten");
lighten_default = lighten;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/darken.js
var darken, darken_default;
var init_darken = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/darken.js"() {
"use strict";
init_adjust_channel();
darken = /* @__PURE__ */ __name((color2, amount) => {
return adjust_channel_default(color2, "l", -amount);
}, "darken");
darken_default = darken;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/adjust.js
var adjust, adjust_default;
var init_adjust = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/adjust.js"() {
"use strict";
init_color();
init_change();
adjust = /* @__PURE__ */ __name((color2, channels2) => {
const ch = color_default.parse(color2);
const changes = {};
for (const c3 in channels2) {
if (!channels2[c3])
continue;
changes[c3] = ch[c3] + channels2[c3];
}
return change_default(color2, changes);
}, "adjust");
adjust_default = adjust;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/mix.js
var mix, mix_default;
var init_mix = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/mix.js"() {
"use strict";
init_color();
init_rgba();
mix = /* @__PURE__ */ __name((color1, color2, weight8 = 50) => {
const { r: r1, g: g1, b: b1, a: a1 } = color_default.parse(color1);
const { r: r2, g: g2, b: b22, a: a2 } = color_default.parse(color2);
const weightScale = weight8 / 100;
const weightNormalized = weightScale * 2 - 1;
const alphaDelta = a1 - a2;
const weight1combined = weightNormalized * alphaDelta === -1 ? weightNormalized : (weightNormalized + alphaDelta) / (1 + weightNormalized * alphaDelta);
const weight1 = (weight1combined + 1) / 2;
const weight22 = 1 - weight1;
const r3 = r1 * weight1 + r2 * weight22;
const g3 = g1 * weight1 + g2 * weight22;
const b3 = b1 * weight1 + b22 * weight22;
const a3 = a1 * weightScale + a2 * (1 - weightScale);
return rgba_default(r3, g3, b3, a3);
}, "mix");
mix_default = mix;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/invert.js
var invert, invert_default;
var init_invert = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/invert.js"() {
"use strict";
init_color();
init_mix();
invert = /* @__PURE__ */ __name((color2, weight8 = 100) => {
const inverse = color_default.parse(color2);
inverse.r = 255 - inverse.r;
inverse.g = 255 - inverse.g;
inverse.b = 255 - inverse.b;
return mix_default(inverse, color2, weight8);
}, "invert");
invert_default = invert;
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/index.js
var init_methods = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/index.js"() {
"use strict";
init_rgba();
init_channel2();
init_is_dark();
init_lighten();
init_darken();
init_adjust();
init_invert();
}
});
// ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/index.js
var init_dist = __esm({
"../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/index.js"() {
"use strict";
init_methods();
}
});
// src/themes/erDiagram-oldHardcodedValues.ts
var oldAttributeBackgroundColorOdd, oldAttributeBackgroundColorEven;
var init_erDiagram_oldHardcodedValues = __esm({
"src/themes/erDiagram-oldHardcodedValues.ts"() {
"use strict";
oldAttributeBackgroundColorOdd = "#ffffff";
oldAttributeBackgroundColorEven = "#f2f2f2";
}
});
// src/themes/theme-helpers.js
var mkBorder;
var init_theme_helpers = __esm({
"src/themes/theme-helpers.js"() {
"use strict";
init_dist();
mkBorder = /* @__PURE__ */ __name((col, darkMode) => darkMode ? adjust_default(col, { s: -40, l: 10 }) : adjust_default(col, { s: -40, l: -10 }), "mkBorder");
}
});
// src/themes/theme-base.js
var Theme, getThemeVariables;
var init_theme_base = __esm({
"src/themes/theme-base.js"() {
"use strict";
init_dist();
init_erDiagram_oldHardcodedValues();
init_theme_helpers();
Theme = class {
static {
__name(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() {
this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333");
this.secondaryColor = this.secondaryColor || adjust_default(this.primaryColor, { h: -120 });
this.tertiaryColor = this.tertiaryColor || adjust_default(this.primaryColor, { h: 180, l: 5 });
this.primaryBorderColor = this.primaryBorderColor || mkBorder(this.primaryColor, this.darkMode);
this.secondaryBorderColor = this.secondaryBorderColor || mkBorder(this.secondaryColor, this.darkMode);
this.tertiaryBorderColor = this.tertiaryBorderColor || mkBorder(this.tertiaryColor, this.darkMode);
this.noteBorderColor = this.noteBorderColor || mkBorder(this.noteBkgColor, this.darkMode);
this.noteBkgColor = this.noteBkgColor || "#fff5ad";
this.noteTextColor = this.noteTextColor || "#333";
this.secondaryTextColor = this.secondaryTextColor || invert_default(this.secondaryColor);
this.tertiaryTextColor = this.tertiaryTextColor || invert_default(this.tertiaryColor);
this.lineColor = this.lineColor || invert_default(this.background);
this.arrowheadColor = this.arrowheadColor || invert_default(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 ? darken_default(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 || darken_default(this.secondaryColor, 10);
this.activationBkgColor = this.activationBkgColor || this.secondaryColor;
this.sequenceNumberColor = this.sequenceNumberColor || invert_default(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 || lighten_default(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.vertLineColor = this.vertLineColor || "navy";
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;
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;
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 || adjust_default(this.primaryColor, { h: 30 });
this.cScale4 = this.cScale4 || adjust_default(this.primaryColor, { h: 60 });
this.cScale5 = this.cScale5 || adjust_default(this.primaryColor, { h: 90 });
this.cScale6 = this.cScale6 || adjust_default(this.primaryColor, { h: 120 });
this.cScale7 = this.cScale7 || adjust_default(this.primaryColor, { h: 150 });
this.cScale8 = this.cScale8 || adjust_default(this.primaryColor, { h: 210, l: 150 });
this.cScale9 = this.cScale9 || adjust_default(this.primaryColor, { h: 270 });
this.cScale10 = this.cScale10 || adjust_default(this.primaryColor, { h: 300 });
this.cScale11 = this.cScale11 || adjust_default(this.primaryColor, { h: 330 });
if (this.darkMode) {
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScale" + i2] = darken_default(this["cScale" + i2], 75);
}
} else {
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScale" + i2] = darken_default(this["cScale" + i2], 25);
}
}
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert_default(this["cScale" + i2]);
}
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
if (this.darkMode) {
this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten_default(this["cScale" + i2], 10);
} else {
this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken_default(this["cScale" + i2], 10);
}
}
this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor;
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor;
}
const multiplier = this.darkMode ? -4 : -1;
for (let i2 = 0; i2 < 5; i2++) {
this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { h: 180, s: -15, l: multiplier * (5 + i2 * 3) });
this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { h: 180, s: -15, l: multiplier * (8 + i2 * 3) });
}
this.classText = this.classText || this.textColor;
this.fillType0 = this.fillType0 || this.primaryColor;
this.fillType1 = this.fillType1 || this.secondaryColor;
this.fillType2 = this.fillType2 || adjust_default(this.primaryColor, { h: 64 });
this.fillType3 = this.fillType3 || adjust_default(this.secondaryColor, { h: 64 });
this.fillType4 = this.fillType4 || adjust_default(this.primaryColor, { h: -64 });
this.fillType5 = this.fillType5 || adjust_default(this.secondaryColor, { h: -64 });
this.fillType6 = this.fillType6 || adjust_default(this.primaryColor, { h: 128 });
this.fillType7 = this.fillType7 || adjust_default(this.secondaryColor, { h: 128 });
this.pie1 = this.pie1 || this.primaryColor;
this.pie2 = this.pie2 || this.secondaryColor;
this.pie3 = this.pie3 || this.tertiaryColor;
this.pie4 = this.pie4 || adjust_default(this.primaryColor, { l: -10 });
this.pie5 = this.pie5 || adjust_default(this.secondaryColor, { l: -10 });
this.pie6 = this.pie6 || adjust_default(this.tertiaryColor, { l: -10 });
this.pie7 = this.pie7 || adjust_default(this.primaryColor, { h: 60, l: -10 });
this.pie8 = this.pie8 || adjust_default(this.primaryColor, { h: -60, l: -10 });
this.pie9 = this.pie9 || adjust_default(this.primaryColor, { h: 120, l: 0 });
this.pie10 = this.pie10 || adjust_default(this.primaryColor, { h: 60, l: -20 });
this.pie11 = this.pie11 || adjust_default(this.primaryColor, { h: -60, l: -20 });
this.pie12 = this.pie12 || adjust_default(this.primaryColor, { h: 120, l: -10 });
this.pieTitleTextSize = this.pieTitleTextSize || "25px";
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
this.pieSectionTextSize = this.pieSectionTextSize || "17px";
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
this.pieLegendTextSize = this.pieLegendTextSize || "17px";
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
this.pieStrokeColor = this.pieStrokeColor || "black";
this.pieStrokeWidth = this.pieStrokeWidth || "2px";
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";
this.archGroupBorderColor = this.archGroupBorderColor || "#000";
this.archGroupBorderWidth = this.archGroupBorderWidth || "2px";
this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 });
this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 });
this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 });
this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 });
this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 });
this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 });
this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill);
this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
this.xyChart = {
backgroundColor: this.xyChart?.backgroundColor || this.background,
titleColor: this.xyChart?.titleColor || this.primaryTextColor,
xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
plotColorPalette: this.xyChart?.plotColorPalette || "#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"
};
this.requirementBackground = this.requirementBackground || this.primaryColor;
this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
this.requirementBorderSize = this.requirementBorderSize || "1";
this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
this.relationColor = this.relationColor || this.lineColor;
this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken_default(this.secondaryColor, 30) : this.secondaryColor);
this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
this.git0 = this.git0 || this.primaryColor;
this.git1 = this.git1 || this.secondaryColor;
this.git2 = this.git2 || this.tertiaryColor;
this.git3 = this.git3 || adjust_default(this.primaryColor, { h: -30 });
this.git4 = this.git4 || adjust_default(this.primaryColor, { h: -60 });
this.git5 = this.git5 || adjust_default(this.primaryColor, { h: -90 });
this.git6 = this.git6 || adjust_default(this.primaryColor, { h: 60 });
this.git7 = this.git7 || adjust_default(this.primaryColor, { h: 120 });
if (this.darkMode) {
this.git0 = lighten_default(this.git0, 25);
this.git1 = lighten_default(this.git1, 25);
this.git2 = lighten_default(this.git2, 25);
this.git3 = lighten_default(this.git3, 25);
this.git4 = lighten_default(this.git4, 25);
this.git5 = lighten_default(this.git5, 25);
this.git6 = lighten_default(this.git6, 25);
this.git7 = lighten_default(this.git7, 25);
} else {
this.git0 = darken_default(this.git0, 25);
this.git1 = darken_default(this.git1, 25);
this.git2 = darken_default(this.git2, 25);
this.git3 = darken_default(this.git3, 25);
this.git4 = darken_default(this.git4, 25);
this.git5 = darken_default(this.git5, 25);
this.git6 = darken_default(this.git6, 25);
this.git7 = darken_default(this.git7, 25);
}
this.gitInv0 = this.gitInv0 || invert_default(this.git0);
this.gitInv1 = this.gitInv1 || invert_default(this.git1);
this.gitInv2 = this.gitInv2 || invert_default(this.git2);
this.gitInv3 = this.gitInv3 || invert_default(this.git3);
this.gitInv4 = this.gitInv4 || invert_default(this.git4);
this.gitInv5 = this.gitInv5 || invert_default(this.git5);
this.gitInv6 = this.gitInv6 || invert_default(this.git6);
this.gitInv7 = this.gitInv7 || invert_default(this.git7);
this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor);
this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;
this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor;
this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor;
this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor;
this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor;
this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor;
this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor;
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
this.tagLabelFontSize = this.tagLabelFontSize || "10px";
this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
this.commitLabelFontSize = this.commitLabelFontSize || "10px";
this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
}
calculate(overrides) {
if (typeof overrides !== "object") {
this.updateColors();
return;
}
const keys2 = Object.keys(overrides);
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
this.updateColors();
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
}
};
getThemeVariables = /* @__PURE__ */ __name((userOverrides) => {
const theme = new Theme();
theme.calculate(userOverrides);
return theme;
}, "getThemeVariables");
}
});
// src/themes/theme-dark.js
var Theme2, getThemeVariables2;
var init_theme_dark = __esm({
"src/themes/theme-dark.js"() {
"use strict";
init_dist();
init_theme_helpers();
Theme2 = class {
static {
__name(this, "Theme");
}
constructor() {
this.background = "#333";
this.primaryColor = "#1f2020";
this.secondaryColor = lighten_default(this.primaryColor, 16);
this.tertiaryColor = adjust_default(this.primaryColor, { h: -160 });
this.primaryBorderColor = invert_default(this.background);
this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
this.primaryTextColor = invert_default(this.primaryColor);
this.secondaryTextColor = invert_default(this.secondaryColor);
this.tertiaryTextColor = invert_default(this.tertiaryColor);
this.lineColor = invert_default(this.background);
this.textColor = invert_default(this.background);
this.mainBkg = "#1f2020";
this.secondBkg = "calculated";
this.mainContrastColor = "lightgrey";
this.darkTextColor = lighten_default(invert_default("#323D47"), 10);
this.lineColor = "calculated";
this.border1 = "#ccc";
this.border2 = rgba_default(255, 255, 255, 0.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 = darken_default("#EAE8D9", 30);
this.altSectionBkgColor = "calculated";
this.sectionBkgColor2 = "#EAE8D9";
this.excludeBkgColor = darken_default(this.sectionBkgColor, 10);
this.taskBorderColor = rgba_default(255, 255, 255, 70);
this.taskBkgColor = "calculated";
this.taskTextColor = "calculated";
this.taskTextLightColor = "calculated";
this.taskTextOutsideColor = "calculated";
this.taskTextClickableColor = "#003163";
this.activeTaskBorderColor = rgba_default(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.vertLineColor = "#00BFFF";
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 || lighten_default(this.mainBkg, 5) || "#ffffff";
this.rowEven = this.rowEven || darken_default(this.mainBkg, 10);
this.labelColor = "calculated";
this.errorBkgColor = "#a44141";
this.errorTextColor = "#ddd";
}
updateColors() {
this.secondBkg = lighten_default(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 = lighten_default(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 = lighten_default(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 = adjust_default(this.primaryColor, { h: 64 });
this.fillType3 = adjust_default(this.secondaryColor, { h: 64 });
this.fillType4 = adjust_default(this.primaryColor, { h: -64 });
this.fillType5 = adjust_default(this.secondaryColor, { h: -64 });
this.fillType6 = adjust_default(this.primaryColor, { h: 128 });
this.fillType7 = adjust_default(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 || adjust_default(this.primaryColor, { h: 30 });
this.cScale4 = this.cScale4 || adjust_default(this.primaryColor, { h: 60 });
this.cScale5 = this.cScale5 || adjust_default(this.primaryColor, { h: 90 });
this.cScale6 = this.cScale6 || adjust_default(this.primaryColor, { h: 120 });
this.cScale7 = this.cScale7 || adjust_default(this.primaryColor, { h: 150 });
this.cScale8 = this.cScale8 || adjust_default(this.primaryColor, { h: 210 });
this.cScale9 = this.cScale9 || adjust_default(this.primaryColor, { h: 270 });
this.cScale10 = this.cScale10 || adjust_default(this.primaryColor, { h: 300 });
this.cScale11 = this.cScale11 || adjust_default(this.primaryColor, { h: 330 });
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert_default(this["cScale" + i2]);
}
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten_default(this["cScale" + i2], 10);
}
for (let i2 = 0; i2 < 5; i2++) {
this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { h: 30, s: -30, l: -(-10 + i2 * 4) });
this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { h: 30, s: -30, l: -(-7 + i2 * 4) });
}
this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor;
}
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["pie" + i2] = this["cScale" + i2];
}
this.pieTitleTextSize = this.pieTitleTextSize || "25px";
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
this.pieSectionTextSize = this.pieSectionTextSize || "17px";
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
this.pieLegendTextSize = this.pieLegendTextSize || "17px";
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
this.pieStrokeColor = this.pieStrokeColor || "black";
this.pieStrokeWidth = this.pieStrokeWidth || "2px";
this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
this.pieOpacity = this.pieOpacity || "0.7";
this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 });
this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 });
this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 });
this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 });
this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 });
this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 });
this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill);
this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
this.xyChart = {
backgroundColor: this.xyChart?.backgroundColor || this.background,
titleColor: this.xyChart?.titleColor || this.primaryTextColor,
xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
plotColorPalette: this.xyChart?.plotColorPalette || "#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"
};
this.packet = {
startByteColor: this.primaryTextColor,
endByteColor: this.primaryTextColor,
labelColor: this.primaryTextColor,
titleColor: this.primaryTextColor,
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;
this.requirementBorderSize = this.requirementBorderSize || "1";
this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
this.relationColor = this.relationColor || this.lineColor;
this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken_default(this.secondaryColor, 30) : this.secondaryColor);
this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
this.git0 = lighten_default(this.secondaryColor, 20);
this.git1 = lighten_default(this.pie2 || this.secondaryColor, 20);
this.git2 = lighten_default(this.pie3 || this.tertiaryColor, 20);
this.git3 = lighten_default(this.pie4 || adjust_default(this.primaryColor, { h: -30 }), 20);
this.git4 = lighten_default(this.pie5 || adjust_default(this.primaryColor, { h: -60 }), 20);
this.git5 = lighten_default(this.pie6 || adjust_default(this.primaryColor, { h: -90 }), 10);
this.git6 = lighten_default(this.pie7 || adjust_default(this.primaryColor, { h: 60 }), 10);
this.git7 = lighten_default(this.pie8 || adjust_default(this.primaryColor, { h: 120 }), 20);
this.gitInv0 = this.gitInv0 || invert_default(this.git0);
this.gitInv1 = this.gitInv1 || invert_default(this.git1);
this.gitInv2 = this.gitInv2 || invert_default(this.git2);
this.gitInv3 = this.gitInv3 || invert_default(this.git3);
this.gitInv4 = this.gitInv4 || invert_default(this.git4);
this.gitInv5 = this.gitInv5 || invert_default(this.git5);
this.gitInv6 = this.gitInv6 || invert_default(this.git6);
this.gitInv7 = this.gitInv7 || invert_default(this.git7);
this.gitBranchLabel0 = this.gitBranchLabel0 || invert_default(this.labelTextColor);
this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
this.gitBranchLabel3 = this.gitBranchLabel3 || invert_default(this.labelTextColor);
this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
this.tagLabelFontSize = this.tagLabelFontSize || "10px";
this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
this.commitLabelFontSize = this.commitLabelFontSize || "10px";
this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || lighten_default(this.background, 12);
this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || lighten_default(this.background, 2);
this.nodeBorder = this.nodeBorder || "#999";
}
calculate(overrides) {
if (typeof overrides !== "object") {
this.updateColors();
return;
}
const keys2 = Object.keys(overrides);
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
this.updateColors();
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
}
};
getThemeVariables2 = /* @__PURE__ */ __name((userOverrides) => {
const theme = new Theme2();
theme.calculate(userOverrides);
return theme;
}, "getThemeVariables");
}
});
// src/themes/theme-default.js
var Theme3, getThemeVariables3;
var init_theme_default = __esm({
"src/themes/theme-default.js"() {
"use strict";
init_dist();
init_theme_helpers();
init_erDiagram_oldHardcodedValues();
Theme3 = class {
static {
__name(this, "Theme");
}
constructor() {
this.background = "#f4f4f4";
this.primaryColor = "#ECECFF";
this.secondaryColor = adjust_default(this.primaryColor, { h: 120 });
this.secondaryColor = "#ffffde";
this.tertiaryColor = adjust_default(this.primaryColor, { h: -160 });
this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
this.primaryTextColor = invert_default(this.primaryColor);
this.secondaryTextColor = invert_default(this.secondaryColor);
this.tertiaryTextColor = invert_default(this.tertiaryColor);
this.lineColor = invert_default(this.background);
this.textColor = invert_default(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.vertLineColor = "calculated";
this.sectionBkgColor = rgba_default(102, 102, 255, 0.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.vertLineColor = "navy";
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 || adjust_default(this.primaryColor, { h: 30 });
this.cScale4 = this.cScale4 || adjust_default(this.primaryColor, { h: 60 });
this.cScale5 = this.cScale5 || adjust_default(this.primaryColor, { h: 90 });
this.cScale6 = this.cScale6 || adjust_default(this.primaryColor, { h: 120 });
this.cScale7 = this.cScale7 || adjust_default(this.primaryColor, { h: 150 });
this.cScale8 = this.cScale8 || adjust_default(this.primaryColor, { h: 210 });
this.cScale9 = this.cScale9 || adjust_default(this.primaryColor, { h: 270 });
this.cScale10 = this.cScale10 || adjust_default(this.primaryColor, { h: 300 });
this.cScale11 = this.cScale11 || adjust_default(this.primaryColor, { h: 330 });
this["cScalePeer1"] = this["cScalePeer1"] || darken_default(this.secondaryColor, 45);
this["cScalePeer2"] = this["cScalePeer2"] || darken_default(this.tertiaryColor, 40);
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScale" + i2] = darken_default(this["cScale" + i2], 10);
this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken_default(this["cScale" + i2], 25);
}
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleInv" + i2] = this["cScaleInv" + i2] || adjust_default(this["cScale" + i2], { h: 180 });
}
for (let i2 = 0; i2 < 5; i2++) {
this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { h: 30, l: -(5 + i2 * 5) });
this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { h: 30, l: -(7 + i2 * 5) });
}
this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
if (this.labelTextColor !== "calculated") {
this.cScaleLabel0 = this.cScaleLabel0 || invert_default(this.labelTextColor);
this.cScaleLabel3 = this.cScaleLabel3 || invert_default(this.labelTextColor);
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.labelTextColor;
}
}
this.nodeBkg = this.mainBkg;
this.nodeBorder = this.border1;
this.clusterBkg = this.secondBkg;
this.clusterBorder = this.border2;
this.defaultLinkColor = this.lineColor;
this.titleColor = this.textColor;
this.edgeLabelBackground = this.labelBackground;
this.actorBorder = lighten_default(this.border1, 23);
this.actorBkg = this.mainBkg;
this.labelBoxBkgColor = this.actorBkg;
this.signalColor = this.textColor;
this.signalTextColor = this.textColor;
this.labelBoxBorderColor = this.actorBorder;
this.labelTextColor = this.actorTextColor;
this.loopTextColor = this.actorTextColor;
this.noteBorderColor = this.border2;
this.noteTextColor = this.actorTextColor;
this.actorLineColor = this.actorBorder;
this.taskTextColor = this.taskTextLightColor;
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;
this.stateBkg = this.stateBkg || this.mainBkg;
this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
this.altBackground = this.altBackground || "#f0f0f0";
this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
this.compositeBorder = this.compositeBorder || this.nodeBorder;
this.innerEndBackground = this.nodeBorder;
this.specialStateColor = this.lineColor;
this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
this.transitionColor = this.transitionColor || this.lineColor;
this.classText = this.primaryTextColor;
this.fillType0 = this.primaryColor;
this.fillType1 = this.secondaryColor;
this.fillType2 = adjust_default(this.primaryColor, { h: 64 });
this.fillType3 = adjust_default(this.secondaryColor, { h: 64 });
this.fillType4 = adjust_default(this.primaryColor, { h: -64 });
this.fillType5 = adjust_default(this.secondaryColor, { h: -64 });
this.fillType6 = adjust_default(this.primaryColor, { h: 128 });
this.fillType7 = adjust_default(this.secondaryColor, { h: 128 });
this.pie1 = this.pie1 || this.primaryColor;
this.pie2 = this.pie2 || this.secondaryColor;
this.pie3 = this.pie3 || adjust_default(this.tertiaryColor, { l: -40 });
this.pie4 = this.pie4 || adjust_default(this.primaryColor, { l: -10 });
this.pie5 = this.pie5 || adjust_default(this.secondaryColor, { l: -30 });
this.pie6 = this.pie6 || adjust_default(this.tertiaryColor, { l: -20 });
this.pie7 = this.pie7 || adjust_default(this.primaryColor, { h: 60, l: -20 });
this.pie8 = this.pie8 || adjust_default(this.primaryColor, { h: -60, l: -40 });
this.pie9 = this.pie9 || adjust_default(this.primaryColor, { h: 120, l: -40 });
this.pie10 = this.pie10 || adjust_default(this.primaryColor, { h: 60, l: -40 });
this.pie11 = this.pie11 || adjust_default(this.primaryColor, { h: -90, l: -40 });
this.pie12 = this.pie12 || adjust_default(this.primaryColor, { h: 120, l: -30 });
this.pieTitleTextSize = this.pieTitleTextSize || "25px";
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
this.pieSectionTextSize = this.pieSectionTextSize || "17px";
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
this.pieLegendTextSize = this.pieLegendTextSize || "17px";
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
this.pieStrokeColor = this.pieStrokeColor || "black";
this.pieStrokeWidth = this.pieStrokeWidth || "2px";
this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
this.pieOpacity = this.pieOpacity || "0.7";
this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 });
this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 });
this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 });
this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 });
this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 });
this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 });
this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill);
this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
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,
xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
plotColorPalette: this.xyChart?.plotColorPalette || "#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"
};
this.requirementBackground = this.requirementBackground || this.primaryColor;
this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
this.requirementBorderSize = this.requirementBorderSize || "1";
this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
this.relationColor = this.relationColor || this.lineColor;
this.relationLabelBackground = this.relationLabelBackground || this.labelBackground;
this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
this.git0 = this.git0 || this.primaryColor;
this.git1 = this.git1 || this.secondaryColor;
this.git2 = this.git2 || this.tertiaryColor;
this.git3 = this.git3 || adjust_default(this.primaryColor, { h: -30 });
this.git4 = this.git4 || adjust_default(this.primaryColor, { h: -60 });
this.git5 = this.git5 || adjust_default(this.primaryColor, { h: -90 });
this.git6 = this.git6 || adjust_default(this.primaryColor, { h: 60 });
this.git7 = this.git7 || adjust_default(this.primaryColor, { h: 120 });
if (this.darkMode) {
this.git0 = lighten_default(this.git0, 25);
this.git1 = lighten_default(this.git1, 25);
this.git2 = lighten_default(this.git2, 25);
this.git3 = lighten_default(this.git3, 25);
this.git4 = lighten_default(this.git4, 25);
this.git5 = lighten_default(this.git5, 25);
this.git6 = lighten_default(this.git6, 25);
this.git7 = lighten_default(this.git7, 25);
} else {
this.git0 = darken_default(this.git0, 25);
this.git1 = darken_default(this.git1, 25);
this.git2 = darken_default(this.git2, 25);
this.git3 = darken_default(this.git3, 25);
this.git4 = darken_default(this.git4, 25);
this.git5 = darken_default(this.git5, 25);
this.git6 = darken_default(this.git6, 25);
this.git7 = darken_default(this.git7, 25);
}
this.gitInv0 = this.gitInv0 || darken_default(invert_default(this.git0), 25);
this.gitInv1 = this.gitInv1 || invert_default(this.git1);
this.gitInv2 = this.gitInv2 || invert_default(this.git2);
this.gitInv3 = this.gitInv3 || invert_default(this.git3);
this.gitInv4 = this.gitInv4 || invert_default(this.git4);
this.gitInv5 = this.gitInv5 || invert_default(this.git5);
this.gitInv6 = this.gitInv6 || invert_default(this.git6);
this.gitInv7 = this.gitInv7 || invert_default(this.git7);
this.gitBranchLabel0 = this.gitBranchLabel0 || invert_default(this.labelTextColor);
this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
this.gitBranchLabel3 = this.gitBranchLabel3 || invert_default(this.labelTextColor);
this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
this.tagLabelFontSize = this.tagLabelFontSize || "10px";
this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
this.commitLabelFontSize = this.commitLabelFontSize || "10px";
this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
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;
}
const keys2 = Object.keys(overrides);
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
this.updateColors();
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
}
};
getThemeVariables3 = /* @__PURE__ */ __name((userOverrides) => {
const theme = new Theme3();
theme.calculate(userOverrides);
return theme;
}, "getThemeVariables");
}
});
// src/themes/theme-forest.js
var Theme4, getThemeVariables4;
var init_theme_forest = __esm({
"src/themes/theme-forest.js"() {
"use strict";
init_dist();
init_erDiagram_oldHardcodedValues();
init_theme_helpers();
Theme4 = class {
static {
__name(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 = lighten_default("#cde498", 10);
this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
this.primaryTextColor = invert_default(this.primaryColor);
this.secondaryTextColor = invert_default(this.secondaryColor);
this.tertiaryTextColor = invert_default(this.primaryColor);
this.lineColor = invert_default(this.background);
this.textColor = invert_default(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.vertLineColor = "#00BFFF";
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 = darken_default(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 || adjust_default(this.primaryColor, { h: 30 });
this.cScale4 = this.cScale4 || adjust_default(this.primaryColor, { h: 60 });
this.cScale5 = this.cScale5 || adjust_default(this.primaryColor, { h: 90 });
this.cScale6 = this.cScale6 || adjust_default(this.primaryColor, { h: 120 });
this.cScale7 = this.cScale7 || adjust_default(this.primaryColor, { h: 150 });
this.cScale8 = this.cScale8 || adjust_default(this.primaryColor, { h: 210 });
this.cScale9 = this.cScale9 || adjust_default(this.primaryColor, { h: 270 });
this.cScale10 = this.cScale10 || adjust_default(this.primaryColor, { h: 300 });
this.cScale11 = this.cScale11 || adjust_default(this.primaryColor, { h: 330 });
this["cScalePeer1"] = this["cScalePeer1"] || darken_default(this.secondaryColor, 45);
this["cScalePeer2"] = this["cScalePeer2"] || darken_default(this.tertiaryColor, 40);
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScale" + i2] = darken_default(this["cScale" + i2], 10);
this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken_default(this["cScale" + i2], 25);
}
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleInv" + i2] = this["cScaleInv" + i2] || adjust_default(this["cScale" + i2], { h: 180 });
}
this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor;
}
for (let i2 = 0; i2 < 5; i2++) {
this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { h: 30, s: -30, l: -(5 + i2 * 5) });
this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { h: 30, s: -30, l: -(8 + i2 * 5) });
}
this.nodeBkg = this.mainBkg;
this.nodeBorder = this.border1;
this.clusterBkg = this.secondBkg;
this.clusterBorder = this.border2;
this.defaultLinkColor = this.lineColor;
this.taskBorderColor = this.border1;
this.taskTextColor = this.taskTextLightColor;
this.taskTextOutsideColor = this.taskTextDarkColor;
this.activeTaskBorderColor = this.taskBorderColor;
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;
this.stateBkg = this.stateBkg || this.mainBkg;
this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
this.altBackground = this.altBackground || "#f0f0f0";
this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
this.compositeBorder = this.compositeBorder || this.nodeBorder;
this.innerEndBackground = this.primaryBorderColor;
this.specialStateColor = this.lineColor;
this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
this.transitionColor = this.transitionColor || this.lineColor;
this.classText = this.primaryTextColor;
this.fillType0 = this.primaryColor;
this.fillType1 = this.secondaryColor;
this.fillType2 = adjust_default(this.primaryColor, { h: 64 });
this.fillType3 = adjust_default(this.secondaryColor, { h: 64 });
this.fillType4 = adjust_default(this.primaryColor, { h: -64 });
this.fillType5 = adjust_default(this.secondaryColor, { h: -64 });
this.fillType6 = adjust_default(this.primaryColor, { h: 128 });
this.fillType7 = adjust_default(this.secondaryColor, { h: 128 });
this.pie1 = this.pie1 || this.primaryColor;
this.pie2 = this.pie2 || this.secondaryColor;
this.pie3 = this.pie3 || this.tertiaryColor;
this.pie4 = this.pie4 || adjust_default(this.primaryColor, { l: -30 });
this.pie5 = this.pie5 || adjust_default(this.secondaryColor, { l: -30 });
this.pie6 = this.pie6 || adjust_default(this.tertiaryColor, { h: 40, l: -40 });
this.pie7 = this.pie7 || adjust_default(this.primaryColor, { h: 60, l: -10 });
this.pie8 = this.pie8 || adjust_default(this.primaryColor, { h: -60, l: -10 });
this.pie9 = this.pie9 || adjust_default(this.primaryColor, { h: 120, l: 0 });
this.pie10 = this.pie10 || adjust_default(this.primaryColor, { h: 60, l: -50 });
this.pie11 = this.pie11 || adjust_default(this.primaryColor, { h: -60, l: -50 });
this.pie12 = this.pie12 || adjust_default(this.primaryColor, { h: 120, l: -50 });
this.pieTitleTextSize = this.pieTitleTextSize || "25px";
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
this.pieSectionTextSize = this.pieSectionTextSize || "17px";
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
this.pieLegendTextSize = this.pieLegendTextSize || "17px";
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
this.pieStrokeColor = this.pieStrokeColor || "black";
this.pieStrokeWidth = this.pieStrokeWidth || "2px";
this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
this.pieOpacity = this.pieOpacity || "0.7";
this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 });
this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 });
this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 });
this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 });
this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 });
this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 });
this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill);
this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
this.packet = {
startByteColor: this.primaryTextColor,
endByteColor: this.primaryTextColor,
labelColor: this.primaryTextColor,
titleColor: this.primaryTextColor,
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,
xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
plotColorPalette: this.xyChart?.plotColorPalette || "#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"
};
this.requirementBackground = this.requirementBackground || this.primaryColor;
this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
this.requirementBorderSize = this.requirementBorderSize || "1";
this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
this.relationColor = this.relationColor || this.lineColor;
this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;
this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
this.git0 = this.git0 || this.primaryColor;
this.git1 = this.git1 || this.secondaryColor;
this.git2 = this.git2 || this.tertiaryColor;
this.git3 = this.git3 || adjust_default(this.primaryColor, { h: -30 });
this.git4 = this.git4 || adjust_default(this.primaryColor, { h: -60 });
this.git5 = this.git5 || adjust_default(this.primaryColor, { h: -90 });
this.git6 = this.git6 || adjust_default(this.primaryColor, { h: 60 });
this.git7 = this.git7 || adjust_default(this.primaryColor, { h: 120 });
if (this.darkMode) {
this.git0 = lighten_default(this.git0, 25);
this.git1 = lighten_default(this.git1, 25);
this.git2 = lighten_default(this.git2, 25);
this.git3 = lighten_default(this.git3, 25);
this.git4 = lighten_default(this.git4, 25);
this.git5 = lighten_default(this.git5, 25);
this.git6 = lighten_default(this.git6, 25);
this.git7 = lighten_default(this.git7, 25);
} else {
this.git0 = darken_default(this.git0, 25);
this.git1 = darken_default(this.git1, 25);
this.git2 = darken_default(this.git2, 25);
this.git3 = darken_default(this.git3, 25);
this.git4 = darken_default(this.git4, 25);
this.git5 = darken_default(this.git5, 25);
this.git6 = darken_default(this.git6, 25);
this.git7 = darken_default(this.git7, 25);
}
this.gitInv0 = this.gitInv0 || invert_default(this.git0);
this.gitInv1 = this.gitInv1 || invert_default(this.git1);
this.gitInv2 = this.gitInv2 || invert_default(this.git2);
this.gitInv3 = this.gitInv3 || invert_default(this.git3);
this.gitInv4 = this.gitInv4 || invert_default(this.git4);
this.gitInv5 = this.gitInv5 || invert_default(this.git5);
this.gitInv6 = this.gitInv6 || invert_default(this.git6);
this.gitInv7 = this.gitInv7 || invert_default(this.git7);
this.gitBranchLabel0 = this.gitBranchLabel0 || invert_default(this.labelTextColor);
this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
this.gitBranchLabel3 = this.gitBranchLabel3 || invert_default(this.labelTextColor);
this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
this.tagLabelFontSize = this.tagLabelFontSize || "10px";
this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
this.commitLabelFontSize = this.commitLabelFontSize || "10px";
this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
}
calculate(overrides) {
if (typeof overrides !== "object") {
this.updateColors();
return;
}
const keys2 = Object.keys(overrides);
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
this.updateColors();
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
}
};
getThemeVariables4 = /* @__PURE__ */ __name((userOverrides) => {
const theme = new Theme4();
theme.calculate(userOverrides);
return theme;
}, "getThemeVariables");
}
});
// src/themes/theme-neutral.js
var Theme5, getThemeVariables5;
var init_theme_neutral = __esm({
"src/themes/theme-neutral.js"() {
"use strict";
init_dist();
init_theme_helpers();
init_erDiagram_oldHardcodedValues();
Theme5 = class {
static {
__name(this, "Theme");
}
constructor() {
this.primaryColor = "#eee";
this.contrast = "#707070";
this.secondaryColor = lighten_default(this.contrast, 55);
this.background = "#ffffff";
this.tertiaryColor = adjust_default(this.primaryColor, { h: -160 });
this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
this.primaryTextColor = invert_default(this.primaryColor);
this.secondaryTextColor = invert_default(this.secondaryColor);
this.tertiaryTextColor = invert_default(this.tertiaryColor);
this.lineColor = invert_default(this.background);
this.textColor = invert_default(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.vertLineColor = "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 || lighten_default(this.mainBkg, 75) || "#ffffff";
this.rowEven = this.rowEven || "#f4f4f4";
this.labelColor = "black";
this.errorBkgColor = "#552222";
this.errorTextColor = "#552222";
}
updateColors() {
this.secondBkg = lighten_default(this.contrast, 55);
this.border2 = this.contrast;
this.actorBorder = lighten_default(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 i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert_default(this["cScale" + i2]);
}
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
if (this.darkMode) {
this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten_default(this["cScale" + i2], 10);
} else {
this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken_default(this["cScale" + i2], 10);
}
}
this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
this.cScaleLabel0 = this.cScaleLabel0 || this.cScale1;
this.cScaleLabel2 = this.cScaleLabel2 || this.cScale1;
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor;
}
for (let i2 = 0; i2 < 5; i2++) {
this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { l: -(5 + i2 * 5) });
this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { l: -(8 + i2 * 5) });
}
this.nodeBkg = this.mainBkg;
this.nodeBorder = this.border1;
this.clusterBkg = this.secondBkg;
this.clusterBorder = this.border2;
this.defaultLinkColor = this.lineColor;
this.titleColor = this.text;
this.sectionBkgColor = lighten_default(this.contrast, 30);
this.sectionBkgColor2 = lighten_default(this.contrast, 30);
this.taskBorderColor = darken_default(this.contrast, 10);
this.taskBkgColor = this.contrast;
this.taskTextColor = this.taskTextLightColor;
this.taskTextDarkColor = this.text;
this.taskTextOutsideColor = this.taskTextDarkColor;
this.activeTaskBorderColor = this.taskBorderColor;
this.activeTaskBkgColor = this.mainBkg;
this.gridColor = lighten_default(this.border1, 30);
this.doneTaskBkgColor = this.done;
this.doneTaskBorderColor = this.lineColor;
this.critBkgColor = this.critical;
this.critBorderColor = darken_default(this.critBkgColor, 10);
this.todayLineColor = this.critBkgColor;
this.vertLineColor = this.critBkgColor;
this.archEdgeColor = this.lineColor;
this.archEdgeArrowColor = this.lineColor;
this.transitionColor = this.transitionColor || "#000";
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 || "#f4f4f4";
this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
this.stateBorder = this.stateBorder || "#000";
this.innerEndBackground = this.primaryBorderColor;
this.specialStateColor = "#222";
this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
this.classText = this.primaryTextColor;
this.fillType0 = this.primaryColor;
this.fillType1 = this.secondaryColor;
this.fillType2 = adjust_default(this.primaryColor, { h: 64 });
this.fillType3 = adjust_default(this.secondaryColor, { h: 64 });
this.fillType4 = adjust_default(this.primaryColor, { h: -64 });
this.fillType5 = adjust_default(this.secondaryColor, { h: -64 });
this.fillType6 = adjust_default(this.primaryColor, { h: 128 });
this.fillType7 = adjust_default(this.secondaryColor, { h: 128 });
for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) {
this["pie" + i2] = this["cScale" + i2];
}
this.pie12 = this.pie0;
this.pieTitleTextSize = this.pieTitleTextSize || "25px";
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
this.pieSectionTextSize = this.pieSectionTextSize || "17px";
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
this.pieLegendTextSize = this.pieLegendTextSize || "17px";
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
this.pieStrokeColor = this.pieStrokeColor || "black";
this.pieStrokeWidth = this.pieStrokeWidth || "2px";
this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
this.pieOpacity = this.pieOpacity || "0.7";
this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 });
this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 });
this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 });
this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 });
this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 });
this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 });
this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill);
this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
this.xyChart = {
backgroundColor: this.xyChart?.backgroundColor || this.background,
titleColor: this.xyChart?.titleColor || this.primaryTextColor,
xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
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";
this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
this.relationColor = this.relationColor || this.lineColor;
this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;
this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
this.git0 = darken_default(this.pie1, 25) || this.primaryColor;
this.git1 = this.pie2 || this.secondaryColor;
this.git2 = this.pie3 || this.tertiaryColor;
this.git3 = this.pie4 || adjust_default(this.primaryColor, { h: -30 });
this.git4 = this.pie5 || adjust_default(this.primaryColor, { h: -60 });
this.git5 = this.pie6 || adjust_default(this.primaryColor, { h: -90 });
this.git6 = this.pie7 || adjust_default(this.primaryColor, { h: 60 });
this.git7 = this.pie8 || adjust_default(this.primaryColor, { h: 120 });
this.gitInv0 = this.gitInv0 || invert_default(this.git0);
this.gitInv1 = this.gitInv1 || invert_default(this.git1);
this.gitInv2 = this.gitInv2 || invert_default(this.git2);
this.gitInv3 = this.gitInv3 || invert_default(this.git3);
this.gitInv4 = this.gitInv4 || invert_default(this.git4);
this.gitInv5 = this.gitInv5 || invert_default(this.git5);
this.gitInv6 = this.gitInv6 || invert_default(this.git6);
this.gitInv7 = this.gitInv7 || invert_default(this.git7);
this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
this.gitBranchLabel0 = this.branchLabelColor;
this.gitBranchLabel1 = "white";
this.gitBranchLabel2 = this.branchLabelColor;
this.gitBranchLabel3 = "white";
this.gitBranchLabel4 = this.branchLabelColor;
this.gitBranchLabel5 = this.branchLabelColor;
this.gitBranchLabel6 = this.branchLabelColor;
this.gitBranchLabel7 = this.branchLabelColor;
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
this.tagLabelFontSize = this.tagLabelFontSize || "10px";
this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
this.commitLabelFontSize = this.commitLabelFontSize || "10px";
this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
}
calculate(overrides) {
if (typeof overrides !== "object") {
this.updateColors();
return;
}
const keys2 = Object.keys(overrides);
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
this.updateColors();
keys2.forEach((k2) => {
this[k2] = overrides[k2];
});
}
};
getThemeVariables5 = /* @__PURE__ */ __name((userOverrides) => {
const theme = new Theme5();
theme.calculate(userOverrides);
return theme;
}, "getThemeVariables");
}
});
// src/themes/index.js
var themes_default;
var init_themes = __esm({
"src/themes/index.js"() {
"use strict";
init_theme_base();
init_theme_dark();
init_theme_default();
init_theme_forest();
init_theme_neutral();
themes_default = {
base: {
getThemeVariables
},
dark: {
getThemeVariables: getThemeVariables2
},
default: {
getThemeVariables: getThemeVariables3
},
forest: {
getThemeVariables: getThemeVariables4
},
neutral: {
getThemeVariables: getThemeVariables5
}
};
}
});
// src/schemas/config.schema.yaml?only-defaults=true
var config_schema_default;
var init_config_schema = __esm({
"src/schemas/config.schema.yaml?only-defaults=true"() {
"use strict";
config_schema_default = {
"flowchart": {
"useMaxWidth": true,
"titleTopMargin": 25,
"subGraphTitleMargin": {
"top": 0,
"bottom": 0
},
"diagramPadding": 8,
"htmlLabels": true,
"nodeSpacing": 50,
"rankSpacing": 50,
"curve": "basis",
"padding": 15,
"defaultRenderer": "dagre-wrapper",
"wrappingWidth": 200,
"inheritDir": false
},
"sequence": {
"useMaxWidth": true,
"hideUnusedParticipants": false,
"activationWidth": 10,
"diagramMarginX": 50,
"diagramMarginY": 10,
"actorMargin": 50,
"width": 150,
"height": 65,
"boxMargin": 10,
"boxTextMargin": 5,
"noteMargin": 10,
"messageMargin": 35,
"messageAlign": "center",
"mirrorActors": true,
"forceMenus": false,
"bottomMarginAdj": 1,
"rightAngles": false,
"showSequenceNumbers": false,
"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": false,
"wrapPadding": 10,
"labelBoxWidth": 50,
"labelBoxHeight": 20
},
"gantt": {
"useMaxWidth": true,
"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": false,
"displayMode": "",
"weekday": "sunday"
},
"journey": {
"useMaxWidth": true,
"diagramMarginX": 50,
"diagramMarginY": 10,
"leftMargin": 150,
"maxLabelWidth": 360,
"width": 150,
"height": 50,
"boxMargin": 10,
"boxTextMargin": 5,
"noteMargin": 10,
"messageMargin": 35,
"messageAlign": "center",
"bottomMarginAdj": 1,
"rightAngles": false,
"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"
],
"titleColor": "",
"titleFontFamily": '"trebuchet ms", verdana, arial, sans-serif',
"titleFontSize": "4ex"
},
"class": {
"useMaxWidth": true,
"titleTopMargin": 25,
"arrowMarkerAbsolute": false,
"dividerMargin": 10,
"padding": 5,
"textHeight": 10,
"defaultRenderer": "dagre-wrapper",
"htmlLabels": false,
"hideEmptyMembersBox": false
},
"state": {
"useMaxWidth": true,
"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": true,
"titleTopMargin": 25,
"diagramPadding": 20,
"layoutDirection": "TB",
"minEntityWidth": 100,
"minEntityHeight": 75,
"entityPadding": 15,
"nodeSpacing": 140,
"rankSpacing": 80,
"stroke": "gray",
"fill": "honeydew",
"fontSize": 12
},
"pie": {
"useMaxWidth": true,
"textPosition": 0.75
},
"quadrantChart": {
"useMaxWidth": true,
"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": true,
"width": 700,
"height": 500,
"titleFontSize": 20,
"titlePadding": 10,
"showDataLabel": false,
"showTitle": true,
"xAxis": {
"$ref": "#/$defs/XYChartAxisConfig",
"showLabel": true,
"labelFontSize": 14,
"labelPadding": 5,
"showTitle": true,
"titleFontSize": 16,
"titlePadding": 5,
"showTick": true,
"tickLength": 5,
"tickWidth": 2,
"showAxisLine": true,
"axisLineWidth": 2
},
"yAxis": {
"$ref": "#/$defs/XYChartAxisConfig",
"showLabel": true,
"labelFontSize": 14,
"labelPadding": 5,
"showTitle": true,
"titleFontSize": 16,
"titlePadding": 5,
"showTick": true,
"tickLength": 5,
"tickWidth": 2,
"showAxisLine": true,
"axisLineWidth": 2
},
"chartOrientation": "vertical",
"plotReservedSpacePercent": 50
},
"requirement": {
"useMaxWidth": true,
"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": true,
"padding": 10,
"maxNodeWidth": 200,
"layoutAlgorithm": "cose-bilkent"
},
"kanban": {
"useMaxWidth": true,
"padding": 8,
"sectionWidth": 200,
"ticketBaseUrl": ""
},
"timeline": {
"useMaxWidth": true,
"diagramMarginX": 50,
"diagramMarginY": 10,
"leftMargin": 150,
"width": 150,
"height": 50,
"boxMargin": 10,
"boxTextMargin": 5,
"noteMargin": 10,
"messageMargin": 35,
"messageAlign": "center",
"bottomMarginAdj": 1,
"rightAngles": false,
"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": false
},
"gitGraph": {
"useMaxWidth": true,
"titleTopMargin": 25,
"diagramPadding": 8,
"nodeLabel": {
"width": 75,
"height": 100,
"x": -25,
"y": 0
},
"mainBranchName": "main",
"mainBranchOrder": 0,
"showCommitLabel": true,
"showBranches": true,
"rotateCommitLabel": true,
"parallelCommits": false,
"arrowMarkerAbsolute": false
},
"c4": {
"useMaxWidth": true,
"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": true,
"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": true,
"width": 600,
"height": 400,
"linkColor": "gradient",
"nodeAlignment": "justify",
"showValues": true,
"prefix": "",
"suffix": ""
},
"block": {
"useMaxWidth": true,
"padding": 8
},
"packet": {
"useMaxWidth": true,
"rowHeight": 32,
"bitWidth": 32,
"bitsPerRow": 32,
"showBits": true,
"paddingX": 5,
"paddingY": 5
},
"architecture": {
"useMaxWidth": true,
"padding": 40,
"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,
"layout": "dagre",
"maxTextSize": 5e4,
"maxEdges": 500,
"darkMode": false,
"fontFamily": '"trebuchet ms", verdana, arial, sans-serif;',
"logLevel": 5,
"securityLevel": "strict",
"startOnLoad": true,
"arrowMarkerAbsolute": false,
"secure": [
"secure",
"securityLevel",
"startOnLoad",
"maxTextSize",
"suppressErrorRendering",
"maxEdges"
],
"legacyMathML": false,
"forceLegacyMathML": false,
"deterministicIds": false,
"fontSize": 16,
"markdownAutoWrap": true,
"suppressErrorRendering": false
};
}
});
// src/defaultConfig.ts
var config, keyify, configKeys, defaultConfig_default;
var init_defaultConfig = __esm({
"src/defaultConfig.ts"() {
"use strict";
init_themes();
init_config_schema();
config = {
...config_schema_default,
// Set, even though they're `undefined` so that `configKeys` finds these keys
// 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: "BRANDES_KOEPF",
forceNodeModelOrder: false,
considerModelOrder: "NODES_AND_EDGES"
},
themeCSS: void 0,
// add non-JSON default config values
themeVariables: themes_default.default.getThemeVariables(),
sequence: {
...config_schema_default.sequence,
messageFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.messageFontFamily,
fontSize: this.messageFontSize,
fontWeight: this.messageFontWeight
};
}, "messageFont"),
noteFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.noteFontFamily,
fontSize: this.noteFontSize,
fontWeight: this.noteFontWeight
};
}, "noteFont"),
actorFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.actorFontFamily,
fontSize: this.actorFontSize,
fontWeight: this.actorFontWeight
};
}, "actorFont")
},
class: {
hideEmptyMembersBox: false
},
gantt: {
...config_schema_default.gantt,
tickInterval: void 0,
useWidth: void 0
// can probably be removed since `configKeys` already includes this
},
c4: {
...config_schema_default.c4,
useWidth: void 0,
personFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.personFontFamily,
fontSize: this.personFontSize,
fontWeight: this.personFontWeight
};
}, "personFont"),
flowchart: {
...config_schema_default.flowchart,
inheritDir: false
// default to legacy behavior
},
external_personFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_personFontFamily,
fontSize: this.external_personFontSize,
fontWeight: this.external_personFontWeight
};
}, "external_personFont"),
systemFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.systemFontFamily,
fontSize: this.systemFontSize,
fontWeight: this.systemFontWeight
};
}, "systemFont"),
external_systemFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_systemFontFamily,
fontSize: this.external_systemFontSize,
fontWeight: this.external_systemFontWeight
};
}, "external_systemFont"),
system_dbFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.system_dbFontFamily,
fontSize: this.system_dbFontSize,
fontWeight: this.system_dbFontWeight
};
}, "system_dbFont"),
external_system_dbFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_system_dbFontFamily,
fontSize: this.external_system_dbFontSize,
fontWeight: this.external_system_dbFontWeight
};
}, "external_system_dbFont"),
system_queueFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.system_queueFontFamily,
fontSize: this.system_queueFontSize,
fontWeight: this.system_queueFontWeight
};
}, "system_queueFont"),
external_system_queueFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_system_queueFontFamily,
fontSize: this.external_system_queueFontSize,
fontWeight: this.external_system_queueFontWeight
};
}, "external_system_queueFont"),
containerFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.containerFontFamily,
fontSize: this.containerFontSize,
fontWeight: this.containerFontWeight
};
}, "containerFont"),
external_containerFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_containerFontFamily,
fontSize: this.external_containerFontSize,
fontWeight: this.external_containerFontWeight
};
}, "external_containerFont"),
container_dbFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.container_dbFontFamily,
fontSize: this.container_dbFontSize,
fontWeight: this.container_dbFontWeight
};
}, "container_dbFont"),
external_container_dbFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_container_dbFontFamily,
fontSize: this.external_container_dbFontSize,
fontWeight: this.external_container_dbFontWeight
};
}, "external_container_dbFont"),
container_queueFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.container_queueFontFamily,
fontSize: this.container_queueFontSize,
fontWeight: this.container_queueFontWeight
};
}, "container_queueFont"),
external_container_queueFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_container_queueFontFamily,
fontSize: this.external_container_queueFontSize,
fontWeight: this.external_container_queueFontWeight
};
}, "external_container_queueFont"),
componentFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.componentFontFamily,
fontSize: this.componentFontSize,
fontWeight: this.componentFontWeight
};
}, "componentFont"),
external_componentFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_componentFontFamily,
fontSize: this.external_componentFontSize,
fontWeight: this.external_componentFontWeight
};
}, "external_componentFont"),
component_dbFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.component_dbFontFamily,
fontSize: this.component_dbFontSize,
fontWeight: this.component_dbFontWeight
};
}, "component_dbFont"),
external_component_dbFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_component_dbFontFamily,
fontSize: this.external_component_dbFontSize,
fontWeight: this.external_component_dbFontWeight
};
}, "external_component_dbFont"),
component_queueFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.component_queueFontFamily,
fontSize: this.component_queueFontSize,
fontWeight: this.component_queueFontWeight
};
}, "component_queueFont"),
external_component_queueFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.external_component_queueFontFamily,
fontSize: this.external_component_queueFontSize,
fontWeight: this.external_component_queueFontWeight
};
}, "external_component_queueFont"),
boundaryFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.boundaryFontFamily,
fontSize: this.boundaryFontSize,
fontWeight: this.boundaryFontWeight
};
}, "boundaryFont"),
messageFont: /* @__PURE__ */ __name(function() {
return {
fontFamily: this.messageFontFamily,
fontSize: this.messageFontSize,
fontWeight: this.messageFontWeight
};
}, "messageFont")
},
pie: {
...config_schema_default.pie,
useWidth: 984
},
xyChart: {
...config_schema_default.xyChart,
useWidth: void 0
},
requirement: {
...config_schema_default.requirement,
useWidth: void 0
},
packet: {
...config_schema_default.packet
},
radar: {
...config_schema_default.radar
},
treemap: {
useMaxWidth: true,
padding: 10,
diagramPadding: 8,
showValues: true,
nodeWidth: 100,
nodeHeight: 40,
borderWidth: 1,
valueFontSize: 12,
labelFontSize: 14,
valueFormat: ","
}
};
keyify = /* @__PURE__ */ __name((obj, prefix = "") => Object.keys(obj).reduce((res, el) => {
if (Array.isArray(obj[el])) {
return res;
} else if (typeof obj[el] === "object" && obj[el] !== null) {
return [...res, prefix + el, ...keyify(obj[el], "")];
}
return [...res, prefix + el];
}, []), "keyify");
configKeys = new Set(keyify(config, ""));
defaultConfig_default = config;
}
});
// src/utils/sanitizeDirective.ts
var sanitizeDirective, sanitizeCss;
var init_sanitizeDirective = __esm({
"src/utils/sanitizeDirective.ts"() {
"use strict";
init_defaultConfig();
init_logger();
sanitizeDirective = /* @__PURE__ */ __name((args) => {
log.debug("sanitizeDirective called with", args);
if (typeof args !== "object" || args == null) {
return;
}
if (Array.isArray(args)) {
args.forEach((arg) => sanitizeDirective(arg));
return;
}
for (const key of Object.keys(args)) {
log.debug("Checking key", key);
if (key.startsWith("__") || key.includes("proto") || key.includes("constr") || !configKeys.has(key) || args[key] == null) {
log.debug("sanitize deleting key: ", key);
delete args[key];
continue;
}
if (typeof args[key] === "object") {
log.debug("sanitizing object", key);
sanitizeDirective(args[key]);
continue;
}
const cssMatchers = ["themeCSS", "fontFamily", "altFontFamily"];
for (const cssKey of cssMatchers) {
if (key.includes(cssKey)) {
log.debug("sanitizing css option", key);
args[key] = sanitizeCss(args[key]);
}
}
}
if (args.themeVariables) {
for (const k2 of Object.keys(args.themeVariables)) {
const val = args.themeVariables[k2];
if (val?.match && !val.match(/^[\d "#%(),.;A-Za-z]+$/)) {
args.themeVariables[k2] = "";
}
}
}
log.debug("After sanitization", args);
}, "sanitizeDirective");
sanitizeCss = /* @__PURE__ */ __name((str2) => {
let startCnt = 0;
let endCnt = 0;
for (const element3 of str2) {
if (startCnt < endCnt) {
return "{ /* ERROR: Unbalanced CSS */ }";
}
if (element3 === "{") {
startCnt++;
} else if (element3 === "}") {
endCnt++;
}
}
if (startCnt !== endCnt) {
return "{ /* ERROR: Unbalanced CSS */ }";
}
return str2;
}, "sanitizeCss");
}
});
// src/config.ts
var defaultConfig, siteConfig, configFromInitialize, directives, currentConfig, updateCurrentConfig, setSiteConfig, saveConfigFromInitialize, updateSiteConfig, getSiteConfig, setConfig, getConfig, sanitize, addDirective, reset, ConfigWarning, issuedWarnings, issueWarning, checkConfig, getUserDefinedConfig;
var init_config = __esm({
"src/config.ts"() {
"use strict";
init_assignWithDepth();
init_logger();
init_themes();
init_defaultConfig();
init_sanitizeDirective();
defaultConfig = Object.freeze(defaultConfig_default);
siteConfig = assignWithDepth_default({}, defaultConfig);
directives = [];
currentConfig = assignWithDepth_default({}, defaultConfig);
updateCurrentConfig = /* @__PURE__ */ __name((siteCfg, _directives) => {
let cfg = assignWithDepth_default({}, siteCfg);
let sumOfDirectives = {};
for (const d3 of _directives) {
sanitize(d3);
sumOfDirectives = assignWithDepth_default(sumOfDirectives, d3);
}
cfg = assignWithDepth_default(cfg, sumOfDirectives);
if (sumOfDirectives.theme && sumOfDirectives.theme in themes_default) {
const tmpConfigFromInitialize = assignWithDepth_default({}, configFromInitialize);
const themeVariables = assignWithDepth_default(
tmpConfigFromInitialize.themeVariables || {},
sumOfDirectives.themeVariables
);
if (cfg.theme && cfg.theme in themes_default) {
cfg.themeVariables = themes_default[cfg.theme].getThemeVariables(themeVariables);
}
}
currentConfig = cfg;
checkConfig(currentConfig);
return currentConfig;
}, "updateCurrentConfig");
setSiteConfig = /* @__PURE__ */ __name((conf5) => {
siteConfig = assignWithDepth_default({}, defaultConfig);
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((conf5) => {
configFromInitialize = assignWithDepth_default({}, conf5);
}, "saveConfigFromInitialize");
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((conf5) => {
checkConfig(conf5);
assignWithDepth_default(currentConfig, conf5);
return getConfig();
}, "setConfig");
getConfig = /* @__PURE__ */ __name(() => {
return assignWithDepth_default({}, currentConfig);
}, "getConfig");
sanitize = /* @__PURE__ */ __name((options2) => {
if (!options2) {
return;
}
["secure", ...siteConfig.secure ?? []].forEach((key) => {
if (Object.hasOwn(options2, key)) {
log.debug(`Denied attempt to modify a secure key ${key}`, options2[key]);
delete options2[key];
}
});
Object.keys(options2).forEach((key) => {
if (key.startsWith("__")) {
delete options2[key];
}
});
Object.keys(options2).forEach((key) => {
if (typeof options2[key] === "string" && (options2[key].includes("<") || options2[key].includes(">") || options2[key].includes("url(data:"))) {
delete options2[key];
}
if (typeof options2[key] === "object") {
sanitize(options2[key]);
}
});
}, "sanitize");
addDirective = /* @__PURE__ */ __name((directive) => {
sanitizeDirective(directive);
if (directive.fontFamily && !directive.themeVariables?.fontFamily) {
directive.themeVariables = {
...directive.themeVariables,
fontFamily: directive.fontFamily
};
}
directives.push(directive);
updateCurrentConfig(siteConfig, directives);
}, "addDirective");
reset = /* @__PURE__ */ __name((config5 = siteConfig) => {
directives = [];
updateCurrentConfig(config5, directives);
}, "reset");
ConfigWarning = {
LAZY_LOAD_DEPRECATED: "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."
};
issuedWarnings = {};
issueWarning = /* @__PURE__ */ __name((warning) => {
if (issuedWarnings[warning]) {
return;
}
log.warn(ConfigWarning[warning]);
issuedWarnings[warning] = true;
}, "issueWarning");
checkConfig = /* @__PURE__ */ __name((config5) => {
if (!config5) {
return;
}
if (config5.lazyLoadedDiagrams || config5.loadExternalDiagramsAtStartup) {
issueWarning("LAZY_LOAD_DEPRECATED");
}
}, "checkConfig");
getUserDefinedConfig = /* @__PURE__ */ __name(() => {
let userConfig = {};
if (configFromInitialize) {
userConfig = assignWithDepth_default(userConfig, configFromInitialize);
}
for (const d3 of directives) {
userConfig = assignWithDepth_default(userConfig, d3);
}
return userConfig;
}, "getUserDefinedConfig");
}
});
// ../../node_modules/.pnpm/dompurify@3.2.6/node_modules/dompurify/dist/purify.es.mjs
function unapply(func) {
return function(thisArg) {
if (thisArg instanceof RegExp) {
thisArg.lastIndex = 0;
}
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(set5, array4) {
let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
if (setPrototypeOf) {
setPrototypeOf(set5, null);
}
let l4 = array4.length;
while (l4--) {
let element3 = array4[l4];
if (typeof element3 === "string") {
const lcElement = transformCaseFunc(element3);
if (lcElement !== element3) {
if (!isFrozen(array4)) {
array4[l4] = lcElement;
}
element3 = lcElement;
}
}
set5[element3] = true;
}
return set5;
}
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((root3) => createDOMPurify(root3), "DOMPurify");
DOMPurify.version = "3.2.6";
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: Node2,
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 = _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) : clone({});
FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
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;
}
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 (_3) {
remove3(node2);
}
}, "_forceRemove");
const _removeAttribute = /* @__PURE__ */ __name(function _removeAttribute2(name, element3) {
try {
arrayPush(DOMPurify.removed, {
attribute: element3.getAttributeNode(name),
from: element3
});
} catch (_3) {
arrayPush(DOMPurify.removed, {
attribute: null,
from: element3
});
}
element3.removeAttribute(name);
if (name === "is") {
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
try {
_forceRemove(element3);
} catch (_3) {
}
} else {
try {
element3.setAttribute(name, "");
} catch (_3) {
}
}
}
}, "_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 (_3) {
}
}
if (!doc || !doc.documentElement) {
doc = implementation.createDocument(NAMESPACE2, "template", null);
try {
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
} catch (_3) {
}
}
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(root3) {
return createNodeIterator.call(
root3.ownerDocument || root3,
root3,
// 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 Node2 === "function" && value2 instanceof Node2;
}, "_isNode");
function _executeHooks(hooks2, currentNode, data5) {
arrayForEach(hooks2, (hook2) => {
hook2.call(DOMPurify, currentNode, data5, 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 (SAFE_FOR_XML && 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) {
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 l4 = attributes.length;
while (l4--) {
const attr = attributes[l4];
const {
name,
namespaceURI,
value: attrValue
} = attr;
const lcName = transformCaseFunc(name);
const initValue = attrValue;
let value2 = name === "value" ? initValue : stringTrim(initValue);
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;
}
if (!hookEvent.keepAttr) {
_removeAttribute(name, currentNode);
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)) {
_removeAttribute(name, currentNode);
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;
}
case "TrustedScriptURL": {
value2 = trustedTypesPolicy.createScriptURL(value2);
break;
}
}
}
}
if (value2 !== initValue) {
try {
if (namespaceURI) {
currentNode.setAttributeNS(namespaceURI, name, value2);
} else {
currentNode.setAttribute(name, value2);
}
if (_isClobbered(currentNode)) {
_forceRemove(currentNode);
} else {
arrayPop(DOMPurify.removed);
}
} catch (_3) {
_removeAttribute(name, currentNode);
}
}
}
_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");
}
} 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");
}
}
} else if (dirty instanceof Node2) {
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);
}
} 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(tag, attr, value2) {
if (!CONFIG) {
_parseConfig({});
}
const lcTag = transformCaseFunc(tag);
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.6/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|matrix):|[^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(html2) {
return html2;
},
createScriptURL(scriptUrl) {
return scriptUrl;
}
});
} catch (_3) {
console.warn("TrustedTypes policy " + policyName + " could not be created.");
return null;
}
}, "_createTrustedTypesPolicy");
_createHooksMap = /* @__PURE__ */ __name(function _createHooksMap2() {
return {
afterSanitizeAttributes: [],
afterSanitizeElements: [],
afterSanitizeShadowDOM: [],
beforeSanitizeAttributes: [],
beforeSanitizeElements: [],
beforeSanitizeShadowDOM: [],
uponSanitizeAttribute: [],
uponSanitizeElement: [],
uponSanitizeShadowNode: []
};
}, "_createHooksMap");
__name(createDOMPurify, "createDOMPurify");
purify = createDOMPurify();
}
});
// ../../node_modules/.pnpm/katex@0.16.22/node_modules/katex/dist/katex.mjs
var katex_exports = {};
__export(katex_exports, {
ParseError: () => ParseError,
SETTINGS_SCHEMA: () => SETTINGS_SCHEMA,
__defineFunction: () => defineFunction,
__defineMacro: () => defineMacro,
__defineSymbol: () => defineSymbol,
__domTree: () => __domTree,
__parse: () => generateParseTree,
__renderToDomTree: () => renderToDomTree,
__renderToHTMLTree: () => renderToHTMLTree,
__setFontMetrics: () => setFontMetrics,
default: () => katex,
render: () => render,
renderToString: () => renderToString,
version: () => version
});
function escape2(text4) {
return String(text4).replace(ESCAPE_REGEX, (match2) => ESCAPE_LOOKUP[match2]);
}
function getDefaultValue(schema2) {
if (schema2.default) {
return schema2.default;
}
var type3 = schema2.type;
var defaultType = Array.isArray(type3) ? type3[0] : type3;
if (typeof defaultType !== "string") {
return defaultType.enum[0];
}
switch (defaultType) {
case "boolean":
return false;
case "string":
return "";
case "number":
return 0;
case "object":
return {};
}
}
function scriptFromCodepoint(codepoint) {
for (var i2 = 0; i2 < scriptData.length; i2++) {
var script = scriptData[i2];
for (var _i = 0; _i < script.blocks.length; _i++) {
var block2 = script.blocks[_i];
if (codepoint >= block2[0] && codepoint <= block2[1]) {
return script.name;
}
}
}
return null;
}
function supportedCodepoint(codepoint) {
for (var i2 = 0; i2 < allBlocks.length; i2 += 2) {
if (codepoint >= allBlocks[i2] && codepoint <= allBlocks[i2 + 1]) {
return true;
}
}
return false;
}
function setFontMetrics(fontName, metrics) {
fontMetricsData[fontName] = metrics;
}
function getCharacterMetrics(character2, font, mode) {
if (!fontMetricsData[font]) {
throw new Error("Font metrics not found for font: " + font + ".");
}
var ch = character2.charCodeAt(0);
var metrics = fontMetricsData[font][ch];
if (!metrics && character2[0] in extraCharacterMap) {
ch = extraCharacterMap[character2[0]].charCodeAt(0);
metrics = fontMetricsData[font][ch];
}
if (!metrics && mode === "text") {
if (supportedCodepoint(ch)) {
metrics = fontMetricsData[font][77];
}
}
if (metrics) {
return {
depth: metrics[0],
height: metrics[1],
italic: metrics[2],
skew: metrics[3],
width: metrics[4]
};
}
}
function getGlobalMetrics(size4) {
var sizeIndex;
if (size4 >= 5) {
sizeIndex = 0;
} else if (size4 >= 3) {
sizeIndex = 1;
} else {
sizeIndex = 2;
}
if (!fontMetricsBySizeIndex[sizeIndex]) {
var metrics = fontMetricsBySizeIndex[sizeIndex] = {
cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18
};
for (var key in sigmasAndXis) {
if (sigmasAndXis.hasOwnProperty(key)) {
metrics[key] = sigmasAndXis[key][sizeIndex];
}
}
}
return fontMetricsBySizeIndex[sizeIndex];
}
function assertSymbolDomNode(group2) {
if (group2 instanceof SymbolNode) {
return group2;
} else {
throw new Error("Expected symbolNode but got " + String(group2) + ".");
}
}
function assertSpan(group2) {
if (group2 instanceof Span) {
return group2;
} else {
throw new Error("Expected span but got " + String(group2) + ".");
}
}
function defineSymbol(mode, font, group2, replace2, name, acceptUnicodeChar) {
symbols[mode][name] = {
font,
group: group2,
replace: replace2
};
if (acceptUnicodeChar && replace2) {
symbols[mode][replace2] = symbols[mode][name];
}
}
function defineFunction(_ref) {
var {
type: type3,
names,
props,
handler,
htmlBuilder: htmlBuilder3,
mathmlBuilder: mathmlBuilder3
} = _ref;
var data5 = {
type: type3,
numArgs: props.numArgs,
argTypes: props.argTypes,
allowedInArgument: !!props.allowedInArgument,
allowedInText: !!props.allowedInText,
allowedInMath: props.allowedInMath === void 0 ? true : props.allowedInMath,
numOptionalArgs: props.numOptionalArgs || 0,
infix: !!props.infix,
primitive: !!props.primitive,
handler
};
for (var i2 = 0; i2 < names.length; ++i2) {
_functions[names[i2]] = data5;
}
if (type3) {
if (htmlBuilder3) {
_htmlGroupBuilders[type3] = htmlBuilder3;
}
if (mathmlBuilder3) {
_mathmlGroupBuilders[type3] = mathmlBuilder3;
}
}
}
function defineFunctionBuilders(_ref2) {
var {
type: type3,
htmlBuilder: htmlBuilder3,
mathmlBuilder: mathmlBuilder3
} = _ref2;
defineFunction({
type: type3,
names: [],
props: {
numArgs: 0
},
handler() {
throw new Error("Should never be called.");
},
htmlBuilder: htmlBuilder3,
mathmlBuilder: mathmlBuilder3
});
}
function buildHTMLUnbreakable(children2, options2) {
var body = makeSpan$1(["base"], children2, options2);
var strut = makeSpan$1(["strut"]);
strut.style.height = makeEm(body.height + body.depth);
if (body.depth) {
strut.style.verticalAlign = makeEm(-body.depth);
}
body.children.unshift(strut);
return body;
}
function buildHTML(tree, options2) {
var tag = null;
if (tree.length === 1 && tree[0].type === "tag") {
tag = tree[0].tag;
tree = tree[0].body;
}
var expression = buildExpression$1(tree, options2, "root");
var eqnNum;
if (expression.length === 2 && expression[1].hasClass("tag")) {
eqnNum = expression.pop();
}
var children2 = [];
var parts = [];
for (var i2 = 0; i2 < expression.length; i2++) {
parts.push(expression[i2]);
if (expression[i2].hasClass("mbin") || expression[i2].hasClass("mrel") || expression[i2].hasClass("allowbreak")) {
var nobreak = false;
while (i2 < expression.length - 1 && expression[i2 + 1].hasClass("mspace") && !expression[i2 + 1].hasClass("newline")) {
i2++;
parts.push(expression[i2]);
if (expression[i2].hasClass("nobreak")) {
nobreak = true;
}
}
if (!nobreak) {
children2.push(buildHTMLUnbreakable(parts, options2));
parts = [];
}
} else if (expression[i2].hasClass("newline")) {
parts.pop();
if (parts.length > 0) {
children2.push(buildHTMLUnbreakable(parts, options2));
parts = [];
}
children2.push(expression[i2]);
}
}
if (parts.length > 0) {
children2.push(buildHTMLUnbreakable(parts, options2));
}
var tagChild;
if (tag) {
tagChild = buildHTMLUnbreakable(buildExpression$1(tag, options2, true));
tagChild.classes = ["tag"];
children2.push(tagChild);
} else if (eqnNum) {
children2.push(eqnNum);
}
var htmlNode = makeSpan$1(["katex-html"], children2);
htmlNode.setAttribute("aria-hidden", "true");
if (tagChild) {
var strut = tagChild.children[0];
strut.style.height = makeEm(htmlNode.height + htmlNode.depth);
if (htmlNode.depth) {
strut.style.verticalAlign = makeEm(-htmlNode.depth);
}
}
return htmlNode;
}
function newDocumentFragment(children2) {
return new DocumentFragment(children2);
}
function isNumberPunctuation(group2) {
if (!group2) {
return false;
}
if (group2.type === "mi" && group2.children.length === 1) {
var child = group2.children[0];
return child instanceof TextNode && child.text === ".";
} else if (group2.type === "mo" && group2.children.length === 1 && group2.getAttribute("separator") === "true" && group2.getAttribute("lspace") === "0em" && group2.getAttribute("rspace") === "0em") {
var _child = group2.children[0];
return _child instanceof TextNode && _child.text === ",";
} else {
return false;
}
}
function buildMathML(tree, texExpression, options2, isDisplayMode, forMathmlOnly) {
var expression = buildExpression2(tree, options2);
var wrapper;
if (expression.length === 1 && expression[0] instanceof MathNode && utils.contains(["mrow", "mtable"], expression[0].type)) {
wrapper = expression[0];
} else {
wrapper = new mathMLTree.MathNode("mrow", expression);
}
var annotation = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(texExpression)]);
annotation.setAttribute("encoding", "application/x-tex");
var semantics = new mathMLTree.MathNode("semantics", [wrapper, annotation]);
var math2 = new mathMLTree.MathNode("math", [semantics]);
math2.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML");
if (isDisplayMode) {
math2.setAttribute("display", "block");
}
var wrapperClass = forMathmlOnly ? "katex" : "katex-mathml";
return buildCommon.makeSpan([wrapperClass], [math2]);
}
function assertNodeType(node2, type3) {
if (!node2 || node2.type !== type3) {
throw new Error("Expected node of type " + type3 + ", but got " + (node2 ? "node of type " + node2.type : String(node2)));
}
return node2;
}
function assertSymbolNodeType(node2) {
var typedNode = checkSymbolNodeType(node2);
if (!typedNode) {
throw new Error("Expected node of symbol group type, but got " + (node2 ? "node of type " + node2.type : String(node2)));
}
return typedNode;
}
function checkSymbolNodeType(node2) {
if (node2 && (node2.type === "atom" || NON_ATOMS.hasOwnProperty(node2.type))) {
return node2;
}
return null;
}
function htmlBuilder$9(group2, options2) {
var elements2 = buildExpression$1(group2.body, options2, true);
return makeSpan2([group2.mclass], elements2, options2);
}
function mathmlBuilder$8(group2, options2) {
var node2;
var inner2 = buildExpression2(group2.body, options2);
if (group2.mclass === "minner") {
node2 = new mathMLTree.MathNode("mpadded", inner2);
} else if (group2.mclass === "mord") {
if (group2.isCharacterBox) {
node2 = inner2[0];
node2.type = "mi";
} else {
node2 = new mathMLTree.MathNode("mi", inner2);
}
} else {
if (group2.isCharacterBox) {
node2 = inner2[0];
node2.type = "mo";
} else {
node2 = new mathMLTree.MathNode("mo", inner2);
}
if (group2.mclass === "mbin") {
node2.attributes.lspace = "0.22em";
node2.attributes.rspace = "0.22em";
} else if (group2.mclass === "mpunct") {
node2.attributes.lspace = "0em";
node2.attributes.rspace = "0.17em";
} else if (group2.mclass === "mopen" || group2.mclass === "mclose") {
node2.attributes.lspace = "0em";
node2.attributes.rspace = "0em";
} else if (group2.mclass === "minner") {
node2.attributes.lspace = "0.0556em";
node2.attributes.width = "+0.1111em";
}
}
return node2;
}
function cdArrow(arrowChar, labels, parser24) {
var funcName = cdArrowFunctionName[arrowChar];
switch (funcName) {
case "\\\\cdrightarrow":
case "\\\\cdleftarrow":
return parser24.callFunction(funcName, [labels[0]], [labels[1]]);
case "\\uparrow":
case "\\downarrow": {
var leftLabel = parser24.callFunction("\\\\cdleft", [labels[0]], []);
var bareArrow = {
type: "atom",
text: funcName,
mode: "math",
family: "rel"
};
var sizedArrow = parser24.callFunction("\\Big", [bareArrow], []);
var rightLabel = parser24.callFunction("\\\\cdright", [labels[1]], []);
var arrowGroup = {
type: "ordgroup",
mode: "math",
body: [leftLabel, sizedArrow, rightLabel]
};
return parser24.callFunction("\\\\cdparent", [arrowGroup], []);
}
case "\\\\cdlongequal":
return parser24.callFunction("\\\\cdlongequal", [], []);
case "\\Vert": {
var arrow = {
type: "textord",
text: "\\Vert",
mode: "math"
};
return parser24.callFunction("\\Big", [arrow], []);
}
default:
return {
type: "textord",
text: " ",
mode: "math"
};
}
}
function parseCD(parser24) {
var parsedRows = [];
parser24.gullet.beginGroup();
parser24.gullet.macros.set("\\cr", "\\\\\\relax");
parser24.gullet.beginGroup();
while (true) {
parsedRows.push(parser24.parseExpression(false, "\\\\"));
parser24.gullet.endGroup();
parser24.gullet.beginGroup();
var next3 = parser24.fetch().text;
if (next3 === "&" || next3 === "\\\\") {
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", parser24.nextToken);
}
}
var row = [];
var body = [row];
for (var i2 = 0; i2 < parsedRows.length; i2++) {
var rowNodes = parsedRows[i2];
var cell = newCell();
for (var j3 = 0; j3 < rowNodes.length; j3++) {
if (!isStartOfArrow(rowNodes[j3])) {
cell.body.push(rowNodes[j3]);
} else {
row.push(cell);
j3 += 1;
var arrowChar = assertSymbolNodeType(rowNodes[j3]).text;
var labels = new Array(2);
labels[0] = {
type: "ordgroup",
mode: "math",
body: []
};
labels[1] = {
type: "ordgroup",
mode: "math",
body: []
};
if ("=|.".indexOf(arrowChar) > -1) ;
else if ("<>AV".indexOf(arrowChar) > -1) {
for (var labelNum = 0; labelNum < 2; labelNum++) {
var inLabel = true;
for (var k2 = j3 + 1; k2 < rowNodes.length; k2++) {
if (isLabelEnd(rowNodes[k2], arrowChar)) {
inLabel = false;
j3 = k2;
break;
}
if (isStartOfArrow(rowNodes[k2])) {
throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[k2]);
}
labels[labelNum].body.push(rowNodes[k2]);
}
if (inLabel) {
throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[j3]);
}
}
} else {
throw new ParseError('Expected one of "<>AV=|." after @', rowNodes[j3]);
}
var arrow = cdArrow(arrowChar, labels, parser24);
var wrappedArrow = {
type: "styling",
body: [arrow],
mode: "math",
style: "display"
// CD is always displaystyle.
};
row.push(wrappedArrow);
cell = newCell();
}
}
if (i2 % 2 === 0) {
row.push(cell);
} else {
row.shift();
}
row = [];
body.push(row);
}
parser24.gullet.endGroup();
parser24.gullet.endGroup();
var cols = new Array(body[0].length).fill({
type: "align",
align: "c",
pregap: 0.25,
// CD package sets \enskip between columns.
postgap: 0.25
// So pre and post each get half an \enskip, i.e. 0.25em.
});
return {
type: "array",
mode: "math",
body,
arraystretch: 1,
addJot: true,
rowGaps: [null],
cols,
colSeparationType: "CD",
hLinesBeforeRow: new Array(body.length + 1).fill([])
};
}
function checkDelimiter(delim, context) {
var symDelim = checkSymbolNodeType(delim);
if (symDelim && utils.contains(delimiters, symDelim.text)) {
return symDelim;
} else if (symDelim) {
throw new ParseError("Invalid delimiter '" + symDelim.text + "' after '" + context.funcName + "'", delim);
} else {
throw new ParseError("Invalid delimiter type '" + delim.type + "'", delim);
}
}
function assertParsed(group2) {
if (!group2.body) {
throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
}
function defineEnvironment(_ref) {
var {
type: type3,
names,
props,
handler,
htmlBuilder: htmlBuilder3,
mathmlBuilder: mathmlBuilder3
} = _ref;
var data5 = {
type: type3,
numArgs: props.numArgs || 0,
allowedInText: false,
numOptionalArgs: 0,
handler
};
for (var i2 = 0; i2 < names.length; ++i2) {
_environments[names[i2]] = data5;
}
if (htmlBuilder3) {
_htmlGroupBuilders[type3] = htmlBuilder3;
}
if (mathmlBuilder3) {
_mathmlGroupBuilders[type3] = mathmlBuilder3;
}
}
function defineMacro(name, body) {
_macros[name] = body;
}
function getHLines(parser24) {
var hlineInfo = [];
parser24.consumeSpaces();
var nxt = parser24.fetch().text;
if (nxt === "\\relax") {
parser24.consume();
parser24.consumeSpaces();
nxt = parser24.fetch().text;
}
while (nxt === "\\hline" || nxt === "\\hdashline") {
parser24.consume();
hlineInfo.push(nxt === "\\hdashline");
parser24.consumeSpaces();
nxt = parser24.fetch().text;
}
return hlineInfo;
}
function getAutoTag(name) {
if (name.indexOf("ed") === -1) {
return name.indexOf("*") === -1;
}
}
function parseArray(parser24, _ref, style3) {
var {
hskipBeforeAndAfter,
addJot,
cols,
arraystretch,
colSeparationType,
autoTag,
singleRow,
emptySingleRow,
maxNumCols,
leqno
} = _ref;
parser24.gullet.beginGroup();
if (!singleRow) {
parser24.gullet.macros.set("\\cr", "\\\\\\relax");
}
if (!arraystretch) {
var stretch = parser24.gullet.expandMacroAsText("\\arraystretch");
if (stretch == null) {
arraystretch = 1;
} else {
arraystretch = parseFloat(stretch);
if (!arraystretch || arraystretch < 0) {
throw new ParseError("Invalid \\arraystretch: " + stretch);
}
}
}
parser24.gullet.beginGroup();
var row = [];
var body = [row];
var rowGaps = [];
var hLinesBeforeRow = [];
var tags2 = autoTag != null ? [] : void 0;
function beginRow() {
if (autoTag) {
parser24.gullet.macros.set("\\@eqnsw", "1", true);
}
}
__name(beginRow, "beginRow");
function endRow() {
if (tags2) {
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) && parser24.gullet.macros.get("\\@eqnsw") === "1");
}
}
}
__name(endRow, "endRow");
beginRow();
hLinesBeforeRow.push(getHLines(parser24));
while (true) {
var cell = parser24.parseExpression(false, singleRow ? "\\end" : "\\\\");
parser24.gullet.endGroup();
parser24.gullet.beginGroup();
cell = {
type: "ordgroup",
mode: parser24.mode,
body: cell
};
if (style3) {
cell = {
type: "styling",
mode: parser24.mode,
style: style3,
body: [cell]
};
}
row.push(cell);
var next3 = parser24.fetch().text;
if (next3 === "&") {
if (maxNumCols && row.length === maxNumCols) {
if (singleRow || colSeparationType) {
throw new ParseError("Too many tab characters: &", parser24.nextToken);
} else {
parser24.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
}
}
parser24.consume();
} else if (next3 === "\\end") {
endRow();
if (row.length === 1 && cell.type === "styling" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow)) {
body.pop();
}
if (hLinesBeforeRow.length < body.length + 1) {
hLinesBeforeRow.push([]);
}
break;
} else if (next3 === "\\\\") {
parser24.consume();
var size4 = void 0;
if (parser24.gullet.future().text !== " ") {
size4 = parser24.parseSizeGroup(true);
}
rowGaps.push(size4 ? size4.value : null);
endRow();
hLinesBeforeRow.push(getHLines(parser24));
row = [];
body.push(row);
beginRow();
} else {
throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser24.nextToken);
}
}
parser24.gullet.endGroup();
parser24.gullet.endGroup();
return {
type: "array",
mode: parser24.mode,
addJot,
arraystretch,
body,
cols,
rowGaps,
hskipBeforeAndAfter,
hLinesBeforeRow,
colSeparationType,
tags: tags2,
leqno
};
}
function dCellStyle(envName) {
if (envName.slice(0, 1) === "d") {
return "display";
} else {
return "text";
}
}
function sizingGroup(value2, options2, baseOptions) {
var inner2 = buildExpression$1(value2, options2, false);
var multiplier = options2.sizeMultiplier / baseOptions.sizeMultiplier;
for (var i2 = 0; i2 < inner2.length; i2++) {
var pos = inner2[i2].classes.indexOf("sizing");
if (pos < 0) {
Array.prototype.push.apply(inner2[i2].classes, options2.sizingClasses(baseOptions));
} else if (inner2[i2].classes[pos + 1] === "reset-size" + options2.size) {
inner2[i2].classes[pos + 1] = "reset-size" + baseOptions.size;
}
inner2[i2].height *= multiplier;
inner2[i2].depth *= multiplier;
}
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, invalidAttributeNameRegex, 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, version, __domTree, katex;
var init_katex = __esm({
"../../node_modules/.pnpm/katex@0.16.22/node_modules/katex/dist/katex.mjs"() {
"use strict";
SourceLocation = class _SourceLocation {
static {
__name(this, "SourceLocation");
}
// The + prefix indicates that these fields aren't writeable
// Lexer holding the input string.
// Start offset, zero-based inclusive.
// End offset, zero-based exclusive.
constructor(lexer, start3, end2) {
this.lexer = void 0;
this.start = void 0;
this.end = void 0;
this.lexer = lexer;
this.start = start3;
this.end = end2;
}
/**
* Merges two `SourceLocation`s from location providers, given they are
* provided in order of appearance.
* - Returns the first one's location if only the first is provided.
* - Returns a merged range of the first and the last if both are provided
* and their lexers match.
* - Otherwise, returns null.
*/
static range(first3, second2) {
if (!second2) {
return first3 && first3.loc;
} else if (!first3 || !first3.loc || !second2.loc || first3.loc.lexer !== second2.loc.lexer) {
return null;
} else {
return new _SourceLocation(first3.loc.lexer, first3.loc.start, second2.loc.end);
}
}
};
Token = class _Token {
static {
__name(this, "Token");
}
// don't expand the token
// used in \noexpand
constructor(text4, loc) {
this.text = void 0;
this.loc = void 0;
this.noexpand = void 0;
this.treatAsRelax = void 0;
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, text4) {
return new _Token(text4, SourceLocation.range(this, endToken));
}
};
ParseError = class _ParseError {
static {
__name(this, "ParseError");
}
// Error start position based on passed-in Token or ParseNode.
// Length of affected text based on passed-in Token or ParseNode.
// The underlying error message without any context added.
constructor(message, token2) {
this.name = void 0;
this.position = void 0;
this.length = void 0;
this.rawMessage = void 0;
var error3 = "KaTeX parse error: " + message;
var start3;
var end2;
var loc = token2 && token2.loc;
if (loc && loc.start <= loc.end) {
var input = loc.lexer.input;
start3 = loc.start;
end2 = loc.end;
if (start3 === input.length) {
error3 += " at end of input: ";
} else {
error3 += " at position " + (start3 + 1) + ": ";
}
var underlined = input.slice(start3, end2).replace(/[^]/g, "$&\u0332");
var left3;
if (start3 > 15) {
left3 = "\u2026" + input.slice(start3 - 15, start3);
} else {
left3 = input.slice(0, start3);
}
var right3;
if (end2 + 15 < input.length) {
right3 = input.slice(end2, end2 + 15) + "\u2026";
} else {
right3 = input.slice(end2);
}
error3 += left3 + underlined + right3;
}
var self2 = new Error(error3);
self2.name = "ParseError";
self2.__proto__ = _ParseError.prototype;
self2.position = start3;
if (start3 != null && end2 != null) {
self2.length = end2 - start3;
}
self2.rawMessage = message;
return self2;
}
};
ParseError.prototype.__proto__ = Error.prototype;
contains = /* @__PURE__ */ __name(function contains2(list, elem) {
return list.indexOf(elem) !== -1;
}, "contains");
deflt = /* @__PURE__ */ __name(function deflt2(setting, defaultIfUndefined) {
return setting === void 0 ? defaultIfUndefined : setting;
}, "deflt");
uppercase = /([A-Z])/g;
hyphenate = /* @__PURE__ */ __name(function hyphenate2(str2) {
return str2.replace(uppercase, "-$1").toLowerCase();
}, "hyphenate");
ESCAPE_LOOKUP = {
"&": "&",
">": ">",
"<": "<",
'"': """,
"'": "'"
};
ESCAPE_REGEX = /[&><"']/g;
__name(escape2, "escape");
getBaseElem = /* @__PURE__ */ __name(function getBaseElem2(group2) {
if (group2.type === "ordgroup") {
if (group2.body.length === 1) {
return getBaseElem2(group2.body[0]);
} else {
return group2;
}
} else if (group2.type === "color") {
if (group2.body.length === 1) {
return getBaseElem2(group2.body[0]);
} else {
return group2;
}
} else if (group2.type === "font") {
return getBaseElem2(group2.body);
} else {
return group2;
}
}, "getBaseElem");
isCharacterBox = /* @__PURE__ */ __name(function isCharacterBox2(group2) {
var baseElem = getBaseElem(group2);
return baseElem.type === "mathord" || baseElem.type === "textord" || baseElem.type === "atom";
}, "isCharacterBox");
assert = /* @__PURE__ */ __name(function assert2(value2) {
if (!value2) {
throw new Error("Expected non-null, but got " + String(value2));
}
return value2;
}, "assert");
protocolFromUrl = /* @__PURE__ */ __name(function protocolFromUrl2(url) {
var protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|*58|*3a|&colon)/i.exec(url);
if (!protocol) {
return "_relative";
}
if (protocol[2] !== ":") {
return null;
}
if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) {
return null;
}
return protocol[1].toLowerCase();
}, "protocolFromUrl");
utils = {
contains,
deflt,
escape: escape2,
hyphenate,
getBaseElem,
isCharacterBox,
protocolFromUrl
};
SETTINGS_SCHEMA = {
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: true,
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: /* @__PURE__ */ __name((color2) => "#" + color2, "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: /* @__PURE__ */ __name((def, defs2) => {
defs2.push(def);
return defs2;
}, "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: /* @__PURE__ */ __name((t4) => Math.max(0, t4), "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: false
},
trust: {
type: ["boolean", "function"],
description: "Trust the input, enabling all HTML features such as \\url.",
cli: "-T, --trust"
},
maxSize: {
type: "number",
default: Infinity,
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: /* @__PURE__ */ __name((s2) => Math.max(0, s2), "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: /* @__PURE__ */ __name((n2) => Math.max(0, n2), "processor"),
cli: "-e, --max-expand ",
cliProcessor: /* @__PURE__ */ __name((n2) => n2 === "Infinity" ? Infinity : parseInt(n2), "cliProcessor")
},
globalGroup: {
type: "boolean",
cli: false
}
};
__name(getDefaultValue, "getDefaultValue");
Settings = class {
static {
__name(this, "Settings");
}
constructor(options2) {
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;
options2 = options2 || {};
for (var prop in SETTINGS_SCHEMA) {
if (SETTINGS_SCHEMA.hasOwnProperty(prop)) {
var schema2 = SETTINGS_SCHEMA[prop];
this[prop] = options2[prop] !== void 0 ? schema2.processor ? schema2.processor(options2[prop]) : options2[prop] : getDefaultValue(schema2);
}
}
}
/**
* Report nonstrict (non-LaTeX-compatible) input.
* Can safely not be called if `this.strict` is false in JavaScript.
*/
reportNonstrict(errorCode, errorMsg, token2) {
var strict = this.strict;
if (typeof strict === "function") {
strict = strict(errorCode, errorMsg, token2);
}
if (!strict || strict === "ignore") {
return;
} else if (strict === true || strict === "error") {
throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token2);
} else if (strict === "warn") {
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
} else {
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
}
}
/**
* Check whether to apply strict (LaTeX-adhering) behavior for unusual
* input (like `\\`). Unlike `nonstrict`, will not throw an error;
* instead, "error" translates to a return value of `true`, while "ignore"
* translates to a return value of `false`. May still print a warning:
* "warn" prints a warning and returns `false`.
* This is for the second category of `errorCode`s listed in the README.
*/
useStrictBehavior(errorCode, errorMsg, token2) {
var strict = this.strict;
if (typeof strict === "function") {
try {
strict = strict(errorCode, errorMsg, token2);
} catch (error3) {
strict = "error";
}
}
if (!strict || strict === "ignore") {
return false;
} else if (strict === true || strict === "error") {
return true;
} else if (strict === "warn") {
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
return false;
} else {
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
return false;
}
}
/**
* Check whether to test potentially dangerous input, and return
* `true` (trusted) or `false` (untrusted). The sole argument `context`
* should be an object with `command` field specifying the relevant LaTeX
* command (as a string starting with `\`), and any other arguments, etc.
* If `context` has a `url` field, a `protocol` field will automatically
* get added by this function (changing the specified object).
*/
isTrusted(context) {
if (context.url && !context.protocol) {
var protocol = utils.protocolFromUrl(context.url);
if (protocol == null) {
return false;
}
context.protocol = protocol;
}
var trust = typeof this.trust === "function" ? this.trust(context) : this.trust;
return Boolean(trust);
}
};
Style = class {
static {
__name(this, "Style");
}
constructor(id30, size4, cramped) {
this.id = void 0;
this.size = void 0;
this.cramped = void 0;
this.id = id30;
this.size = size4;
this.cramped = cramped;
}
/**
* Get the style of a superscript given a base in the current style.
*/
sup() {
return styles[sup[this.id]];
}
/**
* Get the style of a subscript given a base in the current style.
*/
sub() {
return styles[sub[this.id]];
}
/**
* Get the style of a fraction numerator given the fraction in the current
* style.
*/
fracNum() {
return styles[fracNum[this.id]];
}
/**
* Get the style of a fraction denominator given the fraction in the current
* style.
*/
fracDen() {
return styles[fracDen[this.id]];
}
/**
* Get the cramped version of a style (in particular, cramping a cramped style
* doesn't change the style).
*/
cramp() {
return styles[cramp[this.id]];
}
/**
* Get a text or display version of this style.
*/
text() {
return styles[text$1[this.id]];
}
/**
* Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
*/
isTight() {
return this.size >= 2;
}
};
D = 0;
Dc = 1;
T = 2;
Tc = 3;
S = 4;
Sc = 5;
SS = 6;
SSc = 7;
styles = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)];
sup = [S, Sc, S, Sc, SS, SSc, SS, SSc];
sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc];
fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc];
fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];
cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc];
text$1 = [D, Dc, T, Tc, T, Tc, T, Tc];
Style$1 = {
DISPLAY: styles[D],
TEXT: styles[T],
SCRIPT: styles[S],
SCRIPTSCRIPT: styles[SS]
};
scriptData = [{
// Latin characters beyond the Latin-1 characters we have metrics for.
// Needed for Czech, Hungarian and Turkish text, for example.
name: "latin",
blocks: [
[256, 591],
// Latin Extended-A and Latin Extended-B
[768, 879]
// Combining Diacritical marks
]
}, {
// The Cyrillic script used by Russian and related languages.
// A Cyrillic subset used to be supported as explicitly defined
// symbols in symbols.js
name: "cyrillic",
blocks: [[1024, 1279]]
}, {
// Armenian
name: "armenian",
blocks: [[1328, 1423]]
}, {
// The Brahmic scripts of South and Southeast Asia
// Devanagari (0900–097F)
// Bengali (0980–09FF)
// Gurmukhi (0A00–0A7F)
// Gujarati (0A80–0AFF)
// Oriya (0B00–0B7F)
// Tamil (0B80–0BFF)
// Telugu (0C00–0C7F)
// Kannada (0C80–0CFF)
// Malayalam (0D00–0D7F)
// Sinhala (0D80–0DFF)
// Thai (0E00–0E7F)
// Lao (0E80–0EFF)
// Tibetan (0F00–0FFF)
// Myanmar (1000–109F)
name: "brahmic",
blocks: [[2304, 4255]]
}, {
name: "georgian",
blocks: [[4256, 4351]]
}, {
// Chinese and Japanese.
// The "k" in cjk is for Korean, but we've separated Korean out
name: "cjk",
blocks: [
[12288, 12543],
// CJK symbols and punctuation, Hiragana, Katakana
[19968, 40879],
// CJK ideograms
[65280, 65376]
// Fullwidth punctuation
// TODO: add halfwidth Katakana and Romanji glyphs
]
}, {
// Korean
name: "hangul",
blocks: [[44032, 55215]]
}];
__name(scriptFromCodepoint, "scriptFromCodepoint");
allBlocks = [];
scriptData.forEach((s2) => s2.blocks.forEach((b3) => allBlocks.push(...b3)));
__name(supportedCodepoint, "supportedCodepoint");
hLinePad = 80;
sqrtMain = /* @__PURE__ */ __name(function sqrtMain2(extraVinculum, hLinePad2) {
return "M95," + (622 + extraVinculum + hLinePad2) + "\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.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\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl" + extraVinculum / 2.075 + " -" + extraVinculum + "\nc5.3,-9.3,12,-14,20,-14\nH400000v" + (40 + extraVinculum) + "H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM" + (834 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z";
}, "sqrtMain");
sqrtSize1 = /* @__PURE__ */ __name(function sqrtSize12(extraVinculum, hLinePad2) {
return "M263," + (601 + extraVinculum + hLinePad2) + "c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl" + extraVinculum / 2.084 + " -" + extraVinculum + "\nc4.7,-7.3,11,-11,19,-11\nH40000v" + (40 + extraVinculum) + "H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z";
}, "sqrtSize1");
sqrtSize2 = /* @__PURE__ */ __name(function sqrtSize22(extraVinculum, hLinePad2) {
return "M983 " + (10 + extraVinculum + hLinePad2) + "\nl" + extraVinculum / 3.13 + " -" + extraVinculum + "\nc4,-6.7,10,-10,18,-10 H400000v" + (40 + extraVinculum) + "\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z";
}, "sqrtSize2");
sqrtSize3 = /* @__PURE__ */ __name(function sqrtSize32(extraVinculum, hLinePad2) {
return "M424," + (2398 + extraVinculum + hLinePad2) + "\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-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\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl" + extraVinculum / 4.223 + " -" + extraVinculum + "c4,-6.7,10,-10,18,-10 H400000\nv" + (40 + extraVinculum) + "H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M" + (1001 + extraVinculum) + " " + hLinePad2 + "\nh400000v" + (40 + extraVinculum) + "h-400000z";
}, "sqrtSize3");
sqrtSize4 = /* @__PURE__ */ __name(function sqrtSize42(extraVinculum, hLinePad2) {
return "M473," + (2713 + extraVinculum + hLinePad2) + "\nc339.3,-1799.3,509.3,-2700,510,-2702 l" + extraVinculum / 5.298 + " -" + extraVinculum + "\nc3.3,-7.3,9.3,-11,18,-11 H400000v" + (40 + extraVinculum) + "H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-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\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "H1017.7z";
}, "sqrtSize4");
phasePath = /* @__PURE__ */ __name(function phasePath2(y6) {
var x5 = y6 / 2;
return "M400000 " + y6 + " H0 L" + x5 + " 0 l65 45 L145 " + (y6 - 80) + " H400000z";
}, "phasePath");
sqrtTall = /* @__PURE__ */ __name(function sqrtTall2(extraVinculum, hLinePad2, viewBoxHeight) {
var vertSegment = viewBoxHeight - 54 - hLinePad2 - extraVinculum;
return "M702 " + (extraVinculum + hLinePad2) + "H400000" + (40 + extraVinculum) + "\nH742v" + vertSegment + "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\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 " + hLinePad2 + "H400000v" + (40 + extraVinculum) + "H742z";
}, "sqrtTall");
sqrtPath = /* @__PURE__ */ __name(function sqrtPath2(size4, extraVinculum, viewBoxHeight) {
extraVinculum = 1e3 * extraVinculum;
var path4 = "";
switch (size4) {
case "sqrtMain":
path4 = sqrtMain(extraVinculum, hLinePad);
break;
case "sqrtSize1":
path4 = sqrtSize1(extraVinculum, hLinePad);
break;
case "sqrtSize2":
path4 = sqrtSize2(extraVinculum, hLinePad);
break;
case "sqrtSize3":
path4 = sqrtSize3(extraVinculum, hLinePad);
break;
case "sqrtSize4":
path4 = sqrtSize4(extraVinculum, hLinePad);
break;
case "sqrtTall":
path4 = sqrtTall(extraVinculum, hLinePad, viewBoxHeight);
}
return path4;
}, "sqrtPath");
innerPath = /* @__PURE__ */ __name(function innerPath2(name, height2) {
switch (name) {
case "\u239C":
return "M291 0 H417 V" + height2 + " H291z M291 0 H417 V" + height2 + " H291z";
case "\u2223":
return "M145 0 H188 V" + height2 + " H145z M145 0 H188 V" + height2 + " H145z";
case "\u2225":
return "M145 0 H188 V" + height2 + " H145z M145 0 H188 V" + height2 + " H145z" + ("M367 0 H410 V" + height2 + " H367z M367 0 H410 V" + height2 + " H367z");
case "\u239F":
return "M457 0 H583 V" + height2 + " H457z M457 0 H583 V" + height2 + " H457z";
case "\u23A2":
return "M319 0 H403 V" + height2 + " H319z M319 0 H403 V" + height2 + " H319z";
case "\u23A5":
return "M263 0 H347 V" + height2 + " H263z M263 0 H347 V" + height2 + " H263z";
case "\u23AA":
return "M384 0 H504 V" + height2 + " H384z M384 0 H504 V" + height2 + " H384z";
case "\u23D0":
return "M312 0 H355 V" + height2 + " H312z M312 0 H355 V" + height2 + " H312z";
case "\u2016":
return "M257 0 H300 V" + height2 + " H257z M257 0 H300 V" + height2 + " H257z" + ("M478 0 H521 V" + height2 + " H478z M478 0 H521 V" + height2 + " H478z");
default:
return "";
}
}, "innerPath");
path = {
// The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
doubleleftarrow: "M262 157\nl10-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\n 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\n 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\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",
// doublerightarrow is from glyph U+21D2 in font KaTeX Main
doublerightarrow: "M399738 392l\n-10 10c-34 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\n 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\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",
// leftarrow is from glyph U+2190 in font KaTeX Main
leftarrow: "M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",
// overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
leftbrace: "M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",
leftbraceunder: "M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",
// overgroup is from the MnSymbol package (public domain)
leftgroup: "M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",
leftgroupunder: "M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",
// Harpoons are from glyph U+21BD in font KaTeX Main
leftharpoon: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",
leftharpoonplus: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",
leftharpoondown: "M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",
leftharpoondownplus: "M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",
// hook is from glyph U+21A9 in font KaTeX Main
lefthook: "M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",
leftlinesegment: "M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",
leftmapsto: "M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",
// tofrom is from glyph U+21C4 in font KaTeX AMS Regular
leftToFrom: "M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",
longequal: "M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",
midbrace: "M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",
midbraceunder: "M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",
oiintSize1: "M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",
oiintSize2: "M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",
oiiintSize1: "M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",
oiiintSize2: "M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",
rightarrow: "M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",
rightbrace: "M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",
rightbraceunder: "M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",
rightgroup: "M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",
rightgroupunder: "M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",
rightharpoon: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",
rightharpoonplus: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",
rightharpoondown: "M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",
rightharpoondownplus: "M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",
righthook: "M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",
rightlinesegment: "M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",
rightToFrom: "M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",
// twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
twoheadleftarrow: "M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",
twoheadrightarrow: "M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",
// tilde1 is a modified version of a glyph from the MnSymbol package
tilde1: "M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",
// ditto tilde2, tilde3, & tilde4
tilde2: "M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",
tilde3: "M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",
tilde4: "M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",
// vec is from glyph U+20D7 in font KaTeX Main
vec: "M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",
// widehat1 is a modified version of a glyph from the MnSymbol package
widehat1: "M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",
// ditto widehat2, widehat3, & widehat4
widehat2: "M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
widehat3: "M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
widehat4: "M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
// widecheck paths are all inverted versions of widehat
widecheck1: "M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",
widecheck2: "M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
widecheck3: "M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
widecheck4: "M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
// The next ten paths support reaction arrows from the mhchem package.
// Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
// baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
baraboveleftarrow: "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",
// rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
rightarrowabovebar: "M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",
// The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
// Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
baraboveshortleftharpoon: "M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",
rightharpoonaboveshortbar: "M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-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\nc-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\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",
shortbaraboveleftharpoon: "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",
shortrightharpoonabovebar: "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-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\nc-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\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"
};
tallDelim = /* @__PURE__ */ __name(function tallDelim2(label, midHeight) {
switch (label) {
case "lbrack":
return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v" + midHeight + " v1759 h84z";
case "rbrack":
return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v" + midHeight + " v1759 h84z";
case "vert":
return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z";
case "doublevert":
return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z\nM367 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v" + midHeight + " v585 h43z";
case "lfloor":
return "M319 602 V0 H403 V602 v" + midHeight + " v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z";
case "rfloor":
return "M319 602 V0 H403 V602 v" + midHeight + " v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z";
case "lceil":
return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v602 h84z\nM403 1759 V0 H319 V1759 v" + midHeight + " v602 h84z";
case "rceil":
return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v602 h84z\nM347 1759 V0 h-84 V1759 v" + midHeight + " v602 h84z";
case "lparen":
return "M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0," + (midHeight + 84) + "c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-" + (midHeight + 92) + "c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";
case "rparen":
return "M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0," + (midHeight + 9) + "\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-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,11\nc0,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\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-" + (midHeight + 144) + "c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-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");
DocumentFragment = class {
static {
__name(this, "DocumentFragment");
}
// HtmlDomNode
// Never used; needed for satisfying interface.
constructor(children2) {
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 = children2;
this.classes = [];
this.height = 0;
this.depth = 0;
this.maxFontSize = 0;
this.style = {};
}
hasClass(className) {
return utils.contains(this.classes, className);
}
/** Convert the fragment into a node. */
toNode() {
var frag = document.createDocumentFragment();
for (var i2 = 0; i2 < this.children.length; i2++) {
frag.appendChild(this.children[i2].toNode());
}
return frag;
}
/** Convert the fragment into HTML markup. */
toMarkup() {
var markup = "";
for (var i2 = 0; i2 < this.children.length; i2++) {
markup += this.children[i2].toMarkup();
}
return markup;
}
/**
* Converts the math node into a string, similar to innerText. Applies to
* MathDomNode's only.
*/
toText() {
var toText = /* @__PURE__ */ __name((child) => child.toText(), "toText");
return this.children.map(toText).join("");
}
};
fontMetricsData = {
"AMS-Regular": {
"32": [0, 0, 0, 0, 0.25],
"65": [0, 0.68889, 0, 0, 0.72222],
"66": [0, 0.68889, 0, 0, 0.66667],
"67": [0, 0.68889, 0, 0, 0.72222],
"68": [0, 0.68889, 0, 0, 0.72222],
"69": [0, 0.68889, 0, 0, 0.66667],
"70": [0, 0.68889, 0, 0, 0.61111],
"71": [0, 0.68889, 0, 0, 0.77778],
"72": [0, 0.68889, 0, 0, 0.77778],
"73": [0, 0.68889, 0, 0, 0.38889],
"74": [0.16667, 0.68889, 0, 0, 0.5],
"75": [0, 0.68889, 0, 0, 0.77778],
"76": [0, 0.68889, 0, 0, 0.66667],
"77": [0, 0.68889, 0, 0, 0.94445],
"78": [0, 0.68889, 0, 0, 0.72222],
"79": [0.16667, 0.68889, 0, 0, 0.77778],
"80": [0, 0.68889, 0, 0, 0.61111],
"81": [0.16667, 0.68889, 0, 0, 0.77778],
"82": [0, 0.68889, 0, 0, 0.72222],
"83": [0, 0.68889, 0, 0, 0.55556],
"84": [0, 0.68889, 0, 0, 0.66667],
"85": [0, 0.68889, 0, 0, 0.72222],
"86": [0, 0.68889, 0, 0, 0.72222],
"87": [0, 0.68889, 0, 0, 1],
"88": [0, 0.68889, 0, 0, 0.72222],
"89": [0, 0.68889, 0, 0, 0.72222],
"90": [0, 0.68889, 0, 0, 0.66667],
"107": [0, 0.68889, 0, 0, 0.55556],
"160": [0, 0, 0, 0, 0.25],
"165": [0, 0.675, 0.025, 0, 0.75],
"174": [0.15559, 0.69224, 0, 0, 0.94666],
"240": [0, 0.68889, 0, 0, 0.55556],
"295": [0, 0.68889, 0, 0, 0.54028],
"710": [0, 0.825, 0, 0, 2.33334],
"732": [0, 0.9, 0, 0, 2.33334],
"770": [0, 0.825, 0, 0, 2.33334],
"771": [0, 0.9, 0, 0, 2.33334],
"989": [0.08167, 0.58167, 0, 0, 0.77778],
"1008": [0, 0.43056, 0.04028, 0, 0.66667],
"8245": [0, 0.54986, 0, 0, 0.275],
"8463": [0, 0.68889, 0, 0, 0.54028],
"8487": [0, 0.68889, 0, 0, 0.72222],
"8498": [0, 0.68889, 0, 0, 0.55556],
"8502": [0, 0.68889, 0, 0, 0.66667],
"8503": [0, 0.68889, 0, 0, 0.44445],
"8504": [0, 0.68889, 0, 0, 0.66667],
"8513": [0, 0.68889, 0, 0, 0.63889],
"8592": [-0.03598, 0.46402, 0, 0, 0.5],
"8594": [-0.03598, 0.46402, 0, 0, 0.5],
"8602": [-0.13313, 0.36687, 0, 0, 1],
"8603": [-0.13313, 0.36687, 0, 0, 1],
"8606": [0.01354, 0.52239, 0, 0, 1],
"8608": [0.01354, 0.52239, 0, 0, 1],
"8610": [0.01354, 0.52239, 0, 0, 1.11111],
"8611": [0.01354, 0.52239, 0, 0, 1.11111],
"8619": [0, 0.54986, 0, 0, 1],
"8620": [0, 0.54986, 0, 0, 1],
"8621": [-0.13313, 0.37788, 0, 0, 1.38889],
"8622": [-0.13313, 0.36687, 0, 0, 1],
"8624": [0, 0.69224, 0, 0, 0.5],
"8625": [0, 0.69224, 0, 0, 0.5],
"8630": [0, 0.43056, 0, 0, 1],
"8631": [0, 0.43056, 0, 0, 1],
"8634": [0.08198, 0.58198, 0, 0, 0.77778],
"8635": [0.08198, 0.58198, 0, 0, 0.77778],
"8638": [0.19444, 0.69224, 0, 0, 0.41667],
"8639": [0.19444, 0.69224, 0, 0, 0.41667],
"8642": [0.19444, 0.69224, 0, 0, 0.41667],
"8643": [0.19444, 0.69224, 0, 0, 0.41667],
"8644": [0.1808, 0.675, 0, 0, 1],
"8646": [0.1808, 0.675, 0, 0, 1],
"8647": [0.1808, 0.675, 0, 0, 1],
"8648": [0.19444, 0.69224, 0, 0, 0.83334],
"8649": [0.1808, 0.675, 0, 0, 1],
"8650": [0.19444, 0.69224, 0, 0, 0.83334],
"8651": [0.01354, 0.52239, 0, 0, 1],
"8652": [0.01354, 0.52239, 0, 0, 1],
"8653": [-0.13313, 0.36687, 0, 0, 1],
"8654": [-0.13313, 0.36687, 0, 0, 1],
"8655": [-0.13313, 0.36687, 0, 0, 1],
"8666": [0.13667, 0.63667, 0, 0, 1],
"8667": [0.13667, 0.63667, 0, 0, 1],
"8669": [-0.13313, 0.37788, 0, 0, 1],
"8672": [-0.064, 0.437, 0, 0, 1.334],
"8674": [-0.064, 0.437, 0, 0, 1.334],
"8705": [0, 0.825, 0, 0, 0.5],
"8708": [0, 0.68889, 0, 0, 0.55556],
"8709": [0.08167, 0.58167, 0, 0, 0.77778],
"8717": [0, 0.43056, 0, 0, 0.42917],
"8722": [-0.03598, 0.46402, 0, 0, 0.5],
"8724": [0.08198, 0.69224, 0, 0, 0.77778],
"8726": [0.08167, 0.58167, 0, 0, 0.77778],
"8733": [0, 0.69224, 0, 0, 0.77778],
"8736": [0, 0.69224, 0, 0, 0.72222],
"8737": [0, 0.69224, 0, 0, 0.72222],
"8738": [0.03517, 0.52239, 0, 0, 0.72222],
"8739": [0.08167, 0.58167, 0, 0, 0.22222],
"8740": [0.25142, 0.74111, 0, 0, 0.27778],
"8741": [0.08167, 0.58167, 0, 0, 0.38889],
"8742": [0.25142, 0.74111, 0, 0, 0.5],
"8756": [0, 0.69224, 0, 0, 0.66667],
"8757": [0, 0.69224, 0, 0, 0.66667],
"8764": [-0.13313, 0.36687, 0, 0, 0.77778],
"8765": [-0.13313, 0.37788, 0, 0, 0.77778],
"8769": [-0.13313, 0.36687, 0, 0, 0.77778],
"8770": [-0.03625, 0.46375, 0, 0, 0.77778],
"8774": [0.30274, 0.79383, 0, 0, 0.77778],
"8776": [-0.01688, 0.48312, 0, 0, 0.77778],
"8778": [0.08167, 0.58167, 0, 0, 0.77778],
"8782": [0.06062, 0.54986, 0, 0, 0.77778],
"8783": [0.06062, 0.54986, 0, 0, 0.77778],
"8785": [0.08198, 0.58198, 0, 0, 0.77778],
"8786": [0.08198, 0.58198, 0, 0, 0.77778],
"8787": [0.08198, 0.58198, 0, 0, 0.77778],
"8790": [0, 0.69224, 0, 0, 0.77778],
"8791": [0.22958, 0.72958, 0, 0, 0.77778],
"8796": [0.08198, 0.91667, 0, 0, 0.77778],
"8806": [0.25583, 0.75583, 0, 0, 0.77778],
"8807": [0.25583, 0.75583, 0, 0, 0.77778],
"8808": [0.25142, 0.75726, 0, 0, 0.77778],
"8809": [0.25142, 0.75726, 0, 0, 0.77778],
"8812": [0.25583, 0.75583, 0, 0, 0.5],
"8814": [0.20576, 0.70576, 0, 0, 0.77778],
"8815": [0.20576, 0.70576, 0, 0, 0.77778],
"8816": [0.30274, 0.79383, 0, 0, 0.77778],
"8817": [0.30274, 0.79383, 0, 0, 0.77778],
"8818": [0.22958, 0.72958, 0, 0, 0.77778],
"8819": [0.22958, 0.72958, 0, 0, 0.77778],
"8822": [0.1808, 0.675, 0, 0, 0.77778],
"8823": [0.1808, 0.675, 0, 0, 0.77778],
"8828": [0.13667, 0.63667, 0, 0, 0.77778],
"8829": [0.13667, 0.63667, 0, 0, 0.77778],
"8830": [0.22958, 0.72958, 0, 0, 0.77778],
"8831": [0.22958, 0.72958, 0, 0, 0.77778],
"8832": [0.20576, 0.70576, 0, 0, 0.77778],
"8833": [0.20576, 0.70576, 0, 0, 0.77778],
"8840": [0.30274, 0.79383, 0, 0, 0.77778],
"8841": [0.30274, 0.79383, 0, 0, 0.77778],
"8842": [0.13597, 0.63597, 0, 0, 0.77778],
"8843": [0.13597, 0.63597, 0, 0, 0.77778],
"8847": [0.03517, 0.54986, 0, 0, 0.77778],
"8848": [0.03517, 0.54986, 0, 0, 0.77778],
"8858": [0.08198, 0.58198, 0, 0, 0.77778],
"8859": [0.08198, 0.58198, 0, 0, 0.77778],
"8861": [0.08198, 0.58198, 0, 0, 0.77778],
"8862": [0, 0.675, 0, 0, 0.77778],
"8863": [0, 0.675, 0, 0, 0.77778],
"8864": [0, 0.675, 0, 0, 0.77778],
"8865": [0, 0.675, 0, 0, 0.77778],
"8872": [0, 0.69224, 0, 0, 0.61111],
"8873": [0, 0.69224, 0, 0, 0.72222],
"8874": [0, 0.69224, 0, 0, 0.88889],
"8876": [0, 0.68889, 0, 0, 0.61111],
"8877": [0, 0.68889, 0, 0, 0.61111],
"8878": [0, 0.68889, 0, 0, 0.72222],
"8879": [0, 0.68889, 0, 0, 0.72222],
"8882": [0.03517, 0.54986, 0, 0, 0.77778],
"8883": [0.03517, 0.54986, 0, 0, 0.77778],
"8884": [0.13667, 0.63667, 0, 0, 0.77778],
"8885": [0.13667, 0.63667, 0, 0, 0.77778],
"8888": [0, 0.54986, 0, 0, 1.11111],
"8890": [0.19444, 0.43056, 0, 0, 0.55556],
"8891": [0.19444, 0.69224, 0, 0, 0.61111],
"8892": [0.19444, 0.69224, 0, 0, 0.61111],
"8901": [0, 0.54986, 0, 0, 0.27778],
"8903": [0.08167, 0.58167, 0, 0, 0.77778],
"8905": [0.08167, 0.58167, 0, 0, 0.77778],
"8906": [0.08167, 0.58167, 0, 0, 0.77778],
"8907": [0, 0.69224, 0, 0, 0.77778],
"8908": [0, 0.69224, 0, 0, 0.77778],
"8909": [-0.03598, 0.46402, 0, 0, 0.77778],
"8910": [0, 0.54986, 0, 0, 0.76042],
"8911": [0, 0.54986, 0, 0, 0.76042],
"8912": [0.03517, 0.54986, 0, 0, 0.77778],
"8913": [0.03517, 0.54986, 0, 0, 0.77778],
"8914": [0, 0.54986, 0, 0, 0.66667],
"8915": [0, 0.54986, 0, 0, 0.66667],
"8916": [0, 0.69224, 0, 0, 0.66667],
"8918": [0.0391, 0.5391, 0, 0, 0.77778],
"8919": [0.0391, 0.5391, 0, 0, 0.77778],
"8920": [0.03517, 0.54986, 0, 0, 1.33334],
"8921": [0.03517, 0.54986, 0, 0, 1.33334],
"8922": [0.38569, 0.88569, 0, 0, 0.77778],
"8923": [0.38569, 0.88569, 0, 0, 0.77778],
"8926": [0.13667, 0.63667, 0, 0, 0.77778],
"8927": [0.13667, 0.63667, 0, 0, 0.77778],
"8928": [0.30274, 0.79383, 0, 0, 0.77778],
"8929": [0.30274, 0.79383, 0, 0, 0.77778],
"8934": [0.23222, 0.74111, 0, 0, 0.77778],
"8935": [0.23222, 0.74111, 0, 0, 0.77778],
"8936": [0.23222, 0.74111, 0, 0, 0.77778],
"8937": [0.23222, 0.74111, 0, 0, 0.77778],
"8938": [0.20576, 0.70576, 0, 0, 0.77778],
"8939": [0.20576, 0.70576, 0, 0, 0.77778],
"8940": [0.30274, 0.79383, 0, 0, 0.77778],
"8941": [0.30274, 0.79383, 0, 0, 0.77778],
"8994": [0.19444, 0.69224, 0, 0, 0.77778],
"8995": [0.19444, 0.69224, 0, 0, 0.77778],
"9416": [0.15559, 0.69224, 0, 0, 0.90222],
"9484": [0, 0.69224, 0, 0, 0.5],
"9488": [0, 0.69224, 0, 0, 0.5],
"9492": [0, 0.37788, 0, 0, 0.5],
"9496": [0, 0.37788, 0, 0, 0.5],
"9585": [0.19444, 0.68889, 0, 0, 0.88889],
"9586": [0.19444, 0.74111, 0, 0, 0.88889],
"9632": [0, 0.675, 0, 0, 0.77778],
"9633": [0, 0.675, 0, 0, 0.77778],
"9650": [0, 0.54986, 0, 0, 0.72222],
"9651": [0, 0.54986, 0, 0, 0.72222],
"9654": [0.03517, 0.54986, 0, 0, 0.77778],
"9660": [0, 0.54986, 0, 0, 0.72222],
"9661": [0, 0.54986, 0, 0, 0.72222],
"9664": [0.03517, 0.54986, 0, 0, 0.77778],
"9674": [0.11111, 0.69224, 0, 0, 0.66667],
"9733": [0.19444, 0.69224, 0, 0, 0.94445],
"10003": [0, 0.69224, 0, 0, 0.83334],
"10016": [0, 0.69224, 0, 0, 0.83334],
"10731": [0.11111, 0.69224, 0, 0, 0.66667],
"10846": [0.19444, 0.75583, 0, 0, 0.61111],
"10877": [0.13667, 0.63667, 0, 0, 0.77778],
"10878": [0.13667, 0.63667, 0, 0, 0.77778],
"10885": [0.25583, 0.75583, 0, 0, 0.77778],
"10886": [0.25583, 0.75583, 0, 0, 0.77778],
"10887": [0.13597, 0.63597, 0, 0, 0.77778],
"10888": [0.13597, 0.63597, 0, 0, 0.77778],
"10889": [0.26167, 0.75726, 0, 0, 0.77778],
"10890": [0.26167, 0.75726, 0, 0, 0.77778],
"10891": [0.48256, 0.98256, 0, 0, 0.77778],
"10892": [0.48256, 0.98256, 0, 0, 0.77778],
"10901": [0.13667, 0.63667, 0, 0, 0.77778],
"10902": [0.13667, 0.63667, 0, 0, 0.77778],
"10933": [0.25142, 0.75726, 0, 0, 0.77778],
"10934": [0.25142, 0.75726, 0, 0, 0.77778],
"10935": [0.26167, 0.75726, 0, 0, 0.77778],
"10936": [0.26167, 0.75726, 0, 0, 0.77778],
"10937": [0.26167, 0.75726, 0, 0, 0.77778],
"10938": [0.26167, 0.75726, 0, 0, 0.77778],
"10949": [0.25583, 0.75583, 0, 0, 0.77778],
"10950": [0.25583, 0.75583, 0, 0, 0.77778],
"10955": [0.28481, 0.79383, 0, 0, 0.77778],
"10956": [0.28481, 0.79383, 0, 0, 0.77778],
"57350": [0.08167, 0.58167, 0, 0, 0.22222],
"57351": [0.08167, 0.58167, 0, 0, 0.38889],
"57352": [0.08167, 0.58167, 0, 0, 0.77778],
"57353": [0, 0.43056, 0.04028, 0, 0.66667],
"57356": [0.25142, 0.75726, 0, 0, 0.77778],
"57357": [0.25142, 0.75726, 0, 0, 0.77778],
"57358": [0.41951, 0.91951, 0, 0, 0.77778],
"57359": [0.30274, 0.79383, 0, 0, 0.77778],
"57360": [0.30274, 0.79383, 0, 0, 0.77778],
"57361": [0.41951, 0.91951, 0, 0, 0.77778],
"57366": [0.25142, 0.75726, 0, 0, 0.77778],
"57367": [0.25142, 0.75726, 0, 0, 0.77778],
"57368": [0.25142, 0.75726, 0, 0, 0.77778],
"57369": [0.25142, 0.75726, 0, 0, 0.77778],
"57370": [0.13597, 0.63597, 0, 0, 0.77778],
"57371": [0.13597, 0.63597, 0, 0, 0.77778]
},
"Caligraphic-Regular": {
"32": [0, 0, 0, 0, 0.25],
"65": [0, 0.68333, 0, 0.19445, 0.79847],
"66": [0, 0.68333, 0.03041, 0.13889, 0.65681],
"67": [0, 0.68333, 0.05834, 0.13889, 0.52653],
"68": [0, 0.68333, 0.02778, 0.08334, 0.77139],
"69": [0, 0.68333, 0.08944, 0.11111, 0.52778],
"70": [0, 0.68333, 0.09931, 0.11111, 0.71875],
"71": [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
"72": [0, 0.68333, 965e-5, 0.11111, 0.84452],
"73": [0, 0.68333, 0.07382, 0, 0.54452],
"74": [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
"75": [0, 0.68333, 0.01445, 0.05556, 0.76195],
"76": [0, 0.68333, 0, 0.13889, 0.68972],
"77": [0, 0.68333, 0, 0.13889, 1.2009],
"78": [0, 0.68333, 0.14736, 0.08334, 0.82049],
"79": [0, 0.68333, 0.02778, 0.11111, 0.79611],
"80": [0, 0.68333, 0.08222, 0.08334, 0.69556],
"81": [0.09722, 0.68333, 0, 0.11111, 0.81667],
"82": [0, 0.68333, 0, 0.08334, 0.8475],
"83": [0, 0.68333, 0.075, 0.13889, 0.60556],
"84": [0, 0.68333, 0.25417, 0, 0.54464],
"85": [0, 0.68333, 0.09931, 0.08334, 0.62583],
"86": [0, 0.68333, 0.08222, 0, 0.61278],
"87": [0, 0.68333, 0.08222, 0.08334, 0.98778],
"88": [0, 0.68333, 0.14643, 0.13889, 0.7133],
"89": [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
"90": [0, 0.68333, 0.07944, 0.13889, 0.72473],
"160": [0, 0, 0, 0, 0.25]
},
"Fraktur-Regular": {
"32": [0, 0, 0, 0, 0.25],
"33": [0, 0.69141, 0, 0, 0.29574],
"34": [0, 0.69141, 0, 0, 0.21471],
"38": [0, 0.69141, 0, 0, 0.73786],
"39": [0, 0.69141, 0, 0, 0.21201],
"40": [0.24982, 0.74947, 0, 0, 0.38865],
"41": [0.24982, 0.74947, 0, 0, 0.38865],
"42": [0, 0.62119, 0, 0, 0.27764],
"43": [0.08319, 0.58283, 0, 0, 0.75623],
"44": [0, 0.10803, 0, 0, 0.27764],
"45": [0.08319, 0.58283, 0, 0, 0.75623],
"46": [0, 0.10803, 0, 0, 0.27764],
"47": [0.24982, 0.74947, 0, 0, 0.50181],
"48": [0, 0.47534, 0, 0, 0.50181],
"49": [0, 0.47534, 0, 0, 0.50181],
"50": [0, 0.47534, 0, 0, 0.50181],
"51": [0.18906, 0.47534, 0, 0, 0.50181],
"52": [0.18906, 0.47534, 0, 0, 0.50181],
"53": [0.18906, 0.47534, 0, 0, 0.50181],
"54": [0, 0.69141, 0, 0, 0.50181],
"55": [0.18906, 0.47534, 0, 0, 0.50181],
"56": [0, 0.69141, 0, 0, 0.50181],
"57": [0.18906, 0.47534, 0, 0, 0.50181],
"58": [0, 0.47534, 0, 0, 0.21606],
"59": [0.12604, 0.47534, 0, 0, 0.21606],
"61": [-0.13099, 0.36866, 0, 0, 0.75623],
"63": [0, 0.69141, 0, 0, 0.36245],
"65": [0, 0.69141, 0, 0, 0.7176],
"66": [0, 0.69141, 0, 0, 0.88397],
"67": [0, 0.69141, 0, 0, 0.61254],
"68": [0, 0.69141, 0, 0, 0.83158],
"69": [0, 0.69141, 0, 0, 0.66278],
"70": [0.12604, 0.69141, 0, 0, 0.61119],
"71": [0, 0.69141, 0, 0, 0.78539],
"72": [0.06302, 0.69141, 0, 0, 0.7203],
"73": [0, 0.69141, 0, 0, 0.55448],
"74": [0.12604, 0.69141, 0, 0, 0.55231],
"75": [0, 0.69141, 0, 0, 0.66845],
"76": [0, 0.69141, 0, 0, 0.66602],
"77": [0, 0.69141, 0, 0, 1.04953],
"78": [0, 0.69141, 0, 0, 0.83212],
"79": [0, 0.69141, 0, 0, 0.82699],
"80": [0.18906, 0.69141, 0, 0, 0.82753],
"81": [0.03781, 0.69141, 0, 0, 0.82699],
"82": [0, 0.69141, 0, 0, 0.82807],
"83": [0, 0.69141, 0, 0, 0.82861],
"84": [0, 0.69141, 0, 0, 0.66899],
"85": [0, 0.69141, 0, 0, 0.64576],
"86": [0, 0.69141, 0, 0, 0.83131],
"87": [0, 0.69141, 0, 0, 1.04602],
"88": [0, 0.69141, 0, 0, 0.71922],
"89": [0.18906, 0.69141, 0, 0, 0.83293],
"90": [0.12604, 0.69141, 0, 0, 0.60201],
"91": [0.24982, 0.74947, 0, 0, 0.27764],
"93": [0.24982, 0.74947, 0, 0, 0.27764],
"94": [0, 0.69141, 0, 0, 0.49965],
"97": [0, 0.47534, 0, 0, 0.50046],
"98": [0, 0.69141, 0, 0, 0.51315],
"99": [0, 0.47534, 0, 0, 0.38946],
"100": [0, 0.62119, 0, 0, 0.49857],
"101": [0, 0.47534, 0, 0, 0.40053],
"102": [0.18906, 0.69141, 0, 0, 0.32626],
"103": [0.18906, 0.47534, 0, 0, 0.5037],
"104": [0.18906, 0.69141, 0, 0, 0.52126],
"105": [0, 0.69141, 0, 0, 0.27899],
"106": [0, 0.69141, 0, 0, 0.28088],
"107": [0, 0.69141, 0, 0, 0.38946],
"108": [0, 0.69141, 0, 0, 0.27953],
"109": [0, 0.47534, 0, 0, 0.76676],
"110": [0, 0.47534, 0, 0, 0.52666],
"111": [0, 0.47534, 0, 0, 0.48885],
"112": [0.18906, 0.52396, 0, 0, 0.50046],
"113": [0.18906, 0.47534, 0, 0, 0.48912],
"114": [0, 0.47534, 0, 0, 0.38919],
"115": [0, 0.47534, 0, 0, 0.44266],
"116": [0, 0.62119, 0, 0, 0.33301],
"117": [0, 0.47534, 0, 0, 0.5172],
"118": [0, 0.52396, 0, 0, 0.5118],
"119": [0, 0.52396, 0, 0, 0.77351],
"120": [0.18906, 0.47534, 0, 0, 0.38865],
"121": [0.18906, 0.47534, 0, 0, 0.49884],
"122": [0.18906, 0.47534, 0, 0, 0.39054],
"160": [0, 0, 0, 0, 0.25],
"8216": [0, 0.69141, 0, 0, 0.21471],
"8217": [0, 0.69141, 0, 0, 0.21471],
"58112": [0, 0.62119, 0, 0, 0.49749],
"58113": [0, 0.62119, 0, 0, 0.4983],
"58114": [0.18906, 0.69141, 0, 0, 0.33328],
"58115": [0.18906, 0.69141, 0, 0, 0.32923],
"58116": [0.18906, 0.47534, 0, 0, 0.50343],
"58117": [0, 0.69141, 0, 0, 0.33301],
"58118": [0, 0.62119, 0, 0, 0.33409],
"58119": [0, 0.47534, 0, 0, 0.50073]
},
"Main-Bold": {
"32": [0, 0, 0, 0, 0.25],
"33": [0, 0.69444, 0, 0, 0.35],
"34": [0, 0.69444, 0, 0, 0.60278],
"35": [0.19444, 0.69444, 0, 0, 0.95833],
"36": [0.05556, 0.75, 0, 0, 0.575],
"37": [0.05556, 0.75, 0, 0, 0.95833],
"38": [0, 0.69444, 0, 0, 0.89444],
"39": [0, 0.69444, 0, 0, 0.31944],
"40": [0.25, 0.75, 0, 0, 0.44722],
"41": [0.25, 0.75, 0, 0, 0.44722],
"42": [0, 0.75, 0, 0, 0.575],
"43": [0.13333, 0.63333, 0, 0, 0.89444],
"44": [0.19444, 0.15556, 0, 0, 0.31944],
"45": [0, 0.44444, 0, 0, 0.38333],
"46": [0, 0.15556, 0, 0, 0.31944],
"47": [0.25, 0.75, 0, 0, 0.575],
"48": [0, 0.64444, 0, 0, 0.575],
"49": [0, 0.64444, 0, 0, 0.575],
"50": [0, 0.64444, 0, 0, 0.575],
"51": [0, 0.64444, 0, 0, 0.575],
"52": [0, 0.64444, 0, 0, 0.575],
"53": [0, 0.64444, 0, 0, 0.575],
"54": [0, 0.64444, 0, 0, 0.575],
"55": [0, 0.64444, 0, 0, 0.575],
"56": [0, 0.64444, 0, 0, 0.575],
"57": [0, 0.64444, 0, 0, 0.575],
"58": [0, 0.44444, 0, 0, 0.31944],
"59": [0.19444, 0.44444, 0, 0, 0.31944],
"60": [0.08556, 0.58556, 0, 0, 0.89444],
"61": [-0.10889, 0.39111, 0, 0, 0.89444],
"62": [0.08556, 0.58556, 0, 0, 0.89444],
"63": [0, 0.69444, 0, 0, 0.54305],
"64": [0, 0.69444, 0, 0, 0.89444],
"65": [0, 0.68611, 0, 0, 0.86944],
"66": [0, 0.68611, 0, 0, 0.81805],
"67": [0, 0.68611, 0, 0, 0.83055],
"68": [0, 0.68611, 0, 0, 0.88194],
"69": [0, 0.68611, 0, 0, 0.75555],
"70": [0, 0.68611, 0, 0, 0.72361],
"71": [0, 0.68611, 0, 0, 0.90416],
"72": [0, 0.68611, 0, 0, 0.9],
"73": [0, 0.68611, 0, 0, 0.43611],
"74": [0, 0.68611, 0, 0, 0.59444],
"75": [0, 0.68611, 0, 0, 0.90138],
"76": [0, 0.68611, 0, 0, 0.69166],
"77": [0, 0.68611, 0, 0, 1.09166],
"78": [0, 0.68611, 0, 0, 0.9],
"79": [0, 0.68611, 0, 0, 0.86388],
"80": [0, 0.68611, 0, 0, 0.78611],
"81": [0.19444, 0.68611, 0, 0, 0.86388],
"82": [0, 0.68611, 0, 0, 0.8625],
"83": [0, 0.68611, 0, 0, 0.63889],
"84": [0, 0.68611, 0, 0, 0.8],
"85": [0, 0.68611, 0, 0, 0.88472],
"86": [0, 0.68611, 0.01597, 0, 0.86944],
"87": [0, 0.68611, 0.01597, 0, 1.18888],
"88": [0, 0.68611, 0, 0, 0.86944],
"89": [0, 0.68611, 0.02875, 0, 0.86944],
"90": [0, 0.68611, 0, 0, 0.70277],
"91": [0.25, 0.75, 0, 0, 0.31944],
"92": [0.25, 0.75, 0, 0, 0.575],
"93": [0.25, 0.75, 0, 0, 0.31944],
"94": [0, 0.69444, 0, 0, 0.575],
"95": [0.31, 0.13444, 0.03194, 0, 0.575],
"97": [0, 0.44444, 0, 0, 0.55902],
"98": [0, 0.69444, 0, 0, 0.63889],
"99": [0, 0.44444, 0, 0, 0.51111],
"100": [0, 0.69444, 0, 0, 0.63889],
"101": [0, 0.44444, 0, 0, 0.52708],
"102": [0, 0.69444, 0.10903, 0, 0.35139],
"103": [0.19444, 0.44444, 0.01597, 0, 0.575],
"104": [0, 0.69444, 0, 0, 0.63889],
"105": [0, 0.69444, 0, 0, 0.31944],
"106": [0.19444, 0.69444, 0, 0, 0.35139],
"107": [0, 0.69444, 0, 0, 0.60694],
"108": [0, 0.69444, 0, 0, 0.31944],
"109": [0, 0.44444, 0, 0, 0.95833],
"110": [0, 0.44444, 0, 0, 0.63889],
"111": [0, 0.44444, 0, 0, 0.575],
"112": [0.19444, 0.44444, 0, 0, 0.63889],
"113": [0.19444, 0.44444, 0, 0, 0.60694],
"114": [0, 0.44444, 0, 0, 0.47361],
"115": [0, 0.44444, 0, 0, 0.45361],
"116": [0, 0.63492, 0, 0, 0.44722],
"117": [0, 0.44444, 0, 0, 0.63889],
"118": [0, 0.44444, 0.01597, 0, 0.60694],
"119": [0, 0.44444, 0.01597, 0, 0.83055],
"120": [0, 0.44444, 0, 0, 0.60694],
"121": [0.19444, 0.44444, 0.01597, 0, 0.60694],
"122": [0, 0.44444, 0, 0, 0.51111],
"123": [0.25, 0.75, 0, 0, 0.575],
"124": [0.25, 0.75, 0, 0, 0.31944],
"125": [0.25, 0.75, 0, 0, 0.575],
"126": [0.35, 0.34444, 0, 0, 0.575],
"160": [0, 0, 0, 0, 0.25],
"163": [0, 0.69444, 0, 0, 0.86853],
"168": [0, 0.69444, 0, 0, 0.575],
"172": [0, 0.44444, 0, 0, 0.76666],
"176": [0, 0.69444, 0, 0, 0.86944],
"177": [0.13333, 0.63333, 0, 0, 0.89444],
"184": [0.17014, 0, 0, 0, 0.51111],
"198": [0, 0.68611, 0, 0, 1.04166],
"215": [0.13333, 0.63333, 0, 0, 0.89444],
"216": [0.04861, 0.73472, 0, 0, 0.89444],
"223": [0, 0.69444, 0, 0, 0.59722],
"230": [0, 0.44444, 0, 0, 0.83055],
"247": [0.13333, 0.63333, 0, 0, 0.89444],
"248": [0.09722, 0.54167, 0, 0, 0.575],
"305": [0, 0.44444, 0, 0, 0.31944],
"338": [0, 0.68611, 0, 0, 1.16944],
"339": [0, 0.44444, 0, 0, 0.89444],
"567": [0.19444, 0.44444, 0, 0, 0.35139],
"710": [0, 0.69444, 0, 0, 0.575],
"711": [0, 0.63194, 0, 0, 0.575],
"713": [0, 0.59611, 0, 0, 0.575],
"714": [0, 0.69444, 0, 0, 0.575],
"715": [0, 0.69444, 0, 0, 0.575],
"728": [0, 0.69444, 0, 0, 0.575],
"729": [0, 0.69444, 0, 0, 0.31944],
"730": [0, 0.69444, 0, 0, 0.86944],
"732": [0, 0.69444, 0, 0, 0.575],
"733": [0, 0.69444, 0, 0, 0.575],
"915": [0, 0.68611, 0, 0, 0.69166],
"916": [0, 0.68611, 0, 0, 0.95833],
"920": [0, 0.68611, 0, 0, 0.89444],
"923": [0, 0.68611, 0, 0, 0.80555],
"926": [0, 0.68611, 0, 0, 0.76666],
"928": [0, 0.68611, 0, 0, 0.9],
"931": [0, 0.68611, 0, 0, 0.83055],
"933": [0, 0.68611, 0, 0, 0.89444],
"934": [0, 0.68611, 0, 0, 0.83055],
"936": [0, 0.68611, 0, 0, 0.89444],
"937": [0, 0.68611, 0, 0, 0.83055],
"8211": [0, 0.44444, 0.03194, 0, 0.575],
"8212": [0, 0.44444, 0.03194, 0, 1.14999],
"8216": [0, 0.69444, 0, 0, 0.31944],
"8217": [0, 0.69444, 0, 0, 0.31944],
"8220": [0, 0.69444, 0, 0, 0.60278],
"8221": [0, 0.69444, 0, 0, 0.60278],
"8224": [0.19444, 0.69444, 0, 0, 0.51111],
"8225": [0.19444, 0.69444, 0, 0, 0.51111],
"8242": [0, 0.55556, 0, 0, 0.34444],
"8407": [0, 0.72444, 0.15486, 0, 0.575],
"8463": [0, 0.69444, 0, 0, 0.66759],
"8465": [0, 0.69444, 0, 0, 0.83055],
"8467": [0, 0.69444, 0, 0, 0.47361],
"8472": [0.19444, 0.44444, 0, 0, 0.74027],
"8476": [0, 0.69444, 0, 0, 0.83055],
"8501": [0, 0.69444, 0, 0, 0.70277],
"8592": [-0.10889, 0.39111, 0, 0, 1.14999],
"8593": [0.19444, 0.69444, 0, 0, 0.575],
"8594": [-0.10889, 0.39111, 0, 0, 1.14999],
"8595": [0.19444, 0.69444, 0, 0, 0.575],
"8596": [-0.10889, 0.39111, 0, 0, 1.14999],
"8597": [0.25, 0.75, 0, 0, 0.575],
"8598": [0.19444, 0.69444, 0, 0, 1.14999],
"8599": [0.19444, 0.69444, 0, 0, 1.14999],
"8600": [0.19444, 0.69444, 0, 0, 1.14999],
"8601": [0.19444, 0.69444, 0, 0, 1.14999],
"8636": [-0.10889, 0.39111, 0, 0, 1.14999],
"8637": [-0.10889, 0.39111, 0, 0, 1.14999],
"8640": [-0.10889, 0.39111, 0, 0, 1.14999],
"8641": [-0.10889, 0.39111, 0, 0, 1.14999],
"8656": [-0.10889, 0.39111, 0, 0, 1.14999],
"8657": [0.19444, 0.69444, 0, 0, 0.70277],
"8658": [-0.10889, 0.39111, 0, 0, 1.14999],
"8659": [0.19444, 0.69444, 0, 0, 0.70277],
"8660": [-0.10889, 0.39111, 0, 0, 1.14999],
"8661": [0.25, 0.75, 0, 0, 0.70277],
"8704": [0, 0.69444, 0, 0, 0.63889],
"8706": [0, 0.69444, 0.06389, 0, 0.62847],
"8707": [0, 0.69444, 0, 0, 0.63889],
"8709": [0.05556, 0.75, 0, 0, 0.575],
"8711": [0, 0.68611, 0, 0, 0.95833],
"8712": [0.08556, 0.58556, 0, 0, 0.76666],
"8715": [0.08556, 0.58556, 0, 0, 0.76666],
"8722": [0.13333, 0.63333, 0, 0, 0.89444],
"8723": [0.13333, 0.63333, 0, 0, 0.89444],
"8725": [0.25, 0.75, 0, 0, 0.575],
"8726": [0.25, 0.75, 0, 0, 0.575],
"8727": [-0.02778, 0.47222, 0, 0, 0.575],
"8728": [-0.02639, 0.47361, 0, 0, 0.575],
"8729": [-0.02639, 0.47361, 0, 0, 0.575],
"8730": [0.18, 0.82, 0, 0, 0.95833],
"8733": [0, 0.44444, 0, 0, 0.89444],
"8734": [0, 0.44444, 0, 0, 1.14999],
"8736": [0, 0.69224, 0, 0, 0.72222],
"8739": [0.25, 0.75, 0, 0, 0.31944],
"8741": [0.25, 0.75, 0, 0, 0.575],
"8743": [0, 0.55556, 0, 0, 0.76666],
"8744": [0, 0.55556, 0, 0, 0.76666],
"8745": [0, 0.55556, 0, 0, 0.76666],
"8746": [0, 0.55556, 0, 0, 0.76666],
"8747": [0.19444, 0.69444, 0.12778, 0, 0.56875],
"8764": [-0.10889, 0.39111, 0, 0, 0.89444],
"8768": [0.19444, 0.69444, 0, 0, 0.31944],
"8771": [222e-5, 0.50222, 0, 0, 0.89444],
"8773": [0.027, 0.638, 0, 0, 0.894],
"8776": [0.02444, 0.52444, 0, 0, 0.89444],
"8781": [222e-5, 0.50222, 0, 0, 0.89444],
"8801": [222e-5, 0.50222, 0, 0, 0.89444],
"8804": [0.19667, 0.69667, 0, 0, 0.89444],
"8805": [0.19667, 0.69667, 0, 0, 0.89444],
"8810": [0.08556, 0.58556, 0, 0, 1.14999],
"8811": [0.08556, 0.58556, 0, 0, 1.14999],
"8826": [0.08556, 0.58556, 0, 0, 0.89444],
"8827": [0.08556, 0.58556, 0, 0, 0.89444],
"8834": [0.08556, 0.58556, 0, 0, 0.89444],
"8835": [0.08556, 0.58556, 0, 0, 0.89444],
"8838": [0.19667, 0.69667, 0, 0, 0.89444],
"8839": [0.19667, 0.69667, 0, 0, 0.89444],
"8846": [0, 0.55556, 0, 0, 0.76666],
"8849": [0.19667, 0.69667, 0, 0, 0.89444],
"8850": [0.19667, 0.69667, 0, 0, 0.89444],
"8851": [0, 0.55556, 0, 0, 0.76666],
"8852": [0, 0.55556, 0, 0, 0.76666],
"8853": [0.13333, 0.63333, 0, 0, 0.89444],
"8854": [0.13333, 0.63333, 0, 0, 0.89444],
"8855": [0.13333, 0.63333, 0, 0, 0.89444],
"8856": [0.13333, 0.63333, 0, 0, 0.89444],
"8857": [0.13333, 0.63333, 0, 0, 0.89444],
"8866": [0, 0.69444, 0, 0, 0.70277],
"8867": [0, 0.69444, 0, 0, 0.70277],
"8868": [0, 0.69444, 0, 0, 0.89444],
"8869": [0, 0.69444, 0, 0, 0.89444],
"8900": [-0.02639, 0.47361, 0, 0, 0.575],
"8901": [-0.02639, 0.47361, 0, 0, 0.31944],
"8902": [-0.02778, 0.47222, 0, 0, 0.575],
"8968": [0.25, 0.75, 0, 0, 0.51111],
"8969": [0.25, 0.75, 0, 0, 0.51111],
"8970": [0.25, 0.75, 0, 0, 0.51111],
"8971": [0.25, 0.75, 0, 0, 0.51111],
"8994": [-0.13889, 0.36111, 0, 0, 1.14999],
"8995": [-0.13889, 0.36111, 0, 0, 1.14999],
"9651": [0.19444, 0.69444, 0, 0, 1.02222],
"9657": [-0.02778, 0.47222, 0, 0, 0.575],
"9661": [0.19444, 0.69444, 0, 0, 1.02222],
"9667": [-0.02778, 0.47222, 0, 0, 0.575],
"9711": [0.19444, 0.69444, 0, 0, 1.14999],
"9824": [0.12963, 0.69444, 0, 0, 0.89444],
"9825": [0.12963, 0.69444, 0, 0, 0.89444],
"9826": [0.12963, 0.69444, 0, 0, 0.89444],
"9827": [0.12963, 0.69444, 0, 0, 0.89444],
"9837": [0, 0.75, 0, 0, 0.44722],
"9838": [0.19444, 0.69444, 0, 0, 0.44722],
"9839": [0.19444, 0.69444, 0, 0, 0.44722],
"10216": [0.25, 0.75, 0, 0, 0.44722],
"10217": [0.25, 0.75, 0, 0, 0.44722],
"10815": [0, 0.68611, 0, 0, 0.9],
"10927": [0.19667, 0.69667, 0, 0, 0.89444],
"10928": [0.19667, 0.69667, 0, 0, 0.89444],
"57376": [0.19444, 0.69444, 0, 0, 0]
},
"Main-BoldItalic": {
"32": [0, 0, 0, 0, 0.25],
"33": [0, 0.69444, 0.11417, 0, 0.38611],
"34": [0, 0.69444, 0.07939, 0, 0.62055],
"35": [0.19444, 0.69444, 0.06833, 0, 0.94444],
"37": [0.05556, 0.75, 0.12861, 0, 0.94444],
"38": [0, 0.69444, 0.08528, 0, 0.88555],
"39": [0, 0.69444, 0.12945, 0, 0.35555],
"40": [0.25, 0.75, 0.15806, 0, 0.47333],
"41": [0.25, 0.75, 0.03306, 0, 0.47333],
"42": [0, 0.75, 0.14333, 0, 0.59111],
"43": [0.10333, 0.60333, 0.03306, 0, 0.88555],
"44": [0.19444, 0.14722, 0, 0, 0.35555],
"45": [0, 0.44444, 0.02611, 0, 0.41444],
"46": [0, 0.14722, 0, 0, 0.35555],
"47": [0.25, 0.75, 0.15806, 0, 0.59111],
"48": [0, 0.64444, 0.13167, 0, 0.59111],
"49": [0, 0.64444, 0.13167, 0, 0.59111],
"50": [0, 0.64444, 0.13167, 0, 0.59111],
"51": [0, 0.64444, 0.13167, 0, 0.59111],
"52": [0.19444, 0.64444, 0.13167, 0, 0.59111],
"53": [0, 0.64444, 0.13167, 0, 0.59111],
"54": [0, 0.64444, 0.13167, 0, 0.59111],
"55": [0.19444, 0.64444, 0.13167, 0, 0.59111],
"56": [0, 0.64444, 0.13167, 0, 0.59111],
"57": [0, 0.64444, 0.13167, 0, 0.59111],
"58": [0, 0.44444, 0.06695, 0, 0.35555],
"59": [0.19444, 0.44444, 0.06695, 0, 0.35555],
"61": [-0.10889, 0.39111, 0.06833, 0, 0.88555],
"63": [0, 0.69444, 0.11472, 0, 0.59111],
"64": [0, 0.69444, 0.09208, 0, 0.88555],
"65": [0, 0.68611, 0, 0, 0.86555],
"66": [0, 0.68611, 0.0992, 0, 0.81666],
"67": [0, 0.68611, 0.14208, 0, 0.82666],
"68": [0, 0.68611, 0.09062, 0, 0.87555],
"69": [0, 0.68611, 0.11431, 0, 0.75666],
"70": [0, 0.68611, 0.12903, 0, 0.72722],
"71": [0, 0.68611, 0.07347, 0, 0.89527],
"72": [0, 0.68611, 0.17208, 0, 0.8961],
"73": [0, 0.68611, 0.15681, 0, 0.47166],
"74": [0, 0.68611, 0.145, 0, 0.61055],
"75": [0, 0.68611, 0.14208, 0, 0.89499],
"76": [0, 0.68611, 0, 0, 0.69777],
"77": [0, 0.68611, 0.17208, 0, 1.07277],
"78": [0, 0.68611, 0.17208, 0, 0.8961],
"79": [0, 0.68611, 0.09062, 0, 0.85499],
"80": [0, 0.68611, 0.0992, 0, 0.78721],
"81": [0.19444, 0.68611, 0.09062, 0, 0.85499],
"82": [0, 0.68611, 0.02559, 0, 0.85944],
"83": [0, 0.68611, 0.11264, 0, 0.64999],
"84": [0, 0.68611, 0.12903, 0, 0.7961],
"85": [0, 0.68611, 0.17208, 0, 0.88083],
"86": [0, 0.68611, 0.18625, 0, 0.86555],
"87": [0, 0.68611, 0.18625, 0, 1.15999],
"88": [0, 0.68611, 0.15681, 0, 0.86555],
"89": [0, 0.68611, 0.19803, 0, 0.86555],
"90": [0, 0.68611, 0.14208, 0, 0.70888],
"91": [0.25, 0.75, 0.1875, 0, 0.35611],
"93": [0.25, 0.75, 0.09972, 0, 0.35611],
"94": [0, 0.69444, 0.06709, 0, 0.59111],
"95": [0.31, 0.13444, 0.09811, 0, 0.59111],
"97": [0, 0.44444, 0.09426, 0, 0.59111],
"98": [0, 0.69444, 0.07861, 0, 0.53222],
"99": [0, 0.44444, 0.05222, 0, 0.53222],
"100": [0, 0.69444, 0.10861, 0, 0.59111],
"101": [0, 0.44444, 0.085, 0, 0.53222],
"102": [0.19444, 0.69444, 0.21778, 0, 0.4],
"103": [0.19444, 0.44444, 0.105, 0, 0.53222],
"104": [0, 0.69444, 0.09426, 0, 0.59111],
"105": [0, 0.69326, 0.11387, 0, 0.35555],
"106": [0.19444, 0.69326, 0.1672, 0, 0.35555],
"107": [0, 0.69444, 0.11111, 0, 0.53222],
"108": [0, 0.69444, 0.10861, 0, 0.29666],
"109": [0, 0.44444, 0.09426, 0, 0.94444],
"110": [0, 0.44444, 0.09426, 0, 0.64999],
"111": [0, 0.44444, 0.07861, 0, 0.59111],
"112": [0.19444, 0.44444, 0.07861, 0, 0.59111],
"113": [0.19444, 0.44444, 0.105, 0, 0.53222],
"114": [0, 0.44444, 0.11111, 0, 0.50167],
"115": [0, 0.44444, 0.08167, 0, 0.48694],
"116": [0, 0.63492, 0.09639, 0, 0.385],
"117": [0, 0.44444, 0.09426, 0, 0.62055],
"118": [0, 0.44444, 0.11111, 0, 0.53222],
"119": [0, 0.44444, 0.11111, 0, 0.76777],
"120": [0, 0.44444, 0.12583, 0, 0.56055],
"121": [0.19444, 0.44444, 0.105, 0, 0.56166],
"122": [0, 0.44444, 0.13889, 0, 0.49055],
"126": [0.35, 0.34444, 0.11472, 0, 0.59111],
"160": [0, 0, 0, 0, 0.25],
"168": [0, 0.69444, 0.11473, 0, 0.59111],
"176": [0, 0.69444, 0, 0, 0.94888],
"184": [0.17014, 0, 0, 0, 0.53222],
"198": [0, 0.68611, 0.11431, 0, 1.02277],
"216": [0.04861, 0.73472, 0.09062, 0, 0.88555],
"223": [0.19444, 0.69444, 0.09736, 0, 0.665],
"230": [0, 0.44444, 0.085, 0, 0.82666],
"248": [0.09722, 0.54167, 0.09458, 0, 0.59111],
"305": [0, 0.44444, 0.09426, 0, 0.35555],
"338": [0, 0.68611, 0.11431, 0, 1.14054],
"339": [0, 0.44444, 0.085, 0, 0.82666],
"567": [0.19444, 0.44444, 0.04611, 0, 0.385],
"710": [0, 0.69444, 0.06709, 0, 0.59111],
"711": [0, 0.63194, 0.08271, 0, 0.59111],
"713": [0, 0.59444, 0.10444, 0, 0.59111],
"714": [0, 0.69444, 0.08528, 0, 0.59111],
"715": [0, 0.69444, 0, 0, 0.59111],
"728": [0, 0.69444, 0.10333, 0, 0.59111],
"729": [0, 0.69444, 0.12945, 0, 0.35555],
"730": [0, 0.69444, 0, 0, 0.94888],
"732": [0, 0.69444, 0.11472, 0, 0.59111],
"733": [0, 0.69444, 0.11472, 0, 0.59111],
"915": [0, 0.68611, 0.12903, 0, 0.69777],
"916": [0, 0.68611, 0, 0, 0.94444],
"920": [0, 0.68611, 0.09062, 0, 0.88555],
"923": [0, 0.68611, 0, 0, 0.80666],
"926": [0, 0.68611, 0.15092, 0, 0.76777],
"928": [0, 0.68611, 0.17208, 0, 0.8961],
"931": [0, 0.68611, 0.11431, 0, 0.82666],
"933": [0, 0.68611, 0.10778, 0, 0.88555],
"934": [0, 0.68611, 0.05632, 0, 0.82666],
"936": [0, 0.68611, 0.10778, 0, 0.88555],
"937": [0, 0.68611, 0.0992, 0, 0.82666],
"8211": [0, 0.44444, 0.09811, 0, 0.59111],
"8212": [0, 0.44444, 0.09811, 0, 1.18221],
"8216": [0, 0.69444, 0.12945, 0, 0.35555],
"8217": [0, 0.69444, 0.12945, 0, 0.35555],
"8220": [0, 0.69444, 0.16772, 0, 0.62055],
"8221": [0, 0.69444, 0.07939, 0, 0.62055]
},
"Main-Italic": {
"32": [0, 0, 0, 0, 0.25],
"33": [0, 0.69444, 0.12417, 0, 0.30667],
"34": [0, 0.69444, 0.06961, 0, 0.51444],
"35": [0.19444, 0.69444, 0.06616, 0, 0.81777],
"37": [0.05556, 0.75, 0.13639, 0, 0.81777],
"38": [0, 0.69444, 0.09694, 0, 0.76666],
"39": [0, 0.69444, 0.12417, 0, 0.30667],
"40": [0.25, 0.75, 0.16194, 0, 0.40889],
"41": [0.25, 0.75, 0.03694, 0, 0.40889],
"42": [0, 0.75, 0.14917, 0, 0.51111],
"43": [0.05667, 0.56167, 0.03694, 0, 0.76666],
"44": [0.19444, 0.10556, 0, 0, 0.30667],
"45": [0, 0.43056, 0.02826, 0, 0.35778],
"46": [0, 0.10556, 0, 0, 0.30667],
"47": [0.25, 0.75, 0.16194, 0, 0.51111],
"48": [0, 0.64444, 0.13556, 0, 0.51111],
"49": [0, 0.64444, 0.13556, 0, 0.51111],
"50": [0, 0.64444, 0.13556, 0, 0.51111],
"51": [0, 0.64444, 0.13556, 0, 0.51111],
"52": [0.19444, 0.64444, 0.13556, 0, 0.51111],
"53": [0, 0.64444, 0.13556, 0, 0.51111],
"54": [0, 0.64444, 0.13556, 0, 0.51111],
"55": [0.19444, 0.64444, 0.13556, 0, 0.51111],
"56": [0, 0.64444, 0.13556, 0, 0.51111],
"57": [0, 0.64444, 0.13556, 0, 0.51111],
"58": [0, 0.43056, 0.0582, 0, 0.30667],
"59": [0.19444, 0.43056, 0.0582, 0, 0.30667],
"61": [-0.13313, 0.36687, 0.06616, 0, 0.76666],
"63": [0, 0.69444, 0.1225, 0, 0.51111],
"64": [0, 0.69444, 0.09597, 0, 0.76666],
"65": [0, 0.68333, 0, 0, 0.74333],
"66": [0, 0.68333, 0.10257, 0, 0.70389],
"67": [0, 0.68333, 0.14528, 0, 0.71555],
"68": [0, 0.68333, 0.09403, 0, 0.755],
"69": [0, 0.68333, 0.12028, 0, 0.67833],
"70": [0, 0.68333, 0.13305, 0, 0.65277],
"71": [0, 0.68333, 0.08722, 0, 0.77361],
"72": [0, 0.68333, 0.16389, 0, 0.74333],
"73": [0, 0.68333, 0.15806, 0, 0.38555],
"74": [0, 0.68333, 0.14028, 0, 0.525],
"75": [0, 0.68333, 0.14528, 0, 0.76888],
"76": [0, 0.68333, 0, 0, 0.62722],
"77": [0, 0.68333, 0.16389, 0, 0.89666],
"78": [0, 0.68333, 0.16389, 0, 0.74333],
"79": [0, 0.68333, 0.09403, 0, 0.76666],
"80": [0, 0.68333, 0.10257, 0, 0.67833],
"81": [0.19444, 0.68333, 0.09403, 0, 0.76666],
"82": [0, 0.68333, 0.03868, 0, 0.72944],
"83": [0, 0.68333, 0.11972, 0, 0.56222],
"84": [0, 0.68333, 0.13305, 0, 0.71555],
"85": [0, 0.68333, 0.16389, 0, 0.74333],
"86": [0, 0.68333, 0.18361, 0, 0.74333],
"87": [0, 0.68333, 0.18361, 0, 0.99888],
"88": [0, 0.68333, 0.15806, 0, 0.74333],
"89": [0, 0.68333, 0.19383, 0, 0.74333],
"90": [0, 0.68333, 0.14528, 0, 0.61333],
"91": [0.25, 0.75, 0.1875, 0, 0.30667],
"93": [0.25, 0.75, 0.10528, 0, 0.30667],
"94": [0, 0.69444, 0.06646, 0, 0.51111],
"95": [0.31, 0.12056, 0.09208, 0, 0.51111],
"97": [0, 0.43056, 0.07671, 0, 0.51111],
"98": [0, 0.69444, 0.06312, 0, 0.46],
"99": [0, 0.43056, 0.05653, 0, 0.46],
"100": [0, 0.69444, 0.10333, 0, 0.51111],
"101": [0, 0.43056, 0.07514, 0, 0.46],
"102": [0.19444, 0.69444, 0.21194, 0, 0.30667],
"103": [0.19444, 0.43056, 0.08847, 0, 0.46],
"104": [0, 0.69444, 0.07671, 0, 0.51111],
"105": [0, 0.65536, 0.1019, 0, 0.30667],
"106": [0.19444, 0.65536, 0.14467, 0, 0.30667],
"107": [0, 0.69444, 0.10764, 0, 0.46],
"108": [0, 0.69444, 0.10333, 0, 0.25555],
"109": [0, 0.43056, 0.07671, 0, 0.81777],
"110": [0, 0.43056, 0.07671, 0, 0.56222],
"111": [0, 0.43056, 0.06312, 0, 0.51111],
"112": [0.19444, 0.43056, 0.06312, 0, 0.51111],
"113": [0.19444, 0.43056, 0.08847, 0, 0.46],
"114": [0, 0.43056, 0.10764, 0, 0.42166],
"115": [0, 0.43056, 0.08208, 0, 0.40889],
"116": [0, 0.61508, 0.09486, 0, 0.33222],
"117": [0, 0.43056, 0.07671, 0, 0.53666],
"118": [0, 0.43056, 0.10764, 0, 0.46],
"119": [0, 0.43056, 0.10764, 0, 0.66444],
"120": [0, 0.43056, 0.12042, 0, 0.46389],
"121": [0.19444, 0.43056, 0.08847, 0, 0.48555],
"122": [0, 0.43056, 0.12292, 0, 0.40889],
"126": [0.35, 0.31786, 0.11585, 0, 0.51111],
"160": [0, 0, 0, 0, 0.25],
"168": [0, 0.66786, 0.10474, 0, 0.51111],
"176": [0, 0.69444, 0, 0, 0.83129],
"184": [0.17014, 0, 0, 0, 0.46],
"198": [0, 0.68333, 0.12028, 0, 0.88277],
"216": [0.04861, 0.73194, 0.09403, 0, 0.76666],
"223": [0.19444, 0.69444, 0.10514, 0, 0.53666],
"230": [0, 0.43056, 0.07514, 0, 0.71555],
"248": [0.09722, 0.52778, 0.09194, 0, 0.51111],
"338": [0, 0.68333, 0.12028, 0, 0.98499],
"339": [0, 0.43056, 0.07514, 0, 0.71555],
"710": [0, 0.69444, 0.06646, 0, 0.51111],
"711": [0, 0.62847, 0.08295, 0, 0.51111],
"713": [0, 0.56167, 0.10333, 0, 0.51111],
"714": [0, 0.69444, 0.09694, 0, 0.51111],
"715": [0, 0.69444, 0, 0, 0.51111],
"728": [0, 0.69444, 0.10806, 0, 0.51111],
"729": [0, 0.66786, 0.11752, 0, 0.30667],
"730": [0, 0.69444, 0, 0, 0.83129],
"732": [0, 0.66786, 0.11585, 0, 0.51111],
"733": [0, 0.69444, 0.1225, 0, 0.51111],
"915": [0, 0.68333, 0.13305, 0, 0.62722],
"916": [0, 0.68333, 0, 0, 0.81777],
"920": [0, 0.68333, 0.09403, 0, 0.76666],
"923": [0, 0.68333, 0, 0, 0.69222],
"926": [0, 0.68333, 0.15294, 0, 0.66444],
"928": [0, 0.68333, 0.16389, 0, 0.74333],
"931": [0, 0.68333, 0.12028, 0, 0.71555],
"933": [0, 0.68333, 0.11111, 0, 0.76666],
"934": [0, 0.68333, 0.05986, 0, 0.71555],
"936": [0, 0.68333, 0.11111, 0, 0.76666],
"937": [0, 0.68333, 0.10257, 0, 0.71555],
"8211": [0, 0.43056, 0.09208, 0, 0.51111],
"8212": [0, 0.43056, 0.09208, 0, 1.02222],
"8216": [0, 0.69444, 0.12417, 0, 0.30667],
"8217": [0, 0.69444, 0.12417, 0, 0.30667],
"8220": [0, 0.69444, 0.1685, 0, 0.51444],
"8221": [0, 0.69444, 0.06961, 0, 0.51444],
"8463": [0, 0.68889, 0, 0, 0.54028]
},
"Main-Regular": {
"32": [0, 0, 0, 0, 0.25],
"33": [0, 0.69444, 0, 0, 0.27778],
"34": [0, 0.69444, 0, 0, 0.5],
"35": [0.19444, 0.69444, 0, 0, 0.83334],
"36": [0.05556, 0.75, 0, 0, 0.5],
"37": [0.05556, 0.75, 0, 0, 0.83334],
"38": [0, 0.69444, 0, 0, 0.77778],
"39": [0, 0.69444, 0, 0, 0.27778],
"40": [0.25, 0.75, 0, 0, 0.38889],
"41": [0.25, 0.75, 0, 0, 0.38889],
"42": [0, 0.75, 0, 0, 0.5],
"43": [0.08333, 0.58333, 0, 0, 0.77778],
"44": [0.19444, 0.10556, 0, 0, 0.27778],
"45": [0, 0.43056, 0, 0, 0.33333],
"46": [0, 0.10556, 0, 0, 0.27778],
"47": [0.25, 0.75, 0, 0, 0.5],
"48": [0, 0.64444, 0, 0, 0.5],
"49": [0, 0.64444, 0, 0, 0.5],
"50": [0, 0.64444, 0, 0, 0.5],
"51": [0, 0.64444, 0, 0, 0.5],
"52": [0, 0.64444, 0, 0, 0.5],
"53": [0, 0.64444, 0, 0, 0.5],
"54": [0, 0.64444, 0, 0, 0.5],
"55": [0, 0.64444, 0, 0, 0.5],
"56": [0, 0.64444, 0, 0, 0.5],
"57": [0, 0.64444, 0, 0, 0.5],
"58": [0, 0.43056, 0, 0, 0.27778],
"59": [0.19444, 0.43056, 0, 0, 0.27778],
"60": [0.0391, 0.5391, 0, 0, 0.77778],
"61": [-0.13313, 0.36687, 0, 0, 0.77778],
"62": [0.0391, 0.5391, 0, 0, 0.77778],
"63": [0, 0.69444, 0, 0, 0.47222],
"64": [0, 0.69444, 0, 0, 0.77778],
"65": [0, 0.68333, 0, 0, 0.75],
"66": [0, 0.68333, 0, 0, 0.70834],
"67": [0, 0.68333, 0, 0, 0.72222],
"68": [0, 0.68333, 0, 0, 0.76389],
"69": [0, 0.68333, 0, 0, 0.68056],
"70": [0, 0.68333, 0, 0, 0.65278],
"71": [0, 0.68333, 0, 0, 0.78472],
"72": [0, 0.68333, 0, 0, 0.75],
"73": [0, 0.68333, 0, 0, 0.36111],
"74": [0, 0.68333, 0, 0, 0.51389],
"75": [0, 0.68333, 0, 0, 0.77778],
"76": [0, 0.68333, 0, 0, 0.625],
"77": [0, 0.68333, 0, 0, 0.91667],
"78": [0, 0.68333, 0, 0, 0.75],
"79": [0, 0.68333, 0, 0, 0.77778],
"80": [0, 0.68333, 0, 0, 0.68056],
"81": [0.19444, 0.68333, 0, 0, 0.77778],
"82": [0, 0.68333, 0, 0, 0.73611],
"83": [0, 0.68333, 0, 0, 0.55556],
"84": [0, 0.68333, 0, 0, 0.72222],
"85": [0, 0.68333, 0, 0, 0.75],
"86": [0, 0.68333, 0.01389, 0, 0.75],
"87": [0, 0.68333, 0.01389, 0, 1.02778],
"88": [0, 0.68333, 0, 0, 0.75],
"89": [0, 0.68333, 0.025, 0, 0.75],
"90": [0, 0.68333, 0, 0, 0.61111],
"91": [0.25, 0.75, 0, 0, 0.27778],
"92": [0.25, 0.75, 0, 0, 0.5],
"93": [0.25, 0.75, 0, 0, 0.27778],
"94": [0, 0.69444, 0, 0, 0.5],
"95": [0.31, 0.12056, 0.02778, 0, 0.5],
"97": [0, 0.43056, 0, 0, 0.5],
"98": [0, 0.69444, 0, 0, 0.55556],
"99": [0, 0.43056, 0, 0, 0.44445],
"100": [0, 0.69444, 0, 0, 0.55556],
"101": [0, 0.43056, 0, 0, 0.44445],
"102": [0, 0.69444, 0.07778, 0, 0.30556],
"103": [0.19444, 0.43056, 0.01389, 0, 0.5],
"104": [0, 0.69444, 0, 0, 0.55556],
"105": [0, 0.66786, 0, 0, 0.27778],
"106": [0.19444, 0.66786, 0, 0, 0.30556],
"107": [0, 0.69444, 0, 0, 0.52778],
"108": [0, 0.69444, 0, 0, 0.27778],
"109": [0, 0.43056, 0, 0, 0.83334],
"110": [0, 0.43056, 0, 0, 0.55556],
"111": [0, 0.43056, 0, 0, 0.5],
"112": [0.19444, 0.43056, 0, 0, 0.55556],
"113": [0.19444, 0.43056, 0, 0, 0.52778],
"114": [0, 0.43056, 0, 0, 0.39167],
"115": [0, 0.43056, 0, 0, 0.39445],
"116": [0, 0.61508, 0, 0, 0.38889],
"117": [0, 0.43056, 0, 0, 0.55556],
"118": [0, 0.43056, 0.01389, 0, 0.52778],
"119": [0, 0.43056, 0.01389, 0, 0.72222],
"120": [0, 0.43056, 0, 0, 0.52778],
"121": [0.19444, 0.43056, 0.01389, 0, 0.52778],
"122": [0, 0.43056, 0, 0, 0.44445],
"123": [0.25, 0.75, 0, 0, 0.5],
"124": [0.25, 0.75, 0, 0, 0.27778],
"125": [0.25, 0.75, 0, 0, 0.5],
"126": [0.35, 0.31786, 0, 0, 0.5],
"160": [0, 0, 0, 0, 0.25],
"163": [0, 0.69444, 0, 0, 0.76909],
"167": [0.19444, 0.69444, 0, 0, 0.44445],
"168": [0, 0.66786, 0, 0, 0.5],
"172": [0, 0.43056, 0, 0, 0.66667],
"176": [0, 0.69444, 0, 0, 0.75],
"177": [0.08333, 0.58333, 0, 0, 0.77778],
"182": [0.19444, 0.69444, 0, 0, 0.61111],
"184": [0.17014, 0, 0, 0, 0.44445],
"198": [0, 0.68333, 0, 0, 0.90278],
"215": [0.08333, 0.58333, 0, 0, 0.77778],
"216": [0.04861, 0.73194, 0, 0, 0.77778],
"223": [0, 0.69444, 0, 0, 0.5],
"230": [0, 0.43056, 0, 0, 0.72222],
"247": [0.08333, 0.58333, 0, 0, 0.77778],
"248": [0.09722, 0.52778, 0, 0, 0.5],
"305": [0, 0.43056, 0, 0, 0.27778],
"338": [0, 0.68333, 0, 0, 1.01389],
"339": [0, 0.43056, 0, 0, 0.77778],
"567": [0.19444, 0.43056, 0, 0, 0.30556],
"710": [0, 0.69444, 0, 0, 0.5],
"711": [0, 0.62847, 0, 0, 0.5],
"713": [0, 0.56778, 0, 0, 0.5],
"714": [0, 0.69444, 0, 0, 0.5],
"715": [0, 0.69444, 0, 0, 0.5],
"728": [0, 0.69444, 0, 0, 0.5],
"729": [0, 0.66786, 0, 0, 0.27778],
"730": [0, 0.69444, 0, 0, 0.75],
"732": [0, 0.66786, 0, 0, 0.5],
"733": [0, 0.69444, 0, 0, 0.5],
"915": [0, 0.68333, 0, 0, 0.625],
"916": [0, 0.68333, 0, 0, 0.83334],
"920": [0, 0.68333, 0, 0, 0.77778],
"923": [0, 0.68333, 0, 0, 0.69445],
"926": [0, 0.68333, 0, 0, 0.66667],
"928": [0, 0.68333, 0, 0, 0.75],
"931": [0, 0.68333, 0, 0, 0.72222],
"933": [0, 0.68333, 0, 0, 0.77778],
"934": [0, 0.68333, 0, 0, 0.72222],
"936": [0, 0.68333, 0, 0, 0.77778],
"937": [0, 0.68333, 0, 0, 0.72222],
"8211": [0, 0.43056, 0.02778, 0, 0.5],
"8212": [0, 0.43056, 0.02778, 0, 1],
"8216": [0, 0.69444, 0, 0, 0.27778],
"8217": [0, 0.69444, 0, 0, 0.27778],
"8220": [0, 0.69444, 0, 0, 0.5],
"8221": [0, 0.69444, 0, 0, 0.5],
"8224": [0.19444, 0.69444, 0, 0, 0.44445],
"8225": [0.19444, 0.69444, 0, 0, 0.44445],
"8230": [0, 0.123, 0, 0, 1.172],
"8242": [0, 0.55556, 0, 0, 0.275],
"8407": [0, 0.71444, 0.15382, 0, 0.5],
"8463": [0, 0.68889, 0, 0, 0.54028],
"8465": [0, 0.69444, 0, 0, 0.72222],
"8467": [0, 0.69444, 0, 0.11111, 0.41667],
"8472": [0.19444, 0.43056, 0, 0.11111, 0.63646],
"8476": [0, 0.69444, 0, 0, 0.72222],
"8501": [0, 0.69444, 0, 0, 0.61111],
"8592": [-0.13313, 0.36687, 0, 0, 1],
"8593": [0.19444, 0.69444, 0, 0, 0.5],
"8594": [-0.13313, 0.36687, 0, 0, 1],
"8595": [0.19444, 0.69444, 0, 0, 0.5],
"8596": [-0.13313, 0.36687, 0, 0, 1],
"8597": [0.25, 0.75, 0, 0, 0.5],
"8598": [0.19444, 0.69444, 0, 0, 1],
"8599": [0.19444, 0.69444, 0, 0, 1],
"8600": [0.19444, 0.69444, 0, 0, 1],
"8601": [0.19444, 0.69444, 0, 0, 1],
"8614": [0.011, 0.511, 0, 0, 1],
"8617": [0.011, 0.511, 0, 0, 1.126],
"8618": [0.011, 0.511, 0, 0, 1.126],
"8636": [-0.13313, 0.36687, 0, 0, 1],
"8637": [-0.13313, 0.36687, 0, 0, 1],
"8640": [-0.13313, 0.36687, 0, 0, 1],
"8641": [-0.13313, 0.36687, 0, 0, 1],
"8652": [0.011, 0.671, 0, 0, 1],
"8656": [-0.13313, 0.36687, 0, 0, 1],
"8657": [0.19444, 0.69444, 0, 0, 0.61111],
"8658": [-0.13313, 0.36687, 0, 0, 1],
"8659": [0.19444, 0.69444, 0, 0, 0.61111],
"8660": [-0.13313, 0.36687, 0, 0, 1],
"8661": [0.25, 0.75, 0, 0, 0.61111],
"8704": [0, 0.69444, 0, 0, 0.55556],
"8706": [0, 0.69444, 0.05556, 0.08334, 0.5309],
"8707": [0, 0.69444, 0, 0, 0.55556],
"8709": [0.05556, 0.75, 0, 0, 0.5],
"8711": [0, 0.68333, 0, 0, 0.83334],
"8712": [0.0391, 0.5391, 0, 0, 0.66667],
"8715": [0.0391, 0.5391, 0, 0, 0.66667],
"8722": [0.08333, 0.58333, 0, 0, 0.77778],
"8723": [0.08333, 0.58333, 0, 0, 0.77778],
"8725": [0.25, 0.75, 0, 0, 0.5],
"8726": [0.25, 0.75, 0, 0, 0.5],
"8727": [-0.03472, 0.46528, 0, 0, 0.5],
"8728": [-0.05555, 0.44445, 0, 0, 0.5],
"8729": [-0.05555, 0.44445, 0, 0, 0.5],
"8730": [0.2, 0.8, 0, 0, 0.83334],
"8733": [0, 0.43056, 0, 0, 0.77778],
"8734": [0, 0.43056, 0, 0, 1],
"8736": [0, 0.69224, 0, 0, 0.72222],
"8739": [0.25, 0.75, 0, 0, 0.27778],
"8741": [0.25, 0.75, 0, 0, 0.5],
"8743": [0, 0.55556, 0, 0, 0.66667],
"8744": [0, 0.55556, 0, 0, 0.66667],
"8745": [0, 0.55556, 0, 0, 0.66667],
"8746": [0, 0.55556, 0, 0, 0.66667],
"8747": [0.19444, 0.69444, 0.11111, 0, 0.41667],
"8764": [-0.13313, 0.36687, 0, 0, 0.77778],
"8768": [0.19444, 0.69444, 0, 0, 0.27778],
"8771": [-0.03625, 0.46375, 0, 0, 0.77778],
"8773": [-0.022, 0.589, 0, 0, 0.778],
"8776": [-0.01688, 0.48312, 0, 0, 0.77778],
"8781": [-0.03625, 0.46375, 0, 0, 0.77778],
"8784": [-0.133, 0.673, 0, 0, 0.778],
"8801": [-0.03625, 0.46375, 0, 0, 0.77778],
"8804": [0.13597, 0.63597, 0, 0, 0.77778],
"8805": [0.13597, 0.63597, 0, 0, 0.77778],
"8810": [0.0391, 0.5391, 0, 0, 1],
"8811": [0.0391, 0.5391, 0, 0, 1],
"8826": [0.0391, 0.5391, 0, 0, 0.77778],
"8827": [0.0391, 0.5391, 0, 0, 0.77778],
"8834": [0.0391, 0.5391, 0, 0, 0.77778],
"8835": [0.0391, 0.5391, 0, 0, 0.77778],
"8838": [0.13597, 0.63597, 0, 0, 0.77778],
"8839": [0.13597, 0.63597, 0, 0, 0.77778],
"8846": [0, 0.55556, 0, 0, 0.66667],
"8849": [0.13597, 0.63597, 0, 0, 0.77778],
"8850": [0.13597, 0.63597, 0, 0, 0.77778],
"8851": [0, 0.55556, 0, 0, 0.66667],
"8852": [0, 0.55556, 0, 0, 0.66667],
"8853": [0.08333, 0.58333, 0, 0, 0.77778],
"8854": [0.08333, 0.58333, 0, 0, 0.77778],
"8855": [0.08333, 0.58333, 0, 0, 0.77778],
"8856": [0.08333, 0.58333, 0, 0, 0.77778],
"8857": [0.08333, 0.58333, 0, 0, 0.77778],
"8866": [0, 0.69444, 0, 0, 0.61111],
"8867": [0, 0.69444, 0, 0, 0.61111],
"8868": [0, 0.69444, 0, 0, 0.77778],
"8869": [0, 0.69444, 0, 0, 0.77778],
"8872": [0.249, 0.75, 0, 0, 0.867],
"8900": [-0.05555, 0.44445, 0, 0, 0.5],
"8901": [-0.05555, 0.44445, 0, 0, 0.27778],
"8902": [-0.03472, 0.46528, 0, 0, 0.5],
"8904": [5e-3, 0.505, 0, 0, 0.9],
"8942": [0.03, 0.903, 0, 0, 0.278],
"8943": [-0.19, 0.313, 0, 0, 1.172],
"8945": [-0.1, 0.823, 0, 0, 1.282],
"8968": [0.25, 0.75, 0, 0, 0.44445],
"8969": [0.25, 0.75, 0, 0, 0.44445],
"8970": [0.25, 0.75, 0, 0, 0.44445],
"8971": [0.25, 0.75, 0, 0, 0.44445],
"8994": [-0.14236, 0.35764, 0, 0, 1],
"8995": [-0.14236, 0.35764, 0, 0, 1],
"9136": [0.244, 0.744, 0, 0, 0.412],
"9137": [0.244, 0.745, 0, 0, 0.412],
"9651": [0.19444, 0.69444, 0, 0, 0.88889],
"9657": [-0.03472, 0.46528, 0, 0, 0.5],
"9661": [0.19444, 0.69444, 0, 0, 0.88889],
"9667": [-0.03472, 0.46528, 0, 0, 0.5],
"9711": [0.19444, 0.69444, 0, 0, 1],
"9824": [0.12963, 0.69444, 0, 0, 0.77778],
"9825": [0.12963, 0.69444, 0, 0, 0.77778],
"9826": [0.12963, 0.69444, 0, 0, 0.77778],
"9827": [0.12963, 0.69444, 0, 0, 0.77778],
"9837": [0, 0.75, 0, 0, 0.38889],
"9838": [0.19444, 0.69444, 0, 0, 0.38889],
"9839": [0.19444, 0.69444, 0, 0, 0.38889],
"10216": [0.25, 0.75, 0, 0, 0.38889],
"10217": [0.25, 0.75, 0, 0, 0.38889],
"10222": [0.244, 0.744, 0, 0, 0.412],
"10223": [0.244, 0.745, 0, 0, 0.412],
"10229": [0.011, 0.511, 0, 0, 1.609],
"10230": [0.011, 0.511, 0, 0, 1.638],
"10231": [0.011, 0.511, 0, 0, 1.859],
"10232": [0.024, 0.525, 0, 0, 1.609],
"10233": [0.024, 0.525, 0, 0, 1.638],
"10234": [0.024, 0.525, 0, 0, 1.858],
"10236": [0.011, 0.511, 0, 0, 1.638],
"10815": [0, 0.68333, 0, 0, 0.75],
"10927": [0.13597, 0.63597, 0, 0, 0.77778],
"10928": [0.13597, 0.63597, 0, 0, 0.77778],
"57376": [0.19444, 0.69444, 0, 0, 0]
},
"Math-BoldItalic": {
"32": [0, 0, 0, 0, 0.25],
"48": [0, 0.44444, 0, 0, 0.575],
"49": [0, 0.44444, 0, 0, 0.575],
"50": [0, 0.44444, 0, 0, 0.575],
"51": [0.19444, 0.44444, 0, 0, 0.575],
"52": [0.19444, 0.44444, 0, 0, 0.575],
"53": [0.19444, 0.44444, 0, 0, 0.575],
"54": [0, 0.64444, 0, 0, 0.575],
"55": [0.19444, 0.44444, 0, 0, 0.575],
"56": [0, 0.64444, 0, 0, 0.575],
"57": [0.19444, 0.44444, 0, 0, 0.575],
"65": [0, 0.68611, 0, 0, 0.86944],
"66": [0, 0.68611, 0.04835, 0, 0.8664],
"67": [0, 0.68611, 0.06979, 0, 0.81694],
"68": [0, 0.68611, 0.03194, 0, 0.93812],
"69": [0, 0.68611, 0.05451, 0, 0.81007],
"70": [0, 0.68611, 0.15972, 0, 0.68889],
"71": [0, 0.68611, 0, 0, 0.88673],
"72": [0, 0.68611, 0.08229, 0, 0.98229],
"73": [0, 0.68611, 0.07778, 0, 0.51111],
"74": [0, 0.68611, 0.10069, 0, 0.63125],
"75": [0, 0.68611, 0.06979, 0, 0.97118],
"76": [0, 0.68611, 0, 0, 0.75555],
"77": [0, 0.68611, 0.11424, 0, 1.14201],
"78": [0, 0.68611, 0.11424, 0, 0.95034],
"79": [0, 0.68611, 0.03194, 0, 0.83666],
"80": [0, 0.68611, 0.15972, 0, 0.72309],
"81": [0.19444, 0.68611, 0, 0, 0.86861],
"82": [0, 0.68611, 421e-5, 0, 0.87235],
"83": [0, 0.68611, 0.05382, 0, 0.69271],
"84": [0, 0.68611, 0.15972, 0, 0.63663],
"85": [0, 0.68611, 0.11424, 0, 0.80027],
"86": [0, 0.68611, 0.25555, 0, 0.67778],
"87": [0, 0.68611, 0.15972, 0, 1.09305],
"88": [0, 0.68611, 0.07778, 0, 0.94722],
"89": [0, 0.68611, 0.25555, 0, 0.67458],
"90": [0, 0.68611, 0.06979, 0, 0.77257],
"97": [0, 0.44444, 0, 0, 0.63287],
"98": [0, 0.69444, 0, 0, 0.52083],
"99": [0, 0.44444, 0, 0, 0.51342],
"100": [0, 0.69444, 0, 0, 0.60972],
"101": [0, 0.44444, 0, 0, 0.55361],
"102": [0.19444, 0.69444, 0.11042, 0, 0.56806],
"103": [0.19444, 0.44444, 0.03704, 0, 0.5449],
"104": [0, 0.69444, 0, 0, 0.66759],
"105": [0, 0.69326, 0, 0, 0.4048],
"106": [0.19444, 0.69326, 0.0622, 0, 0.47083],
"107": [0, 0.69444, 0.01852, 0, 0.6037],
"108": [0, 0.69444, 88e-4, 0, 0.34815],
"109": [0, 0.44444, 0, 0, 1.0324],
"110": [0, 0.44444, 0, 0, 0.71296],
"111": [0, 0.44444, 0, 0, 0.58472],
"112": [0.19444, 0.44444, 0, 0, 0.60092],
"113": [0.19444, 0.44444, 0.03704, 0, 0.54213],
"114": [0, 0.44444, 0.03194, 0, 0.5287],
"115": [0, 0.44444, 0, 0, 0.53125],
"116": [0, 0.63492, 0, 0, 0.41528],
"117": [0, 0.44444, 0, 0, 0.68102],
"118": [0, 0.44444, 0.03704, 0, 0.56666],
"119": [0, 0.44444, 0.02778, 0, 0.83148],
"120": [0, 0.44444, 0, 0, 0.65903],
"121": [0.19444, 0.44444, 0.03704, 0, 0.59028],
"122": [0, 0.44444, 0.04213, 0, 0.55509],
"160": [0, 0, 0, 0, 0.25],
"915": [0, 0.68611, 0.15972, 0, 0.65694],
"916": [0, 0.68611, 0, 0, 0.95833],
"920": [0, 0.68611, 0.03194, 0, 0.86722],
"923": [0, 0.68611, 0, 0, 0.80555],
"926": [0, 0.68611, 0.07458, 0, 0.84125],
"928": [0, 0.68611, 0.08229, 0, 0.98229],
"931": [0, 0.68611, 0.05451, 0, 0.88507],
"933": [0, 0.68611, 0.15972, 0, 0.67083],
"934": [0, 0.68611, 0, 0, 0.76666],
"936": [0, 0.68611, 0.11653, 0, 0.71402],
"937": [0, 0.68611, 0.04835, 0, 0.8789],
"945": [0, 0.44444, 0, 0, 0.76064],
"946": [0.19444, 0.69444, 0.03403, 0, 0.65972],
"947": [0.19444, 0.44444, 0.06389, 0, 0.59003],
"948": [0, 0.69444, 0.03819, 0, 0.52222],
"949": [0, 0.44444, 0, 0, 0.52882],
"950": [0.19444, 0.69444, 0.06215, 0, 0.50833],
"951": [0.19444, 0.44444, 0.03704, 0, 0.6],
"952": [0, 0.69444, 0.03194, 0, 0.5618],
"953": [0, 0.44444, 0, 0, 0.41204],
"954": [0, 0.44444, 0, 0, 0.66759],
"955": [0, 0.69444, 0, 0, 0.67083],
"956": [0.19444, 0.44444, 0, 0, 0.70787],
"957": [0, 0.44444, 0.06898, 0, 0.57685],
"958": [0.19444, 0.69444, 0.03021, 0, 0.50833],
"959": [0, 0.44444, 0, 0, 0.58472],
"960": [0, 0.44444, 0.03704, 0, 0.68241],
"961": [0.19444, 0.44444, 0, 0, 0.6118],
"962": [0.09722, 0.44444, 0.07917, 0, 0.42361],
"963": [0, 0.44444, 0.03704, 0, 0.68588],
"964": [0, 0.44444, 0.13472, 0, 0.52083],
"965": [0, 0.44444, 0.03704, 0, 0.63055],
"966": [0.19444, 0.44444, 0, 0, 0.74722],
"967": [0.19444, 0.44444, 0, 0, 0.71805],
"968": [0.19444, 0.69444, 0.03704, 0, 0.75833],
"969": [0, 0.44444, 0.03704, 0, 0.71782],
"977": [0, 0.69444, 0, 0, 0.69155],
"981": [0.19444, 0.69444, 0, 0, 0.7125],
"982": [0, 0.44444, 0.03194, 0, 0.975],
"1009": [0.19444, 0.44444, 0, 0, 0.6118],
"1013": [0, 0.44444, 0, 0, 0.48333],
"57649": [0, 0.44444, 0, 0, 0.39352],
"57911": [0.19444, 0.44444, 0, 0, 0.43889]
},
"Math-Italic": {
"32": [0, 0, 0, 0, 0.25],
"48": [0, 0.43056, 0, 0, 0.5],
"49": [0, 0.43056, 0, 0, 0.5],
"50": [0, 0.43056, 0, 0, 0.5],
"51": [0.19444, 0.43056, 0, 0, 0.5],
"52": [0.19444, 0.43056, 0, 0, 0.5],
"53": [0.19444, 0.43056, 0, 0, 0.5],
"54": [0, 0.64444, 0, 0, 0.5],
"55": [0.19444, 0.43056, 0, 0, 0.5],
"56": [0, 0.64444, 0, 0, 0.5],
"57": [0.19444, 0.43056, 0, 0, 0.5],
"65": [0, 0.68333, 0, 0.13889, 0.75],
"66": [0, 0.68333, 0.05017, 0.08334, 0.75851],
"67": [0, 0.68333, 0.07153, 0.08334, 0.71472],
"68": [0, 0.68333, 0.02778, 0.05556, 0.82792],
"69": [0, 0.68333, 0.05764, 0.08334, 0.7382],
"70": [0, 0.68333, 0.13889, 0.08334, 0.64306],
"71": [0, 0.68333, 0, 0.08334, 0.78625],
"72": [0, 0.68333, 0.08125, 0.05556, 0.83125],
"73": [0, 0.68333, 0.07847, 0.11111, 0.43958],
"74": [0, 0.68333, 0.09618, 0.16667, 0.55451],
"75": [0, 0.68333, 0.07153, 0.05556, 0.84931],
"76": [0, 0.68333, 0, 0.02778, 0.68056],
"77": [0, 0.68333, 0.10903, 0.08334, 0.97014],
"78": [0, 0.68333, 0.10903, 0.08334, 0.80347],
"79": [0, 0.68333, 0.02778, 0.08334, 0.76278],
"80": [0, 0.68333, 0.13889, 0.08334, 0.64201],
"81": [0.19444, 0.68333, 0, 0.08334, 0.79056],
"82": [0, 0.68333, 773e-5, 0.08334, 0.75929],
"83": [0, 0.68333, 0.05764, 0.08334, 0.6132],
"84": [0, 0.68333, 0.13889, 0.08334, 0.58438],
"85": [0, 0.68333, 0.10903, 0.02778, 0.68278],
"86": [0, 0.68333, 0.22222, 0, 0.58333],
"87": [0, 0.68333, 0.13889, 0, 0.94445],
"88": [0, 0.68333, 0.07847, 0.08334, 0.82847],
"89": [0, 0.68333, 0.22222, 0, 0.58056],
"90": [0, 0.68333, 0.07153, 0.08334, 0.68264],
"97": [0, 0.43056, 0, 0, 0.52859],
"98": [0, 0.69444, 0, 0, 0.42917],
"99": [0, 0.43056, 0, 0.05556, 0.43276],
"100": [0, 0.69444, 0, 0.16667, 0.52049],
"101": [0, 0.43056, 0, 0.05556, 0.46563],
"102": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
"103": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
"104": [0, 0.69444, 0, 0, 0.57616],
"105": [0, 0.65952, 0, 0, 0.34451],
"106": [0.19444, 0.65952, 0.05724, 0, 0.41181],
"107": [0, 0.69444, 0.03148, 0, 0.5206],
"108": [0, 0.69444, 0.01968, 0.08334, 0.29838],
"109": [0, 0.43056, 0, 0, 0.87801],
"110": [0, 0.43056, 0, 0, 0.60023],
"111": [0, 0.43056, 0, 0.05556, 0.48472],
"112": [0.19444, 0.43056, 0, 0.08334, 0.50313],
"113": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
"114": [0, 0.43056, 0.02778, 0.05556, 0.45116],
"115": [0, 0.43056, 0, 0.05556, 0.46875],
"116": [0, 0.61508, 0, 0.08334, 0.36111],
"117": [0, 0.43056, 0, 0.02778, 0.57246],
"118": [0, 0.43056, 0.03588, 0.02778, 0.48472],
"119": [0, 0.43056, 0.02691, 0.08334, 0.71592],
"120": [0, 0.43056, 0, 0.02778, 0.57153],
"121": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
"122": [0, 0.43056, 0.04398, 0.05556, 0.46505],
"160": [0, 0, 0, 0, 0.25],
"915": [0, 0.68333, 0.13889, 0.08334, 0.61528],
"916": [0, 0.68333, 0, 0.16667, 0.83334],
"920": [0, 0.68333, 0.02778, 0.08334, 0.76278],
"923": [0, 0.68333, 0, 0.16667, 0.69445],
"926": [0, 0.68333, 0.07569, 0.08334, 0.74236],
"928": [0, 0.68333, 0.08125, 0.05556, 0.83125],
"931": [0, 0.68333, 0.05764, 0.08334, 0.77986],
"933": [0, 0.68333, 0.13889, 0.05556, 0.58333],
"934": [0, 0.68333, 0, 0.08334, 0.66667],
"936": [0, 0.68333, 0.11, 0.05556, 0.61222],
"937": [0, 0.68333, 0.05017, 0.08334, 0.7724],
"945": [0, 0.43056, 37e-4, 0.02778, 0.6397],
"946": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
"947": [0.19444, 0.43056, 0.05556, 0, 0.51773],
"948": [0, 0.69444, 0.03785, 0.05556, 0.44444],
"949": [0, 0.43056, 0, 0.08334, 0.46632],
"950": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
"951": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
"952": [0, 0.69444, 0.02778, 0.08334, 0.46944],
"953": [0, 0.43056, 0, 0.05556, 0.35394],
"954": [0, 0.43056, 0, 0, 0.57616],
"955": [0, 0.69444, 0, 0, 0.58334],
"956": [0.19444, 0.43056, 0, 0.02778, 0.60255],
"957": [0, 0.43056, 0.06366, 0.02778, 0.49398],
"958": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
"959": [0, 0.43056, 0, 0.05556, 0.48472],
"960": [0, 0.43056, 0.03588, 0, 0.57003],
"961": [0.19444, 0.43056, 0, 0.08334, 0.51702],
"962": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
"963": [0, 0.43056, 0.03588, 0, 0.57141],
"964": [0, 0.43056, 0.1132, 0.02778, 0.43715],
"965": [0, 0.43056, 0.03588, 0.02778, 0.54028],
"966": [0.19444, 0.43056, 0, 0.08334, 0.65417],
"967": [0.19444, 0.43056, 0, 0.05556, 0.62569],
"968": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
"969": [0, 0.43056, 0.03588, 0, 0.62245],
"977": [0, 0.69444, 0, 0.08334, 0.59144],
"981": [0.19444, 0.69444, 0, 0.08334, 0.59583],
"982": [0, 0.43056, 0.02778, 0, 0.82813],
"1009": [0.19444, 0.43056, 0, 0.08334, 0.51702],
"1013": [0, 0.43056, 0, 0.05556, 0.4059],
"57649": [0, 0.43056, 0, 0.02778, 0.32246],
"57911": [0.19444, 0.43056, 0, 0.08334, 0.38403]
},
"SansSerif-Bold": {
"32": [0, 0, 0, 0, 0.25],
"33": [0, 0.69444, 0, 0, 0.36667],
"34": [0, 0.69444, 0, 0, 0.55834],
"35": [0.19444, 0.69444, 0, 0, 0.91667],
"36": [0.05556, 0.75, 0, 0, 0.55],
"37": [0.05556, 0.75, 0, 0, 1.02912],
"38": [0, 0.69444, 0, 0, 0.83056],
"39": [0, 0.69444, 0, 0, 0.30556],
"40": [0.25, 0.75, 0, 0, 0.42778],
"41": [0.25, 0.75, 0, 0, 0.42778],
"42": [0, 0.75, 0, 0, 0.55],
"43": [0.11667, 0.61667, 0, 0, 0.85556],
"44": [0.10556, 0.13056, 0, 0, 0.30556],
"45": [0, 0.45833, 0, 0, 0.36667],
"46": [0, 0.13056, 0, 0, 0.30556],
"47": [0.25, 0.75, 0, 0, 0.55],
"48": [0, 0.69444, 0, 0, 0.55],
"49": [0, 0.69444, 0, 0, 0.55],
"50": [0, 0.69444, 0, 0, 0.55],
"51": [0, 0.69444, 0, 0, 0.55],
"52": [0, 0.69444, 0, 0, 0.55],
"53": [0, 0.69444, 0, 0, 0.55],
"54": [0, 0.69444, 0, 0, 0.55],
"55": [0, 0.69444, 0, 0, 0.55],
"56": [0, 0.69444, 0, 0, 0.55],
"57": [0, 0.69444, 0, 0, 0.55],
"58": [0, 0.45833, 0, 0, 0.30556],
"59": [0.10556, 0.45833, 0, 0, 0.30556],
"61": [-0.09375, 0.40625, 0, 0, 0.85556],
"63": [0, 0.69444, 0, 0, 0.51945],
"64": [0, 0.69444, 0, 0, 0.73334],
"65": [0, 0.69444, 0, 0, 0.73334],
"66": [0, 0.69444, 0, 0, 0.73334],
"67": [0, 0.69444, 0, 0, 0.70278],
"68": [0, 0.69444, 0, 0, 0.79445],
"69": [0, 0.69444, 0, 0, 0.64167],
"70": [0, 0.69444, 0, 0, 0.61111],
"71": [0, 0.69444, 0, 0, 0.73334],
"72": [0, 0.69444, 0, 0, 0.79445],
"73": [0, 0.69444, 0, 0, 0.33056],
"74": [0, 0.69444, 0, 0, 0.51945],
"75": [0, 0.69444, 0, 0, 0.76389],
"76": [0, 0.69444, 0, 0, 0.58056],
"77": [0, 0.69444, 0, 0, 0.97778],
"78": [0, 0.69444, 0, 0, 0.79445],
"79": [0, 0.69444, 0, 0, 0.79445],
"80": [0, 0.69444, 0, 0, 0.70278],
"81": [0.10556, 0.69444, 0, 0, 0.79445],
"82": [0, 0.69444, 0, 0, 0.70278],
"83": [0, 0.69444, 0, 0, 0.61111],
"84": [0, 0.69444, 0, 0, 0.73334],
"85": [0, 0.69444, 0, 0, 0.76389],
"86": [0, 0.69444, 0.01528, 0, 0.73334],
"87": [0, 0.69444, 0.01528, 0, 1.03889],
"88": [0, 0.69444, 0, 0, 0.73334],
"89": [0, 0.69444, 0.0275, 0, 0.73334],
"90": [0, 0.69444, 0, 0, 0.67223],
"91": [0.25, 0.75, 0, 0, 0.34306],
"93": [0.25, 0.75, 0, 0, 0.34306],
"94": [0, 0.69444, 0, 0, 0.55],
"95": [0.35, 0.10833, 0.03056, 0, 0.55],
"97": [0, 0.45833, 0, 0, 0.525],
"98": [0, 0.69444, 0, 0, 0.56111],
"99": [0, 0.45833, 0, 0, 0.48889],
"100": [0, 0.69444, 0, 0, 0.56111],
"101": [0, 0.45833, 0, 0, 0.51111],
"102": [0, 0.69444, 0.07639, 0, 0.33611],
"103": [0.19444, 0.45833, 0.01528, 0, 0.55],
"104": [0, 0.69444, 0, 0, 0.56111],
"105": [0, 0.69444, 0, 0, 0.25556],
"106": [0.19444, 0.69444, 0, 0, 0.28611],
"107": [0, 0.69444, 0, 0, 0.53056],
"108": [0, 0.69444, 0, 0, 0.25556],
"109": [0, 0.45833, 0, 0, 0.86667],
"110": [0, 0.45833, 0, 0, 0.56111],
"111": [0, 0.45833, 0, 0, 0.55],
"112": [0.19444, 0.45833, 0, 0, 0.56111],
"113": [0.19444, 0.45833, 0, 0, 0.56111],
"114": [0, 0.45833, 0.01528, 0, 0.37222],
"115": [0, 0.45833, 0, 0, 0.42167],
"116": [0, 0.58929, 0, 0, 0.40417],
"117": [0, 0.45833, 0, 0, 0.56111],
"118": [0, 0.45833, 0.01528, 0, 0.5],
"119": [0, 0.45833, 0.01528, 0, 0.74445],
"120": [0, 0.45833, 0, 0, 0.5],
"121": [0.19444, 0.45833, 0.01528, 0, 0.5],
"122": [0, 0.45833, 0, 0, 0.47639],
"126": [0.35, 0.34444, 0, 0, 0.55],
"160": [0, 0, 0, 0, 0.25],
"168": [0, 0.69444, 0, 0, 0.55],
"176": [0, 0.69444, 0, 0, 0.73334],
"180": [0, 0.69444, 0, 0, 0.55],
"184": [0.17014, 0, 0, 0, 0.48889],
"305": [0, 0.45833, 0, 0, 0.25556],
"567": [0.19444, 0.45833, 0, 0, 0.28611],
"710": [0, 0.69444, 0, 0, 0.55],
"711": [0, 0.63542, 0, 0, 0.55],
"713": [0, 0.63778, 0, 0, 0.55],
"728": [0, 0.69444, 0, 0, 0.55],
"729": [0, 0.69444, 0, 0, 0.30556],
"730": [0, 0.69444, 0, 0, 0.73334],
"732": [0, 0.69444, 0, 0, 0.55],
"733": [0, 0.69444, 0, 0, 0.55],
"915": [0, 0.69444, 0, 0, 0.58056],
"916": [0, 0.69444, 0, 0, 0.91667],
"920": [0, 0.69444, 0, 0, 0.85556],
"923": [0, 0.69444, 0, 0, 0.67223],
"926": [0, 0.69444, 0, 0, 0.73334],
"928": [0, 0.69444, 0, 0, 0.79445],
"931": [0, 0.69444, 0, 0, 0.79445],
"933": [0, 0.69444, 0, 0, 0.85556],
"934": [0, 0.69444, 0, 0, 0.79445],
"936": [0, 0.69444, 0, 0, 0.85556],
"937": [0, 0.69444, 0, 0, 0.79445],
"8211": [0, 0.45833, 0.03056, 0, 0.55],
"8212": [0, 0.45833, 0.03056, 0, 1.10001],
"8216": [0, 0.69444, 0, 0, 0.30556],
"8217": [0, 0.69444, 0, 0, 0.30556],
"8220": [0, 0.69444, 0, 0, 0.55834],
"8221": [0, 0.69444, 0, 0, 0.55834]
},
"SansSerif-Italic": {
"32": [0, 0, 0, 0, 0.25],
"33": [0, 0.69444, 0.05733, 0, 0.31945],
"34": [0, 0.69444, 316e-5, 0, 0.5],
"35": [0.19444, 0.69444, 0.05087, 0, 0.83334],
"36": [0.05556, 0.75, 0.11156, 0, 0.5],
"37": [0.05556, 0.75, 0.03126, 0, 0.83334],
"38": [0, 0.69444, 0.03058, 0, 0.75834],
"39": [0, 0.69444, 0.07816, 0, 0.27778],
"40": [0.25, 0.75, 0.13164, 0, 0.38889],
"41": [0.25, 0.75, 0.02536, 0, 0.38889],
"42": [0, 0.75, 0.11775, 0, 0.5],
"43": [0.08333, 0.58333, 0.02536, 0, 0.77778],
"44": [0.125, 0.08333, 0, 0, 0.27778],
"45": [0, 0.44444, 0.01946, 0, 0.33333],
"46": [0, 0.08333, 0, 0, 0.27778],
"47": [0.25, 0.75, 0.13164, 0, 0.5],
"48": [0, 0.65556, 0.11156, 0, 0.5],
"49": [0, 0.65556, 0.11156, 0, 0.5],
"50": [0, 0.65556, 0.11156, 0, 0.5],
"51": [0, 0.65556, 0.11156, 0, 0.5],
"52": [0, 0.65556, 0.11156, 0, 0.5],
"53": [0, 0.65556, 0.11156, 0, 0.5],
"54": [0, 0.65556, 0.11156, 0, 0.5],
"55": [0, 0.65556, 0.11156, 0, 0.5],
"56": [0, 0.65556, 0.11156, 0, 0.5],
"57": [0, 0.65556, 0.11156, 0, 0.5],
"58": [0, 0.44444, 0.02502, 0, 0.27778],
"59": [0.125, 0.44444, 0.02502, 0, 0.27778],
"61": [-0.13, 0.37, 0.05087, 0, 0.77778],
"63": [0, 0.69444, 0.11809, 0, 0.47222],
"64": [0, 0.69444, 0.07555, 0, 0.66667],
"65": [0, 0.69444, 0, 0, 0.66667],
"66": [0, 0.69444, 0.08293, 0, 0.66667],
"67": [0, 0.69444, 0.11983, 0, 0.63889],
"68": [0, 0.69444, 0.07555, 0, 0.72223],
"69": [0, 0.69444, 0.11983, 0, 0.59722],
"70": [0, 0.69444, 0.13372, 0, 0.56945],
"71": [0, 0.69444, 0.11983, 0, 0.66667],
"72": [0, 0.69444, 0.08094, 0, 0.70834],
"73": [0, 0.69444, 0.13372, 0, 0.27778],
"74": [0, 0.69444, 0.08094, 0, 0.47222],
"75": [0, 0.69444, 0.11983, 0, 0.69445],
"76": [0, 0.69444, 0, 0, 0.54167],
"77": [0, 0.69444, 0.08094, 0, 0.875],
"78": [0, 0.69444, 0.08094, 0, 0.70834],
"79": [0, 0.69444, 0.07555, 0, 0.73611],
"80": [0, 0.69444, 0.08293, 0, 0.63889],
"81": [0.125, 0.69444, 0.07555, 0, 0.73611],
"82": [0, 0.69444, 0.08293, 0, 0.64584],
"83": [0, 0.69444, 0.09205, 0, 0.55556],
"84": [0, 0.69444, 0.13372, 0, 0.68056],
"85": [0, 0.69444, 0.08094, 0, 0.6875],
"86": [0, 0.69444, 0.1615, 0, 0.66667],
"87": [0, 0.69444, 0.1615, 0, 0.94445],
"88": [0, 0.69444, 0.13372, 0, 0.66667],
"89": [0, 0.69444, 0.17261, 0, 0.66667],
"90": [0, 0.69444, 0.11983, 0, 0.61111],
"91": [0.25, 0.75, 0.15942, 0, 0.28889],
"93": [0.25, 0.75, 0.08719, 0, 0.28889],
"94": [0, 0.69444, 0.0799, 0, 0.5],
"95": [0.35, 0.09444, 0.08616, 0, 0.5],
"97": [0, 0.44444, 981e-5, 0, 0.48056],
"98": [0, 0.69444, 0.03057, 0, 0.51667],
"99": [0, 0.44444, 0.08336, 0, 0.44445],
"100": [0, 0.69444, 0.09483, 0, 0.51667],
"101": [0, 0.44444, 0.06778, 0, 0.44445],
"102": [0, 0.69444, 0.21705, 0, 0.30556],
"103": [0.19444, 0.44444, 0.10836, 0, 0.5],
"104": [0, 0.69444, 0.01778, 0, 0.51667],
"105": [0, 0.67937, 0.09718, 0, 0.23889],
"106": [0.19444, 0.67937, 0.09162, 0, 0.26667],
"107": [0, 0.69444, 0.08336, 0, 0.48889],
"108": [0, 0.69444, 0.09483, 0, 0.23889],
"109": [0, 0.44444, 0.01778, 0, 0.79445],
"110": [0, 0.44444, 0.01778, 0, 0.51667],
"111": [0, 0.44444, 0.06613, 0, 0.5],
"112": [0.19444, 0.44444, 0.0389, 0, 0.51667],
"113": [0.19444, 0.44444, 0.04169, 0, 0.51667],
"114": [0, 0.44444, 0.10836, 0, 0.34167],
"115": [0, 0.44444, 0.0778, 0, 0.38333],
"116": [0, 0.57143, 0.07225, 0, 0.36111],
"117": [0, 0.44444, 0.04169, 0, 0.51667],
"118": [0, 0.44444, 0.10836, 0, 0.46111],
"119": [0, 0.44444, 0.10836, 0, 0.68334],
"120": [0, 0.44444, 0.09169, 0, 0.46111],
"121": [0.19444, 0.44444, 0.10836, 0, 0.46111],
"122": [0, 0.44444, 0.08752, 0, 0.43472],
"126": [0.35, 0.32659, 0.08826, 0, 0.5],
"160": [0, 0, 0, 0, 0.25],
"168": [0, 0.67937, 0.06385, 0, 0.5],
"176": [0, 0.69444, 0, 0, 0.73752],
"184": [0.17014, 0, 0, 0, 0.44445],
"305": [0, 0.44444, 0.04169, 0, 0.23889],
"567": [0.19444, 0.44444, 0.04169, 0, 0.26667],
"710": [0, 0.69444, 0.0799, 0, 0.5],
"711": [0, 0.63194, 0.08432, 0, 0.5],
"713": [0, 0.60889, 0.08776, 0, 0.5],
"714": [0, 0.69444, 0.09205, 0, 0.5],
"715": [0, 0.69444, 0, 0, 0.5],
"728": [0, 0.69444, 0.09483, 0, 0.5],
"729": [0, 0.67937, 0.07774, 0, 0.27778],
"730": [0, 0.69444, 0, 0, 0.73752],
"732": [0, 0.67659, 0.08826, 0, 0.5],
"733": [0, 0.69444, 0.09205, 0, 0.5],
"915": [0, 0.69444, 0.13372, 0, 0.54167],
"916": [0, 0.69444, 0, 0, 0.83334],
"920": [0, 0.69444, 0.07555, 0, 0.77778],
"923": [0, 0.69444, 0, 0, 0.61111],
"926": [0, 0.69444, 0.12816, 0, 0.66667],
"928": [0, 0.69444, 0.08094, 0, 0.70834],
"931": [0, 0.69444, 0.11983, 0, 0.72222],
"933": [0, 0.69444, 0.09031, 0, 0.77778],
"934": [0, 0.69444, 0.04603, 0, 0.72222],
"936": [0, 0.69444, 0.09031, 0, 0.77778],
"937": [0, 0.69444, 0.08293, 0, 0.72222],
"8211": [0, 0.44444, 0.08616, 0, 0.5],
"8212": [0, 0.44444, 0.08616, 0, 1],
"8216": [0, 0.69444, 0.07816, 0, 0.27778],
"8217": [0, 0.69444, 0.07816, 0, 0.27778],
"8220": [0, 0.69444, 0.14205, 0, 0.5],
"8221": [0, 0.69444, 316e-5, 0, 0.5]
},
"SansSerif-Regular": {
"32": [0, 0, 0, 0, 0.25],
"33": [0, 0.69444, 0, 0, 0.31945],
"34": [0, 0.69444, 0, 0, 0.5],
"35": [0.19444, 0.69444, 0, 0, 0.83334],
"36": [0.05556, 0.75, 0, 0, 0.5],
"37": [0.05556, 0.75, 0, 0, 0.83334],
"38": [0, 0.69444, 0, 0, 0.75834],
"39": [0, 0.69444, 0, 0, 0.27778],
"40": [0.25, 0.75, 0, 0, 0.38889],
"41": [0.25, 0.75, 0, 0, 0.38889],
"42": [0, 0.75, 0, 0, 0.5],
"43": [0.08333, 0.58333, 0, 0, 0.77778],
"44": [0.125, 0.08333, 0, 0, 0.27778],
"45": [0, 0.44444, 0, 0, 0.33333],
"46": [0, 0.08333, 0, 0, 0.27778],
"47": [0.25, 0.75, 0, 0, 0.5],
"48": [0, 0.65556, 0, 0, 0.5],
"49": [0, 0.65556, 0, 0, 0.5],
"50": [0, 0.65556, 0, 0, 0.5],
"51": [0, 0.65556, 0, 0, 0.5],
"52": [0, 0.65556, 0, 0, 0.5],
"53": [0, 0.65556, 0, 0, 0.5],
"54": [0, 0.65556, 0, 0, 0.5],
"55": [0, 0.65556, 0, 0, 0.5],
"56": [0, 0.65556, 0, 0, 0.5],
"57": [0, 0.65556, 0, 0, 0.5],
"58": [0, 0.44444, 0, 0, 0.27778],
"59": [0.125, 0.44444, 0, 0, 0.27778],
"61": [-0.13, 0.37, 0, 0, 0.77778],
"63": [0, 0.69444, 0, 0, 0.47222],
"64": [0, 0.69444, 0, 0, 0.66667],
"65": [0, 0.69444, 0, 0, 0.66667],
"66": [0, 0.69444, 0, 0, 0.66667],
"67": [0, 0.69444, 0, 0, 0.63889],
"68": [0, 0.69444, 0, 0, 0.72223],
"69": [0, 0.69444, 0, 0, 0.59722],
"70": [0, 0.69444, 0, 0, 0.56945],
"71": [0, 0.69444, 0, 0, 0.66667],
"72": [0, 0.69444, 0, 0, 0.70834],
"73": [0, 0.69444, 0, 0, 0.27778],
"74": [0, 0.69444, 0, 0, 0.47222],
"75": [0, 0.69444, 0, 0, 0.69445],
"76": [0, 0.69444, 0, 0, 0.54167],
"77": [0, 0.69444, 0, 0, 0.875],
"78": [0, 0.69444, 0, 0, 0.70834],
"79": [0, 0.69444, 0, 0, 0.73611],
"80": [0, 0.69444, 0, 0, 0.63889],
"81": [0.125, 0.69444, 0, 0, 0.73611],
"82": [0, 0.69444, 0, 0, 0.64584],
"83": [0, 0.69444, 0, 0, 0.55556],
"84": [0, 0.69444, 0, 0, 0.68056],
"85": [0, 0.69444, 0, 0, 0.6875],
"86": [0, 0.69444, 0.01389, 0, 0.66667],
"87": [0, 0.69444, 0.01389, 0, 0.94445],
"88": [0, 0.69444, 0, 0, 0.66667],
"89": [0, 0.69444, 0.025, 0, 0.66667],
"90": [0, 0.69444, 0, 0, 0.61111],
"91": [0.25, 0.75, 0, 0, 0.28889],
"93": [0.25, 0.75, 0, 0, 0.28889],
"94": [0, 0.69444, 0, 0, 0.5],
"95": [0.35, 0.09444, 0.02778, 0, 0.5],
"97": [0, 0.44444, 0, 0, 0.48056],
"98": [0, 0.69444, 0, 0, 0.51667],
"99": [0, 0.44444, 0, 0, 0.44445],
"100": [0, 0.69444, 0, 0, 0.51667],
"101": [0, 0.44444, 0, 0, 0.44445],
"102": [0, 0.69444, 0.06944, 0, 0.30556],
"103": [0.19444, 0.44444, 0.01389, 0, 0.5],
"104": [0, 0.69444, 0, 0, 0.51667],
"105": [0, 0.67937, 0, 0, 0.23889],
"106": [0.19444, 0.67937, 0, 0, 0.26667],
"107": [0, 0.69444, 0, 0, 0.48889],
"108": [0, 0.69444, 0, 0, 0.23889],
"109": [0, 0.44444, 0, 0, 0.79445],
"110": [0, 0.44444, 0, 0, 0.51667],
"111": [0, 0.44444, 0, 0, 0.5],
"112": [0.19444, 0.44444, 0, 0, 0.51667],
"113": [0.19444, 0.44444, 0, 0, 0.51667],
"114": [0, 0.44444, 0.01389, 0, 0.34167],
"115": [0, 0.44444, 0, 0, 0.38333],
"116": [0, 0.57143, 0, 0, 0.36111],
"117": [0, 0.44444, 0, 0, 0.51667],
"118": [0, 0.44444, 0.01389, 0, 0.46111],
"119": [0, 0.44444, 0.01389, 0, 0.68334],
"120": [0, 0.44444, 0, 0, 0.46111],
"121": [0.19444, 0.44444, 0.01389, 0, 0.46111],
"122": [0, 0.44444, 0, 0, 0.43472],
"126": [0.35, 0.32659, 0, 0, 0.5],
"160": [0, 0, 0, 0, 0.25],
"168": [0, 0.67937, 0, 0, 0.5],
"176": [0, 0.69444, 0, 0, 0.66667],
"184": [0.17014, 0, 0, 0, 0.44445],
"305": [0, 0.44444, 0, 0, 0.23889],
"567": [0.19444, 0.44444, 0, 0, 0.26667],
"710": [0, 0.69444, 0, 0, 0.5],
"711": [0, 0.63194, 0, 0, 0.5],
"713": [0, 0.60889, 0, 0, 0.5],
"714": [0, 0.69444, 0, 0, 0.5],
"715": [0, 0.69444, 0, 0, 0.5],
"728": [0, 0.69444, 0, 0, 0.5],
"729": [0, 0.67937, 0, 0, 0.27778],
"730": [0, 0.69444, 0, 0, 0.66667],
"732": [0, 0.67659, 0, 0, 0.5],
"733": [0, 0.69444, 0, 0, 0.5],
"915": [0, 0.69444, 0, 0, 0.54167],
"916": [0, 0.69444, 0, 0, 0.83334],
"920": [0, 0.69444, 0, 0, 0.77778],
"923": [0, 0.69444, 0, 0, 0.61111],
"926": [0, 0.69444, 0, 0, 0.66667],
"928": [0, 0.69444, 0, 0, 0.70834],
"931": [0, 0.69444, 0, 0, 0.72222],
"933": [0, 0.69444, 0, 0, 0.77778],
"934": [0, 0.69444, 0, 0, 0.72222],
"936": [0, 0.69444, 0, 0, 0.77778],
"937": [0, 0.69444, 0, 0, 0.72222],
"8211": [0, 0.44444, 0.02778, 0, 0.5],
"8212": [0, 0.44444, 0.02778, 0, 1],
"8216": [0, 0.69444, 0, 0, 0.27778],
"8217": [0, 0.69444, 0, 0, 0.27778],
"8220": [0, 0.69444, 0, 0, 0.5],
"8221": [0, 0.69444, 0, 0, 0.5]
},
"Script-Regular": {
"32": [0, 0, 0, 0, 0.25],
"65": [0, 0.7, 0.22925, 0, 0.80253],
"66": [0, 0.7, 0.04087, 0, 0.90757],
"67": [0, 0.7, 0.1689, 0, 0.66619],
"68": [0, 0.7, 0.09371, 0, 0.77443],
"69": [0, 0.7, 0.18583, 0, 0.56162],
"70": [0, 0.7, 0.13634, 0, 0.89544],
"71": [0, 0.7, 0.17322, 0, 0.60961],
"72": [0, 0.7, 0.29694, 0, 0.96919],
"73": [0, 0.7, 0.19189, 0, 0.80907],
"74": [0.27778, 0.7, 0.19189, 0, 1.05159],
"75": [0, 0.7, 0.31259, 0, 0.91364],
"76": [0, 0.7, 0.19189, 0, 0.87373],
"77": [0, 0.7, 0.15981, 0, 1.08031],
"78": [0, 0.7, 0.3525, 0, 0.9015],
"79": [0, 0.7, 0.08078, 0, 0.73787],
"80": [0, 0.7, 0.08078, 0, 1.01262],
"81": [0, 0.7, 0.03305, 0, 0.88282],
"82": [0, 0.7, 0.06259, 0, 0.85],
"83": [0, 0.7, 0.19189, 0, 0.86767],
"84": [0, 0.7, 0.29087, 0, 0.74697],
"85": [0, 0.7, 0.25815, 0, 0.79996],
"86": [0, 0.7, 0.27523, 0, 0.62204],
"87": [0, 0.7, 0.27523, 0, 0.80532],
"88": [0, 0.7, 0.26006, 0, 0.94445],
"89": [0, 0.7, 0.2939, 0, 0.70961],
"90": [0, 0.7, 0.24037, 0, 0.8212],
"160": [0, 0, 0, 0, 0.25]
},
"Size1-Regular": {
"32": [0, 0, 0, 0, 0.25],
"40": [0.35001, 0.85, 0, 0, 0.45834],
"41": [0.35001, 0.85, 0, 0, 0.45834],
"47": [0.35001, 0.85, 0, 0, 0.57778],
"91": [0.35001, 0.85, 0, 0, 0.41667],
"92": [0.35001, 0.85, 0, 0, 0.57778],
"93": [0.35001, 0.85, 0, 0, 0.41667],
"123": [0.35001, 0.85, 0, 0, 0.58334],
"125": [0.35001, 0.85, 0, 0, 0.58334],
"160": [0, 0, 0, 0, 0.25],
"710": [0, 0.72222, 0, 0, 0.55556],
"732": [0, 0.72222, 0, 0, 0.55556],
"770": [0, 0.72222, 0, 0, 0.55556],
"771": [0, 0.72222, 0, 0, 0.55556],
"8214": [-99e-5, 0.601, 0, 0, 0.77778],
"8593": [1e-5, 0.6, 0, 0, 0.66667],
"8595": [1e-5, 0.6, 0, 0, 0.66667],
"8657": [1e-5, 0.6, 0, 0, 0.77778],
"8659": [1e-5, 0.6, 0, 0, 0.77778],
"8719": [0.25001, 0.75, 0, 0, 0.94445],
"8720": [0.25001, 0.75, 0, 0, 0.94445],
"8721": [0.25001, 0.75, 0, 0, 1.05556],
"8730": [0.35001, 0.85, 0, 0, 1],
"8739": [-599e-5, 0.606, 0, 0, 0.33333],
"8741": [-599e-5, 0.606, 0, 0, 0.55556],
"8747": [0.30612, 0.805, 0.19445, 0, 0.47222],
"8748": [0.306, 0.805, 0.19445, 0, 0.47222],
"8749": [0.306, 0.805, 0.19445, 0, 0.47222],
"8750": [0.30612, 0.805, 0.19445, 0, 0.47222],
"8896": [0.25001, 0.75, 0, 0, 0.83334],
"8897": [0.25001, 0.75, 0, 0, 0.83334],
"8898": [0.25001, 0.75, 0, 0, 0.83334],
"8899": [0.25001, 0.75, 0, 0, 0.83334],
"8968": [0.35001, 0.85, 0, 0, 0.47222],
"8969": [0.35001, 0.85, 0, 0, 0.47222],
"8970": [0.35001, 0.85, 0, 0, 0.47222],
"8971": [0.35001, 0.85, 0, 0, 0.47222],
"9168": [-99e-5, 0.601, 0, 0, 0.66667],
"10216": [0.35001, 0.85, 0, 0, 0.47222],
"10217": [0.35001, 0.85, 0, 0, 0.47222],
"10752": [0.25001, 0.75, 0, 0, 1.11111],
"10753": [0.25001, 0.75, 0, 0, 1.11111],
"10754": [0.25001, 0.75, 0, 0, 1.11111],
"10756": [0.25001, 0.75, 0, 0, 0.83334],
"10758": [0.25001, 0.75, 0, 0, 0.83334]
},
"Size2-Regular": {
"32": [0, 0, 0, 0, 0.25],
"40": [0.65002, 1.15, 0, 0, 0.59722],
"41": [0.65002, 1.15, 0, 0, 0.59722],
"47": [0.65002, 1.15, 0, 0, 0.81111],
"91": [0.65002, 1.15, 0, 0, 0.47222],
"92": [0.65002, 1.15, 0, 0, 0.81111],
"93": [0.65002, 1.15, 0, 0, 0.47222],
"123": [0.65002, 1.15, 0, 0, 0.66667],
"125": [0.65002, 1.15, 0, 0, 0.66667],
"160": [0, 0, 0, 0, 0.25],
"710": [0, 0.75, 0, 0, 1],
"732": [0, 0.75, 0, 0, 1],
"770": [0, 0.75, 0, 0, 1],
"771": [0, 0.75, 0, 0, 1],
"8719": [0.55001, 1.05, 0, 0, 1.27778],
"8720": [0.55001, 1.05, 0, 0, 1.27778],
"8721": [0.55001, 1.05, 0, 0, 1.44445],
"8730": [0.65002, 1.15, 0, 0, 1],
"8747": [0.86225, 1.36, 0.44445, 0, 0.55556],
"8748": [0.862, 1.36, 0.44445, 0, 0.55556],
"8749": [0.862, 1.36, 0.44445, 0, 0.55556],
"8750": [0.86225, 1.36, 0.44445, 0, 0.55556],
"8896": [0.55001, 1.05, 0, 0, 1.11111],
"8897": [0.55001, 1.05, 0, 0, 1.11111],
"8898": [0.55001, 1.05, 0, 0, 1.11111],
"8899": [0.55001, 1.05, 0, 0, 1.11111],
"8968": [0.65002, 1.15, 0, 0, 0.52778],
"8969": [0.65002, 1.15, 0, 0, 0.52778],
"8970": [0.65002, 1.15, 0, 0, 0.52778],
"8971": [0.65002, 1.15, 0, 0, 0.52778],
"10216": [0.65002, 1.15, 0, 0, 0.61111],
"10217": [0.65002, 1.15, 0, 0, 0.61111],
"10752": [0.55001, 1.05, 0, 0, 1.51112],
"10753": [0.55001, 1.05, 0, 0, 1.51112],
"10754": [0.55001, 1.05, 0, 0, 1.51112],
"10756": [0.55001, 1.05, 0, 0, 1.11111],
"10758": [0.55001, 1.05, 0, 0, 1.11111]
},
"Size3-Regular": {
"32": [0, 0, 0, 0, 0.25],
"40": [0.95003, 1.45, 0, 0, 0.73611],
"41": [0.95003, 1.45, 0, 0, 0.73611],
"47": [0.95003, 1.45, 0, 0, 1.04445],
"91": [0.95003, 1.45, 0, 0, 0.52778],
"92": [0.95003, 1.45, 0, 0, 1.04445],
"93": [0.95003, 1.45, 0, 0, 0.52778],
"123": [0.95003, 1.45, 0, 0, 0.75],
"125": [0.95003, 1.45, 0, 0, 0.75],
"160": [0, 0, 0, 0, 0.25],
"710": [0, 0.75, 0, 0, 1.44445],
"732": [0, 0.75, 0, 0, 1.44445],
"770": [0, 0.75, 0, 0, 1.44445],
"771": [0, 0.75, 0, 0, 1.44445],
"8730": [0.95003, 1.45, 0, 0, 1],
"8968": [0.95003, 1.45, 0, 0, 0.58334],
"8969": [0.95003, 1.45, 0, 0, 0.58334],
"8970": [0.95003, 1.45, 0, 0, 0.58334],
"8971": [0.95003, 1.45, 0, 0, 0.58334],
"10216": [0.95003, 1.45, 0, 0, 0.75],
"10217": [0.95003, 1.45, 0, 0, 0.75]
},
"Size4-Regular": {
"32": [0, 0, 0, 0, 0.25],
"40": [1.25003, 1.75, 0, 0, 0.79167],
"41": [1.25003, 1.75, 0, 0, 0.79167],
"47": [1.25003, 1.75, 0, 0, 1.27778],
"91": [1.25003, 1.75, 0, 0, 0.58334],
"92": [1.25003, 1.75, 0, 0, 1.27778],
"93": [1.25003, 1.75, 0, 0, 0.58334],
"123": [1.25003, 1.75, 0, 0, 0.80556],
"125": [1.25003, 1.75, 0, 0, 0.80556],
"160": [0, 0, 0, 0, 0.25],
"710": [0, 0.825, 0, 0, 1.8889],
"732": [0, 0.825, 0, 0, 1.8889],
"770": [0, 0.825, 0, 0, 1.8889],
"771": [0, 0.825, 0, 0, 1.8889],
"8730": [1.25003, 1.75, 0, 0, 1],
"8968": [1.25003, 1.75, 0, 0, 0.63889],
"8969": [1.25003, 1.75, 0, 0, 0.63889],
"8970": [1.25003, 1.75, 0, 0, 0.63889],
"8971": [1.25003, 1.75, 0, 0, 0.63889],
"9115": [0.64502, 1.155, 0, 0, 0.875],
"9116": [1e-5, 0.6, 0, 0, 0.875],
"9117": [0.64502, 1.155, 0, 0, 0.875],
"9118": [0.64502, 1.155, 0, 0, 0.875],
"9119": [1e-5, 0.6, 0, 0, 0.875],
"9120": [0.64502, 1.155, 0, 0, 0.875],
"9121": [0.64502, 1.155, 0, 0, 0.66667],
"9122": [-99e-5, 0.601, 0, 0, 0.66667],
"9123": [0.64502, 1.155, 0, 0, 0.66667],
"9124": [0.64502, 1.155, 0, 0, 0.66667],
"9125": [-99e-5, 0.601, 0, 0, 0.66667],
"9126": [0.64502, 1.155, 0, 0, 0.66667],
"9127": [1e-5, 0.9, 0, 0, 0.88889],
"9128": [0.65002, 1.15, 0, 0, 0.88889],
"9129": [0.90001, 0, 0, 0, 0.88889],
"9130": [0, 0.3, 0, 0, 0.88889],
"9131": [1e-5, 0.9, 0, 0, 0.88889],
"9132": [0.65002, 1.15, 0, 0, 0.88889],
"9133": [0.90001, 0, 0, 0, 0.88889],
"9143": [0.88502, 0.915, 0, 0, 1.05556],
"10216": [1.25003, 1.75, 0, 0, 0.80556],
"10217": [1.25003, 1.75, 0, 0, 0.80556],
"57344": [-499e-5, 0.605, 0, 0, 1.05556],
"57345": [-499e-5, 0.605, 0, 0, 1.05556],
"57680": [0, 0.12, 0, 0, 0.45],
"57681": [0, 0.12, 0, 0, 0.45],
"57682": [0, 0.12, 0, 0, 0.45],
"57683": [0, 0.12, 0, 0, 0.45]
},
"Typewriter-Regular": {
"32": [0, 0, 0, 0, 0.525],
"33": [0, 0.61111, 0, 0, 0.525],
"34": [0, 0.61111, 0, 0, 0.525],
"35": [0, 0.61111, 0, 0, 0.525],
"36": [0.08333, 0.69444, 0, 0, 0.525],
"37": [0.08333, 0.69444, 0, 0, 0.525],
"38": [0, 0.61111, 0, 0, 0.525],
"39": [0, 0.61111, 0, 0, 0.525],
"40": [0.08333, 0.69444, 0, 0, 0.525],
"41": [0.08333, 0.69444, 0, 0, 0.525],
"42": [0, 0.52083, 0, 0, 0.525],
"43": [-0.08056, 0.53055, 0, 0, 0.525],
"44": [0.13889, 0.125, 0, 0, 0.525],
"45": [-0.08056, 0.53055, 0, 0, 0.525],
"46": [0, 0.125, 0, 0, 0.525],
"47": [0.08333, 0.69444, 0, 0, 0.525],
"48": [0, 0.61111, 0, 0, 0.525],
"49": [0, 0.61111, 0, 0, 0.525],
"50": [0, 0.61111, 0, 0, 0.525],
"51": [0, 0.61111, 0, 0, 0.525],
"52": [0, 0.61111, 0, 0, 0.525],
"53": [0, 0.61111, 0, 0, 0.525],
"54": [0, 0.61111, 0, 0, 0.525],
"55": [0, 0.61111, 0, 0, 0.525],
"56": [0, 0.61111, 0, 0, 0.525],
"57": [0, 0.61111, 0, 0, 0.525],
"58": [0, 0.43056, 0, 0, 0.525],
"59": [0.13889, 0.43056, 0, 0, 0.525],
"60": [-0.05556, 0.55556, 0, 0, 0.525],
"61": [-0.19549, 0.41562, 0, 0, 0.525],
"62": [-0.05556, 0.55556, 0, 0, 0.525],
"63": [0, 0.61111, 0, 0, 0.525],
"64": [0, 0.61111, 0, 0, 0.525],
"65": [0, 0.61111, 0, 0, 0.525],
"66": [0, 0.61111, 0, 0, 0.525],
"67": [0, 0.61111, 0, 0, 0.525],
"68": [0, 0.61111, 0, 0, 0.525],
"69": [0, 0.61111, 0, 0, 0.525],
"70": [0, 0.61111, 0, 0, 0.525],
"71": [0, 0.61111, 0, 0, 0.525],
"72": [0, 0.61111, 0, 0, 0.525],
"73": [0, 0.61111, 0, 0, 0.525],
"74": [0, 0.61111, 0, 0, 0.525],
"75": [0, 0.61111, 0, 0, 0.525],
"76": [0, 0.61111, 0, 0, 0.525],
"77": [0, 0.61111, 0, 0, 0.525],
"78": [0, 0.61111, 0, 0, 0.525],
"79": [0, 0.61111, 0, 0, 0.525],
"80": [0, 0.61111, 0, 0, 0.525],
"81": [0.13889, 0.61111, 0, 0, 0.525],
"82": [0, 0.61111, 0, 0, 0.525],
"83": [0, 0.61111, 0, 0, 0.525],
"84": [0, 0.61111, 0, 0, 0.525],
"85": [0, 0.61111, 0, 0, 0.525],
"86": [0, 0.61111, 0, 0, 0.525],
"87": [0, 0.61111, 0, 0, 0.525],
"88": [0, 0.61111, 0, 0, 0.525],
"89": [0, 0.61111, 0, 0, 0.525],
"90": [0, 0.61111, 0, 0, 0.525],
"91": [0.08333, 0.69444, 0, 0, 0.525],
"92": [0.08333, 0.69444, 0, 0, 0.525],
"93": [0.08333, 0.69444, 0, 0, 0.525],
"94": [0, 0.61111, 0, 0, 0.525],
"95": [0.09514, 0, 0, 0, 0.525],
"96": [0, 0.61111, 0, 0, 0.525],
"97": [0, 0.43056, 0, 0, 0.525],
"98": [0, 0.61111, 0, 0, 0.525],
"99": [0, 0.43056, 0, 0, 0.525],
"100": [0, 0.61111, 0, 0, 0.525],
"101": [0, 0.43056, 0, 0, 0.525],
"102": [0, 0.61111, 0, 0, 0.525],
"103": [0.22222, 0.43056, 0, 0, 0.525],
"104": [0, 0.61111, 0, 0, 0.525],
"105": [0, 0.61111, 0, 0, 0.525],
"106": [0.22222, 0.61111, 0, 0, 0.525],
"107": [0, 0.61111, 0, 0, 0.525],
"108": [0, 0.61111, 0, 0, 0.525],
"109": [0, 0.43056, 0, 0, 0.525],
"110": [0, 0.43056, 0, 0, 0.525],
"111": [0, 0.43056, 0, 0, 0.525],
"112": [0.22222, 0.43056, 0, 0, 0.525],
"113": [0.22222, 0.43056, 0, 0, 0.525],
"114": [0, 0.43056, 0, 0, 0.525],
"115": [0, 0.43056, 0, 0, 0.525],
"116": [0, 0.55358, 0, 0, 0.525],
"117": [0, 0.43056, 0, 0, 0.525],
"118": [0, 0.43056, 0, 0, 0.525],
"119": [0, 0.43056, 0, 0, 0.525],
"120": [0, 0.43056, 0, 0, 0.525],
"121": [0.22222, 0.43056, 0, 0, 0.525],
"122": [0, 0.43056, 0, 0, 0.525],
"123": [0.08333, 0.69444, 0, 0, 0.525],
"124": [0.08333, 0.69444, 0, 0, 0.525],
"125": [0.08333, 0.69444, 0, 0, 0.525],
"126": [0, 0.61111, 0, 0, 0.525],
"127": [0, 0.61111, 0, 0, 0.525],
"160": [0, 0, 0, 0, 0.525],
"176": [0, 0.61111, 0, 0, 0.525],
"184": [0.19445, 0, 0, 0, 0.525],
"305": [0, 0.43056, 0, 0, 0.525],
"567": [0.22222, 0.43056, 0, 0, 0.525],
"711": [0, 0.56597, 0, 0, 0.525],
"713": [0, 0.56555, 0, 0, 0.525],
"714": [0, 0.61111, 0, 0, 0.525],
"715": [0, 0.61111, 0, 0, 0.525],
"728": [0, 0.61111, 0, 0, 0.525],
"730": [0, 0.61111, 0, 0, 0.525],
"770": [0, 0.61111, 0, 0, 0.525],
"771": [0, 0.61111, 0, 0, 0.525],
"776": [0, 0.61111, 0, 0, 0.525],
"915": [0, 0.61111, 0, 0, 0.525],
"916": [0, 0.61111, 0, 0, 0.525],
"920": [0, 0.61111, 0, 0, 0.525],
"923": [0, 0.61111, 0, 0, 0.525],
"926": [0, 0.61111, 0, 0, 0.525],
"928": [0, 0.61111, 0, 0, 0.525],
"931": [0, 0.61111, 0, 0, 0.525],
"933": [0, 0.61111, 0, 0, 0.525],
"934": [0, 0.61111, 0, 0, 0.525],
"936": [0, 0.61111, 0, 0, 0.525],
"937": [0, 0.61111, 0, 0, 0.525],
"8216": [0, 0.61111, 0, 0, 0.525],
"8217": [0, 0.61111, 0, 0, 0.525],
"8242": [0, 0.61111, 0, 0, 0.525],
"9251": [0.11111, 0.21944, 0, 0, 0.525]
}
};
sigmasAndXis = {
slant: [0.25, 0.25, 0.25],
// sigma1
space: [0, 0, 0],
// sigma2
stretch: [0, 0, 0],
// sigma3
shrink: [0, 0, 0],
// sigma4
xHeight: [0.431, 0.431, 0.431],
// sigma5
quad: [1, 1.171, 1.472],
// sigma6
extraSpace: [0, 0, 0],
// sigma7
num1: [0.677, 0.732, 0.925],
// sigma8
num2: [0.394, 0.384, 0.387],
// sigma9
num3: [0.444, 0.471, 0.504],
// sigma10
denom1: [0.686, 0.752, 1.025],
// sigma11
denom2: [0.345, 0.344, 0.532],
// sigma12
sup1: [0.413, 0.503, 0.504],
// sigma13
sup2: [0.363, 0.431, 0.404],
// sigma14
sup3: [0.289, 0.286, 0.294],
// sigma15
sub1: [0.15, 0.143, 0.2],
// sigma16
sub2: [0.247, 0.286, 0.4],
// sigma17
supDrop: [0.386, 0.353, 0.494],
// sigma18
subDrop: [0.05, 0.071, 0.1],
// sigma19
delim1: [2.39, 1.7, 1.98],
// sigma20
delim2: [1.01, 1.157, 1.42],
// sigma21
axisHeight: [0.25, 0.25, 0.25],
// sigma22
// These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
// they correspond to the font parameters of the extension fonts (family 3).
// See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
// match cmex7, we'd use cmex7.tfm values for script and scriptscript
// values.
defaultRuleThickness: [0.04, 0.049, 0.049],
// xi8; cmex7: 0.049
bigOpSpacing1: [0.111, 0.111, 0.111],
// xi9
bigOpSpacing2: [0.166, 0.166, 0.166],
// xi10
bigOpSpacing3: [0.2, 0.2, 0.2],
// xi11
bigOpSpacing4: [0.6, 0.611, 0.611],
// xi12; cmex7: 0.611
bigOpSpacing5: [0.1, 0.143, 0.143],
// xi13; cmex7: 0.143
// The \sqrt rule width is taken from the height of the surd character.
// Since we use the same font at all sizes, this thickness doesn't scale.
sqrtRuleThickness: [0.04, 0.04, 0.04],
// This value determines how large a pt is, for metrics which are defined
// in terms of pts.
// This value is also used in katex.scss; if you change it make sure the
// values match.
ptPerEm: [10, 10, 10],
// The space between adjacent `|` columns in an array definition. From
// `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
doubleRuleSep: [0.2, 0.2, 0.2],
// The width of separator lines in {array} environments. From
// `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
arrayRuleWidth: [0.04, 0.04, 0.04],
// Two values from LaTeX source2e:
fboxsep: [0.3, 0.3, 0.3],
// 3 pt / ptPerEm
fboxrule: [0.04, 0.04, 0.04]
// 0.4 pt / ptPerEm
};
extraCharacterMap = {
// Latin-1
"\xC5": "A",
"\xD0": "D",
"\xDE": "o",
"\xE5": "a",
"\xF0": "d",
"\xFE": "o",
// Cyrillic
"\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"
};
__name(setFontMetrics, "setFontMetrics");
__name(getCharacterMetrics, "getCharacterMetrics");
fontMetricsBySizeIndex = {};
__name(getGlobalMetrics, "getGlobalMetrics");
sizeStyleMap = [
// Each element contains [textsize, scriptsize, scriptscriptsize].
// The size mappings are taken from TeX with \normalsize=10pt.
[1, 1, 1],
// size1: [5, 5, 5] \tiny
[2, 1, 1],
// size2: [6, 5, 5]
[3, 1, 1],
// size3: [7, 5, 5] \scriptsize
[4, 2, 1],
// size4: [8, 6, 5] \footnotesize
[5, 2, 1],
// size5: [9, 6, 5] \small
[6, 3, 1],
// size6: [10, 7, 5] \normalsize
[7, 4, 2],
// size7: [12, 8, 6] \large
[8, 6, 3],
// size8: [14.4, 10, 7] \Large
[9, 7, 6],
// size9: [17.28, 12, 10] \LARGE
[10, 8, 7],
// size10: [20.74, 14.4, 12] \huge
[11, 10, 9]
// size11: [24.88, 20.74, 17.28] \HUGE
];
sizeMultipliers = [
// fontMetrics.js:getGlobalMetrics also uses size indexes, so if
// you change size indexes, change that function.
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.2,
1.44,
1.728,
2.074,
2.488
];
sizeAtStyle = /* @__PURE__ */ __name(function sizeAtStyle2(size4, style3) {
return style3.size < 2 ? size4 : sizeStyleMap[size4 - 1][style3.size - 1];
}, "sizeAtStyle");
Options = class _Options {
static {
__name(this, "Options");
}
// A font family applies to a group of fonts (i.e. SansSerif), while a font
// represents a specific font (i.e. SansSerif Bold).
// See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
/**
* The base size index.
*/
constructor(data5) {
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 = 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.sizeMultiplier = sizeMultipliers[this.size - 1];
this.maxSize = data5.maxSize;
this.minRuleThickness = data5.minRuleThickness;
this._fontMetrics = void 0;
}
/**
* Returns a new options object with the same properties as "this". Properties
* from "extension" will be copied to the new options object.
*/
extend(extension5) {
var data5 = {
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 key in extension5) {
if (extension5.hasOwnProperty(key)) {
data5[key] = extension5[key];
}
}
return new _Options(data5);
}
/**
* Return an options object with the given style. If `this.style === style`,
* returns `this`.
*/
havingStyle(style3) {
if (this.style === style3) {
return this;
} else {
return this.extend({
style: style3,
size: sizeAtStyle(this.textSize, style3)
});
}
}
/**
* Return an options object with a cramped version of the current style. If
* the current style is cramped, returns `this`.
*/
havingCrampedStyle() {
return this.havingStyle(this.style.cramp());
}
/**
* Return an options object with the given size and in at least `\textstyle`.
* Returns `this` if appropriate.
*/
havingSize(size4) {
if (this.size === size4 && this.textSize === size4) {
return this;
} else {
return this.extend({
style: this.style.text(),
size: size4,
textSize: size4,
sizeMultiplier: sizeMultipliers[size4 - 1]
});
}
}
/**
* Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
* changes to at least `\textstyle`.
*/
havingBaseStyle(style3) {
style3 = style3 || this.style.text();
var wantSize = sizeAtStyle(_Options.BASESIZE, style3);
if (this.size === wantSize && this.textSize === _Options.BASESIZE && this.style === style3) {
return this;
} else {
return this.extend({
style: style3,
size: wantSize
});
}
}
/**
* Remove the effect of sizing changes such as \Huge.
* Keep the effect of the current style, such as \scriptstyle.
*/
havingBaseSizing() {
var size4;
switch (this.style.id) {
case 4:
case 5:
size4 = 3;
break;
case 6:
case 7:
size4 = 1;
break;
default:
size4 = 6;
}
return this.extend({
style: this.style.text(),
size: size4
});
}
/**
* Create a new options object with the given color.
*/
withColor(color2) {
return this.extend({
color: color2
});
}
/**
* Create a new options object with "phantom" set to true.
*/
withPhantom() {
return this.extend({
phantom: true
});
}
/**
* Creates a new options object with the given math font or old text font.
* @type {[type]}
*/
withFont(font) {
return this.extend({
font
});
}
/**
* Create a new options objects with the given fontFamily.
*/
withTextFontFamily(fontFamily) {
return this.extend({
fontFamily,
font: ""
});
}
/**
* Creates a new options object with the given font weight
*/
withTextFontWeight(fontWeight) {
return this.extend({
fontWeight,
font: ""
});
}
/**
* Creates a new options object with the given font weight
*/
withTextFontShape(fontShape) {
return this.extend({
fontShape,
font: ""
});
}
/**
* Return the CSS sizing classes required to switch from enclosing options
* `oldOptions` to `this`. Returns an array of classes.
*/
sizingClasses(oldOptions) {
if (oldOptions.size !== this.size) {
return ["sizing", "reset-size" + oldOptions.size, "size" + this.size];
} else {
return [];
}
}
/**
* Return the CSS sizing classes required to switch to the base size. Like
* `this.havingSize(BASESIZE).sizingClasses(this)`.
*/
baseSizingClasses() {
if (this.size !== _Options.BASESIZE) {
return ["sizing", "reset-size" + this.size, "size" + _Options.BASESIZE];
} else {
return [];
}
}
/**
* Return the font metrics for this size.
*/
fontMetrics() {
if (!this._fontMetrics) {
this._fontMetrics = getGlobalMetrics(this.size);
}
return this._fontMetrics;
}
/**
* Gets the CSS color of the current options object
*/
getColor() {
if (this.phantom) {
return "transparent";
} else {
return this.color;
}
}
};
Options.BASESIZE = 6;
ptPerUnit = {
// https://en.wikibooks.org/wiki/LaTeX/Lengths and
// https://tex.stackexchange.com/a/8263
"pt": 1,
// TeX point
"mm": 7227 / 2540,
// millimeter
"cm": 7227 / 254,
// centimeter
"in": 72.27,
// inch
"bp": 803 / 800,
// big (PostScript) points
"pc": 12,
// pica
"dd": 1238 / 1157,
// didot
"cc": 14856 / 1157,
// cicero (12 didot)
"nd": 685 / 642,
// new didot
"nc": 1370 / 107,
// new cicero (12 new didot)
"sp": 1 / 65536,
// scaled point (TeX's internal smallest unit)
// https://tex.stackexchange.com/a/41371
"px": 803 / 800
// \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
};
relativeUnit = {
"ex": true,
"em": true,
"mu": true
};
validUnit = /* @__PURE__ */ __name(function validUnit2(unit2) {
if (typeof unit2 !== "string") {
unit2 = unit2.unit;
}
return unit2 in ptPerUnit || unit2 in relativeUnit || unit2 === "ex";
}, "validUnit");
calculateSize2 = /* @__PURE__ */ __name(function calculateSize3(sizeValue, options2) {
var scale2;
if (sizeValue.unit in ptPerUnit) {
scale2 = ptPerUnit[sizeValue.unit] / options2.fontMetrics().ptPerEm / options2.sizeMultiplier;
} else if (sizeValue.unit === "mu") {
scale2 = options2.fontMetrics().cssEmPerMu;
} else {
var unitOptions;
if (options2.style.isTight()) {
unitOptions = options2.havingStyle(options2.style.text());
} else {
unitOptions = options2;
}
if (sizeValue.unit === "ex") {
scale2 = unitOptions.fontMetrics().xHeight;
} else if (sizeValue.unit === "em") {
scale2 = unitOptions.fontMetrics().quad;
} else {
throw new ParseError("Invalid unit: '" + sizeValue.unit + "'");
}
if (unitOptions !== options2) {
scale2 *= unitOptions.sizeMultiplier / options2.sizeMultiplier;
}
}
return Math.min(sizeValue.number * scale2, options2.maxSize);
}, "calculateSize");
makeEm = /* @__PURE__ */ __name(function makeEm2(n2) {
return +n2.toFixed(4) + "em";
}, "makeEm");
createClass = /* @__PURE__ */ __name(function createClass2(classes3) {
return classes3.filter((cls) => cls).join(" ");
}, "createClass");
initNode = /* @__PURE__ */ __name(function initNode2(classes3, options2, style3) {
this.classes = classes3 || [];
this.attributes = {};
this.height = 0;
this.depth = 0;
this.maxFontSize = 0;
this.style = style3 || {};
if (options2) {
if (options2.style.isTight()) {
this.classes.push("mtight");
}
var color2 = options2.getColor();
if (color2) {
this.style.color = color2;
}
}
}, "initNode");
toNode = /* @__PURE__ */ __name(function toNode2(tagName) {
var node2 = document.createElement(tagName);
node2.className = createClass(this.classes);
for (var style3 in this.style) {
if (this.style.hasOwnProperty(style3)) {
node2.style[style3] = this.style[style3];
}
}
for (var attr in this.attributes) {
if (this.attributes.hasOwnProperty(attr)) {
node2.setAttribute(attr, this.attributes[attr]);
}
}
for (var i2 = 0; i2 < this.children.length; i2++) {
node2.appendChild(this.children[i2].toNode());
}
return node2;
}, "toNode");
invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/;
toMarkup = /* @__PURE__ */ __name(function toMarkup2(tagName) {
var markup = "<" + tagName;
if (this.classes.length) {
markup += ' class="' + utils.escape(createClass(this.classes)) + '"';
}
var styles4 = "";
for (var style3 in this.style) {
if (this.style.hasOwnProperty(style3)) {
styles4 += utils.hyphenate(style3) + ":" + this.style[style3] + ";";
}
}
if (styles4) {
markup += ' style="' + utils.escape(styles4) + '"';
}
for (var attr in this.attributes) {
if (this.attributes.hasOwnProperty(attr)) {
if (invalidAttributeNameRegex.test(attr)) {
throw new ParseError("Invalid attribute name '" + attr + "'");
}
markup += " " + attr + '="' + utils.escape(this.attributes[attr]) + '"';
}
}
markup += ">";
for (var i2 = 0; i2 < this.children.length; i2++) {
markup += this.children[i2].toMarkup();
}
markup += "" + tagName + ">";
return markup;
}, "toMarkup");
Span = class {
static {
__name(this, "Span");
}
constructor(classes3, children2, options2, style3) {
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;
initNode.call(this, classes3, options2, style3);
this.children = children2 || [];
}
/**
* Sets an arbitrary attribute on the span. Warning: use this wisely. Not
* all browsers support attributes the same, and having too many custom
* attributes is probably bad.
*/
setAttribute(attribute, value2) {
this.attributes[attribute] = value2;
}
hasClass(className) {
return utils.contains(this.classes, className);
}
toNode() {
return toNode.call(this, "span");
}
toMarkup() {
return toMarkup.call(this, "span");
}
};
Anchor = class {
static {
__name(this, "Anchor");
}
constructor(href, classes3, children2, options2) {
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;
initNode.call(this, classes3, options2);
this.children = children2 || [];
this.setAttribute("href", href);
}
setAttribute(attribute, value2) {
this.attributes[attribute] = value2;
}
hasClass(className) {
return utils.contains(this.classes, className);
}
toNode() {
return toNode.call(this, "a");
}
toMarkup() {
return toMarkup.call(this, "a");
}
};
Img = class {
static {
__name(this, "Img");
}
constructor(src, alt, style3) {
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 = alt;
this.src = src;
this.classes = ["mord"];
this.style = style3;
}
hasClass(className) {
return utils.contains(this.classes, className);
}
toNode() {
var node2 = document.createElement("img");
node2.src = this.src;
node2.alt = this.alt;
node2.className = "mord";
for (var style3 in this.style) {
if (this.style.hasOwnProperty(style3)) {
node2.style[style3] = this.style[style3];
}
}
return node2;
}
toMarkup() {
var markup = '
";
return markup;
}
};
iCombinations = {
"\xEE": "\u0131\u0302",
"\xEF": "\u0131\u0308",
"\xED": "\u0131\u0301",
// 'ī': '\u0131\u0304', // enable when we add Extended Latin
"\xEC": "\u0131\u0300"
};
SymbolNode = class {
static {
__name(this, "SymbolNode");
}
constructor(text4, height2, depth, italic, skew, width3, classes3, style3) {
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 = text4;
this.height = height2 || 0;
this.depth = depth || 0;
this.italic = italic || 0;
this.skew = skew || 0;
this.width = width3 || 0;
this.classes = classes3 || [];
this.style = style3 || {};
this.maxFontSize = 0;
var script = scriptFromCodepoint(this.text.charCodeAt(0));
if (script) {
this.classes.push(script + "_fallback");
}
if (/[îïíì]/.test(this.text)) {
this.text = iCombinations[this.text];
}
}
hasClass(className) {
return utils.contains(this.classes, className);
}
/**
* Creates a text node or span from a symbol node. Note that a span is only
* created if it is needed.
*/
toNode() {
var node2 = document.createTextNode(this.text);
var span = null;
if (this.italic > 0) {
span = document.createElement("span");
span.style.marginRight = makeEm(this.italic);
}
if (this.classes.length > 0) {
span = span || document.createElement("span");
span.className = createClass(this.classes);
}
for (var style3 in this.style) {
if (this.style.hasOwnProperty(style3)) {
span = span || document.createElement("span");
span.style[style3] = this.style[style3];
}
}
if (span) {
span.appendChild(node2);
return span;
} else {
return node2;
}
}
/**
* Creates markup for a symbol node.
*/
toMarkup() {
var needsSpan = false;
var markup = " 0) {
styles4 += "margin-right:" + this.italic + "em;";
}
for (var style3 in this.style) {
if (this.style.hasOwnProperty(style3)) {
styles4 += utils.hyphenate(style3) + ":" + this.style[style3] + ";";
}
}
if (styles4) {
needsSpan = true;
markup += ' style="' + utils.escape(styles4) + '"';
}
var escaped = utils.escape(this.text);
if (needsSpan) {
markup += ">";
markup += escaped;
markup += "";
return markup;
} else {
return escaped;
}
}
};
SvgNode = class {
static {
__name(this, "SvgNode");
}
constructor(children2, attributes) {
this.children = void 0;
this.attributes = void 0;
this.children = children2 || [];
this.attributes = attributes || {};
}
toNode() {
var svgNS = "http://www.w3.org/2000/svg";
var node2 = document.createElementNS(svgNS, "svg");
for (var attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
node2.setAttribute(attr, this.attributes[attr]);
}
}
for (var i2 = 0; i2 < this.children.length; i2++) {
node2.appendChild(this.children[i2].toNode());
}
return node2;
}
toMarkup() {
var markup = '";
return markup;
}
};
PathNode = class {
static {
__name(this, "PathNode");
}
constructor(pathName, alternate) {
this.pathName = void 0;
this.alternate = void 0;
this.pathName = pathName;
this.alternate = alternate;
}
toNode() {
var svgNS = "http://www.w3.org/2000/svg";
var node2 = document.createElementNS(svgNS, "path");
if (this.alternate) {
node2.setAttribute("d", this.alternate);
} else {
node2.setAttribute("d", path[this.pathName]);
}
return node2;
}
toMarkup() {
if (this.alternate) {
return '';
} else {
return '';
}
}
};
LineNode = class {
static {
__name(this, "LineNode");
}
constructor(attributes) {
this.attributes = void 0;
this.attributes = attributes || {};
}
toNode() {
var svgNS = "http://www.w3.org/2000/svg";
var node2 = document.createElementNS(svgNS, "line");
for (var attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
node2.setAttribute(attr, this.attributes[attr]);
}
}
return node2;
}
toMarkup() {
var markup = "";
return markup;
}
};
__name(assertSymbolDomNode, "assertSymbolDomNode");
__name(assertSpan, "assertSpan");
ATOMS = {
"bin": 1,
"close": 1,
"inner": 1,
"open": 1,
"punct": 1,
"rel": 1
};
NON_ATOMS = {
"accent-token": 1,
"mathord": 1,
"op-token": 1,
"spacing": 1,
"textord": 1
};
symbols = {
"math": {},
"text": {}
};
__name(defineSymbol, "defineSymbol");
math = "math";
text2 = "text";
main = "main";
ams = "ams";
accent = "accent-token";
bin = "bin";
close = "close";
inner = "inner";
mathord = "mathord";
op = "op-token";
open = "open";
punct = "punct";
rel = "rel";
spacing = "spacing";
textord = "textord";
defineSymbol(math, main, rel, "\u2261", "\\equiv", true);
defineSymbol(math, main, rel, "\u227A", "\\prec", true);
defineSymbol(math, main, rel, "\u227B", "\\succ", true);
defineSymbol(math, main, rel, "\u223C", "\\sim", true);
defineSymbol(math, main, rel, "\u22A5", "\\perp");
defineSymbol(math, main, rel, "\u2AAF", "\\preceq", true);
defineSymbol(math, main, rel, "\u2AB0", "\\succeq", true);
defineSymbol(math, main, rel, "\u2243", "\\simeq", true);
defineSymbol(math, main, rel, "\u2223", "\\mid", true);
defineSymbol(math, main, rel, "\u226A", "\\ll", true);
defineSymbol(math, main, rel, "\u226B", "\\gg", true);
defineSymbol(math, main, rel, "\u224D", "\\asymp", true);
defineSymbol(math, main, rel, "\u2225", "\\parallel");
defineSymbol(math, main, rel, "\u22C8", "\\bowtie", true);
defineSymbol(math, main, rel, "\u2323", "\\smile", true);
defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq", true);
defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq", true);
defineSymbol(math, main, rel, "\u2250", "\\doteq", true);
defineSymbol(math, main, rel, "\u2322", "\\frown", true);
defineSymbol(math, main, rel, "\u220B", "\\ni", true);
defineSymbol(math, main, rel, "\u221D", "\\propto", true);
defineSymbol(math, main, rel, "\u22A2", "\\vdash", true);
defineSymbol(math, main, rel, "\u22A3", "\\dashv", true);
defineSymbol(math, main, rel, "\u220B", "\\owns");
defineSymbol(math, main, punct, ".", "\\ldotp");
defineSymbol(math, main, punct, "\u22C5", "\\cdotp");
defineSymbol(math, main, textord, "#", "\\#");
defineSymbol(text2, main, textord, "#", "\\#");
defineSymbol(math, 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);
defineSymbol(math, main, textord, "\u2203", "\\exists", true);
defineSymbol(math, main, textord, "\u2207", "\\nabla", true);
defineSymbol(math, main, textord, "\u266D", "\\flat", true);
defineSymbol(math, main, textord, "\u2113", "\\ell", true);
defineSymbol(math, main, textord, "\u266E", "\\natural", true);
defineSymbol(math, main, textord, "\u2663", "\\clubsuit", true);
defineSymbol(math, main, textord, "\u2118", "\\wp", true);
defineSymbol(math, main, textord, "\u266F", "\\sharp", true);
defineSymbol(math, main, textord, "\u2662", "\\diamondsuit", true);
defineSymbol(math, main, textord, "\u211C", "\\Re", true);
defineSymbol(math, main, textord, "\u2661", "\\heartsuit", true);
defineSymbol(math, main, textord, "\u2111", "\\Im", true);
defineSymbol(math, main, textord, "\u2660", "\\spadesuit", true);
defineSymbol(math, main, textord, "\xA7", "\\S", true);
defineSymbol(text2, main, textord, "\xA7", "\\S");
defineSymbol(math, main, textord, "\xB6", "\\P", true);
defineSymbol(text2, main, textord, "\xB6", "\\P");
defineSymbol(math, main, textord, "\u2020", "\\dag");
defineSymbol(text2, main, textord, "\u2020", "\\dag");
defineSymbol(text2, main, textord, "\u2020", "\\textdagger");
defineSymbol(math, main, textord, "\u2021", "\\ddag");
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);
defineSymbol(math, main, open, "\u27EE", "\\lgroup", true);
defineSymbol(math, main, bin, "\u2213", "\\mp", true);
defineSymbol(math, main, bin, "\u2296", "\\ominus", true);
defineSymbol(math, main, bin, "\u228E", "\\uplus", true);
defineSymbol(math, main, bin, "\u2293", "\\sqcap", true);
defineSymbol(math, main, bin, "\u2217", "\\ast");
defineSymbol(math, main, bin, "\u2294", "\\sqcup", true);
defineSymbol(math, main, bin, "\u25EF", "\\bigcirc", true);
defineSymbol(math, main, bin, "\u2219", "\\bullet", true);
defineSymbol(math, main, bin, "\u2021", "\\ddagger");
defineSymbol(math, main, bin, "\u2240", "\\wr", true);
defineSymbol(math, main, bin, "\u2A3F", "\\amalg");
defineSymbol(math, main, bin, "&", "\\And");
defineSymbol(math, main, rel, "\u27F5", "\\longleftarrow", true);
defineSymbol(math, main, rel, "\u21D0", "\\Leftarrow", true);
defineSymbol(math, main, rel, "\u27F8", "\\Longleftarrow", true);
defineSymbol(math, main, rel, "\u27F6", "\\longrightarrow", true);
defineSymbol(math, main, rel, "\u21D2", "\\Rightarrow", true);
defineSymbol(math, main, rel, "\u27F9", "\\Longrightarrow", true);
defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow", true);
defineSymbol(math, main, rel, "\u27F7", "\\longleftrightarrow", true);
defineSymbol(math, main, rel, "\u21D4", "\\Leftrightarrow", true);
defineSymbol(math, main, rel, "\u27FA", "\\Longleftrightarrow", true);
defineSymbol(math, main, rel, "\u21A6", "\\mapsto", true);
defineSymbol(math, main, rel, "\u27FC", "\\longmapsto", true);
defineSymbol(math, main, rel, "\u2197", "\\nearrow", true);
defineSymbol(math, main, rel, "\u21A9", "\\hookleftarrow", true);
defineSymbol(math, main, rel, "\u21AA", "\\hookrightarrow", true);
defineSymbol(math, main, rel, "\u2198", "\\searrow", true);
defineSymbol(math, main, rel, "\u21BC", "\\leftharpoonup", true);
defineSymbol(math, main, rel, "\u21C0", "\\rightharpoonup", true);
defineSymbol(math, main, rel, "\u2199", "\\swarrow", true);
defineSymbol(math, main, rel, "\u21BD", "\\leftharpoondown", true);
defineSymbol(math, main, rel, "\u21C1", "\\rightharpoondown", true);
defineSymbol(math, main, rel, "\u2196", "\\nwarrow", true);
defineSymbol(math, main, rel, "\u21CC", "\\rightleftharpoons", true);
defineSymbol(math, ams, rel, "\u226E", "\\nless", true);
defineSymbol(math, ams, rel, "\uE010", "\\@nleqslant");
defineSymbol(math, ams, rel, "\uE011", "\\@nleqq");
defineSymbol(math, ams, rel, "\u2A87", "\\lneq", true);
defineSymbol(math, ams, rel, "\u2268", "\\lneqq", true);
defineSymbol(math, ams, rel, "\uE00C", "\\@lvertneqq");
defineSymbol(math, ams, rel, "\u22E6", "\\lnsim", true);
defineSymbol(math, ams, rel, "\u2A89", "\\lnapprox", true);
defineSymbol(math, ams, rel, "\u2280", "\\nprec", true);
defineSymbol(math, ams, rel, "\u22E0", "\\npreceq", true);
defineSymbol(math, ams, rel, "\u22E8", "\\precnsim", true);
defineSymbol(math, ams, rel, "\u2AB9", "\\precnapprox", true);
defineSymbol(math, ams, rel, "\u2241", "\\nsim", true);
defineSymbol(math, ams, rel, "\uE006", "\\@nshortmid");
defineSymbol(math, ams, rel, "\u2224", "\\nmid", true);
defineSymbol(math, ams, rel, "\u22AC", "\\nvdash", true);
defineSymbol(math, ams, rel, "\u22AD", "\\nvDash", true);
defineSymbol(math, ams, rel, "\u22EA", "\\ntriangleleft");
defineSymbol(math, ams, rel, "\u22EC", "\\ntrianglelefteq", true);
defineSymbol(math, ams, rel, "\u228A", "\\subsetneq", true);
defineSymbol(math, ams, rel, "\uE01A", "\\@varsubsetneq");
defineSymbol(math, ams, rel, "\u2ACB", "\\subsetneqq", true);
defineSymbol(math, ams, rel, "\uE017", "\\@varsubsetneqq");
defineSymbol(math, ams, rel, "\u226F", "\\ngtr", true);
defineSymbol(math, ams, rel, "\uE00F", "\\@ngeqslant");
defineSymbol(math, ams, rel, "\uE00E", "\\@ngeqq");
defineSymbol(math, ams, rel, "\u2A88", "\\gneq", true);
defineSymbol(math, ams, rel, "\u2269", "\\gneqq", true);
defineSymbol(math, ams, rel, "\uE00D", "\\@gvertneqq");
defineSymbol(math, ams, rel, "\u22E7", "\\gnsim", true);
defineSymbol(math, ams, rel, "\u2A8A", "\\gnapprox", true);
defineSymbol(math, ams, rel, "\u2281", "\\nsucc", true);
defineSymbol(math, ams, rel, "\u22E1", "\\nsucceq", true);
defineSymbol(math, ams, rel, "\u22E9", "\\succnsim", true);
defineSymbol(math, ams, rel, "\u2ABA", "\\succnapprox", true);
defineSymbol(math, ams, rel, "\u2246", "\\ncong", true);
defineSymbol(math, ams, rel, "\uE007", "\\@nshortparallel");
defineSymbol(math, ams, rel, "\u2226", "\\nparallel", true);
defineSymbol(math, ams, rel, "\u22AF", "\\nVDash", true);
defineSymbol(math, ams, rel, "\u22EB", "\\ntriangleright");
defineSymbol(math, ams, rel, "\u22ED", "\\ntrianglerighteq", true);
defineSymbol(math, ams, rel, "\uE018", "\\@nsupseteqq");
defineSymbol(math, ams, rel, "\u228B", "\\supsetneq", true);
defineSymbol(math, ams, rel, "\uE01B", "\\@varsupsetneq");
defineSymbol(math, ams, rel, "\u2ACC", "\\supsetneqq", true);
defineSymbol(math, ams, rel, "\uE019", "\\@varsupsetneqq");
defineSymbol(math, ams, rel, "\u22AE", "\\nVdash", true);
defineSymbol(math, ams, rel, "\u2AB5", "\\precneqq", true);
defineSymbol(math, ams, rel, "\u2AB6", "\\succneqq", true);
defineSymbol(math, ams, rel, "\uE016", "\\@nsubseteqq");
defineSymbol(math, ams, bin, "\u22B4", "\\unlhd");
defineSymbol(math, ams, bin, "\u22B5", "\\unrhd");
defineSymbol(math, ams, rel, "\u219A", "\\nleftarrow", true);
defineSymbol(math, ams, rel, "\u219B", "\\nrightarrow", true);
defineSymbol(math, ams, rel, "\u21CD", "\\nLeftarrow", true);
defineSymbol(math, ams, rel, "\u21CF", "\\nRightarrow", true);
defineSymbol(math, ams, rel, "\u21AE", "\\nleftrightarrow", true);
defineSymbol(math, ams, rel, "\u21CE", "\\nLeftrightarrow", true);
defineSymbol(math, ams, rel, "\u25B3", "\\vartriangle");
defineSymbol(math, ams, textord, "\u210F", "\\hslash");
defineSymbol(math, ams, textord, "\u25BD", "\\triangledown");
defineSymbol(math, ams, textord, "\u25CA", "\\lozenge");
defineSymbol(math, ams, textord, "\u24C8", "\\circledS");
defineSymbol(math, 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");
defineSymbol(math, ams, textord, "\u2132", "\\Finv", true);
defineSymbol(math, ams, textord, "\u2141", "\\Game", true);
defineSymbol(math, ams, textord, "\u2035", "\\backprime");
defineSymbol(math, ams, textord, "\u25B2", "\\blacktriangle");
defineSymbol(math, ams, textord, "\u25BC", "\\blacktriangledown");
defineSymbol(math, ams, textord, "\u25A0", "\\blacksquare");
defineSymbol(math, ams, textord, "\u29EB", "\\blacklozenge");
defineSymbol(math, ams, textord, "\u2605", "\\bigstar");
defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle", true);
defineSymbol(math, ams, textord, "\u2201", "\\complement", true);
defineSymbol(math, ams, textord, "\xF0", "\\eth", true);
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(text2, ams, textord, "\xA5", "\\yen", true);
defineSymbol(math, ams, textord, "\u2713", "\\checkmark", true);
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);
defineSymbol(math, ams, textord, "\u03DD", "\\digamma", true);
defineSymbol(math, ams, textord, "\u03F0", "\\varkappa");
defineSymbol(math, ams, open, "\u250C", "\\@ulcorner", true);
defineSymbol(math, ams, close, "\u2510", "\\@urcorner", true);
defineSymbol(math, ams, open, "\u2514", "\\@llcorner", true);
defineSymbol(math, ams, close, "\u2518", "\\@lrcorner", true);
defineSymbol(math, ams, rel, "\u2266", "\\leqq", true);
defineSymbol(math, ams, rel, "\u2A7D", "\\leqslant", true);
defineSymbol(math, ams, rel, "\u2A95", "\\eqslantless", true);
defineSymbol(math, ams, rel, "\u2272", "\\lesssim", true);
defineSymbol(math, ams, rel, "\u2A85", "\\lessapprox", true);
defineSymbol(math, ams, rel, "\u224A", "\\approxeq", true);
defineSymbol(math, ams, bin, "\u22D6", "\\lessdot");
defineSymbol(math, ams, rel, "\u22D8", "\\lll", true);
defineSymbol(math, ams, rel, "\u2276", "\\lessgtr", true);
defineSymbol(math, ams, rel, "\u22DA", "\\lesseqgtr", true);
defineSymbol(math, ams, rel, "\u2A8B", "\\lesseqqgtr", true);
defineSymbol(math, ams, rel, "\u2251", "\\doteqdot");
defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq", true);
defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq", true);
defineSymbol(math, ams, rel, "\u223D", "\\backsim", true);
defineSymbol(math, ams, rel, "\u22CD", "\\backsimeq", true);
defineSymbol(math, ams, rel, "\u2AC5", "\\subseteqq", true);
defineSymbol(math, ams, rel, "\u22D0", "\\Subset", true);
defineSymbol(math, ams, rel, "\u228F", "\\sqsubset", true);
defineSymbol(math, ams, rel, "\u227C", "\\preccurlyeq", true);
defineSymbol(math, ams, rel, "\u22DE", "\\curlyeqprec", true);
defineSymbol(math, ams, rel, "\u227E", "\\precsim", true);
defineSymbol(math, ams, rel, "\u2AB7", "\\precapprox", true);
defineSymbol(math, ams, rel, "\u22B2", "\\vartriangleleft");
defineSymbol(math, ams, rel, "\u22B4", "\\trianglelefteq");
defineSymbol(math, ams, rel, "\u22A8", "\\vDash", true);
defineSymbol(math, ams, rel, "\u22AA", "\\Vvdash", true);
defineSymbol(math, ams, rel, "\u2323", "\\smallsmile");
defineSymbol(math, ams, rel, "\u2322", "\\smallfrown");
defineSymbol(math, ams, rel, "\u224F", "\\bumpeq", true);
defineSymbol(math, ams, rel, "\u224E", "\\Bumpeq", true);
defineSymbol(math, ams, rel, "\u2267", "\\geqq", true);
defineSymbol(math, ams, rel, "\u2A7E", "\\geqslant", true);
defineSymbol(math, ams, rel, "\u2A96", "\\eqslantgtr", true);
defineSymbol(math, ams, rel, "\u2273", "\\gtrsim", true);
defineSymbol(math, ams, rel, "\u2A86", "\\gtrapprox", true);
defineSymbol(math, ams, bin, "\u22D7", "\\gtrdot");
defineSymbol(math, ams, rel, "\u22D9", "\\ggg", true);
defineSymbol(math, ams, rel, "\u2277", "\\gtrless", true);
defineSymbol(math, ams, rel, "\u22DB", "\\gtreqless", true);
defineSymbol(math, ams, rel, "\u2A8C", "\\gtreqqless", true);
defineSymbol(math, ams, rel, "\u2256", "\\eqcirc", true);
defineSymbol(math, ams, rel, "\u2257", "\\circeq", true);
defineSymbol(math, ams, rel, "\u225C", "\\triangleq", true);
defineSymbol(math, ams, rel, "\u223C", "\\thicksim");
defineSymbol(math, ams, rel, "\u2248", "\\thickapprox");
defineSymbol(math, ams, rel, "\u2AC6", "\\supseteqq", true);
defineSymbol(math, ams, rel, "\u22D1", "\\Supset", true);
defineSymbol(math, ams, rel, "\u2290", "\\sqsupset", true);
defineSymbol(math, ams, rel, "\u227D", "\\succcurlyeq", true);
defineSymbol(math, ams, rel, "\u22DF", "\\curlyeqsucc", true);
defineSymbol(math, ams, rel, "\u227F", "\\succsim", true);
defineSymbol(math, ams, rel, "\u2AB8", "\\succapprox", true);
defineSymbol(math, ams, rel, "\u22B3", "\\vartriangleright");
defineSymbol(math, ams, rel, "\u22B5", "\\trianglerighteq");
defineSymbol(math, ams, rel, "\u22A9", "\\Vdash", true);
defineSymbol(math, ams, rel, "\u2223", "\\shortmid");
defineSymbol(math, ams, rel, "\u2225", "\\shortparallel");
defineSymbol(math, ams, rel, "\u226C", "\\between", true);
defineSymbol(math, ams, rel, "\u22D4", "\\pitchfork", true);
defineSymbol(math, ams, rel, "\u221D", "\\varpropto");
defineSymbol(math, ams, rel, "\u25C0", "\\blacktriangleleft");
defineSymbol(math, ams, rel, "\u2234", "\\therefore", true);
defineSymbol(math, ams, rel, "\u220D", "\\backepsilon");
defineSymbol(math, ams, rel, "\u25B6", "\\blacktriangleright");
defineSymbol(math, ams, rel, "\u2235", "\\because", true);
defineSymbol(math, ams, rel, "\u22D8", "\\llless");
defineSymbol(math, ams, rel, "\u22D9", "\\gggtr");
defineSymbol(math, ams, bin, "\u22B2", "\\lhd");
defineSymbol(math, ams, bin, "\u22B3", "\\rhd");
defineSymbol(math, ams, rel, "\u2242", "\\eqsim", true);
defineSymbol(math, main, rel, "\u22C8", "\\Join");
defineSymbol(math, ams, rel, "\u2251", "\\Doteq", true);
defineSymbol(math, ams, bin, "\u2214", "\\dotplus", true);
defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus");
defineSymbol(math, ams, bin, "\u22D2", "\\Cap", true);
defineSymbol(math, ams, bin, "\u22D3", "\\Cup", true);
defineSymbol(math, ams, bin, "\u2A5E", "\\doublebarwedge", true);
defineSymbol(math, ams, bin, "\u229F", "\\boxminus", true);
defineSymbol(math, ams, bin, "\u229E", "\\boxplus", true);
defineSymbol(math, ams, bin, "\u22C7", "\\divideontimes", true);
defineSymbol(math, ams, bin, "\u22C9", "\\ltimes", true);
defineSymbol(math, ams, bin, "\u22CA", "\\rtimes", true);
defineSymbol(math, ams, bin, "\u22CB", "\\leftthreetimes", true);
defineSymbol(math, ams, bin, "\u22CC", "\\rightthreetimes", true);
defineSymbol(math, ams, bin, "\u22CF", "\\curlywedge", true);
defineSymbol(math, ams, bin, "\u22CE", "\\curlyvee", true);
defineSymbol(math, ams, bin, "\u229D", "\\circleddash", true);
defineSymbol(math, ams, bin, "\u229B", "\\circledast", true);
defineSymbol(math, ams, bin, "\u22C5", "\\centerdot");
defineSymbol(math, ams, bin, "\u22BA", "\\intercal", true);
defineSymbol(math, ams, bin, "\u22D2", "\\doublecap");
defineSymbol(math, ams, bin, "\u22D3", "\\doublecup");
defineSymbol(math, ams, bin, "\u22A0", "\\boxtimes", true);
defineSymbol(math, ams, rel, "\u21E2", "\\dashrightarrow", true);
defineSymbol(math, ams, rel, "\u21E0", "\\dashleftarrow", true);
defineSymbol(math, ams, rel, "\u21C7", "\\leftleftarrows", true);
defineSymbol(math, ams, rel, "\u21C6", "\\leftrightarrows", true);
defineSymbol(math, ams, rel, "\u21DA", "\\Lleftarrow", true);
defineSymbol(math, ams, rel, "\u219E", "\\twoheadleftarrow", true);
defineSymbol(math, ams, rel, "\u21A2", "\\leftarrowtail", true);
defineSymbol(math, ams, rel, "\u21AB", "\\looparrowleft", true);
defineSymbol(math, ams, rel, "\u21CB", "\\leftrightharpoons", true);
defineSymbol(math, ams, rel, "\u21B6", "\\curvearrowleft", true);
defineSymbol(math, ams, rel, "\u21BA", "\\circlearrowleft", true);
defineSymbol(math, ams, rel, "\u21B0", "\\Lsh", true);
defineSymbol(math, ams, rel, "\u21C8", "\\upuparrows", true);
defineSymbol(math, ams, rel, "\u21BF", "\\upharpoonleft", true);
defineSymbol(math, ams, rel, "\u21C3", "\\downharpoonleft", true);
defineSymbol(math, main, rel, "\u22B6", "\\origof", true);
defineSymbol(math, main, rel, "\u22B7", "\\imageof", true);
defineSymbol(math, ams, rel, "\u22B8", "\\multimap", true);
defineSymbol(math, ams, rel, "\u21AD", "\\leftrightsquigarrow", true);
defineSymbol(math, ams, rel, "\u21C9", "\\rightrightarrows", true);
defineSymbol(math, ams, rel, "\u21C4", "\\rightleftarrows", true);
defineSymbol(math, ams, rel, "\u21A0", "\\twoheadrightarrow", true);
defineSymbol(math, ams, rel, "\u21A3", "\\rightarrowtail", true);
defineSymbol(math, ams, rel, "\u21AC", "\\looparrowright", true);
defineSymbol(math, ams, rel, "\u21B7", "\\curvearrowright", true);
defineSymbol(math, ams, rel, "\u21BB", "\\circlearrowright", true);
defineSymbol(math, ams, rel, "\u21B1", "\\Rsh", true);
defineSymbol(math, ams, rel, "\u21CA", "\\downdownarrows", true);
defineSymbol(math, ams, rel, "\u21BE", "\\upharpoonright", true);
defineSymbol(math, ams, rel, "\u21C2", "\\downharpoonright", true);
defineSymbol(math, ams, rel, "\u21DD", "\\rightsquigarrow", true);
defineSymbol(math, ams, rel, "\u21DD", "\\leadsto");
defineSymbol(math, ams, rel, "\u21DB", "\\Rrightarrow", true);
defineSymbol(math, ams, rel, "\u21BE", "\\restriction");
defineSymbol(math, main, textord, "\u2018", "`");
defineSymbol(math, main, textord, "$", "\\$");
defineSymbol(text2, main, textord, "$", "\\$");
defineSymbol(text2, main, textord, "$", "\\textdollar");
defineSymbol(math, main, textord, "%", "\\%");
defineSymbol(text2, main, textord, "%", "\\%");
defineSymbol(math, main, textord, "_", "\\_");
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");
defineSymbol(math, main, textord, "\u25B3", "\\triangle");
defineSymbol(math, main, textord, "\u0393", "\\Gamma", true);
defineSymbol(math, main, textord, "\u0394", "\\Delta", true);
defineSymbol(math, main, textord, "\u0398", "\\Theta", true);
defineSymbol(math, main, textord, "\u039B", "\\Lambda", true);
defineSymbol(math, main, textord, "\u039E", "\\Xi", true);
defineSymbol(math, main, textord, "\u03A0", "\\Pi", true);
defineSymbol(math, main, textord, "\u03A3", "\\Sigma", true);
defineSymbol(math, main, textord, "\u03A5", "\\Upsilon", true);
defineSymbol(math, main, textord, "\u03A6", "\\Phi", true);
defineSymbol(math, main, textord, "\u03A8", "\\Psi", true);
defineSymbol(math, main, textord, "\u03A9", "\\Omega", true);
defineSymbol(math, main, textord, "A", "\u0391");
defineSymbol(math, main, textord, "B", "\u0392");
defineSymbol(math, main, textord, "E", "\u0395");
defineSymbol(math, main, textord, "Z", "\u0396");
defineSymbol(math, main, textord, "H", "\u0397");
defineSymbol(math, main, textord, "I", "\u0399");
defineSymbol(math, main, textord, "K", "\u039A");
defineSymbol(math, main, textord, "M", "\u039C");
defineSymbol(math, main, textord, "N", "\u039D");
defineSymbol(math, main, textord, "O", "\u039F");
defineSymbol(math, main, textord, "P", "\u03A1");
defineSymbol(math, main, textord, "T", "\u03A4");
defineSymbol(math, main, textord, "X", "\u03A7");
defineSymbol(math, main, textord, "\xAC", "\\neg", true);
defineSymbol(math, main, textord, "\xAC", "\\lnot");
defineSymbol(math, main, textord, "\u22A4", "\\top");
defineSymbol(math, main, textord, "\u22A5", "\\bot");
defineSymbol(math, main, textord, "\u2205", "\\emptyset");
defineSymbol(math, ams, textord, "\u2205", "\\varnothing");
defineSymbol(math, main, mathord, "\u03B1", "\\alpha", true);
defineSymbol(math, main, mathord, "\u03B2", "\\beta", true);
defineSymbol(math, main, mathord, "\u03B3", "\\gamma", true);
defineSymbol(math, main, mathord, "\u03B4", "\\delta", true);
defineSymbol(math, main, mathord, "\u03F5", "\\epsilon", true);
defineSymbol(math, main, mathord, "\u03B6", "\\zeta", true);
defineSymbol(math, main, mathord, "\u03B7", "\\eta", true);
defineSymbol(math, main, mathord, "\u03B8", "\\theta", true);
defineSymbol(math, main, mathord, "\u03B9", "\\iota", true);
defineSymbol(math, main, mathord, "\u03BA", "\\kappa", true);
defineSymbol(math, main, mathord, "\u03BB", "\\lambda", true);
defineSymbol(math, main, mathord, "\u03BC", "\\mu", true);
defineSymbol(math, main, mathord, "\u03BD", "\\nu", true);
defineSymbol(math, main, mathord, "\u03BE", "\\xi", true);
defineSymbol(math, main, mathord, "\u03BF", "\\omicron", true);
defineSymbol(math, main, mathord, "\u03C0", "\\pi", true);
defineSymbol(math, main, mathord, "\u03C1", "\\rho", true);
defineSymbol(math, main, mathord, "\u03C3", "\\sigma", true);
defineSymbol(math, main, mathord, "\u03C4", "\\tau", true);
defineSymbol(math, main, mathord, "\u03C5", "\\upsilon", true);
defineSymbol(math, main, mathord, "\u03D5", "\\phi", true);
defineSymbol(math, main, mathord, "\u03C7", "\\chi", true);
defineSymbol(math, main, mathord, "\u03C8", "\\psi", true);
defineSymbol(math, main, mathord, "\u03C9", "\\omega", true);
defineSymbol(math, main, mathord, "\u03B5", "\\varepsilon", true);
defineSymbol(math, main, mathord, "\u03D1", "\\vartheta", true);
defineSymbol(math, main, mathord, "\u03D6", "\\varpi", true);
defineSymbol(math, main, mathord, "\u03F1", "\\varrho", true);
defineSymbol(math, main, mathord, "\u03C2", "\\varsigma", true);
defineSymbol(math, main, mathord, "\u03C6", "\\varphi", true);
defineSymbol(math, main, bin, "\u2217", "*", true);
defineSymbol(math, main, bin, "+", "+");
defineSymbol(math, main, bin, "\u2212", "-", true);
defineSymbol(math, main, bin, "\u22C5", "\\cdot", true);
defineSymbol(math, main, bin, "\u2218", "\\circ", true);
defineSymbol(math, main, bin, "\xF7", "\\div", true);
defineSymbol(math, main, bin, "\xB1", "\\pm", true);
defineSymbol(math, main, bin, "\xD7", "\\times", true);
defineSymbol(math, main, bin, "\u2229", "\\cap", true);
defineSymbol(math, main, bin, "\u222A", "\\cup", true);
defineSymbol(math, main, bin, "\u2216", "\\setminus", true);
defineSymbol(math, main, bin, "\u2227", "\\land");
defineSymbol(math, main, bin, "\u2228", "\\lor");
defineSymbol(math, main, bin, "\u2227", "\\wedge", true);
defineSymbol(math, main, bin, "\u2228", "\\vee", true);
defineSymbol(math, main, textord, "\u221A", "\\surd");
defineSymbol(math, main, open, "\u27E8", "\\langle", true);
defineSymbol(math, main, open, "\u2223", "\\lvert");
defineSymbol(math, main, open, "\u2225", "\\lVert");
defineSymbol(math, main, close, "?", "?");
defineSymbol(math, main, close, "!", "!");
defineSymbol(math, main, close, "\u27E9", "\\rangle", true);
defineSymbol(math, main, close, "\u2223", "\\rvert");
defineSymbol(math, main, close, "\u2225", "\\rVert");
defineSymbol(math, main, rel, "=", "=");
defineSymbol(math, main, rel, ":", ":");
defineSymbol(math, main, rel, "\u2248", "\\approx", true);
defineSymbol(math, main, rel, "\u2245", "\\cong", true);
defineSymbol(math, main, rel, "\u2265", "\\ge");
defineSymbol(math, main, rel, "\u2265", "\\geq", true);
defineSymbol(math, main, rel, "\u2190", "\\gets");
defineSymbol(math, main, rel, ">", "\\gt", true);
defineSymbol(math, main, rel, "\u2208", "\\in", true);
defineSymbol(math, main, rel, "\uE020", "\\@not");
defineSymbol(math, main, rel, "\u2282", "\\subset", true);
defineSymbol(math, main, rel, "\u2283", "\\supset", true);
defineSymbol(math, main, rel, "\u2286", "\\subseteq", true);
defineSymbol(math, main, rel, "\u2287", "\\supseteq", true);
defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq", true);
defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq", true);
defineSymbol(math, main, rel, "\u22A8", "\\models");
defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true);
defineSymbol(math, main, rel, "\u2264", "\\le");
defineSymbol(math, main, rel, "\u2264", "\\leq", true);
defineSymbol(math, main, rel, "<", "\\lt", true);
defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true);
defineSymbol(math, main, rel, "\u2192", "\\to");
defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true);
defineSymbol(math, ams, rel, "\u2270", "\\nleq", true);
defineSymbol(math, main, spacing, "\xA0", "\\ ");
defineSymbol(math, main, spacing, "\xA0", "\\space");
defineSymbol(math, 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, ",", ",");
defineSymbol(math, main, punct, ";", ";");
defineSymbol(math, ams, bin, "\u22BC", "\\barwedge", true);
defineSymbol(math, ams, bin, "\u22BB", "\\veebar", true);
defineSymbol(math, main, bin, "\u2299", "\\odot", true);
defineSymbol(math, main, bin, "\u2295", "\\oplus", true);
defineSymbol(math, main, bin, "\u2297", "\\otimes", true);
defineSymbol(math, main, textord, "\u2202", "\\partial", true);
defineSymbol(math, main, bin, "\u2298", "\\oslash", true);
defineSymbol(math, ams, bin, "\u229A", "\\circledcirc", true);
defineSymbol(math, ams, bin, "\u22A1", "\\boxdot", true);
defineSymbol(math, main, bin, "\u25B3", "\\bigtriangleup");
defineSymbol(math, main, bin, "\u25BD", "\\bigtriangledown");
defineSymbol(math, main, bin, "\u2020", "\\dagger");
defineSymbol(math, main, bin, "\u22C4", "\\diamond");
defineSymbol(math, main, bin, "\u22C6", "\\star");
defineSymbol(math, main, bin, "\u25C3", "\\triangleleft");
defineSymbol(math, main, bin, "\u25B9", "\\triangleright");
defineSymbol(math, main, open, "{", "\\{");
defineSymbol(text2, main, textord, "{", "\\{");
defineSymbol(text2, main, textord, "{", "\\textbraceleft");
defineSymbol(math, main, close, "}", "\\}");
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(text2, main, textord, "[", "\\lbrack", true);
defineSymbol(math, main, close, "]", "\\rbrack", true);
defineSymbol(text2, main, textord, "]", "\\rbrack", true);
defineSymbol(math, main, open, "(", "\\lparen", true);
defineSymbol(math, main, close, ")", "\\rparen", 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);
defineSymbol(math, main, close, "\u2309", "\\rceil", true);
defineSymbol(math, main, textord, "\\", "\\backslash");
defineSymbol(math, main, textord, "\u2223", "|");
defineSymbol(math, main, textord, "\u2223", "\\vert");
defineSymbol(text2, main, textord, "|", "\\textbar", true);
defineSymbol(math, main, textord, "\u2225", "\\|");
defineSymbol(math, main, textord, "\u2225", "\\Vert");
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);
defineSymbol(math, main, rel, "\u21D3", "\\Downarrow", true);
defineSymbol(math, main, rel, "\u2195", "\\updownarrow", true);
defineSymbol(math, main, rel, "\u21D5", "\\Updownarrow", true);
defineSymbol(math, main, op, "\u2210", "\\coprod");
defineSymbol(math, main, op, "\u22C1", "\\bigvee");
defineSymbol(math, main, op, "\u22C0", "\\bigwedge");
defineSymbol(math, main, op, "\u2A04", "\\biguplus");
defineSymbol(math, main, op, "\u22C2", "\\bigcap");
defineSymbol(math, main, op, "\u22C3", "\\bigcup");
defineSymbol(math, main, op, "\u222B", "\\int");
defineSymbol(math, main, op, "\u222B", "\\intop");
defineSymbol(math, main, op, "\u222C", "\\iint");
defineSymbol(math, main, op, "\u222D", "\\iiint");
defineSymbol(math, main, op, "\u220F", "\\prod");
defineSymbol(math, main, op, "\u2211", "\\sum");
defineSymbol(math, main, op, "\u2A02", "\\bigotimes");
defineSymbol(math, main, op, "\u2A01", "\\bigoplus");
defineSymbol(math, main, op, "\u2A00", "\\bigodot");
defineSymbol(math, main, op, "\u222E", "\\oint");
defineSymbol(math, main, op, "\u222F", "\\oiint");
defineSymbol(math, main, op, "\u2230", "\\oiiint");
defineSymbol(math, main, op, "\u2A06", "\\bigsqcup");
defineSymbol(math, main, op, "\u222B", "\\smallint");
defineSymbol(text2, main, inner, "\u2026", "\\textellipsis");
defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");
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);
defineSymbol(math, main, textord, "\u22EE", "\\varvdots");
defineSymbol(text2, main, textord, "\u22EE", "\\varvdots");
defineSymbol(math, main, accent, "\u02CA", "\\acute");
defineSymbol(math, main, accent, "\u02CB", "\\grave");
defineSymbol(math, main, accent, "\xA8", "\\ddot");
defineSymbol(math, main, accent, "~", "\\tilde");
defineSymbol(math, main, accent, "\u02C9", "\\bar");
defineSymbol(math, main, accent, "\u02D8", "\\breve");
defineSymbol(math, main, accent, "\u02C7", "\\check");
defineSymbol(math, main, accent, "^", "\\hat");
defineSymbol(math, main, accent, "\u20D7", "\\vec");
defineSymbol(math, main, accent, "\u02D9", "\\dot");
defineSymbol(math, main, accent, "\u02DA", "\\mathring");
defineSymbol(math, main, mathord, "\uE131", "\\@imath");
defineSymbol(math, main, mathord, "\uE237", "\\@jmath");
defineSymbol(math, main, textord, "\u0131", "\u0131");
defineSymbol(math, main, textord, "\u0237", "\u0237");
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(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(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(text2, main, textord, "\xA3", "\\pounds");
defineSymbol(text2, main, textord, "\xA3", "\\textsterling", true);
defineSymbol(math, ams, textord, "\u2720", "\\maltese");
defineSymbol(text2, ams, textord, "\u2720", "\\maltese");
mathTextSymbols = '0123456789/@."';
for (i2 = 0; i2 < mathTextSymbols.length; i2++) {
ch = mathTextSymbols.charAt(i2);
defineSymbol(math, main, textord, ch, ch);
}
textSymbols = '0123456789!@*()-=+";:?/.,';
for (_i = 0; _i < textSymbols.length; _i++) {
_ch = textSymbols.charAt(_i);
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(text2, main, textord, _ch2, _ch2);
}
defineSymbol(math, ams, textord, "C", "\u2102");
defineSymbol(text2, ams, textord, "C", "\u2102");
defineSymbol(math, ams, textord, "H", "\u210D");
defineSymbol(text2, ams, textord, "H", "\u210D");
defineSymbol(math, ams, textord, "N", "\u2115");
defineSymbol(text2, ams, textord, "N", "\u2115");
defineSymbol(math, ams, textord, "P", "\u2119");
defineSymbol(text2, ams, textord, "P", "\u2119");
defineSymbol(math, ams, textord, "Q", "\u211A");
defineSymbol(text2, ams, textord, "Q", "\u211A");
defineSymbol(math, ams, textord, "R", "\u211D");
defineSymbol(text2, ams, textord, "R", "\u211D");
defineSymbol(math, ams, textord, "Z", "\u2124");
defineSymbol(text2, ams, textord, "Z", "\u2124");
defineSymbol(math, 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(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56372 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56424 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56580 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56684 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56736 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56788 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56840 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56944 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
if (_i3 < 26) {
wideChar = String.fromCharCode(55349, 56632 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(55349, 56476 + _i3);
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text2, main, textord, _ch3, wideChar);
}
}
wideChar = String.fromCharCode(55349, 56668);
defineSymbol(math, main, mathord, "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(text2, main, textord, _ch4, wideChar);
wideChar = String.fromCharCode(55349, 57314 + _i4);
defineSymbol(math, main, mathord, _ch4, wideChar);
defineSymbol(text2, main, textord, _ch4, wideChar);
wideChar = String.fromCharCode(55349, 57324 + _i4);
defineSymbol(math, main, mathord, _ch4, wideChar);
defineSymbol(text2, main, textord, _ch4, wideChar);
wideChar = String.fromCharCode(55349, 57334 + _i4);
defineSymbol(math, main, mathord, _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(text2, main, textord, _ch5, _ch5);
}
wideLatinLetterData = [
["mathbf", "textbf", "Main-Bold"],
// A-Z bold upright
["mathbf", "textbf", "Main-Bold"],
// a-z bold upright
["mathnormal", "textit", "Math-Italic"],
// A-Z italic
["mathnormal", "textit", "Math-Italic"],
// a-z italic
["boldsymbol", "boldsymbol", "Main-BoldItalic"],
// A-Z bold italic
["boldsymbol", "boldsymbol", "Main-BoldItalic"],
// a-z bold italic
// Map fancy A-Z letters to script, not calligraphic.
// This aligns with unicode-math and math fonts (except Cambria Math).
["mathscr", "textscr", "Script-Regular"],
// A-Z script
["", "", ""],
// a-z script. No font
["", "", ""],
// A-Z bold script. No font
["", "", ""],
// a-z bold script. No font
["mathfrak", "textfrak", "Fraktur-Regular"],
// A-Z Fraktur
["mathfrak", "textfrak", "Fraktur-Regular"],
// a-z Fraktur
["mathbb", "textbb", "AMS-Regular"],
// A-Z double-struck
["mathbb", "textbb", "AMS-Regular"],
// k double-struck
// Note that we are using a bold font, but font metrics for regular Fraktur.
["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
// A-Z bold Fraktur
["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
// a-z bold Fraktur
["mathsf", "textsf", "SansSerif-Regular"],
// A-Z sans-serif
["mathsf", "textsf", "SansSerif-Regular"],
// a-z sans-serif
["mathboldsf", "textboldsf", "SansSerif-Bold"],
// A-Z bold sans-serif
["mathboldsf", "textboldsf", "SansSerif-Bold"],
// a-z bold sans-serif
["mathitsf", "textitsf", "SansSerif-Italic"],
// A-Z italic sans-serif
["mathitsf", "textitsf", "SansSerif-Italic"],
// a-z italic sans-serif
["", "", ""],
// A-Z bold italic sans. No font
["", "", ""],
// a-z bold italic sans. No font
["mathtt", "texttt", "Typewriter-Regular"],
// A-Z monospace
["mathtt", "texttt", "Typewriter-Regular"]
// a-z monospace
];
wideNumeralData = [
["mathbf", "textbf", "Main-Bold"],
// 0-9 bold
["", "", ""],
// 0-9 double-struck. No KaTeX font.
["mathsf", "textsf", "SansSerif-Regular"],
// 0-9 sans-serif
["mathboldsf", "textboldsf", "SansSerif-Bold"],
// 0-9 bold sans-serif
["mathtt", "texttt", "Typewriter-Regular"]
// 0-9 monospace
];
wideCharacterFont = /* @__PURE__ */ __name(function wideCharacterFont2(wideChar2, mode) {
var H2 = wideChar2.charCodeAt(0);
var L3 = wideChar2.charCodeAt(1);
var codePoint = (H2 - 55296) * 1024 + (L3 - 56320) + 65536;
var j3 = mode === "math" ? 0 : 1;
if (119808 <= codePoint && codePoint < 120484) {
var i2 = Math.floor((codePoint - 119808) / 26);
return [wideLatinLetterData[i2][2], wideLatinLetterData[i2][j3]];
} else if (120782 <= codePoint && codePoint <= 120831) {
var _i = Math.floor((codePoint - 120782) / 10);
return [wideNumeralData[_i][2], wideNumeralData[_i][j3]];
} else if (codePoint === 120485 || codePoint === 120486) {
return [wideLatinLetterData[0][2], wideLatinLetterData[0][j3]];
} else if (120486 < codePoint && codePoint < 120782) {
return ["", ""];
} else {
throw new ParseError("Unsupported character: " + wideChar2);
}
}, "wideCharacterFont");
lookupSymbol = /* @__PURE__ */ __name(function lookupSymbol2(value2, fontName, mode) {
if (symbols[mode][value2] && symbols[mode][value2].replace) {
value2 = symbols[mode][value2].replace;
}
return {
value: value2,
metrics: getCharacterMetrics(value2, fontName, mode)
};
}, "lookupSymbol");
makeSymbol = /* @__PURE__ */ __name(function makeSymbol2(value2, fontName, mode, options2, classes3) {
var lookup2 = lookupSymbol(value2, fontName, mode);
var metrics = lookup2.metrics;
value2 = lookup2.value;
var symbolNode;
if (metrics) {
var italic = metrics.italic;
if (mode === "text" || options2 && options2.font === "mathit") {
italic = 0;
}
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, classes3);
}
if (options2) {
symbolNode.maxFontSize = options2.sizeMultiplier;
if (options2.style.isTight()) {
symbolNode.classes.push("mtight");
}
var color2 = options2.getColor();
if (color2) {
symbolNode.style.color = color2;
}
}
return symbolNode;
}, "makeSymbol");
mathsym = /* @__PURE__ */ __name(function mathsym2(value2, mode, options2, classes3) {
if (classes3 === void 0) {
classes3 = [];
}
if (options2.font === "boldsymbol" && lookupSymbol(value2, "Main-Bold", mode).metrics) {
return makeSymbol(value2, "Main-Bold", mode, options2, classes3.concat(["mathbf"]));
} else if (value2 === "\\" || symbols[mode][value2].font === "main") {
return makeSymbol(value2, "Main-Regular", mode, options2, classes3);
} else {
return makeSymbol(value2, "AMS-Regular", mode, options2, classes3.concat(["amsrm"]));
}
}, "mathsym");
boldsymbol = /* @__PURE__ */ __name(function boldsymbol2(value2, mode, options2, classes3, type3) {
if (type3 !== "textord" && lookupSymbol(value2, "Math-BoldItalic", mode).metrics) {
return {
fontName: "Math-BoldItalic",
fontClass: "boldsymbol"
};
} else {
return {
fontName: "Main-Bold",
fontClass: "mathbf"
};
}
}, "boldsymbol");
makeOrd = /* @__PURE__ */ __name(function makeOrd2(group2, options2, type3) {
var mode = group2.mode;
var text4 = group2.text;
var classes3 = ["mord"];
var isFont = mode === "math" || mode === "text" && options2.font;
var fontOrFamily = isFont ? options2.font : options2.fontFamily;
var wideFontName = "";
var wideFontClass = "";
if (text4.charCodeAt(0) === 55349) {
[wideFontName, wideFontClass] = wideCharacterFont(text4, mode);
}
if (wideFontName.length > 0) {
return makeSymbol(text4, wideFontName, mode, options2, classes3.concat(wideFontClass));
} else if (fontOrFamily) {
var fontName;
var fontClasses;
if (fontOrFamily === "boldsymbol") {
var fontData = boldsymbol(text4, mode, options2, classes3, type3);
fontName = fontData.fontName;
fontClasses = [fontData.fontClass];
} else if (isFont) {
fontName = fontMap[fontOrFamily].fontName;
fontClasses = [fontOrFamily];
} else {
fontName = retrieveTextFontName(fontOrFamily, options2.fontWeight, options2.fontShape);
fontClasses = [fontOrFamily, options2.fontWeight, options2.fontShape];
}
if (lookupSymbol(text4, fontName, mode).metrics) {
return makeSymbol(text4, fontName, mode, options2, classes3.concat(fontClasses));
} else if (ligatures.hasOwnProperty(text4) && fontName.slice(0, 10) === "Typewriter") {
var parts = [];
for (var i2 = 0; i2 < text4.length; i2++) {
parts.push(makeSymbol(text4[i2], fontName, mode, options2, classes3.concat(fontClasses)));
}
return makeFragment(parts);
}
}
if (type3 === "mathord") {
return makeSymbol(text4, "Math-Italic", mode, options2, classes3.concat(["mathnormal"]));
} else if (type3 === "textord") {
var font = symbols[mode][text4] && symbols[mode][text4].font;
if (font === "ams") {
var _fontName = retrieveTextFontName("amsrm", options2.fontWeight, options2.fontShape);
return makeSymbol(text4, _fontName, mode, options2, classes3.concat("amsrm", options2.fontWeight, options2.fontShape));
} else if (font === "main" || !font) {
var _fontName2 = retrieveTextFontName("textrm", options2.fontWeight, options2.fontShape);
return makeSymbol(text4, _fontName2, mode, options2, classes3.concat(options2.fontWeight, options2.fontShape));
} else {
var _fontName3 = retrieveTextFontName(font, options2.fontWeight, options2.fontShape);
return makeSymbol(text4, _fontName3, mode, options2, classes3.concat(_fontName3, options2.fontWeight, options2.fontShape));
}
} else {
throw new Error("unexpected type: " + type3 + " in makeOrd");
}
}, "makeOrd");
canCombine = /* @__PURE__ */ __name((prev2, next3) => {
if (createClass(prev2.classes) !== createClass(next3.classes) || prev2.skew !== next3.skew || prev2.maxFontSize !== next3.maxFontSize) {
return false;
}
if (prev2.classes.length === 1) {
var cls = prev2.classes[0];
if (cls === "mbin" || cls === "mord") {
return false;
}
}
for (var style3 in prev2.style) {
if (prev2.style.hasOwnProperty(style3) && prev2.style[style3] !== next3.style[style3]) {
return false;
}
}
for (var _style in next3.style) {
if (next3.style.hasOwnProperty(_style) && prev2.style[_style] !== next3.style[_style]) {
return false;
}
}
return true;
}, "canCombine");
tryCombineChars = /* @__PURE__ */ __name((chars) => {
for (var i2 = 0; i2 < chars.length - 1; i2++) {
var prev2 = chars[i2];
var next3 = chars[i2 + 1];
if (prev2 instanceof SymbolNode && next3 instanceof SymbolNode && canCombine(prev2, next3)) {
prev2.text += next3.text;
prev2.height = Math.max(prev2.height, next3.height);
prev2.depth = Math.max(prev2.depth, next3.depth);
prev2.italic = next3.italic;
chars.splice(i2 + 1, 1);
i2--;
}
}
return chars;
}, "tryCombineChars");
sizeElementFromChildren = /* @__PURE__ */ __name(function sizeElementFromChildren2(elem) {
var height2 = 0;
var depth = 0;
var maxFontSize = 0;
for (var i2 = 0; i2 < elem.children.length; i2++) {
var child = elem.children[i2];
if (child.height > height2) {
height2 = child.height;
}
if (child.depth > depth) {
depth = child.depth;
}
if (child.maxFontSize > maxFontSize) {
maxFontSize = child.maxFontSize;
}
}
elem.height = height2;
elem.depth = depth;
elem.maxFontSize = maxFontSize;
}, "sizeElementFromChildren");
makeSpan$2 = /* @__PURE__ */ __name(function makeSpan(classes3, children2, options2, style3) {
var span = new Span(classes3, children2, options2, style3);
sizeElementFromChildren(span);
return span;
}, "makeSpan");
makeSvgSpan = /* @__PURE__ */ __name((classes3, children2, options2, style3) => new Span(classes3, children2, options2, style3), "makeSvgSpan");
makeLineSpan = /* @__PURE__ */ __name(function makeLineSpan2(className, options2, thickness) {
var line2 = makeSpan$2([className], [], options2);
line2.height = Math.max(thickness || options2.fontMetrics().defaultRuleThickness, options2.minRuleThickness);
line2.style.borderBottomWidth = makeEm(line2.height);
line2.maxFontSize = 1;
return line2;
}, "makeLineSpan");
makeAnchor = /* @__PURE__ */ __name(function makeAnchor2(href, classes3, children2, options2) {
var anchor2 = new Anchor(href, classes3, children2, options2);
sizeElementFromChildren(anchor2);
return anchor2;
}, "makeAnchor");
makeFragment = /* @__PURE__ */ __name(function makeFragment2(children2) {
var fragment = new DocumentFragment(children2);
sizeElementFromChildren(fragment);
return fragment;
}, "makeFragment");
wrapFragment = /* @__PURE__ */ __name(function wrapFragment2(group2, options2) {
if (group2 instanceof DocumentFragment) {
return makeSpan$2([], [group2], options2);
}
return group2;
}, "wrapFragment");
getVListChildrenAndDepth = /* @__PURE__ */ __name(function getVListChildrenAndDepth2(params) {
if (params.positionType === "individualShift") {
var oldChildren = params.children;
var children2 = [oldChildren[0]];
var _depth = -oldChildren[0].shift - oldChildren[0].elem.depth;
var currPos = _depth;
for (var i2 = 1; i2 < oldChildren.length; i2++) {
var diff2 = -oldChildren[i2].shift - currPos - oldChildren[i2].elem.depth;
var size4 = diff2 - (oldChildren[i2 - 1].elem.height + oldChildren[i2 - 1].elem.depth);
currPos = currPos + diff2;
children2.push({
type: "kern",
size: size4
});
children2.push(oldChildren[i2]);
}
return {
children: children2,
depth: _depth
};
}
var depth;
if (params.positionType === "top") {
var bottom2 = params.positionData;
for (var _i = 0; _i < params.children.length; _i++) {
var child = params.children[_i];
bottom2 -= child.type === "kern" ? child.size : child.elem.height + child.elem.depth;
}
depth = bottom2;
} else if (params.positionType === "bottom") {
depth = -params.positionData;
} else {
var firstChild = params.children[0];
if (firstChild.type !== "elem") {
throw new Error('First child must have type "elem".');
}
if (params.positionType === "shift") {
depth = -firstChild.elem.depth - params.positionData;
} else if (params.positionType === "firstBaseline") {
depth = -firstChild.elem.depth;
} else {
throw new Error("Invalid positionType " + params.positionType + ".");
}
}
return {
children: params.children,
depth
};
}, "getVListChildrenAndDepth");
makeVList = /* @__PURE__ */ __name(function makeVList2(params, options2) {
var {
children: children2,
depth
} = getVListChildrenAndDepth(params);
var pstrutSize = 0;
for (var i2 = 0; i2 < children2.length; i2++) {
var child = children2[i2];
if (child.type === "elem") {
var elem = child.elem;
pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height);
}
}
pstrutSize += 2;
var pstrut = makeSpan$2(["pstrut"], []);
pstrut.style.height = makeEm(pstrutSize);
var realChildren = [];
var minPos = depth;
var maxPos2 = depth;
var currPos = depth;
for (var _i2 = 0; _i2 < children2.length; _i2++) {
var _child = children2[_i2];
if (_child.type === "kern") {
currPos += _child.size;
} else {
var _elem = _child.elem;
var classes3 = _child.wrapperClasses || [];
var style3 = _child.wrapperStyle || {};
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;
}
if (_child.marginRight) {
childWrap.style.marginRight = _child.marginRight;
}
realChildren.push(childWrap);
currPos += _elem.height + _elem.depth;
}
minPos = Math.min(minPos, currPos);
maxPos2 = Math.max(maxPos2, currPos);
}
var vlist = makeSpan$2(["vlist"], realChildren);
vlist.style.height = makeEm(maxPos2);
var rows;
if (minPos < 0) {
var emptySpan = makeSpan$2([], []);
var depthStrut = makeSpan$2(["vlist"], [emptySpan]);
depthStrut.style.height = makeEm(-minPos);
var topStrut = makeSpan$2(["vlist-s"], [new SymbolNode("\u200B")]);
rows = [makeSpan$2(["vlist-r"], [vlist, topStrut]), makeSpan$2(["vlist-r"], [depthStrut])];
} else {
rows = [makeSpan$2(["vlist-r"], [vlist])];
}
var vtable = makeSpan$2(["vlist-t"], rows);
if (rows.length === 2) {
vtable.classes.push("vlist-t2");
}
vtable.height = maxPos2;
vtable.depth = -minPos;
return vtable;
}, "makeVList");
makeGlue = /* @__PURE__ */ __name((measurement, options2) => {
var rule = makeSpan$2(["mspace"], [], options2);
var size4 = calculateSize2(measurement, options2);
rule.style.marginRight = makeEm(size4);
return rule;
}, "makeGlue");
retrieveTextFontName = /* @__PURE__ */ __name(function retrieveTextFontName2(fontFamily, fontWeight, fontShape) {
var baseFontName = "";
switch (fontFamily) {
case "amsrm":
baseFontName = "AMS";
break;
case "textrm":
baseFontName = "Main";
break;
case "textsf":
baseFontName = "SansSerif";
break;
case "texttt":
baseFontName = "Typewriter";
break;
default:
baseFontName = fontFamily;
}
var fontStylesName;
if (fontWeight === "textbf" && fontShape === "textit") {
fontStylesName = "BoldItalic";
} else if (fontWeight === "textbf") {
fontStylesName = "Bold";
} else if (fontWeight === "textit") {
fontStylesName = "Italic";
} else {
fontStylesName = "Regular";
}
return baseFontName + "-" + fontStylesName;
}, "retrieveTextFontName");
fontMap = {
// styles
"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"
},
"mathsfit": {
variant: "sans-serif-italic",
fontName: "SansSerif-Italic"
},
// "boldsymbol" is missing because they require the use of multiple fonts:
// Math-BoldItalic and Main-Bold. This is handled by a special case in
// makeOrd which ends up calling boldsymbol.
// families
"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"
}
};
svgData = {
// path, width, height
vec: ["vec", 0.471, 0.714],
// values from the font glyph
oiintSize1: ["oiintSize1", 0.957, 0.499],
// oval to overlay the integrand
oiintSize2: ["oiintSize2", 1.472, 0.659],
oiiintSize1: ["oiiintSize1", 1.304, 0.499],
oiiintSize2: ["oiiintSize2", 1.98, 0.659]
};
staticSvg = /* @__PURE__ */ __name(function staticSvg2(value2, options2) {
var [pathName, width3, height2] = svgData[value2];
var path4 = new PathNode(pathName);
var svgNode2 = new SvgNode([path4], {
"width": makeEm(width3),
"height": makeEm(height2),
// Override CSS rule `.katex svg { width: 100% }`
"style": "width:" + makeEm(width3),
"viewBox": "0 0 " + 1e3 * width3 + " " + 1e3 * height2,
"preserveAspectRatio": "xMinYMin"
});
var span = makeSvgSpan(["overlay"], [svgNode2], options2);
span.height = height2;
span.style.height = makeEm(height2);
span.style.width = makeEm(width3);
return span;
}, "staticSvg");
buildCommon = {
fontMap,
makeSymbol,
mathsym,
makeSpan: makeSpan$2,
makeSvgSpan,
makeLineSpan,
makeAnchor,
makeFragment,
wrapFragment,
makeVList,
makeOrd,
makeGlue,
staticSvg,
svgData,
tryCombineChars
};
thinspace = {
number: 3,
unit: "mu"
};
mediumspace = {
number: 4,
unit: "mu"
};
thickspace = {
number: 5,
unit: "mu"
};
spacings = {
mord: {
mop: thinspace,
mbin: mediumspace,
mrel: thickspace,
minner: thinspace
},
mop: {
mord: thinspace,
mop: thinspace,
mrel: thickspace,
minner: thinspace
},
mbin: {
mord: mediumspace,
mop: mediumspace,
mopen: mediumspace,
minner: mediumspace
},
mrel: {
mord: thickspace,
mop: thickspace,
mopen: thickspace,
minner: thickspace
},
mopen: {},
mclose: {
mop: thinspace,
mbin: mediumspace,
mrel: thickspace,
minner: thinspace
},
mpunct: {
mord: thinspace,
mop: thinspace,
mrel: thickspace,
mopen: thinspace,
mclose: thinspace,
mpunct: thinspace,
minner: thinspace
},
minner: {
mord: thinspace,
mop: thinspace,
mbin: mediumspace,
mrel: thickspace,
mopen: thinspace,
mpunct: thinspace,
minner: thinspace
}
};
tightSpacings = {
mord: {
mop: thinspace
},
mop: {
mord: thinspace,
mop: thinspace
},
mbin: {},
mrel: {},
mopen: {},
mclose: {
mop: thinspace
},
mpunct: {},
minner: {
mop: thinspace
}
};
_functions = {};
_htmlGroupBuilders = {};
_mathmlGroupBuilders = {};
__name(defineFunction, "defineFunction");
__name(defineFunctionBuilders, "defineFunctionBuilders");
normalizeArgument = /* @__PURE__ */ __name(function normalizeArgument2(arg) {
return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg;
}, "normalizeArgument");
ordargument = /* @__PURE__ */ __name(function ordargument2(arg) {
return arg.type === "ordgroup" ? arg.body : [arg];
}, "ordargument");
makeSpan$1 = buildCommon.makeSpan;
binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"];
binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"];
styleMap$1 = {
"display": Style$1.DISPLAY,
"text": Style$1.TEXT,
"script": Style$1.SCRIPT,
"scriptscript": Style$1.SCRIPTSCRIPT
};
DomEnum = {
mord: "mord",
mop: "mop",
mbin: "mbin",
mrel: "mrel",
mopen: "mopen",
mclose: "mclose",
mpunct: "mpunct",
minner: "minner"
};
buildExpression$1 = /* @__PURE__ */ __name(function buildExpression(expression, options2, isRealGroup, surrounding) {
if (surrounding === void 0) {
surrounding = [null, null];
}
var groups = [];
for (var i2 = 0; i2 < expression.length; i2++) {
var output2 = buildGroup$1(expression[i2], options2);
if (output2 instanceof DocumentFragment) {
var children2 = output2.children;
groups.push(...children2);
} else {
groups.push(output2);
}
}
buildCommon.tryCombineChars(groups);
if (!isRealGroup) {
return groups;
}
var glueOptions = options2;
if (expression.length === 1) {
var node2 = expression[0];
if (node2.type === "sizing") {
glueOptions = options2.havingSize(node2.size);
} else if (node2.type === "styling") {
glueOptions = options2.havingStyle(styleMap$1[node2.style]);
}
}
var dummyPrev = makeSpan$1([surrounding[0] || "leftmost"], [], options2);
var dummyNext = makeSpan$1([surrounding[1] || "rightmost"], [], options2);
var isRoot = isRealGroup === "root";
traverseNonSpaceNodes(groups, (node3, prev2) => {
var prevType = prev2.classes[0];
var type3 = node3.classes[0];
if (prevType === "mbin" && utils.contains(binRightCanceller, type3)) {
prev2.classes[0] = "mord";
} else if (type3 === "mbin" && utils.contains(binLeftCanceller, prevType)) {
node3.classes[0] = "mord";
}
}, {
node: dummyPrev
}, dummyNext, isRoot);
traverseNonSpaceNodes(groups, (node3, prev2) => {
var prevType = getTypeOfDomTree(prev2);
var type3 = getTypeOfDomTree(node3);
var space = prevType && type3 ? node3.hasClass("mtight") ? tightSpacings[prevType][type3] : spacings[prevType][type3] : null;
if (space) {
return buildCommon.makeGlue(space, glueOptions);
}
}, {
node: dummyPrev
}, dummyNext, isRoot);
return groups;
}, "buildExpression");
traverseNonSpaceNodes = /* @__PURE__ */ __name(function traverseNonSpaceNodes2(nodes5, callback, prev2, next3, isRoot) {
if (next3) {
nodes5.push(next3);
}
var i2 = 0;
for (; i2 < nodes5.length; i2++) {
var node2 = nodes5[i2];
var partialGroup = checkPartialGroup(node2);
if (partialGroup) {
traverseNonSpaceNodes2(partialGroup.children, callback, prev2, null, isRoot);
continue;
}
var nonspace = !node2.hasClass("mspace");
if (nonspace) {
var result = callback(node2, prev2.node);
if (result) {
if (prev2.insertAfter) {
prev2.insertAfter(result);
} else {
nodes5.unshift(result);
i2++;
}
}
}
if (nonspace) {
prev2.node = node2;
} else if (isRoot && node2.hasClass("newline")) {
prev2.node = makeSpan$1(["leftmost"]);
}
prev2.insertAfter = /* @__PURE__ */ ((index) => (n2) => {
nodes5.splice(index + 1, 0, n2);
i2++;
})(i2);
}
if (next3) {
nodes5.pop();
}
}, "traverseNonSpaceNodes");
checkPartialGroup = /* @__PURE__ */ __name(function checkPartialGroup2(node2) {
if (node2 instanceof DocumentFragment || node2 instanceof Anchor || node2 instanceof Span && node2.hasClass("enclosing")) {
return node2;
}
return null;
}, "checkPartialGroup");
getOutermostNode = /* @__PURE__ */ __name(function getOutermostNode2(node2, side) {
var partialGroup = checkPartialGroup(node2);
if (partialGroup) {
var children2 = partialGroup.children;
if (children2.length) {
if (side === "right") {
return getOutermostNode2(children2[children2.length - 1], "right");
} else if (side === "left") {
return getOutermostNode2(children2[0], "left");
}
}
}
return node2;
}, "getOutermostNode");
getTypeOfDomTree = /* @__PURE__ */ __name(function getTypeOfDomTree2(node2, side) {
if (!node2) {
return null;
}
if (side) {
node2 = getOutermostNode(node2, side);
}
return DomEnum[node2.classes[0]] || null;
}, "getTypeOfDomTree");
makeNullDelimiter = /* @__PURE__ */ __name(function makeNullDelimiter2(options2, classes3) {
var moreClasses = ["nulldelimiter"].concat(options2.baseSizingClasses());
return makeSpan$1(classes3.concat(moreClasses));
}, "makeNullDelimiter");
buildGroup$1 = /* @__PURE__ */ __name(function buildGroup(group2, options2, baseOptions) {
if (!group2) {
return makeSpan$1();
}
if (_htmlGroupBuilders[group2.type]) {
var groupNode = _htmlGroupBuilders[group2.type](group2, options2);
if (baseOptions && options2.size !== baseOptions.size) {
groupNode = makeSpan$1(options2.sizingClasses(baseOptions), [groupNode], options2);
var multiplier = options2.sizeMultiplier / baseOptions.sizeMultiplier;
groupNode.height *= multiplier;
groupNode.depth *= multiplier;
}
return groupNode;
} else {
throw new ParseError("Got group of unknown type: '" + group2.type + "'");
}
}, "buildGroup");
__name(buildHTMLUnbreakable, "buildHTMLUnbreakable");
__name(buildHTML, "buildHTML");
__name(newDocumentFragment, "newDocumentFragment");
MathNode = class {
static {
__name(this, "MathNode");
}
constructor(type3, children2, classes3) {
this.type = void 0;
this.attributes = void 0;
this.children = void 0;
this.classes = void 0;
this.type = type3;
this.attributes = {};
this.children = children2 || [];
this.classes = classes3 || [];
}
/**
* Sets an attribute on a MathML node. MathML depends on attributes to convey a
* semantic content, so this is used heavily.
*/
setAttribute(name, value2) {
this.attributes[name] = value2;
}
/**
* Gets an attribute on a MathML node.
*/
getAttribute(name) {
return this.attributes[name];
}
/**
* Converts the math node into a MathML-namespaced DOM element.
*/
toNode() {
var node2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
for (var attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
node2.setAttribute(attr, this.attributes[attr]);
}
}
if (this.classes.length > 0) {
node2.className = createClass(this.classes);
}
for (var i2 = 0; i2 < this.children.length; i2++) {
if (this.children[i2] instanceof TextNode && this.children[i2 + 1] instanceof TextNode) {
var text4 = this.children[i2].toText() + this.children[++i2].toText();
while (this.children[i2 + 1] instanceof TextNode) {
text4 += this.children[++i2].toText();
}
node2.appendChild(new TextNode(text4).toNode());
} else {
node2.appendChild(this.children[i2].toNode());
}
}
return node2;
}
/**
* Converts the math node into an HTML markup string.
*/
toMarkup() {
var markup = "<" + this.type;
for (var attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
markup += " " + attr + '="';
markup += utils.escape(this.attributes[attr]);
markup += '"';
}
}
if (this.classes.length > 0) {
markup += ' class ="' + utils.escape(createClass(this.classes)) + '"';
}
markup += ">";
for (var i2 = 0; i2 < this.children.length; i2++) {
markup += this.children[i2].toMarkup();
}
markup += "" + this.type + ">";
return markup;
}
/**
* Converts the math node into a string, similar to innerText, but escaped.
*/
toText() {
return this.children.map((child) => child.toText()).join("");
}
};
TextNode = class {
static {
__name(this, "TextNode");
}
constructor(text4) {
this.text = void 0;
this.text = text4;
}
/**
* Converts the text node into a DOM text node.
*/
toNode() {
return document.createTextNode(this.text);
}
/**
* Converts the text node into escaped HTML markup
* (representing the text itself).
*/
toMarkup() {
return utils.escape(this.toText());
}
/**
* Converts the text node into a string
* (representing the text itself).
*/
toText() {
return this.text;
}
};
SpaceNode = class {
static {
__name(this, "SpaceNode");
}
/**
* Create a Space node with width given in CSS ems.
*/
constructor(width3) {
this.width = void 0;
this.character = void 0;
this.width = width3;
if (width3 >= 0.05555 && width3 <= 0.05556) {
this.character = "\u200A";
} else if (width3 >= 0.1666 && width3 <= 0.1667) {
this.character = "\u2009";
} else if (width3 >= 0.2222 && width3 <= 0.2223) {
this.character = "\u2005";
} else if (width3 >= 0.2777 && width3 <= 0.2778) {
this.character = "\u2005\u200A";
} else if (width3 >= -0.05556 && width3 <= -0.05555) {
this.character = "\u200A\u2063";
} else if (width3 >= -0.1667 && width3 <= -0.1666) {
this.character = "\u2009\u2063";
} else if (width3 >= -0.2223 && width3 <= -0.2222) {
this.character = "\u205F\u2063";
} else if (width3 >= -0.2778 && width3 <= -0.2777) {
this.character = "\u2005\u2063";
} else {
this.character = null;
}
}
/**
* Converts the math node into a MathML-namespaced DOM element.
*/
toNode() {
if (this.character) {
return document.createTextNode(this.character);
} else {
var node2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
node2.setAttribute("width", makeEm(this.width));
return node2;
}
}
/**
* Converts the math node into an HTML markup string.
*/
toMarkup() {
if (this.character) {
return "" + this.character + "";
} else {
return '';
}
}
/**
* Converts the math node into a string, similar to innerText.
*/
toText() {
if (this.character) {
return this.character;
} else {
return " ";
}
}
};
mathMLTree = {
MathNode,
TextNode,
SpaceNode,
newDocumentFragment
};
makeText = /* @__PURE__ */ __name(function makeText2(text4, mode, options2) {
if (symbols[mode][text4] && symbols[mode][text4].replace && text4.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(text4) && options2 && (options2.fontFamily && options2.fontFamily.slice(4, 6) === "tt" || options2.font && options2.font.slice(4, 6) === "tt"))) {
text4 = symbols[mode][text4].replace;
}
return new mathMLTree.TextNode(text4);
}, "makeText");
makeRow = /* @__PURE__ */ __name(function makeRow2(body) {
if (body.length === 1) {
return body[0];
} else {
return new mathMLTree.MathNode("mrow", body);
}
}, "makeRow");
getVariant = /* @__PURE__ */ __name(function getVariant2(group2, options2) {
if (options2.fontFamily === "texttt") {
return "monospace";
} else if (options2.fontFamily === "textsf") {
if (options2.fontShape === "textit" && options2.fontWeight === "textbf") {
return "sans-serif-bold-italic";
} else if (options2.fontShape === "textit") {
return "sans-serif-italic";
} else if (options2.fontWeight === "textbf") {
return "bold-sans-serif";
} else {
return "sans-serif";
}
} else if (options2.fontShape === "textit" && options2.fontWeight === "textbf") {
return "bold-italic";
} else if (options2.fontShape === "textit") {
return "italic";
} else if (options2.fontWeight === "textbf") {
return "bold";
}
var font = options2.font;
if (!font || font === "mathnormal") {
return null;
}
var mode = group2.mode;
if (font === "mathit") {
return "italic";
} else if (font === "boldsymbol") {
return group2.type === "textord" ? "bold" : "bold-italic";
} else if (font === "mathbf") {
return "bold";
} else if (font === "mathbb") {
return "double-struck";
} else if (font === "mathsfit") {
return "sans-serif-italic";
} else if (font === "mathfrak") {
return "fraktur";
} else if (font === "mathscr" || font === "mathcal") {
return "script";
} else if (font === "mathsf") {
return "sans-serif";
} else if (font === "mathtt") {
return "monospace";
}
var text4 = group2.text;
if (utils.contains(["\\imath", "\\jmath"], text4)) {
return null;
}
if (symbols[mode][text4] && symbols[mode][text4].replace) {
text4 = symbols[mode][text4].replace;
}
var fontName = buildCommon.fontMap[font].fontName;
if (getCharacterMetrics(text4, fontName, mode)) {
return buildCommon.fontMap[font].variant;
}
return null;
}, "getVariant");
__name(isNumberPunctuation, "isNumberPunctuation");
buildExpression2 = /* @__PURE__ */ __name(function buildExpression3(expression, options2, isOrdgroup) {
if (expression.length === 1) {
var group2 = buildGroup2(expression[0], options2);
if (isOrdgroup && group2 instanceof MathNode && group2.type === "mo") {
group2.setAttribute("lspace", "0em");
group2.setAttribute("rspace", "0em");
}
return [group2];
}
var groups = [];
var lastGroup;
for (var i2 = 0; i2 < expression.length; i2++) {
var _group = buildGroup2(expression[i2], options2);
if (_group instanceof MathNode && lastGroup instanceof MathNode) {
if (_group.type === "mtext" && lastGroup.type === "mtext" && _group.getAttribute("mathvariant") === lastGroup.getAttribute("mathvariant")) {
lastGroup.children.push(..._group.children);
continue;
} else if (_group.type === "mn" && lastGroup.type === "mn") {
lastGroup.children.push(..._group.children);
continue;
} else if (isNumberPunctuation(_group) && lastGroup.type === "mn") {
lastGroup.children.push(..._group.children);
continue;
} else if (_group.type === "mn" && isNumberPunctuation(lastGroup)) {
_group.children = [...lastGroup.children, ..._group.children];
groups.pop();
} else if ((_group.type === "msup" || _group.type === "msub") && _group.children.length >= 1 && (lastGroup.type === "mn" || isNumberPunctuation(lastGroup))) {
var base = _group.children[0];
if (base instanceof MathNode && base.type === "mn") {
base.children = [...lastGroup.children, ...base.children];
groups.pop();
}
} else if (lastGroup.type === "mi" && lastGroup.children.length === 1) {
var lastChild = lastGroup.children[0];
if (lastChild instanceof TextNode && lastChild.text === "\u0338" && (_group.type === "mo" || _group.type === "mi" || _group.type === "mn")) {
var child = _group.children[0];
if (child instanceof TextNode && child.text.length > 0) {
child.text = child.text.slice(0, 1) + "\u0338" + child.text.slice(1);
groups.pop();
}
}
}
}
groups.push(_group);
lastGroup = _group;
}
return groups;
}, "buildExpression");
buildExpressionRow = /* @__PURE__ */ __name(function buildExpressionRow2(expression, options2, isOrdgroup) {
return makeRow(buildExpression2(expression, options2, isOrdgroup));
}, "buildExpressionRow");
buildGroup2 = /* @__PURE__ */ __name(function buildGroup3(group2, options2) {
if (!group2) {
return new mathMLTree.MathNode("mrow");
}
if (_mathmlGroupBuilders[group2.type]) {
var result = _mathmlGroupBuilders[group2.type](group2, options2);
return result;
} else {
throw new ParseError("Got group of unknown type: '" + group2.type + "'");
}
}, "buildGroup");
__name(buildMathML, "buildMathML");
optionsFromSettings = /* @__PURE__ */ __name(function optionsFromSettings2(settings) {
return new Options({
style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT,
maxSize: settings.maxSize,
minRuleThickness: settings.minRuleThickness
});
}, "optionsFromSettings");
displayWrap = /* @__PURE__ */ __name(function displayWrap2(node2, settings) {
if (settings.displayMode) {
var classes3 = ["katex-display"];
if (settings.leqno) {
classes3.push("leqno");
}
if (settings.fleqn) {
classes3.push("fleqn");
}
node2 = buildCommon.makeSpan(classes3, [node2]);
}
return node2;
}, "displayWrap");
buildTree = /* @__PURE__ */ __name(function buildTree2(tree, expression, settings) {
var options2 = optionsFromSettings(settings);
var katexNode;
if (settings.output === "mathml") {
return buildMathML(tree, expression, options2, settings.displayMode, true);
} else if (settings.output === "html") {
var htmlNode = buildHTML(tree, options2);
katexNode = buildCommon.makeSpan(["katex"], [htmlNode]);
} else {
var mathMLNode = buildMathML(tree, expression, options2, settings.displayMode, false);
var _htmlNode = buildHTML(tree, options2);
katexNode = buildCommon.makeSpan(["katex"], [mathMLNode, _htmlNode]);
}
return displayWrap(katexNode, settings);
}, "buildTree");
buildHTMLTree = /* @__PURE__ */ __name(function buildHTMLTree2(tree, expression, settings) {
var options2 = optionsFromSettings(settings);
var htmlNode = buildHTML(tree, options2);
var katexNode = buildCommon.makeSpan(["katex"], [htmlNode]);
return displayWrap(katexNode, settings);
}, "buildHTMLTree");
stretchyCodePoint = {
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",
// Not a perfect match.
xleftequilibrium: "\u21CB",
// None better available.
"\\cdrightarrow": "\u2192",
"\\cdleftarrow": "\u2190",
"\\cdlongequal": "="
};
mathMLnode = /* @__PURE__ */ __name(function mathMLnode2(label) {
var node2 = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[label.replace(/^\\/, "")])]);
node2.setAttribute("stretchy", "true");
return node2;
}, "mathMLnode");
katexImagesData = {
// path(s), minWidth, height, align
overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
"\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"],
// CD minwwidth2.5pc
xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
"\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"],
Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
"\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"],
xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],
overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548],
underleftrightarrow: [["leftarrow", "rightarrow"], 0.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"], 0.888, 522],
underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],
// The next three arrows are from the mhchem package.
// In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
// document as \xrightarrow or \xrightleftharpoons. Those have
// min-length = 1.75em, so we set min-length on these next three to match.
xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901],
xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716],
xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716]
};
groupLength = /* @__PURE__ */ __name(function groupLength2(arg) {
if (arg.type === "ordgroup") {
return arg.body.length;
} else {
return 1;
}
}, "groupLength");
svgSpan = /* @__PURE__ */ __name(function svgSpan2(group2, options2) {
function buildSvgSpan_() {
var viewBoxWidth = 4e5;
var label = group2.label.slice(1);
if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], label)) {
var grp = group2;
var numChars = groupLength(grp.base);
var viewBoxHeight;
var pathName;
var _height;
if (numChars > 5) {
if (label === "widehat" || label === "widecheck") {
viewBoxHeight = 420;
viewBoxWidth = 2364;
_height = 0.42;
pathName = label + "4";
} else {
viewBoxHeight = 312;
viewBoxWidth = 2340;
_height = 0.34;
pathName = "tilde4";
}
} else {
var imgIndex = [1, 1, 2, 2, 3, 3][numChars];
if (label === "widehat" || label === "widecheck") {
viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex];
viewBoxHeight = [0, 239, 300, 360, 420][imgIndex];
_height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex];
pathName = label + imgIndex;
} else {
viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex];
viewBoxHeight = [0, 260, 286, 306, 312][imgIndex];
_height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex];
pathName = "tilde" + imgIndex;
}
}
var path4 = new PathNode(pathName);
var svgNode2 = new SvgNode([path4], {
"width": "100%",
"height": makeEm(_height),
"viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight,
"preserveAspectRatio": "none"
});
return {
span: buildCommon.makeSvgSpan([], [svgNode2], options2),
minWidth: 0,
height: _height
};
} else {
var spans = [];
var data5 = katexImagesData[label];
var [paths, _minWidth, _viewBoxHeight] = data5;
var _height2 = _viewBoxHeight / 1e3;
var numSvgChildren = paths.length;
var widthClasses;
var aligns;
if (numSvgChildren === 1) {
var align1 = data5[3];
widthClasses = ["hide-tail"];
aligns = [align1];
} else if (numSvgChildren === 2) {
widthClasses = ["halfarrow-left", "halfarrow-right"];
aligns = ["xMinYMin", "xMaxYMin"];
} else if (numSvgChildren === 3) {
widthClasses = ["brace-left", "brace-center", "brace-right"];
aligns = ["xMinYMin", "xMidYMin", "xMaxYMin"];
} else {
throw new Error("Correct katexImagesData or update code here to support\n " + numSvgChildren + " children.");
}
for (var i2 = 0; i2 < numSvgChildren; i2++) {
var _path = new PathNode(paths[i2]);
var _svgNode = new SvgNode([_path], {
"width": "400em",
"height": makeEm(_height2),
"viewBox": "0 0 " + viewBoxWidth + " " + _viewBoxHeight,
"preserveAspectRatio": aligns[i2] + " slice"
});
var _span = buildCommon.makeSvgSpan([widthClasses[i2]], [_svgNode], options2);
if (numSvgChildren === 1) {
return {
span: _span,
minWidth: _minWidth,
height: _height2
};
} else {
_span.style.height = makeEm(_height2);
spans.push(_span);
}
}
return {
span: buildCommon.makeSpan(["stretchy"], spans, options2),
minWidth: _minWidth,
height: _height2
};
}
}
__name(buildSvgSpan_, "buildSvgSpan_");
var {
span,
minWidth,
height: height2
} = buildSvgSpan_();
span.height = height2;
span.style.height = makeEm(height2);
if (minWidth > 0) {
span.style.minWidth = makeEm(minWidth);
}
return span;
}, "svgSpan");
encloseSpan = /* @__PURE__ */ __name(function encloseSpan2(inner2, label, topPad, bottomPad, options2) {
var img;
var totalHeight = inner2.height + inner2.depth + topPad + bottomPad;
if (/fbox|color|angl/.test(label)) {
img = buildCommon.makeSpan(["stretchy", label], [], options2);
if (label === "fbox") {
var color2 = options2.color && options2.getColor();
if (color2) {
img.style.borderColor = color2;
}
}
} else {
var lines = [];
if (/^[bx]cancel$/.test(label)) {
lines.push(new LineNode({
"x1": "0",
"y1": "0",
"x2": "100%",
"y2": "100%",
"stroke-width": "0.046em"
}));
}
if (/^x?cancel$/.test(label)) {
lines.push(new LineNode({
"x1": "0",
"y1": "100%",
"x2": "100%",
"y2": "0",
"stroke-width": "0.046em"
}));
}
var svgNode2 = new SvgNode(lines, {
"width": "100%",
"height": makeEm(totalHeight)
});
img = buildCommon.makeSvgSpan([], [svgNode2], options2);
}
img.height = totalHeight;
img.style.height = makeEm(totalHeight);
return img;
}, "encloseSpan");
stretchy = {
encloseSpan,
mathMLnode,
svgSpan
};
__name(assertNodeType, "assertNodeType");
__name(assertSymbolNodeType, "assertSymbolNodeType");
__name(checkSymbolNodeType, "checkSymbolNodeType");
htmlBuilder$a = /* @__PURE__ */ __name((grp, options2) => {
var base;
var group2;
var supSubGroup;
if (grp && grp.type === "supsub") {
group2 = assertNodeType(grp.base, "accent");
base = group2.base;
grp.base = base;
supSubGroup = assertSpan(buildGroup$1(grp, options2));
grp.base = group2;
} else {
group2 = assertNodeType(grp, "accent");
base = group2.base;
}
var body = buildGroup$1(base, options2.havingCrampedStyle());
var mustShift = group2.isShifty && utils.isCharacterBox(base);
var skew = 0;
if (mustShift) {
var baseChar = utils.getBaseElem(base);
var baseGroup = buildGroup$1(baseChar, options2.havingCrampedStyle());
skew = assertSymbolDomNode(baseGroup).skew;
}
var accentBelow = group2.label === "\\c";
var clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options2.fontMetrics().xHeight);
var accentBody;
if (!group2.isStretchy) {
var accent2;
var width3;
if (group2.label === "\\vec") {
accent2 = buildCommon.staticSvg("vec", options2);
width3 = buildCommon.svgData.vec[1];
} else {
accent2 = buildCommon.makeOrd({
mode: group2.mode,
text: group2.label
}, options2, "textord");
accent2 = assertSymbolDomNode(accent2);
accent2.italic = 0;
width3 = accent2.width;
if (accentBelow) {
clearance += accent2.depth;
}
}
accentBody = buildCommon.makeSpan(["accent-body"], [accent2]);
var accentFull = group2.label === "\\textcircled";
if (accentFull) {
accentBody.classes.push("accent-full");
clearance = body.height;
}
var left3 = skew;
if (!accentFull) {
left3 -= width3 / 2;
}
accentBody.style.left = makeEm(left3);
if (group2.label === "\\textcircled") {
accentBody.style.top = ".2em";
}
accentBody = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{
type: "elem",
elem: body
}, {
type: "kern",
size: -clearance
}, {
type: "elem",
elem: accentBody
}]
}, options2);
} else {
accentBody = stretchy.svgSpan(group2, options2);
accentBody = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{
type: "elem",
elem: body
}, {
type: "elem",
elem: accentBody,
wrapperClasses: ["svg-align"],
wrapperStyle: skew > 0 ? {
width: "calc(100% - " + makeEm(2 * skew) + ")",
marginLeft: makeEm(2 * skew)
} : void 0
}]
}, options2);
}
var accentWrap = buildCommon.makeSpan(["mord", "accent"], [accentBody], options2);
if (supSubGroup) {
supSubGroup.children[0] = accentWrap;
supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height);
supSubGroup.classes[0] = "mord";
return supSubGroup;
} else {
return accentWrap;
}
}, "htmlBuilder$a");
mathmlBuilder$9 = /* @__PURE__ */ __name((group2, options2) => {
var accentNode = group2.isStretchy ? stretchy.mathMLnode(group2.label) : new mathMLTree.MathNode("mo", [makeText(group2.label, group2.mode)]);
var node2 = new mathMLTree.MathNode("mover", [buildGroup2(group2.base, options2), accentNode]);
node2.setAttribute("accent", "true");
return node2;
}, "mathmlBuilder$9");
NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((accent2) => "\\" + accent2).join("|"));
defineFunction({
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: /* @__PURE__ */ __name((context, args) => {
var base = normalizeArgument(args[0]);
var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName);
var isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck";
return {
type: "accent",
mode: context.parser.mode,
label: context.funcName,
isStretchy,
isShifty,
base
};
}, "handler"),
htmlBuilder: htmlBuilder$a,
mathmlBuilder: mathmlBuilder$9
});
defineFunction({
type: "accent",
names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
props: {
numArgs: 1,
allowedInText: true,
allowedInMath: true,
// unless in strict mode
argTypes: ["primitive"]
},
handler: /* @__PURE__ */ __name((context, args) => {
var base = args[0];
var mode = context.parser.mode;
if (mode === "math") {
context.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + context.funcName + " works only in text mode");
mode = "text";
}
return {
type: "accent",
mode,
label: context.funcName,
isStretchy: false,
isShifty: true,
base
};
}, "handler"),
htmlBuilder: htmlBuilder$a,
mathmlBuilder: mathmlBuilder$9
});
defineFunction({
type: "accentUnder",
names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
props: {
numArgs: 1
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24,
funcName
} = _ref;
var base = args[0];
return {
type: "accentUnder",
mode: parser24.mode,
label: funcName,
base
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var innerGroup = buildGroup$1(group2.base, options2);
var accentBody = stretchy.svgSpan(group2, options2);
var kern = group2.label === "\\utilde" ? 0.12 : 0;
var vlist = buildCommon.makeVList({
positionType: "top",
positionData: innerGroup.height,
children: [{
type: "elem",
elem: accentBody,
wrapperClasses: ["svg-align"]
}, {
type: "kern",
size: kern
}, {
type: "elem",
elem: innerGroup
}]
}, options2);
return buildCommon.makeSpan(["mord", "accentunder"], [vlist], options2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var accentNode = stretchy.mathMLnode(group2.label);
var node2 = new mathMLTree.MathNode("munder", [buildGroup2(group2.base, options2), accentNode]);
node2.setAttribute("accentunder", "true");
return node2;
}, "mathmlBuilder")
});
paddedNode = /* @__PURE__ */ __name((group2) => {
var node2 = new mathMLTree.MathNode("mpadded", group2 ? [group2] : []);
node2.setAttribute("width", "+0.6em");
node2.setAttribute("lspace", "0.3em");
return node2;
}, "paddedNode");
defineFunction({
type: "xArrow",
names: [
"\\xleftarrow",
"\\xrightarrow",
"\\xLeftarrow",
"\\xRightarrow",
"\\xleftrightarrow",
"\\xLeftrightarrow",
"\\xhookleftarrow",
"\\xhookrightarrow",
"\\xmapsto",
"\\xrightharpoondown",
"\\xrightharpoonup",
"\\xleftharpoondown",
"\\xleftharpoonup",
"\\xrightleftharpoons",
"\\xleftrightharpoons",
"\\xlongequal",
"\\xtwoheadrightarrow",
"\\xtwoheadleftarrow",
"\\xtofrom",
// The next 3 functions are here to support the mhchem extension.
// Direct use of these functions is discouraged and may break someday.
"\\xrightleftarrows",
"\\xrightequilibrium",
"\\xleftequilibrium",
// The next 3 functions are here only to support the {CD} environment.
"\\\\cdrightarrow",
"\\\\cdleftarrow",
"\\\\cdlongequal"
],
props: {
numArgs: 1,
numOptionalArgs: 1
},
handler(_ref, args, optArgs) {
var {
parser: parser24,
funcName
} = _ref;
return {
type: "xArrow",
mode: parser24.mode,
label: funcName,
body: args[0],
below: optArgs[0]
};
},
// Flow is unable to correctly infer the type of `group`, even though it's
// unambiguously determined from the passed-in `type` above.
htmlBuilder(group2, options2) {
var style3 = options2.style;
var newOptions = options2.havingStyle(style3.sup());
var upperGroup = buildCommon.wrapFragment(buildGroup$1(group2.body, newOptions, options2), options2);
var arrowPrefix = group2.label.slice(0, 2) === "\\x" ? "x" : "cd";
upperGroup.classes.push(arrowPrefix + "-arrow-pad");
var lowerGroup;
if (group2.below) {
newOptions = options2.havingStyle(style3.sub());
lowerGroup = buildCommon.wrapFragment(buildGroup$1(group2.below, newOptions, options2), options2);
lowerGroup.classes.push(arrowPrefix + "-arrow-pad");
}
var arrowBody = stretchy.svgSpan(group2, options2);
var arrowShift = -options2.fontMetrics().axisHeight + 0.5 * arrowBody.height;
var upperShift = -options2.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111;
if (upperGroup.depth > 0.25 || group2.label === "\\xleftequilibrium") {
upperShift -= upperGroup.depth;
}
var vlist;
if (lowerGroup) {
var lowerShift = -options2.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111;
vlist = buildCommon.makeVList({
positionType: "individualShift",
children: [{
type: "elem",
elem: upperGroup,
shift: upperShift
}, {
type: "elem",
elem: arrowBody,
shift: arrowShift
}, {
type: "elem",
elem: lowerGroup,
shift: lowerShift
}]
}, options2);
} else {
vlist = buildCommon.makeVList({
positionType: "individualShift",
children: [{
type: "elem",
elem: upperGroup,
shift: upperShift
}, {
type: "elem",
elem: arrowBody,
shift: arrowShift
}]
}, options2);
}
vlist.children[0].children[0].children[1].classes.push("svg-align");
return buildCommon.makeSpan(["mrel", "x-arrow"], [vlist], options2);
},
mathmlBuilder(group2, options2) {
var arrowNode = stretchy.mathMLnode(group2.label);
arrowNode.setAttribute("minsize", group2.label.charAt(0) === "x" ? "1.75em" : "3.0em");
var node2;
if (group2.body) {
var upperNode = paddedNode(buildGroup2(group2.body, options2));
if (group2.below) {
var lowerNode = paddedNode(buildGroup2(group2.below, options2));
node2 = new mathMLTree.MathNode("munderover", [arrowNode, lowerNode, upperNode]);
} else {
node2 = new mathMLTree.MathNode("mover", [arrowNode, upperNode]);
}
} else if (group2.below) {
var _lowerNode = paddedNode(buildGroup2(group2.below, options2));
node2 = new mathMLTree.MathNode("munder", [arrowNode, _lowerNode]);
} else {
node2 = paddedNode();
node2 = new mathMLTree.MathNode("mover", [arrowNode, node2]);
}
return node2;
}
});
makeSpan2 = buildCommon.makeSpan;
__name(htmlBuilder$9, "htmlBuilder$9");
__name(mathmlBuilder$8, "mathmlBuilder$8");
defineFunction({
type: "mclass",
names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
props: {
numArgs: 1,
primitive: true
},
handler(_ref, args) {
var {
parser: parser24,
funcName
} = _ref;
var body = args[0];
return {
type: "mclass",
mode: parser24.mode,
mclass: "m" + funcName.slice(5),
// TODO(kevinb): don't prefix with 'm'
body: ordargument(body),
isCharacterBox: utils.isCharacterBox(body)
};
},
htmlBuilder: htmlBuilder$9,
mathmlBuilder: mathmlBuilder$8
});
binrelClass = /* @__PURE__ */ __name((arg) => {
var atom2 = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg;
if (atom2.type === "atom" && (atom2.family === "bin" || atom2.family === "rel")) {
return "m" + atom2.family;
} else {
return "mord";
}
}, "binrelClass");
defineFunction({
type: "mclass",
names: ["\\@binrel"],
props: {
numArgs: 2
},
handler(_ref2, args) {
var {
parser: parser24
} = _ref2;
return {
type: "mclass",
mode: parser24.mode,
mclass: binrelClass(args[0]),
body: ordargument(args[1]),
isCharacterBox: utils.isCharacterBox(args[1])
};
}
});
defineFunction({
type: "mclass",
names: ["\\stackrel", "\\overset", "\\underset"],
props: {
numArgs: 2
},
handler(_ref3, args) {
var {
parser: parser24,
funcName
} = _ref3;
var baseArg = args[1];
var shiftedArg = args[0];
var mclass;
if (funcName !== "\\stackrel") {
mclass = binrelClass(baseArg);
} else {
mclass = "mrel";
}
var baseOp = {
type: "op",
mode: baseArg.mode,
limits: true,
alwaysHandleSupSub: true,
parentIsSupSub: false,
symbol: false,
suppressBaseShift: funcName !== "\\stackrel",
body: ordargument(baseArg)
};
var supsub = {
type: "supsub",
mode: shiftedArg.mode,
base: baseOp,
sup: funcName === "\\underset" ? null : shiftedArg,
sub: funcName === "\\underset" ? shiftedArg : null
};
return {
type: "mclass",
mode: parser24.mode,
mclass,
body: [supsub],
isCharacterBox: utils.isCharacterBox(supsub)
};
},
htmlBuilder: htmlBuilder$9,
mathmlBuilder: mathmlBuilder$8
});
defineFunction({
type: "pmb",
names: ["\\pmb"],
props: {
numArgs: 1,
allowedInText: true
},
handler(_ref, args) {
var {
parser: parser24
} = _ref;
return {
type: "pmb",
mode: parser24.mode,
mclass: binrelClass(args[0]),
body: ordargument(args[0])
};
},
htmlBuilder(group2, options2) {
var elements2 = buildExpression$1(group2.body, options2, true);
var node2 = buildCommon.makeSpan([group2.mclass], elements2, options2);
node2.style.textShadow = "0.02em 0.01em 0.04px";
return node2;
},
mathmlBuilder(group2, style3) {
var inner2 = buildExpression2(group2.body, style3);
var node2 = new mathMLTree.MathNode("mstyle", inner2);
node2.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px");
return node2;
}
});
cdArrowFunctionName = {
">": "\\\\cdrightarrow",
"<": "\\\\cdleftarrow",
"=": "\\\\cdlongequal",
"A": "\\uparrow",
"V": "\\downarrow",
"|": "\\Vert",
".": "no arrow"
};
newCell = /* @__PURE__ */ __name(() => {
return {
type: "styling",
body: [],
mode: "math",
style: "display"
};
}, "newCell");
isStartOfArrow = /* @__PURE__ */ __name((node2) => {
return node2.type === "textord" && node2.text === "@";
}, "isStartOfArrow");
isLabelEnd = /* @__PURE__ */ __name((node2, endChar) => {
return (node2.type === "mathord" || node2.type === "atom") && node2.text === endChar;
}, "isLabelEnd");
__name(cdArrow, "cdArrow");
__name(parseCD, "parseCD");
defineFunction({
type: "cdlabel",
names: ["\\\\cdleft", "\\\\cdright"],
props: {
numArgs: 1
},
handler(_ref, args) {
var {
parser: parser24,
funcName
} = _ref;
return {
type: "cdlabel",
mode: parser24.mode,
side: funcName.slice(4),
label: args[0]
};
},
htmlBuilder(group2, options2) {
var newOptions = options2.havingStyle(options2.style.sup());
var label = buildCommon.wrapFragment(buildGroup$1(group2.label, newOptions, options2), options2);
label.classes.push("cd-label-" + group2.side);
label.style.bottom = makeEm(0.8 - label.depth);
label.height = 0;
label.depth = 0;
return label;
},
mathmlBuilder(group2, options2) {
var label = new mathMLTree.MathNode("mrow", [buildGroup2(group2.label, options2)]);
label = new mathMLTree.MathNode("mpadded", [label]);
label.setAttribute("width", "0");
if (group2.side === "left") {
label.setAttribute("lspace", "-1width");
}
label.setAttribute("voffset", "0.7em");
label = new mathMLTree.MathNode("mstyle", [label]);
label.setAttribute("displaystyle", "false");
label.setAttribute("scriptlevel", "1");
return label;
}
});
defineFunction({
type: "cdlabelparent",
names: ["\\\\cdparent"],
props: {
numArgs: 1
},
handler(_ref2, args) {
var {
parser: parser24
} = _ref2;
return {
type: "cdlabelparent",
mode: parser24.mode,
fragment: args[0]
};
},
htmlBuilder(group2, options2) {
var parent4 = buildCommon.wrapFragment(buildGroup$1(group2.fragment, options2), options2);
parent4.classes.push("cd-vert-arrow");
return parent4;
},
mathmlBuilder(group2, options2) {
return new mathMLTree.MathNode("mrow", [buildGroup2(group2.fragment, options2)]);
}
});
defineFunction({
type: "textord",
names: ["\\@char"],
props: {
numArgs: 1,
allowedInText: true
},
handler(_ref, args) {
var {
parser: parser24
} = _ref;
var arg = assertNodeType(args[0], "ordgroup");
var group2 = arg.body;
var number7 = "";
for (var i2 = 0; i2 < group2.length; i2++) {
var node2 = assertNodeType(group2[i2], "textord");
number7 += node2.text;
}
var code = parseInt(number7);
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) {
text4 = String.fromCharCode(code);
} else {
code -= 65536;
text4 = String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
}
return {
type: "textord",
mode: parser24.mode,
text: text4
};
}
});
htmlBuilder$8 = /* @__PURE__ */ __name((group2, options2) => {
var elements2 = buildExpression$1(group2.body, options2.withColor(group2.color), false);
return buildCommon.makeFragment(elements2);
}, "htmlBuilder$8");
mathmlBuilder$7 = /* @__PURE__ */ __name((group2, options2) => {
var inner2 = buildExpression2(group2.body, options2.withColor(group2.color));
var node2 = new mathMLTree.MathNode("mstyle", inner2);
node2.setAttribute("mathcolor", group2.color);
return node2;
}, "mathmlBuilder$7");
defineFunction({
type: "color",
names: ["\\textcolor"],
props: {
numArgs: 2,
allowedInText: true,
argTypes: ["color", "original"]
},
handler(_ref, args) {
var {
parser: parser24
} = _ref;
var color2 = assertNodeType(args[0], "color-token").color;
var body = args[1];
return {
type: "color",
mode: parser24.mode,
color: color2,
body: ordargument(body)
};
},
htmlBuilder: htmlBuilder$8,
mathmlBuilder: mathmlBuilder$7
});
defineFunction({
type: "color",
names: ["\\color"],
props: {
numArgs: 1,
allowedInText: true,
argTypes: ["color"]
},
handler(_ref2, args) {
var {
parser: parser24,
breakOnTokenText
} = _ref2;
var color2 = assertNodeType(args[0], "color-token").color;
parser24.gullet.macros.set("\\current@color", color2);
var body = parser24.parseExpression(true, breakOnTokenText);
return {
type: "color",
mode: parser24.mode,
color: color2,
body
};
},
htmlBuilder: htmlBuilder$8,
mathmlBuilder: mathmlBuilder$7
});
defineFunction({
type: "cr",
names: ["\\\\"],
props: {
numArgs: 0,
numOptionalArgs: 0,
allowedInText: true
},
handler(_ref, args, optArgs) {
var {
parser: parser24
} = _ref;
var size4 = 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: parser24.mode,
newLine,
size: size4 && assertNodeType(size4, "size").value
};
},
// The following builders are called only at the top level,
// not within tabular/array environments.
htmlBuilder(group2, options2) {
var span = buildCommon.makeSpan(["mspace"], [], options2);
if (group2.newLine) {
span.classes.push("newline");
if (group2.size) {
span.style.marginTop = makeEm(calculateSize2(group2.size, options2));
}
}
return span;
},
mathmlBuilder(group2, options2) {
var node2 = new mathMLTree.MathNode("mspace");
if (group2.newLine) {
node2.setAttribute("linebreak", "newline");
if (group2.size) {
node2.setAttribute("height", makeEm(calculateSize2(group2.size, options2)));
}
}
return node2;
}
});
globalMap = {
"\\global": "\\global",
"\\long": "\\\\globallong",
"\\\\globallong": "\\\\globallong",
"\\def": "\\gdef",
"\\gdef": "\\gdef",
"\\edef": "\\xdef",
"\\xdef": "\\xdef",
"\\let": "\\\\globallet",
"\\futurelet": "\\\\globalfuture"
};
checkControlSequence = /* @__PURE__ */ __name((tok) => {
var name = tok.text;
if (/^(?:[\\{}$^_]|EOF)$/.test(name)) {
throw new ParseError("Expected a control sequence", tok);
}
return name;
}, "checkControlSequence");
getRHS = /* @__PURE__ */ __name((parser24) => {
var tok = parser24.gullet.popToken();
if (tok.text === "=") {
tok = parser24.gullet.popToken();
if (tok.text === " ") {
tok = parser24.gullet.popToken();
}
}
return tok;
}, "getRHS");
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: !parser24.gullet.isExpandable(tok.text)
};
}
parser24.gullet.macros.set(name, macro, global2);
}, "letCommand");
defineFunction({
type: "internal",
names: [
"\\global",
"\\long",
"\\\\globallong"
// can’t be entered directly
],
props: {
numArgs: 0,
allowedInText: true
},
handler(_ref) {
var {
parser: parser24,
funcName
} = _ref;
parser24.consumeSpaces();
var token2 = parser24.fetch();
if (globalMap[token2.text]) {
if (funcName === "\\global" || funcName === "\\\\globallong") {
token2.text = globalMap[token2.text];
}
return assertNodeType(parser24.parseFunction(), "internal");
}
throw new ParseError("Invalid token after macro prefix", token2);
}
});
defineFunction({
type: "internal",
names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler(_ref2) {
var {
parser: parser24,
funcName
} = _ref2;
var tok = parser24.gullet.popToken();
var name = tok.text;
if (/^(?:[\\{}$^_]|EOF)$/.test(name)) {
throw new ParseError("Expected a control sequence", tok);
}
var numArgs = 0;
var insert;
var delimiters2 = [[]];
while (parser24.gullet.future().text !== "{") {
tok = parser24.gullet.popToken();
if (tok.text === "#") {
if (parser24.gullet.future().text === "{") {
insert = parser24.gullet.future();
delimiters2[numArgs].push("{");
break;
}
tok = parser24.gullet.popToken();
if (!/^[1-9]$/.test(tok.text)) {
throw new ParseError('Invalid argument number "' + tok.text + '"');
}
if (parseInt(tok.text) !== numArgs + 1) {
throw new ParseError('Argument number "' + tok.text + '" out of order');
}
numArgs++;
delimiters2.push([]);
} else if (tok.text === "EOF") {
throw new ParseError("Expected a macro definition");
} else {
delimiters2[numArgs].push(tok.text);
}
}
var {
tokens: tokens2
} = parser24.gullet.consumeArg();
if (insert) {
tokens2.unshift(insert);
}
if (funcName === "\\edef" || funcName === "\\xdef") {
tokens2 = parser24.gullet.expandTokens(tokens2);
tokens2.reverse();
}
parser24.gullet.macros.set(name, {
tokens: tokens2,
numArgs,
delimiters: delimiters2
}, funcName === globalMap[funcName]);
return {
type: "internal",
mode: parser24.mode
};
}
});
defineFunction({
type: "internal",
names: [
"\\let",
"\\\\globallet"
// can’t be entered directly
],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler(_ref3) {
var {
parser: parser24,
funcName
} = _ref3;
var name = checkControlSequence(parser24.gullet.popToken());
parser24.gullet.consumeSpaces();
var tok = getRHS(parser24);
letCommand(parser24, name, tok, funcName === "\\\\globallet");
return {
type: "internal",
mode: parser24.mode
};
}
});
defineFunction({
type: "internal",
names: [
"\\futurelet",
"\\\\globalfuture"
// can’t be entered directly
],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler(_ref4) {
var {
parser: parser24,
funcName
} = _ref4;
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: parser24.mode
};
}
});
getMetrics = /* @__PURE__ */ __name(function getMetrics2(symbol, font, mode) {
var replace2 = symbols.math[symbol] && symbols.math[symbol].replace;
var metrics = getCharacterMetrics(replace2 || symbol, font, mode);
if (!metrics) {
throw new Error("Unsupported symbol " + symbol + " and font size " + font + ".");
}
return metrics;
}, "getMetrics");
styleWrap = /* @__PURE__ */ __name(function styleWrap2(delim, toStyle, options2, classes3) {
var newOptions = options2.havingBaseStyle(toStyle);
var span = buildCommon.makeSpan(classes3.concat(newOptions.sizingClasses(options2)), [delim], options2);
var delimSizeMultiplier = newOptions.sizeMultiplier / options2.sizeMultiplier;
span.height *= delimSizeMultiplier;
span.depth *= delimSizeMultiplier;
span.maxFontSize = newOptions.sizeMultiplier;
return span;
}, "styleWrap");
centerSpan = /* @__PURE__ */ __name(function centerSpan2(span, options2, style3) {
var newOptions = options2.havingBaseStyle(style3);
var shift2 = (1 - options2.sizeMultiplier / newOptions.sizeMultiplier) * options2.fontMetrics().axisHeight;
span.classes.push("delimcenter");
span.style.top = makeEm(shift2);
span.height -= shift2;
span.depth += shift2;
}, "centerSpan");
makeSmallDelim = /* @__PURE__ */ __name(function makeSmallDelim2(delim, style3, center4, options2, mode, classes3) {
var text4 = buildCommon.makeSymbol(delim, "Main-Regular", mode, options2);
var span = styleWrap(text4, style3, options2, classes3);
if (center4) {
centerSpan(span, options2, style3);
}
return span;
}, "makeSmallDelim");
mathrmSize = /* @__PURE__ */ __name(function mathrmSize2(value2, size4, mode, options2) {
return buildCommon.makeSymbol(value2, "Size" + size4 + "-Regular", mode, options2);
}, "mathrmSize");
makeLargeDelim = /* @__PURE__ */ __name(function makeLargeDelim2(delim, size4, center4, options2, mode, classes3) {
var inner2 = mathrmSize(delim, size4, mode, options2);
var span = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + size4], [inner2], options2), Style$1.TEXT, options2, classes3);
if (center4) {
centerSpan(span, options2, Style$1.TEXT);
}
return span;
}, "makeLargeDelim");
makeGlyphSpan = /* @__PURE__ */ __name(function makeGlyphSpan2(symbol, font, mode) {
var sizeClass;
if (font === "Size1-Regular") {
sizeClass = "delim-size1";
} else {
sizeClass = "delim-size4";
}
var corner = buildCommon.makeSpan(["delimsizinginner", sizeClass], [buildCommon.makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]);
return {
type: "elem",
elem: corner
};
}, "makeGlyphSpan");
makeInner = /* @__PURE__ */ __name(function makeInner2(ch, height2, options2) {
var width3 = fontMetricsData["Size4-Regular"][ch.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][ch.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][ch.charCodeAt(0)][4];
var path4 = new PathNode("inner", innerPath(ch, Math.round(1e3 * height2)));
var svgNode2 = new SvgNode([path4], {
"width": makeEm(width3),
"height": makeEm(height2),
// Override CSS rule `.katex svg { width: 100% }`
"style": "width:" + makeEm(width3),
"viewBox": "0 0 " + 1e3 * width3 + " " + Math.round(1e3 * height2),
"preserveAspectRatio": "xMinYMin"
});
var span = buildCommon.makeSvgSpan([], [svgNode2], options2);
span.height = height2;
span.style.height = makeEm(height2);
span.style.width = makeEm(width3);
return {
type: "elem",
elem: span
};
}, "makeInner");
lapInEms = 8e-3;
lap = {
type: "kern",
size: -1 * lapInEms
};
verts = ["|", "\\lvert", "\\rvert", "\\vert"];
doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"];
makeStackedDelim = /* @__PURE__ */ __name(function makeStackedDelim2(delim, heightTotal, center4, options2, mode, classes3) {
var top2;
var middle;
var repeat2;
var bottom2;
var svgLabel = "";
var viewBoxWidth = 0;
top2 = repeat2 = bottom2 = delim;
middle = null;
var font = "Size1-Regular";
if (delim === "\\uparrow") {
repeat2 = bottom2 = "\u23D0";
} else if (delim === "\\Uparrow") {
repeat2 = bottom2 = "\u2016";
} else if (delim === "\\downarrow") {
top2 = repeat2 = "\u23D0";
} else if (delim === "\\Downarrow") {
top2 = repeat2 = "\u2016";
} else if (delim === "\\updownarrow") {
top2 = "\\uparrow";
repeat2 = "\u23D0";
bottom2 = "\\downarrow";
} else if (delim === "\\Updownarrow") {
top2 = "\\Uparrow";
repeat2 = "\u2016";
bottom2 = "\\Downarrow";
} else if (utils.contains(verts, delim)) {
repeat2 = "\u2223";
svgLabel = "vert";
viewBoxWidth = 333;
} else if (utils.contains(doubleVerts, delim)) {
repeat2 = "\u2225";
svgLabel = "doublevert";
viewBoxWidth = 556;
} else if (delim === "[" || delim === "\\lbrack") {
top2 = "\u23A1";
repeat2 = "\u23A2";
bottom2 = "\u23A3";
font = "Size4-Regular";
svgLabel = "lbrack";
viewBoxWidth = 667;
} else if (delim === "]" || delim === "\\rbrack") {
top2 = "\u23A4";
repeat2 = "\u23A5";
bottom2 = "\u23A6";
font = "Size4-Regular";
svgLabel = "rbrack";
viewBoxWidth = 667;
} else if (delim === "\\lfloor" || delim === "\u230A") {
repeat2 = top2 = "\u23A2";
bottom2 = "\u23A3";
font = "Size4-Regular";
svgLabel = "lfloor";
viewBoxWidth = 667;
} else if (delim === "\\lceil" || delim === "\u2308") {
top2 = "\u23A1";
repeat2 = bottom2 = "\u23A2";
font = "Size4-Regular";
svgLabel = "lceil";
viewBoxWidth = 667;
} else if (delim === "\\rfloor" || delim === "\u230B") {
repeat2 = top2 = "\u23A5";
bottom2 = "\u23A6";
font = "Size4-Regular";
svgLabel = "rfloor";
viewBoxWidth = 667;
} else if (delim === "\\rceil" || delim === "\u2309") {
top2 = "\u23A4";
repeat2 = bottom2 = "\u23A5";
font = "Size4-Regular";
svgLabel = "rceil";
viewBoxWidth = 667;
} else if (delim === "(" || delim === "\\lparen") {
top2 = "\u239B";
repeat2 = "\u239C";
bottom2 = "\u239D";
font = "Size4-Regular";
svgLabel = "lparen";
viewBoxWidth = 875;
} else if (delim === ")" || delim === "\\rparen") {
top2 = "\u239E";
repeat2 = "\u239F";
bottom2 = "\u23A0";
font = "Size4-Regular";
svgLabel = "rparen";
viewBoxWidth = 875;
} else if (delim === "\\{" || delim === "\\lbrace") {
top2 = "\u23A7";
middle = "\u23A8";
bottom2 = "\u23A9";
repeat2 = "\u23AA";
font = "Size4-Regular";
} else if (delim === "\\}" || delim === "\\rbrace") {
top2 = "\u23AB";
middle = "\u23AC";
bottom2 = "\u23AD";
repeat2 = "\u23AA";
font = "Size4-Regular";
} else if (delim === "\\lgroup" || delim === "\u27EE") {
top2 = "\u23A7";
bottom2 = "\u23A9";
repeat2 = "\u23AA";
font = "Size4-Regular";
} else if (delim === "\\rgroup" || delim === "\u27EF") {
top2 = "\u23AB";
bottom2 = "\u23AD";
repeat2 = "\u23AA";
font = "Size4-Regular";
} else if (delim === "\\lmoustache" || delim === "\u23B0") {
top2 = "\u23A7";
bottom2 = "\u23AD";
repeat2 = "\u23AA";
font = "Size4-Regular";
} else if (delim === "\\rmoustache" || delim === "\u23B1") {
top2 = "\u23AB";
bottom2 = "\u23A9";
repeat2 = "\u23AA";
font = "Size4-Regular";
}
var topMetrics = getMetrics(top2, font, mode);
var topHeightTotal = topMetrics.height + topMetrics.depth;
var repeatMetrics = getMetrics(repeat2, font, mode);
var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth;
var bottomMetrics = getMetrics(bottom2, font, mode);
var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth;
var middleHeightTotal = 0;
var middleFactor = 1;
if (middle !== null) {
var middleMetrics = getMetrics(middle, font, mode);
middleHeightTotal = middleMetrics.height + middleMetrics.depth;
middleFactor = 2;
}
var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;
var repeatCount = Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal)));
var realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal;
var axisHeight = options2.fontMetrics().axisHeight;
if (center4) {
axisHeight *= options2.sizeMultiplier;
}
var depth = realHeightTotal / 2 - axisHeight;
var stack = [];
if (svgLabel.length > 0) {
var midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal;
var viewBoxHeight = Math.round(realHeightTotal * 1e3);
var pathStr = tallDelim(svgLabel, Math.round(midHeight * 1e3));
var path4 = new PathNode(svgLabel, pathStr);
var width3 = (viewBoxWidth / 1e3).toFixed(3) + "em";
var height2 = (viewBoxHeight / 1e3).toFixed(3) + "em";
var svg2 = new SvgNode([path4], {
"width": width3,
"height": height2,
"viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight
});
var wrapper = buildCommon.makeSvgSpan([], [svg2], options2);
wrapper.height = viewBoxHeight / 1e3;
wrapper.style.width = width3;
wrapper.style.height = height2;
stack.push({
type: "elem",
elem: wrapper
});
} else {
stack.push(makeGlyphSpan(bottom2, font, mode));
stack.push(lap);
if (middle === null) {
var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms;
stack.push(makeInner(repeat2, innerHeight, options2));
} else {
var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms;
stack.push(makeInner(repeat2, _innerHeight, options2));
stack.push(lap);
stack.push(makeGlyphSpan(middle, font, mode));
stack.push(lap);
stack.push(makeInner(repeat2, _innerHeight, options2));
}
stack.push(lap);
stack.push(makeGlyphSpan(top2, font, mode));
}
var newOptions = options2.havingBaseStyle(Style$1.TEXT);
var inner2 = buildCommon.makeVList({
positionType: "bottom",
positionData: depth,
children: stack
}, newOptions);
return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [inner2], newOptions), Style$1.TEXT, options2, classes3);
}, "makeStackedDelim");
vbPad = 80;
emPad = 0.08;
sqrtSvg = /* @__PURE__ */ __name(function sqrtSvg2(sqrtName, height2, viewBoxHeight, extraVinculum, options2) {
var path4 = sqrtPath(sqrtName, extraVinculum, viewBoxHeight);
var pathNode = new PathNode(sqrtName, path4);
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"], [svg2], options2);
}, "sqrtSvg");
makeSqrtImage = /* @__PURE__ */ __name(function makeSqrtImage2(height2, options2) {
var newOptions = options2.havingBaseSizing();
var delim = traverseSequence("\\surd", height2 * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions);
var sizeMultiplier = newOptions.sizeMultiplier;
var extraVinculum = Math.max(0, options2.minRuleThickness - options2.fontMetrics().sqrtRuleThickness);
var span;
var spanHeight = 0;
var texHeight = 0;
var viewBoxHeight = 0;
var advanceWidth;
if (delim.type === "small") {
viewBoxHeight = 1e3 + 1e3 * extraVinculum + vbPad;
if (height2 < 1) {
sizeMultiplier = 1;
} else if (height2 < 1.4) {
sizeMultiplier = 0.7;
}
spanHeight = (1 + extraVinculum + emPad) / sizeMultiplier;
texHeight = (1 + extraVinculum) / sizeMultiplier;
span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum, options2);
span.style.minWidth = "0.853em";
advanceWidth = 0.833 / sizeMultiplier;
} else if (delim.type === "large") {
viewBoxHeight = (1e3 + vbPad) * sizeToMaxHeight[delim.size];
texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier;
spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad) / sizeMultiplier;
span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight, extraVinculum, options2);
span.style.minWidth = "1.02em";
advanceWidth = 1 / sizeMultiplier;
} else {
spanHeight = height2 + extraVinculum + emPad;
texHeight = height2 + extraVinculum;
viewBoxHeight = Math.floor(1e3 * height2 + extraVinculum) + vbPad;
span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum, options2);
span.style.minWidth = "0.742em";
advanceWidth = 1.056;
}
span.height = texHeight;
span.style.height = makeEm(spanHeight);
return {
span,
advanceWidth,
// Calculate the actual line width.
// This actually should depend on the chosen font -- e.g. \boldmath
// should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
// have thicker rules.
ruleWidth: (options2.fontMetrics().sqrtRuleThickness + extraVinculum) * sizeMultiplier
};
}, "makeSqrtImage");
stackLargeDelimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230A", "\u230B", "\\lceil", "\\rceil", "\u2308", "\u2309", "\\surd"];
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, size4, options2, 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, size4, false, options2, mode, classes3);
} else if (utils.contains(stackAlwaysDelimiters, delim)) {
return makeStackedDelim(delim, sizeToMaxHeight[size4], false, options2, mode, classes3);
} else {
throw new ParseError("Illegal delimiter: '" + delim + "'");
}
}, "makeSizedDelim");
stackNeverDelimiterSequence = [{
type: "small",
style: Style$1.SCRIPTSCRIPT
}, {
type: "small",
style: Style$1.SCRIPT
}, {
type: "small",
style: Style$1.TEXT
}, {
type: "large",
size: 1
}, {
type: "large",
size: 2
}, {
type: "large",
size: 3
}, {
type: "large",
size: 4
}];
stackAlwaysDelimiterSequence = [{
type: "small",
style: Style$1.SCRIPTSCRIPT
}, {
type: "small",
style: Style$1.SCRIPT
}, {
type: "small",
style: Style$1.TEXT
}, {
type: "stack"
}];
stackLargeDelimiterSequence = [{
type: "small",
style: Style$1.SCRIPTSCRIPT
}, {
type: "small",
style: Style$1.SCRIPT
}, {
type: "small",
style: Style$1.TEXT
}, {
type: "large",
size: 1
}, {
type: "large",
size: 2
}, {
type: "large",
size: 3
}, {
type: "large",
size: 4
}, {
type: "stack"
}];
delimTypeToFont = /* @__PURE__ */ __name(function delimTypeToFont2(type3) {
if (type3.type === "small") {
return "Main-Regular";
} else if (type3.type === "large") {
return "Size" + type3.size + "-Regular";
} else if (type3.type === "stack") {
return "Size4-Regular";
} else {
throw new Error("Add support for delim type '" + type3.type + "' here.");
}
}, "delimTypeToFont");
traverseSequence = /* @__PURE__ */ __name(function traverseSequence2(delim, height2, sequence, options2) {
var start3 = Math.min(2, 3 - options2.style.size);
for (var i2 = start3; i2 < sequence.length; i2++) {
if (sequence[i2].type === "stack") {
break;
}
var metrics = getMetrics(delim, delimTypeToFont(sequence[i2]), "math");
var heightDepth = metrics.height + metrics.depth;
if (sequence[i2].type === "small") {
var newOptions = options2.havingBaseStyle(sequence[i2].style);
heightDepth *= newOptions.sizeMultiplier;
}
if (heightDepth > height2) {
return sequence[i2];
}
}
return sequence[sequence.length - 1];
}, "traverseSequence");
makeCustomSizedDelim = /* @__PURE__ */ __name(function makeCustomSizedDelim2(delim, height2, center4, options2, mode, classes3) {
if (delim === "<" || delim === "\\lt" || delim === "\u27E8") {
delim = "\\langle";
} else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") {
delim = "\\rangle";
}
var sequence;
if (utils.contains(stackNeverDelimiters, delim)) {
sequence = stackNeverDelimiterSequence;
} else if (utils.contains(stackLargeDelimiters, delim)) {
sequence = stackLargeDelimiterSequence;
} else {
sequence = stackAlwaysDelimiterSequence;
}
var delimType = traverseSequence(delim, height2, sequence, options2);
if (delimType.type === "small") {
return makeSmallDelim(delim, delimType.style, center4, options2, mode, classes3);
} else if (delimType.type === "large") {
return makeLargeDelim(delim, delimType.size, center4, options2, mode, classes3);
} else {
return makeStackedDelim(delim, height2, center4, options2, mode, classes3);
}
}, "makeCustomSizedDelim");
makeLeftRightDelim = /* @__PURE__ */ __name(function makeLeftRightDelim2(delim, height2, depth, options2, mode, classes3) {
var axisHeight = options2.fontMetrics().axisHeight * options2.sizeMultiplier;
var delimiterFactor = 901;
var delimiterExtend = 5 / options2.fontMetrics().ptPerEm;
var maxDistFromAxis = Math.max(height2 - axisHeight, depth + axisHeight);
var totalHeight = Math.max(
// In real TeX, calculations are done using integral values which are
// 65536 per pt, or 655360 per em. So, the division here truncates in
// TeX but doesn't here, producing different results. If we wanted to
// exactly match TeX's calculation, we could do
// Math.floor(655360 * maxDistFromAxis / 500) *
// delimiterFactor / 655360
// (To see the difference, compare
// x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
// in TeX and KaTeX)
maxDistFromAxis / 500 * delimiterFactor,
2 * maxDistFromAxis - delimiterExtend
);
return makeCustomSizedDelim(delim, totalHeight, true, options2, mode, classes3);
}, "makeLeftRightDelim");
delimiter = {
sqrtImage: makeSqrtImage,
sizedDelim: makeSizedDelim,
sizeToMaxHeight,
customSizedDelim: makeCustomSizedDelim,
leftRightDelim: makeLeftRightDelim
};
delimiterSizes = {
"\\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
}
};
delimiters = ["(", "\\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", "."];
__name(checkDelimiter, "checkDelimiter");
defineFunction({
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: /* @__PURE__ */ __name((context, args) => {
var delim = checkDelimiter(args[0], context);
return {
type: "delimsizing",
mode: context.parser.mode,
size: delimiterSizes[context.funcName].size,
mclass: delimiterSizes[context.funcName].mclass,
delim: delim.text
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
if (group2.delim === ".") {
return buildCommon.makeSpan([group2.mclass]);
}
return delimiter.sizedDelim(group2.delim, group2.size, options2, group2.mode, [group2.mclass]);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2) => {
var children2 = [];
if (group2.delim !== ".") {
children2.push(makeText(group2.delim, group2.mode));
}
var node2 = new mathMLTree.MathNode("mo", children2);
if (group2.mclass === "mopen" || group2.mclass === "mclose") {
node2.setAttribute("fence", "true");
} else {
node2.setAttribute("fence", "false");
}
node2.setAttribute("stretchy", "true");
var size4 = makeEm(delimiter.sizeToMaxHeight[group2.size]);
node2.setAttribute("minsize", size4);
node2.setAttribute("maxsize", size4);
return node2;
}, "mathmlBuilder")
});
__name(assertParsed, "assertParsed");
defineFunction({
type: "leftright-right",
names: ["\\right"],
props: {
numArgs: 1,
primitive: true
},
handler: /* @__PURE__ */ __name((context, args) => {
var color2 = context.parser.gullet.macros.get("\\current@color");
if (color2 && typeof color2 !== "string") {
throw new ParseError("\\current@color set to non-string in \\right");
}
return {
type: "leftright-right",
mode: context.parser.mode,
delim: checkDelimiter(args[0], context).text,
color: color2
// undefined if not set via \color
};
}, "handler")
});
defineFunction({
type: "leftright",
names: ["\\left"],
props: {
numArgs: 1,
primitive: true
},
handler: /* @__PURE__ */ __name((context, args) => {
var delim = checkDelimiter(args[0], context);
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: parser24.mode,
body,
left: delim.text,
right: right3.delim,
rightColor: right3.color
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
assertParsed(group2);
var inner2 = buildExpression$1(group2.body, options2, true, ["mopen", "mclose"]);
var innerHeight = 0;
var innerDepth = 0;
var hadMiddle = false;
for (var i2 = 0; i2 < inner2.length; i2++) {
if (inner2[i2].isMiddle) {
hadMiddle = true;
} else {
innerHeight = Math.max(inner2[i2].height, innerHeight);
innerDepth = Math.max(inner2[i2].depth, innerDepth);
}
}
innerHeight *= options2.sizeMultiplier;
innerDepth *= options2.sizeMultiplier;
var leftDelim;
if (group2.left === ".") {
leftDelim = makeNullDelimiter(options2, ["mopen"]);
} else {
leftDelim = delimiter.leftRightDelim(group2.left, innerHeight, innerDepth, options2, group2.mode, ["mopen"]);
}
inner2.unshift(leftDelim);
if (hadMiddle) {
for (var _i = 1; _i < inner2.length; _i++) {
var middleDelim = inner2[_i];
var isMiddle = middleDelim.isMiddle;
if (isMiddle) {
inner2[_i] = delimiter.leftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group2.mode, []);
}
}
}
var rightDelim;
if (group2.right === ".") {
rightDelim = makeNullDelimiter(options2, ["mclose"]);
} else {
var colorOptions = group2.rightColor ? options2.withColor(group2.rightColor) : options2;
rightDelim = delimiter.leftRightDelim(group2.right, innerHeight, innerDepth, colorOptions, group2.mode, ["mclose"]);
}
inner2.push(rightDelim);
return buildCommon.makeSpan(["minner"], inner2, options2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
assertParsed(group2);
var inner2 = buildExpression2(group2.body, options2);
if (group2.left !== ".") {
var leftNode = new mathMLTree.MathNode("mo", [makeText(group2.left, group2.mode)]);
leftNode.setAttribute("fence", "true");
inner2.unshift(leftNode);
}
if (group2.right !== ".") {
var rightNode = new mathMLTree.MathNode("mo", [makeText(group2.right, group2.mode)]);
rightNode.setAttribute("fence", "true");
if (group2.rightColor) {
rightNode.setAttribute("mathcolor", group2.rightColor);
}
inner2.push(rightNode);
}
return makeRow(inner2);
}, "mathmlBuilder")
});
defineFunction({
type: "middle",
names: ["\\middle"],
props: {
numArgs: 1,
primitive: true
},
handler: /* @__PURE__ */ __name((context, args) => {
var delim = checkDelimiter(args[0], context);
if (!context.parser.leftrightDepth) {
throw new ParseError("\\middle without preceding \\left", delim);
}
return {
type: "middle",
mode: context.parser.mode,
delim: delim.text
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var middleDelim;
if (group2.delim === ".") {
middleDelim = makeNullDelimiter(options2, []);
} else {
middleDelim = delimiter.sizedDelim(group2.delim, 1, options2, group2.mode, []);
var isMiddle = {
delim: group2.delim,
options: options2
};
middleDelim.isMiddle = isMiddle;
}
return middleDelim;
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var textNode = group2.delim === "\\vert" || group2.delim === "|" ? makeText("|", "text") : makeText(group2.delim, group2.mode);
var middleNode = new mathMLTree.MathNode("mo", [textNode]);
middleNode.setAttribute("fence", "true");
middleNode.setAttribute("lspace", "0.05em");
middleNode.setAttribute("rspace", "0.05em");
return middleNode;
}, "mathmlBuilder")
});
htmlBuilder$7 = /* @__PURE__ */ __name((group2, options2) => {
var inner2 = buildCommon.wrapFragment(buildGroup$1(group2.body, options2), options2);
var label = group2.label.slice(1);
var scale2 = options2.sizeMultiplier;
var img;
var imgShift = 0;
var isSingleChar = utils.isCharacterBox(group2.body);
if (label === "sout") {
img = buildCommon.makeSpan(["stretchy", "sout"]);
img.height = options2.fontMetrics().defaultRuleThickness / scale2;
imgShift = -0.5 * options2.fontMetrics().xHeight;
} else if (label === "phase") {
var lineWeight = calculateSize2({
number: 0.6,
unit: "pt"
}, options2);
var clearance = calculateSize2({
number: 0.35,
unit: "ex"
}, options2);
var newOptions = options2.havingBaseSizing();
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 * scale2);
var path4 = phasePath(viewBoxHeight);
var svgNode2 = new SvgNode([new PathNode("phase", path4)], {
"width": "400em",
"height": makeEm(viewBoxHeight / 1e3),
"viewBox": "0 0 400000 " + viewBoxHeight,
"preserveAspectRatio": "xMinYMin slice"
});
img = buildCommon.makeSvgSpan(["hide-tail"], [svgNode2], options2);
img.style.height = makeEm(angleHeight);
imgShift = inner2.depth + lineWeight + clearance;
} else {
if (/cancel/.test(label)) {
if (!isSingleChar) {
inner2.classes.push("cancel-pad");
}
} else if (label === "angl") {
inner2.classes.push("anglpad");
} else {
inner2.classes.push("boxpad");
}
var topPad = 0;
var bottomPad = 0;
var ruleThickness = 0;
if (/box/.test(label)) {
ruleThickness = Math.max(
options2.fontMetrics().fboxrule,
// default
options2.minRuleThickness
// User override.
);
topPad = options2.fontMetrics().fboxsep + (label === "colorbox" ? 0 : ruleThickness);
bottomPad = topPad;
} else if (label === "angl") {
ruleThickness = Math.max(options2.fontMetrics().defaultRuleThickness, options2.minRuleThickness);
topPad = 4 * ruleThickness;
bottomPad = Math.max(0, 0.25 - inner2.depth);
} else {
topPad = isSingleChar ? 0.2 : 0;
bottomPad = topPad;
}
img = stretchy.encloseSpan(inner2, label, topPad, bottomPad, options2);
if (/fbox|boxed|fcolorbox/.test(label)) {
img.style.borderStyle = "solid";
img.style.borderWidth = makeEm(ruleThickness);
} else if (label === "angl" && ruleThickness !== 0.049) {
img.style.borderTopWidth = makeEm(ruleThickness);
img.style.borderRightWidth = makeEm(ruleThickness);
}
imgShift = inner2.depth + bottomPad;
if (group2.backgroundColor) {
img.style.backgroundColor = group2.backgroundColor;
if (group2.borderColor) {
img.style.borderColor = group2.borderColor;
}
}
}
var vlist;
if (group2.backgroundColor) {
vlist = buildCommon.makeVList({
positionType: "individualShift",
children: [
// Put the color background behind inner;
{
type: "elem",
elem: img,
shift: imgShift
},
{
type: "elem",
elem: inner2,
shift: 0
}
]
}, options2);
} else {
var classes3 = /cancel|phase/.test(label) ? ["svg-align"] : [];
vlist = buildCommon.makeVList({
positionType: "individualShift",
children: [
// Write the \cancel stroke on top of inner.
{
type: "elem",
elem: inner2,
shift: 0
},
{
type: "elem",
elem: img,
shift: imgShift,
wrapperClasses: classes3
}
]
}, options2);
}
if (/cancel/.test(label)) {
vlist.height = inner2.height;
vlist.depth = inner2.depth;
}
if (/cancel/.test(label) && !isSingleChar) {
return buildCommon.makeSpan(["mord", "cancel-lap"], [vlist], options2);
} else {
return buildCommon.makeSpan(["mord"], [vlist], options2);
}
}, "htmlBuilder$7");
mathmlBuilder$6 = /* @__PURE__ */ __name((group2, options2) => {
var fboxsep = 0;
var node2 = new mathMLTree.MathNode(group2.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildGroup2(group2.body, options2)]);
switch (group2.label) {
case "\\cancel":
node2.setAttribute("notation", "updiagonalstrike");
break;
case "\\bcancel":
node2.setAttribute("notation", "downdiagonalstrike");
break;
case "\\phase":
node2.setAttribute("notation", "phasorangle");
break;
case "\\sout":
node2.setAttribute("notation", "horizontalstrike");
break;
case "\\fbox":
node2.setAttribute("notation", "box");
break;
case "\\angl":
node2.setAttribute("notation", "actuarial");
break;
case "\\fcolorbox":
case "\\colorbox":
fboxsep = options2.fontMetrics().fboxsep * options2.fontMetrics().ptPerEm;
node2.setAttribute("width", "+" + 2 * fboxsep + "pt");
node2.setAttribute("height", "+" + 2 * fboxsep + "pt");
node2.setAttribute("lspace", fboxsep + "pt");
node2.setAttribute("voffset", fboxsep + "pt");
if (group2.label === "\\fcolorbox") {
var thk = Math.max(
options2.fontMetrics().fboxrule,
// default
options2.minRuleThickness
// user override
);
node2.setAttribute("style", "border: " + thk + "em solid " + String(group2.borderColor));
}
break;
case "\\xcancel":
node2.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
break;
}
if (group2.backgroundColor) {
node2.setAttribute("mathbackground", group2.backgroundColor);
}
return node2;
}, "mathmlBuilder$6");
defineFunction({
type: "enclose",
names: ["\\colorbox"],
props: {
numArgs: 2,
allowedInText: true,
argTypes: ["color", "text"]
},
handler(_ref, args, optArgs) {
var {
parser: parser24,
funcName
} = _ref;
var color2 = assertNodeType(args[0], "color-token").color;
var body = args[1];
return {
type: "enclose",
mode: parser24.mode,
label: funcName,
backgroundColor: color2,
body
};
},
htmlBuilder: htmlBuilder$7,
mathmlBuilder: mathmlBuilder$6
});
defineFunction({
type: "enclose",
names: ["\\fcolorbox"],
props: {
numArgs: 3,
allowedInText: true,
argTypes: ["color", "color", "text"]
},
handler(_ref2, args, optArgs) {
var {
parser: parser24,
funcName
} = _ref2;
var borderColor = assertNodeType(args[0], "color-token").color;
var backgroundColor = assertNodeType(args[1], "color-token").color;
var body = args[2];
return {
type: "enclose",
mode: parser24.mode,
label: funcName,
backgroundColor,
borderColor,
body
};
},
htmlBuilder: htmlBuilder$7,
mathmlBuilder: mathmlBuilder$6
});
defineFunction({
type: "enclose",
names: ["\\fbox"],
props: {
numArgs: 1,
argTypes: ["hbox"],
allowedInText: true
},
handler(_ref3, args) {
var {
parser: parser24
} = _ref3;
return {
type: "enclose",
mode: parser24.mode,
label: "\\fbox",
body: args[0]
};
}
});
defineFunction({
type: "enclose",
names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"],
props: {
numArgs: 1
},
handler(_ref4, args) {
var {
parser: parser24,
funcName
} = _ref4;
var body = args[0];
return {
type: "enclose",
mode: parser24.mode,
label: funcName,
body
};
},
htmlBuilder: htmlBuilder$7,
mathmlBuilder: mathmlBuilder$6
});
defineFunction({
type: "enclose",
names: ["\\angl"],
props: {
numArgs: 1,
argTypes: ["hbox"],
allowedInText: false
},
handler(_ref5, args) {
var {
parser: parser24
} = _ref5;
return {
type: "enclose",
mode: parser24.mode,
label: "\\angl",
body: args[0]
};
}
});
_environments = {};
__name(defineEnvironment, "defineEnvironment");
_macros = {};
__name(defineMacro, "defineMacro");
__name(getHLines, "getHLines");
validateAmsEnvironmentContext = /* @__PURE__ */ __name((context) => {
var settings = context.parser.settings;
if (!settings.displayMode) {
throw new ParseError("{" + context.envName + "} can be used only in display mode.");
}
}, "validateAmsEnvironmentContext");
__name(getAutoTag, "getAutoTag");
__name(parseArray, "parseArray");
__name(dCellStyle, "dCellStyle");
htmlBuilder$6 = /* @__PURE__ */ __name(function htmlBuilder(group2, options2) {
var r2;
var c3;
var nr = group2.body.length;
var hLinesBeforeRow = group2.hLinesBeforeRow;
var nc = 0;
var body = new Array(nr);
var hlines = [];
var ruleThickness = Math.max(
// From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
options2.fontMetrics().arrayRuleWidth,
options2.minRuleThickness
// User override.
);
var pt = 1 / options2.fontMetrics().ptPerEm;
var arraycolsep = 5 * pt;
if (group2.colSeparationType && group2.colSeparationType === "small") {
var localMultiplier = options2.havingStyle(Style$1.SCRIPT).sizeMultiplier;
arraycolsep = 0.2778 * (localMultiplier / options2.sizeMultiplier);
}
var baselineskip = group2.colSeparationType === "CD" ? calculateSize2({
number: 3,
unit: "ex"
}, options2) : 12 * pt;
var jot = 3 * pt;
var arrayskip = group2.arraystretch * baselineskip;
var arstrutHeight = 0.7 * arrayskip;
var arstrutDepth = 0.3 * arrayskip;
var totalHeight = 0;
function setHLinePos(hlinesInGap) {
for (var i2 = 0; i2 < hlinesInGap.length; ++i2) {
if (i2 > 0) {
totalHeight += 0.25;
}
hlines.push({
pos: totalHeight,
isDashed: hlinesInGap[i2]
});
}
}
__name(setHLinePos, "setHLinePos");
setHLinePos(hLinesBeforeRow[0]);
for (r2 = 0; r2 < group2.body.length; ++r2) {
var inrow = group2.body[r2];
var height2 = arstrutHeight;
var depth = arstrutDepth;
if (nc < inrow.length) {
nc = inrow.length;
}
var outrow = new Array(inrow.length);
for (c3 = 0; c3 < inrow.length; ++c3) {
var elt = buildGroup$1(inrow[c3], options2);
if (depth < elt.depth) {
depth = elt.depth;
}
if (height2 < elt.height) {
height2 = elt.height;
}
outrow[c3] = elt;
}
var rowGap = group2.rowGaps[r2];
var gap = 0;
if (rowGap) {
gap = calculateSize2(rowGap, options2);
if (gap > 0) {
gap += arstrutDepth;
if (depth < gap) {
depth = gap;
}
gap = 0;
}
}
if (group2.addJot) {
depth += jot;
}
outrow.height = height2;
outrow.depth = depth;
totalHeight += height2;
outrow.pos = totalHeight;
totalHeight += depth + gap;
body[r2] = outrow;
setHLinePos(hLinesBeforeRow[r2 + 1]);
}
var offset = totalHeight / 2 + options2.fontMetrics().axisHeight;
var colDescriptions = group2.cols || [];
var cols = [];
var colSep;
var colDescrNum;
var tagSpans = [];
if (group2.tags && group2.tags.some((tag2) => tag2)) {
for (r2 = 0; r2 < nr; ++r2) {
var rw = body[r2];
var shift2 = rw.pos - offset;
var tag = group2.tags[r2];
var tagSpan = void 0;
if (tag === true) {
tagSpan = buildCommon.makeSpan(["eqn-num"], [], options2);
} else if (tag === false) {
tagSpan = buildCommon.makeSpan([], [], options2);
} else {
tagSpan = buildCommon.makeSpan([], buildExpression$1(tag, options2, true), options2);
}
tagSpan.depth = rw.depth;
tagSpan.height = rw.height;
tagSpans.push({
type: "elem",
elem: tagSpan,
shift: shift2
});
}
}
for (
c3 = 0, colDescrNum = 0;
// Continue while either there are more columns or more column
// descriptions, so trailing separators don't get lost.
c3 < nc || colDescrNum < colDescriptions.length;
++c3, ++colDescrNum
) {
var colDescr = colDescriptions[colDescrNum] || {};
var firstSeparator = true;
while (colDescr.type === "separator") {
if (!firstSeparator) {
colSep = buildCommon.makeSpan(["arraycolsep"], []);
colSep.style.width = makeEm(options2.fontMetrics().doubleRuleSep);
cols.push(colSep);
}
if (colDescr.separator === "|" || colDescr.separator === ":") {
var lineType = colDescr.separator === "|" ? "solid" : "dashed";
var separator = buildCommon.makeSpan(["vertical-separator"], [], options2);
separator.style.height = makeEm(totalHeight);
separator.style.borderRightWidth = makeEm(ruleThickness);
separator.style.borderRightStyle = lineType;
separator.style.margin = "0 " + makeEm(-ruleThickness / 2);
var _shift = totalHeight - offset;
if (_shift) {
separator.style.verticalAlign = makeEm(-_shift);
}
cols.push(separator);
} else {
throw new ParseError("Invalid separator type: " + colDescr.separator);
}
colDescrNum++;
colDescr = colDescriptions[colDescrNum] || {};
firstSeparator = false;
}
if (c3 >= nc) {
continue;
}
var sepwidth = void 0;
if (c3 > 0 || group2.hskipBeforeAndAfter) {
sepwidth = utils.deflt(colDescr.pregap, arraycolsep);
if (sepwidth !== 0) {
colSep = buildCommon.makeSpan(["arraycolsep"], []);
colSep.style.width = makeEm(sepwidth);
cols.push(colSep);
}
}
var col = [];
for (r2 = 0; r2 < nr; ++r2) {
var row = body[r2];
var elem = row[c3];
if (!elem) {
continue;
}
var _shift2 = row.pos - offset;
elem.depth = row.depth;
elem.height = row.height;
col.push({
type: "elem",
elem,
shift: _shift2
});
}
col = buildCommon.makeVList({
positionType: "individualShift",
children: col
}, options2);
col = buildCommon.makeSpan(["col-align-" + (colDescr.align || "c")], [col]);
cols.push(col);
if (c3 < nc - 1 || group2.hskipBeforeAndAfter) {
sepwidth = utils.deflt(colDescr.postgap, arraycolsep);
if (sepwidth !== 0) {
colSep = buildCommon.makeSpan(["arraycolsep"], []);
colSep.style.width = makeEm(sepwidth);
cols.push(colSep);
}
}
}
body = buildCommon.makeSpan(["mtable"], cols);
if (hlines.length > 0) {
var line2 = buildCommon.makeLineSpan("hline", options2, ruleThickness);
var dashes = buildCommon.makeLineSpan("hdashline", options2, ruleThickness);
var vListElems = [{
type: "elem",
elem: body,
shift: 0
}];
while (hlines.length > 0) {
var hline = hlines.pop();
var lineShift = hline.pos - offset;
if (hline.isDashed) {
vListElems.push({
type: "elem",
elem: dashes,
shift: lineShift
});
} else {
vListElems.push({
type: "elem",
elem: line2,
shift: lineShift
});
}
}
body = buildCommon.makeVList({
positionType: "individualShift",
children: vListElems
}, options2);
}
if (tagSpans.length === 0) {
return buildCommon.makeSpan(["mord"], [body], options2);
} else {
var eqnNumCol = buildCommon.makeVList({
positionType: "individualShift",
children: tagSpans
}, options2);
eqnNumCol = buildCommon.makeSpan(["tag"], [eqnNumCol], options2);
return buildCommon.makeFragment([body, eqnNumCol]);
}
}, "htmlBuilder");
alignMap = {
c: "center ",
l: "left ",
r: "right "
};
mathmlBuilder$5 = /* @__PURE__ */ __name(function mathmlBuilder(group2, options2) {
var tbl = [];
var glue = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]);
var tag = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]);
for (var i2 = 0; i2 < group2.body.length; i2++) {
var rw = group2.body[i2];
var row = [];
for (var j3 = 0; j3 < rw.length; j3++) {
row.push(new mathMLTree.MathNode("mtd", [buildGroup2(rw[j3], options2)]));
}
if (group2.tags && group2.tags[i2]) {
row.unshift(glue);
row.push(glue);
if (group2.leqno) {
row.unshift(tag);
} else {
row.push(tag);
}
}
tbl.push(new mathMLTree.MathNode("mtr", row));
}
var table = new mathMLTree.MathNode("mtable", tbl);
var gap = group2.arraystretch === 0.5 ? 0.1 : 0.16 + group2.arraystretch - 1 + (group2.addJot ? 0.09 : 0);
table.setAttribute("rowspacing", makeEm(gap));
var menclose = "";
var align = "";
if (group2.cols && group2.cols.length > 0) {
var cols = group2.cols;
var columnLines = "";
var prevTypeWasAlign = false;
var iStart = 0;
var iEnd = cols.length;
if (cols[0].type === "separator") {
menclose += "top ";
iStart = 1;
}
if (cols[cols.length - 1].type === "separator") {
menclose += "bottom ";
iEnd -= 1;
}
for (var _i = iStart; _i < iEnd; _i++) {
if (cols[_i].type === "align") {
align += alignMap[cols[_i].align];
if (prevTypeWasAlign) {
columnLines += "none ";
}
prevTypeWasAlign = true;
} else if (cols[_i].type === "separator") {
if (prevTypeWasAlign) {
columnLines += cols[_i].separator === "|" ? "solid " : "dashed ";
prevTypeWasAlign = false;
}
}
}
table.setAttribute("columnalign", align.trim());
if (/[sd]/.test(columnLines)) {
table.setAttribute("columnlines", columnLines.trim());
}
}
if (group2.colSeparationType === "align") {
var _cols = group2.cols || [];
var spacing2 = "";
for (var _i2 = 1; _i2 < _cols.length; _i2++) {
spacing2 += _i2 % 2 ? "0em " : "1em ";
}
table.setAttribute("columnspacing", spacing2.trim());
} else if (group2.colSeparationType === "alignat" || group2.colSeparationType === "gather") {
table.setAttribute("columnspacing", "0em");
} else if (group2.colSeparationType === "small") {
table.setAttribute("columnspacing", "0.2778em");
} else if (group2.colSeparationType === "CD") {
table.setAttribute("columnspacing", "0.5em");
} else {
table.setAttribute("columnspacing", "1em");
}
var rowLines = "";
var hlines = group2.hLinesBeforeRow;
menclose += hlines[0].length > 0 ? "left " : "";
menclose += hlines[hlines.length - 1].length > 0 ? "right " : "";
for (var _i3 = 1; _i3 < hlines.length - 1; _i3++) {
rowLines += hlines[_i3].length === 0 ? "none " : hlines[_i3][0] ? "dashed " : "solid ";
}
if (/[sd]/.test(rowLines)) {
table.setAttribute("rowlines", rowLines.trim());
}
if (menclose !== "") {
table = new mathMLTree.MathNode("menclose", [table]);
table.setAttribute("notation", menclose.trim());
}
if (group2.arraystretch && group2.arraystretch < 1) {
table = new mathMLTree.MathNode("mstyle", [table]);
table.setAttribute("scriptlevel", "1");
}
return table;
}, "mathmlBuilder");
alignedHandler = /* @__PURE__ */ __name(function alignedHandler2(context, args) {
if (context.envName.indexOf("ed") === -1) {
validateAmsEnvironmentContext(context);
}
var cols = [];
var separationType = context.envName.indexOf("at") > -1 ? "alignat" : "align";
var isSplit = context.envName === "split";
var res = parseArray(context.parser, {
cols,
addJot: true,
autoTag: isSplit ? void 0 : getAutoTag(context.envName),
emptySingleRow: true,
colSeparationType: separationType,
maxNumCols: isSplit ? 2 : void 0,
leqno: context.parser.settings.leqno
}, "display");
var numMaths;
var numCols = 0;
var emptyGroup = {
type: "ordgroup",
mode: context.mode,
body: []
};
if (args[0] && args[0].type === "ordgroup") {
var arg0 = "";
for (var i2 = 0; i2 < args[0].body.length; i2++) {
var textord2 = assertNodeType(args[0].body[i2], "textord");
arg0 += textord2.text;
}
numMaths = Number(arg0);
numCols = numMaths * 2;
}
var isAligned = !numCols;
res.body.forEach(function(row) {
for (var _i4 = 1; _i4 < row.length; _i4 += 2) {
var styling = assertNodeType(row[_i4], "styling");
var ordgroup = assertNodeType(styling.body[0], "ordgroup");
ordgroup.body.unshift(emptyGroup);
}
if (!isAligned) {
var curMaths = row.length / 2;
if (numMaths < curMaths) {
throw new ParseError("Too many math in a row: " + ("expected " + numMaths + ", but got " + curMaths), row[0]);
}
} else if (numCols < row.length) {
numCols = row.length;
}
});
for (var _i5 = 0; _i5 < numCols; ++_i5) {
var align = "r";
var pregap = 0;
if (_i5 % 2 === 1) {
align = "l";
} else if (_i5 > 0 && isAligned) {
pregap = 1;
}
cols[_i5] = {
type: "align",
align,
pregap,
postgap: 0
};
}
res.colSeparationType = isAligned ? "align" : "alignat";
return res;
}, "alignedHandler");
defineEnvironment({
type: "array",
names: ["array", "darray"],
props: {
numArgs: 1
},
handler(context, args) {
var symNode = checkSymbolNodeType(args[0]);
var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
var cols = colalign.map(function(nde) {
var node2 = assertSymbolNodeType(nde);
var ca = node2.text;
if ("lcr".indexOf(ca) !== -1) {
return {
type: "align",
align: ca
};
} else if (ca === "|") {
return {
type: "separator",
separator: "|"
};
} else if (ca === ":") {
return {
type: "separator",
separator: ":"
};
}
throw new ParseError("Unknown column alignment: " + ca, nde);
});
var res = {
cols,
hskipBeforeAndAfter: true,
// \@preamble in lttab.dtx
maxNumCols: cols.length
};
return parseArray(context.parser, res, dCellStyle(context.envName));
},
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
props: {
numArgs: 0
},
handler(context) {
var delimiters2 = {
"matrix": null,
"pmatrix": ["(", ")"],
"bmatrix": ["[", "]"],
"Bmatrix": ["\\{", "\\}"],
"vmatrix": ["|", "|"],
"Vmatrix": ["\\Vert", "\\Vert"]
}[context.envName.replace("*", "")];
var colAlign = "c";
var payload = {
hskipBeforeAndAfter: false,
cols: [{
type: "align",
align: colAlign
}]
};
if (context.envName.charAt(context.envName.length - 1) === "*") {
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", parser24.nextToken);
}
parser24.consume();
parser24.consumeSpaces();
parser24.expect("]");
parser24.consume();
payload.cols = [{
type: "align",
align: colAlign
}];
}
}
var res = parseArray(context.parser, payload, dCellStyle(context.envName));
var numCols = Math.max(0, ...res.body.map((row) => row.length));
res.cols = new Array(numCols).fill({
type: "align",
align: colAlign
});
return delimiters2 ? {
type: "leftright",
mode: context.mode,
body: [res],
left: delimiters2[0],
right: delimiters2[1],
rightColor: void 0
// \right uninfluenced by \color in array
} : res;
},
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["smallmatrix"],
props: {
numArgs: 0
},
handler(context) {
var payload = {
arraystretch: 0.5
};
var res = parseArray(context.parser, payload, "script");
res.colSeparationType = "small";
return res;
},
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["subarray"],
props: {
numArgs: 1
},
handler(context, args) {
var symNode = checkSymbolNodeType(args[0]);
var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
var cols = colalign.map(function(nde) {
var node2 = assertSymbolNodeType(nde);
var ca = node2.text;
if ("lc".indexOf(ca) !== -1) {
return {
type: "align",
align: ca
};
}
throw new ParseError("Unknown column alignment: " + ca, nde);
});
if (cols.length > 1) {
throw new ParseError("{subarray} can contain only one column");
}
var res = {
cols,
hskipBeforeAndAfter: false,
arraystretch: 0.5
};
res = parseArray(context.parser, res, "script");
if (res.body.length > 0 && res.body[0].length > 1) {
throw new ParseError("{subarray} can contain only one column");
}
return res;
},
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["cases", "dcases", "rcases", "drcases"],
props: {
numArgs: 0
},
handler(context) {
var payload = {
arraystretch: 1.2,
cols: [{
type: "align",
align: "l",
pregap: 0,
// TODO(kevinb) get the current style.
// For now we use the metrics for TEXT style which is what we were
// doing before. Before attempting to get the current style we
// should look at TeX's behavior especially for \over and matrices.
postgap: 1
/* 1em quad */
}, {
type: "align",
align: "l",
pregap: 0,
postgap: 0
}]
};
var res = parseArray(context.parser, payload, dCellStyle(context.envName));
return {
type: "leftright",
mode: context.mode,
body: [res],
left: context.envName.indexOf("r") > -1 ? "." : "\\{",
right: context.envName.indexOf("r") > -1 ? "\\}" : ".",
rightColor: void 0
};
},
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["align", "align*", "aligned", "split"],
props: {
numArgs: 0
},
handler: alignedHandler,
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["gathered", "gather", "gather*"],
props: {
numArgs: 0
},
handler(context) {
if (utils.contains(["gather", "gather*"], context.envName)) {
validateAmsEnvironmentContext(context);
}
var res = {
cols: [{
type: "align",
align: "c"
}],
addJot: true,
colSeparationType: "gather",
autoTag: getAutoTag(context.envName),
emptySingleRow: true,
leqno: context.parser.settings.leqno
};
return parseArray(context.parser, res, "display");
},
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["alignat", "alignat*", "alignedat"],
props: {
numArgs: 1
},
handler: alignedHandler,
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["equation", "equation*"],
props: {
numArgs: 0
},
handler(context) {
validateAmsEnvironmentContext(context);
var res = {
autoTag: getAutoTag(context.envName),
emptySingleRow: true,
singleRow: true,
maxNumCols: 1,
leqno: context.parser.settings.leqno
};
return parseArray(context.parser, res, "display");
},
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
type: "array",
names: ["CD"],
props: {
numArgs: 0
},
handler(context) {
validateAmsEnvironmentContext(context);
return parseCD(context.parser);
},
htmlBuilder: htmlBuilder$6,
mathmlBuilder: mathmlBuilder$5
});
defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}");
defineMacro("\\notag", "\\nonumber");
defineFunction({
type: "text",
// Doesn't matter what this is.
names: ["\\hline", "\\hdashline"],
props: {
numArgs: 0,
allowedInText: true,
allowedInMath: true
},
handler(context, args) {
throw new ParseError(context.funcName + " valid only within array environment");
}
});
environments = _environments;
defineFunction({
type: "environment",
names: ["\\begin", "\\end"],
props: {
numArgs: 1,
argTypes: ["text"]
},
handler(_ref, args) {
var {
parser: parser24,
funcName
} = _ref;
var nameGroup = args[0];
if (nameGroup.type !== "ordgroup") {
throw new ParseError("Invalid environment name", nameGroup);
}
var envName = "";
for (var i2 = 0; i2 < nameGroup.body.length; ++i2) {
envName += assertNodeType(nameGroup.body[i2], "textord").text;
}
if (funcName === "\\begin") {
if (!environments.hasOwnProperty(envName)) {
throw new ParseError("No such environment: " + envName, nameGroup);
}
var env = environments[envName];
var {
args: _args,
optArgs
} = parser24.parseArguments("\\begin{" + envName + "}", env);
var context = {
mode: parser24.mode,
envName,
parser: parser24
};
var result = env.handler(context, _args, optArgs);
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);
}
return result;
}
return {
type: "environment",
mode: parser24.mode,
name: envName,
nameGroup
};
}
});
htmlBuilder$5 = /* @__PURE__ */ __name((group2, options2) => {
var font = group2.font;
var newOptions = options2.withFont(font);
return buildGroup$1(group2.body, newOptions);
}, "htmlBuilder$5");
mathmlBuilder$4 = /* @__PURE__ */ __name((group2, options2) => {
var font = group2.font;
var newOptions = options2.withFont(font);
return buildGroup2(group2.body, newOptions);
}, "mathmlBuilder$4");
fontAliases = {
"\\Bbb": "\\mathbb",
"\\bold": "\\mathbf",
"\\frak": "\\mathfrak",
"\\bm": "\\boldsymbol"
};
defineFunction({
type: "font",
names: [
// styles, except \boldsymbol defined below
"\\mathrm",
"\\mathit",
"\\mathbf",
"\\mathnormal",
"\\mathsfit",
// families
"\\mathbb",
"\\mathcal",
"\\mathfrak",
"\\mathscr",
"\\mathsf",
"\\mathtt",
// aliases, except \bm defined below
"\\Bbb",
"\\bold",
"\\frak"
],
props: {
numArgs: 1,
allowedInArgument: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24,
funcName
} = _ref;
var body = normalizeArgument(args[0]);
var func = funcName;
if (func in fontAliases) {
func = fontAliases[func];
}
return {
type: "font",
mode: parser24.mode,
font: func.slice(1),
body
};
}, "handler"),
htmlBuilder: htmlBuilder$5,
mathmlBuilder: mathmlBuilder$4
});
defineFunction({
type: "mclass",
names: ["\\boldsymbol", "\\bm"],
props: {
numArgs: 1
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
parser: parser24
} = _ref2;
var body = args[0];
var isCharacterBox3 = utils.isCharacterBox(body);
return {
type: "mclass",
mode: parser24.mode,
mclass: binrelClass(body),
body: [{
type: "font",
mode: parser24.mode,
font: "boldsymbol",
body
}],
isCharacterBox: isCharacterBox3
};
}, "handler")
});
defineFunction({
type: "font",
names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
props: {
numArgs: 0,
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref3, args) => {
var {
parser: parser24,
funcName,
breakOnTokenText
} = _ref3;
var {
mode
} = parser24;
var body = parser24.parseExpression(true, breakOnTokenText);
var style3 = "math" + funcName.slice(1);
return {
type: "font",
mode,
font: style3,
body: {
type: "ordgroup",
mode: parser24.mode,
body
}
};
}, "handler"),
htmlBuilder: htmlBuilder$5,
mathmlBuilder: mathmlBuilder$4
});
adjustStyle = /* @__PURE__ */ __name((size4, originalStyle) => {
var style3 = originalStyle;
if (size4 === "display") {
style3 = style3.id >= Style$1.SCRIPT.id ? style3.text() : Style$1.DISPLAY;
} else if (size4 === "text" && style3.size === Style$1.DISPLAY.size) {
style3 = Style$1.TEXT;
} else if (size4 === "script") {
style3 = Style$1.SCRIPT;
} else if (size4 === "scriptscript") {
style3 = Style$1.SCRIPTSCRIPT;
}
return style3;
}, "adjustStyle");
htmlBuilder$4 = /* @__PURE__ */ __name((group2, options2) => {
var style3 = adjustStyle(group2.size, options2.style);
var nstyle = style3.fracNum();
var dstyle = style3.fracDen();
var newOptions;
newOptions = options2.havingStyle(nstyle);
var numerm = buildGroup$1(group2.numer, newOptions, options2);
if (group2.continued) {
var hStrut = 8.5 / options2.fontMetrics().ptPerEm;
var dStrut = 3.5 / options2.fontMetrics().ptPerEm;
numerm.height = numerm.height < hStrut ? hStrut : numerm.height;
numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth;
}
newOptions = options2.havingStyle(dstyle);
var denomm = buildGroup$1(group2.denom, newOptions, options2);
var rule;
var ruleWidth;
var ruleSpacing;
if (group2.hasBarLine) {
if (group2.barSize) {
ruleWidth = calculateSize2(group2.barSize, options2);
rule = buildCommon.makeLineSpan("frac-line", options2, ruleWidth);
} else {
rule = buildCommon.makeLineSpan("frac-line", options2);
}
ruleWidth = rule.height;
ruleSpacing = rule.height;
} else {
rule = null;
ruleWidth = 0;
ruleSpacing = options2.fontMetrics().defaultRuleThickness;
}
var numShift;
var clearance;
var denomShift;
if (style3.size === Style$1.DISPLAY.size || group2.size === "display") {
numShift = options2.fontMetrics().num1;
if (ruleWidth > 0) {
clearance = 3 * ruleSpacing;
} else {
clearance = 7 * ruleSpacing;
}
denomShift = options2.fontMetrics().denom1;
} else {
if (ruleWidth > 0) {
numShift = options2.fontMetrics().num2;
clearance = ruleSpacing;
} else {
numShift = options2.fontMetrics().num3;
clearance = 3 * ruleSpacing;
}
denomShift = options2.fontMetrics().denom2;
}
var frac;
if (!rule) {
var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift);
if (candidateClearance < clearance) {
numShift += 0.5 * (clearance - candidateClearance);
denomShift += 0.5 * (clearance - candidateClearance);
}
frac = buildCommon.makeVList({
positionType: "individualShift",
children: [{
type: "elem",
elem: denomm,
shift: denomShift
}, {
type: "elem",
elem: numerm,
shift: -numShift
}]
}, options2);
} else {
var axisHeight = options2.fontMetrics().axisHeight;
if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) {
numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth));
}
if (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift) < clearance) {
denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift));
}
var midShift = -(axisHeight - 0.5 * ruleWidth);
frac = buildCommon.makeVList({
positionType: "individualShift",
children: [{
type: "elem",
elem: denomm,
shift: denomShift
}, {
type: "elem",
elem: rule,
shift: midShift
}, {
type: "elem",
elem: numerm,
shift: -numShift
}]
}, options2);
}
newOptions = options2.havingStyle(style3);
frac.height *= newOptions.sizeMultiplier / options2.sizeMultiplier;
frac.depth *= newOptions.sizeMultiplier / options2.sizeMultiplier;
var delimSize;
if (style3.size === Style$1.DISPLAY.size) {
delimSize = options2.fontMetrics().delim1;
} else if (style3.size === Style$1.SCRIPTSCRIPT.size) {
delimSize = options2.havingStyle(Style$1.SCRIPT).fontMetrics().delim2;
} else {
delimSize = options2.fontMetrics().delim2;
}
var leftDelim;
var rightDelim;
if (group2.leftDelim == null) {
leftDelim = makeNullDelimiter(options2, ["mopen"]);
} else {
leftDelim = delimiter.customSizedDelim(group2.leftDelim, delimSize, true, options2.havingStyle(style3), group2.mode, ["mopen"]);
}
if (group2.continued) {
rightDelim = buildCommon.makeSpan([]);
} else if (group2.rightDelim == null) {
rightDelim = makeNullDelimiter(options2, ["mclose"]);
} else {
rightDelim = delimiter.customSizedDelim(group2.rightDelim, delimSize, true, options2.havingStyle(style3), group2.mode, ["mclose"]);
}
return buildCommon.makeSpan(["mord"].concat(newOptions.sizingClasses(options2)), [leftDelim, buildCommon.makeSpan(["mfrac"], [frac]), rightDelim], options2);
}, "htmlBuilder$4");
mathmlBuilder$3 = /* @__PURE__ */ __name((group2, options2) => {
var node2 = new mathMLTree.MathNode("mfrac", [buildGroup2(group2.numer, options2), buildGroup2(group2.denom, options2)]);
if (!group2.hasBarLine) {
node2.setAttribute("linethickness", "0px");
} else if (group2.barSize) {
var ruleWidth = calculateSize2(group2.barSize, options2);
node2.setAttribute("linethickness", makeEm(ruleWidth));
}
var style3 = adjustStyle(group2.size, options2.style);
if (style3.size !== options2.style.size) {
node2 = new mathMLTree.MathNode("mstyle", [node2]);
var isDisplay = style3.size === Style$1.DISPLAY.size ? "true" : "false";
node2.setAttribute("displaystyle", isDisplay);
node2.setAttribute("scriptlevel", "0");
}
if (group2.leftDelim != null || group2.rightDelim != null) {
var withDelims = [];
if (group2.leftDelim != null) {
var leftOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group2.leftDelim.replace("\\", ""))]);
leftOp.setAttribute("fence", "true");
withDelims.push(leftOp);
}
withDelims.push(node2);
if (group2.rightDelim != null) {
var rightOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group2.rightDelim.replace("\\", ""))]);
rightOp.setAttribute("fence", "true");
withDelims.push(rightOp);
}
return makeRow(withDelims);
}
return node2;
}, "mathmlBuilder$3");
defineFunction({
type: "genfrac",
names: [
"\\dfrac",
"\\frac",
"\\tfrac",
"\\dbinom",
"\\binom",
"\\tbinom",
"\\\\atopfrac",
// can’t be entered directly
"\\\\bracefrac",
"\\\\brackfrac"
// ditto
],
props: {
numArgs: 2,
allowedInArgument: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24,
funcName
} = _ref;
var numer = args[0];
var denom = args[1];
var hasBarLine;
var leftDelim = null;
var rightDelim = null;
var size4 = "auto";
switch (funcName) {
case "\\dfrac":
case "\\frac":
case "\\tfrac":
hasBarLine = true;
break;
case "\\\\atopfrac":
hasBarLine = false;
break;
case "\\dbinom":
case "\\binom":
case "\\tbinom":
hasBarLine = false;
leftDelim = "(";
rightDelim = ")";
break;
case "\\\\bracefrac":
hasBarLine = false;
leftDelim = "\\{";
rightDelim = "\\}";
break;
case "\\\\brackfrac":
hasBarLine = false;
leftDelim = "[";
rightDelim = "]";
break;
default:
throw new Error("Unrecognized genfrac command");
}
switch (funcName) {
case "\\dfrac":
case "\\dbinom":
size4 = "display";
break;
case "\\tfrac":
case "\\tbinom":
size4 = "text";
break;
}
return {
type: "genfrac",
mode: parser24.mode,
continued: false,
numer,
denom,
hasBarLine,
leftDelim,
rightDelim,
size: size4,
barSize: null
};
}, "handler"),
htmlBuilder: htmlBuilder$4,
mathmlBuilder: mathmlBuilder$3
});
defineFunction({
type: "genfrac",
names: ["\\cfrac"],
props: {
numArgs: 2
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
parser: parser24,
funcName
} = _ref2;
var numer = args[0];
var denom = args[1];
return {
type: "genfrac",
mode: parser24.mode,
continued: true,
numer,
denom,
hasBarLine: true,
leftDelim: null,
rightDelim: null,
size: "display",
barSize: null
};
}, "handler")
});
defineFunction({
type: "infix",
names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
props: {
numArgs: 0,
infix: true
},
handler(_ref3) {
var {
parser: parser24,
funcName,
token: token2
} = _ref3;
var replaceWith;
switch (funcName) {
case "\\over":
replaceWith = "\\frac";
break;
case "\\choose":
replaceWith = "\\binom";
break;
case "\\atop":
replaceWith = "\\\\atopfrac";
break;
case "\\brace":
replaceWith = "\\\\bracefrac";
break;
case "\\brack":
replaceWith = "\\\\brackfrac";
break;
default:
throw new Error("Unrecognized infix genfrac command");
}
return {
type: "infix",
mode: parser24.mode,
replaceWith,
token: token2
};
}
});
stylArray = ["display", "text", "script", "scriptscript"];
delimFromValue = /* @__PURE__ */ __name(function delimFromValue2(delimString) {
var delim = null;
if (delimString.length > 0) {
delim = delimString;
delim = delim === "." ? null : delim;
}
return delim;
}, "delimFromValue");
defineFunction({
type: "genfrac",
names: ["\\genfrac"],
props: {
numArgs: 6,
allowedInArgument: true,
argTypes: ["math", "math", "size", "text", "math", "math"]
},
handler(_ref4, args) {
var {
parser: parser24
} = _ref4;
var numer = args[4];
var denom = args[5];
var leftNode = normalizeArgument(args[0]);
var leftDelim = leftNode.type === "atom" && leftNode.family === "open" ? delimFromValue(leftNode.text) : null;
var rightNode = normalizeArgument(args[1]);
var rightDelim = rightNode.type === "atom" && rightNode.family === "close" ? delimFromValue(rightNode.text) : null;
var barNode = assertNodeType(args[2], "size");
var hasBarLine;
var barSize = null;
if (barNode.isBlank) {
hasBarLine = true;
} else {
barSize = barNode.value;
hasBarLine = barSize.number > 0;
}
var size4 = "auto";
var styl = args[3];
if (styl.type === "ordgroup") {
if (styl.body.length > 0) {
var textOrd = assertNodeType(styl.body[0], "textord");
size4 = stylArray[Number(textOrd.text)];
}
} else {
styl = assertNodeType(styl, "textord");
size4 = stylArray[Number(styl.text)];
}
return {
type: "genfrac",
mode: parser24.mode,
numer,
denom,
continued: false,
hasBarLine,
barSize,
leftDelim,
rightDelim,
size: size4
};
},
htmlBuilder: htmlBuilder$4,
mathmlBuilder: mathmlBuilder$3
});
defineFunction({
type: "infix",
names: ["\\above"],
props: {
numArgs: 1,
argTypes: ["size"],
infix: true
},
handler(_ref5, args) {
var {
parser: parser24,
funcName,
token: token2
} = _ref5;
return {
type: "infix",
mode: parser24.mode,
replaceWith: "\\\\abovefrac",
size: assertNodeType(args[0], "size").value,
token: token2
};
}
});
defineFunction({
type: "genfrac",
names: ["\\\\abovefrac"],
props: {
numArgs: 3,
argTypes: ["math", "size", "math"]
},
handler: /* @__PURE__ */ __name((_ref6, args) => {
var {
parser: parser24,
funcName
} = _ref6;
var numer = args[0];
var barSize = assert(assertNodeType(args[1], "infix").size);
var denom = args[2];
var hasBarLine = barSize.number > 0;
return {
type: "genfrac",
mode: parser24.mode,
numer,
denom,
continued: false,
hasBarLine,
barSize,
leftDelim: null,
rightDelim: null,
size: "auto"
};
}, "handler"),
htmlBuilder: htmlBuilder$4,
mathmlBuilder: mathmlBuilder$3
});
htmlBuilder$3 = /* @__PURE__ */ __name((grp, options2) => {
var style3 = options2.style;
var supSubGroup;
var group2;
if (grp.type === "supsub") {
supSubGroup = grp.sup ? buildGroup$1(grp.sup, options2.havingStyle(style3.sup()), options2) : buildGroup$1(grp.sub, options2.havingStyle(style3.sub()), options2);
group2 = assertNodeType(grp.base, "horizBrace");
} else {
group2 = assertNodeType(grp, "horizBrace");
}
var body = buildGroup$1(group2.base, options2.havingBaseStyle(Style$1.DISPLAY));
var braceBody = stretchy.svgSpan(group2, options2);
var vlist;
if (group2.isOver) {
vlist = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{
type: "elem",
elem: body
}, {
type: "kern",
size: 0.1
}, {
type: "elem",
elem: braceBody
}]
}, options2);
vlist.children[0].children[0].children[1].classes.push("svg-align");
} else {
vlist = buildCommon.makeVList({
positionType: "bottom",
positionData: body.depth + 0.1 + braceBody.height,
children: [{
type: "elem",
elem: braceBody
}, {
type: "kern",
size: 0.1
}, {
type: "elem",
elem: body
}]
}, options2);
vlist.children[0].children[0].children[0].classes.push("svg-align");
}
if (supSubGroup) {
var vSpan = buildCommon.makeSpan(["mord", group2.isOver ? "mover" : "munder"], [vlist], options2);
if (group2.isOver) {
vlist = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{
type: "elem",
elem: vSpan
}, {
type: "kern",
size: 0.2
}, {
type: "elem",
elem: supSubGroup
}]
}, options2);
} else {
vlist = buildCommon.makeVList({
positionType: "bottom",
positionData: vSpan.depth + 0.2 + supSubGroup.height + supSubGroup.depth,
children: [{
type: "elem",
elem: supSubGroup
}, {
type: "kern",
size: 0.2
}, {
type: "elem",
elem: vSpan
}]
}, options2);
}
}
return buildCommon.makeSpan(["mord", group2.isOver ? "mover" : "munder"], [vlist], options2);
}, "htmlBuilder$3");
mathmlBuilder$2 = /* @__PURE__ */ __name((group2, options2) => {
var accentNode = stretchy.mathMLnode(group2.label);
return new mathMLTree.MathNode(group2.isOver ? "mover" : "munder", [buildGroup2(group2.base, options2), accentNode]);
}, "mathmlBuilder$2");
defineFunction({
type: "horizBrace",
names: ["\\overbrace", "\\underbrace"],
props: {
numArgs: 1
},
handler(_ref, args) {
var {
parser: parser24,
funcName
} = _ref;
return {
type: "horizBrace",
mode: parser24.mode,
label: funcName,
isOver: /^\\over/.test(funcName),
base: args[0]
};
},
htmlBuilder: htmlBuilder$3,
mathmlBuilder: mathmlBuilder$2
});
defineFunction({
type: "href",
names: ["\\href"],
props: {
numArgs: 2,
argTypes: ["url", "original"],
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24
} = _ref;
var body = args[1];
var href = assertNodeType(args[0], "url").url;
if (!parser24.settings.isTrusted({
command: "\\href",
url: href
})) {
return parser24.formatUnsupportedCmd("\\href");
}
return {
type: "href",
mode: parser24.mode,
href,
body: ordargument(body)
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var elements2 = buildExpression$1(group2.body, options2, false);
return buildCommon.makeAnchor(group2.href, [], elements2, options2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var math2 = buildExpressionRow(group2.body, options2);
if (!(math2 instanceof MathNode)) {
math2 = new MathNode("mrow", [math2]);
}
math2.setAttribute("href", group2.href);
return math2;
}, "mathmlBuilder")
});
defineFunction({
type: "href",
names: ["\\url"],
props: {
numArgs: 1,
argTypes: ["url"],
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
parser: parser24
} = _ref2;
var href = assertNodeType(args[0], "url").url;
if (!parser24.settings.isTrusted({
command: "\\url",
url: href
})) {
return parser24.formatUnsupportedCmd("\\url");
}
var chars = [];
for (var i2 = 0; i2 < href.length; i2++) {
var c3 = href[i2];
if (c3 === "~") {
c3 = "\\textasciitilde";
}
chars.push({
type: "textord",
mode: "text",
text: c3
});
}
var body = {
type: "text",
mode: parser24.mode,
font: "\\texttt",
body: chars
};
return {
type: "href",
mode: parser24.mode,
href,
body: ordargument(body)
};
}, "handler")
});
defineFunction({
type: "hbox",
names: ["\\hbox"],
props: {
numArgs: 1,
argTypes: ["text"],
allowedInText: true,
primitive: true
},
handler(_ref, args) {
var {
parser: parser24
} = _ref;
return {
type: "hbox",
mode: parser24.mode,
body: ordargument(args[0])
};
},
htmlBuilder(group2, options2) {
var elements2 = buildExpression$1(group2.body, options2, false);
return buildCommon.makeFragment(elements2);
},
mathmlBuilder(group2, options2) {
return new mathMLTree.MathNode("mrow", buildExpression2(group2.body, options2));
}
});
defineFunction({
type: "html",
names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
props: {
numArgs: 2,
argTypes: ["raw", "original"],
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24,
funcName,
token: token2
} = _ref;
var value2 = assertNodeType(args[0], "raw").string;
var body = args[1];
if (parser24.settings.strict) {
parser24.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
}
var trustContext;
var attributes = {};
switch (funcName) {
case "\\htmlClass":
attributes.class = value2;
trustContext = {
command: "\\htmlClass",
class: value2
};
break;
case "\\htmlId":
attributes.id = value2;
trustContext = {
command: "\\htmlId",
id: value2
};
break;
case "\\htmlStyle":
attributes.style = value2;
trustContext = {
command: "\\htmlStyle",
style: value2
};
break;
case "\\htmlData": {
var data5 = value2.split(",");
for (var i2 = 0; i2 < data5.length; i2++) {
var keyVal = data5[i2].split("=");
if (keyVal.length !== 2) {
throw new ParseError("Error parsing key-value for \\htmlData");
}
attributes["data-" + keyVal[0].trim()] = keyVal[1].trim();
}
trustContext = {
command: "\\htmlData",
attributes
};
break;
}
default:
throw new Error("Unrecognized html command");
}
if (!parser24.settings.isTrusted(trustContext)) {
return parser24.formatUnsupportedCmd(funcName);
}
return {
type: "html",
mode: parser24.mode,
attributes,
body: ordargument(body)
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var elements2 = buildExpression$1(group2.body, options2, false);
var classes3 = ["enclosing"];
if (group2.attributes.class) {
classes3.push(...group2.attributes.class.trim().split(/\s+/));
}
var span = buildCommon.makeSpan(classes3, elements2, options2);
for (var attr in group2.attributes) {
if (attr !== "class" && group2.attributes.hasOwnProperty(attr)) {
span.setAttribute(attr, group2.attributes[attr]);
}
}
return span;
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
return buildExpressionRow(group2.body, options2);
}, "mathmlBuilder")
});
defineFunction({
type: "htmlmathml",
names: ["\\html@mathml"],
props: {
numArgs: 2,
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24
} = _ref;
return {
type: "htmlmathml",
mode: parser24.mode,
html: ordargument(args[0]),
mathml: ordargument(args[1])
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var elements2 = buildExpression$1(group2.html, options2, false);
return buildCommon.makeFragment(elements2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
return buildExpressionRow(group2.mathml, options2);
}, "mathmlBuilder")
});
sizeData = /* @__PURE__ */ __name(function sizeData2(str2) {
if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str2)) {
return {
number: +str2,
unit: "bp"
};
} else {
var match2 = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str2);
if (!match2) {
throw new ParseError("Invalid size: '" + str2 + "' in \\includegraphics");
}
var data5 = {
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.");
}
return data5;
}
}, "sizeData");
defineFunction({
type: "includegraphics",
names: ["\\includegraphics"],
props: {
numArgs: 1,
numOptionalArgs: 1,
argTypes: ["raw", "url"],
allowedInText: false
},
handler: /* @__PURE__ */ __name((_ref, args, optArgs) => {
var {
parser: parser24
} = _ref;
var width3 = {
number: 0,
unit: "em"
};
var height2 = {
number: 0.9,
unit: "em"
};
var totalheight = {
number: 0,
unit: "em"
};
var alt = "";
if (optArgs[0]) {
var attributeStr = assertNodeType(optArgs[0], "raw").string;
var attributes = attributeStr.split(",");
for (var i2 = 0; i2 < attributes.length; i2++) {
var keyVal = attributes[i2].split("=");
if (keyVal.length === 2) {
var str2 = keyVal[1].trim();
switch (keyVal[0].trim()) {
case "alt":
alt = str2;
break;
case "width":
width3 = sizeData(str2);
break;
case "height":
height2 = sizeData(str2);
break;
case "totalheight":
totalheight = sizeData(str2);
break;
default:
throw new ParseError("Invalid key: '" + keyVal[0] + "' in \\includegraphics.");
}
}
}
}
var src = assertNodeType(args[0], "url").url;
if (alt === "") {
alt = src;
alt = alt.replace(/^.*[\\/]/, "");
alt = alt.substring(0, alt.lastIndexOf("."));
}
if (!parser24.settings.isTrusted({
command: "\\includegraphics",
url: src
})) {
return parser24.formatUnsupportedCmd("\\includegraphics");
}
return {
type: "includegraphics",
mode: parser24.mode,
alt,
width: width3,
height: height2,
totalheight,
src
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var height2 = calculateSize2(group2.height, options2);
var depth = 0;
if (group2.totalheight.number > 0) {
depth = calculateSize2(group2.totalheight, options2) - height2;
}
var width3 = 0;
if (group2.width.number > 0) {
width3 = calculateSize2(group2.width, options2);
}
var style3 = {
height: makeEm(height2 + depth)
};
if (width3 > 0) {
style3.width = makeEm(width3);
}
if (depth > 0) {
style3.verticalAlign = makeEm(-depth);
}
var node2 = new Img(group2.src, group2.alt, style3);
node2.height = height2;
node2.depth = depth;
return node2;
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var node2 = new mathMLTree.MathNode("mglyph", []);
node2.setAttribute("alt", group2.alt);
var height2 = calculateSize2(group2.height, options2);
var depth = 0;
if (group2.totalheight.number > 0) {
depth = calculateSize2(group2.totalheight, options2) - height2;
node2.setAttribute("valign", makeEm(-depth));
}
node2.setAttribute("height", makeEm(height2 + depth));
if (group2.width.number > 0) {
var width3 = calculateSize2(group2.width, options2);
node2.setAttribute("width", makeEm(width3));
}
node2.setAttribute("src", group2.src);
return node2;
}, "mathmlBuilder")
});
defineFunction({
type: "kern",
names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
props: {
numArgs: 1,
argTypes: ["size"],
primitive: true,
allowedInText: true
},
handler(_ref, args) {
var {
parser: parser24,
funcName
} = _ref;
var size4 = assertNodeType(args[0], "size");
if (parser24.settings.strict) {
var mathFunction = funcName[1] === "m";
var muUnit = size4.value.unit === "mu";
if (mathFunction) {
if (!muUnit) {
parser24.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size4.value.unit + " units"));
}
if (parser24.mode !== "math") {
parser24.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode");
}
} else {
if (muUnit) {
parser24.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units");
}
}
}
return {
type: "kern",
mode: parser24.mode,
dimension: size4.value
};
},
htmlBuilder(group2, options2) {
return buildCommon.makeGlue(group2.dimension, options2);
},
mathmlBuilder(group2, options2) {
var dimension = calculateSize2(group2.dimension, options2);
return new mathMLTree.SpaceNode(dimension);
}
});
defineFunction({
type: "lap",
names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
props: {
numArgs: 1,
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24,
funcName
} = _ref;
var body = args[0];
return {
type: "lap",
mode: parser24.mode,
alignment: funcName.slice(5),
body
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var inner2;
if (group2.alignment === "clap") {
inner2 = buildCommon.makeSpan([], [buildGroup$1(group2.body, options2)]);
inner2 = buildCommon.makeSpan(["inner"], [inner2], options2);
} else {
inner2 = buildCommon.makeSpan(["inner"], [buildGroup$1(group2.body, options2)]);
}
var fix = buildCommon.makeSpan(["fix"], []);
var node2 = buildCommon.makeSpan([group2.alignment], [inner2, fix], options2);
var strut = buildCommon.makeSpan(["strut"]);
strut.style.height = makeEm(node2.height + node2.depth);
if (node2.depth) {
strut.style.verticalAlign = makeEm(-node2.depth);
}
node2.children.unshift(strut);
node2 = buildCommon.makeSpan(["thinbox"], [node2], options2);
return buildCommon.makeSpan(["mord", "vbox"], [node2], options2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var node2 = new mathMLTree.MathNode("mpadded", [buildGroup2(group2.body, options2)]);
if (group2.alignment !== "rlap") {
var offset = group2.alignment === "llap" ? "-1" : "-0.5";
node2.setAttribute("lspace", offset + "width");
}
node2.setAttribute("width", "0px");
return node2;
}, "mathmlBuilder")
});
defineFunction({
type: "styling",
names: ["\\(", "$"],
props: {
numArgs: 0,
allowedInText: true,
allowedInMath: false
},
handler(_ref, args) {
var {
funcName,
parser: parser24
} = _ref;
var outerMode = parser24.mode;
parser24.switchMode("math");
var close2 = funcName === "\\(" ? "\\)" : "$";
var body = parser24.parseExpression(false, close2);
parser24.expect(close2);
parser24.switchMode(outerMode);
return {
type: "styling",
mode: parser24.mode,
style: "text",
body
};
}
});
defineFunction({
type: "text",
// Doesn't matter what this is.
names: ["\\)", "\\]"],
props: {
numArgs: 0,
allowedInText: true,
allowedInMath: false
},
handler(context, args) {
throw new ParseError("Mismatched " + context.funcName);
}
});
chooseMathStyle = /* @__PURE__ */ __name((group2, options2) => {
switch (options2.style.size) {
case Style$1.DISPLAY.size:
return group2.display;
case Style$1.TEXT.size:
return group2.text;
case Style$1.SCRIPT.size:
return group2.script;
case Style$1.SCRIPTSCRIPT.size:
return group2.scriptscript;
default:
return group2.text;
}
}, "chooseMathStyle");
defineFunction({
type: "mathchoice",
names: ["\\mathchoice"],
props: {
numArgs: 4,
primitive: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24
} = _ref;
return {
type: "mathchoice",
mode: parser24.mode,
display: ordargument(args[0]),
text: ordargument(args[1]),
script: ordargument(args[2]),
scriptscript: ordargument(args[3])
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var body = chooseMathStyle(group2, options2);
var elements2 = buildExpression$1(body, options2, false);
return buildCommon.makeFragment(elements2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var body = chooseMathStyle(group2, options2);
return buildExpressionRow(body, options2);
}, "mathmlBuilder")
});
assembleSupSub = /* @__PURE__ */ __name((base, supGroup, subGroup, options2, style3, slant, baseShift) => {
base = buildCommon.makeSpan([], [base]);
var subIsSingleCharacter = subGroup && utils.isCharacterBox(subGroup);
var sub2;
var sup2;
if (supGroup) {
var elem = buildGroup$1(supGroup, options2.havingStyle(style3.sup()), options2);
sup2 = {
elem,
kern: Math.max(options2.fontMetrics().bigOpSpacing1, options2.fontMetrics().bigOpSpacing3 - elem.depth)
};
}
if (subGroup) {
var _elem = buildGroup$1(subGroup, options2.havingStyle(style3.sub()), options2);
sub2 = {
elem: _elem,
kern: Math.max(options2.fontMetrics().bigOpSpacing2, options2.fontMetrics().bigOpSpacing4 - _elem.height)
};
}
var finalGroup;
if (sup2 && sub2) {
var bottom2 = options2.fontMetrics().bigOpSpacing5 + sub2.elem.height + sub2.elem.depth + sub2.kern + base.depth + baseShift;
finalGroup = buildCommon.makeVList({
positionType: "bottom",
positionData: bottom2,
children: [{
type: "kern",
size: options2.fontMetrics().bigOpSpacing5
}, {
type: "elem",
elem: sub2.elem,
marginLeft: makeEm(-slant)
}, {
type: "kern",
size: sub2.kern
}, {
type: "elem",
elem: base
}, {
type: "kern",
size: sup2.kern
}, {
type: "elem",
elem: sup2.elem,
marginLeft: makeEm(slant)
}, {
type: "kern",
size: options2.fontMetrics().bigOpSpacing5
}]
}, options2);
} else if (sub2) {
var top2 = base.height - baseShift;
finalGroup = buildCommon.makeVList({
positionType: "top",
positionData: top2,
children: [{
type: "kern",
size: options2.fontMetrics().bigOpSpacing5
}, {
type: "elem",
elem: sub2.elem,
marginLeft: makeEm(-slant)
}, {
type: "kern",
size: sub2.kern
}, {
type: "elem",
elem: base
}]
}, options2);
} else if (sup2) {
var _bottom = base.depth + baseShift;
finalGroup = buildCommon.makeVList({
positionType: "bottom",
positionData: _bottom,
children: [{
type: "elem",
elem: base
}, {
type: "kern",
size: sup2.kern
}, {
type: "elem",
elem: sup2.elem,
marginLeft: makeEm(slant)
}, {
type: "kern",
size: options2.fontMetrics().bigOpSpacing5
}]
}, options2);
} else {
return base;
}
var parts = [finalGroup];
if (sub2 && slant !== 0 && !subIsSingleCharacter) {
var spacer = buildCommon.makeSpan(["mspace"], [], options2);
spacer.style.marginRight = makeEm(slant);
parts.unshift(spacer);
}
return buildCommon.makeSpan(["mop", "op-limits"], parts, options2);
}, "assembleSupSub");
noSuccessor = ["\\smallint"];
htmlBuilder$2 = /* @__PURE__ */ __name((grp, options2) => {
var supGroup;
var subGroup;
var hasLimits = false;
var group2;
if (grp.type === "supsub") {
supGroup = grp.sup;
subGroup = grp.sub;
group2 = assertNodeType(grp.base, "op");
hasLimits = true;
} else {
group2 = assertNodeType(grp, "op");
}
var style3 = options2.style;
var large = false;
if (style3.size === Style$1.DISPLAY.size && group2.symbol && !utils.contains(noSuccessor, group2.name)) {
large = true;
}
var base;
if (group2.symbol) {
var fontName = large ? "Size2-Regular" : "Size1-Regular";
var stash = "";
if (group2.name === "\\oiint" || group2.name === "\\oiiint") {
stash = group2.name.slice(1);
group2.name = stash === "oiint" ? "\\iint" : "\\iiint";
}
base = buildCommon.makeSymbol(group2.name, fontName, "math", options2, ["mop", "op-symbol", large ? "large-op" : "small-op"]);
if (stash.length > 0) {
var italic = base.italic;
var oval = buildCommon.staticSvg(stash + "Size" + (large ? "2" : "1"), options2);
base = buildCommon.makeVList({
positionType: "individualShift",
children: [{
type: "elem",
elem: base,
shift: 0
}, {
type: "elem",
elem: oval,
shift: large ? 0.08 : 0
}]
}, options2);
group2.name = "\\" + stash;
base.classes.unshift("mop");
base.italic = italic;
}
} else if (group2.body) {
var inner2 = buildExpression$1(group2.body, options2, true);
if (inner2.length === 1 && inner2[0] instanceof SymbolNode) {
base = inner2[0];
base.classes[0] = "mop";
} else {
base = buildCommon.makeSpan(["mop"], inner2, options2);
}
} else {
var output2 = [];
for (var i2 = 1; i2 < group2.name.length; i2++) {
output2.push(buildCommon.mathsym(group2.name[i2], group2.mode, options2));
}
base = buildCommon.makeSpan(["mop"], output2, options2);
}
var baseShift = 0;
var slant = 0;
if ((base instanceof SymbolNode || group2.name === "\\oiint" || group2.name === "\\oiiint") && !group2.suppressBaseShift) {
baseShift = (base.height - base.depth) / 2 - options2.fontMetrics().axisHeight;
slant = base.italic;
}
if (hasLimits) {
return assembleSupSub(base, supGroup, subGroup, options2, style3, slant, baseShift);
} else {
if (baseShift) {
base.style.position = "relative";
base.style.top = makeEm(baseShift);
}
return base;
}
}, "htmlBuilder$2");
mathmlBuilder$1 = /* @__PURE__ */ __name((group2, options2) => {
var node2;
if (group2.symbol) {
node2 = new MathNode("mo", [makeText(group2.name, group2.mode)]);
if (utils.contains(noSuccessor, group2.name)) {
node2.setAttribute("largeop", "false");
}
} else if (group2.body) {
node2 = new MathNode("mo", buildExpression2(group2.body, options2));
} else {
node2 = new MathNode("mi", [new TextNode(group2.name.slice(1))]);
var operator = new MathNode("mo", [makeText("\u2061", "text")]);
if (group2.parentIsSupSub) {
node2 = new MathNode("mrow", [node2, operator]);
} else {
node2 = newDocumentFragment([node2, operator]);
}
}
return node2;
}, "mathmlBuilder$1");
singleCharBigOps = {
"\u220F": "\\prod",
"\u2210": "\\coprod",
"\u2211": "\\sum",
"\u22C0": "\\bigwedge",
"\u22C1": "\\bigvee",
"\u22C2": "\\bigcap",
"\u22C3": "\\bigcup",
"\u2A00": "\\bigodot",
"\u2A01": "\\bigoplus",
"\u2A02": "\\bigotimes",
"\u2A04": "\\biguplus",
"\u2A06": "\\bigsqcup"
};
defineFunction({
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: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24,
funcName
} = _ref;
var fName = funcName;
if (fName.length === 1) {
fName = singleCharBigOps[fName];
}
return {
type: "op",
mode: parser24.mode,
limits: true,
parentIsSupSub: false,
symbol: true,
name: fName
};
}, "handler"),
htmlBuilder: htmlBuilder$2,
mathmlBuilder: mathmlBuilder$1
});
defineFunction({
type: "op",
names: ["\\mathop"],
props: {
numArgs: 1,
primitive: true
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
parser: parser24
} = _ref2;
var body = args[0];
return {
type: "op",
mode: parser24.mode,
limits: false,
parentIsSupSub: false,
symbol: false,
body: ordargument(body)
};
}, "handler"),
htmlBuilder: htmlBuilder$2,
mathmlBuilder: mathmlBuilder$1
});
singleCharIntegrals = {
"\u222B": "\\int",
"\u222C": "\\iint",
"\u222D": "\\iiint",
"\u222E": "\\oint",
"\u222F": "\\oiint",
"\u2230": "\\oiiint"
};
defineFunction({
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(_ref3) {
var {
parser: parser24,
funcName
} = _ref3;
return {
type: "op",
mode: parser24.mode,
limits: false,
parentIsSupSub: false,
symbol: false,
name: funcName
};
},
htmlBuilder: htmlBuilder$2,
mathmlBuilder: mathmlBuilder$1
});
defineFunction({
type: "op",
names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
props: {
numArgs: 0
},
handler(_ref4) {
var {
parser: parser24,
funcName
} = _ref4;
return {
type: "op",
mode: parser24.mode,
limits: true,
parentIsSupSub: false,
symbol: false,
name: funcName
};
},
htmlBuilder: htmlBuilder$2,
mathmlBuilder: mathmlBuilder$1
});
defineFunction({
type: "op",
names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "\u222B", "\u222C", "\u222D", "\u222E", "\u222F", "\u2230"],
props: {
numArgs: 0
},
handler(_ref5) {
var {
parser: parser24,
funcName
} = _ref5;
var fName = funcName;
if (fName.length === 1) {
fName = singleCharIntegrals[fName];
}
return {
type: "op",
mode: parser24.mode,
limits: false,
parentIsSupSub: false,
symbol: true,
name: fName
};
},
htmlBuilder: htmlBuilder$2,
mathmlBuilder: mathmlBuilder$1
});
htmlBuilder$1 = /* @__PURE__ */ __name((grp, options2) => {
var supGroup;
var subGroup;
var hasLimits = false;
var group2;
if (grp.type === "supsub") {
supGroup = grp.sup;
subGroup = grp.sub;
group2 = assertNodeType(grp.base, "operatorname");
hasLimits = true;
} else {
group2 = assertNodeType(grp, "operatorname");
}
var base;
if (group2.body.length > 0) {
var body = group2.body.map((child2) => {
var childText = child2.text;
if (typeof childText === "string") {
return {
type: "textord",
mode: child2.mode,
text: childText
};
} else {
return child2;
}
});
var expression = buildExpression$1(body, options2.withFont("mathrm"), true);
for (var i2 = 0; i2 < expression.length; i2++) {
var child = expression[i2];
if (child instanceof SymbolNode) {
child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*");
}
}
base = buildCommon.makeSpan(["mop"], expression, options2);
} else {
base = buildCommon.makeSpan(["mop"], [], options2);
}
if (hasLimits) {
return assembleSupSub(base, supGroup, subGroup, options2, options2.style, 0, 0);
} else {
return base;
}
}, "htmlBuilder$1");
mathmlBuilder2 = /* @__PURE__ */ __name((group2, options2) => {
var expression = buildExpression2(group2.body, options2.withFont("mathrm"));
var isAllString = true;
for (var i2 = 0; i2 < expression.length; i2++) {
var node2 = expression[i2];
if (node2 instanceof mathMLTree.SpaceNode) ;
else if (node2 instanceof mathMLTree.MathNode) {
switch (node2.type) {
case "mi":
case "mn":
case "ms":
case "mspace":
case "mtext":
break;
// Do nothing yet.
case "mo": {
var child = node2.children[0];
if (node2.children.length === 1 && child instanceof mathMLTree.TextNode) {
child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*");
} else {
isAllString = false;
}
break;
}
default:
isAllString = false;
}
} else {
isAllString = false;
}
}
if (isAllString) {
var word = expression.map((node3) => node3.toText()).join("");
expression = [new mathMLTree.TextNode(word)];
}
var identifier2 = new mathMLTree.MathNode("mi", expression);
identifier2.setAttribute("mathvariant", "normal");
var operator = new mathMLTree.MathNode("mo", [makeText("\u2061", "text")]);
if (group2.parentIsSupSub) {
return new mathMLTree.MathNode("mrow", [identifier2, operator]);
} else {
return mathMLTree.newDocumentFragment([identifier2, operator]);
}
}, "mathmlBuilder");
defineFunction({
type: "operatorname",
names: ["\\operatorname@", "\\operatornamewithlimits"],
props: {
numArgs: 1
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24,
funcName
} = _ref;
var body = args[0];
return {
type: "operatorname",
mode: parser24.mode,
body: ordargument(body),
alwaysHandleSupSub: funcName === "\\operatornamewithlimits",
limits: false,
parentIsSupSub: false
};
}, "handler"),
htmlBuilder: htmlBuilder$1,
mathmlBuilder: mathmlBuilder2
});
defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
defineFunctionBuilders({
type: "ordgroup",
htmlBuilder(group2, options2) {
if (group2.semisimple) {
return buildCommon.makeFragment(buildExpression$1(group2.body, options2, false));
}
return buildCommon.makeSpan(["mord"], buildExpression$1(group2.body, options2, true), options2);
},
mathmlBuilder(group2, options2) {
return buildExpressionRow(group2.body, options2, true);
}
});
defineFunction({
type: "overline",
names: ["\\overline"],
props: {
numArgs: 1
},
handler(_ref, args) {
var {
parser: parser24
} = _ref;
var body = args[0];
return {
type: "overline",
mode: parser24.mode,
body
};
},
htmlBuilder(group2, options2) {
var innerGroup = buildGroup$1(group2.body, options2.havingCrampedStyle());
var line2 = buildCommon.makeLineSpan("overline-line", options2);
var defaultRuleThickness = options2.fontMetrics().defaultRuleThickness;
var vlist = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{
type: "elem",
elem: innerGroup
}, {
type: "kern",
size: 3 * defaultRuleThickness
}, {
type: "elem",
elem: line2
}, {
type: "kern",
size: defaultRuleThickness
}]
}, options2);
return buildCommon.makeSpan(["mord", "overline"], [vlist], options2);
},
mathmlBuilder(group2, options2) {
var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203E")]);
operator.setAttribute("stretchy", "true");
var node2 = new mathMLTree.MathNode("mover", [buildGroup2(group2.body, options2), operator]);
node2.setAttribute("accent", "true");
return node2;
}
});
defineFunction({
type: "phantom",
names: ["\\phantom"],
props: {
numArgs: 1,
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
parser: parser24
} = _ref;
var body = args[0];
return {
type: "phantom",
mode: parser24.mode,
body: ordargument(body)
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var elements2 = buildExpression$1(group2.body, options2.withPhantom(), false);
return buildCommon.makeFragment(elements2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var inner2 = buildExpression2(group2.body, options2);
return new mathMLTree.MathNode("mphantom", inner2);
}, "mathmlBuilder")
});
defineFunction({
type: "hphantom",
names: ["\\hphantom"],
props: {
numArgs: 1,
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref2, args) => {
var {
parser: parser24
} = _ref2;
var body = args[0];
return {
type: "hphantom",
mode: parser24.mode,
body
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var node2 = buildCommon.makeSpan([], [buildGroup$1(group2.body, options2.withPhantom())]);
node2.height = 0;
node2.depth = 0;
if (node2.children) {
for (var i2 = 0; i2 < node2.children.length; i2++) {
node2.children[i2].height = 0;
node2.children[i2].depth = 0;
}
}
node2 = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{
type: "elem",
elem: node2
}]
}, options2);
return buildCommon.makeSpan(["mord"], [node2], options2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var inner2 = buildExpression2(ordargument(group2.body), options2);
var phantom = new mathMLTree.MathNode("mphantom", inner2);
var node2 = new mathMLTree.MathNode("mpadded", [phantom]);
node2.setAttribute("height", "0px");
node2.setAttribute("depth", "0px");
return node2;
}, "mathmlBuilder")
});
defineFunction({
type: "vphantom",
names: ["\\vphantom"],
props: {
numArgs: 1,
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref3, args) => {
var {
parser: parser24
} = _ref3;
var body = args[0];
return {
type: "vphantom",
mode: parser24.mode,
body
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var inner2 = buildCommon.makeSpan(["inner"], [buildGroup$1(group2.body, options2.withPhantom())]);
var fix = buildCommon.makeSpan(["fix"], []);
return buildCommon.makeSpan(["mord", "rlap"], [inner2, fix], options2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var inner2 = buildExpression2(ordargument(group2.body), options2);
var phantom = new mathMLTree.MathNode("mphantom", inner2);
var node2 = new mathMLTree.MathNode("mpadded", [phantom]);
node2.setAttribute("width", "0px");
return node2;
}, "mathmlBuilder")
});
defineFunction({
type: "raisebox",
names: ["\\raisebox"],
props: {
numArgs: 2,
argTypes: ["size", "hbox"],
allowedInText: true
},
handler(_ref, args) {
var {
parser: parser24
} = _ref;
var amount = assertNodeType(args[0], "size").value;
var body = args[1];
return {
type: "raisebox",
mode: parser24.mode,
dy: amount,
body
};
},
htmlBuilder(group2, options2) {
var body = buildGroup$1(group2.body, options2);
var dy = calculateSize2(group2.dy, options2);
return buildCommon.makeVList({
positionType: "shift",
positionData: -dy,
children: [{
type: "elem",
elem: body
}]
}, options2);
},
mathmlBuilder(group2, options2) {
var node2 = new mathMLTree.MathNode("mpadded", [buildGroup2(group2.body, options2)]);
var dy = group2.dy.number + group2.dy.unit;
node2.setAttribute("voffset", dy);
return node2;
}
});
defineFunction({
type: "internal",
names: ["\\relax"],
props: {
numArgs: 0,
allowedInText: true,
allowedInArgument: true
},
handler(_ref) {
var {
parser: parser24
} = _ref;
return {
type: "internal",
mode: parser24.mode
};
}
});
defineFunction({
type: "rule",
names: ["\\rule"],
props: {
numArgs: 2,
numOptionalArgs: 1,
allowedInText: true,
allowedInMath: true,
argTypes: ["size", "size", "size"]
},
handler(_ref, args, optArgs) {
var {
parser: parser24
} = _ref;
var shift2 = optArgs[0];
var width3 = assertNodeType(args[0], "size");
var height2 = assertNodeType(args[1], "size");
return {
type: "rule",
mode: parser24.mode,
shift: shift2 && assertNodeType(shift2, "size").value,
width: width3.value,
height: height2.value
};
},
htmlBuilder(group2, options2) {
var rule = buildCommon.makeSpan(["mord", "rule"], [], options2);
var width3 = calculateSize2(group2.width, options2);
var height2 = calculateSize2(group2.height, options2);
var shift2 = group2.shift ? calculateSize2(group2.shift, options2) : 0;
rule.style.borderRightWidth = makeEm(width3);
rule.style.borderTopWidth = makeEm(height2);
rule.style.bottom = makeEm(shift2);
rule.width = width3;
rule.height = height2 + shift2;
rule.depth = -shift2;
rule.maxFontSize = height2 * 1.125 * options2.sizeMultiplier;
return rule;
},
mathmlBuilder(group2, options2) {
var width3 = calculateSize2(group2.width, options2);
var height2 = calculateSize2(group2.height, options2);
var shift2 = group2.shift ? calculateSize2(group2.shift, options2) : 0;
var color2 = options2.color && options2.getColor() || "black";
var rule = new mathMLTree.MathNode("mspace");
rule.setAttribute("mathbackground", color2);
rule.setAttribute("width", makeEm(width3));
rule.setAttribute("height", makeEm(height2));
var wrapper = new mathMLTree.MathNode("mpadded", [rule]);
if (shift2 >= 0) {
wrapper.setAttribute("height", makeEm(shift2));
} else {
wrapper.setAttribute("height", makeEm(shift2));
wrapper.setAttribute("depth", makeEm(-shift2));
}
wrapper.setAttribute("voffset", makeEm(shift2));
return wrapper;
}
});
__name(sizingGroup, "sizingGroup");
sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"];
htmlBuilder2 = /* @__PURE__ */ __name((group2, options2) => {
var newOptions = options2.havingSize(group2.size);
return sizingGroup(group2.body, newOptions, options2);
}, "htmlBuilder");
defineFunction({
type: "sizing",
names: sizeFuncs,
props: {
numArgs: 0,
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref, args) => {
var {
breakOnTokenText,
funcName,
parser: parser24
} = _ref;
var body = parser24.parseExpression(false, breakOnTokenText);
return {
type: "sizing",
mode: parser24.mode,
// Figure out what size to use based on the list of functions above
size: sizeFuncs.indexOf(funcName) + 1,
body
};
}, "handler"),
htmlBuilder: htmlBuilder2,
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var newOptions = options2.havingSize(group2.size);
var inner2 = buildExpression2(group2.body, newOptions);
var node2 = new mathMLTree.MathNode("mstyle", inner2);
node2.setAttribute("mathsize", makeEm(newOptions.sizeMultiplier));
return node2;
}, "mathmlBuilder")
});
defineFunction({
type: "smash",
names: ["\\smash"],
props: {
numArgs: 1,
numOptionalArgs: 1,
allowedInText: true
},
handler: /* @__PURE__ */ __name((_ref, args, optArgs) => {
var {
parser: parser24
} = _ref;
var smashHeight = false;
var smashDepth = false;
var tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup");
if (tbArg) {
var letter = "";
for (var i2 = 0; i2 < tbArg.body.length; ++i2) {
var node2 = tbArg.body[i2];
letter = node2.text;
if (letter === "t") {
smashHeight = true;
} else if (letter === "b") {
smashDepth = true;
} else {
smashHeight = false;
smashDepth = false;
break;
}
}
} else {
smashHeight = true;
smashDepth = true;
}
var body = args[0];
return {
type: "smash",
mode: parser24.mode,
body,
smashHeight,
smashDepth
};
}, "handler"),
htmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var node2 = buildCommon.makeSpan([], [buildGroup$1(group2.body, options2)]);
if (!group2.smashHeight && !group2.smashDepth) {
return node2;
}
if (group2.smashHeight) {
node2.height = 0;
if (node2.children) {
for (var i2 = 0; i2 < node2.children.length; i2++) {
node2.children[i2].height = 0;
}
}
}
if (group2.smashDepth) {
node2.depth = 0;
if (node2.children) {
for (var _i = 0; _i < node2.children.length; _i++) {
node2.children[_i].depth = 0;
}
}
}
var smashedNode = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{
type: "elem",
elem: node2
}]
}, options2);
return buildCommon.makeSpan(["mord"], [smashedNode], options2);
}, "htmlBuilder"),
mathmlBuilder: /* @__PURE__ */ __name((group2, options2) => {
var node2 = new mathMLTree.MathNode("mpadded", [buildGroup2(group2.body, options2)]);
if (group2.smashHeight) {
node2.setAttribute("height", "0px");
}
if (group2.smashDepth) {
node2.setAttribute("depth", "0px");
}
return node2;
}, "mathmlBuilder")
});
defineFunction({
type: "sqrt",
names: ["\\sqrt"],
props: {
numArgs: 1,
numOptionalArgs: 1
},
handler(_ref, args, optArgs) {
var {
parser: parser24
} = _ref;
var index = optArgs[0];
var body = args[0];
return {
type: "sqrt",
mode: parser24.mode,
body,
index
};
},
htmlBuilder(group2, options2) {
var inner2 = buildGroup$1(group2.body, options2.havingCrampedStyle());
if (inner2.height === 0) {
inner2.height = options2.fontMetrics().xHeight;
}
inner2 = buildCommon.wrapFragment(inner2, options2);
var metrics = options2.fontMetrics();
var theta = metrics.defaultRuleThickness;
var phi2 = theta;
if (options2.style.id < Style$1.TEXT.id) {
phi2 = options2.fontMetrics().xHeight;
}
var lineClearance = theta + phi2 / 4;
var minDelimiterHeight = inner2.height + inner2.depth + lineClearance + theta;
var {
span: img,
ruleWidth,
advanceWidth
} = delimiter.sqrtImage(minDelimiterHeight, options2);
var delimDepth = img.height - ruleWidth;
if (delimDepth > inner2.height + inner2.depth + lineClearance) {
lineClearance = (lineClearance + delimDepth - inner2.height - inner2.depth) / 2;
}
var imgShift = img.height - inner2.height - lineClearance - ruleWidth;
inner2.style.paddingLeft = makeEm(advanceWidth);
var body = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{
type: "elem",
elem: inner2,
wrapperClasses: ["svg-align"]
}, {
type: "kern",
size: -(inner2.height + imgShift)
}, {
type: "elem",
elem: img
}, {
type: "kern",
size: ruleWidth
}]
}, options2);
if (!group2.index) {
return buildCommon.makeSpan(["mord", "sqrt"], [body], options2);
} else {
var newOptions = options2.havingStyle(Style$1.SCRIPTSCRIPT);
var rootm = buildGroup$1(group2.index, newOptions, options2);
var toShift = 0.6 * (body.height - body.depth);
var rootVList = buildCommon.makeVList({
positionType: "shift",
positionData: -toShift,
children: [{
type: "elem",
elem: rootm
}]
}, options2);
var rootVListWrap = buildCommon.makeSpan(["root"], [rootVList]);
return buildCommon.makeSpan(["mord", "sqrt"], [rootVListWrap, body], options2);
}
},
mathmlBuilder(group2, options2) {
var {
body,
index
} = group2;
return index ? new mathMLTree.MathNode("mroot", [buildGroup2(body, options2), buildGroup2(index, options2)]) : new mathMLTree.MathNode("msqrt", [buildGroup2(body, options2)]);
}
});
styleMap = {
"display": Style$1.DISPLAY,
"text": Style$1.TEXT,
"script": Style$1.SCRIPT,
"scriptscript": Style$1.SCRIPTSCRIPT
};
defineFunction({
type: "styling",
names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler(_ref, args) {
var {
breakOnTokenText,
funcName,
parser: parser24
} = _ref;
var body = parser24.parseExpression(true, breakOnTokenText);
var style3 = funcName.slice(1, funcName.length - 5);
return {
type: "styling",
mode: parser24.mode,
// Figure out what style to use by pulling out the style from
// the function name
style: style3,
body
};
},
htmlBuilder(group2, options2) {
var newStyle = styleMap[group2.style];
var newOptions = options2.havingStyle(newStyle).withFont("");
return sizingGroup(group2.body, newOptions, options2);
},
mathmlBuilder(group2, options2) {
var newStyle = styleMap[group2.style];
var newOptions = options2.havingStyle(newStyle);
var inner2 = buildExpression2(group2.body, newOptions);
var node2 = new mathMLTree.MathNode("mstyle", inner2);
var styleAttributes = {
"display": ["0", "true"],
"text": ["0", "false"],
"script": ["1", "false"],
"scriptscript": ["2", "false"]
};
var attr = styleAttributes[group2.style];
node2.setAttribute("scriptlevel", attr[0]);
node2.setAttribute("displaystyle", attr[1]);
return node2;
}
});
htmlBuilderDelegate = /* @__PURE__ */ __name(function htmlBuilderDelegate2(group2, options2) {
var base = group2.base;
if (!base) {
return null;
} else if (base.type === "op") {
var delegate = base.limits && (options2.style.size === Style$1.DISPLAY.size || base.alwaysHandleSupSub);
return delegate ? htmlBuilder$2 : null;
} else if (base.type === "operatorname") {
var _delegate = base.alwaysHandleSupSub && (options2.style.size === Style$1.DISPLAY.size || base.limits);
return _delegate ? htmlBuilder$1 : null;
} else if (base.type === "accent") {
return utils.isCharacterBox(base.base) ? htmlBuilder$a : null;
} else if (base.type === "horizBrace") {
var isSup = !group2.sub;
return isSup === base.isOver ? htmlBuilder$3 : null;
} else {
return null;
}
}, "htmlBuilderDelegate");
defineFunctionBuilders({
type: "supsub",
htmlBuilder(group2, options2) {
var builderDelegate = htmlBuilderDelegate(group2, options2);
if (builderDelegate) {
return builderDelegate(group2, options2);
}
var {
base: valueBase,
sup: valueSup,
sub: valueSub
} = group2;
var base = buildGroup$1(valueBase, options2);
var supm;
var subm;
var metrics = options2.fontMetrics();
var supShift = 0;
var subShift = 0;
var isCharacterBox3 = valueBase && utils.isCharacterBox(valueBase);
if (valueSup) {
var newOptions = options2.havingStyle(options2.style.sup());
supm = buildGroup$1(valueSup, newOptions, options2);
if (!isCharacterBox3) {
supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options2.sizeMultiplier;
}
}
if (valueSub) {
var _newOptions = options2.havingStyle(options2.style.sub());
subm = buildGroup$1(valueSub, _newOptions, options2);
if (!isCharacterBox3) {
subShift = base.depth + _newOptions.fontMetrics().subDrop * _newOptions.sizeMultiplier / options2.sizeMultiplier;
}
}
var minSupShift;
if (options2.style === Style$1.DISPLAY) {
minSupShift = metrics.sup1;
} else if (options2.style.cramped) {
minSupShift = metrics.sup3;
} else {
minSupShift = metrics.sup2;
}
var multiplier = options2.sizeMultiplier;
var marginRight = makeEm(0.5 / metrics.ptPerEm / multiplier);
var marginLeft = null;
if (subm) {
var isOiint = group2.base && group2.base.type === "op" && group2.base.name && (group2.base.name === "\\oiint" || group2.base.name === "\\oiiint");
if (base instanceof SymbolNode || isOiint) {
marginLeft = makeEm(-base.italic);
}
}
var supsub;
if (supm && subm) {
supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
subShift = Math.max(subShift, metrics.sub2);
var ruleWidth = metrics.defaultRuleThickness;
var maxWidth2 = 4 * ruleWidth;
if (supShift - supm.depth - (subm.height - subShift) < maxWidth2) {
subShift = maxWidth2 - (supShift - supm.depth) + subm.height;
var psi = 0.8 * metrics.xHeight - (supShift - supm.depth);
if (psi > 0) {
supShift += psi;
subShift -= psi;
}
}
var vlistElem = [{
type: "elem",
elem: subm,
shift: subShift,
marginRight,
marginLeft
}, {
type: "elem",
elem: supm,
shift: -supShift,
marginRight
}];
supsub = buildCommon.makeVList({
positionType: "individualShift",
children: vlistElem
}, options2);
} else if (subm) {
subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight);
var _vlistElem = [{
type: "elem",
elem: subm,
marginLeft,
marginRight
}];
supsub = buildCommon.makeVList({
positionType: "shift",
positionData: subShift,
children: _vlistElem
}, options2);
} else if (supm) {
supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
supsub = buildCommon.makeVList({
positionType: "shift",
positionData: -supShift,
children: [{
type: "elem",
elem: supm,
marginRight
}]
}, options2);
} else {
throw new Error("supsub must have either sup or sub.");
}
var mclass = getTypeOfDomTree(base, "right") || "mord";
return buildCommon.makeSpan([mclass], [base, buildCommon.makeSpan(["msupsub"], [supsub])], options2);
},
mathmlBuilder(group2, options2) {
var isBrace = false;
var isOver;
var isSup;
if (group2.base && group2.base.type === "horizBrace") {
isSup = !!group2.sup;
if (isSup === group2.base.isOver) {
isBrace = true;
isOver = group2.base.isOver;
}
}
if (group2.base && (group2.base.type === "op" || group2.base.type === "operatorname")) {
group2.base.parentIsSupSub = true;
}
var children2 = [buildGroup2(group2.base, options2)];
if (group2.sub) {
children2.push(buildGroup2(group2.sub, options2));
}
if (group2.sup) {
children2.push(buildGroup2(group2.sup, options2));
}
var nodeType3;
if (isBrace) {
nodeType3 = isOver ? "mover" : "munder";
} else if (!group2.sub) {
var base = group2.base;
if (base && base.type === "op" && base.limits && (options2.style === Style$1.DISPLAY || base.alwaysHandleSupSub)) {
nodeType3 = "mover";
} else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options2.style === Style$1.DISPLAY)) {
nodeType3 = "mover";
} else {
nodeType3 = "msup";
}
} else if (!group2.sup) {
var _base = group2.base;
if (_base && _base.type === "op" && _base.limits && (options2.style === Style$1.DISPLAY || _base.alwaysHandleSupSub)) {
nodeType3 = "munder";
} else if (_base && _base.type === "operatorname" && _base.alwaysHandleSupSub && (_base.limits || options2.style === Style$1.DISPLAY)) {
nodeType3 = "munder";
} else {
nodeType3 = "msub";
}
} else {
var _base2 = group2.base;
if (_base2 && _base2.type === "op" && _base2.limits && options2.style === Style$1.DISPLAY) {
nodeType3 = "munderover";
} else if (_base2 && _base2.type === "operatorname" && _base2.alwaysHandleSupSub && (options2.style === Style$1.DISPLAY || _base2.limits)) {
nodeType3 = "munderover";
} else {
nodeType3 = "msubsup";
}
}
return new mathMLTree.MathNode(nodeType3, children2);
}
});
defineFunctionBuilders({
type: "atom",
htmlBuilder(group2, options2) {
return buildCommon.mathsym(group2.text, group2.mode, options2, ["m" + group2.family]);
},
mathmlBuilder(group2, options2) {
var node2 = new mathMLTree.MathNode("mo", [makeText(group2.text, group2.mode)]);
if (group2.family === "bin") {
var variant = getVariant(group2, options2);
if (variant === "bold-italic") {
node2.setAttribute("mathvariant", variant);
}
} else if (group2.family === "punct") {
node2.setAttribute("separator", "true");
} else if (group2.family === "open" || group2.family === "close") {
node2.setAttribute("stretchy", "false");
}
return node2;
}
});
defaultVariant = {
"mi": "italic",
"mn": "normal",
"mtext": "normal"
};
defineFunctionBuilders({
type: "mathord",
htmlBuilder(group2, options2) {
return buildCommon.makeOrd(group2, options2, "mathord");
},
mathmlBuilder(group2, options2) {
var node2 = new mathMLTree.MathNode("mi", [makeText(group2.text, group2.mode, options2)]);
var variant = getVariant(group2, options2) || "italic";
if (variant !== defaultVariant[node2.type]) {
node2.setAttribute("mathvariant", variant);
}
return node2;
}
});
defineFunctionBuilders({
type: "textord",
htmlBuilder(group2, options2) {
return buildCommon.makeOrd(group2, options2, "textord");
},
mathmlBuilder(group2, options2) {
var text4 = makeText(group2.text, group2.mode, options2);
var variant = getVariant(group2, options2) || "normal";
var node2;
if (group2.mode === "text") {
node2 = new mathMLTree.MathNode("mtext", [text4]);
} else if (/[0-9]/.test(group2.text)) {
node2 = new mathMLTree.MathNode("mn", [text4]);
} else if (group2.text === "\\prime") {
node2 = new mathMLTree.MathNode("mo", [text4]);
} else {
node2 = new mathMLTree.MathNode("mi", [text4]);
}
if (variant !== defaultVariant[node2.type]) {
node2.setAttribute("mathvariant", variant);
}
return node2;
}
});
cssSpace = {
"\\nobreak": "nobreak",
"\\allowbreak": "allowbreak"
};
regularSpace = {
" ": {},
"\\ ": {},
"~": {
className: "nobreak"
},
"\\space": {},
"\\nobreakspace": {
className: "nobreak"
}
};
defineFunctionBuilders({
type: "spacing",
htmlBuilder(group2, options2) {
if (regularSpace.hasOwnProperty(group2.text)) {
var className = regularSpace[group2.text].className || "";
if (group2.mode === "text") {
var ord = buildCommon.makeOrd(group2, options2, "textord");
ord.classes.push(className);
return ord;
} else {
return buildCommon.makeSpan(["mspace", className], [buildCommon.mathsym(group2.text, group2.mode, options2)], options2);
}
} else if (cssSpace.hasOwnProperty(group2.text)) {
return buildCommon.makeSpan(["mspace", cssSpace[group2.text]], [], options2);
} else {
throw new ParseError('Unknown type of space "' + group2.text + '"');
}
},
mathmlBuilder(group2, options2) {
var node2;
if (regularSpace.hasOwnProperty(group2.text)) {
node2 = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode("\xA0")]);
} else if (cssSpace.hasOwnProperty(group2.text)) {
return new mathMLTree.MathNode("mspace");
} else {
throw new ParseError('Unknown type of space "' + group2.text + '"');
}
return node2;
}
});
pad = /* @__PURE__ */ __name(() => {
var padNode = new mathMLTree.MathNode("mtd", []);
padNode.setAttribute("width", "50%");
return padNode;
}, "pad");
defineFunctionBuilders({
type: "tag",
mathmlBuilder(group2, options2) {
var table = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group2.body, options2)]), pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group2.tag, options2)])])]);
table.setAttribute("width", "100%");
return table;
}
});
textFontFamilies = {
"\\text": void 0,
"\\textrm": "textrm",
"\\textsf": "textsf",
"\\texttt": "texttt",
"\\textnormal": "textrm"
};
textFontWeights = {
"\\textbf": "textbf",
"\\textmd": "textmd"
};
textFontShapes = {
"\\textit": "textit",
"\\textup": "textup"
};
optionsWithFont = /* @__PURE__ */ __name((group2, options2) => {
var font = group2.font;
if (!font) {
return options2;
} else if (textFontFamilies[font]) {
return options2.withTextFontFamily(textFontFamilies[font]);
} else if (textFontWeights[font]) {
return options2.withTextFontWeight(textFontWeights[font]);
} else if (font === "\\emph") {
return options2.fontShape === "textit" ? options2.withTextFontShape("textup") : options2.withTextFontShape("textit");
}
return options2.withTextFontShape(textFontShapes[font]);
}, "optionsWithFont");
defineFunction({
type: "text",
names: [
// Font families
"\\text",
"\\textrm",
"\\textsf",
"\\texttt",
"\\textnormal",
// Font weights
"\\textbf",
"\\textmd",
// Font Shapes
"\\textit",
"\\textup",
"\\emph"
],
props: {
numArgs: 1,
argTypes: ["text"],
allowedInArgument: true,
allowedInText: true
},
handler(_ref, args) {
var {
parser: parser24,
funcName
} = _ref;
var body = args[0];
return {
type: "text",
mode: parser24.mode,
body: ordargument(body),
font: funcName
};
},
htmlBuilder(group2, options2) {
var newOptions = optionsWithFont(group2, options2);
var inner2 = buildExpression$1(group2.body, newOptions, true);
return buildCommon.makeSpan(["mord", "text"], inner2, newOptions);
},
mathmlBuilder(group2, options2) {
var newOptions = optionsWithFont(group2, options2);
return buildExpressionRow(group2.body, newOptions);
}
});
defineFunction({
type: "underline",
names: ["\\underline"],
props: {
numArgs: 1,
allowedInText: true
},
handler(_ref, args) {
var {
parser: parser24
} = _ref;
return {
type: "underline",
mode: parser24.mode,
body: args[0]
};
},
htmlBuilder(group2, options2) {
var innerGroup = buildGroup$1(group2.body, options2);
var line2 = buildCommon.makeLineSpan("underline-line", options2);
var defaultRuleThickness = options2.fontMetrics().defaultRuleThickness;
var vlist = buildCommon.makeVList({
positionType: "top",
positionData: innerGroup.height,
children: [{
type: "kern",
size: defaultRuleThickness
}, {
type: "elem",
elem: line2
}, {
type: "kern",
size: 3 * defaultRuleThickness
}, {
type: "elem",
elem: innerGroup
}]
}, options2);
return buildCommon.makeSpan(["mord", "underline"], [vlist], options2);
},
mathmlBuilder(group2, options2) {
var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203E")]);
operator.setAttribute("stretchy", "true");
var node2 = new mathMLTree.MathNode("munder", [buildGroup2(group2.body, options2), operator]);
node2.setAttribute("accentunder", "true");
return node2;
}
});
defineFunction({
type: "vcenter",
names: ["\\vcenter"],
props: {
numArgs: 1,
argTypes: ["original"],
// In LaTeX, \vcenter can act only on a box.
allowedInText: false
},
handler(_ref, args) {
var {
parser: parser24
} = _ref;
return {
type: "vcenter",
mode: parser24.mode,
body: args[0]
};
},
htmlBuilder(group2, options2) {
var body = buildGroup$1(group2.body, options2);
var axisHeight = options2.fontMetrics().axisHeight;
var dy = 0.5 * (body.height - axisHeight - (body.depth + axisHeight));
return buildCommon.makeVList({
positionType: "shift",
positionData: dy,
children: [{
type: "elem",
elem: body
}]
}, options2);
},
mathmlBuilder(group2, options2) {
return new mathMLTree.MathNode("mpadded", [buildGroup2(group2.body, options2)], ["vcenter"]);
}
});
defineFunction({
type: "verb",
names: ["\\verb"],
props: {
numArgs: 0,
allowedInText: true
},
handler(context, args, optArgs) {
throw new ParseError("\\verb ended by end of line instead of matching delimiter");
},
htmlBuilder(group2, options2) {
var text4 = makeVerb(group2);
var body = [];
var newOptions = options2.havingStyle(options2.style.text());
for (var i2 = 0; i2 < text4.length; i2++) {
var c3 = text4[i2];
if (c3 === "~") {
c3 = "\\textasciitilde";
}
body.push(buildCommon.makeSymbol(c3, "Typewriter-Regular", group2.mode, newOptions, ["mord", "texttt"]));
}
return buildCommon.makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options2)), buildCommon.tryCombineChars(body), newOptions);
},
mathmlBuilder(group2, options2) {
var text4 = new mathMLTree.TextNode(makeVerb(group2));
var node2 = new mathMLTree.MathNode("mtext", [text4]);
node2.setAttribute("mathvariant", "monospace");
return node2;
}
});
makeVerb = /* @__PURE__ */ __name((group2) => group2.body.replace(/ /g, group2.star ? "\u2423" : "\xA0"), "makeVerb");
functions = _functions;
spaceRegexString = "[ \r\n ]";
controlWordRegexString = "\\\\[a-zA-Z@]+";
controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]";
controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*";
controlSpaceRegexString = "\\\\(\n|[ \r ]+\n?)[ \r ]*";
combiningDiacriticalMarkString = "[\u0300-\u036F]";
combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$");
tokenRegexString = "(" + spaceRegexString + "+)|" + // whitespace
(controlSpaceRegexString + "|") + // \whitespace
"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + // single codepoint
(combiningDiacriticalMarkString + "*") + // ...plus accents
"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair
(combiningDiacriticalMarkString + "*") + // ...plus accents
"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred
("|" + controlWordWhitespaceRegexString) + // \macroName + spaces
("|" + controlSymbolRegexString + ")");
Lexer = class {
static {
__name(this, "Lexer");
}
// Category codes. The lexer only supports comment characters (14) for now.
// MacroExpander additionally distinguishes active (13).
constructor(input, settings) {
this.input = void 0;
this.settings = void 0;
this.tokenRegex = void 0;
this.catcodes = void 0;
this.input = input;
this.settings = settings;
this.tokenRegex = new RegExp(tokenRegexString, "g");
this.catcodes = {
"%": 14,
// comment character
"~": 13
// active character
};
}
setCatcode(char2, code) {
this.catcodes[char2] = code;
}
/**
* This function lexes a single token.
*/
lex() {
var input = this.input;
var pos = this.tokenRegex.lastIndex;
if (pos === input.length) {
return new Token("EOF", new SourceLocation(this, pos, pos));
}
var match2 = this.tokenRegex.exec(input);
if (match2 === null || match2.index !== pos) {
throw new ParseError("Unexpected character: '" + input[pos] + "'", new Token(input[pos], new SourceLocation(this, pos, pos + 1)));
}
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;
this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)");
} else {
this.tokenRegex.lastIndex = nlIndex + 1;
}
return this.lex();
}
return new Token(text4, new SourceLocation(this, pos, this.tokenRegex.lastIndex));
}
};
Namespace = class {
static {
__name(this, "Namespace");
}
/**
* Both arguments are optional. The first argument is an object of
* built-in mappings which never change. The second argument is an object
* of initial (global-level) mappings, which will constantly change
* according to any global/top-level `set`s done.
*/
constructor(builtins, globalMacros) {
if (builtins === void 0) {
builtins = {};
}
if (globalMacros === void 0) {
globalMacros = {};
}
this.current = void 0;
this.builtins = void 0;
this.undefStack = void 0;
this.current = globalMacros;
this.builtins = builtins;
this.undefStack = [];
}
/**
* Start a new nested group, affecting future local `set`s.
*/
beginGroup() {
this.undefStack.push({});
}
/**
* End current nested group, restoring values before the group began.
*/
endGroup() {
if (this.undefStack.length === 0) {
throw new ParseError("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");
}
var undefs = this.undefStack.pop();
for (var undef2 in undefs) {
if (undefs.hasOwnProperty(undef2)) {
if (undefs[undef2] == null) {
delete this.current[undef2];
} else {
this.current[undef2] = undefs[undef2];
}
}
}
}
/**
* Ends all currently nested groups (if any), restoring values before the
* groups began. Useful in case of an error in the middle of parsing.
*/
endGroups() {
while (this.undefStack.length > 0) {
this.endGroup();
}
}
/**
* Detect whether `name` has a definition. Equivalent to
* `get(name) != null`.
*/
has(name) {
return this.current.hasOwnProperty(name) || this.builtins.hasOwnProperty(name);
}
/**
* Get the current value of a name, or `undefined` if there is no value.
*
* Note: Do not use `if (namespace.get(...))` to detect whether a macro
* is defined, as the definition may be the empty string which evaluates
* to `false` in JavaScript. Use `if (namespace.get(...) != null)` or
* `if (namespace.has(...))`.
*/
get(name) {
if (this.current.hasOwnProperty(name)) {
return this.current[name];
} else {
return this.builtins[name];
}
}
/**
* Set the current value of a name, and optionally set it globally too.
* Local set() sets the current value and (when appropriate) adds an undo
* operation to the undo stack. Global set() may change the undo
* operation at every level, so takes time linear in their number.
* A value of undefined means to delete existing definitions.
*/
set(name, value2, global2) {
if (global2 === void 0) {
global2 = false;
}
if (global2) {
for (var i2 = 0; i2 < this.undefStack.length; i2++) {
delete this.undefStack[i2][name];
}
if (this.undefStack.length > 0) {
this.undefStack[this.undefStack.length - 1][name] = value2;
}
} else {
var top2 = this.undefStack[this.undefStack.length - 1];
if (top2 && !top2.hasOwnProperty(name)) {
top2[name] = this.current[name];
}
}
if (value2 == null) {
delete this.current[name];
} else {
this.current[name] = value2;
}
}
};
macros = _macros;
defineMacro("\\noexpand", function(context) {
var t4 = context.popToken();
if (context.isExpandable(t4.text)) {
t4.noexpand = true;
t4.treatAsRelax = true;
}
return {
tokens: [t4],
numArgs: 0
};
});
defineMacro("\\expandafter", function(context) {
var t4 = context.popToken();
context.expandOnce(true);
return {
tokens: [t4],
numArgs: 0
};
});
defineMacro("\\@firstoftwo", function(context) {
var args = context.consumeArgs(2);
return {
tokens: args[0],
numArgs: 0
};
});
defineMacro("\\@secondoftwo", function(context) {
var args = context.consumeArgs(2);
return {
tokens: args[1],
numArgs: 0
};
});
defineMacro("\\@ifnextchar", function(context) {
var args = context.consumeArgs(3);
context.consumeSpaces();
var nextToken = context.future();
if (args[0].length === 1 && args[0][0].text === nextToken.text) {
return {
tokens: args[1],
numArgs: 0
};
} else {
return {
tokens: args[2],
numArgs: 0
};
}
});
defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
defineMacro("\\TextOrMath", function(context) {
var args = context.consumeArgs(2);
if (context.mode === "text") {
return {
tokens: args[0],
numArgs: 0
};
} else {
return {
tokens: args[1],
numArgs: 0
};
}
});
digitToNumber = {
"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
};
defineMacro("\\char", function(context) {
var token2 = context.popToken();
var base;
var number7 = "";
if (token2.text === "'") {
base = 8;
token2 = context.popToken();
} else if (token2.text === '"') {
base = 16;
token2 = context.popToken();
} else if (token2.text === "`") {
token2 = context.popToken();
if (token2.text[0] === "\\") {
number7 = token2.text.charCodeAt(1);
} else if (token2.text === "EOF") {
throw new ParseError("\\char` missing argument");
} else {
number7 = token2.text.charCodeAt(0);
}
} else {
base = 10;
}
if (base) {
number7 = digitToNumber[token2.text];
if (number7 == null || number7 >= base) {
throw new ParseError("Invalid base-" + base + " digit " + token2.text);
}
var digit;
while ((digit = digitToNumber[context.future().text]) != null && digit < base) {
number7 *= base;
number7 += digit;
context.popToken();
}
}
return "\\@char{" + number7 + "}";
});
newcommand = /* @__PURE__ */ __name((context, existsOK, nonexistsOK, skipIfExists) => {
var arg = context.consumeArg().tokens;
if (arg.length !== 1) {
throw new ParseError("\\newcommand's first argument must be a macro name");
}
var name = arg[0].text;
var exists = context.isDefined(name);
if (exists && !existsOK) {
throw new ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand"));
}
if (!exists && !nonexistsOK) {
throw new ParseError("\\renewcommand{" + name + "} when command " + name + " does not yet exist; use \\newcommand");
}
var numArgs = 0;
arg = context.consumeArg().tokens;
if (arg.length === 1 && arg[0].text === "[") {
var argText = "";
var token2 = context.expandNextToken();
while (token2.text !== "]" && token2.text !== "EOF") {
argText += token2.text;
token2 = context.expandNextToken();
}
if (!argText.match(/^\s*[0-9]+\s*$/)) {
throw new ParseError("Invalid number of arguments: " + argText);
}
numArgs = parseInt(argText);
arg = context.consumeArg().tokens;
}
if (!(exists && skipIfExists)) {
context.macros.set(name, {
tokens: arg,
numArgs
});
}
return "";
}, "newcommand");
defineMacro("\\newcommand", (context) => newcommand(context, false, true, false));
defineMacro("\\renewcommand", (context) => newcommand(context, true, false, false));
defineMacro("\\providecommand", (context) => newcommand(context, true, true, true));
defineMacro("\\message", (context) => {
var arg = context.consumeArgs(1)[0];
console.log(arg.reverse().map((token2) => token2.text).join(""));
return "";
});
defineMacro("\\errmessage", (context) => {
var arg = context.consumeArgs(1)[0];
console.error(arg.reverse().map((token2) => token2.text).join(""));
return "";
});
defineMacro("\\show", (context) => {
var tok = context.popToken();
var name = tok.text;
console.log(tok, context.macros.get(name), functions[name], symbols.math[name], symbols.text[name]);
return "";
});
defineMacro("\\bgroup", "{");
defineMacro("\\egroup", "}");
defineMacro("~", "\\nobreakspace");
defineMacro("\\lq", "`");
defineMacro("\\rq", "'");
defineMacro("\\aa", "\\r a");
defineMacro("\\AA", "\\r A");
defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`\xA9}");
defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");
defineMacro("\u212C", "\\mathscr{B}");
defineMacro("\u2130", "\\mathscr{E}");
defineMacro("\u2131", "\\mathscr{F}");
defineMacro("\u210B", "\\mathscr{H}");
defineMacro("\u2110", "\\mathscr{I}");
defineMacro("\u2112", "\\mathscr{L}");
defineMacro("\u2133", "\\mathscr{M}");
defineMacro("\u211B", "\\mathscr{R}");
defineMacro("\u212D", "\\mathfrak{C}");
defineMacro("\u210C", "\\mathfrak{H}");
defineMacro("\u2128", "\\mathfrak{Z}");
defineMacro("\\Bbbk", "\\Bbb{k}");
defineMacro("\xB7", "\\cdotp");
defineMacro("\\llap", "\\mathllap{\\textrm{#1}}");
defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}");
defineMacro("\\clap", "\\mathclap{\\textrm{#1}}");
defineMacro("\\mathstrut", "\\vphantom{(}");
defineMacro("\\underbar", "\\underline{\\text{#1}}");
defineMacro("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');
defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");
defineMacro("\\ne", "\\neq");
defineMacro("\u2260", "\\neq");
defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");
defineMacro("\u2209", "\\notin");
defineMacro("\u2258", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");
defineMacro("\u2259", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");
defineMacro("\u225A", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");
defineMacro("\u225B", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");
defineMacro("\u225D", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");
defineMacro("\u225E", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");
defineMacro("\u225F", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");
defineMacro("\u27C2", "\\perp");
defineMacro("\u203C", "\\mathclose{!\\mkern-0.8mu!}");
defineMacro("\u220C", "\\notni");
defineMacro("\u231C", "\\ulcorner");
defineMacro("\u231D", "\\urcorner");
defineMacro("\u231E", "\\llcorner");
defineMacro("\u231F", "\\lrcorner");
defineMacro("\xA9", "\\copyright");
defineMacro("\xAE", "\\textregistered");
defineMacro("\uFE0F", "\\textregistered");
defineMacro("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
defineMacro("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
defineMacro("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
defineMacro("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\u22EE", "\\vdots");
defineMacro("\\varGamma", "\\mathit{\\Gamma}");
defineMacro("\\varDelta", "\\mathit{\\Delta}");
defineMacro("\\varTheta", "\\mathit{\\Theta}");
defineMacro("\\varLambda", "\\mathit{\\Lambda}");
defineMacro("\\varXi", "\\mathit{\\Xi}");
defineMacro("\\varPi", "\\mathit{\\Pi}");
defineMacro("\\varSigma", "\\mathit{\\Sigma}");
defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}");
defineMacro("\\varPhi", "\\mathit{\\Phi}");
defineMacro("\\varPsi", "\\mathit{\\Psi}");
defineMacro("\\varOmega", "\\mathit{\\Omega}");
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
dotsByToken = {
",": "\\dotsc",
"\\not": "\\dotsb",
// \keybin@ checks for the following:
"+": "\\dotsb",
"=": "\\dotsb",
"<": "\\dotsb",
">": "\\dotsb",
"-": "\\dotsb",
"*": "\\dotsb",
":": "\\dotsb",
// Symbols whose definition starts with \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",
// Symbols whose definition starts with \mathbin:
"\\mathbin": "\\dotsb",
// Symbols whose definition starts with \mathrel:
"\\mathrel": "\\dotsb",
"\\relbar": "\\dotsb",
"\\Relbar": "\\dotsb",
"\\xrightarrow": "\\dotsb",
"\\xleftarrow": "\\dotsb",
// Symbols whose definition starts with \DOTSI:
"\\DOTSI": "\\dotsi",
"\\int": "\\dotsi",
"\\oint": "\\dotsi",
"\\iint": "\\dotsi",
"\\iiint": "\\dotsi",
"\\iiiint": "\\dotsi",
"\\idotsint": "\\dotsi",
// Symbols whose definition starts with \DOTSX:
"\\DOTSX": "\\dotsx"
};
defineMacro("\\dots", function(context) {
var thedots = "\\dotso";
var next3 = context.expandAfterFuture().text;
if (next3 in dotsByToken) {
thedots = dotsByToken[next3];
} else if (next3.slice(0, 4) === "\\not") {
thedots = "\\dotsb";
} else if (next3 in symbols.math) {
if (utils.contains(["bin", "rel"], symbols.math[next3].group)) {
thedots = "\\dotsb";
}
}
return thedots;
});
spaceAfterDots = {
// \rightdelim@ checks for the following:
")": true,
"]": true,
"\\rbrack": true,
"\\}": true,
"\\rbrace": true,
"\\rangle": true,
"\\rceil": true,
"\\rfloor": true,
"\\rgroup": true,
"\\rmoustache": true,
"\\right": true,
"\\bigr": true,
"\\biggr": true,
"\\Bigr": true,
"\\Biggr": true,
// \extra@ also tests for the following:
"$": true,
// \extrap@ checks for the following:
";": true,
".": true,
",": true
};
defineMacro("\\dotso", function(context) {
var next3 = context.future().text;
if (next3 in spaceAfterDots) {
return "\\ldots\\,";
} else {
return "\\ldots";
}
});
defineMacro("\\dotsc", function(context) {
var next3 = context.future().text;
if (next3 in spaceAfterDots && next3 !== ",") {
return "\\ldots\\,";
} else {
return "\\ldots";
}
});
defineMacro("\\cdots", function(context) {
var next3 = context.future().text;
if (next3 in spaceAfterDots) {
return "\\@cdots\\,";
} else {
return "\\@cdots";
}
});
defineMacro("\\dotsb", "\\cdots");
defineMacro("\\dotsm", "\\cdots");
defineMacro("\\dotsi", "\\!\\cdots");
defineMacro("\\dotsx", "\\ldots\\,");
defineMacro("\\DOTSI", "\\relax");
defineMacro("\\DOTSB", "\\relax");
defineMacro("\\DOTSX", "\\relax");
defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");
defineMacro("\\thinspace", "\\,");
defineMacro("\\>", "\\mskip{4mu}");
defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");
defineMacro("\\medspace", "\\:");
defineMacro("\\;", "\\tmspace+{5mu}{.2777em}");
defineMacro("\\thickspace", "\\;");
defineMacro("\\!", "\\tmspace-{3mu}{.1667em}");
defineMacro("\\negthinspace", "\\!");
defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}");
defineMacro("\\enspace", "\\kern.5em ");
defineMacro("\\enskip", "\\hskip.5em\\relax");
defineMacro("\\quad", "\\hskip1em\\relax");
defineMacro("\\qquad", "\\hskip2em\\relax");
defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
defineMacro("\\tag@paren", "\\tag@literal{({#1})}");
defineMacro("\\tag@literal", (context) => {
if (context.macros.get("\\df@tag")) {
throw new ParseError("Multiple \\tag");
}
return "\\gdef\\df@tag{\\text{#1}}";
});
defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
defineMacro("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
defineMacro("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");
defineMacro("\\newline", "\\\\\\relax");
defineMacro("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");
latexRaiseA = makeEm(fontMetricsData["Main-Regular"]["T".charCodeAt(0)][1] - 0.7 * fontMetricsData["Main-Regular"]["A".charCodeAt(0)][1]);
defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
defineMacro("\\@hspace", "\\hskip #1\\relax");
defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
defineMacro("\\ordinarycolon", ":");
defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
defineMacro("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');
defineMacro("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');
defineMacro("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');
defineMacro("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');
defineMacro("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');
defineMacro("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');
defineMacro("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');
defineMacro("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');
defineMacro("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');
defineMacro("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');
defineMacro("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');
defineMacro("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');
defineMacro("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');
defineMacro("\u2237", "\\dblcolon");
defineMacro("\u2239", "\\eqcolon");
defineMacro("\u2254", "\\coloneqq");
defineMacro("\u2255", "\\eqqcolon");
defineMacro("\u2A74", "\\Coloneqq");
defineMacro("\\ratio", "\\vcentcolon");
defineMacro("\\coloncolon", "\\dblcolon");
defineMacro("\\colonequals", "\\coloneqq");
defineMacro("\\coloncolonequals", "\\Coloneqq");
defineMacro("\\equalscolon", "\\eqqcolon");
defineMacro("\\equalscoloncolon", "\\Eqqcolon");
defineMacro("\\colonminus", "\\coloneq");
defineMacro("\\coloncolonminus", "\\Coloneq");
defineMacro("\\minuscolon", "\\eqcolon");
defineMacro("\\minuscoloncolon", "\\Eqcolon");
defineMacro("\\coloncolonapprox", "\\Colonapprox");
defineMacro("\\coloncolonsim", "\\Colonsim");
defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");
defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{\u2269}");
defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{\u2268}");
defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{\u2271}");
defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{\u2271}");
defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{\u2270}");
defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{\u2270}");
defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{\u2224}");
defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{\u2226}");
defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{\u2288}");
defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{\u2289}");
defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{\u228A}");
defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{\u2ACB}");
defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{\u228B}");
defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{\u2ACC}");
defineMacro("\\imath", "\\html@mathml{\\@imath}{\u0131}");
defineMacro("\\jmath", "\\html@mathml{\\@jmath}{\u0237}");
defineMacro("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");
defineMacro("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");
defineMacro("\u27E6", "\\llbracket");
defineMacro("\u27E7", "\\rrbracket");
defineMacro("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");
defineMacro("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");
defineMacro("\u2983", "\\lBrace");
defineMacro("\u2984", "\\rBrace");
defineMacro("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");
defineMacro("\u29B5", "\\minuso");
defineMacro("\\darr", "\\downarrow");
defineMacro("\\dArr", "\\Downarrow");
defineMacro("\\Darr", "\\Downarrow");
defineMacro("\\lang", "\\langle");
defineMacro("\\rang", "\\rangle");
defineMacro("\\uarr", "\\uparrow");
defineMacro("\\uArr", "\\Uparrow");
defineMacro("\\Uarr", "\\Uparrow");
defineMacro("\\N", "\\mathbb{N}");
defineMacro("\\R", "\\mathbb{R}");
defineMacro("\\Z", "\\mathbb{Z}");
defineMacro("\\alef", "\\aleph");
defineMacro("\\alefsym", "\\aleph");
defineMacro("\\Alpha", "\\mathrm{A}");
defineMacro("\\Beta", "\\mathrm{B}");
defineMacro("\\bull", "\\bullet");
defineMacro("\\Chi", "\\mathrm{X}");
defineMacro("\\clubs", "\\clubsuit");
defineMacro("\\cnums", "\\mathbb{C}");
defineMacro("\\Complex", "\\mathbb{C}");
defineMacro("\\Dagger", "\\ddagger");
defineMacro("\\diamonds", "\\diamondsuit");
defineMacro("\\empty", "\\emptyset");
defineMacro("\\Epsilon", "\\mathrm{E}");
defineMacro("\\Eta", "\\mathrm{H}");
defineMacro("\\exist", "\\exists");
defineMacro("\\harr", "\\leftrightarrow");
defineMacro("\\hArr", "\\Leftrightarrow");
defineMacro("\\Harr", "\\Leftrightarrow");
defineMacro("\\hearts", "\\heartsuit");
defineMacro("\\image", "\\Im");
defineMacro("\\infin", "\\infty");
defineMacro("\\Iota", "\\mathrm{I}");
defineMacro("\\isin", "\\in");
defineMacro("\\Kappa", "\\mathrm{K}");
defineMacro("\\larr", "\\leftarrow");
defineMacro("\\lArr", "\\Leftarrow");
defineMacro("\\Larr", "\\Leftarrow");
defineMacro("\\lrarr", "\\leftrightarrow");
defineMacro("\\lrArr", "\\Leftrightarrow");
defineMacro("\\Lrarr", "\\Leftrightarrow");
defineMacro("\\Mu", "\\mathrm{M}");
defineMacro("\\natnums", "\\mathbb{N}");
defineMacro("\\Nu", "\\mathrm{N}");
defineMacro("\\Omicron", "\\mathrm{O}");
defineMacro("\\plusmn", "\\pm");
defineMacro("\\rarr", "\\rightarrow");
defineMacro("\\rArr", "\\Rightarrow");
defineMacro("\\Rarr", "\\Rightarrow");
defineMacro("\\real", "\\Re");
defineMacro("\\reals", "\\mathbb{R}");
defineMacro("\\Reals", "\\mathbb{R}");
defineMacro("\\Rho", "\\mathrm{P}");
defineMacro("\\sdot", "\\cdot");
defineMacro("\\sect", "\\S");
defineMacro("\\spades", "\\spadesuit");
defineMacro("\\sub", "\\subset");
defineMacro("\\sube", "\\subseteq");
defineMacro("\\supe", "\\supseteq");
defineMacro("\\Tau", "\\mathrm{T}");
defineMacro("\\thetasym", "\\vartheta");
defineMacro("\\weierp", "\\wp");
defineMacro("\\Zeta", "\\mathrm{Z}");
defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
defineMacro("\\bra", "\\mathinner{\\langle{#1}|}");
defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}");
defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
defineMacro("\\Bra", "\\left\\langle#1\\right|");
defineMacro("\\Ket", "\\left|#1\\right\\rangle");
braketHelper = /* @__PURE__ */ __name((one4) => (context) => {
var left3 = context.consumeArg().tokens;
var middle = context.consumeArg().tokens;
var middleDouble = context.consumeArg().tokens;
var right3 = context.consumeArg().tokens;
var oldMiddle = context.macros.get("|");
var oldMiddleDouble = context.macros.get("\\|");
context.macros.beginGroup();
var midMacro = /* @__PURE__ */ __name((double) => (context2) => {
if (one4) {
context2.macros.set("|", oldMiddle);
if (middleDouble.length) {
context2.macros.set("\\|", oldMiddleDouble);
}
}
var doubled = double;
if (!double && middleDouble.length) {
var nextToken = context2.future();
if (nextToken.text === "|") {
context2.popToken();
doubled = true;
}
}
return {
tokens: doubled ? middleDouble : middle,
numArgs: 0
};
}, "midMacro");
context.macros.set("|", midMacro(false));
if (middleDouble.length) {
context.macros.set("\\|", midMacro(true));
}
var arg = context.consumeArg().tokens;
var expanded = context.expandTokens([
...right3,
...arg,
...left3
// reversed
]);
context.macros.endGroup();
return {
tokens: expanded.reverse(),
numArgs: 0
};
}, "braketHelper");
defineMacro("\\bra@ket", braketHelper(false));
defineMacro("\\bra@set", braketHelper(true));
defineMacro("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
defineMacro("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
defineMacro("\\angln", "{\\angl n}");
defineMacro("\\blue", "\\textcolor{##6495ed}{#1}");
defineMacro("\\orange", "\\textcolor{##ffa500}{#1}");
defineMacro("\\pink", "\\textcolor{##ff00af}{#1}");
defineMacro("\\red", "\\textcolor{##df0030}{#1}");
defineMacro("\\green", "\\textcolor{##28ae7b}{#1}");
defineMacro("\\gray", "\\textcolor{gray}{#1}");
defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}");
defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}");
defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}");
defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}");
defineMacro("\\blueD", "\\textcolor{##11accd}{#1}");
defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}");
defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}");
defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}");
defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}");
defineMacro("\\tealD", "\\textcolor{##01a995}{#1}");
defineMacro("\\tealE", "\\textcolor{##208170}{#1}");
defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}");
defineMacro("\\greenB", "\\textcolor{##8af281}{#1}");
defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}");
defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}");
defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}");
defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}");
defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}");
defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}");
defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}");
defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}");
defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}");
defineMacro("\\redB", "\\textcolor{##ff8482}{#1}");
defineMacro("\\redC", "\\textcolor{##f9685d}{#1}");
defineMacro("\\redD", "\\textcolor{##e84d39}{#1}");
defineMacro("\\redE", "\\textcolor{##bc2612}{#1}");
defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}");
defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}");
defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}");
defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}");
defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}");
defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}");
defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}");
defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}");
defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}");
defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}");
defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}");
defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}");
defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}");
defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}");
defineMacro("\\grayE", "\\textcolor{##babec2}{#1}");
defineMacro("\\grayF", "\\textcolor{##888d93}{#1}");
defineMacro("\\grayG", "\\textcolor{##626569}{#1}");
defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}");
defineMacro("\\grayI", "\\textcolor{##21242c}{#1}");
defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}");
defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}");
implicitCommands = {
"^": true,
// Parser.js
"_": true,
// Parser.js
"\\limits": true,
// Parser.js
"\\nolimits": true
// Parser.js
};
MacroExpander = class {
static {
__name(this, "MacroExpander");
}
constructor(input, settings, mode) {
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 = settings;
this.expansionCount = 0;
this.feed(input);
this.macros = new Namespace(macros, settings.macros);
this.mode = mode;
this.stack = [];
}
/**
* Feed a new input string to the same MacroExpander
* (with existing macros etc.).
*/
feed(input) {
this.lexer = new Lexer(input, this.settings);
}
/**
* Switches between "text" and "math" modes.
*/
switchMode(newMode) {
this.mode = newMode;
}
/**
* Start a new group nesting within all namespaces.
*/
beginGroup() {
this.macros.beginGroup();
}
/**
* End current group nesting within all namespaces.
*/
endGroup() {
this.macros.endGroup();
}
/**
* Ends all currently nested groups (if any), restoring values before the
* groups began. Useful in case of an error in the middle of parsing.
*/
endGroups() {
this.macros.endGroups();
}
/**
* Returns the topmost token on the stack, without expanding it.
* Similar in behavior to TeX's `\futurelet`.
*/
future() {
if (this.stack.length === 0) {
this.pushToken(this.lexer.lex());
}
return this.stack[this.stack.length - 1];
}
/**
* Remove and return the next unexpanded token.
*/
popToken() {
this.future();
return this.stack.pop();
}
/**
* Add a given token to the token stack. In particular, this get be used
* to put back a token returned from one of the other methods.
*/
pushToken(token2) {
this.stack.push(token2);
}
/**
* Append an array of tokens to the token stack.
*/
pushTokens(tokens2) {
this.stack.push(...tokens2);
}
/**
* Find an macro argument without expanding tokens and append the array of
* tokens to the token stack. Uses Token as a container for the result.
*/
scanArgument(isOptional) {
var start3;
var end2;
var tokens2;
if (isOptional) {
this.consumeSpaces();
if (this.future().text !== "[") {
return null;
}
start3 = this.popToken();
({
tokens: tokens2,
end: end2
} = this.consumeArg(["]"]));
} else {
({
tokens: tokens2,
start: start3,
end: end2
} = this.consumeArg());
}
this.pushToken(new Token("EOF", end2.loc));
this.pushTokens(tokens2);
return start3.range(end2, "");
}
/**
* Consume all following space tokens, without expansion.
*/
consumeSpaces() {
for (; ; ) {
var token2 = this.future();
if (token2.text === " ") {
this.stack.pop();
} else {
break;
}
}
}
/**
* Consume an argument from the token stream, and return the resulting array
* of tokens and start/end token.
*/
consumeArg(delims) {
var tokens2 = [];
var isDelimited = delims && delims.length > 0;
if (!isDelimited) {
this.consumeSpaces();
}
var start3 = this.future();
var tok;
var depth = 0;
var match2 = 0;
do {
tok = this.popToken();
tokens2.push(tok);
if (tok.text === "{") {
++depth;
} else if (tok.text === "}") {
--depth;
if (depth === -1) {
throw new ParseError("Extra }", tok);
}
} else if (tok.text === "EOF") {
throw new ParseError("Unexpected end of input in a macro argument, expected '" + (delims && isDelimited ? delims[match2] : "}") + "'", tok);
}
if (delims && isDelimited) {
if ((depth === 0 || depth === 1 && delims[match2] === "{") && tok.text === delims[match2]) {
++match2;
if (match2 === delims.length) {
tokens2.splice(-match2, match2);
break;
}
} else {
match2 = 0;
}
}
} while (depth !== 0 || isDelimited);
if (start3.text === "{" && tokens2[tokens2.length - 1].text === "}") {
tokens2.pop();
tokens2.shift();
}
tokens2.reverse();
return {
tokens: tokens2,
start: start3,
end: tok
};
}
/**
* Consume the specified number of (delimited) arguments from the token
* stream and return the resulting array of arguments.
*/
consumeArgs(numArgs, delimiters2) {
if (delimiters2) {
if (delimiters2.length !== numArgs + 1) {
throw new ParseError("The length of delimiters doesn't match the number of args!");
}
var delims = delimiters2[0];
for (var i2 = 0; i2 < delims.length; i2++) {
var tok = this.popToken();
if (delims[i2] !== tok.text) {
throw new ParseError("Use of the macro doesn't match its definition", tok);
}
}
}
var args = [];
for (var _i = 0; _i < numArgs; _i++) {
args.push(this.consumeArg(delimiters2 && delimiters2[_i + 1]).tokens);
}
return args;
}
/**
* Increment `expansionCount` by the specified amount.
* Throw an error if it exceeds `maxExpand`.
*/
countExpansion(amount) {
this.expansionCount += amount;
if (this.expansionCount > this.settings.maxExpand) {
throw new ParseError("Too many expansions: infinite loop or need to increase maxExpand setting");
}
}
/**
* Expand the next token only once if possible.
*
* If the token is expanded, the resulting tokens will be pushed onto
* the stack in reverse order, and the number of such tokens will be
* returned. This number might be zero or positive.
*
* If not, the return value is `false`, and the next token remains at the
* top of the stack.
*
* In either case, the next token will be on the top of the stack,
* or the stack will be empty (in case of empty expansion
* and no other tokens).
*
* Used to implement `expandAfterFuture` and `expandNextToken`.
*
* If expandableOnly, only expandable tokens are expanded and
* an undefined control sequence results in an error.
*/
expandOnce(expandableOnly) {
var topToken = this.popToken();
var name = topToken.text;
var expansion = !topToken.noexpand ? this._getExpansion(name) : null;
if (expansion == null || expandableOnly && expansion.unexpandable) {
if (expandableOnly && expansion == null && name[0] === "\\" && !this.isDefined(name)) {
throw new ParseError("Undefined control sequence: " + name);
}
this.pushToken(topToken);
return false;
}
this.countExpansion(1);
var tokens2 = expansion.tokens;
var args = this.consumeArgs(expansion.numArgs, expansion.delimiters);
if (expansion.numArgs) {
tokens2 = tokens2.slice();
for (var i2 = tokens2.length - 1; i2 >= 0; --i2) {
var tok = tokens2[i2];
if (tok.text === "#") {
if (i2 === 0) {
throw new ParseError("Incomplete placeholder at end of macro body", tok);
}
tok = tokens2[--i2];
if (tok.text === "#") {
tokens2.splice(i2 + 1, 1);
} else if (/^[1-9]$/.test(tok.text)) {
tokens2.splice(i2, 2, ...args[+tok.text - 1]);
} else {
throw new ParseError("Not a valid argument number", tok);
}
}
}
}
this.pushTokens(tokens2);
return tokens2.length;
}
/**
* Expand the next token only once (if possible), and return the resulting
* top token on the stack (without removing anything from the stack).
* Similar in behavior to TeX's `\expandafter\futurelet`.
* Equivalent to expandOnce() followed by future().
*/
expandAfterFuture() {
this.expandOnce();
return this.future();
}
/**
* Recursively expand first token, then return first non-expandable token.
*/
expandNextToken() {
for (; ; ) {
if (this.expandOnce() === false) {
var token2 = this.stack.pop();
if (token2.treatAsRelax) {
token2.text = "\\relax";
}
return token2;
}
}
throw new Error();
}
/**
* Fully expand the given macro name and return the resulting list of
* tokens, or return `undefined` if no such macro is defined.
*/
expandMacro(name) {
return this.macros.has(name) ? this.expandTokens([new Token(name)]) : void 0;
}
/**
* Fully expand the given token stream and return the resulting list of
* tokens. Note that the input tokens are in reverse order, but the
* output tokens are in forward order.
*/
expandTokens(tokens2) {
var output2 = [];
var oldStackLength = this.stack.length;
this.pushTokens(tokens2);
while (this.stack.length > oldStackLength) {
if (this.expandOnce(true) === false) {
var token2 = this.stack.pop();
if (token2.treatAsRelax) {
token2.noexpand = false;
token2.treatAsRelax = false;
}
output2.push(token2);
}
}
this.countExpansion(output2.length);
return output2;
}
/**
* Fully expand the given macro name and return the result as a string,
* or return `undefined` if no such macro is defined.
*/
expandMacroAsText(name) {
var tokens2 = this.expandMacro(name);
if (tokens2) {
return tokens2.map((token2) => token2.text).join("");
} else {
return tokens2;
}
}
/**
* Returns the expanded macro as a reversed array of tokens and a macro
* argument count. Or returns `null` if no such macro.
*/
_getExpansion(name) {
var definition = this.macros.get(name);
if (definition == null) {
return definition;
}
if (name.length === 1) {
var catcode = this.lexer.catcodes[name];
if (catcode != null && catcode !== 13) {
return;
}
}
var expansion = typeof definition === "function" ? definition(this) : definition;
if (typeof expansion === "string") {
var numArgs = 0;
if (expansion.indexOf("#") !== -1) {
var stripped = expansion.replace(/##/g, "");
while (stripped.indexOf("#" + (numArgs + 1)) !== -1) {
++numArgs;
}
}
var bodyLexer = new Lexer(expansion, this.settings);
var tokens2 = [];
var tok = bodyLexer.lex();
while (tok.text !== "EOF") {
tokens2.push(tok);
tok = bodyLexer.lex();
}
tokens2.reverse();
var expanded = {
tokens: tokens2,
numArgs
};
return expanded;
}
return expansion;
}
/**
* Determine whether a command is currently "defined" (has some
* functionality), meaning that it's a macro (in the current group),
* a function, a symbol, or one of the special commands listed in
* `implicitCommands`.
*/
isDefined(name) {
return this.macros.has(name) || functions.hasOwnProperty(name) || symbols.math.hasOwnProperty(name) || symbols.text.hasOwnProperty(name) || implicitCommands.hasOwnProperty(name);
}
/**
* Determine whether a command is expandable.
*/
isExpandable(name) {
var macro = this.macros.get(name);
return macro != null ? typeof macro === "string" || typeof macro === "function" || !macro.unexpandable : functions.hasOwnProperty(name) && !functions[name].primitive;
}
};
unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;
uSubsAndSups = 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"
});
unicodeAccents = {
"\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"
}
};
unicodeSymbols = {
"\xE1": "a\u0301",
"\xE0": "a\u0300",
"\xE4": "a\u0308",
"\u01DF": "a\u0308\u0304",
"\xE3": "a\u0303",
"\u0101": "a\u0304",
"\u0103": "a\u0306",
"\u1EAF": "a\u0306\u0301",
"\u1EB1": "a\u0306\u0300",
"\u1EB5": "a\u0306\u0303",
"\u01CE": "a\u030C",
"\xE2": "a\u0302",
"\u1EA5": "a\u0302\u0301",
"\u1EA7": "a\u0302\u0300",
"\u1EAB": "a\u0302\u0303",
"\u0227": "a\u0307",
"\u01E1": "a\u0307\u0304",
"\xE5": "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",
"\xE7": "c\u0327",
"\u010F": "d\u030C",
"\u1E0B": "d\u0307",
"\u1E11": "d\u0327",
"\xE9": "e\u0301",
"\xE8": "e\u0300",
"\xEB": "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",
"\xEA": "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",
"\xED": "i\u0301",
"\xEC": "i\u0300",
"\xEF": "i\u0308",
"\u1E2F": "i\u0308\u0301",
"\u0129": "i\u0303",
"\u012B": "i\u0304",
"\u012D": "i\u0306",
"\u01D0": "i\u030C",
"\xEE": "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",
"\xF1": "n\u0303",
"\u0148": "n\u030C",
"\u1E45": "n\u0307",
"\u0146": "n\u0327",
"\xF3": "o\u0301",
"\xF2": "o\u0300",
"\xF6": "o\u0308",
"\u022B": "o\u0308\u0304",
"\xF5": "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",
"\xF4": "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",
"\xFA": "u\u0301",
"\xF9": "u\u0300",
"\xFC": "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",
"\xFB": "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",
"\xFD": "y\u0301",
"\u1EF3": "y\u0300",
"\xFF": "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",
"\xC1": "A\u0301",
"\xC0": "A\u0300",
"\xC4": "A\u0308",
"\u01DE": "A\u0308\u0304",
"\xC3": "A\u0303",
"\u0100": "A\u0304",
"\u0102": "A\u0306",
"\u1EAE": "A\u0306\u0301",
"\u1EB0": "A\u0306\u0300",
"\u1EB4": "A\u0306\u0303",
"\u01CD": "A\u030C",
"\xC2": "A\u0302",
"\u1EA4": "A\u0302\u0301",
"\u1EA6": "A\u0302\u0300",
"\u1EAA": "A\u0302\u0303",
"\u0226": "A\u0307",
"\u01E0": "A\u0307\u0304",
"\xC5": "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",
"\xC7": "C\u0327",
"\u010E": "D\u030C",
"\u1E0A": "D\u0307",
"\u1E10": "D\u0327",
"\xC9": "E\u0301",
"\xC8": "E\u0300",
"\xCB": "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",
"\xCA": "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",
"\xCD": "I\u0301",
"\xCC": "I\u0300",
"\xCF": "I\u0308",
"\u1E2E": "I\u0308\u0301",
"\u0128": "I\u0303",
"\u012A": "I\u0304",
"\u012C": "I\u0306",
"\u01CF": "I\u030C",
"\xCE": "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",
"\xD1": "N\u0303",
"\u0147": "N\u030C",
"\u1E44": "N\u0307",
"\u0145": "N\u0327",
"\xD3": "O\u0301",
"\xD2": "O\u0300",
"\xD6": "O\u0308",
"\u022A": "O\u0308\u0304",
"\xD5": "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",
"\xD4": "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",
"\xDA": "U\u0301",
"\xD9": "U\u0300",
"\xDC": "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",
"\xDB": "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",
"\xDD": "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"
};
Parser = class _Parser {
static {
__name(this, "Parser");
}
constructor(input, settings) {
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 MacroExpander(input, settings, this.mode);
this.settings = settings;
this.leftrightDepth = 0;
}
/**
* Checks a result to make sure it has the right type, and throws an
* appropriate error otherwise.
*/
expect(text4, consume) {
if (consume === void 0) {
consume = true;
}
if (this.fetch().text !== text4) {
throw new ParseError("Expected '" + text4 + "', got '" + this.fetch().text + "'", this.fetch());
}
if (consume) {
this.consume();
}
}
/**
* Discards the current lookahead token, considering it consumed.
*/
consume() {
this.nextToken = null;
}
/**
* Return the current lookahead token, or if there isn't one (at the
* beginning, or if the previous lookahead token was consume()d),
* fetch the next token as the new lookahead token and return it.
*/
fetch() {
if (this.nextToken == null) {
this.nextToken = this.gullet.expandNextToken();
}
return this.nextToken;
}
/**
* Switches between "text" and "math" modes.
*/
switchMode(newMode) {
this.mode = newMode;
this.gullet.switchMode(newMode);
}
/**
* Main parsing function, which parses an entire input.
*/
parse() {
if (!this.settings.globalGroup) {
this.gullet.beginGroup();
}
if (this.settings.colorIsTextColor) {
this.gullet.macros.set("\\color", "\\textcolor");
}
try {
var parse7 = this.parseExpression(false);
this.expect("EOF");
if (!this.settings.globalGroup) {
this.gullet.endGroup();
}
return parse7;
} finally {
this.gullet.endGroups();
}
}
/**
* Fully parse a separate sequence of tokens as a separate job.
* Tokens should be specified in reverse order, as in a MacroDefinition.
*/
subparse(tokens2) {
var oldToken = this.nextToken;
this.consume();
this.gullet.pushToken(new Token("}"));
this.gullet.pushTokens(tokens2);
var parse7 = this.parseExpression(false);
this.expect("}");
this.nextToken = oldToken;
return parse7;
}
/**
* Parses an "expression", which is a list of atoms.
*
* `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
* happens when functions have higher precedence han infix
* nodes in implicit parses.
*
* `breakOnTokenText`: The text of the token that the expression should end
* with, or `null` if something else should end the
* expression.
*/
parseExpression(breakOnInfix, breakOnTokenText) {
var body = [];
while (true) {
if (this.mode === "math") {
this.consumeSpaces();
}
var lex = this.fetch();
if (_Parser.endOfExpression.indexOf(lex.text) !== -1) {
break;
}
if (breakOnTokenText && lex.text === breakOnTokenText) {
break;
}
if (breakOnInfix && functions[lex.text] && functions[lex.text].infix) {
break;
}
var atom2 = this.parseAtom(breakOnTokenText);
if (!atom2) {
break;
} else if (atom2.type === "internal") {
continue;
}
body.push(atom2);
}
if (this.mode === "text") {
this.formLigatures(body);
}
return this.handleInfixNodes(body);
}
/**
* Rewrites infix operators such as \over with corresponding commands such
* as \frac.
*
* There can only be one infix operator per group. If there's more than one
* then the expression is ambiguous. This can be resolved by adding {}.
*/
handleInfixNodes(body) {
var overIndex = -1;
var funcName;
for (var i2 = 0; i2 < body.length; i2++) {
if (body[i2].type === "infix") {
if (overIndex !== -1) {
throw new ParseError("only one infix operator per group", body[i2].token);
}
overIndex = i2;
funcName = body[i2].replaceWith;
}
}
if (overIndex !== -1 && funcName) {
var numerNode;
var denomNode;
var numerBody = body.slice(0, overIndex);
var denomBody = body.slice(overIndex + 1);
if (numerBody.length === 1 && numerBody[0].type === "ordgroup") {
numerNode = numerBody[0];
} else {
numerNode = {
type: "ordgroup",
mode: this.mode,
body: numerBody
};
}
if (denomBody.length === 1 && denomBody[0].type === "ordgroup") {
denomNode = denomBody[0];
} else {
denomNode = {
type: "ordgroup",
mode: this.mode,
body: denomBody
};
}
var node2;
if (funcName === "\\\\abovefrac") {
node2 = this.callFunction(funcName, [numerNode, body[overIndex], denomNode], []);
} else {
node2 = this.callFunction(funcName, [numerNode, denomNode], []);
}
return [node2];
} else {
return body;
}
}
/**
* Handle a subscript or superscript with nice errors.
*/
handleSupSubscript(name) {
var symbolToken = this.fetch();
var symbol = symbolToken.text;
this.consume();
this.consumeSpaces();
var group2;
do {
var _group;
group2 = this.parseGroup(name);
} while (((_group = group2) == null ? void 0 : _group.type) === "internal");
if (!group2) {
throw new ParseError("Expected group after '" + symbol + "'", symbolToken);
}
return group2;
}
/**
* Converts the textual input of an unsupported command into a text node
* contained within a color node whose color is determined by errorColor
*/
formatUnsupportedCmd(text4) {
var textordArray = [];
for (var i2 = 0; i2 < text4.length; i2++) {
textordArray.push({
type: "textord",
mode: "text",
text: text4[i2]
});
}
var textNode = {
type: "text",
mode: this.mode,
body: textordArray
};
var colorNode = {
type: "color",
mode: this.mode,
color: this.settings.errorColor,
body: [textNode]
};
return colorNode;
}
/**
* Parses a group with optional super/subscripts.
*/
parseAtom(breakOnTokenText) {
var base = this.parseGroup("atom", breakOnTokenText);
if ((base == null ? void 0 : base.type) === "internal") {
return base;
}
if (this.mode === "text") {
return base;
}
var superscript;
var subscript;
while (true) {
this.consumeSpaces();
var lex = this.fetch();
if (lex.text === "\\limits" || lex.text === "\\nolimits") {
if (base && base.type === "op") {
var limits = lex.text === "\\limits";
base.limits = limits;
base.alwaysHandleSupSub = true;
} else if (base && base.type === "operatorname") {
if (base.alwaysHandleSupSub) {
base.limits = lex.text === "\\limits";
}
} else {
throw new ParseError("Limit controls must follow a math operator", lex);
}
this.consume();
} else if (lex.text === "^") {
if (superscript) {
throw new ParseError("Double superscript", lex);
}
superscript = this.handleSupSubscript("superscript");
} else if (lex.text === "_") {
if (subscript) {
throw new ParseError("Double subscript", lex);
}
subscript = this.handleSupSubscript("subscript");
} else if (lex.text === "'") {
if (superscript) {
throw new ParseError("Double superscript", lex);
}
var prime = {
type: "textord",
mode: this.mode,
text: "\\prime"
};
var primes = [prime];
this.consume();
while (this.fetch().text === "'") {
primes.push(prime);
this.consume();
}
if (this.fetch().text === "^") {
primes.push(this.handleSupSubscript("superscript"));
}
superscript = {
type: "ordgroup",
mode: this.mode,
body: primes
};
} else if (uSubsAndSups[lex.text]) {
var isSub = unicodeSubRegEx.test(lex.text);
var subsupTokens = [];
subsupTokens.push(new Token(uSubsAndSups[lex.text]));
this.consume();
while (true) {
var token2 = this.fetch().text;
if (!uSubsAndSups[token2]) {
break;
}
if (unicodeSubRegEx.test(token2) !== isSub) {
break;
}
subsupTokens.unshift(new Token(uSubsAndSups[token2]));
this.consume();
}
var body = this.subparse(subsupTokens);
if (isSub) {
subscript = {
type: "ordgroup",
mode: "math",
body
};
} else {
superscript = {
type: "ordgroup",
mode: "math",
body
};
}
} else {
break;
}
}
if (superscript || subscript) {
return {
type: "supsub",
mode: this.mode,
base,
sup: superscript,
sub: subscript
};
} else {
return base;
}
}
/**
* Parses an entire function, including its base and all of its arguments.
*/
parseFunction(breakOnTokenText, name) {
var token2 = this.fetch();
var func = token2.text;
var funcData = functions[func];
if (!funcData) {
return null;
}
this.consume();
if (name && name !== "atom" && !funcData.allowedInArgument) {
throw new ParseError("Got function '" + func + "' with no arguments" + (name ? " as " + name : ""), token2);
} else if (this.mode === "text" && !funcData.allowedInText) {
throw new ParseError("Can't use function '" + func + "' in text mode", token2);
} else if (this.mode === "math" && funcData.allowedInMath === false) {
throw new ParseError("Can't use function '" + func + "' in math mode", token2);
}
var {
args,
optArgs
} = this.parseArguments(func, funcData);
return this.callFunction(func, args, optArgs, token2, breakOnTokenText);
}
/**
* Call a function handler with a suitable context and arguments.
*/
callFunction(name, args, optArgs, token2, breakOnTokenText) {
var context = {
funcName: name,
parser: this,
token: token2,
breakOnTokenText
};
var func = functions[name];
if (func && func.handler) {
return func.handler(context, args, optArgs);
} else {
throw new ParseError("No function handler for " + name);
}
}
/**
* Parses the arguments of a function or environment
*/
parseArguments(func, funcData) {
var totalArgs = funcData.numArgs + funcData.numOptionalArgs;
if (totalArgs === 0) {
return {
args: [],
optArgs: []
};
}
var args = [];
var optArgs = [];
for (var i2 = 0; i2 < totalArgs; i2++) {
var argType = funcData.argTypes && funcData.argTypes[i2];
var isOptional = i2 < funcData.numOptionalArgs;
if (funcData.primitive && argType == null || // \sqrt expands into primitive if optional argument doesn't exist
funcData.type === "sqrt" && i2 === 1 && optArgs[0] == null) {
argType = "primitive";
}
var arg = this.parseGroupOfType("argument to '" + func + "'", argType, isOptional);
if (isOptional) {
optArgs.push(arg);
} else if (arg != null) {
args.push(arg);
} else {
throw new ParseError("Null argument, please report this as a bug");
}
}
return {
args,
optArgs
};
}
/**
* Parses a group when the mode is changing.
*/
parseGroupOfType(name, type3, optional2) {
switch (type3) {
case "color":
return this.parseColorGroup(optional2);
case "size":
return this.parseSizeGroup(optional2);
case "url":
return this.parseUrlGroup(optional2);
case "math":
case "text":
return this.parseArgumentGroup(optional2, type3);
case "hbox": {
var group2 = this.parseArgumentGroup(optional2, "text");
return group2 != null ? {
type: "styling",
mode: group2.mode,
body: [group2],
style: "text"
// simulate \textstyle
} : null;
}
case "raw": {
var token2 = this.parseStringGroup("raw", optional2);
return token2 != null ? {
type: "raw",
mode: "text",
string: token2.text
} : null;
}
case "primitive": {
if (optional2) {
throw new ParseError("A primitive argument cannot be optional");
}
var _group2 = this.parseGroup(name);
if (_group2 == null) {
throw new ParseError("Expected group as " + name, this.fetch());
}
return _group2;
}
case "original":
case null:
case void 0:
return this.parseArgumentGroup(optional2);
default:
throw new ParseError("Unknown group type as " + name, this.fetch());
}
}
/**
* Discard any space tokens, fetching the next non-space token.
*/
consumeSpaces() {
while (this.fetch().text === " ") {
this.consume();
}
}
/**
* Parses a group, essentially returning the string formed by the
* brace-enclosed tokens plus some position information.
*/
parseStringGroup(modeName, optional2) {
var argToken = this.gullet.scanArgument(optional2);
if (argToken == null) {
return null;
}
var str2 = "";
var nextToken;
while ((nextToken = this.fetch()).text !== "EOF") {
str2 += nextToken.text;
this.consume();
}
this.consume();
argToken.text = str2;
return argToken;
}
/**
* Parses a regex-delimited group: the largest sequence of tokens
* whose concatenated strings match `regex`. Returns the string
* formed by the tokens plus some position information.
*/
parseRegexGroup(regex2, modeName) {
var firstToken = this.fetch();
var lastToken = firstToken;
var str2 = "";
var nextToken;
while ((nextToken = this.fetch()).text !== "EOF" && regex2.test(str2 + nextToken.text)) {
lastToken = nextToken;
str2 += lastToken.text;
this.consume();
}
if (str2 === "") {
throw new ParseError("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken);
}
return firstToken.range(lastToken, str2);
}
/**
* Parses a color description.
*/
parseColorGroup(optional2) {
var res = this.parseStringGroup("color", optional2);
if (res == null) {
return null;
}
var match2 = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(res.text);
if (!match2) {
throw new ParseError("Invalid color: '" + res.text + "'", res);
}
var color2 = match2[0];
if (/^[0-9a-f]{6}$/i.test(color2)) {
color2 = "#" + color2;
}
return {
type: "color-token",
mode: this.mode,
color: color2
};
}
/**
* Parses a size specification, consisting of magnitude and unit.
*/
parseSizeGroup(optional2) {
var res;
var isBlank = false;
this.gullet.consumeSpaces();
if (!optional2 && this.gullet.future().text !== "{") {
res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size");
} else {
res = this.parseStringGroup("size", optional2);
}
if (!res) {
return null;
}
if (!optional2 && res.text.length === 0) {
res.text = "0pt";
isBlank = true;
}
var match2 = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text);
if (!match2) {
throw new ParseError("Invalid size: '" + res.text + "'", res);
}
var data5 = {
number: +(match2[1] + match2[2]),
// sign + magnitude, cast to number
unit: match2[3]
};
if (!validUnit(data5)) {
throw new ParseError("Invalid unit: '" + data5.unit + "'", res);
}
return {
type: "size",
mode: this.mode,
value: data5,
isBlank
};
}
/**
* Parses an URL, checking escaped letters and allowed protocols,
* and setting the catcode of % as an active character (as in \hyperref).
*/
parseUrlGroup(optional2) {
this.gullet.lexer.setCatcode("%", 13);
this.gullet.lexer.setCatcode("~", 12);
var res = this.parseStringGroup("url", optional2);
this.gullet.lexer.setCatcode("%", 14);
this.gullet.lexer.setCatcode("~", 13);
if (res == null) {
return null;
}
var url = res.text.replace(/\\([#$%&~_^{}])/g, "$1");
return {
type: "url",
mode: this.mode,
url
};
}
/**
* Parses an argument with the mode specified.
*/
parseArgumentGroup(optional2, mode) {
var argToken = this.gullet.scanArgument(optional2);
if (argToken == null) {
return null;
}
var outerMode = this.mode;
if (mode) {
this.switchMode(mode);
}
this.gullet.beginGroup();
var expression = this.parseExpression(false, "EOF");
this.expect("EOF");
this.gullet.endGroup();
var result = {
type: "ordgroup",
mode: this.mode,
loc: argToken.loc,
body: expression
};
if (mode) {
this.switchMode(outerMode);
}
return result;
}
/**
* Parses an ordinary group, which is either a single nucleus (like "x")
* or an expression in braces (like "{x+y}") or an implicit group, a group
* that starts at the current position, and ends right before a higher explicit
* group ends, or at EOF.
*/
parseGroup(name, breakOnTokenText) {
var firstToken = this.fetch();
var text4 = firstToken.text;
var result;
if (text4 === "{" || text4 === "\\begingroup") {
this.consume();
var groupEnd = text4 === "{" ? "}" : "\\endgroup";
this.gullet.beginGroup();
var expression = this.parseExpression(false, groupEnd);
var lastToken = this.fetch();
this.expect(groupEnd);
this.gullet.endGroup();
result = {
type: "ordgroup",
mode: this.mode,
loc: SourceLocation.range(firstToken, lastToken),
body: expression,
// A group formed by \begingroup...\endgroup is a semi-simple group
// 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: text4 === "\\begingroup" || void 0
};
} else {
result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol();
if (result == null && text4[0] === "\\" && !implicitCommands.hasOwnProperty(text4)) {
if (this.settings.throwOnError) {
throw new ParseError("Undefined control sequence: " + text4, firstToken);
}
result = this.formatUnsupportedCmd(text4);
this.consume();
}
}
return result;
}
/**
* Form ligature-like combinations of characters for text mode.
* This includes inputs like "--", "---", "``" and "''".
* The result will simply replace multiple textord nodes with a single
* character in each value by a single textord node having multiple
* characters in its value. The representation is still ASCII source.
* The group will be modified in place.
*/
formLigatures(group2) {
var n2 = group2.length - 1;
for (var i2 = 0; i2 < n2; ++i2) {
var a2 = group2[i2];
var v3 = a2.text;
if (v3 === "-" && group2[i2 + 1].text === "-") {
if (i2 + 1 < n2 && group2[i2 + 2].text === "-") {
group2.splice(i2, 3, {
type: "textord",
mode: "text",
loc: SourceLocation.range(a2, group2[i2 + 2]),
text: "---"
});
n2 -= 2;
} else {
group2.splice(i2, 2, {
type: "textord",
mode: "text",
loc: SourceLocation.range(a2, group2[i2 + 1]),
text: "--"
});
n2 -= 1;
}
}
if ((v3 === "'" || v3 === "`") && group2[i2 + 1].text === v3) {
group2.splice(i2, 2, {
type: "textord",
mode: "text",
loc: SourceLocation.range(a2, group2[i2 + 1]),
text: v3 + v3
});
n2 -= 1;
}
}
}
/**
* Parse a single symbol out of the string. Here, we handle single character
* symbols and special functions like \verb.
*/
parseSymbol() {
var nucleus = this.fetch();
var text4 = nucleus.text;
if (/^\\verb[^a-zA-Z]/.test(text4)) {
this.consume();
var arg = text4.slice(5);
var star2 = arg.charAt(0) === "*";
if (star2) {
arg = arg.slice(1);
}
if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) {
throw new ParseError("\\verb assertion failed --\n please report what input caused this bug");
}
arg = arg.slice(1, -1);
return {
type: "verb",
mode: "text",
body: arg,
star: star2
};
}
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 "' + text4[0] + '" used in math mode', nucleus);
}
text4 = unicodeSymbols[text4[0]] + text4.slice(1);
}
var match2 = combiningDiacriticalMarksEndRegex.exec(text4);
if (match2) {
text4 = text4.substring(0, match2.index);
if (text4 === "i") {
text4 = "\u0131";
} else if (text4 === "j") {
text4 = "\u0237";
}
}
var symbol;
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][text4].group;
var loc = SourceLocation.range(nucleus);
var s2;
if (ATOMS.hasOwnProperty(group2)) {
var family = group2;
s2 = {
type: "atom",
mode: this.mode,
family,
loc,
text: text4
};
} else {
s2 = {
type: group2,
mode: this.mode,
loc,
text: text4
};
}
symbol = s2;
} else if (text4.charCodeAt(0) >= 128) {
if (this.settings.strict) {
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 "' + text4[0] + '" used in math mode', nucleus);
}
}
symbol = {
type: "textord",
mode: "text",
loc: SourceLocation.range(nucleus),
text: text4
};
} else {
return null;
}
this.consume();
if (match2) {
for (var i2 = 0; i2 < match2[0].length; i2++) {
var accent2 = match2[0][i2];
if (!unicodeAccents[accent2]) {
throw new ParseError("Unknown accent ' " + accent2 + "'", nucleus);
}
var command = unicodeAccents[accent2][this.mode] || unicodeAccents[accent2].text;
if (!command) {
throw new ParseError("Accent " + accent2 + " unsupported in " + this.mode + " mode", nucleus);
}
symbol = {
type: "accent",
mode: this.mode,
loc: SourceLocation.range(nucleus),
label: command,
isStretchy: false,
isShifty: true,
// $FlowFixMe
base: symbol
};
}
}
return symbol;
}
};
Parser.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"];
parseTree = /* @__PURE__ */ __name(function parseTree2(toParse, settings) {
if (!(typeof toParse === "string" || toParse instanceof String)) {
throw new TypeError("KaTeX can only parse string typed expression");
}
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");
}
tree = [{
type: "tag",
mode: "text",
body: tree,
tag: parser24.subparse([new Token("\\df@tag")])
}];
}
return tree;
}, "parseTree");
render = /* @__PURE__ */ __name(function render2(expression, baseNode, options2) {
baseNode.textContent = "";
var node2 = renderToDomTree(expression, options2).toNode();
baseNode.appendChild(node2);
}, "render");
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 render9() {
throw new ParseError("KaTeX doesn't work in quirks mode.");
}, "render");
}
}
renderToString = /* @__PURE__ */ __name(function renderToString2(expression, options2) {
var markup = renderToDomTree(expression, options2).toMarkup();
return markup;
}, "renderToString");
generateParseTree = /* @__PURE__ */ __name(function generateParseTree2(expression, options2) {
var settings = new Settings(options2);
return parseTree(expression, settings);
}, "generateParseTree");
renderError = /* @__PURE__ */ __name(function renderError2(error3, expression, options2) {
if (options2.throwOnError || !(error3 instanceof ParseError)) {
throw error3;
}
var node2 = buildCommon.makeSpan(["katex-error"], [new SymbolNode(expression)]);
node2.setAttribute("title", error3.toString());
node2.setAttribute("style", "color:" + options2.errorColor);
return node2;
}, "renderError");
renderToDomTree = /* @__PURE__ */ __name(function renderToDomTree2(expression, options2) {
var settings = new Settings(options2);
try {
var tree = parseTree(expression, settings);
return buildTree(tree, expression, settings);
} catch (error3) {
return renderError(error3, expression, settings);
}
}, "renderToDomTree");
renderToHTMLTree = /* @__PURE__ */ __name(function renderToHTMLTree2(expression, options2) {
var settings = new Settings(options2);
try {
var tree = parseTree(expression, settings);
return buildHTMLTree(tree, expression, settings);
} catch (error3) {
return renderError(error3, expression, settings);
}
}, "renderToHTMLTree");
version = "0.16.22";
__domTree = {
Span,
Anchor,
SymbolNode,
SvgNode,
PathNode,
LineNode
};
katex = {
/**
* Current KaTeX version
*/
version,
/**
* Renders the given LaTeX into an HTML+MathML combination, and adds
* it as a child to the specified DOM node.
*/
render,
/**
* Renders the given LaTeX into an HTML+MathML combination string,
* for sending to the client.
*/
renderToString,
/**
* KaTeX error, usually during parsing.
*/
ParseError,
/**
* The schema of Settings
*/
SETTINGS_SCHEMA,
/**
* Parses the given LaTeX into KaTeX's internal parse tree structure,
* without rendering to HTML or MathML.
*
* NOTE: This method is not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__parse: generateParseTree,
/**
* Renders the given LaTeX into an HTML+MathML internal DOM tree
* representation, without flattening that representation to a string.
*
* NOTE: This method is not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__renderToDomTree: renderToDomTree,
/**
* Renders the given LaTeX into an HTML internal DOM tree representation,
* without MathML and without flattening that representation to a string.
*
* NOTE: This method is not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__renderToHTMLTree: renderToHTMLTree,
/**
* extends internal font metrics object with a new object
* each key in the new object represents a font name
*/
__setFontMetrics: setFontMetrics,
/**
* adds a new symbol to builtin symbols table
*/
__defineSymbol: defineSymbol,
/**
* adds a new function to builtin function list,
* which directly produce parse tree elements
* and have their own html/mathml builders
*/
__defineFunction: defineFunction,
/**
* adds a new macro to builtin macro list
*/
__defineMacro: defineMacro,
/**
* Expose the dom tree node types, which can be useful for type checking nodes.
*
* NOTE: These methods are not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__domTree
};
}
});
// src/diagrams/common/common.ts
function setupDompurifyHooks() {
const TEMPORARY_ATTRIBUTE = "data-temp-href-target";
purify.addHook("beforeSanitizeAttributes", (node2) => {
if (node2.tagName === "A" && node2.hasAttribute("target")) {
node2.setAttribute(TEMPORARY_ATTRIBUTE, node2.getAttribute("target") ?? "");
}
});
purify.addHook("afterSanitizeAttributes", (node2) => {
if (node2.tagName === "A" && node2.hasAttribute(TEMPORARY_ATTRIBUTE)) {
node2.setAttribute("target", node2.getAttribute(TEMPORARY_ATTRIBUTE) ?? "");
node2.removeAttribute(TEMPORARY_ATTRIBUTE);
if (node2.getAttribute("target") === "_blank") {
node2.setAttribute("rel", "noopener");
}
}
});
}
var lineBreakRegex, getRows, setupDompurifyHooksIfNotSetup, removeScript, sanitizeMore, sanitizeText, sanitizeTextOrArray, hasBreaks, splitBreaks, placeholderToBreak, breakToPlaceholder, getUrl, evaluate, getMax, getMin, parseGenericTypes, countOccurrence, shouldCombineSets, processSet, isMathMLSupported, katexRegex, hasKatex, calculateMathMLDimensions, renderKatexUnsanitized, renderKatexSanitized, common_default;
var init_common = __esm({
"src/diagrams/common/common.ts"() {
"use strict";
init_purify_es();
lineBreakRegex = /
/gi;
getRows = /* @__PURE__ */ __name((s2) => {
if (!s2) {
return [""];
}
const str2 = breakToPlaceholder(s2).replace(/\\n/g, "#br#");
return str2.split("#br#");
}, "getRows");
setupDompurifyHooksIfNotSetup = /* @__PURE__ */ (() => {
let setup = false;
return () => {
if (!setup) {
setupDompurifyHooks();
setup = true;
}
};
})();
__name(setupDompurifyHooks, "setupDompurifyHooks");
removeScript = /* @__PURE__ */ __name((txt) => {
setupDompurifyHooksIfNotSetup();
const sanitizedText = purify.sanitize(txt);
return sanitizedText;
}, "removeScript");
sanitizeMore = /* @__PURE__ */ __name((text4, config5) => {
if (config5.flowchart?.htmlLabels !== false) {
const level = config5.securityLevel;
if (level === "antiscript" || level === "strict") {
text4 = removeScript(text4);
} else if (level !== "loose") {
text4 = breakToPlaceholder(text4);
text4 = text4.replace(//g, ">");
text4 = text4.replace(/=/g, "=");
text4 = placeholderToBreak(text4);
}
}
return text4;
}, "sanitizeMore");
sanitizeText = /* @__PURE__ */ __name((text4, config5) => {
if (!text4) {
return text4;
}
if (config5.dompurifyConfig) {
text4 = purify.sanitize(sanitizeMore(text4, config5), config5.dompurifyConfig).toString();
} else {
text4 = purify.sanitize(sanitizeMore(text4, config5), {
FORBID_TAGS: ["style"]
}).toString();
}
return text4;
}, "sanitizeText");
sanitizeTextOrArray = /* @__PURE__ */ __name((a2, config5) => {
if (typeof a2 === "string") {
return sanitizeText(a2, config5);
}
return a2.flat().map((x5) => sanitizeText(x5, config5));
}, "sanitizeTextOrArray");
hasBreaks = /* @__PURE__ */ __name((text4) => {
return lineBreakRegex.test(text4);
}, "hasBreaks");
splitBreaks = /* @__PURE__ */ __name((text4) => {
return text4.split(lineBreakRegex);
}, "splitBreaks");
placeholderToBreak = /* @__PURE__ */ __name((s2) => {
return s2.replace(/#br#/g, "
");
}, "placeholderToBreak");
breakToPlaceholder = /* @__PURE__ */ __name((s2) => {
return s2.replace(lineBreakRegex, "#br#");
}, "breakToPlaceholder");
getUrl = /* @__PURE__ */ __name((useAbsolute) => {
let url = "";
if (useAbsolute) {
url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
url = CSS.escape(url);
}
return url;
}, "getUrl");
evaluate = /* @__PURE__ */ __name((val) => val === false || ["false", "null", "0"].includes(String(val).trim().toLowerCase()) ? false : true, "evaluate");
getMax = /* @__PURE__ */ __name(function(...values2) {
const newValues = values2.filter((value2) => {
return !isNaN(value2);
});
return Math.max(...newValues);
}, "getMax");
getMin = /* @__PURE__ */ __name(function(...values2) {
const newValues = values2.filter((value2) => {
return !isNaN(value2);
});
return Math.min(...newValues);
}, "getMin");
parseGenericTypes = /* @__PURE__ */ __name(function(input) {
const inputSets = input.split(/(,)/);
const output2 = [];
for (let i2 = 0; i2 < inputSets.length; i2++) {
let thisSet = inputSets[i2];
if (thisSet === "," && i2 > 0 && i2 + 1 < inputSets.length) {
const previousSet = inputSets[i2 - 1];
const nextSet = inputSets[i2 + 1];
if (shouldCombineSets(previousSet, nextSet)) {
thisSet = previousSet + "," + nextSet;
i2++;
output2.pop();
}
}
output2.push(processSet(thisSet));
}
return output2.join("");
}, "parseGenericTypes");
countOccurrence = /* @__PURE__ */ __name((string3, substring) => {
return Math.max(0, string3.split(substring).length - 1);
}, "countOccurrence");
shouldCombineSets = /* @__PURE__ */ __name((previousSet, nextSet) => {
const prevCount = countOccurrence(previousSet, "~");
const nextCount = countOccurrence(nextSet, "~");
return prevCount === 1 && nextCount === 1;
}, "shouldCombineSets");
processSet = /* @__PURE__ */ __name((input) => {
const tildeCount = countOccurrence(input, "~");
let hasStartingTilde = false;
if (tildeCount <= 1) {
return input;
}
if (tildeCount % 2 !== 0 && input.startsWith("~")) {
input = input.substring(1);
hasStartingTilde = true;
}
const chars = [...input];
let first3 = chars.indexOf("~");
let last3 = chars.lastIndexOf("~");
while (first3 !== -1 && last3 !== -1 && first3 !== last3) {
chars[first3] = "<";
chars[last3] = ">";
first3 = chars.indexOf("~");
last3 = chars.lastIndexOf("~");
}
if (hasStartingTilde) {
chars.unshift("~");
}
return chars.join("");
}, "processSet");
isMathMLSupported = /* @__PURE__ */ __name(() => window.MathMLElement !== void 0, "isMathMLSupported");
katexRegex = /\$\$(.*)\$\$/g;
hasKatex = /* @__PURE__ */ __name((text4) => (text4.match(katexRegex)?.length ?? 0) > 0, "hasKatex");
calculateMathMLDimensions = /* @__PURE__ */ __name(async (text4, config5) => {
const divElem = document.createElement("div");
divElem.innerHTML = await renderKatexSanitized(text4, config5);
divElem.id = "katex-temp";
divElem.style.visibility = "hidden";
divElem.style.position = "absolute";
divElem.style.top = "0";
const body = document.querySelector("body");
body?.insertAdjacentElement("beforeend", divElem);
const dim = { width: divElem.clientWidth, height: divElem.clientHeight };
divElem.remove();
return dim;
}, "calculateMathMLDimensions");
renderKatexUnsanitized = /* @__PURE__ */ __name(async (text4, config5) => {
if (!hasKatex(text4)) {
return text4;
}
if (!(isMathMLSupported() || config5.legacyMathML || config5.forceLegacyMathML)) {
return text4.replace(katexRegex, "MathML is unsupported in this environment.");
}
if (true) {
const { default: katex2 } = await Promise.resolve().then(() => (init_katex(), katex_exports));
const outputMode = config5.forceLegacyMathML || !isMathMLSupported() && config5.legacyMathML ? "htmlAndMathml" : "mathml";
return text4.split(lineBreakRegex).map(
(line2) => hasKatex(line2) ? `${line2}
` : `${line2}
`
).join("").replace(
katexRegex,
(_3, c3) => katex2.renderToString(c3, {
throwOnError: true,
displayMode: true,
output: outputMode
}).replace(/\n/g, " ").replace(//g, "")
);
}
return text4.replace(
katexRegex,
"Katex is not supported in @mermaid-js/tiny. Please use the full mermaid library."
);
}, "renderKatexUnsanitized");
renderKatexSanitized = /* @__PURE__ */ __name(async (text4, config5) => {
return sanitizeText(await renderKatexUnsanitized(text4, config5), config5);
}, "renderKatexSanitized");
common_default = {
getRows,
sanitizeText,
sanitizeTextOrArray,
hasBreaks,
splitBreaks,
lineBreakRegex,
removeScript,
getUrl,
evaluate,
getMax,
getMin
};
}
});
// src/rendering-util/icons.ts
var unknownIcon, iconsStore, loaderStore, registerIconPacks, getRegisteredIconData, isIconAvailable, getIconSVG;
var init_icons = __esm({
"src/rendering-util/icons.ts"() {
"use strict";
init_lib();
init_config();
init_common();
init_logger();
unknownIcon = {
body: '?',
height: 80,
width: 80
};
iconsStore = /* @__PURE__ */ new Map();
loaderStore = /* @__PURE__ */ new Map();
registerIconPacks = /* @__PURE__ */ __name((iconLoaders) => {
for (const iconLoader of iconLoaders) {
if (!iconLoader.name) {
throw new Error(
'Invalid icon loader. Must have a "name" property with non-empty string value.'
);
}
log.debug("Registering icon pack:", iconLoader.name);
if ("loader" in iconLoader) {
loaderStore.set(iconLoader.name, iconLoader.loader);
} else if ("icons" in iconLoader) {
iconsStore.set(iconLoader.name, iconLoader.icons);
} else {
log.error("Invalid icon loader:", iconLoader);
throw new Error('Invalid icon loader. Must have either "icons" or "loader" property.');
}
}
}, "registerIconPacks");
getRegisteredIconData = /* @__PURE__ */ __name(async (iconName, fallbackPrefix) => {
const data5 = stringToIcon(iconName, true, fallbackPrefix !== void 0);
if (!data5) {
throw new Error(`Invalid icon name: ${iconName}`);
}
const prefix = data5.prefix || fallbackPrefix;
if (!prefix) {
throw new Error(`Icon name must contain a prefix: ${iconName}`);
}
let icons = iconsStore.get(prefix);
if (!icons) {
const loader29 = loaderStore.get(prefix);
if (!loader29) {
throw new Error(`Icon set not found: ${data5.prefix}`);
}
try {
const loaded = await loader29();
icons = { ...loaded, prefix };
iconsStore.set(prefix, icons);
} catch (e3) {
log.error(e3);
throw new Error(`Failed to load icon set: ${data5.prefix}`);
}
}
const iconData = getIconData(icons, data5.name);
if (!iconData) {
throw new Error(`Icon not found: ${iconName}`);
}
return iconData;
}, "getRegisteredIconData");
isIconAvailable = /* @__PURE__ */ __name(async (iconName) => {
try {
await getRegisteredIconData(iconName);
return true;
} catch {
return false;
}
}, "isIconAvailable");
getIconSVG = /* @__PURE__ */ __name(async (iconName, customisations, extraAttributes) => {
let iconData;
try {
iconData = await getRegisteredIconData(iconName, customisations?.fallbackPrefix);
} catch (e3) {
log.error(e3);
iconData = unknownIcon;
}
const renderData = iconToSVG(iconData, customisations);
const svg2 = iconToHTML(replaceIDs(renderData.body), {
...renderData.attributes,
...extraAttributes
});
return sanitizeText(svg2, getConfig());
}, "getIconSVG");
}
});
// ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js
function dedent(templ) {
var values2 = [];
for (var _i = 1; _i < arguments.length; _i++) {
values2[_i - 1] = arguments[_i];
}
var strings = Array.from(typeof templ === "string" ? [templ] : templ);
strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
var indentLengths = strings.reduce(function(arr, str2) {
var matches33 = str2.match(/\n([\t ]+|(?!\s).)/g);
if (matches33) {
return arr.concat(matches33.map(function(match2) {
var _a, _b;
return (_b = (_a = match2.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
}));
}
return arr;
}, []);
if (indentLengths.length) {
var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
strings = strings.map(function(str2) {
return str2.replace(pattern_1, "\n");
});
}
strings[0] = strings[0].replace(/^\r?\n/, "");
var string3 = strings[0];
values2.forEach(function(value2, i2) {
var endentations = string3.match(/(?:^|\n)( *)$/);
var endentation = endentations ? endentations[1] : "";
var indentedValue = value2;
if (typeof value2 === "string" && value2.includes("\n")) {
indentedValue = String(value2).split("\n").map(function(str2, i3) {
return i3 === 0 ? str2 : "" + endentation + str2;
}).join("\n");
}
string3 += indentedValue + strings[i2 + 1];
});
return string3;
}
var init_esm = __esm({
"../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js"() {
"use strict";
__name(dedent, "dedent");
}
});
// src/diagram-api/regexes.ts
var frontMatterRegex, directiveRegex, anyCommentRegex;
var init_regexes = __esm({
"src/diagram-api/regexes.ts"() {
"use strict";
frontMatterRegex = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;
directiveRegex = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
anyCommentRegex = /\s*%%.*\n/gm;
}
});
// src/errors.ts
var UnknownDiagramError;
var init_errors = __esm({
"src/errors.ts"() {
"use strict";
UnknownDiagramError = class extends Error {
static {
__name(this, "UnknownDiagramError");
}
constructor(message) {
super(message);
this.name = "UnknownDiagramError";
}
};
}
});
// src/diagram-api/detectType.ts
var detectors, detectType, registerLazyLoadedDiagrams, addDetector, getDiagramLoader;
var init_detectType = __esm({
"src/diagram-api/detectType.ts"() {
"use strict";
init_logger();
init_regexes();
init_errors();
detectors = {};
detectType = /* @__PURE__ */ __name(function(text4, config5) {
text4 = text4.replace(frontMatterRegex, "").replace(directiveRegex, "").replace(anyCommentRegex, "\n");
for (const [key, { detector: detector28 }] of Object.entries(detectors)) {
const diagram27 = detector28(text4, config5);
if (diagram27) {
return key;
}
}
throw new UnknownDiagramError(
`No diagram type detected matching given configuration for text: ${text4}`
);
}, "detectType");
registerLazyLoadedDiagrams = /* @__PURE__ */ __name((...diagrams2) => {
for (const { id: id30, detector: detector28, loader: loader29 } of diagrams2) {
addDetector(id30, detector28, loader29);
}
}, "registerLazyLoadedDiagrams");
addDetector = /* @__PURE__ */ __name((key, detector28, loader29) => {
if (detectors[key]) {
log.warn(`Detector with key ${key} already exists. Overwriting.`);
}
detectors[key] = { detector: detector28, loader: loader29 };
log.debug(`Detector with key ${key} added${loader29 ? " with loader" : ""}`);
}, "addDetector");
getDiagramLoader = /* @__PURE__ */ __name((key) => {
return detectors[key].loader;
}, "getDiagramLoader");
}
});
// src/diagrams/c4/parser/c4Diagram.jison
var parser, c4Diagram_default;
var init_c4Diagram = __esm({
"src/diagrams/c4/parser/c4Diagram.jison"() {
"use strict";
parser = (function() {
var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l4) {
for (o3 = o3 || {}, l4 = k2.length; l4--; o3[k2[l4]] = 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 parser24 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "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: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
var $0 = $$.length - 1;
switch (yystate) {
case 3:
yy.setDirection("TB");
break;
case 4:
yy.setDirection("BT");
break;
case 5:
yy.setDirection("RL");
break;
case 6:
yy.setDirection("LR");
break;
case 8:
case 9:
case 10:
case 11:
case 12:
yy.setC4Type($$[$0 - 3]);
break;
case 19:
yy.setTitle($$[$0].substring(6));
this.$ = $$[$0].substring(6);
break;
case 20:
yy.setAccDescription($$[$0].substring(15));
this.$ = $$[$0].substring(15);
break;
case 21:
this.$ = $$[$0].trim();
yy.setTitle(this.$);
break;
case 22:
case 23:
this.$ = $$[$0].trim();
yy.setAccDescription(this.$);
break;
case 28:
$$[$0].splice(2, 0, "ENTERPRISE");
yy.addPersonOrSystemBoundary(...$$[$0]);
this.$ = $$[$0];
break;
case 29:
$$[$0].splice(2, 0, "SYSTEM");
yy.addPersonOrSystemBoundary(...$$[$0]);
this.$ = $$[$0];
break;
case 30:
yy.addPersonOrSystemBoundary(...$$[$0]);
this.$ = $$[$0];
break;
case 31:
$$[$0].splice(2, 0, "CONTAINER");
yy.addContainerBoundary(...$$[$0]);
this.$ = $$[$0];
break;
case 32:
yy.addDeploymentNode("node", ...$$[$0]);
this.$ = $$[$0];
break;
case 33:
yy.addDeploymentNode("nodeL", ...$$[$0]);
this.$ = $$[$0];
break;
case 34:
yy.addDeploymentNode("nodeR", ...$$[$0]);
this.$ = $$[$0];
break;
case 35:
yy.popBoundaryParseStack();
break;
case 39:
yy.addPersonOrSystem("person", ...$$[$0]);
this.$ = $$[$0];
break;
case 40:
yy.addPersonOrSystem("external_person", ...$$[$0]);
this.$ = $$[$0];
break;
case 41:
yy.addPersonOrSystem("system", ...$$[$0]);
this.$ = $$[$0];
break;
case 42:
yy.addPersonOrSystem("system_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 43:
yy.addPersonOrSystem("system_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 44:
yy.addPersonOrSystem("external_system", ...$$[$0]);
this.$ = $$[$0];
break;
case 45:
yy.addPersonOrSystem("external_system_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 46:
yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 47:
yy.addContainer("container", ...$$[$0]);
this.$ = $$[$0];
break;
case 48:
yy.addContainer("container_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 49:
yy.addContainer("container_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 50:
yy.addContainer("external_container", ...$$[$0]);
this.$ = $$[$0];
break;
case 51:
yy.addContainer("external_container_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 52:
yy.addContainer("external_container_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 53:
yy.addComponent("component", ...$$[$0]);
this.$ = $$[$0];
break;
case 54:
yy.addComponent("component_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 55:
yy.addComponent("component_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 56:
yy.addComponent("external_component", ...$$[$0]);
this.$ = $$[$0];
break;
case 57:
yy.addComponent("external_component_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 58:
yy.addComponent("external_component_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 60:
yy.addRel("rel", ...$$[$0]);
this.$ = $$[$0];
break;
case 61:
yy.addRel("birel", ...$$[$0]);
this.$ = $$[$0];
break;
case 62:
yy.addRel("rel_u", ...$$[$0]);
this.$ = $$[$0];
break;
case 63:
yy.addRel("rel_d", ...$$[$0]);
this.$ = $$[$0];
break;
case 64:
yy.addRel("rel_l", ...$$[$0]);
this.$ = $$[$0];
break;
case 65:
yy.addRel("rel_r", ...$$[$0]);
this.$ = $$[$0];
break;
case 66:
yy.addRel("rel_b", ...$$[$0]);
this.$ = $$[$0];
break;
case 67:
$$[$0].splice(0, 1);
yy.addRel("rel", ...$$[$0]);
this.$ = $$[$0];
break;
case 68:
yy.updateElStyle("update_el_style", ...$$[$0]);
this.$ = $$[$0];
break;
case 69:
yy.updateRelStyle("update_rel_style", ...$$[$0]);
this.$ = $$[$0];
break;
case 70:
yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
this.$ = $$[$0];
break;
case 71:
this.$ = [$$[$0]];
break;
case 72:
$$[$0].unshift($$[$0 - 1]);
this.$ = $$[$0];
break;
case 73:
case 75:
this.$ = $$[$0].trim();
break;
case 74:
let kv = {};
kv[$$[$0 - 1].trim()] = $$[$0].trim();
this.$ = kv;
break;
case 76:
this.$ = "";
break;
}
}, "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: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o2($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o2($VH, [2, 14]), o2($VI, [2, 16], { 12: [1, 76] }), o2($VH, [2, 36], { 12: [1, 77] }), o2($VJ, [2, 19]), o2($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o2($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o2($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o2($VH, [2, 15]), o2($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o2($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o2($VJ, [2, 21]), o2($VJ, [2, 22]), o2($VO, [2, 39]), o2($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o2($VQ, [2, 73]), { 78: [1, 133] }, o2($VQ, [2, 75]), o2($VQ, [2, 76]), o2($VO, [2, 40]), o2($VO, [2, 41]), o2($VO, [2, 42]), o2($VO, [2, 43]), o2($VO, [2, 44]), o2($VO, [2, 45]), o2($VO, [2, 46]), o2($VO, [2, 47]), o2($VO, [2, 48]), o2($VO, [2, 49]), o2($VO, [2, 50]), o2($VO, [2, 51]), o2($VO, [2, 52]), o2($VO, [2, 53]), o2($VO, [2, 54]), o2($VO, [2, 55]), o2($VO, [2, 56]), o2($VO, [2, 57]), o2($VO, [2, 58]), o2($VO, [2, 60]), o2($VO, [2, 61]), o2($VO, [2, 62]), o2($VO, [2, 63]), o2($VO, [2, 64]), o2($VO, [2, 65]), o2($VO, [2, 66]), o2($VO, [2, 67]), o2($VO, [2, 68]), o2($VO, [2, 69]), o2($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o2($VR, [2, 28]), o2($VR, [2, 29]), o2($VR, [2, 30]), o2($VR, [2, 31]), o2($VR, [2, 32]), o2($VR, [2, 33]), o2($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o2($VI, [2, 18]), o2($VH, [2, 38]), o2($VP, [2, 72]), o2($VQ, [2, 74]), o2($VO, [2, 24]), o2($VO, [2, 35]), o2($VS, [2, 25]), o2($VS, [2, 26], { 12: [1, 138] }), o2($VS, [2, 27])],
defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
parseError: /* @__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 lexer2 = 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];
}
}
lexer2.setInput(input, sharedState.yy);
sharedState.yy.lexer = lexer2;
sharedState.yy.parser = this;
if (typeof lexer2.yylloc == "undefined") {
lexer2.yylloc = {};
}
var yyloc = lexer2.yylloc;
lstack.push(yyloc);
var ranges = lexer2.options && lexer2.options.ranges;
if (typeof sharedState.yy.parseError === "function") {
this.parseError = sharedState.yy.parseError;
} else {
this.parseError = Object.getPrototypeOf(this).parseError;
}
function 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() || lexer2.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, state3, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
state3 = stack[stack.length - 1];
if (this.defaultActions[state3]) {
action = this.defaultActions[state3];
} else {
if (symbol === null || typeof symbol == "undefined") {
symbol = lex();
}
action = table[state3] && table[state3][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
for (p3 in table[state3]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
}
if (lexer2.showPosition) {
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
} else {
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, {
text: lexer2.match,
token: this.terminals_[symbol] || symbol,
line: lexer2.yylineno,
loc: yyloc,
expected
});
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error("Parse Error: multiple actions possible at state: " + state3 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(lexer2.yytext);
lstack.push(lexer2.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = lexer2.yyleng;
yytext = lexer2.yytext;
yylineno = lexer2.yylineno;
yyloc = lexer2.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 lexer = /* @__PURE__ */ (function() {
var lexer2 = {
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: {},
performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
var YYSTATE = YY_START;
switch ($avoiding_name_collisions) {
case 0:
return 6;
break;
case 1:
return 7;
break;
case 2:
return 8;
break;
case 3:
return 9;
break;
case 4:
return 22;
break;
case 5:
return 23;
break;
case 6:
this.begin("acc_title");
return 24;
break;
case 7:
this.popState();
return "acc_title_value";
break;
case 8:
this.begin("acc_descr");
return 26;
break;
case 9:
this.popState();
return "acc_descr_value";
break;
case 10:
this.begin("acc_descr_multiline");
break;
case 11:
this.popState();
break;
case 12:
return "acc_descr_multiline_value";
break;
case 13:
break;
case 14:
c;
break;
case 15:
return 12;
break;
case 16:
break;
case 17:
return 11;
break;
case 18:
return 15;
break;
case 19:
return 16;
break;
case 20:
return 17;
break;
case 21:
return 18;
break;
case 22:
this.begin("person_ext");
return 45;
break;
case 23:
this.begin("person");
return 44;
break;
case 24:
this.begin("system_ext_queue");
return 51;
break;
case 25:
this.begin("system_ext_db");
return 50;
break;
case 26:
this.begin("system_ext");
return 49;
break;
case 27:
this.begin("system_queue");
return 48;
break;
case 28:
this.begin("system_db");
return 47;
break;
case 29:
this.begin("system");
return 46;
break;
case 30:
this.begin("boundary");
return 37;
break;
case 31:
this.begin("enterprise_boundary");
return 34;
break;
case 32:
this.begin("system_boundary");
return 36;
break;
case 33:
this.begin("container_ext_queue");
return 57;
break;
case 34:
this.begin("container_ext_db");
return 56;
break;
case 35:
this.begin("container_ext");
return 55;
break;
case 36:
this.begin("container_queue");
return 54;
break;
case 37:
this.begin("container_db");
return 53;
break;
case 38:
this.begin("container");
return 52;
break;
case 39:
this.begin("container_boundary");
return 38;
break;
case 40:
this.begin("component_ext_queue");
return 63;
break;
case 41:
this.begin("component_ext_db");
return 62;
break;
case 42:
this.begin("component_ext");
return 61;
break;
case 43:
this.begin("component_queue");
return 60;
break;
case 44:
this.begin("component_db");
return 59;
break;
case 45:
this.begin("component");
return 58;
break;
case 46:
this.begin("node");
return 39;
break;
case 47:
this.begin("node");
return 39;
break;
case 48:
this.begin("node_l");
return 40;
break;
case 49:
this.begin("node_r");
return 41;
break;
case 50:
this.begin("rel");
return 64;
break;
case 51:
this.begin("birel");
return 65;
break;
case 52:
this.begin("rel_u");
return 66;
break;
case 53:
this.begin("rel_u");
return 66;
break;
case 54:
this.begin("rel_d");
return 67;
break;
case 55:
this.begin("rel_d");
return 67;
break;
case 56:
this.begin("rel_l");
return 68;
break;
case 57:
this.begin("rel_l");
return 68;
break;
case 58:
this.begin("rel_r");
return 69;
break;
case 59:
this.begin("rel_r");
return 69;
break;
case 60:
this.begin("rel_b");
return 70;
break;
case 61:
this.begin("rel_index");
return 71;
break;
case 62:
this.begin("update_el_style");
return 72;
break;
case 63:
this.begin("update_rel_style");
return 73;
break;
case 64:
this.begin("update_layout_config");
return 74;
break;
case 65:
return "EOF_IN_STRUCT";
break;
case 66:
this.begin("attribute");
return "ATTRIBUTE_EMPTY";
break;
case 67:
this.begin("attribute");
break;
case 68:
this.popState();
this.popState();
break;
case 69:
return 80;
break;
case 70:
break;
case 71:
return 80;
break;
case 72:
this.begin("string");
break;
case 73:
this.popState();
break;
case 74:
return "STR";
break;
case 75:
this.begin("string_kv");
break;
case 76:
this.begin("string_kv_key");
return "STR_KEY";
break;
case 77:
this.popState();
this.begin("string_kv_value");
break;
case 78:
return "STR_VALUE";
break;
case 79:
this.popState();
this.popState();
break;
case 80:
return "STR";
break;
case 81:
return "LBRACE";
break;
case 82:
return "RBRACE";
break;
case 83:
return "SPACE";
break;
case 84:
return "EOL";
break;
case 85:
return 14;
break;
}
}, "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": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "string_kv_value": { "rules": [78, 79], "inclusive": false }, "string_kv_key": { "rules": [77], "inclusive": false }, "string_kv": { "rules": [76], "inclusive": false }, "string": { "rules": [73, 74], "inclusive": false }, "attribute": { "rules": [68, 69, 70, 71, 72, 75, 80], "inclusive": false }, "update_layout_config": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_rel_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_el_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_b": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_d": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_u": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "node": { "rules": [65, 66, 67, 68], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container": { "rules": [65, 66, 67, 68], "inclusive": false }, "birel": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "enterprise_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system": { "rules": [65, 66, 67, 68], "inclusive": false }, "person_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "person": { "rules": [65, 66, 67, 68], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], "inclusive": true } }
};
return lexer2;
})();
parser24.lexer = lexer;
function Parser3() {
this.yy = {};
}
__name(Parser3, "Parser");
Parser3.prototype = parser24;
parser24.Parser = Parser3;
return new Parser3();
})();
parser.parser = parser;
c4Diagram_default = parser;
}
});
// src/setupGraphViewbox.js
var d3Attrs, calculateSvgSizeAttrs, configureSvgSize, setupGraphViewbox;
var init_setupGraphViewbox = __esm({
"src/setupGraphViewbox.js"() {
"use strict";
init_logger();
d3Attrs = /* @__PURE__ */ __name(function(d3Elem, attrs) {
for (let attr of attrs) {
d3Elem.attr(attr[0], attr[1]);
}
}, "d3Attrs");
calculateSvgSizeAttrs = /* @__PURE__ */ __name(function(height2, width3, useMaxWidth) {
let attrs = /* @__PURE__ */ new Map();
if (useMaxWidth) {
attrs.set("width", "100%");
attrs.set("style", `max-width: ${width3}px;`);
} else {
attrs.set("height", height2);
attrs.set("width", width3);
}
return attrs;
}, "calculateSvgSizeAttrs");
configureSvgSize = /* @__PURE__ */ __name(function(svgElem, height2, width3, useMaxWidth) {
const attrs = calculateSvgSizeAttrs(height2, width3, useMaxWidth);
d3Attrs(svgElem, attrs);
}, "configureSvgSize");
setupGraphViewbox = /* @__PURE__ */ __name(function(graph, svgElem, padding2, useMaxWidth) {
const svgBounds = svgElem.node().getBBox();
const sWidth = svgBounds.width;
const sHeight = svgBounds.height;
log.info(`SVG bounds: ${sWidth}x${sHeight}`, svgBounds);
let width3 = 0;
let height2 = 0;
log.info(`Graph bounds: ${width3}x${height2}`, graph);
width3 = sWidth + padding2 * 2;
height2 = sHeight + padding2 * 2;
log.info(`Calculated bounds: ${width3}x${height2}`);
configureSvgSize(svgElem, height2, width3, useMaxWidth);
const vBox = `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${svgBounds.width + 2 * padding2} ${svgBounds.height + 2 * padding2}`;
svgElem.attr("viewBox", vBox);
}, "setupGraphViewbox");
}
});
// src/styles.ts
var themes, getStyles, addStylesForDiagram, styles_default;
var init_styles = __esm({
"src/styles.ts"() {
"use strict";
init_logger();
themes = {};
getStyles = /* @__PURE__ */ __name((type3, userStyles, options2) => {
let diagramStyles = "";
if (type3 in themes && themes[type3]) {
diagramStyles = themes[type3](options2);
} else {
log.warn(`No theme found for ${type3}`);
}
return ` & {
font-family: ${options2.fontFamily};
font-size: ${options2.fontSize};
fill: ${options2.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 {
fill: ${options2.errorBkgColor};
}
& .error-text {
fill: ${options2.errorTextColor};
stroke: ${options2.errorTextColor};
}
& .edge-thickness-normal {
stroke-width: 1px;
}
& .edge-thickness-thick {
stroke-width: 3.5px
}
& .edge-pattern-solid {
stroke-dasharray: 0;
}
& .edge-thickness-invisible {
stroke-width: 0;
fill: none;
}
& .edge-pattern-dashed{
stroke-dasharray: 3;
}
.edge-pattern-dotted {
stroke-dasharray: 2;
}
& .marker {
fill: ${options2.lineColor};
stroke: ${options2.lineColor};
}
& .marker.cross {
stroke: ${options2.lineColor};
}
& svg {
font-family: ${options2.fontFamily};
font-size: ${options2.fontSize};
}
& p {
margin: 0
}
${diagramStyles}
${userStyles}
`;
}, "getStyles");
addStylesForDiagram = /* @__PURE__ */ __name((type3, diagramTheme) => {
if (diagramTheme !== void 0) {
themes[type3] = diagramTheme;
}
}, "addStylesForDiagram");
styles_default = getStyles;
}
});
// src/diagrams/common/commonDb.ts
var commonDb_exports = {};
__export(commonDb_exports, {
clear: () => clear,
getAccDescription: () => getAccDescription,
getAccTitle: () => getAccTitle,
getDiagramTitle: () => getDiagramTitle,
setAccDescription: () => setAccDescription,
setAccTitle: () => setAccTitle,
setDiagramTitle: () => setDiagramTitle
});
var accTitle, diagramTitle, accDescription, sanitizeText2, clear, setAccTitle, getAccTitle, setAccDescription, getAccDescription, setDiagramTitle, getDiagramTitle;
var init_commonDb = __esm({
"src/diagrams/common/commonDb.ts"() {
"use strict";
init_common();
init_config();
accTitle = "";
diagramTitle = "";
accDescription = "";
sanitizeText2 = /* @__PURE__ */ __name((txt) => sanitizeText(txt, getConfig()), "sanitizeText");
clear = /* @__PURE__ */ __name(() => {
accTitle = "";
accDescription = "";
diagramTitle = "";
}, "clear");
setAccTitle = /* @__PURE__ */ __name((txt) => {
accTitle = sanitizeText2(txt).replace(/^\s+/g, "");
}, "setAccTitle");
getAccTitle = /* @__PURE__ */ __name(() => accTitle, "getAccTitle");
setAccDescription = /* @__PURE__ */ __name((txt) => {
accDescription = sanitizeText2(txt).replace(/\n\s+/g, "\n");
}, "setAccDescription");
getAccDescription = /* @__PURE__ */ __name(() => accDescription, "getAccDescription");
setDiagramTitle = /* @__PURE__ */ __name((txt) => {
diagramTitle = sanitizeText2(txt);
}, "setDiagramTitle");
getDiagramTitle = /* @__PURE__ */ __name(() => diagramTitle, "getDiagramTitle");
}
});
// src/diagram-api/diagramAPI.ts
var log2, setLogLevel2, getConfig2, setConfig2, defaultConfig2, sanitizeText3, setupGraphViewbox2, getCommonDb, diagrams, registerDiagram, getDiagram, DiagramNotFoundError;
var init_diagramAPI = __esm({
"src/diagram-api/diagramAPI.ts"() {
"use strict";
init_detectType();
init_logger();
init_config();
init_common();
init_setupGraphViewbox();
init_styles();
init_commonDb();
log2 = log;
setLogLevel2 = setLogLevel;
getConfig2 = getConfig;
setConfig2 = setConfig;
defaultConfig2 = defaultConfig;
sanitizeText3 = /* @__PURE__ */ __name((text4) => sanitizeText(text4, getConfig2()), "sanitizeText");
setupGraphViewbox2 = setupGraphViewbox;
getCommonDb = /* @__PURE__ */ __name(() => {
return commonDb_exports;
}, "getCommonDb");
diagrams = {};
registerDiagram = /* @__PURE__ */ __name((id30, diagram27, detector28) => {
if (diagrams[id30]) {
log2.warn(`Diagram with id ${id30} already registered. Overwriting.`);
}
diagrams[id30] = diagram27;
if (detector28) {
addDetector(id30, detector28);
}
addStylesForDiagram(id30, diagram27.styles);
diagram27.injectUtils?.(
log2,
setLogLevel2,
getConfig2,
sanitizeText3,
setupGraphViewbox2,
getCommonDb(),
() => {
}
);
}, "registerDiagram");
getDiagram = /* @__PURE__ */ __name((name) => {
if (name in diagrams) {
return diagrams[name];
}
throw new DiagramNotFoundError(name);
}, "getDiagram");
DiagramNotFoundError = class extends Error {
static {
__name(this, "DiagramNotFoundError");
}
constructor(name) {
super(`Diagram ${name} not found.`);
}
};
}
});
// src/diagrams/c4/c4Db.js
var c4ShapeArray, boundaryParseStack, currentBoundaryParse, parentBoundaryParse, boundaries, rels, title, wrapEnabled, c4ShapeInRow, c4BoundaryInRow, c4Type, getC4Type, setC4Type, addRel, addPersonOrSystem, addContainer, addComponent, addPersonOrSystemBoundary, addContainerBoundary, addDeploymentNode, popBoundaryParseStack, updateElStyle, updateRelStyle, updateLayoutConfig, getC4ShapeInRow, getC4BoundaryInRow, getCurrentBoundaryParse, getParentBoundaryParse, getC4ShapeArray, getC4Shape, getC4ShapeKeys, getBoundaries, getBoundarys, getRels, getTitle, setWrap, autoWrap, clear2, LINETYPE, ARROWTYPE, PLACEMENT, setTitle, c4Db_default;
var init_c4Db = __esm({
"src/diagrams/c4/c4Db.js"() {
"use strict";
init_diagramAPI();
init_common();
init_commonDb();
c4ShapeArray = [];
boundaryParseStack = [""];
currentBoundaryParse = "global";
parentBoundaryParse = "";
boundaries = [
{
alias: "global",
label: { text: "global" },
type: { text: "global" },
tags: null,
link: null,
parentBoundary: ""
}
];
rels = [];
title = "";
wrapEnabled = false;
c4ShapeInRow = 4;
c4BoundaryInRow = 2;
getC4Type = /* @__PURE__ */ __name(function() {
return c4Type;
}, "getC4Type");
setC4Type = /* @__PURE__ */ __name(function(c4TypeParam) {
let sanitizedText = sanitizeText(c4TypeParam, getConfig2());
c4Type = sanitizedText;
}, "setC4Type");
addRel = /* @__PURE__ */ __name(function(type3, from2, to, label, techn, descr, sprite, tags2, link2) {
if (type3 === void 0 || type3 === null || from2 === void 0 || from2 === null || to === void 0 || to === null || label === void 0 || label === null) {
return;
}
let rel2 = {};
const old = rels.find((rel3) => rel3.from === from2 && rel3.to === to);
if (old) {
rel2 = old;
} else {
rels.push(rel2);
}
rel2.type = type3;
rel2.from = from2;
rel2.to = to;
rel2.label = { text: label };
if (techn === void 0 || techn === null) {
rel2.techn = { text: "" };
} else {
if (typeof techn === "object") {
let [key, value2] = Object.entries(techn)[0];
rel2[key] = { text: value2 };
} else {
rel2.techn = { text: techn };
}
}
if (descr === void 0 || descr === null) {
rel2.descr = { text: "" };
} else {
if (typeof descr === "object") {
let [key, value2] = Object.entries(descr)[0];
rel2[key] = { text: value2 };
} else {
rel2.descr = { text: descr };
}
}
if (typeof sprite === "object") {
let [key, value2] = Object.entries(sprite)[0];
rel2[key] = value2;
} else {
rel2.sprite = sprite;
}
if (typeof tags2 === "object") {
let [key, value2] = Object.entries(tags2)[0];
rel2[key] = value2;
} else {
rel2.tags = tags2;
}
if (typeof link2 === "object") {
let [key, value2] = Object.entries(link2)[0];
rel2[key] = value2;
} else {
rel2.link = link2;
}
rel2.wrap = autoWrap();
}, "addRel");
addPersonOrSystem = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, descr, sprite, tags2, link2) {
if (alias === null || label === null) {
return;
}
let personOrSystem = {};
const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias);
if (old && alias === old.alias) {
personOrSystem = old;
} else {
personOrSystem.alias = alias;
c4ShapeArray.push(personOrSystem);
}
if (label === void 0 || label === null) {
personOrSystem.label = { text: "" };
} else {
personOrSystem.label = { text: label };
}
if (descr === void 0 || descr === null) {
personOrSystem.descr = { text: "" };
} else {
if (typeof descr === "object") {
let [key, value2] = Object.entries(descr)[0];
personOrSystem[key] = { text: value2 };
} else {
personOrSystem.descr = { text: descr };
}
}
if (typeof sprite === "object") {
let [key, value2] = Object.entries(sprite)[0];
personOrSystem[key] = value2;
} else {
personOrSystem.sprite = sprite;
}
if (typeof tags2 === "object") {
let [key, value2] = Object.entries(tags2)[0];
personOrSystem[key] = value2;
} else {
personOrSystem.tags = tags2;
}
if (typeof link2 === "object") {
let [key, value2] = Object.entries(link2)[0];
personOrSystem[key] = value2;
} else {
personOrSystem.link = link2;
}
personOrSystem.typeC4Shape = { text: typeC4Shape };
personOrSystem.parentBoundary = currentBoundaryParse;
personOrSystem.wrap = autoWrap();
}, "addPersonOrSystem");
addContainer = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link2) {
if (alias === null || label === null) {
return;
}
let container2 = {};
const old = c4ShapeArray.find((container3) => container3.alias === alias);
if (old && alias === old.alias) {
container2 = old;
} else {
container2.alias = alias;
c4ShapeArray.push(container2);
}
if (label === void 0 || label === null) {
container2.label = { text: "" };
} else {
container2.label = { text: label };
}
if (techn === void 0 || techn === null) {
container2.techn = { text: "" };
} else {
if (typeof techn === "object") {
let [key, value2] = Object.entries(techn)[0];
container2[key] = { text: value2 };
} else {
container2.techn = { text: techn };
}
}
if (descr === void 0 || descr === null) {
container2.descr = { text: "" };
} else {
if (typeof descr === "object") {
let [key, value2] = Object.entries(descr)[0];
container2[key] = { text: value2 };
} else {
container2.descr = { text: descr };
}
}
if (typeof sprite === "object") {
let [key, value2] = Object.entries(sprite)[0];
container2[key] = value2;
} else {
container2.sprite = sprite;
}
if (typeof tags2 === "object") {
let [key, value2] = Object.entries(tags2)[0];
container2[key] = value2;
} else {
container2.tags = tags2;
}
if (typeof link2 === "object") {
let [key, value2] = Object.entries(link2)[0];
container2[key] = value2;
} else {
container2.link = link2;
}
container2.wrap = autoWrap();
container2.typeC4Shape = { text: typeC4Shape };
container2.parentBoundary = currentBoundaryParse;
}, "addContainer");
addComponent = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link2) {
if (alias === null || label === null) {
return;
}
let component2 = {};
const old = c4ShapeArray.find((component3) => component3.alias === alias);
if (old && alias === old.alias) {
component2 = old;
} else {
component2.alias = alias;
c4ShapeArray.push(component2);
}
if (label === void 0 || label === null) {
component2.label = { text: "" };
} else {
component2.label = { text: label };
}
if (techn === void 0 || techn === null) {
component2.techn = { text: "" };
} else {
if (typeof techn === "object") {
let [key, value2] = Object.entries(techn)[0];
component2[key] = { text: value2 };
} else {
component2.techn = { text: techn };
}
}
if (descr === void 0 || descr === null) {
component2.descr = { text: "" };
} else {
if (typeof descr === "object") {
let [key, value2] = Object.entries(descr)[0];
component2[key] = { text: value2 };
} else {
component2.descr = { text: descr };
}
}
if (typeof sprite === "object") {
let [key, value2] = Object.entries(sprite)[0];
component2[key] = value2;
} else {
component2.sprite = sprite;
}
if (typeof tags2 === "object") {
let [key, value2] = Object.entries(tags2)[0];
component2[key] = value2;
} else {
component2.tags = tags2;
}
if (typeof link2 === "object") {
let [key, value2] = Object.entries(link2)[0];
component2[key] = value2;
} else {
component2.link = link2;
}
component2.wrap = autoWrap();
component2.typeC4Shape = { text: typeC4Shape };
component2.parentBoundary = currentBoundaryParse;
}, "addComponent");
addPersonOrSystemBoundary = /* @__PURE__ */ __name(function(alias, label, type3, tags2, link2) {
if (alias === null || label === null) {
return;
}
let boundary = {};
const old = boundaries.find((boundary2) => boundary2.alias === alias);
if (old && alias === old.alias) {
boundary = old;
} else {
boundary.alias = alias;
boundaries.push(boundary);
}
if (label === void 0 || label === null) {
boundary.label = { text: "" };
} else {
boundary.label = { text: label };
}
if (type3 === void 0 || type3 === null) {
boundary.type = { text: "system" };
} else {
if (typeof type3 === "object") {
let [key, value2] = Object.entries(type3)[0];
boundary[key] = { text: value2 };
} else {
boundary.type = { text: type3 };
}
}
if (typeof tags2 === "object") {
let [key, value2] = Object.entries(tags2)[0];
boundary[key] = value2;
} else {
boundary.tags = tags2;
}
if (typeof link2 === "object") {
let [key, value2] = Object.entries(link2)[0];
boundary[key] = value2;
} else {
boundary.link = link2;
}
boundary.parentBoundary = currentBoundaryParse;
boundary.wrap = autoWrap();
parentBoundaryParse = currentBoundaryParse;
currentBoundaryParse = alias;
boundaryParseStack.push(parentBoundaryParse);
}, "addPersonOrSystemBoundary");
addContainerBoundary = /* @__PURE__ */ __name(function(alias, label, type3, tags2, link2) {
if (alias === null || label === null) {
return;
}
let boundary = {};
const old = boundaries.find((boundary2) => boundary2.alias === alias);
if (old && alias === old.alias) {
boundary = old;
} else {
boundary.alias = alias;
boundaries.push(boundary);
}
if (label === void 0 || label === null) {
boundary.label = { text: "" };
} else {
boundary.label = { text: label };
}
if (type3 === void 0 || type3 === null) {
boundary.type = { text: "container" };
} else {
if (typeof type3 === "object") {
let [key, value2] = Object.entries(type3)[0];
boundary[key] = { text: value2 };
} else {
boundary.type = { text: type3 };
}
}
if (typeof tags2 === "object") {
let [key, value2] = Object.entries(tags2)[0];
boundary[key] = value2;
} else {
boundary.tags = tags2;
}
if (typeof link2 === "object") {
let [key, value2] = Object.entries(link2)[0];
boundary[key] = value2;
} else {
boundary.link = link2;
}
boundary.parentBoundary = currentBoundaryParse;
boundary.wrap = autoWrap();
parentBoundaryParse = currentBoundaryParse;
currentBoundaryParse = alias;
boundaryParseStack.push(parentBoundaryParse);
}, "addContainerBoundary");
addDeploymentNode = /* @__PURE__ */ __name(function(nodeType3, alias, label, type3, descr, sprite, tags2, link2) {
if (alias === null || label === null) {
return;
}
let boundary = {};
const old = boundaries.find((boundary2) => boundary2.alias === alias);
if (old && alias === old.alias) {
boundary = old;
} else {
boundary.alias = alias;
boundaries.push(boundary);
}
if (label === void 0 || label === null) {
boundary.label = { text: "" };
} else {
boundary.label = { text: label };
}
if (type3 === void 0 || type3 === null) {
boundary.type = { text: "node" };
} else {
if (typeof type3 === "object") {
let [key, value2] = Object.entries(type3)[0];
boundary[key] = { text: value2 };
} else {
boundary.type = { text: type3 };
}
}
if (descr === void 0 || descr === null) {
boundary.descr = { text: "" };
} else {
if (typeof descr === "object") {
let [key, value2] = Object.entries(descr)[0];
boundary[key] = { text: value2 };
} else {
boundary.descr = { text: descr };
}
}
if (typeof tags2 === "object") {
let [key, value2] = Object.entries(tags2)[0];
boundary[key] = value2;
} else {
boundary.tags = tags2;
}
if (typeof link2 === "object") {
let [key, value2] = Object.entries(link2)[0];
boundary[key] = value2;
} else {
boundary.link = link2;
}
boundary.nodeType = nodeType3;
boundary.parentBoundary = currentBoundaryParse;
boundary.wrap = autoWrap();
parentBoundaryParse = currentBoundaryParse;
currentBoundaryParse = alias;
boundaryParseStack.push(parentBoundaryParse);
}, "addDeploymentNode");
popBoundaryParseStack = /* @__PURE__ */ __name(function() {
currentBoundaryParse = parentBoundaryParse;
boundaryParseStack.pop();
parentBoundaryParse = boundaryParseStack.pop();
boundaryParseStack.push(parentBoundaryParse);
}, "popBoundaryParseStack");
updateElStyle = /* @__PURE__ */ __name(function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) {
let old = c4ShapeArray.find((element3) => element3.alias === elementName);
if (old === void 0) {
old = boundaries.find((element3) => element3.alias === elementName);
if (old === void 0) {
return;
}
}
if (bgColor !== void 0 && bgColor !== null) {
if (typeof bgColor === "object") {
let [key, value2] = Object.entries(bgColor)[0];
old[key] = value2;
} else {
old.bgColor = bgColor;
}
}
if (fontColor !== void 0 && fontColor !== null) {
if (typeof fontColor === "object") {
let [key, value2] = Object.entries(fontColor)[0];
old[key] = value2;
} else {
old.fontColor = fontColor;
}
}
if (borderColor !== void 0 && borderColor !== null) {
if (typeof borderColor === "object") {
let [key, value2] = Object.entries(borderColor)[0];
old[key] = value2;
} else {
old.borderColor = borderColor;
}
}
if (shadowing !== void 0 && shadowing !== null) {
if (typeof shadowing === "object") {
let [key, value2] = Object.entries(shadowing)[0];
old[key] = value2;
} else {
old.shadowing = shadowing;
}
}
if (shape !== void 0 && shape !== null) {
if (typeof shape === "object") {
let [key, value2] = Object.entries(shape)[0];
old[key] = value2;
} else {
old.shape = shape;
}
}
if (sprite !== void 0 && sprite !== null) {
if (typeof sprite === "object") {
let [key, value2] = Object.entries(sprite)[0];
old[key] = value2;
} else {
old.sprite = sprite;
}
}
if (techn !== void 0 && techn !== null) {
if (typeof techn === "object") {
let [key, value2] = Object.entries(techn)[0];
old[key] = value2;
} else {
old.techn = techn;
}
}
if (legendText !== void 0 && legendText !== null) {
if (typeof legendText === "object") {
let [key, value2] = Object.entries(legendText)[0];
old[key] = value2;
} else {
old.legendText = legendText;
}
}
if (legendSprite !== void 0 && legendSprite !== null) {
if (typeof legendSprite === "object") {
let [key, value2] = Object.entries(legendSprite)[0];
old[key] = value2;
} else {
old.legendSprite = legendSprite;
}
}
}, "updateElStyle");
updateRelStyle = /* @__PURE__ */ __name(function(typeC4Shape, from2, to, textColor, lineColor, offsetX, offsetY) {
const old = rels.find((rel2) => rel2.from === from2 && rel2.to === to);
if (old === void 0) {
return;
}
if (textColor !== void 0 && textColor !== null) {
if (typeof textColor === "object") {
let [key, value2] = Object.entries(textColor)[0];
old[key] = value2;
} else {
old.textColor = textColor;
}
}
if (lineColor !== void 0 && lineColor !== null) {
if (typeof lineColor === "object") {
let [key, value2] = Object.entries(lineColor)[0];
old[key] = value2;
} else {
old.lineColor = lineColor;
}
}
if (offsetX !== void 0 && offsetX !== null) {
if (typeof offsetX === "object") {
let [key, value2] = Object.entries(offsetX)[0];
old[key] = parseInt(value2);
} else {
old.offsetX = parseInt(offsetX);
}
}
if (offsetY !== void 0 && offsetY !== null) {
if (typeof offsetY === "object") {
let [key, value2] = Object.entries(offsetY)[0];
old[key] = parseInt(value2);
} else {
old.offsetY = parseInt(offsetY);
}
}
}, "updateRelStyle");
updateLayoutConfig = /* @__PURE__ */ __name(function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {
let c4ShapeInRowValue = c4ShapeInRow;
let c4BoundaryInRowValue = c4BoundaryInRow;
if (typeof c4ShapeInRowParam === "object") {
const value2 = Object.values(c4ShapeInRowParam)[0];
c4ShapeInRowValue = parseInt(value2);
} else {
c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
}
if (typeof c4BoundaryInRowParam === "object") {
const value2 = Object.values(c4BoundaryInRowParam)[0];
c4BoundaryInRowValue = parseInt(value2);
} else {
c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
}
if (c4ShapeInRowValue >= 1) {
c4ShapeInRow = c4ShapeInRowValue;
}
if (c4BoundaryInRowValue >= 1) {
c4BoundaryInRow = c4BoundaryInRowValue;
}
}, "updateLayoutConfig");
getC4ShapeInRow = /* @__PURE__ */ __name(function() {
return c4ShapeInRow;
}, "getC4ShapeInRow");
getC4BoundaryInRow = /* @__PURE__ */ __name(function() {
return c4BoundaryInRow;
}, "getC4BoundaryInRow");
getCurrentBoundaryParse = /* @__PURE__ */ __name(function() {
return currentBoundaryParse;
}, "getCurrentBoundaryParse");
getParentBoundaryParse = /* @__PURE__ */ __name(function() {
return parentBoundaryParse;
}, "getParentBoundaryParse");
getC4ShapeArray = /* @__PURE__ */ __name(function(parentBoundary) {
if (parentBoundary === void 0 || parentBoundary === null) {
return c4ShapeArray;
} else {
return c4ShapeArray.filter((personOrSystem) => {
return personOrSystem.parentBoundary === parentBoundary;
});
}
}, "getC4ShapeArray");
getC4Shape = /* @__PURE__ */ __name(function(alias) {
return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);
}, "getC4Shape");
getC4ShapeKeys = /* @__PURE__ */ __name(function(parentBoundary) {
return Object.keys(getC4ShapeArray(parentBoundary));
}, "getC4ShapeKeys");
getBoundaries = /* @__PURE__ */ __name(function(parentBoundary) {
if (parentBoundary === void 0 || parentBoundary === null) {
return boundaries;
} else {
return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary);
}
}, "getBoundaries");
getBoundarys = getBoundaries;
getRels = /* @__PURE__ */ __name(function() {
return rels;
}, "getRels");
getTitle = /* @__PURE__ */ __name(function() {
return title;
}, "getTitle");
setWrap = /* @__PURE__ */ __name(function(wrapSetting) {
wrapEnabled = wrapSetting;
}, "setWrap");
autoWrap = /* @__PURE__ */ __name(function() {
return wrapEnabled;
}, "autoWrap");
clear2 = /* @__PURE__ */ __name(function() {
c4ShapeArray = [];
boundaries = [
{
alias: "global",
label: { text: "global" },
type: { text: "global" },
tags: null,
link: null,
parentBoundary: ""
}
];
parentBoundaryParse = "";
currentBoundaryParse = "global";
boundaryParseStack = [""];
rels = [];
boundaryParseStack = [""];
title = "";
wrapEnabled = false;
c4ShapeInRow = 4;
c4BoundaryInRow = 2;
}, "clear");
LINETYPE = {
SOLID: 0,
DOTTED: 1,
NOTE: 2,
SOLID_CROSS: 3,
DOTTED_CROSS: 4,
SOLID_OPEN: 5,
DOTTED_OPEN: 6,
LOOP_START: 10,
LOOP_END: 11,
ALT_START: 12,
ALT_ELSE: 13,
ALT_END: 14,
OPT_START: 15,
OPT_END: 16,
ACTIVE_START: 17,
ACTIVE_END: 18,
PAR_START: 19,
PAR_AND: 20,
PAR_END: 21,
RECT_START: 22,
RECT_END: 23,
SOLID_POINT: 24,
DOTTED_POINT: 25
};
ARROWTYPE = {
FILLED: 0,
OPEN: 1
};
PLACEMENT = {
LEFTOF: 0,
RIGHTOF: 1,
OVER: 2
};
setTitle = /* @__PURE__ */ __name(function(txt) {
let sanitizedText = sanitizeText(txt, getConfig2());
title = sanitizedText;
}, "setTitle");
c4Db_default = {
addPersonOrSystem,
addPersonOrSystemBoundary,
addContainer,
addContainerBoundary,
addComponent,
addDeploymentNode,
popBoundaryParseStack,
addRel,
updateElStyle,
updateRelStyle,
updateLayoutConfig,
autoWrap,
setWrap,
getC4ShapeArray,
getC4Shape,
getC4ShapeKeys,
getBoundaries,
getBoundarys,
getCurrentBoundaryParse,
getParentBoundaryParse,
getRels,
getTitle,
getC4Type,
getC4ShapeInRow,
getC4BoundaryInRow,
setAccTitle,
getAccTitle,
getAccDescription,
setAccDescription,
getConfig: /* @__PURE__ */ __name(() => getConfig2().c4, "getConfig"),
clear: clear2,
LINETYPE,
ARROWTYPE,
PLACEMENT,
setTitle,
setC4Type
// apply,
};
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js
function ascending(a2, b3) {
return a2 == null || b3 == null ? NaN : a2 < b3 ? -1 : a2 > b3 ? 1 : a2 >= b3 ? 0 : NaN;
}
var init_ascending = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js"() {
"use strict";
__name(ascending, "ascending");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js
function descending(a2, b3) {
return a2 == null || b3 == null ? NaN : b3 < a2 ? -1 : b3 > a2 ? 1 : b3 >= a2 ? 0 : NaN;
}
var init_descending = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js"() {
"use strict";
__name(descending, "descending");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js
function bisector(f2) {
let compare1, compare2, delta;
if (f2.length !== 2) {
compare1 = ascending;
compare2 = /* @__PURE__ */ __name((d3, x5) => ascending(f2(d3), x5), "compare2");
delta = /* @__PURE__ */ __name((d3, x5) => f2(d3) - x5, "delta");
} else {
compare1 = f2 === ascending || f2 === descending ? f2 : zero;
compare2 = f2;
delta = f2;
}
function left3(a2, x5, lo = 0, hi = a2.length) {
if (lo < hi) {
if (compare1(x5, x5) !== 0) return hi;
do {
const mid = lo + hi >>> 1;
if (compare2(a2[mid], x5) < 0) lo = mid + 1;
else hi = mid;
} while (lo < hi);
}
return lo;
}
__name(left3, "left");
function right3(a2, x5, lo = 0, hi = a2.length) {
if (lo < hi) {
if (compare1(x5, x5) !== 0) return hi;
do {
const mid = lo + hi >>> 1;
if (compare2(a2[mid], x5) <= 0) lo = mid + 1;
else hi = mid;
} while (lo < hi);
}
return lo;
}
__name(right3, "right");
function center4(a2, x5, lo = 0, hi = a2.length) {
const i2 = left3(a2, x5, lo, hi - 1);
return i2 > lo && delta(a2[i2 - 1], x5) > -delta(a2[i2], x5) ? i2 - 1 : i2;
}
__name(center4, "center");
return { left: left3, center: center4, right: right3 };
}
function zero() {
return 0;
}
var init_bisector = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js"() {
"use strict";
init_ascending();
init_descending();
__name(bisector, "bisector");
__name(zero, "zero");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/number.js
function number(x5) {
return x5 === null ? NaN : +x5;
}
var init_number = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/number.js"() {
"use strict";
__name(number, "number");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisect.js
var ascendingBisect, bisectRight, bisectLeft, bisectCenter, bisect_default;
var init_bisect = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisect.js"() {
"use strict";
init_ascending();
init_bisector();
init_number();
ascendingBisect = bisector(ascending);
bisectRight = ascendingBisect.right;
bisectLeft = ascendingBisect.left;
bisectCenter = bisector(number).center;
bisect_default = bisectRight;
}
});
// ../../node_modules/.pnpm/internmap@2.0.3/node_modules/internmap/src/index.js
function intern_get({ _intern, _key }, value2) {
const key = _key(value2);
return _intern.has(key) ? _intern.get(key) : value2;
}
function intern_set({ _intern, _key }, value2) {
const key = _key(value2);
if (_intern.has(key)) return _intern.get(key);
_intern.set(key, value2);
return value2;
}
function intern_delete({ _intern, _key }, value2) {
const key = _key(value2);
if (_intern.has(key)) {
value2 = _intern.get(key);
_intern.delete(key);
}
return value2;
}
function keyof(value2) {
return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2;
}
var InternMap;
var init_src = __esm({
"../../node_modules/.pnpm/internmap@2.0.3/node_modules/internmap/src/index.js"() {
"use strict";
InternMap = class extends Map {
static {
__name(this, "InternMap");
}
constructor(entries2, key = keyof) {
super();
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } });
if (entries2 != null) for (const [key2, value2] of entries2) this.set(key2, value2);
}
get(key) {
return super.get(intern_get(this, key));
}
has(key) {
return super.has(intern_get(this, key));
}
set(key, value2) {
return super.set(intern_set(this, key), value2);
}
delete(key) {
return super.delete(intern_delete(this, key));
}
};
__name(intern_get, "intern_get");
__name(intern_set, "intern_set");
__name(intern_delete, "intern_delete");
__name(keyof, "keyof");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ticks.js
function tickSpec(start3, stop5, count2) {
const step3 = (stop5 - start3) / Math.max(0, count2), power = Math.floor(Math.log10(step3)), error3 = step3 / Math.pow(10, power), factor = error3 >= e10 ? 10 : error3 >= e5 ? 5 : error3 >= e2 ? 2 : 1;
let i1, i2, inc;
if (power < 0) {
inc = Math.pow(10, -power) / factor;
i1 = Math.round(start3 * inc);
i2 = Math.round(stop5 * inc);
if (i1 / inc < start3) ++i1;
if (i2 / inc > stop5) --i2;
inc = -inc;
} else {
inc = Math.pow(10, power) * factor;
i1 = Math.round(start3 / inc);
i2 = Math.round(stop5 / inc);
if (i1 * inc < start3) ++i1;
if (i2 * inc > stop5) --i2;
}
if (i2 < i1 && 0.5 <= count2 && count2 < 2) return tickSpec(start3, stop5, count2 * 2);
return [i1, i2, inc];
}
function ticks(start3, stop5, count2) {
stop5 = +stop5, start3 = +start3, count2 = +count2;
if (!(count2 > 0)) return [];
if (start3 === stop5) return [start3];
const reverse2 = stop5 < start3, [i1, i2, inc] = reverse2 ? tickSpec(stop5, start3, count2) : tickSpec(start3, stop5, count2);
if (!(i2 >= i1)) return [];
const n2 = i2 - i1 + 1, ticks2 = new Array(n2);
if (reverse2) {
if (inc < 0) for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i2 - i3) / -inc;
else for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i2 - i3) * inc;
} else {
if (inc < 0) for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i1 + i3) / -inc;
else for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i1 + i3) * inc;
}
return ticks2;
}
function tickIncrement(start3, stop5, count2) {
stop5 = +stop5, start3 = +start3, count2 = +count2;
return tickSpec(start3, stop5, count2)[2];
}
function tickStep(start3, stop5, count2) {
stop5 = +stop5, start3 = +start3, count2 = +count2;
const reverse2 = stop5 < start3, inc = reverse2 ? tickIncrement(stop5, start3, count2) : tickIncrement(start3, stop5, count2);
return (reverse2 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}
var e10, e5, e2;
var init_ticks = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ticks.js"() {
"use strict";
e10 = Math.sqrt(50);
e5 = Math.sqrt(10);
e2 = Math.sqrt(2);
__name(tickSpec, "tickSpec");
__name(ticks, "ticks");
__name(tickIncrement, "tickIncrement");
__name(tickStep, "tickStep");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/max.js
function max(values2, valueof) {
let max10;
if (valueof === void 0) {
for (const value2 of values2) {
if (value2 != null && (max10 < value2 || max10 === void 0 && value2 >= value2)) {
max10 = value2;
}
}
} else {
let index = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index, values2)) != null && (max10 < value2 || max10 === void 0 && value2 >= value2)) {
max10 = value2;
}
}
}
return max10;
}
var init_max = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/max.js"() {
"use strict";
__name(max, "max");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js
function min(values2, valueof) {
let min9;
if (valueof === void 0) {
for (const value2 of values2) {
if (value2 != null && (min9 > value2 || min9 === void 0 && value2 >= value2)) {
min9 = value2;
}
}
} else {
let index = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index, values2)) != null && (min9 > value2 || min9 === void 0 && value2 >= value2)) {
min9 = value2;
}
}
}
return min9;
}
var init_min = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js"() {
"use strict";
__name(min, "min");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/range.js
function range(start3, stop5, step3) {
start3 = +start3, stop5 = +stop5, step3 = (n2 = arguments.length) < 2 ? (stop5 = start3, start3 = 0, 1) : n2 < 3 ? 1 : +step3;
var i2 = -1, n2 = Math.max(0, Math.ceil((stop5 - start3) / step3)) | 0, range3 = new Array(n2);
while (++i2 < n2) {
range3[i2] = start3 + i2 * step3;
}
return range3;
}
var init_range = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/range.js"() {
"use strict";
__name(range, "range");
}
});
// ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/index.js
var init_src2 = __esm({
"../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/index.js"() {
"use strict";
init_bisect();
init_bisector();
init_max();
init_min();
init_range();
init_ticks();
init_src();
}
});
// ../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/identity.js
function identity_default(x5) {
return x5;
}
var init_identity = __esm({
"../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/identity.js"() {
"use strict";
__name(identity_default, "default");
}
});
// ../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/axis.js
function translateX(x5) {
return "translate(" + x5 + ",0)";
}
function translateY(y6) {
return "translate(0," + y6 + ")";
}
function number2(scale2) {
return (d3) => +scale2(d3);
}
function center(scale2, offset) {
offset = Math.max(0, scale2.bandwidth() - offset * 2) / 2;
if (scale2.round()) offset = Math.round(offset);
return (d3) => +scale2(d3) + offset;
}
function entering() {
return !this.__axis;
}
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 ? 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));
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);
text4 = text4.transition(context);
tickExit = tickExit.transition(context).attr("opacity", epsilon).attr("transform", function(d3) {
return isFinite(d3 = position5(d3)) ? transform8(d3 + offset) : this.getAttribute("transform");
});
tickEnter.attr("opacity", epsilon).attr("transform", function(d3) {
var p3 = this.parentNode.__axis;
return transform8((p3 && isFinite(p3 = p3(d3)) ? p3 : position5(d3)) + offset);
});
}
tickExit.remove();
path4.attr("d", orient === left || orient === right ? tickSizeOuter ? "M" + k2 * tickSizeOuter + "," + range0 + "H" + offset + "V" + range1 + "H" + k2 * tickSizeOuter : "M" + offset + "," + range0 + "V" + range1 : tickSizeOuter ? "M" + range0 + "," + k2 * tickSizeOuter + "V" + offset + "H" + range1 + "V" + k2 * tickSizeOuter : "M" + range0 + "," + offset + "H" + range1);
tick.attr("opacity", 1).attr("transform", function(d3) {
return transform8(position5(d3) + offset);
});
line2.attr(x5 + "2", k2 * tickSizeInner);
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;
});
}
__name(axis2, "axis");
axis2.scale = function(_3) {
return arguments.length ? (scale2 = _3, axis2) : scale2;
};
axis2.ticks = function() {
return tickArguments = Array.from(arguments), axis2;
};
axis2.tickArguments = function(_3) {
return arguments.length ? (tickArguments = _3 == null ? [] : Array.from(_3), axis2) : tickArguments.slice();
};
axis2.tickValues = function(_3) {
return arguments.length ? (tickValues = _3 == null ? null : Array.from(_3), axis2) : tickValues && tickValues.slice();
};
axis2.tickFormat = function(_3) {
return arguments.length ? (tickFormat2 = _3, axis2) : tickFormat2;
};
axis2.tickSize = function(_3) {
return arguments.length ? (tickSizeInner = tickSizeOuter = +_3, axis2) : tickSizeInner;
};
axis2.tickSizeInner = function(_3) {
return arguments.length ? (tickSizeInner = +_3, axis2) : tickSizeInner;
};
axis2.tickSizeOuter = function(_3) {
return arguments.length ? (tickSizeOuter = +_3, axis2) : tickSizeOuter;
};
axis2.tickPadding = function(_3) {
return arguments.length ? (tickPadding = +_3, axis2) : tickPadding;
};
axis2.offset = function(_3) {
return arguments.length ? (offset = +_3, axis2) : offset;
};
return axis2;
}
function axisTop(scale2) {
return axis(top, scale2);
}
function axisBottom(scale2) {
return axis(bottom, scale2);
}
var top, right, bottom, left, epsilon;
var init_axis = __esm({
"../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/axis.js"() {
"use strict";
init_identity();
top = 1;
right = 2;
bottom = 3;
left = 4;
epsilon = 1e-6;
__name(translateX, "translateX");
__name(translateY, "translateY");
__name(number2, "number");
__name(center, "center");
__name(entering, "entering");
__name(axis, "axis");
__name(axisTop, "axisTop");
__name(axisBottom, "axisBottom");
}
});
// ../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/index.js
var init_src3 = __esm({
"../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/index.js"() {
"use strict";
init_axis();
}
});
// ../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js
function dispatch() {
for (var i2 = 0, n2 = arguments.length, _3 = {}, t4; i2 < n2; ++i2) {
if (!(t4 = arguments[i2] + "") || t4 in _3 || /[\s.]/.test(t4)) throw new Error("illegal type: " + t4);
_3[t4] = [];
}
return new Dispatch(_3);
}
function Dispatch(_3) {
this._ = _3;
}
function parseTypenames(typenames, types) {
return typenames.trim().split(/^|\s+/).map(function(t4) {
var name = "", i2 = t4.indexOf(".");
if (i2 >= 0) name = t4.slice(i2 + 1), t4 = t4.slice(0, i2);
if (t4 && !types.hasOwnProperty(t4)) throw new Error("unknown type: " + t4);
return { type: t4, name };
});
}
function get(type3, name) {
for (var i2 = 0, n2 = type3.length, c3; i2 < n2; ++i2) {
if ((c3 = type3[i2]).name === name) {
return c3.value;
}
}
}
function set(type3, name, callback) {
for (var i2 = 0, n2 = type3.length; i2 < n2; ++i2) {
if (type3[i2].name === name) {
type3[i2] = noop, type3 = type3.slice(0, i2).concat(type3.slice(i2 + 1));
break;
}
}
if (callback != null) type3.push({ name, value: callback });
return type3;
}
var noop, dispatch_default;
var init_dispatch = __esm({
"../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js"() {
"use strict";
noop = { value: /* @__PURE__ */ __name(() => {
}, "value") };
__name(dispatch, "dispatch");
__name(Dispatch, "Dispatch");
__name(parseTypenames, "parseTypenames");
Dispatch.prototype = dispatch.prototype = {
constructor: Dispatch,
on: /* @__PURE__ */ __name(function(typename, callback) {
var _3 = this._, T3 = parseTypenames(typename + "", _3), t4, i2 = -1, n2 = T3.length;
if (arguments.length < 2) {
while (++i2 < n2) if ((t4 = (typename = T3[i2]).type) && (t4 = get(_3[t4], typename.name))) return t4;
return;
}
if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
while (++i2 < n2) {
if (t4 = (typename = T3[i2]).type) _3[t4] = set(_3[t4], typename.name, callback);
else if (callback == null) for (t4 in _3) _3[t4] = set(_3[t4], typename.name, null);
}
return this;
}, "on"),
copy: /* @__PURE__ */ __name(function() {
var copy5 = {}, _3 = this._;
for (var t4 in _3) copy5[t4] = _3[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];
if (!this._.hasOwnProperty(type3)) throw new Error("unknown type: " + type3);
for (t4 = this._[type3], i2 = 0, n2 = t4.length; i2 < n2; ++i2) t4[i2].value.apply(that, args);
}, "call"),
apply: /* @__PURE__ */ __name(function(type3, that, args) {
if (!this._.hasOwnProperty(type3)) throw new Error("unknown type: " + type3);
for (var t4 = this._[type3], i2 = 0, n2 = t4.length; i2 < n2; ++i2) t4[i2].value.apply(that, args);
}, "apply")
};
__name(get, "get");
__name(set, "set");
dispatch_default = dispatch;
}
});
// ../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/index.js
var init_src4 = __esm({
"../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/index.js"() {
"use strict";
init_dispatch();
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js
var xhtml, namespaces_default;
var init_namespaces = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js"() {
"use strict";
xhtml = "http://www.w3.org/1999/xhtml";
namespaces_default = {
svg: "http://www.w3.org/2000/svg",
xhtml,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js
function namespace_default(name) {
var prefix = name += "", i2 = prefix.indexOf(":");
if (i2 >= 0 && (prefix = name.slice(0, i2)) !== "xmlns") name = name.slice(i2 + 1);
return namespaces_default.hasOwnProperty(prefix) ? { space: namespaces_default[prefix], local: name } : name;
}
var init_namespace = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js"() {
"use strict";
init_namespaces();
__name(namespace_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js
function creatorInherit(name) {
return function() {
var document2 = this.ownerDocument, uri = this.namespaceURI;
return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
};
}
function creatorFixed(fullname) {
return function() {
return this.ownerDocument.createElementNS(fullname.space, fullname.local);
};
}
function creator_default(name) {
var fullname = namespace_default(name);
return (fullname.local ? creatorFixed : creatorInherit)(fullname);
}
var init_creator = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js"() {
"use strict";
init_namespace();
init_namespaces();
__name(creatorInherit, "creatorInherit");
__name(creatorFixed, "creatorFixed");
__name(creator_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js
function none() {
}
function selector_default(selector) {
return selector == null ? none : function() {
return this.querySelector(selector);
};
}
var init_selector = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js"() {
"use strict";
__name(none, "none");
__name(selector_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js
function select_default(select) {
if (typeof select !== "function") select = selector_default(select);
for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], n2 = group2.length, subgroup = subgroups[j3] = 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;
}
}
}
return new Selection(subgroups, this._parents);
}
var init_select = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js"() {
"use strict";
init_selection();
init_selector();
__name(select_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js
function array(x5) {
return x5 == null ? [] : Array.isArray(x5) ? x5 : Array.from(x5);
}
var init_array = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js"() {
"use strict";
__name(array, "array");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js
function empty() {
return [];
}
function selectorAll_default(selector) {
return selector == null ? empty : function() {
return this.querySelectorAll(selector);
};
}
var init_selectorAll = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js"() {
"use strict";
__name(empty, "empty");
__name(selectorAll_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js
function arrayAll(select) {
return function() {
return array(select.apply(this, arguments));
};
}
function selectAll_default(select) {
if (typeof select === "function") select = arrayAll(select);
else select = selectorAll_default(select);
for (var groups = this._groups, m3 = groups.length, subgroups = [], parents3 = [], j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group2[i2]) {
subgroups.push(select.call(node2, node2.__data__, i2, group2));
parents3.push(node2);
}
}
}
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"() {
"use strict";
init_selection();
init_array();
init_selectorAll();
__name(arrayAll, "arrayAll");
__name(selectAll_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js
function matcher_default(selector) {
return function() {
return this.matches(selector);
};
}
function childMatcher(selector) {
return function(node2) {
return node2.matches(selector);
};
}
var init_matcher = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js"() {
"use strict";
__name(matcher_default, "default");
__name(childMatcher, "childMatcher");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js
function childFind(match2) {
return function() {
return find.call(this.children, match2);
};
}
function childFirst() {
return this.firstElementChild;
}
function selectChild_default(match2) {
return this.select(match2 == null ? childFirst : childFind(typeof match2 === "function" ? match2 : childMatcher(match2)));
}
var find;
var init_selectChild = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js"() {
"use strict";
init_matcher();
find = Array.prototype.find;
__name(childFind, "childFind");
__name(childFirst, "childFirst");
__name(selectChild_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js
function children() {
return Array.from(this.children);
}
function childrenFilter(match2) {
return function() {
return filter.call(this.children, match2);
};
}
function selectChildren_default(match2) {
return this.selectAll(match2 == null ? children : childrenFilter(typeof match2 === "function" ? match2 : childMatcher(match2)));
}
var filter;
var init_selectChildren = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js"() {
"use strict";
init_matcher();
filter = Array.prototype.filter;
__name(children, "children");
__name(childrenFilter, "childrenFilter");
__name(selectChildren_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js
function filter_default(match2) {
if (typeof match2 !== "function") match2 = matcher_default(match2);
for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], n2 = group2.length, subgroup = subgroups[j3] = [], node2, i2 = 0; i2 < n2; ++i2) {
if ((node2 = group2[i2]) && match2.call(node2, node2.__data__, i2, group2)) {
subgroup.push(node2);
}
}
}
return new Selection(subgroups, this._parents);
}
var init_filter = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js"() {
"use strict";
init_selection();
init_matcher();
__name(filter_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js
function sparse_default(update2) {
return new Array(update2.length);
}
var init_sparse = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js"() {
"use strict";
__name(sparse_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js
function enter_default() {
return new Selection(this._enter || this._groups.map(sparse_default), this._parents);
}
function EnterNode(parent4, datum2) {
this.ownerDocument = parent4.ownerDocument;
this.namespaceURI = parent4.namespaceURI;
this._next = null;
this._parent = parent4;
this.__data__ = datum2;
}
var init_enter = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js"() {
"use strict";
init_sparse();
init_selection();
__name(enter_default, "default");
__name(EnterNode, "EnterNode");
EnterNode.prototype = {
constructor: EnterNode,
appendChild: /* @__PURE__ */ __name(function(child) {
return this._parent.insertBefore(child, this._next);
}, "appendChild"),
insertBefore: /* @__PURE__ */ __name(function(child, next3) {
return this._parent.insertBefore(child, next3);
}, "insertBefore"),
querySelector: /* @__PURE__ */ __name(function(selector) {
return this._parent.querySelector(selector);
}, "querySelector"),
querySelectorAll: /* @__PURE__ */ __name(function(selector) {
return this._parent.querySelectorAll(selector);
}, "querySelectorAll")
};
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js
function constant_default(x5) {
return function() {
return x5;
};
}
var init_constant = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js"() {
"use strict";
__name(constant_default, "default");
}
});
// ../../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;
for (; i2 < dataLength; ++i2) {
if (node2 = group2[i2]) {
node2.__data__ = data5[i2];
update2[i2] = node2;
} else {
enter[i2] = new EnterNode(parent4, data5[i2]);
}
}
for (; i2 < groupLength3; ++i2) {
if (node2 = group2[i2]) {
exit[i2] = node2;
}
}
}
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;
for (i2 = 0; i2 < groupLength3; ++i2) {
if (node2 = group2[i2]) {
keyValues[i2] = keyValue = key.call(node2, node2.__data__, i2, group2) + "";
if (nodeByKeyValue.has(keyValue)) {
exit[i2] = node2;
} else {
nodeByKeyValue.set(keyValue, node2);
}
}
}
for (i2 = 0; i2 < dataLength; ++i2) {
keyValue = key.call(parent4, data5[i2], i2, data5) + "";
if (node2 = nodeByKeyValue.get(keyValue)) {
update2[i2] = node2;
node2.__data__ = data5[i2];
nodeByKeyValue.delete(keyValue);
} else {
enter[i2] = new EnterNode(parent4, data5[i2]);
}
}
for (i2 = 0; i2 < groupLength3; ++i2) {
if ((node2 = group2[i2]) && nodeByKeyValue.get(keyValues[i2]) === node2) {
exit[i2] = node2;
}
}
}
function datum(node2) {
return node2.__data__;
}
function data_default(value2, key) {
if (!arguments.length) return Array.from(this, datum);
var bind = key ? bindKey : bindIndex, parents3 = this._parents, groups = this._groups;
if (typeof value2 !== "function") value2 = constant_default(value2);
for (var m3 = groups.length, update2 = new Array(m3), enter = new Array(m3), exit = new Array(m3), j3 = 0; j3 < m3; ++j3) {
var parent4 = parents3[j3], group2 = groups[j3], groupLength3 = group2.length, data5 = arraylike(value2.call(parent4, parent4 && parent4.__data__, j3, parents3)), dataLength = data5.length, enterGroup = enter[j3] = new Array(dataLength), updateGroup = update2[j3] = new Array(dataLength), exitGroup = exit[j3] = new Array(groupLength3);
bind(parent4, group2, enterGroup, updateGroup, exitGroup, data5, key);
for (var i0 = 0, i1 = 0, previous, next3; i0 < dataLength; ++i0) {
if (previous = enterGroup[i0]) {
if (i0 >= i1) i1 = i0 + 1;
while (!(next3 = updateGroup[i1]) && ++i1 < dataLength) ;
previous._next = next3 || null;
}
}
}
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);
}
var init_data = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js"() {
"use strict";
init_selection();
init_enter();
init_constant();
__name(bindIndex, "bindIndex");
__name(bindKey, "bindKey");
__name(datum, "datum");
__name(data_default, "default");
__name(arraylike, "arraylike");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js
function exit_default() {
return new Selection(this._exit || this._groups.map(sparse_default), this._parents);
}
var init_exit = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js"() {
"use strict";
init_sparse();
init_selection();
__name(exit_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js
function join_default(onenter, onupdate, onexit) {
var enter = this.enter(), update2 = this, exit = this.exit();
if (typeof onenter === "function") {
enter = onenter(enter);
if (enter) enter = enter.selection();
} else {
enter = enter.append(onenter + "");
}
if (onupdate != null) {
update2 = onupdate(update2);
if (update2) update2 = update2.selection();
}
if (onexit == null) exit.remove();
else onexit(exit);
return enter && update2 ? enter.merge(update2).order() : update2;
}
var init_join = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js"() {
"use strict";
__name(join_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js
function merge_default(context) {
var selection2 = context.selection ? context.selection() : context;
for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m3 = Math.min(m0, m1), merges = new Array(m0), j3 = 0; j3 < m3; ++j3) {
for (var group0 = groups0[j3], group1 = groups1[j3], n2 = group0.length, merge5 = merges[j3] = new Array(n2), node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group0[i2] || group1[i2]) {
merge5[i2] = node2;
}
}
}
for (; j3 < m0; ++j3) {
merges[j3] = groups0[j3];
}
return new Selection(merges, this._parents);
}
var init_merge2 = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js"() {
"use strict";
init_selection();
__name(merge_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js
function order_default() {
for (var groups = this._groups, j3 = -1, m3 = groups.length; ++j3 < m3; ) {
for (var group2 = groups[j3], i2 = group2.length - 1, next3 = group2[i2], node2; --i2 >= 0; ) {
if (node2 = group2[i2]) {
if (next3 && node2.compareDocumentPosition(next3) ^ 4) next3.parentNode.insertBefore(node2, next3);
next3 = node2;
}
}
}
return this;
}
var init_order = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js"() {
"use strict";
__name(order_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js
function sort_default(compare) {
if (!compare) compare = ascending2;
function compareNode(a2, b3) {
return a2 && b3 ? compare(a2.__data__, b3.__data__) : !a2 - !b3;
}
__name(compareNode, "compareNode");
for (var groups = this._groups, m3 = groups.length, sortgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], n2 = group2.length, sortgroup = sortgroups[j3] = new Array(n2), node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group2[i2]) {
sortgroup[i2] = node2;
}
}
sortgroup.sort(compareNode);
}
return new Selection(sortgroups, this._parents).order();
}
function ascending2(a2, b3) {
return a2 < b3 ? -1 : a2 > b3 ? 1 : a2 >= b3 ? 0 : NaN;
}
var init_sort = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js"() {
"use strict";
init_selection();
__name(sort_default, "default");
__name(ascending2, "ascending");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js
function call_default() {
var callback = arguments[0];
arguments[0] = this;
callback.apply(null, arguments);
return this;
}
var init_call = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js"() {
"use strict";
__name(call_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js
function nodes_default() {
return Array.from(this);
}
var init_nodes = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js"() {
"use strict";
__name(nodes_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js
function node_default() {
for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
for (var group2 = groups[j3], i2 = 0, n2 = group2.length; i2 < n2; ++i2) {
var node2 = group2[i2];
if (node2) return node2;
}
}
return null;
}
var init_node = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js"() {
"use strict";
__name(node_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js
function size_default() {
let size4 = 0;
for (const node2 of this) ++size4;
return size4;
}
var init_size2 = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js"() {
"use strict";
__name(size_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js
function empty_default() {
return !this.node();
}
var init_empty = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js"() {
"use strict";
__name(empty_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js
function each_default(callback) {
for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
for (var group2 = groups[j3], i2 = 0, n2 = group2.length, node2; i2 < n2; ++i2) {
if (node2 = group2[i2]) callback.call(node2, node2.__data__, i2, group2);
}
}
return this;
}
var init_each = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js"() {
"use strict";
__name(each_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js
function attrRemove(name) {
return function() {
this.removeAttribute(name);
};
}
function attrRemoveNS(fullname) {
return function() {
this.removeAttributeNS(fullname.space, fullname.local);
};
}
function attrConstant(name, value2) {
return function() {
this.setAttribute(name, value2);
};
}
function attrConstantNS(fullname, value2) {
return function() {
this.setAttributeNS(fullname.space, fullname.local, value2);
};
}
function attrFunction(name, value2) {
return function() {
var v3 = value2.apply(this, arguments);
if (v3 == null) this.removeAttribute(name);
else this.setAttribute(name, v3);
};
}
function attrFunctionNS(fullname, value2) {
return function() {
var v3 = value2.apply(this, arguments);
if (v3 == null) this.removeAttributeNS(fullname.space, fullname.local);
else this.setAttributeNS(fullname.space, fullname.local, v3);
};
}
function attr_default(name, value2) {
var fullname = namespace_default(name);
if (arguments.length < 2) {
var node2 = this.node();
return fullname.local ? node2.getAttributeNS(fullname.space, fullname.local) : node2.getAttribute(fullname);
}
return this.each((value2 == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value2 === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value2));
}
var init_attr = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js"() {
"use strict";
init_namespace();
__name(attrRemove, "attrRemove");
__name(attrRemoveNS, "attrRemoveNS");
__name(attrConstant, "attrConstant");
__name(attrConstantNS, "attrConstantNS");
__name(attrFunction, "attrFunction");
__name(attrFunctionNS, "attrFunctionNS");
__name(attr_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js
function window_default(node2) {
return node2.ownerDocument && node2.ownerDocument.defaultView || node2.document && node2 || node2.defaultView;
}
var init_window = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js"() {
"use strict";
__name(window_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js
function styleRemove(name) {
return function() {
this.style.removeProperty(name);
};
}
function styleConstant(name, value2, priority3) {
return function() {
this.style.setProperty(name, value2, priority3);
};
}
function styleFunction(name, value2, priority3) {
return function() {
var v3 = value2.apply(this, arguments);
if (v3 == null) this.style.removeProperty(name);
else this.style.setProperty(name, v3, priority3);
};
}
function style_default(name, value2, priority3) {
return arguments.length > 1 ? this.each((value2 == null ? styleRemove : typeof value2 === "function" ? styleFunction : styleConstant)(name, value2, priority3 == null ? "" : priority3)) : styleValue(this.node(), name);
}
function styleValue(node2, name) {
return node2.style.getPropertyValue(name) || window_default(node2).getComputedStyle(node2, null).getPropertyValue(name);
}
var init_style = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js"() {
"use strict";
init_window();
__name(styleRemove, "styleRemove");
__name(styleConstant, "styleConstant");
__name(styleFunction, "styleFunction");
__name(style_default, "default");
__name(styleValue, "styleValue");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js
function propertyRemove(name) {
return function() {
delete this[name];
};
}
function propertyConstant(name, value2) {
return function() {
this[name] = value2;
};
}
function propertyFunction(name, value2) {
return function() {
var v3 = value2.apply(this, arguments);
if (v3 == null) delete this[name];
else this[name] = v3;
};
}
function property_default(name, value2) {
return arguments.length > 1 ? this.each((value2 == null ? propertyRemove : typeof value2 === "function" ? propertyFunction : propertyConstant)(name, value2)) : this.node()[name];
}
var init_property = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js"() {
"use strict";
__name(propertyRemove, "propertyRemove");
__name(propertyConstant, "propertyConstant");
__name(propertyFunction, "propertyFunction");
__name(property_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js
function classArray(string3) {
return string3.trim().split(/^|\s+/);
}
function classList(node2) {
return node2.classList || new ClassList(node2);
}
function ClassList(node2) {
this._node = node2;
this._names = classArray(node2.getAttribute("class") || "");
}
function classedAdd(node2, names) {
var list = classList(node2), i2 = -1, n2 = names.length;
while (++i2 < n2) list.add(names[i2]);
}
function classedRemove(node2, names) {
var list = classList(node2), i2 = -1, n2 = names.length;
while (++i2 < n2) list.remove(names[i2]);
}
function classedTrue(names) {
return function() {
classedAdd(this, names);
};
}
function classedFalse(names) {
return function() {
classedRemove(this, names);
};
}
function classedFunction(names, value2) {
return function() {
(value2.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
};
}
function classed_default(name, value2) {
var names = classArray(name + "");
if (arguments.length < 2) {
var list = classList(this.node()), i2 = -1, n2 = names.length;
while (++i2 < n2) if (!list.contains(names[i2])) return false;
return true;
}
return this.each((typeof value2 === "function" ? classedFunction : value2 ? classedTrue : classedFalse)(names, value2));
}
var init_classed = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js"() {
"use strict";
__name(classArray, "classArray");
__name(classList, "classList");
__name(ClassList, "ClassList");
ClassList.prototype = {
add: /* @__PURE__ */ __name(function(name) {
var i2 = this._names.indexOf(name);
if (i2 < 0) {
this._names.push(name);
this._node.setAttribute("class", this._names.join(" "));
}
}, "add"),
remove: /* @__PURE__ */ __name(function(name) {
var i2 = this._names.indexOf(name);
if (i2 >= 0) {
this._names.splice(i2, 1);
this._node.setAttribute("class", this._names.join(" "));
}
}, "remove"),
contains: /* @__PURE__ */ __name(function(name) {
return this._names.indexOf(name) >= 0;
}, "contains")
};
__name(classedAdd, "classedAdd");
__name(classedRemove, "classedRemove");
__name(classedTrue, "classedTrue");
__name(classedFalse, "classedFalse");
__name(classedFunction, "classedFunction");
__name(classed_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js
function textRemove() {
this.textContent = "";
}
function textConstant(value2) {
return function() {
this.textContent = value2;
};
}
function textFunction(value2) {
return function() {
var v3 = value2.apply(this, arguments);
this.textContent = v3 == null ? "" : v3;
};
}
function text_default(value2) {
return arguments.length ? this.each(value2 == null ? textRemove : (typeof value2 === "function" ? textFunction : textConstant)(value2)) : this.node().textContent;
}
var init_text = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js"() {
"use strict";
__name(textRemove, "textRemove");
__name(textConstant, "textConstant");
__name(textFunction, "textFunction");
__name(text_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js
function htmlRemove() {
this.innerHTML = "";
}
function htmlConstant(value2) {
return function() {
this.innerHTML = value2;
};
}
function htmlFunction(value2) {
return function() {
var v3 = value2.apply(this, arguments);
this.innerHTML = v3 == null ? "" : v3;
};
}
function html_default(value2) {
return arguments.length ? this.each(value2 == null ? htmlRemove : (typeof value2 === "function" ? htmlFunction : htmlConstant)(value2)) : this.node().innerHTML;
}
var init_html2 = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js"() {
"use strict";
__name(htmlRemove, "htmlRemove");
__name(htmlConstant, "htmlConstant");
__name(htmlFunction, "htmlFunction");
__name(html_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js
function raise() {
if (this.nextSibling) this.parentNode.appendChild(this);
}
function raise_default() {
return this.each(raise);
}
var init_raise = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js"() {
"use strict";
__name(raise, "raise");
__name(raise_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js
function lower() {
if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function lower_default() {
return this.each(lower);
}
var init_lower = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js"() {
"use strict";
__name(lower, "lower");
__name(lower_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js
function append_default(name) {
var create4 = typeof name === "function" ? name : creator_default(name);
return this.select(function() {
return this.appendChild(create4.apply(this, arguments));
});
}
var init_append = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js"() {
"use strict";
init_creator();
__name(append_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js
function constantNull() {
return null;
}
function insert_default(name, 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(create4.apply(this, arguments), select.apply(this, arguments) || null);
});
}
var init_insert = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js"() {
"use strict";
init_creator();
init_selector();
__name(constantNull, "constantNull");
__name(insert_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js
function remove() {
var parent4 = this.parentNode;
if (parent4) parent4.removeChild(this);
}
function remove_default() {
return this.each(remove);
}
var init_remove = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js"() {
"use strict";
__name(remove, "remove");
__name(remove_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js
function selection_cloneShallow() {
var clone6 = this.cloneNode(false), parent4 = this.parentNode;
return parent4 ? parent4.insertBefore(clone6, this.nextSibling) : clone6;
}
function selection_cloneDeep() {
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);
}
var init_clone = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js"() {
"use strict";
__name(selection_cloneShallow, "selection_cloneShallow");
__name(selection_cloneDeep, "selection_cloneDeep");
__name(clone_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js
function datum_default(value2) {
return arguments.length ? this.property("__data__", value2) : this.node().__data__;
}
var init_datum = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js"() {
"use strict";
__name(datum_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js
function contextListener(listener) {
return function(event3) {
listener.call(this, event3, this.__data__);
};
}
function parseTypenames2(typenames) {
return typenames.trim().split(/^|\s+/).map(function(t4) {
var name = "", i2 = t4.indexOf(".");
if (i2 >= 0) name = t4.slice(i2 + 1), t4 = t4.slice(0, i2);
return { type: t4, name };
});
}
function onRemove(typename) {
return function() {
var on3 = this.__on;
if (!on3) return;
for (var j3 = 0, i2 = -1, m3 = on3.length, o2; j3 < m3; ++j3) {
if (o2 = on3[j3], (!typename.type || o2.type === typename.type) && o2.name === typename.name) {
this.removeEventListener(o2.type, o2.listener, o2.options);
} else {
on3[++i2] = o2;
}
}
if (++i2) on3.length = i2;
else delete this.__on;
};
}
function onAdd(typename, value2, options2) {
return function() {
var on3 = this.__on, o2, listener = contextListener(value2);
if (on3) for (var j3 = 0, m3 = on3.length; j3 < m3; ++j3) {
if ((o2 = on3[j3]).type === typename.type && o2.name === typename.name) {
this.removeEventListener(o2.type, o2.listener, o2.options);
this.addEventListener(o2.type, o2.listener = listener, o2.options = options2);
o2.value = value2;
return;
}
}
this.addEventListener(typename.type, listener, options2);
o2 = { type: typename.type, name: typename.name, value: value2, listener, options: options2 };
if (!on3) this.__on = [o2];
else on3.push(o2);
};
}
function on_default(typename, value2, options2) {
var typenames = parseTypenames2(typename + ""), i2, n2 = typenames.length, t4;
if (arguments.length < 2) {
var on3 = this.node().__on;
if (on3) for (var j3 = 0, m3 = on3.length, o2; j3 < m3; ++j3) {
for (i2 = 0, o2 = on3[j3]; i2 < n2; ++i2) {
if ((t4 = typenames[i2]).type === o2.type && t4.name === o2.name) {
return o2.value;
}
}
}
return;
}
on3 = value2 ? onAdd : onRemove;
for (i2 = 0; i2 < n2; ++i2) this.each(on3(typenames[i2], value2, options2));
return this;
}
var init_on = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js"() {
"use strict";
__name(contextListener, "contextListener");
__name(parseTypenames2, "parseTypenames");
__name(onRemove, "onRemove");
__name(onAdd, "onAdd");
__name(on_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js
function dispatchEvent(node2, type3, params) {
var window3 = window_default(node2), event3 = window3.CustomEvent;
if (typeof event3 === "function") {
event3 = new event3(type3, params);
} else {
event3 = window3.document.createEvent("Event");
if (params) event3.initEvent(type3, params.bubbles, params.cancelable), event3.detail = params.detail;
else event3.initEvent(type3, false, false);
}
node2.dispatchEvent(event3);
}
function dispatchConstant(type3, params) {
return function() {
return dispatchEvent(this, type3, params);
};
}
function dispatchFunction(type3, params) {
return function() {
return dispatchEvent(this, type3, params.apply(this, arguments));
};
}
function dispatch_default2(type3, params) {
return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type3, params));
}
var init_dispatch2 = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js"() {
"use strict";
init_window();
__name(dispatchEvent, "dispatchEvent");
__name(dispatchConstant, "dispatchConstant");
__name(dispatchFunction, "dispatchFunction");
__name(dispatch_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js
function* iterator_default() {
for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
for (var group2 = groups[j3], i2 = 0, n2 = group2.length, node2; i2 < n2; ++i2) {
if (node2 = group2[i2]) yield node2;
}
}
}
var init_iterator = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js"() {
"use strict";
__name(iterator_default, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js
function Selection(groups, parents3) {
this._groups = groups;
this._parents = parents3;
}
function selection() {
return new Selection([[document.documentElement]], root);
}
function selection_selection() {
return this;
}
var root, selection_default;
var init_selection = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js"() {
"use strict";
init_select();
init_selectAll();
init_selectChild();
init_selectChildren();
init_filter();
init_data();
init_enter();
init_exit();
init_join();
init_merge2();
init_order();
init_sort();
init_call();
init_nodes();
init_node();
init_size2();
init_empty();
init_each();
init_attr();
init_style();
init_property();
init_classed();
init_text();
init_html2();
init_raise();
init_lower();
init_append();
init_insert();
init_remove();
init_clone();
init_datum();
init_on();
init_dispatch2();
init_iterator();
root = [null];
__name(Selection, "Selection");
__name(selection, "selection");
__name(selection_selection, "selection_selection");
Selection.prototype = selection.prototype = {
constructor: Selection,
select: select_default,
selectAll: selectAll_default,
selectChild: selectChild_default,
selectChildren: selectChildren_default,
filter: filter_default,
data: data_default,
enter: enter_default,
exit: exit_default,
join: join_default,
merge: merge_default,
selection: selection_selection,
order: order_default,
sort: sort_default,
call: call_default,
nodes: nodes_default,
node: node_default,
size: size_default,
empty: empty_default,
each: each_default,
attr: attr_default,
style: style_default,
property: property_default,
classed: classed_default,
text: text_default,
html: html_default,
raise: raise_default,
lower: lower_default,
append: append_default,
insert: insert_default,
remove: remove_default,
clone: clone_default,
datum: datum_default,
on: on_default,
dispatch: dispatch_default2,
[Symbol.iterator]: iterator_default
};
selection_default = selection;
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js
function select_default2(selector) {
return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root);
}
var init_select2 = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js"() {
"use strict";
init_selection();
__name(select_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/index.js
var init_src5 = __esm({
"../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/index.js"() {
"use strict";
init_matcher();
init_namespace();
init_select2();
init_selection();
init_selector();
init_selectorAll();
init_style();
}
});
// ../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/index.js
var init_src6 = __esm({
"../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js
function define_default(constructor, factory, prototype) {
constructor.prototype = factory.prototype = prototype;
prototype.constructor = constructor;
}
function extend(parent4, definition) {
var prototype = Object.create(parent4.prototype);
for (var key in definition) prototype[key] = definition[key];
return prototype;
}
var init_define = __esm({
"../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js"() {
"use strict";
__name(define_default, "default");
__name(extend, "extend");
}
});
// ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js
function Color2() {
}
function color_formatHex() {
return this.rgb().formatHex();
}
function color_formatHex8() {
return this.rgb().formatHex8();
}
function color_formatHsl() {
return hslConvert(this).formatHsl();
}
function color_formatRgb() {
return this.rgb().formatRgb();
}
function color(format3) {
var m3, l4;
format3 = (format3 + "").trim().toLowerCase();
return (m3 = reHex.exec(format3)) ? (l4 = m3[1].length, m3 = parseInt(m3[1], 16), l4 === 6 ? rgbn(m3) : l4 === 3 ? new Rgb(m3 >> 8 & 15 | m3 >> 4 & 240, m3 >> 4 & 15 | m3 & 240, (m3 & 15) << 4 | m3 & 15, 1) : l4 === 8 ? rgba2(m3 >> 24 & 255, m3 >> 16 & 255, m3 >> 8 & 255, (m3 & 255) / 255) : l4 === 4 ? rgba2(m3 >> 12 & 15 | m3 >> 8 & 240, m3 >> 8 & 15 | m3 >> 4 & 240, m3 >> 4 & 15 | m3 & 240, ((m3 & 15) << 4 | m3 & 15) / 255) : null) : (m3 = reRgbInteger.exec(format3)) ? new Rgb(m3[1], m3[2], m3[3], 1) : (m3 = reRgbPercent.exec(format3)) ? new Rgb(m3[1] * 255 / 100, m3[2] * 255 / 100, m3[3] * 255 / 100, 1) : (m3 = reRgbaInteger.exec(format3)) ? rgba2(m3[1], m3[2], m3[3], m3[4]) : (m3 = reRgbaPercent.exec(format3)) ? rgba2(m3[1] * 255 / 100, m3[2] * 255 / 100, m3[3] * 255 / 100, m3[4]) : (m3 = reHslPercent.exec(format3)) ? hsla(m3[1], m3[2] / 100, m3[3] / 100, 1) : (m3 = reHslaPercent.exec(format3)) ? hsla(m3[1], m3[2] / 100, m3[3] / 100, m3[4]) : named.hasOwnProperty(format3) ? rgbn(named[format3]) : format3 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
}
function rgbn(n2) {
return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
}
function rgba2(r2, g2, b3, a2) {
if (a2 <= 0) r2 = g2 = b3 = NaN;
return new Rgb(r2, g2, b3, a2);
}
function rgbConvert(o2) {
if (!(o2 instanceof Color2)) o2 = color(o2);
if (!o2) return new Rgb();
o2 = o2.rgb();
return new Rgb(o2.r, o2.g, o2.b, o2.opacity);
}
function rgb(r2, g2, b3, opacity) {
return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g2, b3, opacity == null ? 1 : opacity);
}
function Rgb(r2, g2, b3, opacity) {
this.r = +r2;
this.g = +g2;
this.b = +b3;
this.opacity = +opacity;
}
function rgb_formatHex() {
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
}
function rgb_formatHex8() {
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function rgb_formatRgb() {
const a2 = clampa(this.opacity);
return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
}
function clampa(opacity) {
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
}
function clampi(value2) {
return Math.max(0, Math.min(255, Math.round(value2) || 0));
}
function hex(value2) {
value2 = clampi(value2);
return (value2 < 16 ? "0" : "") + value2.toString(16);
}
function hsla(h3, s2, l4, a2) {
if (a2 <= 0) h3 = s2 = l4 = NaN;
else if (l4 <= 0 || l4 >= 1) h3 = s2 = NaN;
else if (s2 <= 0) h3 = NaN;
return new Hsl(h3, s2, l4, a2);
}
function hslConvert(o2) {
if (o2 instanceof Hsl) return new Hsl(o2.h, o2.s, o2.l, o2.opacity);
if (!(o2 instanceof Color2)) o2 = color(o2);
if (!o2) return new Hsl();
if (o2 instanceof Hsl) return o2;
o2 = o2.rgb();
var r2 = o2.r / 255, g2 = o2.g / 255, b3 = o2.b / 255, min9 = Math.min(r2, g2, b3), max10 = Math.max(r2, g2, b3), h3 = NaN, s2 = max10 - min9, l4 = (max10 + min9) / 2;
if (s2) {
if (r2 === max10) h3 = (g2 - b3) / s2 + (g2 < b3) * 6;
else if (g2 === max10) h3 = (b3 - r2) / s2 + 2;
else h3 = (r2 - g2) / s2 + 4;
s2 /= l4 < 0.5 ? max10 + min9 : 2 - max10 - min9;
h3 *= 60;
} else {
s2 = l4 > 0 && l4 < 1 ? 0 : h3;
}
return new Hsl(h3, s2, l4, o2.opacity);
}
function hsl(h3, s2, l4, opacity) {
return arguments.length === 1 ? hslConvert(h3) : new Hsl(h3, s2, l4, opacity == null ? 1 : opacity);
}
function Hsl(h3, s2, l4, opacity) {
this.h = +h3;
this.s = +s2;
this.l = +l4;
this.opacity = +opacity;
}
function clamph(value2) {
value2 = (value2 || 0) % 360;
return value2 < 0 ? value2 + 360 : value2;
}
function clampt(value2) {
return Math.max(0, Math.min(1, value2 || 0));
}
function hsl2rgb(h3, m1, m22) {
return (h3 < 60 ? m1 + (m22 - m1) * h3 / 60 : h3 < 180 ? m22 : h3 < 240 ? m1 + (m22 - m1) * (240 - h3) / 60 : m1) * 255;
}
var darker, brighter, reI, reN, reP, reHex, reRgbInteger, reRgbPercent, reRgbaInteger, reRgbaPercent, reHslPercent, reHslaPercent, named;
var init_color2 = __esm({
"../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js"() {
"use strict";
init_define();
__name(Color2, "Color");
darker = 0.7;
brighter = 1 / darker;
reI = "\\s*([+-]?\\d+)\\s*";
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
reHex = /^#([0-9a-f]{3,8})$/;
reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`);
reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`);
reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`);
reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`);
reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`);
reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
named = {
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
};
define_default(Color2, color, {
copy(channels2) {
return Object.assign(new this.constructor(), this, channels2);
},
displayable() {
return this.rgb().displayable();
},
hex: color_formatHex,
// Deprecated! Use color.formatHex.
formatHex: color_formatHex,
formatHex8: color_formatHex8,
formatHsl: color_formatHsl,
formatRgb: color_formatRgb,
toString: color_formatRgb
});
__name(color_formatHex, "color_formatHex");
__name(color_formatHex8, "color_formatHex8");
__name(color_formatHsl, "color_formatHsl");
__name(color_formatRgb, "color_formatRgb");
__name(color, "color");
__name(rgbn, "rgbn");
__name(rgba2, "rgba");
__name(rgbConvert, "rgbConvert");
__name(rgb, "rgb");
__name(Rgb, "Rgb");
define_default(Rgb, rgb, extend(Color2, {
brighter(k2) {
k2 = k2 == null ? brighter : Math.pow(brighter, k2);
return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
},
darker(k2) {
k2 = k2 == null ? darker : Math.pow(darker, k2);
return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
},
rgb() {
return this;
},
clamp() {
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
},
displayable() {
return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
},
hex: rgb_formatHex,
// Deprecated! Use color.formatHex.
formatHex: rgb_formatHex,
formatHex8: rgb_formatHex8,
formatRgb: rgb_formatRgb,
toString: rgb_formatRgb
}));
__name(rgb_formatHex, "rgb_formatHex");
__name(rgb_formatHex8, "rgb_formatHex8");
__name(rgb_formatRgb, "rgb_formatRgb");
__name(clampa, "clampa");
__name(clampi, "clampi");
__name(hex, "hex");
__name(hsla, "hsla");
__name(hslConvert, "hslConvert");
__name(hsl, "hsl");
__name(Hsl, "Hsl");
define_default(Hsl, hsl, extend(Color2, {
brighter(k2) {
k2 = k2 == null ? brighter : Math.pow(brighter, k2);
return new Hsl(this.h, this.s, this.l * k2, this.opacity);
},
darker(k2) {
k2 = k2 == null ? darker : Math.pow(darker, k2);
return new Hsl(this.h, this.s, this.l * k2, this.opacity);
},
rgb() {
var h3 = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h3) || isNaN(this.s) ? 0 : this.s, l4 = this.l, m22 = l4 + (l4 < 0.5 ? l4 : 1 - l4) * s2, m1 = 2 * l4 - m22;
return new Rgb(
hsl2rgb(h3 >= 240 ? h3 - 240 : h3 + 120, m1, m22),
hsl2rgb(h3, m1, m22),
hsl2rgb(h3 < 120 ? h3 + 240 : h3 - 120, m1, m22),
this.opacity
);
},
clamp() {
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(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() {
const a2 = clampa(this.opacity);
return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
}
}));
__name(clamph, "clamph");
__name(clampt, "clampt");
__name(hsl2rgb, "hsl2rgb");
}
});
// ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/math.js
var radians, degrees;
var init_math = __esm({
"../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/math.js"() {
"use strict";
radians = Math.PI / 180;
degrees = 180 / Math.PI;
}
});
// ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/lab.js
function labConvert(o2) {
if (o2 instanceof Lab) return new Lab(o2.l, o2.a, o2.b, o2.opacity);
if (o2 instanceof Hcl) return hcl2lab(o2);
if (!(o2 instanceof Rgb)) o2 = rgbConvert(o2);
var r2 = rgb2lrgb(o2.r), g2 = rgb2lrgb(o2.g), b3 = rgb2lrgb(o2.b), y6 = xyz2lab((0.2225045 * r2 + 0.7168786 * g2 + 0.0606169 * b3) / Yn), x5, z3;
if (r2 === g2 && g2 === b3) x5 = z3 = y6;
else {
x5 = xyz2lab((0.4360747 * r2 + 0.3850649 * g2 + 0.1430804 * b3) / Xn);
z3 = xyz2lab((0.0139322 * r2 + 0.0971045 * g2 + 0.7141733 * b3) / Zn);
}
return new Lab(116 * y6 - 16, 500 * (x5 - y6), 200 * (y6 - z3), o2.opacity);
}
function lab(l4, a2, b3, opacity) {
return arguments.length === 1 ? labConvert(l4) : new Lab(l4, a2, b3, opacity == null ? 1 : opacity);
}
function Lab(l4, a2, b3, opacity) {
this.l = +l4;
this.a = +a2;
this.b = +b3;
this.opacity = +opacity;
}
function xyz2lab(t4) {
return t4 > t3 ? Math.pow(t4, 1 / 3) : t4 / t2 + t0;
}
function lab2xyz(t4) {
return t4 > t1 ? t4 * t4 * t4 : t2 * (t4 - t0);
}
function lrgb2rgb(x5) {
return 255 * (x5 <= 31308e-7 ? 12.92 * x5 : 1.055 * Math.pow(x5, 1 / 2.4) - 0.055);
}
function rgb2lrgb(x5) {
return (x5 /= 255) <= 0.04045 ? x5 / 12.92 : Math.pow((x5 + 0.055) / 1.055, 2.4);
}
function hclConvert(o2) {
if (o2 instanceof Hcl) return new Hcl(o2.h, o2.c, o2.l, o2.opacity);
if (!(o2 instanceof Lab)) o2 = labConvert(o2);
if (o2.a === 0 && o2.b === 0) return new Hcl(NaN, 0 < o2.l && o2.l < 100 ? 0 : NaN, o2.l, o2.opacity);
var h3 = Math.atan2(o2.b, o2.a) * degrees;
return new Hcl(h3 < 0 ? h3 + 360 : h3, Math.sqrt(o2.a * o2.a + o2.b * o2.b), o2.l, o2.opacity);
}
function hcl(h3, c3, l4, opacity) {
return arguments.length === 1 ? hclConvert(h3) : new Hcl(h3, c3, l4, opacity == null ? 1 : opacity);
}
function Hcl(h3, c3, l4, opacity) {
this.h = +h3;
this.c = +c3;
this.l = +l4;
this.opacity = +opacity;
}
function hcl2lab(o2) {
if (isNaN(o2.h)) return new Lab(o2.l, 0, 0, o2.opacity);
var h3 = o2.h * radians;
return new Lab(o2.l, Math.cos(h3) * o2.c, Math.sin(h3) * o2.c, o2.opacity);
}
var K, Xn, Yn, Zn, t0, t1, t2, t3;
var init_lab = __esm({
"../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/lab.js"() {
"use strict";
init_define();
init_color2();
init_math();
K = 18;
Xn = 0.96422;
Yn = 1;
Zn = 0.82521;
t0 = 4 / 29;
t1 = 6 / 29;
t2 = 3 * t1 * t1;
t3 = t1 * t1 * t1;
__name(labConvert, "labConvert");
__name(lab, "lab");
__name(Lab, "Lab");
define_default(Lab, lab, extend(Color2, {
brighter(k2) {
return new Lab(this.l + K * (k2 == null ? 1 : k2), this.a, this.b, this.opacity);
},
darker(k2) {
return new Lab(this.l - K * (k2 == null ? 1 : k2), this.a, this.b, this.opacity);
},
rgb() {
var y6 = (this.l + 16) / 116, x5 = isNaN(this.a) ? y6 : y6 + this.a / 500, z3 = isNaN(this.b) ? y6 : y6 - this.b / 200;
x5 = Xn * lab2xyz(x5);
y6 = Yn * lab2xyz(y6);
z3 = Zn * lab2xyz(z3);
return new Rgb(
lrgb2rgb(3.1338561 * x5 - 1.6168667 * y6 - 0.4906146 * z3),
lrgb2rgb(-0.9787684 * x5 + 1.9161415 * y6 + 0.033454 * z3),
lrgb2rgb(0.0719453 * x5 - 0.2289914 * y6 + 1.4052427 * z3),
this.opacity
);
}
}));
__name(xyz2lab, "xyz2lab");
__name(lab2xyz, "lab2xyz");
__name(lrgb2rgb, "lrgb2rgb");
__name(rgb2lrgb, "rgb2lrgb");
__name(hclConvert, "hclConvert");
__name(hcl, "hcl");
__name(Hcl, "Hcl");
__name(hcl2lab, "hcl2lab");
define_default(Hcl, hcl, extend(Color2, {
brighter(k2) {
return new Hcl(this.h, this.c, this.l + K * (k2 == null ? 1 : k2), this.opacity);
},
darker(k2) {
return new Hcl(this.h, this.c, this.l - K * (k2 == null ? 1 : k2), this.opacity);
},
rgb() {
return hcl2lab(this).rgb();
}
}));
}
});
// ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/index.js
var init_src7 = __esm({
"../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/index.js"() {
"use strict";
init_color2();
init_lab();
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basis.js
function basis(t13, v0, v12, v23, v3) {
var t22 = t13 * t13, t32 = t22 * t13;
return ((1 - 3 * t13 + 3 * t22 - t32) * v0 + (4 - 6 * t22 + 3 * t32) * v12 + (1 + 3 * t13 + 3 * t22 - 3 * t32) * v23 + t32 * v3) / 6;
}
function basis_default(values2) {
var n2 = values2.length - 1;
return function(t4) {
var i2 = t4 <= 0 ? t4 = 0 : t4 >= 1 ? (t4 = 1, n2 - 1) : Math.floor(t4 * n2), v12 = values2[i2], v23 = values2[i2 + 1], v0 = i2 > 0 ? values2[i2 - 1] : 2 * v12 - v23, v3 = i2 < n2 - 1 ? values2[i2 + 2] : 2 * v23 - v12;
return basis((t4 - i2 / n2) * n2, v0, v12, v23, v3);
};
}
var init_basis = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basis.js"() {
"use strict";
__name(basis, "basis");
__name(basis_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basisClosed.js
function basisClosed_default(values2) {
var n2 = values2.length;
return function(t4) {
var i2 = Math.floor(((t4 %= 1) < 0 ? ++t4 : t4) * n2), v0 = values2[(i2 + n2 - 1) % n2], v12 = values2[i2 % n2], v23 = values2[(i2 + 1) % n2], v3 = values2[(i2 + 2) % n2];
return basis((t4 - i2 / n2) * n2, v0, v12, v23, v3);
};
}
var init_basisClosed = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basisClosed.js"() {
"use strict";
init_basis();
__name(basisClosed_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js
var constant_default2;
var init_constant2 = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js"() {
"use strict";
constant_default2 = /* @__PURE__ */ __name((x5) => () => x5, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js
function linear(a2, d3) {
return function(t4) {
return a2 + t4 * d3;
};
}
function exponential(a2, b3, y6) {
return a2 = Math.pow(a2, y6), b3 = Math.pow(b3, y6) - a2, y6 = 1 / y6, function(t4) {
return Math.pow(a2 + t4 * b3, y6);
};
}
function hue(a2, b3) {
var d3 = b3 - a2;
return d3 ? linear(a2, d3 > 180 || d3 < -180 ? d3 - 360 * Math.round(d3 / 360) : d3) : constant_default2(isNaN(a2) ? b3 : a2);
}
function gamma(y6) {
return (y6 = +y6) === 1 ? nogamma : function(a2, b3) {
return b3 - a2 ? exponential(a2, b3, y6) : constant_default2(isNaN(a2) ? b3 : a2);
};
}
function nogamma(a2, b3) {
var d3 = b3 - a2;
return d3 ? linear(a2, d3) : constant_default2(isNaN(a2) ? b3 : a2);
}
var init_color3 = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js"() {
"use strict";
init_constant2();
__name(linear, "linear");
__name(exponential, "exponential");
__name(hue, "hue");
__name(gamma, "gamma");
__name(nogamma, "nogamma");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js
function rgbSpline(spline) {
return function(colors2) {
var n2 = colors2.length, r2 = new Array(n2), g2 = new Array(n2), b3 = new Array(n2), i2, color2;
for (i2 = 0; i2 < n2; ++i2) {
color2 = rgb(colors2[i2]);
r2[i2] = color2.r || 0;
g2[i2] = color2.g || 0;
b3[i2] = color2.b || 0;
}
r2 = spline(r2);
g2 = spline(g2);
b3 = spline(b3);
color2.opacity = 1;
return function(t4) {
color2.r = r2(t4);
color2.g = g2(t4);
color2.b = b3(t4);
return color2 + "";
};
};
}
var rgb_default2, rgbBasis, rgbBasisClosed;
var init_rgb2 = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js"() {
"use strict";
init_src7();
init_basis();
init_basisClosed();
init_color3();
rgb_default2 = (/* @__PURE__ */ __name((function rgbGamma(y6) {
var color2 = gamma(y6);
function rgb2(start3, end2) {
var r2 = color2((start3 = rgb(start3)).r, (end2 = rgb(end2)).r), g2 = color2(start3.g, end2.g), b3 = color2(start3.b, end2.b), opacity = nogamma(start3.opacity, end2.opacity);
return function(t4) {
start3.r = r2(t4);
start3.g = g2(t4);
start3.b = b3(t4);
start3.opacity = opacity(t4);
return start3 + "";
};
}
__name(rgb2, "rgb");
rgb2.gamma = rgbGamma;
return rgb2;
}), "rgbGamma"))(1);
__name(rgbSpline, "rgbSpline");
rgbBasis = rgbSpline(basis_default);
rgbBasisClosed = rgbSpline(basisClosed_default);
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/numberArray.js
function numberArray_default(a2, b3) {
if (!b3) b3 = [];
var n2 = a2 ? Math.min(b3.length, a2.length) : 0, c3 = b3.slice(), i2;
return function(t4) {
for (i2 = 0; i2 < n2; ++i2) c3[i2] = a2[i2] * (1 - t4) + b3[i2] * t4;
return c3;
};
}
function isNumberArray(x5) {
return ArrayBuffer.isView(x5) && !(x5 instanceof DataView);
}
var init_numberArray = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/numberArray.js"() {
"use strict";
__name(numberArray_default, "default");
__name(isNumberArray, "isNumberArray");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js
function genericArray(a2, b3) {
var nb = b3 ? b3.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x5 = new Array(na), c3 = new Array(nb), i2;
for (i2 = 0; i2 < na; ++i2) x5[i2] = value_default(a2[i2], b3[i2]);
for (; i2 < nb; ++i2) c3[i2] = b3[i2];
return function(t4) {
for (i2 = 0; i2 < na; ++i2) c3[i2] = x5[i2](t4);
return c3;
};
}
var init_array2 = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js"() {
"use strict";
init_value();
__name(genericArray, "genericArray");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/date.js
function date_default(a2, b3) {
var d3 = /* @__PURE__ */ new Date();
return a2 = +a2, b3 = +b3, function(t4) {
return d3.setTime(a2 * (1 - t4) + b3 * t4), d3;
};
}
var init_date = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/date.js"() {
"use strict";
__name(date_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js
function number_default(a2, b3) {
return a2 = +a2, b3 = +b3, function(t4) {
return a2 * (1 - t4) + b3 * t4;
};
}
var init_number2 = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js"() {
"use strict";
__name(number_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/object.js
function object_default(a2, b3) {
var i2 = {}, c3 = {}, k2;
if (a2 === null || typeof a2 !== "object") a2 = {};
if (b3 === null || typeof b3 !== "object") b3 = {};
for (k2 in b3) {
if (k2 in a2) {
i2[k2] = value_default(a2[k2], b3[k2]);
} else {
c3[k2] = b3[k2];
}
}
return function(t4) {
for (k2 in i2) c3[k2] = i2[k2](t4);
return c3;
};
}
var init_object = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/object.js"() {
"use strict";
init_value();
__name(object_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js
function zero2(b3) {
return function() {
return b3;
};
}
function one(b3) {
return function(t4) {
return b3(t4) + "";
};
}
function string_default(a2, b3) {
var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1, s2 = [], q3 = [];
a2 = a2 + "", b3 = b3 + "";
while ((am = reA.exec(a2)) && (bm = reB.exec(b3))) {
if ((bs = bm.index) > bi) {
bs = b3.slice(bi, bs);
if (s2[i2]) s2[i2] += bs;
else s2[++i2] = bs;
}
if ((am = am[0]) === (bm = bm[0])) {
if (s2[i2]) s2[i2] += bm;
else s2[++i2] = bm;
} else {
s2[++i2] = null;
q3.push({ i: i2, x: number_default(am, bm) });
}
bi = reB.lastIndex;
}
if (bi < b3.length) {
bs = b3.slice(bi);
if (s2[i2]) s2[i2] += bs;
else s2[++i2] = bs;
}
return s2.length < 2 ? q3[0] ? one(q3[0].x) : zero2(b3) : (b3 = q3.length, function(t4) {
for (var i3 = 0, o2; i3 < b3; ++i3) s2[(o2 = q3[i3]).i] = o2.x(t4);
return s2.join("");
});
}
var reA, reB;
var init_string = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js"() {
"use strict";
init_number2();
reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
reB = new RegExp(reA.source, "g");
__name(zero2, "zero");
__name(one, "one");
__name(string_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/value.js
function value_default(a2, b3) {
var t4 = typeof b3, c3;
return b3 == null || t4 === "boolean" ? constant_default2(b3) : (t4 === "number" ? number_default : t4 === "string" ? (c3 = color(b3)) ? (b3 = c3, rgb_default2) : string_default : b3 instanceof color ? rgb_default2 : b3 instanceof Date ? date_default : isNumberArray(b3) ? numberArray_default : Array.isArray(b3) ? genericArray : typeof b3.valueOf !== "function" && typeof b3.toString !== "function" || isNaN(b3) ? object_default : number_default)(a2, b3);
}
var init_value = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/value.js"() {
"use strict";
init_src7();
init_rgb2();
init_array2();
init_date();
init_number2();
init_object();
init_string();
init_constant2();
init_numberArray();
__name(value_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/round.js
function round_default(a2, b3) {
return a2 = +a2, b3 = +b3, function(t4) {
return Math.round(a2 * (1 - t4) + b3 * t4);
};
}
var init_round = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/round.js"() {
"use strict";
__name(round_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js
function decompose_default(a2, b3, c3, d3, e3, f2) {
var scaleX, scaleY, skewX;
if (scaleX = Math.sqrt(a2 * a2 + b3 * b3)) a2 /= scaleX, b3 /= scaleX;
if (skewX = a2 * c3 + b3 * d3) c3 -= a2 * skewX, d3 -= b3 * skewX;
if (scaleY = Math.sqrt(c3 * c3 + d3 * d3)) c3 /= scaleY, d3 /= scaleY, skewX /= scaleY;
if (a2 * d3 < b3 * c3) a2 = -a2, b3 = -b3, skewX = -skewX, scaleX = -scaleX;
return {
translateX: e3,
translateY: f2,
rotate: Math.atan2(b3, a2) * degrees2,
skewX: Math.atan(skewX) * degrees2,
scaleX,
scaleY
};
}
var degrees2, identity;
var init_decompose = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js"() {
"use strict";
degrees2 = 180 / Math.PI;
identity = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
__name(decompose_default, "default");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js
function parseCss(value2) {
const m3 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value2 + "");
return m3.isIdentity ? identity : decompose_default(m3.a, m3.b, m3.c, m3.d, m3.e, m3.f);
}
function parseSvg(value2) {
if (value2 == null) return identity;
if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
svgNode.setAttribute("transform", value2);
if (!(value2 = svgNode.transform.baseVal.consolidate())) return identity;
value2 = value2.matrix;
return decompose_default(value2.a, value2.b, value2.c, value2.d, value2.e, value2.f);
}
var svgNode;
var init_parse = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js"() {
"use strict";
init_decompose();
__name(parseCss, "parseCss");
__name(parseSvg, "parseSvg");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js
function interpolateTransform(parse7, pxComma, pxParen, degParen) {
function pop(s2) {
return s2.length ? s2.pop() + " " : "";
}
__name(pop, "pop");
function translate2(xa, ya, xb, yb, s2, q3) {
if (xa !== xb || ya !== yb) {
var i2 = s2.push("translate(", null, pxComma, null, pxParen);
q3.push({ i: i2 - 4, x: number_default(xa, xb) }, { i: i2 - 2, x: number_default(ya, yb) });
} else if (xb || yb) {
s2.push("translate(" + xb + pxComma + yb + pxParen);
}
}
__name(translate2, "translate");
function rotate2(a2, b3, s2, q3) {
if (a2 !== b3) {
if (a2 - b3 > 180) b3 += 360;
else if (b3 - a2 > 180) a2 += 360;
q3.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: number_default(a2, b3) });
} else if (b3) {
s2.push(pop(s2) + "rotate(" + b3 + degParen);
}
}
__name(rotate2, "rotate");
function skewX(a2, b3, s2, q3) {
if (a2 !== b3) {
q3.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default(a2, b3) });
} else if (b3) {
s2.push(pop(s2) + "skewX(" + b3 + degParen);
}
}
__name(skewX, "skewX");
function scale2(xa, ya, xb, yb, s2, q3) {
if (xa !== xb || ya !== yb) {
var i2 = s2.push(pop(s2) + "scale(", null, ",", null, ")");
q3.push({ i: i2 - 4, x: number_default(xa, xb) }, { i: i2 - 2, x: number_default(ya, yb) });
} else if (xb !== 1 || yb !== 1) {
s2.push(pop(s2) + "scale(" + xb + "," + yb + ")");
}
}
__name(scale2, "scale");
return function(a2, b3) {
var s2 = [], q3 = [];
a2 = parse7(a2), b3 = parse7(b3);
translate2(a2.translateX, a2.translateY, b3.translateX, b3.translateY, s2, q3);
rotate2(a2.rotate, b3.rotate, s2, q3);
skewX(a2.skewX, b3.skewX, s2, q3);
scale2(a2.scaleX, a2.scaleY, b3.scaleX, b3.scaleY, s2, q3);
a2 = b3 = null;
return function(t4) {
var i2 = -1, n2 = q3.length, o2;
while (++i2 < n2) s2[(o2 = q3[i2]).i] = o2.x(t4);
return s2.join("");
};
};
}
var interpolateTransformCss, interpolateTransformSvg;
var init_transform = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js"() {
"use strict";
init_number2();
init_parse();
__name(interpolateTransform, "interpolateTransform");
interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/hcl.js
function hcl2(hue2) {
return function(start3, end2) {
var h3 = hue2((start3 = hcl(start3)).h, (end2 = hcl(end2)).h), c3 = nogamma(start3.c, end2.c), l4 = nogamma(start3.l, end2.l), opacity = nogamma(start3.opacity, end2.opacity);
return function(t4) {
start3.h = h3(t4);
start3.c = c3(t4);
start3.l = l4(t4);
start3.opacity = opacity(t4);
return start3 + "";
};
};
}
var hcl_default, hclLong;
var init_hcl = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/hcl.js"() {
"use strict";
init_src7();
init_color3();
__name(hcl2, "hcl");
hcl_default = hcl2(hue);
hclLong = hcl2(nogamma);
}
});
// ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/index.js
var init_src8 = __esm({
"../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/index.js"() {
"use strict";
init_value();
init_number2();
init_round();
init_string();
init_transform();
init_rgb2();
init_hcl();
}
});
// ../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js
function now() {
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
}
function clearNow() {
clockNow = 0;
}
function Timer() {
this._call = this._time = this._next = null;
}
function timer(callback, delay2, time4) {
var t4 = new Timer();
t4.restart(callback, delay2, time4);
return t4;
}
function timerFlush() {
now();
++frame;
var t4 = taskHead, e3;
while (t4) {
if ((e3 = clockNow - t4._time) >= 0) t4._call.call(void 0, e3);
t4 = t4._next;
}
--frame;
}
function wake() {
clockNow = (clockLast = clock.now()) + clockSkew;
frame = timeout = 0;
try {
timerFlush();
} finally {
frame = 0;
nap();
clockNow = 0;
}
}
function poke() {
var now3 = clock.now(), delay2 = now3 - clockLast;
if (delay2 > pokeDelay) clockSkew -= delay2, clockLast = now3;
}
function nap() {
var t03, t13 = taskHead, t22, time4 = Infinity;
while (t13) {
if (t13._call) {
if (time4 > t13._time) time4 = t13._time;
t03 = t13, t13 = t13._next;
} else {
t22 = t13._next, t13._next = null;
t13 = t03 ? t03._next = t22 : taskHead = t22;
}
}
taskTail = t03;
sleep(time4);
}
function sleep(time4) {
if (frame) return;
if (timeout) timeout = clearTimeout(timeout);
var delay2 = time4 - clockNow;
if (delay2 > 24) {
if (time4 < Infinity) timeout = setTimeout(wake, time4 - clock.now() - clockSkew);
if (interval) interval = clearInterval(interval);
} else {
if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
frame = 1, setFrame(wake);
}
}
var frame, timeout, interval, pokeDelay, taskHead, taskTail, clockLast, clockNow, clockSkew, clock, setFrame;
var init_timer = __esm({
"../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js"() {
"use strict";
frame = 0;
timeout = 0;
interval = 0;
pokeDelay = 1e3;
clockLast = 0;
clockNow = 0;
clockSkew = 0;
clock = typeof performance === "object" && performance.now ? performance : Date;
setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f2) {
setTimeout(f2, 17);
};
__name(now, "now");
__name(clearNow, "clearNow");
__name(Timer, "Timer");
Timer.prototype = timer.prototype = {
constructor: Timer,
restart: /* @__PURE__ */ __name(function(callback, delay2, time4) {
if (typeof callback !== "function") throw new TypeError("callback is not a function");
time4 = (time4 == null ? now() : +time4) + (delay2 == null ? 0 : +delay2);
if (!this._next && taskTail !== this) {
if (taskTail) taskTail._next = this;
else taskHead = this;
taskTail = this;
}
this._call = callback;
this._time = time4;
sleep();
}, "restart"),
stop: /* @__PURE__ */ __name(function() {
if (this._call) {
this._call = null;
this._time = Infinity;
sleep();
}
}, "stop")
};
__name(timer, "timer");
__name(timerFlush, "timerFlush");
__name(wake, "wake");
__name(poke, "poke");
__name(nap, "nap");
__name(sleep, "sleep");
}
});
// ../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js
function timeout_default(callback, delay2, time4) {
var t4 = new Timer();
delay2 = delay2 == null ? 0 : +delay2;
t4.restart((elapsed) => {
t4.stop();
callback(elapsed + delay2);
}, delay2, time4);
return t4;
}
var init_timeout = __esm({
"../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js"() {
"use strict";
init_timer();
__name(timeout_default, "default");
}
});
// ../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/index.js
var init_src9 = __esm({
"../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/index.js"() {
"use strict";
init_timer();
init_timeout();
}
});
// ../../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, id30, index, group2, timing) {
var schedules = node2.__transition;
if (!schedules) node2.__transition = {};
else if (id30 in schedules) return;
create2(node2, id30, {
name,
index,
// For context during callback.
group: group2,
// For context during callback.
on: emptyOn,
tween: emptyTween,
time: timing.time,
delay: timing.delay,
duration: timing.duration,
ease: timing.ease,
timer: null,
state: CREATED
});
}
function init(node2, id30) {
var schedule = get2(node2, id30);
if (schedule.state > CREATED) throw new Error("too late; already scheduled");
return schedule;
}
function set2(node2, id30) {
var schedule = get2(node2, id30);
if (schedule.state > STARTED) throw new Error("too late; already running");
return schedule;
}
function get2(node2, id30) {
var schedule = node2.__transition;
if (!schedule || !(schedule = schedule[id30])) throw new Error("transition not found");
return schedule;
}
function create2(node2, id30, self2) {
var schedules = node2.__transition, tween;
schedules[id30] = self2;
self2.timer = timer(schedule, 0, self2.time);
function schedule(elapsed) {
self2.state = SCHEDULED;
self2.timer.restart(start3, self2.delay, self2.time);
if (self2.delay <= elapsed) start3(elapsed - self2.delay);
}
__name(schedule, "schedule");
function start3(elapsed) {
var i2, j3, n2, o2;
if (self2.state !== SCHEDULED) return stop5();
for (i2 in schedules) {
o2 = schedules[i2];
if (o2.name !== self2.name) continue;
if (o2.state === STARTED) return timeout_default(start3);
if (o2.state === RUNNING) {
o2.state = ENDED;
o2.timer.stop();
o2.on.call("interrupt", node2, node2.__data__, o2.index, o2.group);
delete schedules[i2];
} else if (+i2 < id30) {
o2.state = ENDED;
o2.timer.stop();
o2.on.call("cancel", node2, node2.__data__, o2.index, o2.group);
delete schedules[i2];
}
}
timeout_default(function() {
if (self2.state === STARTED) {
self2.state = RUNNING;
self2.timer.restart(tick, self2.delay, self2.time);
tick(elapsed);
}
});
self2.state = STARTING;
self2.on.call("start", node2, node2.__data__, self2.index, self2.group);
if (self2.state !== STARTING) return;
self2.state = STARTED;
tween = new Array(n2 = self2.tween.length);
for (i2 = 0, j3 = -1; i2 < n2; ++i2) {
if (o2 = self2.tween[i2].value.call(node2, node2.__data__, self2.index, self2.group)) {
tween[++j3] = o2;
}
}
tween.length = j3 + 1;
}
__name(start3, "start");
function tick(elapsed) {
var t4 = elapsed < self2.duration ? self2.ease.call(null, elapsed / self2.duration) : (self2.timer.restart(stop5), self2.state = ENDING, 1), i2 = -1, n2 = tween.length;
while (++i2 < n2) {
tween[i2].call(node2, t4);
}
if (self2.state === ENDING) {
self2.on.call("end", node2, node2.__data__, self2.index, self2.group);
stop5();
}
}
__name(tick, "tick");
function stop5() {
self2.state = ENDED;
self2.timer.stop();
delete schedules[id30];
for (var i2 in schedules) return;
delete node2.__transition;
}
__name(stop5, "stop");
}
var emptyOn, emptyTween, CREATED, SCHEDULED, STARTING, STARTED, RUNNING, ENDING, ENDED;
var init_schedule = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js"() {
"use strict";
init_src4();
init_src9();
emptyOn = dispatch_default("start", "end", "cancel", "interrupt");
emptyTween = [];
CREATED = 0;
SCHEDULED = 1;
STARTING = 2;
STARTED = 3;
RUNNING = 4;
ENDING = 5;
ENDED = 6;
__name(schedule_default, "default");
__name(init, "init");
__name(set2, "set");
__name(get2, "get");
__name(create2, "create");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js
function interrupt_default(node2, name) {
var schedules = node2.__transition, schedule, active, empty3 = true, i2;
if (!schedules) return;
name = name == null ? null : name + "";
for (i2 in schedules) {
if ((schedule = schedules[i2]).name !== name) {
empty3 = false;
continue;
}
active = schedule.state > STARTING && schedule.state < ENDING;
schedule.state = ENDED;
schedule.timer.stop();
schedule.on.call(active ? "interrupt" : "cancel", node2, node2.__data__, schedule.index, schedule.group);
delete schedules[i2];
}
if (empty3) delete node2.__transition;
}
var init_interrupt = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js"() {
"use strict";
init_schedule();
__name(interrupt_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js
function interrupt_default2(name) {
return this.each(function() {
interrupt_default(this, name);
});
}
var init_interrupt2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js"() {
"use strict";
init_interrupt();
__name(interrupt_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js
function tweenRemove(id30, name) {
var tween0, tween1;
return function() {
var schedule = set2(this, id30), tween = schedule.tween;
if (tween !== tween0) {
tween1 = tween0 = tween;
for (var i2 = 0, n2 = tween1.length; i2 < n2; ++i2) {
if (tween1[i2].name === name) {
tween1 = tween1.slice();
tween1.splice(i2, 1);
break;
}
}
}
schedule.tween = tween1;
};
}
function tweenFunction(id30, name, value2) {
var tween0, tween1;
if (typeof value2 !== "function") throw new Error();
return function() {
var schedule = set2(this, id30), tween = schedule.tween;
if (tween !== tween0) {
tween1 = (tween0 = tween).slice();
for (var t4 = { name, value: value2 }, i2 = 0, n2 = tween1.length; i2 < n2; ++i2) {
if (tween1[i2].name === name) {
tween1[i2] = t4;
break;
}
}
if (i2 === n2) tween1.push(t4);
}
schedule.tween = tween1;
};
}
function tween_default(name, value2) {
var id30 = this._id;
name += "";
if (arguments.length < 2) {
var tween = get2(this.node(), id30).tween;
for (var i2 = 0, n2 = tween.length, t4; i2 < n2; ++i2) {
if ((t4 = tween[i2]).name === name) {
return t4.value;
}
}
return null;
}
return this.each((value2 == null ? tweenRemove : tweenFunction)(id30, name, value2));
}
function tweenValue(transition2, name, value2) {
var id30 = transition2._id;
transition2.each(function() {
var schedule = set2(this, id30);
(schedule.value || (schedule.value = {}))[name] = value2.apply(this, arguments);
});
return function(node2) {
return get2(node2, id30).value[name];
};
}
var init_tween = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js"() {
"use strict";
init_schedule();
__name(tweenRemove, "tweenRemove");
__name(tweenFunction, "tweenFunction");
__name(tween_default, "default");
__name(tweenValue, "tweenValue");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js
function interpolate_default(a2, b3) {
var c3;
return (typeof b3 === "number" ? number_default : b3 instanceof color ? rgb_default2 : (c3 = color(b3)) ? (b3 = c3, rgb_default2) : string_default)(a2, b3);
}
var init_interpolate = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js"() {
"use strict";
init_src7();
init_src8();
__name(interpolate_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js
function attrRemove2(name) {
return function() {
this.removeAttribute(name);
};
}
function attrRemoveNS2(fullname) {
return function() {
this.removeAttributeNS(fullname.space, fullname.local);
};
}
function attrConstant2(name, interpolate, value1) {
var string00, string1 = value1 + "", interpolate0;
return function() {
var string0 = this.getAttribute(name);
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
};
}
function attrConstantNS2(fullname, interpolate, value1) {
var string00, string1 = value1 + "", interpolate0;
return function() {
var string0 = this.getAttributeNS(fullname.space, fullname.local);
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
};
}
function attrFunction2(name, interpolate, value2) {
var string00, string10, interpolate0;
return function() {
var string0, value1 = value2(this), string1;
if (value1 == null) return void this.removeAttribute(name);
string0 = this.getAttribute(name);
string1 = value1 + "";
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
};
}
function attrFunctionNS2(fullname, interpolate, value2) {
var string00, string10, interpolate0;
return function() {
var string0, value1 = value2(this), string1;
if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
string0 = this.getAttributeNS(fullname.space, fullname.local);
string1 = value1 + "";
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
};
}
function attr_default2(name, value2) {
var fullname = namespace_default(name), i2 = fullname === "transform" ? interpolateTransformSvg : interpolate_default;
return this.attrTween(name, typeof value2 === "function" ? (fullname.local ? attrFunctionNS2 : attrFunction2)(fullname, i2, tweenValue(this, "attr." + name, value2)) : value2 == null ? (fullname.local ? attrRemoveNS2 : attrRemove2)(fullname) : (fullname.local ? attrConstantNS2 : attrConstant2)(fullname, i2, value2));
}
var init_attr2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js"() {
"use strict";
init_src8();
init_src5();
init_tween();
init_interpolate();
__name(attrRemove2, "attrRemove");
__name(attrRemoveNS2, "attrRemoveNS");
__name(attrConstant2, "attrConstant");
__name(attrConstantNS2, "attrConstantNS");
__name(attrFunction2, "attrFunction");
__name(attrFunctionNS2, "attrFunctionNS");
__name(attr_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js
function attrInterpolate(name, i2) {
return function(t4) {
this.setAttribute(name, i2.call(this, t4));
};
}
function attrInterpolateNS(fullname, i2) {
return function(t4) {
this.setAttributeNS(fullname.space, fullname.local, i2.call(this, t4));
};
}
function attrTweenNS(fullname, value2) {
var t03, i0;
function tween() {
var i2 = value2.apply(this, arguments);
if (i2 !== i0) t03 = (i0 = i2) && attrInterpolateNS(fullname, i2);
return t03;
}
__name(tween, "tween");
tween._value = value2;
return tween;
}
function attrTween(name, value2) {
var t03, i0;
function tween() {
var i2 = value2.apply(this, arguments);
if (i2 !== i0) t03 = (i0 = i2) && attrInterpolate(name, i2);
return t03;
}
__name(tween, "tween");
tween._value = value2;
return tween;
}
function attrTween_default(name, value2) {
var key = "attr." + name;
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
if (value2 == null) return this.tween(key, null);
if (typeof value2 !== "function") throw new Error();
var fullname = namespace_default(name);
return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value2));
}
var init_attrTween = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js"() {
"use strict";
init_src5();
__name(attrInterpolate, "attrInterpolate");
__name(attrInterpolateNS, "attrInterpolateNS");
__name(attrTweenNS, "attrTweenNS");
__name(attrTween, "attrTween");
__name(attrTween_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js
function delayFunction(id30, value2) {
return function() {
init(this, id30).delay = +value2.apply(this, arguments);
};
}
function delayConstant(id30, value2) {
return value2 = +value2, function() {
init(this, id30).delay = value2;
};
}
function delay_default(value2) {
var id30 = this._id;
return arguments.length ? this.each((typeof value2 === "function" ? delayFunction : delayConstant)(id30, value2)) : get2(this.node(), id30).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"() {
"use strict";
init_schedule();
__name(delayFunction, "delayFunction");
__name(delayConstant, "delayConstant");
__name(delay_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js
function durationFunction(id30, value2) {
return function() {
set2(this, id30).duration = +value2.apply(this, arguments);
};
}
function durationConstant(id30, value2) {
return value2 = +value2, function() {
set2(this, id30).duration = value2;
};
}
function duration_default(value2) {
var id30 = this._id;
return arguments.length ? this.each((typeof value2 === "function" ? durationFunction : durationConstant)(id30, value2)) : get2(this.node(), id30).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"() {
"use strict";
init_schedule();
__name(durationFunction, "durationFunction");
__name(durationConstant, "durationConstant");
__name(duration_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js
function easeConstant(id30, value2) {
if (typeof value2 !== "function") throw new Error();
return function() {
set2(this, id30).ease = value2;
};
}
function ease_default(value2) {
var id30 = this._id;
return arguments.length ? this.each(easeConstant(id30, value2)) : get2(this.node(), id30).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"() {
"use strict";
init_schedule();
__name(easeConstant, "easeConstant");
__name(ease_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js
function easeVarying(id30, value2) {
return function() {
var v3 = value2.apply(this, arguments);
if (typeof v3 !== "function") throw new Error();
set2(this, id30).ease = v3;
};
}
function easeVarying_default(value2) {
if (typeof value2 !== "function") throw new Error();
return this.each(easeVarying(this._id, value2));
}
var init_easeVarying = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js"() {
"use strict";
init_schedule();
__name(easeVarying, "easeVarying");
__name(easeVarying_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js
function filter_default2(match2) {
if (typeof match2 !== "function") match2 = matcher_default(match2);
for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], n2 = group2.length, subgroup = subgroups[j3] = [], node2, i2 = 0; i2 < n2; ++i2) {
if ((node2 = group2[i2]) && match2.call(node2, node2.__data__, i2, group2)) {
subgroup.push(node2);
}
}
}
return new Transition(subgroups, this._parents, this._name, this._id);
}
var init_filter2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js"() {
"use strict";
init_src5();
init_transition2();
__name(filter_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js
function merge_default2(transition2) {
if (transition2._id !== this._id) throw new Error();
for (var groups0 = this._groups, groups1 = transition2._groups, m0 = groups0.length, m1 = groups1.length, m3 = Math.min(m0, m1), merges = new Array(m0), j3 = 0; j3 < m3; ++j3) {
for (var group0 = groups0[j3], group1 = groups1[j3], n2 = group0.length, merge5 = merges[j3] = new Array(n2), node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group0[i2] || group1[i2]) {
merge5[i2] = node2;
}
}
}
for (; j3 < m0; ++j3) {
merges[j3] = groups0[j3];
}
return new Transition(merges, this._parents, this._name, this._id);
}
var init_merge3 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js"() {
"use strict";
init_transition2();
__name(merge_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js
function start(name) {
return (name + "").trim().split(/^|\s+/).every(function(t4) {
var i2 = t4.indexOf(".");
if (i2 >= 0) t4 = t4.slice(0, i2);
return !t4 || t4 === "start";
});
}
function onFunction(id30, name, listener) {
var on0, on1, sit = start(name) ? init : set2;
return function() {
var schedule = sit(this, id30), on3 = schedule.on;
if (on3 !== on0) (on1 = (on0 = on3).copy()).on(name, listener);
schedule.on = on1;
};
}
function on_default2(name, listener) {
var id30 = this._id;
return arguments.length < 2 ? get2(this.node(), id30).on.on(name) : this.each(onFunction(id30, 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"() {
"use strict";
init_schedule();
__name(start, "start");
__name(onFunction, "onFunction");
__name(on_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js
function removeFunction(id30) {
return function() {
var parent4 = this.parentNode;
for (var i2 in this.__transition) if (+i2 !== id30) return;
if (parent4) parent4.removeChild(this);
};
}
function remove_default2() {
return this.on("end.remove", removeFunction(this._id));
}
var init_remove2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js"() {
"use strict";
__name(removeFunction, "removeFunction");
__name(remove_default2, "default");
}
});
// ../../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, id30 = this._id;
if (typeof select !== "function") select = selector_default(select);
for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], n2 = group2.length, subgroup = subgroups[j3] = 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, id30, i2, subgroup, get2(node2, id30));
}
}
}
return new Transition(subgroups, this._parents, name, id30);
}
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"() {
"use strict";
init_src5();
init_transition2();
init_schedule();
__name(select_default3, "default");
}
});
// ../../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, id30 = this._id;
if (typeof select !== "function") select = selectorAll_default(select);
for (var groups = this._groups, m3 = groups.length, subgroups = [], parents3 = [], j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], 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, id30), k2 = 0, l4 = children2.length; k2 < l4; ++k2) {
if (child = children2[k2]) {
schedule_default(child, name, id30, k2, children2, inherit2);
}
}
subgroups.push(children2);
parents3.push(node2);
}
}
}
return new Transition(subgroups, parents3, name, id30);
}
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"() {
"use strict";
init_src5();
init_transition2();
init_schedule();
__name(selectAll_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js
function selection_default2() {
return new Selection2(this._groups, this._parents);
}
var Selection2;
var init_selection2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js"() {
"use strict";
init_src5();
Selection2 = selection_default.prototype.constructor;
__name(selection_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js
function styleNull(name, interpolate) {
var string00, string10, interpolate0;
return function() {
var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1);
};
}
function styleRemove2(name) {
return function() {
this.style.removeProperty(name);
};
}
function styleConstant2(name, interpolate, value1) {
var string00, string1 = value1 + "", interpolate0;
return function() {
var string0 = styleValue(this, name);
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
};
}
function styleFunction2(name, interpolate, value2) {
var string00, string10, interpolate0;
return function() {
var string0 = styleValue(this, name), value1 = value2(this), string1 = value1 + "";
if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
};
}
function styleMaybeRemove(id30, name) {
var on0, on1, listener0, key = "style." + name, event3 = "end." + key, remove3;
return function() {
var schedule = set2(this, id30), 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;
};
}
function style_default2(name, value2, priority3) {
var i2 = (name += "") === "transform" ? interpolateTransformCss : interpolate_default;
return value2 == null ? this.styleTween(name, styleNull(name, i2)).on("end.style." + name, styleRemove2(name)) : typeof value2 === "function" ? this.styleTween(name, styleFunction2(name, i2, tweenValue(this, "style." + name, value2))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant2(name, i2, value2), priority3).on("end.style." + name, null);
}
var init_style2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js"() {
"use strict";
init_src8();
init_src5();
init_schedule();
init_tween();
init_interpolate();
__name(styleNull, "styleNull");
__name(styleRemove2, "styleRemove");
__name(styleConstant2, "styleConstant");
__name(styleFunction2, "styleFunction");
__name(styleMaybeRemove, "styleMaybeRemove");
__name(style_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js
function styleInterpolate(name, i2, priority3) {
return function(t4) {
this.style.setProperty(name, i2.call(this, t4), priority3);
};
}
function styleTween(name, value2, priority3) {
var t4, i0;
function tween() {
var i2 = value2.apply(this, arguments);
if (i2 !== i0) t4 = (i0 = i2) && styleInterpolate(name, i2, priority3);
return t4;
}
__name(tween, "tween");
tween._value = value2;
return tween;
}
function styleTween_default(name, value2, priority3) {
var key = "style." + (name += "");
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
if (value2 == null) return this.tween(key, null);
if (typeof value2 !== "function") throw new Error();
return this.tween(key, styleTween(name, value2, priority3 == null ? "" : priority3));
}
var init_styleTween = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js"() {
"use strict";
__name(styleInterpolate, "styleInterpolate");
__name(styleTween, "styleTween");
__name(styleTween_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js
function textConstant2(value2) {
return function() {
this.textContent = value2;
};
}
function textFunction2(value2) {
return function() {
var value1 = value2(this);
this.textContent = value1 == null ? "" : value1;
};
}
function text_default2(value2) {
return this.tween("text", typeof value2 === "function" ? textFunction2(tweenValue(this, "text", value2)) : textConstant2(value2 == null ? "" : value2 + ""));
}
var init_text2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js"() {
"use strict";
init_tween();
__name(textConstant2, "textConstant");
__name(textFunction2, "textFunction");
__name(text_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js
function textInterpolate(i2) {
return function(t4) {
this.textContent = i2.call(this, t4);
};
}
function textTween(value2) {
var t03, i0;
function tween() {
var i2 = value2.apply(this, arguments);
if (i2 !== i0) t03 = (i0 = i2) && textInterpolate(i2);
return t03;
}
__name(tween, "tween");
tween._value = value2;
return tween;
}
function textTween_default(value2) {
var key = "text";
if (arguments.length < 1) return (key = this.tween(key)) && key._value;
if (value2 == null) return this.tween(key, null);
if (typeof value2 !== "function") throw new Error();
return this.tween(key, textTween(value2));
}
var init_textTween = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js"() {
"use strict";
__name(textInterpolate, "textInterpolate");
__name(textTween, "textTween");
__name(textTween_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js
function transition_default() {
var name = this._name, id0 = this._id, id1 = newId();
for (var groups = this._groups, m3 = groups.length, j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group2[i2]) {
var inherit2 = get2(node2, id0);
schedule_default(node2, name, id1, i2, group2, {
time: inherit2.time + inherit2.delay + inherit2.duration,
delay: 0,
duration: inherit2.duration,
ease: inherit2.ease
});
}
}
}
return new Transition(groups, this._parents, name, id1);
}
var init_transition = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js"() {
"use strict";
init_transition2();
init_schedule();
__name(transition_default, "default");
}
});
// ../../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, id30 = that._id, size4 = that.size();
return new Promise(function(resolve2, reject3) {
var cancel = { value: reject3 }, end2 = { value: /* @__PURE__ */ __name(function() {
if (--size4 === 0) resolve2();
}, "value") };
that.each(function() {
var schedule = set2(this, id30), on3 = schedule.on;
if (on3 !== on0) {
on1 = (on0 = on3).copy();
on1._.cancel.push(cancel);
on1._.interrupt.push(cancel);
on1._.end.push(end2);
}
schedule.on = on1;
});
if (size4 === 0) resolve2();
});
}
var init_end = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js"() {
"use strict";
init_schedule();
__name(end_default, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js
function Transition(groups, parents3, name, id30) {
this._groups = groups;
this._parents = parents3;
this._name = name;
this._id = id30;
}
function transition(name) {
return selection_default().transition(name);
}
function newId() {
return ++id;
}
var id, selection_prototype;
var init_transition2 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js"() {
"use strict";
init_src5();
init_attr2();
init_attrTween();
init_delay();
init_duration();
init_ease();
init_easeVarying();
init_filter2();
init_merge3();
init_on2();
init_remove2();
init_select3();
init_selectAll2();
init_selection2();
init_style2();
init_styleTween();
init_text2();
init_textTween();
init_transition();
init_tween();
init_end();
id = 0;
__name(Transition, "Transition");
__name(transition, "transition");
__name(newId, "newId");
selection_prototype = selection_default.prototype;
Transition.prototype = transition.prototype = {
constructor: Transition,
select: select_default3,
selectAll: selectAll_default2,
selectChild: selection_prototype.selectChild,
selectChildren: selection_prototype.selectChildren,
filter: filter_default2,
merge: merge_default2,
selection: selection_default2,
transition: transition_default,
call: selection_prototype.call,
nodes: selection_prototype.nodes,
node: selection_prototype.node,
size: selection_prototype.size,
empty: selection_prototype.empty,
each: selection_prototype.each,
on: on_default2,
attr: attr_default2,
attrTween: attrTween_default,
style: style_default2,
styleTween: styleTween_default,
text: text_default2,
textTween: textTween_default,
remove: remove_default2,
tween: tween_default,
delay: delay_default,
duration: duration_default,
ease: ease_default,
easeVarying: easeVarying_default,
end: end_default,
[Symbol.iterator]: selection_prototype[Symbol.iterator]
};
}
});
// ../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js
function cubicInOut(t4) {
return ((t4 *= 2) <= 1 ? t4 * t4 * t4 : (t4 -= 2) * t4 * t4 + 2) / 2;
}
var init_cubic = __esm({
"../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js"() {
"use strict";
__name(cubicInOut, "cubicInOut");
}
});
// ../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/index.js
var init_src10 = __esm({
"../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/index.js"() {
"use strict";
init_cubic();
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js
function inherit(node2, id30) {
var timing;
while (!(timing = node2.__transition) || !(timing = timing[id30])) {
if (!(node2 = node2.parentNode)) {
throw new Error(`transition ${id30} not found`);
}
}
return timing;
}
function transition_default2(name) {
var id30, timing;
if (name instanceof Transition) {
id30 = name._id, name = name._name;
} else {
id30 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
}
for (var groups = this._groups, m3 = groups.length, j3 = 0; j3 < m3; ++j3) {
for (var group2 = groups[j3], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) {
if (node2 = group2[i2]) {
schedule_default(node2, name, id30, i2, group2, timing || inherit(node2, id30));
}
}
}
return new Transition(groups, this._parents, name, id30);
}
var defaultTiming;
var init_transition3 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js"() {
"use strict";
init_transition2();
init_schedule();
init_src10();
init_src9();
defaultTiming = {
time: null,
// Set on use.
delay: 0,
duration: 250,
ease: cubicInOut
};
__name(inherit, "inherit");
__name(transition_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js
var init_selection3 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js"() {
"use strict";
init_src5();
init_interrupt2();
init_transition3();
selection_default.prototype.interrupt = interrupt_default2;
selection_default.prototype.transition = transition_default2;
}
});
// ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/index.js
var init_src11 = __esm({
"../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/index.js"() {
"use strict";
init_selection3();
}
});
// ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/constant.js
var init_constant3 = __esm({
"../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/constant.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/event.js
var init_event = __esm({
"../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/event.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/noevent.js
var init_noevent = __esm({
"../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/noevent.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/brush.js
function number1(e3) {
return [+e3[0], +e3[1]];
}
function number22(e3) {
return [number1(e3[0]), number1(e3[1])];
}
function type(t4) {
return { type: t4 };
}
var abs, max2, min2, X, Y, XY;
var init_brush = __esm({
"../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/brush.js"() {
"use strict";
init_src11();
init_constant3();
init_event();
init_noevent();
({ abs, max: max2, min: min2 } = Math);
__name(number1, "number1");
__name(number22, "number2");
X = {
name: "x",
handles: ["w", "e"].map(type),
input: /* @__PURE__ */ __name(function(x5, e3) {
return x5 == null ? null : [[+x5[0], e3[0][1]], [+x5[1], e3[1][1]]];
}, "input"),
output: /* @__PURE__ */ __name(function(xy) {
return xy && [xy[0][0], xy[1][0]];
}, "output")
};
Y = {
name: "y",
handles: ["n", "s"].map(type),
input: /* @__PURE__ */ __name(function(y6, e3) {
return y6 == null ? null : [[e3[0][0], +y6[0]], [e3[1][0], +y6[1]]];
}, "input"),
output: /* @__PURE__ */ __name(function(xy) {
return xy && [xy[0][1], xy[1][1]];
}, "output")
};
XY = {
name: "xy",
handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type),
input: /* @__PURE__ */ __name(function(xy) {
return xy == null ? null : number22(xy);
}, "input"),
output: /* @__PURE__ */ __name(function(xy) {
return xy;
}, "output")
};
__name(type, "type");
}
});
// ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/index.js
var init_src12 = __esm({
"../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/index.js"() {
"use strict";
init_brush();
}
});
// ../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.js
function append(strings) {
this._ += strings[0];
for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) {
this._ += arguments[i2] + strings[i2];
}
}
function appendRound(digits) {
let d3 = Math.floor(digits);
if (!(d3 >= 0)) throw new Error(`invalid digits: ${digits}`);
if (d3 > 15) return append;
const k2 = 10 ** d3;
return function(strings) {
this._ += strings[0];
for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) {
this._ += Math.round(arguments[i2] * k2) / k2 + strings[i2];
}
};
}
function path2() {
return new Path();
}
var pi, tau, epsilon2, tauEpsilon, Path;
var init_path = __esm({
"../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.js"() {
"use strict";
pi = Math.PI;
tau = 2 * pi;
epsilon2 = 1e-6;
tauEpsilon = tau - epsilon2;
__name(append, "append");
__name(appendRound, "appendRound");
Path = class {
static {
__name(this, "Path");
}
constructor(digits) {
this._x0 = this._y0 = // start of current subpath
this._x1 = this._y1 = null;
this._ = "";
this._append = digits == null ? append : appendRound(digits);
}
moveTo(x5, y6) {
this._append`M${this._x0 = this._x1 = +x5},${this._y0 = this._y1 = +y6}`;
}
closePath() {
if (this._x1 !== null) {
this._x1 = this._x0, this._y1 = this._y0;
this._append`Z`;
}
}
lineTo(x5, y6) {
this._append`L${this._x1 = +x5},${this._y1 = +y6}`;
}
quadraticCurveTo(x1, y1, x5, y6) {
this._append`Q${+x1},${+y1},${this._x1 = +x5},${this._y1 = +y6}`;
}
bezierCurveTo(x1, y1, x22, y22, x5, y6) {
this._append`C${+x1},${+y1},${+x22},${+y22},${this._x1 = +x5},${this._y1 = +y6}`;
}
arcTo(x1, y1, x22, y22, r2) {
x1 = +x1, y1 = +y1, x22 = +x22, y22 = +y22, r2 = +r2;
if (r2 < 0) throw new Error(`negative radius: ${r2}`);
let x0 = this._x1, y0 = this._y1, x21 = x22 - x1, y21 = y22 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
if (this._x1 === null) {
this._append`M${this._x1 = x1},${this._y1 = y1}`;
} else if (!(l01_2 > epsilon2)) ;
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon2) || !r2) {
this._append`L${this._x1 = x1},${this._y1 = y1}`;
} else {
let x20 = x22 - x0, y20 = y22 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l4 = r2 * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l4 / l01, t21 = l4 / l21;
if (Math.abs(t01 - 1) > epsilon2) {
this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
}
this._append`A${r2},${r2},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
}
}
arc(x5, y6, r2, a0, a1, ccw) {
x5 = +x5, y6 = +y6, r2 = +r2, ccw = !!ccw;
if (r2 < 0) throw new Error(`negative radius: ${r2}`);
let dx = r2 * Math.cos(a0), dy = r2 * Math.sin(a0), x0 = x5 + dx, y0 = y6 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
if (this._x1 === null) {
this._append`M${x0},${y0}`;
} else if (Math.abs(this._x1 - x0) > epsilon2 || Math.abs(this._y1 - y0) > epsilon2) {
this._append`L${x0},${y0}`;
}
if (!r2) return;
if (da < 0) da = da % tau + tau;
if (da > tauEpsilon) {
this._append`A${r2},${r2},0,1,${cw},${x5 - dx},${y6 - dy}A${r2},${r2},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
} else if (da > epsilon2) {
this._append`A${r2},${r2},0,${+(da >= pi)},${cw},${this._x1 = x5 + r2 * Math.cos(a1)},${this._y1 = y6 + r2 * Math.sin(a1)}`;
}
}
rect(x5, y6, w4, h3) {
this._append`M${this._x0 = this._x1 = +x5},${this._y0 = this._y1 = +y6}h${w4 = +w4}v${+h3}h${-w4}Z`;
}
toString() {
return this._;
}
};
__name(path2, "path");
path2.prototype = Path.prototype;
}
});
// ../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/index.js
var init_src13 = __esm({
"../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/index.js"() {
"use strict";
init_path();
}
});
// ../../node_modules/.pnpm/d3-chord@3.0.1/node_modules/d3-chord/src/index.js
var init_src14 = __esm({
"../../node_modules/.pnpm/d3-chord@3.0.1/node_modules/d3-chord/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-contour@4.0.2/node_modules/d3-contour/src/index.js
var init_src15 = __esm({
"../../node_modules/.pnpm/d3-contour@4.0.2/node_modules/d3-contour/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-delaunay@6.0.4/node_modules/d3-delaunay/src/index.js
var init_src16 = __esm({
"../../node_modules/.pnpm/d3-delaunay@6.0.4/node_modules/d3-delaunay/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-dsv@3.0.1/node_modules/d3-dsv/src/index.js
var init_src17 = __esm({
"../../node_modules/.pnpm/d3-dsv@3.0.1/node_modules/d3-dsv/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-fetch@3.0.1/node_modules/d3-fetch/src/index.js
var init_src18 = __esm({
"../../node_modules/.pnpm/d3-fetch@3.0.1/node_modules/d3-fetch/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/index.js
var init_src19 = __esm({
"../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/index.js
var init_src20 = __esm({
"../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatDecimal.js
function formatDecimal_default(x5) {
return Math.abs(x5 = Math.round(x5)) >= 1e21 ? x5.toLocaleString("en").replace(/,/g, "") : x5.toString(10);
}
function formatDecimalParts(x5, p3) {
if ((i2 = (x5 = p3 ? x5.toExponential(p3 - 1) : x5.toExponential()).indexOf("e")) < 0) return null;
var i2, coefficient = x5.slice(0, i2);
return [
coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
+x5.slice(i2 + 1)
];
}
var init_formatDecimal = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatDecimal.js"() {
"use strict";
__name(formatDecimal_default, "default");
__name(formatDecimalParts, "formatDecimalParts");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/exponent.js
function exponent_default(x5) {
return x5 = formatDecimalParts(Math.abs(x5)), x5 ? x5[1] : NaN;
}
var init_exponent = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/exponent.js"() {
"use strict";
init_formatDecimal();
__name(exponent_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatGroup.js
function formatGroup_default(grouping, thousands) {
return function(value2, width3) {
var i2 = value2.length, t4 = [], j3 = 0, g2 = grouping[0], length2 = 0;
while (i2 > 0 && g2 > 0) {
if (length2 + g2 + 1 > width3) g2 = Math.max(1, width3 - length2);
t4.push(value2.substring(i2 -= g2, i2 + g2));
if ((length2 += g2 + 1) > width3) break;
g2 = grouping[j3 = (j3 + 1) % grouping.length];
}
return t4.reverse().join(thousands);
};
}
var init_formatGroup = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatGroup.js"() {
"use strict";
__name(formatGroup_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatNumerals.js
function formatNumerals_default(numerals) {
return function(value2) {
return value2.replace(/[0-9]/g, function(i2) {
return numerals[+i2];
});
};
}
var init_formatNumerals = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatNumerals.js"() {
"use strict";
__name(formatNumerals_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatSpecifier.js
function formatSpecifier(specifier) {
if (!(match2 = re.exec(specifier))) throw new Error("invalid format: " + specifier);
var match2;
return new FormatSpecifier({
fill: match2[1],
align: match2[2],
sign: match2[3],
symbol: match2[4],
zero: match2[5],
width: match2[6],
comma: match2[7],
precision: match2[8] && match2[8].slice(1),
trim: match2[9],
type: match2[10]
});
}
function FormatSpecifier(specifier) {
this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
this.align = specifier.align === void 0 ? ">" : specifier.align + "";
this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
this.zero = !!specifier.zero;
this.width = specifier.width === void 0 ? void 0 : +specifier.width;
this.comma = !!specifier.comma;
this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
this.trim = !!specifier.trim;
this.type = specifier.type === void 0 ? "" : specifier.type + "";
}
var re;
var init_formatSpecifier = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatSpecifier.js"() {
"use strict";
re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
__name(formatSpecifier, "formatSpecifier");
formatSpecifier.prototype = FormatSpecifier.prototype;
__name(FormatSpecifier, "FormatSpecifier");
FormatSpecifier.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;
};
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatTrim.js
function formatTrim_default(s2) {
out: for (var n2 = s2.length, i2 = 1, i0 = -1, i1; i2 < n2; ++i2) {
switch (s2[i2]) {
case ".":
i0 = i1 = i2;
break;
case "0":
if (i0 === 0) i0 = i2;
i1 = i2;
break;
default:
if (!+s2[i2]) break out;
if (i0 > 0) i0 = 0;
break;
}
}
return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
}
var init_formatTrim = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatTrim.js"() {
"use strict";
__name(formatTrim_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatPrefixAuto.js
function formatPrefixAuto_default(x5, p3) {
var d3 = formatDecimalParts(x5, p3);
if (!d3) return x5 + "";
var coefficient = d3[0], exponent = d3[1], i2 = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n2 = coefficient.length;
return i2 === n2 ? coefficient : i2 > n2 ? coefficient + new Array(i2 - n2 + 1).join("0") : i2 > 0 ? coefficient.slice(0, i2) + "." + coefficient.slice(i2) : "0." + new Array(1 - i2).join("0") + formatDecimalParts(x5, Math.max(0, p3 + i2 - 1))[0];
}
var prefixExponent;
var init_formatPrefixAuto = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatPrefixAuto.js"() {
"use strict";
init_formatDecimal();
__name(formatPrefixAuto_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatRounded.js
function formatRounded_default(x5, p3) {
var d3 = formatDecimalParts(x5, p3);
if (!d3) return x5 + "";
var coefficient = d3[0], exponent = d3[1];
return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0");
}
var init_formatRounded = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatRounded.js"() {
"use strict";
init_formatDecimal();
__name(formatRounded_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatTypes.js
var formatTypes_default;
var init_formatTypes = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatTypes.js"() {
"use strict";
init_formatDecimal();
init_formatPrefixAuto();
init_formatRounded();
formatTypes_default = {
"%": /* @__PURE__ */ __name((x5, p3) => (x5 * 100).toFixed(p3), "%"),
"b": /* @__PURE__ */ __name((x5) => Math.round(x5).toString(2), "b"),
"c": /* @__PURE__ */ __name((x5) => x5 + "", "c"),
"d": formatDecimal_default,
"e": /* @__PURE__ */ __name((x5, p3) => x5.toExponential(p3), "e"),
"f": /* @__PURE__ */ __name((x5, p3) => x5.toFixed(p3), "f"),
"g": /* @__PURE__ */ __name((x5, p3) => x5.toPrecision(p3), "g"),
"o": /* @__PURE__ */ __name((x5) => Math.round(x5).toString(8), "o"),
"p": /* @__PURE__ */ __name((x5, p3) => formatRounded_default(x5 * 100, p3), "p"),
"r": formatRounded_default,
"s": formatPrefixAuto_default,
"X": /* @__PURE__ */ __name((x5) => Math.round(x5).toString(16).toUpperCase(), "X"),
"x": /* @__PURE__ */ __name((x5) => Math.round(x5).toString(16), "x")
};
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/identity.js
function identity_default2(x5) {
return x5;
}
var init_identity2 = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/identity.js"() {
"use strict";
__name(identity_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/locale.js
function locale_default(locale3) {
var group2 = locale3.grouping === void 0 || locale3.thousands === void 0 ? identity_default2 : formatGroup_default(map.call(locale3.grouping, Number), locale3.thousands + ""), currencyPrefix = locale3.currency === void 0 ? "" : locale3.currency[0] + "", currencySuffix = locale3.currency === void 0 ? "" : locale3.currency[1] + "", decimal = locale3.decimal === void 0 ? "." : locale3.decimal + "", numerals = locale3.numerals === void 0 ? identity_default2 : formatNumerals_default(map.call(locale3.numerals, String)), percent = locale3.percent === void 0 ? "%" : locale3.percent + "", minus = locale3.minus === void 0 ? "\u2212" : locale3.minus + "", nan = locale3.nan === void 0 ? "NaN" : locale3.nan + "";
function newFormat(specifier) {
specifier = formatSpecifier(specifier);
var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero3 = specifier.zero, width3 = specifier.width, comma = specifier.comma, precision = specifier.precision, trim2 = specifier.trim, type3 = specifier.type;
if (type3 === "n") comma = true, type3 = "g";
else if (!formatTypes_default[type3]) precision === void 0 && (precision = 12), trim2 = true, type3 = "g";
if (zero3 || fill === "0" && align === "=") zero3 = true, fill = "0", align = "=";
var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type3) ? "0" + type3.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type3) ? percent : "";
var formatType = formatTypes_default[type3], maybeSuffix = /[defgprs%]/.test(type3);
precision = precision === void 0 ? 6 : /[gprs]/.test(type3) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
function format3(value2) {
var valuePrefix = prefix, valueSuffix = suffix, i2, n2, c3;
if (type3 === "c") {
valueSuffix = formatType(value2) + valueSuffix;
value2 = "";
} else {
value2 = +value2;
var valueNegative = value2 < 0 || 1 / value2 < 0;
value2 = isNaN(value2) ? nan : formatType(Math.abs(value2), precision);
if (trim2) value2 = formatTrim_default(value2);
if (valueNegative && +value2 === 0 && sign2 !== "+") valueNegative = false;
valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
valueSuffix = (type3 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
if (maybeSuffix) {
i2 = -1, n2 = value2.length;
while (++i2 < n2) {
if (c3 = value2.charCodeAt(i2), 48 > c3 || c3 > 57) {
valueSuffix = (c3 === 46 ? decimal + value2.slice(i2 + 1) : value2.slice(i2)) + valueSuffix;
value2 = value2.slice(0, i2);
break;
}
}
}
}
if (comma && !zero3) value2 = group2(value2, Infinity);
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 + padding2;
break;
case "=":
value2 = valuePrefix + padding2 + value2 + valueSuffix;
break;
case "^":
value2 = padding2.slice(0, length2 = padding2.length >> 1) + valuePrefix + value2 + valueSuffix + padding2.slice(length2);
break;
default:
value2 = padding2 + valuePrefix + value2 + valueSuffix;
break;
}
return numerals(value2);
}
__name(format3, "format");
format3.toString = function() {
return specifier + "";
};
return format3;
}
__name(newFormat, "newFormat");
function formatPrefix2(specifier, value2) {
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 f2(k2 * value3) + prefix;
};
}
__name(formatPrefix2, "formatPrefix");
return {
format: newFormat,
formatPrefix: formatPrefix2
};
}
var map, prefixes;
var init_locale = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/locale.js"() {
"use strict";
init_exponent();
init_formatGroup();
init_formatNumerals();
init_formatSpecifier();
init_formatTrim();
init_formatTypes();
init_formatPrefixAuto();
init_identity2();
map = Array.prototype.map;
prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
__name(locale_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/defaultLocale.js
function defaultLocale(definition) {
locale = locale_default(definition);
format2 = locale.format;
formatPrefix = locale.formatPrefix;
return locale;
}
var locale, format2, formatPrefix;
var init_defaultLocale = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/defaultLocale.js"() {
"use strict";
init_locale();
defaultLocale({
thousands: ",",
grouping: [3],
currency: ["$", ""]
});
__name(defaultLocale, "defaultLocale");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionFixed.js
function precisionFixed_default(step3) {
return Math.max(0, -exponent_default(Math.abs(step3)));
}
var init_precisionFixed = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionFixed.js"() {
"use strict";
init_exponent();
__name(precisionFixed_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionPrefix.js
function precisionPrefix_default(step3, value2) {
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value2) / 3))) * 3 - exponent_default(Math.abs(step3)));
}
var init_precisionPrefix = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionPrefix.js"() {
"use strict";
init_exponent();
__name(precisionPrefix_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionRound.js
function precisionRound_default(step3, max10) {
step3 = Math.abs(step3), max10 = Math.abs(max10) - step3;
return Math.max(0, exponent_default(max10) - exponent_default(step3)) + 1;
}
var init_precisionRound = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionRound.js"() {
"use strict";
init_exponent();
__name(precisionRound_default, "default");
}
});
// ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/index.js
var init_src21 = __esm({
"../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/index.js"() {
"use strict";
init_defaultLocale();
init_formatSpecifier();
init_precisionFixed();
init_precisionPrefix();
init_precisionRound();
}
});
// ../../node_modules/.pnpm/d3-geo@3.1.1/node_modules/d3-geo/src/index.js
var init_src22 = __esm({
"../../node_modules/.pnpm/d3-geo@3.1.1/node_modules/d3-geo/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/count.js
function count(node2) {
var sum2 = 0, children2 = node2.children, i2 = children2 && children2.length;
if (!i2) sum2 = 1;
else while (--i2 >= 0) sum2 += children2[i2].value;
node2.value = sum2;
}
function count_default() {
return this.eachAfter(count);
}
var init_count = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/count.js"() {
"use strict";
__name(count, "count");
__name(count_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/each.js
function each_default2(callback, that) {
let index = -1;
for (const node2 of this) {
callback.call(that, node2, ++index, this);
}
return this;
}
var init_each2 = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/each.js"() {
"use strict";
__name(each_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/eachBefore.js
function eachBefore_default(callback, that) {
var node2 = this, nodes5 = [node2], children2, i2, index = -1;
while (node2 = nodes5.pop()) {
callback.call(that, node2, ++index, this);
if (children2 = node2.children) {
for (i2 = children2.length - 1; i2 >= 0; --i2) {
nodes5.push(children2[i2]);
}
}
}
return this;
}
var init_eachBefore = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/eachBefore.js"() {
"use strict";
__name(eachBefore_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/eachAfter.js
function eachAfter_default(callback, that) {
var node2 = this, nodes5 = [node2], next3 = [], children2, i2, n2, index = -1;
while (node2 = nodes5.pop()) {
next3.push(node2);
if (children2 = node2.children) {
for (i2 = 0, n2 = children2.length; i2 < n2; ++i2) {
nodes5.push(children2[i2]);
}
}
}
while (node2 = next3.pop()) {
callback.call(that, node2, ++index, this);
}
return this;
}
var init_eachAfter = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/eachAfter.js"() {
"use strict";
__name(eachAfter_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/find.js
function find_default(callback, that) {
let index = -1;
for (const node2 of this) {
if (callback.call(that, node2, ++index, this)) {
return node2;
}
}
}
var init_find = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/find.js"() {
"use strict";
__name(find_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/sum.js
function sum_default(value2) {
return this.eachAfter(function(node2) {
var sum2 = +value2(node2.data) || 0, children2 = node2.children, i2 = children2 && children2.length;
while (--i2 >= 0) sum2 += children2[i2].value;
node2.value = sum2;
});
}
var init_sum = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/sum.js"() {
"use strict";
__name(sum_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/sort.js
function sort_default2(compare) {
return this.eachBefore(function(node2) {
if (node2.children) {
node2.children.sort(compare);
}
});
}
var init_sort2 = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/sort.js"() {
"use strict";
__name(sort_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/path.js
function path_default(end2) {
var start3 = this, ancestor = leastCommonAncestor(start3, end2), nodes5 = [start3];
while (start3 !== ancestor) {
start3 = start3.parent;
nodes5.push(start3);
}
var k2 = nodes5.length;
while (end2 !== ancestor) {
nodes5.splice(k2, 0, end2);
end2 = end2.parent;
}
return nodes5;
}
function leastCommonAncestor(a2, b3) {
if (a2 === b3) return a2;
var aNodes = a2.ancestors(), bNodes = b3.ancestors(), c3 = null;
a2 = aNodes.pop();
b3 = bNodes.pop();
while (a2 === b3) {
c3 = a2;
a2 = aNodes.pop();
b3 = bNodes.pop();
}
return c3;
}
var init_path2 = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/path.js"() {
"use strict";
__name(path_default, "default");
__name(leastCommonAncestor, "leastCommonAncestor");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/ancestors.js
function ancestors_default() {
var node2 = this, nodes5 = [node2];
while (node2 = node2.parent) {
nodes5.push(node2);
}
return nodes5;
}
var init_ancestors = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/ancestors.js"() {
"use strict";
__name(ancestors_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/descendants.js
function descendants_default() {
return Array.from(this);
}
var init_descendants = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/descendants.js"() {
"use strict";
__name(descendants_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/leaves.js
function leaves_default() {
var leaves = [];
this.eachBefore(function(node2) {
if (!node2.children) {
leaves.push(node2);
}
});
return leaves;
}
var init_leaves = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/leaves.js"() {
"use strict";
__name(leaves_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/links.js
function links_default() {
var root3 = this, links3 = [];
root3.each(function(node2) {
if (node2 !== root3) {
links3.push({ source: node2.parent, target: node2 });
}
});
return links3;
}
var init_links = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/links.js"() {
"use strict";
__name(links_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/iterator.js
function* iterator_default2() {
var node2 = this, current, next3 = [node2], children2, i2, n2;
do {
current = next3.reverse(), next3 = [];
while (node2 = current.pop()) {
yield node2;
if (children2 = node2.children) {
for (i2 = 0, n2 = children2.length; i2 < n2; ++i2) {
next3.push(children2[i2]);
}
}
}
} while (next3.length);
}
var init_iterator2 = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/iterator.js"() {
"use strict";
__name(iterator_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/index.js
function hierarchy(data5, children2) {
if (data5 instanceof Map) {
data5 = [void 0, data5];
if (children2 === void 0) children2 = mapChildren;
} else if (children2 === void 0) {
children2 = objectChildren;
}
var root3 = new Node(data5), node2, nodes5 = [root3], child, childs, i2, n2;
while (node2 = nodes5.pop()) {
if ((childs = children2(node2.data)) && (n2 = (childs = Array.from(childs)).length)) {
node2.children = childs;
for (i2 = n2 - 1; i2 >= 0; --i2) {
nodes5.push(child = childs[i2] = new Node(childs[i2]));
child.parent = node2;
child.depth = node2.depth + 1;
}
}
}
return root3.eachBefore(computeHeight);
}
function node_copy() {
return hierarchy(this).eachBefore(copyData);
}
function objectChildren(d3) {
return d3.children;
}
function mapChildren(d3) {
return Array.isArray(d3) ? d3[1] : null;
}
function copyData(node2) {
if (node2.data.value !== void 0) node2.value = node2.data.value;
node2.data = node2.data.data;
}
function computeHeight(node2) {
var height2 = 0;
do
node2.height = height2;
while ((node2 = node2.parent) && node2.height < ++height2);
}
function Node(data5) {
this.data = data5;
this.depth = this.height = 0;
this.parent = null;
}
var init_hierarchy = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/hierarchy/index.js"() {
"use strict";
init_count();
init_each2();
init_eachBefore();
init_eachAfter();
init_find();
init_sum();
init_sort2();
init_path2();
init_ancestors();
init_descendants();
init_leaves();
init_links();
init_iterator2();
__name(hierarchy, "hierarchy");
__name(node_copy, "node_copy");
__name(objectChildren, "objectChildren");
__name(mapChildren, "mapChildren");
__name(copyData, "copyData");
__name(computeHeight, "computeHeight");
__name(Node, "Node");
Node.prototype = hierarchy.prototype = {
constructor: Node,
count: count_default,
each: each_default2,
eachAfter: eachAfter_default,
eachBefore: eachBefore_default,
find: find_default,
sum: sum_default,
sort: sort_default2,
path: path_default,
ancestors: ancestors_default,
descendants: descendants_default,
leaves: leaves_default,
links: links_default,
copy: node_copy,
[Symbol.iterator]: iterator_default2
};
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/accessors.js
function required(f2) {
if (typeof f2 !== "function") throw new Error();
return f2;
}
var init_accessors = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/accessors.js"() {
"use strict";
__name(required, "required");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/constant.js
function constantZero() {
return 0;
}
function constant_default4(x5) {
return function() {
return x5;
};
}
var init_constant4 = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/constant.js"() {
"use strict";
__name(constantZero, "constantZero");
__name(constant_default4, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/round.js
function round_default2(node2) {
node2.x0 = Math.round(node2.x0);
node2.y0 = Math.round(node2.y0);
node2.x1 = Math.round(node2.x1);
node2.y1 = Math.round(node2.y1);
}
var init_round2 = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/round.js"() {
"use strict";
__name(round_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/dice.js
function dice_default(parent4, x0, y0, x1, y1) {
var nodes5 = parent4.children, node2, i2 = -1, n2 = nodes5.length, k2 = parent4.value && (x1 - x0) / parent4.value;
while (++i2 < n2) {
node2 = nodes5[i2], node2.y0 = y0, node2.y1 = y1;
node2.x0 = x0, node2.x1 = x0 += node2.value * k2;
}
}
var init_dice = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/dice.js"() {
"use strict";
__name(dice_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/slice.js
function slice_default(parent4, x0, y0, x1, y1) {
var nodes5 = parent4.children, node2, i2 = -1, n2 = nodes5.length, k2 = parent4.value && (y1 - y0) / parent4.value;
while (++i2 < n2) {
node2 = nodes5[i2], node2.x0 = x0, node2.x1 = x1;
node2.y0 = y0, node2.y1 = y0 += node2.value * k2;
}
}
var init_slice = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/slice.js"() {
"use strict";
__name(slice_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/squarify.js
function squarifyRatio(ratio, parent4, x0, y0, x1, y1) {
var rows = [], nodes5 = parent4.children, row, nodeValue, i0 = 0, i1 = 0, n2 = nodes5.length, dx, dy, value2 = parent4.value, sumValue, minValue, maxValue, newRatio, minRatio, alpha, beta;
while (i0 < n2) {
dx = x1 - x0, dy = y1 - y0;
do
sumValue = nodes5[i1++].value;
while (!sumValue && i1 < n2);
minValue = maxValue = sumValue;
alpha = Math.max(dy / dx, dx / dy) / (value2 * ratio);
beta = sumValue * sumValue * alpha;
minRatio = Math.max(maxValue / beta, beta / minValue);
for (; i1 < n2; ++i1) {
sumValue += nodeValue = nodes5[i1].value;
if (nodeValue < minValue) minValue = nodeValue;
if (nodeValue > maxValue) maxValue = nodeValue;
beta = sumValue * sumValue * alpha;
newRatio = Math.max(maxValue / beta, beta / minValue);
if (newRatio > minRatio) {
sumValue -= nodeValue;
break;
}
minRatio = newRatio;
}
rows.push(row = { value: sumValue, dice: dx < dy, children: nodes5.slice(i0, i1) });
if (row.dice) dice_default(row, x0, y0, x1, value2 ? y0 += dy * sumValue / value2 : y1);
else slice_default(row, x0, y0, value2 ? x0 += dx * sumValue / value2 : x1, y1);
value2 -= sumValue, i0 = i1;
}
return rows;
}
var phi, squarify_default;
var init_squarify = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/squarify.js"() {
"use strict";
init_dice();
init_slice();
phi = (1 + Math.sqrt(5)) / 2;
__name(squarifyRatio, "squarifyRatio");
squarify_default = (/* @__PURE__ */ __name((function custom(ratio) {
function squarify(parent4, x0, y0, x1, y1) {
squarifyRatio(ratio, parent4, x0, y0, x1, y1);
}
__name(squarify, "squarify");
squarify.ratio = function(x5) {
return custom((x5 = +x5) > 1 ? x5 : 1);
};
return squarify;
}), "custom"))(phi);
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/index.js
function treemap_default() {
var tile = squarify_default, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
function treemap2(root3) {
root3.x0 = root3.y0 = 0;
root3.x1 = dx;
root3.y1 = dy;
root3.eachBefore(positionNode3);
paddingStack = [0];
if (round) root3.eachBefore(round_default2);
return root3;
}
__name(treemap2, "treemap");
function positionNode3(node2) {
var p3 = paddingStack[node2.depth], x0 = node2.x0 + p3, y0 = node2.y0 + p3, x1 = node2.x1 - p3, y1 = node2.y1 - p3;
if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
node2.x0 = x0;
node2.y0 = y0;
node2.x1 = x1;
node2.y1 = y1;
if (node2.children) {
p3 = paddingStack[node2.depth + 1] = paddingInner(node2) / 2;
x0 += paddingLeft(node2) - p3;
y0 += paddingTop(node2) - p3;
x1 -= paddingRight(node2) - p3;
y1 -= paddingBottom(node2) - p3;
if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
tile(node2, x0, y0, x1, y1);
}
}
__name(positionNode3, "positionNode");
treemap2.round = function(x5) {
return arguments.length ? (round = !!x5, treemap2) : round;
};
treemap2.size = function(x5) {
return arguments.length ? (dx = +x5[0], dy = +x5[1], treemap2) : [dx, dy];
};
treemap2.tile = function(x5) {
return arguments.length ? (tile = required(x5), treemap2) : tile;
};
treemap2.padding = function(x5) {
return arguments.length ? treemap2.paddingInner(x5).paddingOuter(x5) : treemap2.paddingInner();
};
treemap2.paddingInner = function(x5) {
return arguments.length ? (paddingInner = typeof x5 === "function" ? x5 : constant_default4(+x5), treemap2) : paddingInner;
};
treemap2.paddingOuter = function(x5) {
return arguments.length ? treemap2.paddingTop(x5).paddingRight(x5).paddingBottom(x5).paddingLeft(x5) : treemap2.paddingTop();
};
treemap2.paddingTop = function(x5) {
return arguments.length ? (paddingTop = typeof x5 === "function" ? x5 : constant_default4(+x5), treemap2) : paddingTop;
};
treemap2.paddingRight = function(x5) {
return arguments.length ? (paddingRight = typeof x5 === "function" ? x5 : constant_default4(+x5), treemap2) : paddingRight;
};
treemap2.paddingBottom = function(x5) {
return arguments.length ? (paddingBottom = typeof x5 === "function" ? x5 : constant_default4(+x5), treemap2) : paddingBottom;
};
treemap2.paddingLeft = function(x5) {
return arguments.length ? (paddingLeft = typeof x5 === "function" ? x5 : constant_default4(+x5), treemap2) : paddingLeft;
};
return treemap2;
}
var init_treemap = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/treemap/index.js"() {
"use strict";
init_round2();
init_squarify();
init_accessors();
init_constant4();
__name(treemap_default, "default");
}
});
// ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/index.js
var init_src23 = __esm({
"../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/index.js"() {
"use strict";
init_hierarchy();
init_treemap();
}
});
// ../../node_modules/.pnpm/d3-polygon@3.0.1/node_modules/d3-polygon/src/index.js
var init_src24 = __esm({
"../../node_modules/.pnpm/d3-polygon@3.0.1/node_modules/d3-polygon/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-random@3.0.1/node_modules/d3-random/src/index.js
var init_src25 = __esm({
"../../node_modules/.pnpm/d3-random@3.0.1/node_modules/d3-random/src/index.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/init.js
function initRange(domain, range3) {
switch (arguments.length) {
case 0:
break;
case 1:
this.range(domain);
break;
default:
this.range(range3).domain(domain);
break;
}
return this;
}
var init_init = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/init.js"() {
"use strict";
__name(initRange, "initRange");
}
});
// ../../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 scale2(d3) {
let i2 = index.get(d3);
if (i2 === void 0) {
if (unknown !== implicit) return unknown;
index.set(d3, i2 = domain.push(d3) - 1);
}
return range3[i2 % range3.length];
}
__name(scale2, "scale");
scale2.domain = function(_3) {
if (!arguments.length) return domain.slice();
domain = [], index = new InternMap();
for (const value2 of _3) {
if (index.has(value2)) continue;
index.set(value2, domain.push(value2) - 1);
}
return scale2;
};
scale2.range = function(_3) {
return arguments.length ? (range3 = Array.from(_3), scale2) : range3.slice();
};
scale2.unknown = function(_3) {
return arguments.length ? (unknown = _3, scale2) : unknown;
};
scale2.copy = function() {
return ordinal(domain, range3).unknown(unknown);
};
initRange.apply(scale2, arguments);
return scale2;
}
var implicit;
var init_ordinal = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js"() {
"use strict";
init_src2();
init_init();
implicit = Symbol("implicit");
__name(ordinal, "ordinal");
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js
function band() {
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);
if (round) step3 = Math.floor(step3);
start3 += (stop5 - start3 - step3 * (n2 - paddingInner)) * align;
bandwidth = step3 * (1 - paddingInner);
if (round) start3 = Math.round(start3), bandwidth = Math.round(bandwidth);
var values2 = range(n2).map(function(i2) {
return start3 + step3 * i2;
});
return ordinalRange(reverse2 ? values2.reverse() : values2);
}
__name(rescale, "rescale");
scale2.domain = function(_3) {
return arguments.length ? (domain(_3), rescale()) : domain();
};
scale2.range = function(_3) {
return arguments.length ? ([r0, r1] = _3, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
};
scale2.rangeRound = function(_3) {
return [r0, r1] = _3, r0 = +r0, r1 = +r1, round = true, rescale();
};
scale2.bandwidth = function() {
return bandwidth;
};
scale2.step = function() {
return step3;
};
scale2.round = function(_3) {
return arguments.length ? (round = !!_3, rescale()) : round;
};
scale2.padding = function(_3) {
return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_3), rescale()) : paddingInner;
};
scale2.paddingInner = function(_3) {
return arguments.length ? (paddingInner = Math.min(1, _3), rescale()) : paddingInner;
};
scale2.paddingOuter = function(_3) {
return arguments.length ? (paddingOuter = +_3, rescale()) : paddingOuter;
};
scale2.align = function(_3) {
return arguments.length ? (align = Math.max(0, Math.min(1, _3)), rescale()) : align;
};
scale2.copy = function() {
return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
};
return initRange.apply(rescale(), arguments);
}
var init_band = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js"() {
"use strict";
init_src2();
init_init();
init_ordinal();
__name(band, "band");
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js
function constants(x5) {
return function() {
return x5;
};
}
var init_constant5 = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js"() {
"use strict";
__name(constants, "constants");
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/number.js
function number3(x5) {
return +x5;
}
var init_number3 = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/number.js"() {
"use strict";
__name(number3, "number");
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/continuous.js
function identity2(x5) {
return x5;
}
function normalize(a2, b3) {
return (b3 -= a2 = +a2) ? function(x5) {
return (x5 - a2) / b3;
} : constants(isNaN(b3) ? NaN : 0.5);
}
function clamper(a2, b3) {
var t4;
if (a2 > b3) t4 = a2, a2 = b3, b3 = t4;
return function(x5) {
return Math.max(a2, Math.min(b3, x5));
};
}
function bimap(domain, range3, interpolate) {
var d0 = domain[0], d1 = domain[1], r0 = range3[0], r1 = range3[1];
if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
return function(x5) {
return r0(d0(x5));
};
}
function polymap(domain, range3, interpolate) {
var j3 = Math.min(domain.length, range3.length) - 1, d3 = new Array(j3), r2 = new Array(j3), i2 = -1;
if (domain[j3] < domain[0]) {
domain = domain.slice().reverse();
range3 = range3.slice().reverse();
}
while (++i2 < j3) {
d3[i2] = normalize(domain[i2], domain[i2 + 1]);
r2[i2] = interpolate(range3[i2], range3[i2 + 1]);
}
return function(x5) {
var i3 = bisect_default(domain, x5, 1, j3) - 1;
return r2[i3](d3[i3](x5));
};
}
function copy(source, target) {
return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
}
function transformer() {
var domain = unit, range3 = unit, interpolate = value_default, transform8, untransform, unknown, clamp = identity2, piecewise, output2, input;
function rescale() {
var n2 = Math.min(domain.length, range3.length);
if (clamp !== identity2) clamp = clamper(domain[0], domain[n2 - 1]);
piecewise = n2 > 2 ? polymap : bimap;
output2 = input = null;
return scale2;
}
__name(rescale, "rescale");
function scale2(x5) {
return x5 == null || isNaN(x5 = +x5) ? unknown : (output2 || (output2 = piecewise(domain.map(transform8), range3, interpolate)))(transform8(clamp(x5)));
}
__name(scale2, "scale");
scale2.invert = function(y6) {
return clamp(untransform((input || (input = piecewise(range3, domain.map(transform8), number_default)))(y6)));
};
scale2.domain = function(_3) {
return arguments.length ? (domain = Array.from(_3, number3), rescale()) : domain.slice();
};
scale2.range = function(_3) {
return arguments.length ? (range3 = Array.from(_3), rescale()) : range3.slice();
};
scale2.rangeRound = function(_3) {
return range3 = Array.from(_3), interpolate = round_default, rescale();
};
scale2.clamp = function(_3) {
return arguments.length ? (clamp = _3 ? true : identity2, rescale()) : clamp !== identity2;
};
scale2.interpolate = function(_3) {
return arguments.length ? (interpolate = _3, rescale()) : interpolate;
};
scale2.unknown = function(_3) {
return arguments.length ? (unknown = _3, scale2) : unknown;
};
return function(t4, u2) {
transform8 = t4, untransform = u2;
return rescale();
};
}
function continuous() {
return transformer()(identity2, identity2);
}
var unit;
var init_continuous = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/continuous.js"() {
"use strict";
init_src2();
init_src8();
init_constant5();
init_number3();
unit = [0, 1];
__name(identity2, "identity");
__name(normalize, "normalize");
__name(clamper, "clamper");
__name(bimap, "bimap");
__name(polymap, "polymap");
__name(copy, "copy");
__name(transformer, "transformer");
__name(continuous, "continuous");
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/tickFormat.js
function tickFormat(start3, stop5, count2, specifier) {
var step3 = tickStep(start3, stop5, count2), precision;
specifier = formatSpecifier(specifier == null ? ",f" : specifier);
switch (specifier.type) {
case "s": {
var value2 = Math.max(Math.abs(start3), Math.abs(stop5));
if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step3, value2))) specifier.precision = precision;
return formatPrefix(specifier, value2);
}
case "":
case "e":
case "g":
case "p":
case "r": {
if (specifier.precision == null && !isNaN(precision = precisionRound_default(step3, Math.max(Math.abs(start3), Math.abs(stop5))))) specifier.precision = precision - (specifier.type === "e");
break;
}
case "f":
case "%": {
if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step3))) specifier.precision = precision - (specifier.type === "%") * 2;
break;
}
}
return format2(specifier);
}
var init_tickFormat = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/tickFormat.js"() {
"use strict";
init_src2();
init_src21();
__name(tickFormat, "tickFormat");
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js
function linearish(scale2) {
var domain = scale2.domain;
scale2.ticks = function(count2) {
var d3 = domain();
return ticks(d3[0], d3[d3.length - 1], count2 == null ? 10 : count2);
};
scale2.tickFormat = function(count2, specifier) {
var d3 = domain();
return tickFormat(d3[0], d3[d3.length - 1], count2 == null ? 10 : count2, specifier);
};
scale2.nice = function(count2) {
if (count2 == null) count2 = 10;
var d3 = domain();
var i0 = 0;
var i1 = d3.length - 1;
var start3 = d3[i0];
var stop5 = d3[i1];
var prestep;
var step3;
var maxIter = 10;
if (stop5 < start3) {
step3 = start3, start3 = stop5, stop5 = step3;
step3 = i0, i0 = i1, i1 = step3;
}
while (maxIter-- > 0) {
step3 = tickIncrement(start3, stop5, count2);
if (step3 === prestep) {
d3[i0] = start3;
d3[i1] = stop5;
return domain(d3);
} else if (step3 > 0) {
start3 = Math.floor(start3 / step3) * step3;
stop5 = Math.ceil(stop5 / step3) * step3;
} else if (step3 < 0) {
start3 = Math.ceil(start3 * step3) / step3;
stop5 = Math.floor(stop5 * step3) / step3;
} else {
break;
}
prestep = step3;
}
return scale2;
};
return scale2;
}
function linear2() {
var scale2 = continuous();
scale2.copy = function() {
return copy(scale2, linear2());
};
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"() {
"use strict";
init_src2();
init_continuous();
init_init();
init_tickFormat();
__name(linearish, "linearish");
__name(linear2, "linear");
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/nice.js
function nice(domain, interval2) {
domain = domain.slice();
var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t4;
if (x1 < x0) {
t4 = i0, i0 = i1, i1 = t4;
t4 = x0, x0 = x1, x1 = t4;
}
domain[i0] = interval2.floor(x0);
domain[i1] = interval2.ceil(x1);
return domain;
}
var init_nice = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/nice.js"() {
"use strict";
__name(nice, "nice");
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/interval.js
function timeInterval(floori, offseti, count2, field) {
function interval2(date2) {
return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
}
__name(interval2, "interval");
interval2.floor = (date2) => {
return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2;
};
interval2.ceil = (date2) => {
return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2;
};
interval2.round = (date2) => {
const d0 = interval2(date2), d1 = interval2.ceil(date2);
return date2 - d0 < d1 - date2 ? d0 : d1;
};
interval2.offset = (date2, step3) => {
return offseti(date2 = /* @__PURE__ */ new Date(+date2), step3 == null ? 1 : Math.floor(step3)), date2;
};
interval2.range = (start3, stop5, step3) => {
const range3 = [];
start3 = interval2.ceil(start3);
step3 = step3 == null ? 1 : Math.floor(step3);
if (!(start3 < stop5) || !(step3 > 0)) return range3;
let previous;
do
range3.push(previous = /* @__PURE__ */ new Date(+start3)), offseti(start3, step3), floori(start3);
while (previous < start3 && start3 < stop5);
return range3;
};
interval2.filter = (test) => {
return timeInterval((date2) => {
if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1);
}, (date2, step3) => {
if (date2 >= date2) {
if (step3 < 0) while (++step3 <= 0) {
while (offseti(date2, -1), !test(date2)) {
}
}
else while (--step3 >= 0) {
while (offseti(date2, 1), !test(date2)) {
}
}
}
});
};
if (count2) {
interval2.count = (start3, end2) => {
t02.setTime(+start3), t12.setTime(+end2);
floori(t02), floori(t12);
return Math.floor(count2(t02, t12));
};
interval2.every = (step3) => {
step3 = Math.floor(step3);
return !isFinite(step3) || !(step3 > 0) ? null : !(step3 > 1) ? interval2 : interval2.filter(field ? (d3) => field(d3) % step3 === 0 : (d3) => interval2.count(0, d3) % step3 === 0);
};
}
return interval2;
}
var t02, t12;
var init_interval = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/interval.js"() {
"use strict";
t02 = /* @__PURE__ */ new Date();
t12 = /* @__PURE__ */ new Date();
__name(timeInterval, "timeInterval");
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/millisecond.js
var millisecond, milliseconds;
var init_millisecond = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/millisecond.js"() {
"use strict";
init_interval();
millisecond = timeInterval(() => {
}, (date2, step3) => {
date2.setTime(+date2 + step3);
}, (start3, end2) => {
return end2 - start3;
});
millisecond.every = (k2) => {
k2 = Math.floor(k2);
if (!isFinite(k2) || !(k2 > 0)) return null;
if (!(k2 > 1)) return millisecond;
return timeInterval((date2) => {
date2.setTime(Math.floor(date2 / k2) * k2);
}, (date2, step3) => {
date2.setTime(+date2 + step3 * k2);
}, (start3, end2) => {
return (end2 - start3) / k2;
});
};
milliseconds = millisecond.range;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/duration.js
var durationSecond, durationMinute, durationHour, durationDay, durationWeek, durationMonth, durationYear;
var init_duration2 = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/duration.js"() {
"use strict";
durationSecond = 1e3;
durationMinute = durationSecond * 60;
durationHour = durationMinute * 60;
durationDay = durationHour * 24;
durationWeek = durationDay * 7;
durationMonth = durationDay * 30;
durationYear = durationDay * 365;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/second.js
var second, seconds;
var init_second = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/second.js"() {
"use strict";
init_interval();
init_duration2();
second = timeInterval((date2) => {
date2.setTime(date2 - date2.getMilliseconds());
}, (date2, step3) => {
date2.setTime(+date2 + step3 * durationSecond);
}, (start3, end2) => {
return (end2 - start3) / durationSecond;
}, (date2) => {
return date2.getUTCSeconds();
});
seconds = second.range;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/minute.js
var timeMinute, timeMinutes, utcMinute, utcMinutes;
var init_minute = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/minute.js"() {
"use strict";
init_interval();
init_duration2();
timeMinute = timeInterval((date2) => {
date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond);
}, (date2, step3) => {
date2.setTime(+date2 + step3 * durationMinute);
}, (start3, end2) => {
return (end2 - start3) / durationMinute;
}, (date2) => {
return date2.getMinutes();
});
timeMinutes = timeMinute.range;
utcMinute = timeInterval((date2) => {
date2.setUTCSeconds(0, 0);
}, (date2, step3) => {
date2.setTime(+date2 + step3 * durationMinute);
}, (start3, end2) => {
return (end2 - start3) / durationMinute;
}, (date2) => {
return date2.getUTCMinutes();
});
utcMinutes = utcMinute.range;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/hour.js
var timeHour, timeHours, utcHour, utcHours;
var init_hour = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/hour.js"() {
"use strict";
init_interval();
init_duration2();
timeHour = timeInterval((date2) => {
date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute);
}, (date2, step3) => {
date2.setTime(+date2 + step3 * durationHour);
}, (start3, end2) => {
return (end2 - start3) / durationHour;
}, (date2) => {
return date2.getHours();
});
timeHours = timeHour.range;
utcHour = timeInterval((date2) => {
date2.setUTCMinutes(0, 0, 0);
}, (date2, step3) => {
date2.setTime(+date2 + step3 * durationHour);
}, (start3, end2) => {
return (end2 - start3) / durationHour;
}, (date2) => {
return date2.getUTCHours();
});
utcHours = utcHour.range;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/day.js
var timeDay, timeDays, utcDay, utcDays, unixDay, unixDays;
var init_day = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/day.js"() {
"use strict";
init_interval();
init_duration2();
timeDay = timeInterval(
(date2) => date2.setHours(0, 0, 0, 0),
(date2, step3) => date2.setDate(date2.getDate() + step3),
(start3, end2) => (end2 - start3 - (end2.getTimezoneOffset() - start3.getTimezoneOffset()) * durationMinute) / durationDay,
(date2) => date2.getDate() - 1
);
timeDays = timeDay.range;
utcDay = timeInterval((date2) => {
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setUTCDate(date2.getUTCDate() + step3);
}, (start3, end2) => {
return (end2 - start3) / durationDay;
}, (date2) => {
return date2.getUTCDate() - 1;
});
utcDays = utcDay.range;
unixDay = timeInterval((date2) => {
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setUTCDate(date2.getUTCDate() + step3);
}, (start3, end2) => {
return (end2 - start3) / durationDay;
}, (date2) => {
return Math.floor(date2 / durationDay);
});
unixDays = unixDay.range;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/week.js
function timeWeekday(i2) {
return timeInterval((date2) => {
date2.setDate(date2.getDate() - (date2.getDay() + 7 - i2) % 7);
date2.setHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setDate(date2.getDate() + step3 * 7);
}, (start3, end2) => {
return (end2 - start3 - (end2.getTimezoneOffset() - start3.getTimezoneOffset()) * durationMinute) / durationWeek;
});
}
function utcWeekday(i2) {
return timeInterval((date2) => {
date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i2) % 7);
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setUTCDate(date2.getUTCDate() + step3 * 7);
}, (start3, end2) => {
return (end2 - start3) / durationWeek;
});
}
var timeSunday, timeMonday, timeTuesday, timeWednesday, timeThursday, timeFriday, timeSaturday, timeSundays, timeMondays, timeTuesdays, timeWednesdays, timeThursdays, timeFridays, timeSaturdays, utcSunday, utcMonday, utcTuesday, utcWednesday, utcThursday, utcFriday, utcSaturday, utcSundays, utcMondays, utcTuesdays, utcWednesdays, utcThursdays, utcFridays, utcSaturdays;
var init_week = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/week.js"() {
"use strict";
init_interval();
init_duration2();
__name(timeWeekday, "timeWeekday");
timeSunday = timeWeekday(0);
timeMonday = timeWeekday(1);
timeTuesday = timeWeekday(2);
timeWednesday = timeWeekday(3);
timeThursday = timeWeekday(4);
timeFriday = timeWeekday(5);
timeSaturday = timeWeekday(6);
timeSundays = timeSunday.range;
timeMondays = timeMonday.range;
timeTuesdays = timeTuesday.range;
timeWednesdays = timeWednesday.range;
timeThursdays = timeThursday.range;
timeFridays = timeFriday.range;
timeSaturdays = timeSaturday.range;
__name(utcWeekday, "utcWeekday");
utcSunday = utcWeekday(0);
utcMonday = utcWeekday(1);
utcTuesday = utcWeekday(2);
utcWednesday = utcWeekday(3);
utcThursday = utcWeekday(4);
utcFriday = utcWeekday(5);
utcSaturday = utcWeekday(6);
utcSundays = utcSunday.range;
utcMondays = utcMonday.range;
utcTuesdays = utcTuesday.range;
utcWednesdays = utcWednesday.range;
utcThursdays = utcThursday.range;
utcFridays = utcFriday.range;
utcSaturdays = utcSaturday.range;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/month.js
var timeMonth, timeMonths, utcMonth, utcMonths;
var init_month = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/month.js"() {
"use strict";
init_interval();
timeMonth = timeInterval((date2) => {
date2.setDate(1);
date2.setHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setMonth(date2.getMonth() + step3);
}, (start3, end2) => {
return end2.getMonth() - start3.getMonth() + (end2.getFullYear() - start3.getFullYear()) * 12;
}, (date2) => {
return date2.getMonth();
});
timeMonths = timeMonth.range;
utcMonth = timeInterval((date2) => {
date2.setUTCDate(1);
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setUTCMonth(date2.getUTCMonth() + step3);
}, (start3, end2) => {
return end2.getUTCMonth() - start3.getUTCMonth() + (end2.getUTCFullYear() - start3.getUTCFullYear()) * 12;
}, (date2) => {
return date2.getUTCMonth();
});
utcMonths = utcMonth.range;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/year.js
var timeYear, timeYears, utcYear, utcYears;
var init_year = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/year.js"() {
"use strict";
init_interval();
timeYear = timeInterval((date2) => {
date2.setMonth(0, 1);
date2.setHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setFullYear(date2.getFullYear() + step3);
}, (start3, end2) => {
return end2.getFullYear() - start3.getFullYear();
}, (date2) => {
return date2.getFullYear();
});
timeYear.every = (k2) => {
return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2);
date2.setMonth(0, 1);
date2.setHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setFullYear(date2.getFullYear() + step3 * k2);
});
};
timeYears = timeYear.range;
utcYear = timeInterval((date2) => {
date2.setUTCMonth(0, 1);
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setUTCFullYear(date2.getUTCFullYear() + step3);
}, (start3, end2) => {
return end2.getUTCFullYear() - start3.getUTCFullYear();
}, (date2) => {
return date2.getUTCFullYear();
});
utcYear.every = (k2) => {
return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2);
date2.setUTCMonth(0, 1);
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step3) => {
date2.setUTCFullYear(date2.getUTCFullYear() + step3 * k2);
});
};
utcYears = utcYear.range;
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/ticks.js
function ticker(year, month, week, day, hour, minute) {
const tickIntervals = [
[second, 1, durationSecond],
[second, 5, 5 * durationSecond],
[second, 15, 15 * durationSecond],
[second, 30, 30 * durationSecond],
[minute, 1, durationMinute],
[minute, 5, 5 * durationMinute],
[minute, 15, 15 * durationMinute],
[minute, 30, 30 * durationMinute],
[hour, 1, durationHour],
[hour, 3, 3 * durationHour],
[hour, 6, 6 * durationHour],
[hour, 12, 12 * durationHour],
[day, 1, durationDay],
[day, 2, 2 * durationDay],
[week, 1, durationWeek],
[month, 1, durationMonth],
[month, 3, 3 * durationMonth],
[year, 1, durationYear]
];
function ticks2(start3, stop5, count2) {
const reverse2 = stop5 < start3;
if (reverse2) [start3, stop5] = [stop5, start3];
const interval2 = count2 && typeof count2.range === "function" ? count2 : tickInterval2(start3, stop5, count2);
const ticks3 = interval2 ? interval2.range(start3, +stop5 + 1) : [];
return reverse2 ? ticks3.reverse() : ticks3;
}
__name(ticks2, "ticks");
function tickInterval2(start3, stop5, count2) {
const target = Math.abs(stop5 - start3) / count2;
const i2 = bisector(([, , step4]) => step4).right(tickIntervals, target);
if (i2 === tickIntervals.length) return year.every(tickStep(start3 / durationYear, stop5 / durationYear, count2));
if (i2 === 0) return millisecond.every(Math.max(tickStep(start3, stop5, count2), 1));
const [t4, step3] = tickIntervals[target / tickIntervals[i2 - 1][2] < tickIntervals[i2][2] / target ? i2 - 1 : i2];
return t4.every(step3);
}
__name(tickInterval2, "tickInterval");
return [ticks2, tickInterval2];
}
var utcTicks, utcTickInterval, timeTicks, timeTickInterval;
var init_ticks2 = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/ticks.js"() {
"use strict";
init_src2();
init_duration2();
init_millisecond();
init_second();
init_minute();
init_hour();
init_day();
init_week();
init_month();
init_year();
__name(ticker, "ticker");
[utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);
[timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);
}
});
// ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/index.js
var init_src26 = __esm({
"../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/index.js"() {
"use strict";
init_millisecond();
init_second();
init_minute();
init_hour();
init_day();
init_week();
init_month();
init_year();
init_ticks2();
}
});
// ../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/locale.js
function localDate(d3) {
if (0 <= d3.y && d3.y < 100) {
var date2 = new Date(-1, d3.m, d3.d, d3.H, d3.M, d3.S, d3.L);
date2.setFullYear(d3.y);
return date2;
}
return new Date(d3.y, d3.m, d3.d, d3.H, d3.M, d3.S, d3.L);
}
function utcDate(d3) {
if (0 <= d3.y && d3.y < 100) {
var date2 = new Date(Date.UTC(-1, d3.m, d3.d, d3.H, d3.M, d3.S, d3.L));
date2.setUTCFullYear(d3.y);
return date2;
}
return new Date(Date.UTC(d3.y, d3.m, d3.d, d3.H, d3.M, d3.S, d3.L));
}
function newDate(y6, m3, d3) {
return { y: y6, m: m3, d: d3, H: 0, M: 0, S: 0, L: 0 };
}
function formatLocale(locale3) {
var locale_dateTime = locale3.dateTime, locale_date = locale3.date, locale_time = locale3.time, locale_periods = locale3.periods, locale_weekdays = locale3.days, locale_shortWeekdays = locale3.shortDays, locale_months = locale3.months, locale_shortMonths = locale3.shortMonths;
var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths);
var formats = {
"a": formatShortWeekday,
"A": formatWeekday,
"b": formatShortMonth,
"B": formatMonth,
"c": null,
"d": formatDayOfMonth,
"e": formatDayOfMonth,
"f": formatMicroseconds,
"g": formatYearISO,
"G": formatFullYearISO,
"H": formatHour24,
"I": formatHour12,
"j": formatDayOfYear,
"L": formatMilliseconds,
"m": formatMonthNumber,
"M": formatMinutes,
"p": formatPeriod,
"q": formatQuarter,
"Q": formatUnixTimestamp,
"s": formatUnixTimestampSeconds,
"S": formatSeconds,
"u": formatWeekdayNumberMonday,
"U": formatWeekNumberSunday,
"V": formatWeekNumberISO,
"w": formatWeekdayNumberSunday,
"W": formatWeekNumberMonday,
"x": null,
"X": null,
"y": formatYear,
"Y": formatFullYear,
"Z": formatZone,
"%": formatLiteralPercent
};
var utcFormats = {
"a": formatUTCShortWeekday,
"A": formatUTCWeekday,
"b": formatUTCShortMonth,
"B": formatUTCMonth,
"c": null,
"d": formatUTCDayOfMonth,
"e": formatUTCDayOfMonth,
"f": formatUTCMicroseconds,
"g": formatUTCYearISO,
"G": formatUTCFullYearISO,
"H": formatUTCHour24,
"I": formatUTCHour12,
"j": formatUTCDayOfYear,
"L": formatUTCMilliseconds,
"m": formatUTCMonthNumber,
"M": formatUTCMinutes,
"p": formatUTCPeriod,
"q": formatUTCQuarter,
"Q": formatUnixTimestamp,
"s": formatUnixTimestampSeconds,
"S": formatUTCSeconds,
"u": formatUTCWeekdayNumberMonday,
"U": formatUTCWeekNumberSunday,
"V": formatUTCWeekNumberISO,
"w": formatUTCWeekdayNumberSunday,
"W": formatUTCWeekNumberMonday,
"x": null,
"X": null,
"y": formatUTCYear,
"Y": formatUTCFullYear,
"Z": formatUTCZone,
"%": formatLiteralPercent
};
var parses = {
"a": parseShortWeekday,
"A": parseWeekday,
"b": parseShortMonth,
"B": parseMonth,
"c": parseLocaleDateTime,
"d": parseDayOfMonth,
"e": parseDayOfMonth,
"f": parseMicroseconds,
"g": parseYear,
"G": parseFullYear,
"H": parseHour24,
"I": parseHour24,
"j": parseDayOfYear,
"L": parseMilliseconds,
"m": parseMonthNumber,
"M": parseMinutes,
"p": parsePeriod,
"q": parseQuarter,
"Q": parseUnixTimestamp,
"s": parseUnixTimestampSeconds,
"S": parseSeconds,
"u": parseWeekdayNumberMonday,
"U": parseWeekNumberSunday,
"V": parseWeekNumberISO,
"w": parseWeekdayNumberSunday,
"W": parseWeekNumberMonday,
"x": parseLocaleDate,
"X": parseLocaleTime,
"y": parseYear,
"Y": parseFullYear,
"Z": parseZone,
"%": parseLiteralPercent
};
formats.x = newFormat(locale_date, formats);
formats.X = newFormat(locale_time, formats);
formats.c = newFormat(locale_dateTime, formats);
utcFormats.x = newFormat(locale_date, utcFormats);
utcFormats.X = newFormat(locale_time, utcFormats);
utcFormats.c = newFormat(locale_dateTime, utcFormats);
function newFormat(specifier, formats2) {
return function(date2) {
var string3 = [], i2 = -1, j3 = 0, n2 = specifier.length, c3, pad3, format3;
if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2);
while (++i2 < n2) {
if (specifier.charCodeAt(i2) === 37) {
string3.push(specifier.slice(j3, i2));
if ((pad3 = pads[c3 = specifier.charAt(++i2)]) != null) c3 = specifier.charAt(++i2);
else pad3 = c3 === "e" ? " " : "0";
if (format3 = formats2[c3]) c3 = format3(date2, pad3);
string3.push(c3);
j3 = i2 + 1;
}
}
string3.push(specifier.slice(j3, i2));
return string3.join("");
};
}
__name(newFormat, "newFormat");
function newParse(specifier, Z2) {
return function(string3) {
var d3 = newDate(1900, void 0, 1), i2 = parseSpecifier(d3, specifier, string3 += "", 0), week, day;
if (i2 != string3.length) return null;
if ("Q" in d3) return new Date(d3.Q);
if ("s" in d3) return new Date(d3.s * 1e3 + ("L" in d3 ? d3.L : 0));
if (Z2 && !("Z" in d3)) d3.Z = 0;
if ("p" in d3) d3.H = d3.H % 12 + d3.p * 12;
if (d3.m === void 0) d3.m = "q" in d3 ? d3.q : 0;
if ("V" in d3) {
if (d3.V < 1 || d3.V > 53) return null;
if (!("w" in d3)) d3.w = 1;
if ("Z" in d3) {
week = utcDate(newDate(d3.y, 0, 1)), day = week.getUTCDay();
week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
week = utcDay.offset(week, (d3.V - 1) * 7);
d3.y = week.getUTCFullYear();
d3.m = week.getUTCMonth();
d3.d = week.getUTCDate() + (d3.w + 6) % 7;
} else {
week = localDate(newDate(d3.y, 0, 1)), day = week.getDay();
week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
week = timeDay.offset(week, (d3.V - 1) * 7);
d3.y = week.getFullYear();
d3.m = week.getMonth();
d3.d = week.getDate() + (d3.w + 6) % 7;
}
} else if ("W" in d3 || "U" in d3) {
if (!("w" in d3)) d3.w = "u" in d3 ? d3.u % 7 : "W" in d3 ? 1 : 0;
day = "Z" in d3 ? utcDate(newDate(d3.y, 0, 1)).getUTCDay() : localDate(newDate(d3.y, 0, 1)).getDay();
d3.m = 0;
d3.d = "W" in d3 ? (d3.w + 6) % 7 + d3.W * 7 - (day + 5) % 7 : d3.w + d3.U * 7 - (day + 6) % 7;
}
if ("Z" in d3) {
d3.H += d3.Z / 100 | 0;
d3.M += d3.Z % 100;
return utcDate(d3);
}
return localDate(d3);
};
}
__name(newParse, "newParse");
function parseSpecifier(d3, specifier, string3, j3) {
var i2 = 0, n2 = specifier.length, m3 = string3.length, c3, parse7;
while (i2 < n2) {
if (j3 >= m3) return -1;
c3 = specifier.charCodeAt(i2++);
if (c3 === 37) {
c3 = specifier.charAt(i2++);
parse7 = parses[c3 in pads ? specifier.charAt(i2++) : c3];
if (!parse7 || (j3 = parse7(d3, string3, j3)) < 0) return -1;
} else if (c3 != string3.charCodeAt(j3++)) {
return -1;
}
}
return j3;
}
__name(parseSpecifier, "parseSpecifier");
function parsePeriod(d3, string3, i2) {
var n2 = periodRe.exec(string3.slice(i2));
return n2 ? (d3.p = periodLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
__name(parsePeriod, "parsePeriod");
function parseShortWeekday(d3, string3, i2) {
var n2 = shortWeekdayRe.exec(string3.slice(i2));
return n2 ? (d3.w = shortWeekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
__name(parseShortWeekday, "parseShortWeekday");
function parseWeekday(d3, string3, i2) {
var n2 = weekdayRe.exec(string3.slice(i2));
return n2 ? (d3.w = weekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
__name(parseWeekday, "parseWeekday");
function parseShortMonth(d3, string3, i2) {
var n2 = shortMonthRe.exec(string3.slice(i2));
return n2 ? (d3.m = shortMonthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
__name(parseShortMonth, "parseShortMonth");
function parseMonth(d3, string3, i2) {
var n2 = monthRe.exec(string3.slice(i2));
return n2 ? (d3.m = monthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
__name(parseMonth, "parseMonth");
function parseLocaleDateTime(d3, string3, i2) {
return parseSpecifier(d3, locale_dateTime, string3, i2);
}
__name(parseLocaleDateTime, "parseLocaleDateTime");
function parseLocaleDate(d3, string3, i2) {
return parseSpecifier(d3, locale_date, string3, i2);
}
__name(parseLocaleDate, "parseLocaleDate");
function parseLocaleTime(d3, string3, i2) {
return parseSpecifier(d3, locale_time, string3, i2);
}
__name(parseLocaleTime, "parseLocaleTime");
function formatShortWeekday(d3) {
return locale_shortWeekdays[d3.getDay()];
}
__name(formatShortWeekday, "formatShortWeekday");
function formatWeekday(d3) {
return locale_weekdays[d3.getDay()];
}
__name(formatWeekday, "formatWeekday");
function formatShortMonth(d3) {
return locale_shortMonths[d3.getMonth()];
}
__name(formatShortMonth, "formatShortMonth");
function formatMonth(d3) {
return locale_months[d3.getMonth()];
}
__name(formatMonth, "formatMonth");
function formatPeriod(d3) {
return locale_periods[+(d3.getHours() >= 12)];
}
__name(formatPeriod, "formatPeriod");
function formatQuarter(d3) {
return 1 + ~~(d3.getMonth() / 3);
}
__name(formatQuarter, "formatQuarter");
function formatUTCShortWeekday(d3) {
return locale_shortWeekdays[d3.getUTCDay()];
}
__name(formatUTCShortWeekday, "formatUTCShortWeekday");
function formatUTCWeekday(d3) {
return locale_weekdays[d3.getUTCDay()];
}
__name(formatUTCWeekday, "formatUTCWeekday");
function formatUTCShortMonth(d3) {
return locale_shortMonths[d3.getUTCMonth()];
}
__name(formatUTCShortMonth, "formatUTCShortMonth");
function formatUTCMonth(d3) {
return locale_months[d3.getUTCMonth()];
}
__name(formatUTCMonth, "formatUTCMonth");
function formatUTCPeriod(d3) {
return locale_periods[+(d3.getUTCHours() >= 12)];
}
__name(formatUTCPeriod, "formatUTCPeriod");
function formatUTCQuarter(d3) {
return 1 + ~~(d3.getUTCMonth() / 3);
}
__name(formatUTCQuarter, "formatUTCQuarter");
return {
format: /* @__PURE__ */ __name(function(specifier) {
var f2 = newFormat(specifier += "", formats);
f2.toString = function() {
return specifier;
};
return f2;
}, "format"),
parse: /* @__PURE__ */ __name(function(specifier) {
var p3 = newParse(specifier += "", false);
p3.toString = function() {
return specifier;
};
return p3;
}, "parse"),
utcFormat: /* @__PURE__ */ __name(function(specifier) {
var f2 = newFormat(specifier += "", utcFormats);
f2.toString = function() {
return specifier;
};
return f2;
}, "utcFormat"),
utcParse: /* @__PURE__ */ __name(function(specifier) {
var p3 = newParse(specifier += "", true);
p3.toString = function() {
return specifier;
};
return p3;
}, "utcParse")
};
}
function pad2(value2, fill, width3) {
var sign2 = value2 < 0 ? "-" : "", string3 = (sign2 ? -value2 : value2) + "", length2 = string3.length;
return sign2 + (length2 < width3 ? new Array(width3 - length2 + 1).join(fill) + string3 : string3);
}
function requote(s2) {
return s2.replace(requoteRe, "\\$&");
}
function formatRe(names) {
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
}
function formatLookup(names) {
return new Map(names.map((name, i2) => [name.toLowerCase(), i2]));
}
function parseWeekdayNumberSunday(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 1));
return n2 ? (d3.w = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekdayNumberMonday(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 1));
return n2 ? (d3.u = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberSunday(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.U = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberISO(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.V = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberMonday(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.W = +n2[0], i2 + n2[0].length) : -1;
}
function parseFullYear(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 4));
return n2 ? (d3.y = +n2[0], i2 + n2[0].length) : -1;
}
function parseYear(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.y = +n2[0] + (+n2[0] > 68 ? 1900 : 2e3), i2 + n2[0].length) : -1;
}
function parseZone(d3, string3, i2) {
var n2 = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string3.slice(i2, i2 + 6));
return n2 ? (d3.Z = n2[1] ? 0 : -(n2[2] + (n2[3] || "00")), i2 + n2[0].length) : -1;
}
function parseQuarter(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 1));
return n2 ? (d3.q = n2[0] * 3 - 3, i2 + n2[0].length) : -1;
}
function parseMonthNumber(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.m = n2[0] - 1, i2 + n2[0].length) : -1;
}
function parseDayOfMonth(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.d = +n2[0], i2 + n2[0].length) : -1;
}
function parseDayOfYear(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 3));
return n2 ? (d3.m = 0, d3.d = +n2[0], i2 + n2[0].length) : -1;
}
function parseHour24(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.H = +n2[0], i2 + n2[0].length) : -1;
}
function parseMinutes(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.M = +n2[0], i2 + n2[0].length) : -1;
}
function parseSeconds(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 2));
return n2 ? (d3.S = +n2[0], i2 + n2[0].length) : -1;
}
function parseMilliseconds(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 3));
return n2 ? (d3.L = +n2[0], i2 + n2[0].length) : -1;
}
function parseMicroseconds(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2, i2 + 6));
return n2 ? (d3.L = Math.floor(n2[0] / 1e3), i2 + n2[0].length) : -1;
}
function parseLiteralPercent(d3, string3, i2) {
var n2 = percentRe.exec(string3.slice(i2, i2 + 1));
return n2 ? i2 + n2[0].length : -1;
}
function parseUnixTimestamp(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2));
return n2 ? (d3.Q = +n2[0], i2 + n2[0].length) : -1;
}
function parseUnixTimestampSeconds(d3, string3, i2) {
var n2 = numberRe.exec(string3.slice(i2));
return n2 ? (d3.s = +n2[0], i2 + n2[0].length) : -1;
}
function formatDayOfMonth(d3, p3) {
return pad2(d3.getDate(), p3, 2);
}
function formatHour24(d3, p3) {
return pad2(d3.getHours(), p3, 2);
}
function formatHour12(d3, p3) {
return pad2(d3.getHours() % 12 || 12, p3, 2);
}
function formatDayOfYear(d3, p3) {
return pad2(1 + timeDay.count(timeYear(d3), d3), p3, 3);
}
function formatMilliseconds(d3, p3) {
return pad2(d3.getMilliseconds(), p3, 3);
}
function formatMicroseconds(d3, p3) {
return formatMilliseconds(d3, p3) + "000";
}
function formatMonthNumber(d3, p3) {
return pad2(d3.getMonth() + 1, p3, 2);
}
function formatMinutes(d3, p3) {
return pad2(d3.getMinutes(), p3, 2);
}
function formatSeconds(d3, p3) {
return pad2(d3.getSeconds(), p3, 2);
}
function formatWeekdayNumberMonday(d3) {
var day = d3.getDay();
return day === 0 ? 7 : day;
}
function formatWeekNumberSunday(d3, p3) {
return pad2(timeSunday.count(timeYear(d3) - 1, d3), p3, 2);
}
function dISO(d3) {
var day = d3.getDay();
return day >= 4 || day === 0 ? timeThursday(d3) : timeThursday.ceil(d3);
}
function formatWeekNumberISO(d3, p3) {
d3 = dISO(d3);
return pad2(timeThursday.count(timeYear(d3), d3) + (timeYear(d3).getDay() === 4), p3, 2);
}
function formatWeekdayNumberSunday(d3) {
return d3.getDay();
}
function formatWeekNumberMonday(d3, p3) {
return pad2(timeMonday.count(timeYear(d3) - 1, d3), p3, 2);
}
function formatYear(d3, p3) {
return pad2(d3.getFullYear() % 100, p3, 2);
}
function formatYearISO(d3, p3) {
d3 = dISO(d3);
return pad2(d3.getFullYear() % 100, p3, 2);
}
function formatFullYear(d3, p3) {
return pad2(d3.getFullYear() % 1e4, p3, 4);
}
function formatFullYearISO(d3, p3) {
var day = d3.getDay();
d3 = day >= 4 || day === 0 ? timeThursday(d3) : timeThursday.ceil(d3);
return pad2(d3.getFullYear() % 1e4, p3, 4);
}
function formatZone(d3) {
var z3 = d3.getTimezoneOffset();
return (z3 > 0 ? "-" : (z3 *= -1, "+")) + pad2(z3 / 60 | 0, "0", 2) + pad2(z3 % 60, "0", 2);
}
function formatUTCDayOfMonth(d3, p3) {
return pad2(d3.getUTCDate(), p3, 2);
}
function formatUTCHour24(d3, p3) {
return pad2(d3.getUTCHours(), p3, 2);
}
function formatUTCHour12(d3, p3) {
return pad2(d3.getUTCHours() % 12 || 12, p3, 2);
}
function formatUTCDayOfYear(d3, p3) {
return pad2(1 + utcDay.count(utcYear(d3), d3), p3, 3);
}
function formatUTCMilliseconds(d3, p3) {
return pad2(d3.getUTCMilliseconds(), p3, 3);
}
function formatUTCMicroseconds(d3, p3) {
return formatUTCMilliseconds(d3, p3) + "000";
}
function formatUTCMonthNumber(d3, p3) {
return pad2(d3.getUTCMonth() + 1, p3, 2);
}
function formatUTCMinutes(d3, p3) {
return pad2(d3.getUTCMinutes(), p3, 2);
}
function formatUTCSeconds(d3, p3) {
return pad2(d3.getUTCSeconds(), p3, 2);
}
function formatUTCWeekdayNumberMonday(d3) {
var dow = d3.getUTCDay();
return dow === 0 ? 7 : dow;
}
function formatUTCWeekNumberSunday(d3, p3) {
return pad2(utcSunday.count(utcYear(d3) - 1, d3), p3, 2);
}
function UTCdISO(d3) {
var day = d3.getUTCDay();
return day >= 4 || day === 0 ? utcThursday(d3) : utcThursday.ceil(d3);
}
function formatUTCWeekNumberISO(d3, p3) {
d3 = UTCdISO(d3);
return pad2(utcThursday.count(utcYear(d3), d3) + (utcYear(d3).getUTCDay() === 4), p3, 2);
}
function formatUTCWeekdayNumberSunday(d3) {
return d3.getUTCDay();
}
function formatUTCWeekNumberMonday(d3, p3) {
return pad2(utcMonday.count(utcYear(d3) - 1, d3), p3, 2);
}
function formatUTCYear(d3, p3) {
return pad2(d3.getUTCFullYear() % 100, p3, 2);
}
function formatUTCYearISO(d3, p3) {
d3 = UTCdISO(d3);
return pad2(d3.getUTCFullYear() % 100, p3, 2);
}
function formatUTCFullYear(d3, p3) {
return pad2(d3.getUTCFullYear() % 1e4, p3, 4);
}
function formatUTCFullYearISO(d3, p3) {
var day = d3.getUTCDay();
d3 = day >= 4 || day === 0 ? utcThursday(d3) : utcThursday.ceil(d3);
return pad2(d3.getUTCFullYear() % 1e4, p3, 4);
}
function formatUTCZone() {
return "+0000";
}
function formatLiteralPercent() {
return "%";
}
function formatUnixTimestamp(d3) {
return +d3;
}
function formatUnixTimestampSeconds(d3) {
return Math.floor(+d3 / 1e3);
}
var pads, numberRe, percentRe, requoteRe;
var init_locale2 = __esm({
"../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/locale.js"() {
"use strict";
init_src26();
__name(localDate, "localDate");
__name(utcDate, "utcDate");
__name(newDate, "newDate");
__name(formatLocale, "formatLocale");
pads = { "-": "", "_": " ", "0": "0" };
numberRe = /^\s*\d+/;
percentRe = /^%/;
requoteRe = /[\\^$*+?|[\]().{}]/g;
__name(pad2, "pad");
__name(requote, "requote");
__name(formatRe, "formatRe");
__name(formatLookup, "formatLookup");
__name(parseWeekdayNumberSunday, "parseWeekdayNumberSunday");
__name(parseWeekdayNumberMonday, "parseWeekdayNumberMonday");
__name(parseWeekNumberSunday, "parseWeekNumberSunday");
__name(parseWeekNumberISO, "parseWeekNumberISO");
__name(parseWeekNumberMonday, "parseWeekNumberMonday");
__name(parseFullYear, "parseFullYear");
__name(parseYear, "parseYear");
__name(parseZone, "parseZone");
__name(parseQuarter, "parseQuarter");
__name(parseMonthNumber, "parseMonthNumber");
__name(parseDayOfMonth, "parseDayOfMonth");
__name(parseDayOfYear, "parseDayOfYear");
__name(parseHour24, "parseHour24");
__name(parseMinutes, "parseMinutes");
__name(parseSeconds, "parseSeconds");
__name(parseMilliseconds, "parseMilliseconds");
__name(parseMicroseconds, "parseMicroseconds");
__name(parseLiteralPercent, "parseLiteralPercent");
__name(parseUnixTimestamp, "parseUnixTimestamp");
__name(parseUnixTimestampSeconds, "parseUnixTimestampSeconds");
__name(formatDayOfMonth, "formatDayOfMonth");
__name(formatHour24, "formatHour24");
__name(formatHour12, "formatHour12");
__name(formatDayOfYear, "formatDayOfYear");
__name(formatMilliseconds, "formatMilliseconds");
__name(formatMicroseconds, "formatMicroseconds");
__name(formatMonthNumber, "formatMonthNumber");
__name(formatMinutes, "formatMinutes");
__name(formatSeconds, "formatSeconds");
__name(formatWeekdayNumberMonday, "formatWeekdayNumberMonday");
__name(formatWeekNumberSunday, "formatWeekNumberSunday");
__name(dISO, "dISO");
__name(formatWeekNumberISO, "formatWeekNumberISO");
__name(formatWeekdayNumberSunday, "formatWeekdayNumberSunday");
__name(formatWeekNumberMonday, "formatWeekNumberMonday");
__name(formatYear, "formatYear");
__name(formatYearISO, "formatYearISO");
__name(formatFullYear, "formatFullYear");
__name(formatFullYearISO, "formatFullYearISO");
__name(formatZone, "formatZone");
__name(formatUTCDayOfMonth, "formatUTCDayOfMonth");
__name(formatUTCHour24, "formatUTCHour24");
__name(formatUTCHour12, "formatUTCHour12");
__name(formatUTCDayOfYear, "formatUTCDayOfYear");
__name(formatUTCMilliseconds, "formatUTCMilliseconds");
__name(formatUTCMicroseconds, "formatUTCMicroseconds");
__name(formatUTCMonthNumber, "formatUTCMonthNumber");
__name(formatUTCMinutes, "formatUTCMinutes");
__name(formatUTCSeconds, "formatUTCSeconds");
__name(formatUTCWeekdayNumberMonday, "formatUTCWeekdayNumberMonday");
__name(formatUTCWeekNumberSunday, "formatUTCWeekNumberSunday");
__name(UTCdISO, "UTCdISO");
__name(formatUTCWeekNumberISO, "formatUTCWeekNumberISO");
__name(formatUTCWeekdayNumberSunday, "formatUTCWeekdayNumberSunday");
__name(formatUTCWeekNumberMonday, "formatUTCWeekNumberMonday");
__name(formatUTCYear, "formatUTCYear");
__name(formatUTCYearISO, "formatUTCYearISO");
__name(formatUTCFullYear, "formatUTCFullYear");
__name(formatUTCFullYearISO, "formatUTCFullYearISO");
__name(formatUTCZone, "formatUTCZone");
__name(formatLiteralPercent, "formatLiteralPercent");
__name(formatUnixTimestamp, "formatUnixTimestamp");
__name(formatUnixTimestampSeconds, "formatUnixTimestampSeconds");
}
});
// ../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/defaultLocale.js
function defaultLocale2(definition) {
locale2 = formatLocale(definition);
timeFormat = locale2.format;
timeParse = locale2.parse;
utcFormat = locale2.utcFormat;
utcParse = locale2.utcParse;
return locale2;
}
var locale2, timeFormat, timeParse, utcFormat, utcParse;
var init_defaultLocale2 = __esm({
"../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/defaultLocale.js"() {
"use strict";
init_locale2();
defaultLocale2({
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"]
});
__name(defaultLocale2, "defaultLocale");
}
});
// ../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/index.js
var init_src27 = __esm({
"../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/index.js"() {
"use strict";
init_defaultLocale2();
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/time.js
function date(t4) {
return new Date(t4);
}
function number4(t4) {
return t4 instanceof Date ? +t4 : +/* @__PURE__ */ new Date(+t4);
}
function calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format3) {
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");
scale2.invert = function(y6) {
return new Date(invert2(y6));
};
scale2.domain = function(_3) {
return arguments.length ? domain(Array.from(_3, number4)) : domain().map(date);
};
scale2.ticks = function(interval2) {
var d3 = domain();
return ticks2(d3[0], d3[d3.length - 1], interval2 == null ? 10 : interval2);
};
scale2.tickFormat = function(count2, specifier) {
return specifier == null ? tickFormat2 : format3(specifier);
};
scale2.nice = function(interval2) {
var d3 = domain();
if (!interval2 || typeof interval2.range !== "function") interval2 = tickInterval2(d3[0], d3[d3.length - 1], interval2 == null ? 10 : interval2);
return interval2 ? domain(nice(d3, interval2)) : scale2;
};
scale2.copy = function() {
return copy(scale2, calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format3));
};
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);
}
var init_time = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/time.js"() {
"use strict";
init_src26();
init_src27();
init_continuous();
init_init();
init_nice();
__name(date, "date");
__name(number4, "number");
__name(calendar, "calendar");
__name(time, "time");
}
});
// ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/index.js
var init_src28 = __esm({
"../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/index.js"() {
"use strict";
init_band();
init_linear();
init_ordinal();
init_time();
}
});
// ../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/colors.js
function colors_default(specifier) {
var n2 = specifier.length / 6 | 0, colors2 = new Array(n2), i2 = 0;
while (i2 < n2) colors2[i2] = "#" + specifier.slice(i2 * 6, ++i2 * 6);
return colors2;
}
var init_colors = __esm({
"../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/colors.js"() {
"use strict";
__name(colors_default, "default");
}
});
// ../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/categorical/Tableau10.js
var Tableau10_default;
var init_Tableau10 = __esm({
"../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/categorical/Tableau10.js"() {
"use strict";
init_colors();
Tableau10_default = colors_default("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
}
});
// ../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/index.js
var init_src29 = __esm({
"../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/index.js"() {
"use strict";
init_Tableau10();
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.js
function constant_default5(x5) {
return /* @__PURE__ */ __name(function constant3() {
return x5;
}, "constant");
}
var init_constant6 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.js"() {
"use strict";
__name(constant_default5, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/math.js
function acos(x5) {
return x5 > 1 ? 0 : x5 < -1 ? pi2 : Math.acos(x5);
}
function asin(x5) {
return x5 >= 1 ? halfPi : x5 <= -1 ? -halfPi : Math.asin(x5);
}
var abs2, atan2, cos, max3, min3, sin, sqrt, epsilon3, pi2, halfPi, tau2;
var init_math2 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/math.js"() {
"use strict";
abs2 = Math.abs;
atan2 = Math.atan2;
cos = Math.cos;
max3 = Math.max;
min3 = Math.min;
sin = Math.sin;
sqrt = Math.sqrt;
epsilon3 = 1e-12;
pi2 = Math.PI;
halfPi = pi2 / 2;
tau2 = 2 * pi2;
__name(acos, "acos");
__name(asin, "asin");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.js
function withPath(shape) {
let digits = 3;
shape.digits = function(_3) {
if (!arguments.length) return digits;
if (_3 == null) {
digits = null;
} else {
const d3 = Math.floor(_3);
if (!(d3 >= 0)) throw new RangeError(`invalid digits: ${_3}`);
digits = d3;
}
return shape;
};
return () => new Path(digits);
}
var init_path3 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.js"() {
"use strict";
init_src13();
__name(withPath, "withPath");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/arc.js
function arcInnerRadius(d3) {
return d3.innerRadius;
}
function arcOuterRadius(d3) {
return d3.outerRadius;
}
function arcStartAngle(d3) {
return d3.startAngle;
}
function arcEndAngle(d3) {
return d3.endAngle;
}
function arcPadAngle(d3) {
return d3 && d3.padAngle;
}
function intersect(x0, y0, x1, y1, x22, y22, x32, y32) {
var x10 = x1 - x0, y10 = y1 - y0, x322 = x32 - x22, y322 = y32 - y22, t4 = y322 * x10 - x322 * y10;
if (t4 * t4 < epsilon3) return;
t4 = (x322 * (y0 - y22) - y322 * (x0 - x22)) / t4;
return [x0 + t4 * x10, y0 + t4 * y10];
}
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d22 = dx * dx + dy * dy, r2 = r1 - rc, D4 = x11 * y10 - x10 * y11, d3 = (dy < 0 ? -1 : 1) * sqrt(max3(0, r2 * r2 * d22 - D4 * D4)), cx0 = (D4 * dy - dx * d3) / d22, cy0 = (-D4 * dx - dy * d3) / d22, cx1 = (D4 * dy + dx * d3) / d22, cy1 = (-D4 * dx + dy * d3) / d22, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
return {
cx: cx0,
cy: cy0,
x01: -ox,
y01: -oy,
x11: cx0 * (r1 / r2 - 1),
y11: cy0 * (r1 / r2 - 1)
};
}
function arc_default() {
var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default5(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path4 = withPath(arc);
function arc() {
var buffer, r2, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs2(a1 - a0), cw = a1 > a0;
if (!context) context = buffer = path4();
if (r1 < r0) r2 = r1, r1 = r0, r0 = r2;
if (!(r1 > epsilon3)) context.moveTo(0, 0);
else if (da > tau2 - epsilon3) {
context.moveTo(r1 * cos(a0), r1 * sin(a0));
context.arc(0, 0, r1, a0, a1, !cw);
if (r0 > epsilon3) {
context.moveTo(r0 * cos(a1), r0 * sin(a1));
context.arc(0, 0, r0, a1, a0, cw);
}
} else {
var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon3 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min3(abs2(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t03, t13;
if (rp > epsilon3) {
var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
if ((da0 -= p0 * 2) > epsilon3) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
if ((da1 -= p1 * 2) > epsilon3) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
}
var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
if (rc > epsilon3) {
var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
if (da < pi2) {
if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
rc0 = min3(rc, (r0 - lc) / (kc - 1));
rc1 = min3(rc, (r1 - lc) / (kc + 1));
} else {
rc0 = rc1 = 0;
}
}
}
if (!(da1 > epsilon3)) context.moveTo(x01, y01);
else if (rc1 > epsilon3) {
t03 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
t13 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
context.moveTo(t03.cx + t03.x01, t03.cy + t03.y01);
if (rc1 < rc) context.arc(t03.cx, t03.cy, rc1, atan2(t03.y01, t03.x01), atan2(t13.y01, t13.x01), !cw);
else {
context.arc(t03.cx, t03.cy, rc1, atan2(t03.y01, t03.x01), atan2(t03.y11, t03.x11), !cw);
context.arc(0, 0, r1, atan2(t03.cy + t03.y11, t03.cx + t03.x11), atan2(t13.cy + t13.y11, t13.cx + t13.x11), !cw);
context.arc(t13.cx, t13.cy, rc1, atan2(t13.y11, t13.x11), atan2(t13.y01, t13.x01), !cw);
}
} else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
if (!(r0 > epsilon3) || !(da0 > epsilon3)) context.lineTo(x10, y10);
else if (rc0 > epsilon3) {
t03 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
t13 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
context.lineTo(t03.cx + t03.x01, t03.cy + t03.y01);
if (rc0 < rc) context.arc(t03.cx, t03.cy, rc0, atan2(t03.y01, t03.x01), atan2(t13.y01, t13.x01), !cw);
else {
context.arc(t03.cx, t03.cy, rc0, atan2(t03.y01, t03.x01), atan2(t03.y11, t03.x11), !cw);
context.arc(0, 0, r0, atan2(t03.cy + t03.y11, t03.cx + t03.x11), atan2(t13.cy + t13.y11, t13.cx + t13.x11), cw);
context.arc(t13.cx, t13.cy, rc0, atan2(t13.y11, t13.x11), atan2(t13.y01, t13.x01), !cw);
}
} else context.arc(0, 0, r0, a10, a00, cw);
}
context.closePath();
if (buffer) return context = null, buffer + "" || null;
}
__name(arc, "arc");
arc.centroid = function() {
var r2 = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a2 = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi2 / 2;
return [cos(a2) * r2, sin(a2) * r2];
};
arc.innerRadius = function(_3) {
return arguments.length ? (innerRadius = typeof _3 === "function" ? _3 : constant_default5(+_3), arc) : innerRadius;
};
arc.outerRadius = function(_3) {
return arguments.length ? (outerRadius = typeof _3 === "function" ? _3 : constant_default5(+_3), arc) : outerRadius;
};
arc.cornerRadius = function(_3) {
return arguments.length ? (cornerRadius = typeof _3 === "function" ? _3 : constant_default5(+_3), arc) : cornerRadius;
};
arc.padRadius = function(_3) {
return arguments.length ? (padRadius = _3 == null ? null : typeof _3 === "function" ? _3 : constant_default5(+_3), arc) : padRadius;
};
arc.startAngle = function(_3) {
return arguments.length ? (startAngle = typeof _3 === "function" ? _3 : constant_default5(+_3), arc) : startAngle;
};
arc.endAngle = function(_3) {
return arguments.length ? (endAngle = typeof _3 === "function" ? _3 : constant_default5(+_3), arc) : endAngle;
};
arc.padAngle = function(_3) {
return arguments.length ? (padAngle = typeof _3 === "function" ? _3 : constant_default5(+_3), arc) : padAngle;
};
arc.context = function(_3) {
return arguments.length ? (context = _3 == null ? null : _3, arc) : context;
};
return arc;
}
var init_arc = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/arc.js"() {
"use strict";
init_constant6();
init_math2();
init_path3();
__name(arcInnerRadius, "arcInnerRadius");
__name(arcOuterRadius, "arcOuterRadius");
__name(arcStartAngle, "arcStartAngle");
__name(arcEndAngle, "arcEndAngle");
__name(arcPadAngle, "arcPadAngle");
__name(intersect, "intersect");
__name(cornerTangents, "cornerTangents");
__name(arc_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.js
function array_default(x5) {
return typeof x5 === "object" && "length" in x5 ? x5 : Array.from(x5);
}
var slice;
var init_array3 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.js"() {
"use strict";
slice = Array.prototype.slice;
__name(array_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js
function Linear(context) {
this._context = context;
}
function linear_default(context) {
return new Linear(context);
}
var init_linear2 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js"() {
"use strict";
__name(Linear, "Linear");
Linear.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(function() {
this._point = 0;
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x5, y6) : this._context.moveTo(x5, y6);
break;
case 1:
this._point = 2;
// falls through
default:
this._context.lineTo(x5, y6);
break;
}
}, "point")
};
__name(linear_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.js
function x(p3) {
return p3[0];
}
function y(p3) {
return p3[1];
}
var init_point = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.js"() {
"use strict";
__name(x, "x");
__name(y, "y");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js
function line_default(x5, y6) {
var defined = constant_default5(true), context = null, curve = linear_default, output2 = null, path4 = withPath(line2);
x5 = typeof x5 === "function" ? x5 : x5 === void 0 ? x : constant_default5(x5);
y6 = typeof y6 === "function" ? y6 : y6 === void 0 ? y : constant_default5(y6);
function line2(data5) {
var i2, n2 = (data5 = array_default(data5)).length, d3, defined0 = false, buffer;
if (context == null) output2 = curve(buffer = path4());
for (i2 = 0; i2 <= n2; ++i2) {
if (!(i2 < n2 && defined(d3 = data5[i2], i2, data5)) === defined0) {
if (defined0 = !defined0) output2.lineStart();
else output2.lineEnd();
}
if (defined0) output2.point(+x5(d3, i2, data5), +y6(d3, i2, data5));
}
if (buffer) return output2 = null, buffer + "" || null;
}
__name(line2, "line");
line2.x = function(_3) {
return arguments.length ? (x5 = typeof _3 === "function" ? _3 : constant_default5(+_3), line2) : x5;
};
line2.y = function(_3) {
return arguments.length ? (y6 = typeof _3 === "function" ? _3 : constant_default5(+_3), line2) : y6;
};
line2.defined = function(_3) {
return arguments.length ? (defined = typeof _3 === "function" ? _3 : constant_default5(!!_3), line2) : defined;
};
line2.curve = function(_3) {
return arguments.length ? (curve = _3, context != null && (output2 = curve(context)), line2) : curve;
};
line2.context = function(_3) {
return arguments.length ? (_3 == null ? context = output2 = null : output2 = curve(context = _3), line2) : context;
};
return line2;
}
var init_line = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js"() {
"use strict";
init_array3();
init_constant6();
init_linear2();
init_path3();
init_point();
__name(line_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/descending.js
function descending_default(a2, b3) {
return b3 < a2 ? -1 : b3 > a2 ? 1 : b3 >= a2 ? 0 : NaN;
}
var init_descending2 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/descending.js"() {
"use strict";
__name(descending_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/identity.js
function identity_default3(d3) {
return d3;
}
var init_identity3 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/identity.js"() {
"use strict";
__name(identity_default3, "default");
}
});
// ../../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_default5(0), endAngle = constant_default5(tau2), padAngle = constant_default5(0);
function pie2(data5) {
var i2, n2 = (data5 = array_default(data5)).length, j3, 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) {
sum2 += v3;
}
}
if (sortValues != null) index.sort(function(i3, j4) {
return sortValues(arcs[i3], arcs[j4]);
});
else if (sort3 != null) index.sort(function(i3, j4) {
return sort3(data5[i3], data5[j4]);
});
for (i2 = 0, k2 = sum2 ? (da - n2 * pa) / sum2 : 0; i2 < n2; ++i2, a0 = a1) {
j3 = index[i2], v3 = arcs[j3], a1 = a0 + (v3 > 0 ? v3 * k2 : 0) + pa, arcs[j3] = {
data: data5[j3],
index: i2,
value: v3,
startAngle: a0,
endAngle: a1,
padAngle: p3
};
}
return arcs;
}
__name(pie2, "pie");
pie2.value = function(_3) {
return arguments.length ? (value2 = typeof _3 === "function" ? _3 : constant_default5(+_3), pie2) : value2;
};
pie2.sortValues = function(_3) {
return arguments.length ? (sortValues = _3, sort3 = null, pie2) : sortValues;
};
pie2.sort = function(_3) {
return arguments.length ? (sort3 = _3, sortValues = null, pie2) : sort3;
};
pie2.startAngle = function(_3) {
return arguments.length ? (startAngle = typeof _3 === "function" ? _3 : constant_default5(+_3), pie2) : startAngle;
};
pie2.endAngle = function(_3) {
return arguments.length ? (endAngle = typeof _3 === "function" ? _3 : constant_default5(+_3), pie2) : endAngle;
};
pie2.padAngle = function(_3) {
return arguments.length ? (padAngle = typeof _3 === "function" ? _3 : constant_default5(+_3), pie2) : padAngle;
};
return pie2;
}
var init_pie = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/pie.js"() {
"use strict";
init_array3();
init_constant6();
init_descending2();
init_identity3();
init_math2();
__name(pie_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bump.js
function bumpX(context) {
return new Bump(context, true);
}
function bumpY(context) {
return new Bump(context, false);
}
var Bump;
var init_bump = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bump.js"() {
"use strict";
Bump = class {
static {
__name(this, "Bump");
}
constructor(context, x5) {
this._context = context;
this._x = x5;
}
areaStart() {
this._line = 0;
}
areaEnd() {
this._line = NaN;
}
lineStart() {
this._point = 0;
}
lineEnd() {
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
this._line = 1 - this._line;
}
point(x5, y6) {
x5 = +x5, y6 = +y6;
switch (this._point) {
case 0: {
this._point = 1;
if (this._line) this._context.lineTo(x5, y6);
else this._context.moveTo(x5, y6);
break;
}
case 1:
this._point = 2;
// falls through
default: {
if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x5) / 2, this._y0, this._x0, y6, x5, y6);
else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y6) / 2, x5, this._y0, x5, y6);
break;
}
}
this._x0 = x5, this._y0 = y6;
}
};
__name(bumpX, "bumpX");
__name(bumpY, "bumpY");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/noop.js
function noop_default() {
}
var init_noop = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/noop.js"() {
"use strict";
__name(noop_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basis.js
function point2(that, x5, y6) {
that._context.bezierCurveTo(
(2 * that._x0 + that._x1) / 3,
(2 * that._y0 + that._y1) / 3,
(that._x0 + 2 * that._x1) / 3,
(that._y0 + 2 * that._y1) / 3,
(that._x0 + 4 * that._x1 + x5) / 6,
(that._y0 + 4 * that._y1 + y6) / 6
);
}
function Basis(context) {
this._context = context;
}
function basis_default2(context) {
return new Basis(context);
}
var init_basis2 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basis.js"() {
"use strict";
__name(point2, "point");
__name(Basis, "Basis");
Basis.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(function() {
this._x0 = this._x1 = this._y0 = this._y1 = NaN;
this._point = 0;
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
switch (this._point) {
case 3:
point2(this, this._x1, this._y1);
// falls through
case 2:
this._context.lineTo(this._x1, this._y1);
break;
}
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x5, y6) : this._context.moveTo(x5, y6);
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);
// falls through
default:
point2(this, x5, y6);
break;
}
this._x0 = this._x1, this._x1 = x5;
this._y0 = this._y1, this._y1 = y6;
}, "point")
};
__name(basis_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisClosed.js
function BasisClosed(context) {
this._context = context;
}
function basisClosed_default2(context) {
return new BasisClosed(context);
}
var init_basisClosed2 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisClosed.js"() {
"use strict";
init_noop();
init_basis2();
__name(BasisClosed, "BasisClosed");
BasisClosed.prototype = {
areaStart: noop_default,
areaEnd: noop_default,
lineStart: /* @__PURE__ */ __name(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: /* @__PURE__ */ __name(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: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
switch (this._point) {
case 0:
this._point = 1;
this._x2 = x5, this._y2 = y6;
break;
case 1:
this._point = 2;
this._x3 = x5, this._y3 = y6;
break;
case 2:
this._point = 3;
this._x4 = x5, this._y4 = y6;
this._context.moveTo((this._x0 + 4 * this._x1 + x5) / 6, (this._y0 + 4 * this._y1 + y6) / 6);
break;
default:
point2(this, x5, y6);
break;
}
this._x0 = this._x1, this._x1 = x5;
this._y0 = this._y1, this._y1 = y6;
}, "point")
};
__name(basisClosed_default2, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisOpen.js
function BasisOpen(context) {
this._context = context;
}
function basisOpen_default(context) {
return new BasisOpen(context);
}
var init_basisOpen = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisOpen.js"() {
"use strict";
init_basis2();
__name(BasisOpen, "BasisOpen");
BasisOpen.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(function() {
this._x0 = this._x1 = this._y0 = this._y1 = NaN;
this._point = 0;
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
switch (this._point) {
case 0:
this._point = 1;
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
var x0 = (this._x0 + 4 * this._x1 + x5) / 6, y0 = (this._y0 + 4 * this._y1 + y6) / 6;
this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
break;
case 3:
this._point = 4;
// falls through
default:
point2(this, x5, y6);
break;
}
this._x0 = this._x1, this._x1 = x5;
this._y0 = this._y1, this._y1 = y6;
}, "point")
};
__name(basisOpen_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bundle.js
function Bundle(context, beta) {
this._basis = new Basis(context);
this._beta = beta;
}
var bundle_default;
var init_bundle = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bundle.js"() {
"use strict";
init_basis2();
__name(Bundle, "Bundle");
Bundle.prototype = {
lineStart: /* @__PURE__ */ __name(function() {
this._x = [];
this._y = [];
this._basis.lineStart();
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
var x5 = this._x, y6 = this._y, j3 = x5.length - 1;
if (j3 > 0) {
var x0 = x5[0], y0 = y6[0], dx = x5[j3] - x0, dy = y6[j3] - y0, i2 = -1, t4;
while (++i2 <= j3) {
t4 = i2 / j3;
this._basis.point(
this._beta * x5[i2] + (1 - this._beta) * (x0 + t4 * dx),
this._beta * y6[i2] + (1 - this._beta) * (y0 + t4 * dy)
);
}
}
this._x = this._y = null;
this._basis.lineEnd();
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
this._x.push(+x5);
this._y.push(+y6);
}, "point")
};
bundle_default = (/* @__PURE__ */ __name((function custom2(beta) {
function bundle(context) {
return beta === 1 ? new Basis(context) : new Bundle(context, beta);
}
__name(bundle, "bundle");
bundle.beta = function(beta2) {
return custom2(+beta2);
};
return bundle;
}), "custom"))(0.85);
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinal.js
function point3(that, x5, y6) {
that._context.bezierCurveTo(
that._x1 + that._k * (that._x2 - that._x0),
that._y1 + that._k * (that._y2 - that._y0),
that._x2 + that._k * (that._x1 - x5),
that._y2 + that._k * (that._y1 - y6),
that._x2,
that._y2
);
}
function Cardinal(context, tension) {
this._context = context;
this._k = (1 - tension) / 6;
}
var cardinal_default;
var init_cardinal = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinal.js"() {
"use strict";
__name(point3, "point");
__name(Cardinal, "Cardinal");
Cardinal.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(function() {
this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
this._point = 0;
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
switch (this._point) {
case 2:
this._context.lineTo(this._x2, this._y2);
break;
case 3:
point3(this, this._x1, this._y1);
break;
}
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x5, y6) : this._context.moveTo(x5, y6);
break;
case 1:
this._point = 2;
this._x1 = x5, this._y1 = y6;
break;
case 2:
this._point = 3;
// falls through
default:
point3(this, x5, y6);
break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y6;
}, "point")
};
cardinal_default = (/* @__PURE__ */ __name((function custom3(tension) {
function cardinal(context) {
return new Cardinal(context, tension);
}
__name(cardinal, "cardinal");
cardinal.tension = function(tension2) {
return custom3(+tension2);
};
return cardinal;
}), "custom"))(0);
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalClosed.js
function CardinalClosed(context, tension) {
this._context = context;
this._k = (1 - tension) / 6;
}
var cardinalClosed_default;
var init_cardinalClosed = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalClosed.js"() {
"use strict";
init_noop();
init_cardinal();
__name(CardinalClosed, "CardinalClosed");
CardinalClosed.prototype = {
areaStart: noop_default,
areaEnd: noop_default,
lineStart: /* @__PURE__ */ __name(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: /* @__PURE__ */ __name(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: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
switch (this._point) {
case 0:
this._point = 1;
this._x3 = x5, this._y3 = y6;
break;
case 1:
this._point = 2;
this._context.moveTo(this._x4 = x5, this._y4 = y6);
break;
case 2:
this._point = 3;
this._x5 = x5, this._y5 = y6;
break;
default:
point3(this, x5, y6);
break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y6;
}, "point")
};
cardinalClosed_default = (/* @__PURE__ */ __name((function custom4(tension) {
function cardinal(context) {
return new CardinalClosed(context, tension);
}
__name(cardinal, "cardinal");
cardinal.tension = function(tension2) {
return custom4(+tension2);
};
return cardinal;
}), "custom"))(0);
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalOpen.js
function CardinalOpen(context, tension) {
this._context = context;
this._k = (1 - tension) / 6;
}
var cardinalOpen_default;
var init_cardinalOpen = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalOpen.js"() {
"use strict";
init_cardinal();
__name(CardinalOpen, "CardinalOpen");
CardinalOpen.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(function() {
this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
this._point = 0;
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
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;
// falls through
default:
point3(this, x5, y6);
break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y6;
}, "point")
};
cardinalOpen_default = (/* @__PURE__ */ __name((function custom5(tension) {
function cardinal(context) {
return new CardinalOpen(context, tension);
}
__name(cardinal, "cardinal");
cardinal.tension = function(tension2) {
return custom5(+tension2);
};
return cardinal;
}), "custom"))(0);
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRom.js
function point4(that, x5, y6) {
var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2;
if (that._l01_a > epsilon3) {
var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n2 = 3 * that._l01_a * (that._l01_a + that._l12_a);
x1 = (x1 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n2;
y1 = (y1 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n2;
}
if (that._l23_a > epsilon3) {
var b3 = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m3 = 3 * that._l23_a * (that._l23_a + that._l12_a);
x22 = (x22 * b3 + that._x1 * that._l23_2a - x5 * that._l12_2a) / m3;
y22 = (y22 * b3 + that._y1 * that._l23_2a - y6 * that._l12_2a) / m3;
}
that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2);
}
function CatmullRom(context, alpha) {
this._context = context;
this._alpha = alpha;
}
var catmullRom_default;
var init_catmullRom = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRom.js"() {
"use strict";
init_math2();
init_cardinal();
__name(point4, "point");
__name(CatmullRom, "CatmullRom");
CatmullRom.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(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: /* @__PURE__ */ __name(function() {
switch (this._point) {
case 2:
this._context.lineTo(this._x2, this._y2);
break;
case 3:
this.point(this._x2, this._y2);
break;
}
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
if (this._point) {
var x23 = this._x2 - x5, y23 = this._y2 - y6;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x5, y6) : this._context.moveTo(x5, y6);
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
// falls through
default:
point4(this, x5, y6);
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 = x5;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y6;
}, "point")
};
catmullRom_default = (/* @__PURE__ */ __name((function custom6(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
}
__name(catmullRom, "catmullRom");
catmullRom.alpha = function(alpha2) {
return custom6(+alpha2);
};
return catmullRom;
}), "custom"))(0.5);
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomClosed.js
function CatmullRomClosed(context, alpha) {
this._context = context;
this._alpha = alpha;
}
var catmullRomClosed_default;
var init_catmullRomClosed = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomClosed.js"() {
"use strict";
init_cardinalClosed();
init_noop();
init_catmullRom();
__name(CatmullRomClosed, "CatmullRomClosed");
CatmullRomClosed.prototype = {
areaStart: noop_default,
areaEnd: noop_default,
lineStart: /* @__PURE__ */ __name(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: /* @__PURE__ */ __name(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: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
if (this._point) {
var x23 = this._x2 - x5, y23 = this._y2 - y6;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
switch (this._point) {
case 0:
this._point = 1;
this._x3 = x5, this._y3 = y6;
break;
case 1:
this._point = 2;
this._context.moveTo(this._x4 = x5, this._y4 = y6);
break;
case 2:
this._point = 3;
this._x5 = x5, this._y5 = y6;
break;
default:
point4(this, x5, y6);
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 = x5;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y6;
}, "point")
};
catmullRomClosed_default = (/* @__PURE__ */ __name((function custom7(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
}
__name(catmullRom, "catmullRom");
catmullRom.alpha = function(alpha2) {
return custom7(+alpha2);
};
return catmullRom;
}), "custom"))(0.5);
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomOpen.js
function CatmullRomOpen(context, alpha) {
this._context = context;
this._alpha = alpha;
}
var catmullRomOpen_default;
var init_catmullRomOpen = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomOpen.js"() {
"use strict";
init_cardinalOpen();
init_catmullRom();
__name(CatmullRomOpen, "CatmullRomOpen");
CatmullRomOpen.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(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: /* @__PURE__ */ __name(function() {
if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
if (this._point) {
var x23 = this._x2 - x5, y23 = this._y2 - y6;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, 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;
// falls through
default:
point4(this, x5, y6);
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 = x5;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y6;
}, "point")
};
catmullRomOpen_default = (/* @__PURE__ */ __name((function custom8(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
}
__name(catmullRom, "catmullRom");
catmullRom.alpha = function(alpha2) {
return custom8(+alpha2);
};
return catmullRom;
}), "custom"))(0.5);
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linearClosed.js
function LinearClosed(context) {
this._context = context;
}
function linearClosed_default(context) {
return new LinearClosed(context);
}
var init_linearClosed = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linearClosed.js"() {
"use strict";
init_noop();
__name(LinearClosed, "LinearClosed");
LinearClosed.prototype = {
areaStart: noop_default,
areaEnd: noop_default,
lineStart: /* @__PURE__ */ __name(function() {
this._point = 0;
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
if (this._point) this._context.closePath();
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
if (this._point) this._context.lineTo(x5, y6);
else this._point = 1, this._context.moveTo(x5, y6);
}, "point")
};
__name(linearClosed_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/monotone.js
function sign(x5) {
return x5 < 0 ? -1 : 1;
}
function slope3(that, x22, y22) {
var h0 = that._x1 - that._x0, h1 = x22 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y22 - that._y1) / (h1 || h0 < 0 && -0), p3 = (s0 * h1 + s1 * h0) / (h0 + h1);
return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p3)) || 0;
}
function slope2(that, t4) {
var h3 = that._x1 - that._x0;
return h3 ? (3 * (that._y1 - that._y0) / h3 - t4) / 2 : t4;
}
function point5(that, t03, t13) {
var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3;
that._context.bezierCurveTo(x0 + dx, y0 + dx * t03, x1 - dx, y1 - dx * t13, x1, y1);
}
function MonotoneX(context) {
this._context = context;
}
function MonotoneY(context) {
this._context = new ReflectContext(context);
}
function ReflectContext(context) {
this._context = context;
}
function monotoneX(context) {
return new MonotoneX(context);
}
function monotoneY(context) {
return new MonotoneY(context);
}
var init_monotone = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/monotone.js"() {
"use strict";
__name(sign, "sign");
__name(slope3, "slope3");
__name(slope2, "slope2");
__name(point5, "point");
__name(MonotoneX, "MonotoneX");
MonotoneX.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(function() {
this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
this._point = 0;
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
switch (this._point) {
case 2:
this._context.lineTo(this._x1, this._y1);
break;
case 3:
point5(this, this._t0, slope2(this, this._t0));
break;
}
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
var t13 = NaN;
x5 = +x5, y6 = +y6;
if (x5 === this._x1 && y6 === this._y1) return;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x5, y6) : this._context.moveTo(x5, y6);
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
point5(this, slope2(this, t13 = slope3(this, x5, y6)), t13);
break;
default:
point5(this, this._t0, t13 = slope3(this, x5, y6));
break;
}
this._x0 = this._x1, this._x1 = x5;
this._y0 = this._y1, this._y1 = y6;
this._t0 = t13;
}, "point")
};
__name(MonotoneY, "MonotoneY");
(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x5, y6) {
MonotoneX.prototype.point.call(this, y6, x5);
};
__name(ReflectContext, "ReflectContext");
ReflectContext.prototype = {
moveTo: /* @__PURE__ */ __name(function(x5, y6) {
this._context.moveTo(y6, x5);
}, "moveTo"),
closePath: /* @__PURE__ */ __name(function() {
this._context.closePath();
}, "closePath"),
lineTo: /* @__PURE__ */ __name(function(x5, y6) {
this._context.lineTo(y6, x5);
}, "lineTo"),
bezierCurveTo: /* @__PURE__ */ __name(function(x1, y1, x22, y22, x5, y6) {
this._context.bezierCurveTo(y1, x1, y22, x22, y6, x5);
}, "bezierCurveTo")
};
__name(monotoneX, "monotoneX");
__name(monotoneY, "monotoneY");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/natural.js
function Natural(context) {
this._context = context;
}
function controlPoints(x5) {
var i2, n2 = x5.length - 1, m3, a2 = new Array(n2), b3 = new Array(n2), r2 = new Array(n2);
a2[0] = 0, b3[0] = 2, r2[0] = x5[0] + 2 * x5[1];
for (i2 = 1; i2 < n2 - 1; ++i2) a2[i2] = 1, b3[i2] = 4, r2[i2] = 4 * x5[i2] + 2 * x5[i2 + 1];
a2[n2 - 1] = 2, b3[n2 - 1] = 7, r2[n2 - 1] = 8 * x5[n2 - 1] + x5[n2];
for (i2 = 1; i2 < n2; ++i2) m3 = a2[i2] / b3[i2 - 1], b3[i2] -= m3, r2[i2] -= m3 * r2[i2 - 1];
a2[n2 - 1] = r2[n2 - 1] / b3[n2 - 1];
for (i2 = n2 - 2; i2 >= 0; --i2) a2[i2] = (r2[i2] - a2[i2 + 1]) / b3[i2];
b3[n2 - 1] = (x5[n2] + a2[n2 - 1]) / 2;
for (i2 = 0; i2 < n2 - 1; ++i2) b3[i2] = 2 * x5[i2 + 1] - a2[i2 + 1];
return [a2, b3];
}
function natural_default(context) {
return new Natural(context);
}
var init_natural = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/natural.js"() {
"use strict";
__name(Natural, "Natural");
Natural.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(function() {
this._x = [];
this._y = [];
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
var x5 = this._x, y6 = this._y, n2 = x5.length;
if (n2) {
this._line ? this._context.lineTo(x5[0], y6[0]) : this._context.moveTo(x5[0], y6[0]);
if (n2 === 2) {
this._context.lineTo(x5[1], y6[1]);
} else {
var px = controlPoints(x5), py = controlPoints(y6);
for (var i0 = 0, i1 = 1; i1 < n2; ++i0, ++i1) {
this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x5[i1], y6[i1]);
}
}
}
if (this._line || this._line !== 0 && n2 === 1) this._context.closePath();
this._line = 1 - this._line;
this._x = this._y = null;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
this._x.push(+x5);
this._y.push(+y6);
}, "point")
};
__name(controlPoints, "controlPoints");
__name(natural_default, "default");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/step.js
function Step(context, t4) {
this._context = context;
this._t = t4;
}
function step_default(context) {
return new Step(context, 0.5);
}
function stepBefore(context) {
return new Step(context, 0);
}
function stepAfter(context) {
return new Step(context, 1);
}
var init_step = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/step.js"() {
"use strict";
__name(Step, "Step");
Step.prototype = {
areaStart: /* @__PURE__ */ __name(function() {
this._line = 0;
}, "areaStart"),
areaEnd: /* @__PURE__ */ __name(function() {
this._line = NaN;
}, "areaEnd"),
lineStart: /* @__PURE__ */ __name(function() {
this._x = this._y = NaN;
this._point = 0;
}, "lineStart"),
lineEnd: /* @__PURE__ */ __name(function() {
if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
}, "lineEnd"),
point: /* @__PURE__ */ __name(function(x5, y6) {
x5 = +x5, y6 = +y6;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x5, y6) : this._context.moveTo(x5, y6);
break;
case 1:
this._point = 2;
// falls through
default: {
if (this._t <= 0) {
this._context.lineTo(this._x, y6);
this._context.lineTo(x5, y6);
} else {
var x1 = this._x * (1 - this._t) + x5 * this._t;
this._context.lineTo(x1, this._y);
this._context.lineTo(x1, y6);
}
break;
}
}
this._x = x5, this._y = y6;
}, "point")
};
__name(step_default, "default");
__name(stepBefore, "stepBefore");
__name(stepAfter, "stepAfter");
}
});
// ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/index.js
var init_src30 = __esm({
"../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/index.js"() {
"use strict";
init_arc();
init_line();
init_pie();
init_basisClosed2();
init_basisOpen();
init_basis2();
init_bump();
init_bundle();
init_cardinalClosed();
init_cardinalOpen();
init_cardinal();
init_catmullRomClosed();
init_catmullRomOpen();
init_catmullRom();
init_linearClosed();
init_linear2();
init_monotone();
init_natural();
init_step();
}
});
// ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js
var init_constant7 = __esm({
"../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js
var init_event2 = __esm({
"../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js
function Transform(k2, x5, y6) {
this.k = k2;
this.x = x5;
this.y = y6;
}
function transform(node2) {
while (!node2.__zoom) if (!(node2 = node2.parentNode)) return identity3;
return node2.__zoom;
}
var identity3;
var init_transform2 = __esm({
"../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js"() {
"use strict";
__name(Transform, "Transform");
Transform.prototype = {
constructor: Transform,
scale: /* @__PURE__ */ __name(function(k2) {
return k2 === 1 ? this : new Transform(this.k * k2, this.x, this.y);
}, "scale"),
translate: /* @__PURE__ */ __name(function(x5, y6) {
return x5 === 0 & y6 === 0 ? this : new Transform(this.k, this.x + this.k * x5, this.y + this.k * y6);
}, "translate"),
apply: /* @__PURE__ */ __name(function(point8) {
return [point8[0] * this.k + this.x, point8[1] * this.k + this.y];
}, "apply"),
applyX: /* @__PURE__ */ __name(function(x5) {
return x5 * this.k + this.x;
}, "applyX"),
applyY: /* @__PURE__ */ __name(function(y6) {
return y6 * this.k + this.y;
}, "applyY"),
invert: /* @__PURE__ */ __name(function(location) {
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
}, "invert"),
invertX: /* @__PURE__ */ __name(function(x5) {
return (x5 - this.x) / this.k;
}, "invertX"),
invertY: /* @__PURE__ */ __name(function(y6) {
return (y6 - this.y) / this.k;
}, "invertY"),
rescaleX: /* @__PURE__ */ __name(function(x5) {
return x5.copy().domain(x5.range().map(this.invertX, this).map(x5.invert, x5));
}, "rescaleX"),
rescaleY: /* @__PURE__ */ __name(function(y6) {
return y6.copy().domain(y6.range().map(this.invertY, this).map(y6.invert, y6));
}, "rescaleY"),
toString: /* @__PURE__ */ __name(function() {
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
}, "toString")
};
identity3 = new Transform(1, 0, 0);
transform.prototype = Transform.prototype;
__name(transform, "transform");
}
});
// ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js
var init_noevent2 = __esm({
"../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js"() {
"use strict";
}
});
// ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js
var init_zoom = __esm({
"../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js"() {
"use strict";
init_src11();
init_constant7();
init_event2();
init_transform2();
init_noevent2();
}
});
// ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/index.js
var init_src31 = __esm({
"../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/index.js"() {
"use strict";
init_zoom();
init_transform2();
}
});
// ../../node_modules/.pnpm/d3@7.9.0/node_modules/d3/src/index.js
var init_src32 = __esm({
"../../node_modules/.pnpm/d3@7.9.0/node_modules/d3/src/index.js"() {
"use strict";
init_src2();
init_src3();
init_src12();
init_src14();
init_src7();
init_src15();
init_src16();
init_src4();
init_src6();
init_src17();
init_src10();
init_src18();
init_src20();
init_src21();
init_src22();
init_src23();
init_src8();
init_src13();
init_src24();
init_src19();
init_src25();
init_src28();
init_src29();
init_src5();
init_src30();
init_src26();
init_src27();
init_src9();
init_src11();
init_src31();
}
});
// ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/constants.js
var require_constants = __commonJS({
"../../node_modules/.pnpm/@braintree+sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/constants.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.BLANK_URL = exports2.relativeFirstCharacters = exports2.whitespaceEscapeCharsRegex = exports2.urlSchemeRegex = exports2.ctrlCharactersRegex = exports2.htmlCtrlEntityRegex = exports2.htmlEntitiesRegex = exports2.invalidProtocolRegex = void 0;
exports2.invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im;
exports2.htmlEntitiesRegex = /(\w+)(^\w|;)?/g;
exports2.htmlCtrlEntityRegex = /&(newline|tab);/gi;
exports2.ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;
exports2.urlSchemeRegex = /^.+(:|:)/gim;
exports2.whitespaceEscapeCharsRegex = /(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;
exports2.relativeFirstCharacters = [".", "/"];
exports2.BLANK_URL = "about:blank";
}
});
// ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.js
var require_dist = __commonJS({
"../../node_modules/.pnpm/@braintree+sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.sanitizeUrl = void 0;
var constants_1 = require_constants();
function isRelativeUrlWithoutProtocol(url) {
return constants_1.relativeFirstCharacters.indexOf(url[0]) > -1;
}
__name(isRelativeUrlWithoutProtocol, "isRelativeUrlWithoutProtocol");
function decodeHtmlCharacters(str2) {
var removedNullByte = str2.replace(constants_1.ctrlCharactersRegex, "");
return removedNullByte.replace(constants_1.htmlEntitiesRegex, function(match2, dec) {
return String.fromCharCode(dec);
});
}
__name(decodeHtmlCharacters, "decodeHtmlCharacters");
function isValidUrl(url) {
return URL.canParse(url);
}
__name(isValidUrl, "isValidUrl");
function decodeURI(uri) {
try {
return decodeURIComponent(uri);
} catch (e3) {
return uri;
}
}
__name(decodeURI, "decodeURI");
function sanitizeUrl6(url) {
if (!url) {
return constants_1.BLANK_URL;
}
var charsToDecode;
var decodedUrl = decodeURI(url.trim());
do {
decodedUrl = decodeHtmlCharacters(decodedUrl).replace(constants_1.htmlCtrlEntityRegex, "").replace(constants_1.ctrlCharactersRegex, "").replace(constants_1.whitespaceEscapeCharsRegex, "").trim();
decodedUrl = decodeURI(decodedUrl);
charsToDecode = decodedUrl.match(constants_1.ctrlCharactersRegex) || decodedUrl.match(constants_1.htmlEntitiesRegex) || decodedUrl.match(constants_1.htmlCtrlEntityRegex) || decodedUrl.match(constants_1.whitespaceEscapeCharsRegex);
} while (charsToDecode && charsToDecode.length > 0);
var sanitizedUrl = decodedUrl;
if (!sanitizedUrl) {
return constants_1.BLANK_URL;
}
if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
return sanitizedUrl;
}
var trimmedUrl = sanitizedUrl.trimStart();
var urlSchemeParseResults = trimmedUrl.match(constants_1.urlSchemeRegex);
if (!urlSchemeParseResults) {
return sanitizedUrl;
}
var urlScheme = urlSchemeParseResults[0].toLowerCase().trim();
if (constants_1.invalidProtocolRegex.test(urlScheme)) {
return constants_1.BLANK_URL;
}
var backSanitized = trimmedUrl.replace(/\\/g, "/");
if (urlScheme === "mailto:" || urlScheme.includes("://")) {
return backSanitized;
}
if (urlScheme === "http:" || urlScheme === "https:") {
if (!isValidUrl(backSanitized)) {
return constants_1.BLANK_URL;
}
var url_1 = new URL(backSanitized);
url_1.protocol = url_1.protocol.toLowerCase();
url_1.hostname = url_1.hostname.toLowerCase();
return url_1.toString();
}
return backSanitized;
}
__name(sanitizeUrl6, "sanitizeUrl");
exports2.sanitizeUrl = sanitizeUrl6;
}
});
// src/diagrams/common/svgDrawCommon.ts
var import_sanitize_url, drawRect, drawBackgroundRect, drawText, drawImage, drawEmbeddedImage, getNoteRect, getTextObj;
var init_svgDrawCommon = __esm({
"src/diagrams/common/svgDrawCommon.ts"() {
"use strict";
import_sanitize_url = __toESM(require_dist(), 1);
init_common();
drawRect = /* @__PURE__ */ __name((element3, rectData) => {
const rectElement = element3.append("rect");
rectElement.attr("x", rectData.x);
rectElement.attr("y", rectData.y);
rectElement.attr("fill", rectData.fill);
rectElement.attr("stroke", rectData.stroke);
rectElement.attr("width", rectData.width);
rectElement.attr("height", rectData.height);
if (rectData.name) {
rectElement.attr("name", rectData.name);
}
if (rectData.rx) {
rectElement.attr("rx", rectData.rx);
}
if (rectData.ry) {
rectElement.attr("ry", rectData.ry);
}
if (rectData.attrs !== void 0) {
for (const attrKey in rectData.attrs) {
rectElement.attr(attrKey, rectData.attrs[attrKey]);
}
}
if (rectData.class) {
rectElement.attr("class", rectData.class);
}
return rectElement;
}, "drawRect");
drawBackgroundRect = /* @__PURE__ */ __name((element3, bounds4) => {
const rectData = {
x: bounds4.startx,
y: bounds4.starty,
width: bounds4.stopx - bounds4.startx,
height: bounds4.stopy - bounds4.starty,
fill: bounds4.fill,
stroke: bounds4.stroke,
class: "rect"
};
const rectElement = drawRect(element3, rectData);
rectElement.lower();
}, "drawBackgroundRect");
drawText = /* @__PURE__ */ __name((element3, textData) => {
const nText = textData.text.replace(lineBreakRegex, " ");
const textElem = element3.append("text");
textElem.attr("x", textData.x);
textElem.attr("y", textData.y);
textElem.attr("class", "legend");
textElem.style("text-anchor", textData.anchor);
if (textData.class) {
textElem.attr("class", textData.class);
}
const tspan = textElem.append("tspan");
tspan.attr("x", textData.x + textData.textMargin * 2);
tspan.text(nText);
return textElem;
}, "drawText");
drawImage = /* @__PURE__ */ __name((elem, x5, y6, link2) => {
const imageElement = elem.append("image");
imageElement.attr("x", x5);
imageElement.attr("y", y6);
const sanitizedLink = (0, import_sanitize_url.sanitizeUrl)(link2);
imageElement.attr("xlink:href", sanitizedLink);
}, "drawImage");
drawEmbeddedImage = /* @__PURE__ */ __name((element3, x5, y6, link2) => {
const imageElement = element3.append("use");
imageElement.attr("x", x5);
imageElement.attr("y", y6);
const sanitizedLink = (0, import_sanitize_url.sanitizeUrl)(link2);
imageElement.attr("xlink:href", `#${sanitizedLink}`);
}, "drawEmbeddedImage");
getNoteRect = /* @__PURE__ */ __name(() => {
const noteRectData = {
x: 0,
y: 0,
width: 100,
height: 100,
fill: "#EDF2AE",
stroke: "#666",
anchor: "start",
rx: 0,
ry: 0
};
return noteRectData;
}, "getNoteRect");
getTextObj = /* @__PURE__ */ __name(() => {
const testObject = {
x: 0,
y: 0,
width: 100,
height: 100,
"text-anchor": "start",
style: "#666",
textMargin: 0,
rx: 0,
ry: 0,
tspan: true
};
return testObject;
}, "getTextObj");
}
});
// src/diagrams/c4/svgDraw.js
var import_sanitize_url2, drawRect2, drawImage2, drawRels, drawBoundary, drawC4Shape, insertDatabaseIcon, insertComputerIcon, insertClockIcon, insertArrowHead, insertArrowEnd, insertArrowFilledHead, insertDynamicNumber, insertArrowCrossHead, getC4ShapeFont, _drawTextCandidateFunc, svgDraw_default;
var init_svgDraw = __esm({
"src/diagrams/c4/svgDraw.js"() {
"use strict";
init_common();
init_svgDrawCommon();
import_sanitize_url2 = __toESM(require_dist(), 1);
drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
return drawRect(elem, rectData);
}, "drawRect");
drawImage2 = /* @__PURE__ */ __name(function(elem, width3, height2, x5, y6, link2) {
const imageElem = elem.append("image");
imageElem.attr("width", width3);
imageElem.attr("height", height2);
imageElem.attr("x", x5);
imageElem.attr("y", y6);
let sanitizedLink = link2.startsWith("data:image/png;base64") ? link2 : (0, import_sanitize_url2.sanitizeUrl)(link2);
imageElem.attr("xlink:href", sanitizedLink);
}, "drawImage");
drawRels = /* @__PURE__ */ __name((elem, rels2, conf5) => {
const relsElem = elem.append("g");
let i2 = 0;
for (let rel2 of rels2) {
let textColor = rel2.textColor ? rel2.textColor : "#444444";
let strokeColor = rel2.lineColor ? rel2.lineColor : "#444444";
let offsetX = rel2.offsetX ? parseInt(rel2.offsetX) : 0;
let offsetY = rel2.offsetY ? parseInt(rel2.offsetY) : 0;
let url = "";
if (i2 === 0) {
let line2 = relsElem.append("line");
line2.attr("x1", rel2.startPoint.x);
line2.attr("y1", rel2.startPoint.y);
line2.attr("x2", rel2.endPoint.x);
line2.attr("y2", rel2.endPoint.y);
line2.attr("stroke-width", "1");
line2.attr("stroke", strokeColor);
line2.style("fill", "none");
if (rel2.type !== "rel_b") {
line2.attr("marker-end", "url(" + url + "#arrowhead)");
}
if (rel2.type === "birel" || rel2.type === "rel_b") {
line2.attr("marker-start", "url(" + url + "#arrowend)");
}
i2 = -1;
} else {
let line2 = relsElem.append("path");
line2.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
"d",
"Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel2.startPoint.x).replaceAll("starty", rel2.startPoint.y).replaceAll(
"controlx",
rel2.startPoint.x + (rel2.endPoint.x - rel2.startPoint.x) / 2 - (rel2.endPoint.x - rel2.startPoint.x) / 4
).replaceAll("controly", rel2.startPoint.y + (rel2.endPoint.y - rel2.startPoint.y) / 2).replaceAll("stopx", rel2.endPoint.x).replaceAll("stopy", rel2.endPoint.y)
);
if (rel2.type !== "rel_b") {
line2.attr("marker-end", "url(" + url + "#arrowhead)");
}
if (rel2.type === "birel" || rel2.type === "rel_b") {
line2.attr("marker-start", "url(" + url + "#arrowend)");
}
}
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,
Math.min(rel2.startPoint.y, rel2.endPoint.y) + Math.abs(rel2.endPoint.y - rel2.startPoint.y) / 2 + offsetY,
rel2.label.width,
rel2.label.height,
{ fill: textColor },
messageConf
);
if (rel2.techn && rel2.techn.text !== "") {
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 + conf5.messageFontSize + 5 + offsetY,
Math.max(rel2.label.width, rel2.techn.width),
rel2.techn.height,
{ fill: textColor, "font-style": "italic" },
messageConf
);
}
}
}, "drawRels");
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";
let fontColor = boundary.fontColor ? boundary.fontColor : "black";
let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
if (boundary.nodeType) {
attrsValue = { "stroke-width": 1 };
}
let rectData = {
x: boundary.x,
y: boundary.y,
fill: fillColor,
stroke: strokeColor,
width: boundary.width,
height: boundary.height,
rx: 2.5,
ry: 2.5,
attrs: attrsValue
};
drawRect2(boundaryElem, rectData);
let boundaryConf = conf5.boundaryFont();
boundaryConf.fontWeight = "bold";
boundaryConf.fontSize = boundaryConf.fontSize + 2;
boundaryConf.fontColor = fontColor;
_drawTextCandidateFunc(conf5)(
boundary.label.text,
boundaryElem,
boundary.x,
boundary.y + boundary.label.Y,
boundary.width,
boundary.height,
{ fill: "#444444" },
boundaryConf
);
if (boundary.type && boundary.type.text !== "") {
boundaryConf = conf5.boundaryFont();
boundaryConf.fontColor = fontColor;
_drawTextCandidateFunc(conf5)(
boundary.type.text,
boundaryElem,
boundary.x,
boundary.y + boundary.type.Y,
boundary.width,
boundary.height,
{ fill: "#444444" },
boundaryConf
);
}
if (boundary.descr && boundary.descr.text !== "") {
boundaryConf = conf5.boundaryFont();
boundaryConf.fontSize = boundaryConf.fontSize - 2;
boundaryConf.fontColor = fontColor;
_drawTextCandidateFunc(conf5)(
boundary.descr.text,
boundaryElem,
boundary.x,
boundary.y + boundary.descr.Y,
boundary.width,
boundary.height,
{ fill: "#444444" },
boundaryConf
);
}
}, "drawBoundary");
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) {
case "person":
personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
break;
case "external_person":
personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
break;
}
const c4ShapeElem = elem.append("g");
c4ShapeElem.attr("class", "person-man");
const rect3 = getNoteRect();
switch (c4Shape.typeC4Shape.text) {
case "person":
case "external_person":
case "system":
case "external_system":
case "container":
case "external_container":
case "component":
case "external_component":
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":
case "container_db":
case "external_container_db":
case "component_db":
case "external_component_db":
c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
"d",
"Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height)
);
c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
"d",
"Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2)
);
break;
case "system_queue":
case "external_system_queue":
case "container_queue":
case "external_container_queue":
case "component_queue":
case "external_component_queue":
c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
"d",
"Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2)
);
c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
"d",
"Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2)
);
break;
}
let c4ShapeFontConf = getC4ShapeFont(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":
case "external_person":
drawImage2(
c4ShapeElem,
48,
48,
c4Shape.x + c4Shape.width / 2 - 24,
c4Shape.y + c4Shape.image.Y,
personImg
);
break;
}
let textFontConf = conf5[c4Shape.typeC4Shape.text + "Font"]();
textFontConf.fontWeight = "bold";
textFontConf.fontSize = textFontConf.fontSize + 2;
textFontConf.fontColor = fontColor;
_drawTextCandidateFunc(conf5)(
c4Shape.label.text,
c4ShapeElem,
c4Shape.x,
c4Shape.y + c4Shape.label.Y,
c4Shape.width,
c4Shape.height,
{ fill: fontColor },
textFontConf
);
textFontConf = conf5[c4Shape.typeC4Shape.text + "Font"]();
textFontConf.fontColor = fontColor;
if (c4Shape.techn && c4Shape.techn?.text !== "") {
_drawTextCandidateFunc(conf5)(
c4Shape.techn.text,
c4ShapeElem,
c4Shape.x,
c4Shape.y + c4Shape.techn.Y,
c4Shape.width,
c4Shape.height,
{ fill: fontColor, "font-style": "italic" },
textFontConf
);
} else if (c4Shape.type && c4Shape.type.text !== "") {
_drawTextCandidateFunc(conf5)(
c4Shape.type.text,
c4ShapeElem,
c4Shape.x,
c4Shape.y + c4Shape.type.Y,
c4Shape.width,
c4Shape.height,
{ fill: fontColor, "font-style": "italic" },
textFontConf
);
}
if (c4Shape.descr && c4Shape.descr.text !== "") {
textFontConf = conf5.personFont();
textFontConf.fontColor = fontColor;
_drawTextCandidateFunc(conf5)(
c4Shape.descr.text,
c4ShapeElem,
c4Shape.x,
c4Shape.y + c4Shape.descr.Y,
c4Shape.width,
c4Shape.height,
{ fill: fontColor },
textFontConf
);
}
return c4Shape.height;
}, "drawC4Shape");
insertDatabaseIcon = /* @__PURE__ */ __name(function(elem) {
elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
"d",
"M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
);
}, "insertDatabaseIcon");
insertComputerIcon = /* @__PURE__ */ __name(function(elem) {
elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
"d",
"M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
);
}, "insertComputerIcon");
insertClockIcon = /* @__PURE__ */ __name(function(elem) {
elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
"d",
"M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
);
}, "insertClockIcon");
insertArrowHead = /* @__PURE__ */ __name(function(elem) {
elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
}, "insertArrowHead");
insertArrowEnd = /* @__PURE__ */ __name(function(elem) {
elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");
}, "insertArrowEnd");
insertArrowFilledHead = /* @__PURE__ */ __name(function(elem) {
elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
}, "insertArrowFilledHead");
insertDynamicNumber = /* @__PURE__ */ __name(function(elem) {
elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
}, "insertDynamicNumber");
insertArrowCrossHead = /* @__PURE__ */ __name(function(elem) {
const defs2 = elem.append("defs");
const marker = defs2.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z");
marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");
}, "insertArrowCrossHead");
getC4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
return {
fontFamily: cnf[typeC4Shape + "FontFamily"],
fontSize: cnf[typeC4Shape + "FontSize"],
fontWeight: cnf[typeC4Shape + "FontWeight"]
};
}, "getC4ShapeFont");
_drawTextCandidateFunc = /* @__PURE__ */ (function() {
function byText(content, g2, x5, y6, width3, height2, textAttrs) {
const text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y6 + height2 / 2 + 5).style("text-anchor", "middle").text(content);
_setTextAttrs(text4, textAttrs);
}
__name(byText, "byText");
function byTspan(content, g2, x5, y6, 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 text4 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y6).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, y6, width3, height2, textAttrs, conf5) {
const s2 = g2.append("switch");
const f2 = s2.append("foreignObject").attr("x", x5).attr("y", y6).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, y6, width3, height2, textAttrs, conf5);
_setTextAttrs(text4, textAttrs);
}
__name(byFo, "byFo");
function _setTextAttrs(toText, fromTextAttrsDict) {
for (const key in fromTextAttrsDict) {
if (fromTextAttrsDict.hasOwnProperty(key)) {
toText.attr(key, fromTextAttrsDict[key]);
}
}
}
__name(_setTextAttrs, "_setTextAttrs");
return function(conf5) {
return conf5.textPlacement === "fo" ? byFo : conf5.textPlacement === "old" ? byText : byTspan;
};
})();
svgDraw_default = {
drawRect: drawRect2,
drawBoundary,
drawC4Shape,
drawRels,
drawImage: drawImage2,
insertArrowHead,
insertArrowEnd,
insertArrowFilledHead,
insertDynamicNumber,
insertArrowCrossHead,
insertDatabaseIcon,
insertComputerIcon,
insertClockIcon
};
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
var freeGlobal, freeGlobal_default;
var init_freeGlobal = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js"() {
"use strict";
freeGlobal = typeof global == "object" && global && global.Object === Object && global;
freeGlobal_default = freeGlobal;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js
var freeSelf, root2, root_default;
var init_root = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js"() {
"use strict";
init_freeGlobal();
freeSelf = typeof self == "object" && self && self.Object === Object && self;
root2 = freeGlobal_default || freeSelf || Function("return this")();
root_default = root2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
var Symbol2, Symbol_default;
var init_Symbol = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js"() {
"use strict";
init_root();
Symbol2 = root_default.Symbol;
Symbol_default = Symbol2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
function getRawTag(value2) {
var isOwn = hasOwnProperty.call(value2, symToStringTag), tag = value2[symToStringTag];
try {
value2[symToStringTag] = void 0;
var unmasked = true;
} catch (e3) {
}
var result = nativeObjectToString.call(value2);
if (unmasked) {
if (isOwn) {
value2[symToStringTag] = tag;
} else {
delete value2[symToStringTag];
}
}
return result;
}
var objectProto, hasOwnProperty, nativeObjectToString, symToStringTag, getRawTag_default;
var init_getRawTag = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js"() {
"use strict";
init_Symbol();
objectProto = Object.prototype;
hasOwnProperty = objectProto.hasOwnProperty;
nativeObjectToString = objectProto.toString;
symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
__name(getRawTag, "getRawTag");
getRawTag_default = getRawTag;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
function objectToString(value2) {
return nativeObjectToString2.call(value2);
}
var objectProto2, nativeObjectToString2, objectToString_default;
var init_objectToString = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js"() {
"use strict";
objectProto2 = Object.prototype;
nativeObjectToString2 = objectProto2.toString;
__name(objectToString, "objectToString");
objectToString_default = objectToString;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
function baseGetTag(value2) {
if (value2 == null) {
return value2 === void 0 ? undefinedTag : nullTag;
}
return symToStringTag2 && symToStringTag2 in Object(value2) ? getRawTag_default(value2) : objectToString_default(value2);
}
var nullTag, undefinedTag, symToStringTag2, baseGetTag_default;
var init_baseGetTag = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js"() {
"use strict";
init_Symbol();
init_getRawTag();
init_objectToString();
nullTag = "[object Null]";
undefinedTag = "[object Undefined]";
symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
__name(baseGetTag, "baseGetTag");
baseGetTag_default = baseGetTag;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js
function isObject(value2) {
var type3 = typeof value2;
return value2 != null && (type3 == "object" || type3 == "function");
}
var isObject_default;
var init_isObject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js"() {
"use strict";
__name(isObject, "isObject");
isObject_default = isObject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js
function isFunction(value2) {
if (!isObject_default(value2)) {
return false;
}
var tag = baseGetTag_default(value2);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
var asyncTag, funcTag, genTag, proxyTag, isFunction_default;
var init_isFunction = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js"() {
"use strict";
init_baseGetTag();
init_isObject();
asyncTag = "[object AsyncFunction]";
funcTag = "[object Function]";
genTag = "[object GeneratorFunction]";
proxyTag = "[object Proxy]";
__name(isFunction, "isFunction");
isFunction_default = isFunction;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js
var coreJsData, coreJsData_default;
var init_coreJsData = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js"() {
"use strict";
init_root();
coreJsData = root_default["__core-js_shared__"];
coreJsData_default = coreJsData;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js
function isMasked(func) {
return !!maskSrcKey && maskSrcKey in func;
}
var maskSrcKey, isMasked_default;
var init_isMasked = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js"() {
"use strict";
init_coreJsData();
maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
return uid ? "Symbol(src)_1." + uid : "";
})();
__name(isMasked, "isMasked");
isMasked_default = isMasked;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e3) {
}
try {
return func + "";
} catch (e3) {
}
}
return "";
}
var funcProto, funcToString, toSource_default;
var init_toSource = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js"() {
"use strict";
funcProto = Function.prototype;
funcToString = funcProto.toString;
__name(toSource, "toSource");
toSource_default = toSource;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js
function baseIsNative(value2) {
if (!isObject_default(value2) || isMasked_default(value2)) {
return false;
}
var pattern = isFunction_default(value2) ? reIsNative : reIsHostCtor;
return pattern.test(toSource_default(value2));
}
var reRegExpChar, reIsHostCtor, funcProto2, objectProto3, funcToString2, hasOwnProperty2, reIsNative, baseIsNative_default;
var init_baseIsNative = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js"() {
"use strict";
init_isFunction();
init_isMasked();
init_isObject();
init_toSource();
reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
reIsHostCtor = /^\[object .+?Constructor\]$/;
funcProto2 = Function.prototype;
objectProto3 = Object.prototype;
funcToString2 = funcProto2.toString;
hasOwnProperty2 = objectProto3.hasOwnProperty;
reIsNative = RegExp(
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
__name(baseIsNative, "baseIsNative");
baseIsNative_default = baseIsNative;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js
function getValue(object3, key) {
return object3 == null ? void 0 : object3[key];
}
var getValue_default;
var init_getValue = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js"() {
"use strict";
__name(getValue, "getValue");
getValue_default = getValue;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js
function getNative(object3, key) {
var value2 = getValue_default(object3, key);
return baseIsNative_default(value2) ? value2 : void 0;
}
var getNative_default;
var init_getNative = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js"() {
"use strict";
init_baseIsNative();
init_getValue();
__name(getNative, "getNative");
getNative_default = getNative;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js
var nativeCreate, nativeCreate_default;
var init_nativeCreate = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js"() {
"use strict";
init_getNative();
nativeCreate = getNative_default(Object, "create");
nativeCreate_default = nativeCreate;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js
function hashClear() {
this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
this.size = 0;
}
var hashClear_default;
var init_hashClear = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js"() {
"use strict";
init_nativeCreate();
__name(hashClear, "hashClear");
hashClear_default = hashClear;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
var hashDelete_default;
var init_hashDelete = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js"() {
"use strict";
__name(hashDelete, "hashDelete");
hashDelete_default = hashDelete;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js
function hashGet(key) {
var data5 = this.__data__;
if (nativeCreate_default) {
var result = data5[key];
return result === HASH_UNDEFINED ? void 0 : result;
}
return hasOwnProperty3.call(data5, key) ? data5[key] : void 0;
}
var HASH_UNDEFINED, objectProto4, hasOwnProperty3, hashGet_default;
var init_hashGet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js"() {
"use strict";
init_nativeCreate();
HASH_UNDEFINED = "__lodash_hash_undefined__";
objectProto4 = Object.prototype;
hasOwnProperty3 = objectProto4.hasOwnProperty;
__name(hashGet, "hashGet");
hashGet_default = hashGet;
}
});
// ../../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 objectProto5, hasOwnProperty4, hashHas_default;
var init_hashHas = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js"() {
"use strict";
init_nativeCreate();
objectProto5 = Object.prototype;
hasOwnProperty4 = objectProto5.hasOwnProperty;
__name(hashHas, "hashHas");
hashHas_default = hashHas;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js
function hashSet(key, value2) {
var data5 = this.__data__;
this.size += this.has(key) ? 0 : 1;
data5[key] = nativeCreate_default && value2 === void 0 ? HASH_UNDEFINED2 : value2;
return this;
}
var HASH_UNDEFINED2, hashSet_default;
var init_hashSet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js"() {
"use strict";
init_nativeCreate();
HASH_UNDEFINED2 = "__lodash_hash_undefined__";
__name(hashSet, "hashSet");
hashSet_default = hashSet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js
function Hash(entries2) {
var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
var Hash_default;
var init_Hash = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js"() {
"use strict";
init_hashClear();
init_hashDelete();
init_hashGet();
init_hashHas();
init_hashSet();
__name(Hash, "Hash");
Hash.prototype.clear = hashClear_default;
Hash.prototype["delete"] = hashDelete_default;
Hash.prototype.get = hashGet_default;
Hash.prototype.has = hashHas_default;
Hash.prototype.set = hashSet_default;
Hash_default = Hash;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
var listCacheClear_default;
var init_listCacheClear = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js"() {
"use strict";
__name(listCacheClear, "listCacheClear");
listCacheClear_default = listCacheClear;
}
});
// ../../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;
}
var eq_default;
var init_eq = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js"() {
"use strict";
__name(eq, "eq");
eq_default = eq;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js
function assocIndexOf(array4, key) {
var length2 = array4.length;
while (length2--) {
if (eq_default(array4[length2][0], key)) {
return length2;
}
}
return -1;
}
var assocIndexOf_default;
var init_assocIndexOf = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js"() {
"use strict";
init_eq();
__name(assocIndexOf, "assocIndexOf");
assocIndexOf_default = assocIndexOf;
}
});
// ../../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);
if (index < 0) {
return false;
}
var lastIndex = data5.length - 1;
if (index == lastIndex) {
data5.pop();
} else {
splice.call(data5, index, 1);
}
--this.size;
return true;
}
var arrayProto, splice, listCacheDelete_default;
var init_listCacheDelete = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js"() {
"use strict";
init_assocIndexOf();
arrayProto = Array.prototype;
splice = arrayProto.splice;
__name(listCacheDelete, "listCacheDelete");
listCacheDelete_default = listCacheDelete;
}
});
// ../../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 listCacheGet_default;
var init_listCacheGet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js"() {
"use strict";
init_assocIndexOf();
__name(listCacheGet, "listCacheGet");
listCacheGet_default = listCacheGet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js
function listCacheHas(key) {
return assocIndexOf_default(this.__data__, key) > -1;
}
var listCacheHas_default;
var init_listCacheHas = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js"() {
"use strict";
init_assocIndexOf();
__name(listCacheHas, "listCacheHas");
listCacheHas_default = listCacheHas;
}
});
// ../../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);
if (index < 0) {
++this.size;
data5.push([key, value2]);
} else {
data5[index][1] = value2;
}
return this;
}
var listCacheSet_default;
var init_listCacheSet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js"() {
"use strict";
init_assocIndexOf();
__name(listCacheSet, "listCacheSet");
listCacheSet_default = listCacheSet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js
function ListCache(entries2) {
var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
var ListCache_default;
var init_ListCache = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js"() {
"use strict";
init_listCacheClear();
init_listCacheDelete();
init_listCacheGet();
init_listCacheHas();
init_listCacheSet();
__name(ListCache, "ListCache");
ListCache.prototype.clear = listCacheClear_default;
ListCache.prototype["delete"] = listCacheDelete_default;
ListCache.prototype.get = listCacheGet_default;
ListCache.prototype.has = listCacheHas_default;
ListCache.prototype.set = listCacheSet_default;
ListCache_default = ListCache;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js
var Map2, Map_default;
var init_Map = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js"() {
"use strict";
init_getNative();
init_root();
Map2 = getNative_default(root_default, "Map");
Map_default = Map2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js
function mapCacheClear() {
this.size = 0;
this.__data__ = {
"hash": new Hash_default(),
"map": new (Map_default || ListCache_default)(),
"string": new Hash_default()
};
}
var mapCacheClear_default;
var init_mapCacheClear = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js"() {
"use strict";
init_Hash();
init_ListCache();
init_Map();
__name(mapCacheClear, "mapCacheClear");
mapCacheClear_default = mapCacheClear;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js
function isKeyable(value2) {
var type3 = typeof value2;
return type3 == "string" || type3 == "number" || type3 == "symbol" || type3 == "boolean" ? value2 !== "__proto__" : value2 === null;
}
var isKeyable_default;
var init_isKeyable = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js"() {
"use strict";
__name(isKeyable, "isKeyable");
isKeyable_default = isKeyable;
}
});
// ../../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 getMapData_default;
var init_getMapData = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js"() {
"use strict";
init_isKeyable();
__name(getMapData, "getMapData");
getMapData_default = getMapData;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js
function mapCacheDelete(key) {
var result = getMapData_default(this, key)["delete"](key);
this.size -= result ? 1 : 0;
return result;
}
var mapCacheDelete_default;
var init_mapCacheDelete = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js"() {
"use strict";
init_getMapData();
__name(mapCacheDelete, "mapCacheDelete");
mapCacheDelete_default = mapCacheDelete;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js
function mapCacheGet(key) {
return getMapData_default(this, key).get(key);
}
var mapCacheGet_default;
var init_mapCacheGet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js"() {
"use strict";
init_getMapData();
__name(mapCacheGet, "mapCacheGet");
mapCacheGet_default = mapCacheGet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js
function mapCacheHas(key) {
return getMapData_default(this, key).has(key);
}
var mapCacheHas_default;
var init_mapCacheHas = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js"() {
"use strict";
init_getMapData();
__name(mapCacheHas, "mapCacheHas");
mapCacheHas_default = mapCacheHas;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js
function mapCacheSet(key, value2) {
var data5 = getMapData_default(this, key), size4 = data5.size;
data5.set(key, value2);
this.size += data5.size == size4 ? 0 : 1;
return this;
}
var mapCacheSet_default;
var init_mapCacheSet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js"() {
"use strict";
init_getMapData();
__name(mapCacheSet, "mapCacheSet");
mapCacheSet_default = mapCacheSet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js
function MapCache(entries2) {
var index = -1, length2 = entries2 == null ? 0 : entries2.length;
this.clear();
while (++index < length2) {
var entry = entries2[index];
this.set(entry[0], entry[1]);
}
}
var MapCache_default;
var init_MapCache = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js"() {
"use strict";
init_mapCacheClear();
init_mapCacheDelete();
init_mapCacheGet();
init_mapCacheHas();
init_mapCacheSet();
__name(MapCache, "MapCache");
MapCache.prototype.clear = mapCacheClear_default;
MapCache.prototype["delete"] = mapCacheDelete_default;
MapCache.prototype.get = mapCacheGet_default;
MapCache.prototype.has = mapCacheHas_default;
MapCache.prototype.set = mapCacheSet_default;
MapCache_default = MapCache;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js
function memoize(func, resolver3) {
if (typeof func != "function" || resolver3 != null && typeof resolver3 != "function") {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = /* @__PURE__ */ __name(function() {
var args = arguments, key = resolver3 ? resolver3.apply(this, args) : args[0], cache3 = memoized.cache;
if (cache3.has(key)) {
return cache3.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache3.set(key, result) || cache3;
return result;
}, "memoized");
memoized.cache = new (memoize.Cache || MapCache_default)();
return memoized;
}
var FUNC_ERROR_TEXT, memoize_default;
var init_memoize = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js"() {
"use strict";
init_MapCache();
FUNC_ERROR_TEXT = "Expected a function";
__name(memoize, "memoize");
memoize.Cache = MapCache_default;
memoize_default = memoize;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js
function stackClear() {
this.__data__ = new ListCache_default();
this.size = 0;
}
var stackClear_default;
var init_stackClear = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js"() {
"use strict";
init_ListCache();
__name(stackClear, "stackClear");
stackClear_default = stackClear;
}
});
// ../../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;
return result;
}
var stackDelete_default;
var init_stackDelete = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js"() {
"use strict";
__name(stackDelete, "stackDelete");
stackDelete_default = stackDelete;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js
function stackGet(key) {
return this.__data__.get(key);
}
var stackGet_default;
var init_stackGet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js"() {
"use strict";
__name(stackGet, "stackGet");
stackGet_default = stackGet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js
function stackHas(key) {
return this.__data__.has(key);
}
var stackHas_default;
var init_stackHas = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js"() {
"use strict";
__name(stackHas, "stackHas");
stackHas_default = stackHas;
}
});
// ../../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__;
if (!Map_default || pairs2.length < LARGE_ARRAY_SIZE - 1) {
pairs2.push([key, value2]);
this.size = ++data5.size;
return this;
}
data5 = this.__data__ = new MapCache_default(pairs2);
}
data5.set(key, value2);
this.size = data5.size;
return this;
}
var LARGE_ARRAY_SIZE, stackSet_default;
var init_stackSet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js"() {
"use strict";
init_ListCache();
init_Map();
init_MapCache();
LARGE_ARRAY_SIZE = 200;
__name(stackSet, "stackSet");
stackSet_default = stackSet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js
function Stack(entries2) {
var data5 = this.__data__ = new ListCache_default(entries2);
this.size = data5.size;
}
var Stack_default;
var init_Stack = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js"() {
"use strict";
init_ListCache();
init_stackClear();
init_stackDelete();
init_stackGet();
init_stackHas();
init_stackSet();
__name(Stack, "Stack");
Stack.prototype.clear = stackClear_default;
Stack.prototype["delete"] = stackDelete_default;
Stack.prototype.get = stackGet_default;
Stack.prototype.has = stackHas_default;
Stack.prototype.set = stackSet_default;
Stack_default = Stack;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js
var defineProperty, defineProperty_default;
var init_defineProperty = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js"() {
"use strict";
init_getNative();
defineProperty = (function() {
try {
var func = getNative_default(Object, "defineProperty");
func({}, "", {});
return func;
} catch (e3) {
}
})();
defineProperty_default = defineProperty;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js
function baseAssignValue(object3, key, value2) {
if (key == "__proto__" && defineProperty_default) {
defineProperty_default(object3, key, {
"configurable": true,
"enumerable": true,
"value": value2,
"writable": true
});
} else {
object3[key] = value2;
}
}
var baseAssignValue_default;
var init_baseAssignValue = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js"() {
"use strict";
init_defineProperty();
__name(baseAssignValue, "baseAssignValue");
baseAssignValue_default = baseAssignValue;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignMergeValue.js
function assignMergeValue(object3, key, value2) {
if (value2 !== void 0 && !eq_default(object3[key], value2) || value2 === void 0 && !(key in object3)) {
baseAssignValue_default(object3, key, value2);
}
}
var assignMergeValue_default;
var init_assignMergeValue = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignMergeValue.js"() {
"use strict";
init_baseAssignValue();
init_eq();
__name(assignMergeValue, "assignMergeValue");
assignMergeValue_default = assignMergeValue;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js
function createBaseFor(fromRight) {
return function(object3, iteratee, keysFunc) {
var index = -1, iterable = Object(object3), props = keysFunc(object3), length2 = props.length;
while (length2--) {
var key = props[fromRight ? length2 : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object3;
};
}
var createBaseFor_default;
var init_createBaseFor = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js"() {
"use strict";
__name(createBaseFor, "createBaseFor");
createBaseFor_default = createBaseFor;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js
var baseFor, baseFor_default;
var init_baseFor = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js"() {
"use strict";
init_createBaseFor();
baseFor = createBaseFor_default();
baseFor_default = baseFor;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2);
buffer.copy(result);
return result;
}
var freeExports, freeModule, moduleExports, Buffer2, allocUnsafe, cloneBuffer_default;
var init_cloneBuffer = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js"() {
"use strict";
init_root();
freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
moduleExports = freeModule && freeModule.exports === freeExports;
Buffer2 = moduleExports ? root_default.Buffer : void 0;
allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
__name(cloneBuffer, "cloneBuffer");
cloneBuffer_default = cloneBuffer;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js
var Uint8Array2, Uint8Array_default;
var init_Uint8Array = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js"() {
"use strict";
init_root();
Uint8Array2 = root_default.Uint8Array;
Uint8Array_default = Uint8Array2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneArrayBuffer.js
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer));
return result;
}
var cloneArrayBuffer_default;
var init_cloneArrayBuffer = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneArrayBuffer.js"() {
"use strict";
init_Uint8Array();
__name(cloneArrayBuffer, "cloneArrayBuffer");
cloneArrayBuffer_default = cloneArrayBuffer;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneTypedArray.js
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
var cloneTypedArray_default;
var init_cloneTypedArray = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneTypedArray.js"() {
"use strict";
init_cloneArrayBuffer();
__name(cloneTypedArray, "cloneTypedArray");
cloneTypedArray_default = cloneTypedArray;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyArray.js
function copyArray(source, array4) {
var index = -1, length2 = source.length;
array4 || (array4 = Array(length2));
while (++index < length2) {
array4[index] = source[index];
}
return array4;
}
var copyArray_default;
var init_copyArray = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyArray.js"() {
"use strict";
__name(copyArray, "copyArray");
copyArray_default = copyArray;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseCreate.js
var objectCreate, baseCreate, baseCreate_default;
var init_baseCreate = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseCreate.js"() {
"use strict";
init_isObject();
objectCreate = Object.create;
baseCreate = /* @__PURE__ */ (function() {
function object3() {
}
__name(object3, "object");
return function(proto) {
if (!isObject_default(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object3.prototype = proto;
var result = new object3();
object3.prototype = void 0;
return result;
};
})();
baseCreate_default = baseCreate;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js
function overArg(func, transform8) {
return function(arg) {
return func(transform8(arg));
};
}
var overArg_default;
var init_overArg = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js"() {
"use strict";
__name(overArg, "overArg");
overArg_default = overArg;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getPrototype.js
var getPrototype, getPrototype_default;
var init_getPrototype = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getPrototype.js"() {
"use strict";
init_overArg();
getPrototype = overArg_default(Object.getPrototypeOf, Object);
getPrototype_default = getPrototype;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js
function isPrototype(value2) {
var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto6;
return value2 === proto;
}
var objectProto6, isPrototype_default;
var init_isPrototype = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js"() {
"use strict";
objectProto6 = Object.prototype;
__name(isPrototype, "isPrototype");
isPrototype_default = isPrototype;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneObject.js
function initCloneObject(object3) {
return typeof object3.constructor == "function" && !isPrototype_default(object3) ? baseCreate_default(getPrototype_default(object3)) : {};
}
var initCloneObject_default;
var init_initCloneObject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneObject.js"() {
"use strict";
init_baseCreate();
init_getPrototype();
init_isPrototype();
__name(initCloneObject, "initCloneObject");
initCloneObject_default = initCloneObject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
function isObjectLike(value2) {
return value2 != null && typeof value2 == "object";
}
var isObjectLike_default;
var init_isObjectLike = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js"() {
"use strict";
__name(isObjectLike, "isObjectLike");
isObjectLike_default = isObjectLike;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js
function baseIsArguments(value2) {
return isObjectLike_default(value2) && baseGetTag_default(value2) == argsTag;
}
var argsTag, baseIsArguments_default;
var init_baseIsArguments = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js"() {
"use strict";
init_baseGetTag();
init_isObjectLike();
argsTag = "[object Arguments]";
__name(baseIsArguments, "baseIsArguments");
baseIsArguments_default = baseIsArguments;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js
var objectProto7, hasOwnProperty5, propertyIsEnumerable, isArguments, isArguments_default;
var init_isArguments = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js"() {
"use strict";
init_baseIsArguments();
init_isObjectLike();
objectProto7 = Object.prototype;
hasOwnProperty5 = objectProto7.hasOwnProperty;
propertyIsEnumerable = objectProto7.propertyIsEnumerable;
isArguments = baseIsArguments_default(/* @__PURE__ */ (function() {
return arguments;
})()) ? baseIsArguments_default : function(value2) {
return isObjectLike_default(value2) && hasOwnProperty5.call(value2, "callee") && !propertyIsEnumerable.call(value2, "callee");
};
isArguments_default = isArguments;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
var isArray, isArray_default;
var init_isArray = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js"() {
"use strict";
isArray = Array.isArray;
isArray_default = isArray;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js
function isLength(value2) {
return typeof value2 == "number" && value2 > -1 && value2 % 1 == 0 && value2 <= MAX_SAFE_INTEGER;
}
var MAX_SAFE_INTEGER, isLength_default;
var init_isLength = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js"() {
"use strict";
MAX_SAFE_INTEGER = 9007199254740991;
__name(isLength, "isLength");
isLength_default = isLength;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js
function isArrayLike(value2) {
return value2 != null && isLength_default(value2.length) && !isFunction_default(value2);
}
var isArrayLike_default;
var init_isArrayLike = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js"() {
"use strict";
init_isFunction();
init_isLength();
__name(isArrayLike, "isArrayLike");
isArrayLike_default = isArrayLike;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLikeObject.js
function isArrayLikeObject(value2) {
return isObjectLike_default(value2) && isArrayLike_default(value2);
}
var isArrayLikeObject_default;
var init_isArrayLikeObject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLikeObject.js"() {
"use strict";
init_isArrayLike();
init_isObjectLike();
__name(isArrayLikeObject, "isArrayLikeObject");
isArrayLikeObject_default = isArrayLikeObject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js
function stubFalse() {
return false;
}
var stubFalse_default;
var init_stubFalse = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js"() {
"use strict";
__name(stubFalse, "stubFalse");
stubFalse_default = stubFalse;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js
var freeExports2, freeModule2, moduleExports2, Buffer3, nativeIsBuffer, isBuffer, isBuffer_default;
var init_isBuffer = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js"() {
"use strict";
init_root();
init_stubFalse();
freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports;
freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
Buffer3 = moduleExports2 ? root_default.Buffer : void 0;
nativeIsBuffer = Buffer3 ? Buffer3.isBuffer : void 0;
isBuffer = nativeIsBuffer || stubFalse_default;
isBuffer_default = isBuffer;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js
function isPlainObject(value2) {
if (!isObjectLike_default(value2) || baseGetTag_default(value2) != objectTag) {
return false;
}
var proto = getPrototype_default(value2);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty6.call(proto, "constructor") && proto.constructor;
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
}
var objectTag, funcProto3, objectProto8, funcToString3, hasOwnProperty6, objectCtorString, isPlainObject_default;
var init_isPlainObject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js"() {
"use strict";
init_baseGetTag();
init_getPrototype();
init_isObjectLike();
objectTag = "[object Object]";
funcProto3 = Function.prototype;
objectProto8 = Object.prototype;
funcToString3 = funcProto3.toString;
hasOwnProperty6 = objectProto8.hasOwnProperty;
objectCtorString = funcToString3.call(Object);
__name(isPlainObject, "isPlainObject");
isPlainObject_default = isPlainObject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js
function baseIsTypedArray(value2) {
return isObjectLike_default(value2) && isLength_default(value2.length) && !!typedArrayTags[baseGetTag_default(value2)];
}
var argsTag2, arrayTag, boolTag, dateTag, errorTag, funcTag2, mapTag, numberTag, objectTag2, regexpTag, setTag, stringTag, weakMapTag, arrayBufferTag, dataViewTag, float32Tag, float64Tag, int8Tag, int16Tag, int32Tag, uint8Tag, uint8ClampedTag, uint16Tag, uint32Tag, typedArrayTags, baseIsTypedArray_default;
var init_baseIsTypedArray = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js"() {
"use strict";
init_baseGetTag();
init_isLength();
init_isObjectLike();
argsTag2 = "[object Arguments]";
arrayTag = "[object Array]";
boolTag = "[object Boolean]";
dateTag = "[object Date]";
errorTag = "[object Error]";
funcTag2 = "[object Function]";
mapTag = "[object Map]";
numberTag = "[object Number]";
objectTag2 = "[object Object]";
regexpTag = "[object RegExp]";
setTag = "[object Set]";
stringTag = "[object String]";
weakMapTag = "[object WeakMap]";
arrayBufferTag = "[object ArrayBuffer]";
dataViewTag = "[object DataView]";
float32Tag = "[object Float32Array]";
float64Tag = "[object Float64Array]";
int8Tag = "[object Int8Array]";
int16Tag = "[object Int16Array]";
int32Tag = "[object Int32Array]";
uint8Tag = "[object Uint8Array]";
uint8ClampedTag = "[object Uint8ClampedArray]";
uint16Tag = "[object Uint16Array]";
uint32Tag = "[object Uint32Array]";
typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag2] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
__name(baseIsTypedArray, "baseIsTypedArray");
baseIsTypedArray_default = baseIsTypedArray;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js
function baseUnary(func) {
return function(value2) {
return func(value2);
};
}
var baseUnary_default;
var init_baseUnary = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js"() {
"use strict";
__name(baseUnary, "baseUnary");
baseUnary_default = baseUnary;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js
var freeExports3, freeModule3, moduleExports3, freeProcess, nodeUtil, nodeUtil_default;
var init_nodeUtil = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js"() {
"use strict";
init_freeGlobal();
freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports;
freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module;
moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
freeProcess = moduleExports3 && freeGlobal_default.process;
nodeUtil = (function() {
try {
var types = freeModule3 && freeModule3.require && freeModule3.require("util").types;
if (types) {
return types;
}
return freeProcess && freeProcess.binding && freeProcess.binding("util");
} catch (e3) {
}
})();
nodeUtil_default = nodeUtil;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js
var nodeIsTypedArray, isTypedArray, isTypedArray_default;
var init_isTypedArray = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js"() {
"use strict";
init_baseIsTypedArray();
init_baseUnary();
init_nodeUtil();
nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray;
isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default;
isTypedArray_default = isTypedArray;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_safeGet.js
function safeGet(object3, key) {
if (key === "constructor" && typeof object3[key] === "function") {
return;
}
if (key == "__proto__") {
return;
}
return object3[key];
}
var safeGet_default;
var init_safeGet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_safeGet.js"() {
"use strict";
__name(safeGet, "safeGet");
safeGet_default = safeGet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignValue.js
function assignValue(object3, key, value2) {
var objValue = object3[key];
if (!(hasOwnProperty7.call(object3, key) && eq_default(objValue, value2)) || value2 === void 0 && !(key in object3)) {
baseAssignValue_default(object3, key, value2);
}
}
var objectProto9, hasOwnProperty7, assignValue_default;
var init_assignValue = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignValue.js"() {
"use strict";
init_baseAssignValue();
init_eq();
objectProto9 = Object.prototype;
hasOwnProperty7 = objectProto9.hasOwnProperty;
__name(assignValue, "assignValue");
assignValue_default = assignValue;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyObject.js
function copyObject(source, props, object3, customizer) {
var isNew = !object3;
object3 || (object3 = {});
var index = -1, length2 = props.length;
while (++index < length2) {
var key = props[index];
var newValue = customizer ? customizer(object3[key], source[key], key, object3, source) : void 0;
if (newValue === void 0) {
newValue = source[key];
}
if (isNew) {
baseAssignValue_default(object3, key, newValue);
} else {
assignValue_default(object3, key, newValue);
}
}
return object3;
}
var copyObject_default;
var init_copyObject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyObject.js"() {
"use strict";
init_assignValue();
init_baseAssignValue();
__name(copyObject, "copyObject");
copyObject_default = copyObject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js
function baseTimes(n2, iteratee) {
var index = -1, result = Array(n2);
while (++index < n2) {
result[index] = iteratee(index);
}
return result;
}
var baseTimes_default;
var init_baseTimes = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js"() {
"use strict";
__name(baseTimes, "baseTimes");
baseTimes_default = baseTimes;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js
function isIndex(value2, length2) {
var type3 = typeof value2;
length2 = length2 == null ? MAX_SAFE_INTEGER2 : length2;
return !!length2 && (type3 == "number" || type3 != "symbol" && reIsUint.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2);
}
var MAX_SAFE_INTEGER2, reIsUint, isIndex_default;
var init_isIndex = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js"() {
"use strict";
MAX_SAFE_INTEGER2 = 9007199254740991;
reIsUint = /^(?:0|[1-9]\d*)$/;
__name(isIndex, "isIndex");
isIndex_default = isIndex;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js
function arrayLikeKeys(value2, inherited) {
var isArr = isArray_default(value2), isArg = !isArr && isArguments_default(value2), isBuff = !isArr && !isArg && isBuffer_default(value2), isType2 = !isArr && !isArg && !isBuff && isTypedArray_default(value2), skipIndexes = isArr || isArg || isBuff || isType2, result = skipIndexes ? baseTimes_default(value2.length, String) : [], length2 = result.length;
for (var key in value2) {
if ((inherited || hasOwnProperty8.call(value2, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
isIndex_default(key, length2)))) {
result.push(key);
}
}
return result;
}
var objectProto10, hasOwnProperty8, arrayLikeKeys_default;
var init_arrayLikeKeys = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js"() {
"use strict";
init_baseTimes();
init_isArguments();
init_isArray();
init_isBuffer();
init_isIndex();
init_isTypedArray();
objectProto10 = Object.prototype;
hasOwnProperty8 = objectProto10.hasOwnProperty;
__name(arrayLikeKeys, "arrayLikeKeys");
arrayLikeKeys_default = arrayLikeKeys;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeysIn.js
function nativeKeysIn(object3) {
var result = [];
if (object3 != null) {
for (var key in Object(object3)) {
result.push(key);
}
}
return result;
}
var nativeKeysIn_default;
var init_nativeKeysIn = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeysIn.js"() {
"use strict";
__name(nativeKeysIn, "nativeKeysIn");
nativeKeysIn_default = nativeKeysIn;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeysIn.js
function baseKeysIn(object3) {
if (!isObject_default(object3)) {
return nativeKeysIn_default(object3);
}
var isProto = isPrototype_default(object3), result = [];
for (var key in object3) {
if (!(key == "constructor" && (isProto || !hasOwnProperty9.call(object3, key)))) {
result.push(key);
}
}
return result;
}
var objectProto11, hasOwnProperty9, baseKeysIn_default;
var init_baseKeysIn = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeysIn.js"() {
"use strict";
init_isObject();
init_isPrototype();
init_nativeKeysIn();
objectProto11 = Object.prototype;
hasOwnProperty9 = objectProto11.hasOwnProperty;
__name(baseKeysIn, "baseKeysIn");
baseKeysIn_default = baseKeysIn;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keysIn.js
function keysIn(object3) {
return isArrayLike_default(object3) ? arrayLikeKeys_default(object3, true) : baseKeysIn_default(object3);
}
var keysIn_default;
var init_keysIn = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keysIn.js"() {
"use strict";
init_arrayLikeKeys();
init_baseKeysIn();
init_isArrayLike();
__name(keysIn, "keysIn");
keysIn_default = keysIn;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPlainObject.js
function toPlainObject(value2) {
return copyObject_default(value2, keysIn_default(value2));
}
var toPlainObject_default;
var init_toPlainObject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPlainObject.js"() {
"use strict";
init_copyObject();
init_keysIn();
__name(toPlainObject, "toPlainObject");
toPlainObject_default = toPlainObject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMergeDeep.js
function baseMergeDeep(object3, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = safeGet_default(object3, key), srcValue = safeGet_default(source, key), stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue_default(object3, key, stacked);
return;
}
var newValue = customizer ? customizer(objValue, srcValue, key + "", object3, source, stack) : void 0;
var isCommon = newValue === void 0;
if (isCommon) {
var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray_default(objValue)) {
newValue = objValue;
} else if (isArrayLikeObject_default(objValue)) {
newValue = copyArray_default(objValue);
} else if (isBuff) {
isCommon = false;
newValue = cloneBuffer_default(srcValue, true);
} else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray_default(srcValue, true);
} else {
newValue = [];
}
} else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) {
newValue = objValue;
if (isArguments_default(objValue)) {
newValue = toPlainObject_default(objValue);
} else if (!isObject_default(objValue) || isFunction_default(objValue)) {
newValue = initCloneObject_default(srcValue);
}
} else {
isCommon = false;
}
}
if (isCommon) {
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack["delete"](srcValue);
}
assignMergeValue_default(object3, key, newValue);
}
var baseMergeDeep_default;
var init_baseMergeDeep = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMergeDeep.js"() {
"use strict";
init_assignMergeValue();
init_cloneBuffer();
init_cloneTypedArray();
init_copyArray();
init_initCloneObject();
init_isArguments();
init_isArray();
init_isArrayLikeObject();
init_isBuffer();
init_isFunction();
init_isObject();
init_isPlainObject();
init_isTypedArray();
init_safeGet();
init_toPlainObject();
__name(baseMergeDeep, "baseMergeDeep");
baseMergeDeep_default = baseMergeDeep;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMerge.js
function baseMerge(object3, source, srcIndex, customizer, stack) {
if (object3 === source) {
return;
}
baseFor_default(source, function(srcValue, key) {
stack || (stack = new Stack_default());
if (isObject_default(srcValue)) {
baseMergeDeep_default(object3, source, key, srcIndex, baseMerge, customizer, stack);
} else {
var newValue = customizer ? customizer(safeGet_default(object3, key), srcValue, key + "", object3, source, stack) : void 0;
if (newValue === void 0) {
newValue = srcValue;
}
assignMergeValue_default(object3, key, newValue);
}
}, keysIn_default);
}
var baseMerge_default;
var init_baseMerge = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMerge.js"() {
"use strict";
init_Stack();
init_assignMergeValue();
init_baseFor();
init_baseMergeDeep();
init_isObject();
init_keysIn();
init_safeGet();
__name(baseMerge, "baseMerge");
baseMerge_default = baseMerge;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js
function identity4(value2) {
return value2;
}
var identity_default4;
var init_identity4 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js"() {
"use strict";
__name(identity4, "identity");
identity_default4 = identity4;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js
function apply2(func, thisArg, args) {
switch (args.length) {
case 0:
return func.call(thisArg);
case 1:
return func.call(thisArg, args[0]);
case 2:
return func.call(thisArg, args[0], args[1]);
case 3:
return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
var apply_default;
var init_apply = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js"() {
"use strict";
__name(apply2, "apply");
apply_default = apply2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overRest.js
function overRest(func, start3, transform8) {
start3 = nativeMax(start3 === void 0 ? func.length - 1 : start3, 0);
return function() {
var args = arguments, index = -1, length2 = nativeMax(args.length - start3, 0), array4 = Array(length2);
while (++index < length2) {
array4[index] = args[start3 + index];
}
index = -1;
var otherArgs = Array(start3 + 1);
while (++index < start3) {
otherArgs[index] = args[index];
}
otherArgs[start3] = transform8(array4);
return apply_default(func, this, otherArgs);
};
}
var nativeMax, overRest_default;
var init_overRest = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overRest.js"() {
"use strict";
init_apply();
nativeMax = Math.max;
__name(overRest, "overRest");
overRest_default = overRest;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js
function constant(value2) {
return function() {
return value2;
};
}
var constant_default7;
var init_constant8 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js"() {
"use strict";
__name(constant, "constant");
constant_default7 = constant;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSetToString.js
var baseSetToString, baseSetToString_default;
var init_baseSetToString = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSetToString.js"() {
"use strict";
init_constant8();
init_defineProperty();
init_identity4();
baseSetToString = !defineProperty_default ? identity_default4 : function(func, string3) {
return defineProperty_default(func, "toString", {
"configurable": true,
"enumerable": false,
"value": constant_default7(string3),
"writable": true
});
};
baseSetToString_default = baseSetToString;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_shortOut.js
function shortOut(func) {
var count2 = 0, lastCalled = 0;
return function() {
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count2 >= HOT_COUNT) {
return arguments[0];
}
} else {
count2 = 0;
}
return func.apply(void 0, arguments);
};
}
var HOT_COUNT, HOT_SPAN, nativeNow, shortOut_default;
var init_shortOut = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_shortOut.js"() {
"use strict";
HOT_COUNT = 800;
HOT_SPAN = 16;
nativeNow = Date.now;
__name(shortOut, "shortOut");
shortOut_default = shortOut;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToString.js
var setToString, setToString_default;
var init_setToString = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToString.js"() {
"use strict";
init_baseSetToString();
init_shortOut();
setToString = shortOut_default(baseSetToString_default);
setToString_default = setToString;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRest.js
function baseRest(func, start3) {
return setToString_default(overRest_default(func, start3, identity_default4), func + "");
}
var baseRest_default;
var init_baseRest = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRest.js"() {
"use strict";
init_identity4();
init_overRest();
init_setToString();
__name(baseRest, "baseRest");
baseRest_default = baseRest;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIterateeCall.js
function isIterateeCall(value2, index, object3) {
if (!isObject_default(object3)) {
return false;
}
var type3 = typeof index;
if (type3 == "number" ? isArrayLike_default(object3) && isIndex_default(index, object3.length) : type3 == "string" && index in object3) {
return eq_default(object3[index], value2);
}
return false;
}
var isIterateeCall_default;
var init_isIterateeCall = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIterateeCall.js"() {
"use strict";
init_eq();
init_isArrayLike();
init_isIndex();
init_isObject();
__name(isIterateeCall, "isIterateeCall");
isIterateeCall_default = isIterateeCall;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAssigner.js
function createAssigner(assigner) {
return baseRest_default(function(object3, sources) {
var index = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0;
customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0;
if (guard && isIterateeCall_default(sources[0], sources[1], guard)) {
customizer = length2 < 3 ? void 0 : customizer;
length2 = 1;
}
object3 = Object(object3);
while (++index < length2) {
var source = sources[index];
if (source) {
assigner(object3, source, index, customizer);
}
}
return object3;
});
}
var createAssigner_default;
var init_createAssigner = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAssigner.js"() {
"use strict";
init_baseRest();
init_isIterateeCall();
__name(createAssigner, "createAssigner");
createAssigner_default = createAssigner;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js
var merge, merge_default3;
var init_merge4 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js"() {
"use strict";
init_baseMerge();
init_createAssigner();
merge = createAssigner_default(function(object3, source, srcIndex) {
baseMerge_default(object3, source, srcIndex);
});
merge_default3 = merge;
}
});
// src/utils.ts
function interpolateToCurve(interpolate, defaultCurve) {
if (!interpolate) {
return defaultCurve;
}
const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;
return d3CurveTypes[curveName] ?? defaultCurve;
}
function formatUrl(linkStr, config5) {
const url = linkStr.trim();
if (!url) {
return void 0;
}
if (config5.securityLevel !== "loose") {
return (0, import_sanitize_url3.sanitizeUrl)(url);
}
return url;
}
function distance(p1, p22) {
if (!p1 || !p22) {
return 0;
}
return Math.sqrt(Math.pow(p22.x - p1.x, 2) + Math.pow(p22.y - p1.y, 2));
}
function traverseEdge(points) {
let prevPoint;
let totalDistance = 0;
points.forEach((point8) => {
totalDistance += distance(point8, prevPoint);
prevPoint = point8;
});
const remainingDistance = totalDistance / 2;
return calculatePoint(points, remainingDistance);
}
function calcLabelPosition(points) {
if (points.length === 1) {
return points[0];
}
return traverseEdge(points);
}
function calcTerminalLabelPosition(terminalMarkerSize, position5, _points) {
const points = structuredClone(_points);
log.info("our points", points);
if (position5 !== "start_left" && position5 !== "start_right") {
points.reverse();
}
const distanceToCardinalityPoint = 25 + terminalMarkerSize;
const center4 = calculatePoint(points, distanceToCardinalityPoint);
const d3 = 10 + terminalMarkerSize * 0.5;
const angle2 = Math.atan2(points[0].y - center4.y, points[0].x - center4.x);
const cardinalityPosition = { x: 0, y: 0 };
if (position5 === "start_left") {
cardinalityPosition.x = Math.sin(angle2 + Math.PI) * d3 + (points[0].x + center4.x) / 2;
cardinalityPosition.y = -Math.cos(angle2 + Math.PI) * d3 + (points[0].y + center4.y) / 2;
} else if (position5 === "end_right") {
cardinalityPosition.x = Math.sin(angle2 - Math.PI) * d3 + (points[0].x + center4.x) / 2 - 5;
cardinalityPosition.y = -Math.cos(angle2 - Math.PI) * d3 + (points[0].y + center4.y) / 2 - 5;
} else if (position5 === "end_left") {
cardinalityPosition.x = Math.sin(angle2) * d3 + (points[0].x + center4.x) / 2 - 5;
cardinalityPosition.y = -Math.cos(angle2) * d3 + (points[0].y + center4.y) / 2 - 5;
} else {
cardinalityPosition.x = Math.sin(angle2) * d3 + (points[0].x + center4.x) / 2;
cardinalityPosition.y = -Math.cos(angle2) * d3 + (points[0].y + center4.y) / 2;
}
return cardinalityPosition;
}
function getStylesFromArray(arr) {
let style3 = "";
let labelStyle = "";
for (const element3 of arr) {
if (element3 !== void 0) {
if (element3.startsWith("color:") || element3.startsWith("text-align:")) {
labelStyle = labelStyle + element3 + ";";
} else {
style3 = style3 + element3 + ";";
}
}
}
return { style: style3, labelStyle };
}
function makeRandomHex(length2) {
let result = "";
const characters2 = "0123456789abcdef";
const charactersLength = characters2.length;
for (let i2 = 0; i2 < length2; i2++) {
result += characters2.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
function calculateTextHeight(text4, config5) {
return calculateTextDimensions(text4, config5).height;
}
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 handleUndefinedAttr(attrValue) {
return attrValue ?? null;
}
function isLabelCoordinateInPath(point8, dAttr) {
const roundedX = Math.round(point8.x);
const roundedY = Math.round(point8.y);
const sanitizedD = dAttr.replace(
/(\d+\.\d+)/g,
(match2) => Math.round(parseFloat(match2)).toString()
);
return sanitizedD.includes(roundedX.toString()) || sanitizedD.includes(roundedY.toString());
}
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({
"src/utils.ts"() {
"use strict";
import_sanitize_url3 = __toESM(require_dist(), 1);
init_src32();
init_common();
init_sanitizeDirective();
init_logger();
init_detectType();
init_assignWithDepth();
init_memoize();
init_merge4();
init_regexes();
ZERO_WIDTH_SPACE = "\u200B";
d3CurveTypes = {
curveBasis: basis_default2,
curveBasisClosed: basisClosed_default2,
curveBasisOpen: basisOpen_default,
curveBumpX: bumpX,
curveBumpY: bumpY,
curveBundle: bundle_default,
curveCardinalClosed: cardinalClosed_default,
curveCardinalOpen: cardinalOpen_default,
curveCardinal: cardinal_default,
curveCatmullRomClosed: catmullRomClosed_default,
curveCatmullRomOpen: catmullRomOpen_default,
curveCatmullRom: catmullRom_default,
curveLinear: linear_default,
curveLinearClosed: linearClosed_default,
curveMonotoneX: monotoneX,
curveMonotoneY: monotoneY,
curveNatural: natural_default,
curveStep: step_default,
curveStepAfter: stepAfter,
curveStepBefore: stepBefore
};
directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
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);
sanitizeDirective(args);
results = assignWithDepth_default(results, [...args]);
} else {
results = inits.args;
}
if (!results) {
return;
}
let type3 = detectType(text4, config5);
const prop = "config";
if (results[prop] !== void 0) {
if (type3 === "flowchart-v2") {
type3 = "flowchart";
}
results[type3] = results[prop];
delete results[prop];
}
return results;
}, "detectInit");
detectDirective = /* @__PURE__ */ __name(function(text4, type3 = null) {
try {
const commentWithoutDirectives = new RegExp(
`[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*
`,
"ig"
);
text4 = text4.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"');
log.debug(
`Detecting diagram directive${type3 !== null ? " type:" + type3 : ""} based on the text:${text4}`
);
let match2;
const result = [];
while ((match2 = directiveRegex.exec(text4)) !== null) {
if (match2.index === directiveRegex.lastIndex) {
directiveRegex.lastIndex++;
}
if (match2 && !type3 || type3 && match2[1]?.match(type3) || type3 && match2[2]?.match(type3)) {
const type4 = match2[1] ? match2[1] : match2[2];
const args = match2[3] ? match2[3].trim() : match2[4] ? JSON.parse(match2[4].trim()) : null;
result.push({ type: type4, args });
}
}
if (result.length === 0) {
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: '${text4}'`
);
return { type: void 0, args: null };
}
}, "detectDirective");
removeDirectives = /* @__PURE__ */ __name(function(text4) {
return text4.replace(directiveRegex, "");
}, "removeDirectives");
isSubstringInArray = /* @__PURE__ */ __name(function(str2, arr) {
for (const [i2, element3] of arr.entries()) {
if (element3.match(str2)) {
return i2;
}
}
return -1;
}, "isSubstringInArray");
__name(interpolateToCurve, "interpolateToCurve");
__name(formatUrl, "formatUrl");
runFunc = /* @__PURE__ */ __name((functionName, ...params) => {
const arrPaths = functionName.split(".");
const len = arrPaths.length - 1;
const fnName = arrPaths[len];
let obj = window;
for (let i2 = 0; i2 < len; i2++) {
obj = obj[arrPaths[i2]];
if (!obj) {
log.error(`Function name: ${functionName} not found in window`);
return;
}
}
obj[fnName](...params);
}, "runFunc");
__name(distance, "distance");
__name(traverseEdge, "traverseEdge");
__name(calcLabelPosition, "calcLabelPosition");
roundNumber = /* @__PURE__ */ __name((num, precision = 2) => {
const factor = Math.pow(10, precision);
return Math.round(num * factor) / factor;
}, "roundNumber");
calculatePoint = /* @__PURE__ */ __name((points, distanceToTraverse) => {
let prevPoint = void 0;
let remainingDistance = distanceToTraverse;
for (const point8 of points) {
if (prevPoint) {
const vectorDistance = distance(point8, prevPoint);
if (vectorDistance === 0) {
return prevPoint;
}
if (vectorDistance < remainingDistance) {
remainingDistance -= vectorDistance;
} else {
const distanceRatio = remainingDistance / vectorDistance;
if (distanceRatio <= 0) {
return prevPoint;
}
if (distanceRatio >= 1) {
return { x: point8.x, y: point8.y };
}
if (distanceRatio > 0 && distanceRatio < 1) {
return {
x: roundNumber((1 - distanceRatio) * prevPoint.x + distanceRatio * point8.x, 5),
y: roundNumber((1 - distanceRatio) * prevPoint.y + distanceRatio * point8.y, 5)
};
}
}
}
prevPoint = point8;
}
throw new Error("Could not find a suitable point for the given distance");
}, "calculatePoint");
calcCardinalityPosition = /* @__PURE__ */ __name((isRelationTypePresent, points, initialPosition) => {
log.info(`our points ${JSON.stringify(points)}`);
if (points[0] !== initialPosition) {
points = points.reverse();
}
const distanceToCardinalityPoint = 25;
const center4 = calculatePoint(points, distanceToCardinalityPoint);
const d3 = isRelationTypePresent ? 10 : 5;
const angle2 = Math.atan2(points[0].y - center4.y, points[0].x - center4.x);
const cardinalityPosition = { x: 0, y: 0 };
cardinalityPosition.x = Math.sin(angle2) * d3 + (points[0].x + center4.x) / 2;
cardinalityPosition.y = -Math.cos(angle2) * d3 + (points[0].y + center4.y) / 2;
return cardinalityPosition;
}, "calcCardinalityPosition");
__name(calcTerminalLabelPosition, "calcTerminalLabelPosition");
__name(getStylesFromArray, "getStylesFromArray");
cnt = 0;
generateId = /* @__PURE__ */ __name(() => {
cnt++;
return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
}, "generateId");
__name(makeRandomHex, "makeRandomHex");
random = /* @__PURE__ */ __name((options2) => {
return makeRandomHex(options2.length);
}, "random");
getTextObj2 = /* @__PURE__ */ __name(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");
drawSimpleText = /* @__PURE__ */ __name(function(elem, textData) {
const nText = textData.text.replace(common_default.lineBreakRegex, " ");
const [, _fontSizePx] = parseFontSize(textData.fontSize);
const textElem = elem.append("text");
textElem.attr("x", textData.x);
textElem.attr("y", textData.y);
textElem.style("text-anchor", textData.anchor);
textElem.style("font-family", textData.fontFamily);
textElem.style("font-size", _fontSizePx);
textElem.style("font-weight", textData.fontWeight);
textElem.attr("fill", textData.fill);
if (textData.class !== void 0) {
textElem.attr("class", textData.class);
}
const span = textElem.append("tspan");
span.attr("x", textData.x + textData.textMargin * 2);
span.attr("fill", textData.fill);
span.text(nText);
return textElem;
}, "drawSimpleText");
wrapLabel = memoize_default(
(label, maxWidth2, config5) => {
if (!label) {
return label;
}
config5 = Object.assign(
{ fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "
" },
config5
);
if (common_default.lineBreakRegex.test(label)) {
return label;
}
const words = label.split(" ").filter(Boolean);
const completedLines = [];
let nextLine = "";
words.forEach((word, index) => {
const wordLength = calculateTextWidth(`${word} `, config5);
const nextLineLength = calculateTextWidth(nextLine, config5);
if (wordLength > maxWidth2) {
const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth2, "-", config5);
completedLines.push(nextLine, ...hyphenatedStrings);
nextLine = remainingWord;
} else if (nextLineLength + wordLength >= maxWidth2) {
completedLines.push(nextLine);
nextLine = word;
} else {
nextLine = [nextLine, word].filter(Boolean).join(" ");
}
const currentWord = index + 1;
const isLastWord = currentWord === words.length;
if (isLastWord) {
completedLines.push(nextLine);
}
});
return completedLines.filter((line2) => line2 !== "").join(config5.joinWith);
},
(label, maxWidth2, config5) => `${label}${maxWidth2}${config5.fontSize}${config5.fontWeight}${config5.fontFamily}${config5.joinWith}`
);
breakString = memoize_default(
(word, maxWidth2, hyphenCharacter = "-", config5) => {
config5 = Object.assign(
{ fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 },
config5
);
const characters2 = [...word];
const lines = [];
let currentLine = "";
characters2.forEach((character2, index) => {
const nextLine = `${currentLine}${character2}`;
const lineWidth = calculateTextWidth(nextLine, config5);
if (lineWidth >= maxWidth2) {
const currentCharacter = index + 1;
const isLastLine = characters2.length === currentCharacter;
const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`;
lines.push(isLastLine ? nextLine : hyphenatedNextLine);
currentLine = "";
} else {
currentLine = nextLine;
}
});
return { hyphenatedStrings: lines, remainingWord: currentLine };
},
(word, maxWidth2, hyphenCharacter = "-", config5) => `${word}${maxWidth2}${hyphenCharacter}${config5.fontSize}${config5.fontWeight}${config5.fontFamily}`
);
__name(calculateTextHeight, "calculateTextHeight");
__name(calculateTextWidth, "calculateTextWidth");
calculateTextDimensions = memoize_default(
(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 = text4.split(common_default.lineBreakRegex);
const dims = [];
const body = select_default2("body");
if (!body.remove) {
return { width: 0, height: 0, lineHeight: 0 };
}
const g2 = body.append("svg");
for (const fontFamily2 of fontFamilies) {
let cHeight = 0;
const dim = { width: 0, height: 0, lineHeight: 0 };
for (const line2 of lines) {
const textObj = getTextObj2();
textObj.text = line2 || ZERO_WIDTH_SPACE;
const textElem = drawSimpleText(g2, textObj).style("font-size", _fontSizePx).style("font-weight", fontWeight).style("font-family", fontFamily2);
const bBox = (textElem._groups || textElem)[0][0].getBBox();
if (bBox.width === 0 && bBox.height === 0) {
throw new Error("svg element not in render tree");
}
dim.width = Math.round(Math.max(dim.width, bBox.width));
cHeight = Math.round(bBox.height);
dim.height += cHeight;
dim.lineHeight = Math.round(Math.max(dim.lineHeight, cHeight));
}
dims.push(dim);
}
g2.remove();
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];
},
(text4, config5) => `${text4}${config5.fontSize}${config5.fontWeight}${config5.fontFamily}`
);
InitIDGenerator = class {
constructor(deterministic = false, seed) {
this.count = 0;
this.count = seed ? seed.length : 0;
this.next = deterministic ? () => this.count++ : () => Date.now();
}
static {
__name(this, "InitIDGenerator");
}
};
entityDecode = /* @__PURE__ */ __name(function(html2) {
decoder = decoder || document.createElement("div");
html2 = escape(html2).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";");
decoder.innerHTML = html2;
return unescape(decoder.textContent);
}, "entityDecode");
__name(isDetailedError, "isDetailedError");
insertTitle = /* @__PURE__ */ __name((parent4, cssClass, titleTopMargin, title2) => {
if (!title2) {
return;
}
const bounds4 = parent4.node()?.getBBox();
if (!bounds4) {
return;
}
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") {
return [fontSize, fontSize + "px"];
}
const fontSizeNumber = parseInt(fontSize ?? "", 10);
if (Number.isNaN(fontSizeNumber)) {
return [void 0, void 0];
} else if (fontSize === String(fontSizeNumber)) {
return [fontSizeNumber, fontSize + "px"];
} else {
return [fontSizeNumber, fontSize];
}
}, "parseFontSize");
__name(cleanAndMerge, "cleanAndMerge");
utils_default2 = {
assignWithDepth: assignWithDepth_default,
wrapLabel,
calculateTextHeight,
calculateTextWidth,
calculateTextDimensions,
cleanAndMerge,
detectInit,
detectDirective,
isSubstringInArray,
interpolateToCurve,
calcLabelPosition,
calcCardinalityPosition,
calcTerminalLabelPosition,
formatUrl,
getStylesFromArray,
generateId,
random,
runFunc,
entityDecode,
insertTitle,
isLabelCoordinateInPath,
parseFontSize,
InitIDGenerator
};
encodeEntities = /* @__PURE__ */ __name(function(text4) {
let txt = text4;
txt = txt.replace(/style.*:\S*#.*;/g, function(s2) {
return s2.substring(0, s2.length - 1);
});
txt = txt.replace(/classDef.*:\S*#.*;/g, function(s2) {
return s2.substring(0, s2.length - 1);
});
txt = txt.replace(/#\w+;/g, function(s2) {
const innerTxt = s2.substring(1, s2.length - 1);
const isInt = /^\+?\d+$/.test(innerTxt);
if (isInt) {
return "\uFB02\xB0\xB0" + innerTxt + "\xB6\xDF";
} else {
return "\uFB02\xB0" + innerTxt + "\xB6\xDF";
}
});
return txt;
}, "encodeEntities");
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
}, id30) => {
if (id30) {
return id30;
}
return `${prefix ? `${prefix}_` : ""}${from2}_${to}_${counter2}${suffix ? `_${suffix}` : ""}`;
}, "getEdgeId");
__name(handleUndefinedAttr, "handleUndefinedAttr");
__name(isLabelCoordinateInPath, "isLabelCoordinateInPath");
}
});
// src/diagrams/c4/c4Renderer.js
function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {
if (!c4Shape[textType].width) {
if (c4ShapeTextWrap) {
c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);
c4Shape[textType].textLines = c4Shape[textType].text.split(common_default.lineBreakRegex).length;
c4Shape[textType].width = textLimitWidth;
c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);
} else {
let lines = c4Shape[textType].text.split(common_default.lineBreakRegex);
c4Shape[textType].textLines = lines.length;
let lineHeight = 0;
c4Shape[textType].height = 0;
c4Shape[textType].width = 0;
for (const line2 of lines) {
c4Shape[textType].width = Math.max(
calculateTextWidth(line2, textConf),
c4Shape[textType].width
);
lineHeight = calculateTextHeight(line2, textConf);
c4Shape[textType].height = c4Shape[textType].height + lineHeight;
}
}
}
}
function drawInsideBoundary(diagram27, 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()) {
let Y3 = 0;
currentBoundary.image = { width: 0, height: 0, Y: 0 };
if (currentBoundary.sprite) {
currentBoundary.image.width = 48;
currentBoundary.image.height = 48;
currentBoundary.image.Y = Y3;
Y3 = currentBoundary.image.Y + currentBoundary.image.height;
}
let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;
let currentBoundaryLabelConf = boundaryFont(conf);
currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;
currentBoundaryLabelConf.fontWeight = "bold";
calcC4ShapeTextWH(
"label",
currentBoundary,
currentBoundaryTextWrap,
currentBoundaryLabelConf,
currentBounds.data.widthLimit
);
currentBoundary.label.Y = Y3 + 8;
Y3 = currentBoundary.label.Y + currentBoundary.label.height;
if (currentBoundary.type && currentBoundary.type.text !== "") {
currentBoundary.type.text = "[" + currentBoundary.type.text + "]";
let currentBoundaryTypeConf = boundaryFont(conf);
calcC4ShapeTextWH(
"type",
currentBoundary,
currentBoundaryTextWrap,
currentBoundaryTypeConf,
currentBounds.data.widthLimit
);
currentBoundary.type.Y = Y3 + 5;
Y3 = currentBoundary.type.Y + currentBoundary.type.height;
}
if (currentBoundary.descr && currentBoundary.descr.text !== "") {
let currentBoundaryDescrConf = boundaryFont(conf);
currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;
calcC4ShapeTextWH(
"descr",
currentBoundary,
currentBoundaryTextWrap,
currentBoundaryDescrConf,
currentBounds.data.widthLimit
);
currentBoundary.descr.Y = Y3 + 20;
Y3 = currentBoundary.descr.Y + currentBoundary.descr.height;
}
if (i2 == 0 || i2 % c4BoundaryInRow2 === 0) {
let _x = parentBounds.data.startx + conf.diagramMarginX;
let _y = parentBounds.data.stopy + conf.diagramMarginY + Y3;
currentBounds.setData(_x, _x, _y, _y);
} else {
let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx;
let _y = currentBounds.data.starty;
currentBounds.setData(_x, _x, _y, _y);
}
currentBounds.name = currentBoundary.alias;
let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias);
let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias);
if (currentPersonOrSystemKeys.length > 0) {
drawC4ShapeArray(
currentBounds,
diagram27,
currentPersonOrSystemArray,
currentPersonOrSystemKeys
);
}
parentBoundaryAlias = currentBoundary.alias;
let nextCurrentBoundaries = diagObj.db.getBoundaries(parentBoundaryAlias);
if (nextCurrentBoundaries.length > 0) {
drawInsideBoundary(
diagram27,
parentBoundaryAlias,
currentBounds,
nextCurrentBoundaries,
diagObj
);
}
if (currentBoundary.alias !== "global") {
drawBoundary2(diagram27, currentBoundary, currentBounds);
}
parentBounds.data.stopy = Math.max(
currentBounds.data.stopy + conf.c4ShapeMargin,
parentBounds.data.stopy
);
parentBounds.data.stopx = Math.max(
currentBounds.data.stopx + conf.c4ShapeMargin,
parentBounds.data.stopx
);
globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);
globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);
}
}
var globalBoundaryMaxX, globalBoundaryMaxY, c4ShapeInRow2, c4BoundaryInRow2, conf, Bounds, setConf, c4ShapeFont, boundaryFont, messageFont, drawBoundary2, drawC4ShapeArray, Point2, getIntersectPoint, getIntersectPoints, drawRels2, draw, c4Renderer_default;
var init_c4Renderer = __esm({
"src/diagrams/c4/c4Renderer.js"() {
"use strict";
init_src32();
init_svgDraw();
init_logger();
init_c4Diagram();
init_common();
init_c4Db();
init_diagramAPI();
init_assignWithDepth();
init_utils2();
init_setupGraphViewbox();
globalBoundaryMaxX = 0;
globalBoundaryMaxY = 0;
c4ShapeInRow2 = 4;
c4BoundaryInRow2 = 2;
parser.yy = c4Db_default;
conf = {};
Bounds = class {
static {
__name(this, "Bounds");
}
constructor(diagObj) {
this.name = "";
this.data = {};
this.data.startx = void 0;
this.data.stopx = void 0;
this.data.starty = void 0;
this.data.stopy = void 0;
this.data.widthLimit = void 0;
this.nextData = {};
this.nextData.startx = void 0;
this.nextData.stopx = void 0;
this.nextData.starty = void 0;
this.nextData.stopy = void 0;
this.nextData.cnt = 0;
setConf(diagObj.db.getConfig());
}
setData(startx, stopx, starty, stopy) {
this.nextData.startx = this.data.startx = startx;
this.nextData.stopx = this.data.stopx = stopx;
this.nextData.starty = this.data.starty = starty;
this.nextData.stopy = this.data.stopy = stopy;
}
updateVal(obj, key, val, fun) {
if (obj[key] === void 0) {
obj[key] = val;
} else {
obj[key] = fun(val, obj[key]);
}
}
insert(c4Shape) {
this.nextData.cnt = this.nextData.cnt + 1;
let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2;
let _stopx = _startx + c4Shape.width;
let _starty = this.nextData.starty + c4Shape.margin * 2;
let _stopy = _starty + c4Shape.height;
if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow2) {
_startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;
_starty = this.nextData.stopy + c4Shape.margin * 2;
this.nextData.stopx = _stopx = _startx + c4Shape.width;
this.nextData.starty = this.nextData.stopy;
this.nextData.stopy = _stopy = _starty + c4Shape.height;
this.nextData.cnt = 1;
}
c4Shape.x = _startx;
c4Shape.y = _starty;
this.updateVal(this.data, "startx", _startx, Math.min);
this.updateVal(this.data, "starty", _starty, Math.min);
this.updateVal(this.data, "stopx", _stopx, Math.max);
this.updateVal(this.data, "stopy", _stopy, Math.max);
this.updateVal(this.nextData, "startx", _startx, Math.min);
this.updateVal(this.nextData, "starty", _starty, Math.min);
this.updateVal(this.nextData, "stopx", _stopx, Math.max);
this.updateVal(this.nextData, "stopy", _stopy, Math.max);
}
init(diagObj) {
this.name = "";
this.data = {
startx: void 0,
stopx: void 0,
starty: void 0,
stopy: void 0,
widthLimit: void 0
};
this.nextData = {
startx: void 0,
stopx: void 0,
starty: void 0,
stopy: void 0,
cnt: 0
};
setConf(diagObj.db.getConfig());
}
bumpLastMargin(margin) {
this.data.stopx += margin;
this.data.stopy += margin;
}
};
setConf = /* @__PURE__ */ __name(function(cnf) {
assignWithDepth_default(conf, cnf);
if (cnf.fontFamily) {
conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;
}
if (cnf.fontSize) {
conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;
}
if (cnf.fontWeight) {
conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;
}
}, "setConf");
c4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
return {
fontFamily: cnf[typeC4Shape + "FontFamily"],
fontSize: cnf[typeC4Shape + "FontSize"],
fontWeight: cnf[typeC4Shape + "FontWeight"]
};
}, "c4ShapeFont");
boundaryFont = /* @__PURE__ */ __name((cnf) => {
return {
fontFamily: cnf.boundaryFontFamily,
fontSize: cnf.boundaryFontSize,
fontWeight: cnf.boundaryFontWeight
};
}, "boundaryFont");
messageFont = /* @__PURE__ */ __name((cnf) => {
return {
fontFamily: cnf.messageFontFamily,
fontSize: cnf.messageFontSize,
fontWeight: cnf.messageFontWeight
};
}, "messageFont");
__name(calcC4ShapeTextWH, "calcC4ShapeTextWH");
drawBoundary2 = /* @__PURE__ */ __name(function(diagram27, boundary, bounds4) {
boundary.x = bounds4.data.startx;
boundary.y = bounds4.data.starty;
boundary.width = bounds4.data.stopx - bounds4.data.startx;
boundary.height = bounds4.data.stopy - bounds4.data.starty;
boundary.label.y = conf.c4ShapeMargin - 35;
let boundaryTextWrap = boundary.wrap && conf.wrap;
let boundaryLabelConf = boundaryFont(conf);
boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;
boundaryLabelConf.fontWeight = "bold";
let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
svgDraw_default.drawBoundary(diagram27, boundary, conf);
}, "drawBoundary");
drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram27, c4ShapeArray2, c4ShapeKeys) {
let Y3 = 0;
for (const c4ShapeKey of c4ShapeKeys) {
Y3 = 0;
const c4Shape = c4ShapeArray2[c4ShapeKey];
let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;
c4Shape.typeC4Shape.width = calculateTextWidth(
"\xAB" + c4Shape.typeC4Shape.text + "\xBB",
c4ShapeTypeConf
);
c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;
c4Shape.typeC4Shape.Y = conf.c4ShapePadding;
Y3 = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;
c4Shape.image = { width: 0, height: 0, Y: 0 };
switch (c4Shape.typeC4Shape.text) {
case "person":
case "external_person":
c4Shape.image.width = 48;
c4Shape.image.height = 48;
c4Shape.image.Y = Y3;
Y3 = c4Shape.image.Y + c4Shape.image.height;
break;
}
if (c4Shape.sprite) {
c4Shape.image.width = 48;
c4Shape.image.height = 48;
c4Shape.image.Y = Y3;
Y3 = c4Shape.image.Y + c4Shape.image.height;
}
let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;
let textLimitWidth = conf.width - conf.c4ShapePadding * 2;
let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
c4ShapeLabelConf.fontWeight = "bold";
calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
c4Shape.label.Y = Y3 + 8;
Y3 = c4Shape.label.Y + c4Shape.label.height;
if (c4Shape.type && c4Shape.type.text !== "") {
c4Shape.type.text = "[" + c4Shape.type.text + "]";
let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth);
c4Shape.type.Y = Y3 + 5;
Y3 = c4Shape.type.Y + c4Shape.type.height;
} else if (c4Shape.techn && c4Shape.techn.text !== "") {
c4Shape.techn.text = "[" + c4Shape.techn.text + "]";
let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
c4Shape.techn.Y = Y3 + 5;
Y3 = c4Shape.techn.Y + c4Shape.techn.height;
}
let rectHeight = Y3;
let rectWidth = c4Shape.label.width;
if (c4Shape.descr && c4Shape.descr.text !== "") {
let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
c4Shape.descr.Y = Y3 + 20;
Y3 = c4Shape.descr.Y + c4Shape.descr.height;
rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
rectHeight = Y3 - c4Shape.descr.textLines * 5;
}
rectWidth = rectWidth + conf.c4ShapePadding;
c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);
c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
currentBounds.insert(c4Shape);
svgDraw_default.drawC4Shape(diagram27, c4Shape, conf);
}
currentBounds.bumpLastMargin(conf.c4ShapeMargin);
}, "drawC4ShapeArray");
Point2 = class {
static {
__name(this, "Point");
}
constructor(x5, y6) {
this.x = x5;
this.y = y6;
}
};
getIntersectPoint = /* @__PURE__ */ __name(function(fromNode, endPoint) {
let x1 = fromNode.x;
let y1 = fromNode.y;
let x22 = endPoint.x;
let y22 = endPoint.y;
let fromCenterX = x1 + fromNode.width / 2;
let fromCenterY = y1 + fromNode.height / 2;
let dx = Math.abs(x1 - x22);
let dy = Math.abs(y1 - y22);
let tanDYX = dy / dx;
let fromDYX = fromNode.height / fromNode.width;
let returnPoint = null;
if (y1 == y22 && x1 < x22) {
returnPoint = new Point2(x1 + fromNode.width, fromCenterY);
} else if (y1 == y22 && x1 > x22) {
returnPoint = new Point2(x1, fromCenterY);
} else if (x1 == x22 && y1 < y22) {
returnPoint = new Point2(fromCenterX, y1 + fromNode.height);
} else if (x1 == x22 && y1 > y22) {
returnPoint = new Point2(fromCenterX, y1);
}
if (x1 > x22 && y1 < y22) {
if (fromDYX >= tanDYX) {
returnPoint = new Point2(x1, fromCenterY + tanDYX * fromNode.width / 2);
} else {
returnPoint = new Point2(
fromCenterX - dx / dy * fromNode.height / 2,
y1 + fromNode.height
);
}
} else if (x1 < x22 && y1 < y22) {
if (fromDYX >= tanDYX) {
returnPoint = new Point2(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2);
} else {
returnPoint = new Point2(
fromCenterX + dx / dy * fromNode.height / 2,
y1 + fromNode.height
);
}
} else if (x1 < x22 && y1 > y22) {
if (fromDYX >= tanDYX) {
returnPoint = new Point2(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2);
} else {
returnPoint = new Point2(fromCenterX + fromNode.height / 2 * dx / dy, y1);
}
} else if (x1 > x22 && y1 > y22) {
if (fromDYX >= tanDYX) {
returnPoint = new Point2(x1, fromCenterY - fromNode.width / 2 * tanDYX);
} else {
returnPoint = new Point2(fromCenterX - fromNode.height / 2 * dx / dy, y1);
}
}
return returnPoint;
}, "getIntersectPoint");
getIntersectPoints = /* @__PURE__ */ __name(function(fromNode, endNode) {
let endIntersectPoint = { x: 0, y: 0 };
endIntersectPoint.x = endNode.x + endNode.width / 2;
endIntersectPoint.y = endNode.y + endNode.height / 2;
let startPoint = getIntersectPoint(fromNode, endIntersectPoint);
endIntersectPoint.x = fromNode.x + fromNode.width / 2;
endIntersectPoint.y = fromNode.y + fromNode.height / 2;
let endPoint = getIntersectPoint(endNode, endIntersectPoint);
return { startPoint, endPoint };
}, "getIntersectPoints");
drawRels2 = /* @__PURE__ */ __name(function(diagram27, rels2, getC4ShapeObj, diagObj) {
let i2 = 0;
for (let rel2 of rels2) {
i2 = i2 + 1;
let relTextWrap = rel2.wrap && conf.wrap;
let relConf = messageFont(conf);
let diagramType = diagObj.db.getC4Type();
if (diagramType === "C4Dynamic") {
rel2.label.text = i2 + ": " + rel2.label.text;
}
let textLimitWidth = calculateTextWidth(rel2.label.text, relConf);
calcC4ShapeTextWH("label", rel2, relTextWrap, relConf, textLimitWidth);
if (rel2.techn && rel2.techn.text !== "") {
textLimitWidth = calculateTextWidth(rel2.techn.text, relConf);
calcC4ShapeTextWH("techn", rel2, relTextWrap, relConf, textLimitWidth);
}
if (rel2.descr && rel2.descr.text !== "") {
textLimitWidth = calculateTextWidth(rel2.descr.text, relConf);
calcC4ShapeTextWH("descr", rel2, relTextWrap, relConf, textLimitWidth);
}
let fromNode = getC4ShapeObj(rel2.from);
let endNode = getC4ShapeObj(rel2.to);
let points = getIntersectPoints(fromNode, endNode);
rel2.startPoint = points.startPoint;
rel2.endPoint = points.endPoint;
}
svgDraw_default.drawRels(diagram27, rels2, conf);
}, "drawRels");
__name(drawInsideBoundary, "drawInsideBoundary");
draw = /* @__PURE__ */ __name(function(_text, id30, _version, diagObj) {
conf = getConfig2().c4;
const securityLevel = getConfig2().securityLevel;
let sandboxElement;
if (securityLevel === "sandbox") {
sandboxElement = select_default2("#i" + id30);
}
const root3 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
let db7 = diagObj.db;
diagObj.db.setWrap(conf.wrap);
c4ShapeInRow2 = db7.getC4ShapeInRow();
c4BoundaryInRow2 = db7.getC4BoundaryInRow();
log.debug(`C:${JSON.stringify(conf, null, 2)}`);
const diagram27 = securityLevel === "sandbox" ? root3.select(`[id="${id30}"]`) : select_default2(`[id="${id30}"]`);
svgDraw_default.insertComputerIcon(diagram27);
svgDraw_default.insertDatabaseIcon(diagram27);
svgDraw_default.insertClockIcon(diagram27);
let screenBounds = new Bounds(diagObj);
screenBounds.setData(
conf.diagramMarginX,
conf.diagramMarginX,
conf.diagramMarginY,
conf.diagramMarginY
);
screenBounds.data.widthLimit = screen.availWidth;
globalBoundaryMaxX = conf.diagramMarginX;
globalBoundaryMaxY = conf.diagramMarginY;
const title2 = diagObj.db.getTitle();
let currentBoundaries = diagObj.db.getBoundaries("");
drawInsideBoundary(diagram27, "", screenBounds, currentBoundaries, diagObj);
svgDraw_default.insertArrowHead(diagram27);
svgDraw_default.insertArrowEnd(diagram27);
svgDraw_default.insertArrowCrossHead(diagram27);
svgDraw_default.insertArrowFilledHead(diagram27);
drawRels2(diagram27, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj);
screenBounds.data.stopx = globalBoundaryMaxX;
screenBounds.data.stopy = globalBoundaryMaxY;
const box = screenBounds.data;
let boxHeight = box.stopy - box.starty;
let height2 = boxHeight + 2 * conf.diagramMarginY;
let boxWidth = box.stopx - box.startx;
const width3 = boxWidth + 2 * conf.diagramMarginX;
if (title2) {
diagram27.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
}
configureSvgSize(diagram27, height2, width3, conf.useMaxWidth);
const extraVertForTitle = title2 ? 60 : 0;
diagram27.attr(
"viewBox",
box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width3 + " " + (height2 + extraVertForTitle)
);
log.debug(`models:`, box);
}, "draw");
c4Renderer_default = {
drawPersonOrSystemArray: drawC4ShapeArray,
drawBoundary: drawBoundary2,
setConf,
draw
};
}
});
// src/diagrams/c4/styles.js
var getStyles2, styles_default2;
var init_styles2 = __esm({
"src/diagrams/c4/styles.js"() {
"use strict";
getStyles2 = /* @__PURE__ */ __name((options2) => `.person {
stroke: ${options2.personBorder};
fill: ${options2.personBkg};
}
`, "getStyles");
styles_default2 = getStyles2;
}
});
// src/diagrams/c4/c4Diagram.ts
var c4Diagram_exports = {};
__export(c4Diagram_exports, {
diagram: () => diagram
});
var diagram;
var init_c4Diagram2 = __esm({
"src/diagrams/c4/c4Diagram.ts"() {
"use strict";
init_c4Diagram();
init_c4Db();
init_c4Renderer();
init_styles2();
diagram = {
parser: c4Diagram_default,
db: c4Db_default,
renderer: c4Renderer_default,
styles: styles_default2,
init: /* @__PURE__ */ __name(({ c4, wrap: wrap3 }) => {
c4Renderer_default.setConf(c4);
c4Db_default.setWrap(wrap3);
}, "init")
};
}
});
// ../../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];
}
}
return target;
}
function repeat(string3, count2) {
var result = "", cycle;
for (cycle = 0; cycle < count2; 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, options2) {
options2 = Object.create(options2 || null);
if (!mark.buffer) return null;
if (!options2.maxLength) options2.maxLength = 79;
if (typeof options2.indent !== "number") options2.indent = 1;
if (typeof options2.linesBefore !== "number") options2.linesBefore = 3;
if (typeof options2.linesAfter !== "number") options2.linesAfter = 2;
var re3 = /\r?\n|\r|\0/g;
var lineStarts = [0];
var lineEnds = [];
var match2;
var foundLineNo = -1;
while (match2 = re3.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 + options2.linesAfter, lineEnds.length).toString().length;
var maxLineLength = options2.maxLength - (options2.indent + lineNoLength + 3);
for (i2 = 1; i2 <= options2.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(" ", options2.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(" ", options2.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
result += common.repeat("-", options2.indent + lineNoLength + 3 + line2.pos) + "^\n";
for (i2 = 1; i2 <= options2.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(" ", options2.indent) + padStart((mark.line + i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
}
return result.replace(/\n$/, "");
}
function compileStyleAliases(map5) {
var result = {};
if (map5 !== null) {
Object.keys(map5).forEach(function(style3) {
map5[style3].forEach(function(alias) {
result[String(alias)] = style3;
});
});
}
return result;
}
function Type$1(tag, options2) {
options2 = options2 || {};
Object.keys(options2).forEach(function(name) {
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
}
});
this.options = options2;
this.tag = tag;
this.kind = options2["kind"] || null;
this.resolve = options2["resolve"] || function() {
return true;
};
this.construct = options2["construct"] || function(data5) {
return data5;
};
this.instanceOf = options2["instanceOf"] || null;
this.predicate = options2["predicate"] || null;
this.represent = options2["represent"] || null;
this.representName = options2["representName"] || null;
this.defaultStyle = options2["defaultStyle"] || null;
this.multi = options2["multi"] || false;
this.styleAliases = compileStyleAliases(options2["styleAliases"] || null);
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" 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;
}
});
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(data5) {
if (data5 === null) return true;
var max10 = data5.length;
return max10 === 1 && data5 === "~" || max10 === 4 && (data5 === "null" || data5 === "Null" || data5 === "NULL");
}
function constructYamlNull() {
return null;
}
function isNull(object3) {
return object3 === null;
}
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");
}
function constructYamlBoolean(data5) {
return data5 === "true" || data5 === "True" || data5 === "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(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;
}
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);
}
function isInteger(object3) {
return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 === 0 && !common.isNegativeZero(object3));
}
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;
}
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);
}
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;
}
function isFloat(object3) {
return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 !== 0 || common.isNegativeZero(object3));
}
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;
}
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;
}
function representYamlTimestamp(object3) {
return object3.toISOString();
}
function resolveYamlMerge(data5) {
return data5 === "<<" || data5 === null;
}
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;
}
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);
}
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;
}
function isBinary(obj) {
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
}
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;
}
}
if (!pairHasKey) return false;
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
else return false;
}
return true;
}
function constructYamlOmap(data5) {
return data5 !== null ? data5 : [];
}
function resolveYamlPairs(data5) {
if (data5 === null) return true;
var index, length2, pair, keys2, 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;
keys2 = Object.keys(pair);
if (keys2.length !== 1) return false;
result[index] = [keys2[0], pair[keys2[0]]];
}
return true;
}
function constructYamlPairs(data5) {
if (data5 === null) return [];
var index, length2, pair, keys2, result, object3 = data5;
result = new Array(object3.length);
for (index = 0, length2 = object3.length; index < length2; index += 1) {
pair = object3[index];
keys2 = Object.keys(pair);
result[index] = [keys2[0], pair[keys2[0]]];
}
return result;
}
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;
}
function constructYamlSet(data5) {
return data5 !== null ? data5 : {};
}
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 escapedHexLen(c3) {
if (c3 === 120) {
return 2;
}
if (c3 === 117) {
return 4;
}
if (c3 === 85) {
return 8;
}
return 0;
}
function fromDecimalCode(c3) {
if (48 <= c3 && c3 <= 57) {
return c3 - 48;
}
return -1;
}
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" : "";
}
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, options2) {
this.input = input;
this.filename = options2["filename"] || null;
this.schema = options2["schema"] || _default;
this.onWarning = options2["onWarning"] || null;
this.legacy = options2["legacy"] || false;
this.json = options2["json"] || false;
this.listener = options2["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(state3, message) {
var mark = {
name: state3.filename,
buffer: state3.input.slice(0, -1),
// omit trailing \0
position: state3.position,
line: state3.line,
column: state3.position - state3.lineStart
};
mark.snippet = snippet(mark);
return new exception(message, mark);
}
function throwError(state3, message) {
throw generateError(state3, message);
}
function throwWarning(state3, message) {
if (state3.onWarning) {
state3.onWarning.call(null, generateError(state3, message));
}
}
function captureSegment(state3, start3, end2, checkJson) {
var _position, _length, _character, _result;
if (start3 < end2) {
_result = state3.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(state3, "expected valid JSON character");
}
}
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
throwError(state3, "the stream contains non-printable characters");
}
state3.result += _result;
}
}
function mergeMappings(state3, destination, source, overridableKeys) {
var sourceKeys, key, index, quantity;
if (!common.isObject(source)) {
throwError(state3, "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(state3, _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(state3, "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(state3, _result, valueNode[index], overridableKeys);
}
} else {
mergeMappings(state3, _result, valueNode, overridableKeys);
}
} else {
if (!state3.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
state3.line = startLine || state3.line;
state3.lineStart = startLineStart || state3.lineStart;
state3.position = startPos || state3.position;
throwError(state3, "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(state3) {
var ch;
ch = state3.input.charCodeAt(state3.position);
if (ch === 10) {
state3.position++;
} else if (ch === 13) {
state3.position++;
if (state3.input.charCodeAt(state3.position) === 10) {
state3.position++;
}
} else {
throwError(state3, "a line break is expected");
}
state3.line += 1;
state3.lineStart = state3.position;
state3.firstTabInLine = -1;
}
function skipSeparationSpace(state3, allowComments, checkIndent) {
var lineBreaks = 0, ch = state3.input.charCodeAt(state3.position);
while (ch !== 0) {
while (is_WHITE_SPACE(ch)) {
if (ch === 9 && state3.firstTabInLine === -1) {
state3.firstTabInLine = state3.position;
}
ch = state3.input.charCodeAt(++state3.position);
}
if (allowComments && ch === 35) {
do {
ch = state3.input.charCodeAt(++state3.position);
} while (ch !== 10 && ch !== 13 && ch !== 0);
}
if (is_EOL(ch)) {
readLineBreak(state3);
ch = state3.input.charCodeAt(state3.position);
lineBreaks++;
state3.lineIndent = 0;
while (ch === 32) {
state3.lineIndent++;
ch = state3.input.charCodeAt(++state3.position);
}
} else {
break;
}
}
if (checkIndent !== -1 && lineBreaks !== 0 && state3.lineIndent < checkIndent) {
throwWarning(state3, "deficient indentation");
}
return lineBreaks;
}
function testDocumentSeparator(state3) {
var _position = state3.position, ch;
ch = state3.input.charCodeAt(_position);
if ((ch === 45 || ch === 46) && ch === state3.input.charCodeAt(_position + 1) && ch === state3.input.charCodeAt(_position + 2)) {
_position += 3;
ch = state3.input.charCodeAt(_position);
if (ch === 0 || is_WS_OR_EOL(ch)) {
return true;
}
}
return false;
}
function writeFoldedLines(state3, count2) {
if (count2 === 1) {
state3.result += " ";
} else if (count2 > 1) {
state3.result += common.repeat("\n", count2 - 1);
}
}
function readPlainScalar(state3, nodeIndent, withinFlowCollection) {
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state3.kind, _result = state3.result, ch;
ch = state3.input.charCodeAt(state3.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 = state3.input.charCodeAt(state3.position + 1);
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
return false;
}
}
state3.kind = "scalar";
state3.result = "";
captureStart = captureEnd = state3.position;
hasPendingContent = false;
while (ch !== 0) {
if (ch === 58) {
following = state3.input.charCodeAt(state3.position + 1);
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
break;
}
} else if (ch === 35) {
preceding = state3.input.charCodeAt(state3.position - 1);
if (is_WS_OR_EOL(preceding)) {
break;
}
} else if (state3.position === state3.lineStart && testDocumentSeparator(state3) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
break;
} else if (is_EOL(ch)) {
_line = state3.line;
_lineStart = state3.lineStart;
_lineIndent = state3.lineIndent;
skipSeparationSpace(state3, false, -1);
if (state3.lineIndent >= nodeIndent) {
hasPendingContent = true;
ch = state3.input.charCodeAt(state3.position);
continue;
} else {
state3.position = captureEnd;
state3.line = _line;
state3.lineStart = _lineStart;
state3.lineIndent = _lineIndent;
break;
}
}
if (hasPendingContent) {
captureSegment(state3, captureStart, captureEnd, false);
writeFoldedLines(state3, state3.line - _line);
captureStart = captureEnd = state3.position;
hasPendingContent = false;
}
if (!is_WHITE_SPACE(ch)) {
captureEnd = state3.position + 1;
}
ch = state3.input.charCodeAt(++state3.position);
}
captureSegment(state3, captureStart, captureEnd, false);
if (state3.result) {
return true;
}
state3.kind = _kind;
state3.result = _result;
return false;
}
function readSingleQuotedScalar(state3, nodeIndent) {
var ch, captureStart, captureEnd;
ch = state3.input.charCodeAt(state3.position);
if (ch !== 39) {
return false;
}
state3.kind = "scalar";
state3.result = "";
state3.position++;
captureStart = captureEnd = state3.position;
while ((ch = state3.input.charCodeAt(state3.position)) !== 0) {
if (ch === 39) {
captureSegment(state3, captureStart, state3.position, true);
ch = state3.input.charCodeAt(++state3.position);
if (ch === 39) {
captureStart = state3.position;
state3.position++;
captureEnd = state3.position;
} else {
return true;
}
} else if (is_EOL(ch)) {
captureSegment(state3, captureStart, captureEnd, true);
writeFoldedLines(state3, skipSeparationSpace(state3, false, nodeIndent));
captureStart = captureEnd = state3.position;
} else if (state3.position === state3.lineStart && testDocumentSeparator(state3)) {
throwError(state3, "unexpected end of the document within a single quoted scalar");
} else {
state3.position++;
captureEnd = state3.position;
}
}
throwError(state3, "unexpected end of the stream within a single quoted scalar");
}
function readDoubleQuotedScalar(state3, nodeIndent) {
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
ch = state3.input.charCodeAt(state3.position);
if (ch !== 34) {
return false;
}
state3.kind = "scalar";
state3.result = "";
state3.position++;
captureStart = captureEnd = state3.position;
while ((ch = state3.input.charCodeAt(state3.position)) !== 0) {
if (ch === 34) {
captureSegment(state3, captureStart, state3.position, true);
state3.position++;
return true;
} else if (ch === 92) {
captureSegment(state3, captureStart, state3.position, true);
ch = state3.input.charCodeAt(++state3.position);
if (is_EOL(ch)) {
skipSeparationSpace(state3, false, nodeIndent);
} else if (ch < 256 && simpleEscapeCheck[ch]) {
state3.result += simpleEscapeMap[ch];
state3.position++;
} else if ((tmp = escapedHexLen(ch)) > 0) {
hexLength = tmp;
hexResult = 0;
for (; hexLength > 0; hexLength--) {
ch = state3.input.charCodeAt(++state3.position);
if ((tmp = fromHexCode(ch)) >= 0) {
hexResult = (hexResult << 4) + tmp;
} else {
throwError(state3, "expected hexadecimal character");
}
}
state3.result += charFromCodepoint(hexResult);
state3.position++;
} else {
throwError(state3, "unknown escape sequence");
}
captureStart = captureEnd = state3.position;
} else if (is_EOL(ch)) {
captureSegment(state3, captureStart, captureEnd, true);
writeFoldedLines(state3, skipSeparationSpace(state3, false, nodeIndent));
captureStart = captureEnd = state3.position;
} else if (state3.position === state3.lineStart && testDocumentSeparator(state3)) {
throwError(state3, "unexpected end of the document within a double quoted scalar");
} else {
state3.position++;
captureEnd = state3.position;
}
}
throwError(state3, "unexpected end of the stream within a double quoted scalar");
}
function readFlowCollection(state3, nodeIndent) {
var readNext = true, _line, _lineStart, _pos, _tag = state3.tag, _result, _anchor = state3.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
ch = state3.input.charCodeAt(state3.position);
if (ch === 91) {
terminator = 93;
isMapping = false;
_result = [];
} else if (ch === 123) {
terminator = 125;
isMapping = true;
_result = {};
} else {
return false;
}
if (state3.anchor !== null) {
state3.anchorMap[state3.anchor] = _result;
}
ch = state3.input.charCodeAt(++state3.position);
while (ch !== 0) {
skipSeparationSpace(state3, true, nodeIndent);
ch = state3.input.charCodeAt(state3.position);
if (ch === terminator) {
state3.position++;
state3.tag = _tag;
state3.anchor = _anchor;
state3.kind = isMapping ? "mapping" : "sequence";
state3.result = _result;
return true;
} else if (!readNext) {
throwError(state3, "missed comma between flow collection entries");
} else if (ch === 44) {
throwError(state3, "expected the node content, but found ','");
}
keyTag = keyNode = valueNode = null;
isPair = isExplicitPair = false;
if (ch === 63) {
following = state3.input.charCodeAt(state3.position + 1);
if (is_WS_OR_EOL(following)) {
isPair = isExplicitPair = true;
state3.position++;
skipSeparationSpace(state3, true, nodeIndent);
}
}
_line = state3.line;
_lineStart = state3.lineStart;
_pos = state3.position;
composeNode(state3, nodeIndent, CONTEXT_FLOW_IN, false, true);
keyTag = state3.tag;
keyNode = state3.result;
skipSeparationSpace(state3, true, nodeIndent);
ch = state3.input.charCodeAt(state3.position);
if ((isExplicitPair || state3.line === _line) && ch === 58) {
isPair = true;
ch = state3.input.charCodeAt(++state3.position);
skipSeparationSpace(state3, true, nodeIndent);
composeNode(state3, nodeIndent, CONTEXT_FLOW_IN, false, true);
valueNode = state3.result;
}
if (isMapping) {
storeMappingPair(state3, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
} else if (isPair) {
_result.push(storeMappingPair(state3, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
} else {
_result.push(keyNode);
}
skipSeparationSpace(state3, true, nodeIndent);
ch = state3.input.charCodeAt(state3.position);
if (ch === 44) {
readNext = true;
ch = state3.input.charCodeAt(++state3.position);
} else {
readNext = false;
}
}
throwError(state3, "unexpected end of the stream within a flow collection");
}
function readBlockScalar(state3, nodeIndent) {
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
ch = state3.input.charCodeAt(state3.position);
if (ch === 124) {
folding = false;
} else if (ch === 62) {
folding = true;
} else {
return false;
}
state3.kind = "scalar";
state3.result = "";
while (ch !== 0) {
ch = state3.input.charCodeAt(++state3.position);
if (ch === 43 || ch === 45) {
if (CHOMPING_CLIP === chomping) {
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
} else {
throwError(state3, "repeat of a chomping mode identifier");
}
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
if (tmp === 0) {
throwError(state3, "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(state3, "repeat of an indentation width identifier");
}
} else {
break;
}
}
if (is_WHITE_SPACE(ch)) {
do {
ch = state3.input.charCodeAt(++state3.position);
} while (is_WHITE_SPACE(ch));
if (ch === 35) {
do {
ch = state3.input.charCodeAt(++state3.position);
} while (!is_EOL(ch) && ch !== 0);
}
}
while (ch !== 0) {
readLineBreak(state3);
state3.lineIndent = 0;
ch = state3.input.charCodeAt(state3.position);
while ((!detectedIndent || state3.lineIndent < textIndent) && ch === 32) {
state3.lineIndent++;
ch = state3.input.charCodeAt(++state3.position);
}
if (!detectedIndent && state3.lineIndent > textIndent) {
textIndent = state3.lineIndent;
}
if (is_EOL(ch)) {
emptyLines++;
continue;
}
if (state3.lineIndent < textIndent) {
if (chomping === CHOMPING_KEEP) {
state3.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
} else if (chomping === CHOMPING_CLIP) {
if (didReadContent) {
state3.result += "\n";
}
}
break;
}
if (folding) {
if (is_WHITE_SPACE(ch)) {
atMoreIndented = true;
state3.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
} else if (atMoreIndented) {
atMoreIndented = false;
state3.result += common.repeat("\n", emptyLines + 1);
} else if (emptyLines === 0) {
if (didReadContent) {
state3.result += " ";
}
} else {
state3.result += common.repeat("\n", emptyLines);
}
} else {
state3.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
}
didReadContent = true;
detectedIndent = true;
emptyLines = 0;
captureStart = state3.position;
while (!is_EOL(ch) && ch !== 0) {
ch = state3.input.charCodeAt(++state3.position);
}
captureSegment(state3, captureStart, state3.position, false);
}
return true;
}
function readBlockSequence(state3, nodeIndent) {
var _line, _tag = state3.tag, _anchor = state3.anchor, _result = [], following, detected = false, ch;
if (state3.firstTabInLine !== -1) return false;
if (state3.anchor !== null) {
state3.anchorMap[state3.anchor] = _result;
}
ch = state3.input.charCodeAt(state3.position);
while (ch !== 0) {
if (state3.firstTabInLine !== -1) {
state3.position = state3.firstTabInLine;
throwError(state3, "tab characters must not be used in indentation");
}
if (ch !== 45) {
break;
}
following = state3.input.charCodeAt(state3.position + 1);
if (!is_WS_OR_EOL(following)) {
break;
}
detected = true;
state3.position++;
if (skipSeparationSpace(state3, true, -1)) {
if (state3.lineIndent <= nodeIndent) {
_result.push(null);
ch = state3.input.charCodeAt(state3.position);
continue;
}
}
_line = state3.line;
composeNode(state3, nodeIndent, CONTEXT_BLOCK_IN, false, true);
_result.push(state3.result);
skipSeparationSpace(state3, true, -1);
ch = state3.input.charCodeAt(state3.position);
if ((state3.line === _line || state3.lineIndent > nodeIndent) && ch !== 0) {
throwError(state3, "bad indentation of a sequence entry");
} else if (state3.lineIndent < nodeIndent) {
break;
}
}
if (detected) {
state3.tag = _tag;
state3.anchor = _anchor;
state3.kind = "sequence";
state3.result = _result;
return true;
}
return false;
}
function readBlockMapping(state3, nodeIndent, flowIndent) {
var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state3.tag, _anchor = state3.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
if (state3.firstTabInLine !== -1) return false;
if (state3.anchor !== null) {
state3.anchorMap[state3.anchor] = _result;
}
ch = state3.input.charCodeAt(state3.position);
while (ch !== 0) {
if (!atExplicitKey && state3.firstTabInLine !== -1) {
state3.position = state3.firstTabInLine;
throwError(state3, "tab characters must not be used in indentation");
}
following = state3.input.charCodeAt(state3.position + 1);
_line = state3.line;
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
if (ch === 63) {
if (atExplicitKey) {
storeMappingPair(state3, _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(state3, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
}
state3.position += 1;
ch = following;
} else {
_keyLine = state3.line;
_keyLineStart = state3.lineStart;
_keyPos = state3.position;
if (!composeNode(state3, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
break;
}
if (state3.line === _line) {
ch = state3.input.charCodeAt(state3.position);
while (is_WHITE_SPACE(ch)) {
ch = state3.input.charCodeAt(++state3.position);
}
if (ch === 58) {
ch = state3.input.charCodeAt(++state3.position);
if (!is_WS_OR_EOL(ch)) {
throwError(state3, "a whitespace character is expected after the key-value separator within a block mapping");
}
if (atExplicitKey) {
storeMappingPair(state3, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
keyTag = keyNode = valueNode = null;
}
detected = true;
atExplicitKey = false;
allowCompact = false;
keyTag = state3.tag;
keyNode = state3.result;
} else if (detected) {
throwError(state3, "can not read an implicit mapping pair; a colon is missed");
} else {
state3.tag = _tag;
state3.anchor = _anchor;
return true;
}
} else if (detected) {
throwError(state3, "can not read a block mapping entry; a multiline key may not be an implicit key");
} else {
state3.tag = _tag;
state3.anchor = _anchor;
return true;
}
}
if (state3.line === _line || state3.lineIndent > nodeIndent) {
if (atExplicitKey) {
_keyLine = state3.line;
_keyLineStart = state3.lineStart;
_keyPos = state3.position;
}
if (composeNode(state3, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
if (atExplicitKey) {
keyNode = state3.result;
} else {
valueNode = state3.result;
}
}
if (!atExplicitKey) {
storeMappingPair(state3, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
keyTag = keyNode = valueNode = null;
}
skipSeparationSpace(state3, true, -1);
ch = state3.input.charCodeAt(state3.position);
}
if ((state3.line === _line || state3.lineIndent > nodeIndent) && ch !== 0) {
throwError(state3, "bad indentation of a mapping entry");
} else if (state3.lineIndent < nodeIndent) {
break;
}
}
if (atExplicitKey) {
storeMappingPair(state3, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
}
if (detected) {
state3.tag = _tag;
state3.anchor = _anchor;
state3.kind = "mapping";
state3.result = _result;
}
return detected;
}
function readTagProperty(state3) {
var _position, isVerbatim = false, isNamed2 = false, tagHandle, tagName, ch;
ch = state3.input.charCodeAt(state3.position);
if (ch !== 33) return false;
if (state3.tag !== null) {
throwError(state3, "duplication of a tag property");
}
ch = state3.input.charCodeAt(++state3.position);
if (ch === 60) {
isVerbatim = true;
ch = state3.input.charCodeAt(++state3.position);
} else if (ch === 33) {
isNamed2 = true;
tagHandle = "!!";
ch = state3.input.charCodeAt(++state3.position);
} else {
tagHandle = "!";
}
_position = state3.position;
if (isVerbatim) {
do {
ch = state3.input.charCodeAt(++state3.position);
} while (ch !== 0 && ch !== 62);
if (state3.position < state3.length) {
tagName = state3.input.slice(_position, state3.position);
ch = state3.input.charCodeAt(++state3.position);
} else {
throwError(state3, "unexpected end of the stream within a verbatim tag");
}
} else {
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
if (ch === 33) {
if (!isNamed2) {
tagHandle = state3.input.slice(_position - 1, state3.position + 1);
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
throwError(state3, "named tag handle cannot contain such characters");
}
isNamed2 = true;
_position = state3.position + 1;
} else {
throwError(state3, "tag suffix cannot contain exclamation marks");
}
}
ch = state3.input.charCodeAt(++state3.position);
}
tagName = state3.input.slice(_position, state3.position);
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
throwError(state3, "tag suffix cannot contain flow indicator characters");
}
}
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
throwError(state3, "tag name cannot contain such characters: " + tagName);
}
try {
tagName = decodeURIComponent(tagName);
} catch (err) {
throwError(state3, "tag name is malformed: " + tagName);
}
if (isVerbatim) {
state3.tag = tagName;
} else if (_hasOwnProperty$1.call(state3.tagMap, tagHandle)) {
state3.tag = state3.tagMap[tagHandle] + tagName;
} else if (tagHandle === "!") {
state3.tag = "!" + tagName;
} else if (tagHandle === "!!") {
state3.tag = "tag:yaml.org,2002:" + tagName;
} else {
throwError(state3, 'undeclared tag handle "' + tagHandle + '"');
}
return true;
}
function readAnchorProperty(state3) {
var _position, ch;
ch = state3.input.charCodeAt(state3.position);
if (ch !== 38) return false;
if (state3.anchor !== null) {
throwError(state3, "duplication of an anchor property");
}
ch = state3.input.charCodeAt(++state3.position);
_position = state3.position;
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
ch = state3.input.charCodeAt(++state3.position);
}
if (state3.position === _position) {
throwError(state3, "name of an anchor node must contain at least one character");
}
state3.anchor = state3.input.slice(_position, state3.position);
return true;
}
function readAlias(state3) {
var _position, alias, ch;
ch = state3.input.charCodeAt(state3.position);
if (ch !== 42) return false;
ch = state3.input.charCodeAt(++state3.position);
_position = state3.position;
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
ch = state3.input.charCodeAt(++state3.position);
}
if (state3.position === _position) {
throwError(state3, "name of an alias node must contain at least one character");
}
alias = state3.input.slice(_position, state3.position);
if (!_hasOwnProperty$1.call(state3.anchorMap, alias)) {
throwError(state3, 'unidentified alias "' + alias + '"');
}
state3.result = state3.anchorMap[alias];
skipSeparationSpace(state3, true, -1);
return true;
}
function composeNode(state3, parentIndent, nodeContext, allowToSeek, allowCompact) {
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type3, flowIndent, blockIndent;
if (state3.listener !== null) {
state3.listener("open", state3);
}
state3.tag = null;
state3.anchor = null;
state3.kind = null;
state3.result = null;
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
if (allowToSeek) {
if (skipSeparationSpace(state3, true, -1)) {
atNewLine = true;
if (state3.lineIndent > parentIndent) {
indentStatus = 1;
} else if (state3.lineIndent === parentIndent) {
indentStatus = 0;
} else if (state3.lineIndent < parentIndent) {
indentStatus = -1;
}
}
}
if (indentStatus === 1) {
while (readTagProperty(state3) || readAnchorProperty(state3)) {
if (skipSeparationSpace(state3, true, -1)) {
atNewLine = true;
allowBlockCollections = allowBlockStyles;
if (state3.lineIndent > parentIndent) {
indentStatus = 1;
} else if (state3.lineIndent === parentIndent) {
indentStatus = 0;
} else if (state3.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 = state3.position - state3.lineStart;
if (indentStatus === 1) {
if (allowBlockCollections && (readBlockSequence(state3, blockIndent) || readBlockMapping(state3, blockIndent, flowIndent)) || readFlowCollection(state3, flowIndent)) {
hasContent = true;
} else {
if (allowBlockScalars && readBlockScalar(state3, flowIndent) || readSingleQuotedScalar(state3, flowIndent) || readDoubleQuotedScalar(state3, flowIndent)) {
hasContent = true;
} else if (readAlias(state3)) {
hasContent = true;
if (state3.tag !== null || state3.anchor !== null) {
throwError(state3, "alias node should not have any properties");
}
} else if (readPlainScalar(state3, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
hasContent = true;
if (state3.tag === null) {
state3.tag = "?";
}
}
if (state3.anchor !== null) {
state3.anchorMap[state3.anchor] = state3.result;
}
}
} else if (indentStatus === 0) {
hasContent = allowBlockCollections && readBlockSequence(state3, blockIndent);
}
}
if (state3.tag === null) {
if (state3.anchor !== null) {
state3.anchorMap[state3.anchor] = state3.result;
}
} else if (state3.tag === "?") {
if (state3.result !== null && state3.kind !== "scalar") {
throwError(state3, 'unacceptable node kind for !> tag; it should be "scalar", not "' + state3.kind + '"');
}
for (typeIndex = 0, typeQuantity = state3.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
type3 = state3.implicitTypes[typeIndex];
if (type3.resolve(state3.result)) {
state3.result = type3.construct(state3.result);
state3.tag = type3.tag;
if (state3.anchor !== null) {
state3.anchorMap[state3.anchor] = state3.result;
}
break;
}
}
} else if (state3.tag !== "!") {
if (_hasOwnProperty$1.call(state3.typeMap[state3.kind || "fallback"], state3.tag)) {
type3 = state3.typeMap[state3.kind || "fallback"][state3.tag];
} else {
type3 = null;
typeList = state3.typeMap.multi[state3.kind || "fallback"];
for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
if (state3.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
type3 = typeList[typeIndex];
break;
}
}
}
if (!type3) {
throwError(state3, "unknown tag !<" + state3.tag + ">");
}
if (state3.result !== null && type3.kind !== state3.kind) {
throwError(state3, "unacceptable node kind for !<" + state3.tag + '> tag; it should be "' + type3.kind + '", not "' + state3.kind + '"');
}
if (!type3.resolve(state3.result, state3.tag)) {
throwError(state3, "cannot resolve a node with !<" + state3.tag + "> explicit tag");
} else {
state3.result = type3.construct(state3.result, state3.tag);
if (state3.anchor !== null) {
state3.anchorMap[state3.anchor] = state3.result;
}
}
}
if (state3.listener !== null) {
state3.listener("close", state3);
}
return state3.tag !== null || state3.anchor !== null || hasContent;
}
function readDocument(state3) {
var documentStart = state3.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
state3.version = null;
state3.checkLineBreaks = state3.legacy;
state3.tagMap = /* @__PURE__ */ Object.create(null);
state3.anchorMap = /* @__PURE__ */ Object.create(null);
while ((ch = state3.input.charCodeAt(state3.position)) !== 0) {
skipSeparationSpace(state3, true, -1);
ch = state3.input.charCodeAt(state3.position);
if (state3.lineIndent > 0 || ch !== 37) {
break;
}
hasDirectives = true;
ch = state3.input.charCodeAt(++state3.position);
_position = state3.position;
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
ch = state3.input.charCodeAt(++state3.position);
}
directiveName = state3.input.slice(_position, state3.position);
directiveArgs = [];
if (directiveName.length < 1) {
throwError(state3, "directive name must not be less than one character in length");
}
while (ch !== 0) {
while (is_WHITE_SPACE(ch)) {
ch = state3.input.charCodeAt(++state3.position);
}
if (ch === 35) {
do {
ch = state3.input.charCodeAt(++state3.position);
} while (ch !== 0 && !is_EOL(ch));
break;
}
if (is_EOL(ch)) break;
_position = state3.position;
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
ch = state3.input.charCodeAt(++state3.position);
}
directiveArgs.push(state3.input.slice(_position, state3.position));
}
if (ch !== 0) readLineBreak(state3);
if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
directiveHandlers[directiveName](state3, directiveName, directiveArgs);
} else {
throwWarning(state3, 'unknown document directive "' + directiveName + '"');
}
}
skipSeparationSpace(state3, true, -1);
if (state3.lineIndent === 0 && state3.input.charCodeAt(state3.position) === 45 && state3.input.charCodeAt(state3.position + 1) === 45 && state3.input.charCodeAt(state3.position + 2) === 45) {
state3.position += 3;
skipSeparationSpace(state3, true, -1);
} else if (hasDirectives) {
throwError(state3, "directives end mark is expected");
}
composeNode(state3, state3.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
skipSeparationSpace(state3, true, -1);
if (state3.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state3.input.slice(documentStart, state3.position))) {
throwWarning(state3, "non-ASCII line breaks are interpreted as content");
}
state3.documents.push(state3.result);
if (state3.position === state3.lineStart && testDocumentSeparator(state3)) {
if (state3.input.charCodeAt(state3.position) === 46) {
state3.position += 3;
skipSeparationSpace(state3, true, -1);
}
return;
}
if (state3.position < state3.length - 1) {
throwError(state3, "end of the stream or a document separator is expected");
} else {
return;
}
}
function loadDocuments(input, options2) {
input = String(input);
options2 = options2 || {};
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 state3 = new State$1(input, options2);
var nullpos = input.indexOf("\0");
if (nullpos !== -1) {
state3.position = nullpos;
throwError(state3, "null byte is not allowed in input");
}
state3.input += "\0";
while (state3.input.charCodeAt(state3.position) === 32) {
state3.lineIndent += 1;
state3.position += 1;
}
while (state3.position < state3.length - 1) {
readDocument(state3);
}
return state3.documents;
}
function loadAll$1(input, iterator, options2) {
if (iterator !== null && typeof iterator === "object" && typeof options2 === "undefined") {
options2 = iterator;
iterator = null;
}
var documents = loadDocuments(input, options2);
if (typeof iterator !== "function") {
return documents;
}
for (var index = 0, length2 = documents.length; index < length2; index += 1) {
iterator(documents[index]);
}
}
function load$1(input, options2) {
var documents = loadDocuments(input, options2);
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, keys2, index, length2, tag, style3, type3;
if (map5 === null) return {};
result = {};
keys2 = Object.keys(map5);
for (index = 0, length2 = keys2.length; index < length2; index += 1) {
tag = keys2[index];
style3 = String(map5[tag]);
if (tag.slice(0, 2) === "!!") {
tag = "tag:yaml.org,2002:" + tag.slice(2);
}
type3 = schema2.compiledTypeMap["fallback"][tag];
if (type3 && _hasOwnProperty.call(type3.styleAliases, style3)) {
style3 = type3.styleAliases[style3];
}
result[tag] = 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(options2) {
this.schema = options2["schema"] || _default;
this.indent = Math.max(1, options2["indent"] || 2);
this.noArrayIndent = options2["noArrayIndent"] || false;
this.skipInvalid = options2["skipInvalid"] || false;
this.flowLevel = common.isNothing(options2["flowLevel"]) ? -1 : options2["flowLevel"];
this.styleMap = compileStyleMap(this.schema, options2["styles"] || null);
this.sortKeys = options2["sortKeys"] || false;
this.lineWidth = options2["lineWidth"] || 80;
this.noRefs = options2["noRefs"] || false;
this.noCompatMode = options2["noCompatMode"] || false;
this.condenseFlow = options2["condenseFlow"] || false;
this.quotingType = options2["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
this.forceQuotes = options2["forceQuotes"] || false;
this.replacer = typeof options2["replacer"] === "function" ? options2["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(state3, level) {
return "\n" + common.repeat(" ", state3.indent * level);
}
function testImplicitResolving(state3, str2) {
var index, length2, type3;
for (index = 0, length2 = state3.implicitTypes.length; index < length2; index += 1) {
type3 = state3.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(state3, string3, level, iskey, inblock) {
state3.dump = (function() {
if (string3.length === 0) {
return state3.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
}
if (!state3.noCompatMode) {
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string3) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string3)) {
return state3.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string3 + '"' : "'" + string3 + "'";
}
}
var indent = state3.indent * Math.max(1, level);
var lineWidth = state3.lineWidth === -1 ? -1 : Math.max(Math.min(state3.lineWidth, 40), state3.lineWidth - indent);
var singleLineOnly = iskey || state3.flowLevel > -1 && level >= state3.flowLevel;
function testAmbiguity(string4) {
return testImplicitResolving(state3, string4);
}
__name(testAmbiguity, "testAmbiguity");
switch (chooseScalarStyle(
string3,
singleLineOnly,
state3.indent,
lineWidth,
testAmbiguity,
state3.quotingType,
state3.forceQuotes && !iskey,
inblock
)) {
case STYLE_PLAIN:
return string3;
case STYLE_SINGLE:
return "'" + string3.replace(/'/g, "''") + "'";
case STYLE_LITERAL:
return "|" + blockHeader(string3, state3.indent) + dropEndingNewline(indentString(string3, indent));
case STYLE_FOLDED:
return ">" + blockHeader(string3, state3.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(state3, level, object3) {
var _result = "", _tag = state3.tag, index, length2, value2;
for (index = 0, length2 = object3.length; index < length2; index += 1) {
value2 = object3[index];
if (state3.replacer) {
value2 = state3.replacer.call(object3, String(index), value2);
}
if (writeNode(state3, level, value2, false, false) || typeof value2 === "undefined" && writeNode(state3, level, null, false, false)) {
if (_result !== "") _result += "," + (!state3.condenseFlow ? " " : "");
_result += state3.dump;
}
}
state3.tag = _tag;
state3.dump = "[" + _result + "]";
}
function writeBlockSequence(state3, level, object3, compact2) {
var _result = "", _tag = state3.tag, index, length2, value2;
for (index = 0, length2 = object3.length; index < length2; index += 1) {
value2 = object3[index];
if (state3.replacer) {
value2 = state3.replacer.call(object3, String(index), value2);
}
if (writeNode(state3, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode(state3, level + 1, null, true, true, false, true)) {
if (!compact2 || _result !== "") {
_result += generateNextLine(state3, level);
}
if (state3.dump && CHAR_LINE_FEED === state3.dump.charCodeAt(0)) {
_result += "-";
} else {
_result += "- ";
}
_result += state3.dump;
}
}
state3.tag = _tag;
state3.dump = _result || "[]";
}
function writeFlowMapping(state3, level, object3) {
var _result = "", _tag = state3.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 (state3.condenseFlow) pairBuffer += '"';
objectKey = objectKeyList[index];
objectValue = object3[objectKey];
if (state3.replacer) {
objectValue = state3.replacer.call(object3, objectKey, objectValue);
}
if (!writeNode(state3, level, objectKey, false, false)) {
continue;
}
if (state3.dump.length > 1024) pairBuffer += "? ";
pairBuffer += state3.dump + (state3.condenseFlow ? '"' : "") + ":" + (state3.condenseFlow ? "" : " ");
if (!writeNode(state3, level, objectValue, false, false)) {
continue;
}
pairBuffer += state3.dump;
_result += pairBuffer;
}
state3.tag = _tag;
state3.dump = "{" + _result + "}";
}
function writeBlockMapping(state3, level, object3, compact2) {
var _result = "", _tag = state3.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, explicitPair, pairBuffer;
if (state3.sortKeys === true) {
objectKeyList.sort();
} else if (typeof state3.sortKeys === "function") {
objectKeyList.sort(state3.sortKeys);
} else if (state3.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(state3, level);
}
objectKey = objectKeyList[index];
objectValue = object3[objectKey];
if (state3.replacer) {
objectValue = state3.replacer.call(object3, objectKey, objectValue);
}
if (!writeNode(state3, level + 1, objectKey, true, true, true)) {
continue;
}
explicitPair = state3.tag !== null && state3.tag !== "?" || state3.dump && state3.dump.length > 1024;
if (explicitPair) {
if (state3.dump && CHAR_LINE_FEED === state3.dump.charCodeAt(0)) {
pairBuffer += "?";
} else {
pairBuffer += "? ";
}
}
pairBuffer += state3.dump;
if (explicitPair) {
pairBuffer += generateNextLine(state3, level);
}
if (!writeNode(state3, level + 1, objectValue, true, explicitPair)) {
continue;
}
if (state3.dump && CHAR_LINE_FEED === state3.dump.charCodeAt(0)) {
pairBuffer += ":";
} else {
pairBuffer += ": ";
}
pairBuffer += state3.dump;
_result += pairBuffer;
}
state3.tag = _tag;
state3.dump = _result || "{}";
}
function detectType2(state3, object3, explicit) {
var _result, typeList, index, length2, type3, style3;
typeList = explicit ? state3.explicitTypes : state3.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) {
state3.tag = type3.representName(object3);
} else {
state3.tag = type3.tag;
}
} else {
state3.tag = "?";
}
if (type3.represent) {
style3 = state3.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');
}
state3.dump = _result;
}
return true;
}
}
return false;
}
function writeNode(state3, level, object3, block2, compact2, iskey, isblockseq) {
state3.tag = null;
state3.dump = object3;
if (!detectType2(state3, object3, false)) {
detectType2(state3, object3, true);
}
var type3 = _toString.call(state3.dump);
var inblock = block2;
var tagStr;
if (block2) {
block2 = state3.flowLevel < 0 || state3.flowLevel > level;
}
var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate;
if (objectOrArray) {
duplicateIndex = state3.duplicates.indexOf(object3);
duplicate = duplicateIndex !== -1;
}
if (state3.tag !== null && state3.tag !== "?" || duplicate || state3.indent !== 2 && level > 0) {
compact2 = false;
}
if (duplicate && state3.usedDuplicates[duplicateIndex]) {
state3.dump = "*ref_" + duplicateIndex;
} else {
if (objectOrArray && duplicate && !state3.usedDuplicates[duplicateIndex]) {
state3.usedDuplicates[duplicateIndex] = true;
}
if (type3 === "[object Object]") {
if (block2 && Object.keys(state3.dump).length !== 0) {
writeBlockMapping(state3, level, state3.dump, compact2);
if (duplicate) {
state3.dump = "&ref_" + duplicateIndex + state3.dump;
}
} else {
writeFlowMapping(state3, level, state3.dump);
if (duplicate) {
state3.dump = "&ref_" + duplicateIndex + " " + state3.dump;
}
}
} else if (type3 === "[object Array]") {
if (block2 && state3.dump.length !== 0) {
if (state3.noArrayIndent && !isblockseq && level > 0) {
writeBlockSequence(state3, level - 1, state3.dump, compact2);
} else {
writeBlockSequence(state3, level, state3.dump, compact2);
}
if (duplicate) {
state3.dump = "&ref_" + duplicateIndex + state3.dump;
}
} else {
writeFlowSequence(state3, level, state3.dump);
if (duplicate) {
state3.dump = "&ref_" + duplicateIndex + " " + state3.dump;
}
}
} else if (type3 === "[object String]") {
if (state3.tag !== "?") {
writeScalar(state3, state3.dump, level, iskey, inblock);
}
} else if (type3 === "[object Undefined]") {
return false;
} else {
if (state3.skipInvalid) return false;
throw new exception("unacceptable kind of an object to dump " + type3);
}
if (state3.tag !== null && state3.tag !== "?") {
tagStr = encodeURI(
state3.tag[0] === "!" ? state3.tag.slice(1) : state3.tag
).replace(/!/g, "%21");
if (state3.tag[0] === "!") {
tagStr = "!" + tagStr;
} else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
tagStr = "!!" + tagStr.slice(18);
} else {
tagStr = "!<" + tagStr + ">";
}
state3.dump = tagStr + " " + state3.dump;
}
}
return true;
}
function getDuplicateReferences(object3, state3) {
var objects = [], duplicatesIndexes = [], index, length2;
inspectNode(object3, objects, duplicatesIndexes);
for (index = 0, length2 = duplicatesIndexes.length; index < length2; index += 1) {
state3.duplicates.push(objects[duplicatesIndexes[index]]);
}
state3.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, options2) {
options2 = options2 || {};
var state3 = new State(options2);
if (!state3.noRefs) getDuplicateReferences(input, state3);
var value2 = input;
if (state3.replacer) {
value2 = state3.replacer.call({ "": value2 }, "", value2);
}
if (writeNode(state3, 0, value2, true, true)) return state3.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(data5) {
return data5 !== null ? data5 : "";
}, "construct")
});
seq = new type2("tag:yaml.org,2002:seq", {
kind: "sequence",
construct: /* @__PURE__ */ __name(function(data5) {
return data5 !== null ? data5 : [];
}, "construct")
});
map2 = new type2("tag:yaml.org,2002:map", {
kind: "mapping",
construct: /* @__PURE__ */ __name(function(data5) {
return data5 !== null ? data5 : {};
}, "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(state3, name, args) {
var match2, major, minor;
if (state3.version !== null) {
throwError(state3, "duplication of %YAML directive");
}
if (args.length !== 1) {
throwError(state3, "YAML directive accepts exactly one argument");
}
match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
if (match2 === null) {
throwError(state3, "ill-formed argument of the YAML directive");
}
major = parseInt(match2[1], 10);
minor = parseInt(match2[2], 10);
if (major !== 1) {
throwError(state3, "unacceptable YAML version of the document");
}
state3.version = args[0];
state3.checkLineBreaks = minor < 2;
if (minor !== 1 && minor !== 2) {
throwWarning(state3, "unsupported YAML version of the document");
}
}, "handleYamlDirective"),
TAG: /* @__PURE__ */ __name(function handleTagDirective(state3, name, args) {
var handle, prefix;
if (args.length !== 2) {
throwError(state3, "TAG directive accepts exactly two arguments");
}
handle = args[0];
prefix = args[1];
if (!PATTERN_TAG_HANDLE.test(handle)) {
throwError(state3, "ill-formed tag handle (first argument) of the TAG directive");
}
if (_hasOwnProperty$1.call(state3.tagMap, handle)) {
throwError(state3, 'there is a previously declared suffix for "' + handle + '" tag handle');
}
if (!PATTERN_TAG_URI.test(prefix)) {
throwError(state3, "ill-formed tag prefix (second argument) of the TAG directive");
}
try {
prefix = decodeURIComponent(prefix);
} catch (err) {
throwError(state3, "tag prefix is malformed: " + prefix);
}
state3.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@16.3.0/node_modules/marked/lib/marked.esm.js
function L() {
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
}
function G(l4) {
O = l4;
}
function h(l4, e3 = "") {
let t4 = typeof l4 == "string" ? l4 : l4.source, n2 = { replace: /* @__PURE__ */ __name((r2, i2) => {
let s2 = typeof i2 == "string" ? i2 : i2.source;
return s2 = s2.replace(m.caret, "$1"), t4 = t4.replace(r2, s2), n2;
}, "replace"), getRegex: /* @__PURE__ */ __name(() => new RegExp(t4, e3), "getRegex") };
return n2;
}
function w(l4, e3) {
if (e3) {
if (m.escapeTest.test(l4)) return l4.replace(m.escapeReplace, ke);
} else if (m.escapeTestNoEncode.test(l4)) return l4.replace(m.escapeReplaceNoEncode, ke);
return l4;
}
function J(l4) {
try {
l4 = encodeURI(l4).replace(m.percentDecode, "%");
} catch {
return null;
}
return l4;
}
function V(l4, e3) {
let t4 = l4.replace(m.findPipe, (i2, s2, o2) => {
let a2 = false, u2 = s2;
for (; --u2 >= 0 && o2[u2] === "\\"; ) a2 = !a2;
return a2 ? "|" : " |";
}), n2 = t4.split(m.splitPipe), r2 = 0;
if (n2[0].trim() || n2.shift(), n2.length > 0 && !n2.at(-1)?.trim() && n2.pop(), e3) if (n2.length > e3) n2.splice(e3);
else for (; n2.length < e3; ) n2.push("");
for (; r2 < n2.length; r2++) n2[r2] = n2[r2].trim().replace(m.slashPipe, "|");
return n2;
}
function z(l4, e3, t4) {
let n2 = l4.length;
if (n2 === 0) return "";
let r2 = 0;
for (; r2 < n2; ) {
let i2 = l4.charAt(n2 - r2 - 1);
if (i2 === e3 && !t4) r2++;
else if (i2 !== e3 && t4) r2++;
else break;
}
return l4.slice(0, n2 - r2);
}
function ge(l4, e3) {
if (l4.indexOf(e3[1]) === -1) return -1;
let t4 = 0;
for (let n2 = 0; n2 < l4.length; n2++) if (l4[n2] === "\\") n2++;
else if (l4[n2] === e3[0]) t4++;
else if (l4[n2] === e3[1] && (t4--, t4 < 0)) return n2;
return t4 > 0 ? -2 : -1;
}
function fe(l4, e3, t4, n2, r2) {
let i2 = e3.href, s2 = e3.title || null, o2 = l4[1].replace(r2.other.outputLinkReplace, "$1");
n2.state.inLink = true;
let a2 = { type: l4[0].charAt(0) === "!" ? "image" : "link", raw: t4, href: i2, title: s2, text: o2, tokens: n2.inlineTokens(o2) };
return n2.state.inLink = false, a2;
}
function Je(l4, e3, t4) {
let n2 = l4.match(t4.other.indentCodeCompensation);
if (n2 === null) return e3;
let r2 = n2[1];
return e3.split(`
`).map((i2) => {
let s2 = i2.match(t4.other.beginningSpace);
if (s2 === null) return i2;
let [o2] = s2;
return o2.length >= r2.length ? i2.slice(r2.length) : i2;
}).join(`
`);
}
function d(l4, e3) {
return _.parse(l4, e3);
}
var O, E, m, xe, be, Re, C, Oe, j, se, ie, Te, F, we, Q, ye, Pe, v, U, Se, oe, $e, K2, re2, _e, Le, Me, ze, ae, Ae, D2, W, le, Ee, ue, Ce, Ie, Be, pe, qe, ve, ce, De, He, Ze, Ge, Ne, je, Fe, q, Qe, he, de, Ue, X2, Ke, N, We, I, M, Xe, ke, y2, b, P, $, R, S2, B, _, Dt, Ht, Zt, Gt, Nt, Ft, Qt;
var init_marked_esm = __esm({
"../../node_modules/.pnpm/marked@16.3.0/node_modules/marked/lib/marked.esm.js"() {
"use strict";
__name(L, "L");
O = L();
__name(G, "G");
E = { exec: /* @__PURE__ */ __name(() => null, "exec") };
__name(h, "h");
m = { 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((l4) => new RegExp(`^( {0,3}${l4})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ __name((l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ __name((l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ __name((l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ __name((l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ __name((l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex") };
xe = /^(?:[ \t]*(?:\n|$))+/;
be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
j = /(?:[*+-]|\d{1,9}[.)])/;
se = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
ie = h(se).replace(/bull/g, j).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();
Te = h(se).replace(/bull/g, j).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();
F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
we = /^[^\n]+/;
Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
ye = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
Pe = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, j).getRegex();
v = "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";
U = /|$))/;
Se = h("^ {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", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
oe = h(F).replace("hr", C).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", v).getRegex();
$e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex();
K2 = { blockquote: $e, code: be, def: ye, fences: Re, heading: Oe, hr: C, html: Se, lheading: ie, list: Pe, newline: xe, paragraph: oe, table: E, text: we };
re2 = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", C).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", v).getRegex();
_e = { ...K2, lheading: Te, table: re2, paragraph: h(F).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re2).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", v).getRegex() };
Le = { ...K2, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).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: E, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(F).replace("hr", C).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
ae = /^( {2,}|\\)\n(?!\s*$)/;
Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g;
pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
qe = h(pe, "u").replace(/punct/g, D2).getRegex();
ve = h(pe, "u").replace(/punct/g, ue).getRegex();
ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
De = h(ce, "gu").replace(/notPunctSpace/g, le).replace(/punctSpace/g, W).replace(/punct/g, D2).getRegex();
He = h(ce, "gu").replace(/notPunctSpace/g, Ie).replace(/punctSpace/g, Ce).replace(/punct/g, ue).getRegex();
Ze = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, le).replace(/punctSpace/g, W).replace(/punct/g, D2).getRegex();
Ge = h(/\\(punct)/, "gu").replace(/punct/g, D2).getRegex();
Ne = h(/^<(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();
je = h(U).replace("(?:-->|$)", "-->").getRegex();
Fe = h("^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/;
Qe = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
he = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex();
de = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex();
Ue = h("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", de).getRegex();
X2 = { _backpedal: E, anyPunctuation: Ge, autolink: Ne, blockSkip: Be, br: ae, code: ze, del: E, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ze, escape: Me, link: Qe, nolink: de, punctuation: Ee, reflink: he, reflinkSearch: Ue, tag: Fe, text: Ae, url: E };
Ke = { ...X2, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
N = { ...X2, emStrongRDelimAst: He, emStrongLDelim: ve, url: h(/^((?: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\S]|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\": ">", '"': """, "'": "'" };
ke = /* @__PURE__ */ __name((l4) => Xe[l4], "ke");
__name(w, "w");
__name(J, "J");
__name(V, "V");
__name(z, "z");
__name(ge, "ge");
__name(fe, "fe");
__name(Je, "Je");
y2 = class {
static {
__name(this, "y");
}
options;
rules;
lexer;
constructor(e3) {
this.options = e3 || O;
}
space(e3) {
let t4 = this.rules.block.newline.exec(e3);
if (t4 && t4[0].length > 0) return { type: "space", raw: t4[0] };
}
code(e3) {
let t4 = this.rules.block.code.exec(e3);
if (t4) {
let n2 = t4[0].replace(this.rules.other.codeRemoveIndent, "");
return { type: "code", raw: t4[0], codeBlockStyle: "indented", text: this.options.pedantic ? n2 : z(n2, `
`) };
}
}
fences(e3) {
let t4 = this.rules.block.fences.exec(e3);
if (t4) {
let n2 = t4[0], r2 = Je(n2, t4[3] || "", this.rules);
return { type: "code", raw: n2, lang: t4[2] ? t4[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t4[2], text: r2 };
}
}
heading(e3) {
let t4 = this.rules.block.heading.exec(e3);
if (t4) {
let n2 = t4[2].trim();
if (this.rules.other.endingHash.test(n2)) {
let r2 = z(n2, "#");
(this.options.pedantic || !r2 || this.rules.other.endingSpaceChar.test(r2)) && (n2 = r2.trim());
}
return { type: "heading", raw: t4[0], depth: t4[1].length, text: n2, tokens: this.lexer.inline(n2) };
}
}
hr(e3) {
let t4 = this.rules.block.hr.exec(e3);
if (t4) return { type: "hr", raw: z(t4[0], `
`) };
}
blockquote(e3) {
let t4 = this.rules.block.blockquote.exec(e3);
if (t4) {
let n2 = z(t4[0], `
`).split(`
`), r2 = "", i2 = "", s2 = [];
for (; n2.length > 0; ) {
let o2 = false, a2 = [], u2;
for (u2 = 0; u2 < n2.length; u2++) if (this.rules.other.blockquoteStart.test(n2[u2])) a2.push(n2[u2]), o2 = true;
else if (!o2) a2.push(n2[u2]);
else break;
n2 = n2.slice(u2);
let p3 = a2.join(`
`), c3 = p3.replace(this.rules.other.blockquoteSetextReplace, `
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
r2 = r2 ? `${r2}
${p3}` : p3, i2 = i2 ? `${i2}
${c3}` : c3;
let f2 = this.lexer.state.top;
if (this.lexer.state.top = true, this.lexer.blockTokens(c3, s2, true), this.lexer.state.top = f2, n2.length === 0) break;
let k2 = s2.at(-1);
if (k2?.type === "code") break;
if (k2?.type === "blockquote") {
let x5 = k2, g2 = x5.raw + `
` + n2.join(`
`), T3 = this.blockquote(g2);
s2[s2.length - 1] = T3, r2 = r2.substring(0, r2.length - x5.raw.length) + T3.raw, i2 = i2.substring(0, i2.length - x5.text.length) + T3.text;
break;
} else if (k2?.type === "list") {
let x5 = k2, g2 = x5.raw + `
` + n2.join(`
`), T3 = this.list(g2);
s2[s2.length - 1] = T3, r2 = r2.substring(0, r2.length - k2.raw.length) + T3.raw, i2 = i2.substring(0, i2.length - x5.raw.length) + T3.raw, n2 = g2.substring(s2.at(-1).raw.length).split(`
`);
continue;
}
}
return { type: "blockquote", raw: r2, tokens: s2, text: i2 };
}
}
list(e3) {
let t4 = this.rules.block.list.exec(e3);
if (t4) {
let n2 = t4[1].trim(), r2 = n2.length > 1, i2 = { type: "list", raw: "", ordered: r2, start: r2 ? +n2.slice(0, -1) : "", loose: false, items: [] };
n2 = r2 ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = r2 ? n2 : "[*+-]");
let s2 = this.rules.other.listItemRegex(n2), o2 = false;
for (; e3; ) {
let u2 = false, p3 = "", c3 = "";
if (!(t4 = s2.exec(e3)) || this.rules.block.hr.test(e3)) break;
p3 = t4[0], e3 = e3.substring(p3.length);
let f2 = t4[2].split(`
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H2) => " ".repeat(3 * H2.length)), k2 = e3.split(`
`, 1)[0], x5 = !f2.trim(), g2 = 0;
if (this.options.pedantic ? (g2 = 2, c3 = f2.trimStart()) : x5 ? g2 = t4[1].length + 1 : (g2 = t4[2].search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c3 = f2.slice(g2), g2 += t4[1].length), x5 && this.rules.other.blankLine.test(k2) && (p3 += k2 + `
`, e3 = e3.substring(k2.length + 1), u2 = true), !u2) {
let H2 = this.rules.other.nextBulletRegex(g2), ee = this.rules.other.hrRegex(g2), te = this.rules.other.fencesBeginRegex(g2), ne = this.rules.other.headingBeginRegex(g2), me = this.rules.other.htmlBeginRegex(g2);
for (; e3; ) {
let Z2 = e3.split(`
`, 1)[0], A2;
if (k2 = Z2, this.options.pedantic ? (k2 = k2.replace(this.rules.other.listReplaceNesting, " "), A2 = k2) : A2 = k2.replace(this.rules.other.tabCharGlobal, " "), te.test(k2) || ne.test(k2) || me.test(k2) || H2.test(k2) || ee.test(k2)) break;
if (A2.search(this.rules.other.nonSpaceChar) >= g2 || !k2.trim()) c3 += `
` + A2.slice(g2);
else {
if (x5 || f2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(f2) || ne.test(f2) || ee.test(f2)) break;
c3 += `
` + k2;
}
!x5 && !k2.trim() && (x5 = true), p3 += Z2 + `
`, e3 = e3.substring(Z2.length + 1), f2 = A2.slice(g2);
}
}
i2.loose || (o2 ? i2.loose = true : this.rules.other.doubleBlankLine.test(p3) && (o2 = true));
let T3 = null, Y3;
this.options.gfm && (T3 = this.rules.other.listIsTask.exec(c3), T3 && (Y3 = T3[0] !== "[ ] ", c3 = c3.replace(this.rules.other.listReplaceTask, ""))), i2.items.push({ type: "list_item", raw: p3, task: !!T3, checked: Y3, loose: false, text: c3, tokens: [] }), i2.raw += p3;
}
let a2 = i2.items.at(-1);
if (a2) a2.raw = a2.raw.trimEnd(), a2.text = a2.text.trimEnd();
else return;
i2.raw = i2.raw.trimEnd();
for (let u2 = 0; u2 < i2.items.length; u2++) if (this.lexer.state.top = false, i2.items[u2].tokens = this.lexer.blockTokens(i2.items[u2].text, []), !i2.loose) {
let p3 = i2.items[u2].tokens.filter((f2) => f2.type === "space"), c3 = p3.length > 0 && p3.some((f2) => this.rules.other.anyLine.test(f2.raw));
i2.loose = c3;
}
if (i2.loose) for (let u2 = 0; u2 < i2.items.length; u2++) i2.items[u2].loose = true;
return i2;
}
}
html(e3) {
let t4 = this.rules.block.html.exec(e3);
if (t4) return { type: "html", block: true, raw: t4[0], pre: t4[1] === "pre" || t4[1] === "script" || t4[1] === "style", text: t4[0] };
}
def(e3) {
let t4 = this.rules.block.def.exec(e3);
if (t4) {
let n2 = t4[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r2 = t4[2] ? t4[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i2 = t4[3] ? t4[3].substring(1, t4[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t4[3];
return { type: "def", tag: n2, raw: t4[0], href: r2, title: i2 };
}
}
table(e3) {
let t4 = this.rules.block.table.exec(e3);
if (!t4 || !this.rules.other.tableDelimiter.test(t4[2])) return;
let n2 = V(t4[1]), r2 = t4[2].replace(this.rules.other.tableAlignChars, "").split("|"), i2 = t4[3]?.trim() ? t4[3].replace(this.rules.other.tableRowBlankLine, "").split(`
`) : [], s2 = { type: "table", raw: t4[0], header: [], align: [], rows: [] };
if (n2.length === r2.length) {
for (let o2 of r2) this.rules.other.tableAlignRight.test(o2) ? s2.align.push("right") : this.rules.other.tableAlignCenter.test(o2) ? s2.align.push("center") : this.rules.other.tableAlignLeft.test(o2) ? s2.align.push("left") : s2.align.push(null);
for (let o2 = 0; o2 < n2.length; o2++) s2.header.push({ text: n2[o2], tokens: this.lexer.inline(n2[o2]), header: true, align: s2.align[o2] });
for (let o2 of i2) s2.rows.push(V(o2, s2.header.length).map((a2, u2) => ({ text: a2, tokens: this.lexer.inline(a2), header: false, align: s2.align[u2] })));
return s2;
}
}
lheading(e3) {
let t4 = this.rules.block.lheading.exec(e3);
if (t4) return { type: "heading", raw: t4[0], depth: t4[2].charAt(0) === "=" ? 1 : 2, text: t4[1], tokens: this.lexer.inline(t4[1]) };
}
paragraph(e3) {
let t4 = this.rules.block.paragraph.exec(e3);
if (t4) {
let n2 = t4[1].charAt(t4[1].length - 1) === `
` ? t4[1].slice(0, -1) : t4[1];
return { type: "paragraph", raw: t4[0], text: n2, tokens: this.lexer.inline(n2) };
}
}
text(e3) {
let t4 = this.rules.block.text.exec(e3);
if (t4) return { type: "text", raw: t4[0], text: t4[0], tokens: this.lexer.inline(t4[0]) };
}
escape(e3) {
let t4 = this.rules.inline.escape.exec(e3);
if (t4) return { type: "escape", raw: t4[0], text: t4[1] };
}
tag(e3) {
let t4 = this.rules.inline.tag.exec(e3);
if (t4) return !this.lexer.state.inLink && this.rules.other.startATag.test(t4[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t4[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t4[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t4[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t4[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t4[0] };
}
link(e3) {
let t4 = this.rules.inline.link.exec(e3);
if (t4) {
let n2 = t4[2].trim();
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n2)) {
if (!this.rules.other.endAngleBracket.test(n2)) return;
let s2 = z(n2.slice(0, -1), "\\");
if ((n2.length - s2.length) % 2 === 0) return;
} else {
let s2 = ge(t4[2], "()");
if (s2 === -2) return;
if (s2 > -1) {
let a2 = (t4[0].indexOf("!") === 0 ? 5 : 4) + t4[1].length + s2;
t4[2] = t4[2].substring(0, s2), t4[0] = t4[0].substring(0, a2).trim(), t4[3] = "";
}
}
let r2 = t4[2], i2 = "";
if (this.options.pedantic) {
let s2 = this.rules.other.pedanticHrefTitle.exec(r2);
s2 && (r2 = s2[1], i2 = s2[3]);
} else i2 = t4[3] ? t4[3].slice(1, -1) : "";
return r2 = r2.trim(), this.rules.other.startAngleBracket.test(r2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n2) ? r2 = r2.slice(1) : r2 = r2.slice(1, -1)), fe(t4, { href: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1"), title: i2 && i2.replace(this.rules.inline.anyPunctuation, "$1") }, t4[0], this.lexer, this.rules);
}
}
reflink(e3, t4) {
let n2;
if ((n2 = this.rules.inline.reflink.exec(e3)) || (n2 = this.rules.inline.nolink.exec(e3))) {
let r2 = (n2[2] || n2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i2 = t4[r2.toLowerCase()];
if (!i2) {
let s2 = n2[0].charAt(0);
return { type: "text", raw: s2, text: s2 };
}
return fe(n2, i2, n2[0], this.lexer, this.rules);
}
}
emStrong(e3, t4, n2 = "") {
let r2 = this.rules.inline.emStrongLDelim.exec(e3);
if (!r2 || r2[3] && n2.match(this.rules.other.unicodeAlphaNumeric)) return;
if (!(r2[1] || r2[2] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
let s2 = [...r2[0]].length - 1, o2, a2, u2 = s2, p3 = 0, c3 = r2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
for (c3.lastIndex = 0, t4 = t4.slice(-1 * e3.length + s2); (r2 = c3.exec(t4)) != null; ) {
if (o2 = r2[1] || r2[2] || r2[3] || r2[4] || r2[5] || r2[6], !o2) continue;
if (a2 = [...o2].length, r2[3] || r2[4]) {
u2 += a2;
continue;
} else if ((r2[5] || r2[6]) && s2 % 3 && !((s2 + a2) % 3)) {
p3 += a2;
continue;
}
if (u2 -= a2, u2 > 0) continue;
a2 = Math.min(a2, a2 + u2 + p3);
let f2 = [...r2[0]][0].length, k2 = e3.slice(0, s2 + r2.index + f2 + a2);
if (Math.min(s2, a2) % 2) {
let g2 = k2.slice(1, -1);
return { type: "em", raw: k2, text: g2, tokens: this.lexer.inlineTokens(g2) };
}
let x5 = k2.slice(2, -2);
return { type: "strong", raw: k2, text: x5, tokens: this.lexer.inlineTokens(x5) };
}
}
}
codespan(e3) {
let t4 = this.rules.inline.code.exec(e3);
if (t4) {
let n2 = t4[2].replace(this.rules.other.newLineCharGlobal, " "), r2 = this.rules.other.nonSpaceChar.test(n2), i2 = this.rules.other.startingSpaceChar.test(n2) && this.rules.other.endingSpaceChar.test(n2);
return r2 && i2 && (n2 = n2.substring(1, n2.length - 1)), { type: "codespan", raw: t4[0], text: n2 };
}
}
br(e3) {
let t4 = this.rules.inline.br.exec(e3);
if (t4) return { type: "br", raw: t4[0] };
}
del(e3) {
let t4 = this.rules.inline.del.exec(e3);
if (t4) return { type: "del", raw: t4[0], text: t4[2], tokens: this.lexer.inlineTokens(t4[2]) };
}
autolink(e3) {
let t4 = this.rules.inline.autolink.exec(e3);
if (t4) {
let n2, r2;
return t4[2] === "@" ? (n2 = t4[1], r2 = "mailto:" + n2) : (n2 = t4[1], r2 = n2), { type: "link", raw: t4[0], text: n2, href: r2, tokens: [{ type: "text", raw: n2, text: n2 }] };
}
}
url(e3) {
let t4;
if (t4 = this.rules.inline.url.exec(e3)) {
let n2, r2;
if (t4[2] === "@") n2 = t4[0], r2 = "mailto:" + n2;
else {
let i2;
do
i2 = t4[0], t4[0] = this.rules.inline._backpedal.exec(t4[0])?.[0] ?? "";
while (i2 !== t4[0]);
n2 = t4[0], t4[1] === "www." ? r2 = "http://" + t4[0] : r2 = t4[0];
}
return { type: "link", raw: t4[0], text: n2, href: r2, tokens: [{ type: "text", raw: n2, text: n2 }] };
}
}
inlineText(e3) {
let t4 = this.rules.inline.text.exec(e3);
if (t4) {
let n2 = this.lexer.state.inRawBlock;
return { type: "text", raw: t4[0], text: t4[0], escaped: n2 };
}
}
};
b = class l {
static {
__name(this, "l");
}
tokens;
options;
state;
tokenizer;
inlineQueue;
constructor(e3) {
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e3 || O, this.options.tokenizer = this.options.tokenizer || new y2(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
let t4 = { other: m, block: I.normal, inline: M.normal };
this.options.pedantic ? (t4.block = I.pedantic, t4.inline = M.pedantic) : this.options.gfm && (t4.block = I.gfm, this.options.breaks ? t4.inline = M.breaks : t4.inline = M.gfm), this.tokenizer.rules = t4;
}
static get rules() {
return { block: I, inline: M };
}
static lex(e3, t4) {
return new l(t4).lex(e3);
}
static lexInline(e3, t4) {
return new l(t4).inlineTokens(e3);
}
lex(e3) {
e3 = e3.replace(m.carriageReturn, `
`), this.blockTokens(e3, this.tokens);
for (let t4 = 0; t4 < this.inlineQueue.length; t4++) {
let n2 = this.inlineQueue[t4];
this.inlineTokens(n2.src, n2.tokens);
}
return this.inlineQueue = [], this.tokens;
}
blockTokens(e3, t4 = [], n2 = false) {
for (this.options.pedantic && (e3 = e3.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e3; ) {
let r2;
if (this.options.extensions?.block?.some((s2) => (r2 = s2.call({ lexer: this }, e3, t4)) ? (e3 = e3.substring(r2.raw.length), t4.push(r2), true) : false)) continue;
if (r2 = this.tokenizer.space(e3)) {
e3 = e3.substring(r2.raw.length);
let s2 = t4.at(-1);
r2.raw.length === 1 && s2 !== void 0 ? s2.raw += `
` : t4.push(r2);
continue;
}
if (r2 = this.tokenizer.code(e3)) {
e3 = e3.substring(r2.raw.length);
let s2 = t4.at(-1);
s2?.type === "paragraph" || s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
`) ? "" : `
`) + r2.raw, s2.text += `
` + r2.text, this.inlineQueue.at(-1).src = s2.text) : t4.push(r2);
continue;
}
if (r2 = this.tokenizer.fences(e3)) {
e3 = e3.substring(r2.raw.length), t4.push(r2);
continue;
}
if (r2 = this.tokenizer.heading(e3)) {
e3 = e3.substring(r2.raw.length), t4.push(r2);
continue;
}
if (r2 = this.tokenizer.hr(e3)) {
e3 = e3.substring(r2.raw.length), t4.push(r2);
continue;
}
if (r2 = this.tokenizer.blockquote(e3)) {
e3 = e3.substring(r2.raw.length), t4.push(r2);
continue;
}
if (r2 = this.tokenizer.list(e3)) {
e3 = e3.substring(r2.raw.length), t4.push(r2);
continue;
}
if (r2 = this.tokenizer.html(e3)) {
e3 = e3.substring(r2.raw.length), t4.push(r2);
continue;
}
if (r2 = this.tokenizer.def(e3)) {
e3 = e3.substring(r2.raw.length);
let s2 = t4.at(-1);
s2?.type === "paragraph" || s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
`) ? "" : `
`) + r2.raw, s2.text += `
` + r2.raw, this.inlineQueue.at(-1).src = s2.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t4.push(r2));
continue;
}
if (r2 = this.tokenizer.table(e3)) {
e3 = e3.substring(r2.raw.length), t4.push(r2);
continue;
}
if (r2 = this.tokenizer.lheading(e3)) {
e3 = e3.substring(r2.raw.length), t4.push(r2);
continue;
}
let i2 = e3;
if (this.options.extensions?.startBlock) {
let s2 = 1 / 0, o2 = e3.slice(1), a2;
this.options.extensions.startBlock.forEach((u2) => {
a2 = u2.call({ lexer: this }, o2), typeof a2 == "number" && a2 >= 0 && (s2 = Math.min(s2, a2));
}), s2 < 1 / 0 && s2 >= 0 && (i2 = e3.substring(0, s2 + 1));
}
if (this.state.top && (r2 = this.tokenizer.paragraph(i2))) {
let s2 = t4.at(-1);
n2 && s2?.type === "paragraph" ? (s2.raw += (s2.raw.endsWith(`
`) ? "" : `
`) + r2.raw, s2.text += `
` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t4.push(r2), n2 = i2.length !== e3.length, e3 = e3.substring(r2.raw.length);
continue;
}
if (r2 = this.tokenizer.text(e3)) {
e3 = e3.substring(r2.raw.length);
let s2 = t4.at(-1);
s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
`) ? "" : `
`) + r2.raw, s2.text += `
` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t4.push(r2);
continue;
}
if (e3) {
let s2 = "Infinite loop on byte: " + e3.charCodeAt(0);
if (this.options.silent) {
console.error(s2);
break;
} else throw new Error(s2);
}
}
return this.state.top = true, t4;
}
inline(e3, t4 = []) {
return this.inlineQueue.push({ src: e3, tokens: t4 }), t4;
}
inlineTokens(e3, t4 = []) {
let n2 = e3, r2 = null;
if (this.tokens.links) {
let o2 = Object.keys(this.tokens.links);
if (o2.length > 0) for (; (r2 = this.tokenizer.rules.inline.reflinkSearch.exec(n2)) != null; ) o2.includes(r2[0].slice(r2[0].lastIndexOf("[") + 1, -1)) && (n2 = n2.slice(0, r2.index) + "[" + "a".repeat(r2[0].length - 2) + "]" + n2.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
}
for (; (r2 = this.tokenizer.rules.inline.anyPunctuation.exec(n2)) != null; ) n2 = n2.slice(0, r2.index) + "++" + n2.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
for (; (r2 = this.tokenizer.rules.inline.blockSkip.exec(n2)) != null; ) n2 = n2.slice(0, r2.index) + "[" + "a".repeat(r2[0].length - 2) + "]" + n2.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
n2 = this.options.hooks?.emStrongMask?.call({ lexer: this }, n2) ?? n2;
let i2 = false, s2 = "";
for (; e3; ) {
i2 || (s2 = ""), i2 = false;
let o2;
if (this.options.extensions?.inline?.some((u2) => (o2 = u2.call({ lexer: this }, e3, t4)) ? (e3 = e3.substring(o2.raw.length), t4.push(o2), true) : false)) continue;
if (o2 = this.tokenizer.escape(e3)) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
if (o2 = this.tokenizer.tag(e3)) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
if (o2 = this.tokenizer.link(e3)) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
if (o2 = this.tokenizer.reflink(e3, this.tokens.links)) {
e3 = e3.substring(o2.raw.length);
let u2 = t4.at(-1);
o2.type === "text" && u2?.type === "text" ? (u2.raw += o2.raw, u2.text += o2.text) : t4.push(o2);
continue;
}
if (o2 = this.tokenizer.emStrong(e3, n2, s2)) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
if (o2 = this.tokenizer.codespan(e3)) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
if (o2 = this.tokenizer.br(e3)) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
if (o2 = this.tokenizer.del(e3)) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
if (o2 = this.tokenizer.autolink(e3)) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
if (!this.state.inLink && (o2 = this.tokenizer.url(e3))) {
e3 = e3.substring(o2.raw.length), t4.push(o2);
continue;
}
let a2 = e3;
if (this.options.extensions?.startInline) {
let u2 = 1 / 0, p3 = e3.slice(1), c3;
this.options.extensions.startInline.forEach((f2) => {
c3 = f2.call({ lexer: this }, p3), typeof c3 == "number" && c3 >= 0 && (u2 = Math.min(u2, c3));
}), u2 < 1 / 0 && u2 >= 0 && (a2 = e3.substring(0, u2 + 1));
}
if (o2 = this.tokenizer.inlineText(a2)) {
e3 = e3.substring(o2.raw.length), o2.raw.slice(-1) !== "_" && (s2 = o2.raw.slice(-1)), i2 = true;
let u2 = t4.at(-1);
u2?.type === "text" ? (u2.raw += o2.raw, u2.text += o2.text) : t4.push(o2);
continue;
}
if (e3) {
let u2 = "Infinite loop on byte: " + e3.charCodeAt(0);
if (this.options.silent) {
console.error(u2);
break;
} else throw new Error(u2);
}
}
return t4;
}
};
P = class {
static {
__name(this, "P");
}
options;
parser;
constructor(e3) {
this.options = e3 || O;
}
space(e3) {
return "";
}
code({ text: e3, lang: t4, escaped: n2 }) {
let r2 = (t4 || "").match(m.notSpaceStart)?.[0], i2 = e3.replace(m.endingNewline, "") + `
`;
return r2 ? '' + (n2 ? i2 : w(i2, true)) + `
` : "" + (n2 ? i2 : w(i2, true)) + `
`;
}
blockquote({ tokens: e3 }) {
return `
${this.parser.parse(e3)}
`;
}
html({ text: e3 }) {
return e3;
}
def(e3) {
return "";
}
heading({ tokens: e3, depth: t4 }) {
return `${this.parser.parseInline(e3)}
`;
}
hr(e3) {
return `
`;
}
list(e3) {
let t4 = e3.ordered, n2 = e3.start, r2 = "";
for (let o2 = 0; o2 < e3.items.length; o2++) {
let a2 = e3.items[o2];
r2 += this.listitem(a2);
}
let i2 = t4 ? "ol" : "ul", s2 = t4 && n2 !== 1 ? ' start="' + n2 + '"' : "";
return "<" + i2 + s2 + `>
` + r2 + "" + i2 + `>
`;
}
listitem(e3) {
let t4 = "";
if (e3.task) {
let n2 = this.checkbox({ checked: !!e3.checked });
e3.loose ? e3.tokens[0]?.type === "paragraph" ? (e3.tokens[0].text = n2 + " " + e3.tokens[0].text, e3.tokens[0].tokens && e3.tokens[0].tokens.length > 0 && e3.tokens[0].tokens[0].type === "text" && (e3.tokens[0].tokens[0].text = n2 + " " + w(e3.tokens[0].tokens[0].text), e3.tokens[0].tokens[0].escaped = true)) : e3.tokens.unshift({ type: "text", raw: n2 + " ", text: n2 + " ", escaped: true }) : t4 += n2 + " ";
}
return t4 += this.parser.parse(e3.tokens, !!e3.loose), `${t4}
`;
}
checkbox({ checked: e3 }) {
return "';
}
paragraph({ tokens: e3 }) {
return `${this.parser.parseInline(e3)}
`;
}
table(e3) {
let t4 = "", n2 = "";
for (let i2 = 0; i2 < e3.header.length; i2++) n2 += this.tablecell(e3.header[i2]);
t4 += this.tablerow({ text: n2 });
let r2 = "";
for (let i2 = 0; i2 < e3.rows.length; i2++) {
let s2 = e3.rows[i2];
n2 = "";
for (let o2 = 0; o2 < s2.length; o2++) n2 += this.tablecell(s2[o2]);
r2 += this.tablerow({ text: n2 });
}
return r2 && (r2 = `${r2}`), `
`;
}
tablerow({ text: e3 }) {
return `
${e3}
`;
}
tablecell(e3) {
let t4 = this.parser.parseInline(e3.tokens), n2 = e3.header ? "th" : "td";
return (e3.align ? `<${n2} align="${e3.align}">` : `<${n2}>`) + t4 + `${n2}>
`;
}
strong({ tokens: e3 }) {
return `${this.parser.parseInline(e3)}`;
}
em({ tokens: e3 }) {
return `${this.parser.parseInline(e3)}`;
}
codespan({ text: e3 }) {
return `${w(e3, true)}`;
}
br(e3) {
return "
";
}
del({ tokens: e3 }) {
return `${this.parser.parseInline(e3)}`;
}
link({ href: e3, title: t4, tokens: n2 }) {
let r2 = this.parser.parseInline(n2), i2 = J(e3);
if (i2 === null) return r2;
e3 = i2;
let s2 = '" + r2 + "", s2;
}
image({ href: e3, title: t4, text: n2, tokens: r2 }) {
r2 && (n2 = this.parser.parseInline(r2, this.parser.textRenderer));
let i2 = J(e3);
if (i2 === null) return w(n2);
e3 = i2;
let s2 = `
", s2;
}
text(e3) {
return "tokens" in e3 && e3.tokens ? this.parser.parseInline(e3.tokens) : "escaped" in e3 && e3.escaped ? e3.text : w(e3.text);
}
};
$ = class {
static {
__name(this, "$");
}
strong({ text: e3 }) {
return e3;
}
em({ text: e3 }) {
return e3;
}
codespan({ text: e3 }) {
return e3;
}
del({ text: e3 }) {
return e3;
}
html({ text: e3 }) {
return e3;
}
text({ text: e3 }) {
return e3;
}
link({ text: e3 }) {
return "" + e3;
}
image({ text: e3 }) {
return "" + e3;
}
br() {
return "";
}
};
R = class l2 {
static {
__name(this, "l");
}
options;
renderer;
textRenderer;
constructor(e3) {
this.options = e3 || O, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
}
static parse(e3, t4) {
return new l2(t4).parse(e3);
}
static parseInline(e3, t4) {
return new l2(t4).parseInline(e3);
}
parse(e3, t4 = true) {
let n2 = "";
for (let r2 = 0; r2 < e3.length; r2++) {
let i2 = e3[r2];
if (this.options.extensions?.renderers?.[i2.type]) {
let o2 = i2, a2 = this.options.extensions.renderers[o2.type].call({ parser: this }, o2);
if (a2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(o2.type)) {
n2 += a2 || "";
continue;
}
}
let s2 = i2;
switch (s2.type) {
case "space": {
n2 += this.renderer.space(s2);
continue;
}
case "hr": {
n2 += this.renderer.hr(s2);
continue;
}
case "heading": {
n2 += this.renderer.heading(s2);
continue;
}
case "code": {
n2 += this.renderer.code(s2);
continue;
}
case "table": {
n2 += this.renderer.table(s2);
continue;
}
case "blockquote": {
n2 += this.renderer.blockquote(s2);
continue;
}
case "list": {
n2 += this.renderer.list(s2);
continue;
}
case "html": {
n2 += this.renderer.html(s2);
continue;
}
case "def": {
n2 += this.renderer.def(s2);
continue;
}
case "paragraph": {
n2 += this.renderer.paragraph(s2);
continue;
}
case "text": {
let o2 = s2, a2 = this.renderer.text(o2);
for (; r2 + 1 < e3.length && e3[r2 + 1].type === "text"; ) o2 = e3[++r2], a2 += `
` + this.renderer.text(o2);
t4 ? n2 += this.renderer.paragraph({ type: "paragraph", raw: a2, text: a2, tokens: [{ type: "text", raw: a2, text: a2, escaped: true }] }) : n2 += a2;
continue;
}
default: {
let o2 = 'Token with "' + s2.type + '" type was not found.';
if (this.options.silent) return console.error(o2), "";
throw new Error(o2);
}
}
}
return n2;
}
parseInline(e3, t4 = this.renderer) {
let n2 = "";
for (let r2 = 0; r2 < e3.length; r2++) {
let i2 = e3[r2];
if (this.options.extensions?.renderers?.[i2.type]) {
let o2 = this.options.extensions.renderers[i2.type].call({ parser: this }, i2);
if (o2 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i2.type)) {
n2 += o2 || "";
continue;
}
}
let s2 = i2;
switch (s2.type) {
case "escape": {
n2 += t4.text(s2);
break;
}
case "html": {
n2 += t4.html(s2);
break;
}
case "link": {
n2 += t4.link(s2);
break;
}
case "image": {
n2 += t4.image(s2);
break;
}
case "strong": {
n2 += t4.strong(s2);
break;
}
case "em": {
n2 += t4.em(s2);
break;
}
case "codespan": {
n2 += t4.codespan(s2);
break;
}
case "br": {
n2 += t4.br(s2);
break;
}
case "del": {
n2 += t4.del(s2);
break;
}
case "text": {
n2 += t4.text(s2);
break;
}
default: {
let o2 = 'Token with "' + s2.type + '" type was not found.';
if (this.options.silent) return console.error(o2), "";
throw new Error(o2);
}
}
}
return n2;
}
};
S2 = class {
static {
__name(this, "S");
}
options;
block;
constructor(e3) {
this.options = e3 || O;
}
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
preprocess(e3) {
return e3;
}
postprocess(e3) {
return e3;
}
processAllTokens(e3) {
return e3;
}
emStrongMask(e3) {
return e3;
}
provideLexer() {
return this.block ? b.lex : b.lexInline;
}
provideParser() {
return this.block ? R.parse : R.parseInline;
}
};
B = class {
static {
__name(this, "B");
}
defaults = L();
options = this.setOptions;
parse = this.parseMarkdown(true);
parseInline = this.parseMarkdown(false);
Parser = R;
Renderer = P;
TextRenderer = $;
Lexer = b;
Tokenizer = y2;
Hooks = S2;
constructor(...e3) {
this.use(...e3);
}
walkTokens(e3, t4) {
let n2 = [];
for (let r2 of e3) switch (n2 = n2.concat(t4.call(this, r2)), r2.type) {
case "table": {
let i2 = r2;
for (let s2 of i2.header) n2 = n2.concat(this.walkTokens(s2.tokens, t4));
for (let s2 of i2.rows) for (let o2 of s2) n2 = n2.concat(this.walkTokens(o2.tokens, t4));
break;
}
case "list": {
let i2 = r2;
n2 = n2.concat(this.walkTokens(i2.items, t4));
break;
}
default: {
let i2 = r2;
this.defaults.extensions?.childTokens?.[i2.type] ? this.defaults.extensions.childTokens[i2.type].forEach((s2) => {
let o2 = i2[s2].flat(1 / 0);
n2 = n2.concat(this.walkTokens(o2, t4));
}) : i2.tokens && (n2 = n2.concat(this.walkTokens(i2.tokens, t4)));
}
}
return n2;
}
use(...e3) {
let t4 = this.defaults.extensions || { renderers: {}, childTokens: {} };
return e3.forEach((n2) => {
let r2 = { ...n2 };
if (r2.async = this.defaults.async || r2.async || false, n2.extensions && (n2.extensions.forEach((i2) => {
if (!i2.name) throw new Error("extension name required");
if ("renderer" in i2) {
let s2 = t4.renderers[i2.name];
s2 ? t4.renderers[i2.name] = function(...o2) {
let a2 = i2.renderer.apply(this, o2);
return a2 === false && (a2 = s2.apply(this, o2)), a2;
} : t4.renderers[i2.name] = i2.renderer;
}
if ("tokenizer" in i2) {
if (!i2.level || i2.level !== "block" && i2.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
let s2 = t4[i2.level];
s2 ? s2.unshift(i2.tokenizer) : t4[i2.level] = [i2.tokenizer], i2.start && (i2.level === "block" ? t4.startBlock ? t4.startBlock.push(i2.start) : t4.startBlock = [i2.start] : i2.level === "inline" && (t4.startInline ? t4.startInline.push(i2.start) : t4.startInline = [i2.start]));
}
"childTokens" in i2 && i2.childTokens && (t4.childTokens[i2.name] = i2.childTokens);
}), r2.extensions = t4), n2.renderer) {
let i2 = this.defaults.renderer || new P(this.defaults);
for (let s2 in n2.renderer) {
if (!(s2 in i2)) throw new Error(`renderer '${s2}' does not exist`);
if (["options", "parser"].includes(s2)) continue;
let o2 = s2, a2 = n2.renderer[o2], u2 = i2[o2];
i2[o2] = (...p3) => {
let c3 = a2.apply(i2, p3);
return c3 === false && (c3 = u2.apply(i2, p3)), c3 || "";
};
}
r2.renderer = i2;
}
if (n2.tokenizer) {
let i2 = this.defaults.tokenizer || new y2(this.defaults);
for (let s2 in n2.tokenizer) {
if (!(s2 in i2)) throw new Error(`tokenizer '${s2}' does not exist`);
if (["options", "rules", "lexer"].includes(s2)) continue;
let o2 = s2, a2 = n2.tokenizer[o2], u2 = i2[o2];
i2[o2] = (...p3) => {
let c3 = a2.apply(i2, p3);
return c3 === false && (c3 = u2.apply(i2, p3)), c3;
};
}
r2.tokenizer = i2;
}
if (n2.hooks) {
let i2 = this.defaults.hooks || new S2();
for (let s2 in n2.hooks) {
if (!(s2 in i2)) throw new Error(`hook '${s2}' does not exist`);
if (["options", "block"].includes(s2)) continue;
let o2 = s2, a2 = n2.hooks[o2], u2 = i2[o2];
S2.passThroughHooks.has(s2) ? i2[o2] = (p3) => {
if (this.defaults.async && S2.passThroughHooksRespectAsync.has(s2)) return Promise.resolve(a2.call(i2, p3)).then((f2) => u2.call(i2, f2));
let c3 = a2.call(i2, p3);
return u2.call(i2, c3);
} : i2[o2] = (...p3) => {
let c3 = a2.apply(i2, p3);
return c3 === false && (c3 = u2.apply(i2, p3)), c3;
};
}
r2.hooks = i2;
}
if (n2.walkTokens) {
let i2 = this.defaults.walkTokens, s2 = n2.walkTokens;
r2.walkTokens = function(o2) {
let a2 = [];
return a2.push(s2.call(this, o2)), i2 && (a2 = a2.concat(i2.call(this, o2))), a2;
};
}
this.defaults = { ...this.defaults, ...r2 };
}), this;
}
setOptions(e3) {
return this.defaults = { ...this.defaults, ...e3 }, this;
}
lexer(e3, t4) {
return b.lex(e3, t4 ?? this.defaults);
}
parser(e3, t4) {
return R.parse(e3, t4 ?? this.defaults);
}
parseMarkdown(e3) {
return (n2, r2) => {
let i2 = { ...r2 }, s2 = { ...this.defaults, ...i2 }, o2 = this.onError(!!s2.silent, !!s2.async);
if (this.defaults.async === true && i2.async === false) return o2(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."));
if (typeof n2 > "u" || n2 === null) return o2(new Error("marked(): input parameter is undefined or null"));
if (typeof n2 != "string") return o2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n2) + ", string expected"));
s2.hooks && (s2.hooks.options = s2, s2.hooks.block = e3);
let a2 = s2.hooks ? s2.hooks.provideLexer() : e3 ? b.lex : b.lexInline, u2 = s2.hooks ? s2.hooks.provideParser() : e3 ? R.parse : R.parseInline;
if (s2.async) return Promise.resolve(s2.hooks ? s2.hooks.preprocess(n2) : n2).then((p3) => a2(p3, s2)).then((p3) => s2.hooks ? s2.hooks.processAllTokens(p3) : p3).then((p3) => s2.walkTokens ? Promise.all(this.walkTokens(p3, s2.walkTokens)).then(() => p3) : p3).then((p3) => u2(p3, s2)).then((p3) => s2.hooks ? s2.hooks.postprocess(p3) : p3).catch(o2);
try {
s2.hooks && (n2 = s2.hooks.preprocess(n2));
let p3 = a2(n2, s2);
s2.hooks && (p3 = s2.hooks.processAllTokens(p3)), s2.walkTokens && this.walkTokens(p3, s2.walkTokens);
let c3 = u2(p3, s2);
return s2.hooks && (c3 = s2.hooks.postprocess(c3)), c3;
} catch (p3) {
return o2(p3);
}
};
}
onError(e3, t4) {
return (n2) => {
if (n2.message += `
Please report this to https://github.com/markedjs/marked.`, e3) {
let r2 = "An error occurred:
" + w(n2.message + "", true) + "
";
return t4 ? Promise.resolve(r2) : r2;
}
if (t4) return Promise.reject(n2);
throw n2;
};
}
};
_ = new B();
__name(d, "d");
d.options = d.setOptions = function(l4) {
return _.setOptions(l4), d.defaults = _.defaults, G(d.defaults), d;
};
d.getDefaults = L;
d.defaults = O;
d.use = function(...l4) {
return _.use(...l4), d.defaults = _.defaults, G(d.defaults), d;
};
d.walkTokens = function(l4, e3) {
return _.walkTokens(l4, e3);
};
d.parseInline = _.parseInline;
d.Parser = R;
d.parser = R.parse;
d.Renderer = P;
d.TextRenderer = $;
d.Lexer = b;
d.lexer = b.lex;
d.Tokenizer = y2;
d.Hooks = S2;
d.parse = d;
Dt = d.options;
Ht = d.setOptions;
Zt = d.use;
Gt = d.walkTokens;
Nt = d.parseInline;
Ft = R.parse;
Qt = b.lex;
}
});
// src/rendering-util/handle-markdown-text.ts
function preprocessMarkdown(markdown, { markdownAutoWrap }) {
const withoutBR = markdown.replace(/
/g, "\n");
const withoutMultipleNewlines = withoutBR.replace(/\n{2,}/g, "\n");
const withoutExtraSpaces = dedent(withoutMultipleNewlines);
if (markdownAutoWrap === false) {
return withoutExtraSpaces.replace(/ /g, " ");
}
return withoutExtraSpaces;
}
function markdownToLines(markdown, config5 = {}) {
const preprocessedMarkdown = preprocessMarkdown(markdown, config5);
const nodes5 = d.lexer(preprocessedMarkdown);
const lines = [[]];
let currentLine = 0;
function processNode(node2, parentType = "normal") {
if (node2.type === "text") {
const textLines = node2.text.split("\n");
textLines.forEach((textLine, index) => {
if (index !== 0) {
currentLine++;
lines.push([]);
}
textLine.split(" ").forEach((word) => {
word = word.replace(/'/g, `'`);
if (word) {
lines[currentLine].push({ content: word, type: parentType });
}
});
});
} else if (node2.type === "strong" || node2.type === "em") {
node2.tokens.forEach((contentNode) => {
processNode(contentNode, node2.type);
});
} else if (node2.type === "html") {
lines[currentLine].push({ content: node2.text, type: "normal" });
}
}
__name(processNode, "processNode");
nodes5.forEach((treeNode) => {
if (treeNode.type === "paragraph") {
treeNode.tokens?.forEach((contentNode) => {
processNode(contentNode);
});
} else if (treeNode.type === "html") {
lines[currentLine].push({ content: treeNode.text, type: "normal" });
} else {
lines[currentLine].push({ content: treeNode.raw, type: "normal" });
}
});
return lines;
}
function markdownToHTML(markdown, { markdownAutoWrap } = {}) {
const nodes5 = d.lexer(markdown);
function output2(node2) {
if (node2.type === "text") {
if (markdownAutoWrap === false) {
return node2.text.replace(/\n */g, "
").replace(/ /g, " ");
}
return node2.text.replace(/\n */g, "
");
} else if (node2.type === "strong") {
return `${node2.tokens?.map(output2).join("")}`;
} else if (node2.type === "em") {
return `${node2.tokens?.map(output2).join("")}`;
} else if (node2.type === "paragraph") {
return `${node2.tokens?.map(output2).join("")}
`;
} else if (node2.type === "space") {
return "";
} else if (node2.type === "html") {
return `${node2.text}`;
} else if (node2.type === "escape") {
return node2.text;
}
log.warn(`Unsupported markdown: ${node2.type}`);
return node2.raw;
}
__name(output2, "output");
return nodes5.map(output2).join("");
}
var init_handle_markdown_text = __esm({
"src/rendering-util/handle-markdown-text.ts"() {
"use strict";
init_marked_esm();
init_esm();
init_logger();
__name(preprocessMarkdown, "preprocessMarkdown");
__name(markdownToLines, "markdownToLines");
__name(markdownToHTML, "markdownToHTML");
}
});
// src/rendering-util/splitText.ts
function splitTextToChars(text4) {
if (Intl.Segmenter) {
return [...new Intl.Segmenter().segment(text4)].map((s2) => s2.segment);
}
return [...text4];
}
function splitWordToFitWidth(checkFit, word) {
const characters2 = splitTextToChars(word.content);
return splitWordToFitWidthRecursion(checkFit, [], characters2, word.type);
}
function splitWordToFitWidthRecursion(checkFit, usedChars, remainingChars, type3) {
if (remainingChars.length === 0) {
return [
{ content: usedChars.join(""), type: type3 },
{ content: "", type: type3 }
];
}
const [nextChar, ...rest] = remainingChars;
const newWord = [...usedChars, nextChar];
if (checkFit([{ content: newWord.join(""), type: type3 }])) {
return splitWordToFitWidthRecursion(checkFit, newWord, rest, type3);
}
if (usedChars.length === 0 && nextChar) {
usedChars.push(nextChar);
remainingChars.shift();
}
return [
{ content: usedChars.join(""), type: type3 },
{ content: remainingChars.join(""), type: type3 }
];
}
function splitLineToFitWidth(line2, checkFit) {
if (line2.some(({ content }) => content.includes("\n"))) {
throw new Error("splitLineToFitWidth does not support newlines in the line");
}
return splitLineToFitWidthRecursion(line2, checkFit);
}
function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) {
if (words.length === 0) {
if (newLine.length > 0) {
lines.push(newLine);
}
return lines.length > 0 ? lines : [];
}
let joiner = "";
if (words[0].content === " ") {
joiner = " ";
words.shift();
}
const nextWord = words.shift() ?? { content: " ", type: "normal" };
const lineWithNextWord = [...newLine];
if (joiner !== "") {
lineWithNextWord.push({ content: joiner, type: "normal" });
}
lineWithNextWord.push(nextWord);
if (checkFit(lineWithNextWord)) {
return splitLineToFitWidthRecursion(words, checkFit, lines, lineWithNextWord);
}
if (newLine.length > 0) {
lines.push(newLine);
words.unshift(nextWord);
} else if (nextWord.content) {
const [line2, rest] = splitWordToFitWidth(checkFit, nextWord);
lines.push([line2]);
if (rest.content) {
words.unshift(rest);
}
}
return splitLineToFitWidthRecursion(words, checkFit, lines);
}
var init_splitText = __esm({
"src/rendering-util/splitText.ts"() {
"use strict";
__name(splitTextToChars, "splitTextToChars");
__name(splitWordToFitWidth, "splitWordToFitWidth");
__name(splitWordToFitWidthRecursion, "splitWordToFitWidthRecursion");
__name(splitLineToFitWidth, "splitLineToFitWidth");
__name(splitLineToFitWidthRecursion, "splitLineToFitWidthRecursion");
}
});
// src/rendering-util/createText.ts
function applyStyle(dom, styleFn) {
if (styleFn) {
dom.attr("style", styleFn);
}
}
async function addHtmlSpan(element3, node2, width3, classes3, addBackground = false, config5 = getConfig()) {
const fo = element3.append("foreignObject");
fo.attr("width", `${10 * width3}px`);
fo.attr("height", `${10 * width3}px`);
const div = fo.append("xhtml:div");
const sanitizedLabel = hasKatex(node2.label) ? await renderKatexSanitized(node2.label.replace(common_default.lineBreakRegex, "\n"), config5) : sanitizeText(node2.label, config5);
const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel";
const span = div.append("span");
span.html(sanitizedLabel);
applyStyle(span, node2.labelStyle);
span.attr("class", `${labelClass} ${classes3}`);
applyStyle(div, node2.labelStyle);
div.style("display", "table-cell");
div.style("white-space", "nowrap");
div.style("line-height", "1.5");
div.style("max-width", width3 + "px");
div.style("text-align", "center");
div.attr("xmlns", "http://www.w3.org/1999/xhtml");
if (addBackground) {
div.attr("class", "labelBkg");
}
let bbox = div.node().getBoundingClientRect();
if (bbox.width === width3) {
div.style("display", "table");
div.style("white-space", "break-spaces");
div.style("width", width3 + "px");
bbox = div.node().getBoundingClientRect();
}
return fo.node();
}
function createTspan(textElement, lineIndex, lineHeight) {
return textElement.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", lineIndex * lineHeight - 0.1 + "em").attr("dy", lineHeight + "em");
}
function computeWidthOfText(parentNode, lineHeight, line2) {
const testElement = parentNode.append("text");
const testSpan = createTspan(testElement, 1, lineHeight);
updateTextContentAndStyles(testSpan, line2);
const textLength = testSpan.node().getComputedTextLength();
testElement.remove();
return textLength;
}
function computeDimensionOfText(parentNode, lineHeight, text4) {
const testElement = parentNode.append("text");
const testSpan = createTspan(testElement, 1, lineHeight);
updateTextContentAndStyles(testSpan, [{ content: text4, type: "normal" }]);
const textDimension = testSpan.node()?.getBoundingClientRect();
if (textDimension) {
testElement.remove();
}
return textDimension;
}
function createFormattedText(width3, g2, structuredText, addBackground = false) {
const lineHeight = 1.1;
const labelGroup = g2.append("g");
const bkg = labelGroup.insert("rect").attr("class", "background").attr("style", "stroke: none");
const textElement = labelGroup.append("text").attr("y", "-10.1");
let lineIndex = 0;
for (const line2 of structuredText) {
const checkWidth = /* @__PURE__ */ __name((line3) => computeWidthOfText(labelGroup, lineHeight, line3) <= width3, "checkWidth");
const linesUnderWidth = checkWidth(line2) ? [line2] : splitLineToFitWidth(line2, checkWidth);
for (const preparedLine of linesUnderWidth) {
const tspan = createTspan(textElement, lineIndex, lineHeight);
updateTextContentAndStyles(tspan, preparedLine);
lineIndex++;
}
}
if (addBackground) {
const bbox = textElement.node().getBBox();
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();
}
}
function updateTextContentAndStyles(tspan, wrappedLine) {
tspan.text("");
wrappedLine.forEach((word, index) => {
const innerTspan = tspan.append("tspan").attr("font-style", word.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", word.type === "strong" ? "bold" : "normal");
if (index === 0) {
innerTspan.text(word.content);
} else {
innerTspan.text(" " + word.content);
}
});
}
async function replaceIconSubstring(text4, config5 = {}) {
const pendingReplacements = [];
text4.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (fullMatch, prefix, iconName) => {
pendingReplacements.push(
(async () => {
const registeredIconName = `${prefix}:${iconName}`;
if (await isIconAvailable(registeredIconName)) {
return await getIconSVG(registeredIconName, void 0, { class: "label-icon" });
} else {
return ``;
}
})()
);
return fullMatch;
});
const replacements = await Promise.all(pendingReplacements);
return text4.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => replacements.shift() ?? "");
}
var createText;
var init_createText = __esm({
"src/rendering-util/createText.ts"() {
"use strict";
init_src32();
init_common();
init_logger();
init_handle_markdown_text();
init_utils2();
init_icons();
init_splitText();
init_config();
__name(applyStyle, "applyStyle");
__name(addHtmlSpan, "addHtmlSpan");
__name(createTspan, "createTspan");
__name(computeWidthOfText, "computeWidthOfText");
__name(computeDimensionOfText, "computeDimensionOfText");
__name(createFormattedText, "createFormattedText");
__name(updateTextContentAndStyles, "updateTextContentAndStyles");
__name(replaceIconSubstring, "replaceIconSubstring");
createText = /* @__PURE__ */ __name(async (el, text4 = "", {
style: style3 = "",
isTitle = false,
classes: classes3 = "",
useHtmlLabels = true,
isNode: isNode2 = true,
width: width3 = 200,
addSvgBackground = false
} = {}, config5) => {
log.debug(
"XYZ createText",
text4,
style3,
isTitle,
classes3,
useHtmlLabels,
isNode2,
"addSvgBackground: ",
addSvgBackground
);
if (useHtmlLabels) {
const htmlText = markdownToHTML(text4, config5);
const decodedReplacedText = await replaceIconSubstring(decodeEntities(htmlText), config5);
const inputForKatex = text4.replace(/\\\\/g, "\\");
const node2 = {
isNode: isNode2,
label: hasKatex(text4) ? inputForKatex : decodedReplacedText,
labelStyle: style3.replace("fill:", "color:")
};
const vertexNode = await addHtmlSpan(el, node2, width3, classes3, addSvgBackground, config5);
return vertexNode;
} else {
const sanitizeBR = text4.replace(/
/g, "
");
const structuredText = markdownToLines(sanitizeBR.replace("
", "
"), config5);
const svgLabel = createFormattedText(
width3,
el,
structuredText,
text4 ? addSvgBackground : false
);
if (isNode2) {
if (/stroke:/.exec(style3)) {
style3 = style3.replace("stroke:", "lineColor:");
}
const nodeLabelTextStyle = style3.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
select_default2(svgLabel).attr("style", nodeLabelTextStyle);
} else {
const edgeLabelRectStyle = style3.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
select_default2(svgLabel).select("rect").attr("style", edgeLabelRectStyle.replace(/background:/g, "fill:"));
const edgeLabelTextStyle = style3.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
select_default2(svgLabel).select("text").attr("style", edgeLabelTextStyle);
}
return svgLabel;
}
}, "createText");
}
});
// 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(" ");
}
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 y6 = midY + amplitude * Math.sin(frequency * (x5 - x1));
points.push({ x: x5, y: y6 });
}
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 y6 = centerY + radius2 * Math.sin(angle2);
points.push({ x: -x5, y: -y6 });
}
return points;
}
var labelHelper, insertLabel, updateNodeBounds, getNodeClasses;
var init_util = __esm({
"src/rendering-util/rendering-elements/shapes/util.ts"() {
"use strict";
init_createText();
init_diagramAPI();
init_src32();
init_defaultConfig();
init_common();
init_utils2();
labelHelper = /* @__PURE__ */ __name(async (parent4, node2, _classes) => {
let cssClasses;
const useHtmlLabels = node2.useHtmlLabels || evaluate(getConfig2()?.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", handleUndefinedAttr(node2.labelStyle));
let label;
if (node2.label === void 0) {
label = "";
} else {
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);
})
)
);
}
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");
insertLabel = /* @__PURE__ */ __name(async (parent4, label, options2) => {
const useHtmlLabels = options2.useHtmlLabels || evaluate(getConfig2()?.flowchart?.htmlLabels);
const labelEl = parent4.insert("g").attr("class", "label").attr("style", options2.labelStyle || "");
const text4 = await createText(labelEl, sanitizeText(decodeEntities(label), getConfig2()), {
useHtmlLabels,
width: options2.width || getConfig2()?.flowchart?.wrappingWidth,
style: options2.labelStyle,
addSvgBackground: !!options2.icon || !!options2.img
});
let bbox = text4.getBBox();
const halfPadding = options2.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 (options2.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/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/rendering-util/rendering-elements/intersect/intersect-node.js"() {
"use strict";
__name(intersectNode, "intersectNode");
intersect_node_default = intersectNode;
}
});
// src/rendering-util/rendering-elements/intersect/intersect-ellipse.js
function intersectEllipse(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_default;
var init_intersect_ellipse = __esm({
"src/rendering-util/rendering-elements/intersect/intersect-ellipse.js"() {
"use strict";
__name(intersectEllipse, "intersectEllipse");
intersect_ellipse_default = intersectEllipse;
}
});
// 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/rendering-util/rendering-elements/intersect/intersect-circle.js"() {
"use strict";
init_intersect_ellipse();
__name(intersectCircle, "intersectCircle");
intersect_circle_default = intersectCircle;
}
});
// src/rendering-util/rendering-elements/intersect/intersect-line.js
function intersectLine(p1, p22, q1, q22) {
{
const a1 = p22.y - p1.y;
const b1 = p1.x - p22.x;
const c1 = p22.x * p1.y - p1.x * p22.y;
const r3 = a1 * q1.x + b1 * q1.y + c1;
const r4 = a1 * q22.x + b1 * q22.y + c1;
const epsilon6 = 1e-6;
if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {
return;
}
const a2 = q22.y - q1.y;
const b22 = q1.x - q22.x;
const c22 = q22.x * q1.y - q1.x * q22.y;
const r1 = a2 * p1.x + b22 * p1.y + c22;
const r2 = a2 * p22.x + b22 * p22.y + c22;
if (Math.abs(r1) < epsilon6 && Math.abs(r2) < epsilon6 && sameSign(r1, r2)) {
return;
}
const denom = a1 * b22 - a2 * b1;
if (denom === 0) {
return;
}
const offset = Math.abs(denom / 2);
let num = b1 * c22 - b22 * c1;
const x5 = num < 0 ? (num - offset) / denom : (num + offset) / denom;
num = a2 * c1 - a1 * c22;
const y6 = num < 0 ? (num - offset) / denom : (num + offset) / denom;
return { x: x5, y: y6 };
}
}
function sameSign(r1, r2) {
return r1 * r2 > 0;
}
var intersect_line_default;
var init_intersect_line = __esm({
"src/rendering-util/rendering-elements/intersect/intersect-line.js"() {
"use strict";
__name(intersectLine, "intersectLine");
__name(sameSign, "sameSign");
intersect_line_default = intersectLine;
}
});
// src/rendering-util/rendering-elements/intersect/intersect-polygon.js
function intersectPolygon(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_default(
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, q3) {
let pdx = p3.x - point8.x;
let pdy = p3.y - point8.y;
let distp = Math.sqrt(pdx * pdx + pdy * pdy);
let qdx = q3.x - point8.x;
let qdy = q3.y - point8.y;
let distq = Math.sqrt(qdx * qdx + qdy * qdy);
return distp < distq ? -1 : distp === distq ? 0 : 1;
});
}
return intersections[0];
}
var intersect_polygon_default;
var init_intersect_polygon = __esm({
"src/rendering-util/rendering-elements/intersect/intersect-polygon.js"() {
"use strict";
init_intersect_line();
__name(intersectPolygon, "intersectPolygon");
intersect_polygon_default = intersectPolygon;
}
});
// src/rendering-util/rendering-elements/intersect/intersect-rect.js
var intersectRect, intersect_rect_default;
var init_intersect_rect = __esm({
"src/rendering-util/rendering-elements/intersect/intersect-rect.js"() {
"use strict";
intersectRect = /* @__PURE__ */ __name((node2, point8) => {
var x5 = node2.x;
var y6 = node2.y;
var dx = point8.x - x5;
var dy = point8.y - y6;
var w4 = node2.width / 2;
var h3 = node2.height / 2;
var sx, sy;
if (Math.abs(dy) * w4 > Math.abs(dx) * h3) {
if (dy < 0) {
h3 = -h3;
}
sx = dy === 0 ? 0 : h3 * dx / dy;
sy = h3;
} else {
if (dx < 0) {
w4 = -w4;
}
sx = w4;
sy = dx === 0 ? 0 : w4 * dy / dx;
}
return { x: x5 + sx, y: y6 + sy };
}, "intersectRect");
intersect_rect_default = intersectRect;
}
});
// src/rendering-util/rendering-elements/intersect/index.js
var intersect_default;
var init_intersect = __esm({
"src/rendering-util/rendering-elements/intersect/index.js"() {
"use strict";
init_intersect_node();
init_intersect_circle();
init_intersect_ellipse();
init_intersect_polygon();
init_intersect_rect();
intersect_default = {
node: intersect_node_default,
circle: intersect_circle_default,
ellipse: intersect_ellipse_default,
polygon: intersect_polygon_default,
rect: intersect_rect_default
};
}
});
// src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts
var solidStateFill, compileStyles, styles2Map, isLabelStyle, styles2String, userNodeOverrides, getStrokeDashArray;
var init_handDrawnShapeStyles = __esm({
"src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.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 || [],
...node2.labelStyle || []
]);
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");
}
}
});
return {
labelStyles: labelStyles.join(";"),
nodeStyles: nodeStyles.join(";"),
stylesArray,
borderStyles,
backgroundStyles
};
}, "styles2String");
userNodeOverrides = /* @__PURE__ */ __name((node2, options2) => {
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],
strokeLineDash: getStrokeDashArray(stylesMap.get("stroke-dasharray"))
},
options2
);
return result;
}, "userNodeOverrides");
getStrokeDashArray = /* @__PURE__ */ __name((strokeDasharrayStyle) => {
if (!strokeDasharrayStyle) {
return [0, 0];
}
const dashArray = strokeDasharrayStyle.trim().split(/\s+/).map(Number);
if (dashArray.length === 1) {
const val = isNaN(dashArray[0]) ? 0 : dashArray[0];
return [val, val];
}
const first3 = isNaN(dashArray[0]) ? 0 : dashArray[0];
const second2 = isNaN(dashArray[1]) ? 0 : dashArray[1];
return [first3, second2];
}, "getStrokeDashArray");
}
});
// ../../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, h3 = Math.cos(a2), r2 = Math.sin(a2);
for (const e4 of t4) {
const [t5, s3] = e4;
e4[0] = (t5 - n2) * h3 - (s3 - o2) * r2 + n2, e4[1] = (t5 - n2) * r2 + (s3 - o2) * h3 + o2;
}
}
}
function e(t4, e3) {
return t4[0] === e3[0] && t4[1] === e3[1];
}
function s(s2, n2, o2, a2 = 1) {
const h3 = o2, r2 = Math.max(n2, 0.1), i2 = s2[0] && s2[0][0] && "number" == typeof s2[0][0] ? [s2] : s2, c3 = [0, 0];
if (h3) for (const e3 of i2) t(e3, c3, h3);
const l4 = (function(t4, s3, n3) {
const o3 = [];
for (const s4 of t4) {
const t5 = [...s4];
e(t5[0], t5[t5.length - 1]) || t5.push([t5[0][0], t5[0][1]]), t5.length > 2 && o3.push(t5);
}
const a3 = [];
s3 = Math.max(s3, 0.1);
const h4 = [];
for (const t5 of o3) for (let e3 = 0; e3 < t5.length - 1; e3++) {
const s4 = t5[e3], n4 = t5[e3 + 1];
if (s4[1] !== n4[1]) {
const t6 = Math.min(s4[1], n4[1]);
h4.push({ ymin: t6, ymax: Math.max(s4[1], n4[1]), x: t6 === s4[1] ? s4[0] : n4[0], islope: (n4[0] - s4[0]) / (n4[1] - s4[1]) });
}
}
if (h4.sort(((t5, e3) => t5.ymin < e3.ymin ? -1 : t5.ymin > e3.ymin ? 1 : t5.x < e3.x ? -1 : t5.x > e3.x ? 1 : t5.ymax === e3.ymax ? 0 : (t5.ymax - e3.ymax) / Math.abs(t5.ymax - e3.ymax))), !h4.length) return a3;
let r3 = [], i3 = h4[0].ymin, c4 = 0;
for (; r3.length || h4.length; ) {
if (h4.length) {
let t5 = -1;
for (let e3 = 0; e3 < h4.length && !(h4[e3].ymin > i3); e3++) t5 = e3;
h4.splice(0, t5 + 1).forEach(((t6) => {
r3.push({ s: i3, edge: t6 });
}));
}
if (r3 = r3.filter(((t5) => !(t5.edge.ymax <= i3))), r3.sort(((t5, e3) => t5.edge.x === e3.edge.x ? 0 : (t5.edge.x - e3.edge.x) / Math.abs(t5.edge.x - e3.edge.x))), (1 !== n3 || c4 % s3 == 0) && r3.length > 1) for (let t5 = 0; t5 < r3.length; t5 += 2) {
const e3 = t5 + 1;
if (e3 >= r3.length) break;
const s4 = r3[t5].edge, n4 = r3[e3].edge;
a3.push([[Math.round(s4.x), i3], [Math.round(n4.x), i3]]);
}
i3 += n3, r3.forEach(((t5) => {
t5.edge.x = t5.edge.x + n3 * t5.edge.islope;
})), c4++;
}
return a3;
})(i2, r2, a2);
if (h3) {
for (const e3 of i2) t(e3, c3, -h3);
!(function(e3, s3, n3) {
const o3 = [];
e3.forEach(((t4) => o3.push(...t4))), t(o3, s3, n3);
})(l4, c3, -h3);
}
return l4;
}
function n(t4, e3) {
var n2;
const o2 = e3.hachureAngle + 90;
let a2 = e3.hachureGap;
a2 < 0 && (a2 = 4 * e3.strokeWidth), a2 = Math.round(Math.max(a2, 0.1));
let h3 = 1;
return e3.roughness >= 1 && ((null === (n2 = e3.randomizer) || void 0 === n2 ? void 0 : n2.next()) || Math.random()) > 0.7 && (h3 = a2), s(t4, a2, o2, h3 || 1);
}
function a(t4) {
const e3 = t4[0], s2 = t4[1];
return Math.sqrt(Math.pow(e3[0] - s2[0], 2) + Math.pow(e3[1] - s2[1], 2));
}
function k(t4, e3) {
return t4.type === e3;
}
function b2(t4) {
const e3 = [], s2 = (function(t5) {
const e4 = new Array();
for (; "" !== t5; ) if (t5.match(/^([ \t\r\n,]+)/)) t5 = t5.substr(RegExp.$1.length);
else if (t5.match(/^([aAcChHlLmMqQsStTvVzZ])/)) e4[e4.length] = { type: f, text: RegExp.$1 }, t5 = t5.substr(RegExp.$1.length);
else {
if (!t5.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return [];
e4[e4.length] = { type: d2, text: `${parseFloat(RegExp.$1)}` }, t5 = t5.substr(RegExp.$1.length);
}
return e4[e4.length] = { type: g, text: "" }, e4;
})(t4);
let n2 = "BOD", o2 = 0, a2 = s2[o2];
for (; !k(a2, g); ) {
let h3 = 0;
const r2 = [];
if ("BOD" === n2) {
if ("M" !== a2.text && "m" !== a2.text) return b2("M0,0" + t4);
o2++, h3 = M2[a2.text], n2 = a2.text;
} else k(a2, d2) ? h3 = M2[n2] : (o2++, h3 = M2[a2.text], n2 = a2.text);
if (!(o2 + h3 < s2.length)) throw new Error("Path data ended short");
for (let t5 = o2; t5 < o2 + h3; t5++) {
const e4 = s2[t5];
if (!k(e4, d2)) throw new Error("Param not a number: " + n2 + "," + e4.text);
r2[r2.length] = +e4.text;
}
if ("number" != typeof M2[n2]) throw new Error("Bad segment: " + n2);
{
const t5 = { key: n2, data: r2 };
e3.push(t5), o2 += h3, a2 = s2[o2], "M" === n2 && (n2 = "L"), "m" === n2 && (n2 = "l");
}
}
return e3;
}
function y3(t4) {
let e3 = 0, s2 = 0, n2 = 0, o2 = 0;
const a2 = [];
for (const { key: h3, data: r2 } of t4) switch (h3) {
case "M":
a2.push({ key: "M", data: [...r2] }), [e3, s2] = r2, [n2, o2] = r2;
break;
case "m":
e3 += r2[0], s2 += r2[1], a2.push({ key: "M", data: [e3, s2] }), n2 = e3, o2 = s2;
break;
case "L":
a2.push({ key: "L", data: [...r2] }), [e3, s2] = r2;
break;
case "l":
e3 += r2[0], s2 += r2[1], a2.push({ key: "L", data: [e3, s2] });
break;
case "C":
a2.push({ key: "C", data: [...r2] }), e3 = r2[4], s2 = r2[5];
break;
case "c": {
const t5 = r2.map(((t6, n3) => n3 % 2 ? t6 + s2 : t6 + e3));
a2.push({ key: "C", data: t5 }), e3 = t5[4], s2 = t5[5];
break;
}
case "Q":
a2.push({ key: "Q", data: [...r2] }), e3 = r2[2], s2 = r2[3];
break;
case "q": {
const t5 = r2.map(((t6, n3) => n3 % 2 ? t6 + s2 : t6 + e3));
a2.push({ key: "Q", data: t5 }), e3 = t5[2], s2 = t5[3];
break;
}
case "A":
a2.push({ key: "A", data: [...r2] }), e3 = r2[5], s2 = r2[6];
break;
case "a":
e3 += r2[5], s2 += r2[6], a2.push({ key: "A", data: [r2[0], r2[1], r2[2], r2[3], r2[4], e3, s2] });
break;
case "H":
a2.push({ key: "H", data: [...r2] }), e3 = r2[0];
break;
case "h":
e3 += r2[0], a2.push({ key: "H", data: [e3] });
break;
case "V":
a2.push({ key: "V", data: [...r2] }), s2 = r2[0];
break;
case "v":
s2 += r2[0], a2.push({ key: "V", data: [s2] });
break;
case "S":
a2.push({ key: "S", data: [...r2] }), e3 = r2[2], s2 = r2[3];
break;
case "s": {
const t5 = r2.map(((t6, n3) => n3 % 2 ? t6 + s2 : t6 + e3));
a2.push({ key: "S", data: t5 }), e3 = t5[2], s2 = t5[3];
break;
}
case "T":
a2.push({ key: "T", data: [...r2] }), e3 = r2[0], s2 = r2[1];
break;
case "t":
e3 += r2[0], s2 += r2[1], a2.push({ key: "T", data: [e3, s2] });
break;
case "Z":
case "z":
a2.push({ key: "Z", data: [] }), e3 = n2, s2 = o2;
}
return a2;
}
function m2(t4) {
const e3 = [];
let s2 = "", n2 = 0, o2 = 0, a2 = 0, h3 = 0, r2 = 0, i2 = 0;
for (const { key: c3, data: l4 } of t4) {
switch (c3) {
case "M":
e3.push({ key: "M", data: [...l4] }), [n2, o2] = l4, [a2, h3] = l4;
break;
case "C":
e3.push({ key: "C", data: [...l4] }), n2 = l4[4], o2 = l4[5], r2 = l4[2], i2 = l4[3];
break;
case "L":
e3.push({ key: "L", data: [...l4] }), [n2, o2] = l4;
break;
case "H":
n2 = l4[0], e3.push({ key: "L", data: [n2, o2] });
break;
case "V":
o2 = l4[0], e3.push({ key: "L", data: [n2, o2] });
break;
case "S": {
let t5 = 0, a3 = 0;
"C" === s2 || "S" === s2 ? (t5 = n2 + (n2 - r2), a3 = o2 + (o2 - i2)) : (t5 = n2, a3 = o2), e3.push({ key: "C", data: [t5, a3, ...l4] }), r2 = l4[0], i2 = l4[1], n2 = l4[2], o2 = l4[3];
break;
}
case "T": {
const [t5, a3] = l4;
let h4 = 0, c4 = 0;
"Q" === s2 || "T" === s2 ? (h4 = n2 + (n2 - r2), c4 = o2 + (o2 - i2)) : (h4 = n2, c4 = o2);
const u2 = n2 + 2 * (h4 - n2) / 3, p3 = o2 + 2 * (c4 - o2) / 3, f2 = t5 + 2 * (h4 - t5) / 3, d3 = a3 + 2 * (c4 - a3) / 3;
e3.push({ key: "C", data: [u2, p3, f2, d3, t5, a3] }), r2 = h4, i2 = c4, n2 = t5, o2 = a3;
break;
}
case "Q": {
const [t5, s3, a3, h4] = l4, c4 = n2 + 2 * (t5 - n2) / 3, u2 = o2 + 2 * (s3 - o2) / 3, p3 = a3 + 2 * (t5 - a3) / 3, f2 = h4 + 2 * (s3 - h4) / 3;
e3.push({ key: "C", data: [c4, u2, p3, f2, a3, h4] }), r2 = t5, i2 = s3, n2 = a3, o2 = h4;
break;
}
case "A": {
const t5 = Math.abs(l4[0]), s3 = Math.abs(l4[1]), a3 = l4[2], h4 = l4[3], r3 = l4[4], i3 = l4[5], c4 = l4[6];
if (0 === t5 || 0 === s3) e3.push({ key: "C", data: [n2, o2, i3, c4, i3, c4] }), n2 = i3, o2 = c4;
else if (n2 !== i3 || o2 !== c4) {
x2(n2, o2, i3, c4, t5, s3, a3, h4, r3).forEach((function(t6) {
e3.push({ key: "C", data: t6 });
})), n2 = i3, o2 = c4;
}
break;
}
case "Z":
e3.push({ key: "Z", data: [] }), n2 = a2, o2 = h3;
}
s2 = c3;
}
return e3;
}
function w2(t4, e3, s2) {
return [t4 * Math.cos(s2) - e3 * Math.sin(s2), t4 * Math.sin(s2) + e3 * Math.cos(s2)];
}
function x2(t4, e3, s2, n2, o2, a2, h3, r2, i2, c3) {
const l4 = (u2 = h3, Math.PI * u2 / 180);
var u2;
let p3 = [], f2 = 0, d3 = 0, g2 = 0, M3 = 0;
if (c3) [f2, d3, g2, M3] = c3;
else {
[t4, e3] = w2(t4, e3, -l4), [s2, n2] = w2(s2, n2, -l4);
const h4 = (t4 - s2) / 2, c4 = (e3 - n2) / 2;
let u3 = h4 * h4 / (o2 * o2) + c4 * c4 / (a2 * a2);
u3 > 1 && (u3 = Math.sqrt(u3), o2 *= u3, a2 *= u3);
const p4 = o2 * o2, k3 = a2 * a2, b4 = p4 * k3 - p4 * c4 * c4 - k3 * h4 * h4, y7 = p4 * c4 * c4 + k3 * h4 * h4, m4 = (r2 === i2 ? -1 : 1) * Math.sqrt(Math.abs(b4 / y7));
g2 = m4 * o2 * c4 / a2 + (t4 + s2) / 2, M3 = m4 * -a2 * h4 / o2 + (e3 + n2) / 2, f2 = Math.asin(parseFloat(((e3 - M3) / a2).toFixed(9))), d3 = Math.asin(parseFloat(((n2 - M3) / a2).toFixed(9))), t4 < g2 && (f2 = Math.PI - f2), s2 < g2 && (d3 = Math.PI - d3), f2 < 0 && (f2 = 2 * Math.PI + f2), d3 < 0 && (d3 = 2 * Math.PI + d3), i2 && f2 > d3 && (f2 -= 2 * Math.PI), !i2 && d3 > f2 && (d3 -= 2 * Math.PI);
}
let k2 = d3 - f2;
if (Math.abs(k2) > 120 * Math.PI / 180) {
const t5 = d3, e4 = s2, r3 = n2;
d3 = i2 && d3 > f2 ? f2 + 120 * Math.PI / 180 * 1 : f2 + 120 * Math.PI / 180 * -1, p3 = x2(s2 = g2 + o2 * Math.cos(d3), n2 = M3 + a2 * Math.sin(d3), e4, r3, o2, a2, h3, 0, i2, [d3, t5, g2, M3]);
}
k2 = d3 - f2;
const b3 = Math.cos(f2), y6 = Math.sin(f2), m3 = Math.cos(d3), P3 = Math.sin(d3), v3 = Math.tan(k2 / 4), S4 = 4 / 3 * o2 * v3, O3 = 4 / 3 * a2 * v3, L3 = [t4, e3], T3 = [t4 + S4 * y6, e3 - O3 * b3], D4 = [s2 + S4 * P3, n2 - O3 * m3], A2 = [s2, n2];
if (T3[0] = 2 * L3[0] - T3[0], T3[1] = 2 * L3[1] - T3[1], c3) return [T3, D4, A2].concat(p3);
{
p3 = [T3, D4, A2].concat(p3);
const t5 = [];
for (let e4 = 0; e4 < p3.length; e4 += 3) {
const s3 = w2(p3[e4][0], p3[e4][1], l4), n3 = w2(p3[e4 + 1][0], p3[e4 + 1][1], l4), o3 = w2(p3[e4 + 2][0], p3[e4 + 2][1], l4);
t5.push([s3[0], s3[1], n3[0], n3[1], o3[0], o3[1]]);
}
return t5;
}
}
function v2(t4, e3, s2, n2, o2) {
return { type: "path", ops: $2(t4, e3, s2, n2, o2) };
}
function S3(t4, e3, s2) {
const n2 = (t4 || []).length;
if (n2 > 2) {
const o2 = [];
for (let e4 = 0; e4 < n2 - 1; e4++) o2.push(...$2(t4[e4][0], t4[e4][1], t4[e4 + 1][0], t4[e4 + 1][1], s2));
return e3 && o2.push(...$2(t4[n2 - 1][0], t4[n2 - 1][1], t4[0][0], t4[0][1], s2)), { type: "path", ops: o2 };
}
return 2 === n2 ? v2(t4[0][0], t4[0][1], t4[1][0], t4[1][1], s2) : { type: "path", ops: [] };
}
function O2(t4, e3, s2, n2, o2) {
return (function(t5, e4) {
return S3(t5, true, e4);
})([[t4, e3], [t4 + s2, e3], [t4 + s2, e3 + n2], [t4, e3 + n2]], o2);
}
function L2(t4, e3) {
if (t4.length) {
const s2 = "number" == typeof t4[0][0] ? [t4] : t4, n2 = j2(s2[0], 1 * (1 + 0.2 * e3.roughness), e3), o2 = e3.disableMultiStroke ? [] : j2(s2[0], 1.5 * (1 + 0.22 * e3.roughness), z2(e3));
for (let t5 = 1; t5 < s2.length; t5++) {
const a2 = s2[t5];
if (a2.length) {
const t6 = j2(a2, 1 * (1 + 0.2 * e3.roughness), e3), s3 = e3.disableMultiStroke ? [] : j2(a2, 1.5 * (1 + 0.22 * e3.roughness), z2(e3));
for (const e4 of t6) "move" !== e4.op && n2.push(e4);
for (const t7 of s3) "move" !== t7.op && o2.push(t7);
}
}
return { type: "path", ops: n2.concat(o2) };
}
return { type: "path", ops: [] };
}
function T2(t4, e3, s2) {
const n2 = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(t4 / 2, 2) + Math.pow(e3 / 2, 2)) / 2)), o2 = Math.ceil(Math.max(s2.curveStepCount, s2.curveStepCount / Math.sqrt(200) * n2)), a2 = 2 * Math.PI / o2;
let h3 = Math.abs(t4 / 2), r2 = Math.abs(e3 / 2);
const i2 = 1 - s2.curveFitting;
return h3 += G2(h3 * i2, s2), r2 += G2(r2 * i2, s2), { increment: a2, rx: h3, ry: r2 };
}
function D3(t4, e3, s2, n2) {
const [o2, a2] = F2(n2.increment, t4, e3, n2.rx, n2.ry, 1, n2.increment * E2(0.1, E2(0.4, 1, s2), s2), s2);
let h3 = q2(o2, null, s2);
if (!s2.disableMultiStroke && 0 !== s2.roughness) {
const [o3] = F2(n2.increment, t4, e3, n2.rx, n2.ry, 1.5, 0, s2), a3 = q2(o3, null, s2);
h3 = h3.concat(a3);
}
return { estimatedPoints: a2, opset: { type: "path", ops: h3 } };
}
function A(t4, e3, s2, n2, o2, a2, h3, r2, i2) {
const c3 = t4, l4 = e3;
let u2 = Math.abs(s2 / 2), p3 = Math.abs(n2 / 2);
u2 += G2(0.01 * u2, i2), p3 += G2(0.01 * p3, i2);
let f2 = o2, d3 = a2;
for (; f2 < 0; ) f2 += 2 * Math.PI, d3 += 2 * Math.PI;
d3 - f2 > 2 * Math.PI && (f2 = 0, d3 = 2 * Math.PI);
const g2 = 2 * Math.PI / i2.curveStepCount, M3 = Math.min(g2 / 2, (d3 - f2) / 2), k2 = V2(M3, c3, l4, u2, p3, f2, d3, 1, i2);
if (!i2.disableMultiStroke) {
const t5 = V2(M3, c3, l4, u2, p3, f2, d3, 1.5, i2);
k2.push(...t5);
}
return h3 && (r2 ? k2.push(...$2(c3, l4, c3 + u2 * Math.cos(f2), l4 + p3 * Math.sin(f2), i2), ...$2(c3, l4, c3 + u2 * Math.cos(d3), l4 + p3 * Math.sin(d3), i2)) : k2.push({ op: "lineTo", data: [c3, l4] }, { op: "lineTo", data: [c3 + u2 * Math.cos(f2), l4 + p3 * Math.sin(f2)] })), { type: "path", ops: k2 };
}
function _2(t4, e3) {
const s2 = m2(y3(b2(t4))), n2 = [];
let o2 = [0, 0], a2 = [0, 0];
for (const { key: t5, data: h3 } of s2) switch (t5) {
case "M":
a2 = [h3[0], h3[1]], o2 = [h3[0], h3[1]];
break;
case "L":
n2.push(...$2(a2[0], a2[1], h3[0], h3[1], e3)), a2 = [h3[0], h3[1]];
break;
case "C": {
const [t6, s3, o3, r2, i2, c3] = h3;
n2.push(...Z(t6, s3, o3, r2, i2, c3, a2, e3)), a2 = [i2, c3];
break;
}
case "Z":
n2.push(...$2(a2[0], a2[1], o2[0], o2[1], e3)), a2 = [o2[0], o2[1]];
}
return { type: "path", ops: n2 };
}
function I2(t4, e3) {
const s2 = [];
for (const n2 of t4) if (n2.length) {
const t5 = e3.maxRandomnessOffset || 0, o2 = n2.length;
if (o2 > 2) {
s2.push({ op: "move", data: [n2[0][0] + G2(t5, e3), n2[0][1] + G2(t5, e3)] });
for (let a2 = 1; a2 < o2; a2++) s2.push({ op: "lineTo", data: [n2[a2][0] + G2(t5, e3), n2[a2][1] + G2(t5, e3)] });
}
}
return { type: "fillPath", ops: s2 };
}
function C2(t4, e3) {
return (function(t5, e4) {
let s2 = t5.fillStyle || "hachure";
if (!u[s2]) switch (s2) {
case "zigzag":
u[s2] || (u[s2] = new h2(e4));
break;
case "cross-hatch":
u[s2] || (u[s2] = new r(e4));
break;
case "dots":
u[s2] || (u[s2] = new i(e4));
break;
case "dashed":
u[s2] || (u[s2] = new c2(e4));
break;
case "zigzag-line":
u[s2] || (u[s2] = new l3(e4));
break;
default:
s2 = "hachure", u[s2] || (u[s2] = new o(e4));
}
return u[s2];
})(e3, P2).fillPolygons(t4, e3);
}
function z2(t4) {
const e3 = Object.assign({}, t4);
return e3.randomizer = void 0, t4.seed && (e3.seed = t4.seed + 1), e3;
}
function W2(t4) {
return t4.randomizer || (t4.randomizer = new p(t4.seed || 0)), t4.randomizer.next();
}
function E2(t4, e3, s2, n2 = 1) {
return s2.roughness * n2 * (W2(s2) * (e3 - t4) + t4);
}
function G2(t4, e3, s2 = 1) {
return E2(-t4, t4, e3, s2);
}
function $2(t4, e3, s2, n2, o2, a2 = false) {
const h3 = a2 ? o2.disableMultiStrokeFill : o2.disableMultiStroke, r2 = R2(t4, e3, s2, n2, o2, true, false);
if (h3) return r2;
const i2 = R2(t4, e3, s2, n2, o2, true, true);
return r2.concat(i2);
}
function R2(t4, e3, s2, n2, o2, a2, h3) {
const r2 = Math.pow(t4 - s2, 2) + Math.pow(e3 - n2, 2), i2 = Math.sqrt(r2);
let c3 = 1;
c3 = i2 < 200 ? 1 : i2 > 500 ? 0.4 : -16668e-7 * i2 + 1.233334;
let l4 = o2.maxRandomnessOffset || 0;
l4 * l4 * 100 > r2 && (l4 = i2 / 10);
const u2 = l4 / 2, p3 = 0.2 + 0.2 * W2(o2);
let f2 = o2.bowing * o2.maxRandomnessOffset * (n2 - e3) / 200, d3 = o2.bowing * o2.maxRandomnessOffset * (t4 - s2) / 200;
f2 = G2(f2, o2, c3), d3 = G2(d3, o2, c3);
const g2 = [], M3 = /* @__PURE__ */ __name(() => G2(u2, o2, c3), "M"), k2 = /* @__PURE__ */ __name(() => G2(l4, o2, c3), "k"), b3 = o2.preserveVertices;
return a2 && (h3 ? g2.push({ op: "move", data: [t4 + (b3 ? 0 : M3()), e3 + (b3 ? 0 : M3())] }) : g2.push({ op: "move", data: [t4 + (b3 ? 0 : G2(l4, o2, c3)), e3 + (b3 ? 0 : G2(l4, o2, c3))] })), h3 ? g2.push({ op: "bcurveTo", data: [f2 + t4 + (s2 - t4) * p3 + M3(), d3 + e3 + (n2 - e3) * p3 + M3(), f2 + t4 + 2 * (s2 - t4) * p3 + M3(), d3 + e3 + 2 * (n2 - e3) * p3 + M3(), s2 + (b3 ? 0 : M3()), n2 + (b3 ? 0 : M3())] }) : g2.push({ op: "bcurveTo", data: [f2 + t4 + (s2 - t4) * p3 + k2(), d3 + e3 + (n2 - e3) * p3 + k2(), f2 + t4 + 2 * (s2 - t4) * p3 + k2(), d3 + e3 + 2 * (n2 - e3) * p3 + k2(), s2 + (b3 ? 0 : k2()), n2 + (b3 ? 0 : k2())] }), g2;
}
function j2(t4, e3, s2) {
if (!t4.length) return [];
const n2 = [];
n2.push([t4[0][0] + G2(e3, s2), t4[0][1] + G2(e3, s2)]), n2.push([t4[0][0] + G2(e3, s2), t4[0][1] + G2(e3, s2)]);
for (let o2 = 1; o2 < t4.length; o2++) n2.push([t4[o2][0] + G2(e3, s2), t4[o2][1] + G2(e3, s2)]), o2 === t4.length - 1 && n2.push([t4[o2][0] + G2(e3, s2), t4[o2][1] + G2(e3, s2)]);
return q2(n2, null, s2);
}
function q2(t4, e3, s2) {
const n2 = t4.length, o2 = [];
if (n2 > 3) {
const a2 = [], h3 = 1 - s2.curveTightness;
o2.push({ op: "move", data: [t4[1][0], t4[1][1]] });
for (let e4 = 1; e4 + 2 < n2; e4++) {
const s3 = t4[e4];
a2[0] = [s3[0], s3[1]], a2[1] = [s3[0] + (h3 * t4[e4 + 1][0] - h3 * t4[e4 - 1][0]) / 6, s3[1] + (h3 * t4[e4 + 1][1] - h3 * t4[e4 - 1][1]) / 6], a2[2] = [t4[e4 + 1][0] + (h3 * t4[e4][0] - h3 * t4[e4 + 2][0]) / 6, t4[e4 + 1][1] + (h3 * t4[e4][1] - h3 * t4[e4 + 2][1]) / 6], a2[3] = [t4[e4 + 1][0], t4[e4 + 1][1]], o2.push({ op: "bcurveTo", data: [a2[1][0], a2[1][1], a2[2][0], a2[2][1], a2[3][0], a2[3][1]] });
}
if (e3 && 2 === e3.length) {
const t5 = s2.maxRandomnessOffset;
o2.push({ op: "lineTo", data: [e3[0] + G2(t5, s2), e3[1] + G2(t5, s2)] });
}
} else 3 === n2 ? (o2.push({ op: "move", data: [t4[1][0], t4[1][1]] }), o2.push({ op: "bcurveTo", data: [t4[1][0], t4[1][1], t4[2][0], t4[2][1], t4[2][0], t4[2][1]] })) : 2 === n2 && o2.push(...R2(t4[0][0], t4[0][1], t4[1][0], t4[1][1], s2, true, true));
return o2;
}
function F2(t4, e3, s2, n2, o2, a2, h3, r2) {
const i2 = [], c3 = [];
if (0 === r2.roughness) {
t4 /= 4, c3.push([e3 + n2 * Math.cos(-t4), s2 + o2 * Math.sin(-t4)]);
for (let a3 = 0; a3 <= 2 * Math.PI; a3 += t4) {
const t5 = [e3 + n2 * Math.cos(a3), s2 + o2 * Math.sin(a3)];
i2.push(t5), c3.push(t5);
}
c3.push([e3 + n2 * Math.cos(0), s2 + o2 * Math.sin(0)]), c3.push([e3 + n2 * Math.cos(t4), s2 + o2 * Math.sin(t4)]);
} else {
const l4 = G2(0.5, r2) - Math.PI / 2;
c3.push([G2(a2, r2) + e3 + 0.9 * n2 * Math.cos(l4 - t4), G2(a2, r2) + s2 + 0.9 * o2 * Math.sin(l4 - t4)]);
const u2 = 2 * Math.PI + l4 - 0.01;
for (let h4 = l4; h4 < u2; h4 += t4) {
const t5 = [G2(a2, r2) + e3 + n2 * Math.cos(h4), G2(a2, r2) + s2 + o2 * Math.sin(h4)];
i2.push(t5), c3.push(t5);
}
c3.push([G2(a2, r2) + e3 + n2 * Math.cos(l4 + 2 * Math.PI + 0.5 * h3), G2(a2, r2) + s2 + o2 * Math.sin(l4 + 2 * Math.PI + 0.5 * h3)]), c3.push([G2(a2, r2) + e3 + 0.98 * n2 * Math.cos(l4 + h3), G2(a2, r2) + s2 + 0.98 * o2 * Math.sin(l4 + h3)]), c3.push([G2(a2, r2) + e3 + 0.9 * n2 * Math.cos(l4 + 0.5 * h3), G2(a2, r2) + s2 + 0.9 * o2 * Math.sin(l4 + 0.5 * h3)]);
}
return [c3, i2];
}
function V2(t4, e3, s2, n2, o2, a2, h3, r2, i2) {
const c3 = a2 + G2(0.1, i2), l4 = [];
l4.push([G2(r2, i2) + e3 + 0.9 * n2 * Math.cos(c3 - t4), G2(r2, i2) + s2 + 0.9 * o2 * Math.sin(c3 - t4)]);
for (let a3 = c3; a3 <= h3; a3 += t4) l4.push([G2(r2, i2) + e3 + n2 * Math.cos(a3), G2(r2, i2) + s2 + o2 * Math.sin(a3)]);
return l4.push([e3 + n2 * Math.cos(h3), s2 + o2 * Math.sin(h3)]), l4.push([e3 + n2 * Math.cos(h3), s2 + o2 * Math.sin(h3)]), q2(l4, null, i2);
}
function Z(t4, e3, s2, n2, o2, a2, h3, r2) {
const i2 = [], c3 = [r2.maxRandomnessOffset || 1, (r2.maxRandomnessOffset || 1) + 0.3];
let l4 = [0, 0];
const u2 = r2.disableMultiStroke ? 1 : 2, p3 = r2.preserveVertices;
for (let f2 = 0; f2 < u2; f2++) 0 === f2 ? i2.push({ op: "move", data: [h3[0], h3[1]] }) : i2.push({ op: "move", data: [h3[0] + (p3 ? 0 : G2(c3[0], r2)), h3[1] + (p3 ? 0 : G2(c3[0], r2))] }), l4 = p3 ? [o2, a2] : [o2 + G2(c3[f2], r2), a2 + G2(c3[f2], r2)], i2.push({ op: "bcurveTo", data: [t4 + G2(c3[f2], r2), e3 + G2(c3[f2], r2), s2 + G2(c3[f2], r2), n2 + G2(c3[f2], r2), l4[0], l4[1]] });
return i2;
}
function Q2(t4) {
return [...t4];
}
function H(t4, e3 = 0) {
const s2 = t4.length;
if (s2 < 3) throw new Error("A curve must have at least three points.");
const n2 = [];
if (3 === s2) n2.push(Q2(t4[0]), Q2(t4[1]), Q2(t4[2]), Q2(t4[2]));
else {
const s3 = [];
s3.push(t4[0], t4[0]);
for (let e4 = 1; e4 < t4.length; e4++) s3.push(t4[e4]), e4 === t4.length - 1 && s3.push(t4[e4]);
const o2 = [], a2 = 1 - e3;
n2.push(Q2(s3[0]));
for (let t5 = 1; t5 + 2 < s3.length; t5++) {
const e4 = s3[t5];
o2[0] = [e4[0], e4[1]], o2[1] = [e4[0] + (a2 * s3[t5 + 1][0] - a2 * s3[t5 - 1][0]) / 6, e4[1] + (a2 * s3[t5 + 1][1] - a2 * s3[t5 - 1][1]) / 6], o2[2] = [s3[t5 + 1][0] + (a2 * s3[t5][0] - a2 * s3[t5 + 2][0]) / 6, s3[t5 + 1][1] + (a2 * s3[t5][1] - a2 * s3[t5 + 2][1]) / 6], o2[3] = [s3[t5 + 1][0], s3[t5 + 1][1]], n2.push(o2[1], o2[2], o2[3]);
}
}
return n2;
}
function N2(t4, e3) {
return Math.pow(t4[0] - e3[0], 2) + Math.pow(t4[1] - e3[1], 2);
}
function B2(t4, e3, s2) {
const n2 = N2(e3, s2);
if (0 === n2) return N2(t4, e3);
let o2 = ((t4[0] - e3[0]) * (s2[0] - e3[0]) + (t4[1] - e3[1]) * (s2[1] - e3[1])) / n2;
return o2 = Math.max(0, Math.min(1, o2)), N2(t4, J2(e3, s2, o2));
}
function J2(t4, e3, s2) {
return [t4[0] + (e3[0] - t4[0]) * s2, t4[1] + (e3[1] - t4[1]) * s2];
}
function K3(t4, e3, s2, n2) {
const o2 = n2 || [];
if ((function(t5, e4) {
const s3 = t5[e4 + 0], n3 = t5[e4 + 1], o3 = t5[e4 + 2], a3 = t5[e4 + 3];
let h4 = 3 * n3[0] - 2 * s3[0] - a3[0];
h4 *= h4;
let r2 = 3 * n3[1] - 2 * s3[1] - a3[1];
r2 *= r2;
let i2 = 3 * o3[0] - 2 * a3[0] - s3[0];
i2 *= i2;
let c3 = 3 * o3[1] - 2 * a3[1] - s3[1];
return c3 *= c3, h4 < i2 && (h4 = i2), r2 < c3 && (r2 = c3), h4 + r2;
})(t4, e3) < s2) {
const s3 = t4[e3 + 0];
if (o2.length) {
(a2 = o2[o2.length - 1], h3 = s3, Math.sqrt(N2(a2, h3))) > 1 && o2.push(s3);
} else o2.push(s3);
o2.push(t4[e3 + 3]);
} else {
const n3 = 0.5, a3 = t4[e3 + 0], h4 = t4[e3 + 1], r2 = t4[e3 + 2], i2 = t4[e3 + 3], c3 = J2(a3, h4, n3), l4 = J2(h4, r2, n3), u2 = J2(r2, i2, n3), p3 = J2(c3, l4, n3), f2 = J2(l4, u2, n3), d3 = J2(p3, f2, n3);
K3([a3, c3, p3, d3], 0, s2, o2), K3([d3, f2, u2, i2], 0, s2, o2);
}
var a2, h3;
return o2;
}
function U2(t4, e3) {
return X3(t4, 0, t4.length, e3);
}
function X3(t4, e3, s2, n2, o2) {
const a2 = o2 || [], h3 = t4[e3], r2 = t4[s2 - 1];
let i2 = 0, c3 = 1;
for (let n3 = e3 + 1; n3 < s2 - 1; ++n3) {
const e4 = B2(t4[n3], h3, r2);
e4 > i2 && (i2 = e4, c3 = n3);
}
return Math.sqrt(i2) > n2 ? (X3(t4, e3, c3 + 1, n2, a2), X3(t4, c3, s2, n2, a2)) : (a2.length || a2.push(h3), a2.push(r2)), a2;
}
function Y2(t4, e3 = 0.15, s2) {
const n2 = [], o2 = (t4.length - 1) / 3;
for (let s3 = 0; s3 < o2; s3++) {
K3(t4, 3 * s3, e3, n2);
}
return s2 && s2 > 0 ? X3(n2, 0, n2.length, s2) : n2;
}
var o, h2, r, i, c2, l3, u, p, f, d2, g, M2, P2, tt, et, st, nt, ot, at;
var init_rough_esm = __esm({
"../../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");
__name(s, "s");
__name(n, "n");
o = class {
static {
__name(this, "o");
}
constructor(t4) {
this.helper = t4;
}
fillPolygons(t4, e3) {
return this._fillPolygons(t4, e3);
}
_fillPolygons(t4, e3) {
const s2 = n(t4, e3);
return { type: "fillSketch", ops: this.renderLines(s2, e3) };
}
renderLines(t4, e3) {
const s2 = [];
for (const n2 of t4) s2.push(...this.helper.doubleLineOps(n2[0][0], n2[0][1], n2[1][0], n2[1][1], e3));
return s2;
}
};
__name(a, "a");
h2 = class extends o {
static {
__name(this, "h");
}
fillPolygons(t4, e3) {
let s2 = e3.hachureGap;
s2 < 0 && (s2 = 4 * e3.strokeWidth), s2 = Math.max(s2, 0.1);
const o2 = n(t4, Object.assign({}, e3, { hachureGap: s2 })), h3 = Math.PI / 180 * e3.hachureAngle, r2 = [], i2 = 0.5 * s2 * Math.cos(h3), c3 = 0.5 * s2 * Math.sin(h3);
for (const [t5, e4] of o2) a([t5, e4]) && r2.push([[t5[0] - i2, t5[1] + c3], [...e4]], [[t5[0] + i2, t5[1] - c3], [...e4]]);
return { type: "fillSketch", ops: this.renderLines(r2, e3) };
}
};
r = class extends o {
static {
__name(this, "r");
}
fillPolygons(t4, e3) {
const s2 = this._fillPolygons(t4, e3), n2 = Object.assign({}, e3, { hachureAngle: e3.hachureAngle + 90 }), o2 = this._fillPolygons(t4, n2);
return s2.ops = s2.ops.concat(o2.ops), s2;
}
};
i = class {
static {
__name(this, "i");
}
constructor(t4) {
this.helper = t4;
}
fillPolygons(t4, e3) {
const s2 = n(t4, e3 = Object.assign({}, e3, { hachureAngle: 0 }));
return this.dotsOnLines(s2, e3);
}
dotsOnLines(t4, e3) {
const s2 = [];
let n2 = e3.hachureGap;
n2 < 0 && (n2 = 4 * e3.strokeWidth), n2 = Math.max(n2, 0.1);
let o2 = e3.fillWeight;
o2 < 0 && (o2 = e3.strokeWidth / 2);
const h3 = n2 / 4;
for (const r2 of t4) {
const t5 = a(r2), i2 = t5 / n2, c3 = Math.ceil(i2) - 1, l4 = t5 - c3 * n2, u2 = (r2[0][0] + r2[1][0]) / 2 - n2 / 4, p3 = Math.min(r2[0][1], r2[1][1]);
for (let t6 = 0; t6 < c3; t6++) {
const a2 = p3 + l4 + t6 * n2, r3 = u2 - h3 + 2 * Math.random() * h3, i3 = a2 - h3 + 2 * Math.random() * h3, c4 = this.helper.ellipse(r3, i3, o2, o2, e3);
s2.push(...c4.ops);
}
}
return { type: "fillSketch", ops: s2 };
}
};
c2 = class {
static {
__name(this, "c");
}
constructor(t4) {
this.helper = t4;
}
fillPolygons(t4, e3) {
const s2 = n(t4, e3);
return { type: "fillSketch", ops: this.dashedLine(s2, e3) };
}
dashedLine(t4, e3) {
const s2 = e3.dashOffset < 0 ? e3.hachureGap < 0 ? 4 * e3.strokeWidth : e3.hachureGap : e3.dashOffset, n2 = e3.dashGap < 0 ? e3.hachureGap < 0 ? 4 * e3.strokeWidth : e3.hachureGap : e3.dashGap, o2 = [];
return t4.forEach(((t5) => {
const h3 = a(t5), r2 = Math.floor(h3 / (s2 + n2)), i2 = (h3 + n2 - r2 * (s2 + n2)) / 2;
let c3 = t5[0], l4 = t5[1];
c3[0] > l4[0] && (c3 = t5[1], l4 = t5[0]);
const u2 = Math.atan((l4[1] - c3[1]) / (l4[0] - c3[0]));
for (let t6 = 0; t6 < r2; t6++) {
const a2 = t6 * (s2 + n2), h4 = a2 + s2, r3 = [c3[0] + a2 * Math.cos(u2) + i2 * Math.cos(u2), c3[1] + a2 * Math.sin(u2) + i2 * Math.sin(u2)], l5 = [c3[0] + h4 * Math.cos(u2) + i2 * Math.cos(u2), c3[1] + h4 * Math.sin(u2) + i2 * Math.sin(u2)];
o2.push(...this.helper.doubleLineOps(r3[0], r3[1], l5[0], l5[1], e3));
}
})), o2;
}
};
l3 = class {
static {
__name(this, "l");
}
constructor(t4) {
this.helper = t4;
}
fillPolygons(t4, e3) {
const s2 = e3.hachureGap < 0 ? 4 * e3.strokeWidth : e3.hachureGap, o2 = e3.zigzagOffset < 0 ? s2 : e3.zigzagOffset, a2 = n(t4, e3 = Object.assign({}, e3, { hachureGap: s2 + o2 }));
return { type: "fillSketch", ops: this.zigzagLines(a2, o2, e3) };
}
zigzagLines(t4, e3, s2) {
const n2 = [];
return t4.forEach(((t5) => {
const o2 = a(t5), h3 = Math.round(o2 / (2 * e3));
let r2 = t5[0], i2 = t5[1];
r2[0] > i2[0] && (r2 = t5[1], i2 = t5[0]);
const c3 = Math.atan((i2[1] - r2[1]) / (i2[0] - r2[0]));
for (let t6 = 0; t6 < h3; t6++) {
const o3 = 2 * t6 * e3, a2 = 2 * (t6 + 1) * e3, h4 = Math.sqrt(2 * Math.pow(e3, 2)), i3 = [r2[0] + o3 * Math.cos(c3), r2[1] + o3 * Math.sin(c3)], l4 = [r2[0] + a2 * Math.cos(c3), r2[1] + a2 * Math.sin(c3)], u2 = [i3[0] + h4 * Math.cos(c3 + Math.PI / 4), i3[1] + h4 * Math.sin(c3 + Math.PI / 4)];
n2.push(...this.helper.doubleLineOps(i3[0], i3[1], u2[0], u2[1], s2), ...this.helper.doubleLineOps(u2[0], u2[1], l4[0], l4[1], s2));
}
})), n2;
}
};
u = {};
p = class {
static {
__name(this, "p");
}
constructor(t4) {
this.seed = t4;
}
next() {
return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
}
};
f = 0;
d2 = 1;
g = 2;
M2 = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 };
__name(k, "k");
__name(b2, "b");
__name(y3, "y");
__name(m2, "m");
__name(w2, "w");
__name(x2, "x");
P2 = { randOffset: /* @__PURE__ */ __name(function(t4, e3) {
return G2(t4, e3);
}, "randOffset"), randOffsetWithRange: /* @__PURE__ */ __name(function(t4, e3, s2) {
return E2(t4, e3, s2);
}, "randOffsetWithRange"), ellipse: /* @__PURE__ */ __name(function(t4, e3, s2, n2, o2) {
const a2 = T2(s2, n2, o2);
return D3(t4, e3, o2, a2).opset;
}, "ellipse"), doubleLineOps: /* @__PURE__ */ __name(function(t4, e3, s2, n2, o2) {
return $2(t4, e3, s2, n2, o2, true);
}, "doubleLineOps") };
__name(v2, "v");
__name(S3, "S");
__name(O2, "O");
__name(L2, "L");
__name(T2, "T");
__name(D3, "D");
__name(A, "A");
__name(_2, "_");
__name(I2, "I");
__name(C2, "C");
__name(z2, "z");
__name(W2, "W");
__name(E2, "E");
__name(G2, "G");
__name($2, "$");
__name(R2, "R");
__name(j2, "j");
__name(q2, "q");
__name(F2, "F");
__name(V2, "V");
__name(Z, "Z");
__name(Q2, "Q");
__name(H, "H");
__name(N2, "N");
__name(B2, "B");
__name(J2, "J");
__name(K3, "K");
__name(U2, "U");
__name(X3, "X");
__name(Y2, "Y");
tt = "none";
et = class {
static {
__name(this, "et");
}
constructor(t4) {
this.defaultOptions = { maxRandomnessOffset: 2, roughness: 1, bowing: 1, stroke: "#000", strokeWidth: 1, curveTightness: 0, curveFitting: 0.95, curveStepCount: 9, fillStyle: "hachure", fillWeight: -1, hachureAngle: -41, hachureGap: -1, dashOffset: -1, dashGap: -1, zigzagOffset: -1, seed: 0, disableMultiStroke: false, disableMultiStrokeFill: false, preserveVertices: false, fillShapeRoughnessGain: 0.8 }, this.config = t4 || {}, this.config.options && (this.defaultOptions = this._o(this.config.options));
}
static newSeed() {
return Math.floor(Math.random() * 2 ** 31);
}
_o(t4) {
return t4 ? Object.assign({}, this.defaultOptions, t4) : this.defaultOptions;
}
_d(t4, e3, s2) {
return { shape: t4, sets: e3 || [], options: s2 || this.defaultOptions };
}
line(t4, e3, s2, n2, o2) {
const a2 = this._o(o2);
return this._d("line", [v2(t4, e3, s2, n2, a2)], a2);
}
rectangle(t4, e3, s2, n2, o2) {
const a2 = this._o(o2), h3 = [], r2 = O2(t4, e3, s2, n2, a2);
if (a2.fill) {
const o3 = [[t4, e3], [t4 + s2, e3], [t4 + s2, e3 + n2], [t4, e3 + n2]];
"solid" === a2.fillStyle ? h3.push(I2([o3], a2)) : h3.push(C2([o3], a2));
}
return a2.stroke !== tt && h3.push(r2), this._d("rectangle", h3, a2);
}
ellipse(t4, e3, s2, n2, o2) {
const a2 = this._o(o2), h3 = [], r2 = T2(s2, n2, a2), i2 = D3(t4, e3, a2, r2);
if (a2.fill) if ("solid" === a2.fillStyle) {
const s3 = D3(t4, e3, a2, r2).opset;
s3.type = "fillPath", h3.push(s3);
} else h3.push(C2([i2.estimatedPoints], a2));
return a2.stroke !== tt && h3.push(i2.opset), this._d("ellipse", h3, a2);
}
circle(t4, e3, s2, n2) {
const o2 = this.ellipse(t4, e3, s2, s2, n2);
return o2.shape = "circle", o2;
}
linearPath(t4, e3) {
const s2 = this._o(e3);
return this._d("linearPath", [S3(t4, false, s2)], s2);
}
arc(t4, e3, s2, n2, o2, a2, h3 = false, r2) {
const i2 = this._o(r2), c3 = [], l4 = A(t4, e3, s2, n2, o2, a2, h3, true, i2);
if (h3 && i2.fill) if ("solid" === i2.fillStyle) {
const h4 = Object.assign({}, i2);
h4.disableMultiStroke = true;
const r3 = A(t4, e3, s2, n2, o2, a2, true, false, h4);
r3.type = "fillPath", c3.push(r3);
} else c3.push((function(t5, e4, s3, n3, o3, a3, h4) {
const r3 = t5, i3 = e4;
let c4 = Math.abs(s3 / 2), l5 = Math.abs(n3 / 2);
c4 += G2(0.01 * c4, h4), l5 += G2(0.01 * l5, h4);
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 f2 = (p3 - u2) / h4.curveStepCount, d3 = [];
for (let t6 = u2; t6 <= p3; t6 += f2) d3.push([r3 + c4 * Math.cos(t6), i3 + l5 * Math.sin(t6)]);
return d3.push([r3 + c4 * Math.cos(p3), i3 + l5 * Math.sin(p3)]), d3.push([r3, i3]), C2([d3], h4);
})(t4, e3, s2, n2, o2, a2, i2));
return i2.stroke !== tt && c3.push(l4), this._d("arc", c3, i2);
}
curve(t4, e3) {
const s2 = this._o(e3), n2 = [], o2 = L2(t4, s2);
if (s2.fill && s2.fill !== tt) if ("solid" === s2.fillStyle) {
const e4 = L2(t4, Object.assign(Object.assign({}, s2), { disableMultiStroke: true, roughness: s2.roughness ? s2.roughness + s2.fillShapeRoughnessGain : 0 }));
n2.push({ type: "fillPath", ops: this._mergedShape(e4.ops) });
} else {
const e4 = [], o3 = t4;
if (o3.length) {
const t5 = "number" == typeof o3[0][0] ? [o3] : o3;
for (const n3 of t5) n3.length < 3 ? e4.push(...n3) : 3 === n3.length ? e4.push(...Y2(H([n3[0], n3[0], n3[1], n3[2]]), 10, (1 + s2.roughness) / 2)) : e4.push(...Y2(H(n3), 10, (1 + s2.roughness) / 2));
}
e4.length && n2.push(C2([e4], s2));
}
return s2.stroke !== tt && n2.push(o2), this._d("curve", n2, s2);
}
polygon(t4, e3) {
const s2 = this._o(e3), n2 = [], o2 = S3(t4, true, s2);
return s2.fill && ("solid" === s2.fillStyle ? n2.push(I2([t4], s2)) : n2.push(C2([t4], s2))), s2.stroke !== tt && n2.push(o2), this._d("polygon", n2, s2);
}
path(t4, e3) {
const s2 = this._o(e3), n2 = [];
if (!t4) return this._d("path", n2, s2);
t4 = (t4 || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
const o2 = s2.fill && "transparent" !== s2.fill && s2.fill !== tt, a2 = s2.stroke !== tt, h3 = !!(s2.simplification && s2.simplification < 1), r2 = (function(t5, e4, s3) {
const n3 = m2(y3(b2(t5))), o3 = [];
let a3 = [], h4 = [0, 0], r3 = [];
const i3 = /* @__PURE__ */ __name(() => {
r3.length >= 4 && a3.push(...Y2(r3, e4)), r3 = [];
}, "i"), c3 = /* @__PURE__ */ __name(() => {
i3(), a3.length && (o3.push(a3), a3 = []);
}, "c");
for (const { key: t6, data: e6 } of n3) switch (t6) {
case "M":
c3(), h4 = [e6[0], e6[1]], a3.push(h4);
break;
case "L":
i3(), a3.push([e6[0], e6[1]]);
break;
case "C":
if (!r3.length) {
const t7 = a3.length ? a3[a3.length - 1] : h4;
r3.push([t7[0], t7[1]]);
}
r3.push([e6[0], e6[1]]), r3.push([e6[2], e6[3]]), r3.push([e6[4], e6[5]]);
break;
case "Z":
i3(), a3.push([h4[0], h4[1]]);
}
if (c3(), !s3) return o3;
const l4 = [];
for (const t6 of o3) {
const e6 = U2(t6, s3);
e6.length && l4.push(e6);
}
return l4;
})(t4, 1, h3 ? 4 - 4 * (s2.simplification || 1) : (1 + s2.roughness) / 2), i2 = _2(t4, s2);
if (o2) if ("solid" === s2.fillStyle) if (1 === r2.length) {
const e4 = _2(t4, Object.assign(Object.assign({}, s2), { disableMultiStroke: true, roughness: s2.roughness ? s2.roughness + s2.fillShapeRoughnessGain : 0 }));
n2.push({ type: "fillPath", ops: this._mergedShape(e4.ops) });
} else n2.push(I2(r2, s2));
else n2.push(C2(r2, s2));
return a2 && (h3 ? r2.forEach(((t5) => {
n2.push(S3(t5, false, s2));
})) : n2.push(i2)), this._d("path", n2, s2);
}
opsToPath(t4, e3) {
let s2 = "";
for (const n2 of t4.ops) {
const t5 = "number" == typeof e3 && e3 >= 0 ? n2.data.map(((t6) => +t6.toFixed(e3))) : n2.data;
switch (n2.op) {
case "move":
s2 += `M${t5[0]} ${t5[1]} `;
break;
case "bcurveTo":
s2 += `C${t5[0]} ${t5[1]}, ${t5[2]} ${t5[3]}, ${t5[4]} ${t5[5]} `;
break;
case "lineTo":
s2 += `L${t5[0]} ${t5[1]} `;
}
}
return s2.trim();
}
toPaths(t4) {
const e3 = t4.sets || [], s2 = t4.options || this.defaultOptions, n2 = [];
for (const t5 of e3) {
let e4 = null;
switch (t5.type) {
case "path":
e4 = { d: this.opsToPath(t5), stroke: s2.stroke, strokeWidth: s2.strokeWidth, fill: tt };
break;
case "fillPath":
e4 = { d: this.opsToPath(t5), stroke: tt, strokeWidth: 0, fill: s2.fill || tt };
break;
case "fillSketch":
e4 = this.fillSketch(t5, s2);
}
e4 && n2.push(e4);
}
return n2;
}
fillSketch(t4, e3) {
let s2 = e3.fillWeight;
return s2 < 0 && (s2 = e3.strokeWidth / 2), { d: this.opsToPath(t4), stroke: e3.fill || tt, strokeWidth: s2, fill: tt };
}
_mergedShape(t4) {
return t4.filter(((t5, e3) => 0 === e3 || "move" !== t5.op));
}
};
st = class {
static {
__name(this, "st");
}
constructor(t4, e3) {
this.canvas = t4, this.ctx = this.canvas.getContext("2d"), this.gen = new et(e3);
}
draw(t4) {
const e3 = t4.sets || [], s2 = t4.options || this.getDefaultOptions(), n2 = this.ctx, o2 = t4.options.fixedDecimalPlaceDigits;
for (const a2 of e3) switch (a2.type) {
case "path":
n2.save(), n2.strokeStyle = "none" === s2.stroke ? "transparent" : s2.stroke, n2.lineWidth = s2.strokeWidth, s2.strokeLineDash && n2.setLineDash(s2.strokeLineDash), s2.strokeLineDashOffset && (n2.lineDashOffset = s2.strokeLineDashOffset), this._drawToContext(n2, a2, o2), n2.restore();
break;
case "fillPath": {
n2.save(), n2.fillStyle = s2.fill || "";
const e4 = "curve" === t4.shape || "polygon" === t4.shape || "path" === t4.shape ? "evenodd" : "nonzero";
this._drawToContext(n2, a2, o2, e4), n2.restore();
break;
}
case "fillSketch":
this.fillSketch(n2, a2, s2);
}
}
fillSketch(t4, e3, s2) {
let n2 = s2.fillWeight;
n2 < 0 && (n2 = s2.strokeWidth / 2), t4.save(), s2.fillLineDash && t4.setLineDash(s2.fillLineDash), s2.fillLineDashOffset && (t4.lineDashOffset = s2.fillLineDashOffset), t4.strokeStyle = s2.fill || "", t4.lineWidth = n2, this._drawToContext(t4, e3, s2.fixedDecimalPlaceDigits), t4.restore();
}
_drawToContext(t4, e3, s2, n2 = "nonzero") {
t4.beginPath();
for (const n3 of e3.ops) {
const e4 = "number" == typeof s2 && s2 >= 0 ? n3.data.map(((t5) => +t5.toFixed(s2))) : n3.data;
switch (n3.op) {
case "move":
t4.moveTo(e4[0], e4[1]);
break;
case "bcurveTo":
t4.bezierCurveTo(e4[0], e4[1], e4[2], e4[3], e4[4], e4[5]);
break;
case "lineTo":
t4.lineTo(e4[0], e4[1]);
}
}
"fillPath" === e3.type ? t4.fill(n2) : t4.stroke();
}
get generator() {
return this.gen;
}
getDefaultOptions() {
return this.gen.defaultOptions;
}
line(t4, e3, s2, n2, o2) {
const a2 = this.gen.line(t4, e3, s2, n2, o2);
return this.draw(a2), a2;
}
rectangle(t4, e3, s2, n2, o2) {
const a2 = this.gen.rectangle(t4, e3, s2, n2, o2);
return this.draw(a2), a2;
}
ellipse(t4, e3, s2, n2, o2) {
const a2 = this.gen.ellipse(t4, e3, s2, n2, o2);
return this.draw(a2), a2;
}
circle(t4, e3, s2, n2) {
const o2 = this.gen.circle(t4, e3, s2, n2);
return this.draw(o2), o2;
}
linearPath(t4, e3) {
const s2 = this.gen.linearPath(t4, e3);
return this.draw(s2), s2;
}
polygon(t4, e3) {
const s2 = this.gen.polygon(t4, e3);
return this.draw(s2), s2;
}
arc(t4, e3, s2, n2, o2, a2, h3 = false, r2) {
const i2 = this.gen.arc(t4, e3, s2, n2, o2, a2, h3, r2);
return this.draw(i2), i2;
}
curve(t4, e3) {
const s2 = this.gen.curve(t4, e3);
return this.draw(s2), s2;
}
path(t4, e3) {
const s2 = this.gen.path(t4, e3);
return this.draw(s2), s2;
}
};
nt = "http://www.w3.org/2000/svg";
ot = class {
static {
__name(this, "ot");
}
constructor(t4, e3) {
this.svg = t4, this.gen = new et(e3);
}
draw(t4) {
const e3 = t4.sets || [], s2 = t4.options || this.getDefaultOptions(), n2 = this.svg.ownerDocument || window.document, o2 = n2.createElementNS(nt, "g"), a2 = t4.options.fixedDecimalPlaceDigits;
for (const h3 of e3) {
let e4 = null;
switch (h3.type) {
case "path":
e4 = n2.createElementNS(nt, "path"), e4.setAttribute("d", this.opsToPath(h3, a2)), e4.setAttribute("stroke", s2.stroke), e4.setAttribute("stroke-width", s2.strokeWidth + ""), e4.setAttribute("fill", "none"), s2.strokeLineDash && e4.setAttribute("stroke-dasharray", s2.strokeLineDash.join(" ").trim()), s2.strokeLineDashOffset && e4.setAttribute("stroke-dashoffset", `${s2.strokeLineDashOffset}`);
break;
case "fillPath":
e4 = n2.createElementNS(nt, "path"), e4.setAttribute("d", this.opsToPath(h3, a2)), e4.setAttribute("stroke", "none"), e4.setAttribute("stroke-width", "0"), e4.setAttribute("fill", s2.fill || ""), "curve" !== t4.shape && "polygon" !== t4.shape || e4.setAttribute("fill-rule", "evenodd");
break;
case "fillSketch":
e4 = this.fillSketch(n2, h3, s2);
}
e4 && o2.appendChild(e4);
}
return o2;
}
fillSketch(t4, e3, s2) {
let n2 = s2.fillWeight;
n2 < 0 && (n2 = s2.strokeWidth / 2);
const o2 = t4.createElementNS(nt, "path");
return o2.setAttribute("d", this.opsToPath(e3, s2.fixedDecimalPlaceDigits)), o2.setAttribute("stroke", s2.fill || ""), o2.setAttribute("stroke-width", n2 + ""), o2.setAttribute("fill", "none"), s2.fillLineDash && o2.setAttribute("stroke-dasharray", s2.fillLineDash.join(" ").trim()), s2.fillLineDashOffset && o2.setAttribute("stroke-dashoffset", `${s2.fillLineDashOffset}`), o2;
}
get generator() {
return this.gen;
}
getDefaultOptions() {
return this.gen.defaultOptions;
}
opsToPath(t4, e3) {
return this.gen.opsToPath(t4, e3);
}
line(t4, e3, s2, n2, o2) {
const a2 = this.gen.line(t4, e3, s2, n2, o2);
return this.draw(a2);
}
rectangle(t4, e3, s2, n2, o2) {
const a2 = this.gen.rectangle(t4, e3, s2, n2, o2);
return this.draw(a2);
}
ellipse(t4, e3, s2, n2, o2) {
const a2 = this.gen.ellipse(t4, e3, s2, n2, o2);
return this.draw(a2);
}
circle(t4, e3, s2, n2) {
const o2 = this.gen.circle(t4, e3, s2, n2);
return this.draw(o2);
}
linearPath(t4, e3) {
const s2 = this.gen.linearPath(t4, e3);
return this.draw(s2);
}
polygon(t4, e3) {
const s2 = this.gen.polygon(t4, e3);
return this.draw(s2);
}
arc(t4, e3, s2, n2, o2, a2, h3 = false, r2) {
const i2 = this.gen.arc(t4, e3, s2, n2, o2, a2, h3, r2);
return this.draw(i2);
}
curve(t4, e3) {
const s2 = this.gen.curve(t4, e3);
return this.draw(s2);
}
path(t4, e3) {
const s2 = this.gen.path(t4, e3);
return this.draw(s2);
}
};
at = { canvas: /* @__PURE__ */ __name((t4, e3) => new st(t4, e3), "canvas"), svg: /* @__PURE__ */ __name((t4, e3) => new ot(t4, e3), "svg"), generator: /* @__PURE__ */ __name((t4) => new et(t4), "generator"), newSeed: /* @__PURE__ */ __name(() => et.newSeed(), "newSeed") };
}
});
// 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 options2 = userNodeOverrides(node2, { fill: "black", stroke: "none", fillStyle: "solid" });
if (node2.look !== "handDrawn") {
options2.roughness = 0;
}
const roughNode = rc.circle(0, 0, radius2 * 2, options2);
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";
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 y6 = centerY + ry * Math.sin(angle3);
points.push({ x: x5, y: y6 });
}
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 w4 = bbox.width + node2.padding + 20;
const h3 = bbox.height + node2.padding;
const ry = h3 / 2;
const rx = ry / (2.5 + h3 / 50);
const { cssStyles } = node2;
const points = [
{ x: w4 / 2, y: -h3 / 2 },
{ x: -w4 / 2, y: -h3 / 2 },
...generateArcPoints(-w4 / 2, -h3 / 2, -w4 / 2, h3 / 2, rx, ry, false),
{ x: w4 / 2, y: h3 / 2 },
...generateArcPoints(w4 / 2, h3 / 2, w4 / 2, -h3 / 2, rx, ry, true)
];
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const bowTieRectPath = createPathFromPoints(points);
const bowTieRectShapePath = rc.path(bowTieRectPath, options2);
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/shapes/insertPolygonShape.ts
function insertPolygonShape(parent4, w4, h3, points) {
return parent4.insert("polygon", ":first-child").attr(
"points",
points.map(function(d3) {
return d3.x + "," + d3.y;
}).join(" ")
).attr("class", "label-container").attr("transform", "translate(" + -w4 / 2 + "," + h3 / 2 + ")");
}
var init_insertPolygonShape = __esm({
"src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts"() {
"use strict";
__name(insertPolygonShape, "insertPolygonShape");
}
});
// 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 h3 = bbox.height + node2.padding;
const padding2 = 12;
const w4 = bbox.width + node2.padding + padding2;
const left3 = 0;
const right3 = w4;
const top2 = -h3;
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 options2 = userNodeOverrides(node2, {});
const pathData = createPathFromPoints(points);
const roughNode = rc.path(pathData, options2);
polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w4 / 2}, ${h3 / 2})`);
if (cssStyles) {
polygon2.attr("style", cssStyles);
}
} else {
polygon2 = insertPolygonShape(shapeSvg, w4, h3, 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";
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_insertPolygonShape();
init_util();
__name(card, "card");
}
});
// 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 options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const choicePath = createPathFromPoints(points);
const roughNode = rc.path(choicePath, options2);
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_intersect();
init_rough_esm();
init_handDrawnShapeStyles();
init_util();
__name(choice, "choice");
}
});
// src/rendering-util/rendering-elements/shapes/circle.ts
async function circle(parent4, node2, options2) {
const { labelStyles, nodeStyles } = styles2String(node2);
node2.labelStyle = labelStyles;
const { shapeSvg, bbox, halfPadding } = await labelHelper(parent4, node2, getNodeClasses(node2));
const padding2 = options2?.padding ?? halfPadding;
const radius2 = bbox.width / 2 + padding2;
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.calcIntersect = function(bounds4, point8) {
const radius3 = bounds4.width / 2;
return intersect_default.circle(bounds4, radius3, point8);
};
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_rough_esm();
init_logger();
init_utils2();
init_intersect();
init_handDrawnShapeStyles();
init_util();
__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 options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const circleNode = rc.circle(0, 0, radius2 * 2, options2);
const linePath = createLine(radius2);
const lineNode = rc.path(linePath, options2);
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 init_crossedCircle = __esm({
"src/rendering-util/rendering-elements/shapes/crossedCircle.ts"() {
"use strict";
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 y6 = centerY + radius2 * Math.sin(angle2);
points.push({ x: -x5, y: -y6 });
}
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 w4 = bbox.width + (node2.padding ?? 0);
const h3 = bbox.height + (node2.padding ?? 0);
const radius2 = Math.max(5, h3 * 0.1);
const { cssStyles } = node2;
const points = [
...generateCirclePoints2(w4 / 2, -h3 / 2, radius2, 30, -90, 0),
{ x: -w4 / 2 - radius2, y: radius2 },
...generateCirclePoints2(w4 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
...generateCirclePoints2(w4 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
{ x: -w4 / 2 - radius2, y: -h3 / 2 },
...generateCirclePoints2(w4 / 2, h3 / 2, radius2, 20, 0, 90)
];
const rectPoints = [
{ x: w4 / 2, y: -h3 / 2 - radius2 },
{ x: -w4 / 2, y: -h3 / 2 - radius2 },
...generateCirclePoints2(w4 / 2, -h3 / 2, radius2, 20, -90, 0),
{ x: -w4 / 2 - radius2, y: -radius2 },
...generateCirclePoints2(w4 / 2 + w4 * 0.1, -radius2, radius2, 20, -180, -270),
...generateCirclePoints2(w4 / 2 + w4 * 0.1, radius2, radius2, 20, -90, -180),
{ x: -w4 / 2 - radius2, y: h3 / 2 },
...generateCirclePoints2(w4 / 2, h3 / 2, radius2, 20, 0, 90),
{ x: -w4 / 2, y: h3 / 2 + radius2 },
{ x: w4 / 2, y: h3 / 2 + radius2 }
];
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, { fill: "none" });
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const curlyBraceLeftPath = createPathFromPoints(points);
const newCurlyBracePath = curlyBraceLeftPath.replace("Z", "");
const curlyBraceLeftNode = rc.path(newCurlyBracePath, options2);
const rectPath = createPathFromPoints(rectPoints);
const rectShape = rc.path(rectPath, { ...options2 });
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(${-w4 / 2 + radius2 - (bbox.x - (bbox.left ?? 0))},${-h3 / 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 y6 = centerY + radius2 * Math.sin(angle2);
points.push({ x: x5, y: y6 });
}
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 w4 = bbox.width + (node2.padding ?? 0);
const h3 = bbox.height + (node2.padding ?? 0);
const radius2 = Math.max(5, h3 * 0.1);
const { cssStyles } = node2;
const points = [
...generateCirclePoints3(w4 / 2, -h3 / 2, radius2, 20, -90, 0),
{ x: w4 / 2 + radius2, y: -radius2 },
...generateCirclePoints3(w4 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
...generateCirclePoints3(w4 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
{ x: w4 / 2 + radius2, y: h3 / 2 },
...generateCirclePoints3(w4 / 2, h3 / 2, radius2, 20, 0, 90)
];
const rectPoints = [
{ x: -w4 / 2, y: -h3 / 2 - radius2 },
{ x: w4 / 2, y: -h3 / 2 - radius2 },
...generateCirclePoints3(w4 / 2, -h3 / 2, radius2, 20, -90, 0),
{ x: w4 / 2 + radius2, y: -radius2 },
...generateCirclePoints3(w4 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
...generateCirclePoints3(w4 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
{ x: w4 / 2 + radius2, y: h3 / 2 },
...generateCirclePoints3(w4 / 2, h3 / 2, radius2, 20, 0, 90),
{ x: w4 / 2, y: h3 / 2 + radius2 },
{ x: -w4 / 2, y: h3 / 2 + radius2 }
];
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, { fill: "none" });
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const curlyBraceRightPath = createPathFromPoints(points);
const newCurlyBracePath = curlyBraceRightPath.replace("Z", "");
const curlyBraceRightNode = rc.path(newCurlyBracePath, options2);
const rectPath = createPathFromPoints(rectPoints);
const rectShape = rc.path(rectPath, { ...options2 });
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(${-w4 / 2 + (node2.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h3 / 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 y6 = centerY + radius2 * Math.sin(angle2);
points.push({ x: -x5, y: -y6 });
}
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 w4 = bbox.width + (node2.padding ?? 0);
const h3 = bbox.height + (node2.padding ?? 0);
const radius2 = Math.max(5, h3 * 0.1);
const { cssStyles } = node2;
const leftCurlyBracePoints = [
...generateCirclePoints4(w4 / 2, -h3 / 2, radius2, 30, -90, 0),
{ x: -w4 / 2 - radius2, y: radius2 },
...generateCirclePoints4(w4 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
...generateCirclePoints4(w4 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
{ x: -w4 / 2 - radius2, y: -h3 / 2 },
...generateCirclePoints4(w4 / 2, h3 / 2, radius2, 20, 0, 90)
];
const rightCurlyBracePoints = [
...generateCirclePoints4(-w4 / 2 + radius2 + radius2 / 2, -h3 / 2, radius2, 20, -90, -180),
{ x: w4 / 2 - radius2 / 2, y: radius2 },
...generateCirclePoints4(-w4 / 2 - radius2 / 2, -radius2, radius2, 20, 0, 90),
...generateCirclePoints4(-w4 / 2 - radius2 / 2, radius2, radius2, 20, -90, 0),
{ x: w4 / 2 - radius2 / 2, y: -radius2 },
...generateCirclePoints4(-w4 / 2 + radius2 + radius2 / 2, h3 / 2, radius2, 30, -180, -270)
];
const rectPoints = [
{ x: w4 / 2, y: -h3 / 2 - radius2 },
{ x: -w4 / 2, y: -h3 / 2 - radius2 },
...generateCirclePoints4(w4 / 2, -h3 / 2, radius2, 20, -90, 0),
{ x: -w4 / 2 - radius2, y: -radius2 },
...generateCirclePoints4(w4 / 2 + radius2 * 2, -radius2, radius2, 20, -180, -270),
...generateCirclePoints4(w4 / 2 + radius2 * 2, radius2, radius2, 20, -90, -180),
{ x: -w4 / 2 - radius2, y: h3 / 2 },
...generateCirclePoints4(w4 / 2, h3 / 2, radius2, 20, 0, 90),
{ x: -w4 / 2, y: h3 / 2 + radius2 },
{ x: w4 / 2 - radius2 - radius2 / 2, y: h3 / 2 + radius2 },
...generateCirclePoints4(-w4 / 2 + radius2 + radius2 / 2, -h3 / 2, radius2, 20, -90, -180),
{ x: w4 / 2 - radius2 / 2, y: radius2 },
...generateCirclePoints4(-w4 / 2 - radius2 / 2, -radius2, radius2, 20, 0, 90),
...generateCirclePoints4(-w4 / 2 - radius2 / 2, radius2, radius2, 20, -90, 0),
{ x: w4 / 2 - radius2 / 2, y: -radius2 },
...generateCirclePoints4(-w4 / 2 + radius2 + radius2 / 2, h3 / 2, radius2, 30, -180, -270)
];
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, { fill: "none" });
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const leftCurlyBracePath = createPathFromPoints(leftCurlyBracePoints);
const newLeftCurlyBracePath = leftCurlyBracePath.replace("Z", "");
const leftCurlyBraceNode = rc.path(newLeftCurlyBracePath, options2);
const rightCurlyBracePath = createPathFromPoints(rightCurlyBracePoints);
const newRightCurlyBracePath = rightCurlyBracePath.replace("Z", "");
const rightCurlyBraceNode = rc.path(newRightCurlyBracePath, options2);
const rectPath = createPathFromPoints(rectPoints);
const rectShape = rc.path(rectPath, { ...options2 });
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(${-w4 / 2 + (node2.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h3 / 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 w4 = Math.max(minWidth, (bbox.width + (node2.padding ?? 0) * 2) * 1.25, node2?.width ?? 0);
const h3 = Math.max(minHeight, bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const radius2 = h3 / 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const totalWidth = w4, totalHeight = h3;
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, options2);
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(${-w4 / 2}, ${-h3 / 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/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 w4 = Math.max(bbox.width + node2.padding, node2.width ?? 0);
const rx = w4 / 2;
const ry = rx / (2.5 + w4 / 50);
const h3 = 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, w4, h3, rx, ry);
const innerPathData = createInnerCylinderPathD(0, ry, w4, h3, 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, w4, h3, 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(${-w4 / 2}, ${-(h3 / 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 y6 = ry * ry * (1 - x5 * x5 / (rx * rx));
if (y6 > 0) {
y6 = Math.sqrt(y6);
}
y6 = ry - y6;
if (point8.y - (node2.y ?? 0) > 0) {
y6 = -y6;
}
pos.y += y6;
}
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, y6, width3, height2, rx, ry) => {
return [
`M${x5},${y6 + 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, y6, width3, height2, rx, ry) => {
return [
`M${x5},${y6 + ry}`,
`M${x5 + width3},${y6 + 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, y6, 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 w4 = bbox.width + node2.padding;
const h3 = bbox.height + node2.padding;
const rectOffset = h3 * 0.2;
const x5 = -w4 / 2;
const y6 = -h3 / 2 - rectOffset / 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const pts2 = [
{ x: x5, y: y6 + rectOffset },
{ x: -x5, y: y6 + rectOffset },
{ x: -x5, y: -y6 },
{ x: x5, y: -y6 },
{ x: x5, y: y6 },
{ x: -x5, y: y6 },
{ x: -x5, y: y6 + rectOffset }
];
const poly = rc.polygon(
pts2.map((p3) => [p3.x, p3.y]),
options2
);
const polygon2 = shapeSvg.insert(() => poly, ":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);
}
label.attr(
"transform",
`translate(${x5 + (node2.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))}, ${y6 + 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;
}
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");
}
});
// 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 init_doubleCircle = __esm({
"src/rendering-util/rendering-elements/shapes/doubleCircle.ts"() {
"use strict";
init_logger();
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_utils2();
__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 options2 = userNodeOverrides(node2, { fillStyle: "solid" });
if (node2.look !== "handDrawn") {
options2.roughness = 0;
}
const circleNode = rc.circle(0, 0, radius2 * 2, options2);
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_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 w4 = bbox.width + (node2.padding ?? 0);
const h3 = w4 + bbox.height;
const tw = w4 + bbox.height;
const points = [
{ x: 0, y: -h3 },
{ x: tw, y: -h3 },
{ x: tw / 2, y: 0 }
];
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const pathData = createPathFromPoints(points);
const roughNode = rc.path(pathData, options2);
const flippedTriangle2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-h3 / 2}, ${h3 / 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 = w4;
node2.height = h3;
updateNodeBounds(node2, flippedTriangle2);
label.attr(
"transform",
`translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-h3 / 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();
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_util();
__name(flippedTriangle, "flippedTriangle");
}
});
// src/rendering-util/rendering-elements/shapes/forkJoin.ts
function forkJoin(parent4, node2, { dir: dir2, config: { state: state3, 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 y6 = -1 * height2 / 2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {
stroke: themeVariables.lineColor,
fill: themeVariables.lineColor
});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const roughNode = rc.rectangle(x5, y6, width3, height2, options2);
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 = state3?.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_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 w4 = Math.max(minWidth, bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(minHeight, bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const radius2 = h3 / 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: -w4 / 2, y: -h3 / 2 },
{ x: w4 / 2 - radius2, y: -h3 / 2 },
...generateCirclePoints(-w4 / 2 + radius2, 0, radius2, 50, 90, 270),
{ x: w4 / 2 - radius2, y: h3 / 2 },
{ x: -w4 / 2, y: h3 / 2 }
];
const pathData = createPathFromPoints(points);
const shapeNode = rc.path(pathData, options2);
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 init_halfRoundedRectangle = __esm({
"src/rendering-util/rendering-elements/shapes/halfRoundedRectangle.ts"() {
"use strict";
init_logger();
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
__name(halfRoundedRectangle, "halfRoundedRectangle");
}
});
// 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 h3 = bbox.height + (node2.padding ?? 0);
const w4 = bbox.width + (node2.padding ?? 0) * 2.5;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
let halfWidth = w4 / 2;
const m3 = halfWidth / 6;
halfWidth = halfWidth + m3;
const halfHeight = h3 / 2;
const fixedLength = halfHeight / 2;
const deducedWidth = halfWidth - fixedLength;
const points = [
{ x: -deducedWidth, y: -halfHeight },
{ x: 0, y: -halfHeight },
{ x: deducedWidth, y: -halfHeight },
{ x: halfWidth, y: 0 },
{ x: deducedWidth, y: halfHeight },
{ x: 0, y: halfHeight },
{ x: -deducedWidth, y: halfHeight },
{ x: -halfWidth, y: 0 }
];
const pathData = createPathFromPoints(points);
const shapeNode = rc.path(pathData, options2);
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);
}
node2.width = w4;
node2.height = h3;
updateNodeBounds(node2, polygon2);
node2.intersect = function(point8) {
return intersect_default.polygon(node2, points, point8);
};
return shapeSvg;
}
var init_hexagon = __esm({
"src/rendering-util/rendering-elements/shapes/hexagon.ts"() {
"use strict";
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
__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 w4 = Math.max(30, node2?.width ?? 0);
const h3 = Math.max(30, node2?.height ?? 0);
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: 0, y: 0 },
{ x: w4, y: 0 },
{ x: 0, y: h3 },
{ x: w4, y: h3 }
];
const pathData = createPathFromPoints(points);
const shapeNode = rc.path(pathData, options2);
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(${-w4 / 2}, ${-h3 / 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 init_hourglass = __esm({
"src/rendering-util/rendering-elements/shapes/hourglass.ts"() {
"use strict";
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 y6 = -height2 / 2;
const labelPadding = node2.label ? 8 : 0;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, { stroke: "none", fill: "none" });
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const iconNode = rc.rectangle(x5, y6, width3, height2, options2);
const outerWidth = Math.max(width3, bbox.width);
const outerHeight = height2 + bbox.height + labelPadding;
const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
...options2,
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};`);
}
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_icon = __esm({
"src/rendering-util/rendering-elements/shapes/icon.ts"() {
"use strict";
init_rough_esm();
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 options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const fill = stylesMap.get("fill");
options2.stroke = fill ?? mainBkg;
const iconElem = shapeSvg.append("g");
if (node2.icon) {
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;
const diameter = Math.max(iconWidth, iconHeight) * Math.SQRT2 + padding2 * 2;
const iconNode = rc.circle(0, 0, diameter, options2);
const outerWidth = Math.max(diameter, bbox.width);
const outerHeight = diameter + bbox.height + labelPadding;
const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
...options2,
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_rough_esm();
init_logger();
init_icons();
init_intersect();
init_handDrawnShapeStyles();
init_util();
__name(iconCircle, "iconCircle");
}
});
// src/rendering-util/rendering-elements/shapes/roundedRectPath.ts
var createRoundedRectPathD;
var init_roundedRectPath = __esm({
"src/rendering-util/rendering-elements/shapes/roundedRectPath.ts"() {
"use strict";
createRoundedRectPathD = /* @__PURE__ */ __name((x5, y6, totalWidth, totalHeight, radius2) => [
"M",
x5 + radius2,
y6,
// 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,
y6 + radius2,
// Draw arc to the right top corner
"V",
y6 + totalHeight - radius2,
// Draw vertical line down to the beginning of the right bottom corner
"A",
radius2,
radius2,
0,
0,
1,
x5 + totalWidth - radius2,
y6 + 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,
y6 + totalHeight - radius2,
// Draw arc to the left bottom corner
"V",
y6 + radius2,
// Draw vertical line up to the beginning of the left top corner
"A",
radius2,
radius2,
0,
0,
1,
x5 + radius2,
y6,
// Draw arc to the left top corner
"Z"
// Close the path
].join(" "), "createRoundedRectPathD");
}
});
// 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 y6 = -height2 / 2;
const labelPadding = node2.label ? 8 : 0;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const fill = stylesMap.get("fill");
options2.stroke = fill ?? mainBkg;
const iconNode = rc.path(createRoundedRectPathD(x5, y6, width3, height2, 5), options2);
const outerWidth = Math.max(width3, bbox.width);
const outerHeight = height2 + bbox.height + labelPadding;
const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
...options2,
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};`);
}
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_rough_esm();
init_logger();
init_icons();
init_intersect();
init_handDrawnShapeStyles();
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 y6 = -height2 / 2;
const labelPadding = node2.label ? 8 : 0;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const fill = stylesMap.get("fill");
options2.stroke = fill ?? mainBkg;
const iconNode = rc.path(createRoundedRectPathD(x5, y6, width3, height2, 0.1), options2);
const outerWidth = Math.max(width3, bbox.width);
const outerHeight = height2 + bbox.height + labelPadding;
const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
...options2,
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};`);
}
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_rough_esm();
init_logger();
init_icons();
init_intersect();
init_roundedRectPath();
init_handDrawnShapeStyles();
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 y6 = -imageHeight / 2;
const labelPadding = node2.label ? 8 : 0;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const imageNode = rc.rectangle(x5, y6, imageWidth, imageHeight, options2);
const outerWidth = Math.max(imageWidth, bbox.width);
const outerHeight = imageHeight + bbox.height + labelPadding;
const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
...options2,
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})`
);
}
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_rough_esm();
init_logger();
init_intersect();
init_handDrawnShapeStyles();
init_util();
__name(imageSquare, "imageSquare");
}
});
// 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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const points = [
{ x: 0, y: 0 },
{ x: w4, y: 0 },
{ x: w4 + 3 * h3 / 6, y: -h3 },
{ x: -3 * h3 / 6, y: -h3 }
];
let polygon2;
const { cssStyles } = node2;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const pathData = createPathFromPoints(points);
const roughNode = rc.path(pathData, options2);
polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w4 / 2}, ${h3 / 2})`);
if (cssStyles) {
polygon2.attr("style", cssStyles);
}
} else {
polygon2 = insertPolygonShape(shapeSvg, w4, h3, points);
}
if (nodeStyles) {
polygon2.attr("style", nodeStyles);
}
node2.width = w4;
node2.height = h3;
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_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_insertPolygonShape();
__name(inv_trapezoid, "inv_trapezoid");
}
});
// src/rendering-util/rendering-elements/shapes/drawRect.ts
async function drawRect3(parent4, node2, options2) {
const { labelStyles, nodeStyles } = styles2String(node2);
node2.labelStyle = labelStyles;
const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
const totalWidth = Math.max(bbox.width + options2.labelPaddingX * 2, node2?.width || 0);
const totalHeight = Math.max(bbox.height + options2.labelPaddingY * 2, node2?.height || 0);
const x5 = -totalWidth / 2;
const y6 = -totalHeight / 2;
let rect3;
let { rx, ry } = node2;
const { cssStyles } = node2;
if (options2?.rx && options2.ry) {
rx = options2.rx;
ry = options2.ry;
}
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options3 = userNodeOverrides(node2, {});
const roughNode = rx || ry ? rc.path(createRoundedRectPathD(x5, y6, totalWidth, totalHeight, rx || 0), options3) : rc.rectangle(x5, y6, totalWidth, totalHeight, 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", handleUndefinedAttr(rx)).attr("ry", handleUndefinedAttr(ry)).attr("x", x5).attr("y", y6).attr("width", totalWidth).attr("height", totalHeight);
}
updateNodeBounds(node2, rect3);
node2.calcIntersect = function(bounds4, point8) {
return intersect_default.rect(bounds4, point8);
};
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_util();
init_intersect();
init_roundedRectPath();
init_handDrawnShapeStyles();
init_rough_esm();
init_utils2();
__name(drawRect3, "drawRect");
}
});
// 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_labelRect = __esm({
"src/rendering-util/rendering-elements/shapes/labelRect.ts"() {
"use strict";
init_drawRect();
init_util();
init_intersect();
__name(labelRect, "labelRect");
}
});
// 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 w4 = Math.max(bbox.width + (node2.padding ?? 0), node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0), node2?.height ?? 0);
const points = [
{ x: 0, y: 0 },
{ x: w4 + 3 * h3 / 6, y: 0 },
{ x: w4, y: -h3 },
{ x: -(3 * h3) / 6, y: -h3 }
];
let polygon2;
const { cssStyles } = node2;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const pathData = createPathFromPoints(points);
const roughNode = rc.path(pathData, options2);
polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w4 / 2}, ${h3 / 2})`);
if (cssStyles) {
polygon2.attr("style", cssStyles);
}
} else {
polygon2 = insertPolygonShape(shapeSvg, w4, h3, points);
}
if (nodeStyles) {
polygon2.attr("style", nodeStyles);
}
node2.width = w4;
node2.height = h3;
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_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_insertPolygonShape();
__name(lean_left, "lean_left");
}
});
// 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 w4 = Math.max(bbox.width + (node2.padding ?? 0), node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0), node2?.height ?? 0);
const points = [
{ x: -3 * h3 / 6, y: 0 },
{ x: w4, y: 0 },
{ x: w4 + 3 * h3 / 6, y: -h3 },
{ x: 0, y: -h3 }
];
let polygon2;
const { cssStyles } = node2;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const pathData = createPathFromPoints(points);
const roughNode = rc.path(pathData, options2);
polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w4 / 2}, ${h3 / 2})`);
if (cssStyles) {
polygon2.attr("style", cssStyles);
}
} else {
polygon2 = insertPolygonShape(shapeSvg, w4, h3, points);
}
if (nodeStyles) {
polygon2.attr("style", nodeStyles);
}
node2.width = w4;
node2.height = h3;
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_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
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 options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const linePath = createPathFromPoints(points);
const lineNode = rc.path(linePath, options2);
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 w4 = Math.max(bbox.width + (node2.padding ?? 0), node2.width ?? 0);
const rx = w4 / 2;
const ry = rx / (2.5 + w4 / 50);
const h3 = Math.max(bbox.height + ry + (node2.padding ?? 0), node2.height ?? 0);
const outerOffset = h3 * 0.1;
let cylinder3;
const { cssStyles } = node2;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const outerPathData = createOuterCylinderPathD2(0, 0, w4, h3, rx, ry, outerOffset);
const innerPathData = createInnerCylinderPathD2(0, ry, w4, h3, rx, ry);
const options2 = userNodeOverrides(node2, {});
const outerNode = rc.path(outerPathData, options2);
const innerLine = rc.path(innerPathData, options2);
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, w4, h3, 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(${-w4 / 2}, ${-(h3 / 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 y6 = ry * ry * (1 - x5 * x5 / (rx * rx));
if (y6 > 0) {
y6 = Math.sqrt(y6);
}
y6 = ry - y6;
if (point8.y - (node2.y ?? 0) > 0) {
y6 = -y6;
}
pos.y += y6;
}
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, y6, width3, height2, rx, ry, outerOffset) => {
return [
`M${x5},${y6 + 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}`,
`M${x5},${y6 + ry + outerOffset}`,
`a${rx},${ry} 0,0,0 ${width3},0`
].join(" ");
}, "createCylinderPathD");
createOuterCylinderPathD2 = /* @__PURE__ */ __name((x5, y6, width3, height2, rx, ry, outerOffset) => {
return [
`M${x5},${y6 + ry}`,
`M${x5 + width3},${y6 + ry}`,
`a${rx},${ry} 0,0,0 ${-width3},0`,
`l0,${height2}`,
`a${rx},${ry} 0,0,0 ${width3},0`,
`l0,${-height2}`,
`M${x5},${y6 + ry + outerOffset}`,
`a${rx},${ry} 0,0,0 ${width3},0`
].join(" ");
}, "createOuterCylinderPathD");
createInnerCylinderPathD2 = /* @__PURE__ */ __name((x5, y6, width3, height2, rx, ry) => {
return [`M${x5 - width3 / 2},${-height2 / 2}`, `a${rx},${ry} 0,0,0 ${width3},0`].join(" ");
}, "createInnerCylinderPathD");
__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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const waveAmplitude = h3 / 4;
const finalH = h3 + waveAmplitude;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: -w4 / 2 - w4 / 2 * 0.1, y: -finalH / 2 },
{ x: -w4 / 2 - w4 / 2 * 0.1, y: finalH / 2 },
...generateFullSineWavePoints(
-w4 / 2 - w4 / 2 * 0.1,
finalH / 2,
w4 / 2 + w4 / 2 * 0.1,
finalH / 2,
waveAmplitude,
0.8
),
{ x: w4 / 2 + w4 / 2 * 0.1, y: -finalH / 2 },
{ x: -w4 / 2 - w4 / 2 * 0.1, y: -finalH / 2 },
{ x: -w4 / 2, y: -finalH / 2 },
{ x: -w4 / 2, y: finalH / 2 * 1.1 },
{ x: -w4 / 2, y: -finalH / 2 }
];
const poly = rc.polygon(
points.map((p3) => [p3.x, p3.y]),
options2
);
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(${-w4 / 2 + (node2.padding ?? 0) + w4 / 2 * 0.1 / 2 - (bbox.x - (bbox.left ?? 0))},${-h3 / 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_util();
init_intersect();
init_rough_esm();
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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const rectOffset = 5;
const x5 = -w4 / 2;
const y6 = -h3 / 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const outerPathPoints = [
{ x: x5 - rectOffset, y: y6 + rectOffset },
{ x: x5 - rectOffset, y: y6 + h3 + rectOffset },
{ x: x5 + w4 - rectOffset, y: y6 + h3 + rectOffset },
{ x: x5 + w4 - rectOffset, y: y6 + h3 },
{ x: x5 + w4, y: y6 + h3 },
{ x: x5 + w4, y: y6 + h3 - rectOffset },
{ x: x5 + w4 + rectOffset, y: y6 + h3 - rectOffset },
{ x: x5 + w4 + rectOffset, y: y6 - rectOffset },
{ x: x5 + rectOffset, y: y6 - rectOffset },
{ x: x5 + rectOffset, y: y6 },
{ x: x5, y: y6 },
{ x: x5, y: y6 + rectOffset }
];
const innerPathPoints = [
{ x: x5, y: y6 + rectOffset },
{ x: x5 + w4 - rectOffset, y: y6 + rectOffset },
{ x: x5 + w4 - rectOffset, y: y6 + h3 },
{ x: x5 + w4, y: y6 + h3 },
{ x: x5 + w4, y: y6 },
{ x: x5, y: y6 }
];
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const outerPath = createPathFromPoints(outerPathPoints);
const outerNode = rc.path(outerPath, options2);
const innerPath3 = createPathFromPoints(innerPathPoints);
const innerNode = rc.path(innerPath3, { ...options2, 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_util();
init_handDrawnShapeStyles();
init_rough_esm();
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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const waveAmplitude = h3 / 4;
const finalH = h3 + waveAmplitude;
const x5 = -w4 / 2;
const y6 = -finalH / 2;
const rectOffset = 5;
const { cssStyles } = node2;
const wavePoints = generateFullSineWavePoints(
x5 - rectOffset,
y6 + finalH + rectOffset,
x5 + w4 - rectOffset,
y6 + finalH + rectOffset,
waveAmplitude,
0.8
);
const lastWavePoint = wavePoints?.[wavePoints.length - 1];
const outerPathPoints = [
{ x: x5 - rectOffset, y: y6 + rectOffset },
{ x: x5 - rectOffset, y: y6 + finalH + rectOffset },
...wavePoints,
{ x: x5 + w4 - rectOffset, y: lastWavePoint.y - rectOffset },
{ x: x5 + w4, y: lastWavePoint.y - rectOffset },
{ x: x5 + w4, y: lastWavePoint.y - 2 * rectOffset },
{ x: x5 + w4 + rectOffset, y: lastWavePoint.y - 2 * rectOffset },
{ x: x5 + w4 + rectOffset, y: y6 - rectOffset },
{ x: x5 + rectOffset, y: y6 - rectOffset },
{ x: x5 + rectOffset, y: y6 },
{ x: x5, y: y6 },
{ x: x5, y: y6 + rectOffset }
];
const innerPathPoints = [
{ x: x5, y: y6 + rectOffset },
{ x: x5 + w4 - rectOffset, y: y6 + rectOffset },
{ x: x5 + w4 - rectOffset, y: lastWavePoint.y - rectOffset },
{ x: x5 + w4, y: lastWavePoint.y - rectOffset },
{ x: x5 + w4, y: y6 },
{ x: x5, y: y6 }
];
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const outerPath = createPathFromPoints(outerPathPoints);
const outerNode = rc.path(outerPath, options2);
const innerPath3 = createPathFromPoints(innerPathPoints);
const innerNode = rc.path(innerPath3, options2);
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/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, label } = 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 y6 = -totalHeight / 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {
fill: themeVariables.noteBkgColor,
stroke: themeVariables.noteBorderColor
});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const noteShapeNode = rc.rectangle(x5, y6, totalWidth, totalHeight, options2);
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);
}
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_note = __esm({
"src/rendering-util/rendering-elements/shapes/note.ts"() {
"use strict";
init_rough_esm();
init_intersect();
init_handDrawnShapeStyles();
init_util();
init_config();
__name(note, "note");
}
});
// src/rendering-util/rendering-elements/shapes/question.ts
async function question(parent4, node2) {
const { labelStyles, nodeStyles } = styles2String(node2);
node2.labelStyle = labelStyles;
const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
const w4 = bbox.width + node2.padding;
const h3 = bbox.height + node2.padding;
const s2 = w4 + h3;
const adjustment = 0.5;
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 options2 = userNodeOverrides(node2, {});
const pathData = createDecisionBoxPathD(0, 0, s2);
const roughNode = rc.path(pathData, options2);
polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-s2 / 2 + adjustment}, ${s2 / 2})`);
if (cssStyles) {
polygon2.attr("style", cssStyles);
}
} else {
polygon2 = insertPolygonShape(shapeSvg, s2, s2, points);
polygon2.attr("transform", `translate(${-s2 / 2 + adjustment}, ${s2 / 2})`);
}
if (nodeStyles) {
polygon2.attr("style", nodeStyles);
}
updateNodeBounds(node2, polygon2);
node2.calcIntersect = function(bounds4, point8) {
const s3 = bounds4.width;
const points2 = [
{ x: s3 / 2, y: 0 },
{ x: s3, y: -s3 / 2 },
{ x: s3 / 2, y: -s3 },
{ x: 0, y: -s3 / 2 }
];
const res = intersect_default.polygon(bounds4, points2, point8);
return { x: res.x - 0.5, y: res.y - 0.5 };
};
node2.intersect = function(point8) {
return this.calcIntersect(node2, point8);
};
return shapeSvg;
}
var createDecisionBoxPathD;
var init_question = __esm({
"src/rendering-util/rendering-elements/shapes/question.ts"() {
"use strict";
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_insertPolygonShape();
createDecisionBoxPathD = /* @__PURE__ */ __name((x5, y6, size4) => {
return [
`M${x5 + size4 / 2},${y6}`,
`L${x5 + size4},${y6 - size4 / 2}`,
`L${x5 + size4 / 2},${y6 - size4}`,
`L${x5},${y6 - size4 / 2}`,
"Z"
].join(" ");
}, "createDecisionBoxPathD");
__name(question, "question");
}
});
// 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 w4 = Math.max(bbox.width + (node2.padding ?? 0), node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0), node2?.height ?? 0);
const x5 = -w4 / 2;
const y6 = -h3 / 2;
const notch = y6 / 2;
const points = [
{ x: x5 + notch, y: y6 },
{ x: x5, y: 0 },
{ x: x5 + notch, y: -y6 },
{ x: -x5, y: -y6 },
{ x: -x5, y: y6 }
];
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const pathData = createPathFromPoints(points);
const roughNode = rc.path(pathData, options2);
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_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
__name(rect_left_inv_arrow, "rect_left_inv_arrow");
}
});
// 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");
const config5 = getConfig2();
let label = node2.label;
if (node2.label && hasKatex(node2.label)) {
label = await renderKatexSanitized(node2.label.replace(common_default.lineBreakRegex, "\n"), config5);
}
const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel";
const labelSpan = '" + label + "";
div.html(sanitizeText(labelSpan, config5));
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_src32();
init_diagramAPI();
init_common();
init_logger();
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 (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;
}
}, "createLabel");
createLabel_default = createLabel;
}
});
// 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 y6 = -bbox.height / 2 - halfPadding;
let rect3;
let innerLine;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const roughNode = rc.path(
createRoundedRectPathD(x5, y6, totalWidth, totalHeight, node2.rx || 0),
options2
);
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,
options2
);
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_src32();
init_common();
init_util();
init_createLabel();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_diagramAPI();
init_roundedRectPath();
init_logger();
__name(rectWithTitle, "rectWithTitle");
}
});
// src/rendering-util/rendering-elements/shapes/roundedRect.ts
function generateArcPoints2(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 y6 = centerY + ry * Math.sin(angle3);
points.push({ x: x5, y: y6 });
}
return points;
}
async function roundedRect(parent4, node2) {
const { labelStyles, nodeStyles } = styles2String(node2);
node2.labelStyle = labelStyles;
const { shapeSvg, bbox } = await labelHelper(parent4, node2, getNodeClasses(node2));
const labelPaddingX = node2?.padding ?? 0;
const labelPaddingY = node2?.padding ?? 0;
const w4 = (node2?.width ? node2?.width : bbox.width) + labelPaddingX * 2;
const h3 = (node2?.height ? node2?.height : bbox.height) + labelPaddingY * 2;
const radius2 = node2.radius || 5;
const taper = node2.taper || 5;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.stroke) {
options2.stroke = node2.stroke;
}
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
// Top edge (left to right)
{ x: -w4 / 2 + taper, y: -h3 / 2 },
// Top-left corner start (1)
{ x: w4 / 2 - taper, y: -h3 / 2 },
// Top-right corner start (2)
...generateArcPoints2(w4 / 2 - taper, -h3 / 2, w4 / 2, -h3 / 2 + taper, radius2, radius2, true),
// Top-left arc (2 to 3)
// Right edge (top to bottom)
{ x: w4 / 2, y: -h3 / 2 + taper },
// Top-right taper point (3)
{ x: w4 / 2, y: h3 / 2 - taper },
// Bottom-right taper point (4)
...generateArcPoints2(w4 / 2, h3 / 2 - taper, w4 / 2 - taper, h3 / 2, radius2, radius2, true),
// Top-left arc (4 to 5)
// Bottom edge (right to left)
{ x: w4 / 2 - taper, y: h3 / 2 },
// Bottom-right corner start (5)
{ x: -w4 / 2 + taper, y: h3 / 2 },
// Bottom-left corner start (6)
...generateArcPoints2(-w4 / 2 + taper, h3 / 2, -w4 / 2, h3 / 2 - taper, radius2, radius2, true),
// Top-left arc (4 to 5)
// Left edge (bottom to top)
{ x: -w4 / 2, y: h3 / 2 - taper },
// Bottom-left taper point (7)
{ x: -w4 / 2, y: -h3 / 2 + taper },
// Top-left taper point (8)
...generateArcPoints2(-w4 / 2, -h3 / 2 + taper, -w4 / 2 + taper, -h3 / 2, radius2, radius2, true)
// Top-left arc (4 to 5)
];
const pathData = createPathFromPoints(points);
const shapeNode = rc.path(pathData, options2);
const polygon2 = shapeSvg.insert(() => shapeNode, ":first-child");
polygon2.attr("class", "basic label-container outer-path");
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 init_roundedRect = __esm({
"src/rendering-util/rendering-elements/shapes/roundedRect.ts"() {
"use strict";
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
__name(generateArcPoints2, "generateArcPoints");
__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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const x5 = -bbox.width / 2 - halfPadding;
const y6 = -bbox.height / 2 - halfPadding;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: x5, y: y6 },
{ x: x5 + w4 + 8, y: y6 },
{ x: x5 + w4 + 8, y: y6 + h3 },
{ x: x5 - 8, y: y6 + h3 },
{ x: x5 - 8, y: y6 },
{ x: x5, y: y6 },
{ x: x5, y: y6 + h3 }
];
const roughNode = rc.polygon(
points.map((p3) => [p3.x, p3.y]),
options2
);
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(${-w4 / 2 + 4 + (node2.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h3 / 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_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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const x5 = -w4 / 2;
const y6 = -h3 / 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: x5, y: y6 },
{ x: x5, y: y6 + h3 },
{ x: x5 + w4, y: y6 + h3 },
{ x: x5 + w4, y: y6 - h3 / 2 }
];
const pathData = createPathFromPoints(points);
const shapeNode = rc.path(pathData, options2);
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, ${h3 / 4})`);
label.attr(
"transform",
`translate(${-w4 / 2 + (node2.padding ?? 0) - (bbox.x - (bbox.left ?? 0))}, ${-h3 / 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_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
__name(slopedRect, "slopedRect");
}
});
// src/rendering-util/rendering-elements/shapes/squareRect.ts
async function squareRect(parent4, node2) {
const options2 = {
rx: 0,
ry: 0,
classes: "",
labelPaddingX: node2.labelPaddingX ?? (node2?.padding || 0) * 2,
labelPaddingY: (node2?.padding || 0) * 1
};
return drawRect3(parent4, node2, options2);
}
var init_squareRect = __esm({
"src/rendering-util/rendering-elements/shapes/squareRect.ts"() {
"use strict";
init_drawRect();
__name(squareRect, "squareRect");
}
});
// 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 h3 = bbox.height + node2.padding;
const w4 = bbox.width + h3 / 4 + node2.padding;
const radius2 = h3 / 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: -w4 / 2 + radius2, y: -h3 / 2 },
{ x: w4 / 2 - radius2, y: -h3 / 2 },
...generateCirclePoints(-w4 / 2 + radius2, 0, radius2, 50, 90, 270),
{ x: w4 / 2 - radius2, y: h3 / 2 },
...generateCirclePoints(w4 / 2 - radius2, 0, radius2, 50, 270, 450)
];
const pathData = createPathFromPoints(points);
const shapeNode = rc.path(pathData, options2);
const polygon2 = shapeSvg.insert(() => shapeNode, ":first-child");
polygon2.attr("class", "basic label-container outer-path");
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 init_stadium = __esm({
"src/rendering-util/rendering-elements/shapes/stadium.ts"() {
"use strict";
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
__name(stadium, "stadium");
}
});
// src/rendering-util/rendering-elements/shapes/state.ts
async function state(parent4, node2) {
const options2 = {
rx: 5,
ry: 5,
classes: "flowchart-node"
};
return drawRect3(parent4, node2, options2);
}
var init_state = __esm({
"src/rendering-util/rendering-elements/shapes/state.ts"() {
"use strict";
init_drawRect();
__name(state, "state");
}
});
// 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 options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const roughNode = rc.circle(0, 0, 14, {
...options2,
stroke: lineColor,
strokeWidth: 2
});
const innerFill = stateBorder ?? nodeBorder;
const roughInnerNode = rc.circle(0, 0, 5, {
...options2,
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 (nodeStyles) {
circle6.selectAll("path").attr("style", nodeStyles);
}
updateNodeBounds(node2, circle6);
node2.intersect = function(point8) {
return intersect_default.circle(node2, 7, point8);
};
return shapeSvg;
}
var init_stateEnd = __esm({
"src/rendering-util/rendering-elements/shapes/stateEnd.ts"() {
"use strict";
init_rough_esm();
init_intersect();
init_handDrawnShapeStyles();
init_util();
__name(stateEnd, "stateEnd");
}
});
// 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);
}
updateNodeBounds(node2, circle6);
node2.intersect = function(point8) {
return intersect_default.circle(node2, 7, point8);
};
return shapeSvg;
}
var init_stateStart = __esm({
"src/rendering-util/rendering-elements/shapes/stateStart.ts"() {
"use strict";
init_rough_esm();
init_intersect();
init_handDrawnShapeStyles();
init_util();
__name(stateStart, "stateStart");
}
});
// 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 w4 = bbox.width + node2.padding;
const h3 = bbox.height + node2.padding;
const x5 = -bbox.width / 2 - halfPadding;
const y6 = -bbox.height / 2 - halfPadding;
const points = [
{ x: 0, y: 0 },
{ x: w4, y: 0 },
{ x: w4, y: -h3 },
{ x: 0, y: -h3 },
{ x: 0, y: 0 },
{ x: -8, y: 0 },
{ x: w4 + 8, y: 0 },
{ x: w4 + 8, y: -h3 },
{ x: -8, y: -h3 },
{ x: -8, y: 0 }
];
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const roughNode = rc.rectangle(x5 - 8, y6, w4 + 16, h3, options2);
const l1 = rc.line(x5, y6, x5, y6 + h3, options2);
const l22 = rc.line(x5 + w4, y6, x5 + w4, y6 + h3, options2);
shapeSvg.insert(() => l1, ":first-child");
shapeSvg.insert(() => l22, ":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, w4, h3, points);
if (nodeStyles) {
el.attr("style", nodeStyles);
}
updateNodeBounds(node2, el);
}
node2.intersect = function(point8) {
return intersect_default.polygon(node2, points, point8);
};
return shapeSvg;
}
var init_subroutine = __esm({
"src/rendering-util/rendering-elements/shapes/subroutine.ts"() {
"use strict";
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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const x5 = -w4 / 2;
const y6 = -h3 / 2;
const tagWidth = 0.2 * h3;
const tagHeight = 0.2 * h3;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const rectPoints = [
{ x: x5 - tagWidth / 2, y: y6 },
{ x: x5 + w4 + tagWidth / 2, y: y6 },
{ x: x5 + w4 + tagWidth / 2, y: y6 + h3 },
{ x: x5 - tagWidth / 2, y: y6 + h3 }
];
const tagPoints = [
{ x: x5 + w4 - tagWidth / 2, y: y6 + h3 },
{ x: x5 + w4 + tagWidth / 2, y: y6 + h3 },
{ x: x5 + w4 + tagWidth / 2, y: y6 + h3 - tagHeight }
];
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const rectPath = createPathFromPoints(rectPoints);
const rectNode = rc.path(rectPath, options2);
const tagPath = createPathFromPoints(tagPoints);
const tagNode = rc.path(tagPath, { ...options2, 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 init_taggedRect = __esm({
"src/rendering-util/rendering-elements/shapes/taggedRect.ts"() {
"use strict";
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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const waveAmplitude = h3 / 4;
const tagWidth = 0.2 * w4;
const tagHeight = 0.2 * h3;
const finalH = h3 + waveAmplitude;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: -w4 / 2 - w4 / 2 * 0.1, y: finalH / 2 },
...generateFullSineWavePoints(
-w4 / 2 - w4 / 2 * 0.1,
finalH / 2,
w4 / 2 + w4 / 2 * 0.1,
finalH / 2,
waveAmplitude,
0.8
),
{ x: w4 / 2 + w4 / 2 * 0.1, y: -finalH / 2 },
{ x: -w4 / 2 - w4 / 2 * 0.1, y: -finalH / 2 }
];
const x5 = -w4 / 2 + w4 / 2 * 0.1;
const y6 = -finalH / 2 - tagHeight * 0.4;
const tagPoints = [
{ x: x5 + w4 - tagWidth, y: (y6 + h3) * 1.4 },
{ x: x5 + w4, y: y6 + h3 - tagHeight },
{ x: x5 + w4, y: (y6 + h3) * 0.9 },
...generateFullSineWavePoints(
x5 + w4,
(y6 + h3) * 1.3,
x5 + w4 - tagWidth,
(y6 + h3) * 1.5,
-h3 * 0.03,
0.5
)
];
const waveEdgeRectPath = createPathFromPoints(points);
const waveEdgeRectNode = rc.path(waveEdgeRectPath, options2);
const taggedWaveEdgeRectPath = createPathFromPoints(tagPoints);
const taggedWaveEdgeRectNode = rc.path(taggedWaveEdgeRectPath, {
...options2,
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(${-w4 / 2 + (node2.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h3 / 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_taggedWaveEdgedRectangle = __esm({
"src/rendering-util/rendering-elements/shapes/taggedWaveEdgedRectangle.ts"() {
"use strict";
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 y6 = -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", y6).attr("width", totalWidth).attr("height", totalHeight);
updateNodeBounds(node2, rect3);
node2.intersect = function(point8) {
return intersect_default.rect(node2, point8);
};
return shapeSvg;
}
var init_text3 = __esm({
"src/rendering-util/rendering-elements/shapes/text.ts"() {
"use strict";
init_util();
init_intersect();
init_handDrawnShapeStyles();
__name(text3, "text");
}
});
// 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 h3 = bbox.height + labelPadding;
const ry = h3 / 2;
const rx = ry / (2.5 + h3 / 50);
const w4 = bbox.width + rx + labelPadding;
const { cssStyles } = node2;
let cylinder3;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const outerPathData = createOuterCylinderPathD3(0, 0, w4, h3, rx, ry);
const innerPathData = createInnerCylinderPathD3(0, 0, w4, h3, 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, w4, h3, 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);
}
}
cylinder3.attr("label-offset-x", rx);
cylinder3.attr("transform", `translate(${-w4 / 2}, ${h3 / 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 y6 = pos.y - (node2.y ?? 0);
if (ry != 0 && (Math.abs(y6) < (node2.height ?? 0) / 2 || Math.abs(y6) == (node2.height ?? 0) / 2 && Math.abs(pos.x - (node2.x ?? 0)) > (node2.width ?? 0) / 2 - rx)) {
let x5 = rx * rx * (1 - y6 * y6 / (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 createCylinderPathD3, createOuterCylinderPathD3, createInnerCylinderPathD3;
var init_tiltedCylinder = __esm({
"src/rendering-util/rendering-elements/shapes/tiltedCylinder.ts"() {
"use strict";
init_util();
init_handDrawnShapeStyles();
init_rough_esm();
init_intersect();
init_utils2();
createCylinderPathD3 = /* @__PURE__ */ __name((x5, y6, width3, height2, rx, ry) => {
return `M${x5},${y6}
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, y6, width3, height2, rx, ry) => {
return [
`M${x5},${y6}`,
`M${x5 + width3},${y6}`,
`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, y6, width3, height2, rx, ry) => {
return [`M${x5 + width3 / 2},${-height2 / 2}`, `a${rx},${ry} 0,0,0 0,${height2}`].join(" ");
}, "createInnerCylinderPathD");
__name(tiltedCylinder, "tiltedCylinder");
}
});
// 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 w4 = bbox.width + node2.padding;
const h3 = bbox.height + node2.padding;
const points = [
{ x: -3 * h3 / 6, y: 0 },
{ x: w4 + 3 * h3 / 6, y: 0 },
{ x: w4, y: -h3 },
{ x: 0, y: -h3 }
];
let polygon2;
const { cssStyles } = node2;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const pathData = createPathFromPoints(points);
const roughNode = rc.path(pathData, options2);
polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w4 / 2}, ${h3 / 2})`);
if (cssStyles) {
polygon2.attr("style", cssStyles);
}
} else {
polygon2 = insertPolygonShape(shapeSvg, w4, h3, points);
}
if (nodeStyles) {
polygon2.attr("style", nodeStyles);
}
node2.width = w4;
node2.height = h3;
updateNodeBounds(node2, polygon2);
node2.intersect = function(point8) {
return intersect_default.polygon(node2, points, point8);
};
return shapeSvg;
}
var init_trapezoid = __esm({
"src/rendering-util/rendering-elements/shapes/trapezoid.ts"() {
"use strict";
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 w4 = Math.max(minWidth, bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(minHeight, bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: -w4 / 2 * 0.8, y: -h3 / 2 },
{ x: w4 / 2 * 0.8, y: -h3 / 2 },
{ x: w4 / 2, y: -h3 / 2 * 0.6 },
{ x: w4 / 2, y: h3 / 2 },
{ x: -w4 / 2, y: h3 / 2 },
{ x: -w4 / 2, y: -h3 / 2 * 0.6 }
];
const pathData = createPathFromPoints(points);
const shapeNode = rc.path(pathData, options2);
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 init_trapezoidalPentagon = __esm({
"src/rendering-util/rendering-elements/shapes/trapezoidalPentagon.ts"() {
"use strict";
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 w4 = bbox.width + (node2.padding ?? 0);
const h3 = w4 + bbox.height;
const tw = w4 + bbox.height;
const points = [
{ x: 0, y: 0 },
{ x: tw, y: 0 },
{ x: tw / 2, y: -h3 }
];
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const pathData = createPathFromPoints(points);
const roughNode = rc.path(pathData, options2);
const polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-h3 / 2}, ${h3 / 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 = w4;
node2.height = h3;
updateNodeBounds(node2, polygon2);
label.attr(
"transform",
`translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${h3 / 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 init_triangle = __esm({
"src/rendering-util/rendering-elements/shapes/triangle.ts"() {
"use strict";
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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const waveAmplitude = h3 / 8;
const finalH = h3 + waveAmplitude;
const { cssStyles } = node2;
const minWidth = 70;
const widthDif = minWidth - w4;
const extraW = widthDif > 0 ? widthDif / 2 : 0;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: -w4 / 2 - extraW, y: finalH / 2 },
...generateFullSineWavePoints(
-w4 / 2 - extraW,
finalH / 2,
w4 / 2 + extraW,
finalH / 2,
waveAmplitude,
0.8
),
{ x: w4 / 2 + extraW, y: -finalH / 2 },
{ x: -w4 / 2 - extraW, y: -finalH / 2 }
];
const waveEdgeRectPath = createPathFromPoints(points);
const waveEdgeRectNode = rc.path(waveEdgeRectPath, options2);
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(${-w4 / 2 + (node2.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h3 / 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 init_waveEdgedRectangle = __esm({
"src/rendering-util/rendering-elements/shapes/waveEdgedRectangle.ts"() {
"use strict";
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 w4 = baseWidth;
let h3 = baseHeight;
if (w4 > h3 * aspectRatio) {
h3 = w4 / aspectRatio;
} else {
w4 = h3 * aspectRatio;
}
w4 = Math.max(w4, minWidth);
h3 = Math.max(h3, minHeight);
const waveAmplitude = Math.min(h3 * 0.2, h3 / 4);
const finalH = h3 + waveAmplitude * 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const points = [
{ x: -w4 / 2, y: finalH / 2 },
...generateFullSineWavePoints(-w4 / 2, finalH / 2, w4 / 2, finalH / 2, waveAmplitude, 1),
{ x: w4 / 2, y: -finalH / 2 },
...generateFullSineWavePoints(w4 / 2, -finalH / 2, -w4 / 2, -finalH / 2, waveAmplitude, -1)
];
const waveRectPath = createPathFromPoints(points);
const waveRectNode = rc.path(waveRectPath, options2);
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 init_waveRectangle = __esm({
"src/rendering-util/rendering-elements/shapes/waveRectangle.ts"() {
"use strict";
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 w4 = Math.max(bbox.width + (node2.padding ?? 0) * 2, node2?.width ?? 0);
const h3 = Math.max(bbox.height + (node2.padding ?? 0) * 2, node2?.height ?? 0);
const rectOffset = 5;
const x5 = -w4 / 2;
const y6 = -h3 / 2;
const { cssStyles } = node2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const outerPathPoints = [
{ x: x5 - rectOffset, y: y6 - rectOffset },
{ x: x5 - rectOffset, y: y6 + h3 },
{ x: x5 + w4, y: y6 + h3 },
{ x: x5 + w4, y: y6 - rectOffset }
];
const path4 = `M${x5 - rectOffset},${y6 - rectOffset} L${x5 + w4},${y6 - rectOffset} L${x5 + w4},${y6 + h3} L${x5 - rectOffset},${y6 + h3} L${x5 - rectOffset},${y6 - rectOffset}
M${x5 - rectOffset},${y6} L${x5 + w4},${y6}
M${x5},${y6 - rectOffset} L${x5},${y6 + h3}`;
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const no = rc.path(path4, options2);
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 init_windowPane = __esm({
"src/rendering-util/rendering-elements/shapes/windowPane.ts"() {
"use strict";
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, nodeStyles } = styles2String(node2);
if (entityNode.attributes.length === 0 && node2.label) {
const options3 = {
rx: 0,
ry: 0,
labelPaddingX: PADDING,
labelPaddingY: PADDING * 1.5,
classes: ""
};
if (calculateTextWidth(node2.label, config5) + options3.labelPaddingX * 2 < config5.er.minEntityWidth) {
node2.width = config5.er.minEntityWidth;
}
const shapeSvg2 = await drawRect3(parent4, node2, options3);
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 = [];
const rows = [];
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);
const rowHeight = Math.max(typeBBox.height, nameBBox2.height, keysBBox.height, commentBBox.height) + TEXT_PADDING;
rows.push({ yOffset, rowHeight });
yOffset += rowHeight;
}
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 maxWidth2 = maxTypeWidth + maxNameWidth + maxKeysWidth + maxCommentWidth;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
let totalShapeBBoxHeight = 0;
if (rows.length > 0) {
totalShapeBBoxHeight = rows.reduce((sum2, row) => sum2 + (row?.rowHeight ?? 0), 0);
}
const w4 = Math.max(shapeBBox.width + PADDING * 2, node2?.width || 0, maxWidth2);
const h3 = Math.max((totalShapeBBoxHeight ?? 0) + nameBBox.height, node2?.height || 0);
const x5 = -w4 / 2;
const y6 = -h3 / 2;
shapeSvg.selectAll("g:not(:first-child)").each((_3, i2, nodes5) => {
const text4 = select_default2(nodes5[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 + y6 + nameBBox.height + TEXT_PADDING / 2})`
);
});
shapeSvg.select(".name").attr("transform", "translate(" + -nameBBox.width / 2 + ", " + (y6 + TEXT_PADDING / 2) + ")");
const roughRect = rc.rectangle(x5, y6, w4, h3, options2);
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, row] of rows.entries()) {
const contentRowIndex = i2 + 1;
const isEven = contentRowIndex % 2 === 0 && row.yOffset !== 0;
const roughRect2 = rc.rectangle(x5, nameBBox.height + y6 + row?.yOffset, w4, row?.rowHeight, {
...options2,
fill: isEven ? rowEven : rowOdd,
stroke: nodeBorder
});
shapeSvg.insert(() => roughRect2, "g.label").attr("style", cssStyles.join("")).attr("class", `row-rect-${isEven ? "even" : "odd"}`);
}
let roughLine = rc.line(x5, nameBBox.height + y6, w4 + x5, nameBBox.height + y6, options2);
shapeSvg.insert(() => roughLine).attr("class", "divider");
roughLine = rc.line(maxTypeWidth + x5, nameBBox.height + y6, maxTypeWidth + x5, h3 + y6, options2);
shapeSvg.insert(() => roughLine).attr("class", "divider");
if (keysPresent) {
roughLine = rc.line(
maxTypeWidth + maxNameWidth + x5,
nameBBox.height + y6,
maxTypeWidth + maxNameWidth + x5,
h3 + y6,
options2
);
shapeSvg.insert(() => roughLine).attr("class", "divider");
}
if (commentPresent) {
roughLine = rc.line(
maxTypeWidth + maxNameWidth + maxKeysWidth + x5,
nameBBox.height + y6,
maxTypeWidth + maxNameWidth + maxKeysWidth + x5,
h3 + y6,
options2
);
shapeSvg.insert(() => roughLine).attr("class", "divider");
}
for (const yOffset2 of yOffsets) {
roughLine = rc.line(
x5,
nameBBox.height + y6 + yOffset2,
w4 + x5,
nameBBox.height + y6 + yOffset2,
options2
);
shapeSvg.insert(() => roughLine).attr("class", "divider");
}
updateNodeBounds(node2, rect3);
if (nodeStyles && node2.look !== "handDrawn") {
const allStyle = nodeStyles.split(";");
const strokeStyles = allStyle?.filter((e3) => {
return e3.includes("stroke");
})?.map((s2) => `${s2}`).join("; ");
shapeSvg.selectAll("path").attr("style", strokeStyles ?? "");
shapeSvg.selectAll(".row-rect-even path").attr("style", nodeStyles);
}
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(">", ">");
}
}
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);
}
return bbox;
}
var init_erBox = __esm({
"src/rendering-util/rendering-elements/shapes/erBox.ts"() {
"use strict";
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;
}
if (!useHtmlLabels && textContent.startsWith("\\")) {
textContent = textContent.substring(1);
}
if (hasKatex(textContent)) {
useHtmlLabels = true;
}
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);
}
textEl.attr("transform", "translate(0," + (-bbox.height / (2 * numberOfLines) + yOffset) + ")");
return bbox.height;
}
var init_shapeUtil = __esm({
"src/diagrams/class/shapeUtil.ts"() {
"use strict";
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 options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const w4 = bbox.width;
let h3 = bbox.height;
if (classNode.members.length === 0 && classNode.methods.length === 0) {
h3 += GAP;
} else if (classNode.members.length > 0 && classNode.methods.length === 0) {
h3 += GAP * 2;
}
const x5 = -w4 / 2;
const y6 = -h3 / 2;
const roughRect = rc.rectangle(
x5 - PADDING,
y6 - PADDING - (renderExtraBox ? PADDING : classNode.members.length === 0 && classNode.methods.length === 0 ? -PADDING / 2 : 0),
w4 + 2 * PADDING,
h3 + 2 * PADDING + (renderExtraBox ? PADDING * 2 : classNode.members.length === 0 && classNode.methods.length === 0 ? -PADDING : 0),
options2
);
const rect3 = shapeSvg.insert(() => roughRect, ":first-child");
rect3.attr("class", "basic label-container");
const rectBBox = rect3.node().getBBox();
shapeSvg.selectAll(".text").each((_3, i2, nodes5) => {
const text4 = select_default2(nodes5[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 + y6 + 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(_4, i3, nodes6) {
if (window.getComputedStyle(nodes6[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 + y6 + PADDING,
rectBBox.x + rectBBox.width,
annotationGroupHeight + labelGroupHeight + y6 + PADDING,
options2
);
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 + y6 + GAP * 2 + PADDING,
rectBBox.x + rectBBox.width,
annotationGroupHeight + labelGroupHeight + membersGroupHeight + y6 + PADDING + GAP * 2,
options2
);
const line2 = shapeSvg.insert(() => roughLine);
line2.attr("class", "divider").attr("style", styles4);
}
if (classNode.look !== "handDrawn") {
shapeSvg.selectAll("path").attr("style", styles4);
}
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);
}
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);
}
}
}
updateNodeBounds(node2, rect3);
node2.intersect = function(point8) {
return intersect_default.rect(node2, point8);
};
return shapeSvg;
}
var init_classBox = __esm({
"src/rendering-util/rendering-elements/shapes/classBox.ts"() {
"use strict";
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
);
}
const totalWidth = (shapeSvg.node()?.getBBox().width ?? 200) + padding2;
const totalHeight = (shapeSvg.node()?.getBBox().height ?? 200) + padding2;
const x5 = -totalWidth / 2;
const y6 = -totalHeight / 2;
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
if (node2.look !== "handDrawn") {
options2.roughness = 0;
options2.fillStyle = "solid";
}
const roughRect = rc.rectangle(x5, y6, totalWidth, totalHeight, options2);
const rect3 = shapeSvg.insert(() => roughRect, ":first-child");
rect3.attr("class", "basic label-container").attr("style", nodeStyles);
shapeSvg.selectAll(".label").each((_3, i2, nodes5) => {
const text4 = select_default2(nodes5[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,
y6 + typeHeight + nameHeight + gap,
x5 + totalWidth,
y6 + typeHeight + nameHeight + gap,
options2
);
const dividerLine = shapeSvg.insert(() => roughLine);
dividerLine.attr("style", nodeStyles);
}
updateNodeBounds(node2, rect3);
node2.intersect = function(point8) {
return intersect_default.rect(node2, point8);
};
return shapeSvg;
}
async function addText3(parentGroup, inputText, yOffset, style3 = "") {
if (inputText === "") {
return 0;
}
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);
}
}
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);
}
textEl.attr("transform", `translate(${-bbox.width / 2},${-bbox.height / 2 + yOffset})`);
return bbox.height;
}
var init_requirementBox = __esm({
"src/rendering-util/rendering-elements/shapes/requirementBox.ts"() {
"use strict";
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 link2;
if ("ticket" in kanbanNode && kanbanNode.ticket && config5?.kanban?.ticketBaseUrl) {
ticketUrl = config5?.kanban?.ticketBaseUrl.replace("#TICKET#", kanbanNode.ticket);
link2 = shapeSvg.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", ticketUrl).attr("target", "_blank");
}
const options2 = {
useHtmlLabels: kanbanNode.useHtmlLabels,
labelStyle: kanbanNode.labelStyle || "",
width: kanbanNode.width,
img: kanbanNode.img,
padding: kanbanNode.padding || 8,
centerLabel: false
};
let labelEl, bbox2;
if (link2) {
({ label: labelEl, bbox: bbox2 } = await insertLabel(
link2,
"ticket" in kanbanNode && kanbanNode.ticket || "",
options2
));
} else {
({ label: labelEl, bbox: bbox2 } = await insertLabel(
shapeSvg,
"ticket" in kanbanNode && kanbanNode.ticket || "",
options2
));
}
const { label: labelElAssigned, bbox: bboxAssigned } = await insertLabel(
shapeSvg,
"assigned" in kanbanNode && kanbanNode.assigned || "",
options2
);
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 y6 = -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 options3 = userNodeOverrides(kanbanNode, {});
const roughNode = rx || ry ? rc.path(createRoundedRectPathD(x5, y6, totalWidth, totalHeight, rx || 0), options3) : rc.rectangle(x5, y6, totalWidth, totalHeight, options3);
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", y6).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 = y6 + Math.floor((rx ?? 0) / 2);
const y22 = y6 + 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 colorFromPriority;
var init_kanbanItem = __esm({
"src/rendering-util/rendering-elements/shapes/kanbanItem.ts"() {
"use strict";
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");
}
});
// src/rendering-util/rendering-elements/shapes/bang.ts
async function bang(parent4, node2) {
const { labelStyles, nodeStyles } = styles2String(node2);
node2.labelStyle = labelStyles;
const { shapeSvg, bbox, halfPadding, label } = await labelHelper(
parent4,
node2,
getNodeClasses(node2)
);
const w4 = bbox.width + 10 * halfPadding;
const h3 = bbox.height + 8 * halfPadding;
const r2 = 0.15 * w4;
const { cssStyles } = node2;
const minWidth = bbox.width + 20;
const minHeight = bbox.height + 20;
const effectiveWidth = Math.max(w4, minWidth);
const effectiveHeight = Math.max(h3, minHeight);
label.attr("transform", `translate(${-bbox.width / 2}, ${-bbox.height / 2})`);
let bangElem;
const path4 = `M0 0
a${r2},${r2} 1 0,0 ${effectiveWidth * 0.25},${-1 * effectiveHeight * 0.1}
a${r2},${r2} 1 0,0 ${effectiveWidth * 0.25},${0}
a${r2},${r2} 1 0,0 ${effectiveWidth * 0.25},${0}
a${r2},${r2} 1 0,0 ${effectiveWidth * 0.25},${effectiveHeight * 0.1}
a${r2},${r2} 1 0,0 ${effectiveWidth * 0.15},${effectiveHeight * 0.33}
a${r2 * 0.8},${r2 * 0.8} 1 0,0 0,${effectiveHeight * 0.34}
a${r2},${r2} 1 0,0 ${-1 * effectiveWidth * 0.15},${effectiveHeight * 0.33}
a${r2},${r2} 1 0,0 ${-1 * effectiveWidth * 0.25},${effectiveHeight * 0.15}
a${r2},${r2} 1 0,0 ${-1 * effectiveWidth * 0.25},0
a${r2},${r2} 1 0,0 ${-1 * effectiveWidth * 0.25},0
a${r2},${r2} 1 0,0 ${-1 * effectiveWidth * 0.25},${-1 * effectiveHeight * 0.15}
a${r2},${r2} 1 0,0 ${-1 * effectiveWidth * 0.1},${-1 * effectiveHeight * 0.33}
a${r2 * 0.8},${r2 * 0.8} 1 0,0 0,${-1 * effectiveHeight * 0.34}
a${r2},${r2} 1 0,0 ${effectiveWidth * 0.1},${-1 * effectiveHeight * 0.33}
H0 V0 Z`;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const roughNode = rc.path(path4, options2);
bangElem = shapeSvg.insert(() => roughNode, ":first-child");
bangElem.attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles));
} else {
bangElem = shapeSvg.insert("path", ":first-child").attr("class", "basic label-container").attr("style", nodeStyles).attr("d", path4);
}
bangElem.attr("transform", `translate(${-effectiveWidth / 2}, ${-effectiveHeight / 2})`);
updateNodeBounds(node2, bangElem);
node2.calcIntersect = function(bounds4, point8) {
return intersect_default.rect(bounds4, point8);
};
node2.intersect = function(point8) {
log.info("Bang intersect", node2, point8);
return intersect_default.rect(node2, point8);
};
return shapeSvg;
}
var init_bang = __esm({
"src/rendering-util/rendering-elements/shapes/bang.ts"() {
"use strict";
init_logger();
init_util();
init_intersect();
init_handDrawnShapeStyles();
init_rough_esm();
init_utils2();
__name(bang, "bang");
}
});
// src/rendering-util/rendering-elements/shapes/cloud.ts
async function cloud(parent4, node2) {
const { labelStyles, nodeStyles } = styles2String(node2);
node2.labelStyle = labelStyles;
const { shapeSvg, bbox, halfPadding, label } = await labelHelper(
parent4,
node2,
getNodeClasses(node2)
);
const w4 = bbox.width + 2 * halfPadding;
const h3 = bbox.height + 2 * halfPadding;
const r1 = 0.15 * w4;
const r2 = 0.25 * w4;
const r3 = 0.35 * w4;
const r4 = 0.2 * w4;
const { cssStyles } = node2;
let cloudElem;
const path4 = `M0 0
a${r1},${r1} 0 0,1 ${w4 * 0.25},${-1 * w4 * 0.1}
a${r3},${r3} 1 0,1 ${w4 * 0.4},${-1 * w4 * 0.1}
a${r2},${r2} 1 0,1 ${w4 * 0.35},${w4 * 0.2}
a${r1},${r1} 1 0,1 ${w4 * 0.15},${h3 * 0.35}
a${r4},${r4} 1 0,1 ${-1 * w4 * 0.15},${h3 * 0.65}
a${r2},${r1} 1 0,1 ${-1 * w4 * 0.25},${w4 * 0.15}
a${r3},${r3} 1 0,1 ${-1 * w4 * 0.5},0
a${r1},${r1} 1 0,1 ${-1 * w4 * 0.25},${-1 * w4 * 0.15}
a${r1},${r1} 1 0,1 ${-1 * w4 * 0.1},${-1 * h3 * 0.35}
a${r4},${r4} 1 0,1 ${w4 * 0.1},${-1 * h3 * 0.65}
H0 V0 Z`;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {});
const roughNode = rc.path(path4, options2);
cloudElem = shapeSvg.insert(() => roughNode, ":first-child");
cloudElem.attr("class", "basic label-container").attr("style", handleUndefinedAttr(cssStyles));
} else {
cloudElem = shapeSvg.insert("path", ":first-child").attr("class", "basic label-container").attr("style", nodeStyles).attr("d", path4);
}
label.attr("transform", `translate(${-bbox.width / 2}, ${-bbox.height / 2})`);
cloudElem.attr("transform", `translate(${-w4 / 2}, ${-h3 / 2})`);
updateNodeBounds(node2, cloudElem);
node2.calcIntersect = function(bounds4, point8) {
return intersect_default.rect(bounds4, point8);
};
node2.intersect = function(point8) {
log.info("Cloud intersect", node2, point8);
return intersect_default.rect(node2, point8);
};
return shapeSvg;
}
var init_cloud = __esm({
"src/rendering-util/rendering-elements/shapes/cloud.ts"() {
"use strict";
init_rough_esm();
init_logger();
init_utils2();
init_intersect();
init_handDrawnShapeStyles();
init_util();
__name(cloud, "cloud");
}
});
// src/rendering-util/rendering-elements/shapes/defaultMindmapNode.ts
async function defaultMindmapNode(parent4, node2) {
const { labelStyles, nodeStyles } = styles2String(node2);
node2.labelStyle = labelStyles;
const { shapeSvg, bbox, halfPadding, label } = await labelHelper(
parent4,
node2,
getNodeClasses(node2)
);
const w4 = bbox.width + 8 * halfPadding;
const h3 = bbox.height + 2 * halfPadding;
const rd = 5;
const rectPath = `
M${-w4 / 2} ${h3 / 2 - rd}
v${-h3 + 2 * rd}
q0,-${rd} ${rd},-${rd}
h${w4 - 2 * rd}
q${rd},0 ${rd},${rd}
v${h3 - 2 * rd}
q0,${rd} -${rd},${rd}
h${-w4 + 2 * rd}
q-${rd},0 -${rd},-${rd}
Z
`;
const bg = shapeSvg.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + node2.type).attr("style", nodeStyles).attr("d", rectPath);
shapeSvg.append("line").attr("class", "node-line-").attr("x1", -w4 / 2).attr("y1", h3 / 2).attr("x2", w4 / 2).attr("y2", h3 / 2);
label.attr("transform", `translate(${-bbox.width / 2}, ${-bbox.height / 2})`);
shapeSvg.append(() => label.node());
updateNodeBounds(node2, bg);
node2.calcIntersect = function(bounds4, point8) {
return intersect_default.rect(bounds4, point8);
};
node2.intersect = function(point8) {
return intersect_default.rect(node2, point8);
};
return shapeSvg;
}
var init_defaultMindmapNode = __esm({
"src/rendering-util/rendering-elements/shapes/defaultMindmapNode.ts"() {
"use strict";
init_intersect();
init_handDrawnShapeStyles();
init_util();
__name(defaultMindmapNode, "defaultMindmapNode");
}
});
// src/rendering-util/rendering-elements/shapes/mindmapCircle.ts
async function mindmapCircle(parent4, node2) {
const options2 = {
padding: node2.padding ?? 0
};
return circle(parent4, node2, options2);
}
var init_mindmapCircle = __esm({
"src/rendering-util/rendering-elements/shapes/mindmapCircle.ts"() {
"use strict";
init_circle();
__name(mindmapCircle, "mindmapCircle");
}
});
// src/rendering-util/rendering-elements/shapes.ts
function isValidShape(shape) {
return shape in shapes;
}
var shapesDefs, generateShapeMap, shapes;
var init_shapes = __esm({
"src/rendering-util/rendering-elements/shapes.ts"() {
"use strict";
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();
init_bang();
init_cloud();
init_defaultMindmapNode();
init_mindmapCircle();
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: "Bang",
name: "Bang",
shortName: "bang",
description: "Bang",
aliases: ["bang"],
handler: bang
},
{
semanticName: "Cloud",
name: "Cloud",
shortName: "cloud",
description: "cloud",
aliases: ["cloud"],
handler: cloud
},
{
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,
//Mindmap diagram
mindmapCircle,
defaultMindmapNode,
// 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");
}
});
// src/diagrams/flowchart/flowDb.ts
var MERMAID_DOM_ID_PREFIX, FlowDB;
var init_flowDb = __esm({
"src/diagrams/flowchart/flowDb.ts"() {
"use strict";
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(id30) {
for (const vertex of this.vertices.values()) {
if (vertex.id === id30) {
return vertex.domId;
}
}
return id30;
}
/**
* Function called by parser when a node definition has been found
*/
addVertex(id30, textObj, type3, style3, classes3, dir2, props = {}, metadata) {
if (!id30 || id30.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 === id30);
if (edge) {
const edgeDoc = doc;
if (edgeDoc?.animate !== void 0) {
edge.animate = edgeDoc.animate;
}
if (edgeDoc?.animation !== void 0) {
edge.animation = edgeDoc.animation;
}
if (edgeDoc?.curve !== void 0) {
edge.interpolate = edgeDoc.curve;
}
return;
}
let txt;
let vertex = this.vertices.get(id30);
if (vertex === void 0) {
vertex = {
id: id30,
labelType: "text",
domId: MERMAID_DOM_ID_PREFIX + id30 + "-" + this.vertexCounter,
styles: [],
classes: []
};
this.vertices.set(id30, 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 = id30;
}
}
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 === id30) {
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 === id30) {
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, id30) {
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 (id30 && !this.edges.some((e3) => e3.id === id30)) {
edge.id = id30;
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}.
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 id30 = this.isLinkData(linkData) ? linkData.id.replace("@", "") : void 0;
log.info("addLink", _start, _end, id30);
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, id30);
} 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((id30) => {
let classNode = this.classes.get(id30);
if (classNode === void 0) {
classNode = { id: id30, styles: [], textStyles: [] };
this.classes.set(id30, 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.trim();
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 id30 of ids.split(",")) {
const vertex = this.vertices.get(id30);
if (vertex) {
vertex.classes.push(className);
}
const edge = this.edges.find((e3) => e3.id === id30);
if (edge) {
edge.classes.push(className);
}
const subGraph = this.subGraphLookup.get(id30);
if (subGraph) {
subGraph.classes.push(className);
}
}
}
setTooltip(ids, tooltip) {
if (tooltip === void 0) {
return;
}
tooltip = this.sanitizeText(tooltip);
for (const id30 of ids.split(",")) {
this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(id30) : id30, tooltip);
}
}
setClickFun(id30, functionName, functionArgs) {
const domId = this.lookUpDomId(id30);
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(id30);
}
const vertex = this.vertices.get(id30);
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((id30) => {
const vertex = this.vertices.get(id30);
if (vertex !== void 0) {
vertex.link = utils_default2.formatUrl(linkStr, this.config);
vertex.linkTarget = target;
}
});
this.setClass(ids, "clickable");
}
getTooltip(id30) {
return this.tooltips.get(id30);
}
/**
* 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((id30) => {
this.setClickFun(id30, 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 nodes5 = svg2.selectAll("g.node");
nodes5.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, list, _title) {
let id30 = _id.text.trim();
let title2 = _title.text;
if (_id === _title && /\s/.exec(_title.text)) {
id30 = 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 result = uniq2(list.flat());
const nodeList = result.nodeList;
let dir2 = result.dir;
const flowchartConfig = getConfig2().flowchart ?? {};
dir2 = dir2 ?? (flowchartConfig.inheritDir ? this.getDirection() ?? getConfig2().direction ?? void 0 : void 0);
if (this.version === "gen-1") {
for (let i2 = 0; i2 < nodeList.length; i2++) {
nodeList[i2] = this.lookUpDomId(nodeList[i2]);
}
}
id30 = id30 ?? "subGraph" + this.subCount;
title2 = title2 || "";
title2 = this.sanitizeText(title2);
this.subCount = this.subCount + 1;
const subGraph = {
id: id30,
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(id30, subGraph);
return id30;
}
getPosForId(id30) {
for (const [i2, subGraph] of this.subGraphs.entries()) {
if (subGraph.id === id30) {
return i2;
}
}
return -1;
}
indexNodes2(id30, pos) {
const nodes5 = 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 === id30) {
return {
result: true,
count: 0
};
}
let count2 = 0;
let posCount = 1;
while (count2 < nodes5.length) {
const childPos = this.getPosForId(nodes5[count2]);
if (childPos >= 0) {
const res = this.indexNodes2(id30, childPos);
if (res.result) {
return {
result: true,
count: posCount + res.count
};
} else {
posCount = posCount + res.count;
}
}
count2 = count2 + 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 count2 = 0;
for (let i2 = 0; i2 < length2; ++i2) {
if (str2[i2] === char2) {
++count2;
}
}
return count2;
}
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(nodes5, id30) {
return nodes5.find((node2) => node2.id === id30);
}
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, nodes5, parentDB, subGraphDB, config5, look) {
const parentId = parentDB.get(vertex.id);
const isGroup2 = subGraphDB.get(vertex.id) ?? false;
const node2 = this.findNode(nodes5, 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) {
nodes5.push({
...baseNode,
isGroup: true,
shape: "rect"
});
} else {
nodes5.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 nodes5 = [];
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 id30 of subGraph.nodes) {
parentDB.set(id30, subGraph.id);
}
}
for (let i2 = subGraphs.length - 1; i2 >= 0; i2--) {
const subGraph = subGraphs[i2];
nodes5.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, nodes5, 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: nodes5, edges: edges3, other: {}, config: config5 };
}
defaultConfig() {
return defaultConfig2.flowchart;
}
};
}
});
// src/rendering-util/insertElementsForSize.js
var getDiagramElement;
var init_insertElementsForSize = __esm({
"src/rendering-util/insertElementsForSize.js"() {
"use strict";
init_src32();
getDiagramElement = /* @__PURE__ */ __name((id30, securityLevel) => {
let sandboxElement;
if (securityLevel === "sandbox") {
sandboxElement = select_default2("#i" + id30);
}
const root3 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body");
const svg2 = root3.select(`[id="${id30}"]`);
return svg2;
}, "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");
}
});
// 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_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);
}
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 y6 = node2.y - height2 / 2;
log.trace("Data ", node2, JSON.stringify(node2));
let rect3;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {
roughness: 0.7,
fill: clusterBkg,
// fill: 'red',
stroke: clusterBorder,
fillWeight: 3,
seed: handDrawnSeed
});
const roughNode = rc.path(createRoundedRectPathD(x5, y6, width3, height2, 0), options2);
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", y6).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 y6 = 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, y6, width3, height2, 10), {
roughness: 0.7,
fill: compositeTitleBackground,
fillStyle: "solid",
stroke: nodeBorder,
seed: handDrawnSeed
}) : rc.rectangle(x5, y6, 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", y6).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}, ${y6 + 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 y6 = node2.y - height2 / 2;
log.trace("Data ", node2, JSON.stringify(node2));
let rect3;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const options2 = userNodeOverrides(node2, {
roughness: 0.7,
fill: clusterBkg,
// fill: 'red',
stroke: clusterBorder,
fillWeight: 4,
seed: handDrawnSeed
});
const roughNode = rc.path(createRoundedRectPathD(x5, y6, width3, height2, node2.rx), options2);
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", y6).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 y6 = node2.y - height2 / 2;
node2.width = width3;
let rect3;
if (node2.look === "handDrawn") {
const rc = at.svg(shapeSvg);
const roughOuterNode = rc.rectangle(x5, y6, 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", y6).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
};
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");
}
});
// 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 };
}
var markerOffsets, markerOffsets2, pointTransformer, getLineFunctionsWithOffset;
var init_lineWithOffset = __esm({
"src/utils/lineWithOffset.ts"() {
"use strict";
markerOffsets = {
aggregation: 17.25,
extension: 17.25,
composition: 17.25,
dependency: 6,
lollipop: 13.5,
arrow_point: 4
//arrow_cross: 24,
};
markerOffsets2 = {
arrow_point: 9,
arrow_cross: 12.5,
arrow_circle: 12.5
};
__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(d3, i2, data5) {
let offset = 0;
const DIRECTION = pointTransformer(data5[0]).x < pointTransformer(data5[data5.length - 1]).x ? "left" : "right";
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);
}
const differenceToEnd = Math.abs(
pointTransformer(d3).x - pointTransformer(data5[data5.length - 1]).x
);
const differenceInYEnd = Math.abs(
pointTransformer(d3).y - pointTransformer(data5[data5.length - 1]).y
);
const differenceToStart = Math.abs(pointTransformer(d3).x - pointTransformer(data5[0]).x);
const differenceInYStart = Math.abs(pointTransformer(d3).y - pointTransformer(data5[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(d3).x + offset;
}, "x"),
y: /* @__PURE__ */ __name(function(d3, i2, data5) {
let offset = 0;
const DIRECTION = pointTransformer(data5[0]).y < pointTransformer(data5[data5.length - 1]).y ? "down" : "up";
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);
}
const differenceToEnd = Math.abs(
pointTransformer(d3).y - pointTransformer(data5[data5.length - 1]).y
);
const differenceInXEnd = Math.abs(
pointTransformer(d3).x - pointTransformer(data5[data5.length - 1]).x
);
const differenceToStart = Math.abs(pointTransformer(d3).y - pointTransformer(data5[0]).y);
const differenceInXStart = Math.abs(pointTransformer(d3).x - pointTransformer(data5[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(d3).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
});
});
});
}
}
});
// 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, id30, diagramType, strokeColor) => {
if (edge.arrowTypeStart) {
addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id30, diagramType, strokeColor);
}
if (edge.arrowTypeEnd) {
addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id30, 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, id30, 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 = `${id30}_${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");
}
});
// 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";
}
}
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);
}
}
return { cornerPoints, cornerPointPositions };
}
function generateRoundedPath(points, radius2) {
if (points.length < 2) {
return "";
}
let path4 = "";
const size4 = points.length;
const epsilon6 = 1e-5;
for (let i2 = 0; i2 < size4; i2++) {
const currPoint = points[i2];
const prevPoint = points[i2 - 1];
const nextPoint = points[i2 + 1];
if (i2 === 0) {
path4 += `M${currPoint.x},${currPoint.y}`;
} else if (i2 === size4 - 1) {
path4 += `L${currPoint.x},${currPoint.y}`;
} else {
const dx1 = currPoint.x - prevPoint.x;
const dy1 = currPoint.y - prevPoint.y;
const dx2 = nextPoint.x - currPoint.x;
const dy2 = nextPoint.y - currPoint.y;
const len1 = Math.hypot(dx1, dy1);
const len2 = Math.hypot(dx2, dy2);
if (len1 < epsilon6 || len2 < epsilon6) {
path4 += `L${currPoint.x},${currPoint.y}`;
continue;
}
const nx1 = dx1 / len1;
const ny1 = dy1 / len1;
const nx2 = dx2 / len2;
const ny2 = dy2 / len2;
const dot = nx1 * nx2 + ny1 * ny2;
const clampedDot = Math.max(-1, Math.min(1, dot));
const angle2 = Math.acos(clampedDot);
if (angle2 < epsilon6 || Math.abs(Math.PI - angle2) < epsilon6) {
path4 += `L${currPoint.x},${currPoint.y}`;
continue;
}
const cutLen = Math.min(radius2 / Math.sin(angle2 / 2), len1 / 2, len2 / 2);
const startX2 = currPoint.x - nx1 * cutLen;
const startY2 = currPoint.y - ny1 * cutLen;
const endX = currPoint.x + nx2 * cutLen;
const endY = currPoint.y + ny2 * cutLen;
path4 += `L${startX2},${startY2}`;
path4 += `Q${currPoint.x},${currPoint.y} ${endX},${endY}`;
}
}
return path4;
}
function calculateDeltaAndAngle2(point1, point22) {
if (!point1 || !point22) {
return { angle: 0, deltaX: 0, deltaY: 0 };
}
const deltaX = point22.x - point1.x;
const deltaY = point22.y - point1.y;
const angle2 = Math.atan2(deltaY, deltaX);
return { angle: angle2, deltaX, deltaY };
}
function applyMarkerOffsetsToPoints(points, edge) {
const newPoints = points.map((point8) => ({ ...point8 }));
if (points.length >= 2 && markerOffsets[edge.arrowTypeStart]) {
const offsetValue = markerOffsets[edge.arrowTypeStart];
const point1 = points[0];
const point22 = points[1];
const { angle: angle2 } = calculateDeltaAndAngle2(point1, point22);
const offsetX = offsetValue * Math.cos(angle2);
const offsetY = offsetValue * Math.sin(angle2);
newPoints[0].x = point1.x + offsetX;
newPoints[0].y = point1.y + offsetY;
}
const n2 = points.length;
if (n2 >= 2 && markerOffsets[edge.arrowTypeEnd]) {
const offsetValue = markerOffsets[edge.arrowTypeEnd];
const point1 = points[n2 - 1];
const point22 = points[n2 - 2];
const { angle: angle2 } = calculateDeltaAndAngle2(point22, point1);
const offsetX = offsetValue * Math.cos(angle2);
const offsetY = offsetValue * Math.sin(angle2);
newPoints[n2 - 1].x = point1.x - offsetX;
newPoints[n2 - 1].y = point1.y - offsetY;
}
return newPoints;
}
var edgeLabels, terminalLabels, clear4, getLabelStyles, insertEdgeLabel, positionEdgeLabel, outsideNode, intersection, cutPathAtIntersect, findAdjacentPoint, fixCorners, generateDashArray, insertEdge;
var init_edges = __esm({
"src/rendering-util/rendering-elements/edges.js"() {
"use strict";
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 { labelStyles } = styles2String(edge);
edge.labelStyle = labelStyles;
const labelElement = await createText(elem, edge.label, {
style: 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").attr("data-id", edge.id);
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 y6 = edge.y;
if (path4) {
const pos = utils_default2.calcLabelPosition(path4);
log.debug(
"Moving label " + edge.label + " from (",
x5,
",",
y6,
") to (",
pos.x,
",",
pos.y,
") abc88"
);
if (paths.updatedPath) {
x5 = pos.x;
y6 = pos.y;
}
}
el.attr("transform", `translate(${x5}, ${y6 + subGraphTitleTotalMargin / 2})`);
}
if (edge.startLabelLeft) {
const el = terminalLabels.get(edge.id).startLeft;
let x5 = edge.x;
let y6 = edge.y;
if (path4) {
const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path4);
x5 = pos.x;
y6 = pos.y;
}
el.attr("transform", `translate(${x5}, ${y6})`);
}
if (edge.startLabelRight) {
const el = terminalLabels.get(edge.id).startRight;
let x5 = edge.x;
let y6 = edge.y;
if (path4) {
const pos = utils_default2.calcTerminalLabelPosition(
edge.arrowTypeStart ? 10 : 0,
"start_right",
path4
);
x5 = pos.x;
y6 = pos.y;
}
el.attr("transform", `translate(${x5}, ${y6})`);
}
if (edge.endLabelLeft) {
const el = terminalLabels.get(edge.id).endLeft;
let x5 = edge.x;
let y6 = edge.y;
if (path4) {
const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path4);
x5 = pos.x;
y6 = pos.y;
}
el.attr("transform", `translate(${x5}, ${y6})`);
}
if (edge.endLabelRight) {
const el = terminalLabels.get(edge.id).endRight;
let x5 = edge.x;
let y6 = edge.y;
if (path4) {
const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path4);
x5 = pos.x;
y6 = pos.y;
}
el.attr("transform", `translate(${x5}, ${y6})`);
}
}, "positionEdgeLabel");
outsideNode = /* @__PURE__ */ __name((node2, point8) => {
const x5 = node2.x;
const y6 = node2.y;
const dx = Math.abs(point8.x - x5);
const dy = Math.abs(point8.y - y6);
const w4 = node2.width / 2;
const h3 = node2.height / 2;
return dx >= w4 || dy >= h3;
}, "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 y6 = node2.y;
const dx = Math.abs(x5 - insidePoint.x);
const w4 = node2.width / 2;
let r2 = insidePoint.x < outsidePoint.x ? w4 - dx : w4 + dx;
const h3 = node2.height / 2;
const Q3 = Math.abs(outsidePoint.y - insidePoint.y);
const R3 = Math.abs(outsidePoint.x - insidePoint.x);
if (Math.abs(y6 - outsidePoint.y) * w4 > Math.abs(x5 - outsidePoint.x) * h3) {
let q3 = insidePoint.y < outsidePoint.y ? outsidePoint.y - h3 - y6 : y6 - h3 - outsidePoint.y;
r2 = R3 * q3 / Q3;
const res = {
x: insidePoint.x < outsidePoint.x ? insidePoint.x + r2 : insidePoint.x - R3 + r2,
y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q3 - q3 : insidePoint.y - Q3 + q3
};
if (r2 === 0) {
res.x = outsidePoint.x;
res.y = outsidePoint.y;
}
if (R3 === 0) {
res.x = outsidePoint.x;
}
if (Q3 === 0) {
res.y = outsidePoint.y;
}
log.debug(`abc89 top/bottom calc, Q ${Q3}, q ${q3}, R ${R3}, r ${r2}`, res);
return res;
} else {
if (insidePoint.x < outsidePoint.x) {
r2 = outsidePoint.x - w4 - x5;
} else {
r2 = x5 - w4 - outsidePoint.x;
}
let q3 = Q3 * r2 / R3;
let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R3 - r2 : insidePoint.x - R3 + r2;
let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q3 : insidePoint.y - q3;
log.debug(`sides calc abc89, Q ${Q3}, q ${q3}, R ${R3}, r ${r2}`, { _x, _y });
if (r2 === 0) {
_x = outsidePoint.x;
_y = outsidePoint.y;
}
if (R3 === 0) {
_x = outsidePoint.x;
}
if (Q3 === 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");
generateDashArray = /* @__PURE__ */ __name((len, oValueS, oValueE) => {
const middleLength = len - oValueS - oValueE;
const dashLength = 2;
const gapLength = 2;
const dashGapPairLength = dashLength + gapLength;
const numberOfPairs = Math.floor(middleLength / dashGapPairLength);
const middlePattern = Array(numberOfPairs).fill(`${dashLength} ${gapLength}`).join(" ");
const dashArray = `0 ${oValueS} ${middlePattern} ${oValueE}`;
return dashArray;
}, "generateDashArray");
insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb2, diagramType, startNode, endNode, id30, skipIntersect = false) {
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]);
}
log.debug("UIO intersect check", edge.points, head2.x, tail.x);
if (head2.intersect && tail.intersect && !skipIntersect) {
points = points.slice(1, edge.points.length - 1);
points.unshift(tail.intersect(points[0]));
log.debug(
"Last point UIO",
edge.start,
"-->",
edge.end,
points[points.length - 1],
head2,
head2.intersect(points[points.length - 1])
);
points.push(head2.intersect(points[points.length - 1]));
}
const pointsStr = btoa(JSON.stringify(points));
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: y6 } = getLineFunctionsWithOffset(edge);
const lineFunction = line_default().x(x5).y(y6).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 = edge.curve === "rounded" ? generateRoundedPath(applyMarkerOffsetsToPoints(lineData, edge), 5) : lineFunction(lineData);
const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
let strokeColor = edgeStyles.find((style3) => style3?.startsWith("stroke:"));
let animatedEdge = false;
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 d3 = svgPath.attr("d");
svgPath.attr("d", d3);
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) + ";" + (edgeStyles ? edgeStyles.reduce((acc, style3) => acc + ";" + style3, "") : "");
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];
animatedEdge = edge.animate === true || !!edge.animation || stylesFromClasses.includes("animation");
const pathNode = svgPath.node();
const len = typeof pathNode.getTotalLength === "function" ? pathNode.getTotalLength() : 0;
const oValueS = markerOffsets2[edge.arrowTypeStart] || 0;
const oValueE = markerOffsets2[edge.arrowTypeEnd] || 0;
if (edge.look === "neo" && !animatedEdge) {
const dashArray = edge.pattern === "dotted" || edge.pattern === "dashed" ? generateDashArray(len, oValueS, oValueE) : `0 ${oValueS} ${len - oValueS - oValueE} ${oValueE}`;
const mOffset = `stroke-dasharray: ${dashArray}; stroke-dashoffset: 0;`;
svgPath.attr("style", mOffset + svgPath.attr("style"));
}
}
svgPath.attr("data-edge", true);
svgPath.attr("data-et", "edge");
svgPath.attr("data-id", edge.id);
svgPath.attr("data-points", pointsStr);
if (edge.showPoints) {
lineData.forEach((point9) => {
elem.append("circle").style("stroke", "red").style("fill", "red").attr("r", 1).attr("cx", point9.x).attr("cy", point9.y);
});
}
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, id30, diagramType, strokeColor);
const midIndex = Math.floor(points.length / 2);
const point8 = points[midIndex];
if (!utils_default2.isLabelCoordinateInPath(point8, svgPath.attr("d"))) {
pointsHasChanged = true;
}
let paths = {};
if (pointsHasChanged) {
paths.updatedPath = points;
}
paths.originalPath = edge.points;
return paths;
}, "insertEdge");
__name(generateRoundedPath, "generateRoundedPath");
__name(calculateDeltaAndAngle2, "calculateDeltaAndAngle");
__name(applyMarkerOffsetsToPoints, "applyMarkerOffsetsToPoints");
}
});
// 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_logger();
insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type3, id30) => {
markerArray.forEach((markerName) => {
markers[markerName](elem, type3, id30);
});
}, "insertMarkers");
extension = /* @__PURE__ */ __name((elem, type3, id30) => {
log.trace("Making markers for ", id30);
elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("defs").append("marker").attr("id", id30 + "_" + 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, id30) => {
elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
const startMarker = elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
const startMarker = elem.append("defs").append("marker").attr("id", id30 + "_" + 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", id30 + "_" + 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, id30) => {
elem.append("defs").append("marker").attr("id", id30 + "_" + 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, id30) => {
const containsNode = elem.append("defs").append("marker").attr("id", id30 + "_" + 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;
}
});
// 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_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");
}
});
// 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_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/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_baseGetTag();
init_isObjectLike();
symbolTag = "[object Symbol]";
__name(isSymbol, "isSymbol");
isSymbol_default = isSymbol;
}
});
// ../../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 arrayMap_default;
var init_arrayMap = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js"() {
"use strict";
__name(arrayMap, "arrayMap");
arrayMap_default = arrayMap;
}
});
// ../../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 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_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/_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;
}
});
// ../../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 reTrimStart, baseTrim_default;
var init_baseTrim = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js"() {
"use strict";
init_trimmedEndIndex();
reTrimStart = /^\s+/;
__name(baseTrim, "baseTrim");
baseTrim_default = baseTrim;
}
});
// ../../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;
}
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 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_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;
}
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_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;
}
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"() {
"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() {
}
var noop_default2;
var init_noop2 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js"() {
"use strict";
__name(noop2, "noop");
noop_default2 = noop2;
}
});
// ../../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;
}
}
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;
}
});
// ../../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;
}
}
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;
}
});
// ../../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;
}
});
// ../../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;
}
var strictIndexOf_default;
var init_strictIndexOf = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js"() {
"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);
}
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, tag, isDeep) {
var Ctor = object3.constructor;
switch (tag) {
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 tag = getTag_default(value2), isFunc = tag == funcTag3 || tag == genTag2;
if (isBuffer_default(value2)) {
return cloneBuffer_default(value2, isDeep);
}
if (tag == objectTag4 || tag == 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[tag]) {
return object3 ? value2 : {};
}
result = initCloneByTag_default(value2, tag, 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();
init_isSet();
init_keys();
init_keysIn();
CLONE_DEEP_FLAG = 1;
CLONE_FLAT_FLAG = 2;
CLONE_SYMBOLS_FLAG = 4;
argsTag3 = "[object Arguments]";
arrayTag2 = "[object Array]";
boolTag3 = "[object Boolean]";
dateTag3 = "[object Date]";
errorTag2 = "[object Error]";
funcTag3 = "[object Function]";
genTag2 = "[object GeneratorFunction]";
mapTag5 = "[object Map]";
numberTag3 = "[object Number]";
objectTag4 = "[object Object]";
regexpTag3 = "[object RegExp]";
setTag5 = "[object Set]";
stringTag3 = "[object String]";
symbolTag3 = "[object Symbol]";
weakMapTag3 = "[object WeakMap]";
arrayBufferTag3 = "[object ArrayBuffer]";
dataViewTag4 = "[object DataView]";
float32Tag3 = "[object Float32Array]";
float64Tag3 = "[object Float64Array]";
int8Tag3 = "[object Int8Array]";
int16Tag3 = "[object Int16Array]";
int32Tag3 = "[object Int32Array]";
uint8Tag3 = "[object Uint8Array]";
uint8ClampedTag3 = "[object Uint8ClampedArray]";
uint16Tag3 = "[object Uint16Array]";
uint32Tag3 = "[object Uint32Array]";
cloneableTags = {};
cloneableTags[argsTag3] = cloneableTags[arrayTag2] = cloneableTags[arrayBufferTag3] = cloneableTags[dataViewTag4] = cloneableTags[boolTag3] = cloneableTags[dateTag3] = cloneableTags[float32Tag3] = cloneableTags[float64Tag3] = cloneableTags[int8Tag3] = cloneableTags[int16Tag3] = cloneableTags[int32Tag3] = cloneableTags[mapTag5] = cloneableTags[numberTag3] = cloneableTags[objectTag4] = cloneableTags[regexpTag3] = cloneableTags[setTag5] = cloneableTags[stringTag3] = cloneableTags[symbolTag3] = cloneableTags[uint8Tag3] = cloneableTags[uint8ClampedTag3] = cloneableTags[uint16Tag3] = cloneableTags[uint32Tag3] = true;
cloneableTags[errorTag2] = cloneableTags[funcTag3] = cloneableTags[weakMapTag3] = false;
__name(baseClone, "baseClone");
baseClone_default = baseClone;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/clone.js
function clone2(value2) {
return baseClone_default(value2, CLONE_SYMBOLS_FLAG2);
}
var CLONE_SYMBOLS_FLAG2, clone_default2;
var init_clone2 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/clone.js"() {
"use strict";
init_baseClone();
CLONE_SYMBOLS_FLAG2 = 4;
__name(clone2, "clone");
clone_default2 = clone2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.js
function cloneDeep(value2) {
return baseClone_default(value2, CLONE_DEEP_FLAG2 | CLONE_SYMBOLS_FLAG3);
}
var CLONE_DEEP_FLAG2, CLONE_SYMBOLS_FLAG3, cloneDeep_default;
var init_cloneDeep = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.js"() {
"use strict";
init_baseClone();
CLONE_DEEP_FLAG2 = 1;
CLONE_SYMBOLS_FLAG3 = 4;
__name(cloneDeep, "cloneDeep");
cloneDeep_default = cloneDeep;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/compact.js
function compact(array4) {
var index = -1, length2 = array4 == null ? 0 : array4.length, resIndex = 0, result = [];
while (++index < length2) {
var value2 = array4[index];
if (value2) {
result[resIndex++] = value2;
}
}
return result;
}
var compact_default;
var init_compact = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/compact.js"() {
"use strict";
__name(compact, "compact");
compact_default = compact;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js
function setCacheAdd(value2) {
this.__data__.set(value2, HASH_UNDEFINED3);
return this;
}
var HASH_UNDEFINED3, setCacheAdd_default;
var init_setCacheAdd = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js"() {
"use strict";
HASH_UNDEFINED3 = "__lodash_hash_undefined__";
__name(setCacheAdd, "setCacheAdd");
setCacheAdd_default = setCacheAdd;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js
function setCacheHas(value2) {
return this.__data__.has(value2);
}
var setCacheHas_default;
var init_setCacheHas = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js"() {
"use strict";
__name(setCacheHas, "setCacheHas");
setCacheHas_default = setCacheHas;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js
function SetCache(values2) {
var index = -1, length2 = values2 == null ? 0 : values2.length;
this.__data__ = new MapCache_default();
while (++index < length2) {
this.add(values2[index]);
}
}
var SetCache_default;
var init_SetCache = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js"() {
"use strict";
init_MapCache();
init_setCacheAdd();
init_setCacheHas();
__name(SetCache, "SetCache");
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd_default;
SetCache.prototype.has = setCacheHas_default;
SetCache_default = SetCache;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js
function arraySome(array4, predicate) {
var index = -1, length2 = array4 == null ? 0 : array4.length;
while (++index < length2) {
if (predicate(array4[index], index, array4)) {
return true;
}
}
return false;
}
var arraySome_default;
var init_arraySome = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js"() {
"use strict";
__name(arraySome, "arraySome");
arraySome_default = arraySome;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js
function cacheHas(cache3, key) {
return cache3.has(key);
}
var cacheHas_default;
var init_cacheHas = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js"() {
"use strict";
__name(cacheHas, "cacheHas");
cacheHas_default = cacheHas;
}
});
// ../../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;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
var arrStacked = stack.get(array4);
var othStacked = stack.get(other);
if (arrStacked && othStacked) {
return arrStacked == other && 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);
while (++index < arrLength) {
var arrValue = array4[index], othValue = other[index];
if (customizer) {
var compared = isPartial ? customizer(othValue, arrValue, index, other, array4, stack) : customizer(arrValue, othValue, index, array4, other, stack);
}
if (compared !== void 0) {
if (compared) {
continue;
}
result = false;
break;
}
if (seen) {
if (!arraySome_default(other, function(othValue2, othIndex) {
if (!cacheHas_default(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
result = false;
break;
}
}
stack["delete"](array4);
stack["delete"](other);
return result;
}
var COMPARE_PARTIAL_FLAG, COMPARE_UNORDERED_FLAG, equalArrays_default;
var init_equalArrays = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js"() {
"use strict";
init_SetCache();
init_arraySome();
init_cacheHas();
COMPARE_PARTIAL_FLAG = 1;
COMPARE_UNORDERED_FLAG = 2;
__name(equalArrays, "equalArrays");
equalArrays_default = equalArrays;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js
function mapToArray(map5) {
var index = -1, result = Array(map5.size);
map5.forEach(function(value2, key) {
result[++index] = [key, value2];
});
return result;
}
var mapToArray_default;
var init_mapToArray = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js"() {
"use strict";
__name(mapToArray, "mapToArray");
mapToArray_default = mapToArray;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js
function setToArray(set5) {
var index = -1, result = Array(set5.size);
set5.forEach(function(value2) {
result[++index] = value2;
});
return result;
}
var setToArray_default;
var init_setToArray = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js"() {
"use strict";
__name(setToArray, "setToArray");
setToArray_default = setToArray;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js
function equalByTag(object3, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag5:
if (object3.byteLength != other.byteLength || object3.byteOffset != other.byteOffset) {
return false;
}
object3 = object3.buffer;
other = other.buffer;
case arrayBufferTag4:
if (object3.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object3), new Uint8Array_default(other))) {
return false;
}
return true;
case boolTag4:
case dateTag4:
case numberTag4:
return eq_default(+object3, +other);
case errorTag3:
return object3.name == other.name && object3.message == other.message;
case regexpTag4:
case stringTag4:
return object3 == other + "";
case mapTag6:
var convert = mapToArray_default;
case setTag6:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG2;
convert || (convert = setToArray_default);
if (object3.size != other.size && !isPartial) {
return false;
}
var stacked = stack.get(object3);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG2;
stack.set(object3, other);
var result = equalArrays_default(convert(object3), convert(other), bitmask, customizer, equalFunc, stack);
stack["delete"](object3);
return result;
case symbolTag4:
if (symbolValueOf2) {
return symbolValueOf2.call(object3) == symbolValueOf2.call(other);
}
}
return false;
}
var COMPARE_PARTIAL_FLAG2, COMPARE_UNORDERED_FLAG2, boolTag4, dateTag4, errorTag3, mapTag6, numberTag4, regexpTag4, setTag6, stringTag4, symbolTag4, arrayBufferTag4, dataViewTag5, symbolProto3, symbolValueOf2, equalByTag_default;
var init_equalByTag = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js"() {
"use strict";
init_Symbol();
init_Uint8Array();
init_eq();
init_equalArrays();
init_mapToArray();
init_setToArray();
COMPARE_PARTIAL_FLAG2 = 1;
COMPARE_UNORDERED_FLAG2 = 2;
boolTag4 = "[object Boolean]";
dateTag4 = "[object Date]";
errorTag3 = "[object Error]";
mapTag6 = "[object Map]";
numberTag4 = "[object Number]";
regexpTag4 = "[object RegExp]";
setTag6 = "[object Set]";
stringTag4 = "[object String]";
symbolTag4 = "[object Symbol]";
arrayBufferTag4 = "[object ArrayBuffer]";
dataViewTag5 = "[object DataView]";
symbolProto3 = Symbol_default ? Symbol_default.prototype : void 0;
symbolValueOf2 = symbolProto3 ? symbolProto3.valueOf : void 0;
__name(equalByTag, "equalByTag");
equalByTag_default = equalByTag;
}
});
// ../../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;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty13.call(other, key))) {
return false;
}
}
var objStacked = stack.get(object3);
var othStacked = stack.get(other);
if (objStacked && othStacked) {
return objStacked == other && othStacked == object3;
}
var result = true;
stack.set(object3, other);
stack.set(other, object3);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object3[key], othValue = other[key];
if (customizer) {
var compared = isPartial ? customizer(othValue, objValue, key, other, object3, stack) : customizer(objValue, othValue, key, object3, other, stack);
}
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
result = false;
break;
}
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)) {
result = false;
}
}
stack["delete"](object3);
stack["delete"](other);
return result;
}
var COMPARE_PARTIAL_FLAG3, objectProto16, hasOwnProperty13, equalObjects_default;
var init_equalObjects = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js"() {
"use strict";
init_getAllKeys();
COMPARE_PARTIAL_FLAG3 = 1;
objectProto16 = Object.prototype;
hasOwnProperty13 = objectProto16.hasOwnProperty;
__name(equalObjects, "equalObjects");
equalObjects_default = equalObjects;
}
});
// ../../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);
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)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
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);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG4)) {
var objIsWrapped = objIsObj && hasOwnProperty14.call(object3, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty14.call(other, "__wrapped__");
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object3.value() : object3, othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack_default());
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack_default());
return equalObjects_default(object3, other, bitmask, customizer, equalFunc, stack);
}
var COMPARE_PARTIAL_FLAG4, argsTag4, arrayTag3, objectTag5, objectProto17, hasOwnProperty14, baseIsEqualDeep_default;
var init_baseIsEqualDeep = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js"() {
"use strict";
init_Stack();
init_equalArrays();
init_equalByTag();
init_equalObjects();
init_getTag();
init_isArray();
init_isBuffer();
init_isTypedArray();
COMPARE_PARTIAL_FLAG4 = 1;
argsTag4 = "[object Arguments]";
arrayTag3 = "[object Array]";
objectTag5 = "[object Object]";
objectProto17 = Object.prototype;
hasOwnProperty14 = objectProto17.hasOwnProperty;
__name(baseIsEqualDeep, "baseIsEqualDeep");
baseIsEqualDeep_default = baseIsEqualDeep;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js
function baseIsEqual(value2, other, bitmask, customizer, stack) {
if (value2 === other) {
return true;
}
if (value2 == null || other == null || !isObjectLike_default(value2) && !isObjectLike_default(other)) {
return value2 !== value2 && other !== other;
}
return baseIsEqualDeep_default(value2, other, bitmask, customizer, baseIsEqual, stack);
}
var baseIsEqual_default;
var init_baseIsEqual = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js"() {
"use strict";
init_baseIsEqualDeep();
init_isObjectLike();
__name(baseIsEqual, "baseIsEqual");
baseIsEqual_default = baseIsEqual;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js
function baseIsMatch(object3, source, matchData, customizer) {
var index = matchData.length, length2 = index, noCustomizer = !customizer;
if (object3 == null) {
return !length2;
}
object3 = Object(object3);
while (index--) {
var data5 = matchData[index];
if (noCustomizer && data5[2] ? data5[1] !== object3[data5[0]] : !(data5[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]) {
if (objValue === void 0 && !(key in object3)) {
return false;
}
} else {
var stack = new Stack_default();
if (customizer) {
var result = customizer(objValue, srcValue, key, object3, source, stack);
}
if (!(result === void 0 ? baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG5 | COMPARE_UNORDERED_FLAG3, customizer, stack) : result)) {
return false;
}
}
}
return true;
}
var COMPARE_PARTIAL_FLAG5, COMPARE_UNORDERED_FLAG3, baseIsMatch_default;
var init_baseIsMatch = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js"() {
"use strict";
init_Stack();
init_baseIsEqual();
COMPARE_PARTIAL_FLAG5 = 1;
COMPARE_UNORDERED_FLAG3 = 2;
__name(baseIsMatch, "baseIsMatch");
baseIsMatch_default = baseIsMatch;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js
function isStrictComparable(value2) {
return value2 === value2 && !isObject_default(value2);
}
var isStrictComparable_default;
var init_isStrictComparable = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js"() {
"use strict";
init_isObject();
__name(isStrictComparable, "isStrictComparable");
isStrictComparable_default = isStrictComparable;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js
function getMatchData(object3) {
var result = keys_default(object3), length2 = result.length;
while (length2--) {
var key = result[length2], value2 = object3[key];
result[length2] = [key, value2, isStrictComparable_default(value2)];
}
return result;
}
var getMatchData_default;
var init_getMatchData = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js"() {
"use strict";
init_isStrictComparable();
init_keys();
__name(getMatchData, "getMatchData");
getMatchData_default = getMatchData;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js
function matchesStrictComparable(key, srcValue) {
return function(object3) {
if (object3 == null) {
return false;
}
return object3[key] === srcValue && (srcValue !== void 0 || key in Object(object3));
};
}
var matchesStrictComparable_default;
var init_matchesStrictComparable = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js"() {
"use strict";
__name(matchesStrictComparable, "matchesStrictComparable");
matchesStrictComparable_default = matchesStrictComparable;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js
function baseMatches(source) {
var matchData = getMatchData_default(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable_default(matchData[0][0], matchData[0][1]);
}
return function(object3) {
return object3 === source || baseIsMatch_default(object3, source, matchData);
};
}
var baseMatches_default;
var init_baseMatches = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js"() {
"use strict";
init_baseIsMatch();
init_getMatchData();
init_matchesStrictComparable();
__name(baseMatches, "baseMatches");
baseMatches_default = baseMatches;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js
function baseHasIn(object3, key) {
return object3 != null && key in Object(object3);
}
var baseHasIn_default;
var init_baseHasIn = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js"() {
"use strict";
__name(baseHasIn, "baseHasIn");
baseHasIn_default = baseHasIn;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js
function hasPath(object3, path4, hasFunc) {
path4 = castPath_default(path4, object3);
var index = -1, length2 = path4.length, result = false;
while (++index < length2) {
var key = toKey_default(path4[index]);
if (!(result = object3 != null && hasFunc(object3, key))) {
break;
}
object3 = object3[key];
}
if (result || ++index != length2) {
return result;
}
length2 = object3 == null ? 0 : object3.length;
return !!length2 && isLength_default(length2) && isIndex_default(key, length2) && (isArray_default(object3) || isArguments_default(object3));
}
var hasPath_default;
var init_hasPath = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js"() {
"use strict";
init_castPath();
init_isArguments();
init_isArray();
init_isIndex();
init_isLength();
init_toKey();
__name(hasPath, "hasPath");
hasPath_default = hasPath;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js
function hasIn(object3, path4) {
return object3 != null && hasPath_default(object3, path4, baseHasIn_default);
}
var hasIn_default;
var init_hasIn = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js"() {
"use strict";
init_baseHasIn();
init_hasPath();
__name(hasIn, "hasIn");
hasIn_default = hasIn;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js
function baseMatchesProperty(path4, srcValue) {
if (isKey_default(path4) && isStrictComparable_default(srcValue)) {
return matchesStrictComparable_default(toKey_default(path4), srcValue);
}
return function(object3) {
var objValue = get_default(object3, path4);
return objValue === void 0 && objValue === srcValue ? hasIn_default(object3, path4) : baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG6 | COMPARE_UNORDERED_FLAG4);
};
}
var COMPARE_PARTIAL_FLAG6, COMPARE_UNORDERED_FLAG4, baseMatchesProperty_default;
var init_baseMatchesProperty = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js"() {
"use strict";
init_baseIsEqual();
init_get();
init_hasIn();
init_isKey();
init_isStrictComparable();
init_matchesStrictComparable();
init_toKey();
COMPARE_PARTIAL_FLAG6 = 1;
COMPARE_UNORDERED_FLAG4 = 2;
__name(baseMatchesProperty, "baseMatchesProperty");
baseMatchesProperty_default = baseMatchesProperty;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js
function baseProperty(key) {
return function(object3) {
return object3 == null ? void 0 : object3[key];
};
}
var baseProperty_default;
var init_baseProperty = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js"() {
"use strict";
__name(baseProperty, "baseProperty");
baseProperty_default = baseProperty;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js
function basePropertyDeep(path4) {
return function(object3) {
return baseGet_default(object3, path4);
};
}
var basePropertyDeep_default;
var init_basePropertyDeep = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js"() {
"use strict";
init_baseGet();
__name(basePropertyDeep, "basePropertyDeep");
basePropertyDeep_default = basePropertyDeep;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js
function property(path4) {
return isKey_default(path4) ? baseProperty_default(toKey_default(path4)) : basePropertyDeep_default(path4);
}
var property_default2;
var init_property2 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js"() {
"use strict";
init_baseProperty();
init_basePropertyDeep();
init_isKey();
init_toKey();
__name(property, "property");
property_default2 = property;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js
function baseIteratee(value2) {
if (typeof value2 == "function") {
return value2;
}
if (value2 == null) {
return identity_default4;
}
if (typeof value2 == "object") {
return isArray_default(value2) ? baseMatchesProperty_default(value2[0], value2[1]) : baseMatches_default(value2);
}
return property_default2(value2);
}
var baseIteratee_default;
var init_baseIteratee = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js"() {
"use strict";
init_baseMatches();
init_baseMatchesProperty();
init_identity4();
init_isArray();
init_property2();
__name(baseIteratee, "baseIteratee");
baseIteratee_default = baseIteratee;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayAggregator.js
function arrayAggregator(array4, setter, iteratee, accumulator) {
var index = -1, length2 = array4 == null ? 0 : array4.length;
while (++index < length2) {
var value2 = array4[index];
setter(accumulator, value2, iteratee(value2), array4);
}
return accumulator;
}
var arrayAggregator_default;
var init_arrayAggregator = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayAggregator.js"() {
"use strict";
__name(arrayAggregator, "arrayAggregator");
arrayAggregator_default = arrayAggregator;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js
function baseForOwn(object3, iteratee) {
return object3 && baseFor_default(object3, iteratee, keys_default);
}
var baseForOwn_default;
var init_baseForOwn = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js"() {
"use strict";
init_baseFor();
init_keys();
__name(baseForOwn, "baseForOwn");
baseForOwn_default = baseForOwn;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseEach.js
function createBaseEach(eachFunc, fromRight) {
return function(collection4, iteratee) {
if (collection4 == null) {
return collection4;
}
if (!isArrayLike_default(collection4)) {
return eachFunc(collection4, iteratee);
}
var length2 = collection4.length, index = fromRight ? length2 : -1, iterable = Object(collection4);
while (fromRight ? index-- : ++index < length2) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection4;
};
}
var createBaseEach_default;
var init_createBaseEach = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseEach.js"() {
"use strict";
init_isArrayLike();
__name(createBaseEach, "createBaseEach");
createBaseEach_default = createBaseEach;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js
var baseEach, baseEach_default;
var init_baseEach = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js"() {
"use strict";
init_baseForOwn();
init_createBaseEach();
baseEach = createBaseEach_default(baseForOwn_default);
baseEach_default = baseEach;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAggregator.js
function baseAggregator(collection4, setter, iteratee, accumulator) {
baseEach_default(collection4, function(value2, key, collection5) {
setter(accumulator, value2, iteratee(value2), collection5);
});
return accumulator;
}
var baseAggregator_default;
var init_baseAggregator = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAggregator.js"() {
"use strict";
init_baseEach();
__name(baseAggregator, "baseAggregator");
baseAggregator_default = baseAggregator;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAggregator.js
function createAggregator(setter, initializer) {
return function(collection4, iteratee) {
var func = isArray_default(collection4) ? arrayAggregator_default : baseAggregator_default, accumulator = initializer ? initializer() : {};
return func(collection4, setter, baseIteratee_default(iteratee, 2), accumulator);
};
}
var createAggregator_default;
var init_createAggregator = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAggregator.js"() {
"use strict";
init_arrayAggregator();
init_baseAggregator();
init_baseIteratee();
init_isArray();
__name(createAggregator, "createAggregator");
createAggregator_default = createAggregator;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js
var now2, now_default;
var init_now = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js"() {
"use strict";
init_root();
now2 = /* @__PURE__ */ __name(function() {
return root_default.Date.now();
}, "now");
now_default = now2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/defaults.js
var objectProto18, hasOwnProperty15, defaults, defaults_default;
var init_defaults3 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/defaults.js"() {
"use strict";
init_baseRest();
init_eq();
init_isIterateeCall();
init_keysIn();
objectProto18 = Object.prototype;
hasOwnProperty15 = objectProto18.hasOwnProperty;
defaults = baseRest_default(function(object3, sources) {
object3 = Object(object3);
var index = -1;
var length2 = sources.length;
var guard = length2 > 2 ? sources[2] : void 0;
if (guard && isIterateeCall_default(sources[0], sources[1], guard)) {
length2 = 1;
}
while (++index < length2) {
var source = sources[index];
var props = keysIn_default(source);
var propsIndex = -1;
var propsLength = props.length;
while (++propsIndex < propsLength) {
var key = props[propsIndex];
var value2 = object3[key];
if (value2 === void 0 || eq_default(value2, objectProto18[key]) && !hasOwnProperty15.call(object3, key)) {
object3[key] = source[key];
}
}
}
return object3;
});
defaults_default = defaults;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.js
function arrayIncludesWith(array4, value2, comparator) {
var index = -1, length2 = array4 == null ? 0 : array4.length;
while (++index < length2) {
if (comparator(value2, array4[index])) {
return true;
}
}
return false;
}
var arrayIncludesWith_default;
var init_arrayIncludesWith = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.js"() {
"use strict";
__name(arrayIncludesWith, "arrayIncludesWith");
arrayIncludesWith_default = arrayIncludesWith;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseDifference.js
function baseDifference(array4, values2, iteratee, comparator) {
var index = -1, includes3 = arrayIncludes_default, isCommon = true, length2 = array4.length, result = [], valuesLength = values2.length;
if (!length2) {
return result;
}
if (iteratee) {
values2 = arrayMap_default(values2, baseUnary_default(iteratee));
}
if (comparator) {
includes3 = arrayIncludesWith_default;
isCommon = false;
} else if (values2.length >= LARGE_ARRAY_SIZE2) {
includes3 = cacheHas_default;
isCommon = false;
values2 = new SetCache_default(values2);
}
outer:
while (++index < length2) {
var value2 = array4[index], computed = iteratee == null ? value2 : iteratee(value2);
value2 = comparator || value2 !== 0 ? value2 : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values2[valuesIndex] === computed) {
continue outer;
}
}
result.push(value2);
} else if (!includes3(values2, computed, comparator)) {
result.push(value2);
}
}
return result;
}
var LARGE_ARRAY_SIZE2, baseDifference_default;
var init_baseDifference = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseDifference.js"() {
"use strict";
init_SetCache();
init_arrayIncludes();
init_arrayIncludesWith();
init_arrayMap();
init_baseUnary();
init_cacheHas();
LARGE_ARRAY_SIZE2 = 200;
__name(baseDifference, "baseDifference");
baseDifference_default = baseDifference;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/difference.js
var difference, difference_default;
var init_difference = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/difference.js"() {
"use strict";
init_baseDifference();
init_baseFlatten();
init_baseRest();
init_isArrayLikeObject();
difference = baseRest_default(function(array4, values2) {
return isArrayLikeObject_default(array4) ? baseDifference_default(array4, baseFlatten_default(values2, 1, isArrayLikeObject_default, true)) : [];
});
difference_default = difference;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/last.js
function last(array4) {
var length2 = array4 == null ? 0 : array4.length;
return length2 ? array4[length2 - 1] : void 0;
}
var last_default;
var init_last = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/last.js"() {
"use strict";
__name(last, "last");
last_default = last;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/drop.js
function drop(array4, n2, guard) {
var length2 = array4 == null ? 0 : array4.length;
if (!length2) {
return [];
}
n2 = guard || n2 === void 0 ? 1 : toInteger_default(n2);
return baseSlice_default(array4, n2 < 0 ? 0 : n2, length2);
}
var drop_default;
var init_drop = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/drop.js"() {
"use strict";
init_baseSlice();
init_toInteger();
__name(drop, "drop");
drop_default = drop;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/dropRight.js
function dropRight(array4, n2, guard) {
var length2 = array4 == null ? 0 : array4.length;
if (!length2) {
return [];
}
n2 = guard || n2 === void 0 ? 1 : toInteger_default(n2);
n2 = length2 - n2;
return baseSlice_default(array4, 0, n2 < 0 ? 0 : n2);
}
var dropRight_default;
var init_dropRight = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/dropRight.js"() {
"use strict";
init_baseSlice();
init_toInteger();
__name(dropRight, "dropRight");
dropRight_default = dropRight;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castFunction.js
function castFunction(value2) {
return typeof value2 == "function" ? value2 : identity_default4;
}
var castFunction_default;
var init_castFunction = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castFunction.js"() {
"use strict";
init_identity4();
__name(castFunction, "castFunction");
castFunction_default = castFunction;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forEach.js
function forEach(collection4, iteratee) {
var func = isArray_default(collection4) ? arrayEach_default : baseEach_default;
return func(collection4, castFunction_default(iteratee));
}
var forEach_default;
var init_forEach = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forEach.js"() {
"use strict";
init_arrayEach();
init_baseEach();
init_castFunction();
init_isArray();
__name(forEach, "forEach");
forEach_default = forEach;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/each.js
var init_each3 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/each.js"() {
"use strict";
init_forEach();
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEvery.js
function arrayEvery(array4, predicate) {
var index = -1, length2 = array4 == null ? 0 : array4.length;
while (++index < length2) {
if (!predicate(array4[index], index, array4)) {
return false;
}
}
return true;
}
var arrayEvery_default;
var init_arrayEvery = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEvery.js"() {
"use strict";
__name(arrayEvery, "arrayEvery");
arrayEvery_default = arrayEvery;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEvery.js
function baseEvery(collection4, predicate) {
var result = true;
baseEach_default(collection4, function(value2, index, collection5) {
result = !!predicate(value2, index, collection5);
return result;
});
return result;
}
var baseEvery_default;
var init_baseEvery = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEvery.js"() {
"use strict";
init_baseEach();
__name(baseEvery, "baseEvery");
baseEvery_default = baseEvery;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/every.js
function every(collection4, predicate, guard) {
var func = isArray_default(collection4) ? arrayEvery_default : baseEvery_default;
if (guard && isIterateeCall_default(collection4, predicate, guard)) {
predicate = void 0;
}
return func(collection4, baseIteratee_default(predicate, 3));
}
var every_default;
var init_every = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/every.js"() {
"use strict";
init_arrayEvery();
init_baseEvery();
init_baseIteratee();
init_isArray();
init_isIterateeCall();
__name(every, "every");
every_default = every;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFilter.js
function baseFilter(collection4, predicate) {
var result = [];
baseEach_default(collection4, function(value2, index, collection5) {
if (predicate(value2, index, collection5)) {
result.push(value2);
}
});
return result;
}
var baseFilter_default;
var init_baseFilter = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFilter.js"() {
"use strict";
init_baseEach();
__name(baseFilter, "baseFilter");
baseFilter_default = baseFilter;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/filter.js
function filter2(collection4, predicate) {
var func = isArray_default(collection4) ? arrayFilter_default : baseFilter_default;
return func(collection4, baseIteratee_default(predicate, 3));
}
var filter_default3;
var init_filter3 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/filter.js"() {
"use strict";
init_arrayFilter();
init_baseFilter();
init_baseIteratee();
init_isArray();
__name(filter2, "filter");
filter_default3 = filter2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createFind.js
function createFind(findIndexFunc) {
return function(collection4, predicate, fromIndex) {
var iterable = Object(collection4);
if (!isArrayLike_default(collection4)) {
var iteratee = baseIteratee_default(predicate, 3);
collection4 = keys_default(collection4);
predicate = /* @__PURE__ */ __name(function(key) {
return iteratee(iterable[key], key, iterable);
}, "predicate");
}
var index = findIndexFunc(collection4, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection4[index] : index] : void 0;
};
}
var createFind_default;
var init_createFind = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createFind.js"() {
"use strict";
init_baseIteratee();
init_isArrayLike();
init_keys();
__name(createFind, "createFind");
createFind_default = createFind;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/findIndex.js
function findIndex(array4, predicate, fromIndex) {
var length2 = array4 == null ? 0 : array4.length;
if (!length2) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger_default(fromIndex);
if (index < 0) {
index = nativeMax2(length2 + index, 0);
}
return baseFindIndex_default(array4, baseIteratee_default(predicate, 3), index);
}
var nativeMax2, findIndex_default;
var init_findIndex = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/findIndex.js"() {
"use strict";
init_baseFindIndex();
init_baseIteratee();
init_toInteger();
nativeMax2 = Math.max;
__name(findIndex, "findIndex");
findIndex_default = findIndex;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/find.js
var find2, find_default2;
var init_find2 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/find.js"() {
"use strict";
init_createFind();
init_findIndex();
find2 = createFind_default(findIndex_default);
find_default2 = find2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/head.js
function head(array4) {
return array4 && array4.length ? array4[0] : void 0;
}
var head_default;
var init_head = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/head.js"() {
"use strict";
__name(head, "head");
head_default = head;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/first.js
var init_first = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/first.js"() {
"use strict";
init_head();
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMap.js
function baseMap(collection4, iteratee) {
var index = -1, result = isArrayLike_default(collection4) ? Array(collection4.length) : [];
baseEach_default(collection4, function(value2, key, collection5) {
result[++index] = iteratee(value2, key, collection5);
});
return result;
}
var baseMap_default;
var init_baseMap = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMap.js"() {
"use strict";
init_baseEach();
init_isArrayLike();
__name(baseMap, "baseMap");
baseMap_default = baseMap;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/map.js
function map3(collection4, iteratee) {
var func = isArray_default(collection4) ? arrayMap_default : baseMap_default;
return func(collection4, baseIteratee_default(iteratee, 3));
}
var map_default;
var init_map = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/map.js"() {
"use strict";
init_arrayMap();
init_baseIteratee();
init_baseMap();
init_isArray();
__name(map3, "map");
map_default = map3;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatMap.js
function flatMap(collection4, iteratee) {
return baseFlatten_default(map_default(collection4, iteratee), 1);
}
var flatMap_default;
var init_flatMap = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatMap.js"() {
"use strict";
init_baseFlatten();
init_map();
__name(flatMap, "flatMap");
flatMap_default = flatMap;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forIn.js
function forIn(object3, iteratee) {
return object3 == null ? object3 : baseFor_default(object3, castFunction_default(iteratee), keysIn_default);
}
var forIn_default;
var init_forIn = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forIn.js"() {
"use strict";
init_baseFor();
init_castFunction();
init_keysIn();
__name(forIn, "forIn");
forIn_default = forIn;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forOwn.js
function forOwn(object3, iteratee) {
return object3 && baseForOwn_default(object3, castFunction_default(iteratee));
}
var forOwn_default;
var init_forOwn = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forOwn.js"() {
"use strict";
init_baseForOwn();
init_castFunction();
__name(forOwn, "forOwn");
forOwn_default = forOwn;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/groupBy.js
var objectProto19, hasOwnProperty16, groupBy, groupBy_default;
var init_groupBy = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/groupBy.js"() {
"use strict";
init_baseAssignValue();
init_createAggregator();
objectProto19 = Object.prototype;
hasOwnProperty16 = objectProto19.hasOwnProperty;
groupBy = createAggregator_default(function(result, value2, key) {
if (hasOwnProperty16.call(result, key)) {
result[key].push(value2);
} else {
baseAssignValue_default(result, key, [value2]);
}
});
groupBy_default = groupBy;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGt.js
function baseGt(value2, other) {
return value2 > other;
}
var baseGt_default;
var init_baseGt = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGt.js"() {
"use strict";
__name(baseGt, "baseGt");
baseGt_default = baseGt;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHas.js
function baseHas(object3, key) {
return object3 != null && hasOwnProperty17.call(object3, key);
}
var objectProto20, hasOwnProperty17, baseHas_default;
var init_baseHas = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHas.js"() {
"use strict";
objectProto20 = Object.prototype;
hasOwnProperty17 = objectProto20.hasOwnProperty;
__name(baseHas, "baseHas");
baseHas_default = baseHas;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/has.js
function has(object3, path4) {
return object3 != null && hasPath_default(object3, path4, baseHas_default);
}
var has_default;
var init_has = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/has.js"() {
"use strict";
init_baseHas();
init_hasPath();
__name(has, "has");
has_default = has;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isString.js
function isString(value2) {
return typeof value2 == "string" || !isArray_default(value2) && isObjectLike_default(value2) && baseGetTag_default(value2) == stringTag5;
}
var stringTag5, isString_default;
var init_isString = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isString.js"() {
"use strict";
init_baseGetTag();
init_isArray();
init_isObjectLike();
stringTag5 = "[object String]";
__name(isString, "isString");
isString_default = isString;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseValues.js
function baseValues(object3, props) {
return arrayMap_default(props, function(key) {
return object3[key];
});
}
var baseValues_default;
var init_baseValues = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseValues.js"() {
"use strict";
init_arrayMap();
__name(baseValues, "baseValues");
baseValues_default = baseValues;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/values.js
function values(object3) {
return object3 == null ? [] : baseValues_default(object3, keys_default(object3));
}
var values_default;
var init_values = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/values.js"() {
"use strict";
init_baseValues();
init_keys();
__name(values, "values");
values_default = values;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/includes.js
function includes(collection4, value2, fromIndex, guard) {
collection4 = isArrayLike_default(collection4) ? collection4 : values_default(collection4);
fromIndex = fromIndex && !guard ? toInteger_default(fromIndex) : 0;
var length2 = collection4.length;
if (fromIndex < 0) {
fromIndex = nativeMax3(length2 + fromIndex, 0);
}
return isString_default(collection4) ? fromIndex <= length2 && collection4.indexOf(value2, fromIndex) > -1 : !!length2 && baseIndexOf_default(collection4, value2, fromIndex) > -1;
}
var nativeMax3, includes_default;
var init_includes = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/includes.js"() {
"use strict";
init_baseIndexOf();
init_isArrayLike();
init_isString();
init_toInteger();
init_values();
nativeMax3 = Math.max;
__name(includes, "includes");
includes_default = includes;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/indexOf.js
function indexOf(array4, value2, fromIndex) {
var length2 = array4 == null ? 0 : array4.length;
if (!length2) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger_default(fromIndex);
if (index < 0) {
index = nativeMax4(length2 + index, 0);
}
return baseIndexOf_default(array4, value2, index);
}
var nativeMax4, indexOf_default;
var init_indexOf = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/indexOf.js"() {
"use strict";
init_baseIndexOf();
init_toInteger();
nativeMax4 = Math.max;
__name(indexOf, "indexOf");
indexOf_default = indexOf;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isEmpty.js
function isEmpty(value2) {
if (value2 == null) {
return true;
}
if (isArrayLike_default(value2) && (isArray_default(value2) || typeof value2 == "string" || typeof value2.splice == "function" || isBuffer_default(value2) || isTypedArray_default(value2) || isArguments_default(value2))) {
return !value2.length;
}
var tag = getTag_default(value2);
if (tag == mapTag7 || tag == setTag7) {
return !value2.size;
}
if (isPrototype_default(value2)) {
return !baseKeys_default(value2).length;
}
for (var key in value2) {
if (hasOwnProperty18.call(value2, key)) {
return false;
}
}
return true;
}
var mapTag7, setTag7, objectProto21, hasOwnProperty18, isEmpty_default;
var init_isEmpty = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isEmpty.js"() {
"use strict";
init_baseKeys();
init_getTag();
init_isArguments();
init_isArray();
init_isArrayLike();
init_isBuffer();
init_isPrototype();
init_isTypedArray();
mapTag7 = "[object Map]";
setTag7 = "[object Set]";
objectProto21 = Object.prototype;
hasOwnProperty18 = objectProto21.hasOwnProperty;
__name(isEmpty, "isEmpty");
isEmpty_default = isEmpty;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsRegExp.js
function baseIsRegExp(value2) {
return isObjectLike_default(value2) && baseGetTag_default(value2) == regexpTag5;
}
var regexpTag5, baseIsRegExp_default;
var init_baseIsRegExp = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsRegExp.js"() {
"use strict";
init_baseGetTag();
init_isObjectLike();
regexpTag5 = "[object RegExp]";
__name(baseIsRegExp, "baseIsRegExp");
baseIsRegExp_default = baseIsRegExp;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isRegExp.js
var nodeIsRegExp, isRegExp, isRegExp_default;
var init_isRegExp = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isRegExp.js"() {
"use strict";
init_baseIsRegExp();
init_baseUnary();
init_nodeUtil();
nodeIsRegExp = nodeUtil_default && nodeUtil_default.isRegExp;
isRegExp = nodeIsRegExp ? baseUnary_default(nodeIsRegExp) : baseIsRegExp_default;
isRegExp_default = isRegExp;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isUndefined.js
function isUndefined(value2) {
return value2 === void 0;
}
var isUndefined_default;
var init_isUndefined = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isUndefined.js"() {
"use strict";
__name(isUndefined, "isUndefined");
isUndefined_default = isUndefined;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseLt.js
function baseLt(value2, other) {
return value2 < other;
}
var baseLt_default;
var init_baseLt = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseLt.js"() {
"use strict";
__name(baseLt, "baseLt");
baseLt_default = baseLt;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/mapValues.js
function mapValues(object3, iteratee) {
var result = {};
iteratee = baseIteratee_default(iteratee, 3);
baseForOwn_default(object3, function(value2, key, object4) {
baseAssignValue_default(result, key, iteratee(value2, key, object4));
});
return result;
}
var mapValues_default;
var init_mapValues = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/mapValues.js"() {
"use strict";
init_baseAssignValue();
init_baseForOwn();
init_baseIteratee();
__name(mapValues, "mapValues");
mapValues_default = mapValues;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseExtremum.js
function baseExtremum(array4, iteratee, comparator) {
var index = -1, length2 = array4.length;
while (++index < length2) {
var value2 = array4[index], current = iteratee(value2);
if (current != null && (computed === void 0 ? current === current && !isSymbol_default(current) : comparator(current, computed))) {
var computed = current, result = value2;
}
}
return result;
}
var baseExtremum_default;
var init_baseExtremum = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseExtremum.js"() {
"use strict";
init_isSymbol();
__name(baseExtremum, "baseExtremum");
baseExtremum_default = baseExtremum;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/max.js
function max4(array4) {
return array4 && array4.length ? baseExtremum_default(array4, identity_default4, baseGt_default) : void 0;
}
var max_default;
var init_max2 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/max.js"() {
"use strict";
init_baseExtremum();
init_baseGt();
init_identity4();
__name(max4, "max");
max_default = max4;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/min.js
function min4(array4) {
return array4 && array4.length ? baseExtremum_default(array4, identity_default4, baseLt_default) : void 0;
}
var min_default;
var init_min2 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/min.js"() {
"use strict";
init_baseExtremum();
init_baseLt();
init_identity4();
__name(min4, "min");
min_default = min4;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/minBy.js
function minBy(array4, iteratee) {
return array4 && array4.length ? baseExtremum_default(array4, baseIteratee_default(iteratee, 2), baseLt_default) : void 0;
}
var minBy_default;
var init_minBy = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/minBy.js"() {
"use strict";
init_baseExtremum();
init_baseIteratee();
init_baseLt();
__name(minBy, "minBy");
minBy_default = minBy;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/negate.js
function negate(predicate) {
if (typeof predicate != "function") {
throw new TypeError(FUNC_ERROR_TEXT2);
}
return function() {
var args = arguments;
switch (args.length) {
case 0:
return !predicate.call(this);
case 1:
return !predicate.call(this, args[0]);
case 2:
return !predicate.call(this, args[0], args[1]);
case 3:
return !predicate.call(this, args[0], args[1], args[2]);
}
return !predicate.apply(this, args);
};
}
var FUNC_ERROR_TEXT2, negate_default;
var init_negate = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/negate.js"() {
"use strict";
FUNC_ERROR_TEXT2 = "Expected a function";
__name(negate, "negate");
negate_default = negate;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSet.js
function baseSet(object3, path4, value2, customizer) {
if (!isObject_default(object3)) {
return object3;
}
path4 = castPath_default(path4, object3);
var index = -1, length2 = path4.length, lastIndex = length2 - 1, nested = object3;
while (nested != null && ++index < length2) {
var key = toKey_default(path4[index]), newValue = value2;
if (key === "__proto__" || key === "constructor" || key === "prototype") {
return object3;
}
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : void 0;
if (newValue === void 0) {
newValue = isObject_default(objValue) ? objValue : isIndex_default(path4[index + 1]) ? [] : {};
}
}
assignValue_default(nested, key, newValue);
nested = nested[key];
}
return object3;
}
var baseSet_default;
var init_baseSet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSet.js"() {
"use strict";
init_assignValue();
init_castPath();
init_isIndex();
init_isObject();
init_toKey();
__name(baseSet, "baseSet");
baseSet_default = baseSet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePickBy.js
function basePickBy(object3, paths, predicate) {
var index = -1, length2 = paths.length, result = {};
while (++index < length2) {
var path4 = paths[index], value2 = baseGet_default(object3, path4);
if (predicate(value2, path4)) {
baseSet_default(result, castPath_default(path4, object3), value2);
}
}
return result;
}
var basePickBy_default;
var init_basePickBy = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePickBy.js"() {
"use strict";
init_baseGet();
init_baseSet();
init_castPath();
__name(basePickBy, "basePickBy");
basePickBy_default = basePickBy;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pickBy.js
function pickBy(object3, predicate) {
if (object3 == null) {
return {};
}
var props = arrayMap_default(getAllKeysIn_default(object3), function(prop) {
return [prop];
});
predicate = baseIteratee_default(predicate);
return basePickBy_default(object3, props, function(value2, path4) {
return predicate(value2, path4[0]);
});
}
var pickBy_default;
var init_pickBy = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pickBy.js"() {
"use strict";
init_arrayMap();
init_baseIteratee();
init_basePickBy();
init_getAllKeysIn();
__name(pickBy, "pickBy");
pickBy_default = pickBy;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSortBy.js
function baseSortBy(array4, comparer) {
var length2 = array4.length;
array4.sort(comparer);
while (length2--) {
array4[length2] = array4[length2].value;
}
return array4;
}
var baseSortBy_default;
var init_baseSortBy = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSortBy.js"() {
"use strict";
__name(baseSortBy, "baseSortBy");
baseSortBy_default = baseSortBy;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareAscending.js
function compareAscending(value2, other) {
if (value2 !== other) {
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) {
return 1;
}
if (!valIsNull && !valIsSymbol && !othIsSymbol && value2 < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
return -1;
}
}
return 0;
}
var compareAscending_default;
var init_compareAscending = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareAscending.js"() {
"use strict";
init_isSymbol();
__name(compareAscending, "compareAscending");
compareAscending_default = compareAscending;
}
});
// ../../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;
while (++index < length2) {
var result = compareAscending_default(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order2 = orders[index];
return result * (order2 == "desc" ? -1 : 1);
}
}
return object3.index - other.index;
}
var compareMultiple_default;
var init_compareMultiple = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareMultiple.js"() {
"use strict";
init_compareAscending();
__name(compareMultiple, "compareMultiple");
compareMultiple_default = compareMultiple;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseOrderBy.js
function baseOrderBy(collection4, iteratees, orders) {
if (iteratees.length) {
iteratees = arrayMap_default(iteratees, function(iteratee) {
if (isArray_default(iteratee)) {
return function(value2) {
return baseGet_default(value2, iteratee.length === 1 ? iteratee[0] : iteratee);
};
}
return iteratee;
});
} else {
iteratees = [identity_default4];
}
var index = -1;
iteratees = arrayMap_default(iteratees, baseUnary_default(baseIteratee_default));
var result = baseMap_default(collection4, function(value2, key, collection5) {
var criteria = arrayMap_default(iteratees, function(iteratee) {
return iteratee(value2);
});
return { "criteria": criteria, "index": ++index, "value": value2 };
});
return baseSortBy_default(result, function(object3, other) {
return compareMultiple_default(object3, other, orders);
});
}
var baseOrderBy_default;
var init_baseOrderBy = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseOrderBy.js"() {
"use strict";
init_arrayMap();
init_baseGet();
init_baseIteratee();
init_baseMap();
init_baseSortBy();
init_baseUnary();
init_compareMultiple();
init_identity4();
init_isArray();
__name(baseOrderBy, "baseOrderBy");
baseOrderBy_default = baseOrderBy;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiSize.js
var asciiSize, asciiSize_default;
var init_asciiSize = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiSize.js"() {
"use strict";
init_baseProperty();
asciiSize = baseProperty_default("length");
asciiSize_default = asciiSize;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeSize.js
function unicodeSize(string3) {
var result = reUnicode.lastIndex = 0;
while (reUnicode.test(string3)) {
++result;
}
return result;
}
var rsAstralRange2, rsComboMarksRange2, reComboHalfMarksRange2, rsComboSymbolsRange2, rsComboRange2, rsVarRange2, rsAstral, rsCombo, rsFitz, rsModifier, rsNonAstral, rsRegional, rsSurrPair, rsZWJ2, reOptMod, rsOptVar, rsOptJoin, rsSeq, rsSymbol, reUnicode, unicodeSize_default;
var init_unicodeSize = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeSize.js"() {
"use strict";
rsAstralRange2 = "\\ud800-\\udfff";
rsComboMarksRange2 = "\\u0300-\\u036f";
reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
rsComboSymbolsRange2 = "\\u20d0-\\u20ff";
rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2;
rsVarRange2 = "\\ufe0e\\ufe0f";
rsAstral = "[" + rsAstralRange2 + "]";
rsCombo = "[" + rsComboRange2 + "]";
rsFitz = "\\ud83c[\\udffb-\\udfff]";
rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
rsNonAstral = "[^" + rsAstralRange2 + "]";
rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
rsZWJ2 = "\\u200d";
reOptMod = rsModifier + "?";
rsOptVar = "[" + rsVarRange2 + "]?";
rsOptJoin = "(?:" + rsZWJ2 + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
rsSeq = rsOptVar + reOptMod + rsOptJoin;
rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
__name(unicodeSize, "unicodeSize");
unicodeSize_default = unicodeSize;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringSize.js
function stringSize(string3) {
return hasUnicode_default(string3) ? unicodeSize_default(string3) : asciiSize_default(string3);
}
var stringSize_default;
var init_stringSize = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringSize.js"() {
"use strict";
init_asciiSize();
init_hasUnicode();
init_unicodeSize();
__name(stringSize, "stringSize");
stringSize_default = stringSize;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePick.js
function basePick(object3, paths) {
return basePickBy_default(object3, paths, function(value2, path4) {
return hasIn_default(object3, path4);
});
}
var basePick_default;
var init_basePick = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePick.js"() {
"use strict";
init_basePickBy();
init_hasIn();
__name(basePick, "basePick");
basePick_default = basePick;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pick.js
var pick, pick_default;
var init_pick = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pick.js"() {
"use strict";
init_basePick();
init_flatRest();
pick = flatRest_default(function(object3, paths) {
return object3 == null ? {} : basePick_default(object3, paths);
});
pick_default = pick;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRange.js
function baseRange(start3, end2, step3, fromRight) {
var index = -1, length2 = nativeMax5(nativeCeil((end2 - start3) / (step3 || 1)), 0), result = Array(length2);
while (length2--) {
result[fromRight ? length2 : ++index] = start3;
start3 += step3;
}
return result;
}
var nativeCeil, nativeMax5, baseRange_default;
var init_baseRange = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRange.js"() {
"use strict";
nativeCeil = Math.ceil;
nativeMax5 = Math.max;
__name(baseRange, "baseRange");
baseRange_default = baseRange;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createRange.js
function createRange(fromRight) {
return function(start3, end2, step3) {
if (step3 && typeof step3 != "number" && isIterateeCall_default(start3, end2, step3)) {
end2 = step3 = void 0;
}
start3 = toFinite_default(start3);
if (end2 === void 0) {
end2 = start3;
start3 = 0;
} else {
end2 = toFinite_default(end2);
}
step3 = step3 === void 0 ? start3 < end2 ? 1 : -1 : toFinite_default(step3);
return baseRange_default(start3, end2, step3, fromRight);
};
}
var createRange_default;
var init_createRange = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createRange.js"() {
"use strict";
init_baseRange();
init_isIterateeCall();
init_toFinite();
__name(createRange, "createRange");
createRange_default = createRange;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/range.js
var range2, range_default;
var init_range2 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/range.js"() {
"use strict";
init_createRange();
range2 = createRange_default();
range_default = range2;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseReduce.js
function baseReduce(collection4, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection4, function(value2, index, collection5) {
accumulator = initAccum ? (initAccum = false, value2) : iteratee(accumulator, value2, index, collection5);
});
return accumulator;
}
var baseReduce_default;
var init_baseReduce = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseReduce.js"() {
"use strict";
__name(baseReduce, "baseReduce");
baseReduce_default = baseReduce;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reduce.js
function reduce(collection4, iteratee, accumulator) {
var func = isArray_default(collection4) ? arrayReduce_default : baseReduce_default, initAccum = arguments.length < 3;
return func(collection4, baseIteratee_default(iteratee, 4), accumulator, initAccum, baseEach_default);
}
var reduce_default;
var init_reduce = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reduce.js"() {
"use strict";
init_arrayReduce();
init_baseEach();
init_baseIteratee();
init_baseReduce();
init_isArray();
__name(reduce, "reduce");
reduce_default = reduce;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reject.js
function reject(collection4, predicate) {
var func = isArray_default(collection4) ? arrayFilter_default : baseFilter_default;
return func(collection4, negate_default(baseIteratee_default(predicate, 3)));
}
var reject_default;
var init_reject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reject.js"() {
"use strict";
init_arrayFilter();
init_baseFilter();
init_baseIteratee();
init_isArray();
init_negate();
__name(reject, "reject");
reject_default = reject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/size.js
function size(collection4) {
if (collection4 == null) {
return 0;
}
if (isArrayLike_default(collection4)) {
return isString_default(collection4) ? stringSize_default(collection4) : collection4.length;
}
var tag = getTag_default(collection4);
if (tag == mapTag8 || tag == setTag8) {
return collection4.size;
}
return baseKeys_default(collection4).length;
}
var mapTag8, setTag8, size_default2;
var init_size3 = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/size.js"() {
"use strict";
init_baseKeys();
init_getTag();
init_isArrayLike();
init_isString();
init_stringSize();
mapTag8 = "[object Map]";
setTag8 = "[object Set]";
__name(size, "size");
size_default2 = size;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSome.js
function baseSome(collection4, predicate) {
var result;
baseEach_default(collection4, function(value2, index, collection5) {
result = predicate(value2, index, collection5);
return !result;
});
return !!result;
}
var baseSome_default;
var init_baseSome = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSome.js"() {
"use strict";
init_baseEach();
__name(baseSome, "baseSome");
baseSome_default = baseSome;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/some.js
function some(collection4, predicate, guard) {
var func = isArray_default(collection4) ? arraySome_default : baseSome_default;
if (guard && isIterateeCall_default(collection4, predicate, guard)) {
predicate = void 0;
}
return func(collection4, baseIteratee_default(predicate, 3));
}
var some_default;
var init_some = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/some.js"() {
"use strict";
init_arraySome();
init_baseIteratee();
init_baseSome();
init_isArray();
init_isIterateeCall();
__name(some, "some");
some_default = some;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/sortBy.js
var sortBy, sortBy_default;
var init_sortBy = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/sortBy.js"() {
"use strict";
init_baseFlatten();
init_baseOrderBy();
init_baseRest();
init_isIterateeCall();
sortBy = baseRest_default(function(collection4, iteratees) {
if (collection4 == null) {
return [];
}
var length2 = iteratees.length;
if (length2 > 1 && isIterateeCall_default(collection4, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length2 > 2 && isIterateeCall_default(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy_default(collection4, baseFlatten_default(iteratees, 1), []);
});
sortBy_default = sortBy;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.js
var INFINITY4, createSet, createSet_default;
var init_createSet = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.js"() {
"use strict";
init_Set();
init_noop2();
init_setToArray();
INFINITY4 = 1 / 0;
createSet = !(Set_default && 1 / setToArray_default(new Set_default([, -0]))[1] == INFINITY4) ? noop_default2 : function(values2) {
return new Set_default(values2);
};
createSet_default = createSet;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.js
function baseUniq(array4, iteratee, comparator) {
var index = -1, includes3 = arrayIncludes_default, length2 = array4.length, isCommon = true, result = [], seen = result;
if (comparator) {
isCommon = false;
includes3 = arrayIncludesWith_default;
} else if (length2 >= LARGE_ARRAY_SIZE3) {
var set5 = iteratee ? null : createSet_default(array4);
if (set5) {
return setToArray_default(set5);
}
isCommon = false;
includes3 = cacheHas_default;
seen = new SetCache_default();
} else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length2) {
var value2 = array4[index], computed = iteratee ? iteratee(value2) : value2;
value2 = comparator || value2 !== 0 ? value2 : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value2);
} else if (!includes3(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value2);
}
}
return result;
}
var LARGE_ARRAY_SIZE3, baseUniq_default;
var init_baseUniq = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.js"() {
"use strict";
init_SetCache();
init_arrayIncludes();
init_arrayIncludesWith();
init_cacheHas();
init_createSet();
init_setToArray();
LARGE_ARRAY_SIZE3 = 200;
__name(baseUniq, "baseUniq");
baseUniq_default = baseUniq;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/union.js
var union, union_default;
var init_union = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/union.js"() {
"use strict";
init_baseFlatten();
init_baseRest();
init_baseUniq();
init_isArrayLikeObject();
union = baseRest_default(function(arrays) {
return baseUniq_default(baseFlatten_default(arrays, 1, isArrayLikeObject_default, true));
});
union_default = union;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniq.js
function uniq(array4) {
return array4 && array4.length ? baseUniq_default(array4) : [];
}
var uniq_default;
var init_uniq = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniq.js"() {
"use strict";
init_baseUniq();
__name(uniq, "uniq");
uniq_default = uniq;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqBy.js
function uniqBy(array4, iteratee) {
return array4 && array4.length ? baseUniq_default(array4, baseIteratee_default(iteratee, 2)) : [];
}
var uniqBy_default;
var init_uniqBy = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqBy.js"() {
"use strict";
init_baseIteratee();
init_baseUniq();
__name(uniqBy, "uniqBy");
uniqBy_default = uniqBy;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqueId.js
function uniqueId(prefix) {
var id30 = ++idCounter;
return toString_default(prefix) + id30;
}
var idCounter, uniqueId_default;
var init_uniqueId = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqueId.js"() {
"use strict";
init_toString();
idCounter = 0;
__name(uniqueId, "uniqueId");
uniqueId_default = uniqueId;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseZipObject.js
function baseZipObject(props, values2, assignFunc) {
var index = -1, length2 = props.length, valsLength = values2.length, result = {};
while (++index < length2) {
var value2 = index < valsLength ? values2[index] : void 0;
assignFunc(result, props[index], value2);
}
return result;
}
var baseZipObject_default;
var init_baseZipObject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseZipObject.js"() {
"use strict";
__name(baseZipObject, "baseZipObject");
baseZipObject_default = baseZipObject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/zipObject.js
function zipObject(props, values2) {
return baseZipObject_default(props || [], values2 || [], assignValue_default);
}
var zipObject_default;
var init_zipObject = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/zipObject.js"() {
"use strict";
init_assignValue();
init_baseZipObject();
__name(zipObject, "zipObject");
zipObject_default = zipObject;
}
});
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/lodash.js
var init_lodash = __esm({
"../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/lodash.js"() {
"use strict";
init_assign();
init_clone2();
init_cloneDeep();
init_compact();
init_constant8();
init_defaults3();
init_difference();
init_drop();
init_dropRight();
init_each3();
init_every();
init_filter3();
init_find2();
init_first();
init_flatMap();
init_flatten();
init_forEach();
init_forIn();
init_forOwn();
init_groupBy();
init_has();
init_identity4();
init_includes();
init_indexOf();
init_isArray();
init_isEmpty();
init_isFunction();
init_isObject();
init_isRegExp();
init_isString();
init_isUndefined();
init_keys();
init_last();
init_map();
init_mapValues();
init_max2();
init_merge4();
init_min2();
init_minBy();
init_noop2();
init_now();
init_pick();
init_pickBy();
init_range2();
init_reduce();
init_reject();
init_size3();
init_some();
init_sortBy();
init_union();
init_uniq();
init_uniqueId();
init_values();
init_zipObject();
}
});
// ../../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]++;
} else {
map5[k2] = 1;
}
}
function decrementOrRemoveEntry(map5, k2) {
if (!--map5[k2]) {
delete map5[k2];
}
}
function edgeArgsToId(isDirected, v_, w_, name) {
var v3 = "" + v_;
var w4 = "" + w_;
if (!isDirected && v3 > w4) {
var tmp = v3;
v3 = w4;
w4 = tmp;
}
return v3 + EDGE_KEY_DELIM + w4 + EDGE_KEY_DELIM + (isUndefined_default(name) ? DEFAULT_EDGE_NAME : name);
}
function edgeArgsToObj(isDirected, v_, w_, name) {
var v3 = "" + v_;
var w4 = "" + w_;
if (!isDirected && v3 > w4) {
var tmp = v3;
v3 = w4;
w4 = tmp;
}
var edgeObj = { v: v3, w: w4 };
if (name) {
edgeObj.name = name;
}
return edgeObj;
}
function edgeObjToId(isDirected, edgeObj) {
return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);
}
var DEFAULT_EDGE_NAME, GRAPH_NODE, EDGE_KEY_DELIM, Graph;
var init_graph = __esm({
"../../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";
GRAPH_NODE = "\0";
EDGE_KEY_DELIM = "