UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

1,268 lines (1,242 loc) 6.43 MB
"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.1/node_modules/@iconify/utils/lib/icon/defaults.js var defaultIconDimensions, defaultIconTransformations, defaultIconProps, defaultExtendedIconProps; var init_defaults = __esm({ "../../node_modules/.pnpm/@iconify+utils@3.0.1/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.1/node_modules/@iconify/utils/lib/customisations/defaults.js var defaultIconSizeCustomisations, defaultIconCustomisations; var init_defaults2 = __esm({ "../../node_modules/.pnpm/@iconify+utils@3.0.1/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.1/node_modules/@iconify/utils/lib/icon/name.js var stringToIcon, validateIconName; var init_name = __esm({ "../../node_modules/.pnpm/@iconify+utils@3.0.1/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.1/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.1/node_modules/@iconify/utils/lib/icon/transformations.js"() { "use strict"; __name(mergeIconTransformations, "mergeIconTransformations"); } }); // ../../node_modules/.pnpm/@iconify+utils@3.0.1/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.1/node_modules/@iconify/utils/lib/icon/merge.js"() { "use strict"; init_defaults(); init_transformations(); __name(mergeIconData, "mergeIconData"); } }); // ../../node_modules/.pnpm/@iconify+utils@3.0.1/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 resolve3(name) { if (icons[name]) return resolved[name] = []; if (!(name in resolved)) { resolved[name] = null; const parent4 = aliases[name] && aliases[name].parent; const value2 = parent4 && resolve3(parent4); if (value2) resolved[name] = [parent4].concat(value2); } return resolved[name]; } __name(resolve3, "resolve"); (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve3); return resolved; } var init_tree = __esm({ "../../node_modules/.pnpm/@iconify+utils@3.0.1/node_modules/@iconify/utils/lib/icon-set/tree.js"() { "use strict"; __name(getIconsTree, "getIconsTree"); } }); // ../../node_modules/.pnpm/@iconify+utils@3.0.1/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.1/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.1/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.1/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.1/node_modules/@iconify/utils/lib/svg/defs.js function splitSVGDefs(content, tag2 = "defs") { let defs2 = ""; const index = content.indexOf("<" + tag2); while (index >= 0) { const start3 = content.indexOf(">", index); const end2 = content.indexOf("</" + tag2); 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 ? "<defs>" + defs2 + "</defs>" + 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.1/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.1/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, '<g transform="' + transformations.join(" ") + '">', "</g>"); }); 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.1/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.1/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.1/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.1/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 '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>"; } var init_html = __esm({ "../../node_modules/.pnpm/@iconify+utils@3.0.1/node_modules/@iconify/utils/lib/svg/html.js"() { "use strict"; __name(iconToHTML, "iconToHTML"); } }); // ../../node_modules/.pnpm/@iconify+utils@3.0.1/node_modules/@iconify/utils/lib/index.js var init_lib = __esm({ "../../node_modules/.pnpm/@iconify+utils@3.0.1/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.13/node_modules/dayjs/dayjs.min.js var require_dayjs_min = __commonJS({ "../../node_modules/.pnpm/dayjs@1.11.13/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", h2 = "year", d2 = "date", l2 = "Invalid Date", $3 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y5 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: /* @__PURE__ */ __name(function(t5) { var e4 = ["th", "st", "nd", "rd"], n3 = t5 % 100; return "[" + t5 + (e4[(n3 - 20) % 10] || e4[n3] || e4[0]) + "]"; }, "ordinal") }, m2 = /* @__PURE__ */ __name(function(t5, e4, n3) { var r3 = String(t5); return !r3 || r3.length >= e4 ? t5 : "" + Array(e4 + 1 - r3.length).join(n3) + t5; }, "m"), v3 = { s: m2, z: /* @__PURE__ */ __name(function(t5) { var e4 = -t5.utcOffset(), n3 = Math.abs(e4), r3 = Math.floor(n3 / 60), i3 = n3 % 60; return (e4 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(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: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t5] || String(t5 || "").toLowerCase().replace(/s$/, ""); }, "p"), u: /* @__PURE__ */ __name(function(t5) { return void 0 === t5; }, "u") }, g2 = "en", D3 = {}; D3[g2] = M2; var p3 = "$isDayjsObject", S3 = /* @__PURE__ */ __name(function(t5) { return t5 instanceof _2 || !(!t5 || !t5[p3]); }, "S"), w3 = /* @__PURE__ */ __name(function t5(e4, n3, r3) { var i3; if (!e4) return g2; if ("string" == typeof e4) { var s3 = e4.toLowerCase(); D3[s3] && (i3 = s3), n3 && (D3[s3] = n3, i3 = s3); var u3 = e4.split("-"); if (!i3 && u3.length > 1) return t5(u3[0]); } else { var a3 = e4.name; D3[a3] = e4, i3 = a3; } return !r3 && i3 && (g2 = i3), i3 || !r3 && g2; }, "t"), O2 = /* @__PURE__ */ __name(function(t5, e4) { if (S3(t5)) return t5.clone(); var n3 = "object" == typeof e4 ? e4 : {}; return n3.date = t5, n3.args = arguments, new _2(n3); }, "O"), b2 = v3; b2.l = w3, b2.i = S3, b2.w = function(t5, e4) { return O2(t5, { locale: e4.$L, utc: e4.$u, x: e4.$x, $offset: e4.$offset }); }; var _2 = function() { function M3(t5) { this.$L = w3(t5.locale, null, true), this.parse(t5), this.$x = this.$x || t5.x || {}, this[p3] = true; } __name(M3, "M"); var m3 = M3.prototype; return m3.parse = function(t5) { this.$d = function(t6) { var e4 = t6.date, n3 = t6.utc; if (null === e4) return /* @__PURE__ */ new Date(NaN); if (b2.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($3); 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(); }, m3.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(); }, m3.$utils = function() { return b2; }, m3.isValid = function() { return !(this.$d.toString() === l2); }, m3.isSame = function(t5, e4) { var n3 = O2(t5); return this.startOf(e4) <= n3 && n3 <= this.endOf(e4); }, m3.isAfter = function(t5, e4) { return O2(t5) < this.startOf(e4); }, m3.isBefore = function(t5, e4) { return this.endOf(e4) < O2(t5); }, m3.$g = function(t5, e4, n3) { return b2.u(t5) ? this[e4] : this.set(n3, t5); }, m3.unix = function() { return Math.floor(this.valueOf() / 1e3); }, m3.valueOf = function() { return this.$d.getTime(); }, m3.startOf = function(t5, e4) { var n3 = this, r3 = !!b2.u(e4) || e4, f3 = b2.p(t5), l3 = /* @__PURE__ */ __name(function(t6, e6) { var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e6, t6) : new Date(n3.$y, e6, t6), n3); return r3 ? i3 : i3.endOf(a2); }, "l"), $4 = /* @__PURE__ */ __name(function(t6, e6) { return b2.w(n3.toDate()[t6].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e6)), n3); }, "$"), y6 = this.$W, M4 = this.$M, m4 = this.$D, v5 = "set" + (this.$u ? "UTC" : ""); switch (f3) { case h2: return r3 ? l3(1, 0) : l3(31, 11); case c3: return r3 ? l3(1, M4) : l3(0, M4 + 1); case o2: var g3 = this.$locale().weekStart || 0, D4 = (y6 < g3 ? y6 + 7 : y6) - g3; return l3(r3 ? m4 - D4 : m4 + (6 - D4), M4); case a2: case d2: return $4(v5 + "Hours", 0); case u2: return $4(v5 + "Minutes", 1); case s2: return $4(v5 + "Seconds", 2); case i2: return $4(v5 + "Milliseconds", 3); default: return this.clone(); } }, m3.endOf = function(t5) { return this.startOf(t5, false); }, m3.$set = function(t5, e4) { var n3, o3 = b2.p(t5), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c3] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $4 = o3 === a2 ? this.$D + (e4 - this.$W) : e4; if (o3 === c3 || o3 === h2) { var y6 = this.clone().set(d2, 1); y6.$d[l3]($4), y6.init(), this.$d = y6.set(d2, Math.min(this.$D, y6.daysInMonth())).$d; } else l3 && this.$d[l3]($4); return this.init(), this; }, m3.set = function(t5, e4) { return this.clone().$set(t5, e4); }, m3.get = function(t5) { return this[b2.p(t5)](); }, m3.add = function(r3, f3) { var d3, l3 = this; r3 = Number(r3); var $4 = b2.p(f3), y6 = /* @__PURE__ */ __name(function(t5) { var e4 = O2(l3); return b2.w(e4.date(e4.date() + Math.round(t5 * r3)), l3); }, "y"); if ($4 === c3) return this.set(c3, this.$M + r3); if ($4 === h2) return this.set(h2, this.$y + r3); if ($4 === a2) return y6(1); if ($4 === o2) return y6(7); var M4 = (d3 = {}, d3[s2] = e3, d3[u2] = n2, d3[i2] = t4, d3)[$4] || 1, m4 = this.$d.getTime() + r3 * M4; return b2.w(m4, this); }, m3.subtract = function(t5, e4) { return this.add(-1 * t5, e4); }, m3.format = function(t5) { var e4 = this, n3 = this.$locale(); if (!this.isValid()) return n3.invalidDate || l2; var r3 = t5 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c4 = n3.months, f3 = n3.meridiem, h3 = /* @__PURE__ */ __name(function(t6, n4, i4, s4) { return t6 && (t6[n4] || t6(e4, r3)) || i4[n4].slice(0, s4); }, "h"), d3 = /* @__PURE__ */ __name(function(t6) { return b2.s(s3 % 12 || 12, t6, "0"); }, "d"), $4 = f3 || function(t6, e6, n4) { var r4 = t6 < 12 ? "AM" : "PM"; return n4 ? r4.toLowerCase() : r4; }; return r3.replace(y5, function(t6, r4) { return r4 || function(t7) { switch (t7) { case "YY": return String(e4.$y).slice(-2); case "YYYY": return b2.s(e4.$y, 4, "0"); case "M": return a3 + 1; case "MM": return b2.s(a3 + 1, 2, "0"); case "MMM": return h3(n3.monthsShort, a3, c4, 3); case "MMMM": return h3(c4, a3); case "D": return e4.$D; case "DD": return b2.s(e4.$D, 2, "0"); case "d": return String(e4.$W); case "dd": return h3(n3.weekdaysMin, e4.$W, o3, 2); case "ddd": return h3(n3.weekdaysShort, e4.$W, o3, 3); case "dddd": return o3[e4.$W]; case "H": return String(s3); case "HH": return b2.s(s3, 2, "0"); case "h": return d3(1); case "hh": return d3(2); case "a": return $4(s3, u3, true); case "A": return $4(s3, u3, false); case "m": return String(u3); case "mm": return b2.s(u3, 2, "0"); case "s": return String(e4.$s); case "ss": return b2.s(e4.$s, 2, "0"); case "SSS": return b2.s(e4.$ms, 3, "0"); case "Z": return i3; } return null; }(t6) || i3.replace(":", ""); }); }, m3.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m3.diff = function(r3, d3, l3) { var $4, y6 = this, M4 = b2.p(d3), m4 = O2(r3), v5 = (m4.utcOffset() - this.utcOffset()) * e3, g3 = this - m4, D4 = /* @__PURE__ */ __name(function() { return b2.m(y6, m4); }, "D"); switch (M4) { case h2: $4 = D4() / 12; break; case c3: $4 = D4(); break; case f2: $4 = D4() / 3; break; case o2: $4 = (g3 - v5) / 6048e5; break; case a2: $4 = (g3 - v5) / 864e5; break; case u2: $4 = g3 / n2; break; case s2: $4 = g3 / e3; break; case i2: $4 = g3 / t4; break; default: $4 = g3; } return l3 ? $4 : b2.a($4); }, m3.daysInMonth = function() { return this.endOf(c3).$D; }, m3.$locale = function() { return D3[this.$L]; }, m3.locale = function(t5, e4) { if (!t5) return this.$L; var n3 = this.clone(), r3 = w3(t5, e4, true); return r3 && (n3.$L = r3), n3; }, m3.clone = function() { return b2.w(this.$d, this); }, m3.toDate = function() { return new Date(this.valueOf()); }, m3.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, m3.toISOString = function() { return this.$d.toISOString(); }, m3.toString = function() { return this.$d.toUTCString(); }, M3; }(), k2 = _2.prototype; return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c3], ["$y", h2], ["$D", d2]].forEach(function(t5) { k2[t5[1]] = function(e4) { return this.$g(e4, t5[0], t5[1]); }; }), O2.extend = function(t5, e4) { return t5.$i || (t5(e4, _2, O2), t5.$i = true), O2; }, O2.locale = w3, O2.isDayjs = S3, O2.unix = function(t5) { return O2(1e3 * t5); }, O2.en = D3[g2], O2.Ls = D3, O2.p = {}, O2; }); } }); // 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((b2) => b2 >= 255 ? 255 : b2 < 0 ? 0 : b2, "b"), h: /* @__PURE__ */ __name((h2) => h2 % 360, "h"), s: /* @__PURE__ */ __name((s2) => s2 >= 100 ? 100 : s2 < 0 ? 0 : s2, "s"), l: /* @__PURE__ */ __name((l2) => l2 >= 100 ? 100 : l2 < 0 ? 0 : l2, "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, q2, t4) => { if (t4 < 0) t4 += 1; if (t4 > 1) t4 -= 1; if (t4 < 1 / 6) return p3 + (q2 - p3) * 6 * t4; if (t4 < 1 / 2) return q2; if (t4 < 2 / 3) return p3 + (q2 - p3) * (2 / 3 - t4) * 6; return p3; }, "hue2rgb"), hsl2rgb: /* @__PURE__ */ __name(({ h: h2, s: s2, l: l2 }, channel2) => { if (!s2) return l2 * 2.55; h2 /= 360; s2 /= 100; l2 /= 100; const q2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2; const p3 = 2 * l2 - q2; switch (channel2) { case "r": return Channel.hue2rgb(p3, q2, h2 + 1 / 3) * 255; case "g": return Channel.hue2rgb(p3, q2, h2) * 255; case "b": return Channel.hue2rgb(p3, q2, h2 - 1 / 3) * 255; } }, "hsl2rgb"), rgb2hsl: /* @__PURE__ */ __name(({ r: r2, g: g2, b: b2 }, channel2) => { r2 /= 255; g2 /= 255; b2 /= 255; const max10 = Math.max(r2, g2, b2); const min9 = Math.min(r2, g2, b2); const l2 = (max10 + min9) / 2; if (channel2 === "l") return l2 * 100; if (max10 === min9) return 0; const d2 = max10 - min9; const s2 = l2 > 0.5 ? d2 / (2 - max10 - min9) : d2 / (max10 + min9); if (channel2 === "s") return s2 * 100; switch (max10) { case r2: return ((g2 - b2) / d2 + (g2 < b2 ? 6 : 0)) * 60; case g2: return ((b2 - r2) / d2 + 2) * 60; case b2: return ((r2 - g2) / d2 + 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: h2, s: s2, l: l2 } = data5; if (h2 === void 0) data5.h = utils_default.channel.rgb2hsl(data5, "h"); if (s2 === void 0) data5.s = utils_default.channel.rgb2hsl(data5, "s"); if (l2 === void 0) data5.l = utils_default.channel.rgb2hsl(data5, "l"); } _ensureRGB() { const data5 = this.data; const { r: r2, g: g2, b: b2 } = 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 (b2 === 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 b2 = data5.b; if (!this.type.is(TYPE.HSL) && b2 !== void 0) return b2; this._ensureHSL(); return utils_default.channel.hsl2rgb(data5, "b"); } get h() { const data5 = this.data; const h2 = data5.h; if (!this.type.is(TYPE.RGB) && h2 !== void 0) return h2; 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 l2 = data5.l; if (!this.type.is(TYPE.RGB) && l2 !== void 0) return l2; 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(b2) { this.type.set(TYPE.RGB); this.changed = true; this.data.b = b2; } set h(h2) { this.type.set(TYPE.HSL); this.changed = true; this.data.h = h2; } set s(s2) { this.type.set(TYPE.HSL); this.changed = true; this.data.s = s2; } set l(l2) { this.type.set(TYPE.HSL); this.changed = true; this.data.l = l2; } 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: b2, a: a2 } = channels2; if (a2 < 1) { return `#${DEC2HEX[Math.round(r2)]}${DEC2HEX[Math.round(g2)]}${DEC2HEX[Math.round(b2)]}${DEC2HEX[Math.round(a2 * 255)]}`; } else { return `#${DEC2HEX[Math.round(r2)]}${DEC2HEX[Math.round(g2)]}${DEC2HEX[Math.round(b2)]}`; } }, "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.cla